

'''simple docstring'''
import json
import os
import re
import warnings
from pathlib import Path
from shutil import copyfile
from typing import Any, Dict, List, Optional, Tuple, Union

import sentencepiece

from ...tokenization_utils import PreTrainedTokenizer
from ...utils import logging


lowerCamelCase				:   List[str]      				=  logging.get_logger(__name__)

lowerCamelCase				:   Dict      				=  {
    "source_spm": "source.spm",
    "target_spm": "target.spm",
    "vocab": "vocab.json",
    "target_vocab_file": "target_vocab.json",
    "tokenizer_config_file": "tokenizer_config.json",
}

lowerCamelCase				:   Optional[int]      				=  {
    "source_spm": {
        "Helsinki-NLP/opus-mt-en-de": "https://huggingface.co/Helsinki-NLP/opus-mt-en-de/resolve/main/source.spm"
    },
    "target_spm": {
        "Helsinki-NLP/opus-mt-en-de": "https://huggingface.co/Helsinki-NLP/opus-mt-en-de/resolve/main/target.spm"
    },
    "vocab": {
        "Helsinki-NLP/opus-mt-en-de": "https://huggingface.co/Helsinki-NLP/opus-mt-en-de/resolve/main/vocab.json"
    },
    "tokenizer_config_file": {
        "Helsinki-NLP/opus-mt-en-de": (
            "https://huggingface.co/Helsinki-NLP/opus-mt-en-de/resolve/main/tokenizer_config.json"
        )
    },
}

lowerCamelCase				:   Tuple      				=  {"Helsinki-NLP/opus-mt-en-de": 5_1_2}
lowerCamelCase				:   str      				=  {}







