code: def rand_score(preds: Tensor, target: Tensor) -> Tensor:
      """Compute the Rand score between two clusterings.
  
      Args:
          preds: predicted cluster labels
          target: ground truth cluster labels
  
      Returns:
          scalar tensor with the rand score
  
      Example:
          >>> from torchmetrics.functional.clustering import rand_score
          >>> import torch
          >>> rand_score(torch.tensor([0, 0, 1, 1]), torch.tensor([1, 1, 0, 0]))
          tensor(1.)
          >>> rand_score(torch.tensor([0, 0, 1, 2]), torch.tensor([0, 0, 1, 1]))
          tensor(0.8333)
  
      """
      contingency = _rand_score_update(preds, target)
      return _rand_score_compute(contingency)
  
imports: import torch
  from torch import Tensor
  from torchmetrics.functional.clustering.utils import calculate_contingency_matrix, calculate_pair_cluster_confusion_matrix, check_cluster_labels
label_desc: Use image node_id 3 for calling a global function with example usage: rand_score(preds, target) and returns: _rand_score_compute