code: def generate_dataset(path, variant="20m", outputpath="."):
      """Generates a hdf5 movielens datasetfile from the raw datafiles found at:
      https://grouplens.org/datasets/movielens/20m/
  
      You shouldn't have to run this yourself, and can instead just download the
      output using the 'get_movielens' function./
      """
      filename = os.path.join(outputpath, f"movielens_{variant}.hdf5")
  
      if variant == "20m":
          ratings, movies = _read_dataframes_20M(path)
      elif variant == "100k":
          ratings, movies = _read_dataframes_100k(path)
      else:
          ratings, movies = _read_dataframes(path)
  
      _hfd5_from_dataframe(ratings, movies, filename)
  
file_path: implicit/implicit/datasets/movielens.py
imports: import logging
  import os
  import h5py
  import numpy
  from scipy.sparse import coo_matrix, csr_matrix
  from implicit.datasets import _download
label_desc: Use image node_id 2 for calling a global function with example usage: generate_dataset(path, variant, outputpath) without return types