code: def _lookup_host_mappings(query_type, session=None, **bfilter):
      
      if session is None:
          session = bc.get_reader_session()
      query_method = getattr(session.query(
          nexus_models_v2.NexusHostMapping).filter_by(**bfilter), query_type)
      try:
          mappings = query_method()
          if mappings:
              return mappings
      except sa_exc.NoResultFound:
          pass
      raise c_exc.NexusHostMappingNotFound(**bfilter)
docs: Look up 'query_type' Nexus mappings matching the filter.
  
      :param query_type: 'all', 'one' or 'first'
      :param session: db session
      :param bfilter: filter for mappings query
      :returns: mappings if query gave a result, else
               raise NexusHostMappingNotFound.