human
Complete the below
def _match(key, value, attrs):

    ''''Match a given key and value against an attribute list.'
    '''
assistant
#Here is the Python program you requested.
    def match_with_wildcards(norm_val, val_list):
        if norm_val.startswith('*'):
            if norm_val.endswith('*'):
                for x in val_list:
                    if (norm_val[1:(-1)] in x):
                        return True
            else:
                for x in val_list:
                    if (norm_val[1:] == x[((len(x) - len(norm_val)) + 1):]):
                        return True
        elif norm_val.endswith('*'):
            for x in val_list:
                if (norm_val[:(-1)] == x[:(len(norm_val) - 1)]):
                    return True
        else:
            for x in val_list:
                if (check_value == x):
                    return True
        return False
    if (key not in attrs):
        return False
    if (value == '*'):
        return True
    if (key == 'serviceId'):
        str_sids = [six.text_type(x) for x in attrs[key]]
        return (six.text_type(value) in str_sids)
    if (key != 'objectclass'):
        check_value = _internal_attr(key, value)[0].lower()
        norm_values = list((_internal_attr(key, x)[0].lower() for x in attrs[key]))
        return match_with_wildcards(check_value, norm_values)
    values = _subs(value)
    for v in values:
        if (v in attrs[key]):
            return True
    return False