tensorflow_probability/python/mcmc/internal/util.py
def is_namedtuple_like(x):
  """Helper which returns `True` if input is `collections.namedtuple`-like."""
  try:
    for fn in x._fields:
      _ = getattr(x, fn)
    return True
  except AttributeError:
    return False
def is_namedtuple_like(x):
  try:
    for fn in x._fields:
      _ = getattr(x, fn)
    return True
  except AttributeError:
    return False
def is_namedtuple_like ( x ) : try : for fn in x . _fields : _ = getattr ( x , fn ) return True except AttributeError : return False
Helper which returns `True` if input is `collections.namedtuple`-like.
Helper which returns True if input is collections . namedtuple - like .