
from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


_A		     =    {
    "configuration_funnel": ["FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP", "FunnelConfig"],
    "convert_funnel_original_tf_checkpoint_to_pytorch": [],
    "tokenization_funnel": ["FunnelTokenizer"],
}

try:
      if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      _A		     =    ["FunnelTokenizerFast"]

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      _A		     =    [
          "FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST",
          "FunnelBaseModel",
          "FunnelForMaskedLM",
          "FunnelForMultipleChoice",
          "FunnelForPreTraining",
          "FunnelForQuestionAnswering",
          "FunnelForSequenceClassification",
          "FunnelForTokenClassification",
          "FunnelModel",
          "FunnelPreTrainedModel",
          "load_tf_weights_in_funnel",
      ]

try:
      if not is_tf_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      _A		     =    [
          "TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST",
          "TFFunnelBaseModel",
          "TFFunnelForMaskedLM",
          "TFFunnelForMultipleChoice",
          "TFFunnelForPreTraining",
          "TFFunnelForQuestionAnswering",
          "TFFunnelForSequenceClassification",
          "TFFunnelForTokenClassification",
          "TFFunnelModel",
          "TFFunnelPreTrainedModel",
      ]


if TYPE_CHECKING:
      from .configuration_funnel import FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP, FunnelConfig
      from .tokenization_funnel import FunnelTokenizer

      try:
            if not is_tokenizers_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_funnel_fast import FunnelTokenizerFast

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_funnel import (
                FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
                FunnelBaseModel,
                FunnelForMaskedLM,
                FunnelForMultipleChoice,
                FunnelForPreTraining,
                FunnelForQuestionAnswering,
                FunnelForSequenceClassification,
                FunnelForTokenClassification,
                FunnelModel,
                FunnelPreTrainedModel,
                load_tf_weights_in_funnel,
            )

      try:
            if not is_tf_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_tf_funnel import (
                TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
                TFFunnelBaseModel,
                TFFunnelForMaskedLM,
                TFFunnelForMultipleChoice,
                TFFunnelForPreTraining,
                TFFunnelForQuestionAnswering,
                TFFunnelForSequenceClassification,
                TFFunnelForTokenClassification,
                TFFunnelModel,
                TFFunnelPreTrainedModel,
            )

else:
      import sys

      _A		     =    _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)








'''simple docstring'''






from __future__ import annotations

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

# initial triangle of Koch snowflake
UpperCamelCase__:   Tuple								=			numpy.array([0, 0])
UpperCamelCase__:   Union[str, Any]								=			numpy.array([0.5, 0.8660254])
UpperCamelCase__:   Dict								=			numpy.array([1, 0])
UpperCamelCase__:   int								=			[VECTOR_1, VECTOR_2, VECTOR_3, VECTOR_1]


def  snake_case_     (					_lowerCAmelCase  :						list[numpy.ndarray]   ,      _lowerCAmelCase  :						int  )      ->   list[numpy.ndarray]:
							UpperCAmelCase :       Union[str, Any] 							=		initial_vectors
							for _ in range(_lowerCAmelCase  ):
														UpperCAmelCase :       Union[str, Any] 							=		iteration_step(_lowerCAmelCase  )
							return vectors


def  snake_case_     (					_lowerCAmelCase  :						list[numpy.ndarray]  )      ->   list[numpy.ndarray]:
							UpperCAmelCase :       Tuple 							=		[]
							for i, start_vector in enumerate(vectors[:-1]  ):
														UpperCAmelCase :       List[str] 							=		vectors[i + 1]
														new_vectors.append(_lowerCAmelCase  )
														UpperCAmelCase :       Optional[Any] 							=		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  snake_case_     (					_lowerCAmelCase  :						numpy.ndarray   ,      _lowerCAmelCase  :						float  )      ->   numpy.ndarray:
							UpperCAmelCase :       List[str] 							=		numpy.radians(_lowerCAmelCase  )
							UpperCAmelCase							,		UpperCAmelCase :       Tuple 							=		numpy.cos(_lowerCAmelCase  ), numpy.sin(_lowerCAmelCase  )
							UpperCAmelCase :       Union[str, Any] 							=		numpy.array(((c, -s), (s, c))  )
							return numpy.dot(_lowerCAmelCase   ,      _lowerCAmelCase  )


def  snake_case_     (					_lowerCAmelCase  :						list[numpy.ndarray]  )      ->   None:
							UpperCAmelCase :       List[Any] 							=		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()
							UpperCAmelCase							,		UpperCAmelCase :       str 							=		zip(*_lowerCAmelCase  )
							plt.plot(_lowerCAmelCase   ,      _lowerCAmelCase  )
							plt.show()


if __name__ == "__main__":
						import doctest

						doctest.testmod()

						UpperCamelCase__:   List[Any]								=			iterate(INITIAL_VECTORS, 5)
						plot(processed_vectors)





