<commit_before># -*- coding: utf-8 -*-

import re
from utils import detect_string, gen_hashcode, detect_all
from symbols import translate_traces


IGNORE = ['/data/app-lib', '/mnt/asec/', '/data/data/', '/data/app/']


def detect_trace(contents):
    for content in contents:
        if "backtrace:" in content:
            backtrace = detect_all(content, r'((?:/.+)+(?: \(.+\))*)')
            if backtrace:
                for bt in backtrace:
                    for ig in IGNORE:
                        if ig in bt:
                            return []
                return backtrace, content
    return None, None


def detect_issue_owner(backtrace):
    if backtrace:
        for bt in backtrace:
            if '(' in bt:
                lib = bt.split('(')[0].strip()
                break
        else:
            lib = backtrace[0]<commit_msg>fix bug<commit_after># -*- coding: utf-8 -*-

import re
from utils import detect_string, gen_hashcode, detect_all
from symbols import translate_traces


IGNORE = ['/data/app-lib', '/mnt/asec/', '/data/data/', '/data/app/']


def detect_trace(contents):
    for content in contents:
        if "backtrace:" in content:
            backtrace = detect_all(content, r'((?:/.+)+(?: \(.+\))*)')
            if backtrace:
                for bt in backtrace:
                    for ig in IGNORE:
                        if ig in bt:
                            return None, None
                return backtrace, content
    return None, None


def detect_issue_owner(backtrace):
    if backtrace:
        for bt in backtrace:
            if '(' in bt:
                lib = bt.split('(')[0].strip()
                break
        else:
            lib = backtrace[0]
{'fraction_non_alphanumeric': 0.12514551804423749, 'fraction_numerical': 0.0034924330616996507, 'mean_word_length': 1.592760180995475, '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': '3062329', 'n_tokens_mistral': 505, 'n_tokens_neox': 484, 'n_words': 144}