
from collections import Counter
from pathlib import Path
from typing import Optional, Tuple

import yaml



class       _snake_case   (	yaml.SafeLoader							):


 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   lowercase__  :   Optional[Any]    		=      [self.constructed_objects[key_node] for key_node, _ in node.value]
   lowercase__  :   Tuple    		=      [tuple(SCREAMING_SNAKE_CASE_) if isinstance(SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_) else key for key in keys]
   lowercase__  :   Tuple    		=      Counter(SCREAMING_SNAKE_CASE_)
   lowercase__  :   Any    		=      [key for key in counter if counter[key] > 1]
   if duplicate_keys:
     raise TypeError(f'Got duplicate yaml keys: {duplicate_keys}')



 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_=False):


   '''simple docstring'''




   lowercase__  :   List[str]    		=      super().construct_mapping(SCREAMING_SNAKE_CASE_					,  deep=SCREAMING_SNAKE_CASE_)
   self._check_no_duplicates_on_constructed_node(SCREAMING_SNAKE_CASE_)
   return mapping

def 		UpperCamelCase	(      lowercase_   )		->	Tuple[Optional[str], str]:


  '''simple docstring'''






  lowercase__  :   Any    		=      list(readme_content.splitlines()   )
  if full_content and full_content[0] == "---" and "---" in full_content[1:]:
    lowercase__  :   Optional[Any]    		=      full_content[1:].index("""---"""   ) + 1
    lowercase__  :   List[Any]    		=      """\n""".join(full_content[1:sep_idx]   )
    return yamlblock, "\n".join(full_content[sep_idx + 1 :]   )

  return None, "\n".join(lowercase_   )



