<commit_before>import os
from tqdm import tqdm

from . import delay


def upload_photo(self, photo, caption=None, upload_id=None):
    delay.small_delay(self)
    if super(self.__class__, self).uploadPhoto(photo, caption, upload_id):
        self.logger.info("Photo '%s' is %s ." % (photo, 'uploaded'))
        return True
    self.logger.info("Photo '%s' is not %s ." % (photo, 'uploaded'))
    return False


def download_photo(self, media_id, path='photos/', filename=None, description=False):
    delay.small_delay(self)
    if not os.path.exists(path):
        os.makedirs(path)
    if description:
        media = self.get_media_info(media_id)[0]
        caption = media['caption']['text']
        with open('{path}{0}_{1}.txt'.format(media['user']['username'], media_id, path=path), encoding='utf8', 'w') as f:
            f.write(caption)
    photo = super(self.__class__, self).downloadPhoto(media_id, filename, False, path)
    if photo:
        return photo
    self.logger.info("Media with %s is not %s ." % (media_id, 'downloaded'))
    return False


def download_photos(self, medias, path, description=False):
    broken_items = []
    if len(medias) == 0:
        self.logger.info("Nothing to downloads.")
        return broken_items
    self.logger.info("Going to download %d medias." % (len(medias)))
    for media in tqdm(medias):
        if not self.download_photo(media, path, description=description):
            delay.error_delay(self)
            broken_items = medias[medias.index(media):]
            break
    return broken_items
<commit_msg>Missed parameter name<commit_after>import os
from tqdm import tqdm

from . import delay


def upload_photo(self, photo, caption=None, upload_id=None):
    delay.small_delay(self)
    if super(self.__class__, self).uploadPhoto(photo, caption, upload_id):
        self.logger.info("Photo '%s' is %s ." % (photo, 'uploaded'))
        return True
    self.logger.info("Photo '%s' is not %s ." % (photo, 'uploaded'))
    return False


def download_photo(self, media_id, path='photos/', filename=None, description=False):
    delay.small_delay(self)
    if not os.path.exists(path):
        os.makedirs(path)
    if description:
        media = self.get_media_info(media_id)[0]
        caption = media['caption']['text']
        with open('{path}{0}_{1}.txt'.format(media['user']['username'], media_id, path=path), encoding='utf8', mode='w') as f:
            f.write(caption)
    photo = super(self.__class__, self).downloadPhoto(media_id, filename, False, path)
    if photo:
        return photo
    self.logger.info("Media with %s is not %s ." % (media_id, 'downloaded'))
    return False


def download_photos(self, medias, path, description=False):
    broken_items = []
    if len(medias) == 0:
        self.logger.info("Nothing to downloads.")
        return broken_items
    self.logger.info("Going to download %d medias." % (len(medias)))
    for media in tqdm(medias):
        if not self.download_photo(media, path, description=description):
            delay.error_delay(self)
            broken_items = medias[medias.index(media):]
            break
    return broken_items

{'fraction_non_alphanumeric': 0.1379638439581351, 'fraction_numerical': 0.003171582619727244, 'mean_word_length': 3.3028649386084585, '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': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '740660', 'n_tokens_mistral': 995, 'n_tokens_neox': 972, 'n_words': 238}