



import timeit

import numpy as np

import datasets
from datasets.arrow_writer import ArrowWriter
from datasets.features.features import _ArrayXD
def 	snake_case__       (					__lowercase       )		->		str:







      """simple docstring"""

      def wrapper(*__lowercase							,     **__lowercase       ):
            A__	:							Dict						    = timeit.default_timer()
            A__	:							Optional[Any]						    = func(*__lowercase							,     **__lowercase       )
            A__	:							Union[str, Any]						    = timeit.default_timer() - starttime
            return delta

      A__	:							int						    = func.__name__

      return wrapper
def 	snake_case__       (					__lowercase							,     __lowercase=1_0_0							,     __lowercase=None       )		->		str:







      """simple docstring"""

      A__	:							int						    = []
      A__	:							Tuple						    = seq_shapes or {}
      for i in range(__lowercase       ):
            A__	:							Any						    = {}
            for col_id, (k, v) in enumerate(features.items()       ):
                  if isinstance(__lowercase							,     _ArrayXD       ):
                        A__	:							List[str]						    = np.random.rand(*v.shape       ).astype(v.dtype       )
                  elif isinstance(__lowercase							,     datasets.Value       ):
                        if v.dtype == "string":
                              A__	:							int						    = "The small grey turtle was surprisingly fast when challenged."
                        else:
                              A__	:							int						    = np.random.randint(1_0							,     size=1       ).astype(v.dtype       ).item()
                  elif isinstance(__lowercase							,     datasets.Sequence       ):
                        while isinstance(__lowercase							,     datasets.Sequence       ):
                              A__	:							Dict						    = v.feature
                        A__	:							Optional[Any]						    = seq_shapes[k]
                        A__	:							Optional[int]						    = np.random.rand(*__lowercase       ).astype(v.dtype       )
                  A__	:							Union[str, Any]						    = data

            dummy_data.append((i, example)       )

      return dummy_data




def 	snake_case__       (					__lowercase							,     __lowercase							,     __lowercase=1_0_0							,     __lowercase=None       )		->		Any:







      """simple docstring"""

      A__	:							List[str]						    = generate_examples(__lowercase							,     num_examples=__lowercase							,     seq_shapes=__lowercase       )

      with ArrowWriter(features=__lowercase							,     path=__lowercase       ) as writer:
            for key, record in dummy_data:
                  A__	:							List[Any]						    = features.encode_example(__lowercase       )
                  writer.write(__lowercase       )

            A__	:							Any						    = writer.finalize()

      if not num_final_examples == num_examples:
            raise ValueError(
                F'Error writing the dataset, wrote {num_final_examples} examples but should have written {num_examples}.'       )

      A__	:							Optional[Any]						    = datasets.Dataset.from_file(filename=__lowercase							,     info=datasets.DatasetInfo(features=__lowercase       )       )

      return dataset




from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt
def 	snake_case__       (					__lowercase       )		->		bool:







						"""simple docstring"""

						A__	:							int						    = int(number**0.5       )
						return number == sq * sq
def 	snake_case__       (					__lowercase							,     __lowercase							,     __lowercase							,     __lowercase							,     __lowercase							,     __lowercase       )		->		tuple[int, int]:







						"""simple docstring"""

						A__	:							int						    = x_num * y_den * z_den + y_num * x_den * z_den + z_num * x_den * y_den
						A__	:							int						    = x_den * y_den * z_den
						A__	:							int						    = gcd(__lowercase							,     __lowercase       )
						top //= hcf
						bottom //= hcf
						return top, bottom
def 	snake_case__       (					__lowercase = 3_5       )		->		int:







						"""simple docstring"""

						A__	:							set						    = set()
						A__	:							int
						A__	:							Fraction						    = Fraction(0       )
						A__	:							tuple[int, int]

						for x_num in range(1							,     order + 1       ):
												for x_den in range(x_num + 1							,     order + 1       ):
																		for y_num in range(1							,     order + 1       ):
																								for y_den in range(y_num + 1							,     order + 1       ):
																														# n=1
																														A__	:							Any						    = x_num * y_den + x_den * y_num
																														A__	:							List[Any]						    = x_den * y_den
																														A__	:							List[Any]						    = gcd(__lowercase							,     __lowercase       )
																														z_num //= hcf
																														z_den //= hcf
																														if 0 < z_num < z_den <= order:
																																				A__	:							List[Any]						    = add_three(
																																				    __lowercase							,     __lowercase							,     __lowercase							,     __lowercase							,     __lowercase							,     __lowercase       )
																																				unique_s.add(__lowercase       )

																														# n=2
																														A__	:							Any						    = (
																														    x_num * x_num * y_den * y_den + x_den * x_den * y_num * y_num
																														)
																														A__	:							Optional[int]						    = x_den * x_den * y_den * y_den
																														if is_sq(__lowercase       ) and is_sq(__lowercase       ):
																																				A__	:							Union[str, Any]						    = int(sqrt(__lowercase       )       )
																																				A__	:							int						    = int(sqrt(__lowercase       )       )
																																				A__	:							Any						    = gcd(__lowercase							,     __lowercase       )
																																				z_num //= hcf
																																				z_den //= hcf
																																				if 0 < z_num < z_den <= order:
																																										A__	:							List[Any]						    = add_three(
																																										    __lowercase							,     __lowercase							,     __lowercase							,     __lowercase							,     __lowercase							,     __lowercase       )
																																										unique_s.add(__lowercase       )

                    # n=-1
																														A__	:							Tuple						    = x_num * y_num
																														A__	:							int						    = x_den * y_num + x_num * y_den
																														A__	:							List[str]						    = gcd(__lowercase							,     __lowercase       )
																														z_num //= hcf
																														z_den //= hcf
																														if 0 < z_num < z_den <= order:
																																				A__	:							str						    = add_three(
																																				    __lowercase							,     __lowercase							,     __lowercase							,     __lowercase							,     __lowercase							,     __lowercase       )
																																				unique_s.add(__lowercase       )

																														# n=2
																														A__	:							Any						    = x_num * x_num * y_num * y_num
																														A__	:							List[str]						    = (
																														    x_den * x_den * y_num * y_num + x_num * x_num * y_den * y_den
																														)
																														if is_sq(__lowercase       ) and is_sq(__lowercase       ):
																																				A__	:							Optional[int]						    = int(sqrt(__lowercase       )       )
																																				A__	:							List[Any]						    = int(sqrt(__lowercase       )       )
																																				A__	:							Union[str, Any]						    = gcd(__lowercase							,     __lowercase       )
																																				z_num //= hcf
																																				z_den //= hcf
																																				if 0 < z_num < z_den <= order:
																																										A__	:							Optional[Any]						    = add_three(
																																										    __lowercase							,     __lowercase							,     __lowercase							,     __lowercase							,     __lowercase							,     __lowercase       )
																																										unique_s.add(__lowercase       )

						for num, den in unique_s:
												total += Fraction(__lowercase							,     __lowercase       )

						return total.denominator + total.numerator


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