def METHOD_NAME(dirpath: PathType, module: str | None = None) -> str:
    """Returns import_gds script from a directory with all the GDS files.
    Args:
        dirpath: fixed cell directory path.
        module: Optional plot directive to plot imported component.
    """
    dirpath = pathlib.Path(dirpath)
    if not dirpath.exists():
        raise ValueError(f"{str(dirpath.absolute())!r} does not exist.")
    gdspaths = list(dirpath.glob("*.gds")) + list(dirpath.glob("*.GDS"))
    if not gdspaths:
        raise ValueError(f"No GDS files found at {dirpath.absolute()!r}.")
    logger.info(f"Writing {len(gdspaths)} cells from {dirpath.absolute()!r}")
    script = [script_prefix]
    script += [f"gdsdir = {str(dirpath.absolute())!r}\n"]
    script += [
        "import_gds = partial(gf.import_gds, gdsdir=gdsdir, decorator=add_ports)\n"
    ]
    cells = [get_script(gdspath, module=module) for gdspath in gdspaths]
    script += sorted(cells)
    return "\n".join(script)