


"""simple docstring"""




import gc
import random
import unittest

import numpy as np
import torch
from PIL import Image
from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer

from diffusers import (
    AutoencoderKL,
    DDIMScheduler,
    EulerAncestralDiscreteScheduler,
    LMSDiscreteScheduler,
    PNDMScheduler,
    StableDiffusionInstructPixaPixPipeline,
    UNetaDConditionModel,
)
from diffusers.image_processor import VaeImageProcessor
from diffusers.utils import floats_tensor, load_image, slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism, require_torch_gpu

from ..pipeline_params import (
    IMAGE_TO_IMAGE_IMAGE_PARAMS,
    TEXT_GUIDED_IMAGE_INPAINTING_BATCH_PARAMS,
    TEXT_GUIDED_IMAGE_VARIATION_PARAMS,
)
from ..test_pipelines_common import PipelineKarrasSchedulerTesterMixin, PipelineLatentTesterMixin, PipelineTesterMixin


enable_full_determinism()


class 	A_ (	__UpperCamelCase ,				__UpperCamelCase ,				__UpperCamelCase ,				unittest.TestCase   ):




      '''simple docstring'''


      __snake_case 	=       StableDiffusionInstructPixaPixPipeline
      __snake_case 	=       TEXT_GUIDED_IMAGE_VARIATION_PARAMS - {"""height""", """width""", """cross_attention_kwargs"""}
      __snake_case 	=       TEXT_GUIDED_IMAGE_INPAINTING_BATCH_PARAMS
      __snake_case 	=       IMAGE_TO_IMAGE_IMAGE_PARAMS
      __snake_case 	=       IMAGE_TO_IMAGE_IMAGE_PARAMS




      def 					_snake_case     (    self:	List[str]    ):
       torch.manual_seed(0    )
       __lowerCamelCase		:							Optional[Any]		 =						UNetaDConditionModel(
           block_out_channels=(32, 64)						,				layers_per_block=2						,				sample_size=32						,				in_channels=8						,				out_channels=4						,				down_block_types=('DownBlock2D', 'CrossAttnDownBlock2D')						,				up_block_types=('CrossAttnUpBlock2D', 'UpBlock2D')						,				cross_attention_dim=32						,				)
       __lowerCamelCase		:							int		 =						PNDMScheduler(skip_prk_steps=lowerCamelCase_    )
       torch.manual_seed(0    )
       __lowerCamelCase		:							List[str]		 =						AutoencoderKL(
           block_out_channels=[32, 64]						,				in_channels=3						,				out_channels=3						,				down_block_types=['DownEncoderBlock2D', 'DownEncoderBlock2D']						,				up_block_types=['UpDecoderBlock2D', 'UpDecoderBlock2D']						,				latent_channels=4						,				)
       torch.manual_seed(0    )
       __lowerCamelCase		:							Dict		 =						CLIPTextConfig(
           bos_token_id=0						,				eos_token_id=2						,				hidden_size=32						,				intermediate_size=37						,				layer_norm_eps=1e-05						,				num_attention_heads=4						,				num_hidden_layers=5						,				pad_token_id=1						,				vocab_size=1000						,				)
       __lowerCamelCase		:							Union[str, Any]		 =						CLIPTextModel(lowerCamelCase_    )
       __lowerCamelCase		:							Optional[Any]		 =						CLIPTokenizer.from_pretrained('hf-internal-testing/tiny-random-clip'    )

       __lowerCamelCase		:							Dict		 =						{
           'unet': unet,
           'scheduler': scheduler,
           'vae': vae,
           'text_encoder': text_encoder,
           'tokenizer': tokenizer,
           'safety_checker': None,
           'feature_extractor': None,
       }
       return components




      def 					_snake_case     (    self:	List[Any]						,				a:	Any						,				a:	List[str]=0    ):
       __lowerCamelCase		:							Tuple		 =						floats_tensor((1, 3, 32, 32)						,				rng=random.Random(lowerCamelCase_    )    ).to(lowerCamelCase_    )
       __lowerCamelCase		:							Tuple		 =						image.cpu().permute(0						,				2						,				3						,				1    )[0]
       __lowerCamelCase		:							int		 =						Image.fromarray(np.uinta(lowerCamelCase_    )    ).convert('RGB'    )
       if str(lowerCamelCase_    ).startswith('mps'    ):
        __lowerCamelCase		:							List[str]		 =						torch.manual_seed(lowerCamelCase_    )
       else:
        __lowerCamelCase		:							Tuple		 =						torch.Generator(device=lowerCamelCase_    ).manual_seed(lowerCamelCase_    )
       __lowerCamelCase		:							str		 =						{
           'prompt': 'A painting of a squirrel eating a burger',
           'image': image,
           'generator': generator,
           'num_inference_steps': 2,
           'guidance_scale': 6.0,
           'image_guidance_scale': 1,
           'output_type': 'numpy',
       }
       return inputs




      def 					_snake_case     (    self:	str    ):
       __lowerCamelCase		:							Any		 =						'cpu'  # ensure determinism for the device-dependent torch.Generator
       __lowerCamelCase		:							Union[str, Any]		 =						self.get_dummy_components()
       __lowerCamelCase		:							int		 =						StableDiffusionInstructPixaPixPipeline(**lowerCamelCase_    )
       __lowerCamelCase		:							List[str]		 =						sd_pipe.to(lowerCamelCase_    )
       sd_pipe.set_progress_bar_config(disable=lowerCamelCase_    )

       __lowerCamelCase		:							int		 =						self.get_dummy_inputs(lowerCamelCase_    )
       __lowerCamelCase		:							Optional[Any]		 =						sd_pipe(**lowerCamelCase_    ).images
       __lowerCamelCase		:							str		 =						image[0, -3:, -3:, -1]
       assert image.shape == (1, 32, 32, 3)
       __lowerCamelCase		:							int		 =						np.array([0.7_5_2_6, 0.3_7_5_0, 0.4_5_4_7, 0.6_1_1_7, 0.5_8_6_6, 0.5_0_1_6, 0.4_3_2_7, 0.5_6_4_2, 0.4_8_1_5]    )

       assert np.abs(image_slice.flatten() - expected_slice    ).max() < 1e-3




      def 					_snake_case     (    self:	Union[str, Any]    ):
       __lowerCamelCase		:							Union[str, Any]		 =						'cpu'  # ensure determinism for the device-dependent torch.Generator
       __lowerCamelCase		:							Union[str, Any]		 =						self.get_dummy_components()
       __lowerCamelCase		:							Union[str, Any]		 =						StableDiffusionInstructPixaPixPipeline(**lowerCamelCase_    )
       __lowerCamelCase		:							Tuple		 =						sd_pipe.to(lowerCamelCase_    )
       sd_pipe.set_progress_bar_config(disable=lowerCamelCase_    )

       __lowerCamelCase		:							Union[str, Any]		 =						self.get_dummy_inputs(lowerCamelCase_    )
       __lowerCamelCase		:							Optional[Any]		 =						'french fries'
       __lowerCamelCase		:							str		 =						sd_pipe(**lowerCamelCase_						,				negative_prompt=lowerCamelCase_    )
       __lowerCamelCase		:							List[str]		 =						output.images
       __lowerCamelCase		:							Optional[int]		 =						image[0, -3:, -3:, -1]

       assert image.shape == (1, 32, 32, 3)
       __lowerCamelCase		:							int		 =						np.array([0.7_5_1_1, 0.3_6_4_2, 0.4_5_5_3, 0.6_2_3_6, 0.5_7_9_7, 0.5_0_1_3, 0.4_3_4_3, 0.5_6_1_1, 0.4_8_3_1]    )

       assert np.abs(image_slice.flatten() - expected_slice    ).max() < 1e-3




      def 					_snake_case     (    self:	Tuple    ):
       __lowerCamelCase		:							Any		 =						'cpu'  # ensure determinism for the device-dependent torch.Generator
       __lowerCamelCase		:							Any		 =						self.get_dummy_components()
       __lowerCamelCase		:							str		 =						StableDiffusionInstructPixaPixPipeline(**lowerCamelCase_    )
       __lowerCamelCase		:							Tuple		 =						sd_pipe.to(lowerCamelCase_    )
       sd_pipe.set_progress_bar_config(disable=lowerCamelCase_    )

       __lowerCamelCase		:							List[str]		 =						self.get_dummy_inputs(lowerCamelCase_    )
       __lowerCamelCase		:							List[str]		 =						[inputs['prompt']] * 2

       __lowerCamelCase		:							Optional[Any]		 =						np.array(inputs['image']    ).astype(np.floataa    ) / 2_5_5.0
       __lowerCamelCase		:							List[Any]		 =						torch.from_numpy(lowerCamelCase_    ).unsqueeze(0    ).to(lowerCamelCase_    )
       __lowerCamelCase		:							Any		 =						image / 2 + 0.5
       __lowerCamelCase		:							Optional[Any]		 =						image.permute(0						,				3						,				1						,				2    )
       __lowerCamelCase		:							str		 =						image.repeat(2						,				1						,				1						,				1    )

       __lowerCamelCase		:							Tuple		 =						sd_pipe(**lowerCamelCase_    ).images
       __lowerCamelCase		:							Dict		 =						image[-1, -3:, -3:, -1]

       assert image.shape == (2, 32, 32, 3)
       __lowerCamelCase		:							List[Any]		 =						np.array([0.5_8_1_2, 0.5_7_4_8, 0.5_2_2_2, 0.5_9_0_8, 0.5_6_9_5, 0.7_1_7_4, 0.6_8_0_4, 0.5_5_2_3, 0.5_5_7_9]    )

       assert np.abs(image_slice.flatten() - expected_slice    ).max() < 1e-3




      def 					_snake_case     (    self:	List[str]    ):
       __lowerCamelCase		:							Tuple		 =						'cpu'  # ensure determinism for the device-dependent torch.Generator
       __lowerCamelCase		:							Optional[int]		 =						self.get_dummy_components()
       __lowerCamelCase		:							int		 =						EulerAncestralDiscreteScheduler(
           beta_start=0.0_0_0_8_5						,				beta_end=0.0_1_2						,				beta_schedule='scaled_linear'    )
       __lowerCamelCase		:							Optional[int]		 =						StableDiffusionInstructPixaPixPipeline(**lowerCamelCase_    )
       __lowerCamelCase		:							Optional[int]		 =						sd_pipe.to(lowerCamelCase_    )
       sd_pipe.set_progress_bar_config(disable=lowerCamelCase_    )

       __lowerCamelCase		:							Dict		 =						self.get_dummy_inputs(lowerCamelCase_    )
       __lowerCamelCase		:							int		 =						sd_pipe(**lowerCamelCase_    ).images
       __lowerCamelCase		:							List[Any]		 =						image[0, -3:, -3:, -1]

       __lowerCamelCase		:							Any		 =						[round(lowerCamelCase_						,				4    ) for x in image_slice.flatten().tolist()]
       print(','.join([str(lowerCamelCase_    ) for x in slice]    )    )

       assert image.shape == (1, 32, 32, 3)
       __lowerCamelCase		:							Optional[Any]		 =						np.array([0.7_4_1_7, 0.3_8_4_2, 0.4_7_3_2, 0.5_7_7_6, 0.5_8_9_1, 0.5_1_3_9, 0.4_0_5_2, 0.5_6_7_3, 0.4_9_8_6]    )

       assert np.abs(image_slice.flatten() - expected_slice    ).max() < 1e-3




      def 					_snake_case     (    self:	Dict    ):
       super().test_inference_batch_single_identical(expected_max_diff=3e-3    )




      def 					_snake_case     (    self:	Tuple    ):
       __lowerCamelCase		:							List[Any]		 =						self.get_dummy_components()
       __lowerCamelCase		:							Union[str, Any]		 =						StableDiffusionInstructPixaPixPipeline(**lowerCamelCase_    )
       __lowerCamelCase		:							List[Any]		 =						VaeImageProcessor(do_resize=lowerCamelCase_						,				do_normalize=lowerCamelCase_    )
       __lowerCamelCase		:							Tuple		 =						pipe.to(lowerCamelCase_    )
       pipe.set_progress_bar_config(disable=lowerCamelCase_    )

       __lowerCamelCase		:							Dict		 =						pipe(**self.get_dummy_inputs_by_type(lowerCamelCase_						,				input_image_type='pt'    )    )[0]

       __lowerCamelCase		:							Any		 =						components['vae']
       __lowerCamelCase		:							int		 =						self.get_dummy_inputs_by_type(lowerCamelCase_						,				input_image_type='pt'    )

       for image_param in self.image_latents_params:
        if image_param in inputs.keys():
         __lowerCamelCase		:							Dict		 =						vae.encode(inputs[image_param]    ).latent_dist.mode()

       __lowerCamelCase		:							Any		 =						pipe(**lowerCamelCase_    )[0]

       __lowerCamelCase		:							Any		 =						np.abs(out - out_latents_inputs    ).max()
       self.assertLess(lowerCamelCase_						,				1e-4						,				'passing latents as image input generate different result from passing image'    )



