





from timeit import timeit







def        __lowerCamelCase (							__a       :int   )		->    int:






		"""simple docstring"""

		if number < 0:
				raise ValueError("""the value of input must not be negative"""   )
		A__  				=       0
		while number:
				number &= number - 1
				result += 1
		return result







def        __lowerCamelCase (							__a       :int   )		->    int:






		"""simple docstring"""

		if number < 0:
				raise ValueError("""the value of input must not be negative"""   )
		A__  				=       0
		while number:
				if number % 2 == 1:
						result += 1
				number >>= 1
		return result







def        __lowerCamelCase (							)		->    None:






		"""simple docstring"""

		def do_benchmark(__a       :int   ) -> None:
				A__  				=       """import __main__ as z"""
				print(F'Benchmark when {number = }:'   )
				print(F'{get_set_bits_count_using_modulo_operator(__a   ) = }'   )
				A__  				=       timeit("""z.get_set_bits_count_using_modulo_operator(25)"""   ,					setup=__a   )
				print(F'timeit() runs in {timing} seconds'   )
				print(F'{get_set_bits_count_using_brian_kernighans_algorithm(__a   ) = }'   )
				A__  				=       timeit(
				    """z.get_set_bits_count_using_brian_kernighans_algorithm(25)"""   ,					setup=__a   ,					)
				print(F'timeit() runs in {timing} seconds'   )

		for number in (2_5, 3_7, 5_8, 0):
				do_benchmark(__a   )
				print()


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					benchmark()










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


A   : Dict			=				logging.get_logger(__name__)

A   : Dict			=				{
    '''google/pegasus-large''': '''https://huggingface.co/google/pegasus-large/resolve/main/config.json''',
    # See all PEGASUS models at https://huggingface.co/models?filter=pegasus
}


class   A      (SCREAMING_SNAKE_CASE   ):
			'''simple docstring'''




			__lowerCamelCase     :	Tuple          =   '''pegasus'''
			__lowerCamelCase     :	Any          =   ['''past_key_values''']
			__lowerCamelCase     :	List[str]          =   {'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}






			def __init__(      self       :   List[Any]							,     __lowerCAmelCase       :   str=5_02_65							,     __lowerCAmelCase       :   Dict=10_24							,     __lowerCAmelCase       :   Union[str, Any]=12							,     __lowerCAmelCase       :   Any=40_96							,     __lowerCAmelCase       :   Optional[Any]=16							,     __lowerCAmelCase       :   Dict=12							,     __lowerCAmelCase       :   Optional[int]=40_96							,     __lowerCAmelCase       :   Dict=16							,     __lowerCAmelCase       :   Optional[int]=0.0							,     __lowerCAmelCase       :   Optional[Any]=0.0							,     __lowerCAmelCase       :   Union[str, Any]=True							,     __lowerCAmelCase       :   List[str]=True							,     __lowerCAmelCase       :   str="gelu"							,     __lowerCAmelCase       :   Union[str, Any]=10_24							,     __lowerCAmelCase       :   Union[str, Any]=0.1							,     __lowerCAmelCase       :   Dict=0.0							,     __lowerCAmelCase       :   Union[str, Any]=0.0							,     __lowerCAmelCase       :   Union[str, Any]=0.0_2							,     __lowerCAmelCase       :   List[Any]=0							,     __lowerCAmelCase       :   str=False							,     __lowerCAmelCase       :   int=0							,     __lowerCAmelCase       :   Optional[Any]=1							,     __lowerCAmelCase       :   Optional[int]=1							,     **__lowerCAmelCase       :   Dict							,     )     ->     Dict:







					"""simple docstring"""






					A__  				=       vocab_size
					A__  				=       max_position_embeddings
					A__  				=       d_model
					A__  				=       encoder_ffn_dim
					A__  				=       encoder_layers
					A__  				=       encoder_attention_heads
					A__  				=       decoder_ffn_dim
					A__  				=       decoder_layers
					A__  				=       decoder_attention_heads
					A__  				=       dropout
					A__  				=       attention_dropout
					A__  				=       activation_dropout
					A__  				=       activation_function
					A__  				=       init_std
					A__  				=       encoder_layerdrop
					A__  				=       decoder_layerdrop
					A__  				=       use_cache
					A__  				=       encoder_layers
					A__  				=       scale_embedding  # scale factor will be sqrt(d_model) if True
					super().__init__(
					    pad_token_id=__lowerCAmelCase							,     eos_token_id=__lowerCAmelCase							,     is_encoder_decoder=__lowerCAmelCase							,     decoder_start_token_id=__lowerCAmelCase							,     forced_eos_token_id=__lowerCAmelCase							,     **__lowerCAmelCase							,     )






			@property
			def        a_	(      self       :   Dict       )     ->     int:







					"""simple docstring"""






					return self.encoder_attention_heads







			@property
			def        a_	(      self       :   Optional[Any]       )     ->     int:







					"""simple docstring"""






					return self.d_model



