code: def create_variable(value, name, shape, trainable=True):
      """
      Creates NN parameter as Tensorfow variable.
  
      Parameters
      ----------
      value : array-like, Tensorfow variable, scalar or Initializer
          Default value for the parameter.
  
      name : str
          Shared variable name.
  
      shape : tuple
          Parameter's shape.
  
      trainable : bool
          Whether parameter trainable by backpropagation.
  
      Returns
      -------
      Tensorfow variable.
      """
      from neupy import init
  
      if shape is not None:
          shape = shape_to_tuple(shape)
  
      if isinstance(
          value, (tf.Variable, tf.Tensor, np.ndarray, np.matrix)
      ):
          variable_shape = shape_to_tuple(value.shape)
  
          if as_tuple(variable_shape) != as_tuple(shape):
              raise ValueError(
                  "Cannot create variable with name `{}`. Provided variable "
                  "with shape {} is incompatible with expected shape {}"
                  "".format(name, variable_shape, shape)
              )
  
      if isinstance(value, (tf.Variable, tf.Tensor)):
          return value
  
      if isinstance(value, (int, float)):
          value = init.Constant(value)
  
      if isinstance(value, init.Initializer):
          value = value.sample(shape)
  
      return tf.Variable(
          asfloat(value),
          name=name,
          dtype=tf.float32,
          trainable=trainable,
      )
  
file_path: neupy/neupy/utils/tf_utils.py
imports: from functools import wraps
  import numpy
  import tensorflow
  from neupy.utils.misc import as_tuple
  from neupy.utils.processing import asfloat
label_desc: Use image node_id 15 for calling a global function with example usage: create_variable(value, name, shape, trainable) and returns: tf, value