<commit_before>import click
import requests
from bs4 import BeautifulSoup
from constants import anime_status_map, anime_type_map, manga_status_map, manga_type_map


def increment_episode_count(credentials):
    """Increment the episode count of an anime on the user's list

    :param credentials: A tuple containing valid MAL account details in the format (username, password)
    """

    # prompt the user to search their list for the entry
    result = search_list(credentials[0], "anime")

    # check the searching the list returned a valid result
    if result is not None:
        # store the data contained in result
        anime_entry, list_data_xml = result

        # get the id of the anime to update
        anime_id = anime_entry.series_animedb_id.get_text()

        current_ep_count = 0
        anime_title = ""

        # iterate over all anime entries
        for entry in list_data_xml.find_all("anime"):
            # check if the current entry is the one we are looking for
            if entry.series_animedb_id.get_text() == anime_id:
                # get the current number of episodes watched for the anime and the title
                current_ep_count = int(entry.my_watched_episodes.get_text())
                anime_title = entry.series_title.get_text()

        # prepare xml data for sending to server
        xml = """<?xml version="1.0" encoding="UTF-8"?><entry><episode>{}</episode></entry>""".format(
            current_ep_count + 1)

        # send the request to the server, uses GET due to bug in API handling POST requests
        r = requests.get("https://myanimelist.net/api/animelist/update/{}.xml?data={}".format(anime_id, xml),
                         auth=credentials)

        # inform the user whether the request was successful or not
        if r.status_code == 200:
            click.echo("Updated \"{}\" to episode {}".format(anime_title, current_ep_count + 1))
        else:
            click.echo("Error updating anime. Please try again.")

    click.pause()


def increment_chapter_volume_count(credentials, field_type):
    """Increment the chapter or volume count of a manga on the user's list

    :param credentials: A tuple containing valid MAL account details in the format (username, password)
    :param field_type: A string, must be either "chapter" or "volume"
    """

    # ensure that the field_type is valid
    if field_type not in ["chapter", "volume"]:
        raise ValueError("Invalid argument for {}, must be either {} or {}.".format(field_type, "chapter", "volume"))

    # prompt the user to search their list for the entry
    result = search_list(credentials[0], "manga")

    # check the searching the list returned a valid result
    if result is not None:
        # store the data contained in result
        manga_entry, list_data_xml = result

        # get the id of the manga to update
        manga_id = manga_entry.series_mangadb_id.get_text()

        current_field_count = 0
        manga_title = ""

        # iterate over all manga entries
        for entry in list_data_xml.find_all("manga"):
            # check if the current entry is the one we are looking for
            if entry.series_mangadb_id.get_text() == manga_id:
                # get the current number of chapters or volumes for the manga and the title
                current_field_count = int(
                    entry.my_read_chapters.get_text() if field_type == "chapter" else entry.my_read_volumes.get_text())
                manga_title = entry.series_title.get_text()

        # prepare xml data for sending to server
        xml = """<?xml version="1.0" encoding="UTF-8"?><entry><{0}>{1}</{0}></entry>""".format(field_type,
                                                                                               current_field_count + 1)

        # send the request to the server, uses GET due to bug in API handling POST requests
        r = requests.get("https://myanimelist.net/api/mangalist/update/{}.xml?data={}".format(manga_id, xml),
                         auth=credentials)

        # inform the user whether the request was successful or not
        if r.status_code == 200:
            click.echo("Updated \"{}\" to chapter {}".format(manga_title, current_field_count + 1))
        else:
            click.echo("Error updating manga. Please try again.")

    click.pause()


def increment_chapter_count(credentials):
    """Increment the chapter count of a manga on the user's list

    :param credentials: A tuple containing valid MAL account details in the format (username, password)
    """<commit_msg>fixed wording on quick updating volume count<commit_after>import click
import requests
from bs4 import BeautifulSoup
from constants import anime_status_map, anime_type_map, manga_status_map, manga_type_map


