def METHOD_NAME(self, session, model, **kwargs):
    instance = session.query(model).filter_by(**kwargs).first()
    created = False
    if instance:
        return instance, created
    else:
        instance = model(**kwargs)
        self._save_to_db(objs=instance, session=session)
        created = True
    return instance, created