code: def get_parameter_or_create(
      name,
      shape=None,
      initializer=None,
      need_grad=True,
      as_need_grad=None,
  ):
      """
      Returns an existing parameter variable in current parameter scope
      with the provided name.
  
      If a variable with the provided name does not exist,
      a new variable is created and registered to the current parameter scope
      with the name, then returned.
  
      Args:
  
          name(str):
              The name under the current scope. If it already exists, the name
              is queried from the parameter manager.
          shape (:obj:`tuple` of :obj:`int`):
              Shape of created parameter. The shape of the specified
              parameter must match with this shape. The default is None which is
              only valid if initializer is given as an :obj:`numpy.ndarray`.
          initializer (:obj:`nnabla.initializer.BaseInitializer` or :obj:`numpy.ndarray`):
              An initialization function to be applied to the parameter.
              :obj:`numpy.ndarray` can also be given to initialize parameters
              from numpy array data.
          need_grad (bool):
              Register the parameter with the specified ``need_grad`` flag.
              The default is True. If the flag is different from the previously
              specified one, the flag will be overwritten, but the values will be
              kept.
          as_need_grad (bool):
              Get a parameter variable with the specified ``need_grad`` flag.
              Note that this doesn't overwrite the flag of the registered parameter
              variable with the provided name. Instead, if the given flag
              mismatches with the previously registered ``need_grad`` flag, it
              returns a new variable referring to the same array contents but with
              ``need_grad=as_need_grad``.
  
      Note:
          It returns a `Variable` which is unlinked from the
          registered one in the current parameter scope
          (using :py:meth:`nnabla.Variable.get_unlinked_variable`).
          That means changing a `need_grad` attribute doesn't affect
          the variable existing in the current parameter scope.
  
      """
  
      # Resolve delimiter '/' in parameter name.
      names = name.split("/")
      if len(names) > 1:
          with parameter_scope(names[0]):
              return get_parameter_or_create(
                  "/".join(names[1:]),
                  shape,
                  initializer,
                  need_grad,
                  as_need_grad,
              )
  
      # Set need_grad if as_need_grad is not specified.
      if as_need_grad is None:
          as_need_grad = need_grad
  
      # Overwrite as_need_grad if current_no_grad is True
      global current_no_grad
      as_need_grad = False if current_no_grad else as_need_grad
  
      # Try to find a existing parameter.
      param = get_parameter(names[0])
  
      # Postprocess for a parameter variable
      def _returning(v):
          v = v.get_unlinked_variable(need_grad=as_need_grad)
          v.name = names[0]
          return v
  
      # If found, verify shape and flags, and returns it.
      if param is not None:
          if param.shape != tuple(shape):
              raise ValueError(
                  'The size of existing parameter "{}" {} is different from the '
                  "size of new parameter {}.\n"
                  "To clear all parameters, call nn.clear_parameters().".format(
                      name, param.shape, tuple(shape)
                  )
              )
  
          if need_grad != param.need_grad:
              param.need_grad = need_grad
              set_parameter(name, param)
          return _returning(param)
  
      class VariableInfo:
          pass
  
      info = VariableInfo()
      info.initializer = initializer
  
      # Create a new parameter using specified configuration,
      # and write it to current scope..
      param = _create_parameter_by_initializer(
          initializer, shape, need_grad
      )
      param.info = info
      set_parameter(name, param)
      return _returning(param)
  
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 8 for calling a global function with example usage: get_parameter_or_create(name, shape, initializer, need_grad, as_need_grad) and returns: _returning, v, _returning, get_parameter_or_create