code: def namedpersistent(link):
      """Return a generator of all (path, persistent) pairs for a given link.
  
      This function is adopted from https://github.com/chainer/chainer/pull/6788.
      Once it is merged into Chainer, we should use the property instead.
  
      Args:
          link (chainer.Link): Link.
  
      Returns:
          A generator object that generates all (path, persistent) pairs.
          The paths are relative from this link.
      """
      d = link.__dict__
      for name in sorted(link._persistent):
          yield "/" + name, d[name]
      for name, child in _namedchildren(link):
          prefix = "/" + name
          for path, persistent in namedpersistent(child):
              yield prefix + path, persistent
  
label_desc: Use image node_id 2 for calling a global function with example usage: namedpersistent(link) without return types