code: def generate_dataset(filename, outputfilename):
      """Generates a hdf5 lastfm datasetfile from the raw datafiles found at:
      http://ocelma.net/MusicRecommendationDataset/lastfm-360K.html
  
      You shouldn't have to run this yourself, and can instead just download the
      output using the 'get_lastfm' function./
  
      Note there are some invalid entries in this dataset, running
      this function will clean it up so pandas can read it:
      https://github.com/benfred/bens-blog-code/blob/master/distance-metrics/musicdata.py#L39
      """
      data = _read_dataframe(filename)
      _hfd5_from_dataframe(data, outputfilename)
  
file_path: implicit/implicit/datasets/lastfm.py
imports: import logging
  import os
  import time
  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(filename, outputfilename) without return types