code: def encode(self) -> str:
          
          creds = ('%s:%s' % (self.login, self.password)).encode(self.encoding)
          return 'Basic %s' % base64.b64encode(creds).decode(self.encoding)
docs: Encode credentials.