def get_address(pk, main_net=True, prefix=None):
if isinstance(pk, str):<EOL><INDENT>pk = unhexlify(pk.encode())<EOL><DEDENT>assert len(pk) == <NUM_LIT:32>, '<STR_LIT>'.format(len(pk))<EOL>k = keccak_256(pk).digest()<EOL>ripe = RIPEMD160.new(k).digest()<EOL>if prefix is None:<EOL><INDENT>body = (b"<STR_LIT>" if main_net else b"<STR_LIT>") + ripe<EOL><DEDENT>else:<EOL><INDENT>assert isinstance(prefix, bytes), '<STR_LIT>'<EOL>body = prefix + ripe<EOL><DEDENT>checksum = keccak_256(body).digest()[<NUM_LIT:0>:<NUM_LIT:4>]<EOL>return b32encode(body + checksum).decode()<EOL>
compute the nem-py address from the public one