from typing import Any
from typing import Optional
from typing import Iterable
from typing import Tuple


def _get_item_iter(v: Any) -> Optional[Iterable[Tuple[Any, Any]]]:
    """Get a key-value iterable for the given object.

    Args:
        v: Any JSON object.

    Returns:
        An iterable which yields 2-tuples where the first element is the index
        value and the second element is the value. `None`, if the given object
        isn't a container.
    """
    if isinstance(v, list):
        return enumerate(v)
    if isinstance(v, dict):
        return v.items()

    return None