

"""simple docstring"""


import os
import tempfile
import unittest

from transformers import NezhaConfig, is_torch_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
  import torch

  from transformers import (
      MODEL_FOR_PRETRAINING_MAPPING,
      NezhaForMaskedLM,
      NezhaForMultipleChoice,
      NezhaForNextSentencePrediction,
      NezhaForPreTraining,
      NezhaForQuestionAnswering,
      NezhaForSequenceClassification,
      NezhaForTokenClassification,
      NezhaModel,
  )
  from transformers.models.nezha.modeling_nezha import NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST





class lowerCamelCase__   :



    '''simple docstring'''




    def __init__( self ,lowerCamelCase_ ,lowerCamelCase_=1_3 ,lowerCamelCase_=7 ,lowerCamelCase_=True ,lowerCamelCase_=True ,lowerCamelCase_=True ,lowerCamelCase_=True ,lowerCamelCase_=9_9 ,lowerCamelCase_=3_2 ,lowerCamelCase_=5 ,lowerCamelCase_=4 ,lowerCamelCase_=3_7 ,lowerCamelCase_="gelu" ,lowerCamelCase_=0.1 ,lowerCamelCase_=0.1 ,lowerCamelCase_=1_2_8 ,lowerCamelCase_=3_2 ,lowerCamelCase_=1_6 ,lowerCamelCase_=2 ,lowerCamelCase_=0.02 ,lowerCamelCase_=3 ,lowerCamelCase_=4 ,lowerCamelCase_=None ,)    ->      int:
          A				  =		parent
          A				  =		batch_size
          A				  =		seq_length
          A				  =		is_training
          A				  =		use_input_mask
          A				  =		use_token_type_ids
          A				  =		use_labels
          A				  =		vocab_size
          A				  =		hidden_size
          A				  =		num_hidden_layers
          A				  =		num_attention_heads
          A				  =		intermediate_size
          A				  =		hidden_act
          A				  =		hidden_dropout_prob
          A				  =		attention_probs_dropout_prob
          A				  =		max_position_embeddings
          A				  =		type_vocab_size
          A				  =		type_sequence_label_size
          A				  =		initializer_range
          A				  =		num_labels
          A				  =		num_choices
          A				  =		scope




    def UpperCamelCase__		( self    )    ->      Any:
          A				  =		ids_tensor([self.batch_size, self.seq_length] ,self.vocab_size    )

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

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

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

          A				  =		self.get_config()

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




    def UpperCamelCase__		( self    )    ->      str:
          return NezhaConfig(
              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 ,is_decoder=lowerCamelCase_ ,initializer_range=self.initializer_range ,)




    def UpperCamelCase__		( self    )    ->      Tuple:
          (
              (
              A
          )  ,			(
              A
          )  ,			(
              A
          )  ,			(
              A
          )  ,			(
              A
          )  ,			(
              A
          )  ,			(
              A
          )  ,			
          )				  =		self.prepare_config_and_inputs()

          A				  =		True
          A				  =		floats_tensor([self.batch_size, self.seq_length, self.hidden_size]    )
          A				  =		ids_tensor([self.batch_size, self.seq_length] ,vocab_size=2    )

          return (
              config,
              input_ids,
              token_type_ids,
              input_mask,
              sequence_labels,
              token_labels,
              choice_labels,
              encoder_hidden_states,
              encoder_attention_mask,
          )




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_    )    ->      int:
          A				  =		NezhaModel(config=lowerCamelCase_    )
          model.to(lowerCamelCase_    )
          model.eval()
          A				  =		model(lowerCamelCase_ ,attention_mask=lowerCamelCase_ ,token_type_ids=lowerCamelCase_    )
          A				  =		model(lowerCamelCase_ ,token_type_ids=lowerCamelCase_    )
          A				  =		model(lowerCamelCase_    )
          self.parent.assertEqual(result.last_hidden_state.shape ,(self.batch_size, self.seq_length, self.hidden_size)    )
          self.parent.assertEqual(result.pooler_output.shape ,(self.batch_size, self.hidden_size)    )




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,)    ->      Any:
          A				  =		True
          A				  =		NezhaModel(lowerCamelCase_    )
          model.to(lowerCamelCase_    )
          model.eval()
          A				  =		model(
              lowerCamelCase_ ,attention_mask=lowerCamelCase_ ,token_type_ids=lowerCamelCase_ ,encoder_hidden_states=lowerCamelCase_ ,encoder_attention_mask=lowerCamelCase_ ,)
          A				  =		model(
              lowerCamelCase_ ,attention_mask=lowerCamelCase_ ,token_type_ids=lowerCamelCase_ ,encoder_hidden_states=lowerCamelCase_ ,)
          A				  =		model(lowerCamelCase_ ,attention_mask=lowerCamelCase_ ,token_type_ids=lowerCamelCase_    )
          self.parent.assertEqual(result.last_hidden_state.shape ,(self.batch_size, self.seq_length, self.hidden_size)    )
          self.parent.assertEqual(result.pooler_output.shape ,(self.batch_size, self.hidden_size)    )




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_    )    ->      Tuple:
          A				  =		NezhaForMaskedLM(config=lowerCamelCase_    )
          model.to(lowerCamelCase_    )
          model.eval()
          A				  =		model(lowerCamelCase_ ,attention_mask=lowerCamelCase_ ,token_type_ids=lowerCamelCase_ ,labels=lowerCamelCase_    )
          self.parent.assertEqual(result.logits.shape ,(self.batch_size, self.seq_length, self.vocab_size)    )




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_    )    ->      List[Any]:
          A				  =		NezhaForNextSentencePrediction(config=lowerCamelCase_    )
          model.to(lowerCamelCase_    )
          model.eval()
          A				  =		model(
              lowerCamelCase_ ,attention_mask=lowerCamelCase_ ,token_type_ids=lowerCamelCase_ ,labels=lowerCamelCase_ ,)
          self.parent.assertEqual(result.logits.shape ,(self.batch_size, 2)    )




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_    )    ->      int:
          A				  =		NezhaForPreTraining(config=lowerCamelCase_    )
          model.to(lowerCamelCase_    )
          model.eval()
          A				  =		model(
              lowerCamelCase_ ,attention_mask=lowerCamelCase_ ,token_type_ids=lowerCamelCase_ ,labels=lowerCamelCase_ ,next_sentence_label=lowerCamelCase_ ,)
          self.parent.assertEqual(result.prediction_logits.shape ,(self.batch_size, self.seq_length, self.vocab_size)    )
          self.parent.assertEqual(result.seq_relationship_logits.shape ,(self.batch_size, 2)    )




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_    )    ->      Optional[Any]:
          A				  =		NezhaForQuestionAnswering(config=lowerCamelCase_    )
          model.to(lowerCamelCase_    )
          model.eval()
          A				  =		model(
              lowerCamelCase_ ,attention_mask=lowerCamelCase_ ,token_type_ids=lowerCamelCase_ ,start_positions=lowerCamelCase_ ,end_positions=lowerCamelCase_ ,)
          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 UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_    )    ->      List[str]:
          A				  =		self.num_labels
          A				  =		NezhaForSequenceClassification(lowerCamelCase_    )
          model.to(lowerCamelCase_    )
          model.eval()
          A				  =		model(lowerCamelCase_ ,attention_mask=lowerCamelCase_ ,token_type_ids=lowerCamelCase_ ,labels=lowerCamelCase_    )
          self.parent.assertEqual(result.logits.shape ,(self.batch_size, self.num_labels)    )




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_    )    ->      Any:
          A				  =		self.num_labels
          A				  =		NezhaForTokenClassification(config=lowerCamelCase_    )
          model.to(lowerCamelCase_    )
          model.eval()
          A				  =		model(lowerCamelCase_ ,attention_mask=lowerCamelCase_ ,token_type_ids=lowerCamelCase_ ,labels=lowerCamelCase_    )
          self.parent.assertEqual(result.logits.shape ,(self.batch_size, self.seq_length, self.num_labels)    )




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_    )    ->      int:
          A				  =		self.num_choices
          A				  =		NezhaForMultipleChoice(config=lowerCamelCase_    )
          model.to(lowerCamelCase_    )
          model.eval()
          A				  =		input_ids.unsqueeze(1    ).expand(-1 ,self.num_choices ,-1    ).contiguous()
          A				  =		token_type_ids.unsqueeze(1    ).expand(-1 ,self.num_choices ,-1    ).contiguous()
          A				  =		input_mask.unsqueeze(1    ).expand(-1 ,self.num_choices ,-1    ).contiguous()
          A				  =		model(
              lowerCamelCase_ ,attention_mask=lowerCamelCase_ ,token_type_ids=lowerCamelCase_ ,labels=lowerCamelCase_ ,)
          self.parent.assertEqual(result.logits.shape ,(self.batch_size, self.num_choices)    )




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





