MCPcopy Create free account
hub / github.com/ActiveState/code / load_HST

Function load_HST

recipes/Python/502267_Marks_Game/recipe-502267.py:109–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107# HST PREPARATION FUNCTIONS
108
109def load_HST():
110 # Load (H)igh (S)core (T)able.
111 try:
112 database = eval(zlib.decompress(file(HST_FILE, 'rb').read()))
113 names = 0
114 records = sum(map(len, SAMPLE_HST.values()))
115 for key in database.keys():
116 assert isinstance(key, int)
117 assert isinstance(database[key], list)
118 for name in database[key]:
119 assert isinstance(name, str)
120 names += 1
121 assert names <= records
122 assert names == records
123 return database
124 except:
125 return SAMPLE_HST
126
127def format_HST(database):
128 # Format HST database to string.

Callers 1

high_score_tableFunction · 0.85

Calls 5

mapFunction · 0.85
sumFunction · 0.50
readMethod · 0.45
valuesMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected