





'''simple docstring'''






from .stack import Stack
def      UpperCamelCase__   (	lowerCAmelCase						):





      """simple docstring"""


      _lowerCAmelCase							  =							Stack()
      _lowerCAmelCase							  =							{"""(""": """)""", """[""": """]""", """{""": """}"""}
      for bracket in parentheses:
            if bracket in bracket_pairs:
                  stack.push(lowerCAmelCase						)
            elif bracket in (")", "]", "}"):
                  if stack.is_empty() or bracket_pairs[stack.pop()] != bracket:
                        return False
      return stack.is_empty()


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

      testmod()

      A__       :     Optional[Any]          =['''((()))''', '''((())''', '''(()))''']
      print('''Balanced parentheses demonstration:\n''')
      for example in examples:
            A__       :     Optional[int]          ='''''' if balanced_parentheses(example) else '''not '''
            print(F"""{example} is {not_str}balanced""")













'''simple docstring'''






import torch

from transformers import PreTrainedModel

from .custom_configuration import CustomConfig, NoSuperInitConfig




class 				UpperCAmelCase  (    snake_case_     ):
      _lowercase:    str		  =     CustomConfig




      def __init__(    self    :				Optional[int]    ,    __snake_case    :				Tuple						)       ->   Optional[Any]:
            super().__init__(__snake_case						)
            _lowerCAmelCase							  =							torch.nn.Linear(config.hidden_size    ,    config.hidden_size						)




      def        lowercase__					(    self    :				Dict    ,    __snake_case    :				List[Any]						)       ->   Dict:
            return self.linear(__snake_case						)




      def        lowercase__					(    self    :				List[Any]    ,    __snake_case    :				int						)       ->   Any:
            pass




class 				UpperCAmelCase  (    snake_case_     ):
      _lowercase:    List[str]		  =     NoSuperInitConfig




      def __init__(    self    :				List[str]    ,    __snake_case    :				List[str]						)       ->   int:
            super().__init__(__snake_case						)
            _lowerCAmelCase							  =							torch.nn.Linear(config.attribute    ,    config.attribute						)




      def        lowercase__					(    self    :				List[str]    ,    __snake_case    :				Dict						)       ->   Any:
            return self.linear(__snake_case						)




      def        lowercase__					(    self    :				Optional[int]    ,    __snake_case    :				List[Any]						)       ->   Dict:
            pass






