code: def save(model):
      weights = {}
      index = 0
      layers = model.layers
      for layer in layers._layers:
          if hasattr(layer, "W"):
              weights[index] = layer.W.get()
              index += 1
      return weights
  
imports: from __future__ import print_function
  import itertools
  import numpy
  from neon.backends import gen_backend
  from neon.layers import Conv, Affine, GeneralizedCost
  from neon.models import Model
  from neon.initializers.initializer import Gaussian
  from neon.transforms import CrossEntropyBinary
  from neon.optimizers import GradientDescentMomentum
  from utils import allclose_with_out
  from neon import NervanaObject
label_desc: Use image node_id 6 for calling a global function with example usage: save(model) and returns: weights