code: def parse_3dpos(
      graph,
      mol,
      khop,
      rtn_atom_pos=False,
      bond_by_dis=False,
      gen_aux_task=False,
  ):
      # atom positions
      atom_position_list = [[] for i in range(mol.GetNumAtoms())]
      conf = mol.GetConformer()
      for i in range(mol.GetNumAtoms()):
          atom_position_list[i].append(conf.GetAtomPosition(i).x)
          atom_position_list[i].append(conf.GetAtomPosition(i).y)
          atom_position_list[i].append(conf.GetAtomPosition(i).z)
      x_position = np.array(atom_position_list, dtype=np.float)
  
      if rtn_atom_pos:
          graph["node_position"] = x_position
  
      # edge
      matrix_3ddis = Chem.rdmolops.Get3DDistanceMatrix(mol)
      matrix_topodis = shortest_path(mol)
      edge_features_float_list = []
  
      # add distance for real bonds (hop == 1)
      if mol.GetNumBonds() > 0:
          for i in range(len(graph["edge_index"][0])):
              source_id, dest_id = graph["edge_index"][:, i]
              edge_features_float_list.append(
                  [matrix_3ddis[source_id][dest_id]]
              )
          edge_attr_float = np.array(
              edge_features_float_list, dtype=np.float
          )
      else:
          num_bond_features_float = 1
          edge_attr_float = np.empty(
              (0, num_bond_features_float), dtype=np.float
          )
  
      # add fully connected edges
      if khop > 1 or bond_by_dis:
          edges_list = []
          edge_features_list = []
          edge_features_float_list = []
          for i in range(len(matrix_topodis)):
              for j in range(len(matrix_topodis[0])):
                  if matrix_topodis[i][j] > 1 and (
                      matrix_topodis[i][j] <= khop
                      or (
                          bond_by_dis
                          and matrix_3ddis[i][j] < bond_by_dis
                      )
                  ):  # 1 hop has been appended before
                      # virtual feature for k-hop connected bond, value = len()-1
                      edge_feature = [
                          i - 1 for i in get_bond_feature_dims()
                      ]
                      topodis = matrix_topodis[i][j]
                      edge_feature.append(topodis if topodis < 9 else 9)
                      edge_feature_float = [matrix_3ddis[i][j]]
  
                      edges_list.append((i, j))
                      edge_features_list.append(edge_feature)
                      edge_features_float_list.append(
                          edge_feature_float
                      )
          if edges_list:
              edge_index = np.hstack(
                  (
                      graph["edge_index"],
                      np.array(edges_list, dtype=np.int64).T,
                  )
              )
              edge_attr = np.vstack(
                  (graph["edge_feat"], np.array(edge_features_list))
              )
              edge_attr_float = np.vstack(
                  (edge_attr_float, np.array(edge_features_float_list))
              )
              graph["edge_index"] = edge_index
              graph["edge_feat"] = edge_attr
  
      graph["edge_feat_float"] = edge_attr_float
      graph["num_edges"] = graph["edge_index"].shape[1]
  
      if gen_aux_task:
          bond_angle_index = get_bond_angle_index(graph["edge_index"])
          bond_angle = get_bond_angle(x_position, bond_angle_index)
          graph["bond_angle_index"] = bond_angle_index
          graph["bond_angle"] = bond_angle
  
      return graph
  
imports: import numpy
  import rdkit
  from rdkit import Chem
  from rdkit.Chem import AllChem
  import rdkit.Chem.rdPartialCharges
  from ogb.utils.features import allowable_features, atom_to_feature_vector, atom_feature_vector_to_dict, bond_feature_vector_to_dict
  from local_feature import bond_to_feature_vector, get_bond_feature_dims
  from copy import deepcopy
  import hashlib
label_desc: Use image node_id 12 for calling a global function with example usage: parse_3dpos(graph, mol, khop, rtn_atom_pos, bond_by_dis, gen_aux_task) and returns: graph