





"""simple docstring"""






import doctest
import logging
import os
import unittest
from pathlib import Path
from typing import List, Union

import transformers
from transformers.testing_utils import require_tf, require_torch, slow


lowerCAmelCase_			=							logging.getLogger()



@unittest.skip("""Temporarily disable the doc tests."""							)
@require_torch
@require_tf
@slow
class 	lowerCAmelCase					(      unittest.TestCase							):






       def 							__A (   self    ,  a__    ,  a__ = None    ,  a__ = None    ,  a__ = None    ,  a__ = True    ,  ):
              _UpperCAmelCase     =     [file for file in os.listdir(a__     ) if os.path.isfile(os.path.join(a__    ,  a__     )     )]

              if identifier is not None:
                     _UpperCAmelCase     =     [file for file in files if identifier in file]

              if n_identifier is not None:
                     if isinstance(a__    ,  a__     ):
                            for n_ in n_identifier:
                                   _UpperCAmelCase     =     [file for file in files if n_ not in file]
                     else:
                            _UpperCAmelCase     =     [file for file in files if n_identifier not in file]

              _UpperCAmelCase     =     ignore_files or []
              ignore_files.append('__init__.py'     )
              _UpperCAmelCase     =     [file for file in files if file not in ignore_files]

              for file in files:
                     # Open all files
                     print('Testing'    ,  a__     )

                     if only_modules:
                            _UpperCAmelCase     =     file.split('.'     )[0]
                            try:
                                   _UpperCAmelCase     =     getattr(a__    ,  a__     )
                                   _UpperCAmelCase     =     doctest.DocTestSuite(a__     )
                                   _UpperCAmelCase     =     unittest.TextTestRunner().run(a__     )
                                   self.assertIs(len(result.failures     )    ,  0     )
                            except AttributeError:
                                   logger.info(f"""{module_identifier} is not a module."""     )
                     else:
                            _UpperCAmelCase     =     doctest.testfile(str('..' / directory / file     )    ,  optionflags=doctest.ELLIPSIS     )
                            self.assertIs(result.failed    ,  0     )






       def 							__A (   self     ):
              _UpperCAmelCase     =     Path('src/transformers'     )
              _UpperCAmelCase     =     'modeling'
              _UpperCAmelCase     =     [
                  'modeling_ctrl.py',
                  'modeling_tf_ctrl.py',
              ]
              self.analyze_directory(a__    ,  identifier=a__    ,  ignore_files=a__     )






       def 							__A (   self     ):
              _UpperCAmelCase     =     Path('src/transformers'     )
              _UpperCAmelCase     =     'tokenization'
              self.analyze_directory(a__    ,  identifier=a__     )






       def 							__A (   self     ):
              _UpperCAmelCase     =     Path('src/transformers'     )
              _UpperCAmelCase     =     'configuration'
              self.analyze_directory(a__    ,  identifier=a__     )






       def 							__A (   self     ):
              _UpperCAmelCase     =     Path('src/transformers'     )
              _UpperCAmelCase     =     ['configuration', 'modeling', 'tokenization']
              self.analyze_directory(a__    ,  n_identifier=a__     )






       def 							__A (   self     ):
              _UpperCAmelCase     =     Path('docs/source'     )
              _UpperCAmelCase     =     ['favicon.ico']
              self.analyze_directory(a__    ,  ignore_files=a__    ,  only_modules=a__     )













"""simple docstring"""






from itertools import product

def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							)		->       list[int]:






       """simple docstring"""




       _UpperCAmelCase     =     sides_number
       _UpperCAmelCase     =     max_face_number * dice_number
       _UpperCAmelCase     =     [0] * (max_total + 1)

       _UpperCAmelCase     =     1
       _UpperCAmelCase     =     range(SCREAMING_SNAKE_CASE,max_face_number + 1							)
       for dice_numbers in product(SCREAMING_SNAKE_CASE,repeat=SCREAMING_SNAKE_CASE							):
              _UpperCAmelCase     =     sum(SCREAMING_SNAKE_CASE							)
              totals_frequencies[total] += 1

       return totals_frequencies

def       __lowerCamelCase    (       )		->       float:






       """simple docstring"""




       _UpperCAmelCase     =     total_frequency_distribution(
           sides_number=4,dice_number=9							)
       _UpperCAmelCase     =     total_frequency_distribution(
           sides_number=6,dice_number=6							)

       _UpperCAmelCase     =     0
       _UpperCAmelCase     =     9
       _UpperCAmelCase     =     4 * 9
       _UpperCAmelCase     =     6
       for peter_total in range(SCREAMING_SNAKE_CASE,max_peter_total + 1							):
              peter_wins_count += peter_totals_frequencies[peter_total] * sum(
                  colin_totals_frequencies[min_colin_total:peter_total]							)

       _UpperCAmelCase     =     (4**9) * (6**6)
       _UpperCAmelCase     =     peter_wins_count / total_games_number

       _UpperCAmelCase     =     round(SCREAMING_SNAKE_CASE,ndigits=7							)

       return rounded_peter_win_probability


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






