code: def lookup_subclass(cls, d):
          
          try:
              typeid = d["typeid"]
          except KeyError:
              raise FieldError("typeid not present in keys %s" % list(d))
  
          subclass = cls._subcls_lookup.get(typeid, None)
          if not subclass:
              raise FieldError("'%s' not a valid typeid" % typeid)
          else:
              return subclass
docs: Look up a class based on a serialized dictionary containing a typeid
  
          Args:
              d (dict): Dictionary with key "typeid"
  
          Returns:
              Serializable subclass