from pathlib import Path


def is_icon_file(f: Path, sap_code: str, name_pattern: str) -> bool:
    """Determine if icon file is the right file
    :param f (Path): icon file path
    :param sap_code (str): Adobe SAP code for product being processed
    :paaram name_pattern (str): icon filename pattern to test"""
    return sap_code in str(f) and name_pattern in str(f)