


'''simple docstring'''







import unittest

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







class A__       (						unittest.TestCase      ):






      def __UpperCAmelCase       ( self			:List[str]	)       ->					Dict:




             '''simple docstring'''
             _a    : Optional[int]     					=["""a""", """b""", """c"""]

             # Defaults to last layer if both are None
             _a					,    _a    : str     					=get_aligned_output_features_output_indices(SCREAMING_SNAKE_CASE     ,						SCREAMING_SNAKE_CASE     ,						SCREAMING_SNAKE_CASE	)
             self.assertEqual(SCREAMING_SNAKE_CASE     ,						["""c"""]	)
             self.assertEqual(SCREAMING_SNAKE_CASE     ,						[2]	)

             # Out indices set to match out features
             _a					,    _a    : List[Any]     					=get_aligned_output_features_output_indices(["""a""", """c"""]     ,						SCREAMING_SNAKE_CASE     ,						SCREAMING_SNAKE_CASE	)
             self.assertEqual(SCREAMING_SNAKE_CASE     ,						["""a""", """c"""]	)
             self.assertEqual(SCREAMING_SNAKE_CASE     ,						[0, 2]	)

             # Out features set to match out indices
             _a					,    _a    : Dict     					=get_aligned_output_features_output_indices(SCREAMING_SNAKE_CASE     ,						[0, 2]     ,						SCREAMING_SNAKE_CASE	)
             self.assertEqual(SCREAMING_SNAKE_CASE     ,						["""a""", """c"""]	)
             self.assertEqual(SCREAMING_SNAKE_CASE     ,						[0, 2]	)

             # Out features selected from negative indices
             _a					,    _a    : Any     					=get_aligned_output_features_output_indices(SCREAMING_SNAKE_CASE     ,						[-3, -1]     ,						SCREAMING_SNAKE_CASE	)
             self.assertEqual(SCREAMING_SNAKE_CASE     ,						["""a""", """c"""]	)
             self.assertEqual(SCREAMING_SNAKE_CASE     ,						[-3, -1]	)






      def __UpperCAmelCase       ( self			:Any	)       ->					Optional[int]:




             '''simple docstring'''
             # Stage names must be set
             with self.assertRaises(SCREAMING_SNAKE_CASE	):
                    verify_out_features_out_indices(["""a""", """b"""]     ,						(0, 1)     ,						SCREAMING_SNAKE_CASE	)

             # Out features must be a list
             with self.assertRaises(SCREAMING_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(SCREAMING_SNAKE_CASE	):
                    verify_out_features_out_indices(["""a""", """b"""]     ,						(0, 1)     ,						["""a"""]	)

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

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

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

             # Out features should match out indices
             with self.assertRaises(SCREAMING_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(SCREAMING_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 __UpperCAmelCase       ( self			:Any	)       ->					Dict:




             '''simple docstring'''
             _a    : str     					=BackboneMixin()

             _a    : Dict     					=["""a""", """b""", """c"""]
             _a    : List[Any]     					=["""a""", """c"""]
             _a    : Tuple     					=[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
             _a    : Optional[int]     					=["""a""", """b"""]
             self.assertEqual(backbone.out_features     ,						["""a""", """b"""]	)
             self.assertEqual(backbone.out_indices     ,						[0, 1]	)

             _a    : Optional[int]     					=[-3, -1]
             self.assertEqual(backbone.out_features     ,						["""a""", """c"""]	)
             self.assertEqual(backbone.out_indices     ,						[-3, -1]	)






'''simple docstring'''







from math import isqrt


def 	SCREAMING_SNAKE_CASE_					(  _UpperCAmelCase	:	int  )  ->			bool:
       return all(number % divisor != 0 for divisor in range(2    ,isqrt(_UpperCAmelCase  ) + 1  )  )


def 	SCREAMING_SNAKE_CASE_					(  _UpperCAmelCase	:	int = 10**6  )  ->			int:
       _a    : List[Any]     					=0
       _a    : str     					=1
       _a    : Optional[Any]     					=7
       while prime_candidate < max_prime:
              primes_count += is_prime(_UpperCAmelCase  )

              cube_index += 1
              prime_candidate += 6 * cube_index

       return primes_count


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


