Determines whether a given string of code is a single expression.This utility uses Python’s AST module to parse the code and checks if
it consists of a single expression node.Parameters:
code (str): The Python code to analyze.
Returns:bool: True if the code is a single expression, False otherwise.
Compares two Python objects for equality with optional float
tolerance.This method recursively compares nested structures (lists, tuples,
sets, and dictionaries) and applies floating point tolerance when
comparing numerical values. If no float tolerance is set, a runtime
error is raised.Parameters:
a (Any): First value to compare.
b (Any): Second value to compare.
Returns:bool: True if the values are considered equal within the
specified float tolerance; False otherwise.