def METHOD_NAME(yara_patterns_dir, install_dir):
    """ Copy *.yara files from the given source YARA patterns directory
    to the given installation directory.
    File is copied only if it is newer (timestamp) than already existing
    *.yara[c] file in the installation directory, or if such file does not
    exist.
    """
    for root, dirnames, filenames in os.walk(yara_patterns_dir):
        for filename in fnmatch.filter(filenames, '*.yara'):
            input = os.path.join(root, filename)
            input_suffix = os.path.relpath(input, yara_patterns_dir)
            output = os.path.join(install_dir, 'generic', 'yara_patterns', input_suffix)
            output_c = str(pathlib.Path(output).with_suffix('.yarac'))
            if ((not os.path.isfile(output) and not os.path.isfile(output_c))
                    or (os.path.isfile(output) and os.path.getmtime(output) < os.path.getmtime(input))
                    or (os.path.isfile(output_c) and os.path.getmtime(output_c) < os.path.getmtime(input))):
                print('-- Installing:', output)
                os.makedirs(os.path.dirname(output), exist_ok=True)
                shutil.copy(input, output)