nodes: 0, module; 1, function_definition; 2, function_name:sort_by_mem_per_proc; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, comment:# Avoid sorting if mem_per_cpu is not available.; 9, if_statement; 10, return_statement; 11, identifier:reverse; 12, False; 13, comment:"""Sort the configurations in place. items with lowest memory per proc come first."""; 14, call; 15, block; 16, identifier:self; 17, identifier:any; 18, generator_expression; 19, expression_statement; 20, comparison_operator:c.mem_per_proc > 0.0; 21, for_in_clause; 22, call; 23, attribute; 24, float:0.0; 25, identifier:c; 26, identifier:self; 27, attribute; 28, argument_list; 29, identifier:c; 30, identifier:mem_per_proc; 31, attribute; 32, identifier:sort; 33, keyword_argument; 34, keyword_argument; 35, identifier:self; 36, identifier:_confs; 37, identifier:key; 38, lambda; 39, identifier:reverse; 40, identifier:reverse; 41, lambda_parameters; 42, attribute; 43, identifier:c; 44, identifier:c; 45, identifier:mem_per_proc
code: def sort_by_mem_per_proc(self, reverse=False):
          """Sort the configurations in place. items with lowest memory per proc come first."""
          # Avoid sorting if mem_per_cpu is not available.
          if any(c.mem_per_proc > 0.0 for c in self):
              self._confs.sort(key=lambda c: c.mem_per_proc, reverse=reverse)
          return self