





import json
import pathlib
import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision, slow
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
       import torch

if is_vision_available():
       from PIL import Image

       from transformers import DeformableDetrImageProcessor







class       __A							(   unittest.TestCase	):




      """simple docstring"""







      def __init__(		self   ,				a__   ,				a__=7   ,				a__=3   ,				a__=30   ,				a__=400   ,				a__=True   ,				a__=None   ,				a__=True   ,				a__=[0.5, 0.5, 0.5]   ,				a__=[0.5, 0.5, 0.5]   ,				a__=True   ,				a__=1 / 255   ,				a__=True   ,				):



             """simple docstring"""





             _lowerCamelCase				:  Dict						=		size if size is not None else {'''shortest_edge''': 18, '''longest_edge''': 1333}
             _lowerCamelCase				:  Tuple						=		parent
             _lowerCamelCase				:  Dict						=		batch_size
             _lowerCamelCase				:  Optional[Any]						=		num_channels
             _lowerCamelCase				:  Any						=		min_resolution
             _lowerCamelCase				:  Union[str, Any]						=		max_resolution
             _lowerCamelCase				:  Union[str, Any]						=		do_resize
             _lowerCamelCase				:  Dict						=		size
             _lowerCamelCase				:  Optional[Any]						=		do_normalize
             _lowerCamelCase				:  str						=		image_mean
             _lowerCamelCase				:  Union[str, Any]						=		image_std
             _lowerCamelCase				:  str						=		do_rescale
             _lowerCamelCase				:  Dict						=		rescale_factor
             _lowerCamelCase				:  Union[str, Any]						=		do_pad


      def 					__snake_case      (		self):



             """simple docstring"""





             return {
                 "do_resize": self.do_resize,
                 "size": self.size,
                 "do_normalize": self.do_normalize,
                 "image_mean": self.image_mean,
                 "image_std": self.image_std,
                 "do_rescale": self.do_rescale,
                 "rescale_factor": self.rescale_factor,
                 "do_pad": self.do_pad,
             }



      def 					__snake_case      (		self   ,				a__   ,				a__=False):



             """simple docstring"""





             if not batched:
                    _lowerCamelCase				:  Optional[Any]						=		image_inputs[0]
                    if isinstance(a__   ,				Image.Image):
                           _lowerCamelCase,	_lowerCamelCase				:  Dict						=		image.size
                    else:
                           _lowerCamelCase,	_lowerCamelCase				:  Optional[int]						=		image.shape[1], image.shape[2]
                    if w < h:
                           _lowerCamelCase				:  Union[str, Any]						=		int(self.size['''shortest_edge'''] * h / w)
                           _lowerCamelCase				:  str						=		self.size['''shortest_edge''']
                    elif w > h:
                           _lowerCamelCase				:  Tuple						=		self.size['''shortest_edge''']
                           _lowerCamelCase				:  Dict						=		int(self.size['''shortest_edge'''] * w / h)
                    else:
                           _lowerCamelCase				:  List[Any]						=		self.size['''shortest_edge''']
                           _lowerCamelCase				:  Any						=		self.size['''shortest_edge''']

             else:
                    _lowerCamelCase				:  Dict						=		[]
                    for image in image_inputs:
                           _lowerCamelCase,	_lowerCamelCase				:  Tuple						=		self.get_expected_values([image])
                           expected_values.append((expected_height, expected_width))
                    _lowerCamelCase				:  Optional[Any]						=		max(a__   ,				key=lambda a__: item[0])[0]
                    _lowerCamelCase				:  str						=		max(a__   ,				key=lambda a__: item[1])[1]

             return expected_height, expected_width