class 							A__					( A__						):
  A__					=       VOCAB_FILES_NAMES
  A__					=       PRETRAINED_VOCAB_FILES_MAP
  A__					=       PRETRAINED_INIT_CONFIGURATION
  A__					=       PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  A__					=       ["input_ids", "attention_mask"]
  A__					=       re.compile('>>.+<<'						)  # type: re.Pattern





  def __init__(	self   :			str							,      _a   :			Any							,      _a   :			Union[str, Any]							,      _a   :			str							,      _a   :			Union[str, Any]=None							,      _a   :			Tuple=None							,      _a   :			Tuple=None							,      _a   :			List[str]="<unk>"							,      _a   :			int="</s>"							,      _a   :			str="<pad>"							,      _a   :			Any=512							,      _a   :			int = None							,      _a   :			Optional[Any]=False							,      **_a   :			Optional[int]							,      )			->					None:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												={} if sp_model_kwargs is None else sp_model_kwargs

       super().__init__(
           # bos_token=bos_token,  unused. Start decoding with config.decoder_start_token_id
           source_lang=_a							,      target_lang=_a							,      unk_token=_a							,      eos_token=_a							,      pad_token=_a							,      model_max_length=_a							,      sp_model_kwargs=self.sp_model_kwargs							,      target_vocab_file=_a							,      separate_vocabs=_a							,      **_a							,      )
       assert Path(_a				).exists(), f"cannot find spm source {source_spm}"

       _SCREAMING_SNAKE_CASE												=separate_vocabs
       _SCREAMING_SNAKE_CASE												=load_json(_a				)
       if self.unk_token not in self.encoder:
            raise KeyError('<unk> token must be in vocab'				)
       assert self.pad_token in self.encoder

       if separate_vocabs:
            _SCREAMING_SNAKE_CASE												=load_json(_a				)
            _SCREAMING_SNAKE_CASE												={v: k for k, v in self.target_encoder.items()}
            _SCREAMING_SNAKE_CASE												=[]
       else:
            _SCREAMING_SNAKE_CASE												={v: k for k, v in self.encoder.items()}
            _SCREAMING_SNAKE_CASE												=[k for k in self.encoder if k.startswith('>>'				) and k.endswith('<<'				)]

       _SCREAMING_SNAKE_CASE												=source_lang
       _SCREAMING_SNAKE_CASE												=target_lang
       _SCREAMING_SNAKE_CASE												=[source_spm, target_spm]

       # load SentencePiece model for pre-processing
       _SCREAMING_SNAKE_CASE												=load_spm(_a							,      self.sp_model_kwargs				)
       _SCREAMING_SNAKE_CASE												=load_spm(_a							,      self.sp_model_kwargs				)
       _SCREAMING_SNAKE_CASE												=self.spm_source
       _SCREAMING_SNAKE_CASE												=self.encoder

       # Multilingual target side: default to using first supported language code.

       self._setup_normalizer()





  def 		A						(	self   :			Union[str, Any]				)			->					List[str]:





       '''simple docstring'''






       try:
            from sacremoses import MosesPunctNormalizer

            _SCREAMING_SNAKE_CASE												=MosesPunctNormalizer(self.source_lang				).normalize
       except (ImportError, FileNotFoundError):
            warnings.warn('Recommended: pip install sacremoses.'				)
            _SCREAMING_SNAKE_CASE												=lambda _a				: x





  def 		A						(	self   :			List[Any]							,      _a   :			List[str]				)			->					str:





       '''simple docstring'''






       return self.punc_normalizer(_a				) if x else ""





  def 		A						(	self   :			Optional[Any]							,      _a   :			int				)			->					Optional[Any]:





       '''simple docstring'''






       return self.current_encoder.get(_a							,      self.current_encoder[self.unk_token]				)





  def 		A						(	self   :			List[Any]							,      _a   :			str				)			->					int:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=self.language_code_re.match(_a				)
       _SCREAMING_SNAKE_CASE												=[match.group(0				)] if match else []
       return code, self.language_code_re.sub(''							,      _a				)





  def 		A						(	self   :			List[str]							,      _a   :			Optional[Any]				)			->					List[str]:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=self.remove_language_code(_a				)
       _SCREAMING_SNAKE_CASE												=self.current_spm.encode(_a							,      out_type=_a				)
       return code + pieces





  def 		A						(	self   :			Union[str, Any]							,      _a   :			Dict				)			->					str:





       '''simple docstring'''






       return self.decoder.get(_a							,      self.unk_token				)





  def 		A						(	self   :			Tuple							,      _a   :			Any							,      **_a   :			Tuple				)			->					Any:





       '''simple docstring'''






       return super().batch_decode(_a							,      **_a				)





  def 		A						(	self   :			Optional[int]							,      _a   :			Union[str, Any]							,      **_a   :			str				)			->					Dict:





       '''simple docstring'''






       return super().decode(_a							,      **_a				)





  def 		A						(	self   :			Optional[Any]							,      _a   :			Any				)			->					str:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=self.spm_source if self._decode_use_source_tokenizer else self.spm_target
       _SCREAMING_SNAKE_CASE												=[]
       _SCREAMING_SNAKE_CASE												=""
       for token in tokens:
            # make sure that special tokens are not decoded using sentencepiece model
            if token in self.all_special_tokens:
                 out_string += sp_model.decode_pieces(_a				) + token + " "
                 _SCREAMING_SNAKE_CASE												=[]
            else:
                 current_sub_tokens.append(_a				)
       out_string += sp_model.decode_pieces(_a				)
       return out_string.strip()





  def 		A						(	self   :			Tuple							,      _a   :			Any							,      _a   :			Tuple=None				)			->					List[int]:





       '''simple docstring'''






       if token_ids_a is None:
            return token_ids_a + [self.eos_token_id]
       # We don't expect to process pairs, but leave the pair logic for API consistency
       return token_ids_a + token_ids_a + [self.eos_token_id]





  def 		A						(	self   :			str				)			->					str:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=self.spm_source
       _SCREAMING_SNAKE_CASE												=self.encoder





  def 		A						(	self   :			int				)			->					List[Any]:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=self.spm_target
       if self.separate_vocabs:
            _SCREAMING_SNAKE_CASE												=self.target_encoder





  @property
  def 		A						(	self   :			str				)			->					int:





       '''simple docstring'''






       return len(self.encoder				)





  def 		A						(	self   :			Any							,      _a   :			str							,      _a   :			List[Any] = None				)			->					Tuple[str]:





       '''simple docstring'''






       if not os.path.isdir(_a				):
            logger.error(f"Vocabulary path ({save_directory}) should be a directory"				)
            return
       _SCREAMING_SNAKE_CASE												=[]

       if self.separate_vocabs:
            _SCREAMING_SNAKE_CASE												=os.path.join(
                _a							,      (filename_prefix + '-' if filename_prefix else '') + VOCAB_FILES_NAMES['vocab']							,      )
            _SCREAMING_SNAKE_CASE												=os.path.join(
                _a							,      (filename_prefix + '-' if filename_prefix else '') + VOCAB_FILES_NAMES['target_vocab_file']							,      )
            save_json(self.encoder							,      _a				)
            save_json(self.target_encoder							,      _a				)
            saved_files.append(_a				)
            saved_files.append(_a				)
       else:
            _SCREAMING_SNAKE_CASE												=os.path.join(
                _a							,      (filename_prefix + '-' if filename_prefix else '') + VOCAB_FILES_NAMES['vocab']				)
            save_json(self.encoder							,      _a				)
            saved_files.append(_a				)

       for spm_save_filename, spm_orig_path, spm_model in zip(
           [VOCAB_FILES_NAMES['source_spm'], VOCAB_FILES_NAMES['target_spm']]							,      self.spm_files							,      [self.spm_source, self.spm_target]							,      ):
            _SCREAMING_SNAKE_CASE												=os.path.join(
                _a							,      (filename_prefix + '-' if filename_prefix else '') + spm_save_filename				)
            if os.path.abspath(_a				) != os.path.abspath(_a				) and os.path.isfile(_a				):
                 copyfile(_a							,      _a				)
                 saved_files.append(_a				)
            elif not os.path.isfile(_a				):
                 with open(_a							,      'wb'				) as fi:
                      _SCREAMING_SNAKE_CASE												=spm_model.serialized_model_proto()
                      fi.write(_a				)
                 saved_files.append(_a				)

       return tuple(_a				)





  def 		A						(	self   :			Optional[Any]				)			->					Dict:





       '''simple docstring'''






       return self.get_src_vocab()





  def 		A						(	self   :			Optional[Any]				)			->					List[Any]:





       '''simple docstring'''






       return dict(self.encoder							,      **self.added_tokens_encoder				)





  def 		A						(	self   :			Optional[Any]				)			->					List[Any]:





       '''simple docstring'''






       return dict(self.target_encoder							,      **self.added_tokens_decoder				)





  def __getstate__(	self   :			int				)			->					Dict:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=self.__dict__.copy()
       state.update(
           {k: None for k in ['spm_source', 'spm_target', 'current_spm', 'punc_normalizer', 'target_vocab_file']}				)
       return state





  def __setstate__(	self   :			Union[str, Any]							,      _a   :			int				)			->					None:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=d

       # for backward compatibility
       if not hasattr(self							,      'sp_model_kwargs'				):
            _SCREAMING_SNAKE_CASE												={}

       _SCREAMING_SNAKE_CASE												=(load_spm(_a							,      self.sp_model_kwargs				) for f in self.spm_files)
       _SCREAMING_SNAKE_CASE												=self.spm_source
       self._setup_normalizer()





  def 		A						(	self   :			Optional[Any]							,      *_a   :			List[str]							,      **_a   :			Optional[Any]				)			->					Optional[int]:





       '''simple docstring'''






       return 1





  def 		A						(	self   :			List[str]							,      _a   :			Union[str, Any]				)			->					Dict:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=set(self.all_special_ids				)  # call it once instead of inside list comp
       all_special_ids.remove(self.unk_token_id				)  # <unk> is only sometimes special
       return [1 if x in all_special_ids else 0 for x in seq]





  def 		A						(	self   :			str							,      _a   :			Optional[int]							,      _a   :			int = None							,      _a   :			Any = False				)			->					List[int]:





       '''simple docstring'''






       if already_has_special_tokens:
            return self._special_token_mask(_a				)
       elif token_ids_a is None:
            return self._special_token_mask(_a				) + [1]
       else:
            return self._special_token_mask(token_ids_a + token_ids_a				) + [1]


