<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_resource_path(name, raise_exception=False):
 """ Returns the resource file path matching the given name. :param name: Resource name. :type name: unicode :param raise_exception: Raise the exception. :type raise_exception: bool :return: Resource path. :rtype: unicode """


    if not RuntimeGlobals.resources_directories:
        RuntimeGlobals.resources_directories.append(
            os.path.normpath(os.path.join(umbra.__path__[0], Constants.resources_directory)))

    for path in RuntimeGlobals.resources_directories:
        path = os.path.join(path, name)
        if foundations.common.path_exists(path):
            LOGGER.debug("> '{0}' resource path: '{1}'.".format(name, path))
            return path

    if raise_exception:
        raise umbra.exceptions.ResourceExistsError(
            "{0} | No resource file path found for '{1}' name!".format(__name__, name))