code: def _get_attr_str(obj, attr_name):
      fld = getattr(obj, attr_name)
      if isinstance(fld, Enum):
          return fld.value
      else:
          return fld
  
imports: import json
  import os
  from dataclasses import asdict, dataclass, field, fields
  from enum import Enum
  import torch
  from typing import Optional, Dict, Any, Union
  from towhee.utils.log import trainer_log
  from towhee.utils.yaml_utils import dump_yaml, load_yaml
label_desc: Use image node_id 1 for calling a global function with example usage: _get_attr_str(obj, attr_name) and returns: fld, fld