def filter_generate_files(
    s3_prefix,
    target_prefix,
    files,
    keywords=["T1w"],
):
    """Filter files based on keywords, generate target path

    Parameters
    ----------

    s3_prefix, target_prefix: str, str
        Path to BIDS dataset on S3 and your dowload desination

    files: list of str
        List of S3 file paths

    keywords: list of str
        List of keywords you want to keep

    Return
    ------

    List of zipped tuple of source and target path

    """
    s3_keep = []
    local = []
    for f in files:
        for keyword in keywords:
            if keyword in f and (f not in s3_keep):
                print(f)
                target_path = f.replace(s3_prefix, target_prefix)
                s3_keep.append(f)
                local.append(target_path)
    return list(zip(s3_keep, local))