code: def test_rand_score_functional_raises_invalid_task():
      """Check that metric rejects continuous-valued inputs."""
      preds, target = _float_inputs_extrinsic
      with pytest.raises(ValueError, match=r"Expected *"):
          rand_score(preds, target)
  
file_path: torchmetrics/tests/unittests/clustering/test_rand_score.py
imports: import pytest
  import torch
  from sklearn.metrics import rand_score
  from torchmetrics.clustering.rand_score import RandScore
  from torchmetrics.functional.clustering.rand_score import rand_score
  from unittests.clustering.inputs import _float_inputs_extrinsic, _single_target_extrinsic1, _single_target_extrinsic2
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 1 for calling a global function with example usage: test_rand_score_functional_raises_invalid_task() without return types