<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def lookup_subclass(cls, d):
 """Look up a class based on a serialized dictionary containing a typeid Args: d (dict):
 Dictionary with key "typeid" Returns: Serializable subclass """

        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