


'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCAmelCase_		:   Optional[int]							   =		{"""configuration_ibert""": ["""IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """IBertConfig""", """IBertOnnxConfig"""]}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				UpperCAmelCase_		:   int							   =		[
				    """IBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
				    """IBertForMaskedLM""",
				    """IBertForMultipleChoice""",
				    """IBertForQuestionAnswering""",
				    """IBertForSequenceClassification""",
				    """IBertForTokenClassification""",
				    """IBertModel""",
				    """IBertPreTrainedModel""",
				]

if TYPE_CHECKING:
				from .configuration_ibert import IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, IBertConfig, IBertOnnxConfig

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_ibert import (
								    IBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
								    IBertForMaskedLM,
								    IBertForMultipleChoice,
								    IBertForQuestionAnswering,
								    IBertForSequenceClassification,
								    IBertForTokenClassification,
								    IBertModel,
								    IBertPreTrainedModel,
								)

else:
				import sys

				UpperCAmelCase_		:   Tuple							   =		_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)







from PIL import Image





def 					__lowerCamelCase	( UpperCamelCase__   ,							UpperCamelCase__      ):







							'''simple docstring'''






							snake_case_							=    (259 * (level + 255)) / (255 * (259 - level))

							def contrast(UpperCamelCase__      ) -> int:
														return int(128 + factor * (c - 128)      )

							return img.point(UpperCamelCase__      )


if __name__ == "__main__":
					# Load image
					with Image.open("""image_data/lena.jpg""") as img:
										# Change contrast to 170
										_UpperCAmelCase		:   Tuple										=       change_contrast(img, 170)
										cont_img.save("""image_data/lena_high_contrast.png""", format="""png""")




