def METHOD_NAME(args: Iterable[str]) -> List[Path]:
    def is_option(x: str) -> bool:
        return x.startswith("-")
    def get_file_part_from_node_id(x: str) -> str:
        return x.split("::")[0]
    def get_dir_from_path(path: Path) -> Path:
        if path.is_dir():
            return path
        return path.parent
    def safe_exists(path: Path) -> bool:
        # This can throw on paths that contain characters unrepresentable at the OS level,
        # or with invalid syntax on Windows (https://bugs.python.org/issue35306)
        try:
            return path.exists()
        except OSError:
            return False
    # These look like paths but may not exist
    possible_paths = (
        absolutepath(get_file_part_from_node_id(arg))
        for arg in args
        if not is_option(arg)
    )
    return [get_dir_from_path(path) for path in possible_paths if safe_exists(path)]