





from __future__ import annotations

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

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



def _a				(	lowerCamelCase:   list[numpy.ndarray]					,				lowerCamelCase:   int )	->						list[numpy.ndarray]:







      '''simple docstring'''






      __A          =				initial_vectors
      for _ in range(lowerCamelCase ):
            __A          =				iteration_step(lowerCamelCase )
      return vectors



def _a				(	lowerCamelCase:   list[numpy.ndarray] )	->						list[numpy.ndarray]:







      '''simple docstring'''






      __A          =				[]
      for i, start_vector in enumerate(vectors[:-1] ):
            __A          =				vectors[i + 1]
            new_vectors.append(lowerCamelCase )
            __A          =				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 _a				(	lowerCamelCase:   numpy.ndarray					,				lowerCamelCase:   float )	->						numpy.ndarray:







      '''simple docstring'''






      __A          =				numpy.radians(lowerCamelCase )
      __A   ,						__A          =				numpy.cos(lowerCamelCase ), numpy.sin(lowerCamelCase )
      __A          =				numpy.array(((c, -s), (s, c)) )
      return numpy.dot(lowerCamelCase					,				lowerCamelCase )



def _a				(	lowerCamelCase:   list[numpy.ndarray] )	->						None:







      '''simple docstring'''






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


if __name__ == "__main__":
       import doctest

       doctest.testmod()

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












import requests

snake_case__					:							int													=     'https://newsapi.org/v1/articles?source=bbc-news&sortBy=top&apiKey='



def _a				(	lowerCamelCase:   str )	->						None:







      '''simple docstring'''






      __A          =				requests.get(_NEWS_API + bbc_news_api_key ).json()
      # each article in the list is a dict
      for i, article in enumerate(bbc_news_page['''articles''']					,				1 ):
            print(F"""{i}.) {article['title']}""" )


if __name__ == "__main__":
       fetch_bbc_news(bbc_news_api_key='<Your BBC News API key goes here>')





