code: 
  
  
  """simple docstring"""
  import torch
  
  from diffusers import EulerAncestralDiscreteScheduler
  from diffusers.utils import torch_device
  
  from .test_schedulers import SchedulerCommonTest
  
  
  
  
  class   lowercase__							(				lowerCamelCase__							):
     __UpperCAmelCase       					=				(EulerAncestralDiscreteScheduler,)
     __UpperCAmelCase       					=				10
  
  
  
  
  
     def 		UpperCamelCase_     (       self			,      **SCREAMING_SNAKE_CASE)     ->     Optional[Any]:
        _lowerCamelCase  :				Optional[int]      =		{
            """num_train_timesteps""": 1100,
            """beta_start""": 0.00_01,
            """beta_end""": 0.02,
            """beta_schedule""": """linear""",
        }
  
        config.update(**SCREAMING_SNAKE_CASE_)
        return config
  
  
  
  
  
     def 		UpperCamelCase_     (       self)     ->     Optional[int]:
        for timesteps in [10, 50, 100, 1000]:
           self.check_over_configs(num_train_timesteps=SCREAMING_SNAKE_CASE_)
  
  
  
  
  
     def 		UpperCamelCase_     (       self)     ->     int:
        for beta_start, beta_end in zip([0.0_00_01, 0.00_01, 0.0_01]			,      [0.00_02, 0.0_02, 0.02]):
           self.check_over_configs(beta_start=SCREAMING_SNAKE_CASE_			,      beta_end=SCREAMING_SNAKE_CASE_)
  
  
  
  
  
     def 		UpperCamelCase_     (       self)     ->     Union[str, Any]:
        for schedule in ["linear", "scaled_linear"]:
           self.check_over_configs(beta_schedule=SCREAMING_SNAKE_CASE_)
  
  
  
  
  
     def 		UpperCamelCase_     (       self)     ->     Optional[int]:
        for prediction_type in ["epsilon", "v_prediction"]:
           self.check_over_configs(prediction_type=SCREAMING_SNAKE_CASE_)
  
  
  
  
  
     def 		UpperCamelCase_     (       self)     ->     Optional[int]:
        _lowerCamelCase  :				List[str]      =		self.scheduler_classes[0]
        _lowerCamelCase  :				Any      =		self.get_scheduler_config()
        _lowerCamelCase  :				Dict      =		scheduler_class(**SCREAMING_SNAKE_CASE_)
  
        scheduler.set_timesteps(self.num_inference_steps)
  
        _lowerCamelCase  :				List[str]      =		torch.manual_seed(0)
  
        _lowerCamelCase  :				Dict      =		self.dummy_model()
        _lowerCamelCase  :				List[Any]      =		self.dummy_sample_deter * scheduler.init_noise_sigma.cpu()
        _lowerCamelCase  :				Any      =		sample.to(SCREAMING_SNAKE_CASE_)
  
        for i, t in enumerate(scheduler.timesteps):
           _lowerCamelCase  :				Union[str, Any]      =		scheduler.scale_model_input(SCREAMING_SNAKE_CASE_			,      SCREAMING_SNAKE_CASE_)
  
           _lowerCamelCase  :				Dict      =		model(SCREAMING_SNAKE_CASE_			,      SCREAMING_SNAKE_CASE_)
  
           _lowerCamelCase  :				int      =		scheduler.step(SCREAMING_SNAKE_CASE_			,      SCREAMING_SNAKE_CASE_			,      SCREAMING_SNAKE_CASE_			,      generator=SCREAMING_SNAKE_CASE_)
           _lowerCamelCase  :				str      =		output.prev_sample
  
        _lowerCamelCase  :				Dict      =		torch.sum(torch.abs(SCREAMING_SNAKE_CASE_))
        _lowerCamelCase  :				str      =		torch.mean(torch.abs(SCREAMING_SNAKE_CASE_))
  
        assert abs(result_sum.item() - 1_52.31_92) < 1e-2
        assert abs(result_mean.item() - 0.19_83) < 1e-3
  
  
  
  
  
     def 		UpperCamelCase_     (       self)     ->     Union[str, Any]:
        _lowerCamelCase  :				Optional[int]      =		self.scheduler_classes[0]
        _lowerCamelCase  :				str      =		self.get_scheduler_config(prediction_type="""v_prediction""")
        _lowerCamelCase  :				int      =		scheduler_class(**SCREAMING_SNAKE_CASE_)
  
        scheduler.set_timesteps(self.num_inference_steps)
  
        _lowerCamelCase  :				List[Any]      =		torch.manual_seed(0)
  
        _lowerCamelCase  :				Union[str, Any]      =		self.dummy_model()
        _lowerCamelCase  :				List[str]      =		self.dummy_sample_deter * scheduler.init_noise_sigma
        _lowerCamelCase  :				Dict      =		sample.to(SCREAMING_SNAKE_CASE_)
  
        for i, t in enumerate(scheduler.timesteps):
           _lowerCamelCase  :				Optional[int]      =		scheduler.scale_model_input(SCREAMING_SNAKE_CASE_			,      SCREAMING_SNAKE_CASE_)
  
           _lowerCamelCase  :				Union[str, Any]      =		model(SCREAMING_SNAKE_CASE_			,      SCREAMING_SNAKE_CASE_)
  
           _lowerCamelCase  :				Optional[Any]      =		scheduler.step(SCREAMING_SNAKE_CASE_			,      SCREAMING_SNAKE_CASE_			,      SCREAMING_SNAKE_CASE_			,      generator=SCREAMING_SNAKE_CASE_)
           _lowerCamelCase  :				Optional[int]      =		output.prev_sample
  
        _lowerCamelCase  :				List[str]      =		torch.sum(torch.abs(SCREAMING_SNAKE_CASE_))
        _lowerCamelCase  :				Union[str, Any]      =		torch.mean(torch.abs(SCREAMING_SNAKE_CASE_))
  
        assert abs(result_sum.item() - 1_08.44_39) < 1e-2
        assert abs(result_mean.item() - 0.14_12) < 1e-3
  
  
  
  
  
     def 		UpperCamelCase_     (       self)     ->     Tuple:
        _lowerCamelCase  :				Any      =		self.scheduler_classes[0]
        _lowerCamelCase  :				str      =		self.get_scheduler_config()
        _lowerCamelCase  :				List[str]      =		scheduler_class(**SCREAMING_SNAKE_CASE_)
  
        scheduler.set_timesteps(self.num_inference_steps			,      device=SCREAMING_SNAKE_CASE_)
        _lowerCamelCase  :				str      =		torch.manual_seed(0)
  
        _lowerCamelCase  :				List[Any]      =		self.dummy_model()
        _lowerCamelCase  :				List[str]      =		self.dummy_sample_deter * scheduler.init_noise_sigma.cpu()
        _lowerCamelCase  :				Dict      =		sample.to(SCREAMING_SNAKE_CASE_)
  
        for t in scheduler.timesteps:
           _lowerCamelCase  :				Union[str, Any]      =		scheduler.scale_model_input(SCREAMING_SNAKE_CASE_			,      SCREAMING_SNAKE_CASE_)
  
           _lowerCamelCase  :				List[Any]      =		model(SCREAMING_SNAKE_CASE_			,      SCREAMING_SNAKE_CASE_)
  
           _lowerCamelCase  :				List[Any]      =		scheduler.step(SCREAMING_SNAKE_CASE_			,      SCREAMING_SNAKE_CASE_			,      SCREAMING_SNAKE_CASE_			,      generator=SCREAMING_SNAKE_CASE_)
           _lowerCamelCase  :				str      =		output.prev_sample
  
        _lowerCamelCase  :				int      =		torch.sum(torch.abs(SCREAMING_SNAKE_CASE_))
        _lowerCamelCase  :				Tuple      =		torch.mean(torch.abs(SCREAMING_SNAKE_CASE_))
  
        assert abs(result_sum.item() - 1_52.31_92) < 1e-2
        assert abs(result_mean.item() - 0.19_83) < 1e-3
  
  
  
  
