

import unittest

from transformers.utils.backbone_utils import (
    BackboneMixin,
    get_aligned_output_features_output_indices,
    verify_out_features_out_indices,
)







class 					lowercase							(			unittest.TestCase     ):




				def        a				(   self			):
											snake_case_     							=       ['a', 'b', 'c']

											# Defaults to last layer if both are None
											snake_case_							,       snake_case_     							=       get_aligned_output_features_output_indices(snake_case ,  snake_case ,  snake_case			)
											self.assertEqual(snake_case ,  ['c']			)
											self.assertEqual(snake_case ,  [2]			)

											# Out indices set to match out features
											snake_case_							,       snake_case_     							=       get_aligned_output_features_output_indices(['a', 'c'] ,  snake_case ,  snake_case			)
											self.assertEqual(snake_case ,  ['a', 'c']			)
											self.assertEqual(snake_case ,  [0, 2]			)

											# Out features set to match out indices
											snake_case_							,       snake_case_     							=       get_aligned_output_features_output_indices(snake_case ,  [0, 2] ,  snake_case			)
											self.assertEqual(snake_case ,  ['a', 'c']			)
											self.assertEqual(snake_case ,  [0, 2]			)

											# Out features selected from negative indices
											snake_case_							,       snake_case_     							=       get_aligned_output_features_output_indices(snake_case ,  [-3, -1] ,  snake_case			)
											self.assertEqual(snake_case ,  ['a', 'c']			)
											self.assertEqual(snake_case ,  [-3, -1]			)




				def        a				(   self			):
											# Stage names must be set
											with self.assertRaises(snake_case			):
																		verify_out_features_out_indices(['a', 'b'] ,  (0, 1) ,  snake_case			)

											# Out features must be a list
											with self.assertRaises(snake_case			):
																		verify_out_features_out_indices(('a', 'b') ,  (0, 1) ,  ['a', 'b']			)

											# Out features must be a subset of stage names
											with self.assertRaises(snake_case			):
																		verify_out_features_out_indices(['a', 'b'] ,  (0, 1) ,  ['a']			)

											# Out indices must be a list or tuple
											with self.assertRaises(snake_case			):
																		verify_out_features_out_indices(snake_case ,  0 ,  ['a', 'b']			)

											# Out indices must be a subset of stage names
											with self.assertRaises(snake_case			):
																		verify_out_features_out_indices(snake_case ,  (0, 1) ,  ['a']			)

											# Out features and out indices must be the same length
											with self.assertRaises(snake_case			):
																		verify_out_features_out_indices(['a', 'b'] ,  (0,) ,  ['a', 'b', 'c']			)

											# Out features should match out indices
											with self.assertRaises(snake_case			):
																		verify_out_features_out_indices(['a', 'b'] ,  (0, 2) ,  ['a', 'b', 'c']			)

											# Out features and out indices should be in order
											with self.assertRaises(snake_case			):
																		verify_out_features_out_indices(['b', 'a'] ,  (0, 1) ,  ['a', 'b']			)

											# Check passes with valid inputs
											verify_out_features_out_indices(['a', 'b', 'd'] ,  (0, 1, -1) ,  ['a', 'b', 'c', 'd']			)




				def        a				(   self			):
											snake_case_     							=       BackboneMixin()

											snake_case_     							=       ['a', 'b', 'c']
											snake_case_     							=       ['a', 'c']
											snake_case_     							=       [0, 2]

											# Check that the output features and indices are set correctly
											self.assertEqual(backbone.out_features ,  ['a', 'c']			)
											self.assertEqual(backbone.out_indices ,  [0, 2]			)

											# Check out features and indices are updated correctly
											snake_case_     							=       ['a', 'b']
											self.assertEqual(backbone.out_features ,  ['a', 'b']			)
											self.assertEqual(backbone.out_indices ,  [0, 1]			)

											snake_case_     							=       [-3, -1]
											self.assertEqual(backbone.out_features ,  ['a', 'c']			)
											self.assertEqual(backbone.out_indices ,  [-3, -1]			)







from math import sqrt





def    __lowerCamelCase      (					UpperCamelCase__ ):







							'''simple docstring'''






							if 1 < number < 4:
														# 2 and 3 are primes
														return True
							elif number < 2 or number % 2 == 0 or number % 3 == 0:
														# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
														return False

							# All primes number are in format of 6k +/- 1
							for i in range(5  ,				int(sqrt(UpperCamelCase__ ) + 1 )  ,				6 ):
														if number % i == 0 or number % (i + 2) == 0:
																					return False
							return True





def    __lowerCamelCase      (					UpperCamelCase__ = 10001 ):







							'''simple docstring'''






							snake_case_     							=       0
							snake_case_     							=       1
							while count != nth and number < 3:
														number += 1
														if is_prime(UpperCamelCase__ ):
																					count += 1
							while count != nth:
														number += 2
														if is_prime(UpperCamelCase__ ):
																					count += 1
							return number


if __name__ == "__main__":
					print(F'''{solution() = }''')




