code: def up(db, dataset_name):
      match_d = {"name": dataset_name}
      dataset_dict = db.datasets.find_one(match_d)
      _id = dataset_dict.get("_id", None)
  
      sample_fields = dataset_dict.get("sample_fields", None)
      if sample_fields and all(
          f.get("name", None) != "_dataset_id" for f in sample_fields
      ):
          sample_fields.append(
              {
                  "name": "_dataset_id",
                  "ftype": "fiftyone.core.fields.ObjectIdField",
                  "embedded_doc_type": None,
                  "subfield": None,
                  "fields": [],
                  "db_field": "_dataset_id",
                  "description": None,
                  "info": None,
              }
          )
  
          coll_name = dataset_dict.get("sample_collection_name", None)
          if coll_name is not None:
              db[coll_name].update_many(
                  {}, {"$set": {"_dataset_id": _id}}
              )
  
      frame_fields = dataset_dict.get("frame_fields", None)
      if frame_fields and all(
          f.get("name", None) != "_dataset_id" for f in frame_fields
      ):
          frame_fields.append(
              {
                  "name": "_dataset_id",
                  "ftype": "fiftyone.core.fields.ObjectIdField",
                  "embedded_doc_type": None,
                  "subfield": None,
                  "fields": [],
                  "db_field": "_dataset_id",
                  "description": None,
                  "info": None,
              }
          )
  
          coll_name = dataset_dict.get("frame_collection_name", None)
          if coll_name is not None:
              db[coll_name].update_many(
                  {}, {"$set": {"_dataset_id": _id}}
              )
  
      app_config = dataset_dict.get("app_config", None)
      if app_config is not None:
          sidebar_groups = app_config.get("sidebar_groups", None)
          if sidebar_groups is not None:
              label_tags_idx = None
  
              for idx, sidebar_group in enumerate(sidebar_groups):
                  name = sidebar_group.get("name", None)
                  if name == "tags":
                      sidebar_group["paths"] = ["tags", "_label_tags"]
  
                  if name == "label tags":
                      label_tags_idx = idx
  
              if label_tags_idx is not None:
                  sidebar_groups.pop(label_tags_idx)
  
      _update_runs(
          db,
          dataset_dict,
          "brain_methods",
          {"cls": _OLD_SKLEARN_CONFIG_CLS},
          {"cls": _NEW_SKLEARN_CONFIG_CLS, "method": "sklearn"},
          {"cls": _NEW_SKLEARN_RESULTS_CLS},
      )
  
      db.datasets.replace_one(match_d, dataset_dict)
  
imports: from bson import json_util
  import gridfs
label_desc: Use image node_id 1 for calling a global function with example usage: up(db, dataset_name) without return types