def METHOD_NAME(data_range):
    source = large_image.new()
    tile_grid = [
        int(random.randint(*possible_axes['x'])),
        int(random.randint(*possible_axes['y'])),
    ]
    if data_range is None:
        data_range = random.choice(possible_data_ranges)
    # create comparison matrix at max size and fill with zeros
    expected_shape = get_dims(
        tile_grid[1] * max_tile_size, tile_grid[0] * max_tile_size, 4, True,
    )
    expected = np.ndarray(expected_shape)
    expected.fill(0)
    max_x, max_y = 0, 0
    print(
        f'placing {tile_grid[0] * tile_grid[1]} random tiles in available space: {expected_shape}')
    print('tile overlap ratio:', tile_overlap_ratio)
    print('data range:', data_range)
    for x in range(tile_grid[0]):
        for y in range(tile_grid[1]):
            start_location = [
                int(x * max_tile_size * tile_overlap_ratio),
                int(y * max_tile_size * tile_overlap_ratio),
            ]
            tile, mask = random_tile(data_range)
            tile_shape = tile.shape
            source.addTile(tile, *start_location, mask=mask)
            max_x = max(max_x, start_location[1] + tile_shape[0])
            max_y = max(max_y, start_location[0] + tile_shape[1])
            framed_tile = np.array(frame_with_zeros(
                tile,
                expected.shape,
                start_location=start_location[::-1],
            ))
            framed_mask = np.array(frame_with_zeros(
                mask.repeat(tile_shape[-1], -1).reshape(tile_shape),
                expected.shape,
                start_location=start_location[::-1],
            ))
            np.putmask(expected, framed_mask, framed_tile)
    with tempfile.TemporaryDirectory() as tmp_dir:
        # TODO: make destination use mdf5 extension
        destination = pathlib.Path(tmp_dir, 'sample.tiff')
        source.write(destination, lossy=False)
        result, _ = source.getRegion(format='numpy')
    # trim unused space from expected
    expected = expected[:max_x, :max_y]
    # round to specified precision
    precision_vector = np.vectorize(signif)
    expected = precision_vector(expected, data_range[0], data_range[1], data_range[2])
    result = precision_vector(result, data_range[0], data_range[1], data_range[2])
    # ignore alpha values for now
    expected = expected.take(indices=range(-1), axis=-1)
    result = result.take(indices=range(-1), axis=-1)
    # For debugging
    # difference = numpy.subtract(result, expected)
    # print(difference)
    # print(expected[numpy.nonzero(difference)])
    # print(result[numpy.nonzero(difference)])
    assert np.array_equal(result, expected)
    # resultFromFile, _ = large_image.open(destination).getRegion(format='numpy')
    # print(resultFromFile.shape, result.shape)
    # assert numpy.array_equal(result, resultFromFile)
    print(f'Success; result matrix {result.shape} equals expected matrix {expected.shape}.')
    source = None
    cachesClear()