





def     a_       (					lowerCAmelCase_ :     list[list]      ):
   __lowerCAmelCase				      =      current_set.copy()
   for row_index, row in enumerate(lowerCAmelCase_      ):
      __lowerCAmelCase				      =      row[0]
      for column_index, column in enumerate(lowerCAmelCase_      ):
         if magnitude == 0:
            __lowerCAmelCase				      =      column
            continue
         __lowerCAmelCase				      =      column / magnitude
    # Subtract to cancel term
   __lowerCAmelCase				      =      current_set[0]
   __lowerCAmelCase				      =      [first_row]
   __lowerCAmelCase				      =      current_set[1::]
   for row in current_set:
      __lowerCAmelCase				      =      []
      # If first term is 0, it is already in form we want, so we preserve it
      if row[0] == 0:
         final_set.append(lowerCAmelCase_      )
         continue
      for column_index in range(len(lowerCAmelCase_      )      ):
         temp_row.append(first_row[column_index] - row[column_index]      )
      final_set.append(lowerCAmelCase_      )
   # Create next recursion iteration set
   if len(final_set[0]      ) != 3:
      __lowerCAmelCase				      =      final_set[0]
      __lowerCAmelCase				      =      []
      __lowerCAmelCase				      =      []
      for row in final_set[1::]:
         current_first_column.append(row[0]      )
         next_iteration.append(row[1::]      )
      __lowerCAmelCase				      =      simplify(lowerCAmelCase_      )
      for i in range(len(lowerCAmelCase_      )      ):
         resultant[i].insert(0,      current_first_column[i]      )
      resultant.insert(0,      lowerCAmelCase_      )
      __lowerCAmelCase				      =      resultant
   return final_set

def     a_       (					lowerCAmelCase_ :     list[list]      ):
   if len(lowerCAmelCase_      ) == 0:
      raise IndexError('solve_simultaneous() requires n lists of length n+1'      )
   __lowerCAmelCase				      =      len(lowerCAmelCase_      ) + 1
   if any(len(lowerCAmelCase_      ) != _length for item in equations      ):
      raise IndexError('solve_simultaneous() requires n lists of length n+1'      )
   for row in equations:
      if any(not isinstance(lowerCAmelCase_,      (int, float)      ) for column in row      ):
         raise ValueError('solve_simultaneous() requires lists of integers'      )
   if len(lowerCAmelCase_      ) == 1:
      return [equations[0][-1] / equations[0][0]]
   __lowerCAmelCase				      =      equations.copy()
   if any(0 in row for row in data_set      ):
      __lowerCAmelCase				      =      data_set.copy()
      __lowerCAmelCase				      =      []
      for row_index, row in enumerate(lowerCAmelCase_      ):
         if 0 not in row:
            __lowerCAmelCase				      =      data_set.pop(lowerCAmelCase_      )
            break
      if not full_row:
         raise ValueError('solve_simultaneous() requires at least 1 full equation'      )
      data_set.insert(0,      lowerCAmelCase_      )
   __lowerCAmelCase				      =      data_set.copy()
   __lowerCAmelCase				      =      simplify(lowerCAmelCase_      )
   __lowerCAmelCase				      =      simplified[::-1]
   __lowerCAmelCase				      =      []
   for row in simplified:
      __lowerCAmelCase				      =      row[-1]
      if not solutions:
         if row[-2] == 0:
            solutions.append(0      )
            continue
         solutions.append(current_solution / row[-2]      )
         continue
      __lowerCAmelCase				      =      row.copy()[: len(lowerCAmelCase_      ) - 1 :]
      while temp_row[0] == 0:
         temp_row.pop(0      )
      if len(lowerCAmelCase_      ) == 0:
         solutions.append(0      )
         continue
      __lowerCAmelCase				      =      temp_row[1::]
      __lowerCAmelCase				      =      temp_row[::-1]
      for column_index, column in enumerate(lowerCAmelCase_      ):
         current_solution -= column * solutions[column_index]
      solutions.append(lowerCAmelCase_      )
   __lowerCAmelCase				      =      []
   for item in solutions:
      final.append(float(round(lowerCAmelCase_,      5      )      )      )
   return final[::-1]


if __name__ == "__main__":
     import doctest

     doctest.testmod()
     _snake_case    :       List[Any]		       =    [
         [2, 1, 1, 1, 1, 4],
         [1, 2, 1, 1, 1, 5],
         [1, 1, 2, 1, 1, 6],
         [1, 1, 1, 2, 1, 7],
         [1, 1, 1, 1, 2, 8],
     ]
     print(solve_simultaneous(eq))
     print(solve_simultaneous([[4, 2]]))


from ...configuration_utils import PretrainedConfig
from ...utils import logging


SCREAMING_SNAKE_CASE		:     int         =	logging.get_logger(__name__)

SCREAMING_SNAKE_CASE		:     Union[str, Any]         =	{
    # See all MEGATRON_BERT models at https://huggingface.co/models?filter=bert
}

class        UpperCamelCase						(				__a				):
						a__		:List[str]      =			'''megatron-bert'''





						def __init__(self			,     __UpperCamelCase=29_056			,     __UpperCamelCase=1_024			,     __UpperCamelCase=24			,     __UpperCamelCase=16			,     __UpperCamelCase=4_096			,     __UpperCamelCase="gelu"			,     __UpperCamelCase=0.1			,     __UpperCamelCase=0.1			,     __UpperCamelCase=512			,     __UpperCamelCase=2			,     __UpperCamelCase=0.02			,     __UpperCamelCase=1E-1_2			,     __UpperCamelCase=0			,     __UpperCamelCase="absolute"			,     __UpperCamelCase=True			,     **__UpperCamelCase			,     )				->				List[Any]:
												super().__init__(pad_token_id=__UpperCamelCase			,     **__UpperCamelCase						)

												UpperCamelCase_		:							Union[str, Any]  =		vocab_size
												UpperCamelCase_		:							Union[str, Any]  =		hidden_size
												UpperCamelCase_		:							Any  =		num_hidden_layers
												UpperCamelCase_		:							str  =		num_attention_heads
												UpperCamelCase_		:							List[Any]  =		hidden_act
												UpperCamelCase_		:							Dict  =		intermediate_size
												UpperCamelCase_		:							Optional[int]  =		hidden_dropout_prob
												UpperCamelCase_		:							Dict  =		attention_probs_dropout_prob
												UpperCamelCase_		:							Any  =		max_position_embeddings
												UpperCamelCase_		:							str  =		type_vocab_size
												UpperCamelCase_		:							Tuple  =		initializer_range
												UpperCamelCase_		:							List[str]  =		layer_norm_eps
												UpperCamelCase_		:							Tuple  =		position_embedding_type
												UpperCamelCase_		:							Tuple  =		use_cache






