def get_event_loop():
ev = _state.event_loop<EOL>if not os.getenv(_EVENT_LOOP_KEY) and ev is not None:<EOL><INDENT>ev.clear()<EOL>_state.event_loop = None<EOL>ev = None<EOL><DEDENT>if ev is None:<EOL><INDENT>ev = EventLoop()<EOL>_state.event_loop = ev<EOL>os.environ[_EVENT_LOOP_KEY] = '<STR_LIT:1>'<EOL><DEDENT>return ev<EOL>
Return a EventLoop instance.

    A new instance is created for each new HTTP request.  We determine
    that we're in a new request by inspecting os.environ, which is reset
    at the start of each request.  Also, each thread gets its own loop.