Helper function to see if given name has any of the patterns in given matches

def _name_matches(name, matches):
    '''
    Helper function to see if given name has any of the patterns in given matches
    '''
    for m in matches:
        if name.endswith(m):
            return True
        if name.lower().endswith('_' + m.lower()):
            return True
        if name.lower() == m.lower():
            return True
    return False