





import importlib
import os
import sys


# This is required to make the module import works (when the python process is running from the root of the repo)
sys.path.append(".")





def     _UpperCamelCase     (a__   :Optional[int]       ):






							"""simple docstring"""





							UpperCamelCase__				     =			test_file.split(os.path.sep       )
							if components[0:2] != ["tests", "models"]:
														raise ValueError(
														    """`test_file` should start with `tests/models/` (with `/` being the OS specific path separator). Got """
														    f"""{test_file} instead."""       )
							UpperCamelCase__				     =			components[-1]
							if not test_fn.endswith("""py"""       ):
														raise ValueError(f"""`test_file` should be a python file. Got {test_fn} instead."""       )
							if not test_fn.startswith("""test_modeling_"""       ):
														raise ValueError(
														    f"""`test_file` should point to a file name of the form `test_modeling_*.py`. Got {test_fn} instead."""       )

							UpperCamelCase__				     =			components[:-1] + [test_fn.replace(""".py"""   ,			""""""       )]
							UpperCamelCase__				     =			""".""".join(a__       )

							return test_module_path





def     _UpperCamelCase     (a__   :List[Any]       ):






							"""simple docstring"""





							UpperCamelCase__				     =			get_module_path(a__       )
							UpperCamelCase__				     =			importlib.import_module(a__       )

							return test_module





def     _UpperCamelCase     (a__   :Optional[Any]       ):






							"""simple docstring"""





							UpperCamelCase__				     =			[]
							UpperCamelCase__				     =			get_test_module(a__       )
							for attr in dir(a__       ):
														if attr.endswith("""ModelTester"""       ):
																					tester_classes.append(getattr(a__   ,			a__       )       )

    # sort with class names
							return sorted(a__   ,			key=lambda a__       : x.__name__       )





def     _UpperCamelCase     (a__   :Optional[Any]       ):






							"""simple docstring"""





							UpperCamelCase__				     =			[]
							UpperCamelCase__				     =			get_test_module(a__       )
							for attr in dir(a__       ):
														UpperCamelCase__				     =			getattr(a__   ,			a__       )
														# (TF/Flax)ModelTesterMixin is also an attribute in specific model test module. Let's exclude them by checking
														# `all_model_classes` is not empty (which also excludes other special classes).
														UpperCamelCase__				     =			getattr(a__   ,			"""all_model_classes"""   ,			[]       )
														if len(a__       ) > 0:
																					test_classes.append(a__       )

    # sort with class names
							return sorted(a__   ,			key=lambda a__       : x.__name__       )





def     _UpperCamelCase     (a__   :Union[str, Any]       ):






							"""simple docstring"""





							UpperCamelCase__				     =			get_test_classes(a__       )
							UpperCamelCase__				     =			set()
							for test_class in test_classes:
														model_classes.update(test_class.all_model_classes       )

							# sort with class names
							return sorted(a__   ,			key=lambda a__       : x.__name__       )





def     _UpperCamelCase     (a__   :Union[str, Any]       ):






							"""simple docstring"""





							UpperCamelCase__				     =			test_class()
							if hasattr(a__   ,			"""setUp"""       ):
														test.setUp()

							UpperCamelCase__				     =			None
							if hasattr(a__   ,			"""model_tester"""       ):
														# `(TF/Flax)ModelTesterMixin` has this attribute default to `None`. Let's skip this case.
														if test.model_tester is not None:
																					UpperCamelCase__				     =			test.model_tester.__class__

							return model_tester





def     _UpperCamelCase     (a__   :Dict   ,			a__   :Optional[int]       ):






							"""simple docstring"""





							UpperCamelCase__				     =			get_test_classes(a__       )

							UpperCamelCase__				     =			[]
							for test_class in test_classes:
														if model_class in test_class.all_model_classes:
																					target_test_classes.append(a__       )

    # sort with class names
							return sorted(a__   ,			key=lambda a__       : x.__name__       )





