

'''simple docstring'''
from __future__ import annotations

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

# initial triangle of Koch snowflake
lowerCamelCase			:				List[Any] 			=					numpy.array([0, 0])
lowerCamelCase			:				Tuple 			=					numpy.array([0.5, 0.8_6_6_0_2_5_4])
lowerCamelCase			:				Any 			=					numpy.array([1, 0])
lowerCamelCase			:				str 			=					[VECTOR_1, VECTOR_2, VECTOR_3, VECTOR_1]


def 	_lowerCAmelCase (						_UpperCamelCase						:					list[numpy.ndarray]							,			_UpperCamelCase						:					int    )				->      list[numpy.ndarray]:
     """simple docstring"""




     _SCREAMING_SNAKE_CASE							   =initial_vectors
     for _ in range(_UpperCamelCase    ):
          _SCREAMING_SNAKE_CASE							   =iteration_step(_UpperCamelCase    )
     return vectors


def 	_lowerCAmelCase (						_UpperCamelCase						:					list[numpy.ndarray]    )				->      list[numpy.ndarray]:
     """simple docstring"""




     _SCREAMING_SNAKE_CASE							   =[]
     for i, start_vector in enumerate(vectors[:-1]    ):
          _SCREAMING_SNAKE_CASE							   =vectors[i + 1]
          new_vectors.append(_UpperCamelCase    )
          _SCREAMING_SNAKE_CASE							   =end_vector - start_vector
          new_vectors.append(start_vector + difference_vector / 3    )
          new_vectors.append(
              start_vector + difference_vector / 3 + rotate(difference_vector / 3							,			60    )    )
          new_vectors.append(start_vector + difference_vector * 2 / 3    )
     new_vectors.append(vectors[-1]    )
     return new_vectors


def 	_lowerCAmelCase (						_UpperCamelCase						:					numpy.ndarray							,			_UpperCamelCase						:					float    )				->      numpy.ndarray:
     """simple docstring"""




     _SCREAMING_SNAKE_CASE							   =numpy.radians(_UpperCamelCase    )
     _SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE							   =numpy.cos(_UpperCamelCase    ), numpy.sin(_UpperCamelCase    )
     _SCREAMING_SNAKE_CASE							   =numpy.array(((c, -s), (s, c))    )
     return numpy.dot(_UpperCamelCase							,			_UpperCamelCase    )


def 	_lowerCAmelCase (						_UpperCamelCase						:					list[numpy.ndarray]    )				->      None:
     """simple docstring"""




     _SCREAMING_SNAKE_CASE							   =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()
     _SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE							   =zip(*_UpperCamelCase    )
     plt.plot(_UpperCamelCase							,			_UpperCamelCase    )
     plt.show()


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     lowerCamelCase			:				Any 			=					iterate(INITIAL_VECTORS, 5)
     plot(processed_vectors)



'''simple docstring'''
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowerCamelCase			:				List[str] 			=					{"configuration_ibert": ["IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "IBertConfig", "IBertOnnxConfig"]}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     lowerCamelCase			:				Union[str, Any] 			=					[
         "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

     lowerCamelCase			:				str 			=					_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
