def add_polygon(self, path=None, **kwargs):
if path:<EOL><INDENT>if not isinstance(path, list):<EOL><INDENT>raise AttributeError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>for i, point in enumerate(path):<EOL><INDENT>if not isinstance(point, dict):<EOL><INDENT>if isinstance(point, (list, tuple)) and len(point) == <NUM_LIT:2>:<EOL><INDENT>path[i] = {'<STR_LIT>': point[<NUM_LIT:0>], '<STR_LIT>': point[<NUM_LIT:1>]}<EOL><DEDENT>else:<EOL><INDENT>raise AttributeError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>)<EOL><DEDENT><DEDENT><DEDENT>kwargs['<STR_LIT:path>'] = path<EOL><DEDENT>kwargs.setdefault('<STR_LIT>', '<STR_LIT>')<EOL>kwargs.setdefault('<STR_LIT>', <NUM_LIT>)<EOL>kwargs.setdefault('<STR_LIT>', <NUM_LIT:2>)<EOL>kwargs.setdefault('<STR_LIT>', '<STR_LIT>')<EOL>kwargs.setdefault('<STR_LIT>', <NUM_LIT>)<EOL>self.polygons.append(kwargs)<EOL>
Adds a polygon dict to the Map.polygons attribute

        The Google Maps API describes a polyline as a "linear overlay of
        connected line segments on the map" and "form a closed loop and define
        a filled region.". The linear paths are defined by a list of Latitude
        and Longitude coordinate pairs, like so:

            { 'lat': y, 'lng': x }

        with each one being a point of the polyline path.

        It accepts a polygon dict representation as well.

        Args:
            path (list(dict)): The set of points of the path

        .. _Polygon:
            https://developers.google.com/maps/documen
            tation/javascript/reference#Polygon