




'''simple docstring'''




from math import sqrt






def __lowerCAmelCase				(							UpperCamelCase__       )			->					Any:
    __lowerCamelCase						=						[1]
    for i in range(2       ,						int(sqrt(lowercase__       )       ) + 1       ,						1       ):
        if number % i == 0:
            values.append(lowercase__       )
            if int(number // i       ) != i:
                values.append(int(number // i       )       )
    return sorted(lowercase__       )






def __lowerCAmelCase				(							UpperCamelCase__       )			->					Optional[int]:
    return sum(factors(lowercase__       )       ) > n






def __lowerCAmelCase				(							UpperCamelCase__       )			->					str:
    __lowerCamelCase						=						factors(lowercase__       )
    __lowerCamelCase						=						len(lowercase__       )
    __lowerCamelCase						=						[[0 for i in range(number + 1       )] for j in range(r + 1       )]
    for i in range(r + 1       ):
        __lowerCamelCase						=						True

    for i in range(1       ,						number + 1       ):
        __lowerCamelCase						=						False

    for i in range(1       ,						r + 1       ):
        for j in range(1       ,						number + 1       ):
            if j < values[i - 1]:
                __lowerCamelCase						=						subset[i - 1][j]
            else:
                __lowerCamelCase						=						subset[i - 1][j] or subset[i - 1][j - values[i - 1]]

    return subset[r][number] != 0






def __lowerCAmelCase				(							UpperCamelCase__       )			->					str:
    return abundant(lowercase__       ) and not semi_perfect(lowercase__       )


if __name__ == "__main__":
  import doctest

  doctest.testmod(verbose=True)
  for number in (6_9, 7_0, 7_1):
    print(f'{number} is {"" if weird(number) else "not "}weird.')

'''simple docstring'''




import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig


__UpperCAmelCase  							=logging.get_logger(__name__)

__UpperCAmelCase  							={
    "facebook/musicgen-small": "https://huggingface.co/facebook/musicgen-small/resolve/main/config.json",
    # See all Musicgen models at https://huggingface.co/models?filter=musicgen
}




class 					a__   (     UpperCAmelCase__				):
     lowerCamelCase						:  Union[str, Any]							="musicgen_decoder"
     lowerCamelCase						:  List[Any]							=["past_key_values"]






     def __init__(				self	:	List[str]						,       a	:	Dict=20_48						,       a	:	Any=20_48						,       a	:	int=24						,       a	:	Optional[Any]=40_96						,       a	:	Tuple=16						,       a	:	Optional[int]=0.0						,       a	:	Tuple=True						,       a	:	Dict="gelu"						,       a	:	Optional[Any]=10_24						,       a	:	Optional[Any]=0.1						,       a	:	Tuple=0.0						,       a	:	Optional[int]=0.0						,       a	:	Any=0.02						,       a	:	str=False						,       a	:	List[Any]=4						,       a	:	List[str]=20_48						,       a	:	Any=20_48						,       a	:	Dict=None						,       a	:	str=False						,       **a	:	Tuple						,       ):





         """simple docstring"""



         __lowerCamelCase						=						vocab_size
         __lowerCamelCase						=						max_position_embeddings
         __lowerCamelCase						=						hidden_size
         __lowerCamelCase						=						ffn_dim
         __lowerCamelCase						=						num_hidden_layers
         __lowerCamelCase						=						num_attention_heads
         __lowerCamelCase						=						dropout
         __lowerCamelCase						=						attention_dropout
         __lowerCamelCase						=						activation_dropout
         __lowerCamelCase						=						activation_function
         __lowerCamelCase						=						initializer_factor
         __lowerCamelCase						=						layerdrop
         __lowerCamelCase						=						use_cache
         __lowerCamelCase						=						scale_embedding  # scale factor will be sqrt(d_model) if True
         __lowerCamelCase						=						num_codebooks
         super().__init__(
             pad_token_id=a						,       bos_token_id=a						,       eos_token_id=a						,       tie_word_embeddings=a						,       **a						,       )




class 					a__   (     UpperCAmelCase__				):
     lowerCamelCase						:  Any							="musicgen"
     lowerCamelCase						:  str							=True






     def __init__(				self	:	str						,       **a	:	int					):





         """simple docstring"""



         super().__init__(**a					)
         if "text_encoder" not in kwargs or "audio_encoder" not in kwargs or "decoder" not in kwargs:
             raise ValueError('''Config has to be initialized with text_encoder, audio_encoder and decoder config'''					)

         __lowerCamelCase						=						kwargs.pop('''text_encoder'''					)
         __lowerCamelCase						=						text_encoder_config.pop('''model_type'''					)

         __lowerCamelCase						=						kwargs.pop('''audio_encoder'''					)
         __lowerCamelCase						=						audio_encoder_config.pop('''model_type'''					)

         __lowerCamelCase						=						kwargs.pop('''decoder'''					)

         __lowerCamelCase						=						AutoConfig.for_model(a						,       **a					)
         __lowerCamelCase						=						AutoConfig.for_model(a						,       **a					)
         __lowerCamelCase						=						MusicgenDecoderConfig(**a					)
         __lowerCamelCase						=						True






     @classmethod
     def      SCREAMING_SNAKE_CASE__     (				cls	:	Dict						,       a	:	PretrainedConfig						,       a	:	PretrainedConfig						,       a	:	MusicgenDecoderConfig						,       **a	:	str						,       ):





         """simple docstring"""



         return cls(
             text_encoder=text_encoder_config.to_dict()						,       audio_encoder=audio_encoder_config.to_dict()						,       decoder=decoder_config.to_dict()						,       **a						,       )






     def      SCREAMING_SNAKE_CASE__     (				self	:	List[Any]					):





         """simple docstring"""



         __lowerCamelCase						=						copy.deepcopy(self.__dict__					)
         __lowerCamelCase						=						self.text_encoder.to_dict()
         __lowerCamelCase						=						self.audio_encoder.to_dict()
         __lowerCamelCase						=						self.decoder.to_dict()
         __lowerCamelCase						=						self.__class__.model_type
         return output
