"""simple docstring"""




import random
import unittest

import numpy as np

import transformers
from transformers import is_flax_available, is_torch_available
from transformers.testing_utils import is_pt_flax_cross_test, require_flax


if is_flax_available():
			import os

			import jax.numpy as jnp
			from jax import jit

			from transformers import AutoTokenizer, FlaxAutoModelForCausalLM
			from transformers.modeling_flax_pytorch_utils import load_flax_weights_in_pytorch_model

			__lowerCAmelCase    :							Optional[Any]													=						"0.12"  # assumed parallelism: 8


if is_torch_available():
			import torch







def 							_UpperCAmelCase		(       lowerCamelCase__			,  lowerCamelCase__			,  lowerCamelCase__=None     ):





		"""simple docstring"""




		if rng is None:
				lowerCAmelCase__        =   random.Random()

		lowerCAmelCase__        =   1
		for dim in shape:
				total_dims *= dim

		lowerCAmelCase__        =   []
		for _ in range(lowerCamelCase__     ):
				values.append(rng.randint(0			,  vocab_size - 1     )     )

		lowerCAmelCase__        =   np.array(lowerCamelCase__			,  dtype=jnp.intaa     ).reshape(lowerCamelCase__     )

		return output







def 							_UpperCAmelCase		(       lowerCamelCase__			,  lowerCamelCase__=None     ):





		"""simple docstring"""




		lowerCAmelCase__        =   ids_tensor(lowerCamelCase__			,  vocab_size=2			,  rng=lowerCamelCase__     )
		# make sure that at least one token is attended to for each batch
		lowerCAmelCase__        =   1
		return attn_mask

