code: 
  
  
  
  
  import importlib
  import os
  import platform
  from pathlib import Path
  
  from packaging import version
  
  from .utils.logging import get_logger
  
  
  SCREAMING_SNAKE_CASE__    :    List[str]								=					get_logger(__name__)
  
  # Datasets
  SCREAMING_SNAKE_CASE__    :    List[Any]								=					"https://s3.amazonaws.com/datasets.huggingface.co/datasets/datasets"
  SCREAMING_SNAKE_CASE__    :    List[str]								=					"https://cdn-datasets.huggingface.co/datasets/datasets"
  SCREAMING_SNAKE_CASE__    :    Any								=					"https://raw.githubusercontent.com/huggingface/datasets/{revision}/datasets/{path}/{name}"
  
  # Metrics
  SCREAMING_SNAKE_CASE__    :    int								=					"https://s3.amazonaws.com/datasets.huggingface.co/datasets/metrics"
  SCREAMING_SNAKE_CASE__    :    Optional[int]								=					"https://cdn-datasets.huggingface.co/datasets/metric"
  SCREAMING_SNAKE_CASE__    :    Dict								=					"https://raw.githubusercontent.com/huggingface/datasets/{revision}/metrics/{path}/{name}"
  
  # Hub
  SCREAMING_SNAKE_CASE__    :    Optional[int]								=					os.environ.get("HF_ENDPOINT", "https://huggingface.co")
  SCREAMING_SNAKE_CASE__    :    Any								=					HF_ENDPOINT + "/datasets/{repo_id}/resolve/{revision}/{path}"
  SCREAMING_SNAKE_CASE__    :    Union[str, Any]								=					"main"
  
  SCREAMING_SNAKE_CASE__    :    List[Any]								=					version.parse(platform.python_version())
  
  if PY_VERSION < version.parse("3.8"):
  				import importlib_metadata
  else:
  				import importlib.metadata as importlib_metadata
  
  # General environment variables accepted values for booleans
  SCREAMING_SNAKE_CASE__    :    Tuple								=					{"1", "ON", "YES", "TRUE"}
  SCREAMING_SNAKE_CASE__    :    Any								=					ENV_VARS_TRUE_VALUES.union({"AUTO"})
  
  
  # Imports
  SCREAMING_SNAKE_CASE__    :    str								=					version.parse(importlib_metadata.version("dill"))
  SCREAMING_SNAKE_CASE__    :    Union[str, Any]								=					version.parse(importlib_metadata.version("pandas"))
  SCREAMING_SNAKE_CASE__    :    str								=					version.parse(importlib_metadata.version("pyarrow"))
  
  SCREAMING_SNAKE_CASE__    :    Optional[Any]								=					os.environ.get("USE_TF", "AUTO").upper()
  SCREAMING_SNAKE_CASE__    :    Optional[Any]								=					os.environ.get("USE_TORCH", "AUTO").upper()
  SCREAMING_SNAKE_CASE__    :    Optional[int]								=					os.environ.get("USE_JAX", "AUTO").upper()
  
  SCREAMING_SNAKE_CASE__    :    Any								=					"N/A"
  SCREAMING_SNAKE_CASE__    :    Tuple								=					False
  
  if USE_TORCH in ENV_VARS_TRUE_AND_AUTO_VALUES and USE_TF not in ENV_VARS_TRUE_VALUES:
  				SCREAMING_SNAKE_CASE__    :    Union[str, Any]								=					importlib.util.find_spec("torch") is not None
  				if TORCH_AVAILABLE:
  								try:
  												SCREAMING_SNAKE_CASE__    :    int								=					version.parse(importlib_metadata.version("torch"))
  												logger.info(f"""PyTorch version {TORCH_VERSION} available.""")
  								except importlib_metadata.PackageNotFoundError:
  												pass
  else:
  				logger.info("Disabling PyTorch because USE_TF is set")
  
  SCREAMING_SNAKE_CASE__    :    Optional[int]								=					"N/A"
  SCREAMING_SNAKE_CASE__    :    Optional[Any]								=					False
  
  if USE_TF in ENV_VARS_TRUE_AND_AUTO_VALUES and USE_TORCH not in ENV_VARS_TRUE_VALUES:
  				SCREAMING_SNAKE_CASE__    :    int								=					importlib.util.find_spec("tensorflow") is not None
  				if TF_AVAILABLE:
  								# For the metadata, we have to look for both tensorflow and tensorflow-cpu
  								for package in [
  								    "tensorflow",
  								    "tensorflow-cpu",
  								    "tensorflow-gpu",
  								    "tf-nightly",
  								    "tf-nightly-cpu",
  								    "tf-nightly-gpu",
  								    "intel-tensorflow",
  								    "tensorflow-rocm",
  								    "tensorflow-macos",
  								]:
  												try:
  																SCREAMING_SNAKE_CASE__    :    Union[str, Any]								=					version.parse(importlib_metadata.version(package))
  												except importlib_metadata.PackageNotFoundError:
  																continue
  												else:
  																break
  								else:
  												SCREAMING_SNAKE_CASE__    :    Union[str, Any]								=					False
  				if TF_AVAILABLE:
  								if TF_VERSION.major < 2:
  												logger.info(f"""TensorFlow found but with version {TF_VERSION}. `datasets` requires version 2 minimum.""")
  												SCREAMING_SNAKE_CASE__    :    int								=					False
  								else:
  												logger.info(f"""TensorFlow version {TF_VERSION} available.""")
  else:
  				logger.info("Disabling Tensorflow because USE_TORCH is set")
  
  
  SCREAMING_SNAKE_CASE__    :    Dict								=					"N/A"
  SCREAMING_SNAKE_CASE__    :    List[str]								=					False
  
  if USE_JAX in ENV_VARS_TRUE_AND_AUTO_VALUES:
  				SCREAMING_SNAKE_CASE__    :    Any								=					importlib.util.find_spec("jax") is not None and importlib.util.find_spec("jaxlib") is not None
  				if JAX_AVAILABLE:
  								try:
  												SCREAMING_SNAKE_CASE__    :    Dict								=					version.parse(importlib_metadata.version("jax"))
  												logger.info(f"""JAX version {JAX_VERSION} available.""")
  								except importlib_metadata.PackageNotFoundError:
  												pass
  else:
  				logger.info("Disabling JAX because USE_JAX is set to False")
  
  
  SCREAMING_SNAKE_CASE__    :    Any								=					os.environ.get("USE_BEAM", "AUTO").upper()
  SCREAMING_SNAKE_CASE__    :    Optional[int]								=					"N/A"
  SCREAMING_SNAKE_CASE__    :    Union[str, Any]								=					False
  if USE_BEAM in ENV_VARS_TRUE_AND_AUTO_VALUES:
  				try:
  								SCREAMING_SNAKE_CASE__    :    int								=					version.parse(importlib_metadata.version("apache_beam"))
  								SCREAMING_SNAKE_CASE__    :    int								=					True
  								logger.info(f"""Apache Beam version {BEAM_VERSION} available.""")
  				except importlib_metadata.PackageNotFoundError:
  								pass
  else:
  				logger.info("Disabling Apache Beam because USE_BEAM is set to False")
  
  
  # Optional tools for data loading
  SCREAMING_SNAKE_CASE__    :    int								=					importlib.util.find_spec("sqlalchemy") is not None
  
  # Optional tools for feature decoding
  SCREAMING_SNAKE_CASE__    :    int								=					importlib.util.find_spec("PIL") is not None
  SCREAMING_SNAKE_CASE__    :    Any								=					importlib.util.find_spec("soundfile") is not None and version.parse(
      importlib.import_module("soundfile").__libsndfile_version__
  ) >= version.parse("1.0.31")
  SCREAMING_SNAKE_CASE__    :    List[Any]								=					importlib.util.find_spec("soundfile") is not None and version.parse(
      importlib.import_module("soundfile").__libsndfile_version__
  ) >= version.parse("1.1.0")
  
  # Optional compression tools
  SCREAMING_SNAKE_CASE__    :    List[str]								=					importlib.util.find_spec("rarfile") is not None
  SCREAMING_SNAKE_CASE__    :    Dict								=					importlib.util.find_spec("zstandard") is not None
  SCREAMING_SNAKE_CASE__    :    Optional[Any]								=					importlib.util.find_spec("lz4") is not None
  SCREAMING_SNAKE_CASE__    :    str								=					importlib.util.find_spec("py7zr") is not None
  
  
  # Cache location
  SCREAMING_SNAKE_CASE__    :    Union[str, Any]								=					"~/.cache"
  SCREAMING_SNAKE_CASE__    :    Optional[int]								=					os.getenv("XDG_CACHE_HOME", DEFAULT_XDG_CACHE_HOME)
  SCREAMING_SNAKE_CASE__    :    Tuple								=					os.path.join(XDG_CACHE_HOME, "huggingface")
  SCREAMING_SNAKE_CASE__    :    Optional[int]								=					os.path.expanduser(os.getenv("HF_HOME", DEFAULT_HF_CACHE_HOME))
  
  SCREAMING_SNAKE_CASE__    :    int								=					os.path.join(HF_CACHE_HOME, "datasets")
  SCREAMING_SNAKE_CASE__    :    Optional[Any]								=					Path(os.getenv("HF_DATASETS_CACHE", DEFAULT_HF_DATASETS_CACHE))
  
  SCREAMING_SNAKE_CASE__    :    Tuple								=					os.path.join(HF_CACHE_HOME, "metrics")
  SCREAMING_SNAKE_CASE__    :    str								=					Path(os.getenv("HF_METRICS_CACHE", DEFAULT_HF_METRICS_CACHE))
  
  SCREAMING_SNAKE_CASE__    :    str								=					os.path.join(HF_CACHE_HOME, "modules")
  SCREAMING_SNAKE_CASE__    :    Any								=					Path(os.getenv("HF_MODULES_CACHE", DEFAULT_HF_MODULES_CACHE))
  
  SCREAMING_SNAKE_CASE__    :    str								=					"downloads"
  SCREAMING_SNAKE_CASE__    :    Union[str, Any]								=					os.path.join(HF_DATASETS_CACHE, DOWNLOADED_DATASETS_DIR)
  SCREAMING_SNAKE_CASE__    :    Tuple								=					Path(os.getenv("HF_DATASETS_DOWNLOADED_DATASETS_PATH", DEFAULT_DOWNLOADED_DATASETS_PATH))
  
  SCREAMING_SNAKE_CASE__    :    Optional[int]								=					"extracted"
  SCREAMING_SNAKE_CASE__    :    Optional[Any]								=					os.path.join(DEFAULT_DOWNLOADED_DATASETS_PATH, EXTRACTED_DATASETS_DIR)
  SCREAMING_SNAKE_CASE__    :    str								=					Path(os.getenv("HF_DATASETS_EXTRACTED_DATASETS_PATH", DEFAULT_EXTRACTED_DATASETS_PATH))
  
  # Download count for the website
  SCREAMING_SNAKE_CASE__    :    int								=					(
      os.environ.get("HF_UPDATE_DOWNLOAD_COUNTS", "AUTO").upper() in ENV_VARS_TRUE_AND_AUTO_VALUES
  )
  
  # Batch size constants. For more info, see:
  # https://github.com/apache/arrow/blob/master/docs/source/cpp/arrays.rst#size-limitations-and-recommendations)
  SCREAMING_SNAKE_CASE__    :    Any								=					10_00
  
  # Size of the preloaded record batch in `Dataset.__iter__`
  SCREAMING_SNAKE_CASE__    :    Tuple								=					10
  
  # Pickling tables works only for small tables (<4GiB)
  # For big tables, we write them on disk instead
  SCREAMING_SNAKE_CASE__    :    List[Any]								=					4 << 30
  
  # Max shard size in bytes (e.g. to shard parquet datasets in push_to_hub or download_and_prepare)
  SCREAMING_SNAKE_CASE__    :    Optional[int]								=					"500MB"
  
  # Parquet configuration
  SCREAMING_SNAKE_CASE__    :    Optional[int]								=					1_00
  SCREAMING_SNAKE_CASE__    :    Dict								=					1_00
  SCREAMING_SNAKE_CASE__    :    Tuple								=					1_00
  
  # Offline mode
  SCREAMING_SNAKE_CASE__    :    int								=					os.environ.get("HF_DATASETS_OFFLINE", "AUTO").upper() in ENV_VARS_TRUE_VALUES
  
  # In-memory
  SCREAMING_SNAKE_CASE__    :    Union[str, Any]								=					0  # Disabled
  SCREAMING_SNAKE_CASE__    :    Tuple								=					float(os.environ.get("HF_DATASETS_IN_MEMORY_MAX_SIZE", DEFAULT_IN_MEMORY_MAX_SIZE))
  
  # File names
  SCREAMING_SNAKE_CASE__    :    Optional[Any]								=					"dataset.arrow"
  SCREAMING_SNAKE_CASE__    :    Optional[Any]								=					"indices.arrow"
  SCREAMING_SNAKE_CASE__    :    int								=					"state.json"
  SCREAMING_SNAKE_CASE__    :    Dict								=					"dataset_info.json"
  SCREAMING_SNAKE_CASE__    :    Union[str, Any]								=					"dataset_infos.json"
  SCREAMING_SNAKE_CASE__    :    Any								=					"LICENSE"
  SCREAMING_SNAKE_CASE__    :    List[Any]								=					"metric_info.json"
  SCREAMING_SNAKE_CASE__    :    Any								=					"dataset_dict.json"
  
  SCREAMING_SNAKE_CASE__    :    Dict								=					"datasets_modules"
  
  SCREAMING_SNAKE_CASE__    :    str								=					2_55
  
  # Streaming
  SCREAMING_SNAKE_CASE__    :    str								=					20
  SCREAMING_SNAKE_CASE__    :    Optional[Any]								=					5
  
  # Datasets without script
  SCREAMING_SNAKE_CASE__    :    Optional[Any]								=					2_00
  SCREAMING_SNAKE_CASE__    :    Dict								=					10
  SCREAMING_SNAKE_CASE__    :    str								=					2_00
  
  # Progress bars
  SCREAMING_SNAKE_CASE__    :    Dict								=					0.05  # 20 progress updates per sec
  
style_context: 
  
  
  
  
  from dataclasses import dataclass
  from typing import List, Optional, Union
  
  import numpy as np
  import PIL
  
  from ...utils import BaseOutput, is_invisible_watermark_available, is_torch_available, is_transformers_available
  
  
  
  @dataclass
  class 			a_					(    SCREAMING_SNAKE_CASE__    ):
  	A						       =   42
  
  
  if is_transformers_available() and is_torch_available() and is_invisible_watermark_available():
  				from .pipeline_stable_diffusion_xl import StableDiffusionXLPipeline
  				from .pipeline_stable_diffusion_xl_imgaimg import StableDiffusionXLImgaImgPipeline
  