<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def resource_filename(package_or_requirement, resource_name):
 """ Similar to pkg_resources.resource_filename but if the resource it not found via pkg_resources it also looks in a predefined list of paths in order to find the resource :param package_or_requirement: the module in which the resource resides :param resource_name: the name of the resource :return: the path to the resource :rtype: str """

    if pkg_resources.resource_exists(package_or_requirement, resource_name):
        return pkg_resources.resource_filename(package_or_requirement, resource_name)

    path = _search_in_share_folders(package_or_requirement, resource_name)

    if path:
        return path

    raise RuntimeError("Resource {} not found in {}".format(package_or_requirement, resource_name))