def write(name, values, tags={}, timestamp=None, database=None):
point = {<EOL>'<STR_LIT>': name,<EOL>'<STR_LIT>': tags,<EOL>'<STR_LIT>': values<EOL>}<EOL>if isinstance(timestamp, datetime):<EOL><INDENT>timestamp = timestamp.strftime('<STR_LIT>')<EOL><DEDENT>if timestamp:<EOL><INDENT>point['<STR_LIT:time>'] = timestamp<EOL><DEDENT>try:<EOL><INDENT>get_db().write({'<STR_LIT>': [point]},<EOL>{'<STR_LIT>': database or settings.INFLUXDB_DATABASE})<EOL><DEDENT>except Exception as e:<EOL><INDENT>if settings.INFLUXDB_FAIL_SILENTLY:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>raise e<EOL><DEDENT><DEDENT>
Method to be called via threading module.