code: def query(
      self, collection, query_params, sort_key=None, sort_order=None
  ):
      self.__reload()
      if query_params.get("id", None) is not None:
          query_params["pk"] = query_params["id"]
          del query_params["id"]
      if sort_key is not None and sort_order is not None:
          if sort_order == "ascending":
              return list(
                  map(
                      normalize_entity,
                      [
                          item.attributes.copy()
                          for item in self.backend.filter(
                              collection, query_params
                          ).sort(sort_key, queryset.QuerySet.ASCENDING)
                      ],
                  )
              )
          elif sort_order == "descending":
              return list(
                  map(
                      normalize_entity,
                      [
                          item.attributes.copy()
                          for item in self.backend.filter(
                              collection, query_params
                          ).sort(sort_key, queryset.QuerySet.DESCENDING)
                      ],
                  )
              )
          else:
              raise InvalidArgumentType()
      else:
          if (
              sort_key is not None
              and sort_order is None
              or sort_key is None
              and sort_order is not None
          ):
              raise RequiredArgumentMissing()
          return list(
              map(
                  normalize_entity,
                  [
                      item.attributes.copy()
                      for item in self.backend.filter(
                          collection, query_params
                      )
                  ],
              )
          )
  
file_path: datmo/datmo/core/storage/driver/blitzdb_dal_driver.py
imports: from blitzdb import Document, queryset
  from datetime import datetime
  from datmo.core.util.exceptions import EntityNotFound, EntityCollectionNotFound, IncorrectType, InvalidArgumentType, RequiredArgumentMissing, MoreThanOneEntityFound
  from datmo.core.storage.driver import DALDriver
label_desc: Use image node_id 7 for calling the BlitzDBDALDriver obj's underlying member method code with example usage: obj.query(collection, query_params, sort_key, sort_order) and returns: list, list, list