





from typing import List, Optional, Union

import torch

from ...models import UNetaDConditionModel, VQModel
from ...pipelines import DiffusionPipeline
from ...pipelines.pipeline_utils import ImagePipelineOutput
from ...schedulers import DDPMScheduler
from ...utils import (
    is_accelerate_available,
    is_accelerate_version,
    logging,
    randn_tensor,
    replace_example_docstring,
)


__lowerCamelCase	:					Any			  =					logging.get_logger(__name__)  # pylint: disable=invalid-name

__lowerCamelCase	:					str			  =					"""
    Examples:
        ```py
        >>> import torch
        >>> import numpy as np

        >>> from diffusers import KandinskyV22PriorPipeline, KandinskyV22ControlnetPipeline
        >>> from transformers import pipeline
        >>> from diffusers.utils import load_image


        >>> def make_hint(image, depth_estimator):
        ...     image = depth_estimator(image)[\"depth\"]
        ...     image = np.array(image)
        ...     image = image[:, :, None]
        ...     image = np.concatenate([image, image, image], axis=2)
        ...     detected_map = torch.from_numpy(image).float() / 255.0
        ...     hint = detected_map.permute(2, 0, 1)
        ...     return hint


        >>> depth_estimator = pipeline(\"depth-estimation\")

        >>> pipe_prior = KandinskyV22PriorPipeline.from_pretrained(
        ...     \"kandinsky-community/kandinsky-2-2-prior\", torch_dtype=torch.float16
        ... )
        >>> pipe_prior = pipe_prior.to(\"cuda\")

        >>> pipe = KandinskyV22ControlnetPipeline.from_pretrained(
        ...     \"kandinsky-community/kandinsky-2-2-controlnet-depth\", torch_dtype=torch.float16
        ... )
        >>> pipe = pipe.to(\"cuda\")


        >>> img = load_image(
        ...     \"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main\"
        ...     \"/kandinsky/cat.png\"
        ... ).resize((768, 768))

        >>> hint = make_hint(img, depth_estimator).unsqueeze(0).half().to(\"cuda\")

        >>> prompt = \"A robot, 4k photo\"
        >>> negative_prior_prompt = \"lowres, text, error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature\"

        >>> generator = torch.Generator(device=\"cuda\").manual_seed(43)

        >>> image_emb, zero_image_emb = pipe_prior(
        ...     prompt=prompt, negative_prompt=negative_prior_prompt, generator=generator
        ... ).to_tuple()

        >>> images = pipe(
        ...     image_embeds=image_emb,
        ...     negative_image_embeds=zero_image_emb,
        ...     hint=hint,
        ...     num_inference_steps=50,
        ...     generator=generator,
        ...     height=768,
        ...     width=768,
        ... ).images

        >>> images[0].save(\"robot_cat.png\")
        ```
"""



def 		A_    (					_lowerCAmelCase							,       _lowerCAmelCase							,       _lowerCAmelCase=8					)						->			Any:
 UpperCamelCase     : Optional[int]	     =       height // scale_factor**2
 if height % scale_factor**2 != 0:
  new_height += 1
 UpperCamelCase     : Optional[Any]	     =       width // scale_factor**2
 if width % scale_factor**2 != 0:
  new_width += 1
 return new_height * scale_factor, new_width * scale_factor



