<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_files_modified():
 """Get the list of modified files that are Python or Jinja2."""

    cmd = "git diff-index --cached --name-only --diff-filter=ACMRTUXB HEAD"
    _, files_modified, _ = run(cmd)

    extensions = [re.escape(ext) for ext in list(SUPPORTED_FILES) + [".rst"]]
    test = "(?:{0})$".format("|".join(extensions))
    return list(filter(lambda f: re.search(test, f), files_modified))