def _query_include_self(X, include_self, mode):
    """Return the query based on include_self param"""
    if include_self == 'auto':
        include_self = mode == 'connectivity'
    if not include_self:
        X = None
    return X
