code: def import_func_from_string(
      func_string: str,
  ):  # -> Optional[Callable]:
      func = getattr(np, func_string, None)
      if func is not None:
          return func
  
      # Not inside NumPy or Scipy. So probably another package like scipy.
      module = None
      items = func_string.split(".")
      for idx in range(1, len(items)):
          try:
              module = __import__(".".join(items[:idx]))
          except ImportError:
              break
  
      if module:
          for sub in items[1:]:
              try:
                  module = getattr(module, sub)
              except AttributeError:
                  module = None
                  break
          return module
  
file_path: pytensor/pytensor/tensor/utils.py
imports: import re
  from collections.abc import Sequence
  from typing import Union
  import numpy
  import pytensor
  from pytensor.utils import hash_from_code
label_desc: Use image node_id 4 for calling a global function with example usage: import_func_from_string(func_string) and returns: func, module