def _is_array_like(x):
    """
    Helper function that determines if an object is array-like.
    Array-like objects provide `__getitem__` and `__len__` methods.

    Parameters
    ----------
    x: any
        Object to test

    Returns
    -------
    bool
        `True` if `x` is array-like, `False` otherwise.
    """
    return hasattr(x, '__getitem__') and hasattr(x, '__len__')