code: def test_lazy_tractogram_copy(self):
      # Create a copy of the lazy tractogram.
      tractogram = DATA["lazy_tractogram"].copy()
  
      # Check we copied the data and not simply created new references.
      assert tractogram is not DATA["lazy_tractogram"]
  
      # When copying LazyTractogram, the generator function yielding
      # streamlines should stay the same.
      assert (
          tractogram._streamlines
          is DATA["lazy_tractogram"]._streamlines
      )
  
      # Copying LazyTractogram, creates new internal LazyDict objects,
      # but generator functions contained in it should stay the same.
      assert (
          tractogram._data_per_streamline
          is not DATA["lazy_tractogram"]._data_per_streamline
      )
      assert (
          tractogram._data_per_point
          is not DATA["lazy_tractogram"]._data_per_point
      )
  
      for key in tractogram.data_per_streamline:
          data = tractogram.data_per_streamline.store[key]
          expected = DATA["lazy_tractogram"].data_per_streamline.store[
              key
          ]
          assert data is expected
  
      for key in tractogram.data_per_point:
          data = tractogram.data_per_point.store[key]
          expected = DATA["lazy_tractogram"].data_per_point.store[key]
          assert data is expected
  
      # The affine should be a copy.
      assert (
          tractogram._affine_to_apply
          is not DATA["lazy_tractogram"]._affine_to_apply
      )
      assert_array_equal(
          tractogram._affine_to_apply,
          DATA["lazy_tractogram"]._affine_to_apply,
      )
  
      # Check the data are the equivalent.
      with pytest.warns(
          Warning,
          match="Number of streamlines will be determined manually",
      ):
          assert_tractogram_equal(tractogram, 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 8 for calling the TestLazyTractogram obj's underlying member method code with example usage: obj.test_lazy_tractogram_copy() without return types