class  A__       (	__snake_case      ):





      def __init__(			self	,							A_	,							A_	,							A_	,							):
       '''simple docstring'''




       super().__init__()

       self.register_modules(
           unet=A_	,							scheduler=A_	,							movq=A_	,							)
       UpperCamelCase     : str	     =       2 ** (len(self.movq.config.block_out_channels       ) - 1)





      def 	__UpperCamelCase(			self	,							A_	,							A_	,							A_	,							A_	,							A_	,							A_       ):
       '''simple docstring'''




       if latents is None:
        UpperCamelCase     : Any	     =       randn_tensor(A_	,							generator=A_	,							device=A_	,							dtype=A_       )
       else:
        if latents.shape != shape:
         raise ValueError(F"""Unexpected latents shape, got {latents.shape}, expected {shape}"""       )
        UpperCamelCase     : Optional[Any]	     =       latents.to(A_       )

       UpperCamelCase     : Union[str, Any]	     =       latents * scheduler.init_noise_sigma
       return latents





      def 	__UpperCamelCase(			self	,							A_=0       ):
       '''simple docstring'''




       if is_accelerate_available():
        from accelerate import cpu_offload
       else:
        raise ImportError("Please install accelerate via `pip install accelerate`"       )

       UpperCamelCase     : Any	     =       torch.device(F"""cuda:{gpu_id}"""       )

       UpperCamelCase     : Any	     =       [
           self.unet,
           self.movq,
       ]
       for cpu_offloaded_model in models:
        if cpu_offloaded_model is not None:
         cpu_offload(A_	,							A_       )





      def 	__UpperCamelCase(			self	,							A_=0       ):
       '''simple docstring'''




       if is_accelerate_available() and is_accelerate_version(">="	,							"0.17.0.dev0"       ):
        from accelerate import cpu_offload_with_hook
       else:
        raise ImportError("`enable_model_cpu_offload` requires `accelerate v0.17.0` or higher."       )

       UpperCamelCase     : Union[str, Any]	     =       torch.device(F"""cuda:{gpu_id}"""       )

       if self.device.type != "cpu":
        self.to("cpu"	,							silence_dtype_warnings=A_       )
        torch.cuda.empty_cache()  # otherwise we don't see the memory savings (but they probably exist)

       UpperCamelCase     : List[Any]	     =       None
       for cpu_offloaded_model in [self.unet, self.movq]:
        UpperCamelCase     ,   UpperCamelCase     : Optional[Any]	     =       cpu_offload_with_hook(A_	,							A_	,							prev_module_hook=A_       )

       # We'll offload the last model manually.
       UpperCamelCase     : Dict	     =       hook





      @property
      # Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline._execution_device
      def 	__UpperCamelCase(			self       ):
       '''simple docstring'''




       if not hasattr(self.unet	,							"_hf_hook"       ):
        return self.device
       for module in self.unet.modules():
        if (
            hasattr(A_	,							"_hf_hook"       )
            and hasattr(module._hf_hook	,							"execution_device"       )
            and module._hf_hook.execution_device is not None
        ):
         return torch.device(module._hf_hook.execution_device       )
       return self.device





      @torch.no_grad()
      @replace_example_docstring(A_       )
      def __call__(			self	,							A_	,							A_	,							A_	,							A_ = 512	,							A_ = 512	,							A_ = 100	,							A_ = 4.0	,							A_ = 1	,							A_ = None	,							A_ = None	,							A_ = "pil"	,							A_ = True	,							):
       '''simple docstring'''




       UpperCamelCase     : Tuple	     =       self._execution_device

       UpperCamelCase     : List[str]	     =       guidance_scale > 1.0

       if isinstance(A_	,							A_       ):
        UpperCamelCase     : Dict	     =       torch.cat(A_	,							dim=0       )
       if isinstance(A_	,							A_       ):
        UpperCamelCase     : Union[str, Any]	     =       torch.cat(A_	,							dim=0       )
       if isinstance(A_	,							A_       ):
        UpperCamelCase     : Tuple	     =       torch.cat(A_	,							dim=0       )

       UpperCamelCase     : List[str]	     =       image_embeds.shape[0] * num_images_per_prompt

       if do_classifier_free_guidance:
        UpperCamelCase     : Optional[Any]	     =       image_embeds.repeat_interleave(A_	,							dim=0       )
        UpperCamelCase     : Union[str, Any]	     =       negative_image_embeds.repeat_interleave(A_	,							dim=0       )
        UpperCamelCase     : Union[str, Any]	     =       hint.repeat_interleave(A_	,							dim=0       )

       UpperCamelCase     : int	     =       torch.cat([negative_image_embeds, image_embeds]	,							dim=0       ).to(dtype=self.unet.dtype	,							device=A_       )
       UpperCamelCase     : int	     =       torch.cat([hint, hint]	,							dim=0       ).to(dtype=self.unet.dtype	,							device=A_       )
       self.scheduler.set_timesteps(A_	,							device=A_       )
       UpperCamelCase     : Any	     =       self.scheduler.timesteps

       UpperCamelCase     : Union[str, Any]	     =       self.movq.config.latent_channels

       UpperCamelCase     ,   UpperCamelCase     : List[Any]	     =       downscale_height_and_width(A_	,							A_	,							self.movq_scale_factor       )

       # create initial latent
       UpperCamelCase     : List[Any]	     =       self.prepare_latents(
           (batch_size, num_channels_latents, height, width)	,							image_embeds.dtype	,							A_	,							A_	,							A_	,							self.scheduler	,							)

       for i, t in enumerate(self.progress_bar(A_       )       ):
        # expand the latents if we are doing classifier free guidance
        UpperCamelCase     : Union[str, Any]	     =       torch.cat([latents] * 2       ) if do_classifier_free_guidance else latents

        UpperCamelCase     : Optional[int]	     =       {"image_embeds": image_embeds, "hint": hint}
        UpperCamelCase     : Any	     =       self.unet(
            sample=A_	,							timestep=A_	,							encoder_hidden_states=A_	,							added_cond_kwargs=A_	,							return_dict=A_	,							)[0]

        if do_classifier_free_guidance:
         UpperCamelCase     ,   UpperCamelCase     : Union[str, Any]	     =       noise_pred.split(latents.shape[1]	,							dim=1       )
         UpperCamelCase     ,   UpperCamelCase     : str	     =       noise_pred.chunk(2       )
         UpperCamelCase     ,   UpperCamelCase     : Optional[int]	     =       variance_pred.chunk(2       )
         UpperCamelCase     : Dict	     =       noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
         UpperCamelCase     : Tuple	     =       torch.cat([noise_pred, variance_pred_text]	,							dim=1       )

        if not (
            hasattr(self.scheduler.config	,							"variance_type"       )
            and self.scheduler.config.variance_type in ["learned", "learned_range"]
        ):
         UpperCamelCase     ,   UpperCamelCase     : List[str]	     =       noise_pred.split(latents.shape[1]	,							dim=1       )

        # compute the previous noisy sample x_t -> x_t-1
        UpperCamelCase     : List[Any]	     =       self.scheduler.step(
            A_	,							A_	,							A_	,							generator=A_	,							)[0]
       # post-processing
       UpperCamelCase     : Union[str, Any]	     =       self.movq.decode(A_	,							force_not_quantize=A_       )["sample"]

       if output_type not in ["pt", "np", "pil"]:
        raise ValueError(F"""Only the output types `pt`, `pil` and `np` are supported not output_type={output_type}"""       )

       if output_type in ["np", "pil"]:
        UpperCamelCase     : Dict	     =       image * 0.5 + 0.5
        UpperCamelCase     : Optional[int]	     =       image.clamp(0	,							1       )
        UpperCamelCase     : List[str]	     =       image.cpu().permute(0	,							2	,							3	,							1       ).float().numpy()

       if output_type == "pil":
        UpperCamelCase     : Dict	     =       self.numpy_to_pil(A_       )

       if not return_dict:
        return (image,)

       return ImagePipelineOutput(images=A_       )







