code: def inject_utility_code_stage_factory(context):
      def inject_utility_code_stage(module_node):
          module_node.prepare_utility_code()
          use_utility_code_definitions(
              context.cython_scope, module_node.scope
          )
          module_node.scope.utility_code_list = sort_utility_codes(
              module_node.scope.utility_code_list
          )
          normalize_deps(module_node.scope.utility_code_list)
          added = []
          # Note: the list might be extended inside the loop (if some utility code
          # pulls in other utility code, explicitly or implicitly)
          for utilcode in module_node.scope.utility_code_list:
              if utilcode in added:
                  continue
              added.append(utilcode)
              if utilcode.requires:
                  for dep in utilcode.requires:
                      if (
                          dep not in added
                          and dep
                          not in module_node.scope.utility_code_list
                      ):
                          module_node.scope.utility_code_list.append(
                              dep
                          )
              tree = utilcode.get_tree(
                  cython_scope=context.cython_scope
              )
              if tree:
                  module_node.merge_in(
                      tree.body, tree.scope, merge_scope=True
                  )
          return module_node
  
      return inject_utility_code_stage
  
imports: from __future__ import absolute_import
  import itertools
  from time import time
  from .None import Errors
  from .None import DebugFlags
  from .None import Options
  from .Errors import CompileError, InternalError, AbortError
  from .None import Naming
label_desc: Use image node_id 10 for calling a global function with example usage: inject_utility_code_stage_factory(context) and returns: inject_utility_code_stage, module_node