nodes: 0, module; 1, function_definition; 2, function_name:ordered; 3, parameters; 4, block; 5, identifier:orderme; 6, expression_statement; 7, if_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""Converts the provided dictionary into a collections.OrderedDict.
  
      The items in the returned OrderedDict will be inserted based on the
      natural sort order of the keys. Nested dictionaries will also be sorted
      in order to ensure fully predictable ordering.
  
      :param orderme: the dict to order
      :return: collections.OrderedDict
      :raises: ValueError: if `orderme` isn't a dict instance.
      """; 12, not_operator; 13, block; 14, assignment; 15, pattern_list; 16, call; 17, block; 18, identifier:result; 19, call; 20, raise_statement; 21, identifier:result; 22, call; 23, identifier:k; 24, identifier:v; 25, identifier:sorted; 26, argument_list; 27, if_statement; 28, identifier:isinstance; 29, argument_list; 30, call; 31, identifier:OrderedDict; 32, argument_list; 33, call; 34, keyword_argument; 35, call; 36, block; 37, else_clause; 38, identifier:orderme; 39, identifier:dict; 40, identifier:ValueError; 41, argument_list; 42, attribute; 43, argument_list; 44, identifier:key; 45, lambda; 46, identifier:isinstance; 47, argument_list; 48, expression_statement; 49, block; 50, string; 51, identifier:six; 52, identifier:iteritems; 53, identifier:orderme; 54, lambda_parameters; 55, subscript; 56, identifier:v; 57, identifier:dict; 58, assignment; 59, expression_statement; 60, string_content:argument must be a dict type; 61, identifier:x; 62, identifier:x; 63, integer:0; 64, subscript; 65, call; 66, assignment; 67, identifier:result; 68, identifier:k; 69, identifier:ordered; 70, argument_list; 71, subscript; 72, identifier:v; 73, identifier:v; 74, identifier:result; 75, identifier:k
code: def ordered(orderme):
      """Converts the provided dictionary into a collections.OrderedDict.
  
      The items in the returned OrderedDict will be inserted based on the
      natural sort order of the keys. Nested dictionaries will also be sorted
      in order to ensure fully predictable ordering.
  
      :param orderme: the dict to order
      :return: collections.OrderedDict
      :raises: ValueError: if `orderme` isn't a dict instance.
      """
      if not isinstance(orderme, dict):
          raise ValueError('argument must be a dict type')
  
      result = OrderedDict()
      for k, v in sorted(six.iteritems(orderme), key=lambda x: x[0]):
          if isinstance(v, dict):
              result[k] = ordered(v)
          else:
              result[k] = v
  
      return result