import psycopg2


def write(dictionary: dict[str, int]):
    # conn = psycopg2.connect(dbname='postgres', user='postgres', password='dmcourse13', host='datamining-db.ckzuyvzulw2u.us-east-1.rds.amazonaws.com')  # TODO connection string
    conn = psycopg2.connect(dbname='postgres', user='postgres', password='postgres', host='localhost')
    cursor = conn.cursor()
    # sort dictionary?
    cursor.execute('TRUNCATE vk_words_frequency')
    for key in dictionary:
        cursor.execute('INSERT INTO vk_words_frequency VALUES (%s, %s)', (key, dictionary[key]))
    conn.commit()

62f5f3b999d06e30298ad0cb8ab8a1c61531679c
<mask token>

<mask token>


def write(dictionary: dict[str, int]):
    conn = psycopg2.connect(dbname='postgres', user='postgres', password=
        'postgres', host='localhost')
    cursor = conn.cursor()
    cursor.execute('TRUNCATE vk_words_frequency')
    for key in dictionary:
        cursor.execute('INSERT INTO vk_words_frequency VALUES (%s, %s)', (
            key, dictionary[key]))
    conn.commit()

import psycopg2


def write(dictionary: dict[str, int]):
    conn = psycopg2.connect(dbname='postgres', user='postgres', password=
        'postgres', host='localhost')
    cursor = conn.cursor()
    cursor.execute('TRUNCATE vk_words_frequency')
    for key in dictionary:
        cursor.execute('INSERT INTO vk_words_frequency VALUES (%s, %s)', (
            key, dictionary[key]))
    conn.commit()

import psycopg2


def write(dictionary: dict[str, int]):
    # conn = psycopg2.connect(dbname='postgres', user='postgres', password='dmcourse13', host='datamining-db.ckzuyvzulw2u.us-east-1.rds.amazonaws.com')  # TODO connection string
    conn = psycopg2.connect(dbname='postgres', user='postgres', password='postgres', host='localhost')
    cursor = conn.cursor()
    # sort dictionary?
    cursor.execute('TRUNCATE vk_words_frequency')
    for key in dictionary:
        cursor.execute('INSERT INTO vk_words_frequency VALUES (%s, %s)', (key, dictionary[key]))
    conn.commit()
