def load_case(adapter, case_obj, update=False):
logger.info('<STR_LIT>'.format(case_obj['<STR_LIT>']))<EOL>existing_case = adapter.case(case_obj['<STR_LIT>'])<EOL>if existing_case:<EOL><INDENT>if update:<EOL><INDENT>adapter.update_case(case_obj)<EOL><DEDENT>else:<EOL><INDENT>raise IntegrityError("<STR_LIT>".format(case_obj['<STR_LIT>']))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>adapter.add_case(case_obj)<EOL><DEDENT>return case_obj<EOL>
Load a case into the database

    If the case already exists the function will exit.
    If the user want to load a case that is already in the database
    'update' has to be 'True'

    Args:
        adapter (MongoAdapter): connection to the database
        case_obj (dict): case object to persist to the database
        update(bool): If existing case should be updated

    Returns:
        case_obj(dict): A dictionary with the builded case