@require_flax
class       a_      :
					UpperCamelCase_ :	List[str]			=    None
					UpperCamelCase_ :	Any			=    ()




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Optional[Any]     ):
							lowerCAmelCase__   ,					lowerCAmelCase__        =   self.model_tester.prepare_config_and_inputs_for_common()

							# cut to half length & take max batch_size 3
							lowerCAmelCase__        =   2
							lowerCAmelCase__        =   inputs["""input_ids"""].shape[-1] // 2
							lowerCAmelCase__        =   inputs["""input_ids"""][:max_batch_size, :sequence_length]

							lowerCAmelCase__        =   jnp.ones_like(snake_case__     )
							lowerCAmelCase__        =   attention_mask[:max_batch_size, :sequence_length]

							# generate max 5 tokens
							lowerCAmelCase__        =   input_ids.shape[-1] + 5
							if config.eos_token_id is not None and config.pad_token_id is None:
									# hack to allow generate for models such as GPT2 as is done in `generate()`
									lowerCAmelCase__        =   config.eos_token_id
							return config, input_ids, attention_mask, max_length




					@is_pt_flax_cross_test
					def 						_SCREAMING_SNAKE_CASE						(	self						:     Optional[Any]     ):
							lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__        =   self._get_input_ids_and_config()
							lowerCAmelCase__        =   False
							lowerCAmelCase__        =   max_length
							lowerCAmelCase__        =   0

							for model_class in self.all_generative_model_classes:
									lowerCAmelCase__        =   model_class(snake_case__     )

									lowerCAmelCase__        =   model_class.__name__[4:]  # Skip the "Flax" at the beginning
									lowerCAmelCase__        =   getattr(snake_case__  ,						snake_case__     )
									lowerCAmelCase__        =   pt_model_class(snake_case__     ).eval()
									lowerCAmelCase__        =   load_flax_weights_in_pytorch_model(snake_case__  ,						flax_model.params     )

									lowerCAmelCase__        =   flax_model.generate(snake_case__     ).sequences
									lowerCAmelCase__        =   pt_model.generate(torch.tensor(snake_case__  ,						dtype=torch.long     )     )

									if flax_generation_outputs.shape[-1] > pt_generation_outputs.shape[-1]:
											lowerCAmelCase__        =   flax_generation_outputs[:, : pt_generation_outputs.shape[-1]]

									self.assertListEqual(pt_generation_outputs.numpy().tolist()  ,						flax_generation_outputs.tolist()     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Optional[Any]     ):
							lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__        =   self._get_input_ids_and_config()
							lowerCAmelCase__        =   False
							lowerCAmelCase__        =   max_length

							for model_class in self.all_generative_model_classes:
									lowerCAmelCase__        =   model_class(snake_case__     )

									lowerCAmelCase__        =   model.generate(snake_case__     ).sequences
									self.assertEqual(generation_outputs.shape[-1]  ,						snake_case__     )

									lowerCAmelCase__        =   jit(model.generate     )
									lowerCAmelCase__        =   jit_generate(snake_case__     ).sequences

									self.assertListEqual(generation_outputs.tolist()  ,						jit_generation_outputs.tolist()     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     int     ):
							lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__        =   self._get_input_ids_and_config()
							lowerCAmelCase__        =   True
							lowerCAmelCase__        =   max_length

							for model_class in self.all_generative_model_classes:
									lowerCAmelCase__        =   model_class(snake_case__     )

									lowerCAmelCase__        =   model.generate(snake_case__     ).sequences
									self.assertEqual(generation_outputs.shape[-1]  ,						snake_case__     )

									lowerCAmelCase__        =   jit(model.generate     )
									lowerCAmelCase__        =   jit_generate(snake_case__     ).sequences

									self.assertListEqual(generation_outputs.tolist()  ,						jit_generation_outputs.tolist()     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     str     ):
							lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__        =   self._get_input_ids_and_config()
							lowerCAmelCase__        =   False
							lowerCAmelCase__        =   max_length
							lowerCAmelCase__        =   2

							for model_class in self.all_generative_model_classes:
									lowerCAmelCase__        =   model_class(snake_case__     )

									lowerCAmelCase__        =   model.generate(snake_case__     ).sequences
									self.assertEqual(generation_outputs.shape[-1]  ,						snake_case__     )

									lowerCAmelCase__        =   jit(model.generate     )
									lowerCAmelCase__        =   jit_generate(snake_case__     ).sequences

									self.assertListEqual(generation_outputs.tolist()  ,						jit_generation_outputs.tolist()     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     List[Any]     ):
							lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__        =   self._get_input_ids_and_config()
							lowerCAmelCase__        =   False
							lowerCAmelCase__        =   max_length
							lowerCAmelCase__        =   2
							lowerCAmelCase__        =   2

							for model_class in self.all_generative_model_classes:
									lowerCAmelCase__        =   model_class(snake_case__     )

									lowerCAmelCase__        =   model.generate(snake_case__     ).sequences
									self.assertEqual(generation_outputs.shape[0]  ,						input_ids.shape[0] * config.num_return_sequences     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     str     ):
							lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__        =   self._get_input_ids_and_config()
							lowerCAmelCase__        =   True
							lowerCAmelCase__        =   max_length
							lowerCAmelCase__        =   0.8
							lowerCAmelCase__        =   10
							lowerCAmelCase__        =   0.3
							lowerCAmelCase__        =   1
							lowerCAmelCase__        =   8
							lowerCAmelCase__        =   9

							for model_class in self.all_generative_model_classes:
									lowerCAmelCase__        =   model_class(snake_case__     )

									lowerCAmelCase__        =   model.generate(snake_case__     ).sequences
									self.assertEqual(generation_outputs.shape[-1]  ,						snake_case__     )

									lowerCAmelCase__        =   jit(model.generate     )
									lowerCAmelCase__        =   jit_generate(snake_case__     ).sequences

									self.assertListEqual(generation_outputs.tolist()  ,						jit_generation_outputs.tolist()     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     int     ):
							lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__        =   self._get_input_ids_and_config()
							lowerCAmelCase__        =   max_length
							lowerCAmelCase__        =   1
							lowerCAmelCase__        =   8
							lowerCAmelCase__        =   9

							for model_class in self.all_generative_model_classes:
									lowerCAmelCase__        =   model_class(snake_case__     )

									lowerCAmelCase__        =   model.generate(snake_case__     ).sequences
									self.assertEqual(generation_outputs.shape[-1]  ,						snake_case__     )

									lowerCAmelCase__        =   jit(model.generate     )
									lowerCAmelCase__        =   jit_generate(snake_case__     ).sequences

									self.assertListEqual(generation_outputs.tolist()  ,						jit_generation_outputs.tolist()     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     List[str]     ):
							lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__        =   self._get_input_ids_and_config()
							lowerCAmelCase__        =   max_length
							lowerCAmelCase__        =   2
							lowerCAmelCase__        =   1
							lowerCAmelCase__        =   8
							lowerCAmelCase__        =   9

							for model_class in self.all_generative_model_classes:
									lowerCAmelCase__        =   model_class(snake_case__     )

									lowerCAmelCase__        =   model.generate(snake_case__     ).sequences
									self.assertEqual(generation_outputs.shape[-1]  ,						snake_case__     )

									lowerCAmelCase__        =   jit(model.generate     )
									lowerCAmelCase__        =   jit_generate(snake_case__     ).sequences

									self.assertListEqual(generation_outputs.tolist()  ,						jit_generation_outputs.tolist()     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Tuple     ):
							lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__        =   self._get_input_ids_and_config()

							# pad attention mask on the left
							lowerCAmelCase__        =   attention_mask.at[(0, 0)].set(0     )

							lowerCAmelCase__        =   False
							lowerCAmelCase__        =   max_length

							for model_class in self.all_generative_model_classes:
									lowerCAmelCase__        =   model_class(snake_case__     )

									lowerCAmelCase__        =   model.generate(snake_case__  ,						attention_mask=snake_case__     ).sequences
									self.assertEqual(generation_outputs.shape[-1]  ,						snake_case__     )

									lowerCAmelCase__        =   jit(model.generate     )
									lowerCAmelCase__        =   jit_generate(snake_case__  ,						attention_mask=snake_case__     ).sequences

									self.assertListEqual(generation_outputs.tolist()  ,						jit_generation_outputs.tolist()     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Optional[Any]     ):
							lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__        =   self._get_input_ids_and_config()

							# pad attention mask on the left
							lowerCAmelCase__        =   attention_mask.at[(0, 0)].set(0     )

							lowerCAmelCase__        =   True
							lowerCAmelCase__        =   max_length

							for model_class in self.all_generative_model_classes:
									lowerCAmelCase__        =   model_class(snake_case__     )

									lowerCAmelCase__        =   model.generate(snake_case__  ,						attention_mask=snake_case__     ).sequences
									self.assertEqual(generation_outputs.shape[-1]  ,						snake_case__     )

									lowerCAmelCase__        =   jit(model.generate     )
									lowerCAmelCase__        =   jit_generate(snake_case__  ,						attention_mask=snake_case__     ).sequences

									self.assertListEqual(generation_outputs.tolist()  ,						jit_generation_outputs.tolist()     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Union[str, Any]     ):
							lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__   ,					lowerCAmelCase__        =   self._get_input_ids_and_config()

							# pad attention mask on the left
							lowerCAmelCase__        =   attention_mask.at[(0, 0)].set(0     )

							lowerCAmelCase__        =   2
							lowerCAmelCase__        =   max_length

							for model_class in self.all_generative_model_classes:
									lowerCAmelCase__        =   model_class(snake_case__     )

									lowerCAmelCase__        =   model.generate(snake_case__  ,						attention_mask=snake_case__     ).sequences
									self.assertEqual(generation_outputs.shape[-1]  ,						snake_case__     )

									lowerCAmelCase__        =   jit(model.generate     )
									lowerCAmelCase__        =   jit_generate(snake_case__  ,						attention_mask=snake_case__     ).sequences

									self.assertListEqual(generation_outputs.tolist()  ,						jit_generation_outputs.tolist()     )

