<commit_before>"""Python Remote Objects support - Client side"""

# Copyright (c) 2002 <NAME>.  Distributed under the terms of the
# GNU Lesser General Public License (LGPL).

import string, socket
import VisionEgg

__version__ = VisionEgg.release_name
__cvs__ = string.split('$Revision$')[1]
__date__ = string.join(string.split('$Date$')[1:3], ' ')
__author__ = '<NAME> <<EMAIL>>'

import Pyro.core

class PyroClient:
    """Simplifies getting PyroControllers from a remote computer."""
    def __init__(self,server_hostname='',server_port=7766):
        """Initialize Pyro client."""
        Pyro.core.initClient()
        self.server_hostname = socket.getfqdn(server_hostname)
        self.server_port = server_port

    def get(self,name):
        """Return a remote Pyro object being served by Pyro server."""
        URI = "PYROLOC://%s:%d/%s" % (self.server_hostname, self.server_port, name)
        return Pyro.core.getProxyForURI(URI)
<commit_msg>Minor: don't resolve fqdn unless asked<commit_after>"""Python Remote Objects support - Client side"""

# Copyright (c) 2002 <NAME>.  Distributed under the terms of the
# GNU Lesser General Public License (LGPL).

import string, socket
import VisionEgg

__version__ = VisionEgg.release_name
__cvs__ = string.split('$Revision$')[1]
__date__ = string.join(string.split('$Date$')[1:3], ' ')
__author__ = '<NAME> <<EMAIL>>'

import Pyro.core

# Use Python's bool constants if available, make aliases if not
try:
    True
except NameError:
    True = 1==1
    False = 1==0

class PyroClient:
    """Simplifies getting PyroControllers from a remote computer."""
    def __init__(self,server_hostname='',server_port=7766,lookup_fqdn=False):
        """Initialize Pyro client."""
        Pyro.core.initClient()
        if lookup_fqdn:
            self.server_hostname = socket.getfqdn(server_hostname)
        else:
            self.server_hostname = server_hostname
        self.server_port = server_port

    def get(self,name):
        """Return a remote Pyro object being served by Pyro server."""
        URI = "PYROLOC://%s:%d/%s" % (self.server_hostname, self.server_port, name)
        return Pyro.core.getProxyForURI(URI)

{'fraction_non_alphanumeric': 0.12626262626262627, 'fraction_numerical': 0.011937557392102846, 'mean_word_length': 3.8101545253863134, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4180707', 'n_tokens_mistral': 700, 'n_tokens_neox': 691, 'n_words': 180}