def is_sequence(obj):
  """
  Determines whether the given value is a sequence.

  Sets, lists, tuples, bytes, dicts, and strings are treated as sequence.

  :param obj:
      The value to test.
  :returns:
      ``True`` if value is a sequence; ``False`` otherwise.
  """
  try:
    list(obj)
    return True
  except TypeError:  #, exception:
    #assert "is not iterable" in bytes(exception)
    return False