<commit_before>(function (env) {
    'use strict';
    env.ddg_spice_keybase = function(api_result){

        if (!api_result || api_result.error || api_result.status.code != 0) {
            return Spice.failed('keybase');
        }

        var user;

        if (api_result.them.constructor == Array) {
            user = api_result.them[0];
        } else {
            user = api_result.them;
        }

        if (user == null) {
            return Spice.failed('keybase');
        }

        // Retrieve 64-bit version of fingerprint
        function keybase_key_fingerprint(fingerprint) {
            var output = '';

            if (fingerprint.length != 40 || !fingerprint) {
                return output;
            }

            var pos = fingerprint.length - 16;

            for (pos; pos < fingerprint.length; pos += 4) {
                output += fingerprint.substring(pos, pos + 4).toUpperCase() + ' ';
            }

            return output;
        }

        Spice.add({
            id: 'keybase',
            name: 'Keybase',
            data: user,
            meta: {
                sourceName: 'keybase.io',
                sourceUrl: 'https://keybase.io/' + user.basics.username
            },
            normalize: function(item) {
                return {
                    image: item.pictures.primary.url,
                    title: item.profile.full_name,
                    subtitle: item.profile.location,
                    altSubtitle: [{
                        text: keybase_key_fingerprint(item.public_keys.primary.key_fingerprint),
                        href: 'https://keybase.io/' + item.basics.username + '/key.asc'
                    }],
                    description: item.profile.bio
                }
            },
            templates: {
                group: 'icon',
                options: {
                    moreAt: true
                },
                variants: {
                    iconTitle: 'large',
                    iconImage: 'large'
                }
            },<commit_msg>Keybase - Add url to IA title<commit_after>(function (env) {
    'use strict';
    env.ddg_spice_keybase = function(api_result){

        if (!api_result || api_result.error || api_result.status.code != 0) {
            return Spice.failed('keybase');
        }

        var user;

        if (api_result.them.constructor == Array) {
            user = api_result.them[0];
        } else {
            user = api_result.them;
        }

        if (user == null) {
            return Spice.failed('keybase');
        }

        // Retrieve 64-bit version of fingerprint
        function keybase_key_fingerprint(fingerprint) {
            var output = '';

            if (fingerprint.length != 40 || !fingerprint) {
                return output;
            }

            var pos = fingerprint.length - 16;

            for (pos; pos < fingerprint.length; pos += 4) {
                output += fingerprint.substring(pos, pos + 4).toUpperCase() + ' ';
            }

            return output;
        }

        Spice.add({
            id: 'keybase',
            name: 'Keybase',
            data: user,
            meta: {
                sourceName: 'keybase.io',
                sourceUrl: 'https://keybase.io/' + user.basics.username
            },
            normalize: function(item) {
                return {
                    image: item.pictures.primary.url,
                    title: item.profile.full_name,
                    url: 'https://keybase.io/' + item.basics.username,
                    subtitle: item.profile.location,
                    altSubtitle: [{
                        text: keybase_key_fingerprint(item.public_keys.primary.key_fingerprint),
                        href: 'https://keybase.io/' + item.basics.username + '/key.asc'
                    }],
                    description: item.profile.bio
                }
            },
            templates: {
                group: 'icon',
                options: {
                    moreAt: true
                },
                variants: {
                    iconTitle: 'large',
                    iconImage: 'large'
                }
            },
{'fraction_non_alphanumeric': 0.1103202846975089, 'fraction_numerical': 0.004744958481613286, 'mean_word_length': 1.1554192229038855, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 5, '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': '2244358', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1057, 'n_words': 210}