code: def test_max_loops():
      pipe = Pipeline(max_loops_allowed=10)
      pipe.add_component("add", AddFixedValue())
      pipe.add_component("threshold", Threshold(threshold=100))
      pipe.add_component("sum", Sum())
      pipe.connect("threshold.below", "add.value")
      pipe.connect("add.result", "sum.values")
      pipe.connect("sum.total", "threshold.value")
      with pytest.raises(PipelineMaxLoops):
          pipe.run({"sum": {"values": 1}})
  
imports: from typing import Optional
  import logging
  import pytest
  from haystack.core.pipeline import Pipeline
  from haystack.core.component.sockets import InputSocket, OutputSocket
  from haystack.core.errors import PipelineMaxLoops, PipelineError, PipelineRuntimeError
  from haystack.testing.sample_components import AddFixedValue, Threshold, Double, Sum
  from haystack.testing.factory import component_class
label_desc: Use image node_id 1 for calling a global function with example usage: test_max_loops() without return types