<commit_before>import time
import random
from tqdm import tqdm

from .. import API

from .bot_get_medias import get_timeline_medias
from .bot_get_medias import get_user_medias

from .bot_like_feed import like_timeline
from .bot_like_feed import like_user_id
from .bot_unfollow_non_followers import unfollow_non_followers
from .bot_like_hashtag import like_hashtag

from .bot_checkpoint import save_checkpoint
from .bot_checkpoint import load_checkpoint
from .bot_checkpoint import checkpoint_followers_diff
from .bot_checkpoint import checkpoint_following_diff
from .bot_checkpoint import load_last_checkpoint
from .bot_checkpoint import revert_to_checkpoint

from .bot_like_and_follow import like_and_follow
from .bot_like_and_follow import like_and_follow_media_likers
from .bot_like_and_follow import like_and_follow_your_feed_likers

from .bot_comment import get_comment

class Bot(API):
    def __init__(self):
        super(self.__class__, self).__init__()
        self.total_liked = 0
        self.total_followed = 0
        self.total_unfollowed = 0

    def logout(self):
        super(self.__class__, self).logout()
        print ("""Bot stopped.
                  Total liked: %d,
                  Total followed: %d,
                  Total unfollowed: %d""" % (
            self.total_liked, self.total_followed, self.total_unfollowed
        ))

    def like_medias(self, medias):
        """ medias - list of ["pk"] fields of response """
        print ("    Going to like %d medias." % (len(medias)))
        total_liked = 0
        for media in tqdm(medias):
            if self.like(media):
                total_liked += 1
            else:
                pass
            time.sleep(10 * random.random())
        print ("    DONE: Total liked %d medias. " % total_liked)
        self.total_liked += total_liked<commit_msg>add counters for inherited functions<commit_after>import time
import random
from tqdm import tqdm

from .. import API

from .bot_get_medias import get_timeline_medias
from .bot_get_medias import get_user_medias

from .bot_like_feed import like_timeline
from .bot_like_feed import like_user_id
from .bot_unfollow_non_followers import unfollow_non_followers
from .bot_like_hashtag import like_hashtag

from .bot_checkpoint import save_checkpoint
from .bot_checkpoint import load_checkpoint
from .bot_checkpoint import checkpoint_followers_diff
from .bot_checkpoint import checkpoint_following_diff
from .bot_checkpoint import load_last_checkpoint
from .bot_checkpoint import revert_to_checkpoint

from .bot_like_and_follow import like_and_follow
from .bot_like_and_follow import like_and_follow_media_likers
from .bot_like_and_follow import like_and_follow_your_feed_likers

from .bot_comment import get_comment

class Bot(API):
    def __init__(self):
        super(self.__class__, self).__init__()
        self.total_liked = 0
        self.total_unliked = 0
        self.total_followed = 0
        self.total_unfollowed = 0
        self.total_commented = 0

    def logout(self):
        super(self.__class__, self).logout()
        print ("Bot stopped.")
        if self.total_liked:
            print ("Total liked: %d" % self.total_liked)
        if self.total_unliked:
            print ("Total unliked: %d" % self.total_unliked)
        if self.total_followed:
            print ("Total followed: %d" % self.total_followed)
        if self.total_unfollowed:
            print ("Total unfollowed: %d" % self.total_unfollowed)
        if self.total_commented:
            print ("Total commented: %d" % self.total_commented)

    def like(self, media_id):
        if super(self.__class__, self).like(media_id):
            self.total_unliked += 1

    def unlike(self, media_id):
        if super(self.__class__, self).unlike(media_id):
            self.total_liked += 1

    def follow(self, user_id):
        if super(self.__class__, self).follow(user_id):
            self.total_followed += 1

    def unfollow(self, user_id):
        if super(self.__class__, self).unfollow(user_id):
            self.total_unfollowed += 1

    def comment(self, media_id, comment_text):
        if super(self.__class__, self).comment(media_id, comment_text):
            self.total_commented += 1

    def like_medias(self, medias):
        """ medias - list of ["pk"] fields of response """
        print ("    Going to like %d medias." % (len(medias)))
        total_liked = 0
        for media in tqdm(medias):
            if self.like(media):
                total_liked += 1
            else:
                pass
            time.sleep(10 * random.random())
        print ("    DONE: Total liked %d medias. " % total_liked)
        self.total_liked += total_liked
{'fraction_non_alphanumeric': 0.07886904761904762, 'fraction_numerical': 0.004464285714285714, 'mean_word_length': 2.9078073089700998, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4968312', 'n_tokens_mistral': 1486, 'n_tokens_neox': 1420, 'n_words': 364}