



"""simple docstring"""





import inspect
import warnings
from typing import Any, Dict, Optional, Union

from packaging import version




def 	UpperCAmelCase     (		*A	:						Any     ,				A	:						Optional[Union[Dict, Any]] = None     ,				A	:						str=True     ,				A	:						Any=2       ):

		'''simple docstring'''


		from .. import __version__

		_UpperCAmelCase							 =		take_from
		_UpperCAmelCase							 =		()
		if not isinstance(args[0]     ,				A       ):
				_UpperCAmelCase							 =		(args,)

		for attribute, version_name, message in args:
				if version.parse(version.parse(A       ).base_version       ) >= version.parse(A       ):
						raise ValueError(
						    f'The deprecation tuple {(attribute, version_name, message)} should be removed since diffusers\''
						    f' version {__version__} is >= {version_name}'       )

				_UpperCAmelCase							 =		None
				if isinstance(A     ,				A       ) and attribute in deprecated_kwargs:
						values += (deprecated_kwargs.pop(A       ),)
						_UpperCAmelCase							 =		f'The `{attribute}` argument is deprecated and will be removed in version {version_name}.'
				elif hasattr(A     ,				A       ):
						values += (getattr(A     ,				A       ),)
						_UpperCAmelCase							 =		f'The `{attribute}` attribute is deprecated and will be removed in version {version_name}.'
				elif deprecated_kwargs is None:
						_UpperCAmelCase							 =		f'`{attribute}` is deprecated and will be removed in version {version_name}.'

				if warning is not None:
						_UpperCAmelCase							 =		warning + ' ' if standard_warn else ''
						warnings.warn(warning + message     ,				A     ,				stacklevel=A       )

		if isinstance(A     ,				A       ) and len(A       ) > 0:
				_UpperCAmelCase							 =		inspect.getouterframes(inspect.currentframe()       )[1]
				_UpperCAmelCase							 =		call_frame.filename
				_UpperCAmelCase							 =		call_frame.lineno
				_UpperCAmelCase							 =		call_frame.function
				_UpperCAmelCase ,					_UpperCAmelCase							 =		next(iter(deprecated_kwargs.items()       )       )
				raise TypeError(f'{function} in {filename} line {line_number-1} got an unexpected keyword argument `{key}`'       )

		if len(A       ) == 0:
				return
		elif len(A       ) == 1:
				return values[0]
		return values







"""simple docstring"""





from itertools import permutations




def 	UpperCAmelCase     (		A	:						tuple       ):

		'''simple docstring'''


		if num[3] % 2 != 0:
				return False

		if (num[2] + num[3] + num[4]) % 3 != 0:
				return False

		if num[5] % 5 != 0:
				return False

		_UpperCAmelCase							 =		[7, 11, 13, 17]
		for i, test in enumerate(A       ):
				if (num[i + 4] * 100 + num[i + 5] * 10 + num[i + 6]) % test != 0:
						return False
		return True




def 	UpperCAmelCase     (		A	:						int = 10       ):

		'''simple docstring'''


		return sum(
		    int(''.join(map(A     ,				A       )       )       )
		    for num in permutations(range(A       )       )
		    if is_substring_divisible(A       )       )


if __name__ == "__main__":
					print(F'''{solution() = }''')


