






import unittest

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

class 		_snake_case	(	unittest.TestCase       ):






			def  SCREAMING_SNAKE_CASE__     (							self)   ->							Optional[Any]:
						SCREAMING_SNAKE_CASE							=			['a', 'b', 'c']

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

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

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

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






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

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

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

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

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

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

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

						# Out features and out indices should be in order
						with self.assertRaises(a):
									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  SCREAMING_SNAKE_CASE__     (							self)   ->							List[str]:
						SCREAMING_SNAKE_CASE							=			BackboneMixin()

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

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











import operator as op


def 							__snake_case							(    lowerCAmelCase_	)				->						str:
    SCREAMING_SNAKE_CASE__											=			[]
    SCREAMING_SNAKE_CASE__											=			lambda lowerCAmelCase_ ,							lowerCAmelCase_	: int(x / y	)  # noqa: E731 integer division operation
    SCREAMING_SNAKE_CASE__											=			{
        '''^''': op.pow,
        '''*''': op.mul,
        '''/''': div,
        '''+''': op.add,
        '''-''': op.sub,
    }  # operators & their respective operation

    # print table header
    print('''Symbol'''.center(8	) ,							'''Action'''.center(1_2	) ,							'''Stack''' ,							sep=''' | '''	)
    print('''-''' * (3_0 + len(lowerCAmelCase_	))	)

    for x in post_fix:
        if x.isdigit():  # if x in digit
            stack.append(lowerCAmelCase_	)  # append x to stack
            # output in tabular format
            print(x.rjust(8	) ,							('''push(''' + x + ''')''').ljust(1_2	) ,							''','''.join(lowerCAmelCase_	) ,							sep=''' | '''	)
        else:
            SCREAMING_SNAKE_CASE__											=			stack.pop()  # pop stack
            # output in tabular format
            print(''''''.rjust(8	) ,							('''pop(''' + b + ''')''').ljust(1_2	) ,							''','''.join(lowerCAmelCase_	) ,							sep=''' | '''	)

            SCREAMING_SNAKE_CASE__											=			stack.pop()  # pop stack
            # output in tabular format
            print(''''''.rjust(8	) ,							('''pop(''' + a + ''')''').ljust(1_2	) ,							''','''.join(lowerCAmelCase_	) ,							sep=''' | '''	)

            stack.append(
                str(opr[x](int(lowerCAmelCase_	) ,							int(lowerCAmelCase_	)	)	)	)  # evaluate the 2 values popped from stack & push result to stack
            # output in tabular format
            print(
                x.rjust(8	) ,							('''push(''' + a + x + b + ''')''').ljust(1_2	) ,							''','''.join(lowerCAmelCase_	) ,							sep=''' | ''' ,							)

    return int(stack[0]	)


if __name__ == "__main__":
  _A					:				Dict				=			input("""\n\nEnter a Postfix Equation (space separated) = """).split(""" """)
  print("""\n\tResult = """, solve(Postfix))
