"""simple docstring"""





import inspect
import unittest

from transformers import RegNetConfig, is_flax_available
from transformers.testing_utils import require_flax, slow
from transformers.utils import cached_property, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_flax_common import FlaxModelTesterMixin, floats_tensor


if is_flax_available():
				import jax
				import jax.numpy as jnp

				from transformers.models.regnet.modeling_flax_regnet import FlaxRegNetForImageClassification, FlaxRegNetModel

if is_vision_available():
				from PIL import Image

				from transformers import AutoImageProcessor
class  _snake_case     (					unittest.TestCase		):






						def __init__(       self      :			Dict							,					UpperCAmelCase      :			List[Any]							,					UpperCAmelCase      :			List[str]=3							,					UpperCAmelCase      :			Any=32							,					UpperCAmelCase      :			Dict=3							,					UpperCAmelCase      :			Optional[int]=10							,					UpperCAmelCase      :			Dict=[10, 20, 30, 40]							,					UpperCAmelCase      :			List[str]=[1, 1, 2, 1]							,					UpperCAmelCase      :			int=True							,					UpperCAmelCase      :			str=True							,					UpperCAmelCase      :			List[str]="relu"							,					UpperCAmelCase      :			Optional[int]=3							,					UpperCAmelCase      :			List[Any]=None							,					):
													__lowerCamelCase					:		str		   =     parent
													__lowerCamelCase					:		Optional[int]		   =     batch_size
													__lowerCamelCase					:		Tuple		   =     image_size
													__lowerCamelCase					:		Any		   =     num_channels
													__lowerCamelCase					:		Any		   =     embeddings_size
													__lowerCamelCase					:		Tuple		   =     hidden_sizes
													__lowerCamelCase					:		Tuple		   =     depths
													__lowerCamelCase					:		Tuple		   =     is_training
													__lowerCamelCase					:		Dict		   =     use_labels
													__lowerCamelCase					:		Optional[Any]		   =     hidden_act
													__lowerCamelCase					:		str		   =     num_labels
													__lowerCamelCase					:		int		   =     scope
													__lowerCamelCase					:		Optional[Any]		   =     len(__A    )






						def       lowerCamelCase__     (       self      :			Optional[int]    ):
													__lowerCamelCase					:		Optional[int]		   =     floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]    )

													__lowerCamelCase					:		Any		   =     self.get_config()

													return config, pixel_values






						def       lowerCamelCase__     (       self      :			Optional[int]    ):
													return RegNetConfig(
													    num_channels=self.num_channels							,					embeddings_size=self.embeddings_size							,					hidden_sizes=self.hidden_sizes							,					depths=self.depths							,					hidden_act=self.hidden_act							,					num_labels=self.num_labels							,					image_size=self.image_size							,					)






						def       lowerCamelCase__     (       self      :			str							,					UpperCAmelCase      :			int							,					UpperCAmelCase      :			str    ):
													__lowerCamelCase					:		Optional[int]		   =     FlaxRegNetModel(config=__A    )
													__lowerCamelCase					:		Any		   =     model(__A    )

													# Output shape (b, c, h, w)
													self.parent.assertEqual(
													    result.last_hidden_state.shape							,					(self.batch_size, self.hidden_sizes[-1], self.image_size // 32, self.image_size // 32)							,					)






						def       lowerCamelCase__     (       self      :			Optional[Any]							,					UpperCAmelCase      :			Dict							,					UpperCAmelCase      :			Any    ):
													__lowerCamelCase					:		Union[str, Any]		   =     self.num_labels
													__lowerCamelCase					:		int		   =     FlaxRegNetForImageClassification(config=__A    )
													__lowerCamelCase					:		Optional[Any]		   =     model(__A    )
													self.parent.assertEqual(result.logits.shape							,					(self.batch_size, self.num_labels)    )







						def       lowerCamelCase__     (       self      :			List[str]    ):
													__lowerCamelCase					:		int		   =     self.prepare_config_and_inputs()
													__lowerCamelCase   ,  __lowerCamelCase					:		Union[str, Any]		   =     config_and_inputs
													__lowerCamelCase					:		List[Any]		   =     {"pixel_values": pixel_values}
													return config, inputs_dict

@require_flax
class  _snake_case     (					UpperCamelCase__				, unittest.TestCase		):
						snake_case__			  =			(FlaxRegNetModel, FlaxRegNetForImageClassification) if is_flax_available() else ()

						snake_case__			  =			False
						snake_case__			  =			False
						snake_case__			  =			False






						def       lowerCamelCase__     (       self      :			int    ):
													__lowerCamelCase					:		Any		   =     FlaxRegNetModelTester(self    )
													__lowerCamelCase					:		List[Any]		   =     ConfigTester(self							,					config_class=__A							,					has_text_modality=__A    )






						def       lowerCamelCase__     (       self      :			List[str]    ):
													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       lowerCamelCase__     (       self      :			List[str]    ):
													return






						def       lowerCamelCase__     (       self      :			Optional[int]    ):
													__lowerCamelCase					:		List[str]		   =     self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_model(*__A    )






						def       lowerCamelCase__     (       self      :			Optional[Any]    ):
													__lowerCamelCase					:		Union[str, Any]		   =     self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_for_image_classification(*__A    )






						@unittest.skip(reason="RegNet does not use inputs_embeds"    )
						def       lowerCamelCase__     (       self      :			int    ):
													pass






						@unittest.skip(reason="RegNet does not support input and output embeddings"    )
						def       lowerCamelCase__     (       self      :			Tuple    ):
													pass






						def       lowerCamelCase__     (       self      :			Optional[Any]    ):
													__lowerCamelCase   ,  __lowerCamelCase					:		Tuple		   =     self.model_tester.prepare_config_and_inputs_for_common()

													for model_class in self.all_model_classes:
																				__lowerCamelCase					:		List[str]		   =     model_class(__A    )
																				__lowerCamelCase					:		List[Any]		   =     inspect.signature(model.__call__    )
																				# signature.parameters is an OrderedDict => so arg_names order is deterministic
																				__lowerCamelCase					:		Dict		   =     [*signature.parameters.keys()]

																				__lowerCamelCase					:		Union[str, Any]		   =     ["pixel_values"]
																				self.assertListEqual(arg_names[:1]							,					__A    )






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



													def check_hidden_states_output(UpperCAmelCase      :			Optional[int]							,					UpperCAmelCase      :			str							,					UpperCAmelCase      :			Optional[Any]    ):
																				__lowerCamelCase					:		Any		   =     model_class(__A    )

																				__lowerCamelCase					:		Dict		   =     model(**self._prepare_for_class(__A							,					__A    )    )

																				__lowerCamelCase					:		int		   =     outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

																				__lowerCamelCase					:		str		   =     self.model_tester.num_stages
																				self.assertEqual(len(__A    )							,					expected_num_stages + 1    )

													__lowerCamelCase   ,  __lowerCamelCase					:		Dict		   =     self.model_tester.prepare_config_and_inputs_for_common()

													for model_class in self.all_model_classes:
																				__lowerCamelCase					:		List[Any]		   =     True
																				check_hidden_states_output(__A							,					__A							,					__A    )

																				# check that output_hidden_states also work using config
																				del inputs_dict["output_hidden_states"]
																				__lowerCamelCase					:		Tuple		   =     True

																				check_hidden_states_output(__A							,					__A							,					__A    )







						def       lowerCamelCase__     (       self      :			Any    ):
													__lowerCamelCase   ,  __lowerCamelCase					:		Optional[Any]		   =     self.model_tester.prepare_config_and_inputs_for_common()

													for model_class in self.all_model_classes:
																				with self.subTest(model_class.__name__    ):
																											__lowerCamelCase					:		List[Any]		   =     self._prepare_for_class(__A							,					__A    )
																											__lowerCamelCase					:		Any		   =     model_class(__A    )

																											@jax.jit
																											def model_jitted(UpperCAmelCase      :			Dict							,					**UpperCAmelCase      :			Any    ):
																																		return model(pixel_values=__A							,					**__A    )

																											with self.subTest("JIT Enabled"    ):
																																		__lowerCamelCase					:		Optional[Any]		   =     model_jitted(**__A    ).to_tuple()

																											with self.subTest("JIT Disabled"    ):
																																		with jax.disable_jit():
																																									__lowerCamelCase					:		Optional[int]		   =     model_jitted(**__A    ).to_tuple()

																											self.assertEqual(len(__A    )							,					len(__A    )    )
																											for jitted_output, output in zip(__A							,					__A    ):
																																		self.assertEqual(jitted_output.shape							,					output.shape    )


def    lowercase_   (   ) ->      Union[str, Any]:



							'''simple docstring'''

							__lowerCamelCase					:		Union[str, Any]		   =     Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"      )
							return image







@require_flax
class  _snake_case     (					unittest.TestCase		):






						@cached_property
						def       lowerCamelCase__     (       self      :			List[Any]    ):
													return AutoImageProcessor.from_pretrained("facebook/regnet-y-040"    ) if is_vision_available() else None







						@slow
						def       lowerCamelCase__     (       self      :			Any    ):
													__lowerCamelCase					:		Tuple		   =     FlaxRegNetForImageClassification.from_pretrained("facebook/regnet-y-040"    )

													__lowerCamelCase					:		List[str]		   =     self.default_image_processor
													__lowerCamelCase					:		str		   =     prepare_img()
													__lowerCamelCase					:		str		   =     image_processor(images=__A							,					return_tensors="np"    )

													__lowerCamelCase					:		Optional[int]		   =     model(**__A    )

													# verify the logits
													__lowerCamelCase					:		Optional[int]		   =     (1, 1000)
													self.assertEqual(outputs.logits.shape							,					__A    )

													__lowerCamelCase					:		str		   =     jnp.array([-0.4_1_8_0, -1.5_0_5_1, -3.4_8_3_6]    )

													self.assertTrue(jnp.allclose(outputs.logits[0, :3]							,					__A							,					atol=1E-4    )    )
"""simple docstring"""





from typing import Any, Callable, Dict, List, Optional, Union

import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer

from diffusers import (
    AutoencoderKL,
    DDIMScheduler,
    DiffusionPipeline,
    LMSDiscreteScheduler,
    PNDMScheduler,
    StableDiffusionPipeline,
    UNetaDConditionModel,
)
from diffusers.pipelines.stable_diffusion import StableDiffusionPipelineOutput
from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker


__A  =				'''CompVis/stable-diffusion-v1-1'''
__A  =				'''CompVis/stable-diffusion-v1-2'''
__A  =				'''CompVis/stable-diffusion-v1-3'''
__A  =				'''CompVis/stable-diffusion-v1-4'''
class  _snake_case     (					a__		):






						def __init__(       self      :			int							,					UpperCAmelCase      :			AutoencoderKL							,					UpperCAmelCase      :			CLIPTextModel							,					UpperCAmelCase      :			CLIPTokenizer							,					UpperCAmelCase      :			UNetaDConditionModel							,					UpperCAmelCase      :			Union[DDIMScheduler, PNDMScheduler, LMSDiscreteScheduler]							,					UpperCAmelCase      :			StableDiffusionSafetyChecker							,					UpperCAmelCase      :			CLIPImageProcessor							,					UpperCAmelCase      :			bool = True							,					):
													super()._init_()

													__lowerCamelCase					:		Optional[int]		   =     StableDiffusionPipeline.from_pretrained(UpperCAmelCase    )
													__lowerCamelCase					:		Optional[int]		   =     StableDiffusionPipeline.from_pretrained(UpperCAmelCase    )
													__lowerCamelCase					:		Tuple		   =     StableDiffusionPipeline.from_pretrained(UpperCAmelCase    )
													__lowerCamelCase					:		List[str]		   =     StableDiffusionPipeline(
													    vae=UpperCAmelCase							,					text_encoder=UpperCAmelCase							,					tokenizer=UpperCAmelCase							,					unet=UpperCAmelCase							,					scheduler=UpperCAmelCase							,					safety_checker=UpperCAmelCase							,					feature_extractor=UpperCAmelCase							,					requires_safety_checker=UpperCAmelCase							,					)

													self.register_modules(pipelinea=self.pipea							,					pipelinea=self.pipea							,					pipelinea=self.pipea							,					pipelinea=self.pipea    )






						@property
						def       lowerCamelCase__     (       self      :			Dict    ):
													return {k: getattr(self							,					UpperCAmelCase    ) for k in self.config.keys() if not k.startswith("_"    )}






						def       lowerCamelCase__     (       self      :			str							,					UpperCAmelCase      :			Optional[Union[str, int]] = "auto"    ):
													if slice_size == "auto":
																				# half the attention head size is usually a good trade-off between
																				# speed and memory
																				__lowerCamelCase					:		Optional[int]		   =     self.unet.config.attention_head_dim // 2
													self.unet.set_attention_slice(UpperCAmelCase    )






						def       lowerCamelCase__     (       self      :			Tuple    ):
													self.enable_attention_slicing(UpperCAmelCase    )






						@torch.no_grad()
						def       lowerCamelCase__     (       self      :			Dict							,					UpperCAmelCase      :			Union[str, List[str]]							,					UpperCAmelCase      :			int = 512							,					UpperCAmelCase      :			int = 512							,					UpperCAmelCase      :			int = 50							,					UpperCAmelCase      :			float = 7.5							,					UpperCAmelCase      :			Optional[Union[str, List[str]]] = None							,					UpperCAmelCase      :			Optional[int] = 1							,					UpperCAmelCase      :			float = 0.0							,					UpperCAmelCase      :			Optional[torch.Generator] = None							,					UpperCAmelCase      :			Optional[torch.FloatTensor] = None							,					UpperCAmelCase      :			Optional[str] = "pil"							,					UpperCAmelCase      :			bool = True							,					UpperCAmelCase      :			Optional[Callable[[int, int, torch.FloatTensor], None]] = None							,					UpperCAmelCase      :			int = 1							,					**UpperCAmelCase      :			Optional[Any]							,					):
													return self.pipea(
													    prompt=UpperCAmelCase							,					height=UpperCAmelCase							,					width=UpperCAmelCase							,					num_inference_steps=UpperCAmelCase							,					guidance_scale=UpperCAmelCase							,					negative_prompt=UpperCAmelCase							,					num_images_per_prompt=UpperCAmelCase							,					eta=UpperCAmelCase							,					generator=UpperCAmelCase							,					latents=UpperCAmelCase							,					output_type=UpperCAmelCase							,					return_dict=UpperCAmelCase							,					callback=UpperCAmelCase							,					callback_steps=UpperCAmelCase							,					**UpperCAmelCase							,					)






						@torch.no_grad()
						def       lowerCamelCase__     (       self      :			Dict							,					UpperCAmelCase      :			Union[str, List[str]]							,					UpperCAmelCase      :			int = 512							,					UpperCAmelCase      :			int = 512							,					UpperCAmelCase      :			int = 50							,					UpperCAmelCase      :			float = 7.5							,					UpperCAmelCase      :			Optional[Union[str, List[str]]] = None							,					UpperCAmelCase      :			Optional[int] = 1							,					UpperCAmelCase      :			float = 0.0							,					UpperCAmelCase      :			Optional[torch.Generator] = None							,					UpperCAmelCase      :			Optional[torch.FloatTensor] = None							,					UpperCAmelCase      :			Optional[str] = "pil"							,					UpperCAmelCase      :			bool = True							,					UpperCAmelCase      :			Optional[Callable[[int, int, torch.FloatTensor], None]] = None							,					UpperCAmelCase      :			int = 1							,					**UpperCAmelCase      :			Union[str, Any]							,					):
													return self.pipea(
													    prompt=UpperCAmelCase							,					height=UpperCAmelCase							,					width=UpperCAmelCase							,					num_inference_steps=UpperCAmelCase							,					guidance_scale=UpperCAmelCase							,					negative_prompt=UpperCAmelCase							,					num_images_per_prompt=UpperCAmelCase							,					eta=UpperCAmelCase							,					generator=UpperCAmelCase							,					latents=UpperCAmelCase							,					output_type=UpperCAmelCase							,					return_dict=UpperCAmelCase							,					callback=UpperCAmelCase							,					callback_steps=UpperCAmelCase							,					**UpperCAmelCase							,					)






						@torch.no_grad()
						def       lowerCamelCase__     (       self      :			Tuple							,					UpperCAmelCase      :			Union[str, List[str]]							,					UpperCAmelCase      :			int = 512							,					UpperCAmelCase      :			int = 512							,					UpperCAmelCase      :			int = 50							,					UpperCAmelCase      :			float = 7.5							,					UpperCAmelCase      :			Optional[Union[str, List[str]]] = None							,					UpperCAmelCase      :			Optional[int] = 1							,					UpperCAmelCase      :			float = 0.0							,					UpperCAmelCase      :			Optional[torch.Generator] = None							,					UpperCAmelCase      :			Optional[torch.FloatTensor] = None							,					UpperCAmelCase      :			Optional[str] = "pil"							,					UpperCAmelCase      :			bool = True							,					UpperCAmelCase      :			Optional[Callable[[int, int, torch.FloatTensor], None]] = None							,					UpperCAmelCase      :			int = 1							,					**UpperCAmelCase      :			Dict							,					):
													return self.pipea(
													    prompt=UpperCAmelCase							,					height=UpperCAmelCase							,					width=UpperCAmelCase							,					num_inference_steps=UpperCAmelCase							,					guidance_scale=UpperCAmelCase							,					negative_prompt=UpperCAmelCase							,					num_images_per_prompt=UpperCAmelCase							,					eta=UpperCAmelCase							,					generator=UpperCAmelCase							,					latents=UpperCAmelCase							,					output_type=UpperCAmelCase							,					return_dict=UpperCAmelCase							,					callback=UpperCAmelCase							,					callback_steps=UpperCAmelCase							,					**UpperCAmelCase							,					)






						@torch.no_grad()
						def       lowerCamelCase__     (       self      :			Optional[Any]							,					UpperCAmelCase      :			Union[str, List[str]]							,					UpperCAmelCase      :			int = 512							,					UpperCAmelCase      :			int = 512							,					UpperCAmelCase      :			int = 50							,					UpperCAmelCase      :			float = 7.5							,					UpperCAmelCase      :			Optional[Union[str, List[str]]] = None							,					UpperCAmelCase      :			Optional[int] = 1							,					UpperCAmelCase      :			float = 0.0							,					UpperCAmelCase      :			Optional[torch.Generator] = None							,					UpperCAmelCase      :			Optional[torch.FloatTensor] = None							,					UpperCAmelCase      :			Optional[str] = "pil"							,					UpperCAmelCase      :			bool = True							,					UpperCAmelCase      :			Optional[Callable[[int, int, torch.FloatTensor], None]] = None							,					UpperCAmelCase      :			int = 1							,					**UpperCAmelCase      :			List[str]							,					):
													return self.pipea(
													    prompt=UpperCAmelCase							,					height=UpperCAmelCase							,					width=UpperCAmelCase							,					num_inference_steps=UpperCAmelCase							,					guidance_scale=UpperCAmelCase							,					negative_prompt=UpperCAmelCase							,					num_images_per_prompt=UpperCAmelCase							,					eta=UpperCAmelCase							,					generator=UpperCAmelCase							,					latents=UpperCAmelCase							,					output_type=UpperCAmelCase							,					return_dict=UpperCAmelCase							,					callback=UpperCAmelCase							,					callback_steps=UpperCAmelCase							,					**UpperCAmelCase							,					)







						@torch.no_grad()
						def       lowerCamelCase__     (       self      :			str							,					UpperCAmelCase      :			Union[str, List[str]]							,					UpperCAmelCase      :			int = 512							,					UpperCAmelCase      :			int = 512							,					UpperCAmelCase      :			int = 50							,					UpperCAmelCase      :			float = 7.5							,					UpperCAmelCase      :			Optional[Union[str, List[str]]] = None							,					UpperCAmelCase      :			Optional[int] = 1							,					UpperCAmelCase      :			float = 0.0							,					UpperCAmelCase      :			Optional[torch.Generator] = None							,					UpperCAmelCase      :			Optional[torch.FloatTensor] = None							,					UpperCAmelCase      :			Optional[str] = "pil"							,					UpperCAmelCase      :			bool = True							,					UpperCAmelCase      :			Optional[Callable[[int, int, torch.FloatTensor], None]] = None							,					UpperCAmelCase      :			int = 1							,					**UpperCAmelCase      :			Tuple							,					):
													__lowerCamelCase					:		Optional[int]		   =     "cuda" if torch.cuda.is_available() else "cpu"
													self.to(UpperCAmelCase    )

													# Checks if the height and width are divisible by 8 or not
													if height % 8 != 0 or width % 8 != 0:
																				raise ValueError(F"""`height` and `width` must be divisible by 8 but are {height} and {width}."""    )

													# Get first result from Stable Diffusion Checkpoint v1.1
													__lowerCamelCase					:		str		   =     self.textaimg_sda_a(
													    prompt=UpperCAmelCase							,					height=UpperCAmelCase							,					width=UpperCAmelCase							,					num_inference_steps=UpperCAmelCase							,					guidance_scale=UpperCAmelCase							,					negative_prompt=UpperCAmelCase							,					num_images_per_prompt=UpperCAmelCase							,					eta=UpperCAmelCase							,					generator=UpperCAmelCase							,					latents=UpperCAmelCase							,					output_type=UpperCAmelCase							,					return_dict=UpperCAmelCase							,					callback=UpperCAmelCase							,					callback_steps=UpperCAmelCase							,					**UpperCAmelCase							,					)

													# Get first result from Stable Diffusion Checkpoint v1.2
													__lowerCamelCase					:		Optional[int]		   =     self.textaimg_sda_a(
													    prompt=UpperCAmelCase							,					height=UpperCAmelCase							,					width=UpperCAmelCase							,					num_inference_steps=UpperCAmelCase							,					guidance_scale=UpperCAmelCase							,					negative_prompt=UpperCAmelCase							,					num_images_per_prompt=UpperCAmelCase							,					eta=UpperCAmelCase							,					generator=UpperCAmelCase							,					latents=UpperCAmelCase							,					output_type=UpperCAmelCase							,					return_dict=UpperCAmelCase							,					callback=UpperCAmelCase							,					callback_steps=UpperCAmelCase							,					**UpperCAmelCase							,					)

													# Get first result from Stable Diffusion Checkpoint v1.3
													__lowerCamelCase					:		Any		   =     self.textaimg_sda_a(
													    prompt=UpperCAmelCase							,					height=UpperCAmelCase							,					width=UpperCAmelCase							,					num_inference_steps=UpperCAmelCase							,					guidance_scale=UpperCAmelCase							,					negative_prompt=UpperCAmelCase							,					num_images_per_prompt=UpperCAmelCase							,					eta=UpperCAmelCase							,					generator=UpperCAmelCase							,					latents=UpperCAmelCase							,					output_type=UpperCAmelCase							,					return_dict=UpperCAmelCase							,					callback=UpperCAmelCase							,					callback_steps=UpperCAmelCase							,					**UpperCAmelCase							,					)

													# Get first result from Stable Diffusion Checkpoint v1.4
													__lowerCamelCase					:		Optional[Any]		   =     self.textaimg_sda_a(
													    prompt=UpperCAmelCase							,					height=UpperCAmelCase							,					width=UpperCAmelCase							,					num_inference_steps=UpperCAmelCase							,					guidance_scale=UpperCAmelCase							,					negative_prompt=UpperCAmelCase							,					num_images_per_prompt=UpperCAmelCase							,					eta=UpperCAmelCase							,					generator=UpperCAmelCase							,					latents=UpperCAmelCase							,					output_type=UpperCAmelCase							,					return_dict=UpperCAmelCase							,					callback=UpperCAmelCase							,					callback_steps=UpperCAmelCase							,					**UpperCAmelCase							,					)

													# Get all result images into a single list and pass it via StableDiffusionPipelineOutput for final result
													return StableDiffusionPipelineOutput([resa[0], resa[0], resa[0], resa[0]]    )