<commit_before>
from common.rpc import RpcClient

class RemoteManager(RpcClient):
    """
    Labtronyx Remote Instrument Manager
    
    Subclass of RpcClient
    
    .. note::
       
       InstrumentManager must be running on the computer that you
       are trying to connect to. :func:`InstrumentControl.startManager` can be
       used to spawn a new process of InstrumentManager.
    """
    resources = {}
    
    def __init__(self, address, port=6780, **kwargs):
        RpcClient.__init__(self, address, port, **kwargs)
        
        self._enableNotifications()
        #self._registerCallback('event_new_resource', lambda: self.cb_event_new_resource())
        
    def disconnect(self):
        self._disconnect()
        
    def refreshResources(self):
        """
        Query the InstrumentManager resources and create RemoteResource objects
        for new resources
        """
        self.refresh()
        prop = self.getProperties()
        
        for res_uuid, res_dict in prop.items():
            if res_uuid not in self.resources:
                address = res_dict.get('address')
                port = res_dict.get('port')<commit_msg>bug fix<commit_after>
from common.rpc import *

class RemoteManager(RpcClient):
    """
    Labtronyx Remote Instrument Manager
    
    Subclass of RpcClient
    
    .. note::
       
       InstrumentManager must be running on the computer that you
       are trying to connect to. :func:`InstrumentControl.startManager` can be
       used to spawn a new process of InstrumentManager.
    """
    resources = {}
    
    def __init__(self, address, port=6780, **kwargs):
        RpcClient.__init__(self, address, port, **kwargs)
        
        self._enableNotifications()
        #self._registerCallback('event_new_resource', lambda: self.cb_event_new_resource())
        
    def stop(self):
        pass
        
    def disconnect(self):
        self._disconnect()
        
    def refreshResources(self):
        """
        Query the InstrumentManager resources and create RemoteResource objects
        for new resources
        """
        self.refresh()
        prop = self.getProperties()
        
        for res_uuid, res_dict in prop.items():
            if res_uuid not in self.resources:
                address = res_dict.get('address')
                port = res_dict.get('port')
{'fraction_non_alphanumeric': 0.0851602023608769, 'fraction_numerical': 0.003372681281618887, 'mean_word_length': 2.164, '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': '7456251', 'n_tokens_mistral': 630, 'n_tokens_neox': 613, 'n_words': 176}