import collections
import gzip
import os
import urllib

import numpy
from tensorflow.python.framework import dtypes, random_seed
from tensorflow.python.platform import gfile
from tensorflow.python.util.deprecation import deprecated

__lowerCamelCase	:					Any			  =					collections.namedtuple("""_Datasets""", ["""train""", """validation""", """test"""])

# CVDF mirror of http://yann.lecun.com/exdb/mnist/
__lowerCamelCase	:					str			  =					"""https://storage.googleapis.com/cvdf-datasets/mnist/"""



def 		A_    (					_lowerCAmelCase					)						->			Optional[Any]:
 UpperCamelCase     : Tuple	     =       numpy.dtype(numpy.uintaa					).newbyteorder(">"					)
 return numpy.frombuffer(bytestream.read(4					)							,       dtype=_lowerCAmelCase					)[0]



@deprecated(_lowerCAmelCase							,       "Please use tf.data to implement this functionality."					)
def 		A_    (					_lowerCAmelCase					)						->			int:
 print("Extracting"							,       f.name					)
 with gzip.GzipFile(fileobj=_lowerCAmelCase					) as bytestream:
  UpperCamelCase     : Dict	     =       _readaa(_lowerCAmelCase					)
  if magic != 2051:
   raise ValueError(
       "Invalid magic number %d in MNIST image file: %s" % (magic, f.name)					)
  UpperCamelCase     : Optional[int]	     =       _readaa(_lowerCAmelCase					)
  UpperCamelCase     : int	     =       _readaa(_lowerCAmelCase					)
  UpperCamelCase     : Union[str, Any]	     =       _readaa(_lowerCAmelCase					)
  UpperCamelCase     : List[Any]	     =       bytestream.read(rows * cols * num_images					)
  UpperCamelCase     : List[str]	     =       numpy.frombuffer(_lowerCAmelCase							,       dtype=numpy.uinta					)
  UpperCamelCase     : Optional[Any]	     =       data.reshape(_lowerCAmelCase							,       _lowerCAmelCase							,       _lowerCAmelCase							,       1					)
  return data



