import fnmatch


def name_block_match(timeslot, pattern):
    """Returns True if the timeslot matches the name block pattern."""
    match = False

    if hasattr(timeslot, 'text'):
        title = timeslot.text.get('title', [''])[0]
        # Match case insensitively
        match = fnmatch.fnmatch(title.lower(), pattern.lower())

    return match