


from collections import defaultdict

class     a		:




							"""simple docstring"""


							def __init__(							self	:  str   ,     lowerCamelCase	:  Optional[int]   ,     lowerCamelCase	:  Any    )     ->   str:
														__snake_case		:      Union[str, Any]										=       total  # total no of tasks (N)

														# DP table will have a dimension of (2^M)*N
														# initially all values are set to -1
														__snake_case		:      Union[str, Any]										=       [
														    [-1 for i in range(total + 1    )] for j in range(2 ** len(lowerCamelCase    )    )
														]

														__snake_case		:      Optional[Any]										=       defaultdict(lowerCamelCase    )  # stores the list of persons for each task

														# final_mask is used to check if all persons are included by setting all bits
														# to 1
														__snake_case		:      List[str]										=       (1 << len(lowerCamelCase    )) - 1

							def    __snake_case (							self	:  int   ,     lowerCamelCase	:  Dict   ,     lowerCamelCase	:  Tuple    )     ->   str:
														# if mask == self.finalmask all persons are distributed tasks, return 1
														if mask == self.final_mask:
																					return 1

														# if not everyone gets the task and no more tasks are available, return 0
														if task_no > self.total_tasks:
																					return 0

														# if case already considered
														if self.dp[mask][task_no] != -1:
																					return self.dp[mask][task_no]

														# Number of ways when we don't this task in the arrangement
														__snake_case		:      List[str]										=       self.count_ways_until(lowerCamelCase   ,     task_no + 1    )

														# now assign the tasks one by one to all possible persons and recursively
														# assign for the remaining tasks.
														if task_no in self.task:
																					for p in self.task[task_no]:
																												# if p is already given a task
																												if mask & (1 << p):
																																			continue

																												# assign this task to p and change the mask value. And recursively
																												# assign tasks with the new mask value.
																												total_ways_util += self.count_ways_until(mask | (1 << p)   ,     task_no + 1    )

        # save the value.
														__snake_case		:      Dict										=       total_ways_util

														return self.dp[mask][task_no]






							def    __snake_case (							self	:  Dict   ,     lowerCamelCase	:  Union[str, Any]    )     ->   Tuple:
														# Store the list of persons for each task
														for i in range(len(lowerCamelCase    )    ):
																					for j in task_performed[i]:
																												self.task[j].append(lowerCamelCase    )

        # call the function to fill the DP table, final answer is stored in dp[0][1]
														return self.count_ways_until(0   ,     1    )


if __name__ == "__main__":
			_snake_case					:		Dict      =    5  # total no of tasks (the value of N)

			# the list of tasks that can be done by M persons.
			_snake_case					:		Tuple      =    [[1, 3, 4], [1, 2, 5], [3, 4]]
			print(
			    AssignmentUsingBitmask(task_performed, total_tasks).count_no_of_ways(
			        task_performed
			    )
			)





from ...configuration_utils import PretrainedConfig
from ...utils import logging


_snake_case					:		Any      =    logging.get_logger(__name__)

_snake_case					:		Dict      =    {
    "facebook/s2t-wav2vec2-large-en-de": (
        "https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/config.json"
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech2text2
}

class     a		(_lowerCAmelCase				):




							"""simple docstring"""


							__UpperCAmelCase   :							Union[str, Any]					  =  "speech_to_text_2"
							__UpperCAmelCase   :							Dict					  =  ["past_key_values"]
							__UpperCAmelCase   :							str					  =  {"num_attention_heads": "decoder_attention_heads", "hidden_size": "d_model"}

							def __init__(							self	:  str   ,     lowerCamelCase	:  List[Any]=10000   ,     lowerCamelCase	:  Tuple=6   ,     lowerCamelCase	:  Optional[Any]=2048   ,     lowerCamelCase	:  Optional[int]=4   ,     lowerCamelCase	:  Optional[int]=0.0   ,     lowerCamelCase	:  str=True   ,     lowerCamelCase	:  str="relu"   ,     lowerCamelCase	:  Tuple=256   ,     lowerCamelCase	:  Union[str, Any]=0.1   ,     lowerCamelCase	:  Optional[int]=0.0   ,     lowerCamelCase	:  Any=0.0   ,     lowerCamelCase	:  Optional[int]=0.02   ,     lowerCamelCase	:  Dict=2   ,     lowerCamelCase	:  List[str]=True   ,     lowerCamelCase	:  str=1   ,     lowerCamelCase	:  Any=0   ,     lowerCamelCase	:  List[Any]=2   ,     lowerCamelCase	:  List[Any]=1024   ,     **lowerCamelCase	:  List[str]   ,     )     ->   Any:
														__snake_case		:      Tuple										=       vocab_size
														__snake_case		:      int										=       d_model
														__snake_case		:      List[str]										=       decoder_ffn_dim
														__snake_case		:      Union[str, Any]										=       decoder_layers
														__snake_case		:      Dict										=       decoder_attention_heads
														__snake_case		:      Any										=       dropout
														__snake_case		:      List[str]										=       attention_dropout
														__snake_case		:      Optional[Any]										=       activation_dropout
														__snake_case		:      Union[str, Any]										=       activation_function
														__snake_case		:      Union[str, Any]										=       init_std
														__snake_case		:      Union[str, Any]										=       decoder_layerdrop
														__snake_case		:      Optional[int]										=       use_cache
														__snake_case		:      Optional[int]										=       decoder_layers
														__snake_case		:      str										=       scale_embedding  # scale factor will be sqrt(d_model) if True
														__snake_case		:      Dict										=       max_target_positions

														super().__init__(
														    pad_token_id=lowerCamelCase   ,     bos_token_id=lowerCamelCase   ,     eos_token_id=lowerCamelCase   ,     decoder_start_token_id=lowerCamelCase   ,     **lowerCamelCase   ,     )

