def _get_deploy(self, app=None, env=None, number=None, deploy_id=None):
        if deploy_id:
            return Deploy.query.get(deploy_id)
        try:
            app = App.query.filter(App.name == app)[0]
        except __HOLE__:
            return None
        try:
            return Deploy.query.filter(
                Deploy.app_id == app.id,
                Deploy.environment == env,
                Deploy.number == number,
            )[0]
        except IndexError:
            return None
dataset/ETHPy150Open getsentry/freight/freight/api/deploy_details.py/DeployMixin._get_deploy