def _get_project(self, project_id):
        project = Project.query.options(
            joinedload(Project.repository, innerjoin=True),
        ).filter_by(slug=project_id).first()

        if project is None:
            # Not a slug, maybe a project id.
            try:
                as_uuid = uuid.UUID(project_id)
            except __HOLE__:
                # Not a valid project id.
                return None
            project = Project.query.options(
                joinedload(Project.repository, innerjoin=True),
            ).get(as_uuid)
        return project
dataset/ETHPy150Open dropbox/changes/changes/api/project_options_index.py/ProjectOptionsIndexAPIView._get_project