import pkg_resources


def source(package, resource):
    """Fetch the content of a specific file in this package.

    Args:
        package (str): The package path relative to which the resource exists.
            In most cases you probably want to supply ``__name__`` to search
            relative to the current code.
        resource (str): The resource filename to load.

    Returns:
        The content of the package resource as a string.
    """

    filename = pkg_resources.resource_filename(package, resource)

    with open(filename, "r") as f:
        content = f.read()

    return content