code: def test_edit_raise_errors():
      """Test errors are raised on wrong input."""
      with pytest.raises(
          ValueError,
          match="Expected argument `substitution_cost` to be a positive integer.*",
      ):
          EditDistance(substitution_cost=-1)
  
      with pytest.raises(
          ValueError,
          match="Expected argument `substitution_cost` to be a positive integer.*",
      ):
          EditDistance(substitution_cost=2.0)
  
      with pytest.raises(
          ValueError,
          match="Expected argument `reduction` to be one of.*",
      ):
          EditDistance(reduction=2.0)
  
      with pytest.raises(
          ValueError,
          match="Expected argument `preds` and `target` to have same length.*",
      ):
          edit_distance(["abc"], ["abc", "def"])
  
file_path: torchmetrics/tests/unittests/text/test_edit.py
imports: from functools import partial
  import pytest
  from nltk.metrics.distance import edit_distance
  from torchmetrics.functional.text.edit import edit_distance
  from torchmetrics.text.edit import EditDistance
  from unittests.text.helpers import TextTester
  from unittests.text.inputs import _inputs_single_reference
label_desc: Use image node_id 4 for calling a global function with example usage: test_edit_raise_errors() without return types