code: def lift(cooccurrence):
      """Helper method to calculate the Lift of a matrix of
      co-occurrences. In comparison with basic co-occurrence and Jaccard
      similarity, lift favours discoverability and serendipity, as
      opposed to co-occurrence that favours the most popular items, and
      Jaccard that is a compromise between the two.
  
      Args:
          cooccurrence (numpy.ndarray): The symmetric matrix of co-occurrences of items.
  
      Returns:
          numpy.ndarray: The matrix of Lifts between any two items.
  
      """
  
      diag_rows, diag_cols = _get_row_and_column_matrix(
          cooccurrence.diagonal()
      )
  
      with np.errstate(invalid="ignore", divide="ignore"):
          result = cooccurrence / (diag_rows * diag_cols)
  
      return np.array(result)
  
file_path: recommenders/recommenders/utils/python_utils.py
imports: import logging
  import numpy
  from scipy import sparse
label_desc: Use image node_id 4 for calling a global function with example usage: lift(cooccurrence) and returns: np