code: def _create_parameter_by_initializer(initializer, shape, need_grad):
      # If initializer is not set, just returns a new variable with zeros.
      if initializer is None:
          assert shape is not None
          param = nn.Variable(shape, need_grad=need_grad)
          param.data.zero()  # Initialize with zero.
          return param
  
      # Initialize by a numpy array.
      if isinstance(initializer, numpy.ndarray):  # numpy init
          assert (shape is None) or (tuple(shape) == initializer.shape)
          return nn.Variable.from_numpy_array(
              initializer, need_grad=need_grad
          )
  
      # Initialize by Initializer or callable object which takes shape as an argument.
      if callable(initializer):
          assert shape is not None
          return nn.Variable.from_numpy_array(
              initializer(shape=list(map(int, shape))),
              need_grad=need_grad,
          )
  
      # Invalid initializer argument.
      raise ValueError(
          "`initializer` must be either the :obj:`numpy.ndarray`"
          " or an instance inherited from `nnabla.initializer.BaseInitializer`."
      )
  
imports: from six import iteritems
  from contextlib import contextmanager
  from collections import OrderedDict
  import google.protobuf.text_format
  import numpy
  import os
  import shutil
  import tempfile
  import zipfile
  import nnabla
  from nnabla.logger import logger
  import nnabla.utils.nnabla_pb2
  from nnabla.utils.get_file_handle import get_parameter_file_loader, load_files, FileHandlerContext
  from nnabla.utils.get_file_handle import get_file_handle_save, get_parameter_file_savers, save_files
  import warnings
label_desc: Use image node_id 7 for calling a global function with example usage: _create_parameter_by_initializer(initializer, shape, need_grad) and returns: param, nn, nn