code: def add_node_data(node_array, ntwk):
      node_ntwk = nx.Graph()
      newdata = {}
      for idx, data in ntwk.nodes(data=True):
          if not int(idx) == 0:
              newdata["value"] = node_array[int(idx) - 1]
              data.update(newdata)
              node_ntwk.add_node(int(idx), **data)
      return node_ntwk
  
imports: import os.path
  import pickle
  import numpy
  import networkx
  from ...None import logging
  from ...utils.filemanip import split_filename
  from ..base import BaseInterface, BaseInterfaceInputSpec, traits, File, TraitedSpec, InputMultiPath, OutputMultiPath, isdefined
  from .base import have_cmp
label_desc: Use image node_id 12 for calling a global function with example usage: add_node_data(node_array, ntwk) and returns: node_ntwk