code: from copy import deepcopy
  from unittest.case import TestCase
  
  import pytest
  
  from datasets.arrow_dataset import Dataset
  from datasets.features import Audio, ClassLabel, Features, Image, Sequence, Value
  from datasets.info import DatasetInfo
  from datasets.tasks import (
      AudioClassification,
      AutomaticSpeechRecognition,
      ImageClassification,
      LanguageModeling,
      QuestionAnsweringExtractive,
      Summarization,
      TextClassification,
      task_template_from_dict,
  )
  from datasets.utils.py_utils import asdict
  
  
  UpperCAmelCase					=				{
      '''id''': '''5733be284776f41900661182''',
      '''title''': '''University_of_Notre_Dame''',
      '''context''': '''Architecturally, the school has a Catholic character. Atop the Main Building\'s gold dome is a golden statue of the Virgin Mary. Immediately in front of the Main Building and facing it, is a copper statue of Christ with arms upraised with the legend "Venite Ad Me Omnes". Next to the Main Building is the Basilica of the Sacred Heart. Immediately behind the basilica is the Grotto, a Marian place of prayer and reflection. It is a replica of the grotto at Lourdes, France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858. At the end of the main drive (and in a direct line that connects through 3 statues and the Gold Dome), is a simple, modern stone statue of Mary.''',
      '''question''': '''To whom did the Virgin Mary allegedly appear in 1858 in Lourdes France?''',
      '''answers''': {'''text''': ['''Saint Bernadette Soubirous'''], '''answer_start''': [5_15]},
  }
  
  
  @pytest.mark.parametrize(
      'task_cls'		,						[
          AudioClassification,
          AutomaticSpeechRecognition,
          ImageClassification,
          LanguageModeling,
          QuestionAnsweringExtractive,
          Summarization,
          TextClassification,
      ]		,						)
  def SCREAMING_SNAKE_CASE				(     lowercase_:	Optional[Any]				):
         _UpperCamelCase     :       Any  						=  task_cls()
         _UpperCamelCase     :       Any  						=  asdict(lowercase_				)
         _UpperCamelCase     :       Tuple  						=  task_template_from_dict(lowercase_				)
         assert task == reloaded
  
  
  
  
  class    __lowerCAmelCase  :
  
  
  
   '''simple docstring'''
  
   def 					__snake_case					(			self       :		Union[str, Any]  ) ->							Union[str, Any]:
          _UpperCamelCase     :       str  						=  LanguageModeling(text_column='input_text'  )
          assert {"input_text": "text"} == task.column_mapping
  
   def 					__snake_case					(			self       :		Optional[int]  ) ->							Optional[Any]:
          _UpperCamelCase     :       str  						=  Features({'text': Value('string'  )}  )
          _UpperCamelCase     :       List[str]  						=  {'text_column': 'input_text'}
          _UpperCamelCase     :       List[str]  						=  LanguageModeling.from_dict(lowerCamelCase  )
          assert "language-modeling" == task.task
          assert input_schema == task.input_schema
  
  
  
  
  
  
  
  class    __lowerCAmelCase  (       a_						):
  
  
  
   '''simple docstring'''
  
   def 					__snake_case					(			self       :		Any  ) ->							List[str]:
          _UpperCamelCase     :       Tuple  						=  sorted(['pos', 'neg']  )
  
   def 					__snake_case					(			self       :		Tuple  ) ->							List[str]:
          _UpperCamelCase     :       Optional[int]  						=  TextClassification(text_column='input_text'       ,			label_column='input_label'  )
          self.assertDictEqual({'input_text': 'text', 'input_label': 'labels'}       ,			task.column_mapping  )
  
   def 					__snake_case					(			self       :		List[str]  ) ->							Optional[Any]:
          _UpperCamelCase     :       int  						=  Features({'text': Value('string'  )}  )
          # Labels are cast to tuple during `TextClassification.__post_init__`, so we do the same here
          _UpperCamelCase     :       Optional[Any]  						=  Features({'labels': ClassLabel}  )
          _UpperCamelCase     :       str  						=  {'text_column': 'input_text', 'label_column': 'input_labels'}
          _UpperCamelCase     :       int  						=  TextClassification.from_dict(lowerCamelCase  )
          self.assertEqual('text-classification'       ,			task.task  )
          self.assertEqual(lowerCamelCase       ,			task.input_schema  )
          self.assertEqual(lowerCamelCase       ,			task.label_schema  )
  
   def 					__snake_case					(			self       :		Optional[int]  ) ->							List[Any]:
          _UpperCamelCase     :       List[Any]  						=  TextClassification(text_column='input_text'       ,			label_column='input_label'  )
          self.assertEqual(task.label_schema['labels']       ,			lowerCamelCase  )
          _UpperCamelCase     :       int  						=  task.align_with_features(Features({'input_label': ClassLabel(names=self.labels  )}  )  )
          self.assertEqual(task.label_schema['labels']       ,			ClassLabel(names=self.labels  )  )
  
  
  
  
  
  
  
  class    __lowerCAmelCase  (       a_						):
  
  
  
   '''simple docstring'''
  
   def 					__snake_case					(			self       :		Any  ) ->							Dict:
          _UpperCamelCase     :       Any  						=  QuestionAnsweringExtractive(
              context_column='input_context'       ,			question_column='input_question'       ,			answers_column='input_answers'  )
          self.assertDictEqual(
              {'input_context': 'context', 'input_question': 'question', 'input_answers': 'answers'}       ,			task.column_mapping  )
  
   def 					__snake_case					(			self       :		int  ) ->							Dict:
          _UpperCamelCase     :       Dict  						=  Features({'question': Value('string'  ), 'context': Value('string'  )}  )
          _UpperCamelCase     :       Any  						=  Features(
              {
                  'answers': Sequence(
                      {
                          'text': Value('string'  ),
                          'answer_start': Value('int32'  ),
                      }  )
              }  )
          _UpperCamelCase     :       Optional[Any]  						=  {
              'context_column': 'input_input_context',
              'question_column': 'input_question',
              'answers_column': 'input_answers',
          }
          _UpperCamelCase     :       str  						=  QuestionAnsweringExtractive.from_dict(lowerCamelCase  )
          self.assertEqual('question-answering-extractive'       ,			task.task  )
          self.assertEqual(lowerCamelCase       ,			task.input_schema  )
          self.assertEqual(lowerCamelCase       ,			task.label_schema  )
  
  
  
  
  
  
  
  class    __lowerCAmelCase  (       a_						):
  
  
  
   '''simple docstring'''
  
   def 					__snake_case					(			self       :		Optional[Any]  ) ->							Union[str, Any]:
          _UpperCamelCase     :       Dict  						=  Summarization(text_column='input_text'       ,			summary_column='input_summary'  )
          self.assertDictEqual({'input_text': 'text', 'input_summary': 'summary'}       ,			task.column_mapping  )
  
   def 					__snake_case					(			self       :		Optional[Any]  ) ->							List[str]:
          _UpperCamelCase     :       Any  						=  Features({'text': Value('string'  )}  )
          _UpperCamelCase     :       List[str]  						=  Features({'summary': Value('string'  )}  )
          _UpperCamelCase     :       str  						=  {'text_column': 'input_text', 'summary_column': 'input_summary'}
          _UpperCamelCase     :       Dict  						=  Summarization.from_dict(lowerCamelCase  )
          self.assertEqual('summarization'       ,			task.task  )
          self.assertEqual(lowerCamelCase       ,			task.input_schema  )
          self.assertEqual(lowerCamelCase       ,			task.label_schema  )
  
  
  
  
  
  
  
  class    __lowerCAmelCase  (       a_						):
  
  
  
   '''simple docstring'''
  
   def 					__snake_case					(			self       :		Dict  ) ->							Optional[int]:
          _UpperCamelCase     :       Dict  						=  AutomaticSpeechRecognition(audio_column='input_audio'       ,			transcription_column='input_transcription'  )
          self.assertDictEqual({'input_audio': 'audio', 'input_transcription': 'transcription'}       ,			task.column_mapping  )
  
   def 					__snake_case					(			self       :		List[str]  ) ->							List[str]:
          _UpperCamelCase     :       List[str]  						=  Features({'audio': Audio()}  )
          _UpperCamelCase     :       Tuple  						=  Features({'transcription': Value('string'  )}  )
          _UpperCamelCase     :       str  						=  {
              'audio_column': 'input_audio',
              'transcription_column': 'input_transcription',
          }
          _UpperCamelCase     :       Optional[Any]  						=  AutomaticSpeechRecognition.from_dict(lowerCamelCase  )
          self.assertEqual('automatic-speech-recognition'       ,			task.task  )
          self.assertEqual(lowerCamelCase       ,			task.input_schema  )
          self.assertEqual(lowerCamelCase       ,			task.label_schema  )
  
  
  
  
  
  
  
  class    __lowerCAmelCase  (       a_						):
  
  
  
   '''simple docstring'''
  
   def 					__snake_case					(			self       :		str  ) ->							Tuple:
          _UpperCamelCase     :       Optional[int]  						=  sorted(['pos', 'neg']  )
  
   def 					__snake_case					(			self       :		str  ) ->							Optional[int]:
          _UpperCamelCase     :       Dict  						=  AudioClassification(audio_column='input_audio'       ,			label_column='input_label'  )
          self.assertDictEqual({'input_audio': 'audio', 'input_label': 'labels'}       ,			task.column_mapping  )
  
   def 					__snake_case					(			self       :		int  ) ->							Tuple:
          _UpperCamelCase     :       List[Any]  						=  Features({'audio': Audio()}  )
          _UpperCamelCase     :       Tuple  						=  Features({'labels': ClassLabel}  )
          _UpperCamelCase     :       Optional[Any]  						=  {
              'audio_column': 'input_image',
              'label_column': 'input_label',
          }
          _UpperCamelCase     :       Union[str, Any]  						=  AudioClassification.from_dict(lowerCamelCase  )
          self.assertEqual('audio-classification'       ,			task.task  )
          self.assertEqual(lowerCamelCase       ,			task.input_schema  )
          self.assertEqual(lowerCamelCase       ,			task.label_schema  )
  
   def 					__snake_case					(			self       :		Any  ) ->							Optional[int]:
          _UpperCamelCase     :       Optional[int]  						=  AudioClassification(audio_column='input_audio'       ,			label_column='input_label'  )
          self.assertEqual(task.label_schema['labels']       ,			lowerCamelCase  )
          _UpperCamelCase     :       Optional[int]  						=  task.align_with_features(Features({'input_label': ClassLabel(names=self.labels  )}  )  )
          self.assertEqual(task.label_schema['labels']       ,			ClassLabel(names=self.labels  )  )
  
  
  
  
  
  
  
  class    __lowerCAmelCase  (       a_						):
  
  
  
   '''simple docstring'''
  
   def 					__snake_case					(			self       :		List[str]  ) ->							str:
          _UpperCamelCase     :       Dict  						=  sorted(['pos', 'neg']  )
  
   def 					__snake_case					(			self       :		List[Any]  ) ->							Dict:
          _UpperCamelCase     :       Any  						=  ImageClassification(image_column='input_image'       ,			label_column='input_label'  )
          self.assertDictEqual({'input_image': 'image', 'input_label': 'labels'}       ,			task.column_mapping  )
  
   def 					__snake_case					(			self       :		Union[str, Any]  ) ->							Any:
          _UpperCamelCase     :       str  						=  Features({'image': Image()}  )
          _UpperCamelCase     :       Dict  						=  Features({'labels': ClassLabel}  )
          _UpperCamelCase     :       Union[str, Any]  						=  {
              'image_column': 'input_image',
              'label_column': 'input_label',
          }
          _UpperCamelCase     :       Optional[int]  						=  ImageClassification.from_dict(lowerCamelCase  )
          self.assertEqual('image-classification'       ,			task.task  )
          self.assertEqual(lowerCamelCase       ,			task.input_schema  )
          self.assertEqual(lowerCamelCase       ,			task.label_schema  )
  
   def 					__snake_case					(			self       :		str  ) ->							Dict:
          _UpperCamelCase     :       str  						=  ImageClassification(image_column='input_image'       ,			label_column='input_label'  )
          self.assertEqual(task.label_schema['labels']       ,			lowerCamelCase  )
          _UpperCamelCase     :       List[str]  						=  task.align_with_features(Features({'input_label': ClassLabel(names=self.labels  )}  )  )
          self.assertEqual(task.label_schema['labels']       ,			ClassLabel(names=self.labels  )  )
  
  
  
  
  
  
  
  class    __lowerCAmelCase  (       a_						):
  
  
  
   '''simple docstring'''
  
   def 					__snake_case					(			self       :		Union[str, Any]  ) ->							Optional[int]:
          _UpperCamelCase     :       List[Any]  						=  DatasetInfo(task_templates=QuestionAnsweringExtractive()  )
          _UpperCamelCase     :       Dict  						=  Dataset.from_dict({k: [v] for k, v in SAMPLE_QUESTION_ANSWERING_EXTRACTIVE.items()}       ,			info=lowerCamelCase  )
          assert isinstance(dataset.info.task_templates       ,			lowerCamelCase  )
          assert len(dataset.info.task_templates  ) == 1
  
          def keep_task(lowerCamelCase       :		Union[str, Any]  ):
                 return x
  
          def dont_keep_task(lowerCamelCase       :		List[str]  ):
                 _UpperCamelCase     :       Dict  						=  deepcopy(lowerCamelCase  )
                 _UpperCamelCase     :       Dict  						=  0
                 return out
  
          _UpperCamelCase     :       Dict  						=  dataset.map(lowerCamelCase  )
          assert mapped_dataset.info.task_templates == dataset.info.task_templates
          # reload from cache
          _UpperCamelCase     :       Union[str, Any]  						=  dataset.map(lowerCamelCase  )
          assert mapped_dataset.info.task_templates == dataset.info.task_templates
  
          _UpperCamelCase     :       List[str]  						=  dataset.map(lowerCamelCase  )
          assert mapped_dataset.info.task_templates == []
          # reload from cache
          _UpperCamelCase     :       Any  						=  dataset.map(lowerCamelCase  )
          assert mapped_dataset.info.task_templates == []
  
   def 					__snake_case					(			self       :		Union[str, Any]  ) ->							List[Any]:
          _UpperCamelCase     :       int  						=  Features({'text': Value('string'  ), 'label': ClassLabel(names=('pos', 'neg')  )}  )
          _UpperCamelCase     :       int  						=  TextClassification(text_column='text'       ,			label_column='label'  )
          _UpperCamelCase     :       Dict  						=  DatasetInfo(features=lowerCamelCase       ,			task_templates=lowerCamelCase  )
          _UpperCamelCase     :       Any  						=  Dataset.from_dict({'text': ['A sentence.'], 'label': ['pos']}       ,			info=lowerCamelCase  )
  
          def process(lowerCamelCase       :		Any  ):
                 return example
  
          _UpperCamelCase     :       Union[str, Any]  						=  dataset.remove_columns('label'  )
          _UpperCamelCase     :       int  						=  modified_dataset.map(lowerCamelCase  )
          assert mapped_dataset.info.task_templates == []
  
  
  
  
