MCPcopy Create free account
hub / github.com/battlecode/battlecode-2018 / extract_s3_bucket

Function extract_s3_bucket

battlecode-manager/player_abstract.py:15–25  ·  view source on GitHub ↗
(bucket, key, destination_directory)

Source from the content-addressed store, hash-verified

13
14
15def extract_s3_bucket(bucket, key, destination_directory):
16 obj = bucket.Object(key)
17 try:
18 with io.BytesIO(obj.get()["Body"].read()) as tf:
19 tf.seek(0)
20 with zipfile.ZipFile(tf, mode='r') as zipf:
21 zipf.extractall(path=destination_directory)
22 return True
23 except Exception as e:
24 print("Invalid s3 key.")
25 return False
26
27
28def dos2unix(directory):

Callers 1

__init__Method · 0.85

Calls 1

readMethod · 0.80

Tested by

no test coverage detected