code: def test_accuracy_functional_raises_invalid_task():
      """Tests accuracy task enum from functional.accuracy."""
      preds, target = _input_binary
      task = "NotValidTask"
      ignore_index = None
      multidim_average = "global"
  
      with pytest.raises(ValueError, match=r"Invalid *"):
          accuracy(
              preds,
              target,
              threshold=THRESHOLD,
              task=task,
              ignore_index=ignore_index,
              multidim_average=multidim_average,
          )
  
imports: from functools import partial
  import numpy
  import pytest
  import torch
  from scipy.special import expit
  from sklearn.metrics import accuracy_score
  from sklearn.metrics import confusion_matrix
  from torchmetrics.classification.accuracy import Accuracy, BinaryAccuracy, MulticlassAccuracy, MultilabelAccuracy
  from torchmetrics.functional.classification.accuracy import accuracy, binary_accuracy, multiclass_accuracy, multilabel_accuracy
  from torchmetrics.metric import Metric
  from unittests import NUM_CLASSES, THRESHOLD
  from unittests.classification.inputs import _binary_cases, _input_binary, _multiclass_cases, _multilabel_cases
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
label_desc: Use image node_id 3 for calling a global function with example usage: test_accuracy_functional_raises_invalid_task() without return types