code: def edge_closure(tree, children=iter, maxdepth=-1, verbose=False):
      """Yield the edges of a graph in breadth-first order,
      discarding eventual cycles.
      The first argument should be the start node;
      children should be a function taking as argument a graph node
      and returning an iterator of the node's children.
  
      >>> from nltk.util import edge_closure
      >>> print(list(edge_closure('A', lambda node:{'A':['B','C'], 'B':'C', 'C':'B'}[node])))
      [('A', 'B'), ('A', 'C'), ('B', 'C'), ('C', 'B')]
      """
      traversed = set()
      edges = set()
      queue = deque([(tree, 0)])
      while queue:
          node, depth = queue.popleft()
          traversed.add(node)
          if depth != maxdepth:
              try:
                  for child in children(node):
                      if child not in traversed:
                          queue.append((child, depth + 1))
                      else:
                          if verbose:
                              warnings.warn(
                                  f"Discarded redundant search for {child} at depth {depth + 1}",
                                  stacklevel=2,
                              )
                      edge = (node, child)
                      if edge not in edges:
                          yield edge
                          edges.add(edge)
              except TypeError:
                  pass
  
imports: import inspect
  import locale
  import os
  import pydoc
  import re
  import textwrap
  import unicodedata
  import warnings
  from collections import defaultdict, deque
  from itertools import chain, combinations, islice, tee
  from pprint import pprint
  from urllib.request import HTTPPasswordMgrWithDefaultRealm, ProxyBasicAuthHandler, ProxyDigestAuthHandler, ProxyHandler, build_opener, getproxies, install_opener
  from nltk.collections import *
  from nltk.internals import deprecated, raise_unorderable_types, slice_bounds
label_desc: Use image node_id 10 for calling a global function with example usage: edge_closure(tree, children, maxdepth, verbose) without return types