code: def get_act_fn(act=None, trt=False):
      assert act is None or isinstance(
          act, (str, dict)
      ), "name of activation should be str, dict or None"
      if not act:
          return identity
  
      if isinstance(act, dict):
          name = act["name"]
          act.pop("name")
          kwargs = act
      else:
          name = act
          kwargs = dict()
  
      if trt and name in TRT_ACT_SPEC:
          fn = TRT_ACT_SPEC[name]
      elif name in ACT_SPEC:
          fn = ACT_SPEC[name]
      else:
          fn = getattr(F, name)
  
      return lambda x: fn(x, **kwargs)
  
imports: import paddle
  import paddle.nn.functional
  import paddle.nn
  from paddle import ParamAttr
  from paddle.regularizer import L2Decay
  from paddle import in_dynamic_mode
  from paddle.common_ops_import import Variable, LayerHelper, check_variable_and_dtype, check_type, check_dtype
label_desc: Use image node_id 5 for calling a global function with example usage: get_act_fn(act, trt) and returns: function, identity