import re


def block_contains(pattern, cell):
    """Returns True for non-empty notebook code block that contains pattern"""
    if cell['cell_type'] != 'code': return False
    src = cell['source']
    if len(src) == 0 : return False
    check_all = [re.search(f'^.*{pattern}.*$', line, re.IGNORECASE) for line in src]
    if all(check is None for check in check_all):
        return False
    else: 
        return True