code: def _set_weights(w, n):
      """Return w if it is a valid weight vector of size n, and a vector of n 1s
      otherwise.
      """
      if w is None or len(w) != n:
          w = numpy.ones((n,))
      return w
  
label_desc: Use image node_id 1 for calling a global function with example usage: _set_weights(w, n) and returns: w