def _is_iterable(obj):
  """A Python 2 and 3 compatible util to check whether `obj` is iterable."""
  try:
    iter(obj)
    return True
  except TypeError:
    return False
A Python 2 and 3 compatible util to check whether `obj` is iterable.
src/tpu_estimator.py