code: def _iter_notebook_flag_data(notebook_path, opdef=None):
      """Iterator that returns name, flag_data for notebooks flags.
  
      Notebook flag data is derrived from inspecting the notebook for
      global assigns and by applying replacement patterns optionally
      provided by operation flag defs.
  
      If opdef is provided and a flag provides a replacement patter, it
      takes precedence over values from global assigns.
      """
      seen = set()
      if opdef:
          for name, val in _iter_notebook_flag_replacements(
              notebook_path, opdef
          ):
              yield name, _flag_data_for_val(val)
              seen.add(name)
      for name, val, ann_type in _iter_notebook_assigns(notebook_path):
          if not name in seen:
              yield name, _flag_data_for_val(val, ann_type)
  
imports: import ast
  import json
  import logging
  import os
  import re
  from guild import config
  from guild import guildfile
  from guild import model
  from guild import plugin
  from guild import python_util
  from guild import util
  from .None import flags_import_util
label_desc: Use image node_id 10 for calling a global function with example usage: _iter_notebook_flag_data(notebook_path, opdef) without return types