def increment_episode_count(credentials):
    """Increment the episode count of an anime on the user's list

    :param credentials: A tuple containing valid MAL account details in the format (username, password)
    """

    # prompt the user to search their list for the entry
    result = search_list(credentials[0], "anime")

    # check the searching the list returned a valid result
    if result is not None:
        # store the data contained in result
        anime_entry, list_data_xml = result

        # get the id of the anime to update
        anime_id = anime_entry.series_animedb_id.get_text()

        current_ep_count = 0
        anime_title = ""

        # iterate over all anime entries
        for entry in list_data_xml.find_all("anime"):
            # check if the current entry is the one we are looking for
            if entry.series_animedb_id.get_text() == anime_id:
                # get the current number of episodes watched for the anime and the title
                current_ep_count = int(entry.my_watched_episodes.get_text())
                anime_title = entry.series_title.get_text()

        # prepare xml data for sending to server
        xml = """<?xml version="1.0" encoding="UTF-8"?><entry><episode>{}</episode></entry>""".format(
            current_ep_count + 1)

        # send the request to the server, uses GET due to bug in API handling POST requests
        r = requests.get("https://myanimelist.net/api/animelist/update/{}.xml?data={}".format(anime_id, xml),
                         auth=credentials)

        # inform the user whether the request was successful or not
        if r.status_code == 200:
            click.echo("Updated \"{}\" to episode {}".format(anime_title, current_ep_count + 1))
        else:
            click.echo("Error updating anime. Please try again.")

    click.pause()


def increment_chapter_volume_count(credentials, field_type):
    """Increment the chapter or volume count of a manga on the user's list

    :param credentials: A tuple containing valid MAL account details in the format (username, password)
    :param field_type: A string, must be either "chapter" or "volume"
    """

    # ensure that the field_type is valid
    if field_type not in ["chapter", "volume"]:
        raise ValueError("Invalid argument for {}, must be either {} or {}.".format(field_type, "chapter", "volume"))

    # prompt the user to search their list for the entry
    result = search_list(credentials[0], "manga")

    # check the searching the list returned a valid result
    if result is not None:
        # store the data contained in result
        manga_entry, list_data_xml = result

        # get the id of the manga to update
        manga_id = manga_entry.series_mangadb_id.get_text()

        current_field_count = 0
        manga_title = ""

        # iterate over all manga entries
        for entry in list_data_xml.find_all("manga"):
            # check if the current entry is the one we are looking for
            if entry.series_mangadb_id.get_text() == manga_id:
                # get the current number of chapters or volumes for the manga and the title
                current_field_count = int(
                    entry.my_read_chapters.get_text() if field_type == "chapter" else entry.my_read_volumes.get_text())
                manga_title = entry.series_title.get_text()

        # prepare xml data for sending to server
        xml = """<?xml version="1.0" encoding="UTF-8"?><entry><{0}>{1}</{0}></entry>""".format(field_type,
                                                                                               current_field_count + 1)

        # send the request to the server, uses GET due to bug in API handling POST requests
        r = requests.get("https://myanimelist.net/api/mangalist/update/{}.xml?data={}".format(manga_id, xml),
                         auth=credentials)

        # inform the user whether the request was successful or not
        if r.status_code == 200:
            click.echo("Updated \"{}\" to {} {}".format(manga_title, field_type, current_field_count + 1))
        else:
            click.echo("Error updating manga. Please try again.")

    click.pause()


def increment_chapter_count(credentials):
    """Increment the chapter count of a manga on the user's list

    :param credentials: A tuple containing valid MAL account details in the format (username, password)
    """
{'fraction_non_alphanumeric': 0.08786565547128927, 'fraction_numerical': 0.005200433369447454, 'mean_word_length': 2.544930875576037, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 4, '>': 23, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 28}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '698479', 'n_tokens_mistral': 2584, 'n_tokens_neox': 2434, 'n_words': 884}