@require_torch
class lowerCamelCase__   (				SCREAMING_SNAKE_CASE     ,   SCREAMING_SNAKE_CASE     ,   SCREAMING_SNAKE_CASE     ,   unittest.TestCase    ):



    '''simple docstring'''




    _lowerCamelCase					=   (
        (
            NezhaModel,
            NezhaForMaskedLM,
            NezhaForMultipleChoice,
            NezhaForNextSentencePrediction,
            NezhaForPreTraining,
            NezhaForQuestionAnswering,
            NezhaForSequenceClassification,
            NezhaForTokenClassification,
        )
        if is_torch_available()
        else ()
    )
    _lowerCamelCase					=   (
        {
            '''feature-extraction''': NezhaModel,
            '''fill-mask''': NezhaForMaskedLM,
            '''question-answering''': NezhaForQuestionAnswering,
            '''text-classification''': NezhaForSequenceClassification,
            '''token-classification''': NezhaForTokenClassification,
            '''zero-shot''': NezhaForSequenceClassification,
        }
        if is_torch_available()
        else {}
    )
    _lowerCamelCase					=   True




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_=False    )    ->      List[str]:
          A				  =		super()._prepare_for_class(lowerCamelCase_ ,lowerCamelCase_ ,return_labels=lowerCamelCase_    )

          if return_labels:
                if model_class in get_values(lowerCamelCase_    ):
                      A				  =		torch.zeros(
                          (self.model_tester.batch_size, self.model_tester.seq_length) ,dtype=torch.long ,device=lowerCamelCase_    )
                      A				  =		torch.zeros(
                          self.model_tester.batch_size ,dtype=torch.long ,device=lowerCamelCase_    )
          return inputs_dict




    def UpperCamelCase__		( self    )    ->      Optional[int]:
          A				  =		NezhaModelTester(self    )
          A				  =		ConfigTester(self ,config_class=lowerCamelCase_ ,hidden_size=3_7    )




    def UpperCamelCase__		( self    )    ->      List[str]:
          self.config_tester.run_common_tests()




    def UpperCamelCase__		( self    )    ->      Dict:
          A				  =		self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_model(*lowerCamelCase_    )




    def UpperCamelCase__		( self    )    ->      List[Any]:
          A				  =		self.model_tester.prepare_config_and_inputs_for_decoder()
          self.model_tester.create_and_check_model_as_decoder(*lowerCamelCase_    )




    def UpperCamelCase__		( self    )    ->      List[str]:
          # This regression test was failing with PyTorch < 1.3
          (
              (
              A
          )  ,			(
              A
          )  ,			(
              A
          )  ,			(
              A
          )  ,			(
              A
          )  ,			(
              A
          )  ,			(
              A
          )  ,			(
              A
          )  ,			(
              A
          )  ,			
          )				  =		self.model_tester.prepare_config_and_inputs_for_decoder()

          A				  =		None

          self.model_tester.create_and_check_model_as_decoder(
              lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,)




    def UpperCamelCase__		( self    )    ->      Any:
          A				  =		self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_for_masked_lm(*lowerCamelCase_    )




    def UpperCamelCase__		( self    )    ->      List[str]:
          A				  =		self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_for_multiple_choice(*lowerCamelCase_    )




    def UpperCamelCase__		( self    )    ->      Optional[int]:
          A				  =		self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_for_next_sequence_prediction(*lowerCamelCase_    )




    def UpperCamelCase__		( self    )    ->      Tuple:
          A				  =		self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_for_pretraining(*lowerCamelCase_    )




    def UpperCamelCase__		( self    )    ->      Union[str, Any]:
          A				  =		self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_for_question_answering(*lowerCamelCase_    )




    def UpperCamelCase__		( self    )    ->      int:
          A				  =		self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_for_sequence_classification(*lowerCamelCase_    )




    def UpperCamelCase__		( self    )    ->      Tuple:
          A				  =		self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_for_token_classification(*lowerCamelCase_    )




    @slow
    def UpperCamelCase__		( self    )    ->      Any:
          for model_name in NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                A				  =		NezhaModel.from_pretrained(lowerCamelCase_    )
                self.assertIsNotNone(lowerCamelCase_    )




    @slow
    @require_torch_gpu
    def UpperCamelCase__		( self    )    ->      Any:
          A  ,			A				  =		self.model_tester.prepare_config_and_inputs_for_common()
          for model_class in self.all_model_classes:
                # NezhaForMultipleChoice behaves incorrectly in JIT environments.
                if model_class == NezhaForMultipleChoice:
                      return

                A				  =		True
                A				  =		model_class(config=lowerCamelCase_    )

                A				  =		self._prepare_for_class(lowerCamelCase_ ,lowerCamelCase_    )
                A				  =		torch.jit.trace(
                    lowerCamelCase_ ,(inputs_dict["""input_ids"""].to("""cpu"""    ), inputs_dict["""attention_mask"""].to("""cpu"""    ))    )

                with tempfile.TemporaryDirectory() as tmp:
                      torch.jit.save(lowerCamelCase_ ,os.path.join(lowerCamelCase_ ,"""bert.pt"""    )    )
                      A				  =		torch.jit.load(os.path.join(lowerCamelCase_ ,"""bert.pt"""    ) ,map_location=lowerCamelCase_    )
                      loaded(inputs_dict["""input_ids"""].to(lowerCamelCase_    ) ,inputs_dict["""attention_mask"""].to(lowerCamelCase_    )    )





