import tempfile
import unittest

from transformers import SPIECE_UNDERLINE, BatchEncoding, PLBartTokenizer, is_torch_available
from transformers.testing_utils import (
    get_tests_dir,
    nested_simplify,
    require_sentencepiece,
    require_tokenizers,
    require_torch,
)

from ...test_tokenization_common import TokenizerTesterMixin


lowerCAmelCase__     						=			get_tests_dir('fixtures/test_sentencepiece.model')


if is_torch_available():
    from transformers.models.plbart.modeling_plbart import shift_tokens_right

lowerCAmelCase__     						=			50003
lowerCAmelCase__     						=			50002
@require_sentencepiece
@require_tokenizers
class     a_			(						SCREAMING_SNAKE_CASE	,					unittest.TestCase						):






 '''simple docstring'''






 UpperCAmelCase_     			= PLBartTokenizer
 UpperCAmelCase_     			= None
 UpperCAmelCase_     			= False




 def 		__snake_case						(      self :  Union[str, Any]):







        '''simple docstring'''



        super().setUp()

        # We have a SentencePiece fixture for testing
        lowerCAmelCase__					     = PLBartTokenizer(lowercase__      ,   language_codes='base'      ,   keep_accents=lowercase__)
        tokenizer.save_pretrained(self.tmpdirname)




 def 		__snake_case						(      self :  Dict):







        '''simple docstring'''



        lowerCAmelCase__					     = PLBartTokenizer(lowercase__      ,   language_codes='base'      ,   keep_accents=lowercase__)

        lowerCAmelCase__					     = tokenizer.tokenize('This is a test')
        self.assertListEqual(lowercase__      ,   ['▁This', '▁is', '▁a', '▁t', 'est'])

        self.assertListEqual(
            tokenizer.convert_tokens_to_ids(lowercase__)      ,   [value + tokenizer.fairseq_offset for value in [285, 46, 10, 170, 382]]      ,   )

        lowerCAmelCase__					     = tokenizer.tokenize('I was born in 92000, and this is falsé.')
        self.assertListEqual(
            lowercase__      ,   [
                SPIECE_UNDERLINE + 'I',
                SPIECE_UNDERLINE + 'was',
                SPIECE_UNDERLINE + 'b',
                'or',
                'n',
                SPIECE_UNDERLINE + 'in',
                SPIECE_UNDERLINE + '',
                '9',
                '2',
                '0',
                '0',
                '0',
                ',',
                SPIECE_UNDERLINE + 'and',
                SPIECE_UNDERLINE + 'this',
                SPIECE_UNDERLINE + 'is',
                SPIECE_UNDERLINE + 'f',
                'al',
                's',
                'é',
                '.',
            ]      ,   )
        lowerCAmelCase__					     = tokenizer.convert_tokens_to_ids(lowercase__)
        self.assertListEqual(
            lowercase__      ,   [
                value + tokenizer.fairseq_offset
                for value in [8, 21, 84, 55, 24, 19, 7, 2, 602, 347, 347, 347, 3, 12, 66, 46, 72, 80, 6, 2, 4]
            ]      ,   )

        lowerCAmelCase__					     = tokenizer.convert_ids_to_tokens(lowercase__)
        self.assertListEqual(
            lowercase__      ,   [
                SPIECE_UNDERLINE + 'I',
                SPIECE_UNDERLINE + 'was',
                SPIECE_UNDERLINE + 'b',
                'or',
                'n',
                SPIECE_UNDERLINE + 'in',
                SPIECE_UNDERLINE + '',
                '<unk>',
                '2',
                '0',
                '0',
                '0',
                ',',
                SPIECE_UNDERLINE + 'and',
                SPIECE_UNDERLINE + 'this',
                SPIECE_UNDERLINE + 'is',
                SPIECE_UNDERLINE + 'f',
                'al',
                's',
                '<unk>',
                '.',
            ]      ,   )

        lowerCAmelCase__					     = tokenizer.vocab_size
        lowerCAmelCase__					     = [tokenizer.convert_ids_to_tokens(lowercase__) for x in range(end - 4      ,   lowercase__)]

        self.assertListEqual(lowercase__      ,   ['__java__', '__python__', '__en_XX__', '<mask>'])

        lowerCAmelCase__					     = 'java.lang.Exception, python.lang.Exception, javascript, php, ruby, go'
        lowerCAmelCase__					     = tokenizer(lowercase__).input_ids
        self.assertEqual(
            tokenizer.decode(lowercase__      ,   skip_special_tokens=lowercase__      ,   clean_up_tokenization_spaces=lowercase__)      ,   lowercase__      ,   )




 def 		__snake_case						(      self :  Union[str, Any]):







        '''simple docstring'''



        lowerCAmelCase__					     = PLBartTokenizer(lowercase__      ,   language_codes='multi'      ,   keep_accents=lowercase__)

        lowerCAmelCase__					     = tokenizer.tokenize('This is a test')
        self.assertListEqual(lowercase__      ,   ['▁This', '▁is', '▁a', '▁t', 'est'])

        self.assertListEqual(
            tokenizer.convert_tokens_to_ids(lowercase__)      ,   [value + tokenizer.fairseq_offset for value in [285, 46, 10, 170, 382]]      ,   )

        lowerCAmelCase__					     = tokenizer.tokenize('I was born in 92000, and this is falsé.')
        self.assertListEqual(
            lowercase__      ,   [
                SPIECE_UNDERLINE + 'I',
                SPIECE_UNDERLINE + 'was',
                SPIECE_UNDERLINE + 'b',
                'or',
                'n',
                SPIECE_UNDERLINE + 'in',
                SPIECE_UNDERLINE + '',
                '9',
                '2',
                '0',
                '0',
                '0',
                ',',
                SPIECE_UNDERLINE + 'and',
                SPIECE_UNDERLINE + 'this',
                SPIECE_UNDERLINE + 'is',
                SPIECE_UNDERLINE + 'f',
                'al',
                's',
                'é',
                '.',
            ]      ,   )
        lowerCAmelCase__					     = tokenizer.convert_tokens_to_ids(lowercase__)
        self.assertListEqual(
            lowercase__      ,   [
                value + tokenizer.fairseq_offset
                for value in [8, 21, 84, 55, 24, 19, 7, 2, 602, 347, 347, 347, 3, 12, 66, 46, 72, 80, 6, 2, 4]
            ]      ,   )

        lowerCAmelCase__					     = tokenizer.convert_ids_to_tokens(lowercase__)
        self.assertListEqual(
            lowercase__      ,   [
                SPIECE_UNDERLINE + 'I',
                SPIECE_UNDERLINE + 'was',
                SPIECE_UNDERLINE + 'b',
                'or',
                'n',
                SPIECE_UNDERLINE + 'in',
                SPIECE_UNDERLINE + '',
                '<unk>',
                '2',
                '0',
                '0',
                '0',
                ',',
                SPIECE_UNDERLINE + 'and',
                SPIECE_UNDERLINE + 'this',
                SPIECE_UNDERLINE + 'is',
                SPIECE_UNDERLINE + 'f',
                'al',
                's',
                '<unk>',
                '.',
            ]      ,   )
        lowerCAmelCase__					     = tokenizer.vocab_size
        lowerCAmelCase__					     = [tokenizer.convert_ids_to_tokens(lowercase__) for x in range(end - 7      ,   lowercase__)]

        self.assertListEqual(
            lowercase__      ,   ['__java__', '__python__', '__en_XX__', '__javascript__', '__php__', '__ruby__', '__go__'])
        lowerCAmelCase__					     = 'java.lang.Exception, python.lang.Exception, javascript, php, ruby, go'
        lowerCAmelCase__					     = tokenizer(lowercase__).input_ids
        self.assertEqual(
            tokenizer.decode(lowercase__      ,   skip_special_tokens=lowercase__      ,   clean_up_tokenization_spaces=lowercase__)      ,   lowercase__      ,   )






