def get_movielens(variant="<STR_LIT>"):
filename = "<STR_LIT>" % variant<EOL>path = os.path.join(_download.LOCAL_CACHE_DIR, filename)<EOL>if not os.path.isfile(path):<EOL><INDENT>log.info("<STR_LIT>", path)<EOL>_download.download_file(URL_BASE + filename, path)<EOL><DEDENT>else:<EOL><INDENT>log.info("<STR_LIT>", path)<EOL><DEDENT>with h5py.File(path, '<STR_LIT:r>') as f:<EOL><INDENT>m = f.get('<STR_LIT>')<EOL>plays = csr_matrix((m.get('<STR_LIT:data>'), m.get('<STR_LIT>'), m.get('<STR_LIT>')))<EOL>return np.array(f['<STR_LIT>']), plays<EOL><DEDENT>
Gets movielens datasets

    Parameters
    ---------
    variant : string
        Which version of the movielens dataset to download. Should be one of '20m', '10m',
        '1m' or '100k'.

    Returns
    -------
    movies : ndarray
        An array of the movie titles.
    ratings : csr_matrix
        A sparse matrix where the row is the movieId, the column is the userId and the value is
        the rating.