@require_torch
class lowerCamelCase__   (				unittest.TestCase    ):



    '''simple docstring'''




    @slow
    def UpperCamelCase__		( self    )    ->      int:
          A				  =		NezhaModel.from_pretrained("""sijunhe/nezha-cn-base"""    )
          A				  =		torch.tensor([[0, 1, 2, 3, 4, 5]]    )
          A				  =		torch.tensor([[0, 1, 1, 1, 1, 1]]    )
          with torch.no_grad():
                A				  =		model(lowerCamelCase_ ,attention_mask=lowerCamelCase_    )[0]
          A				  =		torch.Size((1, 6, 7_6_8)    )
          self.assertEqual(output.shape ,lowerCamelCase_    )
          A				  =		torch.tensor([[[0.06_85, 0.24_41, 0.11_02], [0.06_00, 0.19_06, 0.13_49], [0.02_21, 0.08_19, 0.05_86]]]    )

          self.assertTrue(torch.allclose(output[:, 1:4, 1:4] ,lowerCamelCase_ ,atol=1E-4    )    )




    @slow
    def UpperCamelCase__		( self    )    ->      Optional[Any]:
          A				  =		NezhaForMaskedLM.from_pretrained("""sijunhe/nezha-cn-base"""    )
          A				  =		torch.tensor([[0, 1, 2, 3, 4, 5]]    )
          A				  =		torch.tensor([[1, 1, 1, 1, 1, 1]]    )
          with torch.no_grad():
                A				  =		model(lowerCamelCase_ ,attention_mask=lowerCamelCase_    )[0]
          A				  =		torch.Size((1, 6, 2_1_1_2_8)    )
          self.assertEqual(output.shape ,lowerCamelCase_    )
          A				  =		torch.tensor(
              [[-2.79_39, -1.79_02, -2.21_89], [-2.85_85, -1.89_08, -2.37_23], [-2.64_99, -1.77_50, -2.25_58]]    )

          self.assertTrue(torch.allclose(output[:, 1:4, 1:4] ,lowerCamelCase_ ,atol=1E-4    )    )







