






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


lowerCamelCase__       		=  logging.get_logger(__name__)

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




class       snake_case__ (				lowercase_):

       '''simple docstring'''
       lowerCamelCase				:					List[str]								=			"lxmert"
       lowerCamelCase				:					List[Any]								=			{}



       def __init__(				self      ,    a__=3_05_22      ,    a__=7_68      ,    a__=12      ,    a__=95_00      ,    a__=16_00      ,    a__=4_00      ,    a__=30_72      ,    a__="gelu"      ,    a__=0.1      ,    a__=0.1      ,    a__=5_12      ,    a__=2      ,    a__=0.02      ,    a__=1e-12      ,    a__=9      ,    a__=5      ,    a__=5      ,    a__=20_48      ,    a__=4      ,    a__=6.67      ,    a__=True      ,    a__=True      ,    a__=True      ,    a__=True      ,    a__=True      ,    a__=True      ,    a__=True      ,    **a__      ,    )			->   str:






            '''simple docstring'''





            __snake_case      :int 							=    vocab_size
            __snake_case      :int 							=    hidden_size
            __snake_case      :Union[str, Any] 							=    num_attention_heads
            __snake_case      :Any 							=    hidden_act
            __snake_case      :List[Any] 							=    intermediate_size
            __snake_case      :Optional[Any] 							=    hidden_dropout_prob
            __snake_case      :List[str] 							=    attention_probs_dropout_prob
            __snake_case      :int 							=    max_position_embeddings
            __snake_case      :Optional[int] 							=    type_vocab_size
            __snake_case      :str 							=    initializer_range
            __snake_case      :List[Any] 							=    layer_norm_eps
            __snake_case      :Dict 							=    num_qa_labels
            __snake_case      :Optional[Any] 							=    num_object_labels
            __snake_case      :Optional[int] 							=    num_attr_labels
            __snake_case      :Dict 							=    l_layers
            __snake_case      :int 							=    x_layers
            __snake_case      :List[str] 							=    r_layers
            __snake_case      :str 							=    visual_feat_dim
            __snake_case      :Dict 							=    visual_pos_dim
            __snake_case      :List[str] 							=    visual_loss_normalizer
            __snake_case      :Union[str, Any] 							=    task_matched
            __snake_case      :int 							=    task_mask_lm
            __snake_case      :Dict 							=    task_obj_predict
            __snake_case      :Any 							=    task_qa
            __snake_case      :Union[str, Any] 							=    visual_obj_loss
            __snake_case      :Dict 							=    visual_attr_loss
            __snake_case      :List[Any] 							=    visual_feat_loss
            __snake_case      :Optional[int] 							=    {"""vision""": r_layers, """cross_encoder""": x_layers, """language""": l_layers}
            super().__init__(**a__     )










import colorsys

from PIL import Image  # type: ignore






def 	UpperCamelCase	(							snake_case__  : float						,snake_case__  : float						,snake_case__  : int	):




     '''simple docstring'''






     __snake_case      :List[Any] 							=    x
     __snake_case      :str 							=    y
     for step in range(snake_case__	):  # noqa: B007
          __snake_case      :Tuple 							=    a * a - b * b + x
          __snake_case      :Dict 							=    2 * a * b + y
          __snake_case      :str 							=    a_new

          # divergence happens for all complex number with an absolute value
          # greater than 4
          if a * a + b * b > 4:
               break
     return step / (max_step - 1)






def 	UpperCamelCase	(							snake_case__  : float	):




     '''simple docstring'''






     if distance == 1:
          return (0, 0, 0)
     else:
          return (255, 255, 255)






def 	UpperCamelCase	(							snake_case__  : float	):




     '''simple docstring'''






     if distance == 1:
          return (0, 0, 0)
     else:
          return tuple(round(i * 255	) for i in colorsys.hsv_to_rgb(snake_case__						,1						,1	)	)






def 	UpperCamelCase	(							snake_case__  : int = 800						,snake_case__  : int = 600						,snake_case__  : float = -0.6						,snake_case__  : float = 0						,snake_case__  : float = 3.2						,snake_case__  : int = 50						,snake_case__  : bool = True						,):




     '''simple docstring'''






     __snake_case      :Tuple 							=    Image.new("""RGB"""						,(image_width, image_height)	)
     __snake_case      :Dict 							=    img.load()

     # loop through the image-coordinates
     for image_x in range(snake_case__	):
          for image_y in range(snake_case__	):
               # determine the figure-coordinates based on the image-coordinates
               __snake_case      :Dict 							=    figure_width / image_width * image_height
               __snake_case      :Any 							=    figure_center_x + (image_x / image_width - 0.5) * figure_width
               __snake_case      :List[str] 							=    figure_center_y + (image_y / image_height - 0.5) * figure_height

               __snake_case      :Tuple 							=    get_distance(snake_case__						,snake_case__						,snake_case__	)

               # color the corresponding pixel based on the selected coloring-function
               if use_distance_color_coding:
                    __snake_case      :Optional[int] 							=    get_color_coded_rgb(snake_case__	)
               else:
                    __snake_case      :Optional[int] 							=    get_black_and_white_rgb(snake_case__	)

     return img


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     # colored version, full figure
     lowerCamelCase__       		=  get_image()

     # uncomment for colored version, different section, zoomed in
     # img = get_image(figure_center_x = -0.6, figure_center_y = -0.4,
     # figure_width = 0.8)

     # uncomment for black and white version, full figure
     # img = get_image(use_distance_color_coding = False)

     # uncomment to save the image
     # img.save("mandelbrot.png")

     img.show()


