code: def non_argument_modifiers(role='ARG1', only_connecting=True):
      
      def func(xmrs, deps):
          edges = []
          for src in deps:
              for _, tgt in deps[src]:
                  edges.append((src, tgt))
          components = _connected_components(xmrs.nodeids(), edges)
  
          ccmap = {}
          for i, component in enumerate(components):
              for n in component:
                  ccmap[n] = i
  
          addl = {}
          if not only_connecting or len(components) > 1:
              lsh = xmrs.labelset_heads
              lblheads = {v: lsh(v) for v, vd in xmrs._vars.items()
                          if 'LBL' in vd['refs']}
              for heads in lblheads.values():
                  if len(heads) > 1:
                      first = heads[0]
                      joined = set([ccmap[first]])
                      for other in heads[1:]:
                          occ = ccmap[other]
                          srt = var_sort(xmrs.args(other).get(role, 'u0'))
                          needs_edge = not only_connecting or occ not in joined
                          edge_available = srt == 'u'
                          if needs_edge and edge_available:
                              addl.setdefault(other, []).append((role, first))
                              joined.add(occ)
          return addl
  
      return func
docs: Return a function that finds non-argument modifier dependencies.
  
      Args:
          role (str): the role that is assigned to the dependency
          only_connecting (bool): if `True`, only return dependencies
              that connect separate components in the basic dependencies;
              if `False`, all non-argument modifier dependencies are
              included
  
      Returns:
          a function with signature `func(xmrs, deps)` that returns a
          mapping of non-argument modifier dependencies
  
      Examples:
          The default function behaves like the LKB:
  
          >>> func = non_argument_modifiers()
  
          A variation is similar to DMRS's MOD/EQ links:
  
          >>> func = non_argument_modifiers(role="MOD", only_connecting=False)