code: def test_tractogram_extend(self):
      # Load tractogram that contains some metadata.
      t = DATA["tractogram"].copy()
  
      for op, in_place in (
          (operator.add, False),
          (operator.iadd, True),
          (extender, True),
      ):
          first_arg = t.copy()
          new_t = op(first_arg, t)
          assert (new_t is first_arg) == in_place
          assert_tractogram_equal(new_t[: len(t)], DATA["tractogram"])
          assert_tractogram_equal(new_t[len(t) :], DATA["tractogram"])
  
      # Test extending an empty Tractogram.
      t = Tractogram()
      t += DATA["tractogram"]
      assert_tractogram_equal(t, DATA["tractogram"])
  
      # and the other way around.
      t = DATA["tractogram"].copy()
      t += Tractogram()
      assert_tractogram_equal(t, DATA["tractogram"])
  
imports: import copy
  import operator
  import sys
  import unittest
  import warnings
  from collections import defaultdict
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from ...testing import assert_arrays_equal, clear_and_catch_warnings
  from ..None import tractogram
  from ..tractogram import LazyDict, LazyTractogram, PerArrayDict, PerArraySequenceDict, Tractogram, TractogramItem, is_data_dict, is_lazy_dict
label_desc: Use image node_id 9 for calling the TestTractogram obj's underlying member method code with example usage: obj.test_tractogram_extend() without return types