




import inspect
import unittest






class  _lowerCAmelCase     (  unittest.TestCase	):

      def 	__magic_name__(   self		):
        try:
          import diffusers  # noqa: F401
        except ImportError:
          assert False







      def 	__magic_name__(   self		):
        import diffusers
        from diffusers.dependency_versions_table import deps

        lowerCAmelCase__				:  Any		       =     inspect.getmembers(__UpperCAmelCase      ,				inspect.isclass		)

        for cls_name, cls_module in all_classes:
          if "dummy_" in cls_module.__module__:
            for backend in cls_module._backends:
              if backend == "k_diffusion":
                lowerCAmelCase__				:  str		       =     '''k-diffusion'''
              elif backend == "invisible_watermark":
                lowerCAmelCase__				:  List[Any]		       =     '''invisible-watermark'''
              assert backend in deps, f"""{backend} is not in the deps table!"""







def      __lowerCAmelCase			(					UpperCamelCase      )     ->	bool:
  if not isinstance(UpperCamelCase	,      UpperCamelCase      ):
    raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''      )
  if len(UpperCamelCase      ) == 0:
    raise ValueError('''Input list must be a non empty list'''      )
  if len(UpperCamelCase      ) == 1:
    return True
  lowerCAmelCase__				:  Tuple		       =     series[1] - series[0]
  for index in range(len(UpperCamelCase      ) - 1      ):
    if series[index + 1] - series[index] != common_diff:
      return False
  return True



def      __lowerCAmelCase			(					UpperCamelCase      )     ->	float:
  if not isinstance(UpperCamelCase	,      UpperCamelCase      ):
    raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''      )
  if len(UpperCamelCase      ) == 0:
    raise ValueError('''Input list must be a non empty list'''      )
  lowerCAmelCase__				:  int		       =     0
  for val in series:
    answer += val
  return answer / len(UpperCamelCase      )


if __name__ == "__main__":
     import doctest

     doctest.testmod()

