code: def update_dashboards(session, uuid_map):
      message = (
          "Updating dashboard position json with slice uuid.."
          if uuid_map
          else "Cleaning up slice uuid from dashboard position json.."
      )
      print(f"\n{message}\r", end="")
  
      query = session.query(models["dashboards"])
      dashboard_count = query.count()
      for i, dashboard in enumerate(query.all()):
          update_position_json(dashboard, session, uuid_map)
          if i and i % default_batch_size == 0:
              session.commit()
          print(f"{message} {i+1}/{dashboard_count}\r", end="")
  
      session.commit()
      # Extra whitespace to override very long numbers, e.g. 99999/99999.
      print(f"{message} Done.      \n")
  
file_path: superset/superset/migrations/versions/2020-09-28_17-57_b56500de1855_add_uuid_column_to_import_mixin.py
imports: import json
  import os
  from json.decoder import JSONDecodeError
  from uuid import uuid4
  import sqlalchemy
  from alembic import op
  from sqlalchemy.ext.declarative import declarative_base
  from sqlalchemy.orm import load_only
  from sqlalchemy_utils import UUIDType
  from superset import db
  from superset.migrations.shared.utils import assign_uuids
  from superset.utils import core
label_desc: Use image node_id 2 for calling a global function with example usage: update_dashboards(session, uuid_map) without return types