def format_hexdump(arg):
line = '<STR_LIT>'<EOL>for i in range(<NUM_LIT:0>, len(arg), <NUM_LIT:16>):<EOL><INDENT>if i > <NUM_LIT:0>:<EOL><INDENT>line += '<STR_LIT:\n>'<EOL><DEDENT>chunk = arg[i:i + <NUM_LIT:16>]<EOL>hex_chunk = hexlify(chunk).decode('<STR_LIT:utf-8>')<EOL>hex_line = '<STR_LIT:U+0020>'.join(hex_chunk[j:j + <NUM_LIT:2>] for j in range(<NUM_LIT:0>, len(hex_chunk), <NUM_LIT:2>))<EOL>if len(hex_line) < (<NUM_LIT:3> * <NUM_LIT:16>) - <NUM_LIT:1>:<EOL><INDENT>hex_line += '<STR_LIT:U+0020>' * (((<NUM_LIT:3> * <NUM_LIT:16>) - <NUM_LIT:1>) - len(hex_line))<EOL><DEDENT>ascii_line = '<STR_LIT>'.join(_convert_to_ascii(x) for x in chunk)<EOL>offset_line = '<STR_LIT>' % i<EOL>line += "<STR_LIT>" % (offset_line, hex_line, ascii_line)<EOL><DEDENT>return line<EOL>
Convert the bytes object to a hexdump.

    The output format will be:

    <offset, 4-byte>  <16-bytes of output separated by 1 space>  <16 ascii characters>