code: def _create_finetuning_config(
      checkpoint_path: str,
      num_gpu: int = 2,
      regularize_bias: bool = False,
      construct_single_param_group_only: bool = False,
      with_fsdp: bool = False,
      fsdp_flatten_parameters: bool = False,
      with_partial_head: bool = False,
  ):
      architecture_config = (
          "+config/test/integration_test/models=finetune_regnet_fsdp"
      )
      if with_partial_head:
          architecture_config = "+config/test/integration_test/models=finetune_regnet_fsdp_head"
  
      cfg = compose_hydra_configuration(
          [
              "config=test/integration_test/quick_eval_finetune_in1k",
              architecture_config,
              f"config.MODEL.WEIGHTS_INIT.PARAMS_FILE={checkpoint_path}",
              "config.DATA.TRAIN.DATA_SOURCES=[synthetic]",
              "config.DATA.TRAIN.LABEL_SOURCES=[synthetic]",
              "config.DATA.TEST.DATA_SOURCES=[synthetic]",
              "config.DATA.TEST.LABEL_SOURCES=[synthetic]",
              "config.DATA.TRAIN.RANDOM_SYNTHETIC_IMAGES=True",
              "config.DATA.TEST.RANDOM_SYNTHETIC_IMAGES=True",
              "config.DATA.TRAIN.DATA_LIMIT=40",
              "config.DATA.TEST.DATA_LIMIT=20",
              "config.DATA.TRAIN.BATCHSIZE_PER_REPLICA=4",
              "config.DATA.TEST.BATCHSIZE_PER_REPLICA=2",
              "config.SEED_VALUE=0",
              f"config.DISTRIBUTED.NUM_PROC_PER_NODE={num_gpu}",
              "config.LOG_FREQUENCY=1",
              "config.OPTIMIZER.num_epochs=2",
              "config.OPTIMIZER.param_schedulers.lr.auto_lr_scaling.base_value=0.01",
              "config.OPTIMIZER.param_schedulers.lr.auto_lr_scaling.base_lr_batch_size=2",
              "config.OPTIMIZER.param_schedulers.lr_head.auto_lr_scaling.base_value=0.1",
              "config.OPTIMIZER.param_schedulers.lr_head.auto_lr_scaling.base_lr_batch_size=2",
              f"config.OPTIMIZER.regularize_bias={regularize_bias}",
              f"config.OPTIMIZER.construct_single_param_group_only={construct_single_param_group_only}",
          ]
      )
      args, config = convert_to_attrdict(cfg)
      if with_fsdp:
          config["MODEL"]["TRUNK"]["NAME"] = "regnet_fsdp"
          if with_partial_head:
              config["MODEL"]["HEAD"]["PARAMS"][0][0] = "swav_head_fsdp"
              config["MODEL"]["HEAD"]["PARAMS"][1][0] = "mlp_fsdp"
          else:
              config["MODEL"]["HEAD"]["PARAMS"][0][0] = "mlp_fsdp"
          config.TRAINER.TASK_NAME = "self_supervision_fsdp_task"
          config.MODEL.FSDP_CONFIG.flatten_parameters = (
              fsdp_flatten_parameters
          )
          config.MODEL.FSDP_CONFIG.mixed_precision = False
      else:
          config["MODEL"]["TRUNK"]["NAME"] = "regnet_v2"
          if with_partial_head:
              config["MODEL"]["HEAD"]["PARAMS"][0][0] = "swav_head"
              config["MODEL"]["HEAD"]["PARAMS"][1][0] = "mlp"
          else:
              config["MODEL"]["HEAD"]["PARAMS"][0][0] = "mlp"
      return config
  
imports: import os
  import unittest
  from classy_vision.optim import build_optimizer_schedulers
  from vissl.config import AttrDict
  from vissl.models import build_model
  from vissl.optimizers import get_optimizer_param_groups
  from vissl.utils.checkpoint import CheckpointFormatConverter
  from vissl.utils.hydra_config import compose_hydra_configuration, convert_to_attrdict
  from vissl.utils.test_utils import gpu_test, in_temporary_directory, run_integration_test, spawn_distributed_test
label_desc: Use image node_id 2 for calling the TestFineTuning obj's underlying member method code with example usage: obj._create_finetuning_config(checkpoint_path, num_gpu, regularize_bias, construct_single_param_group_only, with_fsdp, fsdp_flatten_parameters, with_partial_head) and returns: config