"""simple docstring"""


from __future__ import annotations

from collections.abc import Sequence
from typing import Literal



def   _A					(	_a	:						str     ,   _a	:						str				):



      """simple docstring"""






      A				  =		list(_a				)
      A				  =		list(_a				)
      A				  =		0
      for i in range(len(_a				)				):
            if lista[i] != lista[i]:
                  count += 1
                  A				  =		"""_"""
      if count > 1:
            return False
      else:
            return "".join(_a				)



def   _A					(	_a	:						list[str]				):



      """simple docstring"""






      A				  =		[]
      while True:
            A				  =		["""$"""] * len(_a				)
            A				  =		[]
            for i in range(len(_a				)				):
                  for j in range(i + 1     ,   len(_a				)				):
                        A				  =		compare_string(binary[i]     ,   binary[j]				)
                        if k is False:
                              A				  =		"""*"""
                              A				  =		"""*"""
                              temp.append("""X"""				)
            for i in range(len(_a				)				):
                  if checka[i] == "$":
                        pi.append(binary[i]				)
            if len(_a				) == 0:
                  return pi
            A				  =		list(set(_a				)				)



def   _A					(	_a	:						int     ,   _a	:						Sequence[float]				):



      """simple docstring"""






      A				  =		[]
      for minterm in minterms:
            A				  =		""""""
            for _ in range(_a				):
                  A				  =		str(minterm % 2				) + string
                  minterm //= 2
            temp.append(_a				)
      return temp