def     _UpperCamelCase     (a__   :Any   ,			a__   :Optional[int]       ):






							"""simple docstring"""





							UpperCamelCase__				     =			get_test_classes_for_model(a__   ,			a__       )

							UpperCamelCase__				     =			[]
							for test_class in test_classes:
														UpperCamelCase__				     =			get_model_tester_from_test_class(a__       )
														if tester_class is not None:
																					tester_classes.append(a__       )

    # sort with class names
							return sorted(a__   ,			key=lambda a__       : x.__name__       )





def     _UpperCamelCase     (a__   :Optional[Any]       ):






							"""simple docstring"""





							UpperCamelCase__				     =			get_test_classes(a__       )
							UpperCamelCase__				     =			{test_class: get_model_tester_from_test_class(a__       ) for test_class in test_classes}
							return test_tester_mapping





def     _UpperCamelCase     (a__   :Optional[Any]       ):






							"""simple docstring"""





							UpperCamelCase__				     =			get_model_classes(a__       )
							UpperCamelCase__				     =			{
							    model_class: get_test_classes_for_model(a__   ,			a__       ) for model_class in model_classes
							}
							return model_test_mapping





def     _UpperCamelCase     (a__   :Any       ):






							"""simple docstring"""





							UpperCamelCase__				     =			get_model_classes(a__       )
							UpperCamelCase__				     =			{
							    model_class: get_tester_classes_for_model(a__   ,			a__       ) for model_class in model_classes
							}
							return model_to_tester_mapping





def     _UpperCamelCase     (a__   :int       ):






							"""simple docstring"""





							if isinstance(a__   ,			a__       ):
														return o
							elif isinstance(a__   ,			a__       ):
														return o.__name__
							elif isinstance(a__   ,			(list, tuple)       ):
														return [to_json(a__       ) for x in o]
							elif isinstance(a__   ,			a__       ):
														return {to_json(a__       ): to_json(a__       ) for k, v in o.items()}
							else:
														return o











import math





def     _UpperCamelCase     (a__   :int       ):






							"""simple docstring"""





							UpperCamelCase__				     =			[True] * n
							UpperCamelCase__				     =			False
							UpperCamelCase__				     =			False
							UpperCamelCase__				     =			True

							for i in range(3   ,			int(n**0.5 + 1       )   ,			2       ):
														UpperCamelCase__				     =			i * 2
														while index < n:
																					UpperCamelCase__				     =			False
																					UpperCamelCase__				     =			index + i

							UpperCamelCase__				     =			[2]

							for i in range(3   ,			a__   ,			2       ):
														if is_prime[i]:
																					primes.append(a__       )

							return primes





def     _UpperCamelCase     (a__   :int = 9999_6666_3333       ):






							"""simple docstring"""





							UpperCamelCase__				     =			math.floor(math.sqrt(a__       )       ) + 100
							UpperCamelCase__				     =			prime_sieve(a__       )

							UpperCamelCase__				     =			0
							UpperCamelCase__				     =			0
							UpperCamelCase__				     =			primes[prime_index]

							while (last_prime**2) <= limit:
														UpperCamelCase__				     =			primes[prime_index + 1]

														UpperCamelCase__				     =			last_prime**2
														UpperCamelCase__				     =			next_prime**2

														# Get numbers divisible by lps(current)
														UpperCamelCase__				     =			lower_bound + last_prime
														while upper_bound > current <= limit:
																					matches_sum += current
																					current += last_prime

														# Reset the upper_bound
														while (upper_bound - next_prime) > limit:
																					upper_bound -= next_prime

														# Add the numbers divisible by ups(current)
														UpperCamelCase__				     =			upper_bound - next_prime
														while current > lower_bound:
																					matches_sum += current
																					current -= next_prime

														# Remove the numbers divisible by both ups and lps
														UpperCamelCase__				     =			0
														while upper_bound > current <= limit:
																					if current <= lower_bound:
																												# Increment the current number
																												current += last_prime * next_prime
																												continue

																					if current > limit:
																												break

																					# Remove twice since it was added by both ups and lps
																					matches_sum -= current * 2

																					# Increment the current number
																					current += last_prime * next_prime

														# Setup for next pair
														UpperCamelCase__				     =			next_prime
														prime_index += 1

							return matches_sum


if __name__ == "__main__":
					print(solution())




