human
Complete this python program:
def main(input, output):
assistant
#Here is the Python code you requested.

    """Prints out input just as xxd would do it.
    """
    offset = 0
    bytes_per_line = 16
    bytes_per_sentence = 2
    input_chunk = (bytes_per_line * 10)
    while True:
        data = input.read(bytes_per_line)
        if (data == ''):
            return
        for (off, ordinals, printable) in xxd(offset, data, bytes_per_line, bytes_per_sentence):
            def ashex(ord):
                return ('%02x' % ord)
            hex = '    '.join([''.join(map(ashex, sentence)) for sentence in ordinals])
            hex = hex.ljust((((bytes_per_line * 2) + (bytes_per_line / bytes_per_sentence)) - 1))
            output.write(('%07x:    %s        %s\n' % (off, hex, printable)))
        offset += len(data)