nodes: 0, module; 1, function_definition; 2, function_name:loop_position; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, for_statement; 8, return_statement; 9, comment:"""Return the current sort in the loop"""; 10, pattern_list; 11, call; 12, block; 13, integer:0; 14, identifier:i; 15, identifier:v; 16, identifier:enumerate; 17, argument_list; 18, if_statement; 19, attribute; 20, comparison_operator:v == glances_processes.sort_key; 21, block; 22, identifier:self; 23, identifier:_sort_loop; 24, identifier:v; 25, attribute; 26, return_statement; 27, identifier:glances_processes; 28, identifier:sort_key; 29, identifier:i
code: def loop_position(self):
          """Return the current sort in the loop"""
          for i, v in enumerate(self._sort_loop):
              if v == glances_processes.sort_key:
                  return i
          return 0