code: def _get_required_args(fn, previous_args=()):
      """Returns the distribution's required args."""
      argspec = tf_inspect.getfullargspec(fn)
      args = argspec.args
      if argspec.varargs or argspec.varkw:
          args = args + list(previous_args)
      if tf_inspect.isclass(fn):
          args = args[1:]  # Remove the `self` arg.
      if argspec.defaults:
          # Remove the args which have defaults. By convention we only feed
          # *required args*. This means some distributions must always be wrapped
          # with a `lambda`, e.g., `lambda logits: tfd.Bernoulli(logits=logits)`
          # or `lambda probs: tfd.Bernoulli(probs=probs)`.
          args = args[: -len(argspec.defaults)]
      return tuple(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 4 for calling a global function with example usage: _get_required_args(fn, previous_args) and returns: tuple