Checks if a logged event is to be muted for debugging purposes.

    Also goes through the solo list - only items in there will be logged!

    :param what:
    :return:
335
def is_muted(what):
    

    state = False

    for item in solo:
        if item not in what:
            state = True
        else:
            state = False
            break

    for item in mute:
        if item in what:
            state = True
            break

    return state
253729
def is_active(self):
    
    return bool(
        self._grpc_port is not None and
        self._event_multiplexer and
        self._event_multiplexer.PluginRunToTagToContent(
            constants.DEBUGGER_PLUGIN_NAME))
1293016
def check_program(name):
    
    with open(os.devnull, "w") as null:
        try:
            subprocess.check_call(("which", name), stdout=null, stderr=null)
        except subprocess.CalledProcessError as e:
            return False
    return True
706029
def _on_group_mute(self, data):
        """"""
        self._groups.get(data.get('id')).update_mute(data)
19423
def debug(self, on: bool = True) -> None:
        
        if on:
            self.send_line("debug on")
        else:
            self.send_line("debug off")
1030105
def filter(self, event):
        
        if not self.resolved:
            return None

        if self.chats is not None:
            # Note: the `event.chat_id` property checks if it's `None` for us
            inside = event.chat_id in self.chats
            if inside == self.blacklist_chats:
                # If this chat matches but it's a blacklist ignore.
                # If it doesn't match but it's a whitelist ignore.
                return None

        if not self.func or self.func(event):
            return event
786044
def debug(mode=True):
    
    global DEBUG
    if mode: warnings.simplefilter('default')
    DEBUG = bool(mode)
15208
def _get_event_status(self, message):
        
        status = None

        if message.event_status == LRR_EVENT_STATUS.TRIGGER:
            status = True
        elif message.event_status == LRR_EVENT_STATUS.RESTORE:
            status = False

        return status
456665
def get_speaker_muted(self):
        """"""
        if not self.camera_extended_properties:
            return None

        speaker = self.camera_extended_properties.get('speaker')
        if not speaker:
            return None

        return speaker.get('mute')
983693
public boolean checkIdle (long idleStamp)
    {
        if (_lastEvent > idleStamp) {
            return false;
        }
        if (!isClosed()) {
            log.info("Disconnecting non-communicative client",
                     "conn", this, "idle", (System.currentTimeMillis() - _lastEvent) + "ms");
        }
        return true;
    }
959001
def loggable(obj):
    
    if isinstance(obj, logging.Logger):
        return True
    else:
        return (inspect.isclass(obj)
                and inspect.ismethod(getattr(obj, 'debug', None))
                and inspect.ismethod(getattr(obj, 'isEnabledFor', None))
                and inspect.ismethod(getattr(obj, 'setLevel', None)))
969705
def muted_me(self, account=None, limit=100):
        ''' 
        '''
        self.has_muted = []
        if account is None:
            account = self.mainaccount
        following = self.following(account, limit)
        if following is False:
            self.msg.error_message("COULD NOT GET FOLLOWING FOR MUTED")
            return False
        for f in following:
            h = self.get_my_history(f)
            for a in h:
                if a[1]['op'][0] == "custom_json":
                    j = a[1]['op'][1]['json']
                    d = json.loads(j)
                    try:
                        d[1]
                    except:
                        pass
                    else:
                        for i in d[1]:
                            if i == "what":
                                if len(d[1]['what']) > 0:
                                    if d[1]['what'][0] == "ignore":
                                        if d[1]['follower'] == account:
                                            self.msg.message("MUTED BY " + f)
                                            self.has_muted.append(f)
        return self.has_muted
1303649
def check_status(self, ignore=(), status=None):
        
        self.SHARD_CHECKS = [
            {'check_msg': 'Bad Core Count Check', 'f': self._check_shard_count},
            {'check_msg': 'Bad Shard Cluster Status', 'f': self._check_shard_status}
        ]
        if status is None:
            status = self.clusterstatus()
        out = {}
        for collection in status:
            out[collection] = {}
            out[collection]['coll_status'] = True  # Means it's fine
            out[collection]['coll_messages'] = []
            for shard in status[collection]:
                self.logger.debug("Checking {}/{}".format(collection, shard))
                s_dict = status[collection][shard]
                for check in self.SHARD_CHECKS:
                    if check['check_msg'] in ignore:
                        continue
                    res = check['f'](s_dict)
                    if not res:
                        out[collection]['coll_status'] = False
                        if check['check_msg'] not in out[collection]['coll_messages']:
                            out[collection]['coll_messages'].append(check['check_msg'])
                        self.logger.debug(s_dict)
        return out
1198044
def _is_ignored_read_event(request):
    
    if (
        django.conf.settings.LOG_IGNORE_TRUSTED_SUBJECT
        and d1_gmn.app.auth.is_trusted_subject(request)
    ):
        return True
    if (
        django.conf.settings.LOG_IGNORE_NODE_SUBJECT
        and d1_gmn.app.auth.is_client_side_cert_subject(request)
    ):
        return True
    if _has_regex_match(
        request.META['REMOTE_ADDR'], django.conf.settings.LOG_IGNORE_IP_ADDRESS
    ):
        return True
    if _has_regex_match(
        request.META.get('HTTP_USER_AGENT', '<not provided>'),
        django.conf.settings.LOG_IGNORE_USER_AGENT,
    ):
        return True
    if _has_regex_match(
        request.primary_subject_str, django.conf.settings.LOG_IGNORE_SUBJECT
    ):
        return True
    return False
935528
def postponed_from_when(self):
        
        what = self.what
        if what:
            return _("{what} from {when}").format(what=what,
                                                  when=self.cancellationpage.when)
499402
def muteThreadMentions(self, mute=True, thread_id=None):
        
        thread_id, thread_type = self._getThread(thread_id, None)
        data = {"mentions_mute_mode": int(mute), "thread_fbid": thread_id}
        r = self._post(self.req_url.MUTE_MENTIONS, data, fix_request=True)
667326
def mute(self):
        

        response = self.renderingControl.GetMute([
            ('InstanceID', 0),
            ('Channel', 'Master')
        ])
        mute_state = response['CurrentMute']
        return bool(int(mute_state))