parameters: (self, source_path, dest_path)
docstring: Uploads a directory to cloud storage.
docstring_summary: Uploads a directory to cloud storage.
docstring_tokens: Uploads a directory to cloud storage .
function: def upload_dir_to_bucket(self, source_path, dest_path):
      """Uploads a directory to cloud storage."""
      canonical_path = GcsHelper._canonicalize_dir_path(source_path)
  
      files = list()
      for dirpath, _, filenames in os.walk(canonical_path):
        files += [os.path.join(dirpath, f) for f in filenames]
  
      bucket, prefix = GcsHelper._split_gcs_path(
          GcsHelper._canonicalize_dir_path(dest_path))
      bucket_client = self.client.get_bucket(bucket)
  
      for f in files:
        relative_file = f[len(canonical_path):]
        bucket_client.blob(prefix + relative_file).upload_from_filename(f)
function_tokens: def upload_dir_to_bucket ( self , source_path , dest_path ) : canonical_path = GcsHelper . _canonicalize_dir_path ( source_path ) files = list ( ) for dirpath , _ , filenames in os . walk ( canonical_path ) : files += [ os . path . join ( dirpath , f ) for f in filenames ] bucket , prefix = GcsHelper . _split_gcs_path ( GcsHelper . _canonicalize_dir_path ( dest_path ) ) bucket_client = self . client . get_bucket ( bucket ) for f in files : relative_file = f [ len ( canonical_path ) : ] bucket_client . blob ( prefix + relative_file ) . upload_from_filename ( f )