def __init__(self, name, transform=None):
        """'name' must be unique across all channels.

        'transform' is a function that can either filter or
        transform a message. If the function returns 'None', the
        message is filtered (ignored). The function is called with
        first parameter set to channel name and second parameter set
        to the message.
        """

        if not Channel._asyncoro:
            Channel._asyncoro = AsynCoro.instance()
        self._name = name
        self._location = Channel._asyncoro._location
        if transform is not None:
            try:
                argspec = inspect.getargspec(transform)
                assert len(argspec.args) == 2
            except:
                logger.warning('invalid "transform" function ignored')
                transform = None
        self._transform = transform
        self._subscribers = set()
        self._subscribe_event = Event()
        Channel._asyncoro._lock.acquire()
        if name in Channel._asyncoro._channels:
            Channel._asyncoro._lock.release()
            logger.warning('duplicate channel "%s"!', name)
        else:
            Channel._asyncoro._channels[name] = self
            Channel._asyncoro._lock.release()
dataset/ETHPy150Open pgiri/asyncoro/py2/asyncoro/__init__.py/Channel.__init__/original