code: def _json_clean(d):
      
      result = {}
      compkeys = {}
      for k, v in d.items():
          if not isinstance(k, tuple):
              result[k] = v
          else:
              #v is a list of entries for instance methods/constructors on the
              #UUID of the key. Instead of using the composite tuple keys, we
              #switch them for a string using the 
              key = "c.{}".format(id(k))
              result[key] = v
              compkeys[key] = k
  
      return (result, compkeys)
docs: Cleans the specified python `dict` by converting any tuple keys to
      strings so that they can be serialized by JSON.
  
      Args:
          d (dict): python dictionary to clean up.
  
      Returns:
          dict: cleaned-up dictionary.