<commit_before><bsh>
    import android.app.Service;
    import android.database.Cursor;
    import android.net.Uri;
    import java.text.DateFormat;
    import android.provider.Contacts.People;
    import android.content.ContentValues;

    threadId = parameters.get("threadId");
    contactId = parameters.get("contactId");

    print("[{\n\t\"threadId\" : " + threadId + ", \n\t\"contactId\" : " + contactId + ", \n\t\"contactImg\" : \"graphics/seeContactImg.xhtml?contactId=" + contactId + "\", \n\t\"messages\" : [");

    STATUS_NONE = -1;
    STATUS_COMPLETE = 0;
    STATUS_PENDING = 64;
    STATUS_FAILED = 128;

    service = (Service) server.props.get("serviceContext");
    SMS_CONTENT_URI = Uri.parse("content://sms");

    // Mark all read
    values = new ContentValues(1);
    values.put("read", Integer.valueOf(1));
    service.getContentResolver().update(SMS_CONTENT_URI, values, "thread_id=" + threadId, null);

    ignoreThreadId = 0;

    SMS_READ_COLUMN = "read";
    SORT_ORDER = "date DESC";

    WHERE_CONDITION = "thread_id = " + threadId;

    cursor = service.getContentResolver().query(
        SMS_CONTENT_URI,
        new String[] { "_id", "thread_id", "address", "person", "date", "body", "status", "read"},
        WHERE_CONDITION,
        null,
        SORT_ORDER
    );

    if (cursor != null) {
        try {
            count = cursor.getCount();

            if (cursor.moveToFirst()) {
                do {
                    print("\n\t\t{");
                    messageId = cursor.getLong(0);
                    threadId = cursor.getLong(1);
                    number = cursor.getString(2);
                    long timestamp = cursor.getLong(4);

                    body = cursor.getString(5);
                    status = cursor.getInt(6);

                    // Add links to URLs
                    body = body.replaceAll(
                        "(http://[^\\s]*)",
                        "<a href=\"$1\" target=\"_blank\" class='link'>$1</a>"
                    );

                    print("\n\t\t\t\"person\" : \"" +  person + "\",\n\t\t\t\"read\" : \"" +  read + "\",\n\t\t\t\"number\" : \"" +  number + "\",\n\t\t\t\"date\" : \"" + DateFormat.getDateTimeInstance(
        DateFormat.MEDIUM, DateFormat.MEDIUM).format(new Date(timestamp)) + "\", \n\t\t\t\"message\" : \"" + body + "\""

                    );
                    print("\t\t}");
                    if (!cursor.isLast())  {
                        print(",");
                    }
                } while(cursor.moveToNext());
            }
        } finally {
            cursor.close();
        }
    }
    print("\t]}]");
</bsh><commit_msg>Read value on JSON return<commit_after><bsh>
    import android.app.Service;
    import android.database.Cursor;
    import android.net.Uri;
    import java.text.DateFormat;
    import android.provider.Contacts.People;
    import android.content.ContentValues;

    threadId = parameters.get("threadId");
    contactId = parameters.get("contactId");

    print("[{\n\t\"threadId\" : " + threadId + ", \n\t\"contactId\" : " + contactId + ", \n\t\"contactImg\" : \"graphics/seeContactImg.xhtml?contactId=" + contactId + "\", \n\t\"messages\" : [");

    STATUS_NONE = -1;
    STATUS_COMPLETE = 0;
    STATUS_PENDING = 64;
    STATUS_FAILED = 128;

    service = (Service) server.props.get("serviceContext");
    SMS_CONTENT_URI = Uri.parse("content://sms");

    // Mark all read
    values = new ContentValues(1);
    values.put("read", Integer.valueOf(1));
    service.getContentResolver().update(SMS_CONTENT_URI, values, "thread_id=" + threadId, null);

    SMS_READ_COLUMN = "read";
    SORT_ORDER = "date DESC";

    WHERE_CONDITION = "thread_id = " + threadId;

    cursor = service.getContentResolver().query(
        SMS_CONTENT_URI,
        new String[] { "_id", "thread_id", "address", "person", "date", "body", "status", "read"},
        WHERE_CONDITION,
        null,
        SORT_ORDER
    );

    if (cursor != null) {
        try {
            count = cursor.getCount();

            if (cursor.moveToFirst()) {
                Integer index_Read = cursor.getColumnIndex("read");
                Integer index_Person = cursor.getColumnIndex("person");
                do {
                    print("\n\t\t{");
                    messageId = cursor.getLong(0);
                    threadId = cursor.getLong(1);
                    number = cursor.getString(2);
                    long timestamp = cursor.getLong(4);

                    body = cursor.getString(5);
                    status = cursor.getInt(6);

                    read = cursor.getInt(index_Read);
                    person = cursor.getString(index_Person);

                    // Add links to URLs
                    body = body.replaceAll(
                        "(http://[^\\s]*)",
                        "<a href=\"$1\" target=\"_blank\" class='link'>$1</a>"
                    );

                    body =  body.replace("\n", "<br>").replace("\t", "    ").replace("\"", "\\\"");

                    print("\n\t\t\t\"person\" : \"" +  person + "\",\n\t\t\t\"read\" : \"" +  read + "\",\n\t\t\t\"number\" : \"" +  number + "\",\n\t\t\t\"date\" : \"" + DateFormat.getDateTimeInstance(
        DateFormat.MEDIUM, DateFormat.MEDIUM).format(new Date(timestamp)) + "\", \n\t\t\t\"message\" : \"" + body + "\""

                    );
                    print("\t\t}");
                    if (!cursor.isLast())  {
                        print(",");
                    }
                } while(cursor.moveToNext());
            }
        } finally {
            cursor.close();
        }
    }
    print("\t]}]");
</bsh>
{'fraction_non_alphanumeric': 0.1741731175228712, 'fraction_numerical': 0.006157635467980296, 'mean_word_length': 1.6879432624113475, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '5206076', 'n_tokens_mistral': 1764, 'n_tokens_neox': 1681, 'n_words': 281}