from __future__ import annotations

import os
import tempfile
import unittest

from transformers import ConvBertConfig, is_tf_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
      import tensorflow as tf

      from transformers import (
          TFConvBertForMaskedLM,
          TFConvBertForMultipleChoice,
          TFConvBertForQuestionAnswering,
          TFConvBertForSequenceClassification,
          TFConvBertForTokenClassification,
          TFConvBertModel,
      )


class 	lowerCamelCase       :
  """simple docstring"""







  def __init__(				self			:							List[str]	,  __magic_name__			:							Union[str, Any]	,  __magic_name__			:							List[str]=13	,  __magic_name__			:							List[Any]=7	,  __magic_name__			:							List[Any]=True	,  __magic_name__			:							Optional[int]=True	,  __magic_name__			:							Optional[int]=True	,  __magic_name__			:							List[str]=True	,  __magic_name__			:							str=99	,  __magic_name__			:							Tuple=32	,  __magic_name__			:							Optional[Any]=2	,  __magic_name__			:							List[Any]=4	,  __magic_name__			:							Union[str, Any]=37	,  __magic_name__			:							Any="gelu"	,  __magic_name__			:							Tuple=0.1	,  __magic_name__			:							Optional[Any]=0.1	,  __magic_name__			:							int=512	,  __magic_name__			:							Tuple=16	,  __magic_name__			:							Any=2	,  __magic_name__			:							int=0.02	,  __magic_name__			:							Optional[int]=3	,  __magic_name__			:							int=4	,  __magic_name__			:							int=None	,  )	->						Optional[int]:
        SCREAMING_SNAKE_CASE_    =	parent
        SCREAMING_SNAKE_CASE_    =	13
        SCREAMING_SNAKE_CASE_    =	7
        SCREAMING_SNAKE_CASE_    =	True
        SCREAMING_SNAKE_CASE_    =	True
        SCREAMING_SNAKE_CASE_    =	True
        SCREAMING_SNAKE_CASE_    =	True
        SCREAMING_SNAKE_CASE_    =	99
        SCREAMING_SNAKE_CASE_    =	384
        SCREAMING_SNAKE_CASE_    =	2
        SCREAMING_SNAKE_CASE_    =	4
        SCREAMING_SNAKE_CASE_    =	37
        SCREAMING_SNAKE_CASE_    =	"gelu"
        SCREAMING_SNAKE_CASE_    =	0.1
        SCREAMING_SNAKE_CASE_    =	0.1
        SCREAMING_SNAKE_CASE_    =	512
        SCREAMING_SNAKE_CASE_    =	16
        SCREAMING_SNAKE_CASE_    =	2
        SCREAMING_SNAKE_CASE_    =	0.02
        SCREAMING_SNAKE_CASE_    =	3
        SCREAMING_SNAKE_CASE_    =	4
        SCREAMING_SNAKE_CASE_    =	128
        SCREAMING_SNAKE_CASE_    =	2
        SCREAMING_SNAKE_CASE_    =	9
        SCREAMING_SNAKE_CASE_    =	1
        SCREAMING_SNAKE_CASE_    =	None







  def  __A  (				self			:							List[Any] )	->						int:
        SCREAMING_SNAKE_CASE_    =	ids_tensor([self.batch_size, self.seq_length]	,  self.vocab_size )

        SCREAMING_SNAKE_CASE_    =	None
        if self.use_input_mask:
              SCREAMING_SNAKE_CASE_    =	random_attention_mask([self.batch_size, self.seq_length] )

        SCREAMING_SNAKE_CASE_    =	None
        if self.use_token_type_ids:
              SCREAMING_SNAKE_CASE_    =	ids_tensor([self.batch_size, self.seq_length]	,  self.type_vocab_size )

        SCREAMING_SNAKE_CASE_    =	None
        SCREAMING_SNAKE_CASE_    =	None
        SCREAMING_SNAKE_CASE_    =	None
        if self.use_labels:
              SCREAMING_SNAKE_CASE_    =	ids_tensor([self.batch_size]	,  self.type_sequence_label_size )
              SCREAMING_SNAKE_CASE_    =	ids_tensor([self.batch_size, self.seq_length]	,  self.num_labels )
              SCREAMING_SNAKE_CASE_    =	ids_tensor([self.batch_size]	,  self.num_choices )

        SCREAMING_SNAKE_CASE_    =	ConvBertConfig(
            vocab_size=self.vocab_size	,  hidden_size=self.hidden_size	,  num_hidden_layers=self.num_hidden_layers	,  num_attention_heads=self.num_attention_heads	,  intermediate_size=self.intermediate_size	,  hidden_act=self.hidden_act	,  hidden_dropout_prob=self.hidden_dropout_prob	,  attention_probs_dropout_prob=self.attention_probs_dropout_prob	,  max_position_embeddings=self.max_position_embeddings	,  type_vocab_size=self.type_vocab_size	,  initializer_range=self.initializer_range	,  return_dict=UpperCAmelCase__	,  )

        return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels







  def  __A  (				self			:							Any	,  __magic_name__			:							Optional[Any]	,  __magic_name__			:							Optional[Any]	,  __magic_name__			:							int	,  __magic_name__			:							Dict	,  __magic_name__			:							Dict	,  __magic_name__			:							Any	,  __magic_name__			:							Optional[Any] )	->						List[Any]:
        SCREAMING_SNAKE_CASE_    =	TFConvBertModel(config=UpperCAmelCase__ )
        SCREAMING_SNAKE_CASE_    =	{"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}

        SCREAMING_SNAKE_CASE_    =	[input_ids, input_mask]
        SCREAMING_SNAKE_CASE_    =	model(UpperCAmelCase__ )

        SCREAMING_SNAKE_CASE_    =	model(UpperCAmelCase__ )

        self.parent.assertEqual(result.last_hidden_state.shape	,  (self.batch_size, self.seq_length, self.hidden_size) )







  def  __A  (				self			:							Union[str, Any]	,  __magic_name__			:							Union[str, Any]	,  __magic_name__			:							List[str]	,  __magic_name__			:							str	,  __magic_name__			:							Union[str, Any]	,  __magic_name__			:							int	,  __magic_name__			:							int	,  __magic_name__			:							Tuple )	->						Tuple:
        SCREAMING_SNAKE_CASE_    =	TFConvBertForMaskedLM(config=UpperCAmelCase__ )
        SCREAMING_SNAKE_CASE_    =	{
            "input_ids": input_ids,
            "attention_mask": input_mask,
            "token_type_ids": token_type_ids,
        }
        SCREAMING_SNAKE_CASE_    =	model(UpperCAmelCase__ )
        self.parent.assertEqual(result.logits.shape	,  (self.batch_size, self.seq_length, self.vocab_size) )







  def  __A  (				self			:							str	,  __magic_name__			:							int	,  __magic_name__			:							List[Any]	,  __magic_name__			:							str	,  __magic_name__			:							int	,  __magic_name__			:							List[Any]	,  __magic_name__			:							int	,  __magic_name__			:							str )	->						Tuple:
        SCREAMING_SNAKE_CASE_    =	self.num_labels
        SCREAMING_SNAKE_CASE_    =	TFConvBertForSequenceClassification(config=UpperCAmelCase__ )
        SCREAMING_SNAKE_CASE_    =	{
            "input_ids": input_ids,
            "attention_mask": input_mask,
            "token_type_ids": token_type_ids,
        }

        SCREAMING_SNAKE_CASE_    =	model(UpperCAmelCase__ )
        self.parent.assertEqual(result.logits.shape	,  (self.batch_size, self.num_labels) )







  def  __A  (				self			:							Union[str, Any]	,  __magic_name__			:							Tuple	,  __magic_name__			:							Union[str, Any]	,  __magic_name__			:							int	,  __magic_name__			:							Dict	,  __magic_name__			:							Any	,  __magic_name__			:							Optional[int]	,  __magic_name__			:							Optional[Any] )	->						Union[str, Any]:
        SCREAMING_SNAKE_CASE_    =	self.num_choices
        SCREAMING_SNAKE_CASE_    =	TFConvBertForMultipleChoice(config=UpperCAmelCase__ )
        SCREAMING_SNAKE_CASE_    =	tf.tile(tf.expand_dims(UpperCAmelCase__	,  1 )	,  (1, self.num_choices, 1) )
        SCREAMING_SNAKE_CASE_    =	tf.tile(tf.expand_dims(UpperCAmelCase__	,  1 )	,  (1, self.num_choices, 1) )
        SCREAMING_SNAKE_CASE_    =	tf.tile(tf.expand_dims(UpperCAmelCase__	,  1 )	,  (1, self.num_choices, 1) )
        SCREAMING_SNAKE_CASE_    =	{
            "input_ids": multiple_choice_inputs_ids,
            "attention_mask": multiple_choice_input_mask,
            "token_type_ids": multiple_choice_token_type_ids,
        }
        SCREAMING_SNAKE_CASE_    =	model(UpperCAmelCase__ )
        self.parent.assertEqual(result.logits.shape	,  (self.batch_size, self.num_choices) )







  def  __A  (				self			:							Optional[Any]	,  __magic_name__			:							int	,  __magic_name__			:							Optional[Any]	,  __magic_name__			:							Any	,  __magic_name__			:							Optional[Any]	,  __magic_name__			:							str	,  __magic_name__			:							List[str]	,  __magic_name__			:							str )	->						Tuple:
        SCREAMING_SNAKE_CASE_    =	self.num_labels
        SCREAMING_SNAKE_CASE_    =	TFConvBertForTokenClassification(config=UpperCAmelCase__ )
        SCREAMING_SNAKE_CASE_    =	{
            "input_ids": input_ids,
            "attention_mask": input_mask,
            "token_type_ids": token_type_ids,
        }
        SCREAMING_SNAKE_CASE_    =	model(UpperCAmelCase__ )
        self.parent.assertEqual(result.logits.shape	,  (self.batch_size, self.seq_length, self.num_labels) )







  def  __A  (				self			:							Union[str, Any]	,  __magic_name__			:							List[Any]	,  __magic_name__			:							str	,  __magic_name__			:							Any	,  __magic_name__			:							Optional[Any]	,  __magic_name__			:							Union[str, Any]	,  __magic_name__			:							List[Any]	,  __magic_name__			:							List[str] )	->						Any:
        SCREAMING_SNAKE_CASE_    =	TFConvBertForQuestionAnswering(config=UpperCAmelCase__ )
        SCREAMING_SNAKE_CASE_    =	{
            "input_ids": input_ids,
            "attention_mask": input_mask,
            "token_type_ids": token_type_ids,
        }

        SCREAMING_SNAKE_CASE_    =	model(UpperCAmelCase__ )
        self.parent.assertEqual(result.start_logits.shape	,  (self.batch_size, self.seq_length) )
        self.parent.assertEqual(result.end_logits.shape	,  (self.batch_size, self.seq_length) )







  def  __A  (				self			:							Any )	->						Optional[int]:
        SCREAMING_SNAKE_CASE_    =	self.prepare_config_and_inputs()
        (
            (
            SCREAMING_SNAKE_CASE_				
        )  ,			(
            SCREAMING_SNAKE_CASE_				
        )  ,			(
            SCREAMING_SNAKE_CASE_				
        )  ,			(
            SCREAMING_SNAKE_CASE_				
        )  ,			(
            SCREAMING_SNAKE_CASE_				
        )  ,			(
            SCREAMING_SNAKE_CASE_				
        )  ,			(
            SCREAMING_SNAKE_CASE_				
        )  ,							
        )    =	config_and_inputs
        SCREAMING_SNAKE_CASE_    =	{"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": input_mask}
        return config, inputs_dict



@require_tf
class 	lowerCamelCase       (UpperCAmelCase__	,   UpperCAmelCase__	,   unittest.TestCase       ):
  """simple docstring"""







  lowerCamelCase__  =    (
      (
          TFConvBertModel,
          TFConvBertForMaskedLM,
          TFConvBertForQuestionAnswering,
          TFConvBertForSequenceClassification,
          TFConvBertForTokenClassification,
          TFConvBertForMultipleChoice,
      )
      if is_tf_available()
      else ()
  )
  lowerCamelCase__  =    (
      {
          '''feature-extraction''': TFConvBertModel,
          '''fill-mask''': TFConvBertForMaskedLM,
          '''question-answering''': TFConvBertForQuestionAnswering,
          '''text-classification''': TFConvBertForSequenceClassification,
          '''token-classification''': TFConvBertForTokenClassification,
          '''zero-shot''': TFConvBertForSequenceClassification,
      }
      if is_tf_available()
      else {}
  )
  lowerCamelCase__  =    False
  lowerCamelCase__  =    False
  lowerCamelCase__  =    False







  def  __A  (				self			:							Union[str, Any] )	->						Dict:
        SCREAMING_SNAKE_CASE_    =	TFConvBertModelTester(self )
        SCREAMING_SNAKE_CASE_    =	ConfigTester(self	,  config_class=UpperCAmelCase__	,  hidden_size=37 )







  def  __A  (				self			:							int )	->						Union[str, Any]:
        self.config_tester.run_common_tests()







  def  __A  (				self			:							Dict )	->						Tuple:
        SCREAMING_SNAKE_CASE_    =	self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_model(*UpperCAmelCase__ )







  def  __A  (				self			:							List[Any] )	->						Optional[Any]:
        SCREAMING_SNAKE_CASE_    =	self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_masked_lm(*UpperCAmelCase__ )







  def  __A  (				self			:							int )	->						int:
        SCREAMING_SNAKE_CASE_    =	self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_multiple_choice(*UpperCAmelCase__ )







  def  __A  (				self			:							Any )	->						Dict:
        SCREAMING_SNAKE_CASE_    =	self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_question_answering(*UpperCAmelCase__ )







  def  __A  (				self			:							List[str] )	->						int:
        SCREAMING_SNAKE_CASE_    =	self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_sequence_classification(*UpperCAmelCase__ )







  def  __A  (				self			:							int )	->						List[str]:
        SCREAMING_SNAKE_CASE_    =	self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_for_token_classification(*UpperCAmelCase__ )







  @slow
  def  __A  (				self			:							Dict )	->						Union[str, Any]:
        SCREAMING_SNAKE_CASE_  ,			SCREAMING_SNAKE_CASE_    =	self.model_tester.prepare_config_and_inputs_for_common()
        SCREAMING_SNAKE_CASE_    =	True
        SCREAMING_SNAKE_CASE_    =	True

        if hasattr(UpperCAmelCase__	,  "use_cache" ):
              SCREAMING_SNAKE_CASE_    =	True

        SCREAMING_SNAKE_CASE_    =	getattr(self.model_tester	,  "encoder_seq_length"	,  self.model_tester.seq_length )
        SCREAMING_SNAKE_CASE_    =	getattr(self.model_tester	,  "key_length"	,  UpperCAmelCase__ )

        for model_class in self.all_model_classes:
              SCREAMING_SNAKE_CASE_    =	self._prepare_for_class(UpperCAmelCase__	,  UpperCAmelCase__ )
              SCREAMING_SNAKE_CASE_    =	model_class(UpperCAmelCase__ )
              SCREAMING_SNAKE_CASE_    =	len(model(UpperCAmelCase__ ) )

              with tempfile.TemporaryDirectory() as tmpdirname:
                    model.save_pretrained(UpperCAmelCase__	,  saved_model=UpperCAmelCase__ )
                    SCREAMING_SNAKE_CASE_    =	os.path.join(UpperCAmelCase__	,  "saved_model"	,  "1" )
                    SCREAMING_SNAKE_CASE_    =	tf.keras.models.load_model(UpperCAmelCase__ )
                    SCREAMING_SNAKE_CASE_    =	model(UpperCAmelCase__ )

                    if self.is_encoder_decoder:
                          SCREAMING_SNAKE_CASE_    =	outputs["encoder_hidden_states"]
                          SCREAMING_SNAKE_CASE_    =	outputs["encoder_attentions"]
                    else:
                          SCREAMING_SNAKE_CASE_    =	outputs["hidden_states"]
                          SCREAMING_SNAKE_CASE_    =	outputs["attentions"]

                    self.assertEqual(len(UpperCAmelCase__ )	,  UpperCAmelCase__ )

                    SCREAMING_SNAKE_CASE_    =	getattr(
                        self.model_tester	,  "expected_num_hidden_layers"	,  self.model_tester.num_hidden_layers + 1 )

                    self.assertEqual(len(UpperCAmelCase__ )	,  UpperCAmelCase__ )
                    self.assertListEqual(
                        list(output_hidden_states[0].shape[-2:] )	,  [self.model_tester.seq_length, self.model_tester.hidden_size]	,  )

                    self.assertEqual(len(UpperCAmelCase__ )	,  self.model_tester.num_hidden_layers )
                    self.assertListEqual(
                        list(output_attentions[0].shape[-3:] )	,  [self.model_tester.num_attention_heads / 2, encoder_seq_length, encoder_key_length]	,  )







  @slow
  def  __A  (				self			:							Dict )	->						Tuple:
        SCREAMING_SNAKE_CASE_    =	TFConvBertModel.from_pretrained("YituTech/conv-bert-base" )
        self.assertIsNotNone(UpperCAmelCase__ )







  def  __A  (				self			:							Optional[int] )	->						Optional[Any]:
        SCREAMING_SNAKE_CASE_  ,			SCREAMING_SNAKE_CASE_    =	self.model_tester.prepare_config_and_inputs_for_common()
        SCREAMING_SNAKE_CASE_    =	True
        SCREAMING_SNAKE_CASE_    =	getattr(self.model_tester	,  "decoder_seq_length"	,  self.model_tester.seq_length )
        SCREAMING_SNAKE_CASE_    =	getattr(self.model_tester	,  "encoder_seq_length"	,  self.model_tester.seq_length )
        SCREAMING_SNAKE_CASE_    =	getattr(self.model_tester	,  "key_length"	,  UpperCAmelCase__ )
        SCREAMING_SNAKE_CASE_    =	getattr(self.model_tester	,  "key_length"	,  UpperCAmelCase__ )

        def check_decoder_attentions_output(__magic_name__			:							List[Any] ):
              SCREAMING_SNAKE_CASE_    =	len(UpperCAmelCase__ )
              self.assertEqual(out_len % 2	,  0 )
              SCREAMING_SNAKE_CASE_    =	outputs.decoder_attentions
              self.assertEqual(len(UpperCAmelCase__ )	,  self.model_tester.num_hidden_layers )
              self.assertListEqual(
                  list(decoder_attentions[0].shape[-3:] )	,  [self.model_tester.num_attention_heads / 2, decoder_seq_length, decoder_key_length]	,  )

        def check_encoder_attentions_output(__magic_name__			:							str ):
              SCREAMING_SNAKE_CASE_    =	[
                  t.numpy() for t in (outputs.encoder_attentions if config.is_encoder_decoder else outputs.attentions)
              ]
              self.assertEqual(len(UpperCAmelCase__ )	,  self.model_tester.num_hidden_layers )
              self.assertListEqual(
                  list(attentions[0].shape[-3:] )	,  [self.model_tester.num_attention_heads / 2, encoder_seq_length, encoder_key_length]	,  )

        for model_class in self.all_model_classes:
              SCREAMING_SNAKE_CASE_    =	True
              SCREAMING_SNAKE_CASE_    =	False
              SCREAMING_SNAKE_CASE_    =	model_class(UpperCAmelCase__ )
              SCREAMING_SNAKE_CASE_    =	model(self._prepare_for_class(UpperCAmelCase__	,  UpperCAmelCase__ ) )
              SCREAMING_SNAKE_CASE_    =	len(UpperCAmelCase__ )
              self.assertEqual(config.output_hidden_states	,  UpperCAmelCase__ )
              check_encoder_attentions_output(UpperCAmelCase__ )

              if self.is_encoder_decoder:
                    SCREAMING_SNAKE_CASE_    =	model_class(UpperCAmelCase__ )
                    SCREAMING_SNAKE_CASE_    =	model(self._prepare_for_class(UpperCAmelCase__	,  UpperCAmelCase__ ) )
                    self.assertEqual(config.output_hidden_states	,  UpperCAmelCase__ )
                    check_decoder_attentions_output(UpperCAmelCase__ )

              # Check that output attentions can also be changed via the config
              del inputs_dict["output_attentions"]
              SCREAMING_SNAKE_CASE_    =	True
              SCREAMING_SNAKE_CASE_    =	model_class(UpperCAmelCase__ )
              SCREAMING_SNAKE_CASE_    =	model(self._prepare_for_class(UpperCAmelCase__	,  UpperCAmelCase__ ) )
              self.assertEqual(config.output_hidden_states	,  UpperCAmelCase__ )
              check_encoder_attentions_output(UpperCAmelCase__ )

              # Check attention is always last and order is fine
              SCREAMING_SNAKE_CASE_    =	True
              SCREAMING_SNAKE_CASE_    =	True
              SCREAMING_SNAKE_CASE_    =	model_class(UpperCAmelCase__ )
              SCREAMING_SNAKE_CASE_    =	model(self._prepare_for_class(UpperCAmelCase__	,  UpperCAmelCase__ ) )

              self.assertEqual(out_len + (2 if self.is_encoder_decoder else 1)	,  len(UpperCAmelCase__ ) )
              self.assertEqual(model.config.output_hidden_states	,  UpperCAmelCase__ )
              check_encoder_attentions_output(UpperCAmelCase__ )



@require_tf
class 	lowerCamelCase       (unittest.TestCase       ):
  """simple docstring"""







  @slow
  def  __A  (				self			:							List[Any] )	->						Any:
        SCREAMING_SNAKE_CASE_    =	TFConvBertModel.from_pretrained("YituTech/conv-bert-base" )
        SCREAMING_SNAKE_CASE_    =	tf.constant([[0, 1, 2, 3, 4, 5]] )
        SCREAMING_SNAKE_CASE_    =	model(UpperCAmelCase__ )[0]

        SCREAMING_SNAKE_CASE_    =	[1, 6, 768]
        self.assertEqual(output.shape	,  UpperCAmelCase__ )

        SCREAMING_SNAKE_CASE_    =	tf.constant(
            [
                [
                    [-0.0347_5493, -0.468_6034, -0.3063_8832],
                    [0.2263_7248, -0.2698_8646, -0.742_3424],
                    [0.1032_4868, -0.4501_3508, -0.5828_0784],
                ]
            ] )
        tf.debugging.assert_near(output[:, :3, :3]	,  UpperCAmelCase__	,  atol=1e-4 )








from math import sqrt

import numpy as np
from sympy import symbols

# Coefficient
# Speed of light (m/s)
_lowerCamelCase      :						str							=  299792458

# Symbols
_lowerCamelCase			,     _lowerCamelCase			,     _lowerCamelCase			,     _lowerCamelCase      :						int							=  symbols("""ct x y z""")







def SCREAMING_SNAKE_CASE							(			lowercase_		)  ->			float:



       """simple docstring"""

       if velocity > c:
              raise ValueError('''Speed must not exceed light speed 299,792,458 [m/s]!'''		)
       elif velocity < 1:
              # Usually the speed should be much higher than 1 (c order of magnitude)
              raise ValueError('''Speed must be greater than or equal to 1!'''		)

       return velocity / c







def SCREAMING_SNAKE_CASE							(			lowercase_		)  ->			float:



       """simple docstring"""

       return 1 / sqrt(1 - beta(lowercase_		) ** 2		)







def SCREAMING_SNAKE_CASE							(			lowercase_		)  ->			np.ndarray:



       """simple docstring"""

       return np.array(
           [
               [gamma(lowercase_		), -gamma(lowercase_		) * beta(lowercase_		), 0, 0],
               [-gamma(lowercase_		) * beta(lowercase_		), gamma(lowercase_		), 0, 0],
               [0, 0, 1, 0],
               [0, 0, 0, 1],
           ]		)







def SCREAMING_SNAKE_CASE							(			lowercase_					,							lowercase_ = None		)  ->			np.ndarray:



       """simple docstring"""

       if event is None:
              A__ 					=       np.array([ct, x, y, z]		)  # Symbolic four vector
       else:
              event[0] *= c  # x0 is ct (speed of light * time)

       return transformation_matrix(lowercase_		) @ event


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  # Example of symbolic vector:
  _lowerCamelCase      :						Tuple							=  transform(29979245)
  print("""Example of four vector: """)
  print(F'''ct\' = {four_vector[0]}''')
  print(F'''x\' = {four_vector[1]}''')
  print(F'''y\' = {four_vector[2]}''')
  print(F'''z\' = {four_vector[3]}''')

  # Substitute symbols with numerical values
  _lowerCamelCase      :						int							=  {ct: c, x: 1, y: 1, z: 1}
  _lowerCamelCase      :						Any							=  [four_vector[i].subs(sub_dict) for i in range(4)]

  print(F'''\n{numerical_vector}''')


