code: def mock_hfh(monkeypatch):
      class MetricMock:
          def __init__(self, metric_id):
              self.id = metric_id
  
      class HfhMock:
          _metrics = [
              MetricMock(metric_id)
              for metric_id in [
                  "accuracy",
                  "mse",
                  "precision",
                  "codeparrot/apps_metric",
              ]
          ]
  
          def list_metrics(self):
              return self._metrics
  
      monkeypatch.setattr("datasets.inspect.huggingface_hub", HfhMock())
  
imports: import pytest
  from datasets import inspect_metric, list_metrics, load_metric
label_desc: Use image node_id 2 for calling a global function with example usage: mock_hfh(monkeypatch) and returns: self