


"""simple docstring"""






import os

from apache_beam.io.filesystems import FileSystems
from apache_beam.pipeline import Pipeline

from .logging import get_logger


UpperCamelCase__							:int       =  2 << 20  # 2mb
UpperCamelCase__							:List[str]       =  get_logger(__name__)






class     A(     UpperCAmelCase__		):
		def      _UpperCamelCase(   self      )			->  Union[str, Any]:

					"""simple docstring"""



					_UpperCamelCase				:int				    =  self._options.get_all_options().get('''runner'''      )
					return runner in [None, "DirectRunner", "PortableRunner"]





def 							A_					(   snake_case__					,				snake_case__					,				snake_case__=False		)				->     List[str]:
			_UpperCamelCase				:Any				    =  FileSystems
			if fs.exists(snake_case__		):
						if force_upload:
									logger.info(f"Remote path already exist: {remote_file_path}. Overwriting it as force_upload=True."		)
						else:
									logger.info(f"Remote path already exist: {remote_file_path}. Skipping it as force_upload=False."		)
									return
			with fs.create(snake_case__		) as remote_file:
						with open(snake_case__					,				'''rb'''		) as local_file:
									_UpperCamelCase				:Optional[int]				    =  local_file.read(snake_case__		)
									while chunk:
												remote_file.write(snake_case__		)
												_UpperCamelCase				:Dict				    =  local_file.read(snake_case__		)





def 							A_					(   snake_case__					,				snake_case__					,				snake_case__=False		)				->     int:
			_UpperCamelCase				:Optional[int]				    =  FileSystems
			if os.path.exists(snake_case__		):
						if force_download:
									logger.info(f"Local path already exist: {remote_file_path}. Overwriting it as force_upload=True."		)
						else:
									logger.info(f"Local path already exist: {remote_file_path}. Skipping it as force_upload=False."		)
									return
			with fs.open(snake_case__		) as remote_file:
						with open(snake_case__					,				'''wb'''		) as local_file:
									_UpperCamelCase				:Optional[Any]				    =  remote_file.read(snake_case__		)
									while chunk:
												local_file.write(snake_case__		)
												_UpperCamelCase				:List[Any]				    =  remote_file.read(snake_case__		)





"""simple docstring"""






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(     lowerCamelCase__		):

		"""simple docstring"""





		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

