def METHOD_NAME(package):
    if not hasattr(package, "__file__"):  # pragma: no cover
        return lambda filepath: False
    root = Path(package.__file__).resolve().parent
    cache = {str: {}, bytes: {}}
    def accept(filepath):
        ftype = type(filepath)
        try:
            return cache[ftype][filepath]
        except KeyError:
            pass
        try:
            Path(filepath).resolve().relative_to(root)
            result = True
        except Exception:
            result = False
        cache[ftype][filepath] = result
        return result
    accept.__name__ = f"is_{package.__name__}_file"
    return accept