def METHOD_NAME():
    """Test the smooth module with polynomial fitting"""
    numpy.random.seed(0)
    #
    # Make an image that has a single sinusoidal cycle with different
    # phase in i and j. Make it a little out-of-bounds to start to test
    # clipping
    #
    i, j = numpy.mgrid[0:100, 0:100].astype(float) * numpy.pi / 50
    image = (numpy.sin(i) + numpy.cos(j)) / 1.8 + 0.9
    image += numpy.random.uniform(size=(100, 100)) * 0.1
    mask = numpy.ones(image.shape, bool)
    mask[40:60, 45:65] = False
    for clip in (False, True):
        expected = centrosome.smooth.fit_polynomial(image, mask, clip)
        assert numpy.all((expected >= 0) & (expected <= 1)) == clip
        workspace, module = make_workspace(image, mask)
        module.smoothing_method.value = cellprofiler.modules.smooth.FIT_POLYNOMIAL
        module.clip.value = clip
        module.run(workspace)
        result = workspace.image_set.get_image(OUTPUT_IMAGE_NAME)
        assert not (result is None)
        numpy.testing.assert_almost_equal(result.pixel_data, expected)