import glob


def grab_files(adir, extensions):
    """Grabs files with allowed extensions

    Args:
        adir: directory
        extensions: allowed extensions

    Returns:
        files
    """
    all_files = []
    for ext in extensions:
        all_files += glob.glob(adir + "/*" + ext)
        all_files += glob.glob(adir + "/*" + ext.upper())
    return all_files