


'''simple docstring'''

from __future__ import annotations

import matplotlib.pyplot as plt  # type: ignore
import numpy

# initial triangle of Koch snowflake
_UpperCAmelCase				: Optional[Any]							    =				numpy.array([0, 0])
_UpperCAmelCase				: Tuple							    =				numpy.array([0.5, 0.8_66_02_54])
_UpperCAmelCase				: str							    =				numpy.array([1, 0])
_UpperCAmelCase				: int							    =				[VECTOR_1, VECTOR_2, VECTOR_3, VECTOR_1]

def 							__magic_name__(						lowerCamelCase,				lowerCamelCase):
						__lowerCAmelCase							       =				initial_vectors
						for _ in range(lowerCamelCase):
												__lowerCAmelCase							       =				iteration_step(lowerCamelCase)
						return vectors

def 							__magic_name__(						lowerCamelCase):
						__lowerCAmelCase							       =				[]
						for i, start_vector in enumerate(vectors[:-1]):
												__lowerCAmelCase							       =				vectors[i + 1]
												new_vectors.append(lowerCamelCase)
												__lowerCAmelCase							       =				end_vector - start_vector
												new_vectors.append(start_vector + difference_vector / 3)
												new_vectors.append(
												    start_vector + difference_vector / 3 + rotate(difference_vector / 3,				6_0))
												new_vectors.append(start_vector + difference_vector * 2 / 3)
						new_vectors.append(vectors[-1])
						return new_vectors

def 							__magic_name__(						lowerCamelCase,				lowerCamelCase):
						__lowerCAmelCase							       =				numpy.radians(lowerCamelCase)
						__lowerCAmelCase       ,					__lowerCAmelCase							       =				numpy.cos(lowerCamelCase), numpy.sin(lowerCamelCase)
						__lowerCAmelCase							       =				numpy.array(((c, -s), (s, c)))
						return numpy.dot(lowerCamelCase,				lowerCamelCase)

def 							__magic_name__(						lowerCamelCase):
						__lowerCAmelCase							       =				plt.gca()
						axes.set_aspect('''equal''')

						# matplotlib.pyplot.plot takes a list of all x-coordinates and a list of all
						# y-coordinates as inputs, which are constructed from the vector-list using
						# zip()
						__lowerCAmelCase       ,					__lowerCAmelCase							       =				zip(*lowerCamelCase)
						plt.plot(lowerCamelCase,				lowerCamelCase)
						plt.show()


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	_UpperCAmelCase				: Dict							    =				iterate(INITIAL_VECTORS, 5)
	plot(processed_vectors)







'''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}

