def METHOD_NAME(sidebar_json_path, version_prefix):
    implemented_sidebar_pages = set()
    with open(sidebar_json_path) as f:
        sidebars = json.load(f)[f'{version_prefix}docs']
        for v in sidebars.values():
            if isinstance(v[0], str):
                implemented_sidebar_pages = implemented_sidebar_pages.union(set(v))
            else:
                for item in v:
                    implemented_sidebar_pages = implemented_sidebar_pages.union(set(item['ids']))
    return implemented_sidebar_pages