code: def _adjusted_rand_score_update(
      preds: Tensor, target: Tensor
  ) -> Tensor:
      """Update and return variables required to compute the rand score.
  
      Args:
          preds: predicted cluster labels
          target: ground truth cluster labels
  
      Returns:
          contingency: contingency matrix
  
      """
      check_cluster_labels(preds, target)
      return calculate_contingency_matrix(preds, target)
  
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 1 for calling a global function with example usage: _adjusted_rand_score_update(preds, target) and returns: calculate_contingency_matrix