





'''simple docstring'''


import colorsys

from PIL import Image  # type: ignore
def 							UpperCAmelCase_  (						__lowerCamelCase : float     ,__lowerCamelCase : float     ,__lowerCamelCase : int			):
   lowercase_      :Tuple         =			x
   lowercase_      :Dict         =			y
   for step in range(__lowerCamelCase			):  # noqa: B007
      lowercase_      :Tuple         =			a * a - b * b + x
      lowercase_      :Any         =			2 * a * b + y
      lowercase_      :Union[str, Any]         =			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_  (						__lowerCamelCase : float			):
   if distance == 1:
      return (0, 0, 0)
   else:
      return (2_55, 2_55, 2_55)
def 							UpperCAmelCase_  (						__lowerCamelCase : float			):
   if distance == 1:
      return (0, 0, 0)
   else:
      return tuple(round(i * 2_55			) for i in colorsys.hsv_to_rgb(__lowerCamelCase     ,1     ,1			)			)
def 							UpperCAmelCase_  (						__lowerCamelCase : int = 8_00     ,__lowerCamelCase : int = 6_00     ,__lowerCamelCase : float = -0.6     ,__lowerCamelCase : float = 0     ,__lowerCamelCase : float = 3.2     ,__lowerCamelCase : int = 50     ,__lowerCamelCase : bool = True     ,):
   lowercase_      :int         =			Image.new("RGB"     ,(image_width, image_height)			)
   lowercase_      :Tuple         =			img.load()

   # loop through the image-coordinates
   for image_x in range(__lowerCamelCase			):
      for image_y in range(__lowerCamelCase			):
         # determine the figure-coordinates based on the image-coordinates
         lowercase_      :int         =			figure_width / image_width * image_height
         lowercase_      :int         =			figure_center_x + (image_x / image_width - 0.5) * figure_width
         lowercase_      :str         =			figure_center_y + (image_y / image_height - 0.5) * figure_height

         lowercase_      :List[Any]         =			get_distance(__lowerCamelCase     ,__lowerCamelCase     ,__lowerCamelCase			)

         # color the corresponding pixel based on the selected coloring-function
         if use_distance_color_coding:
            lowercase_      :List[str]         =			get_color_coded_rgb(__lowerCamelCase			)
         else:
            lowercase_      :Union[str, Any]         =			get_black_and_white_rgb(__lowerCamelCase			)

   return img


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 # colored version, full figure
 lowerCAmelCase :					Dict 							=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()









'''simple docstring'''


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


lowerCAmelCase :					Tuple 							=logging.get_logger(__name__)

lowerCAmelCase :					str 							={
    '''microsoft/cvt-13''': '''https://huggingface.co/microsoft/cvt-13/resolve/main/config.json''',
    # See all Cvt models at https://huggingface.co/models?filter=cvt
}
class 				a_       (    _lowerCAmelCase							):
     __A								=      "cvt"





     def __init__(			self		: Tuple     ,				lowercase		: str=3     ,				lowercase		: str=[7, 3, 3]     ,				lowercase		: List[str]=[4, 2, 2]     ,				lowercase		: Dict=[2, 1, 1]     ,				lowercase		: int=[64, 192, 384]     ,				lowercase		: Dict=[1, 3, 6]     ,				lowercase		: Dict=[1, 2, 10]     ,				lowercase		: Any=[4.0, 4.0, 4.0]     ,				lowercase		: Tuple=[0.0, 0.0, 0.0]     ,				lowercase		: List[str]=[0.0, 0.0, 0.0]     ,				lowercase		: List[str]=[0.0, 0.0, 0.1]     ,				lowercase		: Any=[True, True, True]     ,				lowercase		: Any=[False, False, True]     ,				lowercase		: Optional[Any]=["dw_bn", "dw_bn", "dw_bn"]     ,				lowercase		: int=[3, 3, 3]     ,				lowercase		: str=[1, 1, 1]     ,				lowercase		: List[Any]=[2, 2, 2]     ,				lowercase		: Tuple=[1, 1, 1]     ,				lowercase		: Optional[Any]=[1, 1, 1]     ,				lowercase		: str=0.02     ,				lowercase		: str=1e-1_2     ,				**lowercase		: str     ,				):





        """simple docstring"""




        super().__init__(**lowercase						)
        lowercase_      :List[Any]         =			num_channels
        lowercase_      :Union[str, Any]         =			patch_sizes
        lowercase_      :Tuple         =			patch_stride
        lowercase_      :List[Any]         =			patch_padding
        lowercase_      :List[Any]         =			embed_dim
        lowercase_      :Union[str, Any]         =			num_heads
        lowercase_      :Any         =			depth
        lowercase_      :str         =			mlp_ratio
        lowercase_      :List[str]         =			attention_drop_rate
        lowercase_      :List[Any]         =			drop_rate
        lowercase_      :Union[str, Any]         =			drop_path_rate
        lowercase_      :Any         =			qkv_bias
        lowercase_      :Dict         =			cls_token
        lowercase_      :int         =			qkv_projection_method
        lowercase_      :Union[str, Any]         =			kernel_qkv
        lowercase_      :Optional[Any]         =			padding_kv
        lowercase_      :Optional[Any]         =			stride_kv
        lowercase_      :Dict         =			padding_q
        lowercase_      :Any         =			stride_q
        lowercase_      :Dict         =			initializer_range
        lowercase_      :Optional[Any]         =			layer_norm_eps


