





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      _lowercase				(    self		):






				'''simple docstring'''







				UpperCAmelCase   		=				['''a''', '''b''', '''c''']

				# Defaults to last layer if both are None
				UpperCAmelCase		,			UpperCAmelCase   		=				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
				UpperCAmelCase		,			UpperCAmelCase   		=				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
				UpperCAmelCase		,			UpperCAmelCase   		=				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
				UpperCAmelCase		,			UpperCAmelCase   		=				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      _lowercase				(    self		):






				'''simple docstring'''







				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      _lowercase				(    self		):






				'''simple docstring'''







				UpperCAmelCase   		=				BackboneMixin()

				UpperCAmelCase   		=				['''a''', '''b''', '''c''']
				UpperCAmelCase   		=				['''a''', '''c''']
				UpperCAmelCase   		=				[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
				UpperCAmelCase   		=				['''a''', '''b''']
				self.assertEqual(backbone.out_features							,					['''a''', '''b''']		)
				self.assertEqual(backbone.out_indices							,					[0, 1]		)

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






'''simple docstring'''



from itertools import count







def    a__       (  a__ = 50						):




     """simple docstring"""


     __SCREAMING_SNAKE_CASE     =      [1] * min_block_length

     for n in count(a__						):
          fill_count_functions.append(1						)

          for block_length in range(a__      ,    n + 1						):
               for block_start in range(n - block_length						):
                    fill_count_functions[n] += fill_count_functions[
                        n - block_start - block_length - 1
                    ]

               fill_count_functions[n] += 1

          if fill_count_functions[n] > 1_00_00_00:
               break

     return n


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






