code: def test_write_missing_directory(write_method_name: str) -> None:
      df = pl.DataFrame({"a": [1]})
      non_existing_path = Path("non", "existing", "path")
      if non_existing_path.exists():
          pytest.fail(
              "Testing on a non existing path failed because the path does exist."
          )
      write_method = getattr(df, write_method_name)
      with pytest.raises(FileNotFoundError):
          write_method(non_existing_path)
  
file_path: polars/py-polars/tests/unit/io/test_other.py
imports: from __future__ import annotations
  import copy
  import sys
  from pathlib import Path
  from typing import Any, Callable, cast
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 2 for calling a global function with example usage: test_write_missing_directory(write_method_name) without return types