code: def update_attr_name(name, default_name, attr, is_bias):
      """
      Update the name in an attribute
      1. If the user provides a name, then generate the candidate name using the
         provided name;
      2. else generate the candidate name using the default name (which should be
         the name of the layer wrapper).
      3. After obtaining the candidate name, if the attr is False, then we return False;
      4. if the attr is None or attr.name is None, then we set the attr's name as the candidate name;
      5. else we ignore the candidate name and do nothing.
      """
  
      def check_or_replace_name(name, attr):
          ## if this para is not used
          if attr == False:
              return False
  
          if attr is None:
              return ParamAttr(name=name)
  
          if attr.name is None:
              attr.name = name
          return attr
  
      attr = ParamAttr._to_attr(attr)
      name = default_name if name is None else name
      suffix = "b" if is_bias else "w"
      new_name = unique_name.generate(name + "." + suffix)
      return check_or_replace_name(new_name, attr)
  
imports: import inspect
  import paddle.fluid.layers
  import paddle.fluid.unique_name
  import paddle.fluid
  import six
  from copy import deepcopy
  from paddle.fluid.executor import _fetch_var
  from paddle.fluid.framework import Variable
  from paddle.fluid.layers import *
  from paddle.fluid.param_attr import ParamAttr
  from parl.core.fluid.layers.attr_holder import AttrHolder
  from parl.utils import get_fluid_version
label_desc: Use image node_id 1 for calling a global function with example usage: update_attr_name(name, default_name, attr, is_bias) and returns: check_or_replace_name, attr, False, ParamAttr