<commit_before>import octeon
import requests
PLUGINVERSION = 2
# Always name this variable as `plugin`
# If you dont, module loader will fail to load the plugin!
plugin = octeon.Plugin()
PORTINFO = """
Port <code>#%(port)s</code>
<b>Description</b>: <i>%(description)s</i>
<b>Status</b>: <i>%(status)s</i>
<b>TCP</b>:<i>%(tcp)s</i>
<b>UDP</b>:<i>%(udp)s</i>
"""
PORTLIST = requests.get("https://raw.githubusercontent.com/mephux/ports.json/master/ports.lists.json").json()
@plugin.command(command="/port",
                description="Sends information about port",
                inline_supported=True,
                hidden=False)
def port(bot, update, user, args):
    if " ".join(args) in PORTLIST:
        ports = []
        for port in PORTLIST[" ".join(args)]:
            ports.append(PORTINFO % port)
        return octeon.message(text="\nAlso may be:".join(ports), parse_mode="HTML")
    else:
        return octeon.message(text="No such port in database", failed=True)<commit_msg>Fixed bad symbols in ports<commit_after>import octeon
import requests
PLUGINVERSION = 2
# Always name this variable as `plugin`
# If you dont, module loader will fail to load the plugin!
plugin = octeon.Plugin()
PORTINFO = """
Port <code>#%(port)s</code>
<b>Description</b>: <i>%(description)s</i>
<b>Status</b>: <i>%(status)s</i>
<b>TCP</b>:<i>%(tcp)s</i>
<b>UDP</b>:<i>%(udp)s</i>
"""
PORTLIST = requests.get("https://raw.githubusercontent.com/mephux/ports.json/master/ports.lists.json").json()
@plugin.command(command="/port",
                description="Sends information about port",
                inline_supported=True,
                hidden=False)
def port(bot, update, user, args):
    if " ".join(args) in PORTLIST:
        ports = []
        for port in PORTLIST[" ".join(args)]:
            port["description"] = port["description"].replace("â€”", " ")
            ports.append(PORTINFO % port)
        return octeon.message(text="\nAlso may be:".join(ports), parse_mode="HTML")
    else:
        return octeon.message(text="No such port in database", failed=True)
{'fraction_non_alphanumeric': 0.17720907774022213, 'fraction_numerical': 0.0009657170449058426, 'mean_word_length': 3.5538461538461537, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 2, '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': '3049590', 'n_tokens_mistral': 692, 'n_tokens_neox': 668, 'n_words': 151}