def METHOD_NAME(shape, payload_size):
    # First, calculate overhead from commas.
    try:
        rows, columns = shape
    except ValueError:
        rows = 1
        columns = shape[0]
    # Override number of rows.
    if payload_size:
        # Divide by two given the assumption is that inputs are single-digit integers separate by commas and lines
        # end in newline characters.
        rows = int(math.ceil((float(payload_size) / columns / 2.0)))
    row = ",".join(map(lambda x: str(x), _random_input(columns)))
    return "\n".join([row for _ in range(0, rows)])