code: def signed_session(self, session=None):
          
          session = super(AdalAuthentication, self).signed_session(session)
  
          try:
              raw_token = self._adal_method(*self._args, **self._kwargs)
          except adal.AdalError as err:
              # pylint: disable=no-member
              if 'AADSTS70008:' in ((getattr(err, 'error_response', None) or {}).get('error_description') or ''):
                  raise Expired("Credentials have expired due to inactivity.")
              else:
                  raise AuthenticationError(err)
          except ConnectionError as err:
              raise AuthenticationError('Please ensure you have network connection. Error detail: ' + str(err))
  
          scheme, token = raw_token['tokenType'], raw_token['accessToken']
          header = "{} {}".format(scheme, token)
          session.headers['Authorization'] = header
          return session
docs: Create requests session with any required auth headers applied.
  
          If a session object is provided, configure it directly. Otherwise,
          create a new session and return it.
  
          :param session: The session to configure for authentication
          :type session: requests.Session
          :rtype: requests.Session