def METHOD_NAME(name=None, session=None):
    logger.debug('retrieving pending lists')
    query = session.query(PendingListList)
    if name:
        logger.debug('searching for pending lists with name {}', name)
        query = query.filter(PendingListList.name.contains(name))
    return query.all()