<commit_before>#!/usr/bin/env python3

import glob
import logging
import os
import sys

from rofi import Rofi

CURRENT_SCRIPT_NAME = os.path.splitext(os.path.basename(__file__))[0]
LOG_FORMAT = ('[%(asctime)s PID %(process)s '
              '%(filename)s:%(lineno)s - %(funcName)s()] '
              '%(levelname)s -> \n'
              '%(message)s\n')
# Configure the logging to console. Works from python 3.3+
logging.basicConfig(
    format=LOG_FORMAT,
    level=logging.INFO,
    handlers=[logging.StreamHandler(sys.stdout)]
)

def get_shortcuts():
    shortcuts_list = []
    filename = '/storage/src/dot_files/.vimrc'
    with open(filename, 'r') as input_file:
        lines = input_file.readlines()
    for line in lines:
        if line.replace('\n', '') and ('| "' in line):
            shortcut, description = line.split('| "')
            if shortcut and description:
                shortcuts_list.append(f'{description.strip()} => {shortcut.strip()}')
    return sorted(shortcuts_list)<commit_msg>Updated vim shortcuts.<commit_after>#!/usr/bin/env python3

import glob
import logging
import os
import sys

from rofi import Rofi

CURRENT_SCRIPT_NAME = os.path.splitext(os.path.basename(__file__))[0]
LOG_FORMAT = ('[%(asctime)s PID %(process)s '
              '%(filename)s:%(lineno)s - %(funcName)s()] '
              '%(levelname)s -> \n'
              '%(message)s\n')
# Configure the logging to console. Works from python 3.3+
logging.basicConfig(
    format=LOG_FORMAT,
    level=logging.INFO,
    handlers=[logging.StreamHandler(sys.stdout)]
)

def get_shortcuts():
    shortcuts_list = []
    filename = '/storage/src/dot_files/.vimrc'
    with open(filename, 'r') as input_file:
        lines = input_file.readlines()
    for line in lines:
        if line.replace('\n', '') and ('| "' in line):
            shortcut, description = line.split('| "')
            if shortcut and description:
                _shortcut = shortcut[1:].strip() if shortcut.startswith('"') else shortcut.strip()
                shortcuts_list.append(f'{description.strip()} => {_shortcut}')
    return sorted(shortcuts_list)
{'fraction_non_alphanumeric': 0.14790390956194066, 'fraction_numerical': 0.004239284032030146, 'mean_word_length': 3.015122873345936, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5247941', 'n_tokens_mistral': 708, 'n_tokens_neox': 686, 'n_words': 147}