






"""simple docstring"""







import pytest

from datasets import inspect_metric, list_metrics, load_metric


@pytest.fixture
def      UpperCamelCase       ( _A )     ->       List[Any]:
				monkeypatch.setattr("""datasets.utils.deprecation_utils._emitted_deprecation_warnings"""  ,				set() )


@pytest.fixture
def      UpperCamelCase       ( _A )     ->       Tuple:


				class      UpperCamelCase		:






										def __init__(		self  :Optional[int]			, __magic_name__  :int				)      ->Tuple:
														lowercase    :      Dict       = metric_id


				class      UpperCamelCase		:
										_SCREAMING_SNAKE_CASE  : Union[str, Any]												=		[MetricMock(__snake_case     ) for metric_id in ["""accuracy""", """mse""", """precision""", """codeparrot/apps_metric"""]]






										def      __snake_case      (		self  :List[Any]				)      ->Union[str, Any]:
														return self._metrics
				monkeypatch.setattr("""datasets.inspect.huggingface_hub"""  ,				HfhMock() )


@pytest.mark.parametrize(
    """func, args"""  ,				[(load_metric, ("""metrics/mse""",)), (list_metrics, ()), (inspect_metric, ("""metrics/mse""", """tmp_path"""))] )
def      UpperCamelCase       ( _A  ,				_A  ,				_A  ,				_A  ,				_A )     ->       List[Any]:
				if "tmp_path" in args:
								lowercase    :      Dict       = tuple(arg if arg != """tmp_path""" else tmp_path for arg in args )
				with pytest.warns(_A  ,				match="""https://huggingface.co/docs/evaluate""" ):
								func(*_A )








"""simple docstring"""







def      UpperCamelCase       ( _A  ,				_A )     ->       int:
				lowercase    :      int       = 1  # To kept the Calculated Value
				# Since C(n, k) = C(n, n-k)
				if k > (n - k):
								lowercase    :      List[Any]       = n - k
				# Calculate C(n,k)
				for i in range(_A ):
								result *= n - i
								result //= i + 1
				return result


def      UpperCamelCase       ( _A )     ->       int:
				return binomial_coefficient(2 * node_count  ,				_A ) // (node_count + 1)


def      UpperCamelCase       ( _A )     ->       int:
				if n < 0:
								raise ValueError("""factorial() not defined for negative values""" )
				lowercase    :      Union[str, Any]       = 1
				for i in range(1  ,				n + 1 ):
								result *= i
				return result


def      UpperCamelCase       ( _A )     ->       int:
				return catalan_number(_A ) * factorial(_A )


if __name__ == "__main__":
				_lowerCAmelCase            =	int(input('Enter the number of nodes: ').strip() or 0)
				if node_count <= 0:
								raise ValueError('We need some nodes to work with.')
				print(
				    F'Given {node_count} nodes, there are {binary_tree_count(node_count)} '
				    F'binary trees and {catalan_number(node_count)} binary search trees.'
				)
