




"""simple docstring"""







import asyncio
import os
import re
import sys
import tempfile
import unittest
from contextlib import contextmanager
from copy import deepcopy
from distutils.util import strtobool
from enum import Enum
from importlib.util import find_spec
from pathlib import Path
from unittest.mock import patch

import pyarrow as pa
import pytest
import requests
from packaging import version

from datasets import config


if config.PY_VERSION < version.parse('3.8'):
  import importlib_metadata
else:
  import importlib.metadata as importlib_metadata





def      __snake_case (				_lowercase			,_lowercase=False    ):


    """simple docstring"""







    try:
        UpperCamelCase              =	os.environ[key]
    except KeyError:
        # KEY isn't set, default to `default`.
        UpperCamelCase              =	default
    else:
        # KEY is set, convert it to True or False.
        try:
            UpperCamelCase              =	strtobool(_lowercase    )
        except ValueError:
            # More values are supported, but let's keep the message simple.
            raise ValueError(f'If set, {key} must be yes or no.'    )
    return _value


SCREAMING_SNAKE_CASE_	     =       parse_flag_from_env('RUN_SLOW', default=False)
SCREAMING_SNAKE_CASE_	     =       parse_flag_from_env('RUN_REMOTE', default=False)
SCREAMING_SNAKE_CASE_	     =       parse_flag_from_env('RUN_LOCAL', default=True)
SCREAMING_SNAKE_CASE_	     =       parse_flag_from_env('RUN_PACKAGED', default=True)

# Compression
SCREAMING_SNAKE_CASE_	     =       pytest.mark.skipif(not config.LZ4_AVAILABLE, reason='test requires lz4')
SCREAMING_SNAKE_CASE_	     =       pytest.mark.skipif(not config.PY7ZR_AVAILABLE, reason='test requires py7zr')
SCREAMING_SNAKE_CASE_	     =       pytest.mark.skipif(not config.ZSTANDARD_AVAILABLE, reason='test requires zstandard')

# Audio
SCREAMING_SNAKE_CASE_	     =       pytest.mark.skipif(
    # On Windows and OS X, soundfile installs sndfile
    find_spec('soundfile') is None or version.parse(importlib_metadata.version('soundfile')) < version.parse('0.12.0'),
    reason='test requires sndfile>=0.12.1: \'pip install \"soundfile>=0.12.1\"\'; ',
)

# Beam
SCREAMING_SNAKE_CASE_	     =       pytest.mark.skipif(
    not config.BEAM_AVAILABLE or config.DILL_VERSION >= version.parse('0.3.2'),
    reason='test requires apache-beam and a compatible dill version',
)

# Dill-cloudpickle compatibility
SCREAMING_SNAKE_CASE_	     =       pytest.mark.skipif(
    config.DILL_VERSION <= version.parse('0.3.2'),
    reason='test requires dill>0.3.2 for cloudpickle compatibility',
)

