class_docstr: A plain python object modeling a heterogeneous graph with various
  attributes (Node types in :class:`HeteroGraph` require string type).
  
  Args:
      G (:class:`networkx.classes.graph`): A NetworkX graph object which
          contains features and labels for each node type and edge type.
      **kwargs: Keyworded argument list with keys such
          as :obj:`"node_feature"`, :obj:`"node_label"` and
          corresponding attributes.
class_docstr_tok: ["A","plain","python","object","modeling","a","heterogeneous","graph","with","various","attributes","(","Node","types","in",":","class",":","`","HeteroGraph","`","require","string","type",")",".","Args",":","G","(",":","class",":","`","networkx.classes.graph","`",")",":","A","NetworkX","graph","object","which","contains","features","and","labels","for","each","node","type","and","edge","type",".","*","*","kwargs",":","Keyworded","argument","list","with","keys","such","as",":","obj",":","`","``","node_feature","''","`",",",":","obj",":","`","``","node_label","''","`","and","corresponding","attributes","."]
docstr: custom support version of disjoint split_link_pred
docstr_tok: ["custom","support","version","of","disjoint","split_link_pred"]
code: def _custom_split_link_pred_disjoint(self):
      r"""
      custom support version of disjoint split_link_pred
      """
      objective_edges = self.disjoint_split
  
      nodes_dict = {}
      for node in self.G.nodes(data=True):
          nodes_dict[node[0]] = node[1]["node_type"]
  
      edges_dict = {}
      objective_edges_dict = {}
  
      for edge in self.G.edges:
          edge_dict = self.G.edges[edge]
          edge_type = edge_dict["edge_type"]
          head_type = nodes_dict[edge[0]]
          tail_type = nodes_dict[edge[1]]
          message_type = (head_type, edge_type, tail_type)
          if message_type not in edges_dict:
              edges_dict[message_type] = []
          if len(edge) == 2:
              edges_dict[message_type].append(
                  (edge[0], edge[1], edge_dict)
              )
          elif len(edge) == 3:
              edges_dict[message_type].append(
                  (edge[0], edge[1], edge[2], edge_dict)
              )
          else:
              raise ValueError("Each edge has more than 3 indices.")
  
      for edge in objective_edges:
          edge_type = edge[-1]["edge_type"]
          head_type = nodes_dict[edge[0]]
          tail_type = nodes_dict[edge[1]]
          message_type = (head_type, edge_type, tail_type)
          if message_type not in objective_edges_dict:
              objective_edges_dict[message_type] = []
          objective_edges_dict[message_type].append(edge)
  
      message_edges = []
      for edge_type in edges_dict:
          if edge_type in objective_edges_dict:
              edges_no_info = [
                  edge[:-1] for edge in edges_dict[edge_type]
              ]
              objective_edges_no_info = [
                  edge[:-1] for edge in objective_edges_dict[edge_type]
              ]
              message_edges_no_info = set(edges_no_info) - set(
                  objective_edges_no_info
              )
  
              for edge in message_edges_no_info:
                  if len(edge) == 2:
                      message_edges.append(
                          (
                              edge[0],
                              edge[1],
                              self.G.edges[(edge[0], edge[1])],
                          )
                      )
                  elif len(edge) == 3:
                      message_edges.append(
                          (
                              edge[0],
                              edge[1],
                              edge[2],
                              self.G.edges[(edge[0], edge[1], edge[2])],
                          )
                      )
                  else:
                      raise ValueError(
                          "Each edge has more than 3 indices."
                      )
          else:
              message_edges += edges_dict[edge_type]
  
      # update objective edges
      for edge_type in edges_dict:
          if edge_type not in objective_edges_dict:
              objective_edges += edges_dict[edge_type]
  
      graph_train = HeteroGraph(
          self._edge_subgraph_with_isonodes(
              self.G,
              message_edges,
          ),
          negative_edges=self.negative_edges,
      )
  
      graph_train.negative_label_val = self.negative_label_val
      graph_train._create_label_link_pred(
          graph_train,
          objective_edges,
          list(graph_train.G.nodes(data=True)),
      )
  
      graph_train._is_train = True
  
      return graph_train
  
imports: import math
  import copy
  import random
  import torch
  import networkx
  import numpy
  from deepsnap.graph import Graph
  from typing import Dict, List, Union
  import warnings
label_desc: Use image node_id 31 for calling the HeteroGraph obj's underlying member method code with example usage: obj._custom_split_link_pred_disjoint() and returns: graph_train