code: def multipart_to_singleparts(geom):
      
      if isinstance(geom, base.BaseGeometry):
          if hasattr(geom, "geoms"):
              for subgeom in geom:
                  yield subgeom
          else:
              yield geom
docs: Yield single part geometries if geom is multipart, otherwise yield geom.
  
      Parameters:
      -----------
      geom : shapely geometry
  
      Returns:
      --------
      shapely single part geometries