def main(
    api_url: Optional[str] = "http://localhost:6900",
    api_key: Optional[str] = DEFAULT_API_KEY,
    hf_token: Optional[str] = None,
    examples_folder: Path = Path("examples"),
) -> None:
    """
    Run the end2end example notebooks. If no arguments are passed, it
    will try to get the api_key and the hf_token from the environment variables.
    """
    if isinstance(examples_folder, str):
        examples_folder = Path(examples_folder)

    if not examples_folder.exists():
        raise ValueError(f"Folder {examples_folder} does not exist")

    if not hf_token:
        hf_token = get_huggingface_token()

    notebook_parameters = {
        "hf_token": hf_token,
        "api_url": api_url,
        "api_key": api_key,
    }

    # Name of the output notebook that will be removed after running the examples
    output_notebook = "output_notebook.ipynb"

    with tempfile.TemporaryDirectory() as tmpdir:
        examples = []
        for idx, filename in enumerate(examples_folder.glob("*.ipynb")):
            filename = Path(filename)
            if "-" in filename.stem:
                sort_index = int(filename.stem.split("-")[-1])
            else:
                sort_index = idx
            examples.append(
                ExampleNotebook(
                    sort_index=sort_index,
                    src_filename=filename,
                    dst_filename=Path(tmpdir) / output_notebook,
                    parameters=notebook_parameters,
                )
            )
        examples = sorted(examples, key=lambda x: x.sort_index)

        for example in examples:
            example.run()

    Run the end2end example notebooks. If no arguments are passed, it
    will try to get the api_key and the hf_token from the environment variables.
    
argilla-v1/scripts/end2end_examples.py