code: def test_forest_str_undirected():
      # Create a directed forest
      graph = nx.balanced_tree(r=2, h=2, create_using=nx.Graph)
  
      # arbitrary starting point
      nx.forest_str(graph)
  
      node_target0 = dedent(
          """
          ╙── 0
              ├── 1
              │   ├── 3
              │   └── 4
              └── 2
                  ├── 5
                  └── 6
          """
      ).strip()
  
      # defined starting point
      ret = nx.forest_str(graph, sources=[0])
      print(ret)
      assert ret == node_target0
  
      # defined starting point
      node_target2 = dedent(
          """
          ╙── 2
              ├── 0
              │   └── 1
              │       ├── 3
              │       └── 4
              ├── 5
              └── 6
          """
      ).strip()
      ret = nx.forest_str(graph, sources=[2])
      print(ret)
      assert ret == node_target2
  
imports: import random
  from itertools import product
  from textwrap import dedent
  import pytest
  import networkx
label_desc: Use image node_id 6 for calling a global function with example usage: test_forest_str_undirected() without return types