<commit_before>

from solar.system_log import data
from dictdiffer import patch


def set_error(task_uuid, *args, **kwargs):
    sl = data.SL()
    item = sl.get(task_uuid)
    if item:
        item.state = data.STATES.error
        sl.update(task_uuid, item)


def move_to_commited(task_uuid, *args, **kwargs):
    sl = data.SL()
    item = sl.pop(task_uuid)
    if item:
        commited = data.CD()
        staged_data = patch(item.diff, commited.get(item.res, {}))
        cl = data.CL()
        item.state = data.STATES.success
        cl.append(item)
        commited[item.res] = staged_data
<commit_msg>Fix update of logitem bug in system_log<commit_after>

from solar.system_log import data
from dictdiffer import patch


def set_error(task_uuid, *args, **kwargs):
    sl = data.SL()
    item = sl.get(task_uuid)
    if item:
        item.state = data.STATES.error
        sl.update(item)


def move_to_commited(task_uuid, *args, **kwargs):
    sl = data.SL()
    item = sl.pop(task_uuid)
    if item:
        commited = data.CD()
        staged_data = patch(item.diff, commited.get(item.res, {}))
        cl = data.CL()
        item.state = data.STATES.success
        cl.append(item)
        commited[item.res] = staged_data

{'fraction_non_alphanumeric': 0.12388663967611337, 'fraction_numerical': 0.0, 'mean_word_length': 2.6140350877192984, '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': '4211700', 'n_tokens_mistral': 434, 'n_tokens_neox': 427, 'n_words': 95}