@require_torch
@require_vision
class       __A							(   lowerCamelCase__			,unittest.TestCase	):




      """simple docstring"""







      UpperCAmelCase__							=   DeformableDetrImageProcessor if is_vision_available() else None


      def 					__snake_case      (		self):



             """simple docstring"""





             _lowerCamelCase				:  Union[str, Any]						=		DeformableDetrImageProcessingTester(self)


      @property
      def 					__snake_case      (		self):



             """simple docstring"""





             return self.image_processor_tester.prepare_image_processor_dict()


      def 					__snake_case      (		self):



             """simple docstring"""





             _lowerCamelCase				:  List[str]						=		self.image_processing_class(**self.image_processor_dict)
             self.assertTrue(hasattr(a__   ,				'''image_mean'''))
             self.assertTrue(hasattr(a__   ,				'''image_std'''))
             self.assertTrue(hasattr(a__   ,				'''do_normalize'''))
             self.assertTrue(hasattr(a__   ,				'''do_resize'''))
             self.assertTrue(hasattr(a__   ,				'''do_rescale'''))
             self.assertTrue(hasattr(a__   ,				'''do_pad'''))
             self.assertTrue(hasattr(a__   ,				'''size'''))


      def 					__snake_case      (		self):



             """simple docstring"""





             _lowerCamelCase				:  Any						=		self.image_processing_class.from_dict(self.image_processor_dict)
             self.assertEqual(image_processor.size   ,				{'''shortest_edge''': 18, '''longest_edge''': 1333})
             self.assertEqual(image_processor.do_pad   ,				a__)

             _lowerCamelCase				:  List[Any]						=		self.image_processing_class.from_dict(
                 self.image_processor_dict   ,				size=42   ,				max_size=84   ,				pad_and_return_pixel_mask=a__)
             self.assertEqual(image_processor.size   ,				{'''shortest_edge''': 42, '''longest_edge''': 84})
             self.assertEqual(image_processor.do_pad   ,				a__)


      def 					__snake_case      (		self):



             """simple docstring"""





             pass


      def 					__snake_case      (		self):



             """simple docstring"""





             _lowerCamelCase				:  List[str]						=		self.image_processing_class(**self.image_processor_dict)
             # create random PIL images
             _lowerCamelCase				:  Any						=		prepare_image_inputs(self.image_processor_tester   ,				equal_resolution=a__)
             for image in image_inputs:
                    self.assertIsInstance(a__   ,				Image.Image)

             # Test not batched input
             _lowerCamelCase				:  List[str]						=		image_processing(image_inputs[0]   ,				return_tensors='''pt''').pixel_values

             _lowerCamelCase,	_lowerCamelCase				:  int						=		self.image_processor_tester.get_expected_values(a__)

             self.assertEqual(
                 encoded_images.shape   ,				(1, self.image_processor_tester.num_channels, expected_height, expected_width)   ,				)

             # Test batched
             _lowerCamelCase,	_lowerCamelCase				:  Optional[int]						=		self.image_processor_tester.get_expected_values(a__   ,				batched=a__)

             _lowerCamelCase				:  Union[str, Any]						=		image_processing(a__   ,				return_tensors='''pt''').pixel_values
             self.assertEqual(
                 encoded_images.shape   ,				(
                     self.image_processor_tester.batch_size,
                     self.image_processor_tester.num_channels,
                     expected_height,
                     expected_width,
                 )   ,				)


      def 					__snake_case      (		self):



             """simple docstring"""





             _lowerCamelCase				:  List[Any]						=		self.image_processing_class(**self.image_processor_dict)
             # create random numpy tensors
             _lowerCamelCase				:  Optional[Any]						=		prepare_image_inputs(self.image_processor_tester   ,				equal_resolution=a__   ,				numpify=a__)
             for image in image_inputs:
                    self.assertIsInstance(a__   ,				np.ndarray)

             # Test not batched input
             _lowerCamelCase				:  List[Any]						=		image_processing(image_inputs[0]   ,				return_tensors='''pt''').pixel_values

             _lowerCamelCase,	_lowerCamelCase				:  List[str]						=		self.image_processor_tester.get_expected_values(a__)

             self.assertEqual(
                 encoded_images.shape   ,				(1, self.image_processor_tester.num_channels, expected_height, expected_width)   ,				)

             # Test batched
             _lowerCamelCase				:  List[Any]						=		image_processing(a__   ,				return_tensors='''pt''').pixel_values

             _lowerCamelCase,	_lowerCamelCase				:  int						=		self.image_processor_tester.get_expected_values(a__   ,				batched=a__)

             self.assertEqual(
                 encoded_images.shape   ,				(
                     self.image_processor_tester.batch_size,
                     self.image_processor_tester.num_channels,
                     expected_height,
                     expected_width,
                 )   ,				)


      def 					__snake_case      (		self):



             """simple docstring"""





             _lowerCamelCase				:  Dict						=		self.image_processing_class(**self.image_processor_dict)
             # create random PyTorch tensors
             _lowerCamelCase				:  List[str]						=		prepare_image_inputs(self.image_processor_tester   ,				equal_resolution=a__   ,				torchify=a__)
             for image in image_inputs:
                    self.assertIsInstance(a__   ,				torch.Tensor)

             # Test not batched input
             _lowerCamelCase				:  Tuple						=		image_processing(image_inputs[0]   ,				return_tensors='''pt''').pixel_values

             _lowerCamelCase,	_lowerCamelCase				:  Any						=		self.image_processor_tester.get_expected_values(a__)

             self.assertEqual(
                 encoded_images.shape   ,				(1, self.image_processor_tester.num_channels, expected_height, expected_width)   ,				)

             # Test batched
             _lowerCamelCase				:  Union[str, Any]						=		image_processing(a__   ,				return_tensors='''pt''').pixel_values

             _lowerCamelCase,	_lowerCamelCase				:  Optional[Any]						=		self.image_processor_tester.get_expected_values(a__   ,				batched=a__)

             self.assertEqual(
                 encoded_images.shape   ,				(
                     self.image_processor_tester.batch_size,
                     self.image_processor_tester.num_channels,
                     expected_height,
                     expected_width,
                 )   ,				)


      @slow
      def 					__snake_case      (		self):



             """simple docstring"""





             _lowerCamelCase				:  Optional[Any]						=		Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png''')
             with open('''./tests/fixtures/tests_samples/COCO/coco_annotations.txt'''   ,				'''r''') as f:
                    _lowerCamelCase				:  int						=		json.loads(f.read())

             _lowerCamelCase				:  Tuple						=		{'''image_id''': 3_9769, '''annotations''': target}

             # encode them
             _lowerCamelCase				:  List[Any]						=		DeformableDetrImageProcessor()
             _lowerCamelCase				:  Any						=		image_processing(images=a__   ,				annotations=a__   ,				return_tensors='''pt''')

             # verify pixel values
             _lowerCamelCase				:  Union[str, Any]						=		torch.Size([1, 3, 800, 1066])
             self.assertEqual(encoding['''pixel_values'''].shape   ,				a__)

             _lowerCamelCase				:  List[str]						=		torch.tensor([0.2796, 0.3138, 0.3481])
             self.assertTrue(torch.allclose(encoding['''pixel_values'''][0, 0, 0, :3]   ,				a__   ,				atol=1e-4))

             # verify area
             _lowerCamelCase				:  str						=		torch.tensor([5887.9600, 1_1250.2061, 48_9353.8438, 83_7122.7500, 14_7967.5156, 16_5732.3438])
             self.assertTrue(torch.allclose(encoding['''labels'''][0]['''area''']   ,				a__))
             # verify boxes
             _lowerCamelCase				:  Any						=		torch.Size([6, 4])
             self.assertEqual(encoding['''labels'''][0]['''boxes'''].shape   ,				a__)
             _lowerCamelCase				:  Dict						=		torch.tensor([0.5503, 0.2765, 0.0604, 0.2215])
             self.assertTrue(torch.allclose(encoding['''labels'''][0]['''boxes'''][0]   ,				a__   ,				atol=1e-3))
             # verify image_id
             _lowerCamelCase				:  Union[str, Any]						=		torch.tensor([3_9769])
             self.assertTrue(torch.allclose(encoding['''labels'''][0]['''image_id''']   ,				a__))
             # verify is_crowd
             _lowerCamelCase				:  str						=		torch.tensor([0, 0, 0, 0, 0, 0])
             self.assertTrue(torch.allclose(encoding['''labels'''][0]['''iscrowd''']   ,				a__))
             # verify class_labels
             _lowerCamelCase				:  List[str]						=		torch.tensor([75, 75, 63, 65, 17, 17])
             self.assertTrue(torch.allclose(encoding['''labels'''][0]['''class_labels''']   ,				a__))
             # verify orig_size
             _lowerCamelCase				:  Dict						=		torch.tensor([480, 640])
             self.assertTrue(torch.allclose(encoding['''labels'''][0]['''orig_size''']   ,				a__))
             # verify size
             _lowerCamelCase				:  List[str]						=		torch.tensor([800, 1066])
             self.assertTrue(torch.allclose(encoding['''labels'''][0]['''size''']   ,				a__))



      @slow
      def 					__snake_case      (		self):



             """simple docstring"""





             _lowerCamelCase				:  int						=		Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png''')
             with open('''./tests/fixtures/tests_samples/COCO/coco_panoptic_annotations.txt'''   ,				'''r''') as f:
                    _lowerCamelCase				:  Optional[int]						=		json.loads(f.read())

             _lowerCamelCase				:  Tuple						=		{'''file_name''': '''000000039769.png''', '''image_id''': 3_9769, '''segments_info''': target}

             _lowerCamelCase				:  Dict						=		pathlib.Path('''./tests/fixtures/tests_samples/COCO/coco_panoptic''')

             # encode them
             _lowerCamelCase				:  Dict						=		DeformableDetrImageProcessor(format='''coco_panoptic''')
             _lowerCamelCase				:  Optional[int]						=		image_processing(images=a__   ,				annotations=a__   ,				masks_path=a__   ,				return_tensors='''pt''')

             # verify pixel values
             _lowerCamelCase				:  Optional[Any]						=		torch.Size([1, 3, 800, 1066])
             self.assertEqual(encoding['''pixel_values'''].shape   ,				a__)

             _lowerCamelCase				:  Any						=		torch.tensor([0.2796, 0.3138, 0.3481])
             self.assertTrue(torch.allclose(encoding['''pixel_values'''][0, 0, 0, :3]   ,				a__   ,				atol=1e-4))

             # verify area
             _lowerCamelCase				:  Optional[int]						=		torch.tensor([14_7979.6875, 16_5527.0469, 48_4638.5938, 1_1292.9375, 5879.6562, 7634.1147])
             self.assertTrue(torch.allclose(encoding['''labels'''][0]['''area''']   ,				a__))
             # verify boxes
             _lowerCamelCase				:  Optional[int]						=		torch.Size([6, 4])
             self.assertEqual(encoding['''labels'''][0]['''boxes'''].shape   ,				a__)
             _lowerCamelCase				:  Tuple						=		torch.tensor([0.2625, 0.5437, 0.4688, 0.8625])
             self.assertTrue(torch.allclose(encoding['''labels'''][0]['''boxes'''][0]   ,				a__   ,				atol=1e-3))
             # verify image_id
             _lowerCamelCase				:  Union[str, Any]						=		torch.tensor([3_9769])
             self.assertTrue(torch.allclose(encoding['''labels'''][0]['''image_id''']   ,				a__))
             # verify is_crowd
             _lowerCamelCase				:  Optional[Any]						=		torch.tensor([0, 0, 0, 0, 0, 0])
             self.assertTrue(torch.allclose(encoding['''labels'''][0]['''iscrowd''']   ,				a__))
             # verify class_labels
             _lowerCamelCase				:  Dict						=		torch.tensor([17, 17, 63, 75, 75, 93])
             self.assertTrue(torch.allclose(encoding['''labels'''][0]['''class_labels''']   ,				a__))
             # verify masks
             _lowerCamelCase				:  Union[str, Any]						=		82_2873
             self.assertEqual(encoding['''labels'''][0]['''masks'''].sum().item()   ,				a__)
             # verify orig_size
             _lowerCamelCase				:  List[Any]						=		torch.tensor([480, 640])
             self.assertTrue(torch.allclose(encoding['''labels'''][0]['''orig_size''']   ,				a__))
             # verify size
             _lowerCamelCase				:  Dict						=		torch.tensor([800, 1066])
             self.assertTrue(torch.allclose(encoding['''labels'''][0]['''size''']   ,				a__))