@require_flax
class       a_      (     unittest.TestCase			):




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Optional[int]     ):
							lowerCAmelCase__        =   AutoTokenizer.from_pretrained("""hf-internal-testing/tiny-bert"""     )
							lowerCAmelCase__        =   FlaxAutoModelForCausalLM.from_pretrained("""hf-internal-testing/tiny-bert-flax-only"""     )

							lowerCAmelCase__        =   """Hello world"""
							lowerCAmelCase__        =   tokenizer(snake_case__  ,						return_tensors="""np"""     ).input_ids

							# typos are quickly detected (the correct argument is `do_sample`)
							with self.assertRaisesRegex(snake_case__  ,						"""do_samples"""     ):
									model.generate(snake_case__  ,						do_samples=snake_case__     )

							# arbitrary arguments that will not be used anywhere are also not accepted
							with self.assertRaisesRegex(snake_case__  ,						"""foo"""     ):
									lowerCAmelCase__        =   {"""foo""": """bar"""}
									model.generate(snake_case__  ,						**snake_case__     )





"""simple docstring"""




import json
import sys
import tempfile
import unittest
from pathlib import Path

import transformers
from transformers import (
    CONFIG_MAPPING,
    IMAGE_PROCESSOR_MAPPING,
    AutoConfig,
    AutoImageProcessor,
    CLIPConfig,
    CLIPImageProcessor,
)
from transformers.testing_utils import DUMMY_UNKNOWN_IDENTIFIER


