





'''simple docstring'''


import unittest

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

class    lowerCAmelCase_		(		unittest.TestCase		):




 def 							_snake_case   (	self		)    ->							str:
     _lowerCAmelCase				=      ["a", "b", "c"]

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

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

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

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




 def 							_snake_case   (	self		)    ->							List[Any]:
     # Stage names must be set
     with self.assertRaises(_lowerCAmelCase		):
         verify_out_features_out_indices(["a", "b"]			,     (0, 1)			,     _lowerCAmelCase		)

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

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

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

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

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

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

     # Out features and out indices should be in order
     with self.assertRaises(_lowerCAmelCase		):
         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 							_snake_case   (	self		)    ->							Optional[Any]:
     _lowerCAmelCase				=      BackboneMixin()

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

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









'''simple docstring'''


def 	__a(SCREAMING_SNAKE_CASE_  :					int    ):



    '''simple docstring'''





    if not isinstance(SCREAMING_SNAKE_CASE_		,       SCREAMING_SNAKE_CASE_    ):
        raise ValueError("check_bouncy() accepts only integer arguments"    )
    _lowerCAmelCase				=      str(SCREAMING_SNAKE_CASE_    )
    _lowerCAmelCase				=      "".join(sorted(SCREAMING_SNAKE_CASE_    )    )
    return sorted_str_n != str_n and sorted_str_n[::-1] != str_n


def 	__a(SCREAMING_SNAKE_CASE_  :					float = 99    ):



    '''simple docstring'''





    if not 0 < percent < 100:
        raise ValueError("solution() only accepts values from 0 to 100"    )
    _lowerCAmelCase				=      0
    _lowerCAmelCase				=      1

    while True:
        if check_bouncy(SCREAMING_SNAKE_CASE_    ):
            bouncy_num += 1
        if (bouncy_num / num) * 100 >= percent:
            return num
        num += 1


if __name__ == "__main__":
       from doctest import testmod

       testmod()
       print(f'''{solution(99)}''')


