code: def test_get_train_triplet(self):
      data = Reader().read("./tests/graph_data.txt", sep=" ")
      gmd = GraphModality(data=data)
  
      global_iid_map = OrderedDict()
      for raw_iid, raw_jid, val in data:
          global_iid_map.setdefault(raw_iid, len(global_iid_map))
  
      gmd.build(id_map=global_iid_map)
      rid, cid, val = gmd.get_train_triplet([0, 1, 2], [0, 1, 2])
      self.assertEqual(len(rid), 3)
      self.assertEqual(len(cid), 3)
      self.assertEqual(len(val), 3)
  
      rid, cid, val = gmd.get_train_triplet([0, 2], [0, 1])
      self.assertEqual(len(rid), 1)
      self.assertEqual(len(cid), 1)
      self.assertEqual(len(val), 1)
  
file_path: cornac/tests/cornac/data/test_graph.py
imports: import unittest
  import numpy
  from cornac.data import GraphModality
  from cornac.data import Reader
  from collections import OrderedDict
label_desc: Use image node_id 3 for calling the TestGraphModality obj's underlying member method code with example usage: obj.test_get_train_triplet() without return types