def long_to_bytes(n, blocksize=<NUM_LIT:0>):
<EOL>s = b'<STR_LIT>'<EOL>n = int(n)<EOL>pack = struct.pack<EOL>while n > <NUM_LIT:0>:<EOL><INDENT>s = pack('<STR_LIT>', n & <NUM_LIT>) + s<EOL>n = n >> <NUM_LIT:32><EOL><DEDENT>for i in range(len(s)):<EOL><INDENT>if s[i] != '<STR_LIT>':<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>s = '<STR_LIT>'<EOL>i = <NUM_LIT:0><EOL><DEDENT>s = s[i:]<EOL>if blocksize > <NUM_LIT:0> and len(s) % blocksize:<EOL><INDENT>s = (blocksize - len(s) % blocksize) * '<STR_LIT>' + s<EOL><DEDENT>return s<EOL>
long_to_bytes(n:long, blocksize:int) : string
    Convert a long integer to a byte string.

    If optional blocksize is given and greater than zero, pad the front of the
    byte string with binary zeros so that the length is a multiple of
    blocksize.