code: def create_mmd_based_video(
      method: Method,
      dataset,
      image_modality,
      feature_extractor,
      task_classifier,
      **train_params,
  ):
      """MMD-based deep learning methods for domain adaptation on video data: DAN and JAN"""
      if not method.is_mmd_method():
          raise ValueError(f"Unsupported MMD method: {method}")
      if method is Method.DAN:
          return DANTrainerVideo(
              dataset=dataset,
              image_modality=image_modality,
              feature_extractor=feature_extractor,
              task_classifier=task_classifier,
              method=method,
              **train_params,
          )
      if method is Method.JAN:
          return JANTrainerVideo(
              dataset=dataset,
              image_modality=image_modality,
              feature_extractor=feature_extractor,
              task_classifier=task_classifier,
              method=method,
              kernel_mul=[2.0, 2.0],
              kernel_num=[5, 1],
              **train_params,
          )
  
imports: import torch
  import kale.predict.losses
  from kale.loaddata.video_access import get_image_modality
  from kale.pipeline.domain_adapter import BaseMMDLike, CDANTrainer, DANNTrainer, GradReverse, Method, set_requires_grad, WDGRLTrainer
label_desc: Use image node_id 1 for calling a global function with example usage: create_mmd_based_video(method, dataset, image_modality, feature_extractor, task_classifier) and returns: DANTrainerVideo, JANTrainerVideo