code: def _unify_call_signature(i, dist_fn):
      """Creates `dist_fn_wrapped` which calls `dist_fn` with all prev nodes.
  
      Args:
        i: Python `int` corresponding to position in topologically sorted DAG.
        dist_fn: Python `callable` which takes a subset of previously constructed
          distributions (in reverse order) and produces a new distribution instance.
  
      Returns:
        dist_fn_wrapped: Python `callable` which takes all previous distributions
          (in non reverse order) and produces a new distribution instance.
        args: `tuple` of `str` representing the arg names of `dist_fn` (and in non
          wrapped, "natural" order). `None` is returned only if the input is not a
          `callable`.
      """
      if distribution_util.is_distribution_instance(dist_fn):
          return (lambda *_: dist_fn), None
  
      if not callable(dist_fn):
          raise TypeError(
              "{} must be either `tfd.Distribution`-like or "
              "`callable`.".format(dist_fn)
          )
  
      args = _get_required_args(dist_fn, previous_args=range(i))
      if not args:
          return (lambda *_: dist_fn()), ()
  
      @functools.wraps(dist_fn)
      def dist_fn_wrapped(*xs):
          """Calls `dist_fn` with reversed and truncated args."""
          if i != len(xs):
              raise ValueError(
                  "Internal Error: Unexpected number of inputs provided to {}-th "
                  "distribution maker (dist_fn: {}, expected: {}, saw: {}).".format(
                      i, dist_fn, i, len(xs)
                  )
              )
          if len(xs) < len(args):
              raise ValueError(
                  "Internal Error: Too few inputs provided to {}-th distribution maker "
                  "(dist_fn: {}, expected: {}, saw: {}).".format(
                      i, dist_fn, len(args), len(xs)
                  )
              )
          return dist_fn(*reversed(xs[-len(args) :]))
  
      return dist_fn_wrapped, args
  
imports: import collections
  import functools
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import joint_distribution
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.internal import auto_composite_tensor
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 2 for calling a global function with example usage: _unify_call_signature(i, dist_fn) and returns: dist_fn_wrapped,  args, function,  None, function,  , dist_fn