# Windows
SCREAMING_SNAKE_CASE_	     =       pytest.mark.skipif(
    sys.platform == 'win32',
    reason='test should not be run on Windows',
)





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    try:
        import faiss  # noqa
    except ImportError:
        UpperCamelCase              =	unittest.skip('''test requires faiss'''    )(_lowercase    )
    return test_case





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    try:
        import regex  # noqa
    except ImportError:
        UpperCamelCase              =	unittest.skip('''test requires regex'''    )(_lowercase    )
    return test_case





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    try:
        import elasticsearch  # noqa
    except ImportError:
        UpperCamelCase              =	unittest.skip('''test requires elasticsearch'''    )(_lowercase    )
    return test_case





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    try:
        import sqlalchemy  # noqa
    except ImportError:
        UpperCamelCase              =	unittest.skip('''test requires sqlalchemy'''    )(_lowercase    )
    return test_case





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    if not config.TORCH_AVAILABLE:
        UpperCamelCase              =	unittest.skip('''test requires PyTorch'''    )(_lowercase    )
    return test_case





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    if not config.TF_AVAILABLE:
        UpperCamelCase              =	unittest.skip('''test requires TensorFlow'''    )(_lowercase    )
    return test_case





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    if not config.JAX_AVAILABLE:
        UpperCamelCase              =	unittest.skip('''test requires JAX'''    )(_lowercase    )
    return test_case





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    if not config.PIL_AVAILABLE:
        UpperCamelCase              =	unittest.skip('''test requires Pillow'''    )(_lowercase    )
    return test_case





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    try:
        import transformers  # noqa F401
    except ImportError:
        return unittest.skip('''test requires transformers'''    )(_lowercase    )
    else:
        return test_case





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    try:
        import tiktoken  # noqa F401
    except ImportError:
        return unittest.skip('''test requires tiktoken'''    )(_lowercase    )
    else:
        return test_case





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    try:
        import spacy  # noqa F401
    except ImportError:
        return unittest.skip('''test requires spacy'''    )(_lowercase    )
    else:
        return test_case





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    def _require_spacy_model(_lowercase    ):
        try:
            import spacy  # noqa F401

            spacy.load(_lowercase    )
        except ImportError:
            return unittest.skip('''test requires spacy'''    )(_lowercase    )
        except OSError:
            return unittest.skip('''test requires spacy model \'{}\''''.format(_lowercase    )    )(_lowercase    )
        else:
            return test_case

    return _require_spacy_model





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    try:
        import pyspark  # noqa F401
    except ImportError:
        return unittest.skip('''test requires pyspark'''    )(_lowercase    )
    else:
        return test_case





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    try:
        import joblibspark  # noqa F401
    except ImportError:
        return unittest.skip('''test requires joblibspark'''    )(_lowercase    )
    else:
        return test_case





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    if not _run_slow_tests or _run_slow_tests == 0:
        UpperCamelCase              =	unittest.skip('''test is slow'''    )(_lowercase    )
    return test_case





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    if not _run_local_tests or _run_local_tests == 0:
        UpperCamelCase              =	unittest.skip('''test is local'''    )(_lowercase    )
    return test_case





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    if not _run_packaged_tests or _run_packaged_tests == 0:
        UpperCamelCase              =	unittest.skip('''test is packaged'''    )(_lowercase    )
    return test_case





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    if not _run_remote_tests or _run_remote_tests == 0:
        UpperCamelCase              =	unittest.skip('''test requires remote'''    )(_lowercase    )
    return test_case





def      __snake_case (				*_lowercase    ):


    """simple docstring"""







    def decorate(cls    ):
        for name, fn in cls.__dict__.items():
            if callable(_lowercase    ) and name.startswith('''test'''    ):
                for decorator in decorators:
                    UpperCamelCase              =	decorator(_lowercase    )
                setattr(cls			,_lowercase			,_lowercase    )
        return cls

    return decorate

class 				snake_case_			(					lowerCamelCase_			):







   """simple docstring"""




   pass

class 				snake_case_			(					lowerCamelCase_			):







   """simple docstring"""




   A_				      =       0
   A_				      =       1
   A_				      =       2





@contextmanager
def      __snake_case (				_lowercase=OfflineSimulationMode.CONNECTION_FAILS			,_lowercase=1e-16    ):


    """simple docstring"""







    UpperCamelCase              =	requests.Session().request

    def timeout_request(_lowercase			,_lowercase			,_lowercase			,**_lowercase    ):
        # Change the url to an invalid url so that the connection hangs
        UpperCamelCase              =	'''https://10.255.255.1'''
        if kwargs.get('''timeout'''    ) is None:
            raise RequestWouldHangIndefinitelyError(
                f'Tried a call to {url} in offline mode with no timeout set. Please set a timeout.'    )
        UpperCamelCase              =	timeout
        try:
            return online_request(_lowercase			,_lowercase			,**_lowercase    )
        except Exception as e:
            # The following changes in the error are just here to make the offline timeout error prettier
            UpperCamelCase              =	url
            UpperCamelCase              =	e.args[0]
            UpperCamelCase              =	(max_retry_error.args[0].replace('''10.255.255.1'''			,f'OfflineMock[{url}]'    ),)
            UpperCamelCase              =	(max_retry_error,)
            raise

    def raise_connection_error(_lowercase			,_lowercase			,**_lowercase    ):
        raise requests.ConnectionError('''Offline mode is enabled.'''			,request=_lowercase    )

    if mode is OfflineSimulationMode.CONNECTION_FAILS:
        with patch('''requests.Session.send'''			,_lowercase    ):
            yield
    elif mode is OfflineSimulationMode.CONNECTION_TIMES_OUT:
        # inspired from https://stackoverflow.com/a/904609
        with patch('''requests.Session.request'''			,_lowercase    ):
            yield
    elif mode is OfflineSimulationMode.HF_DATASETS_OFFLINE_SET_TO_1:
        with patch('''datasets.config.HF_DATASETS_OFFLINE'''			,_lowercase    ):
            yield
    else:
        raise ValueError('''Please use a value from the OfflineSimulationMode enum.'''    )





