def _value_from_stopiteration(e):
    try:
        # StopIteration has a value attribute beginning in py33.
        # So does our Return class.
        return e.value
    except AttributeError:
        pass
    try:
        # Cython backports coroutine functionality by putting the value in
        # e.args[0].
        return e.args[0]
    except (__HOLE__, IndexError):
        return None
dataset/ETHPy150Open tornadoweb/tornado/tornado/gen.py/_value_from_stopiteration