code: def test_metric_dot_flat_escaped(
      relay_server, user, publish_util, mock_run
  ):
      """Match works when metric is escaped."""
      history = []
      history.append(dict(step=0, data={"this.has.dots": 2}))
      history.append(dict(step=1, data={"this.also": 2}))
      history.append(dict(step=2, data={"nodots": 2}))
      history.append(dict(step=3, data={"this.also": 1}))
  
      m1 = pb.MetricRecord(name=r"this\.also")
      m1.summary.max = True
      metrics = _make_metrics([m1])
  
      run = mock_run(use_magic_mock=True)
      with relay_server() as relay:
          publish_util(run=run, metrics=metrics, history=history)
  
      metrics = relay.context.get_run_metrics(run.id)
      summary = relay.context.get_run_summary(
          run.id, include_private=True
      )
  
      assert metrics and len(metrics) == 1
      assert metrics[0] == {"1": r"this\.also", "7": [2]}
  
      assert summary["this.also"] == {"max": 2}
      assert summary["nodots"] == 2
      assert summary["this.has.dots"] == 2
      assert summary["_step"] == 3
  
imports: from wandb.proto import wandb_internal_pb2
label_desc: Use image node_id 17 for calling a global function with example usage: test_metric_dot_flat_escaped(relay_server, user, publish_util, mock_run) without return types