code: def migrate(viz_type: VizType, is_downgrade: bool = False) -> None:
      """Migrate a viz from one type to another."""
      # pylint: disable=import-outside-toplevel
      from superset.migrations.shared.migrate_viz.processors import (
          MigrateAreaChart,
          MigrateBubbleChart,
          MigrateDualLine,
          MigrateLineChart,
          MigratePivotTable,
          MigrateSunburst,
          MigrateTreeMap,
      )
  
      migrations = {
          VizType.AREA: MigrateAreaChart,
          VizType.BUBBLE: MigrateBubbleChart,
          VizType.DUAL_LINE: MigrateDualLine,
          VizType.LINE: MigrateLineChart,
          VizType.PIVOT_TABLE: MigratePivotTable,
          VizType.SUNBURST: MigrateSunburst,
          VizType.TREEMAP: MigrateTreeMap,
      }
      if is_downgrade:
          migrations[viz_type].downgrade(db.session)
      else:
          migrations[viz_type].upgrade(db.session)
  
file_path: superset/superset/cli/viz_migrations.py
imports: from enum import Enum
  import click
  from click_option_group import optgroup, RequiredMutuallyExclusiveOptionGroup
  from flask.cli import with_appcontext
  from superset import db
label_desc: Use image node_id 4 for calling a global function with example usage: migrate(viz_type, is_downgrade) without return types