






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


__UpperCamelCase   :   Tuple      =    logging.get_logger(__name__)

__UpperCamelCase   :   int      =    {
    """unc-nlp/lxmert-base-uncased""": """https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/config.json""",
}


class 							__UpperCamelCase     (  _lowerCAmelCase ):
	__snake_case						:Union[str, Any] =							'lxmert'
	__snake_case						:Union[str, Any] =							{}







	def __init__(	self   :				List[str]							,					_lowerCAmelCase   :				Dict=3_0522							,					_lowerCAmelCase   :				List[str]=768							,					_lowerCAmelCase   :				Union[str, Any]=12							,					_lowerCAmelCase   :				Union[str, Any]=9500							,					_lowerCAmelCase   :				Union[str, Any]=1600							,					_lowerCAmelCase   :				Optional[Any]=400							,					_lowerCAmelCase   :				Tuple=3072							,					_lowerCAmelCase   :				List[Any]="gelu"							,					_lowerCAmelCase   :				int=0.1							,					_lowerCAmelCase   :				Dict=0.1							,					_lowerCAmelCase   :				Tuple=512							,					_lowerCAmelCase   :				Tuple=2							,					_lowerCAmelCase   :				Optional[Any]=0.02							,					_lowerCAmelCase   :				List[str]=1e-12							,					_lowerCAmelCase   :				Any=9							,					_lowerCAmelCase   :				Optional[Any]=5							,					_lowerCAmelCase   :				Any=5							,					_lowerCAmelCase   :				Dict=2048							,					_lowerCAmelCase   :				int=4							,					_lowerCAmelCase   :				Optional[Any]=6.67							,					_lowerCAmelCase   :				Optional[Any]=True							,					_lowerCAmelCase   :				int=True							,					_lowerCAmelCase   :				int=True							,					_lowerCAmelCase   :				str=True							,					_lowerCAmelCase   :				Dict=True							,					_lowerCAmelCase   :				int=True							,					_lowerCAmelCase   :				int=True							,					**_lowerCAmelCase   :				Tuple							,					)		->			Dict:
		"""simple docstring"""







		__lowercase   							=	vocab_size
		__lowercase   							=	hidden_size
		__lowercase   							=	num_attention_heads
		__lowercase   							=	hidden_act
		__lowercase   							=	intermediate_size
		__lowercase   							=	hidden_dropout_prob
		__lowercase   							=	attention_probs_dropout_prob
		__lowercase   							=	max_position_embeddings
		__lowercase   							=	type_vocab_size
		__lowercase   							=	initializer_range
		__lowercase   							=	layer_norm_eps
		__lowercase   							=	num_qa_labels
		__lowercase   							=	num_object_labels
		__lowercase   							=	num_attr_labels
		__lowercase   							=	l_layers
		__lowercase   							=	x_layers
		__lowercase   							=	r_layers
		__lowercase   							=	visual_feat_dim
		__lowercase   							=	visual_pos_dim
		__lowercase   							=	visual_loss_normalizer
		__lowercase   							=	task_matched
		__lowercase   							=	task_mask_lm
		__lowercase   							=	task_obj_predict
		__lowercase   							=	task_qa
		__lowercase   							=	visual_obj_loss
		__lowercase   							=	visual_attr_loss
		__lowercase   							=	visual_feat_loss
		__lowercase   							=	{"""vision""": r_layers, """cross_encoder""": x_layers, """language""": l_layers}
		super().__init__(**_lowerCAmelCase      )



'''simple docstring'''





from math import factorial

SCREAMING_SNAKE_CASE     =       {str(digit): factorial(digit) for digit in range(1_0)}







def snake_case_     (					lowercase__		):
  if not isinstance(lowercase__   ,       lowercase__		):
    raise TypeError("Parameter number must be int"		)

  if number < 0:
    raise ValueError("Parameter number must be greater than or equal to 0"		)

  # Converts number in string to iterate on its digits and adds its factorial.
  return sum(DIGIT_FACTORIAL[digit] for digit in str(lowercase__		)		)







def snake_case_     (					lowercase__ = 6_0   ,       lowercase__ = 1_0_0_0_0_0_0		):

  if not isinstance(lowercase__   ,       lowercase__		) or not isinstance(lowercase__   ,       lowercase__		):
    raise TypeError("Parameters chain_length and number_limit must be int"		)

  if chain_length <= 0 or number_limit <= 0:
    raise ValueError(
        "Parameters chain_length and number_limit must be greater than 0"		)

  # the counter for the chains with the exact desired length
  UpperCAmelCase__      :					Union[str, Any]				       =							0
  # the cached sizes of the previous chains
  UpperCAmelCase__      :					dict[int, int]				       =							{}

  for start_chain_element in range(1   ,       lowercase__		):
    # The temporary set will contain the elements of the chain
    UpperCAmelCase__      :					Any				       =							set()
    UpperCAmelCase__      :					int				       =							0

    # Stop computing the chain when you find a cached size, a repeating item or the
    # length is greater then the desired one.
    UpperCAmelCase__      :					List[str]				       =							start_chain_element
    while (
        chain_element not in chain_sets_lengths
        and chain_element not in chain_set
        and chain_set_length <= chain_length
    ):
      chain_set.add(lowercase__		)
      chain_set_length += 1
      UpperCAmelCase__      :					List[str]				       =							digit_factorial_sum(lowercase__		)

    if chain_element in chain_sets_lengths:
      chain_set_length += chain_sets_lengths[chain_element]

    UpperCAmelCase__      :					List[str]				       =							chain_set_length

    # If chain contains the exact amount of elements increase the counter
    if chain_set_length == chain_length:
      chains_counter += 1

  return chains_counter


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      print(F'{solution()}')



