<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(cls, primary_key, convert_key=True):
 """ Retrieve a model instance by primary key. :param primary_key: The primary key of the model instance. :returns: Corresponding :py:class:`Model` instance. :raises: ``KeyError`` if object with given primary key does not exist. """

        if convert_key:
            primary_key = cls._query.get_primary_hash_key(primary_key)
        if not cls.__database__.hash_exists(primary_key):
            raise KeyError('Object not found.')
        raw_data = cls.__database__.hgetall(primary_key)
        if PY3:
            raw_data = decode_dict_keys(raw_data)
        data = {}
        for name, field in cls._fields.items():
            if isinstance(field, _ContainerField):
                continue
            elif name in raw_data:
                data[name] = field.python_value(raw_data[name])
            else:
                data[name] = None

        return cls(**data)