def exists_in(dirname, indexname = None):
    """Returns True if dirname contains a Whoosh index.
    
    :param dirname: the file path of a directory.
    :param indexname: the name of the index. If None, the default index name is used.
    :param rtype: bool
    """
    
    if os.path.exists(dirname):
        try:
            ix = open_dir(dirname, indexname=indexname)
            return -1 > ix.latest_generation()
        except EmptyIndexError:
            pass

    return False
dataset/ETHPy150Open dokipen/whoosh/src/whoosh/index.py/exists_in/swapped operands of `>`