@require_torch
@require_sentencepiece
@require_tokenizers
class     a_			(						unittest.TestCase						):






 '''simple docstring'''






 UpperCAmelCase_     			= 'uclanlp/plbart-python-en_XX'
 UpperCAmelCase_     			= [
     'def maximum(a,b,c):NEW_LINE_INDENTreturn max([a,b,c])',
     'def sum(a,b,c):NEW_LINE_INDENTreturn sum([a,b,c])',
 ]
 UpperCAmelCase_     			= [
     'Returns the maximum value of a b c.',
     'Sums the values of a b c.',
 ]
 UpperCAmelCase_     			= [
     134,
     5_452,
     33_460,
     33_441,
     33_463,
     33_465,
     33_463,
     33_449,
     988,
     20,
     33_456,
     19,
     33_456,
     771,
     39,
     4_258,
     889,
     3_318,
     33_441,
     33_463,
     33_465,
     33_463,
     33_449,
     2_471,
     2,
     PYTHON_CODE,
 ]




 @classmethod
 def 		__snake_case						(      cls :  Any):







        '''simple docstring'''



        lowerCAmelCase__					     = PLBartTokenizer.from_pretrained(
            cls.checkpoint_name      ,   language_codes='base'      ,   src_lang='python'      ,   tgt_lang='en_XX')
        lowerCAmelCase__					     = 1
        return cls




 def 		__snake_case						(      self :  List[str]):







        '''simple docstring'''



        self.assertEqual(self.tokenizer.fairseq_tokens_to_ids['__java__']      ,   50_001)
        self.assertEqual(self.tokenizer.fairseq_tokens_to_ids['__python__']      ,   50_002)
        self.assertEqual(self.tokenizer.fairseq_tokens_to_ids['__en_XX__']      ,   50_003)




 def 		__snake_case						(      self :  List[str]):







        '''simple docstring'''



        lowerCAmelCase__					     = self.tokenizer.batch_encode_plus(self.src_text).input_ids[0]
        self.assertListEqual(self.expected_src_tokens      ,   lowercase__)




 def 		__snake_case						(      self :  Optional[Any]):







        '''simple docstring'''



        self.assertIn(lowercase__      ,   self.tokenizer.all_special_ids)
        lowerCAmelCase__					     = [EN_CODE, 9_037, 33_442, 57, 752, 153, 14, 56, 18, 9, 2]
        lowerCAmelCase__					     = self.tokenizer.decode(lowercase__      ,   skip_special_tokens=lowercase__)
        lowerCAmelCase__					     = self.tokenizer.decode(generated_ids[1:]      ,   skip_special_tokens=lowercase__)
        self.assertEqual(lowercase__      ,   lowercase__)
        self.assertNotIn(self.tokenizer.eos_token      ,   lowercase__)




 def 		__snake_case						(      self :  Tuple):







        '''simple docstring'''



        lowerCAmelCase__					     = ['def sum(a,b,c):NEW_LINE_INDENTreturn sum([a,b,c])' * 20]
        self.assertIsInstance(src_text[0]      ,   lowercase__)
        lowerCAmelCase__					     = 10
        lowerCAmelCase__					     = self.tokenizer(lowercase__      ,   max_length=lowercase__      ,   truncation=lowercase__).input_ids[0]
        self.assertEqual(ids[-2]      ,   2)
        self.assertEqual(ids[-1]      ,   lowercase__)
        self.assertEqual(len(lowercase__)      ,   lowercase__)




 def 		__snake_case						(      self :  Optional[int]):







        '''simple docstring'''



        self.assertListEqual(self.tokenizer.convert_tokens_to_ids(['<mask>', '__java__'])      ,   [50_004, 50_001])




 def 		__snake_case						(      self :  Tuple):







        '''simple docstring'''



        lowerCAmelCase__					     = tempfile.mkdtemp()
        lowerCAmelCase__					     = self.tokenizer.fairseq_tokens_to_ids
        self.tokenizer.save_pretrained(lowercase__)
        lowerCAmelCase__					     = PLBartTokenizer.from_pretrained(lowercase__)
        self.assertDictEqual(new_tok.fairseq_tokens_to_ids      ,   lowercase__)




 @require_torch
 def 		__snake_case						(      self :  Union[str, Any]):







        '''simple docstring'''



        lowerCAmelCase__					     = self.tokenizer(self.src_text      ,   text_target=self.tgt_text      ,   padding=lowercase__      ,   return_tensors='pt')
        lowerCAmelCase__					     = shift_tokens_right(batch['labels']      ,   self.tokenizer.pad_token_id)

        # fairseq batch: https://gist.github.com/sshleifer/cba08bc2109361a74ac3760a7e30e4f4
        self.assertEqual(batch.input_ids[1][-2:].tolist()      ,   [2, PYTHON_CODE])
        self.assertEqual(batch.decoder_input_ids[1][0]      ,   lowercase__)
        self.assertEqual(batch.decoder_input_ids[1][-1]      ,   2)
        self.assertEqual(batch.labels[1][-2:].tolist()      ,   [2, EN_CODE])




 @require_torch
 def 		__snake_case						(      self :  Optional[int]):







        '''simple docstring'''



        lowerCAmelCase__					     = self.tokenizer(
            self.src_text      ,   text_target=self.tgt_text      ,   padding=lowercase__      ,   truncation=lowercase__      ,   max_length=len(self.expected_src_tokens)      ,   return_tensors='pt'      ,   )
        lowerCAmelCase__					     = shift_tokens_right(batch['labels']      ,   self.tokenizer.pad_token_id)

        self.assertIsInstance(lowercase__      ,   lowercase__)

        self.assertEqual((2, 26)      ,   batch.input_ids.shape)
        self.assertEqual((2, 26)      ,   batch.attention_mask.shape)
        lowerCAmelCase__					     = batch.input_ids.tolist()[0]
        self.assertListEqual(self.expected_src_tokens      ,   lowercase__)
        self.assertEqual(2      ,   batch.decoder_input_ids[0, -1])  # EOS
        # Test that special tokens are reset
        self.assertEqual(self.tokenizer.prefix_tokens      ,   [])
        self.assertEqual(self.tokenizer.suffix_tokens      ,   [self.tokenizer.eos_token_id, PYTHON_CODE])




 def 		__snake_case						(      self :  Optional[int]):







        '''simple docstring'''



        lowerCAmelCase__					     = self.tokenizer(self.src_text      ,   padding=lowercase__      ,   truncation=lowercase__      ,   max_length=3      ,   return_tensors='pt')
        lowerCAmelCase__					     = self.tokenizer(
            text_target=self.tgt_text      ,   padding=lowercase__      ,   truncation=lowercase__      ,   max_length=10      ,   return_tensors='pt')
        lowerCAmelCase__					     = targets['input_ids']
        lowerCAmelCase__					     = shift_tokens_right(lowercase__      ,   self.tokenizer.pad_token_id)

        self.assertEqual(batch.input_ids.shape[1]      ,   3)
        self.assertEqual(batch.decoder_input_ids.shape[1]      ,   10)




 @require_torch
 def 		__snake_case						(      self :  str):







        '''simple docstring'''



        lowerCAmelCase__					     = self.tokenizer._build_translation_inputs(
            'A test'      ,   return_tensors='pt'      ,   src_lang='en_XX'      ,   tgt_lang='java')

        self.assertEqual(
            nested_simplify(lowercase__)      ,   {
                # A, test, EOS, en_XX
                'input_ids': [[150, 242, 2, 50_003]],
                'attention_mask': [[1, 1, 1, 1]],
                # java
                'forced_bos_token_id': 50_001,
            }      ,   )

