code: def login(self, user_id, password):
          
  
          self._session = requests.session()
          self._session.verify = self._verify_certs
          self._session.auth = (user_id, password)
  
          try:
              self._update_capabilities()
  
              url_components = parse.urlparse(self.url)
              if self._dav_endpoint_version == 1:
                  self._davpath = url_components.path + 'remote.php/dav/files/' + parse.quote(user_id)
                  self._webdav_url = self.url + 'remote.php/dav/files/' + parse.quote(user_id)
              else:
                  self._davpath = url_components.path + 'remote.php/webdav'
                  self._webdav_url = self.url + 'remote.php/webdav'
  
          except HTTPResponseError as e:
              self._session.close()
              self._session = None
              raise e
docs: Authenticate to ownCloud.
          This will create a session on the server.
  
          :param user_id: user id
          :param password: password
          :raises: HTTPResponseError in case an HTTP error status was returned