code: def rectangle(bounds, **kwargs):
      
      from .path import Path2D
  
      # data should be float
      bounds = np.asanyarray(bounds, dtype=np.float64)
  
      # bounds are extents, re- shape to origin- centered rectangle
      if bounds.shape == (2,):
          half = np.abs(bounds) / 2.0
          bounds = np.array([-half, half])
  
      # should have one bounds or multiple bounds
      if not (util.is_shape(bounds, (2, 2)) or
              util.is_shape(bounds, (-1, 2, 2))):
          raise ValueError('bounds must be (m, 2, 2) or (2, 2)')
  
      # hold entities.Line objects
      lines = []
      # hold (n, 2) cartesian points
      vertices = []
  
      # loop through each rectangle
      for lower, upper in bounds.reshape((-1, 2, 2)):
          lines.append(entities.Line((np.arange(5) % 4) + len(vertices)))
          vertices.extend([lower,
                           [upper[0], lower[1]],
                           upper,
                           [lower[0], upper[1]]])
  
      # create the Path2D with specified rectangles
      rect = Path2D(entities=lines,
                    vertices=vertices,
                    **kwargs)
  
      return rect
docs: Create a Path2D containing a single or multiple rectangles
      with the specified bounds.
  
      Parameters
      --------------
      bounds : (2, 2) float, or (m, 2, 2) float
        Minimum XY, Maximum XY
  
      Returns
      -------------
      rect : Path2D
        Path containing specified rectangles