nodes: 0, module; 1, function_definition; 2, function_name:sortBy; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, if_statement; 9, identifier:val; 10, None; 11, comment:""" Sort the object's values by a criterion produced by an iterator.
          """; 12, comparison_operator:val is not None; 13, block; 14, else_clause; 15, identifier:val; 16, None; 17, if_statement; 18, block; 19, call; 20, block; 21, else_clause; 22, return_statement; 23, attribute; 24, argument_list; 25, return_statement; 26, block; 27, call; 28, call; 29, identifier:isString; 30, call; 31, return_statement; 32, attribute; 33, argument_list; 34, identifier:_; 35, argument_list; 36, attribute; 37, argument_list; 38, call; 39, identifier:self; 40, identifier:_wrap; 41, call; 42, identifier:val; 43, identifier:self; 44, identifier:_wrap; 45, call; 46, attribute; 47, argument_list; 48, identifier:sorted; 49, argument_list; 50, identifier:sorted; 51, argument_list; 52, identifier:self; 53, identifier:_wrap; 54, call; 55, attribute; 56, attribute; 57, keyword_argument; 58, identifier:sorted; 59, argument_list; 60, identifier:self; 61, identifier:obj; 62, identifier:self; 63, identifier:obj; 64, identifier:key; 65, lambda; 66, attribute; 67, keyword_argument; 68, lambda_parameters; 69, call; 70, identifier:self; 71, identifier:obj; 72, identifier:key; 73, identifier:val; 74, identifier:x; 75, list_splat_pattern; 76, attribute; 77, argument_list; 78, identifier:args; 79, identifier:x; 80, identifier:get; 81, identifier:val
code: def sortBy(self, val=None):
          """ Sort the object's values by a criterion produced by an iterator.
          """
          if val is not None:
              if _(val).isString():
                  return self._wrap(sorted(self.obj, key=lambda x,
                                    *args: x.get(val)))
              else:
                  return self._wrap(sorted(self.obj, key=val))
          else:
              return self._wrap(sorted(self.obj))