


'''simple docstring'''

from PIL import Image

def 							__magic_name__(						lowerCamelCase,				lowerCamelCase):

						def brightness(lowerCamelCase) -> float:
												return 1_2_8 + level + (c - 1_2_8)

						if not -2_5_5.0 <= level <= 2_5_5.0:
												raise ValueError('''level must be between -255.0 (black) and 255.0 (white)''')
						return img.point(_SCREAMING_SNAKE_CASE)


if __name__ == "__main__":
	# Load image
	with Image.open("""image_data/lena.jpg""") as img:
		# Change brightness to 100
		_UpperCAmelCase				: int							    =				change_brightness(img, 1_0_0)
		brigt_img.save("""image_data/lena_brightness.png""", format="""png""")







'''simple docstring'''

import numpy as np

from transformers import Pipeline

def 							__magic_name__(						lowerCamelCase):
						__lowerCAmelCase							       =				np.max(lowerCamelCase,				axis=-1,				keepdims=lowerCamelCase)
						__lowerCAmelCase							       =				np.exp(outputs - maxes)
						return shifted_exp / shifted_exp.sum(axis=-1,				keepdims=lowerCamelCase)




class       a__				( __A      ):







				"""simple docstring"""



				def 					_snake_case  (self       ,			**__lowercase		):
										__lowerCAmelCase							       =				{}
										if "second_text" in kwargs:
																__lowerCAmelCase							       =				kwargs['''second_text''']
										return preprocess_kwargs, {}, {}




				def 					_snake_case  (self       ,			__lowercase       ,			__lowercase=None		):
										return self.tokenizer(__lowercase       ,			text_pair=__lowercase       ,			return_tensors=self.framework		)




				def 					_snake_case  (self       ,			__lowercase		):
										return self.model(**__lowercase		)




				def 					_snake_case  (self       ,			__lowercase		):
										__lowerCAmelCase							       =				model_outputs.logits[0].numpy()
										__lowerCAmelCase							       =				softmax(__lowercase		)

										__lowerCAmelCase							       =				np.argmax(__lowercase		)
										__lowerCAmelCase							       =				self.model.config.idalabel[best_class]
										__lowerCAmelCase							       =				probabilities[best_class].item()
										__lowerCAmelCase							       =				logits.tolist()
										return {"label": label, "score": score, "logits": logits}

