import json


countries_file = "countries.json"


def create_countries_file():
    with open(countries_file, "w") as file:
        json.dump([], file)


def get_all_countries():
    with open(countries_file, "r") as file:
        return json.load(file)


def add_country(country, capital):
    countries = get_all_countries()
    countries.append({"country": country, "capital": capital})
    _save_all_countries(countries)


def _save_all_countries(countries):
    with open(countries_file, "w") as file:
        json.dump(countries, file)


def remove_country(country):
    countries = get_all_countries()
    countries = [_country for _country in countries if _country['country'] != country]
    _save_all_countries(countries)

402c8816b9a144a48760d3ae545d5046767b6633
<mask token>


def create_countries_file():
    with open(countries_file, 'w') as file:
        json.dump([], file)


def get_all_countries():
    with open(countries_file, 'r') as file:
        return json.load(file)


<mask token>


def _save_all_countries(countries):
    with open(countries_file, 'w') as file:
        json.dump(countries, file)


def remove_country(country):
    countries = get_all_countries()
    countries = [_country for _country in countries if _country['country'] !=
        country]
    _save_all_countries(countries)

<mask token>


def create_countries_file():
    with open(countries_file, 'w') as file:
        json.dump([], file)


def get_all_countries():
    with open(countries_file, 'r') as file:
        return json.load(file)


def add_country(country, capital):
    countries = get_all_countries()
    countries.append({'country': country, 'capital': capital})
    _save_all_countries(countries)


def _save_all_countries(countries):
    with open(countries_file, 'w') as file:
        json.dump(countries, file)


def remove_country(country):
    countries = get_all_countries()
    countries = [_country for _country in countries if _country['country'] !=
        country]
    _save_all_countries(countries)

<mask token>
countries_file = 'countries.json'


def create_countries_file():
    with open(countries_file, 'w') as file:
        json.dump([], file)


def get_all_countries():
    with open(countries_file, 'r') as file:
        return json.load(file)


def add_country(country, capital):
    countries = get_all_countries()
    countries.append({'country': country, 'capital': capital})
    _save_all_countries(countries)


def _save_all_countries(countries):
    with open(countries_file, 'w') as file:
        json.dump(countries, file)


def remove_country(country):
    countries = get_all_countries()
    countries = [_country for _country in countries if _country['country'] !=
        country]
    _save_all_countries(countries)

import json
countries_file = 'countries.json'


def create_countries_file():
    with open(countries_file, 'w') as file:
        json.dump([], file)


def get_all_countries():
    with open(countries_file, 'r') as file:
        return json.load(file)


def add_country(country, capital):
    countries = get_all_countries()
    countries.append({'country': country, 'capital': capital})
    _save_all_countries(countries)


def _save_all_countries(countries):
    with open(countries_file, 'w') as file:
        json.dump(countries, file)


def remove_country(country):
    countries = get_all_countries()
    countries = [_country for _country in countries if _country['country'] !=
        country]
    _save_all_countries(countries)

import json


countries_file = "countries.json"


def create_countries_file():
    with open(countries_file, "w") as file:
        json.dump([], file)


def get_all_countries():
    with open(countries_file, "r") as file:
        return json.load(file)


def add_country(country, capital):
    countries = get_all_countries()
    countries.append({"country": country, "capital": capital})
    _save_all_countries(countries)


def _save_all_countries(countries):
    with open(countries_file, "w") as file:
        json.dump(countries, file)


def remove_country(country):
    countries = get_all_countries()
    countries = [_country for _country in countries if _country['country'] != country]
    _save_all_countries(countries)
