

import inspect
import unittest

from transformers import ConvNextVaConfig
from transformers.models.auto import get_values
from transformers.models.auto.modeling_auto import MODEL_FOR_BACKBONE_MAPPING_NAMES, MODEL_MAPPING_NAMES
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

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


if is_torch_available():
				import torch

				from transformers import ConvNextVaBackbone, ConvNextVaForImageClassification, ConvNextVaModel
				from transformers.models.convnextva.modeling_convnextva import CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
				from PIL import Image

				from transformers import AutoImageProcessor

class 						__UpperCamelCase    :




	def __init__(		self	:						Any		,	lowerCAmelCase	:						str		,	lowerCAmelCase	:						Optional[int]=13		,	lowerCAmelCase	:						int=32		,	lowerCAmelCase	:						List[Any]=3		,	lowerCAmelCase	:						str=4		,	lowerCAmelCase	:						int=[10, 20, 30, 40]		,	lowerCAmelCase	:						List[Any]=[2, 2, 3, 2]		,	lowerCAmelCase	:						Optional[int]=True		,	lowerCAmelCase	:						List[str]=True		,	lowerCAmelCase	:						Any=37		,	lowerCAmelCase	:						Tuple="gelu"		,	lowerCAmelCase	:						List[Any]=10		,	lowerCAmelCase	:						int=0.02		,	lowerCAmelCase	:						List[str]=["stage2", "stage3", "stage4"]		,	lowerCAmelCase	:						Tuple=[2, 3, 4]		,	lowerCAmelCase	:						str=None		,	):


		'''simple docstring'''







		UpperCAmelCase_       				=			parent
		UpperCAmelCase_       				=			batch_size
		UpperCAmelCase_       				=			image_size
		UpperCAmelCase_       				=			num_channels
		UpperCAmelCase_       				=			num_stages
		UpperCAmelCase_       				=			hidden_sizes
		UpperCAmelCase_       				=			depths
		UpperCAmelCase_       				=			is_training
		UpperCAmelCase_       				=			use_labels
		UpperCAmelCase_       				=			intermediate_size
		UpperCAmelCase_       				=			hidden_act
		UpperCAmelCase_       				=			num_labels
		UpperCAmelCase_       				=			initializer_range
		UpperCAmelCase_       				=			out_features
		UpperCAmelCase_       				=			out_indices
		UpperCAmelCase_       				=			scope




	def       __A					(		self	:						str							):


		'''simple docstring'''







		UpperCAmelCase_       				=			floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]							)

		UpperCAmelCase_       				=			None
		if self.use_labels:
			UpperCAmelCase_       				=			ids_tensor([self.batch_size]		,	self.num_labels							)

		UpperCAmelCase_       				=			self.get_config()

		return config, pixel_values, labels




	def       __A					(		self	:						Optional[int]							):


		'''simple docstring'''







		return ConvNextVaConfig(
		    num_channels=self.num_channels		,	hidden_sizes=self.hidden_sizes		,	depths=self.depths		,	num_stages=self.num_stages		,	hidden_act=self.hidden_act		,	is_decoder=_a		,	initializer_range=self.initializer_range		,	out_features=self.out_features		,	out_indices=self.out_indices		,	num_labels=self.num_labels		,	)




	def       __A					(		self	:						List[Any]		,	lowerCAmelCase	:						str		,	lowerCAmelCase	:						Any		,	lowerCAmelCase	:						Any							):


		'''simple docstring'''







		UpperCAmelCase_       				=			ConvNextVaModel(config=_a							)
		model.to(_a							)
		model.eval()
		UpperCAmelCase_       				=			model(_a							)
		# expected last hidden states: B, C, H // 32, W // 32
		self.parent.assertEqual(
		    result.last_hidden_state.shape		,	(self.batch_size, self.hidden_sizes[-1], self.image_size // 32, self.image_size // 32)		,	)




	def       __A					(		self	:						List[str]		,	lowerCAmelCase	:						List[Any]		,	lowerCAmelCase	:						Tuple		,	lowerCAmelCase	:						int							):


		'''simple docstring'''







		UpperCAmelCase_       				=			ConvNextVaForImageClassification(_a							)
		model.to(_a							)
		model.eval()
		UpperCAmelCase_       				=			model(_a		,	labels=_a							)
		self.parent.assertEqual(result.logits.shape		,	(self.batch_size, self.num_labels)							)




	def       __A					(		self	:						Dict		,	lowerCAmelCase	:						int		,	lowerCAmelCase	:						List[str]		,	lowerCAmelCase	:						Any							):


		'''simple docstring'''







		UpperCAmelCase_       				=			ConvNextVaBackbone(config=_a							)
		model.to(_a							)
		model.eval()
		UpperCAmelCase_       				=			model(_a							)

		# 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, self.hidden_sizes[1], 4, 4]							)

		# verify channels
		self.parent.assertEqual(len(model.channels							)		,	len(config.out_features							)							)
		self.parent.assertListEqual(model.channels		,	config.hidden_sizes[1:]							)

		# verify backbone works with out_features=None
		UpperCAmelCase_       				=			None
		UpperCAmelCase_       				=			ConvNextVaBackbone(config=_a							)
		model.to(_a							)
		model.eval()
		UpperCAmelCase_       				=			model(_a							)

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

		# verify channels
		self.parent.assertEqual(len(model.channels							)		,	1							)
		self.parent.assertListEqual(model.channels		,	[config.hidden_sizes[-1]]							)




	def       __A					(		self	:						Any							):


		'''simple docstring'''







		UpperCAmelCase_       				=			self.prepare_config_and_inputs()
		UpperCAmelCase_				,   UpperCAmelCase_				,   UpperCAmelCase_       				=			config_and_inputs
		UpperCAmelCase_       				=			{"pixel_values": pixel_values}
		return config, inputs_dict




	def       __A					(		self	:						Optional[int]							):


		'''simple docstring'''







		UpperCAmelCase_       				=			self.prepare_config_and_inputs()
		UpperCAmelCase_				,   UpperCAmelCase_				,   UpperCAmelCase_       				=			config_and_inputs
		UpperCAmelCase_       				=			{"pixel_values": pixel_values, "labels": labels}
		return config, inputs_dict


@require_torch
class 						__UpperCamelCase    (					__SCREAMING_SNAKE_CASE     ,     __SCREAMING_SNAKE_CASE     ,     unittest.TestCase						):
	SCREAMING_SNAKE_CASE__    				=     (
	    (
	        ConvNextVaModel,
	        ConvNextVaForImageClassification,
	        ConvNextVaBackbone,
	    )
	    if is_torch_available()
	    else ()
	)
	SCREAMING_SNAKE_CASE__    				=     (
	    {'feature-extraction': ConvNextVaModel, 'image-classification': ConvNextVaForImageClassification}
	    if is_torch_available()
	    else {}
	)

	SCREAMING_SNAKE_CASE__    				=     False
	SCREAMING_SNAKE_CASE__    				=     False
	SCREAMING_SNAKE_CASE__    				=     False
	SCREAMING_SNAKE_CASE__    				=     False
	SCREAMING_SNAKE_CASE__    				=     False




	def       __A					(		self	:						str							):


		'''simple docstring'''







		UpperCAmelCase_       				=			ConvNextVaModelTester(self							)
		UpperCAmelCase_       				=			ConfigTester(self		,	config_class=_a		,	has_text_modality=_a		,	hidden_size=37							)




	def       __A					(		self	:						str							):


		'''simple docstring'''







		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	:						List[Any]							):


		'''simple docstring'''







		return




	@unittest.skip(reason="ConvNextV2 does not use inputs_embeds"							)
	def       __A					(		self	:						Dict							):


		'''simple docstring'''







		pass




	@unittest.skip(reason="ConvNextV2 does not support input and output embeddings"							)
	def       __A					(		self	:						List[str]							):


		'''simple docstring'''







		pass




	@unittest.skip(reason="ConvNextV2 does not use feedforward chunking"							)
	def       __A					(		self	:						Union[str, Any]							):


		'''simple docstring'''







		pass




	def       __A					(		self	:						Any							):


		'''simple docstring'''







		if not self.model_tester.is_training:
			return

		for model_class in self.all_model_classes:
			UpperCAmelCase_				,   UpperCAmelCase_       				=			self.model_tester.prepare_config_and_inputs_with_labels()
			UpperCAmelCase_       				=			True

			if model_class.__name__ in [
			    *get_values(_a							),
			    *get_values(_a							),
			]:
				continue

			UpperCAmelCase_       				=			model_class(_a							)
			model.to(_a							)
			model.train()
			UpperCAmelCase_       				=			self._prepare_for_class(_a		,	_a		,	return_labels=_a							)
			UpperCAmelCase_       				=			model(**_a							).loss
			loss.backward()




	def       __A					(		self	:						int							):


		'''simple docstring'''







		if not self.model_tester.is_training:
			return

		for model_class in self.all_model_classes:
			UpperCAmelCase_				,   UpperCAmelCase_       				=			self.model_tester.prepare_config_and_inputs_with_labels()
			UpperCAmelCase_       				=			False
			UpperCAmelCase_       				=			True

			if (
			    model_class.__name__
			    in [*get_values(_a							), *get_values(_a							)]
			    or not model_class.supports_gradient_checkpointing
			):
				continue

			UpperCAmelCase_       				=			model_class(_a							)
			model.to(_a							)
			model.gradient_checkpointing_enable()
			model.train()
			UpperCAmelCase_       				=			self._prepare_for_class(_a		,	_a		,	return_labels=_a							)
			UpperCAmelCase_       				=			model(**_a							).loss
			loss.backward()




	def       __A					(		self	:						Any							):


		'''simple docstring'''







		UpperCAmelCase_				,   UpperCAmelCase_       				=			self.model_tester.prepare_config_and_inputs_for_common()

		for model_class in self.all_model_classes:
			UpperCAmelCase_       				=			model_class(_a							)
			UpperCAmelCase_       				=			inspect.signature(model.forward							)
			# signature.parameters is an OrderedDict => so arg_names order is deterministic
			UpperCAmelCase_       				=			[*signature.parameters.keys()]

			UpperCAmelCase_       				=			["pixel_values"]
			self.assertListEqual(arg_names[:1]		,	_a							)




	def       __A					(		self	:						Optional[int]							):


		'''simple docstring'''







		UpperCAmelCase_       				=			self.model_tester.prepare_config_and_inputs()
		self.model_tester.create_and_check_model(*_a							)




	def       __A					(		self	:						List[Any]							):


		'''simple docstring'''







		def check_hidden_states_output(lowerCAmelCase	:						Optional[int]		,	lowerCAmelCase	:						Optional[int]		,	lowerCAmelCase	:						List[Any]							):
			UpperCAmelCase_       				=			model_class(_a							)
			model.to(_a							)
			model.eval()

			with torch.no_grad():
				UpperCAmelCase_       				=			model(**self._prepare_for_class(_a		,	_a							)							)

			UpperCAmelCase_       				=			outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

			UpperCAmelCase_       				=			self.model_tester.num_stages
			self.assertEqual(len(_a							)		,	expected_num_stages + 1							)

			# ConvNextV2's feature maps are of shape (batch_size, num_channels, height, width)
			self.assertListEqual(
			    list(hidden_states[0].shape[-2:]							)		,	[self.model_tester.image_size // 4, self.model_tester.image_size // 4]		,	)

		UpperCAmelCase_				,   UpperCAmelCase_       				=			self.model_tester.prepare_config_and_inputs_for_common()

		for model_class in self.all_model_classes:
			UpperCAmelCase_       				=			True
			check_hidden_states_output(_a		,	_a		,	_a							)

			# check that output_hidden_states also work using config
			del inputs_dict["output_hidden_states"]
			UpperCAmelCase_       				=			True

			check_hidden_states_output(_a		,	_a		,	_a							)




	def       __A					(		self	:						str							):


		'''simple docstring'''







		UpperCAmelCase_       				=			self.model_tester.prepare_config_and_inputs()
		self.model_tester.create_and_check_for_image_classification(*_a							)




	@slow
	def       __A					(		self	:						Optional[int]							):


		'''simple docstring'''







		for model_name in CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
			UpperCAmelCase_       				=			ConvNextVaModel.from_pretrained(_a							)
			self.assertIsNotNone(_a							)



def       __lowerCAmelCase      (						):
	UpperCAmelCase_       				=			Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"    )
	return image




@require_torch
@require_vision
class 						__UpperCamelCase    (					unittest.TestCase						):




	@cached_property
	def       __A					(		self	:						Optional[Any]							):


		'''simple docstring'''







		return AutoImageProcessor.from_pretrained("facebook/convnextv2-tiny-1k-224"							) if is_vision_available() else None




	@slow
	def       __A					(		self	:						Dict							):


		'''simple docstring'''







		UpperCAmelCase_       				=			ConvNextVaForImageClassification.from_pretrained("facebook/convnextv2-tiny-1k-224"							).to(_a							)

		UpperCAmelCase_       				=			self.default_image_processor
		UpperCAmelCase_       				=			prepare_img()
		UpperCAmelCase_       				=			preprocessor(images=_a		,	return_tensors="pt"							).to(_a							)

		# forward pass
		with torch.no_grad():
			UpperCAmelCase_       				=			model(**_a							)

		# verify the logits
		UpperCAmelCase_       				=			torch.Size((1, 1_000)							)
		self.assertEqual(outputs.logits.shape		,	_a							)

		UpperCAmelCase_       				=			torch.tensor([0.9_996, 0.1_966, -0.4_386]							).to(_a							)
		self.assertTrue(torch.allclose(outputs.logits[0, :3]		,	_a		,	atol=1e-4							)							)


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


_a:    List[Any] 							=			logging.get_logger(__name__)

_a:    List[str] 							=			"""▁"""

_a:    Union[str, Any] 							=			{
    """vocab_file""": """vocab.json""",
    """spm_file""": """sentencepiece.bpe.model""",
}

_a:    Tuple 							=			{
    """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"""
        )
    },
}

_a:    Optional[int] 							=			{
    """facebook/s2t-small-librispeech-asr""": 1024,
}

_a:    List[Any] 							=			["""pt""", """fr""", """ru""", """nl""", """ro""", """it""", """es""", """de"""]

_a:    Tuple 							=			{"""mustc""": MUSTC_LANGS}

class 						__UpperCamelCase    (					lowercase						):
	SCREAMING_SNAKE_CASE__    				=     VOCAB_FILES_NAMES
	SCREAMING_SNAKE_CASE__    				=     PRETRAINED_VOCAB_FILES_MAP
	SCREAMING_SNAKE_CASE__    				=     MAX_MODEL_INPUT_SIZES
	SCREAMING_SNAKE_CASE__    				=     ['input_ids', 'attention_mask']

	SCREAMING_SNAKE_CASE__    				=     []




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


		'''simple docstring'''







		UpperCAmelCase_       				=			{} if sp_model_kwargs is None else sp_model_kwargs

		super().__init__(
		    bos_token=lowerCAmelCase		,	eos_token=lowerCAmelCase		,	unk_token=lowerCAmelCase		,	pad_token=lowerCAmelCase		,	do_upper_case=lowerCAmelCase		,	do_lower_case=lowerCAmelCase		,	tgt_lang=lowerCAmelCase		,	lang_codes=lowerCAmelCase		,	sp_model_kwargs=self.sp_model_kwargs		,	**lowerCAmelCase		,	)
		UpperCAmelCase_       				=			do_upper_case
		UpperCAmelCase_       				=			do_lower_case

		UpperCAmelCase_       				=			load_json(lowerCAmelCase							)
		UpperCAmelCase_       				=			{v: k for k, v in self.encoder.items()}
		UpperCAmelCase_       				=			spm_file
		UpperCAmelCase_       				=			load_spm(lowerCAmelCase		,	self.sp_model_kwargs							)

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

			UpperCAmelCase_       				=			self.lang_tokens
			UpperCAmelCase_       				=			tgt_lang if tgt_lang is not None else self.langs[0]

			self.set_tgt_lang_special_tokens(self._tgt_lang							)
		else:
			UpperCAmelCase_       				=			{}




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


		'''simple docstring'''







		return len(self.encoder							)




	@property
	def       __A					(		self	:						Any							):


		'''simple docstring'''







		return self._tgt_lang




	@tgt_lang.setter
	def       __A					(		self	:						int		,	lowerCAmelCase	:						Optional[Any]							):


		'''simple docstring'''







		UpperCAmelCase_       				=			new_tgt_lang
		self.set_tgt_lang_special_tokens(lowerCAmelCase							)




	def       __A					(		self	:						List[Any]		,	lowerCAmelCase	:						str							):


		'''simple docstring'''







		UpperCAmelCase_       				=			self.lang_code_to_id[tgt_lang]
		UpperCAmelCase_       				=			[lang_code_id]




	def       __A					(		self	:						List[str]		,	lowerCAmelCase	:						str							):


		'''simple docstring'''







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




	def       __A					(		self	:						str		,	lowerCAmelCase	:						int							):


		'''simple docstring'''







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




	def       __A					(		self	:						Optional[Any]		,	lowerCAmelCase	:						int							):


		'''simple docstring'''







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




	def       __A					(		self	:						Dict		,	lowerCAmelCase	:						List[str]							):


		'''simple docstring'''







		UpperCAmelCase_       				=			[]
		UpperCAmelCase_       				=			""
		for token in tokens:
			# make sure that special tokens are not decoded using sentencepiece model
			if token in self.all_special_tokens:
				UpperCAmelCase_       				=			self.sp_model.decode(lowerCAmelCase							)
				out_string += (decoded.upper() if self.do_upper_case else decoded) + token + " "
				UpperCAmelCase_       				=			[]
			else:
				current_sub_tokens.append(lowerCAmelCase							)
		UpperCAmelCase_       				=			self.sp_model.decode(lowerCAmelCase							)
		out_string += decoded.upper() if self.do_upper_case else decoded
		return out_string.strip()




	def       __A					(		self	:						Optional[Any]		,	lowerCAmelCase	:						List[Any]		,	lowerCAmelCase	:						Optional[int]=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       __A					(		self	:						Any		,	lowerCAmelCase	:						List[int]		,	lowerCAmelCase	:						Optional[List[int]] = None		,	lowerCAmelCase	:						bool = False							):


		'''simple docstring'''







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

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




	def       __A					(		self	:						Optional[Any]							):


		'''simple docstring'''







		UpperCAmelCase_       				=			self.encoder.copy()
		vocab.update(self.added_tokens_encoder							)
		return vocab




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


		'''simple docstring'''







		UpperCAmelCase_       				=			self.__dict__.copy()
		UpperCAmelCase_       				=			None
		return state




	def __setstate__(		self	:						Tuple		,	lowerCAmelCase	:						Dict							):


		'''simple docstring'''







		UpperCAmelCase_       				=			d

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

		UpperCAmelCase_       				=			load_spm(self.spm_file		,	self.sp_model_kwargs							)




	def       __A					(		self	:						Optional[Any]		,	lowerCAmelCase	:						str		,	lowerCAmelCase	:						Optional[str] = None							):


		'''simple docstring'''







		UpperCAmelCase_       				=			Path(lowerCAmelCase							)
		assert save_dir.is_dir(), F"{save_directory} should be a directory"
		UpperCAmelCase_       				=			save_dir / (
		    (filename_prefix + "-" if filename_prefix else "") + self.vocab_files_names["vocab_file"]
		)
		UpperCAmelCase_       				=			save_dir / (
		    (filename_prefix + "-" if filename_prefix else "") + self.vocab_files_names["spm_file"]
		)

		save_json(self.encoder		,	lowerCAmelCase							)

		if os.path.abspath(self.spm_file							) != os.path.abspath(lowerCAmelCase							) and os.path.isfile(self.spm_file							):
			copyfile(self.spm_file		,	lowerCAmelCase							)
		elif not os.path.isfile(self.spm_file							):
			with open(lowerCAmelCase		,	"wb"							) as fi:
				UpperCAmelCase_       				=			self.sp_model.serialized_model_proto()
				fi.write(lowerCAmelCase							)

		return (str(lowerCAmelCase							), str(lowerCAmelCase							))



def       __lowerCAmelCase      (						A       ,     A    ):
	UpperCAmelCase_       				=			sentencepiece.SentencePieceProcessor(**A    )
	spm.Load(str(A    )    )
	return spm



def       __lowerCAmelCase      (						A    ):
	with open(A       ,     "r"    ) as f:
		return json.load(A    )




def       __lowerCAmelCase      (						A       ,     A    ):
	with open(A       ,     "w"    ) as f:
		json.dump(A       ,     A       ,     indent=2    )