#NEWLINE# def parse_simpleflake( flake ) : #NEWLINE# #INDENT# 'Parses a simpleflake and returns a named tuple with the parts.' #NEWLINE# timestamp = ( SIMPLEFLAKE_EPOCH + ( extract_bits ( flake , SIMPLEFLAKE_TIMESTAMP_SHIFT , SIMPLEFLAKE_TIMESTAMP_LENGTH ) / 1000.0 ) ) #NEWLINE# random = extract_bits ( flake , SIMPLEFLAKE_RANDOM_SHIFT , SIMPLEFLAKE_RANDOM_LENGTH ) #NEWLINE# return simpleflake_struct ( timestamp , random )