def is_sequence(obj):
    """
    Returns :samp:`True` if argument :samp:`{obj}` is
    a sequence (e.g. a :obj:`list` or :obj:`tuple`, etc).

    :type obj: :obj:`object`
    :param obj: Return :samp:`True` if this is a sequence.
    :rtype: :obj:`bool`
    :return: :samp:`True` if :samp:`{obj}` is a sequence.

    Example::

       >>> is_sequence([1, 2, 3])
       True
       >>> is_sequence([i for i in range(0, 3)])
       True
       >>> is_sequence(5)
       False

    """
    return (
        hasattr(obj, "__len__")
        or
        hasattr(obj, "__getitem__")
        or
        hasattr(obj, "__iter__")
    )