


from math import ceil
def 				UpperCamelCase__					(  SCREAMING_SNAKE_CASE__      ,	SCREAMING_SNAKE_CASE__						):
	__lowerCamelCase		:							Tuple		 =						list(range(0      ,	a_						)						)

	__lowerCamelCase		:							Optional[int]		 =						[item for sublist in list(device_map.values()						) for item in sublist]

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

	if len(a_						) != 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(a_						)						)
	if len(a_						) != 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(a_						)						)
	if len(a_						) != 0:
		raise ValueError(
		    'The device_map contains more attention blocks than this model has. Remove these from the device_map:'
		    + str(a_						)						)



def 				UpperCamelCase__					(  SCREAMING_SNAKE_CASE__      ,	SCREAMING_SNAKE_CASE__						):
	__lowerCamelCase		:							str		 =						list(range(a_						)						)
	__lowerCamelCase		:							List[Any]		 =						int(ceil(n_layers / len(a_						)						)						)
	__lowerCamelCase		:							List[str]		 =						[layers[i : i + n_blocks] for i in range(0      ,	a_      ,	a_						)]

	return dict(zip(a_      ,	a_						)						)





from maths.is_square_free import is_square_free
from maths.prime_factors import prime_factors
def 				UpperCamelCase__					(  SCREAMING_SNAKE_CASE__						):
 __lowerCamelCase		:							Dict		 =						prime_factors(SCREAMING_SNAKE_CASE__						)
 if is_square_free(SCREAMING_SNAKE_CASE__						):
  return -1 if len(SCREAMING_SNAKE_CASE__						) % 2 else 1
 return 0


if __name__ == "__main__":
       import doctest

       doctest.testmod()

