code: def send(self, request, **kwargs):
          
          session = request.context.session
  
          old_max_redirects = None
          if 'max_redirects' in kwargs:
              warnings.warn("max_redirects in operation kwargs is deprecated, use config.redirect_policy instead",
                            DeprecationWarning)
              old_max_redirects = session.max_redirects
              session.max_redirects = int(kwargs['max_redirects'])
  
          old_trust_env = None
          if 'use_env_proxies' in kwargs:
              warnings.warn("use_env_proxies in operation kwargs is deprecated, use config.proxies instead",
                            DeprecationWarning)
              old_trust_env = session.trust_env
              session.trust_env = bool(kwargs['use_env_proxies'])
  
          old_retries = {}
          if 'retries' in kwargs:
              warnings.warn("retries in operation kwargs is deprecated, use config.retry_policy instead",
                            DeprecationWarning)
              max_retries = kwargs['retries']
              for protocol in self._protocols:
                  old_retries[protocol] = session.adapters[protocol].max_retries
                  session.adapters[protocol].max_retries = max_retries
  
          try:
              return self.next.send(request, **kwargs)
          finally:
              if old_max_redirects:
                  session.max_redirects = old_max_redirects
  
              if old_trust_env:
                  session.trust_env = old_trust_env
  
              if old_retries:
                  for protocol in self._protocols:
                      session.adapters[protocol].max_retries = old_retries[protocol]
docs: Patch the current session with Request level operation config.
  
          This is deprecated, we shouldn't patch the session with
          arguments at the Request, and "config" should be used.