code: def _up_runs(db, dataset_dict, runs_field):
      if runs_field not in dataset_dict:
          return
  
      runs = dataset_dict[runs_field]
  
      _runs = {}
      for key, run_doc in runs.items():
          if isinstance(run_doc, dict):
              _id = ObjectId()
              run_doc["_id"] = _id
              run_doc["_dataset_id"] = dataset_dict["_id"]
              _runs[key] = _id
              db.runs.insert_one(run_doc)
          else:
              # Assume already migrated
              _runs[key] = run_doc
  
      dataset_dict[runs_field] = _runs
  
file_path: fiftyone/fiftyone/migrations/revisions/v0_19_0.py
imports: from datetime import datetime
  import logging
  import string
  from bson import ObjectId
label_desc: Use image node_id 4 for calling a global function with example usage: _up_runs(db, dataset_dict, runs_field) without return types