code: 
  
  
  from dataclasses import dataclass
  from enum import Enum
  from typing import List, Optional, Union
  
  import numpy as np
  import PIL
  from PIL import Image
  
  from ...utils import BaseOutput, is_torch_available, is_transformers_available
  
  @dataclass
  class 						snake_case			(       lowerCAmelCase__	):
  			'''simple docstring'''
  
  			UpperCAmelCase       :       Optional[int]       = {
  			    """sld_warmup_steps""": 15,
  			    """sld_guidance_scale""": 20,
  			    """sld_threshold""": 0.0,
  			    """sld_momentum_scale""": 0.0,
  			    """sld_mom_beta""": 0.0,
  			}
  			UpperCAmelCase       :       int       = {
  			    """sld_warmup_steps""": 10,
  			    """sld_guidance_scale""": 1000,
  			    """sld_threshold""": 0.0_1,
  			    """sld_momentum_scale""": 0.3,
  			    """sld_mom_beta""": 0.4,
  			}
  			UpperCAmelCase       :       Dict       = {
  			    """sld_warmup_steps""": 7,
  			    """sld_guidance_scale""": 2000,
  			    """sld_threshold""": 0.0_2_5,
  			    """sld_momentum_scale""": 0.5,
  			    """sld_mom_beta""": 0.7,
  			}
  			UpperCAmelCase       :       Optional[int]       = {
  			    """sld_warmup_steps""": 0,
  			    """sld_guidance_scale""": 5000,
  			    """sld_threshold""": 1.0,
  			    """sld_momentum_scale""": 0.5,
  			    """sld_mom_beta""": 0.7,
  			}
  
  @dataclass
  class 						snake_case			(       lowerCAmelCase__	):
  			'''simple docstring'''
  
  			UpperCAmelCase       :       Union[List[PIL.Image.Image], np.ndarray]
  			UpperCAmelCase       :       Optional[List[bool]]
  			UpperCAmelCase       :       Optional[Union[List[PIL.Image.Image], np.ndarray]]
  			UpperCAmelCase       :       Optional[str]
  
  
  if is_transformers_available() and is_torch_available():
  							from .pipeline_stable_diffusion_safe import StableDiffusionPipelineSafe
  							from .safety_checker import SafeStableDiffusionSafetyChecker
  
  
  
style_context: 
  
  
  from __future__ import annotations
  
  class 						snake_case			:
  			'''simple docstring'''
  
  			def __init__(	self     :     int							,							lowerCAmelCase_     :     int					)					->					None:
  
  
  
  
  								"""simple docstring"""
  
  
  
  
  
  
  								SCREAMING_SNAKE_CASE_	      =       value
  								SCREAMING_SNAKE_CASE_	      =       None
  								SCREAMING_SNAKE_CASE_	      =       None
  
  class 						snake_case			:
  			'''simple docstring'''
  
  			UpperCAmelCase       :       int
  
  			def __init__(	self     :     Union[str, Any]					)					->					None:
  
  
  
  
  								"""simple docstring"""
  
  
  
  
  
  
  								SCREAMING_SNAKE_CASE_	      =       0
  
  			def _lowercase (	self     :     Optional[int]							,							lowerCAmelCase_     :     Node | None							,							lowerCAmelCase_     :     int					)					->					None:
  
  
  
  
  								"""simple docstring"""
  
  
  
  
  
  
  								if node is None:
  													return
  
  								if path_sum == self.target:
  													self.paths += 1
  
  								if node.left:
  													self.depth_first_search(node.left							,							path_sum + node.left.value					)
  								if node.right:
  													self.depth_first_search(node.right							,							path_sum + node.right.value					)
  
  
  
  
  			def _lowercase (	self     :     str							,							lowerCAmelCase_     :     Node | None							,							lowerCAmelCase_     :     int | None = None					)					->					int:
  
  
  
  
  								"""simple docstring"""
  
  
  
  
  
  
  								if node is None:
  													return 0
  								if target is not None:
  													SCREAMING_SNAKE_CASE_	      =       target
  
  								self.depth_first_search(lowerCAmelCase_							,							node.value					)
  								self.path_sum(node.left					)
  								self.path_sum(node.right					)
  
  								return self.paths
  
  
  if __name__ == "__main__":
  		import doctest
  
  		doctest.testmod()
  
  
  