nodes: 0, module; 1, function_definition; 2, function_name:get_sort_on; 3, parameters; 4, block; 5, default_parameter; 6, expression_statement; 7, expression_statement; 8, if_statement; 9, return_statement; 10, identifier:allowed_indexes; 11, None; 12, comment:""" returns the 'sort_on' from the request
      """; 13, assignment; 14, boolean_operator; 15, block; 16, identifier:sort_on; 17, identifier:sort_on; 18, call; 19, identifier:allowed_indexes; 20, comparison_operator:sort_on not in allowed_indexes; 21, expression_statement; 22, return_statement; 23, identifier:get; 24, argument_list; 25, identifier:sort_on; 26, identifier:allowed_indexes; 27, call; 28, None; 29, string:"sort_on"; 30, attribute; 31, argument_list; 32, identifier:logger; 33, identifier:warn; 34, call; 35, attribute; 36, argument_list; 37, string:"Index '{}' is not in allowed_indexes"; 38, identifier:format; 39, identifier:sort_on
code: def get_sort_on(allowed_indexes=None):
      """ returns the 'sort_on' from the request
      """
      sort_on = get("sort_on")
      if allowed_indexes and sort_on not in allowed_indexes:
          logger.warn("Index '{}' is not in allowed_indexes".format(sort_on))
          return None
      return sort_on