@deprecated(_lowerCAmelCase							,       "Please use tf.one_hot on tensors."					)
def 		A_    (					_lowerCAmelCase							,       _lowerCAmelCase					)						->			Dict:
 UpperCamelCase     : List[str]	     =       labels_dense.shape[0]
 UpperCamelCase     : str	     =       numpy.arange(_lowerCAmelCase					) * num_classes
 UpperCamelCase     : Optional[Any]	     =       numpy.zeros((num_labels, num_classes)					)
 UpperCamelCase     : Dict	     =       1
 return labels_one_hot



@deprecated(_lowerCAmelCase							,       "Please use tf.data to implement this functionality."					)
def 		A_    (					_lowerCAmelCase							,       _lowerCAmelCase=False							,       _lowerCAmelCase=10					)						->			str:
 print("Extracting"							,       f.name					)
 with gzip.GzipFile(fileobj=_lowerCAmelCase					) as bytestream:
  UpperCamelCase     : int	     =       _readaa(_lowerCAmelCase					)
  if magic != 2049:
   raise ValueError(
       "Invalid magic number %d in MNIST label file: %s" % (magic, f.name)					)
  UpperCamelCase     : List[str]	     =       _readaa(_lowerCAmelCase					)
  UpperCamelCase     : List[Any]	     =       bytestream.read(_lowerCAmelCase					)
  UpperCamelCase     : List[str]	     =       numpy.frombuffer(_lowerCAmelCase							,       dtype=numpy.uinta					)
  if one_hot:
   return _dense_to_one_hot(_lowerCAmelCase							,       _lowerCAmelCase					)
  return labels



