nodes: 0, module; 1, function_definition; 2, function_name:_sortObjects; 3, parameters; 4, block; 5, default_parameter; 6, dictionary_splat_pattern; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, expression_statement; 11, expression_statement; 12, if_statement; 13, return_statement; 14, identifier:orderby; 15, string; 16, identifier:kwargs; 17, comment:"""Sorts lists of objects and combines them into a single list"""; 18, assignment; 19, identifier:m; 20, call; 21, block; 22, assignment; 23, assignment; 24, attribute; 25, block; 26, else_clause; 27, identifier:o; 28, string_content:created; 29, identifier:o; 30, list; 31, attribute; 32, argument_list; 33, for_statement; 34, identifier:o; 35, call; 36, identifier:sortfunc; 37, conditional_expression:_sortByCreated if orderby == 'created' else _sortByModified; 38, identifier:six; 39, identifier:PY2; 40, expression_statement; 41, block; 42, identifier:kwargs; 43, identifier:values; 44, identifier:l; 45, call; 46, block; 47, identifier:list; 48, argument_list; 49, identifier:_sortByCreated; 50, comparison_operator:orderby == 'created'; 51, identifier:_sortByModified; 52, call; 53, expression_statement; 54, identifier:iter; 55, argument_list; 56, expression_statement; 57, call; 58, identifier:orderby; 59, string; 60, attribute; 61, argument_list; 62, call; 63, identifier:m; 64, call; 65, identifier:set; 66, argument_list; 67, string_content:created; 68, identifier:o; 69, identifier:sort; 70, identifier:sortfunc; 71, attribute; 72, argument_list; 73, attribute; 74, argument_list; 75, identifier:o; 76, identifier:o; 77, identifier:sort; 78, keyword_argument; 79, identifier:o; 80, identifier:append; 81, identifier:l; 82, identifier:key; 83, call; 84, attribute; 85, argument_list; 86, identifier:functools; 87, identifier:cmp_to_key; 88, identifier:sortfunc
code: def _sortObjects(orderby='created', **kwargs):
      """Sorts lists of objects and combines them into a single list"""
      o = []
      
      for m in kwargs.values():
          for l in iter(m):
              o.append(l)
      o = list(set(o))
      sortfunc = _sortByCreated if orderby == 'created' else _sortByModified
      if six.PY2:
          o.sort(sortfunc)
      else:
          o.sort(key=functools.cmp_to_key(sortfunc))
  
      return o