code: def load_movielens_data(data_file, delimiter=","):
      """Loads the movielens data and returns the ratings matrix."""
      ratings_matrix = np.zeros(
          [MOVIELENS_NUM_USERS, MOVIELENS_NUM_MOVIES]
      )
      with tf.io.gfile.GFile(data_file, "r") as infile:
          # The file is a csv with rows containing:
          # user id | item id | rating | timestamp
          reader = csv.reader(infile, delimiter=delimiter)
          for row in reader:
              user_id, item_id, rating, _ = row
              ratings_matrix[
                  int(user_id) - 1, int(item_id) - 1
              ] = float(rating)
      return ratings_matrix
  
file_path: agents/tf_agents/bandits/environments/dataset_utilities.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import csv
  import gin
  import numpy
  from six.moves import range
  from six.moves import zip
  import tensorflow
  import tensorflow_probability
label_desc: Use image node_id 6 for calling a global function with example usage: load_movielens_data(data_file, delimiter) and returns: ratings_matrix