code: def _iter_attr_dicts(
      values: dict[AttrKey, any_ndarray[EdgeValue | NodeValue]],
      masks: dict[AttrKey, any_ndarray[bool]],
  ):
      full_attrs = list(values.keys() - masks.keys())
      if full_attrs:
          full_dicts = (
              dict(zip(full_attrs, vals))
              for vals in zip(
                  *(values[attr].tolist() for attr in full_attrs)
              )
          )
      partial_attrs = list(values.keys() & masks.keys())
      if partial_attrs:
          partial_dicts = (
              {
                  k: v
                  for k, (v, m) in zip(partial_attrs, vals_masks)
                  if m
              }
              for vals_masks in zip(
                  *(
                      zip(values[attr].tolist(), masks[attr].tolist())
                      for attr in partial_attrs
                  )
              )
          )
      if full_attrs and partial_attrs:
          full_dicts = (
              d1.update(d2) or d1
              for d1, d2 in zip(full_dicts, partial_dicts)
          )
      elif partial_attrs:
          full_dicts = partial_dicts
      return full_dicts
  
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 3 for calling a global function with example usage: _iter_attr_dicts(values, masks) and returns: full_dicts