<commit_before>#!/usr/bin/env python

import dbus
import dbus.service
if getattr(dbus, 'version', (0,0,0)) >= (0,41,0):
    import dbus.glib
import gobject
import time

CONN_MGR_INTERFACE = 'org.freedesktop.telepathy.ConnectionManager'
CONN_MGR_OBJECT = '/org/freedesktop/telepathy/ConnectionManager'
CONN_MGR_SERVICE = 'org.freedesktop.telepathy.ConnectionManager'

CONN_INTERFACE = 'org.freedesktop.telepathy.Connection'
CONN_OBJECT = '/org/freedesktop/telepathy/Connection'
CONN_SERVICE = 'org.freedesktop.telepathy.Connection'

CHANNEL_INTERFACE = 'org.freedesktop.telepathy.Channel'
TEXT_CHANNEL_INTERFACE = 'org.freedesktop.telepathy.TextChannel'
LIST_CHANNEL_INTERFACE = 'org.freedesktop.telepathy.ListChannel'

INDIVIDUAL_CHANNEL_INTERFACE = 'org.freedesktop.telepathy.IndividualChannelInterface'
GROUP_CHANNEL_INTERFACE = 'org.freedesktop.telepathy.GroupChannelInterface'
NAMED_CHANNEL_INTERFACE = 'org.freedesktop.telepathy.NamedChannelInterface'
PRESENCE_CHANNEL_INTERFACE = 'org.freedesktop.telepathy.PresenceChannelInterface'
SUBJECT_CHANNEL_INTERFACE = 'org.freedesktop.telepathy.SubjectChannelInterface'

class Channel(dbus.service.Object):
    """
    Base type for all Channels.
    """
    count = 0

    def __init__(self, connection, type):
        """
        Channel constructor. 
        Paramters:
        connection - the parent Connection object
        type - 
        """
        self.conn = conn
        self.object_path = self.conn.object_path+'/channel'+str(Channel.count)
        Channel.count += 1
        dbus.service.Object.__init__(self, self.conn.bus_name, self.object_path)

        self.type = type
        self.interfaces = set()
        self.members = set()

    @dbus.service.method(CHANNEL_INTERFACE, in_signature="", out_signature="")
    def Close(self):
        """ Close this channel. """
        pass

    @dbus.service.signal(CHANNEL_INTERFACE, signature="")
    def Closed(self):
        """ Emitted when this channel is closed. """
        print 'object_path: %s signal: Closed' % (self.object_path)

    @dbus.service.method(CHANNEL_INTERFACE, in_signature="", out_signature="s")
    def GetType(self):
        """ Returns an interface name for the type of this channel """
        return dbus.String(self.type)

    @dbus.service.method(CHANNEL_INTERFACE, in_signature="", out_signature="as")<commit_msg>fix mismatched prototype<commit_after>#!/usr/bin/env python

import dbus
import dbus.service
if getattr(dbus, 'version', (0,0,0)) >= (0,41,0):
    import dbus.glib
import gobject
import time

CONN_MGR_INTERFACE = 'org.freedesktop.telepathy.ConnectionManager'
CONN_MGR_OBJECT = '/org/freedesktop/telepathy/ConnectionManager'
CONN_MGR_SERVICE = 'org.freedesktop.telepathy.ConnectionManager'

CONN_INTERFACE = 'org.freedesktop.telepathy.Connection'
CONN_OBJECT = '/org/freedesktop/telepathy/Connection'
CONN_SERVICE = 'org.freedesktop.telepathy.Connection'

CHANNEL_INTERFACE = 'org.freedesktop.telepathy.Channel'
TEXT_CHANNEL_INTERFACE = 'org.freedesktop.telepathy.TextChannel'
LIST_CHANNEL_INTERFACE = 'org.freedesktop.telepathy.ListChannel'

INDIVIDUAL_CHANNEL_INTERFACE = 'org.freedesktop.telepathy.IndividualChannelInterface'
GROUP_CHANNEL_INTERFACE = 'org.freedesktop.telepathy.GroupChannelInterface'
NAMED_CHANNEL_INTERFACE = 'org.freedesktop.telepathy.NamedChannelInterface'
PRESENCE_CHANNEL_INTERFACE = 'org.freedesktop.telepathy.PresenceChannelInterface'
SUBJECT_CHANNEL_INTERFACE = 'org.freedesktop.telepathy.SubjectChannelInterface'

class Channel(dbus.service.Object):
    """
    Base type for all Channels.
    """
    count = 0

    def __init__(self, connection, type):
        """
        Channel constructor. 
        Paramters:
        connection - the parent Connection object
        type - 
        """
        self.conn = connection
        self.object_path = self.conn.object_path+'/channel'+str(Channel.count)
        Channel.count += 1
        dbus.service.Object.__init__(self, self.conn.bus_name, self.object_path)

        self.type = type
        self.interfaces = set()
        self.members = set()

    @dbus.service.method(CHANNEL_INTERFACE, in_signature="", out_signature="")
    def Close(self):
        """ Close this channel. """
        pass

    @dbus.service.signal(CHANNEL_INTERFACE, signature="")
    def Closed(self):
        """ Emitted when this channel is closed. """
        print 'object_path: %s signal: Closed' % (self.object_path)

    @dbus.service.method(CHANNEL_INTERFACE, in_signature="", out_signature="s")
    def GetType(self):
        """ Returns an interface name for the type of this channel """
        return dbus.String(self.type)

    @dbus.service.method(CHANNEL_INTERFACE, in_signature="", out_signature="as")
{'fraction_non_alphanumeric': 0.11329528640879306, 'fraction_numerical': 0.003804692454026633, 'mean_word_length': 4.093649085037675, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6465458', 'n_tokens_mistral': 1508, 'n_tokens_neox': 1453, 'n_words': 255}