@contextmanager
def      __snake_case (				*_lowercase			,**_lowercase    ):


    """simple docstring"""







    UpperCamelCase              =	str(Path().resolve()    )
    with tempfile.TemporaryDirectory(*_lowercase			,**_lowercase    ) as tmp_dir:
        try:
            os.chdir(_lowercase    )
            yield
        finally:
            os.chdir(_lowercase    )





@contextmanager
def      __snake_case (				):


    """simple docstring"""







    import gc

    gc.collect()
    UpperCamelCase              =	pa.total_allocated_bytes()
    yield
    assert pa.total_allocated_bytes() - previous_allocated_memory > 0, "Arrow memory didn't increase."





@contextmanager
def      __snake_case (				):


    """simple docstring"""







    import gc

    gc.collect()
    UpperCamelCase              =	pa.total_allocated_bytes()
    yield
    assert pa.total_allocated_bytes() - previous_allocated_memory <= 0, "Arrow memory wasn't expected to increase."





def      __snake_case (				_lowercase			,_lowercase    ):


    """simple docstring"""







    return deepcopy(_lowercase    ).integers(0			,100			,10    ).tolist() == deepcopy(_lowercase    ).integers(0			,100			,10    ).tolist()





def      __snake_case (				_lowercase    ):


    """simple docstring"""







    import decorator
    from requests.exceptions import HTTPError

    def _wrapper(_lowercase			,*_lowercase			,**_lowercase    ):
        try:
            return func(*_lowercase			,**_lowercase    )
        except HTTPError as err:
            if str(_lowercase    ).startswith('''500'''    ) or str(_lowercase    ).startswith('''502'''    ):
                pytest.xfail(str(_lowercase    )    )
            raise err

    return decorator.decorator(_wrapper			,_lowercase    )

class 				snake_case_			:







   """simple docstring"""




   def __init__(		self       ,					lowerCamelCase_       ,					lowerCamelCase_       ,					lowerCamelCase_)				->   Dict:
       UpperCamelCase              =	returncode
       UpperCamelCase              =	stdout
       UpperCamelCase              =	stderr





async def      __snake_case (				_lowercase			,_lowercase    ):


    """simple docstring"""







    while True:
        UpperCamelCase              =	await stream.readline()
        if line:
            callback(_lowercase    )
        else:
            break





