code: def _iterate_values(graph, adj, is_dicts, func):
      # Using `dict.values` is faster and is the common case, but it doesn't always work
      if is_dicts is not False:
          it = concat(map(dict.values, adj.values()))
          if graph is not None and graph.is_multigraph():
              it = concat(map(dict.values, it))
          try:
              return func(it), True
          except TypeError:
              if is_dicts is True:
                  raise
      # May not be regular dicts
      it = concat(x.values() for x in adj.values())
      if graph is not None and graph.is_multigraph():
          it = concat(x.values() for x in it)
      return func(it), False
  
file_path: cugraph/python/nx-cugraph/nx_cugraph/convert.py
imports: from __future__ import annotations
  import itertools
  import operator
  from collections import Counter
  from collections.abc import Mapping
  from typing import TYPE_CHECKING
  import cupy
  import networkx
  import numpy
  import nx_cugraph
  from .utils import index_dtype
label_desc: Use image node_id 1 for calling a global function with example usage: _iterate_values(graph, adj, is_dicts, func) and returns: func,  False, func,  True