def get_index_path(version=None, only_existing=False, allow_similar=True):

    if version is None:
        version = _get_current_version()

    path_ = path = expanduser(join('~/.cinspect', 'index-%s.json' % version))
    if only_existing and not exists(path):
       if allow_similar:
           files = glob.glob(expanduser(join('~/.cinspect', 'index*.json')))
           path = _get_most_similar(version, files)
       else:
           path = None

    if path is None:
        raise OSError('Index path does not exist: %s' % path_)

    return path
Return the path to the index file for the given version.
dataset/ETHPy150Open punchagan/cinspect/cinspect/index/serialize.py/get_index_path