code: def ordered(orderme):
      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