code: def as_enum(d: Dict[str, Any]) -> Any:
      if "__enum__" in d:
          name, member = d["__enum__"].split(".")
          return getattr(PUBLIC_ENUMS[name], member)
      else:
          return d
  
imports: from collections import namedtuple
  from io import BytesIO
  import numpy
  from itertools import chain, islice
  from enum import Enum
  import json
  from bigdl.dllib.utils.log4Error import *
  from typing import Any, Dict, Iterator, List, Union, TYPE_CHECKING
label_desc: Use image node_id 2 for calling a global function with example usage: as_enum(d) and returns: getattr, d