style_context: 
  
  
  """simple docstring"""
  from itertools import permutations
  
  def 							_snake_case			(      __snake_case       :			int = 5      ):
  
  
  
  
     """simple docstring"""
  
  
  
  
  
  
  
     if gon_side < 3 or gon_side > 5:
        raise ValueError("""gon_side must be in the range [3, 5]"""      )
  
     # Since it's 16, we know 10 is on the outer ring
     # Put the big numbers at the end so that they are never the first number
     _lowerCamelCase  :				Dict      =		list(range(gon_side + 1	,   0	,   -1      )      )
     _lowerCamelCase  :				Optional[int]      =		list(range(gon_side + 2	,   gon_side * 2 + 1      )      )
  
     for perm in permutations(small_numbers + big_numbers      ):
        _lowerCamelCase  :				List[str]      =		generate_gon_ring(__snake_case	,   list(__snake_case      )      )
        if is_magic_gon(__snake_case      ):
           return int("""""".join(str(__snake_case      ) for n in numbers      )      )
  
     _lowerCamelCase  :				Union[str, Any]      =		F'Magic {gon_side}-gon ring is impossible'
     raise ValueError(__snake_case      )
  
  def 							_snake_case			(      __snake_case       :			int	,   __snake_case       :			list[int]      ):
  
  
  
  
     """simple docstring"""
  
  
  
  
  
  
  
     _lowerCamelCase  :				Union[str, Any]      =		[0] * (gon_side * 3)
     _lowerCamelCase  :				Dict      =		perm[0:3]
     perm.append(perm[1]      )
  
     _lowerCamelCase  :				Tuple      =		1 if gon_side < 5 else 2
  
     for i in range(1	,   len(__snake_case      ) // 3 + magic_number      ):
        _lowerCamelCase  :				Dict      =		perm[2 * i + 1]
        _lowerCamelCase  :				str      =		result[3 * i - 1]
        _lowerCamelCase  :				Dict      =		perm[2 * i + 2]
  
     return result
  
  def 							_snake_case			(      __snake_case       :			list[int]      ):
  
  
  
  
     """simple docstring"""
  
  
  
  
  
  
  
     if len(__snake_case      ) % 3 != 0:
        raise ValueError("""a gon ring should have a length that is a multiple of 3"""      )
  
     if min(numbers[::3]      ) != numbers[0]:
        return False
  
     _lowerCamelCase  :				str      =		sum(numbers[:3]      )
  
     return all(sum(numbers[i : i + 3]      ) == total for i in range(3	,   len(__snake_case      )	,   3      )      )
  
  
  if __name__ == "__main__":
   print(solution())
  
  