<commit_before>#!/usr/bin/env python
"""
Example of running the Python REPL through an SSH connection in an asyncio process.

This requires Python 3.
"""
import asyncio
import asyncssh
import logging

from ptpython.contrib.asyncssh_repl import ReplSSHServerSession

logging.basicConfig()
logging.getLogger().setLevel(logging.INFO)


class MySSHServer(asyncssh.SSHServer):
    """
    Server without authentication, running `ReplSSHServerSession`.
    """
    def __init__(self, get_namespace):
        self.get_namespace = get_namespace

    def begin_auth(self, username):
        return False

    def session_requested(self):
        return ReplSSHServerSession(self.get_namespace)


def main(port=8222):
    """
    Example that starts the REPL through an SSH server.
    """
    loop = asyncio.get_event_loop()<commit_msg>More documentation for asyncio-ssh-python-embed.py.<commit_after>#!/usr/bin/env python
"""
Example of running the Python REPL through an SSH connection in an asyncio process.
This requires Python 3, asyncio and asyncssh.

Run this example and then SSH to localhost, port 8222.
"""
import asyncio
import asyncssh
import logging

from ptpython.contrib.asyncssh_repl import ReplSSHServerSession

logging.basicConfig()
logging.getLogger().setLevel(logging.INFO)


class MySSHServer(asyncssh.SSHServer):
    """
    Server without authentication, running `ReplSSHServerSession`.
    """
    def __init__(self, get_namespace):
        self.get_namespace = get_namespace

    def begin_auth(self, username):
        # No authentication.
        return False

    def session_requested(self):
        return ReplSSHServerSession(self.get_namespace)


def main(port=8222):
    """
    Example that starts the REPL through an SSH server.
    """
    loop = asyncio.get_event_loop()
{'fraction_non_alphanumeric': 0.0867630700778643, 'fraction_numerical': 0.00778642936596218, 'mean_word_length': 3.9833795013850417, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1867530', 'n_tokens_mistral': 548, 'n_tokens_neox': 514, 'n_words': 149}