async def      __snake_case (				_lowercase			,_lowercase=None			,_lowercase=None			,_lowercase=None			,_lowercase=False			,_lowercase=False    ):


    """simple docstring"""







    if echo:
        print('''\nRunning: '''			,''' '''.join(_lowercase    )    )

    UpperCamelCase              =	await asyncio.create_subprocess_exec(
        cmd[0]			,*cmd[1:]			,stdin=_lowercase			,stdout=asyncio.subprocess.PIPE			,stderr=asyncio.subprocess.PIPE			,env=_lowercase			,)

    # note: there is a warning for a possible deadlock when using `wait` with huge amounts of data in the pipe
    # https://docs.python.org/3/library/asyncio-subprocess.html#asyncio.asyncio.subprocess.Process.wait
    #
    # If it starts hanging, will need to switch to the following code. The problem is that no data
    # will be seen until it's done and if it hangs for example there will be no debug info.
    # out, err = await p.communicate()
    # return _RunOutput(p.returncode, out, err)

    UpperCamelCase              =	[]
    UpperCamelCase              =	[]

    def tee(_lowercase			,_lowercase			,_lowercase			,_lowercase=""    ):
        UpperCamelCase              =	line.decode('''utf-8'''    ).rstrip()
        sink.append(_lowercase    )
        if not quiet:
            print(_lowercase			,_lowercase			,file=_lowercase    )

    # XXX: the timeout doesn't seem to make any difference here
    await asyncio.wait(
        [
            _read_stream(p.stdout			,lambda _lowercase    : tee(_lowercase			,_lowercase			,sys.stdout			,label='''stdout:'''    )    ),
            _read_stream(p.stderr			,lambda _lowercase    : tee(_lowercase			,_lowercase			,sys.stderr			,label='''stderr:'''    )    ),
        ]			,timeout=_lowercase			,)
    return _RunOutput(await p.wait()			,_lowercase			,_lowercase    )





def      __snake_case (				_lowercase			,_lowercase=None			,_lowercase=None			,_lowercase=180			,_lowercase=False			,_lowercase=True    ):


    """simple docstring"""







    UpperCamelCase              =	asyncio.get_event_loop()
    UpperCamelCase              =	loop.run_until_complete(
        _stream_subprocess(_lowercase			,env=_lowercase			,stdin=_lowercase			,timeout=_lowercase			,quiet=_lowercase			,echo=_lowercase    )    )

    UpperCamelCase              =	''' '''.join(_lowercase    )
    if result.returncode > 0:
        UpperCamelCase              =	'''\n'''.join(result.stderr    )
        raise RuntimeError(
            f'\'{cmd_str}\' failed with returncode {result.returncode}\n\n'
            f'The combined stderr from workers follows:\n{stderr}'    )

    # check that the subprocess actually did run and produced some output, should the test rely on
    # the remote side to do the testing
    if not result.stdout and not result.stderr:
        raise RuntimeError(f'\'{cmd_str}\' produced no output.'    )

    return result





def      __snake_case (				):


    """simple docstring"""







    UpperCamelCase              =	os.environ.get('''PYTEST_XDIST_WORKER'''			,'''gw0'''    )
    UpperCamelCase              =	re.sub(r'''^gw'''			,''''''			,_lowercase			,0			,re.M    )
    return int(_lowercase    )





def      __snake_case (				):


    """simple docstring"""







    UpperCamelCase              =	2_9500
    UpperCamelCase              =	pytest_xdist_worker_id()
    return port + uniq_delta







import gc
import random
import unittest

import numpy as np
import torch

from diffusers import DDIMScheduler, KandinskyVaaPipeline, KandinskyVaaPriorPipeline, UNetaDConditionModel, VQModel
from diffusers.utils import floats_tensor, load_numpy, slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism, require_torch_gpu

from ..test_pipelines_common import PipelineTesterMixin, assert_mean_pixel_difference


enable_full_determinism()







