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

"""'info' module contains Pyslvs program information."""

__all__ = [
    'KERNELS',
    'SYS_INFO',
    'ARGUMENTS',
    'HAS_SLVS',
    'Kernel',
    'check_update',
    'PyslvsAbout',
    'html',
    'logger',
    'XStream',
    'size_format',
]
__author__ = "<NAME>"
__copyright__ = "Copyright (C) 2016-2020"
__license__ = "AGPL"
__email__ = "<EMAIL>"

from .info import KERNELS, SYS_INFO, ARGUMENTS, HAS_SLVS, Kernel
from .about import PyslvsAbout, html, check_update
from .logging_handler import logger, XStream


def size_format(num: float) -> str:
    if num <= 0:
        return "0 B"
    for u in ('', 'K', 'M', 'G', 'T', 'P', 'E', 'Z'):
        if abs(num) < 1024:
            return f"{num:3.1f} {u}B"
        num /= 1024
    return f"{num:.1f} YB"
<commit_msg>Add missing docstring.<commit_after># -*- coding: utf-8 -*-

"""'info' module contains Pyslvs program information."""

__all__ = [
    'KERNELS',
    'SYS_INFO',
    'ARGUMENTS',
    'HAS_SLVS',
    'Kernel',
    'check_update',
    'PyslvsAbout',
    'html',
    'logger',
    'XStream',
    'size_format',
]
__author__ = "<NAME>"
__copyright__ = "Copyright (C) 2016-2020"
__license__ = "AGPL"
__email__ = "<EMAIL>"

from .info import KERNELS, SYS_INFO, ARGUMENTS, HAS_SLVS, Kernel
from .about import PyslvsAbout, html, check_update
from .logging_handler import logger, XStream


def size_format(num: float) -> str:
    """Calculate file size."""
    if num <= 0:
        return "0 B"
    for u in ('', 'K', 'M', 'G', 'T', 'P', 'E', 'Z'):
        if abs(num) < 1024:
            return f"{num:3.1f} {u}B"
        num /= 1024
    return f"{num:.1f} YB"

{'fraction_non_alphanumeric': 0.17647058823529413, 'fraction_numerical': 0.026410564225690276, 'mean_word_length': 2.931603773584906, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '743578', 'n_tokens_mistral': 674, 'n_tokens_neox': 634, 'n_words': 167}