<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_rectangle(self, north=None, west=None, south=None, east=None, **kwargs):
 """ Adds a rectangle dict to the Map.rectangles attribute The Google Maps API describes a rectangle using the LatLngBounds object, which defines the bounds to be drawn. The bounds use the concept of 2 delimiting points, a northwest and a southeast points, were each coordinate is defined by each parameter. It accepts a rectangle dict representation as well. Args: north (float):
 The north latitude west (float):
 The west longitude south (float):
 The south latitude east (float):
 The east longitude .. _LatLngBoundsLiteral: https://developers.google.com/maps/documen tation/javascript/reference#LatLngBoundsLiteral .. _Rectangles: https://developers.google.com/maps/documen tation/javascript/shapes#rectangles """

        kwargs.setdefault('bounds', {})

        if north:
            kwargs['bounds']['north'] = north
        if west:
            kwargs['bounds']['west'] = west
        if south:
            kwargs['bounds']['south'] = south
        if east:
            kwargs['bounds']['east'] = east

        if set(
            ('north', 'east', 'south', 'west')
        ) != set(kwargs['bounds'].keys()):
            raise AttributeError('rectangle bounds required to rectangles')

        kwargs.setdefault('stroke_color', '#FF0000')
        kwargs.setdefault('stroke_opacity', .8)
        kwargs.setdefault('stroke_weight', 2)
        kwargs.setdefault('fill_color', '#FF0000')
        kwargs.setdefault('fill_opacity', .3)

        self.rectangles.append(kwargs)