class  A__       :





      @deprecated(
          A_	,							"Please use alternatives such as official/mnist/_DataSet.py"
          " from tensorflow/models."	,							)
      def __init__(			self	,							A_	,							A_	,							A_=False	,							A_=False	,							A_=dtypes.floataa	,							A_=True	,							A_=None	,							):
       '''simple docstring'''




       UpperCamelCase     ,   UpperCamelCase     : int	     =       random_seed.get_seed(A_       )
       # If op level seed is not set, use whatever graph level seed is returned
       numpy.random.seed(seeda if seed is None else seeda       )
       UpperCamelCase     : Optional[Any]	     =       dtypes.as_dtype(A_       ).base_dtype
       if dtype not in (dtypes.uinta, dtypes.floataa):
        raise TypeError("Invalid image dtype %r, expected uint8 or float32" % dtype       )
       if fake_data:
        UpperCamelCase     : List[str]	     =       1_0000
        UpperCamelCase     : int	     =       one_hot
       else:
        assert (
            images.shape[0] == labels.shape[0]
        ), F"""images.shape: {images.shape} labels.shape: {labels.shape}"""
        UpperCamelCase     : Optional[Any]	     =       images.shape[0]

        # Convert shape from [num examples, rows, columns, depth]
        # to [num examples, rows*columns] (assuming depth == 1)
        if reshape:
         assert images.shape[3] == 1
         UpperCamelCase     : int	     =       images.reshape(
             images.shape[0]	,							images.shape[1] * images.shape[2]       )
        if dtype == dtypes.floataa:
         # Convert from [0, 255] -> [0.0, 1.0].
         UpperCamelCase     : str	     =       images.astype(numpy.floataa       )
         UpperCamelCase     : str	     =       numpy.multiply(A_	,							1.0 / 2_55.0       )
       UpperCamelCase     : Optional[int]	     =       images
       UpperCamelCase     : str	     =       labels
       UpperCamelCase     : Optional[Any]	     =       0
       UpperCamelCase     : Optional[int]	     =       0





      @property
      def 	__UpperCamelCase(			self       ):
       '''simple docstring'''




       return self._images





      @property
      def 	__UpperCamelCase(			self       ):
       '''simple docstring'''




       return self._labels





      @property
      def 	__UpperCamelCase(			self       ):
       '''simple docstring'''




       return self._num_examples





      @property
      def 	__UpperCamelCase(			self       ):
       '''simple docstring'''




       return self._epochs_completed





      def 	__UpperCamelCase(			self	,							A_	,							A_=False	,							A_=True       ):
       '''simple docstring'''




       if fake_data:
        UpperCamelCase     : Optional[int]	     =       [1] * 784
        UpperCamelCase     : Optional[Any]	     =       [1] + [0] * 9 if self.one_hot else 0
        return (
            [fake_image for _ in range(A_       )],
            [fake_label for _ in range(A_       )],
        )
       UpperCamelCase     : Optional[Any]	     =       self._index_in_epoch
       # Shuffle for the first epoch
       if self._epochs_completed == 0 and start == 0 and shuffle:
        UpperCamelCase     : Optional[Any]	     =       numpy.arange(self._num_examples       )
        numpy.random.shuffle(A_       )
        UpperCamelCase     : int	     =       self.images[perma]
        UpperCamelCase     : Any	     =       self.labels[perma]
       # Go to the next epoch
       if start + batch_size > self._num_examples:
        # Finished epoch
        self._epochs_completed += 1
        # Get the rest examples in this epoch
        UpperCamelCase     : List[Any]	     =       self._num_examples - start
        UpperCamelCase     : Union[str, Any]	     =       self._images[start : self._num_examples]
        UpperCamelCase     : str	     =       self._labels[start : self._num_examples]
        # Shuffle the data
        if shuffle:
         UpperCamelCase     : Union[str, Any]	     =       numpy.arange(self._num_examples       )
         numpy.random.shuffle(A_       )
         UpperCamelCase     : Union[str, Any]	     =       self.images[perm]
         UpperCamelCase     : Union[str, Any]	     =       self.labels[perm]
        # Start next epoch
        UpperCamelCase     : Tuple	     =       0
        UpperCamelCase     : Tuple	     =       batch_size - rest_num_examples
        UpperCamelCase     : List[str]	     =       self._index_in_epoch
        UpperCamelCase     : Dict	     =       self._images[start:end]
        UpperCamelCase     : int	     =       self._labels[start:end]
        return (
            numpy.concatenate((images_rest_part, images_new_part)	,							axis=0       ),
            numpy.concatenate((labels_rest_part, labels_new_part)	,							axis=0       ),
        )
       else:
        self._index_in_epoch += batch_size
        UpperCamelCase     : Union[str, Any]	     =       self._index_in_epoch
        return self._images[start:end], self._labels[start:end]



@deprecated(_lowerCAmelCase							,       "Please write your own downloading logic."					)
def 		A_    (					_lowerCAmelCase							,       _lowerCAmelCase							,       _lowerCAmelCase					)						->			Union[str, Any]:
 if not gfile.Exists(_lowerCAmelCase					):
  gfile.MakeDirs(_lowerCAmelCase					)
 UpperCamelCase     : Optional[Any]	     =       os.path.join(_lowerCAmelCase							,       _lowerCAmelCase					)
 if not gfile.Exists(_lowerCAmelCase					):
  urllib.request.urlretrieve(_lowerCAmelCase							,       _lowerCAmelCase					)  # noqa: S310
  with gfile.GFile(_lowerCAmelCase					) as f:
   UpperCamelCase     : Optional[int]	     =       f.size()
  print("Successfully downloaded"							,       _lowerCAmelCase							,       _lowerCAmelCase							,       "bytes."					)
 return filepath



@deprecated(
    _lowerCAmelCase							,       "Please use alternatives such as:" " tensorflow_datasets.load('mnist')"					)
