<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_contrast(self, contrast):
 """ Adjusts the image contrast. Contrast refers to the rate of change of color with color level. At low contrast, color changes gradually over many intensity levels, while at high contrast it can change rapidly within a few levels Args: contrast: float A number between 0 and 1. Note that upon initialization the colormap has a default contrast value of 0.5. Returns: void """

        self._contrast = contrast

        self.x_spread = 2 * (1.0 - contrast)
        self.y_spread = 2.0 - 2 * (1.0 - contrast)

        self._build_cdict()