code: def dim(self, dim):
          
          # Assume dim display.
          contrast = 0
          # Adjust contrast based on VCC if not dimming.
          if not dim:
              if self._vccstate == SSD1306_EXTERNALVCC:
                  contrast = 0x9F
              else:
                  contrast = 0xCF
docs: Adjusts contrast to dim the display if dim is True, otherwise sets the
          contrast to normal brightness if dim is False.