def 		A_    (					_lowerCAmelCase							,       _lowerCAmelCase=False							,       _lowerCAmelCase=False							,       _lowerCAmelCase=dtypes.floataa							,       _lowerCAmelCase=True							,       _lowerCAmelCase=5000							,       _lowerCAmelCase=None							,       _lowerCAmelCase=DEFAULT_SOURCE_URL							,       )						->			List[str]:
 if fake_data:

  def fake():
   return _DataSet(
       []							,       []							,       fake_data=_lowerCAmelCase							,       one_hot=_lowerCAmelCase							,       dtype=_lowerCAmelCase							,       seed=_lowerCAmelCase					)

  UpperCamelCase     : Any	     =       fake()
  UpperCamelCase     : List[str]	     =       fake()
  UpperCamelCase     : Union[str, Any]	     =       fake()
  return _Datasets(train=_lowerCAmelCase							,       validation=_lowerCAmelCase							,       test=_lowerCAmelCase					)

 if not source_url:  # empty string check
  UpperCamelCase     : str	     =       DEFAULT_SOURCE_URL

 UpperCamelCase     : List[str]	     =       "train-images-idx3-ubyte.gz"
 UpperCamelCase     : Optional[int]	     =       "train-labels-idx1-ubyte.gz"
 UpperCamelCase     : List[str]	     =       "t10k-images-idx3-ubyte.gz"
 UpperCamelCase     : Union[str, Any]	     =       "t10k-labels-idx1-ubyte.gz"

 UpperCamelCase     : Optional[int]	     =       _maybe_download(
     _lowerCAmelCase							,       _lowerCAmelCase							,       source_url + train_images_file					)
 with gfile.Open(_lowerCAmelCase							,       "rb"					) as f:
  UpperCamelCase     : List[str]	     =       _extract_images(_lowerCAmelCase					)

 UpperCamelCase     : Dict	     =       _maybe_download(
     _lowerCAmelCase							,       _lowerCAmelCase							,       source_url + train_labels_file					)
 with gfile.Open(_lowerCAmelCase							,       "rb"					) as f:
  UpperCamelCase     : List[Any]	     =       _extract_labels(_lowerCAmelCase							,       one_hot=_lowerCAmelCase					)

 UpperCamelCase     : Any	     =       _maybe_download(
     _lowerCAmelCase							,       _lowerCAmelCase							,       source_url + test_images_file					)
 with gfile.Open(_lowerCAmelCase							,       "rb"					) as f:
  UpperCamelCase     : Any	     =       _extract_images(_lowerCAmelCase					)

 UpperCamelCase     : List[str]	     =       _maybe_download(
     _lowerCAmelCase							,       _lowerCAmelCase							,       source_url + test_labels_file					)
 with gfile.Open(_lowerCAmelCase							,       "rb"					) as f:
  UpperCamelCase     : str	     =       _extract_labels(_lowerCAmelCase							,       one_hot=_lowerCAmelCase					)

 if not 0 <= validation_size <= len(_lowerCAmelCase					):
  UpperCamelCase     : Any	     =       (
      "Validation size should be between 0 and "
      F"""{len(_lowerCAmelCase					)}. Received: {validation_size}."""
  )
  raise ValueError(_lowerCAmelCase					)

 UpperCamelCase     : str	     =       train_images[:validation_size]
 UpperCamelCase     : int	     =       train_labels[:validation_size]
 UpperCamelCase     : List[str]	     =       train_images[validation_size:]
 UpperCamelCase     : Union[str, Any]	     =       train_labels[validation_size:]

 UpperCamelCase     : List[str]	     =       {"dtype": dtype, "reshape": reshape, "seed": seed}

 UpperCamelCase     : List[str]	     =       _DataSet(_lowerCAmelCase							,       _lowerCAmelCase							,       **_lowerCAmelCase					)
 UpperCamelCase     : List[str]	     =       _DataSet(_lowerCAmelCase							,       _lowerCAmelCase							,       **_lowerCAmelCase					)
 UpperCamelCase     : Any	     =       _DataSet(_lowerCAmelCase							,       _lowerCAmelCase							,       **_lowerCAmelCase					)

 return _Datasets(train=_lowerCAmelCase							,       validation=_lowerCAmelCase							,       test=_lowerCAmelCase					)
