class_docstr: The ``TaskTesterMeta`` is a metaclass which attaches a suite of tests to classes that extend ``TaskTester`` based
  on the configuration variables they define.
  
  These tests will also be wrapped with the appropriate marks to skip them if the required dependencies are not
  available.
class_docstr_tok: ["The","``","TaskTesterMeta","``","is","a","metaclass","which","attaches","a","suite","of","tests","to","classes","that","extend","``","TaskTester","``","based","on","the","configuration","variables","they","define",".","These","tests","will","also","be","wrapped","with","the","appropriate","marks","to","skip","them","if","the","required","dependencies","are","not","available","."]
code: def __new__(mcs, name: str, bases: Tuple, class_dict: Dict[str, Any]):
      result = ABCMeta.__new__(mcs, name, bases, class_dict)
  
      # Skip attaching for the base class
      if name == "TaskTester":
          return result
  
      # Attach forward test
      if "example_forward_input" in class_dict:
          mcs.attach_test(result, "test_forward", _test_forward)
  
      # Attach fit test
      if "example_train_sample" in class_dict:
          mcs.attach_test(result, "test_fit", _test_fit)
  
      # Attach val test
      if "example_val_sample" in class_dict:
          mcs.attach_test(result, "test_val", _test_val)
  
      # Attach test test
      if "example_test_sample" in class_dict:
          mcs.attach_test(result, "test_test", _test_test)
  
      # Attach JIT tests
      if result.traceable and "example_forward_input" in class_dict:
          mcs.attach_test(result, "test_jit_trace", _test_jit_trace)
  
      if result.scriptable and "example_forward_input" in class_dict:
          mcs.attach_test(result, "test_jit_script", _test_jit_script)
  
      # Attach CLI test
      if result.cli_command is not None:
          mcs.attach_test(result, "test_cli", _test_cli)
  
      # Skip tests if dependencies not available
      for attribute_name, attribute_value in filter(
          lambda x: x[0].startswith("test"), inspect.getmembers(result)
      ):
          setattr(
              result,
              attribute_name,
              pytest.mark.skipif(
                  not result.is_testing,
                  reason="Dependencies not available.",
              )(_copy_func(attribute_value)),
          )
  
      # Attach error check tests
      mcs.attach_test(
          result,
          "test_load_from_checkpoint_dependency_error",
          _test_load_from_checkpoint_dependency_error,
      )
  
      mcs.attach_test(
          result,
          "test_init_dependency_error",
          _test_init_dependency_error,
      )
  
      for dependency_test in [
          "test_load_from_checkpoint_dependency_error",
          "test_init_dependency_error",
      ]:
          setattr(
              result,
              dependency_test,
              pytest.mark.skipif(
                  result.is_available, reason="Dependencies available."
              )(_copy_func(getattr(result, dependency_test))),
          )
  
      return result
  
imports: import contextlib
  import functools
  import inspect
  import os
  import types
  from abc import ABCMeta
  from typing import Any, Dict, List, Optional, Tuple
  from unittest.mock import patch
  import flash
  import pytest
  import torch
  from flash.__main__ import main
  from flash.core.model import Task
  from torch.utils.data import Dataset
label_desc: Use image node_id 2 for calling the TaskTesterMeta obj's underlying member method code with example usage: obj.__new__(mcs, name, bases, class_dict) and returns: result, result