<commit_before>from util import *


def parse_elements_buffed(process_info):
    buffs = dict()

    if process_info[0] != '0':
        buffs['elements buffed'] = buffs.get('elements buffed', []) + [
            elements[process_info[0]]]
    if process_info[1] != '0':
        buffs['elements buffed'] = buffs.get('elements buffed', []) + [
            elements[process_info[1]]]

    return buffs


def crit_elem_weakness(x):
    return float(x)*100

genders = {'0': 'genderless', '1': 'male', '2': 'female'}

ls_process_format = {
    '1': ((0, 'atk% buff', int, not_zero),
          (1, 'def% buff', int, not_zero),
          (2, 'rec% buff', int, not_zero),
          (3, 'crit% buff', int, not_zero),
          (4, 'hp% buff', int, not_zero)),

    '2': (parse_elements_buffed,
          (2, 'atk% buff', int, not_zero),
          (3, 'def% buff', int, not_zero),
          (4, 'rec% buff', int, not_zero),
          (5, 'crit% buff', int, not_zero),
          (6, 'hp% buff', int, not_zero)),

    '4': ((0, 'poison resist%', int, not_zero),
          (1, 'weaken resist%', int, not_zero),
          (2, 'sick resist%', int, not_zero),
          (3, 'injury resist%', int, not_zero),
          (4, 'curse resist%', int, not_zero),
          (5, 'paralysis resist%', int, not_zero)),

    '5': (([0, 1], lambda el: '%s resist%%' % elements[el], int),),

    '9': ((0, 'bc fill per turn', bb_gauge),),

    '10': ((0, 'hc effectiveness%', int),),

    '11': ((0, 'atk% buff', int, not_zero),
           (1, 'def% buff', int, not_zero),
           (2, 'rec% buff', int, not_zero),
           (3, 'crit% buff', int, not_zero),
           ([5, 4], lambda s: 'hp %s %% buff requirement' %
            ('above' if int(s) == 1 else 'below'), int, not_zero)),

    '14': ((0, 'dmg reduction%', int),
           (1, 'dmg reduction chance%', int)),

    '19': ((0, 'bc production%', int, not_zero),
           (1, 'hc production%', int, not_zero),
           (2, 'item production%', int, not_zero),
           (3, 'zel production%', int, not_zero),
           (4, 'karma production%', int, not_zero)),

    '20': (((0, 1), ailments.get, int, not_zero),
           ((2, 3), ailments.get, int, not_zero),
           ((4, 5), ailments.get, int, not_zero),
           ((6, 7), ailments.get, int, not_zero)),

    '21': ((0, 'first x turns atk%', int, not_zero),
           (1, 'first x turns def%', int, not_zero),
           (2, 'first x turns', int)),

    '25': ((0, 'bc fill when attacked low', bb_gauge),
           (1, 'bc fill when attacked high', bb_gauge),
           (2, 'bc fill when attacked%', int)),

    '29': ((0, 'ignore def%', int),),

    '31': ((0, 'damage% for spark', int, not_zero),
           (1, 'bc drop% for spark', int, not_zero),
           (2, 'hc drop% for spark', int, not_zero),
           (3, 'item drop% for spark GUESSED', int, not_zero),
           (4, 'zel drop% for spark', int, not_zero),
           (5, 'karma drop% for spark', int, not_zero)),

    '32': ((0, 'bb gauge fill rate%', int),),

    '34': ((0, 'dmg% for crits', crit_elem_weakness),),

    '35': ((0, 'bc fill when attacking low', bb_gauge),
           (1, 'bc fill when attacking high', bb_gauge),
           (2, 'bc fill when attacking%', int)),

    '41': ((0, 'unique elements required', int),
           (1, 'atk% buff', int, not_zero),
           (2, 'def% buff', int, not_zero),
           (3, 'rec% buff', int, not_zero),
           (4, 'crit% buff', int, not_zero),
           (5, 'hp% buff', int, not_zero)),<commit_msg>fix first x turns buffs.<commit_after>from util import *


def parse_elements_buffed(process_info):
    buffs = dict()

    if process_info[0] != '0':
        buffs['elements buffed'] = buffs.get('elements buffed', []) + [
            elements[process_info[0]]]
    if process_info[1] != '0':
        buffs['elements buffed'] = buffs.get('elements buffed', []) + [
            elements[process_info[1]]]

    return buffs


def crit_elem_weakness(x):
    return float(x)*100

genders = {'0': 'genderless', '1': 'male', '2': 'female'}

ls_process_format = {
    '1': ((0, 'atk% buff', int, not_zero),
          (1, 'def% buff', int, not_zero),
          (2, 'rec% buff', int, not_zero),
          (3, 'crit% buff', int, not_zero),
          (4, 'hp% buff', int, not_zero)),

    '2': (parse_elements_buffed,
          (2, 'atk% buff', int, not_zero),
          (3, 'def% buff', int, not_zero),
          (4, 'rec% buff', int, not_zero),
          (5, 'crit% buff', int, not_zero),
          (6, 'hp% buff', int, not_zero)),

    '4': ((0, 'poison resist%', int, not_zero),
          (1, 'weaken resist%', int, not_zero),
          (2, 'sick resist%', int, not_zero),
          (3, 'injury resist%', int, not_zero),
          (4, 'curse resist%', int, not_zero),
          (5, 'paralysis resist%', int, not_zero)),

    '5': (([0, 1], lambda el: '%s resist%%' % elements[el], int),),

    '9': ((0, 'bc fill per turn', bb_gauge),),

    '10': ((0, 'hc effectiveness%', int),),

    '11': ((0, 'atk% buff', int, not_zero),
           (1, 'def% buff', int, not_zero),
           (2, 'rec% buff', int, not_zero),
           (3, 'crit% buff', int, not_zero),
           ([5, 4], lambda s: 'hp %s %% buff requirement' %
            ('above' if int(s) == 1 else 'below'), int, not_zero)),

    '14': ((0, 'dmg reduction%', int),
           (1, 'dmg reduction chance%', int)),

    '19': ((0, 'bc production%', int, not_zero),
           (1, 'hc production%', int, not_zero),
           (2, 'item production%', int, not_zero),
           (3, 'zel production%', int, not_zero),
           (4, 'karma production%', int, not_zero)),

    '20': (((0, 1), ailments.get, int, not_zero),
           ((2, 3), ailments.get, int, not_zero),
           ((4, 5), ailments.get, int, not_zero),
           ((6, 7), ailments.get, int, not_zero)),

    '21': ((0, 'first x turns atk%', int, not_zero),
           (1, 'first x turns def%', int, not_zero),
           (2, 'first x turns rec% GUESSED', int, not_zero),
           (3, 'first x turns crit% GUESSED', int, not_zero),
           (4, 'first x turns', int)),

    '25': ((0, 'bc fill when attacked low', bb_gauge),
           (1, 'bc fill when attacked high', bb_gauge),
           (2, 'bc fill when attacked%', int)),

    '29': ((0, 'ignore def%', int),),

    '31': ((0, 'damage% for spark', int, not_zero),
           (1, 'bc drop% for spark', int, not_zero),
           (2, 'hc drop% for spark', int, not_zero),
           (3, 'item drop% for spark GUESSED', int, not_zero),
           (4, 'zel drop% for spark', int, not_zero),
           (5, 'karma drop% for spark', int, not_zero)),

    '32': ((0, 'bb gauge fill rate%', int),),

    '34': ((0, 'dmg% for crits', crit_elem_weakness),),

    '35': ((0, 'bc fill when attacking low', bb_gauge),
           (1, 'bc fill when attacking high', bb_gauge),
           (2, 'bc fill when attacking%', int)),

    '41': ((0, 'unique elements required', int),
           (1, 'atk% buff', int, not_zero),
           (2, 'def% buff', int, not_zero),
           (3, 'rec% buff', int, not_zero),
           (4, 'crit% buff', int, not_zero),
           (5, 'hp% buff', int, not_zero)),
{'fraction_non_alphanumeric': 0.20492487479131888, 'fraction_numerical': 0.03060656649972176, 'mean_word_length': 2.4135802469135803, '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': '1146945', 'n_tokens_mistral': 2672, 'n_tokens_neox': 2539, 'n_words': 799}