def save(self, data, *args, **kwargs):
try:<EOL><INDENT>collection_name = kwargs.get('<STR_LIT>',<EOL>MONGODB_DEFAULT_COLLECTION)<EOL>w = kwargs.get('<STR_LIT:w>', <NUM_LIT:0>)<EOL>if not self.collection:<EOL><INDENT>self.set_collection(collection_name)<EOL><DEDENT>self.collection.insert(data, w)<EOL><DEDENT>except (ConnectionFailure, AutoReconnect, InvalidURI) as e:<EOL><INDENT>if ADD_LOG_FAILURES:<EOL><INDENT>logging.exception(<EOL>'<STR_LIT>' % (<EOL>MONGODB_URI, data))<EOL><DEDENT><DEDENT>
inserts data (dict or list of dicts)
expected kwargs:
    collection_name: by default uses MONGODB_DEFAULT_COLLECTION
    w: by default set to 0 to disable write acknowledgement
assumes that data has been verified / validated