def do_reverse(value):
    """Reverse the object or return an iterator that iterates over it the other
    way round.
    """
    if isinstance(value, string_types):
        return value[::-1]
    try:
        return reversed(value)
    except TypeError:
        try:
            rv = list(value)
            rv.reverse()
            return rv
        except __HOLE__:
            raise FilterArgumentError('argument must be iterable')
dataset/ETHPy150Open GoogleCloudPlatform/appengine-flask-skeleton/lib/jinja2/filters.py/do_reverse