class       _snake_case   (	UpperCAmelCase_							):
 # class attributes
 __lowerCAmelCase  :     str        =			{'train_eval_index'}  # train-eval-index in the YAML metadata


 @classmethod
 def      lowercase__     (					cls					,  SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   with open(SCREAMING_SNAKE_CASE_					,  encoding="""utf-8""") as readme_file:
     lowercase__		,    lowercase__  :   Optional[int]    		=      _split_yaml_from_readme(readme_file.read())
   if yaml_string is not None:
     return cls.from_yaml_string(SCREAMING_SNAKE_CASE_)
   else:
     return cls()


 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   if path.exists():
     with open(SCREAMING_SNAKE_CASE_					,  encoding="""utf-8""") as readme_file:
       lowercase__  :   Dict    		=      readme_file.read()
   else:
     lowercase__  :   str    		=      None
   lowercase__  :   Tuple    		=      self._to_readme(SCREAMING_SNAKE_CASE_)
   with open(SCREAMING_SNAKE_CASE_					,  """w"""					,  encoding="""utf-8""") as readme_file:
     readme_file.write(SCREAMING_SNAKE_CASE_)


 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_ = None):


   '''simple docstring'''




   if readme_content is not None:
     lowercase__		,    lowercase__  :   Optional[int]    		=      _split_yaml_from_readme(SCREAMING_SNAKE_CASE_)
     lowercase__  :   Dict    		=      """---\n""" + self.to_yaml_string() + """---\n""" + content
   else:
     lowercase__  :   Tuple    		=      """---\n""" + self.to_yaml_string() + """---\n"""
   return full_content


 @classmethod
 def      lowercase__     (					cls					,  SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   lowercase__  :   str    		=      yaml.load(SCREAMING_SNAKE_CASE_					,  Loader=_NoDuplicateSafeLoader) or {}

   # Convert the YAML keys to DatasetMetadata fields
   lowercase__  :   Optional[int]    		=      {
       (key.replace("""-"""					,  """_""") if key.replace("""-"""					,  """_""") in cls._FIELDS_WITH_DASHES else key): value
       for key, value in metadata_dict.items()
   }
   return cls(**SCREAMING_SNAKE_CASE_)



 def      lowercase__     (					self):


   '''simple docstring'''




   return yaml.safe_dump(
       {
           (key.replace("""_"""					,  """-""") if key in self._FIELDS_WITH_DASHES else key): value
           for key, value in self.items()
       }					,  sort_keys=SCREAMING_SNAKE_CASE_					,  allow_unicode=SCREAMING_SNAKE_CASE_					,  encoding="""utf-8"""					,  ).decode("""utf-8""")

lowerCamelCase__    :		Optional[int]          =   {
    """image-classification""": [],
    """translation""": [],
    """image-segmentation""": [],
    """fill-mask""": [],
    """automatic-speech-recognition""": [],
    """token-classification""": [],
    """sentence-similarity""": [],
    """audio-classification""": [],
    """question-answering""": [],
    """summarization""": [],
    """zero-shot-classification""": [],
    """table-to-text""": [],
    """feature-extraction""": [],
    """other""": [],
    """multiple-choice""": [],
    """text-classification""": [],
    """text-to-image""": [],
    """text2text-generation""": [],
    """zero-shot-image-classification""": [],
    """tabular-classification""": [],
    """tabular-regression""": [],
    """image-to-image""": [],
    """tabular-to-text""": [],
    """unconditional-image-generation""": [],
    """text-retrieval""": [],
    """text-to-speech""": [],
    """object-detection""": [],
    """audio-to-audio""": [],
    """text-generation""": [],
    """conversational""": [],
    """table-question-answering""": [],
    """visual-question-answering""": [],
    """image-to-text""": [],
    """reinforcement-learning""": [],
    """voice-activity-detection""": [],
    """time-series-forecasting""": [],
    """document-question-answering""": [],
}


if __name__ == "__main__":
     from argparse import ArgumentParser

     lowerCamelCase__    :		Optional[Any]          =   ArgumentParser(usage="""Validate the yaml metadata block of a README.md file.""")
     ap.add_argument("""readme_filepath""")
     lowerCamelCase__    :		Union[str, Any]          =   ap.parse_args()

     lowerCamelCase__    :		str          =   Path(args.readme_filepath)
     lowerCamelCase__    :		Optional[int]          =   DatasetMetadata.from_readme(readme_filepath)
     print(dataset_metadata)
     dataset_metadata.to_readme(readme_filepath)








import sys

lowerCamelCase__    :		List[Any]          =   (
    """73167176531330624919225119674426574742355349194934"""
    """96983520312774506326239578318016984801869478851843"""
    """85861560789112949495459501737958331952853208805511"""
    """12540698747158523863050715693290963295227443043557"""
    """66896648950445244523161731856403098711121722383113"""
    """62229893423380308135336276614282806444486645238749"""
    """30358907296290491560440772390713810515859307960866"""
    """70172427121883998797908792274921901699720888093776"""
    """65727333001053367881220235421809751254540594752243"""
    """52584907711670556013604839586446706324415722155397"""
    """53697817977846174064955149290862569321978468622482"""
    """83972241375657056057490261407972968652414535100474"""
    """82166370484403199890008895243450658541227588666881"""
    """16427171479924442928230863465674813919123162824586"""
    """17866458359124566529476545682848912883142607690042"""
    """24219022671055626321111109370544217506941658960408"""
    """07198403850962455444362981230987879927244284909188"""
    """84580156166097919133875499200524063689912560717606"""
    """05886116467109405077541002256983155200055935729725"""
    """71636269561882670428252483600823257530420752963450"""
)

def 		UpperCamelCase	(      lowercase_ = N   )		->	int:


  '''simple docstring'''






  lowercase__  :   int    		=      -sys.maxsize - 1
  for i in range(len(lowercase_   ) - 12   ):
    lowercase__  :   Optional[int]    		=      1
    for j in range(13   ):
      product *= int(n[i + j]   )
    if product > largest_product:
      lowercase__  :   int    		=      product
  return largest_product


if __name__ == "__main__":
     print(f'''{solution() = }''')






