code: def _filter_items_from_sparse_matrix(items, query_items):
      """Remaps all the ids in query_items down to match the position
      in the items filter. Requires items to be sorted"""
      filter_query_items = query_items.tocoo()
  
      positions = np.searchsorted(items, filter_query_items.col)
      positions = np.clip(positions, 0, len(items) - 1)
  
      filter_query_items.data[
          items[positions] != filter_query_items.col
      ] = 0
      filter_query_items.col = positions
      filter_query_items.eliminate_zeros()
      return filter_query_items.tocsr()
  
imports: import warnings
  import numpy
  from scipy.sparse import csr_matrix, lil_matrix
  from ..recommender_base import ModelFitError, RecommenderBase
  from .topk import topk
label_desc: Use image node_id 1 for calling a global function with example usage: _filter_items_from_sparse_matrix(items, query_items) and returns: filter_query_items