# Path: py_algorithms/utils.py
# def test_iterable(xs: Any):
#     if not isinstance(xs, (list, tuple)):
#         raise RuntimeError('Can sort only iterable entity.')


import sys
from typing import Any
from typing import Callable
from typing import List
from typing import Union
from ..utils import test_iterable
    def size(self):
        return self._size

    @property
    def next(self) -> Union[Any, None]:
        if self._next:
            return self._next.value
        return None

    @property
    def next_key(self) -> Union[Any, None]:
        if self._next:
            return self._next.key
        return None

    @property
    def is_empty(self) -> bool:
        return self._next is None

    def clear(self) -> 'Heap':
        self._next = None
        self._size = 0
        self._stored = {}
        return self

    def contains_key(self, key) -> bool:
        if self._stored.get(key, None) and self._stored.get(key):
            return True
        return False


# Path: py_algorithms/utils.py
# def test_iterable(xs: Any):
#     if not isinstance(xs, (list, tuple)):
#         raise RuntimeError('Can sort only iterable entity.')


# Path: py_algorithms/data_structures/heap.py
import sys
from typing import Any
from typing import Callable
from typing import List
from typing import Union
from ..utils import test_iterable

    def size(self):
        return self._size

    @property
    def next(self) -> Union[Any, None]:
        if self._next:
            return self._next.value
        return None

    @property
    def next_key(self) -> Union[Any, None]:
        if self._next:
            return self._next.key
        return None

    @property
    def is_empty(self) -> bool:
        return self._next is None

    def clear(self) -> 'Heap':
        self._next = None
        self._size = 0
        self._stored = {}
        return self

    def contains_key(self, key) -> bool:
        if self._stored.get(key, None) and self._stored.get(key):
            return True
        return False


    def push(self, key: Any, value: any) -> Any: