code: def _get_weights(
      self,
      name,
      initializer,
      shape,
      regularization=True,
      trainable=True,
  ):
      var = tf.Variable(
          initial_value=initializer(shape=shape, dtype=tf.float32),
          name=name,
          trainable=True,
      )
      if regularization:
          self.regularizers.append(tf.nn.l2_loss(var))
      if trainable is True:
          if self._trainable_weights is None:
              self._trainable_weights = list()
          self._trainable_weights.append(var)
      else:
          if self._nontrainable_weights is None:
              self._nontrainable_weights = list()
          self._nontrainable_weights.append(var)
      return var
  
imports: import numpy
  import tensorflow
  from tensorlayer.layers import Layer, Dropout, Dense, Input, BatchNorm, Reshape, Elementwise
  from tensorlayer.models import Model
  from tensorlayer import logging
  from .common import mask_weight, neighbour_matrix
label_desc: Use image node_id 3 for calling the Base_layer obj's underlying member method code with example usage: obj._get_weights(name, initializer, shape, regularization, trainable) and returns: var