nodes: 0, module; 1, function_definition; 2, function_name:seperate_symbols; 3, parameters; 4, block; 5, identifier:func; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, for_statement; 11, expression_statement; 12, expression_statement; 13, return_statement; 14, comment:"""
      Seperate the symbols in symbolic function func. Return them in alphabetical
      order.
  
      :param func: scipy symbolic function.
      :return: (vars, params), a tuple of all variables and parameters, each 
          sorted in alphabetical order.
      :raises TypeError: only symfit Variable and Parameter are allowed, not sympy
          Symbols.
      """; 15, assignment; 16, assignment; 17, identifier:symbol; 18, attribute; 19, block; 20, identifier:der; 21, call; 22, comment:# Used by jacobians and hessians, where derivatives are treated as; 23, comment:# Variables. This way of writing it is purposefully discriminatory; 24, comment:# against derivatives wrt variables, since such derivatives should be; 25, comment:# performed explicitly in the case of jacs/hess, and are treated; 26, comment:# differently in the case of ODEModels.; 27, block; 28, call; 29, call; 30, expression_list; 31, identifier:params; 32, list; 33, identifier:vars; 34, list; 35, identifier:func; 36, identifier:free_symbols; 37, if_statement; 38, if_statement; 39, attribute; 40, argument_list; 41, if_statement; 42, attribute; 43, argument_list; 44, attribute; 45, argument_list; 46, identifier:vars; 47, identifier:params; 48, not_operator; 49, block; 50, call; 51, block; 52, elif_clause; 53, elif_clause; 54, else_clause; 55, identifier:func; 56, identifier:atoms; 57, attribute; 58, boolean_operator; 59, block; 60, identifier:params; 61, identifier:sort; 62, keyword_argument; 63, identifier:vars; 64, identifier:sort; 65, keyword_argument; 66, call; 67, continue_statement; 68, comment:# E.g. Indexed objects might print to A[i, j]; 69, identifier:isinstance; 70, argument_list; 71, expression_statement; 72, call; 73, comment:# Idx objects are not seen as parameters or vars.; 74, block; 75, call; 76, block; 77, block; 78, identifier:sympy; 79, identifier:Derivative; 80, comparison_operator:der.expr in vars; 81, call; 82, expression_statement; 83, identifier:key; 84, lambda; 85, identifier:key; 86, lambda; 87, identifier:isidentifier; 88, argument_list; 89, identifier:symbol; 90, identifier:Parameter; 91, call; 92, identifier:isinstance; 93, argument_list; 94, pass_statement; 95, identifier:isinstance; 96, argument_list; 97, expression_statement; 98, raise_statement; 99, attribute; 100, identifier:vars; 101, identifier:all; 102, generator_expression; 103, call; 104, lambda_parameters; 105, attribute; 106, lambda_parameters; 107, attribute; 108, call; 109, attribute; 110, argument_list; 111, identifier:symbol; 112, identifier:Idx; 113, identifier:symbol; 114, tuple; 115, call; 116, call; 117, identifier:der; 118, identifier:expr; 119, call; 120, for_in_clause; 121, attribute; 122, argument_list; 123, identifier:symbol; 124, identifier:symbol; 125, identifier:name; 126, identifier:symbol; 127, identifier:symbol; 128, identifier:name; 129, identifier:str; 130, argument_list; 131, identifier:params; 132, identifier:append; 133, identifier:symbol; 134, identifier:MatrixExpr; 135, identifier:Expr; 136, attribute; 137, argument_list; 138, identifier:TypeError; 139, argument_list; 140, identifier:isinstance; 141, argument_list; 142, identifier:s; 143, attribute; 144, identifier:vars; 145, identifier:append; 146, identifier:der; 147, identifier:symbol; 148, identifier:vars; 149, identifier:append; 150, identifier:symbol; 151, call; 152, identifier:s; 153, identifier:Parameter; 154, identifier:der; 155, identifier:variables; 156, attribute; 157, argument_list; 158, string; 159, identifier:format; 160, call; 161, string_content:model contains an unknown symbol type, {}; 162, identifier:type; 163, argument_list; 164, identifier:symbol
code: def seperate_symbols(func):
      """
      Seperate the symbols in symbolic function func. Return them in alphabetical
      order.
  
      :param func: scipy symbolic function.
      :return: (vars, params), a tuple of all variables and parameters, each 
          sorted in alphabetical order.
      :raises TypeError: only symfit Variable and Parameter are allowed, not sympy
          Symbols.
      """
      params = []
      vars = []
      for symbol in func.free_symbols:
          if not isidentifier(str(symbol)):
              continue  # E.g. Indexed objects might print to A[i, j]
          if isinstance(symbol, Parameter):
              params.append(symbol)
          elif isinstance(symbol, Idx):
              # Idx objects are not seen as parameters or vars.
              pass
          elif isinstance(symbol, (MatrixExpr, Expr)):
              vars.append(symbol)
          else:
              raise TypeError('model contains an unknown symbol type, {}'.format(type(symbol)))
  
      for der in func.atoms(sympy.Derivative):
          # Used by jacobians and hessians, where derivatives are treated as
          # Variables. This way of writing it is purposefully discriminatory
          # against derivatives wrt variables, since such derivatives should be
          # performed explicitly in the case of jacs/hess, and are treated
          # differently in the case of ODEModels.
          if der.expr in vars and all(isinstance(s, Parameter) for s in der.variables):
              vars.append(der)
  
      params.sort(key=lambda symbol: symbol.name)
      vars.sort(key=lambda symbol: symbol.name)
      return vars, params