def add_place(self, **kwargs):
required_kwargs = {'<STR_LIT:name>': [str], '<STR_LIT>': [dict],<EOL>'<STR_LIT>': [int], '<STR_LIT>': [str, list]}<EOL>request_params = {}<EOL>for key in required_kwargs:<EOL><INDENT>if key not in kwargs or kwargs[key] is None:<EOL><INDENT>raise ValueError('<STR_LIT>' % key)<EOL><DEDENT>expected_types = required_kwargs[key]<EOL>type_is_valid = False<EOL>for expected_type in expected_types:<EOL><INDENT>if isinstance(kwargs[key], expected_type):<EOL><INDENT>type_is_valid = True<EOL>break<EOL><DEDENT><DEDENT>if not type_is_valid:<EOL><INDENT>raise ValueError('<STR_LIT>' % key)<EOL><DEDENT>if key is not '<STR_LIT>':<EOL><INDENT>request_params[key] = kwargs[key]<EOL><DEDENT><DEDENT>if len(kwargs['<STR_LIT:name>']) > <NUM_LIT:255>:<EOL><INDENT>raise ValueError('<STR_LIT>' +<EOL>'<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>kwargs['<STR_LIT>']['<STR_LIT>']<EOL>kwargs['<STR_LIT>']['<STR_LIT>']<EOL>request_params['<STR_LIT:location>'] = kwargs['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>request_params['<STR_LIT>'] = (kwargs.get('<STR_LIT>')<EOL>if kwargs.get('<STR_LIT>') is not None else<EOL>lang.ENGLISH)<EOL>sensor = (kwargs.get('<STR_LIT>')<EOL>if kwargs.get('<STR_LIT>') is not None else<EOL>False)<EOL>if isinstance(kwargs['<STR_LIT>'], str):<EOL><INDENT>request_params['<STR_LIT>'] = [kwargs['<STR_LIT>']]<EOL><DEDENT>else:<EOL><INDENT>request_params['<STR_LIT>'] = kwargs['<STR_LIT>']<EOL><DEDENT>url, add_response = _fetch_remote_json(<EOL>GooglePlaces.ADD_API_URL % (str(sensor).lower(),<EOL>self.api_key), json.dumps(request_params), use_http_post=True)<EOL>_validate_response(url, add_response)<EOL>return {'<STR_LIT>': add_response['<STR_LIT>'],<EOL>'<STR_LIT:id>': add_response['<STR_LIT:id>']}<EOL>
Adds a place to the Google Places database.

        On a successful request, this method will return a dict containing
        the the new Place's place_id and id in keys 'place_id' and 'id'
        respectively.

        keyword arguments:
        name        -- The full text name of the Place. Limited to 255
                       characters.
        lat_lng     -- A dict containing the following keys: lat, lng.
        accuracy    -- The accuracy of the location signal on which this request
                       is based, expressed in meters.
        types       -- The category in which this Place belongs. Only one type
                       can currently be specified for a Place. A string or
                       single element list may be passed in.
        language    -- The language in which the Place's name is being reported.
                       (defaults 'en').
        sensor      -- Boolean flag denoting if the location came from a device
                       using its location sensor (default False).