'''simple docstring'''

def snake_case_      (					__snake_case  :							Tuple	,   __snake_case  :							Dict)			->					bool:
   lowerCAmelCase_			=      len(SCREAMING_SNAKE_CASE_) + 1
   lowerCAmelCase_			=      len(SCREAMING_SNAKE_CASE_) + 1

   # dp is a 2d matrix where dp[i][j] denotes whether prefix string of
   # length i of input_string matches with prefix string of length j of
   # given pattern.
   # "dp" stands for dynamic programming.
   lowerCAmelCase_			=      [[0 for i in range(SCREAMING_SNAKE_CASE_)] for j in range(SCREAMING_SNAKE_CASE_)]

   # since string of zero length match pattern of zero length
   lowerCAmelCase_			=      1

   # since pattern of zero length will never match with string of non-zero length
   for i in range(1	,   SCREAMING_SNAKE_CASE_):
      lowerCAmelCase_			=      0

   # since string of zero length will match with pattern where there
   # is at least one * alternatively
   for j in range(1	,   SCREAMING_SNAKE_CASE_):
      lowerCAmelCase_			=      dp[0][j - 2] if pattern[j - 1] == '''*''' else 0

   # now using bottom-up approach to find for all remaining lengths
   for i in range(1	,   SCREAMING_SNAKE_CASE_):
      for j in range(1	,   SCREAMING_SNAKE_CASE_):
         if input_string[i - 1] == pattern[j - 1] or pattern[j - 1] == ".":
            lowerCAmelCase_			=      dp[i - 1][j - 1]

         elif pattern[j - 1] == "*":
            if dp[i][j - 2] == 1:
               lowerCAmelCase_			=      1
            elif pattern[j - 2] in (input_string[i - 1], "."):
               lowerCAmelCase_			=      dp[i - 1][j]
            else:
               lowerCAmelCase_			=      0
         else:
            lowerCAmelCase_			=      0

   return bool(dp[-1][-1])


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 # inputing the strings
 # input_string = input("input a string :")
 # pattern = input("input a pattern :")

 A_     :						Union[str, Any]    							='''aab'''
 A_     :						Tuple    							='''c*a*b'''

 # using function to check whether given string matches the given pattern
 if match_pattern(input_string, pattern):
  print(f'''{input_string} matches the given pattern {pattern}''')
 else:
  print(f'''{input_string} does not match with the given pattern {pattern}''')











'''simple docstring'''
import pytest

from datasets.splits import SplitDict, SplitInfo
from datasets.utils.py_utils import asdict





@pytest.mark.parametrize(
    'split_dict'       ,[
        SplitDict(),
        SplitDict({'train': SplitInfo(name='train'       ,num_bytes=1337       ,num_examples=42       ,dataset_name='my_dataset'     )}     ),
        SplitDict({'train': SplitInfo(name='train'       ,num_bytes=1337       ,num_examples=42     )}     ),
        SplitDict({'train': SplitInfo()}     ),
    ]       ,)
def 			lowerCamelCase(							SCREAMING_SNAKE_CASE_     )		->		List[str]:
			A_									= split_dict._to_yaml_list()
			assert len(SCREAMING_SNAKE_CASE_     ) == len(SCREAMING_SNAKE_CASE_     )
			A_									= SplitDict._from_yaml_list(SCREAMING_SNAKE_CASE_     )
			for split_name, split_info in split_dict.items():
						# dataset_name field is deprecated, and is therefore not part of the YAML dump
						A_									= None
						# the split name of split_dict takes over the name of the split info object
						A_									= split_name
			assert split_dict == reloaded






@pytest.mark.parametrize(
    'split_info'       ,[SplitInfo(), SplitInfo(dataset_name=SCREAMING_SNAKE_CASE_     ), SplitInfo(dataset_name='my_dataset'     )]     )
def 			lowerCamelCase(							SCREAMING_SNAKE_CASE_     )		->		Optional[Any]:
			# For backward compatibility, we need asdict(split_dict) to return split info dictrionaries with the "dataset_name"
			# field even if it's deprecated. This way old versionso of `datasets` can still reload dataset_infos.json files
			A_									= asdict(SplitDict({'train': split_info}     )     )
			assert "dataset_name" in split_dict_asdict["train"]
			assert split_dict_asdict["train"]["dataset_name"] == split_info.dataset_name