style_context: import math
  from collections.abc import Generator
  
  
  def SCREAMING_SNAKE_CASE				(     lowercase_:	int				):
         _UpperCamelCase     :       Generator  						=  (i for i in range(1		,						(max_n + 1)				))
         for i in (n for n in numbers if n > 1):
                for j in range(2		,						lowercase_				):
                       if (i % j) == 0:
                              break
                else:
                       yield i
  
  
  def SCREAMING_SNAKE_CASE				(     lowercase_:	int				):
         _UpperCamelCase     :       Generator  						=  (i for i in range(1		,						(max_n + 1)				))
         for i in (n for n in numbers if n > 1):
                # only need to check for factors up to sqrt(i)
                _UpperCamelCase     :       Any  						=  int(math.sqrt(lowercase_				)				) + 1
                for j in range(2		,						lowercase_				):
                       if (i % j) == 0:
                              break
                else:
                       yield i
  
  
  def SCREAMING_SNAKE_CASE				(     lowercase_:	int				):
         _UpperCamelCase     :       Generator  						=  (i for i in range(1		,						(max_n + 1)		,						2				))
         # It's useless to test even numbers as they will not be prime
         if max_n > 2:
                yield 2  # Because 2 will not be tested, it's necessary to yield it now
         for i in (n for n in numbers if n > 1):
                _UpperCamelCase     :       Tuple  						=  int(math.sqrt(lowercase_				)				) + 1
                for j in range(3		,						lowercase_		,						2				):
                       # As we removed the even numbers, we don't need them now
                       if (i % j) == 0:
                              break
                else:
                       yield i
  
  
  def SCREAMING_SNAKE_CASE				(     ):
         from timeit import timeit
  
         _UpperCamelCase     :       Optional[Any]  						=  'from __main__ import slow_primes, primes, fast_primes'
         print(timeit('slow_primes(1_000_000_000_000)'		,						setup=lowercase_		,						number=1000000				)				)
         print(timeit('primes(1_000_000_000_000)'		,						setup=lowercase_		,						number=1000000				)				)
         print(timeit('fast_primes(1_000_000_000_000)'		,						setup=lowercase_		,						number=1000000				)				)
  
  
  if __name__ == "__main__":
   UpperCAmelCase					=				int(input('''Calculate primes up to:\n>> ''').strip())
   for ret in primes(number):
    print(ret)
   benchmark()
  
  
  
  