<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load(obj, cls, default_factory):
 """Create or load an object if necessary. Parameters obj : `object` or `dict` or `None` cls : `type` default_factory : `function` Returns ------- `object` """

    if obj is None:
        return default_factory()
    if isinstance(obj, dict):
        return cls.load(obj)
    return obj