code: def check_calling_sequence(name, function_name, function, possible_variables):
          
  
          # Get calling sequence
  
          # If the function has been memoized, it will have a "input_object" member
  
          try:
  
              calling_sequence = inspect.getargspec(function.input_object).args
  
          except AttributeError:
  
              # This might happen if the function is with memoization
  
              calling_sequence = inspect.getargspec(function).args
  
          assert calling_sequence[0] == 'self', "Wrong syntax for 'evaluate' in %s. The first argument " \
                                                "should be called 'self'." % name
  
          # Figure out how many variables are used
  
          variables = filter(lambda var: var in possible_variables, calling_sequence)
  
          # Check that they actually make sense. They must be used in the same order
          # as specified in possible_variables
  
          assert len(variables) > 0, "The name of the variables for 'evaluate' in %s must be one or more " \
                                     "among %s, instead of %s" % (name, ','.join(possible_variables), ",".join(variables))
  
          if variables != possible_variables[:len(variables)]:
              raise AssertionError("The variables %s are out of order in '%s' of %s. Should be %s."
                                   % (",".join(variables), function_name, name, possible_variables[:len(variables)]))
  
          other_parameters = filter(lambda var: var not in variables and var != 'self', calling_sequence)
  
          return variables, other_parameters
docs: Check the calling sequence for the function looking for the variables specified.
          One or more of the variables can be in the calling sequence. Note that the
          order of the variables will be enforced.
          It will also enforce that the first parameter in the calling sequence is called 'self'.
  
          :param function: the function to check
          :param possible_variables: a list of variables to check, The order is important, and will be enforced
          :return: a tuple containing the list of found variables, and the name of the other parameters in the calling
          sequence