def METHOD_NAME(cls, external_id, host, owner, name):
    """."""
    try:
        repo = cls.query.filter_by(host=host, owner=owner, name=name).one()
    except NoResultFound:
        repo = cls(
            external_id=external_id, host=host, owner=owner, name=name
        )
        db.session.add(repo)
    return repo