<commit_before>import AppKit
import Foundation

class Application {
    var application: NSRunningApplication?
    var path: String?
    var pid: Int32

    init(pid: Int32) {
        let application = NSRunningApplication(processIdentifier: pid)
        path = getPidPath(pid: pid)
        self.pid = pid
        self.application = application
    }

    func serialize() -> [String: Any] {
        return [
            "pid": pid,
            "path": path!,
            "bundleId": (application?.bundleIdentifier! ?? nil) as Any,
            "name": (application?.localizedName! ?? nil) as Any,<commit_msg>Fix accessing non-existing path<commit_after>import AppKit
import Foundation

class Application {
    var application: NSRunningApplication?
    var path: String?
    var pid: Int32

    init(pid: Int32) {
        let application = NSRunningApplication(processIdentifier: pid)
        path = getPidPath(pid: pid)
        self.pid = pid
        self.application = application
    }

    func serialize() -> [String: Any] {
        return [
            "pid": pid,
            "path": path as Any,
            "bundleId": (application?.bundleIdentifier! ?? nil) as Any,
            "name": (application?.localizedName! ?? nil) as Any,
{'fraction_non_alphanumeric': 0.1064516129032258, 'fraction_numerical': 0.0064516129032258064, 'mean_word_length': 2.418732782369146, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 5, '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': '343015', 'n_tokens_mistral': 344, 'n_tokens_neox': 333, 'n_words': 98}