


'''simple docstring'''






import os
from collections import namedtuple

import pytest

from datasets import ClassLabel, Features, Sequence, Value
from datasets.commands.test import TestCommand
from datasets.info import DatasetInfo, DatasetInfosDict


__A					:  int											=      namedtuple(
    "_TestCommandArgs",
    [
        "dataset",
        "name",
        "cache_dir",
        "data_dir",
        "all_configs",
        "save_infos",
        "ignore_verifications",
        "force_redownload",
        "clear_cache",
    ],
    defaults=[None, None, None, False, False, False, False, False],
)







def 				UpperCamelCase_			(    A__					:   Optional[Any]							,    A__					:   Tuple					):
  '''simple docstring'''





  return (abs(source - target					) / target) < 0.01







@pytest.mark.integration
def 				UpperCamelCase_			(    A__					:   List[str]					):
  '''simple docstring'''





  lowerCAmelCase_			:      Optional[int]			=   _TestCommandArgs(dataset=A__							,    all_configs=A__							,    save_infos=A__					)
  lowerCAmelCase_			:      int			=   TestCommand(*A__					)
  test_command.run()
  lowerCAmelCase_			:      Dict			=   os.path.join(A__							,    """README.md"""					)
  assert os.path.exists(A__					)
  lowerCAmelCase_			:      Dict			=   DatasetInfosDict.from_directory(A__					)
  lowerCAmelCase_			:      str			=   DatasetInfosDict(
      {
          """default""": DatasetInfo(
              features=Features(
                  {
                      """tokens""": Sequence(Value("""string"""					)					),
                      """ner_tags""": Sequence(
                          ClassLabel(names=["""O""", """B-PER""", """I-PER""", """B-ORG""", """I-ORG""", """B-LOC""", """I-LOC"""]					)					),
                      """langs""": Sequence(Value("""string"""					)					),
                      """spans""": Sequence(Value("""string"""					)					),
                  }					)							,    splits=[
                  {
                      """name""": """train""",
                      """num_bytes""": 2_35_15_63,
                      """num_examples""": 1_00_00,
                  },
                  {
                      """name""": """validation""",
                      """num_bytes""": 23_84_18,
                      """num_examples""": 10_00,
                  },
              ]							,    download_size=3_94_06_80							,    dataset_size=2_58_99_81							,    )
      }					)
  assert dataset_infos.keys() == expected_dataset_infos.keys()
  for key in DatasetInfo._INCLUDED_INFO_IN_YAML:
    lowerCAmelCase_,							lowerCAmelCase_			:      Any			=   getattr(dataset_infos["""default"""]							,    A__					), getattr(expected_dataset_infos["""default"""]							,    A__					)
    if key == "num_bytes":
      assert is_apercent_close(A__							,    A__					)
    elif key == "splits":
      assert list(A__					) == list(A__					)
      for split in result:
        assert result[split].name == expected[split].name
        assert result[split].num_examples == expected[split].num_examples
        assert is_apercent_close(result[split].num_bytes							,    expected[split].num_bytes					)
    else:
      result == expected







'''simple docstring'''






def 				UpperCamelCase_			(    A__					:   int					):
  '''simple docstring'''





  lowerCAmelCase_			:      Union[str, Any]			=   (1 + 24 * n) ** 0.5
  return ((1 + root) / 6) % 1 == 0







def 				UpperCamelCase_			(    A__					:   int = 50_00					):
  '''simple docstring'''





  lowerCAmelCase_			:      Optional[int]			=   [(i * (3 * i - 1)) // 2 for i in range(1							,    A__					)]
  for i, pentagonal_i in enumerate(A__					):
    for j in range(A__							,    len(A__					)					):
      lowerCAmelCase_			:      int			=   pentagonal_nums[j]
      lowerCAmelCase_			:      Union[str, Any]			=   pentagonal_i + pentagonal_j
      lowerCAmelCase_			:      List[Any]			=   pentagonal_j - pentagonal_i
      if is_pentagonal(A__					) and is_pentagonal(A__					):
        return b

  return -1


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



