def calculate_coverage(runtime_bytecode, seen):
count, total = <NUM_LIT:0>, <NUM_LIT:0><EOL>bytecode = SolidityMetadata._without_metadata(runtime_bytecode)<EOL>for i in EVMAsm.disassemble_all(bytecode):<EOL><INDENT>if i.pc in seen:<EOL><INDENT>count += <NUM_LIT:1><EOL><DEDENT>total += <NUM_LIT:1><EOL><DEDENT>if total == <NUM_LIT:0>:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>return count * <NUM_LIT> / total<EOL>
Calculates what percentage of runtime_bytecode has been seen