code: def set_user_agent(self, user_agent):
          
          # set a default user_agent if not specified
          if user_agent is None:
              requests_ua = requests.utils.default_user_agent()
              user_agent = '%s (%s/%s)' % (requests_ua, __title__, __version__)
  
          # the requests module uses a case-insensitive dict for session headers
          self.session.headers['User-agent'] = user_agent
docs: Replaces the current user agent in the requests session headers.