def  _lowerCAmelCase      (		_UpperCamelCase		:  str							,				_UpperCamelCase		:  Dict[str, Any]       )   ->    sentencepiece.SentencePieceProcessor:
     """simple docstring"""




     _SCREAMING_SNAKE_CASE												=sentencepiece.SentencePieceProcessor(**_UpperCamelCase       )
     spm.Load(_UpperCamelCase       )
     return spm


def  _lowerCAmelCase      (		_UpperCamelCase		:  Optional[Any]							,				_UpperCamelCase		:  str       )   ->    None:
     """simple docstring"""




     with open(_UpperCamelCase							,				'w'       ) as f:
          json.dump(_UpperCamelCase							,				_UpperCamelCase							,				indent=2       )







def  _lowerCAmelCase      (		_UpperCamelCase		:  str       )   ->    Union[Dict, List]:
     """simple docstring"""




     with open(_UpperCamelCase							,				'r'       ) as f:
          return json.load(_UpperCamelCase       )




'''simple docstring'''
import unittest

import requests

from transformers import MODEL_FOR_VISION_2_SEQ_MAPPING, TF_MODEL_FOR_VISION_2_SEQ_MAPPING, is_vision_available
from transformers.pipelines import pipeline
from transformers.testing_utils import (
    is_pipeline_test,
    is_torch_available,
    require_tf,
    require_torch,
    require_vision,
    slow,
)

