def _process_dims(dims, names):
    """
    Check if an xarray's dims contain something that
    is in *names*

    Parameters
    ----------
    dims : tuple of str
    names : str or container of str

    Returns
    -------
    i : int
        The index in dims
    """
    if isinstance(names, int):
        return names
    for i, d in enumerate(dims):
        if d.lower() in names:
            return i
    return None