code: def __deserialize(self, data, klass):
          
          if data is None:
              return None
  
          if type(klass) == str:
              from tradenity.resources.paging import Page
              if klass.startswith('page['):
                  sub_kls = re.match('page\[(.*)\]', klass).group(1)
                  return Page([self.__deserialize(sub_data, sub_kls)
                              for sub_data in data["items"]], self.__deserialize_page_info(data["__meta"]))
              if klass.startswith('list['):
                  sub_kls = re.match('list\[(.*)\]', klass).group(1)
                  return [self.__deserialize(sub_data, sub_kls)
                          for sub_data in data]
  
              if klass.startswith('dict('):
                  sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2)
                  return {k: self.__deserialize(v, sub_kls)
                          for k, v in six.iteritems(data)}
  
              # convert str to class
              if klass in self.NATIVE_TYPES_MAPPING:
                  klass = self.NATIVE_TYPES_MAPPING[klass]
              else:
                  klass = getattr(tradenity.resources, klass)
  
          if klass in self.PRIMITIVE_TYPES:
              return self.__deserialize_primitive(data, klass)
          elif klass == object:
              return self.__deserialize_object(data)
          elif klass == datetime.date:
              return self.__deserialize_date(data)
          elif klass == datetime.datetime:
              return self.__deserialize_datatime(data)
          else:
              return self.__deserialize_model(data, klass)
docs: Deserializes dict, list, str into an object.
  
          :param data: dict, list or str.
          :param klass: class literal, or string of class name.
  
          :return: object.