code: def _call_fn_maybe_with_seed(fn, args, *, seed=None):
      try:
          return nest_util.call_fn(
              functools.partial(fn, seed=seed), args
          )
      except (TypeError, ValueError) as e:
          if "'seed'" in str(e) or (
              "one of *args or **kwargs" in str(e)
          ):
              return nest_util.call_fn(fn, args)
          else:
              raise e
  
imports: import enum
  import functools
  import warnings
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python import monte_carlo
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import nest_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal.reparameterization import FULLY_REPARAMETERIZED
  from tensorflow_probability.python.stats.leave_one_out import log_soomean_exp
  from tensorflow.python.util import deprecation
label_desc: Use image node_id 1 for calling a global function with example usage: _call_fn_maybe_with_seed(fn, args) and returns: nest_util, nest_util