code: def combine_signatures(
      sig1: Union[inspect.Signature, None],
      sig2: Union[inspect.Signature, None],
  ):
      """
      Utility function which combines the signatures of two functions.
      """
      if sig1 is None:
          return sig2
      if sig2 is None:
          return sig1
  
      # Get all params from sig1
      sig1 = deepcopy(sig1)
      params = list(sig1.parameters.values())
      for n, param in enumerate(params):
          if param.kind in {
              inspect.Parameter.VAR_POSITIONAL,
              inspect.Parameter.VAR_KEYWORD,
          }:
              break
      else:
          n = len(params)
  
      # Add non-overlapping params from sig2
      for param in sig2.parameters.values():
          if param.kind in {
              inspect.Parameter.VAR_POSITIONAL,
              inspect.Parameter.VAR_KEYWORD,
          }:
              break
          if param.name not in sig1.parameters:
              params.insert(n, param)
              n += 1
  
      return sig1.replace(parameters=params)
  
imports: from abc import ABCMeta
  from collections import OrderedDict
  from copy import deepcopy
  from functools import wraps
  import importlib
  import inspect
  import re
  from typing import Callable, Union
label_desc: Use image node_id 1 for calling a global function with example usage: combine_signatures(sig1, sig2) and returns: sig1, sig2, sig1