Return true if `cb` has been decorated with
    :func:`inbound_presence_filter`.
422894
def is_inbound_presence_filter(cb):
    

    try:
        handlers = get_magic_attr(cb)
    except AttributeError:
        return False

    hs = HandlerSpec(
        (_apply_inbound_presence_filter, ())
    )

    return hs in handlers
1098096
def is_active(self):
        """"""
        if self._queue.exhausted:
            return False
        return any(ch.is_active for ch in self._refs.values())
252027
def isPeBounded(self):
        
        boundImportsDir = self.ntHeaders.optionalHeader.dataDirectory[consts.BOUND_IMPORT_DIRECTORY]
        if boundImportsDir.rva.value and boundImportsDir.size.value:
            return True
        return False
573649
def matches(self, client, event_data):
        """"""

        for f in self.filters:
            if not f(client, event_data):
                return False

        return True
658718
def visible(self):
        
        if not self.in_workspace():
            return False

        if not self.context.join_policy == "self":
            return False

        user = api.user.get_current()
        workspace = IWorkspace(self.context.acquire_workspace())
        if user.getUserName() in workspace.members:
            return False

        return True
584000
def _(s: Influence) -> bool:
    
    return is_grounded(s.subj) and is_grounded(s.obj)
183694
def connected(self, *, presence=structs.PresenceState(False), **kwargs):
        
        return UseConnected(self, presence=presence, **kwargs)
1131705
def is_flagged(self, user=None, status=None):
        
        filter_kwargs = {
            'content_type': ContentType.objects.get_for_model(self),
            'object_id': self.id,
        }
        update_filter_dict(filter_kwargs, user, status)
        return self.flags.filter(**filter_kwargs).count()
1336962
def check_hook_mechanism_is_intact(module):
    
    result = True
    if check_register_present(module):
        result = not result
    if check_deregister_present(module):
        result = not result
    return result
211827
def _inbound(self, From, to, protocol, udp_source=None):
        
        # Verify stuff!

        self.verifyCertificateAllowed(to, From)
        return self.service.verifyHook(From, to, protocol
                                       ).addCallback(self._inboundimpl,
                                                     From,
                                                     to,
                                                     protocol,
                                                     udp_source).addErrback(
            lambda f: f.trap(KeyError) and dict(listeners=[]))
1001651
def instance_contains(container, item):
    """"""
    return item in (member for _, member in inspect.getmembers(container))
726309
public boolean isInBounds( int c_x , int c_y ) {
		return BoofMiscOps.checkInside(image, c_x, c_y, radiusWidth, radiusHeight);
	}
722378
def related_to(self, entry, live_only=False):
        
        filters = {'tag__in': entry.tags}

        if live_only:
            filters.update({'entry__live': True})

        return self.filter(**filters).exclude(entry=entry)
1161281
def ivorn_present(session, ivorn):
    
    return bool(
        session.query(Voevent.id).filter(Voevent.ivorn == ivorn).count())
1177471
def not_called_with(self, *args, **kwargs):
        
        call = Call(*args, **kwargs)
        if call in calls(self.spy):
            raise VerificationError(
                'expected %s to not be called with %s, but it was' % (
                    self.spy, call.formatted_args))
        return True
312486
def has_active_condition(self, condition, instances):
        
        return_value = None
        for instance in instances + [None]:
            if not self.can_execute(instance):
                continue
            result = self.is_active(instance, condition)
            if result is False:
                return False
            elif result is True:
                return_value = True
        return return_value
359820
def hassuggestions(self,allowempty=False):
        """"""
        for e in self.select(Suggestion,None,False, False):
            if not allowempty and len(e) == 0: continue
            return True
        return False