def   _A					(	_a	:						str     ,   _a	:						str     ,   _a	:						int				):



      """simple docstring"""






      A				  =		list(_a				)
      A				  =		list(_a				)
      A				  =		0
      for i in range(len(_a				)				):
            if lista[i] != lista[i]:
                  count_n += 1
      return count_n == count



def   _A					(	_a	:						list[list[int]]     ,   _a	:						list[str]				):



      """simple docstring"""






      A				  =		[]
      A				  =		[0] * len(_a				)
      for i in range(len(chart[0]				)				):
            A				  =		0
            A				  =		-1
            for j in range(len(_a				)				):
                  if chart[j][i] == 1:
                        count += 1
                        A				  =		j
            if count == 1:
                  A				  =		1
      for i in range(len(_a				)				):
            if select[i] == 1:
                  for j in range(len(chart[0]				)				):
                        if chart[i][j] == 1:
                              for k in range(len(_a				)				):
                                    A				  =		0
                  temp.append(prime_implicants[i]				)
      while True:
            A				  =		0
            A				  =		-1
            A				  =		0
            for i in range(len(_a				)				):
                  A				  =		chart[i].count(1				)
                  if count_n > max_n:
                        A				  =		count_n
                        A				  =		i

            if max_n == 0:
                  return temp

            temp.append(prime_implicants[rem]				)

            for i in range(len(chart[0]				)				):
                  if chart[rem][i] == 1:
                        for j in range(len(_a				)				):
                              A				  =		0



def   _A					(	_a	:						list[str]     ,   _a	:						list[str]				):



      """simple docstring"""






      A				  =		[[0 for x in range(len(_a				)				)] for x in range(len(_a				)				)]
      for i in range(len(_a				)				):
            A				  =		prime_implicants[i].count("""_"""				)
            for j in range(len(_a				)				):
                  if is_for_table(prime_implicants[i]     ,   binary[j]     ,   _a				):
                        A				  =		1

      return chart



def   _A					(	):



      """simple docstring"""






      A				  =		int(input("""Enter the no. of variables\n"""				)				)
      A				  =		[
          float(_a				)
          for x in input(
              """Enter the decimal representation of Minterms 'Spaces Separated'\n"""				).split()
      ]
      A				  =		decimal_to_binary(_a     ,   _a				)

      A				  =		check(_a				)
      print("""Prime Implicants are:"""				)
      print(_a				)
      A				  =		prime_implicant_chart(_a     ,   _a				)

      A				  =		selection(_a     ,   _a				)
      print("""Essential Prime Implicants are:"""				)
      print(_a				)


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  main()