@slow
@require_torch_gpu
class 	A_ (	unittest.TestCase   ):




      '''simple docstring'''


      def 					_snake_case     (    self:	str    ):
       super().tearDown()
       gc.collect()
       torch.cuda.empty_cache()




      def 					_snake_case     (    self:	Optional[Any]						,				a:	Dict=0    ):
       __lowerCamelCase		:							Any		 =						torch.manual_seed(lowerCamelCase_    )
       __lowerCamelCase		:							List[str]		 =						load_image(
           'https://huggingface.co/datasets/diffusers/test-arrays/resolve/main/stable_diffusion_pix2pix/example.jpg'    )
       __lowerCamelCase		:							List[str]		 =						{
           'prompt': 'turn him into a cyborg',
           'image': image,
           'generator': generator,
           'num_inference_steps': 3,
           'guidance_scale': 7.5,
           'image_guidance_scale': 1.0,
           'output_type': 'numpy',
       }
       return inputs




      def 					_snake_case     (    self:	List[Any]    ):
       __lowerCamelCase		:							Any		 =						StableDiffusionInstructPixaPixPipeline.from_pretrained(
           'timbrooks/instruct-pix2pix'						,				safety_checker=lowerCamelCase_    )
       pipe.to(lowerCamelCase_    )
       pipe.set_progress_bar_config(disable=lowerCamelCase_    )
       pipe.enable_attention_slicing()

       __lowerCamelCase		:							List[str]		 =						self.get_inputs()
       __lowerCamelCase		:							int		 =						pipe(**lowerCamelCase_    ).images
       __lowerCamelCase		:							Union[str, Any]		 =						image[0, -3:, -3:, -1].flatten()

       assert image.shape == (1, 512, 512, 3)
       __lowerCamelCase		:							Optional[Any]		 =						np.array([0.5_9_0_2, 0.6_0_1_5, 0.6_0_2_7, 0.5_9_8_3, 0.6_0_9_2, 0.6_0_6_1, 0.5_7_6_5, 0.5_7_8_5, 0.5_5_5_5]    )

       assert np.abs(expected_slice - image_slice    ).max() < 1e-3




      def 					_snake_case     (    self:	Union[str, Any]    ):
       __lowerCamelCase		:							Any		 =						StableDiffusionInstructPixaPixPipeline.from_pretrained(
           'timbrooks/instruct-pix2pix'						,				safety_checker=lowerCamelCase_    )
       __lowerCamelCase		:							Union[str, Any]		 =						LMSDiscreteScheduler.from_config(pipe.scheduler.config    )
       pipe.to(lowerCamelCase_    )
       pipe.set_progress_bar_config(disable=lowerCamelCase_    )
       pipe.enable_attention_slicing()

       __lowerCamelCase		:							int		 =						self.get_inputs()
       __lowerCamelCase		:							int		 =						pipe(**lowerCamelCase_    ).images
       __lowerCamelCase		:							List[Any]		 =						image[0, -3:, -3:, -1].flatten()

       assert image.shape == (1, 512, 512, 3)
       __lowerCamelCase		:							Any		 =						np.array([0.6_5_7_8, 0.6_8_1_7, 0.6_9_7_2, 0.6_7_6_1, 0.6_8_5_6, 0.6_9_1_6, 0.6_4_2_8, 0.6_5_1_6, 0.6_3_0_1]    )

       assert np.abs(expected_slice - image_slice    ).max() < 1e-3




      def 					_snake_case     (    self:	Tuple    ):
       __lowerCamelCase		:							str		 =						StableDiffusionInstructPixaPixPipeline.from_pretrained(
           'timbrooks/instruct-pix2pix'						,				safety_checker=lowerCamelCase_    )
       __lowerCamelCase		:							Any		 =						DDIMScheduler.from_config(pipe.scheduler.config    )
       pipe.to(lowerCamelCase_    )
       pipe.set_progress_bar_config(disable=lowerCamelCase_    )
       pipe.enable_attention_slicing()

       __lowerCamelCase		:							Union[str, Any]		 =						self.get_inputs()
       __lowerCamelCase		:							int		 =						pipe(**lowerCamelCase_    ).images
       __lowerCamelCase		:							Union[str, Any]		 =						image[0, -3:, -3:, -1].flatten()

       assert image.shape == (1, 512, 512, 3)
       __lowerCamelCase		:							Any		 =						np.array([0.3_8_2_8, 0.3_8_3_4, 0.3_8_1_8, 0.3_7_9_2, 0.3_8_6_5, 0.3_7_5_2, 0.3_7_9_2, 0.3_8_4_7, 0.3_7_5_3]    )

       assert np.abs(expected_slice - image_slice    ).max() < 1e-3




      def 					_snake_case     (    self:	Union[str, Any]    ):
       __lowerCamelCase		:							List[Any]		 =						0

       def callback_fn(a:	Optional[Any]						,				a:	Union[str, Any]						,				a:	List[str]    ) -> None:
        __lowerCamelCase		:							Optional[int]		 =						True
        nonlocal number_of_steps
        number_of_steps += 1
        if step == 1:
         __lowerCamelCase		:							List[str]		 =						latents.detach().cpu().numpy()
         assert latents.shape == (1, 4, 64, 64)
         __lowerCamelCase		:							str		 =						latents[0, -3:, -3:, -1]
         __lowerCamelCase		:							Optional[int]		 =						np.array([-0.2_4_6_3, -0.4_6_4_4, -0.9_7_5_6, 1.5_1_7_6, 1.4_4_1_4, 0.7_8_6_6, 0.9_8_9_7, 0.8_5_2_1, 0.7_9_8_3]    )

         assert np.abs(latents_slice.flatten() - expected_slice    ).max() < 5e-2
        elif step == 2:
         __lowerCamelCase		:							Dict		 =						latents.detach().cpu().numpy()
         assert latents.shape == (1, 4, 64, 64)
         __lowerCamelCase		:							str		 =						latents[0, -3:, -3:, -1]
         __lowerCamelCase		:							Optional[int]		 =						np.array([-0.2_6_4_4, -0.4_6_2_6, -0.9_6_5_3, 1.5_1_7_6, 1.4_5_5_1, 0.7_6_8_6, 0.9_8_0_5, 0.8_4_5_2, 0.8_1_1_5]    )

         assert np.abs(latents_slice.flatten() - expected_slice    ).max() < 5e-2

       __lowerCamelCase		:							Optional[Any]		 =						False

       __lowerCamelCase		:							str		 =						StableDiffusionInstructPixaPixPipeline.from_pretrained(
           'timbrooks/instruct-pix2pix'						,				safety_checker=lowerCamelCase_						,				torch_dtype=torch.floataa    )
       __lowerCamelCase		:							Optional[int]		 =						pipe.to(lowerCamelCase_    )
       pipe.set_progress_bar_config(disable=lowerCamelCase_    )
       pipe.enable_attention_slicing()

       __lowerCamelCase		:							Union[str, Any]		 =						self.get_inputs()
       pipe(**lowerCamelCase_						,				callback=lowerCamelCase_						,				callback_steps=1    )
       assert callback_fn.has_been_called
       assert number_of_steps == 3




      def 					_snake_case     (    self:	List[str]    ):
       torch.cuda.empty_cache()
       torch.cuda.reset_max_memory_allocated()
       torch.cuda.reset_peak_memory_stats()

       __lowerCamelCase		:							Union[str, Any]		 =						StableDiffusionInstructPixaPixPipeline.from_pretrained(
           'timbrooks/instruct-pix2pix'						,				safety_checker=lowerCamelCase_						,				torch_dtype=torch.floataa    )
       __lowerCamelCase		:							str		 =						pipe.to(lowerCamelCase_    )
       pipe.set_progress_bar_config(disable=lowerCamelCase_    )
       pipe.enable_attention_slicing(1    )
       pipe.enable_sequential_cpu_offload()

       __lowerCamelCase		:							Optional[Any]		 =						self.get_inputs()
       __lowerCamelCase		:							Optional[int]		 =						pipe(**lowerCamelCase_    )

       __lowerCamelCase		:							Any		 =						torch.cuda.max_memory_allocated()
       # make sure that less than 2.2 GB is allocated
       assert mem_bytes < 2.2 * 10**9




      def 					_snake_case     (    self:	Tuple    ):
       __lowerCamelCase		:							List[Any]		 =						self.get_inputs()
       # resize to resolution that is divisible by 8 but not 16 or 32
       __lowerCamelCase		:							Any		 =						inputs['image'].resize((504, 504)    )

       __lowerCamelCase		:							Dict		 =						'timbrooks/instruct-pix2pix'
       __lowerCamelCase		:							List[Any]		 =						StableDiffusionInstructPixaPixPipeline.from_pretrained(
           lowerCamelCase_						,				safety_checker=lowerCamelCase_						,				)
       pipe.to(lowerCamelCase_    )
       pipe.set_progress_bar_config(disable=lowerCamelCase_    )
       pipe.enable_attention_slicing()

       __lowerCamelCase		:							int		 =						pipe(**lowerCamelCase_    )
       __lowerCamelCase		:							Any		 =						output.images[0]

       __lowerCamelCase		:							Dict		 =						image[255:258, 383:386, -1]

       assert image.shape == (504, 504, 3)
       __lowerCamelCase		:							str		 =						np.array([0.2_7_2_6, 0.2_5_2_9, 0.2_6_6_4, 0.2_6_5_5, 0.2_6_4_1, 0.2_6_4_2, 0.2_5_9_1, 0.2_6_4_9, 0.2_5_9_0]    )

       assert np.abs(image_slice.flatten() - expected_slice    ).max() < 5e-3





