def METHOD_NAME(project, passed_only=True):
    SQL = """
        SELECT sp.id FROM specimens sp
        JOIN ephys_roi_results err ON sp.ephys_roi_result_id = err.id
        JOIN projects prj ON prj.id = sp.project_id
        WHERE prj.code = '%s'
        """ % project
    if passed_only:
        SQL += "AND err.workflow_state = 'manual_passed'"
    results = query(SQL)
    sp_ids = [d["id"] for d in results]
    return sp_ids