

'''simple docstring'''







from operator import delitem, getitem, setitem

import pytest

from data_structures.hashing.hash_map import HashMap
def  UpperCAmelCase__      ( UpperCAmelCase__			)     ->     List[Any]:
       return getitem, k
def  UpperCAmelCase__      ( UpperCAmelCase__,    UpperCAmelCase__			)     ->     List[str]:
       return setitem, k, v
def  UpperCAmelCase__      ( UpperCAmelCase__			)     ->     int:
       return delitem, k
def  UpperCAmelCase__      ( UpperCAmelCase__,    UpperCAmelCase__,    *UpperCAmelCase__			)     ->     List[Any]:
       try:
              return fun(UpperCAmelCase__,    *UpperCAmelCase__			), None
       except Exception as e:
              return None, e


__lowerCamelCase						    =      (
    _set('''key_a''', '''val_a'''),
    _set('''key_b''', '''val_b'''),
)

__lowerCamelCase						    =      [
    _set('''key_a''', '''val_a'''),
    _set('''key_a''', '''val_b'''),
]

__lowerCamelCase						    =      [
    _set('''key_a''', '''val_a'''),
    _set('''key_b''', '''val_b'''),
    _del('''key_a'''),
    _del('''key_b'''),
    _set('''key_a''', '''val_a'''),
    _del('''key_a'''),
]

__lowerCamelCase						    =      [
    _get('''key_a'''),
    _del('''key_a'''),
    _set('''key_a''', '''val_a'''),
    _del('''key_a'''),
    _del('''key_a'''),
    _get('''key_a'''),
]

__lowerCamelCase						    =      [
    *[_set(x, x) for x in range(5)],  # guaranteed upsize
]

__lowerCamelCase						    =      [
    *[_set(x, x) for x in range(5)],  # guaranteed upsize
    *[_del(x) for x in range(5)],
    _set('''key_a''', '''val_b'''),
]
@pytest.mark.parametrize(
    """operations""",    (
        pytest.param(_add_items,    id="""add items"""			),
        pytest.param(_overwrite_items,    id="""overwrite items"""			),
        pytest.param(_delete_items,    id="""delete items"""			),
        pytest.param(_access_absent_items,    id="""access absent items"""			),
        pytest.param(_add_with_resize_up,    id="""add with resize up"""			),
        pytest.param(_add_with_resize_down,    id="""add with resize down"""			),
    ),    )
def  UpperCAmelCase__      ( UpperCAmelCase__			)     ->     Tuple:
       A_		   = HashMap(initial_block_size=4			)
       A_		   = {}
       for _, (fun, *args) in enumerate(UpperCAmelCase__			):
              A_   ,     A_		   = _run_operation(UpperCAmelCase__,    UpperCAmelCase__,    *UpperCAmelCase__			)
              A_   ,     A_		   = _run_operation(UpperCAmelCase__,    UpperCAmelCase__,    *UpperCAmelCase__			)
              assert my_res == py_res
              assert str(UpperCAmelCase__			) == str(UpperCAmelCase__			)
              assert set(UpperCAmelCase__			) == set(UpperCAmelCase__			)
              assert len(UpperCAmelCase__			) == len(UpperCAmelCase__			)
              assert set(my.items()			) == set(py.items()			)







def  UpperCAmelCase__      ( )     ->     str:
       def is_public(UpperCAmelCase__			) -> bool:
              return not name.startswith("""_"""			)

       A_		   = {name for name in dir({}			) if is_public(UpperCAmelCase__			)}
       A_		   = {name for name in dir(HashMap()			) if is_public(UpperCAmelCase__			)}

       assert dict_public_names > hash_public_names



'''simple docstring'''







def  UpperCAmelCase__      ( UpperCAmelCase__			)     ->     float:

       if edge <= 0 or not isinstance(UpperCAmelCase__,    UpperCAmelCase__			):
              raise ValueError("""Length must be a positive."""			)
       return 3 * ((25 + 10 * (5 ** (1 / 2))) ** (1 / 2)) * (edge**2)
def  UpperCAmelCase__      ( UpperCAmelCase__			)     ->     float:

       if edge <= 0 or not isinstance(UpperCAmelCase__,    UpperCAmelCase__			):
              raise ValueError("""Length must be a positive."""			)
       return ((15 + (7 * (5 ** (1 / 2)))) / 4) * (edge**3)


if __name__ == "__main__":
      import doctest

      doctest.testmod()