import json
import os
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      							=   logging.get_logger(__name__)

_lowerCamelCase      							=   '▁'

_lowerCamelCase      							=   {
    'vocab_file': 'vocab.json',
    'spm_file': 'sentencepiece.bpe.model',
}

_lowerCamelCase      							=   {
    'vocab_file': {
        'facebook/s2t-small-librispeech-asr': (
            'https://huggingface.co/facebook/s2t-small-librispeech-asr/resolve/main/vocab.json'
        ),
    },
    'spm_file': {
        'facebook/s2t-small-librispeech-asr': (
            'https://huggingface.co/facebook/s2t-small-librispeech-asr/resolve/main/sentencepiece.bpe.model'
        )
    },
}

_lowerCamelCase      							=   {
    'facebook/s2t-small-librispeech-asr': 1024,
}

_lowerCamelCase      							=   ['pt', 'fr', 'ru', 'nl', 'ro', 'it', 'es', 'de']

_lowerCamelCase      							=   {'mustc': MUSTC_LANGS}







class       __A							(   lowerCamelCase__	):




      """simple docstring"""







      UpperCAmelCase__							=   VOCAB_FILES_NAMES
      UpperCAmelCase__							=   PRETRAINED_VOCAB_FILES_MAP
      UpperCAmelCase__							=   MAX_MODEL_INPUT_SIZES
      UpperCAmelCase__							=   ["""input_ids""", """attention_mask"""]

      UpperCAmelCase__							=   []


      def __init__(		self   ,				a__   ,				a__   ,				a__="<s>"   ,				a__="</s>"   ,				a__="<pad>"   ,				a__="<unk>"   ,				a__=False   ,				a__=False   ,				a__=None   ,				a__=None   ,				a__ = None   ,				**a__   ,				):



             """simple docstring"""





             _lowerCamelCase				:  str						=		{} if sp_model_kwargs is None else sp_model_kwargs

             super().__init__(
                 bos_token=a__   ,				eos_token=a__   ,				unk_token=a__   ,				pad_token=a__   ,				do_upper_case=a__   ,				do_lower_case=a__   ,				tgt_lang=a__   ,				lang_codes=a__   ,				sp_model_kwargs=self.sp_model_kwargs   ,				**a__   ,				)
             _lowerCamelCase				:  Optional[int]						=		do_upper_case
             _lowerCamelCase				:  Optional[Any]						=		do_lower_case

             _lowerCamelCase				:  Tuple						=		load_json(a__)
             _lowerCamelCase				:  Union[str, Any]						=		{v: k for k, v in self.encoder.items()}
             _lowerCamelCase				:  Tuple						=		spm_file
             _lowerCamelCase				:  Any						=		load_spm(a__   ,				self.sp_model_kwargs)

             if lang_codes is not None:
                    _lowerCamelCase				:  List[Any]						=		lang_codes
                    _lowerCamelCase				:  List[str]						=		LANGUAGES[lang_codes]
                    _lowerCamelCase				:  Any						=		[F"""<lang:{lang}>""" for lang in self.langs]
                    _lowerCamelCase				:  Optional[Any]						=		{lang: self.sp_model.PieceToId(F"""<lang:{lang}>""") for lang in self.langs}

                    _lowerCamelCase				:  List[str]						=		self.lang_tokens
                    _lowerCamelCase				:  str						=		tgt_lang if tgt_lang is not None else self.langs[0]

                    self.set_tgt_lang_special_tokens(self._tgt_lang)
             else:
                    _lowerCamelCase				:  Any						=		{}


      @property
      def 					__snake_case      (		self):



             """simple docstring"""





             return len(self.encoder)


      @property
      def 					__snake_case      (		self):



             """simple docstring"""





             return self._tgt_lang


      @tgt_lang.setter
      def 					__snake_case      (		self   ,				a__):



             """simple docstring"""





             _lowerCamelCase				:  Any						=		new_tgt_lang
             self.set_tgt_lang_special_tokens(a__)


      def 					__snake_case      (		self   ,				a__):



             """simple docstring"""





             _lowerCamelCase				:  Optional[Any]						=		self.lang_code_to_id[tgt_lang]
             _lowerCamelCase				:  Any						=		[lang_code_id]


      def 					__snake_case      (		self   ,				a__):



             """simple docstring"""





             return self.sp_model.encode(a__   ,				out_type=a__)


      def 					__snake_case      (		self   ,				a__):



             """simple docstring"""





             return self.encoder.get(a__   ,				self.encoder[self.unk_token])


      def 					__snake_case      (		self   ,				a__):



             """simple docstring"""





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


      def 					__snake_case      (		self   ,				a__):



             """simple docstring"""





             _lowerCamelCase				:  Union[str, Any]						=		[]
             _lowerCamelCase				:  List[str]						=		''''''
             for token in tokens:
                    # make sure that special tokens are not decoded using sentencepiece model
                    if token in self.all_special_tokens:
                           _lowerCamelCase				:  List[Any]						=		self.sp_model.decode(a__)
                           out_string += (decoded.upper() if self.do_upper_case else decoded) + token + " "
                           _lowerCamelCase				:  Optional[int]						=		[]
                    else:
                           current_sub_tokens.append(a__)
             _lowerCamelCase				:  Tuple						=		self.sp_model.decode(a__)
             out_string += decoded.upper() if self.do_upper_case else decoded
             return out_string.strip()


      def 					__snake_case      (		self   ,				a__   ,				a__=None):



             """simple docstring"""





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


      def 					__snake_case      (		self   ,				a__   ,				a__ = None   ,				a__ = False):



             """simple docstring"""





             if already_has_special_tokens:
                    return super().get_special_tokens_mask(
                        token_ids_a=a__   ,				token_ids_a=a__   ,				already_has_special_tokens=a__)

             _lowerCamelCase				:  Tuple						=		[1] * len(self.prefix_tokens)
             _lowerCamelCase				:  Tuple						=		[1]
             if token_ids_a is None:
                    return prefix_ones + ([0] * len(a__)) + suffix_ones
             return prefix_ones + ([0] * len(a__)) + ([0] * len(a__)) + suffix_ones


      def 					__snake_case      (		self):



             """simple docstring"""





             _lowerCamelCase				:  Union[str, Any]						=		self.encoder.copy()
             vocab.update(self.added_tokens_encoder)
             return vocab


      def __getstate__(		self):



             """simple docstring"""





             _lowerCamelCase				:  Union[str, Any]						=		self.__dict__.copy()
             _lowerCamelCase				:  str						=		None
             return state


      def __setstate__(		self   ,				a__):



             """simple docstring"""





             _lowerCamelCase				:  Optional[int]						=		d

             # for backward compatibility
             if not hasattr(self   ,				'''sp_model_kwargs'''):
                    _lowerCamelCase				:  List[Any]						=		{}

             _lowerCamelCase				:  Dict						=		load_spm(self.spm_file   ,				self.sp_model_kwargs)



      def 					__snake_case      (		self   ,				a__   ,				a__ = None):



             """simple docstring"""





             _lowerCamelCase				:  str						=		Path(a__)
             assert save_dir.is_dir(), F"""{save_directory} should be a directory"""
             _lowerCamelCase				:  Any						=		save_dir / (
                 (filename_prefix + '''-''' if filename_prefix else '''''') + self.vocab_files_names['''vocab_file''']
             )
             _lowerCamelCase				:  Optional[Any]						=		save_dir / (
                 (filename_prefix + '''-''' if filename_prefix else '''''') + self.vocab_files_names['''spm_file''']
             )

             save_json(self.encoder   ,				a__)

             if os.path.abspath(self.spm_file) != os.path.abspath(a__) and os.path.isfile(self.spm_file):
                    copyfile(self.spm_file   ,				a__)
             elif not os.path.isfile(self.spm_file):
                    with open(a__   ,				'''wb''') as fi:
                           _lowerCamelCase				:  List[str]						=		self.sp_model.serialized_model_proto()
                           fi.write(a__)

             return (str(a__), str(a__))




def  __UpperCAmelCase(   lowercase_			,     lowercase_   ):
       _lowerCamelCase				:  Optional[Any]						=		sentencepiece.SentencePieceProcessor(**lowercase_   )
       spm.Load(str(lowercase_   )   )
       return spm




def  __UpperCAmelCase(   lowercase_   ):
       with open(lowercase_			,     '''r'''   ) as f:
              return json.load(lowercase_   )




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

