import re


def _match_label(pattern, issue):
    """
        :param pattern:
        :param issue:
        :return: [True] if issue contains the pattern

        >>> _match_label('aaa', {'labels': [{'name': 'aaa'}]})
        True

        >>> _match_label('aaa', {'labels': [{'name': 'bbb'}]})
        False
    """
    return any(re.search(pattern, label['name'], re.IGNORECASE)
               for label in issue['labels'])