sys.path.append(str(Path(__file__).parent.parent.parent.parent / "utils"))

from test_module.custom_configuration import CustomConfig  # noqa E402
from test_module.custom_image_processing import CustomImageProcessor  # noqa E402

class       a_      (     unittest.TestCase			):




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Optional[int]     ):
							lowerCAmelCase__        =   0




					def 						_SCREAMING_SNAKE_CASE						(	self						:     List[Any]     ):
							lowerCAmelCase__        =   AutoImageProcessor.from_pretrained("""openai/clip-vit-base-patch32"""     )
							self.assertIsInstance(snake_case__  ,						snake_case__     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Tuple     ):
							with tempfile.TemporaryDirectory() as tmpdirname:
									lowerCAmelCase__        =   Path(snake_case__     ) / """preprocessor_config.json"""
									lowerCAmelCase__        =   Path(snake_case__     ) / """config.json"""
									json.dump(
									    {"""image_processor_type""": """CLIPImageProcessor""", """processor_class""": """CLIPProcessor"""}  ,						open(snake_case__  ,						"""w"""     )  ,						)
									json.dump({"""model_type""": """clip"""}  ,						open(snake_case__  ,						"""w"""     )     )

									lowerCAmelCase__        =   AutoImageProcessor.from_pretrained(snake_case__     )
									self.assertIsInstance(snake_case__  ,						snake_case__     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Union[str, Any]     ):
							# Ensure we can load the image processor from the feature extractor config
							with tempfile.TemporaryDirectory() as tmpdirname:
									lowerCAmelCase__        =   Path(snake_case__     ) / """preprocessor_config.json"""
									lowerCAmelCase__        =   Path(snake_case__     ) / """config.json"""
									json.dump(
									    {"""feature_extractor_type""": """CLIPFeatureExtractor""", """processor_class""": """CLIPProcessor"""}  ,						open(snake_case__  ,						"""w"""     )  ,						)
									json.dump({"""model_type""": """clip"""}  ,						open(snake_case__  ,						"""w"""     )     )

									lowerCAmelCase__        =   AutoImageProcessor.from_pretrained(snake_case__     )
									self.assertIsInstance(snake_case__  ,						snake_case__     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Optional[int]     ):
							with tempfile.TemporaryDirectory() as tmpdirname:
									lowerCAmelCase__        =   CLIPConfig()

									# Create a dummy config file with image_proceesor_type
									lowerCAmelCase__        =   Path(snake_case__     ) / """preprocessor_config.json"""
									lowerCAmelCase__        =   Path(snake_case__     ) / """config.json"""
									json.dump(
									    {"""image_processor_type""": """CLIPImageProcessor""", """processor_class""": """CLIPProcessor"""}  ,						open(snake_case__  ,						"""w"""     )  ,						)
									json.dump({"""model_type""": """clip"""}  ,						open(snake_case__  ,						"""w"""     )     )

									# remove image_processor_type to make sure config.json alone is enough to load image processor locally
									lowerCAmelCase__        =   AutoImageProcessor.from_pretrained(snake_case__     ).to_dict()

									config_dict.pop("""image_processor_type"""     )
									lowerCAmelCase__        =   CLIPImageProcessor(**snake_case__     )

									# save in new folder
									model_config.save_pretrained(snake_case__     )
									config.save_pretrained(snake_case__     )

									lowerCAmelCase__        =   AutoImageProcessor.from_pretrained(snake_case__     )

									# make sure private variable is not incorrectly saved
									lowerCAmelCase__        =   json.loads(config.to_json_string()     )
									self.assertTrue("""_processor_class""" not in dict_as_saved     )

							self.assertIsInstance(snake_case__  ,						snake_case__     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Dict     ):
							with tempfile.TemporaryDirectory() as tmpdirname:
									lowerCAmelCase__        =   Path(snake_case__     ) / """preprocessor_config.json"""
									json.dump(
									    {"""image_processor_type""": """CLIPImageProcessor""", """processor_class""": """CLIPProcessor"""}  ,						open(snake_case__  ,						"""w"""     )  ,						)

									lowerCAmelCase__        =   AutoImageProcessor.from_pretrained(snake_case__     )
									self.assertIsInstance(snake_case__  ,						snake_case__     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Optional[int]     ):
							with self.assertRaisesRegex(
							    snake_case__  ,						"""clip-base is not a local folder and is not a valid model identifier"""     ):
									lowerCAmelCase__        =   AutoImageProcessor.from_pretrained("""clip-base"""     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Union[str, Any]     ):
							with self.assertRaisesRegex(
							    snake_case__  ,						R"""aaaaaa is not a valid git identifier \(branch name, tag name or commit id\)"""     ):
									lowerCAmelCase__        =   AutoImageProcessor.from_pretrained(snake_case__  ,						revision="""aaaaaa"""     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Optional[Any]     ):
							with self.assertRaisesRegex(
							    snake_case__  ,						"""hf-internal-testing/config-no-model does not appear to have a file named preprocessor_config.json."""  ,						):
									lowerCAmelCase__        =   AutoImageProcessor.from_pretrained("""hf-internal-testing/config-no-model"""     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Any     ):
							# If remote code is not set, we will time out when asking whether to load the model.
							with self.assertRaises(snake_case__     ):
									lowerCAmelCase__        =   AutoImageProcessor.from_pretrained("""hf-internal-testing/test_dynamic_image_processor"""     )
							# If remote code is disabled, we can't load this config.
							with self.assertRaises(snake_case__     ):
									lowerCAmelCase__        =   AutoImageProcessor.from_pretrained(
									    """hf-internal-testing/test_dynamic_image_processor"""  ,						trust_remote_code=snake_case__     )

							lowerCAmelCase__        =   AutoImageProcessor.from_pretrained(
							    """hf-internal-testing/test_dynamic_image_processor"""  ,						trust_remote_code=snake_case__     )
							self.assertEqual(image_processor.__class__.__name__  ,						"""NewImageProcessor"""     )

							# Test image processor can be reloaded.
							with tempfile.TemporaryDirectory() as tmp_dir:
									image_processor.save_pretrained(snake_case__     )
									lowerCAmelCase__        =   AutoImageProcessor.from_pretrained(snake_case__  ,						trust_remote_code=snake_case__     )
							self.assertEqual(reloaded_image_processor.__class__.__name__  ,						"""NewImageProcessor"""     )




					def 						_SCREAMING_SNAKE_CASE						(	self						:     Dict     ):
							try:
									AutoConfig.register("""custom"""  ,						snake_case__     )
									AutoImageProcessor.register(snake_case__  ,						snake_case__     )
									# Trying to register something existing in the Transformers library will raise an error
									with self.assertRaises(snake_case__     ):
											AutoImageProcessor.register(snake_case__  ,						snake_case__     )

									with tempfile.TemporaryDirectory() as tmpdirname:
											lowerCAmelCase__        =   Path(snake_case__     ) / """preprocessor_config.json"""
											lowerCAmelCase__        =   Path(snake_case__     ) / """config.json"""
											json.dump(
											    {"""feature_extractor_type""": """CLIPFeatureExtractor""", """processor_class""": """CLIPProcessor"""}  ,						open(snake_case__  ,						"""w"""     )  ,						)
											json.dump({"""model_type""": """clip"""}  ,						open(snake_case__  ,						"""w"""     )     )

											lowerCAmelCase__        =   CustomImageProcessor.from_pretrained(snake_case__     )

									# Now that the config is registered, it can be used as any other config with the auto-API
									with tempfile.TemporaryDirectory() as tmp_dir:
											image_processor.save_pretrained(snake_case__     )
											lowerCAmelCase__        =   AutoImageProcessor.from_pretrained(snake_case__     )
											self.assertIsInstance(snake_case__  ,						snake_case__     )

							finally:
									if "custom" in CONFIG_MAPPING._extra_content:
											del CONFIG_MAPPING._extra_content["custom"]
									if CustomConfig in IMAGE_PROCESSOR_MAPPING._extra_content:
											del IMAGE_PROCESSOR_MAPPING._extra_content[CustomConfig]




					def 						_SCREAMING_SNAKE_CASE						(	self						:     List[str]     ):

							class       a_      (     __UpperCamelCase			):
												UpperCamelCase_ :	Tuple			=    True

							try:
									AutoConfig.register("""custom"""  ,						snake_case__     )
									AutoImageProcessor.register(snake_case__  ,						snake_case__     )
									# If remote code is not set, the default is to use local
									lowerCAmelCase__        =   AutoImageProcessor.from_pretrained("""hf-internal-testing/test_dynamic_image_processor"""     )
									self.assertEqual(image_processor.__class__.__name__  ,						"""NewImageProcessor"""     )
									self.assertTrue(image_processor.is_local     )

									# If remote code is disabled, we load the local one.
									lowerCAmelCase__        =   AutoImageProcessor.from_pretrained(
									    """hf-internal-testing/test_dynamic_image_processor"""  ,						trust_remote_code=snake_case__     )
									self.assertEqual(image_processor.__class__.__name__  ,						"""NewImageProcessor"""     )
									self.assertTrue(image_processor.is_local     )

									# If remote is enabled, we load from the Hub
									lowerCAmelCase__        =   AutoImageProcessor.from_pretrained(
									    """hf-internal-testing/test_dynamic_image_processor"""  ,						trust_remote_code=snake_case__     )
									self.assertEqual(image_processor.__class__.__name__  ,						"""NewImageProcessor"""     )
									self.assertTrue(not hasattr(snake_case__  ,						"""is_local"""     )     )

							finally:
									if "custom" in CONFIG_MAPPING._extra_content:
											del CONFIG_MAPPING._extra_content["custom"]
									if CustomConfig in IMAGE_PROCESSOR_MAPPING._extra_content:
											del IMAGE_PROCESSOR_MAPPING._extra_content[CustomConfig]




