code: def add_edge_data(edge_array, ntwk, above=0, below=0):
      edge_ntwk = ntwk.copy()
      data = {}
      for x, row in enumerate(edge_array):
          for y in range(0, np.max(np.shape(edge_array[x]))):
              if not edge_array[x, y] == 0:
                  data["value"] = edge_array[x, y]
                  if data["value"] <= below or data["value"] >= above:
                      if edge_ntwk.has_edge(x + 1, y + 1):
                          old_edge_dict = edge_ntwk.edge[x + 1][y + 1]
                          edge_ntwk.remove_edge(x + 1, y + 1)
                          data.update(old_edge_dict)
                      edge_ntwk.add_edge(x + 1, y + 1, **data)
      return edge_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 13 for calling a global function with example usage: add_edge_data(edge_array, ntwk, above, below) and returns: edge_ntwk