<commit_before># -*- coding: utf-8 -*-
from __future__ import (absolute_import, print_function, unicode_literals)
from acli.output import output_ascii_table, dash_if_none


def get_elb_instances(instances=None):
    """
    @type instances: list
    """
    instance_ids = [x.id for x in instances]
    return ",".join(instance_ids)


def output_elbs(output_media=None, elbs=None):
    """
    @type output_media: unicode
    @type elbs: list
    """
    if elbs:
        if output_media == 'console':
            td = [['name', 'instances', 'dns_name']]
            for elb in elbs:
                td.append([elb.name, str(len(elb.instances)), elb.dns_name])
            output_ascii_table(table_title="ELBs",
                               table_data=td,
                               inner_heading_row_border=True)
    else:
        print("No ELBs found.")
    exit(0)


def get_elb_policies(policies=None):
    """
    @type policies: Policies
    """
    print(policies.__class__.__name__)
    output = ""
    if policies.app_cookie_stickiness_policies:
        for acsp in policies.app_cookie_stickiness_policies:
            output += "{0}\n".format(str(acsp))
    if policies.lb_cookie_stickiness_policies:
        for lcsp in policies.lb_cookie_stickiness_policies:
            output += "{0}\n".format(str(lcsp))<commit_msg>sort elb list output by name.<commit_after># -*- coding: utf-8 -*-
from __future__ import (absolute_import, print_function, unicode_literals)
from acli.output import output_ascii_table, dash_if_none


def get_elb_instances(instances=None):
    """
    @type instances: list
    """
    instance_ids = [x.id for x in instances]
    return ",".join(instance_ids)


def output_elbs(output_media=None, elbs=None):
    """
    @type output_media: unicode
    @type elbs: list
    """
    if elbs:
        elbs.sort(key=lambda k: k.dns_name)
        if output_media == 'console':
            td = [['name', 'instances', 'dns_name']]
            for elb in elbs:
                td.append([elb.name, str(len(elb.instances)), elb.dns_name])
            output_ascii_table(table_title="ELBs",
                               table_data=td,
                               inner_heading_row_border=True)
    else:
        print("No ELBs found.")
    exit(0)


def get_elb_policies(policies=None):
    """
    @type policies: Policies
    """
    print(policies.__class__.__name__)
    output = ""
    if policies.app_cookie_stickiness_policies:
        for acsp in policies.app_cookie_stickiness_policies:
            output += "{0}\n".format(str(acsp))
    if policies.lb_cookie_stickiness_policies:
        for lcsp in policies.lb_cookie_stickiness_policies:
            output += "{0}\n".format(str(lcsp))
{'fraction_non_alphanumeric': 0.11822840409956076, 'fraction_numerical': 0.0029282576866764276, 'mean_word_length': 2.5772251308900525, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '317612', 'n_tokens_mistral': 898, 'n_tokens_neox': 891, 'n_words': 173}