# Path: heatclient/_i18n.py
# def get_available_languages():
# def enable_lazy():
# 
# Path: heatclient/exc.py
# class BaseException(Exception):
# class CommandError(BaseException):
# class InvalidEndpoint(BaseException):
# class CommunicationError(BaseException):
# class HTTPException(BaseException):
# class HTTPMultipleChoices(HTTPException):
# class BadRequest(HTTPException):
# class HTTPBadRequest(BadRequest):
# class Unauthorized(HTTPException):
# class HTTPUnauthorized(Unauthorized):
# class Forbidden(HTTPException):
# class HTTPForbidden(Forbidden):
# class NotFound(HTTPException):
# class HTTPNotFound(NotFound):
# class NoUniqueMatch(HTTPException):
# class HTTPMethodNotAllowed(HTTPException):
# class Conflict(HTTPException):
# class HTTPConflict(Conflict):
# class OverLimit(HTTPException):
# class HTTPOverLimit(OverLimit):
# class HTTPUnsupported(HTTPException):
# class HTTPInternalServerError(HTTPException):
# class HTTPNotImplemented(HTTPException):
# class HTTPBadGateway(HTTPException):
# class ServiceUnavailable(HTTPException):
# class HTTPServiceUnavailable(ServiceUnavailable):
# class NoTokenLookupException(Exception):
# class EndpointNotFound(Exception):
# class StackFailure(Exception):
#     def __init__(self, message=None):
#     def __str__(self):
#     def __init__(self, message=None, code=None):
#     def __str__(self):
#     def __str__(self):
# def from_response(response):


import base64
import logging
import os
import textwrap
import uuid
import prettytable
import six
import yaml
from oslo_serialization import jsonutils
from oslo_utils import encodeutils
from six.moves.urllib import error
from six.moves.urllib import parse
from six.moves.urllib import request
from heatclient._i18n import _
from heatclient import exc
        base_url = base_url + '/'
    str_url = parse.urljoin(base_url, file)
    return read_url_content(str_url)


def format_output(output, format='yaml'):
    """Format the supplied dict as specified."""
    output_format = format.lower()
    try:
        return supported_formats[output_format](output)
    except KeyError:
        raise exc.HTTPUnsupported(_("The format(%s) is unsupported.")
                                  % output_format)


def parse_query_url(url):
    base_url, query_params = url.split('?')
    return base_url, parse.parse_qs(query_params)


def get_template_url(template_file=None, template_url=None):
    if template_file:
        template_url = normalise_file_path_to_url(template_file)
    return template_url


def read_url_content(url):
    try:
        content = request.urlopen(url).read()
    except error.URLError:

# Path: heatclient/_i18n.py
# def get_available_languages():
# def enable_lazy():
# 
# Path: heatclient/exc.py
# class BaseException(Exception):
# class CommandError(BaseException):
# class InvalidEndpoint(BaseException):
# class CommunicationError(BaseException):
# class HTTPException(BaseException):
# class HTTPMultipleChoices(HTTPException):
# class BadRequest(HTTPException):
# class HTTPBadRequest(BadRequest):
# class Unauthorized(HTTPException):
# class HTTPUnauthorized(Unauthorized):
# class Forbidden(HTTPException):
# class HTTPForbidden(Forbidden):
# class NotFound(HTTPException):
# class HTTPNotFound(NotFound):
# class NoUniqueMatch(HTTPException):
# class HTTPMethodNotAllowed(HTTPException):
# class Conflict(HTTPException):
# class HTTPConflict(Conflict):
# class OverLimit(HTTPException):
# class HTTPOverLimit(OverLimit):
# class HTTPUnsupported(HTTPException):
# class HTTPInternalServerError(HTTPException):
# class HTTPNotImplemented(HTTPException):
# class HTTPBadGateway(HTTPException):
# class ServiceUnavailable(HTTPException):
# class HTTPServiceUnavailable(ServiceUnavailable):
# class NoTokenLookupException(Exception):
# class EndpointNotFound(Exception):
# class StackFailure(Exception):
#     def __init__(self, message=None):
#     def __str__(self):
#     def __init__(self, message=None, code=None):
#     def __str__(self):
#     def __str__(self):
# def from_response(response):


# Path: heatclient/common/utils.py
import base64
import logging
import os
import textwrap
import uuid
import prettytable
import six
import yaml
from oslo_serialization import jsonutils
from oslo_utils import encodeutils
from six.moves.urllib import error
from six.moves.urllib import parse
from six.moves.urllib import request
from heatclient._i18n import _
from heatclient import exc

        base_url = base_url + '/'
    str_url = parse.urljoin(base_url, file)
    return read_url_content(str_url)


def format_output(output, format='yaml'):
    """Format the supplied dict as specified."""
    output_format = format.lower()
    try:
        return supported_formats[output_format](output)
    except KeyError:
        raise exc.HTTPUnsupported(_("The format(%s) is unsupported.")
                                  % output_format)


def parse_query_url(url):
    base_url, query_params = url.split('?')
    return base_url, parse.parse_qs(query_params)


def get_template_url(template_file=None, template_url=None):
    if template_file:
        template_url = normalise_file_path_to_url(template_file)
    return template_url


def read_url_content(url):
    try:
        content = request.urlopen(url).read()
    except error.URLError:

        raise exc.CommandError(_('Could not fetch contents for %s') % url)