code: def _filter_items_from_results(queryid, ids, scores, filter_items, N):
      if np.isscalar(queryid):
          mask = np.in1d(ids, filter_items, invert=True)
          ids, scores = ids[mask][:N], scores[mask][:N]
      else:
          rows = len(queryid)
          filtered_scores = np.zeros((rows, N), dtype=scores.dtype)
          filtered_ids = np.zeros((rows, N), dtype=ids.dtype)
          for row in range(rows):
              mask = np.in1d(ids[row], filter_items, invert=True)
              filtered_ids[row] = ids[row][mask][:N]
              filtered_scores[row] = scores[row][mask][:N]
          ids, scores = filtered_ids, filtered_scores
      return ids, scores
  
file_path: implicit/implicit/utils.py
imports: import time
  import warnings
  import numpy
  import scipy.sparse
  import threadpoolctl
label_desc: Use image node_id 6 for calling a global function with example usage: _filter_items_from_results(queryid, ids, scores, filter_items, N) and returns: ids,  scores