code: def test_warning_on_too_large_adjusted(metric_class=R2Score):
      """Test that warning is raised if adjusted argument is set to more than or equal to the number of datapoints."""
      metric = metric_class(adjusted=10)
  
      with pytest.warns(
          UserWarning,
          match="More independent regressions than data points in adjusted r2 score. Falls back to standard r2 score.",
      ):
          metric(torch.randn(10), torch.randn(10))
  
      with pytest.warns(
          UserWarning,
          match="Division by zero in adjusted r2 score. Falls back to standard r2 score.",
      ):
          metric(torch.randn(11), torch.randn(11))
  
imports: from functools import partial
  import pytest
  import torch
  from sklearn.metrics import r2_score
  from torchmetrics.functional import r2_score
  from torchmetrics.regression import R2Score
  from unittests import BATCH_SIZE, NUM_BATCHES, _Input
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 6 for calling a global function with example usage: test_warning_on_too_large_adjusted(metric_class) without return types