MCPcopy Create free account
hub / github.com/THUDM/GLM / split_s3_path

Function split_s3_path

data_utils/file_utils.py:114–124  ·  view source on GitHub ↗

Split a full s3 path into the bucket name and path.

(url)

Source from the content-addressed store, hash-verified

112
113
114def split_s3_path(url):
115 """Split a full s3 path into the bucket name and path."""
116 parsed = urlparse(url)
117 if not parsed.netloc or not parsed.path:
118 raise ValueError("bad s3 path {}".format(url))
119 bucket_name = parsed.netloc
120 s3_path = parsed.path
121 # Remove '/' at beginning of path.
122 if s3_path.startswith("/"):
123 s3_path = s3_path[1:]
124 return bucket_name, s3_path
125
126
127def s3_request(func):

Callers 2

s3_etagFunction · 0.85
s3_getFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected