





from math import ceil





def  __magic_name__  (				lowercase				,       lowercase				)				-> Optional[Any]:

							"""simple docstring"""



							lowercase_	:   Tuple  				=     list(range(0				,       lowercase				)				)

							lowercase_	:   Tuple  				=     [item for sublist in list(device_map.values()				) for item in sublist]

							# Duplicate check
							lowercase_	:   int  				=     []
							for i in device_map_blocks:
														if device_map_blocks.count(lowercase				) > 1 and i not in duplicate_blocks:
																					duplicate_blocks.append(lowercase				)
    # Missing blocks
							lowercase_	:   Optional[Any]  				=     [i for i in blocks if i not in device_map_blocks]
							lowercase_	:   str  				=     [i for i in device_map_blocks if i not in blocks]

							if len(lowercase				) != 0:
														raise ValueError(
														    """Duplicate attention blocks specified in device_map. Attention blocks must be specified to one device."""
														    """ These attention blocks were specified more than once: """ + str(lowercase				)				)
							if len(lowercase				) != 0:
														raise ValueError(
														    """There are attention blocks for this model that are not specified in the device_map. Add these attention """
														    """blocks to a device on the device_map: """ + str(lowercase				)				)
							if len(lowercase				) != 0:
														raise ValueError(
														    """The device_map contains more attention blocks than this model has. Remove these from the device_map:"""
														    + str(lowercase				)				)





def  __magic_name__  (				lowercase				,       lowercase				)				-> Union[str, Any]:

							"""simple docstring"""



							lowercase_	:   int  				=     list(range(lowercase				)				)
							lowercase_	:   Any  				=     int(ceil(n_layers / len(lowercase				)				)				)
							lowercase_	:   Union[str, Any]  				=     [layers[i : i + n_blocks] for i in range(0				,       lowercase				,       lowercase				)]

							return dict(zip(lowercase				,       lowercase				)				)

"""simple docstring"""

from math import asin, atan, cos, radians, sin, sqrt, tan

SCREAMING_SNAKE_CASE_            =    6_3_7_8_1_3_7.0
SCREAMING_SNAKE_CASE_            =    6_3_5_6_7_5_2.3_1_4_2_4_5
SCREAMING_SNAKE_CASE_            =    637_8137




def      lowercase__    (       lowerCAmelCase					:       float			,					lowerCAmelCase					:       float			,					lowerCAmelCase					:       float			,					lowerCAmelCase					:       float			)			->   float:






    """simple docstring"""




    UpperCAmelCase          =       (AXIS_A - AXIS_B) / AXIS_A
    UpperCAmelCase          =       atan((1 - flattening) * tan(radians(lowerCAmelCase			)			)			)
    UpperCAmelCase          =       atan((1 - flattening) * tan(radians(lowerCAmelCase			)			)			)
    UpperCAmelCase          =       radians(lowerCAmelCase			)
    UpperCAmelCase          =       radians(lowerCAmelCase			)
    # Equation
    UpperCAmelCase          =       sin((phi_a - phi_a) / 2			)
    UpperCAmelCase          =       sin((lambda_a - lambda_a) / 2			)
    # Square both values
    sin_sq_phi *= sin_sq_phi
    sin_sq_lambda *= sin_sq_lambda
    UpperCAmelCase          =       sqrt(sin_sq_phi + (cos(lowerCAmelCase			) * cos(lowerCAmelCase			) * sin_sq_lambda)			)
    return 2 * RADIUS * asin(lowerCAmelCase			)


if __name__ == "__main__":
   import doctest

   doctest.testmod()



