<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __deserialize(self, payload, obj_type):
 # type: (str, Union[T, str]) -> Any """Deserializes payload into a model object. :param payload: data to be deserialized. :type payload: str :param obj_type: resolved class name for deserialized object :type obj_type: Union[object, str] :return: deserialized object :rtype: object """

        if payload is None:
            return None

        if isinstance(obj_type, str):
            if obj_type.startswith('list['):
                # Get object type for each item in the list
                # Deserialize each item using the object type.
                sub_obj_type =  re.match(
                    'list\[(.*)\]', obj_type)
                if sub_obj_type is None:
                    return []
                sub_obj_types = sub_obj_type.group(1)
                deserialized_list = []  # type: List
                if "," in sub_obj_types:
                    # list contains objects of different types
                    for sub_payload, sub_obj_types in zip(
                            payload, sub_obj_types.split(",")):
                        deserialized_list.append(self.__deserialize(
                            sub_payload, sub_obj_types.strip()))
                else:
                    for sub_payload in payload:
                        deserialized_list.append(self.__deserialize(
                            sub_payload, sub_obj_types.strip()))
                return deserialized_list

            if obj_type.startswith('dict('):
                # Get object type for each k,v pair in the dict
                # Deserialize each value using the object type of v.
                sub_obj_type = re.match(
                    'dict\(([^,]*), (.*)\)', obj_type)
                if sub_obj_type is None:
                    return {}
                sub_obj_types = sub_obj_type.group(2)
                return {
                    k: self.__deserialize(v, sub_obj_types)
                    for k, v in iteritems(cast(Any, payload))
                }
            # convert str to class
            if obj_type in self.NATIVE_TYPES_MAPPING:
                obj_type = self.NATIVE_TYPES_MAPPING[obj_type]  # type: ignore
            else:
                # deserialize models
                obj_type = self.__load_class_from_name(obj_type)

        if obj_type in self.PRIMITIVE_TYPES:
            return self.__deserialize_primitive(payload, obj_type)
        elif obj_type == object:
            return payload
        elif obj_type == date:
            return self.__deserialize_datetime(payload, obj_type)
        elif obj_type == datetime:
            return self.__deserialize_datetime(payload, obj_type)
        else:
            return self.__deserialize_model(payload, obj_type)