code: def get_class_from_dynamic_module(
      class_reference: str,
      pretrained_model_name_or_path: Union[str, os.PathLike],
      cache_dir: Optional[Union[str, os.PathLike]] = None,
      force_download: bool = False,
      resume_download: bool = False,
      proxies: Optional[Dict[str, str]] = None,
      token: Optional[Union[bool, str]] = None,
      revision: Optional[str] = None,
      local_files_only: bool = False,
      repo_type: Optional[str] = None,
      code_revision: Optional[str] = None,
      **kwargs,
  ) -> typing.Type:
      """
      Extracts a class from a module file, present in the local folder or repository of a model.
  
      <Tip warning={true}>
  
      Calling this function will execute the code in the module file found locally or downloaded from the Hub. It should
      therefore only be called on trusted repos.
  
      </Tip>
  
      Args:
          class_reference (`str`):
              The full name of the class to load, including its module and optionally its repo.
          pretrained_model_name_or_path (`str` or `os.PathLike`):
              This can be either:
  
              - a string, the *model id* of a pretrained model configuration hosted inside a model repo on
                huggingface.co. Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced
                under a user or organization name, like `dbmdz/bert-base-german-cased`.
              - a path to a *directory* containing a configuration file saved using the
                [`~PreTrainedTokenizer.save_pretrained`] method, e.g., `./my_model_directory/`.
  
              This is used when `class_reference` does not specify another repo.
          module_file (`str`):
              The name of the module file containing the class to look for.
          class_name (`str`):
              The name of the class to import in the module.
          cache_dir (`str` or `os.PathLike`, *optional*):
              Path to a directory in which a downloaded pretrained model configuration should be cached if the standard
              cache should not be used.
          force_download (`bool`, *optional*, defaults to `False`):
              Whether or not to force to (re-)download the configuration files and override the cached versions if they
              exist.
          resume_download (`bool`, *optional*, defaults to `False`):
              Whether or not to delete incompletely received file. Attempts to resume the download if such a file exists.
          proxies (`Dict[str, str]`, *optional*):
              A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
              'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.
          token (`str` or `bool`, *optional*):
              The token to use as HTTP bearer authorization for remote files. If `True`, will use the token generated
              when running `huggingface-cli login` (stored in `~/.huggingface`).
          revision (`str`, *optional*, defaults to `"main"`):
              The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
              git-based system for storing models and other artifacts on huggingface.co, so `revision` can be any
              identifier allowed by git.
          local_files_only (`bool`, *optional*, defaults to `False`):
              If `True`, will only try to load the tokenizer configuration from local files.
          repo_type (`str`, *optional*):
              Specify the repo type (useful when downloading from a space for instance).
          code_revision (`str`, *optional*, defaults to `"main"`):
              The specific revision to use for the code on the Hub, if the code leaves in a different repository than the
              rest of the model. It can be a branch name, a tag name, or a commit id, since we use a git-based system for
              storing models and other artifacts on huggingface.co, so `revision` can be any identifier allowed by git.
  
      <Tip>
  
      Passing `token=True` is required when you want to use a private model.
  
      </Tip>
  
      Returns:
          `typing.Type`: The class, dynamically imported from the module.
  
      Examples:
  
      ```python
      # Download module `modeling.py` from huggingface.co and cache then extract the class `MyBertModel` from this
      # module.
      cls = get_class_from_dynamic_module("modeling.MyBertModel", "sgugger/my-bert-model")
  
      # Download module `modeling.py` from a given repo and cache then extract the class `MyBertModel` from this
      # module.
      cls = get_class_from_dynamic_module("sgugger/my-bert-model--modeling.MyBertModel", "sgugger/another-bert-model")
      ```"""
      use_auth_token = kwargs.pop("use_auth_token", None)
      if use_auth_token is not None:
          warnings.warn(
              "The `use_auth_token` argument is deprecated and will be removed in v5 of Transformers. Please use `token` instead.",
              FutureWarning,
          )
          if token is not None:
              raise ValueError(
                  "`token` and `use_auth_token` are both specified. Please set only the argument `token`."
              )
          token = use_auth_token
  
      # Catch the name of the repo if it's specified in `class_reference`
      if "--" in class_reference:
          repo_id, class_reference = class_reference.split("--")
      else:
          repo_id = pretrained_model_name_or_path
      module_file, class_name = class_reference.split(".")
  
      if (
          code_revision is None
          and pretrained_model_name_or_path == repo_id
      ):
          code_revision = revision
      # And lastly we get the class inside our newly created module
      final_module = get_cached_module_file(
          repo_id,
          module_file + ".py",
          cache_dir=cache_dir,
          force_download=force_download,
          resume_download=resume_download,
          proxies=proxies,
          token=token,
          revision=code_revision,
          local_files_only=local_files_only,
          repo_type=repo_type,
      )
      return get_class_in_module(
          class_name, final_module.replace(".py", "")
      )
  
imports: import filecmp
  import importlib
  import os
  import re
  import shutil
  import signal
  import sys
  import typing
  import warnings
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Union
  from huggingface_hub import try_to_load_from_cache
  from .utils import HF_MODULES_CACHE, TRANSFORMERS_DYNAMIC_MODULE_NAME, cached_file, extract_commit_hash, is_offline_mode, logging
label_desc: Use image node_id 9 for calling a global function with example usage: get_class_from_dynamic_module(class_reference, pretrained_model_name_or_path, cache_dir, force_download, resume_download, proxies, token, revision, local_files_only, repo_type, code_revision) and returns: get_class_in_module