code: def _get_dimensions(train_data, test_data):
      uids = set()
      iids = set()
  
      for uid, iid, _, _ in itertools.chain(train_data, test_data):
          uids.add(uid)
          iids.add(iid)
  
      rows = max(uids) + 1
      cols = max(iids) + 1
  
      return rows, cols
  
file_path: lightfm/lightfm/datasets/movielens.py
imports: import itertools
  import os
  import zipfile
  import numpy
  import scipy.sparse
  from lightfm.datasets import _common
label_desc: Use image node_id 3 for calling a global function with example usage: _get_dimensions(train_data, test_data) and returns: rows,  cols