code: def _yield_csv_rows_base(output_dir, row_extra_info_gen_fn):
      """Yield rows for the CSV ground-truth files, also creates fake images."""
      (
          mammography,
          abnormalities,
      ) = _yield_mammography_with_abnormalities()
      patient_id = "P_%05d" % np.random.randint(0, 1000)
      breast_density = np.random.randint(1, 5)
      left_or_right_breast = np.random.choice(["LEFT", "RIGHT"])
      image_view = np.random.choice(["CC", "MLO"])
      study_id = tuple(np.random.randint(0, 999999999 + 1, size=2))
      study_id = "1.3.6.1.4.1.9590.100.1.2.%010d.%010d" % study_id
      series_id = tuple(np.random.randint(0, 999999999 + 1, size=2))
      series_id = "1.3.6.1.4.1.9590.100.1.2.%010d.%010d" % series_id
      remake_dirs(
          os.path.join(output_dir, "%s/%s" % (study_id, series_id))
      )
      # Write mammography image.
      mammography_basename = "%s/%s/000000" % (study_id, series_id)
      write_png(
          os.path.join(output_dir, mammography_basename + ".png"),
          mammography,
      )
  
      for abnormality_id, abnormality in enumerate(abnormalities, 1):
          # Write abnormality crop image.
          crop_basename = "%s/%s/%06d" % (
              study_id,
              series_id,
              abnormality_id * 2 - 1,
          )
          write_png(
              os.path.join(output_dir, crop_basename + ".png"),
              abnormality[1],
          )
          # Write abnormality mask image.
          mask_basename = "%s/%s/%06d" % (
              study_id,
              series_id,
              abnormality_id * 2,
          )
          write_png(
              os.path.join(output_dir, mask_basename + ".png"),
              abnormality[0],
          )
          row = {
              "patient_id": patient_id,
              "breast density": breast_density,
              "left or right breast": left_or_right_breast,
              "image view": image_view,
              "abnormality id": abnormality_id,
              "abnormality type": "calcification",
              "assessment": np.random.randint(1, 5),
              "pathology": np.random.choice(
                  ["BENIGN", "BENIGN_WITHOUT_CALLBACK", "MALIGNANT"]
              ),
              "subtlety": np.random.randint(1, 5),
              "image file path": mammography_basename + ".dcm",
              "cropped image file path": crop_basename + ".dcm",
              "ROI mask file path": mask_basename + ".dcm",
          }
          row.update(row_extra_info_gen_fn())
          yield row
  
file_path: datasets/tensorflow_datasets/testing/fake_data_generation/curated_breast_imaging_ddsm.py
imports: import csv
  import os
  from absl import app
  from absl import flags
  import numpy
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 4 for calling a global function with example usage: _yield_csv_rows_base(output_dir, row_extra_info_gen_fn) without return types