# Path: ament_index_python/ament_index_python/constants.py
# RESOURCE_INDEX_SUBFOLDER = 'share/ament_index/resource_index'
# 
# Path: ament_index_python/ament_index_python/search_paths.py
# def get_search_paths():
#     """
#     Get the paths from the environment variable '{AMENT_PREFIX_PATH_ENV_VAR}'.
# 
#     :returns: list of paths
#     :raises: :exc:`EnvironmentError`
#     """.format(AMENT_PREFIX_PATH_ENV_VAR=AMENT_PREFIX_PATH_ENV_VAR)
#     ament_prefix_path = os.environ.get(AMENT_PREFIX_PATH_ENV_VAR)
#     if not ament_prefix_path:
#         raise EnvironmentError(
#             "Environment variable '{}' is not set or empty".format(AMENT_PREFIX_PATH_ENV_VAR))
# 
#     paths = ament_prefix_path.split(os.pathsep)
#     return [p for p in paths if p and os.path.exists(p)]


import os
from .constants import RESOURCE_INDEX_SUBFOLDER
from .search_paths import get_search_paths
    :type resource_name: str
    :returns: True or False
    """
    return ('/' in resource_name) or ('\\' in resource_name)


def get_resource(resource_type, resource_name):
    """
    Get the content of a specific resource and its prefix path.

    :param resource_type: the type of the resource
    :type resource_type: str
    :param resource_names: the name of the resource
    :type resource_name: str
    :returns: a tuple of the content (bytes) of the resource and its prefix path
    :raises: :exc:`EnvironmentError`
    :raises: :exc:`OSError`
    :raises: :exc:`LookupError`
    :raises: :exc:`InvalidResourceTypeNameError`
    :raises: :exc:`InvalidResourceNameError`
    """
    assert resource_type, 'The resource type must not be empty'
    assert resource_name, 'The resource name must not be empty'
    if _name_is_invalid(resource_type):
        raise InvalidResourceTypeNameError(
            "Resource type '%s' is invalid" % resource_type)
    if _name_is_invalid(resource_name):
        raise InvalidResourceNameError(
            "Resource name '%s' is invalid" % resource_name)
    for path in get_search_paths():

# Path: ament_index_python/ament_index_python/constants.py
# RESOURCE_INDEX_SUBFOLDER = 'share/ament_index/resource_index'
# 
# Path: ament_index_python/ament_index_python/search_paths.py
# def get_search_paths():
#     """
#     Get the paths from the environment variable '{AMENT_PREFIX_PATH_ENV_VAR}'.
# 
#     :returns: list of paths
#     :raises: :exc:`EnvironmentError`
#     """.format(AMENT_PREFIX_PATH_ENV_VAR=AMENT_PREFIX_PATH_ENV_VAR)
#     ament_prefix_path = os.environ.get(AMENT_PREFIX_PATH_ENV_VAR)
#     if not ament_prefix_path:
#         raise EnvironmentError(
#             "Environment variable '{}' is not set or empty".format(AMENT_PREFIX_PATH_ENV_VAR))
# 
#     paths = ament_prefix_path.split(os.pathsep)
#     return [p for p in paths if p and os.path.exists(p)]


# Path: ament_index_python/ament_index_python/resources.py
import os
from .constants import RESOURCE_INDEX_SUBFOLDER
from .search_paths import get_search_paths

    :type resource_name: str
    :returns: True or False
    """
    return ('/' in resource_name) or ('\\' in resource_name)


def get_resource(resource_type, resource_name):
    """
    Get the content of a specific resource and its prefix path.

    :param resource_type: the type of the resource
    :type resource_type: str
    :param resource_names: the name of the resource
    :type resource_name: str
    :returns: a tuple of the content (bytes) of the resource and its prefix path
    :raises: :exc:`EnvironmentError`
    :raises: :exc:`OSError`
    :raises: :exc:`LookupError`
    :raises: :exc:`InvalidResourceTypeNameError`
    :raises: :exc:`InvalidResourceNameError`
    """
    assert resource_type, 'The resource type must not be empty'
    assert resource_name, 'The resource name must not be empty'
    if _name_is_invalid(resource_type):
        raise InvalidResourceTypeNameError(
            "Resource type '%s' is invalid" % resource_type)
    if _name_is_invalid(resource_name):
        raise InvalidResourceNameError(
            "Resource name '%s' is invalid" % resource_name)
    for path in get_search_paths():

        resource_path = os.path.join(path, RESOURCE_INDEX_SUBFOLDER, resource_type, resource_name)