



from math import factorial



def 	__a					(   lowerCAmelCase_       : int      ,lowerCAmelCase_       : int      ,lowerCAmelCase_       : float    )				->			float:






						'''simple docstring'''



						if successes > trials:
												raise ValueError("""successes must be lower or equal to trials"""    )
						if trials < 0 or successes < 0:
												raise ValueError("""the function is defined for non-negative integers"""    )
						if not isinstance(lowerCAmelCase_      ,lowerCAmelCase_    ) or not isinstance(lowerCAmelCase_      ,lowerCAmelCase_    ):
												raise ValueError("""the function is defined for non-negative integers"""    )
						if not 0 < prob < 1:
												raise ValueError("""prob has to be in range of 1 - 0"""    )
						UpperCAmelCase_=       (prob**successes) * ((1 - prob) ** (trials - successes))
						# Calculate the binomial coefficient: n! / k!(n-k)!
						UpperCAmelCase_=       float(factorial(lowerCAmelCase_    )    )
						coefficient /= factorial(lowerCAmelCase_    ) * factorial(trials - successes    )
						return probability * coefficient


if __name__ == "__main__":
	from doctest import testmod

	testmod()
	print('''Probability of 2 successes out of 4 trails''')
	print('''with probability of 0.75 is:''', end=''' ''')
	print(binomial_distribution(2, 4, 0.7_5))









import pytest

import datasets


# Import fixture modules as plugins
__A       =						['''tests.fixtures.files''', '''tests.fixtures.hub''', '''tests.fixtures.fsspec''']



def 	__a					(   lowerCAmelCase_       : Optional[Any]      ,lowerCAmelCase_       : Any    )				->			Tuple:






						'''simple docstring'''



						for item in items:
												if any(marker in item.keywords for marker in ["""integration""", """unit"""]    ):
																		continue
												item.add_marker(pytest.mark.unit    )



def 	__a					(   lowerCAmelCase_       : Tuple    )				->			Optional[Any]:






						'''simple docstring'''



						config.addinivalue_line("""markers"""      ,"""torchaudio_latest: mark test to run with torchaudio>=0.12"""    )



@pytest.fixture(autouse=lowerCAmelCase_    )
def 	__a					(   lowerCAmelCase_       : List[str]      ,lowerCAmelCase_       : List[str]    )				->			int:






						'''simple docstring'''



						UpperCAmelCase_=       tmp_path_factory.getbasetemp() / """cache"""
						UpperCAmelCase_=       test_hf_cache_home / """datasets"""
						UpperCAmelCase_=       test_hf_cache_home / """metrics"""
						UpperCAmelCase_=       test_hf_cache_home / """modules"""
						monkeypatch.setattr("""datasets.config.HF_DATASETS_CACHE"""      ,str(lowerCAmelCase_    )    )
						monkeypatch.setattr("""datasets.config.HF_METRICS_CACHE"""      ,str(lowerCAmelCase_    )    )
						monkeypatch.setattr("""datasets.config.HF_MODULES_CACHE"""      ,str(lowerCAmelCase_    )    )
						UpperCAmelCase_=       test_hf_datasets_cache / """downloads"""
						monkeypatch.setattr("""datasets.config.DOWNLOADED_DATASETS_PATH"""      ,str(lowerCAmelCase_    )    )
						UpperCAmelCase_=       test_hf_datasets_cache / """downloads""" / """extracted"""
						monkeypatch.setattr("""datasets.config.EXTRACTED_DATASETS_PATH"""      ,str(lowerCAmelCase_    )    )



@pytest.fixture(autouse=lowerCAmelCase_      ,scope="""session"""    )
def 	__a					(   )				->			Optional[int]:






						'''simple docstring'''



						datasets.disable_progress_bar()



@pytest.fixture(autouse=lowerCAmelCase_    )
def 	__a					(   lowerCAmelCase_       : int    )				->			str:






						'''simple docstring'''



						monkeypatch.setattr("""datasets.config.HF_UPDATE_DOWNLOAD_COUNTS"""      ,lowerCAmelCase_    )



@pytest.fixture
def 	__a					(   lowerCAmelCase_       : List[str]    )				->			Union[str, Any]:






						'''simple docstring'''



						monkeypatch.setattr("""sqlalchemy.util.deprecations.SILENCE_UBER_WARNING"""      ,lowerCAmelCase_    )




