code: def test_line():
      geom = ((0, 0), (0.5, 0.5))
      words = _mock_words(size=geom[1], offset=geom[0])
      line = elements.Line(words)
  
      # Attribute checks
      assert len(line.words) == len(words)
      assert all(isinstance(w, elements.Word) for w in line.words)
      assert line.geometry == geom
  
      # Render
      assert line.render() == "hello world"
  
      # Export
      assert line.export() == {
          "words": [w.export() for w in words],
          "geometry": geom,
      }
  
      # Repr
      words_str = (
          " " * 4 + ",\n    ".join(repr(word) for word in words) + ","
      )
      assert (
          line.__repr__() == f"Line(\n  (words): [\n{words_str}\n  ]\n)"
      )
  
      # Ensure that words repr does't span on several lines when there are none
      assert (
          repr(elements.Line([], ((0, 0), (1, 1))))
          == "Line(\n  (words): []\n)"
      )
  
      # from dict
      state_dict = {
          "words": [
              {
                  "value": "there",
                  "confidence": 0.1,
                  "geometry": ((0, 0), (1.0, 1.0)),
              }
          ],
          "geometry": ((0, 0), (1.0, 1.0)),
      }
      line = elements.Line.from_dict(state_dict)
      assert line.export() == state_dict
  
imports: from xml.etree.ElementTree import ElementTree
  import numpy
  import pytest
  from doctr.file_utils import CLASS_NAME
  from doctr.io import elements
label_desc: Use image node_id 10 for calling a global function with example usage: test_line() without return types