code: def update_auth(self, auth: Optional[BasicAuth]) -> None:
          
          if auth is None:
              auth = self.auth
          if auth is None:
              return
  
          if not isinstance(auth, helpers.BasicAuth):
              raise TypeError('BasicAuth() tuple is required instead')
  
          self.headers[hdrs.AUTHORIZATION] = auth.encode()
docs: Set basic auth.