from terminaltables import AsciiTable


def get_terminal_table(vacancies, title):
    data = [['Язык программирования', 'Вакансий найдено', 'Вакансий обработано', 'Средняя зарплата']]
    for language, statistics, in vacancies.items():
        data.append([language,
                     statistics['vacancies_found'],
                     statistics['vacancies_processed'],
                     statistics['average_salary']])
    table = AsciiTable(data, title)
    return table.table


def predict_rub_salary(payment_from, payment_to):
    if payment_from and not payment_to:
        return payment_from * 1.2
    elif not payment_from and payment_to:
        return payment_to * 0.8
    elif payment_from and payment_to:
        return (payment_from + payment_to) / 2
4cda82cc21dccbfbf35a4aeb69e9420d7615c8d3
<mask token>

<mask token>


def predict_rub_salary(payment_from, payment_to):
    if payment_from and not payment_to:
        return payment_from * 1.2
    elif not payment_from and payment_to:
        return payment_to * 0.8
    elif payment_from and payment_to:
        return (payment_from + payment_to) / 2

<mask token>


def get_terminal_table(vacancies, title):
    data = [['Язык программирования', 'Вакансий найдено',
        'Вакансий обработано', 'Средняя зарплата']]
    for language, statistics in vacancies.items():
        data.append([language, statistics['vacancies_found'], statistics[
            'vacancies_processed'], statistics['average_salary']])
    table = AsciiTable(data, title)
    return table.table


def predict_rub_salary(payment_from, payment_to):
    if payment_from and not payment_to:
        return payment_from * 1.2
    elif not payment_from and payment_to:
        return payment_to * 0.8
    elif payment_from and payment_to:
        return (payment_from + payment_to) / 2

from terminaltables import AsciiTable


def get_terminal_table(vacancies, title):
    data = [['Язык программирования', 'Вакансий найдено',
        'Вакансий обработано', 'Средняя зарплата']]
    for language, statistics in vacancies.items():
        data.append([language, statistics['vacancies_found'], statistics[
            'vacancies_processed'], statistics['average_salary']])
    table = AsciiTable(data, title)
    return table.table


def predict_rub_salary(payment_from, payment_to):
    if payment_from and not payment_to:
        return payment_from * 1.2
    elif not payment_from and payment_to:
        return payment_to * 0.8
    elif payment_from and payment_to:
        return (payment_from + payment_to) / 2

from terminaltables import AsciiTable


def get_terminal_table(vacancies, title):
    data = [['Язык программирования', 'Вакансий найдено', 'Вакансий обработано', 'Средняя зарплата']]
    for language, statistics, in vacancies.items():
        data.append([language,
                     statistics['vacancies_found'],
                     statistics['vacancies_processed'],
                     statistics['average_salary']])
    table = AsciiTable(data, title)
    return table.table


def predict_rub_salary(payment_from, payment_to):
    if payment_from and not payment_to:
        return payment_from * 1.2
    elif not payment_from and payment_to:
        return payment_to * 0.8
    elif payment_from and payment_to:
        return (payment_from + payment_to) / 2