code: def parse_100k_movies_data(
      dir_path: str,
  ) -> Iterator[Tuple[int, Dict[str, Any]]]:
      """Parses the 100k movies data."""
      movies_file_path = os.path.join(dir_path, "u.item")
      # A list for converting genre index to genre label for 100K dataset.
      # "Children's" changed to "Children" in the list for consistency.
      all_genre_list = [
          "Unknown",
          "Action",
          "Adventure",
          "Animation",
          "Children",
          "Comedy",
          "Crime",
          "Documentary",
          "Drama",
          "Fantasy",
          "Film-Noir",
          "Horror",
          "Musical",
          "Mystery",
          "Romance",
          "Sci-Fi",
          "Thriller",
          "War",
          "Western",
      ]
      with tf.io.gfile.GFile(
          movies_file_path, mode="rb"
      ) as movies_file:
          for row_num, line in enumerate(movies_file):
              line = codecs.decode(line, encoding="ISO-8859-1").strip()
              # Row format: <movie id>|<movie title>|<release date>|\
              # <video release date>|<IMDb URL>|<19 fields for each genre>|.
              # movie_id, movie_title, _, _, _, *genre_bools = line.split('|')
              categories = line.split("|")
              movie_id = categories[0]
              movie_title = categories[1]
              genre_bools = categories[5:]
              genre_list = []
              for index, genre_indicator in enumerate(genre_bools):
                  if genre_indicator == "1":
                      genre_list.append(all_genre_list[index])
              yield row_num, {
                  "movie_id": movie_id,
                  "movie_title": movie_title,
                  "movie_genres": genre_list,
              }
  
file_path: datasets/tensorflow_datasets/structured/movielens_parsing.py
imports: import codecs
  import csv
  import os
  from typing import Any, Dict, Iterator, Tuple
  from etils import epath
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 5 for calling a global function with example usage: parse_100k_movies_data(dir_path) without return types