code: def get_variable_info(var: paddle.static.Variable) -> dict:
      if not isinstance(var, paddle.static.Variable):
          raise TypeError(
              "var shoule be an instance of paddle.static.Variable"
          )
  
      var_info = {
          "name": var.name,
          "stop_gradient": var.stop_gradient,
          "is_data": var.is_data,
          "error_clip": var.error_clip,
          "type": var.type,
      }
  
      try:
          var_info["dtype"] = convert_dtype_to_string(var.dtype)
          var_info["lod_level"] = var.lod_level
          var_info["shape"] = var.shape
      except:
          pass
  
      if isinstance(var, paddle.device.framework.Parameter):
          var_info["trainable"] = var.trainable
          var_info["optimize_attr"] = var.optimize_attr
          var_info["regularizer"] = var.regularizer
          if Version(paddle.__version__) < "1.8":
              var_info["gradient_clip_attr"] = var.gradient_clip_attr
          var_info["do_model_average"] = var.do_model_average
      else:
          var_info["persistable"] = var.persistable
  
      return var_info
  
file_path: PaddleHub/paddlehub/compat/paddle_utils.py
imports: import contextlib
  import copy
  from typing import Callable
  from typing import List
  import paddle
  from paddle.framework import core
  from paddlehub.utils.utils import Version
label_desc: Use image node_id 2 for calling a global function with example usage: get_variable_info(var) and returns: var_info