code: def _recursive_repr(item):
      
      if isinstance(item, basestring):
          result = str(item)
      elif isinstance(item, list):
          result = '[{}]'.format(', '.join([_recursive_repr(x) for x in item]))
      elif isinstance(item, dict):
          kv_pairs = ['{}: {}'.format(_recursive_repr(k), _recursive_repr(item[k])) for k in sorted(item)]
          result = '{' + ', '.join(kv_pairs) + '}'
      else:
          result = repr(item)
      return result
docs: Hack around python `repr` to deterministically represent dictionaries.
  
      This is able to represent more things than json.dumps, since it does not require things to be JSON serializable
      (e.g. datetimes).