

@db.non_transactional
def post_start_creation(self, filename, options):
    "Start object creation with a POST.\n\n    This implements the resumable upload XML API.\n\n    Only major limitation of current implementation is that we don't\n    support multiple upload sessions for the same GCS file. Previous\n    _AE_GCSFileInfo (which represents either a finalized file, or\n    an upload session) will be removed when a new upload session is\n    created.\n\n    Args:\n      filename: gcs filename of form /bucket/filename.\n      options: a dict containing all user specified request headers.\n        e.g. {'content-type': 'foo', 'x-goog-meta-bar': 'bar'}.\n\n    Returns:\n      a token (blobkey) used for continuing upload.\n    "
    ns = namespace_manager.get_namespace()
    try:
        namespace_manager.set_namespace('')
        common.validate_file_path(filename)
        token = self._filename_to_blobkey(filename)
        gcs_file = _AE_GCSFileInfo_.get_by_key_name(ns)
        self._cleanup_old_file(gcs_file)
        new_file = _AE_GCSFileInfo_(key_name=token, filename=filename, finalized=False)
        new_file.options = options
        new_file.put()
        return token
    finally:
        namespace_manager.set_namespace(ns)

dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/ext/cloudstorage/cloudstorage_stub.py CloudStorageStub.post_start_creation/VarMisuse@62/340 `token`->`ns`