code: def get_callable_from_script(
      script_path: str, func_name: str = "main"
  ) -> Callable:
      """Convert a module to a callable function and call the `main` function of
      the module.
  
      Args:
          script_path: str, the file path to the python script to run. It can
              either be given as a module i.e. in the [package.]*[module] form,
              or as a path to a *.py file in case it is not added into the
              PYTHONPATH environment variable.
          func_name: str, the name of the function to run.
  
      Returns:
          The wrapper which calls a function from the script module.
  
      Raises:
            `AttributeError` if the script does not define a `func_name` function.
      """
  
      def wrapper(*args):
          module = import_script(script_path)
          if not hasattr(module, func_name):
              raise AttributeError(
                  f"Cannot find {func_name} function in {script_path}."
              )
          return getattr(module, func_name)(*args)
  
      return wrapper
  
imports: import enum
  import importlib
  import os
  import pickle
  import re
  import subprocess
  import sys
  import tempfile
  import time
  from dataclasses import dataclass, field
  from functools import partial
  from typing import Any, Callable, Dict, List, Tuple, Union
label_desc: Use image node_id 5 for calling a global function with example usage: get_callable_from_script(script_path, func_name) and returns: wrapper, getattr