code: def shared_paths(g1, g2):
      """Find paths shared between the two given lineal geometries
  
      Returns a GeometryCollection with two elements:
       - First element is a MultiLineString containing shared paths with the
         same direction for both inputs.
       - Second element is a MultiLineString containing shared paths with the
         opposite direction for the two inputs.
  
      Parameters
      ----------
      g1 : geometry
          The first geometry
      g2 : geometry
          The second geometry
      """
      if not isinstance(g1, LineString):
          raise GeometryTypeError("First geometry must be a LineString")
      if not isinstance(g2, LineString):
          raise GeometryTypeError(
              "Second geometry must be a LineString"
          )
      return shapely.shared_paths(g1, g2)
  
imports: from warnings import warn
  import shapely
  from shapely.algorithms.polylabel import polylabel
  from shapely.errors import GeometryTypeError, ShapelyDeprecationWarning
  from shapely.geometry import GeometryCollection, LineString, MultiLineString, MultiPoint, Point, Polygon, shape
  from shapely.geometry.base import BaseGeometry, BaseMultipartGeometry
  from shapely.geometry.polygon import orient
  from shapely.prepared import prep
label_desc: Use image node_id 7 for calling a global function with example usage: shared_paths(g1, g2) and returns: shapely