'**DEPRECATED** - Ensures that an index exists on this collection.
.. versionchanged:: 3.0
**DEPRECATED**'

def ensure_index(self, key_or_list, cache_for=300, **kwargs):

    warnings.warn('ensure_index    is    deprecated.    Use    create_index    instead.', DeprecationWarning, stacklevel=2)
    if (not (isinstance(cache_for, integer_types) or isinstance(cache_for, float))):
        raise TypeError('cache_for    must    be    an    integer    or    float.')
    if ('drop_dups' in kwargs):
        kwargs['dropDups'] = kwargs.pop('drop_dups')
    if ('bucket_size' in kwargs):
        kwargs['bucketSize'] = kwargs.pop('bucket_size')
    keys = helpers._index_list(key_or_list)
    name = kwargs.setdefault('name', helpers._gen_index_name(keys))
    if (not self.__database.client._cached(self.__database.name, self.__name, name)):
        self.__create_index(keys, kwargs)
        self.__database.client._cache_index(self.__database.name, self.__name, name, cache_for)
        return name
    return None
