code: def shape(context):
      """
      Returns a new, independent geometry with coordinates *copied* from the
      context. Changes to the original context will not be reflected in the
      geometry object.
  
      Parameters
      ----------
      context :
          a GeoJSON-like dict, which provides a "type" member describing the type
          of the geometry and "coordinates" member providing a list of coordinates,
          or an object which implements __geo_interface__.
  
      Returns
      -------
      Geometry object
  
      Examples
      --------
      Create a Point from GeoJSON, and then create a copy using __geo_interface__.
  
      >>> context = {'type': 'Point', 'coordinates': [0, 1]}
      >>> geom = shape(context)
      >>> geom.geom_type == 'Point'
      True
      >>> geom.wkt
      'POINT (0 1)'
      >>> geom2 = shape(geom)
      >>> geom == geom2
      True
      """
      if hasattr(context, "__geo_interface__"):
          ob = context.__geo_interface__
      else:
          ob = context
      geom_type = ob.get("type").lower()
  
      if geom_type == "feature":
          # GeoJSON features must have a 'geometry' field.
          ob = ob["geometry"]
          geom_type = ob.get("type").lower()
  
      if "coordinates" in ob and _is_coordinates_empty(
          ob["coordinates"]
      ):
          return _empty_shape_for_no_coordinates(geom_type)
      elif geom_type == "point":
          return Point(ob["coordinates"])
      elif geom_type == "linestring":
          return LineString(ob["coordinates"])
      elif geom_type == "linearring":
          return LinearRing(ob["coordinates"])
      elif geom_type == "polygon":
          return Polygon(ob["coordinates"][0], ob["coordinates"][1:])
      elif geom_type == "multipoint":
          return MultiPoint(ob["coordinates"])
      elif geom_type == "multilinestring":
          return MultiLineString(ob["coordinates"])
      elif geom_type == "multipolygon":
          return MultiPolygon(
              [[c[0], c[1:]] for c in ob["coordinates"]]
          )
      elif geom_type == "geometrycollection":
          geoms = [shape(g) for g in ob.get("geometries", [])]
          return GeometryCollection(geoms)
      else:
          raise GeometryTypeError(
              f"Unknown geometry type: {geom_type!r}"
          )
  
file_path: shapely/shapely/geometry/geo.py
imports: import numpy
  from shapely.errors import GeometryTypeError
  from shapely.geometry.collection import GeometryCollection
  from shapely.geometry.linestring import LineString
  from shapely.geometry.multilinestring import MultiLineString
  from shapely.geometry.multipoint import MultiPoint
  from shapely.geometry.multipolygon import MultiPolygon
  from shapely.geometry.point import Point
  from shapely.geometry.polygon import LinearRing, Polygon
label_desc: Use image node_id 4 for calling a global function with example usage: shape(context) and returns: _empty_shape_for_no_coordinates, Point, LineString, LinearRing, Polygon, MultiPoint, MultiLineString, MultiPolygon, GeometryCollection