class 		_A						( UpperCAmelCase_	,				unittest.TestCase ):
  lowercase_						:			int						=					KandinskyVaaPipeline
  lowercase_						:			Union[str, Any]						=					[
      '''image_embeds''',
      '''negative_image_embeds''',
  ]
  lowercase_						:			int						=					['''image_embeds''', '''negative_image_embeds''']
  lowercase_						:			str						=					[
      '''generator''',
      '''height''',
      '''width''',
      '''latents''',
      '''guidance_scale''',
      '''num_inference_steps''',
      '''return_dict''',
      '''guidance_scale''',
      '''num_images_per_prompt''',
      '''output_type''',
      '''return_dict''',
  ]
  lowercase_						:			str						=					False

  @property
  def    a					(    self						:	int			):
     """simple docstring"""

     return 32

  @property
  def    a					(    self						:	str			):
     """simple docstring"""

     return 32

  @property
  def    a					(    self						:	Optional[int]			):
     """simple docstring"""

     return self.time_input_dim

  @property
  def    a					(    self						:	Optional[int]			):
     """simple docstring"""

     return self.time_input_dim * 4

  @property
  def    a					(    self						:	Optional[Any]			):
     """simple docstring"""

     return 1_00

  @property
  def    a					(    self						:	str			):
     """simple docstring"""

     torch.manual_seed(0			)

     __UpperCamelCase	:			int					=					{
         """in_channels""": 4,
         # Out channels is double in channels because predicts mean and variance
         """out_channels""": 8,
         """addition_embed_type""": """image""",
         """down_block_types""": ("""ResnetDownsampleBlock2D""", """SimpleCrossAttnDownBlock2D"""),
         """up_block_types""": ("""SimpleCrossAttnUpBlock2D""", """ResnetUpsampleBlock2D"""),
         """mid_block_type""": """UNetMidBlock2DSimpleCrossAttn""",
         """block_out_channels""": (self.block_out_channels_a, self.block_out_channels_a * 2),
         """layers_per_block""": 1,
         """encoder_hid_dim""": self.text_embedder_hidden_size,
         """encoder_hid_dim_type""": """image_proj""",
         """cross_attention_dim""": self.cross_attention_dim,
         """attention_head_dim""": 4,
         """resnet_time_scale_shift""": """scale_shift""",
         """class_embed_type""": None,
     }

     __UpperCamelCase	:			Any					=					UNetaDConditionModel(**lowerCamelCase__			)
     return model

  @property
  def    a					(    self						:	Union[str, Any]			):
     """simple docstring"""

     return {
         "block_out_channels": [32, 64],
         "down_block_types": ["DownEncoderBlock2D", "AttnDownEncoderBlock2D"],
         "in_channels": 3,
         "latent_channels": 4,
         "layers_per_block": 1,
         "norm_num_groups": 8,
         "norm_type": "spatial",
         "num_vq_embeddings": 12,
         "out_channels": 3,
         "up_block_types": [
             "AttnUpDecoderBlock2D",
             "UpDecoderBlock2D",
         ],
         "vq_embed_dim": 4,
     }

  @property
  def    a					(    self						:	int			):
     """simple docstring"""

     torch.manual_seed(0			)
     __UpperCamelCase	:			Tuple					=					VQModel(**self.dummy_movq_kwargs			)
     return model

  def    a					(    self						:	Tuple			):
     """simple docstring"""

     __UpperCamelCase	:			str					=					self.dummy_unet
     __UpperCamelCase	:			Optional[int]					=					self.dummy_movq

     __UpperCamelCase	:			List[str]					=					DDIMScheduler(
         num_train_timesteps=10_00   ,				beta_schedule="""linear"""   ,				beta_start=0.0_0085   ,				beta_end=0.012   ,				clip_sample=lowerCamelCase__   ,				set_alpha_to_one=lowerCamelCase__   ,				steps_offset=1   ,				prediction_type="""epsilon"""   ,				thresholding=lowerCamelCase__   ,				)

     __UpperCamelCase	:			str					=					{
         """unet""": unet,
         """scheduler""": scheduler,
         """movq""": movq,
     }
     return components

  def    a					(    self						:	Optional[int]   ,				lowerCamelCase__						:	Optional[Any]   ,				lowerCamelCase__						:	Any=0			):
     """simple docstring"""

     __UpperCamelCase	:			Tuple					=					floats_tensor((1, self.text_embedder_hidden_size)   ,				rng=random.Random(lowerCamelCase__			)			).to(lowerCamelCase__			)
     __UpperCamelCase	:			Optional[int]					=					floats_tensor((1, self.text_embedder_hidden_size)   ,				rng=random.Random(seed + 1			)			).to(
         lowerCamelCase__			)
     if str(lowerCamelCase__			).startswith("""mps"""			):
        __UpperCamelCase	:			Optional[int]					=					torch.manual_seed(lowerCamelCase__			)
     else:
        __UpperCamelCase	:			int					=					torch.Generator(device=lowerCamelCase__			).manual_seed(lowerCamelCase__			)
     __UpperCamelCase	:			Dict					=					{
         """image_embeds""": image_embeds,
         """negative_image_embeds""": negative_image_embeds,
         """generator""": generator,
         """height""": 64,
         """width""": 64,
         """guidance_scale""": 4.0,
         """num_inference_steps""": 2,
         """output_type""": """np""",
     }
     return inputs

  def    a					(    self						:	Dict			):
     """simple docstring"""

     __UpperCamelCase	:			Dict					=					"""cpu"""

     __UpperCamelCase	:			Dict					=					self.get_dummy_components()

     __UpperCamelCase	:			Union[str, Any]					=					self.pipeline_class(**lowerCamelCase__			)
     __UpperCamelCase	:			int					=					pipe.to(lowerCamelCase__			)

     pipe.set_progress_bar_config(disable=lowerCamelCase__			)

     __UpperCamelCase	:			List[Any]					=					pipe(**self.get_dummy_inputs(lowerCamelCase__			)			)
     __UpperCamelCase	:			List[Any]					=					output.images

     __UpperCamelCase	:			int					=					pipe(
         **self.get_dummy_inputs(lowerCamelCase__			)   ,				return_dict=lowerCamelCase__   ,				)[0]

     __UpperCamelCase	:			List[str]					=					image[0, -3:, -3:, -1]
     __UpperCamelCase	:			Tuple					=					image_from_tuple[0, -3:, -3:, -1]

     assert image.shape == (1, 64, 64, 3)

     __UpperCamelCase	:			int					=					np.array(
         [0.623_7976, 1.0, 0.3644_1332, 1.0, 0.7063_9634, 0.2987_7186, 0.8565_2125, 0.521_6843, 0.5445_4046]			)

     assert (
         np.abs(image_slice.flatten() - expected_slice			).max() < 1e-2
     ), f' expected_slice {expected_slice}, but got {image_slice.flatten()}'

     assert (
         np.abs(image_from_tuple_slice.flatten() - expected_slice			).max() < 1e-2
     ), f' expected_slice {expected_slice}, but got {image_from_tuple_slice.flatten()}'







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

  def    a					(    self						:	Optional[int]			):
     """simple docstring"""

     super().tearDown()
     gc.collect()
     torch.cuda.empty_cache()

  def    a					(    self						:	List[Any]			):
     """simple docstring"""

     __UpperCamelCase	:			int					=					load_numpy(
         """https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main"""
         """/kandinskyv22/kandinskyv22_text2img_cat_fp16.npy"""			)

     __UpperCamelCase	:			List[str]					=					KandinskyVaaPriorPipeline.from_pretrained(
         """kandinsky-community/kandinsky-2-2-prior"""   ,				torch_dtype=torch.floataa			)
     pipe_prior.to(lowerCamelCase__			)

     __UpperCamelCase	:			int					=					KandinskyVaaPipeline.from_pretrained(
         """kandinsky-community/kandinsky-2-2-decoder"""   ,				torch_dtype=torch.floataa			)
     __UpperCamelCase	:			Optional[int]					=					pipeline.to(lowerCamelCase__			)
     pipeline.set_progress_bar_config(disable=lowerCamelCase__			)

     __UpperCamelCase	:			Optional[Any]					=					"""red cat, 4k photo"""

     __UpperCamelCase	:			Tuple					=					torch.Generator(device="""cuda"""			).manual_seed(0			)
     __UpperCamelCase	,     __UpperCamelCase	:			Union[str, Any]					=					pipe_prior(
         lowerCamelCase__   ,				generator=lowerCamelCase__   ,				num_inference_steps=5   ,				negative_prompt=""""""   ,				).to_tuple()

     __UpperCamelCase	:			Any					=					torch.Generator(device="""cuda"""			).manual_seed(0			)
     __UpperCamelCase	:			Union[str, Any]					=					pipeline(
         image_embeds=lowerCamelCase__   ,				negative_image_embeds=lowerCamelCase__   ,				generator=lowerCamelCase__   ,				num_inference_steps=1_00   ,				output_type="""np"""   ,				)

     __UpperCamelCase	:			Any					=					output.images[0]

     assert image.shape == (5_12, 5_12, 3)

     assert_mean_pixel_difference(lowerCamelCase__   ,				lowerCamelCase__			)



