parameters: (self, rect)
return_statement: return intersection
docstring: Compute the intersection between this instance and another Rectangle.
  
          Parameters
          ----------
          rect : Rectangle
              The instance of the second Rectangle.
  
          Returns
          -------
          intersection_area : float
              Area of intersection between the two rectangles expressed in number of pixels.
docstring_summary: Compute the intersection between this instance and another Rectangle.
docstring_tokens: Compute the intersection between this instance and another Rectangle .
function: def intersect_with(self, rect):
          """
          Compute the intersection between this instance and another Rectangle.
  
          Parameters
          ----------
          rect : Rectangle
              The instance of the second Rectangle.
  
          Returns
          -------
          intersection_area : float
              Area of intersection between the two rectangles expressed in number of pixels.
          """
          if not isinstance(rect, Rectangle):
              raise ValueError('Cannot compute intersection if "rect" is not a Rectangle')
  
          dx = min(self.x_max, rect.x_max) - max(self.x_min, rect.x_min)
          dy = min(self.y_max, rect.y_max) - max(self.y_min, rect.y_min)
  
          if dx >= 0 and dy >= 0:
              intersection = dx * dy
          else:
              intersection = 0.
  
          return intersection
function_tokens: def intersect_with ( self , rect ) : if not isinstance ( rect , Rectangle ) : raise ValueError ( 'Cannot compute intersection if "rect" is not a Rectangle' ) dx = min ( self . x_max , rect . x_max ) - max ( self . x_min , rect . x_min ) dy = min ( self . y_max , rect . y_max ) - max ( self . y_min , rect . y_min ) if dx >= 0 and dy >= 0 : intersection = dx * dy else : intersection = 0. return intersection