from .test_pipelines_common import ANY


if is_torch_available():
     from transformers.pytorch_utils import is_torch_greater_or_equal_than_1_11
else:
     lowerCamelCase				:   Optional[Any]      				=  False


if is_vision_available():
     from PIL import Image
else:







     class 							A__					:





       @staticmethod
       def 		A						(	*_a   :			Any							,      **_a   :			str				)			->					Optional[int]:





            '''simple docstring'''






            pass







@is_pipeline_test
@require_vision
class 							A__					( unittest.TestCase						):
  A__					=       MODEL_FOR_VISION_2_SEQ_MAPPING
  A__					=       TF_MODEL_FOR_VISION_2_SEQ_MAPPING





  def 		A						(	self   :			List[str]							,      _a   :			List[Any]							,      _a   :			Any							,      _a   :			Dict				)			->					Any:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=pipeline('image-to-text'							,      model=_a							,      tokenizer=_a							,      image_processor=_a				)
       _SCREAMING_SNAKE_CASE												=[
           Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png'				),
           './tests/fixtures/tests_samples/COCO/000000039769.png',
       ]
       return pipe, examples





  def 		A						(	self   :			str							,      _a   :			int							,      _a   :			Tuple				)			->					Optional[int]:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=pipe(_a				)
       self.assertEqual(
           _a							,      [
               [{'generated_text': ANY(_a				)}],
               [{'generated_text': ANY(_a				)}],
           ]							,      )





  @require_tf
  def 		A						(	self   :			Any				)			->					Optional[int]:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=pipeline('image-to-text'							,      model='hf-internal-testing/tiny-random-vit-gpt2'							,      framework='tf'				)
       _SCREAMING_SNAKE_CASE												='./tests/fixtures/tests_samples/COCO/000000039769.png'

       _SCREAMING_SNAKE_CASE												=pipe(_a				)
       self.assertEqual(
           _a							,      [
               {
                   'generated_text': 'growthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthGOGO'
               },
           ]							,      )

       _SCREAMING_SNAKE_CASE												=pipe([image, image]				)
       self.assertEqual(
           _a							,      [
               [
                   {
                       'generated_text': 'growthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthGOGO'
                   }
               ],
               [
                   {
                       'generated_text': 'growthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthGOGO'
                   }
               ],
           ]							,      )

       _SCREAMING_SNAKE_CASE												=pipe(_a							,      max_new_tokens=1				)
       self.assertEqual(
           _a							,      [{'generated_text': 'growth'}]							,      )





  @require_torch
  def 		A						(	self   :			List[str]				)			->					Tuple:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=pipeline('image-to-text'							,      model='hf-internal-testing/tiny-random-vit-gpt2'				)
       _SCREAMING_SNAKE_CASE												='./tests/fixtures/tests_samples/COCO/000000039769.png'

       _SCREAMING_SNAKE_CASE												=pipe(_a				)
       self.assertEqual(
           _a							,      [
               {
                   'generated_text': 'growthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthGOGO'
               },
           ]							,      )

       _SCREAMING_SNAKE_CASE												=pipe([image, image]				)
       self.assertEqual(
           _a							,      [
               [
                   {
                       'generated_text': 'growthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthGOGO'
                   }
               ],
               [
                   {
                       'generated_text': 'growthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthgrowthGOGO'
                   }
               ],
           ]							,      )





  @require_torch
  def 		A						(	self   :			Union[str, Any]				)			->					Tuple:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=pipeline('image-to-text'							,      model='hf-internal-testing/tiny-random-BlipForConditionalGeneration'				)
       _SCREAMING_SNAKE_CASE												='./tests/fixtures/tests_samples/COCO/000000039769.png'
       _SCREAMING_SNAKE_CASE												='a photo of'

       _SCREAMING_SNAKE_CASE												=pipe(_a							,      prompt=_a				)
       self.assertTrue(outputs[0]['generated_text'].startswith(_a				)				)





  @slow
  @require_torch
  def 		A						(	self   :			Any				)			->					List[str]:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=pipeline('image-to-text'							,      model='ydshieh/vit-gpt2-coco-en'				)
       _SCREAMING_SNAKE_CASE												='./tests/fixtures/tests_samples/COCO/000000039769.png'

       _SCREAMING_SNAKE_CASE												=pipe(_a				)
       self.assertEqual(_a							,      [{'generated_text': 'a cat laying on a blanket next to a cat laying on a bed '}]				)

       _SCREAMING_SNAKE_CASE												=pipe([image, image]				)
       self.assertEqual(
           _a							,      [
               [{'generated_text': 'a cat laying on a blanket next to a cat laying on a bed '}],
               [{'generated_text': 'a cat laying on a blanket next to a cat laying on a bed '}],
           ]							,      )





  @slow
  @require_torch
  def 		A						(	self   :			List[Any]				)			->					List[Any]:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=pipeline('image-to-text'							,      model='Salesforce/blip-image-captioning-base'				)
       _SCREAMING_SNAKE_CASE												='https://huggingface.co/datasets/sayakpaul/sample-datasets/resolve/main/pokemon.png'
       _SCREAMING_SNAKE_CASE												=Image.open(requests.get(_a							,      stream=_a				).raw				)

       _SCREAMING_SNAKE_CASE												=pipe(_a				)
       self.assertEqual(_a							,      [{'generated_text': 'a pink pokemon pokemon with a blue shirt and a blue shirt'}]				)





  @slow
  @require_torch
  def 		A						(	self   :			str				)			->					int:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=pipeline('image-to-text'							,      model='microsoft/git-base-coco'				)
       _SCREAMING_SNAKE_CASE												='https://huggingface.co/datasets/sayakpaul/sample-datasets/resolve/main/pokemon.png'
       _SCREAMING_SNAKE_CASE												=Image.open(requests.get(_a							,      stream=_a				).raw				)

       _SCREAMING_SNAKE_CASE												=pipe(_a				)
       self.assertEqual(_a							,      [{'generated_text': 'a cartoon of a purple character.'}]				)





  @slow
  @require_torch
  def 		A						(	self   :			Any				)			->					Dict:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=pipeline('image-to-text'							,      model='Salesforce/blip-image-captioning-base'				)
       _SCREAMING_SNAKE_CASE												='https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/ai2d-demo.jpg'
       _SCREAMING_SNAKE_CASE												=Image.open(requests.get(_a							,      stream=_a				).raw				)

       _SCREAMING_SNAKE_CASE												='a photography of'

       _SCREAMING_SNAKE_CASE												=pipe(_a							,      prompt=_a				)
       self.assertEqual(_a							,      [{'generated_text': 'a photography of a volcano'}]				)

       with self.assertRaises(_a				):
            _SCREAMING_SNAKE_CASE												=pipe([image, image]							,      prompt=[prompt, prompt]				)





  @slow
  @require_torch
  def 		A						(	self   :			str				)			->					Dict:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=pipeline('image-to-text'							,      model='microsoft/git-base-coco'				)
       _SCREAMING_SNAKE_CASE												='https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/ai2d-demo.jpg'
       _SCREAMING_SNAKE_CASE												=Image.open(requests.get(_a							,      stream=_a				).raw				)

       _SCREAMING_SNAKE_CASE												='a photo of a'

       _SCREAMING_SNAKE_CASE												=pipe(_a							,      prompt=_a				)
       self.assertEqual(_a							,      [{'generated_text': 'a photo of a tent with a tent and a tent in the background.'}]				)

       with self.assertRaises(_a				):
            _SCREAMING_SNAKE_CASE												=pipe([image, image]							,      prompt=[prompt, prompt]				)





  @unittest.skipIf(
      not is_torch_greater_or_equal_than_1_11							,      reason='`Pix2StructImageProcessor` requires `torch>=1.11.0`.'				)
  @slow
  @require_torch
  def 		A						(	self   :			List[Any]				)			->					Union[str, Any]:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=pipeline('image-to-text'							,      model='google/pix2struct-ai2d-base'				)
       _SCREAMING_SNAKE_CASE												='https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/ai2d-demo.jpg'
       _SCREAMING_SNAKE_CASE												=Image.open(requests.get(_a							,      stream=_a				).raw				)

       _SCREAMING_SNAKE_CASE												='What does the label 15 represent? (1) lava (2) core (3) tunnel (4) ash cloud'

       _SCREAMING_SNAKE_CASE												=pipe(_a							,      prompt=_a				)
       self.assertEqual(_a							,      [{'generated_text': 'ash cloud'}]				)

       with self.assertRaises(_a				):
            _SCREAMING_SNAKE_CASE												=pipe([image, image]							,      prompt=[prompt, prompt]				)





  @slow
  @require_tf
  def 		A						(	self   :			List[str]				)			->					Tuple:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE												=pipeline('image-to-text'							,      model='ydshieh/vit-gpt2-coco-en'							,      framework='tf'				)
       _SCREAMING_SNAKE_CASE												='./tests/fixtures/tests_samples/COCO/000000039769.png'

       _SCREAMING_SNAKE_CASE												=pipe(_a				)
       self.assertEqual(_a							,      [{'generated_text': 'a cat laying on a blanket next to a cat laying on a bed '}]				)

       _SCREAMING_SNAKE_CASE												=pipe([image, image]				)
       self.assertEqual(
           _a							,      [
               [{'generated_text': 'a cat laying on a blanket next to a cat laying on a bed '}],
               [{'generated_text': 'a cat laying on a blanket next to a cat laying on a bed '}],
           ]							,      )
