def printable_device(device):
    """Returns a printable form of a device record."""
    if device is None:
        return "<device NULL>"

    output_list = []
    assert device.StartSize + len(device.DeltaValue) - 1 == device.EndSize
    for index in range(len(device.DeltaValue)):
        output_list.append(
            "%d %d" % (device.StartSize + index, device.DeltaValue[index])
        )
    return "<device %s>" % (", ".join(output_list))