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: Resample splits of the message passing and supervision edges in the 
  `disjoint` mode.
  
  .. note::
  
      If :meth:`apply_transform` (on the message passing graph)
      was used before this resampling, it needs to be
      re-applied after resampling, to update some of the (supervision)
      edges that were in the objectives.
  
  Args:
      split_types (list): Message types that will be splitted on.
      message_ratio(float or list): Split ratios.
docstr_tok: ["Resample","splits","of","the","message","passing","and","supervision","edges","in","the","`","disjoint","`","mode",".","..","note",":",":","If",":","meth",":","`","apply_transform","`","(","on","the","message","passing","graph",")","was","used","before","this","resampling",",","it","needs","to","be","re-applied","after","resampling",",","to","update","some","of","the","(","supervision",")","edges","that","were","in","the","objectives",".","Args",":","split_types","(","list",")",":","Message","types","that","will","be","splitted","on",".","message_ratio","(","float","or","list",")",":","Split","ratios","."]
code: def resample_disjoint(self, split_types, message_ratio):
      r"""
      Resample splits of the message passing and supervision edges in the
      `disjoint` mode.
  
      .. note::
  
          If :meth:`apply_transform` (on the message passing graph)
          was used before this resampling, it needs to be
          re-applied after resampling, to update some of the (supervision)
          edges that were in the objectives.
  
      Args:
          split_types (list): Message types that will be splitted on.
          message_ratio(float or list): Split ratios.
      """
      if not hasattr(self, "_objective_edges"):
          raise ValueError("No disjoint edge split was performed.")
      if not hasattr(self, "_resample_disjoint_idx"):
          self._resample_disjoint_idx = 0
      resample_disjoint_period = self.resample_disjoint_period
      if self._resample_disjoint_idx == (resample_disjoint_period - 1):
          if self.G is not None:
              graph = self
              graph.G.add_edges_from(self._objective_edges)
          else:
              graph = copy.deepcopy(self)
              # recover full edge_index
              edge_index = {
                  message_type: edge_index_type[
                      :, : self.num_edges(message_type)
                  ]
                  for message_type, edge_index_type in graph.edge_index.items()
              }
              for message_type in graph._objective_edges:
                  edge_index[message_type] = torch.cat(
                      [
                          edge_index[message_type],
                          graph._objective_edges[message_type],
                      ],
                      dim=1,
                  )
                  if graph.is_undirected():
                      edge_index[message_type] = torch.cat(
                          [
                              edge_index[message_type],
                              torch.flip(edge_index[message_type], [0]),
                          ],
                          dim=1,
                      )
              graph.edge_index = edge_index
  
              # recover full edge attributes
              for key in graph._objective_edges_attribute:
                  if graph._is_edge_attribute(key):
                      for (
                          message_type
                      ) in graph._objective_edges_attribute[key]:
                          graph[key][message_type] = torch.cat(
                              [
                                  graph[key][message_type],
                                  graph._objective_edges_attribute[key][
                                      message_type
                                  ],
                              ],
                              dim=0,
                          )
                          if graph.is_undirected():
                              graph[key][message_type] = torch.cat(
                                  [
                                      graph[key][message_type],
                                      graph[key][message_type],
                                  ],
                                  dim=0,
                              )
  
              graph.edge_label = graph._edge_label
  
          graph = graph.split_link_pred(
              split_types=split_types, split_ratio=message_ratio
          )[1]
          graph._is_train = True
          graph._resample_disjoint_flag = True
      else:
          graph = self
          graph._resample_disjoint_flag = False
  
      graph._resample_disjoint_idx = (
          self._resample_disjoint_idx + 1
      ) % resample_disjoint_period
      return graph
  
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 25 for calling the HeteroGraph obj's underlying member method code with example usage: obj.resample_disjoint(split_types, message_ratio) and returns: graph