'Create a new request context from a WSGI environ.
The request context is used to push/pop the threadlocals required
when processing the request. It also contains an initialized
:class:`pyramid.interfaces.IRequest` instance using the registered
:class:`pyramid.interfaces.IRequestFactory`. The context may be
used as a context manager to control the threadlocal lifecycle:
.. code-block:: python
with router.request_context(environ) as request:
Alternatively, the context may be used without the ``with`` statement
by manually invoking its ``begin()`` and ``end()`` methods.
.. code-block:: python
ctx = router.request_context(environ)
request = ctx.begin()
try:
finally:
ctx.end()'

def request_context(self, environ):

    request = self.request_factory(environ)
    request.registry = self.registry
    request.invoke_subrequest = self.invoke_subrequest
    extensions = self.request_extensions
    if (extensions is not None):
        apply_request_extensions(request, extensions=extensions)
    return RequestContext(request)
