


from __future__ import annotations

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

# initial triangle of Koch snowflake
__lowercase											=      numpy.array([0, 0])
__lowercase											=      numpy.array([0.5, 0.8_6_6_0_2_5_4])
__lowercase											=      numpy.array([1, 0])
__lowercase											=      [VECTOR_1, VECTOR_2, VECTOR_3, VECTOR_1]



def lowerCamelCase						(     SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







    __UpperCamelCase  :Tuple    						=	initial_vectors
    for _ in range(snake_case_			):
        __UpperCamelCase  :List[Any]    						=	iteration_step(snake_case_			)
    return vectors



def lowerCamelCase						(     SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







    __UpperCamelCase  :Dict    						=	[]
    for i, start_vector in enumerate(vectors[:-1]			):
        __UpperCamelCase  :List[str]    						=	vectors[i + 1]
        new_vectors.append(snake_case_			)
        __UpperCamelCase  :List[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 lowerCamelCase						(     SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







    __UpperCamelCase  :Optional[Any]    						=	numpy.radians(snake_case_			)
    __UpperCamelCase  :Optional[Any]    						=	numpy.cos(snake_case_			), numpy.sin(snake_case_			)
    __UpperCamelCase  :Union[str, Any]    						=	numpy.array(((c, -s), (s, c))			)
    return numpy.dot(snake_case_						,    snake_case_			)



def lowerCamelCase						(     SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







    __UpperCamelCase  :int    						=	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  :int    						=	zip(*snake_case_			)
    plt.plot(snake_case_						,    snake_case_			)
    plt.show()


if __name__ == "__main__":
    import doctest

    doctest.testmod()

    __lowercase											=      iterate(INITIAL_VECTORS, 5)
    plot(processed_vectors)






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_speech_available, is_torch_available


__lowercase											=      {
    '''configuration_audio_spectrogram_transformer''': [
        '''AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''ASTConfig''',
    ]
}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __lowercase											=      [
        '''AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
        '''ASTForAudioClassification''',
        '''ASTModel''',
        '''ASTPreTrainedModel''',
    ]

try:
    if not is_speech_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __lowercase											=      ['''ASTFeatureExtractor''']

if TYPE_CHECKING:
    from .configuration_audio_spectrogram_transformer import (
        AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
        ASTConfig,
    )

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_audio_spectrogram_transformer import (
            AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
            ASTForAudioClassification,
            ASTModel,
            ASTPreTrainedModel,
        )

    try:
        if not is_speech_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .feature_extraction_audio_spectrogram_transformer import ASTFeatureExtractor


else:
    import sys

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





