code: def build_thing(typedb_thing):
      iid = typedb_thing.get_iid()
      type_label = typedb_thing.get_type().get_label().name()
      if typedb_thing.is_entity():
          base_type = "entity"
      elif typedb_thing.is_relation():
          base_type = "relation"
      elif typedb_thing.is_attribute():
          base_type = "attribute"
      else:
          raise RuntimeError("Unexpected Concept")
  
      if base_type == "attribute":
          value_type = typedb_thing.get_type().get_value_type()
          assert value_type in Thing.VALUE_TYPES
          value = typedb_thing.get_value()
  
          return Thing(iid, type_label, base_type, value_type, value)
  
      return Thing(iid, type_label, base_type)
  
file_path: typedb-ml/typedb_ml/typedb/thing.py
imports: from typedb.api.concept.type.attribute_type import AttributeType
label_desc: Use image node_id 1 for calling a global function with example usage: build_thing(typedb_thing) and returns: Thing, Thing