code: def test_split_data_local(self, heterogeneous_graph):
      g, es_obj = heterogeneous_graph
      p = 0.1
  
      # using default sampling probabilities
      (
          g_test,
          edge_data_ids_test,
          edge_data_labels_test,
      ) = es_obj.train_test_split(
          p=p, method="local", keep_connected=True
      )
  
      # if all goes well, what are the expected return values?
      num_sampled_positives = np.sum(edge_data_labels_test == 1)
      num_sampled_negatives = np.sum(edge_data_labels_test == 0)
  
      assert num_sampled_positives > 0
      assert num_sampled_negatives > 0
      assert len(edge_data_ids_test) == len(edge_data_labels_test)
      assert (num_sampled_positives - num_sampled_negatives) == 0
      assert len(g_test.edges()) < len(g.edges())
      assert nx.is_connected(g_test)
  
imports: import pytest
  import os
  import numpy
  import networkx
  from stellargraph import StellarGraph
  from stellargraph.data.edge_splitter import EdgeSplitter
  from stellargraph.data.epgm import EPGM
  import random
  import datetime
  from datetime import datetime, timedelta
  from ..test_utils import flaky_xfail_mark
  from ..test_utils.graphs import example_graph_random
label_desc: Use image node_id 6 for calling the TestEdgeSplitterHeterogeneous obj's underlying member method code with example usage: obj.test_split_data_local(heterogeneous_graph) without return types