code: def test_child_with_deleted_parent():
      # test that we can remove a collection while keeping
      # children around
      a = LineString([(0, 0), (1, 1), (1, 2), (2, 2)])
      b = LineString([(0, 0), (1, 1), (2, 1), (2, 2)])
      collection = a.intersection(b)
  
      child = collection.geoms[0]
      # delete parent of child
      del collection
  
      # access geometry, this should not seg fault as 1.2.15 did
      assert child.wkt is not None
  
file_path: shapely/shapely/tests/geometry/test_collection.py
imports: import numpy
  import pytest
  from shapely import GeometryCollection, LineString, Point, wkt
  from shapely.geometry import shape
label_desc: Use image node_id 4 for calling a global function with example usage: test_child_with_deleted_parent() without return types