# Path: scalrctl/settings.py
# API_KEY_ID = None
# API_SECRET_KEY = None
# API_VERSION = "v1beta0"
# API_SCHEME = 'https'
# API_HOST = 'my.scalr.com'
# SIGNATURE_VERSION = 'V1-HMAC-SHA256'
# SSL_VERIFY_PEER = True
# GLOBAL_SCOPE_API_KEY_ID = None
# GLOBAL_SCOPE_API_SECRET_KEY = None


import json
import yaml
import six
import prettytable
import re
from scalrctl import settings

    for row in rows:
        table.add_row(row)

    body = table.get_string()

    if body and pre:
        body = "%s\n\n%s" % (pre, body)
    if body and post:
        body = "%s\n\n%s" % (body, post)

    return "\n%s\n" % body


def calc_horizontal_table(response_json, columns):
    rows = []
    data = response_json.get("data", {})
    for column_name in columns:
        if column_name.lower() in [d.lower() for d in data.keys()]:
            rows.append([column_name, data[column_name]])
        elif column_name.lower() in ['%s.id' % d.lower() for d in data.keys()]:
            if 'id' in data[column_name[:-3]]:
                rows.append([column_name, data[column_name[:-3]]['id']])
            else:
                rows.append([column_name, ''])
    return rows


def build_horizontal_table(rows):
    table = prepare_table()

# Path: scalrctl/settings.py
# API_KEY_ID = None
# API_SECRET_KEY = None
# API_VERSION = "v1beta0"
# API_SCHEME = 'https'
# API_HOST = 'my.scalr.com'
# SIGNATURE_VERSION = 'V1-HMAC-SHA256'
# SSL_VERIFY_PEER = True
# GLOBAL_SCOPE_API_KEY_ID = None
# GLOBAL_SCOPE_API_SECRET_KEY = None


# Path: scalrctl/view.py
import json
import yaml
import six
import prettytable
import re
from scalrctl import settings


    for row in rows:
        table.add_row(row)

    body = table.get_string()

    if body and pre:
        body = "%s\n\n%s" % (pre, body)
    if body and post:
        body = "%s\n\n%s" % (body, post)

    return "\n%s\n" % body


def calc_horizontal_table(response_json, columns):
    rows = []
    data = response_json.get("data", {})
    for column_name in columns:
        if column_name.lower() in [d.lower() for d in data.keys()]:
            rows.append([column_name, data[column_name]])
        elif column_name.lower() in ['%s.id' % d.lower() for d in data.keys()]:
            if 'id' in data[column_name[:-3]]:
                rows.append([column_name, data[column_name[:-3]]['id']])
            else:
                rows.append([column_name, ''])
    return rows


def build_horizontal_table(rows):
    table = prepare_table()

    template = '\x1b[1m%s\x1b[0m' if settings.colored_output else "%s"