from copy import deepcopy
from typing import Optional, Union

import numpy as np

from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding
from ...utils import TensorType, is_tf_available, is_torch_available


if is_torch_available():
    import torch

if is_tf_available():
    import tensorflow as tf
class     a_			(						SCREAMING_SNAKE_CASE						):






 '''simple docstring'''






 UpperCAmelCase_     			= ['image_processor']
 UpperCAmelCase_     			= 'SamImageProcessor'




 def __init__(      self :  Tuple      ,   lowercase__ :  Dict):







        '''simple docstring'''



        super().__init__(lowercase__)
        lowerCAmelCase__					     = self.image_processor
        lowerCAmelCase__					     = -10
        lowerCAmelCase__					     = self.image_processor.size['longest_edge']




 def __call__(      self :  List[Any]      ,   lowercase__ :  Optional[int]=None      ,   lowercase__ :  Any=None      ,   lowercase__ :  Tuple=None      ,   lowercase__ :  List[str]=None      ,   lowercase__ :  Optional[Union[str, TensorType]] = None      ,   **lowercase__ :  Dict      ,   ):







        '''simple docstring'''



        lowerCAmelCase__					     = self.image_processor(
            lowercase__      ,   return_tensors=lowercase__      ,   **lowercase__      ,   )

        # pop arguments that are not used in the foward but used nevertheless
        lowerCAmelCase__					     = encoding_image_processor['original_sizes']

        if hasattr(lowercase__      ,   'numpy'):  # Checks if Torch or TF tensor
               lowerCAmelCase__					     = original_sizes.numpy()

        lowerCAmelCase__     , lowerCAmelCase__     , lowerCAmelCase__					     = self._check_and_preprocess_points(
            input_points=lowercase__      ,   input_labels=lowercase__      ,   input_boxes=lowercase__      ,   )

        lowerCAmelCase__					     = self._normalize_and_convert(
            lowercase__      ,   lowercase__      ,   input_points=lowercase__      ,   input_labels=lowercase__      ,   input_boxes=lowercase__      ,   return_tensors=lowercase__      ,   )

        return encoding_image_processor




 def 		__snake_case						(      self :  Optional[Any]      ,   lowercase__ :  List[str]      ,   lowercase__ :  List[str]      ,   lowercase__ :  str=None      ,   lowercase__ :  Optional[int]=None      ,   lowercase__ :  str=None      ,   lowercase__ :  Optional[Any]="pt"      ,   ):







        '''simple docstring'''



        if input_points is not None:
               if len(lowercase__) != len(lowercase__):
                      lowerCAmelCase__					     = [
                          self._normalize_coordinates(self.target_size      ,   lowercase__      ,   original_sizes[0]) for point in input_points
                      ]
               else:
                      lowerCAmelCase__					     = [
                          self._normalize_coordinates(self.target_size      ,   lowercase__      ,   lowercase__)
                          for point, original_size in zip(lowercase__      ,   lowercase__)
                      ]
               # check that all arrays have the same shape
               if not all(point.shape == input_points[0].shape for point in input_points):
                      if input_labels is not None:
                             lowerCAmelCase__     , lowerCAmelCase__					     = self._pad_points_and_labels(lowercase__      ,   lowercase__)

               lowerCAmelCase__					     = np.array(lowercase__)

        if input_labels is not None:
               lowerCAmelCase__					     = np.array(lowercase__)

        if input_boxes is not None:
               if len(lowercase__) != len(lowercase__):
                      lowerCAmelCase__					     = [
                          self._normalize_coordinates(self.target_size      ,   lowercase__      ,   original_sizes[0]      ,   is_bounding_box=lowercase__)
                          for box in input_boxes
                      ]
               else:
                      lowerCAmelCase__					     = [
                          self._normalize_coordinates(self.target_size      ,   lowercase__      ,   lowercase__      ,   is_bounding_box=lowercase__)
                          for box, original_size in zip(lowercase__      ,   lowercase__)
                      ]
               lowerCAmelCase__					     = np.array(lowercase__)

        if input_boxes is not None:
               if return_tensors == "pt":
                      lowerCAmelCase__					     = torch.from_numpy(lowercase__)
                      # boxes batch size of 1 by default
                      lowerCAmelCase__					     = input_boxes.unsqueeze(1) if len(input_boxes.shape) != 3 else input_boxes
               elif return_tensors == "tf":
                      lowerCAmelCase__					     = tf.convert_to_tensor(lowercase__)
                      # boxes batch size of 1 by default
                      lowerCAmelCase__					     = tf.expand_dims(lowercase__      ,   1) if len(input_boxes.shape) != 3 else input_boxes
               encoding_image_processor.update({'input_boxes': input_boxes})
        if input_points is not None:
               if return_tensors == "pt":
                      lowerCAmelCase__					     = torch.from_numpy(lowercase__)
                      # point batch size of 1 by default
                      lowerCAmelCase__					     = input_points.unsqueeze(1) if len(input_points.shape) != 4 else input_points
               elif return_tensors == "tf":
                      lowerCAmelCase__					     = tf.convert_to_tensor(lowercase__)
                      # point batch size of 1 by default
                      lowerCAmelCase__					     = tf.expand_dims(lowercase__      ,   1) if len(input_points.shape) != 4 else input_points
               encoding_image_processor.update({'input_points': input_points})
        if input_labels is not None:
               if return_tensors == "pt":
                      lowerCAmelCase__					     = torch.from_numpy(lowercase__)
                      # point batch size of 1 by default
                      lowerCAmelCase__					     = input_labels.unsqueeze(1) if len(input_labels.shape) != 3 else input_labels
               elif return_tensors == "tf":
                      lowerCAmelCase__					     = tf.convert_to_tensor(lowercase__)
                      # point batch size of 1 by default
                      lowerCAmelCase__					     = tf.expand_dims(lowercase__      ,   1) if len(input_labels.shape) != 3 else input_labels
               encoding_image_processor.update({'input_labels': input_labels})

        return encoding_image_processor




 def 		__snake_case						(      self :  str      ,   lowercase__ :  Optional[int]      ,   lowercase__ :  Optional[Any]):







        '''simple docstring'''



        lowerCAmelCase__					     = max([point.shape[0] for point in input_points])
        lowerCAmelCase__					     = []
        for i, point in enumerate(lowercase__):
               if point.shape[0] != expected_nb_points:
                      lowerCAmelCase__					     = np.concatenate(
                          [point, np.zeros((expected_nb_points - point.shape[0], 2)) + self.point_pad_value]      ,   axis=0)
                      lowerCAmelCase__					     = np.append(input_labels[i]      ,   [self.point_pad_value])
               processed_input_points.append(lowercase__)
        lowerCAmelCase__					     = processed_input_points
        return input_points, input_labels




 def 		__snake_case						(      self :  Optional[Any]      ,   lowercase__ :  int      ,   lowercase__ :  np.ndarray      ,   lowercase__ :  int      ,   lowercase__ :  Optional[Any]=False):







        '''simple docstring'''



        lowerCAmelCase__     , lowerCAmelCase__					     = original_size
        lowerCAmelCase__     , lowerCAmelCase__					     = self.image_processor._get_preprocess_shape(lowercase__      ,   longest_edge=lowercase__)
        lowerCAmelCase__					     = deepcopy(lowercase__).astype(lowercase__)

        if is_bounding_box:
               lowerCAmelCase__					     = coords.reshape(-1      ,   2      ,   2)

        lowerCAmelCase__					     = coords[..., 0] * (new_w / old_w)
        lowerCAmelCase__					     = coords[..., 1] * (new_h / old_h)

        if is_bounding_box:
               lowerCAmelCase__					     = coords.reshape(-1      ,   4)

        return coords




 def 		__snake_case						(      self :  Dict      ,   lowercase__ :  Optional[Any]=None      ,   lowercase__ :  Tuple=None      ,   lowercase__ :  int=None      ,   ):







        '''simple docstring'''



        if input_points is not None:
               if hasattr(lowercase__      ,   'numpy'):  # Checks for TF or Torch tensor
                      lowerCAmelCase__					     = input_points.numpy().tolist()

               if not isinstance(lowercase__      ,   lowercase__) or not isinstance(input_points[0]      ,   lowercase__):
                      raise ValueError('Input points must be a list of list of floating points.')
               lowerCAmelCase__					     = [np.array(lowercase__) for input_point in input_points]
        else:
               lowerCAmelCase__					     = None

        if input_labels is not None:
               if hasattr(lowercase__      ,   'numpy'):
                      lowerCAmelCase__					     = input_labels.numpy().tolist()

               if not isinstance(lowercase__      ,   lowercase__) or not isinstance(input_labels[0]      ,   lowercase__):
                      raise ValueError('Input labels must be a list of list integers.')
               lowerCAmelCase__					     = [np.array(lowercase__) for label in input_labels]
        else:
               lowerCAmelCase__					     = None

        if input_boxes is not None:
               if hasattr(lowercase__      ,   'numpy'):
                      lowerCAmelCase__					     = input_boxes.numpy().tolist()

               if (
                   not isinstance(lowercase__      ,   lowercase__)
                   or not isinstance(input_boxes[0]      ,   lowercase__)
                   or not isinstance(input_boxes[0][0]      ,   lowercase__)
               ):
                      raise ValueError('Input boxes must be a list of list of list of floating points.')
               lowerCAmelCase__					     = [np.array(lowercase__).astype(np.floataa) for box in input_boxes]
        else:
               lowerCAmelCase__					     = None

        return input_points, input_labels, input_boxes




 @property
 def 		__snake_case						(      self :  List[Any]):







        '''simple docstring'''



        lowerCAmelCase__					     = self.image_processor.model_input_names
        return list(dict.fromkeys(lowercase__))




 def 		__snake_case						(      self :  int      ,   *lowercase__ :  int      ,   **lowercase__ :  int):







        '''simple docstring'''



        return self.image_processor.post_process_masks(*lowercase__      ,   **lowercase__)
