Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _consume_life_bar_graph(buffer):
life_bar_graph_raw = consume_string(buffer)
return [
(datetime.timedelta(milliseconds=int(offset)), float(value))
for offset, value in (
pair.split('|') for pair in life_bar_graph_raw.split(',') if pair
)
use_client = client is not None
if use_client:
if library is not None:
raise ValueError(
'only one of library or client can be passed'
)
library = client.library
buffer = bytearray(data)
mode = GameMode(consume_byte(buffer))
version = consume_int(buffer)
beatmap_md5 = consume_string(buffer)
player_name = consume_string(buffer)
replay_md5 = consume_string(buffer)
count_300 = consume_short(buffer)
count_100 = consume_short(buffer)
count_50 = consume_short(buffer)
count_geki = consume_short(buffer)
count_katu = consume_short(buffer)
count_miss = consume_short(buffer)
score = consume_int(buffer)
max_combo = consume_short(buffer)
full_combo = bool(consume_byte(buffer))
mod_mask = consume_int(buffer)
life_bar_graph = _consume_life_bar_graph(buffer)
timestamp = consume_datetime(buffer)
actions = _consume_actions(buffer)
mod_kwargs = Mod.unpack(mod_mask)
# delete the alias field names
' beatmap to be retrieved',
)
use_client = client is not None
if use_client:
if library is not None:
raise ValueError(
'only one of library or client can be passed'
)
library = client.library
buffer = bytearray(data)
mode = GameMode(consume_byte(buffer))
version = consume_int(buffer)
beatmap_md5 = consume_string(buffer)
player_name = consume_string(buffer)
replay_md5 = consume_string(buffer)
count_300 = consume_short(buffer)
count_100 = consume_short(buffer)
count_50 = consume_short(buffer)
count_geki = consume_short(buffer)
count_katu = consume_short(buffer)
count_miss = consume_short(buffer)
score = consume_int(buffer)
max_combo = consume_short(buffer)
full_combo = bool(consume_byte(buffer))
mod_mask = consume_int(buffer)
life_bar_graph = _consume_life_bar_graph(buffer)
timestamp = consume_datetime(buffer)
actions = _consume_actions(buffer)
)
use_client = client is not None
if use_client:
if library is not None:
raise ValueError(
'only one of library or client can be passed'
)
library = client.library
buffer = bytearray(data)
mode = GameMode(consume_byte(buffer))
version = consume_int(buffer)
beatmap_md5 = consume_string(buffer)
player_name = consume_string(buffer)
replay_md5 = consume_string(buffer)
count_300 = consume_short(buffer)
count_100 = consume_short(buffer)
count_50 = consume_short(buffer)
count_geki = consume_short(buffer)
count_katu = consume_short(buffer)
count_miss = consume_short(buffer)
score = consume_int(buffer)
max_combo = consume_short(buffer)
full_combo = bool(consume_byte(buffer))
mod_mask = consume_int(buffer)
life_bar_graph = _consume_life_bar_graph(buffer)
timestamp = consume_datetime(buffer)
actions = _consume_actions(buffer)
mod_kwargs = Mod.unpack(mod_mask)