# Path: flatland/util/signals.py
# ANY = symbol('ANY')
# ANY_ID = 0
#     ANY = ANY
# class Signal(object):
# class NamedSignal(Signal):
# class Namespace(object):
#     def __init__(self, doc=None):
#     def connect(self, receiver, sender=ANY, weak=True):
#     def send(self, sender=None, **kwargs):
#     def has_receivers_for(self, sender):
#     def receivers_for(self, sender):
#     def disconnect(self, receiver, sender=ANY):
#     def _disconnect(self, receiver_id, sender_id):
#     def _cleanup_receiver(self, receiver_ref):
#     def _cleanup_sender(self, sender_ref):
#     def _clear_state(self):
#     def __init__(self, name, doc=None):
#     def __repr__(self):
#     def __init__(self):
#     def signal(self, name, doc=None):
# def _hashable_identity(obj):


from flatland.util.signals import (
    ANY,
    ANY_ID,
    NamedSignal,
    Namespace,
    Signal,
    receiver_connected,
    )
from tests._util import eq_, assert_raises

    sig.connect(received, 'xyz')
    assert not sig.has_receivers_for(None)
    assert not sig.has_receivers_for(ANY)
    assert sig.has_receivers_for('xyz')

    class Object(object):
        pass
    o = Object()

    sig.connect(received, o)
    assert sig.has_receivers_for(o)

    del received
    assert not sig.has_receivers_for('xyz')
    assert list(sig.receivers_for('xyz')) == []
    assert list(sig.receivers_for(o)) == []

    sig.connect(lambda sender: None, weak=False)
    assert sig.has_receivers_for('xyz')
    assert sig.has_receivers_for(o)
    assert sig.has_receivers_for(None)
    assert sig.has_receivers_for(ANY)
    assert sig.has_receivers_for('xyz')


def test_instance_doc():
    sig = Signal(doc='x')
    assert sig.__doc__ == 'x'


# Path: flatland/util/signals.py
# ANY = symbol('ANY')
# ANY_ID = 0
#     ANY = ANY
# class Signal(object):
# class NamedSignal(Signal):
# class Namespace(object):
#     def __init__(self, doc=None):
#     def connect(self, receiver, sender=ANY, weak=True):
#     def send(self, sender=None, **kwargs):
#     def has_receivers_for(self, sender):
#     def receivers_for(self, sender):
#     def disconnect(self, receiver, sender=ANY):
#     def _disconnect(self, receiver_id, sender_id):
#     def _cleanup_receiver(self, receiver_ref):
#     def _cleanup_sender(self, sender_ref):
#     def _clear_state(self):
#     def __init__(self, name, doc=None):
#     def __repr__(self):
#     def __init__(self):
#     def signal(self, name, doc=None):
# def _hashable_identity(obj):


# Path: tests/test_signals.py
from flatland.util.signals import (
    ANY,
    ANY_ID,
    NamedSignal,
    Namespace,
    Signal,
    receiver_connected,
    )
from tests._util import eq_, assert_raises


    sig.connect(received, 'xyz')
    assert not sig.has_receivers_for(None)
    assert not sig.has_receivers_for(ANY)
    assert sig.has_receivers_for('xyz')

    class Object(object):
        pass
    o = Object()

    sig.connect(received, o)
    assert sig.has_receivers_for(o)

    del received
    assert not sig.has_receivers_for('xyz')
    assert list(sig.receivers_for('xyz')) == []
    assert list(sig.receivers_for(o)) == []

    sig.connect(lambda sender: None, weak=False)
    assert sig.has_receivers_for('xyz')
    assert sig.has_receivers_for(o)
    assert sig.has_receivers_for(None)
    assert sig.has_receivers_for(ANY)
    assert sig.has_receivers_for('xyz')


def test_instance_doc():
    sig = Signal(doc='x')
    assert sig.__doc__ == 'x'


    sig = Signal('x')