# Path: heatclient/_i18n.py
# def get_available_languages():
# def enable_lazy():
# 
# Path: heatclient/common/utils.py
# LOG = logging.getLogger(__name__)
# def arg(*args, **kwargs):
#     def _decorator(func):
# def env(*args, **kwargs):
# def add_arg(func, *args, **kwargs):
# def print_list(objs, fields, formatters=None, sortby_index=0,
#                mixed_case_fields=None, field_labels=None):
# def link_formatter(links):
#     def format_link(l):
# def resource_nested_identifier(rsrc):
# def json_formatter(js):
# def yaml_formatter(js):
# def text_wrap_formatter(d):
# def newline_list_formatter(r):
# def print_dict(d, formatters=None):
#     def __init__(self):
#     def prepend_paths(self, resource_path, stack_id):
#     def build_resource_name(self, event):
#         def get_stack_id():
# def event_log_formatter(events, event_log_context=None):
# def print_update_list(lst, fields, formatters=None):
# def find_resource(manager, name_or_id):
# def format_parameters(params, parse_semicolon=True):
# def format_all_parameters(params, param_files,
#                           template_file=None, template_url=None):
# def format_parameter_file(param_files, template_file=None,
#                           template_url=None):
# def resolve_param_get_file(file, base_url):
# def format_output(output, format='yaml'):
# def parse_query_url(url):
# def get_template_url(template_file=None, template_url=None):
# def read_url_content(url):
# def base_url_for_url(url):
# def normalise_file_path_to_url(path):
# def get_response_body(resp):
# class EventLogContext(object):
# 
# Path: heatclient/v1/events.py
# DEFAULT_PAGE_SIZE = 20
# class Event(base.Resource):
# class EventManager(stacks.StackChildManager):
#     def __repr__(self):
#     def update(self, **fields):
#     def delete(self):
#     def data(self, **kwargs):
#     def list(self, stack_id, resource_name=None, **kwargs):
#     def get(self, stack_id, resource_name, event_id):


import sys
import time
import heatclient.exc as exc
from heatclient._i18n import _
from heatclient.common import utils
from heatclient.v1 import events as events_mod
    events = _get_stack_events(hc, stack_id, event_args)
    events.extend(_get_nested_events(hc, nested_depth,
                                     stack_id, event_args))
    # Because there have been multiple stacks events mangled into
    # one list, we need to sort before passing to print_list
    # Note we can't use the prettytable sortby_index here, because
    # the "start" option doesn't allow post-sort slicing, which
    # will be needed to make "--marker" work for nested_depth lists
    events.sort(key=lambda x: x.event_time)

    # Slice the list if marker is specified
    if marker:
        try:
            marker_index = [e.id for e in events].index(marker)
            events = events[marker_index:]
        except ValueError:
            pass

    # Slice the list if limit is specified
    if limit:
        limit_index = min(int(limit), len(events))
        events = events[:limit_index]
    return events


def _get_nested_ids(hc, stack_id):
    nested_ids = []
    try:
        resources = hc.resources.list(stack_id=stack_id)
    except exc.HTTPNotFound:

# Path: heatclient/_i18n.py
# def get_available_languages():
# def enable_lazy():
# 
# Path: heatclient/common/utils.py
# LOG = logging.getLogger(__name__)
# def arg(*args, **kwargs):
#     def _decorator(func):
# def env(*args, **kwargs):
# def add_arg(func, *args, **kwargs):
# def print_list(objs, fields, formatters=None, sortby_index=0,
#                mixed_case_fields=None, field_labels=None):
# def link_formatter(links):
#     def format_link(l):
# def resource_nested_identifier(rsrc):
# def json_formatter(js):
# def yaml_formatter(js):
# def text_wrap_formatter(d):
# def newline_list_formatter(r):
# def print_dict(d, formatters=None):
#     def __init__(self):
#     def prepend_paths(self, resource_path, stack_id):
#     def build_resource_name(self, event):
#         def get_stack_id():
# def event_log_formatter(events, event_log_context=None):
# def print_update_list(lst, fields, formatters=None):
# def find_resource(manager, name_or_id):
# def format_parameters(params, parse_semicolon=True):
# def format_all_parameters(params, param_files,
#                           template_file=None, template_url=None):
# def format_parameter_file(param_files, template_file=None,
#                           template_url=None):
# def resolve_param_get_file(file, base_url):
# def format_output(output, format='yaml'):
# def parse_query_url(url):
# def get_template_url(template_file=None, template_url=None):
# def read_url_content(url):
# def base_url_for_url(url):
# def normalise_file_path_to_url(path):
# def get_response_body(resp):
# class EventLogContext(object):
# 
# Path: heatclient/v1/events.py
# DEFAULT_PAGE_SIZE = 20
# class Event(base.Resource):
# class EventManager(stacks.StackChildManager):
#     def __repr__(self):
#     def update(self, **fields):
#     def delete(self):
#     def data(self, **kwargs):
#     def list(self, stack_id, resource_name=None, **kwargs):
#     def get(self, stack_id, resource_name, event_id):


# Path: heatclient/common/event_utils.py
import sys
import time
import heatclient.exc as exc
from heatclient._i18n import _
from heatclient.common import utils
from heatclient.v1 import events as events_mod

    events = _get_stack_events(hc, stack_id, event_args)
    events.extend(_get_nested_events(hc, nested_depth,
                                     stack_id, event_args))
    # Because there have been multiple stacks events mangled into
    # one list, we need to sort before passing to print_list
    # Note we can't use the prettytable sortby_index here, because
    # the "start" option doesn't allow post-sort slicing, which
    # will be needed to make "--marker" work for nested_depth lists
    events.sort(key=lambda x: x.event_time)

    # Slice the list if marker is specified
    if marker:
        try:
            marker_index = [e.id for e in events].index(marker)
            events = events[marker_index:]
        except ValueError:
            pass

    # Slice the list if limit is specified
    if limit:
        limit_index = min(int(limit), len(events))
        events = events[:limit_index]
    return events


def _get_nested_ids(hc, stack_id):
    nested_ids = []
    try:
        resources = hc.resources.list(stack_id=stack_id)
    except exc.HTTPNotFound:

        raise exc.CommandError(_('Stack not found: %s') % stack_id)