
"""simple docstring"""





import re
import string

import numpy as np

import datasets


UpperCamelCase_       :    List[Any]						      =			'''
Returns the rate at which the input predicted strings exactly match their references, ignoring any strings input as part of the regexes_to_ignore list.
'''

UpperCamelCase_       :    List[Any]						      =			'''
Args:
    predictions: List of predicted texts.
    references: List of reference texts.
    regexes_to_ignore: List, defaults to None. Regex expressions of characters to
        ignore when calculating the exact matches. Note: these regexes are removed
        from the input data before the changes based on the options below (e.g. ignore_case,
        ignore_punctuation, ignore_numbers) are applied.
    ignore_case: Boolean, defaults to False. If true, turns everything
        to lowercase so that capitalization differences are ignored.
    ignore_punctuation: Boolean, defaults to False. If true, removes all punctuation before
        comparing predictions and references.
    ignore_numbers: Boolean, defaults to False. If true, removes all punctuation before
        comparing predictions and references.
Returns:
    exact_match: Dictionary containing exact_match rate. Possible values are between 0.0 and 100.0, inclusive.
Examples:
    >>> exact_match = datasets.load_metric("exact_match")
    >>> refs = ["the cat", "theater", "YELLING", "agent007"]
    >>> preds = ["cat?", "theater", "yelling", "agent"]
    >>> results = exact_match.compute(references=refs, predictions=preds)
    >>> print(round(results["exact_match"], 1))
    25.0

    >>> exact_match = datasets.load_metric("exact_match")
    >>> refs = ["the cat", "theater", "YELLING", "agent007"]
    >>> preds = ["cat?", "theater", "yelling", "agent"]
    >>> results = exact_match.compute(references=refs, predictions=preds, regexes_to_ignore=["the ", "yell"], ignore_case=True, ignore_punctuation=True)
    >>> print(round(results["exact_match"], 1))
    50.0


    >>> exact_match = datasets.load_metric("exact_match")
    >>> refs = ["the cat", "theater", "YELLING", "agent007"]
    >>> preds = ["cat?", "theater", "yelling", "agent"]
    >>> results = exact_match.compute(references=refs, predictions=preds, regexes_to_ignore=["the ", "yell", "YELL"], ignore_case=True, ignore_punctuation=True)
    >>> print(round(results["exact_match"], 1))
    75.0

    >>> exact_match = datasets.load_metric("exact_match")
    >>> refs = ["the cat", "theater", "YELLING", "agent007"]
    >>> preds = ["cat?", "theater", "yelling", "agent"]
    >>> results = exact_match.compute(references=refs, predictions=preds, regexes_to_ignore=["the ", "yell", "YELL"], ignore_case=True, ignore_punctuation=True, ignore_numbers=True)
    >>> print(round(results["exact_match"], 1))
    100.0

    >>> exact_match = datasets.load_metric("exact_match")
    >>> refs = ["The cat sat on the mat.", "Theaters are great.", "It\'s like comparing oranges and apples."]
    >>> preds = ["The cat sat on the mat?", "Theaters are great.", "It\'s like comparing apples and oranges."]
    >>> results = exact_match.compute(references=refs, predictions=preds)
    >>> print(round(results["exact_match"], 1))
    33.3

'''

UpperCamelCase_       :    List[str]						      =			'''
'''



@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION  ,					_KWARGS_DESCRIPTION   )
class __lowerCAmelCase					(       datasets.Metric   ):




			"""simple docstring"""







			def   lowerCamelCase__  (					self    :       Dict						)   ->			Tuple:







								"""simple docstring"""
								return datasets.MetricInfo(
								    description=_DESCRIPTION							, citation=_CITATION							, inputs_description=_KWARGS_DESCRIPTION							, features=datasets.Features(
								        {
								            "predictions": datasets.Value("string"							, id="sequence"						),
								            "references": datasets.Value("string"							, id="sequence"						),
								        }						)							, reference_urls=[]							, )






			def   lowerCamelCase__  (					self    :       List[str]							, _snake_case    :       List[Any]							, _snake_case    :       List[str]							, _snake_case    :       str=None							, _snake_case    :       Optional[Any]=False							, _snake_case    :       Dict=False							, _snake_case    :       Tuple=False							, )   ->			Any:







								"""simple docstring"""
								if regexes_to_ignore is not None:
													for s in regexes_to_ignore:
																		A_								=    np.array([re.sub(_snake_case							, ""							, _snake_case						) for x in predictions]						)
																		A_								=    np.array([re.sub(_snake_case							, ""							, _snake_case						) for x in references]						)
								else:
													A_								=    np.asarray(_snake_case						)
													A_								=    np.asarray(_snake_case						)

								if ignore_case:
													A_								=    np.char.lower(_snake_case						)
													A_								=    np.char.lower(_snake_case						)

								if ignore_punctuation:
													A_								=    string.punctuation.maketrans(""							, ""							, string.punctuation						)
													A_								=    np.char.translate(_snake_case							, table=_snake_case						)
													A_								=    np.char.translate(_snake_case							, table=_snake_case						)

								if ignore_numbers:
													A_								=    string.digits.maketrans(""							, ""							, string.digits						)
													A_								=    np.char.translate(_snake_case							, table=_snake_case						)
													A_								=    np.char.translate(_snake_case							, table=_snake_case						)

								A_								=    predictions == references

								return {"exact_match": np.mean(_snake_case						) * 100}








'''simple docstring'''
from __future__ import annotations

from typing import Any







def       a_				(	UpperCamelCase_ ):
							create_state_space_tree(UpperCamelCase_						,  []						,  0 )







def       a_				(	UpperCamelCase_						,  UpperCamelCase_						,  UpperCamelCase_ ):

							if index == len(UpperCamelCase_ ):
														print(UpperCamelCase_ )
														return

							create_state_space_tree(UpperCamelCase_						,  UpperCamelCase_						,  index + 1 )
							current_subsequence.append(sequence[index] )
							create_state_space_tree(UpperCamelCase_						,  UpperCamelCase_						,  index + 1 )
							current_subsequence.pop()


if __name__ == "__main__":
							__SCREAMING_SNAKE_CASE					:				list[Any]									=		[3, 1, 2, 4]
							generate_all_subsequences(seq)

							seq.clear()
							seq.extend(['''A''', '''B''', '''C'''])
							generate_all_subsequences(seq)