import datasets


lowercase_	   =     '\\n@InProceedings{conneau2018xnli,\n  author = "Conneau, Alexis\n                 and Rinott, Ruty\n                 and Lample, Guillaume\n                 and Williams, Adina\n                 and Bowman, Samuel R.\n                 and Schwenk, Holger\n                 and Stoyanov, Veselin",\n  title = "XNLI: Evaluating Cross-lingual Sentence Representations",\n  booktitle = "Proceedings of the 2018 Conference on Empirical Methods\n               in Natural Language Processing",\n  year = "2018",\n  publisher = "Association for Computational Linguistics",\n  location = "Brussels, Belgium",\n}\n'

lowercase_	   =     '\\nXNLI is a subset of a few thousand examples from MNLI which has been translated\ninto a 14 different languages (some low-ish resource). As with MNLI, the goal is\nto predict textual entailment (does sentence A imply/contradict/neither sentence\nB) and is a classification task (given two sentences, predict one of three\nlabels).\n'

lowercase_	   =     '\nComputes XNLI score which is just simple accuracy.\nArgs:\n    predictions: Predicted labels.\n    references: Ground truth labels.\nReturns:\n    \'accuracy\': accuracy\nExamples:\n\n    >>> predictions = [0, 1]\n    >>> references = [0, 1]\n    >>> xnli_metric = datasets.load_metric("xnli")\n    >>> results = xnli_metric.compute(predictions=predictions, references=references)\n    >>> print(results)\n    {\'accuracy\': 1.0}\n'
def 				UpperCamelCase__					(  SCREAMING_SNAKE_CASE__      ,	SCREAMING_SNAKE_CASE__						):
 return (preds == labels).mean()



@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION ,				_KWARGS_DESCRIPTION   )
class 	A_ (	datasets.Metric   ):




      '''simple docstring'''


      def 					_snake_case     (    self:	Union[str, Any]    ):
       return datasets.MetricInfo(
           description=_DESCRIPTION						,				citation=_CITATION						,				inputs_description=_KWARGS_DESCRIPTION						,				features=datasets.Features(
               {
                   'predictions': datasets.Value('int64' if self.config_name != 'sts-b' else 'float32'    ),
                   'references': datasets.Value('int64' if self.config_name != 'sts-b' else 'float32'    ),
               }    )						,				codebase_urls=[]						,				reference_urls=[]						,				format='numpy'						,				)




      def 					_snake_case     (    self:	int						,				a:	Optional[Any]						,				a:	Optional[Any]    ):
       return {"accuracy": simple_accuracy(a						,				a    )}

