def __deserialize(self, data, klass):
if data is None:<EOL><INDENT>return None<EOL><DEDENT>if type(klass) == str:<EOL><INDENT>if klass.startswith('<STR_LIT>'):<EOL><INDENT>sub_kls = re.match('<STR_LIT>', klass).group(<NUM_LIT:1>)<EOL>return [self.__deserialize(sub_data, sub_kls)<EOL>for sub_data in data]<EOL><DEDENT>if klass.startswith('<STR_LIT>'):<EOL><INDENT>sub_kls = re.match('<STR_LIT>', klass).group(<NUM_LIT:2>)<EOL>return {k: self.__deserialize(v, sub_kls)<EOL>for k, v in iteritems(data)}<EOL><DEDENT>if klass in self.NATIVE_TYPES_MAPPING:<EOL><INDENT>klass = self.NATIVE_TYPES_MAPPING[klass]<EOL><DEDENT>else:<EOL><INDENT>klass = getattr(models, klass)<EOL><DEDENT><DEDENT>if klass in self.PRIMITIVE_TYPES:<EOL><INDENT>return self.__deserialize_primitive(data, klass)<EOL><DEDENT>elif klass == object:<EOL><INDENT>return self.__deserialize_object(data)<EOL><DEDENT>elif klass == date:<EOL><INDENT>return self.__deserialize_date(data)<EOL><DEDENT>elif klass == datetime:<EOL><INDENT>return self.__deserialize_datatime(data)<EOL><DEDENT>else:<EOL><INDENT>return self.__deserialize_model(data, klass)<EOL><DEDENT>
Deserializes dict, list, str into an object.

:param data: dict, list or str.
:param klass: class literal, or string of class name.

:return: object.