trains/storage/helper.py
def verify_upload(self, folder_uri='', raise_on_error=True, log_on_error=True):
        """
        Verify that this helper can upload files to a folder.

        An upload is possible iff:
        1. the destination folder is under the base uri of the url used to create the helper
        2. the helper has credentials to write to the destination folder

        :param folder_uri: The destination folder to test. Must be an absolute
            url that begins with the base uri of the url used to create the helper.
        :param raise_on_error: Raise an exception if an upload is not possible
        :param log_on_error: Log an error if an upload is not possible
        :return: True iff an upload to folder_uri is possible.
        """

        folder_uri = self._canonize_url(folder_uri)

        folder_uri = self.conform_url(folder_uri, self._base_url)

        test_path = self._normalize_object_name(folder_uri)

        if self._scheme == 's3':
            self._test_bucket_config(
                self._conf,
                self._log,
                test_path=test_path,
                raise_on_error=raise_on_error,
                log_on_error=log_on_error,
            )
        elif self._scheme == _GoogleCloudStorageDriver.scheme:
            self._driver.test_upload(test_path, self._conf)

        elif self._scheme == 'file':
            # Check path exists
            Path(test_path).mkdir(parents=True, exist_ok=True)
            # check path permissions
            Path(test_path).touch(exist_ok=True)

        return folder_uri

        Verify that this helper can upload files to a folder.

        An upload is possible iff:
        1. the destination folder is under the base uri of the url used to create the helper
        2. the helper has credentials to write to the destination folder

        :param folder_uri: The destination folder to test. Must be an absolute
            url that begins with the base uri of the url used to create the helper.
        :param raise_on_error: Raise an exception if an upload is not possible
        :param log_on_error: Log an error if an upload is not possible
        :return: True iff an upload to folder_uri is possible.
        
Verify that this helper can upload files to a folder.
An upload is possible iff:
1. the destination folder is under the base uri of the url used to create the helper
2. the helper has credentials to write to the destination folder
Verify that this helper can upload files to a folder . An upload is possible iff : 1 . the destination folder is under the base uri of the url used to create the helper 2 . the helper has credentials to write to the destination folder
def verify_upload(self, folder_uri='', raise_on_error=True, log_on_error=True):
        folder_uri = self._canonize_url(folder_uri)
        folder_uri = self.conform_url(folder_uri, self._base_url)
        test_path = self._normalize_object_name(folder_uri)
        if self._scheme == 's3':
            self._test_bucket_config(
                self._conf,
                self._log,
                test_path=test_path,
                raise_on_error=raise_on_error,
                log_on_error=log_on_error,
            )
        elif self._scheme == _GoogleCloudStorageDriver.scheme:
            self._driver.test_upload(test_path, self._conf)
        elif self._scheme == 'file':
            Path(test_path).mkdir(parents=True, exist_ok=True)
            Path(test_path).touch(exist_ok=True)
        return folder_uri
def verify_upload ( self , folder_uri = '' , raise_on_error = True , log_on_error = True ) : folder_uri = self . _canonize_url ( folder_uri ) folder_uri = self . conform_url ( folder_uri , self . _base_url ) test_path = self . _normalize_object_name ( folder_uri ) if self . _scheme == 's3' : self . _test_bucket_config ( self . _conf , self . _log , test_path = test_path , raise_on_error = raise_on_error , log_on_error = log_on_error , ) elif self . _scheme == _GoogleCloudStorageDriver . scheme : self . _driver . test_upload ( test_path , self . _conf ) elif self . _scheme == 'file' : Path ( test_path ) . mkdir ( parents = True , exist_ok = True ) Path ( test_path ) . touch ( exist_ok = True ) return folder_uri
Verify that this helper can upload files to a folder.
Verify that this helper can upload files to a folder .
"""
        Verify that this helper can upload files to a folder.

        An upload is possible iff:
        1. the destination folder is under the base uri of the url used to create the helper
        2. the helper has credentials to write to the destination folder

        :param folder_uri: The destination folder to test. Must be an absolute
            url that begins with the base uri of the url used to create the helper.
        :param raise_on_error: Raise an exception if an upload is not possible
        :param log_on_error: Log an error if an upload is not possible
        :return: True iff an upload to folder_uri is possible.
        """ # Check path exists # check path permissions
True iff an upload to folder_uri is possible.
True iff an upload to folder_uri is possible .
self
folder_uri
The destination folder to test. Must be an absolute
url that begins with the base uri of the url used to create the helper.
The destination folder to test . Must be an absolute url that begins with the base uri of the url used to create the helper .
raise_on_error
Raise an exception if an upload is not possible
Raise an exception if an upload is not possible
log_on_error
Log an error if an upload is not possible
Log an error if an upload is not possible