code: def get_variables(expression, variables=None):
      
      if variables is None:
          variables = set()
      if hasattr(expression, 'variable_name') and expression.variable_name is not None:
          variables.add(expression.variable_name)
      if isinstance(expression, Operation):
          for operand in op_iter(expression):
              get_variables(operand, variables)
      return variables
docs: Returns the set of variable names in the given expression.