


'''simple docstring'''







import collections
import inspect
import unittest

from transformers import NatConfig
from transformers.testing_utils import require_natten, require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_backbone_common import BackboneTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, _config_zero_init, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
   import torch
   from torch import nn

   from transformers import NatBackbone, NatForImageClassification, NatModel
   from transformers.models.nat.modeling_nat import NAT_PRETRAINED_MODEL_ARCHIVE_LIST

if is_vision_available():
   from PIL import Image

   from transformers import AutoImageProcessor


class 				__lowerCamelCase				:
    """simple docstring"""


    def __init__(						self    :							int   ,							SCREAMING_SNAKE_CASE    :							Any   ,							SCREAMING_SNAKE_CASE    :							Any=13   ,							SCREAMING_SNAKE_CASE    :							Tuple=64   ,							SCREAMING_SNAKE_CASE    :							List[Any]=4   ,							SCREAMING_SNAKE_CASE    :							Tuple=3   ,							SCREAMING_SNAKE_CASE    :							str=16   ,							SCREAMING_SNAKE_CASE    :							List[str]=[1, 2, 1]   ,							SCREAMING_SNAKE_CASE    :							List[Any]=[2, 4, 8]   ,							SCREAMING_SNAKE_CASE    :							Union[str, Any]=3   ,							SCREAMING_SNAKE_CASE    :							str=2.0   ,							SCREAMING_SNAKE_CASE    :							List[str]=True   ,							SCREAMING_SNAKE_CASE    :							Tuple=0.0   ,							SCREAMING_SNAKE_CASE    :							str=0.0   ,							SCREAMING_SNAKE_CASE    :							Tuple=0.1   ,							SCREAMING_SNAKE_CASE    :							Tuple="gelu"   ,							SCREAMING_SNAKE_CASE    :							List[Any]=True   ,							SCREAMING_SNAKE_CASE    :							List[Any]=0.02   ,							SCREAMING_SNAKE_CASE    :							int=1e-5   ,							SCREAMING_SNAKE_CASE    :							Union[str, Any]=True   ,							SCREAMING_SNAKE_CASE    :							Optional[Any]=None   ,							SCREAMING_SNAKE_CASE    :							Tuple=True   ,							SCREAMING_SNAKE_CASE    :							List[Any]=10   ,							SCREAMING_SNAKE_CASE    :							Optional[int]=["stage1", "stage2"]   ,							SCREAMING_SNAKE_CASE    :							str=[1, 2]   ,							):
           _A  :			List[Any]											=      parent
           _A  :			Tuple											=      batch_size
           _A  :			Optional[Any]											=      image_size
           _A  :			int											=      patch_size
           _A  :			str											=      num_channels
           _A  :			List[Any]											=      embed_dim
           _A  :			Tuple											=      depths
           _A  :			Optional[int]											=      num_heads
           _A  :			Tuple											=      kernel_size
           _A  :			str											=      mlp_ratio
           _A  :			Union[str, Any]											=      qkv_bias
           _A  :			List[Any]											=      hidden_dropout_prob
           _A  :			Dict											=      attention_probs_dropout_prob
           _A  :			Tuple											=      drop_path_rate
           _A  :			Union[str, Any]											=      hidden_act
           _A  :			int											=      patch_norm
           _A  :			Union[str, Any]											=      layer_norm_eps
           _A  :			Optional[int]											=      initializer_range
           _A  :			int											=      is_training
           _A  :			Any											=      scope
           _A  :			Union[str, Any]											=      use_labels
           _A  :			List[Any]											=      num_labels
           _A  :			Optional[int]											=      out_features
           _A  :			Optional[int]											=      out_indices


    def      A					(						self    :							Tuple):
           _A  :			Union[str, Any]											=      floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size])

           _A  :			Optional[Any]											=      None
           if self.use_labels:
                  _A  :			Dict											=      ids_tensor([self.batch_size]   ,							self.num_labels)

           _A  :			Union[str, Any]											=      self.get_config()

           return config, pixel_values, labels


    def      A					(						self    :							Any):
           return NatConfig(
               num_labels=self.num_labels   ,							image_size=self.image_size   ,							patch_size=self.patch_size   ,							num_channels=self.num_channels   ,							embed_dim=self.embed_dim   ,							depths=self.depths   ,							num_heads=self.num_heads   ,							kernel_size=self.kernel_size   ,							mlp_ratio=self.mlp_ratio   ,							qkv_bias=self.qkv_bias   ,							hidden_dropout_prob=self.hidden_dropout_prob   ,							attention_probs_dropout_prob=self.attention_probs_dropout_prob   ,							drop_path_rate=self.drop_path_rate   ,							hidden_act=self.hidden_act   ,							patch_norm=self.patch_norm   ,							layer_norm_eps=self.layer_norm_eps   ,							initializer_range=self.initializer_range   ,							out_features=self.out_features   ,							out_indices=self.out_indices   ,							)


    def      A					(						self    :							Dict   ,							SCREAMING_SNAKE_CASE    :							Union[str, Any]   ,							SCREAMING_SNAKE_CASE    :							Optional[int]   ,							SCREAMING_SNAKE_CASE    :							str):
           _A  :			List[Any]											=      NatModel(config=SCREAMING_SNAKE_CASE)
           model.to(SCREAMING_SNAKE_CASE)
           model.eval()
           _A  :			List[Any]											=      model(SCREAMING_SNAKE_CASE)

           _A  :			str											=      (config.image_size // config.patch_size) // (2 ** (len(config.depths) - 1))
           _A  :			Optional[int]											=      int(config.embed_dim * 2 ** (len(config.depths) - 1))

           self.parent.assertEqual(
               result.last_hidden_state.shape   ,							(self.batch_size, expected_height, expected_width, expected_dim))


    def      A					(						self    :							Tuple   ,							SCREAMING_SNAKE_CASE    :							List[Any]   ,							SCREAMING_SNAKE_CASE    :							Union[str, Any]   ,							SCREAMING_SNAKE_CASE    :							str):
           _A  :			List[Any]											=      NatForImageClassification(SCREAMING_SNAKE_CASE)
           model.to(SCREAMING_SNAKE_CASE)
           model.eval()
           _A  :			Tuple											=      model(SCREAMING_SNAKE_CASE   ,							labels=SCREAMING_SNAKE_CASE)
           self.parent.assertEqual(result.logits.shape   ,							(self.batch_size, self.num_labels))

           # test greyscale images
           _A  :			int											=      1
           _A  :			str											=      NatForImageClassification(SCREAMING_SNAKE_CASE)
           model.to(SCREAMING_SNAKE_CASE)
           model.eval()

           _A  :			Any											=      floats_tensor([self.batch_size, 1, self.image_size, self.image_size])
           _A  :			List[Any]											=      model(SCREAMING_SNAKE_CASE)
           self.parent.assertEqual(result.logits.shape   ,							(self.batch_size, self.num_labels))


    def      A					(						self    :							List[Any]   ,							SCREAMING_SNAKE_CASE    :							Tuple   ,							SCREAMING_SNAKE_CASE    :							List[str]   ,							SCREAMING_SNAKE_CASE    :							Dict):
           _A  :			List[Any]											=      NatBackbone(config=SCREAMING_SNAKE_CASE)
           model.to(SCREAMING_SNAKE_CASE)
           model.eval()
           _A  :			Union[str, Any]											=      model(SCREAMING_SNAKE_CASE)

           # verify hidden states
           self.parent.assertEqual(len(result.feature_maps)   ,							len(config.out_features))
           self.parent.assertListEqual(list(result.feature_maps[0].shape)   ,							[self.batch_size, model.channels[0], 16, 16])

           # verify channels
           self.parent.assertEqual(len(model.channels)   ,							len(config.out_features))

           # verify backbone works with out_features=None
           _A  :			Any											=      None
           _A  :			Optional[Any]											=      NatBackbone(config=SCREAMING_SNAKE_CASE)
           model.to(SCREAMING_SNAKE_CASE)
           model.eval()
           _A  :			List[Any]											=      model(SCREAMING_SNAKE_CASE)

           # verify feature maps
           self.parent.assertEqual(len(result.feature_maps)   ,							1)
           self.parent.assertListEqual(list(result.feature_maps[0].shape)   ,							[self.batch_size, model.channels[-1], 4, 4])

           # verify channels
           self.parent.assertEqual(len(model.channels)   ,							1)


    def      A					(						self    :							List[str]):
           _A  :			Optional[int]											=      self.prepare_config_and_inputs()
           _A						,				_A						,				_A  :			int											=      config_and_inputs
           _A  :			Any											=      {'pixel_values': pixel_values}
           return config, inputs_dict




@require_natten
@require_torch
class 				__lowerCamelCase				( a_       ,      a_       ,      unittest.TestCase ):
    """simple docstring"""
    a									=					(
        (
            NatModel,
            NatForImageClassification,
            NatBackbone,
        )
        if is_torch_available()
        else ()
    )
    a									=					(
        {"feature-extraction": NatModel, "image-classification": NatForImageClassification}
        if is_torch_available()
        else {}
    )
    a									=					False

    a									=					False
    a									=					False
    a									=					False
    a									=					False


    def      A					(						self    :							Union[str, Any]):
           _A  :			Optional[Any]											=      NatModelTester(self)
           _A  :			Optional[Any]											=      ConfigTester(self   ,							config_class=SCREAMING_SNAKE_CASE   ,							embed_dim=37)


    def      A					(						self    :							str):
           self.create_and_test_config_common_properties()
           self.config_tester.create_and_test_config_to_json_string()
           self.config_tester.create_and_test_config_to_json_file()
           self.config_tester.create_and_test_config_from_and_save_pretrained()
           self.config_tester.create_and_test_config_with_num_labels()
           self.config_tester.check_config_can_be_init_without_params()
           self.config_tester.check_config_arguments_init()


    def      A					(						self    :							Union[str, Any]):
           return


    def      A					(						self    :							str):
           _A  :			int											=      self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_model(*SCREAMING_SNAKE_CASE)


    def      A					(						self    :							Dict):
           _A  :			List[str]											=      self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_for_image_classification(*SCREAMING_SNAKE_CASE)


    def      A					(						self    :							List[Any]):
           _A  :			Tuple											=      self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_backbone(*SCREAMING_SNAKE_CASE)


    @unittest.skip(reason='Nat does not use inputs_embeds')
    def      A					(						self    :							List[str]):
           pass


    @unittest.skip(reason='Nat does not use feedforward chunking')
    def      A					(						self    :							List[Any]):
           pass


    def      A					(						self    :							List[str]):
           _A						,				_A  :			Union[str, Any]											=      self.model_tester.prepare_config_and_inputs_for_common()

           for model_class in self.all_model_classes:
                  _A  :			Dict											=      model_class(SCREAMING_SNAKE_CASE)
                  self.assertIsInstance(model.get_input_embeddings()   ,							(nn.Module))
                  _A  :			Optional[int]											=      model.get_output_embeddings()
                  self.assertTrue(x is None or isinstance(SCREAMING_SNAKE_CASE   ,							nn.Linear))


    def      A					(						self    :							Optional[int]):
           _A						,				_A  :			Tuple											=      self.model_tester.prepare_config_and_inputs_for_common()

           for model_class in self.all_model_classes:
                  _A  :			Optional[Any]											=      model_class(SCREAMING_SNAKE_CASE)
                  _A  :			Union[str, Any]											=      inspect.signature(model.forward)
                  # signature.parameters is an OrderedDict => so arg_names order is deterministic
                  _A  :			Optional[Any]											=      [*signature.parameters.keys()]

                  _A  :			List[Any]											=      ['pixel_values']
                  self.assertListEqual(arg_names[:1]   ,							SCREAMING_SNAKE_CASE)


    def      A					(						self    :							Any):
           self.skipTest('Nat\'s attention operation is handled entirely by NATTEN.')


    def      A					(						self    :							Dict   ,							SCREAMING_SNAKE_CASE    :							Any   ,							SCREAMING_SNAKE_CASE    :							List[str]   ,							SCREAMING_SNAKE_CASE    :							Any   ,							SCREAMING_SNAKE_CASE    :							List[Any]):
           _A  :			str											=      model_class(SCREAMING_SNAKE_CASE)
           model.to(SCREAMING_SNAKE_CASE)
           model.eval()

           with torch.no_grad():
                  _A  :			List[Any]											=      model(**self._prepare_for_class(SCREAMING_SNAKE_CASE   ,							SCREAMING_SNAKE_CASE))

           _A  :			List[str]											=      outputs.hidden_states

           _A  :			Union[str, Any]											=      getattr(
               self.model_tester   ,							'expected_num_hidden_layers'   ,							len(self.model_tester.depths) + 1)
           self.assertEqual(len(SCREAMING_SNAKE_CASE)   ,							SCREAMING_SNAKE_CASE)

           # Nat has a different seq_length
           _A  :			Optional[Any]											=      (
               config.patch_size
               if isinstance(config.patch_size   ,							collections.abc.Iterable)
               else (config.patch_size, config.patch_size)
           )

           _A  :			List[Any]											=      image_size[0] // patch_size[0]
           _A  :			Any											=      image_size[1] // patch_size[1]

           self.assertListEqual(
               list(hidden_states[0].shape[-3:])   ,							[height, width, self.model_tester.embed_dim]   ,							)

           if model_class.__name__ != "NatBackbone":
                  _A  :			Optional[int]											=      outputs.reshaped_hidden_states
                  self.assertEqual(len(SCREAMING_SNAKE_CASE)   ,							SCREAMING_SNAKE_CASE)

                  _A						,				_A						,				_A						,				_A  :			int											=      reshaped_hidden_states[0].shape
                  _A  :			List[Any]											=      (
                      reshaped_hidden_states[0].view(SCREAMING_SNAKE_CASE   ,							SCREAMING_SNAKE_CASE   ,							SCREAMING_SNAKE_CASE   ,							SCREAMING_SNAKE_CASE).permute(0   ,							2   ,							3   ,							1)
                  )
                  self.assertListEqual(
                      list(reshaped_hidden_states.shape[-3:])   ,							[height, width, self.model_tester.embed_dim]   ,							)


    def      A					(						self    :							Tuple):
           _A						,				_A  :			Tuple											=      self.model_tester.prepare_config_and_inputs_for_common()

           _A  :			Dict											=      (
               self.model_tester.image_size
               if isinstance(self.model_tester.image_size   ,							collections.abc.Iterable)
               else (self.model_tester.image_size, self.model_tester.image_size)
           )

           for model_class in self.all_model_classes:
                  _A  :			Tuple											=      True
                  self.check_hidden_states_output(SCREAMING_SNAKE_CASE   ,							SCREAMING_SNAKE_CASE   ,							SCREAMING_SNAKE_CASE   ,							SCREAMING_SNAKE_CASE)

                  # check that output_hidden_states also work using config
                  del inputs_dict["output_hidden_states"]
                  _A  :			List[str]											=      True

                  self.check_hidden_states_output(SCREAMING_SNAKE_CASE   ,							SCREAMING_SNAKE_CASE   ,							SCREAMING_SNAKE_CASE   ,							SCREAMING_SNAKE_CASE)


    @slow
    def      A					(						self    :							str):
           for model_name in NAT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                  _A  :			Optional[int]											=      NatModel.from_pretrained(SCREAMING_SNAKE_CASE)
                  self.assertIsNotNone(SCREAMING_SNAKE_CASE)


    def      A					(						self    :							Optional[Any]):
           _A						,				_A  :			List[str]											=      self.model_tester.prepare_config_and_inputs_for_common()

           _A  :			Tuple											=      _config_zero_init(SCREAMING_SNAKE_CASE)
           for model_class in self.all_model_classes:
                  _A  :			Dict											=      model_class(config=SCREAMING_SNAKE_CASE)
                  for name, param in model.named_parameters():
                         if "embeddings" not in name and param.requires_grad:
                                self.assertIn(
                                    ((param.data.mean() * 1e9).round() / 1e9).item()   ,							[0.0, 1.0]   ,							msg=F'Parameter {name} of model {model_class} seems not properly initialized'   ,							)




@require_natten
@require_vision
@require_torch
class 				__lowerCamelCase				( unittest.TestCase ):
    """simple docstring"""


    @cached_property
    def      A					(						self    :							str):
           return AutoImageProcessor.from_pretrained('shi-labs/nat-mini-in1k-224') if is_vision_available() else None


    @slow
    def      A					(						self    :							Union[str, Any]):
           _A  :			Optional[Any]											=      NatForImageClassification.from_pretrained('shi-labs/nat-mini-in1k-224').to(SCREAMING_SNAKE_CASE)
           _A  :			Tuple											=      self.default_image_processor

           _A  :			str											=      Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png')
           _A  :			List[Any]											=      image_processor(images=SCREAMING_SNAKE_CASE   ,							return_tensors='pt').to(SCREAMING_SNAKE_CASE)

           # forward pass
           with torch.no_grad():
                  _A  :			str											=      model(**SCREAMING_SNAKE_CASE)

           # verify the logits
           _A  :			Any											=      torch.Size((1, 1000))
           self.assertEqual(outputs.logits.shape   ,							SCREAMING_SNAKE_CASE)
           _A  :			Any											=      torch.tensor([0.3805, -0.8676, -0.3912]).to(SCREAMING_SNAKE_CASE)
           self.assertTrue(torch.allclose(outputs.logits[0, :3]   ,							SCREAMING_SNAKE_CASE   ,							atol=1e-4))




@require_torch
@require_natten
class 				__lowerCamelCase				( unittest.TestCase       ,      a_ ):
    """simple docstring"""
    a									=					(NatBackbone,) if is_torch_available() else ()
    a									=					NatConfig


    def      A					(						self    :							Any):
           _A  :			int											=      NatModelTester(self)










'''simple docstring'''







import unittest

from transformers import (
    MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING,
    TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING,
    SummarizationPipeline,
    TFPreTrainedModel,
    pipeline,
)
from transformers.testing_utils import get_gpu_count, is_pipeline_test, require_tf, require_torch, slow, torch_device
from transformers.tokenization_utils import TruncationStrategy

from .test_pipelines_common import ANY


A   :  Optional[Any]       		=				-1 if torch_device == '''cpu''' else 0


@is_pipeline_test
class 				__lowerCamelCase				( unittest.TestCase ):
    """simple docstring"""
    a									=					MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING
    a									=					TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING


    def      A					(						self    :							Union[str, Any]   ,							SCREAMING_SNAKE_CASE    :							Tuple   ,							SCREAMING_SNAKE_CASE    :							Optional[Any]   ,							SCREAMING_SNAKE_CASE    :							Dict):
           _A  :			str											=      SummarizationPipeline(model=SCREAMING_SNAKE_CASE   ,							tokenizer=SCREAMING_SNAKE_CASE)
           return summarizer, ["(CNN)The Palestinian Authority officially became", "Some other text"]


    def      A					(						self    :							Optional[int]   ,							SCREAMING_SNAKE_CASE    :							Tuple   ,							SCREAMING_SNAKE_CASE    :							Optional[int]):
           _A  :			str											=      summarizer.model

           _A  :			Tuple											=      summarizer('(CNN)The Palestinian Authority officially became')
           self.assertEqual(SCREAMING_SNAKE_CASE   ,							[{'summary_text': ANY(SCREAMING_SNAKE_CASE)}])

           _A  :			Optional[Any]											=      summarizer(
               '(CNN)The Palestinian Authority officially became '   ,							num_beams=2   ,							min_length=2   ,							max_length=5   ,							)
           self.assertEqual(SCREAMING_SNAKE_CASE   ,							[{'summary_text': ANY(SCREAMING_SNAKE_CASE)}])

           # Some models (Switch Transformers, LED, T5, LongT5, etc) can handle long sequences.
           _A  :			Union[str, Any]											=      [
               'SwitchTransformersConfig',
               'T5Config',
               'LongT5Config',
               'LEDConfig',
               'PegasusXConfig',
               'FSMTConfig',
               'M2M100Config',
               'ProphetNetConfig',  # positional embeddings up to a fixed maximum size (otherwise clamping the values)
           ]
           if model.config.__class__.__name__ not in model_can_handle_longer_seq:
                  # Too long and exception is expected.
                  # For TF models, if the weights are initialized in GPU context, we won't get expected index error from
                  # the embedding layer.
                  if not (
                      isinstance(SCREAMING_SNAKE_CASE   ,							SCREAMING_SNAKE_CASE)
                      and get_gpu_count() > 0
                      and len(summarizer.model.trainable_weights) > 0
                  ):
                         with self.assertRaises(SCREAMING_SNAKE_CASE):
                                _A  :			Any											=      summarizer('This ' * 1000)
           _A  :			int											=      summarizer('This ' * 1000   ,							truncation=TruncationStrategy.ONLY_FIRST)


    @require_torch
    def      A					(						self    :							int):
           _A  :			Tuple											=      pipeline(task='summarization'   ,							model='sshleifer/tiny-mbart'   ,							framework='pt')
           _A  :			List[str]											=      summarizer('This is a small test')
           self.assertEqual(
               SCREAMING_SNAKE_CASE   ,							[
                   {
                       'summary_text': 'เข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไป'
                   }
               ]   ,							)


    @require_tf
    def      A					(						self    :							int):
           _A  :			Optional[Any]											=      pipeline(task='summarization'   ,							model='sshleifer/tiny-mbart'   ,							framework='tf')
           _A  :			Any											=      summarizer('This is a small test')
           self.assertEqual(
               SCREAMING_SNAKE_CASE   ,							[
                   {
                       'summary_text': 'เข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไปเข้าไป'
                   }
               ]   ,							)


    @require_torch
    @slow
    def      A					(						self    :							List[Any]):
           _A  :			int											=      pipeline(task='summarization'   ,							device=SCREAMING_SNAKE_CASE)
           _A  :			int											=      (
               ' (CNN)The Palestinian Authority officially became the 123rd member of the International Criminal Court on'
               ' Wednesday, a step that gives the court jurisdiction over alleged crimes in Palestinian territories. The'
               ' formal accession was marked with a ceremony at The Hague, in the Netherlands, where the court is based.'
               ' The Palestinians signed the ICC\'s founding Rome Statute in January, when they also accepted its'
               ' jurisdiction over alleged crimes committed "in the occupied Palestinian territory, including East'
               ' Jerusalem, since June 13, 2014." Later that month, the ICC opened a preliminary examination into the'
               ' situation in Palestinian territories, paving the way for possible war crimes investigations against'
               ' Israelis. As members of the court, Palestinians may be subject to counter-charges as well. Israel and'
               ' the United States, neither of which is an ICC member, opposed the Palestinians\' efforts to join the'
               ' body. But Palestinian Foreign Minister Riad al-Malki, speaking at Wednesday\'s ceremony, said it was a'
               ' move toward greater justice. "As Palestine formally becomes a State Party to the Rome Statute today, the'
               ' world is also a step closer to ending a long era of impunity and injustice," he said, according to an'
               ' ICC news release. "Indeed, today brings us closer to our shared goals of justice and peace." Judge'
               ' Kuniko Ozaki, a vice president of the ICC, said acceding to the treaty was just the first step for the'
               ' Palestinians. "As the Rome Statute today enters into force for the State of Palestine, Palestine'
               ' acquires all the rights as well as responsibilities that come with being a State Party to the Statute.'
               ' These are substantive commitments, which cannot be taken lightly," she said. Rights group Human Rights'
               ' Watch welcomed the development. "Governments seeking to penalize Palestine for joining the ICC should'
               ' immediately end their pressure, and countries that support universal acceptance of the court\'s treaty'
               ' should speak out to welcome its membership," said Balkees Jarrah, international justice counsel for the'
               ' group. \"What\'s objectionable is the attempts to undermine international justice, not Palestine\'s'
               ' decision to join a treaty to which over 100 countries around the world are members." In January, when'
               ' the preliminary ICC examination was opened, Israeli Prime Minister Benjamin Netanyahu described it as an'
               ' outrage, saying the court was overstepping its boundaries. The United States also said it "strongly"'
               ' disagreed with the court\'s decision. \"As we have said repeatedly, we do not believe that Palestine is a'
               ' state and therefore we do not believe that it is eligible to join the ICC," the State Department said in'
               ' a statement. It urged the warring sides to resolve their differences through direct negotiations. "We'
               ' will continue to oppose actions against Israel at the ICC as counterproductive to the cause of peace,"'
               ' it said. But the ICC begs to differ with the definition of a state for its purposes and refers to the'
               ' territories as "Palestine." While a preliminary examination is not a formal investigation, it allows the'
               ' court to review evidence and determine whether to investigate suspects on both sides. Prosecutor Fatou'
               ' Bensouda said her office would "conduct its analysis in full independence and impartiality." The war'
               ' between Israel and Hamas militants in Gaza last summer left more than 2,000 people dead. The inquiry'
               ' will include alleged war crimes committed since June. The International Criminal Court was set up in'
               ' 2002 to prosecute genocide, crimes against humanity and war crimes. CNN\'s Vasco Cotovio, Kareem Khadder'
               ' and Faith Karimi contributed to this report.'
           )
           _A  :			Optional[Any]											=      (
               ' The Palestinian Authority becomes the 123rd member of the International Criminal Court . The move gives'
               ' the court jurisdiction over alleged crimes in Palestinian territories . Israel and the United States'
               ' opposed the Palestinians\' efforts to join the court . Rights group Human Rights Watch welcomes the move,'
               ' says governments seeking to penalize Palestine should end pressure .'
           )
           _A  :			Union[str, Any]											=      summarizer(SCREAMING_SNAKE_CASE)
           self.assertEqual(result[0]['summary_text']   ,							SCREAMING_SNAKE_CASE)






