{"record":{"id":"85bbc752de1d8e86","repo":"tensorflow/models","slug":"dataset-is-not-in","errorCode":null,"errorMessage":"dataset {} is not in {{{}}}","messagePattern":"dataset (.+?) is not in (.+?)\\}\\}","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/recommendation/movielens.py","lineNumber":99,"sourceCode":"\nNUM_RATINGS = {\n    ML_1M: 1000209,\n    ML_20M: 20000263\n}\n\nDATASET_TO_NUM_USERS_AND_ITEMS = {ML_1M: (6040, 3706), ML_20M: (138493, 26744)}\n\n\ndef _download_and_clean(dataset, data_dir):\n  \"\"\"Download MovieLens dataset in a standard format.\n\n  This function downloads the specified MovieLens format and coerces it into a\n  standard format. The only difference between the ml-1m and ml-20m datasets\n  after this point (other than size, of course) is that the 1m dataset uses\n  whole number ratings while the 20m dataset allows half integer ratings.\n  \"\"\"\n  if dataset not in DATASETS:\n    raise ValueError(\"dataset {} is not in {{{}}}\".format(\n        dataset, \",\".join(DATASETS)))\n\n  data_subdir = os.path.join(data_dir, dataset)\n\n  expected_files = [\"{}.zip\".format(dataset), RATINGS_FILE, MOVIES_FILE]\n\n  tf.io.gfile.makedirs(data_subdir)\n  if set(expected_files).intersection(\n      tf.io.gfile.listdir(data_subdir)) == set(expected_files):\n    logging.info(\"Dataset {} has already been downloaded\".format(dataset))\n    return\n\n  url = \"{}{}.zip\".format(_DATA_URL, dataset)\n\n  temp_dir = tempfile.mkdtemp()\n  try:\n    zip_path = os.path.join(temp_dir, \"{}.zip\".format(dataset))\n    zip_path, _ = urllib.request.urlretrieve(url, zip_path)","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/recommendation/movielens.py#L81-L117","documentation":"Error \"dataset {} is not in {{{}}}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/recommendation/movielens.py:99 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}