def METHOD_NAME(
    structure: Structure,
    input_set_generator: VaspInputGenerator,
    directory: str | Path = ".",
    from_prev: bool = False,
    apply_incar_updates: bool = True,
    potcar_spec: bool = False,
    clean_prev: bool = True,
    **kwargs,
):
    """
    Write VASP input set.
    Parameters
    ----------
    structure : .Structure
        A structure.
    input_set_generator : .VaspInputGenerator
        A VASP input set generator.
    directory : str or Path
        The directory to write the input files to.
    from_prev : bool
        Whether to initialize the input set from a previous calculation.
    apply_incar_updates : bool
        Whether to apply incar updates given in the ~/.atomate2.yaml settings file.
    potcar_spec : bool
        Whether to use the POTCAR.spec file instead of the POTCAR file.
    clean_prev : bool
        Remove previous KPOINTS, INCAR, POSCAR, and POTCAR before writing new inputs.
    **kwargs
        Keyword arguments that will be passed to :obj:`.VaspInputSet.write_input`.
    """
    prev_dir = "." if from_prev else None
    vis = input_set_generator.get_input_set(
        structure, prev_dir=prev_dir, potcar_spec=potcar_spec
    )
    if apply_incar_updates:
        vis.incar.update(SETTINGS.VASP_INCAR_UPDATES)
    if clean_prev:
        # remove previous inputs (prevents old KPOINTS file from overriding KSPACING)
        for filename in ("POSCAR", "KPOINTS", "POTCAR", "INCAR"):
            if Path(filename).exists():
                Path(filename).unlink()
    logger.info("Writing VASP input set.")
    vis.write_input(directory, potcar_spec=potcar_spec, **kwargs)