Determin whether the given tuple is a ZPK-format filter definition

    Returns
    -------
    iszpk : `bool`
        `True` if the ``zpktup`` looks like a ZPK-format filter definition,
        otherwise `False`
339887
def is_zpk(zpktup):
    
    return (
        isinstance(zpktup, (tuple, list)) and
        len(zpktup) == 3 and
        isinstance(zpktup[0], (list, tuple, numpy.ndarray)) and
        isinstance(zpktup[1], (list, tuple, numpy.ndarray)) and
        isinstance(zpktup[2], float))
985812
def get_pks_for_filter(self, key, filter_type, value):
        
        start, end, exclude = self.get_boundaries(filter_type, value)
        members = self.connection.zrangebylex(key, start, end)
        if exclude is not None:
            # special case where we don't want the exact given value, but we cannot
            # exclude it from the sorted set directly
            return [
                member_pk
                for member_value, member_pk in
                [self._extract_value_from_storage(member) for member in members]
                if member_value != exclude
            ]
        else:
            return [self._extract_value_from_storage(member)[-1] for member in members]
1174134
def compile_filter(bpf_filter, iface=None):
    
    if not TCPDUMP:
        raise Scapy_Exception("tcpdump is not available. Cannot use filter !")
    try:
        process = subprocess.Popen([
            conf.prog.tcpdump,
            "-p",
            "-i", (conf.iface if iface is None else iface),
            "-ddd",
            "-s", str(MTU),
            bpf_filter],
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE
        )
    except OSError as ex:
        raise Scapy_Exception("Failed to attach filter: %s" % ex)
    lines, err = process.communicate()
    ret = process.returncode
    if ret:
        raise Scapy_Exception(
            "Failed to attach filter: tcpdump returned: %s" % err
        )
    lines = lines.strip().split(b"\n")
    return get_bpf_pointer(lines)
441
def _homogenize_data_filter(dfilter):
    
    if isinstance(dfilter, tuple) and (len(dfilter) == 1):
        dfilter = (dfilter[0], None)
    if (dfilter is None) or (dfilter == (None, None)) or (dfilter == (None,)):
        dfilter = (None, None)
    elif isinstance(dfilter, dict):
        dfilter = (dfilter, None)
    elif isinstance(dfilter, (list, str)) or (
        isinstance(dfilter, int) and (not isinstance(dfilter, bool))
    ):
        dfilter = (None, dfilter if isinstance(dfilter, list) else [dfilter])
    elif isinstance(dfilter[0], dict) or (
        (dfilter[0] is None) and (not isinstance(dfilter[1], dict))
    ):
        pass
    else:
        dfilter = (dfilter[1], dfilter[0])
    return dfilter
386749
def is_api_filter(self, filter_field):
        """"""
        if self.filter_type == 'server':
            for choice in self.filter_choices:
                if (choice[0] == filter_field and len(choice) > 2 and
                        choice[2]):
                    return True
        return False
246114
def iseof(self):
        """"""
        succ = windll.kernel32.PeekNamedPipe(
            self.conout_pipe, None, None, None, None, None
        )
        return not bool(succ)
1360665
private boolean checkFiltered() {	
		if ((this.hocr.getMetaDataFilter()==null) || (this.hocr.getMetaDataFilter().size()==0)) { // if no filter is defined it does match by definition
			return true;
		}
		if (this.currentWorkbook instanceof XSSFWorkbook) {
			return checkFilteredXSSF();
		} else if (this.currentWorkbook instanceof HSSFWorkbook) {
			return checkFilteredHSSF();
		} else	{
			LOG.error("Unknown workbook format. Cannot check if document matches metadata filter");
			return false;
		}
	}
829842
def is_named_tuple(cls):
    """"""
    b = cls.__bases__
    if len(b) != 1 or b[0] != tuple:
        return False
    f = getattr(cls, "_fields", None)
    if not isinstance(f, tuple):
        return False
    return all(type(n) == str for n in f)
589017
def isfld(xmethod, dmethod, opt):
    

    fld = ['Iter', 'ObjFun', 'DFid', 'RegL1', 'Cnstr']
    if xmethod == 'admm':
        fld.extend(['XPrRsdl', 'XDlRsdl', 'XRho'])
    else:
        if opt['CBPDN', 'BackTrack', 'Enabled']:
            fld.extend(['X_F_Btrack', 'X_Q_Btrack', 'X_ItBt', 'X_L',
                        'X_Rsdl'])
        else:
            fld.extend(['X_L', 'X_Rsdl'])
    if dmethod != 'fista':
        fld.extend(['DPrRsdl', 'DDlRsdl', 'DRho'])
    else:
        if opt['CCMOD', 'BackTrack', 'Enabled']:
            fld.extend(['D_F_Btrack', 'D_Q_Btrack', 'D_ItBt', 'D_L',
                        'D_Rsdl'])
        else:
            fld.extend(['D_L', 'D_Rsdl'])
    fld.append('Time')
    return fld
1311528
def _validate_filter(self, keys, filterset_class):
        
        for k in keys:
            if ((not filterset_class) or (k not in filterset_class.base_filters)):
                raise ValidationError("invalid filter[{}]".format(k))
1238186
def isMemberOf(self, schemas):
        
        if type(schemas) not in (tuple, list, set):
            schemas = (schemas,)

        for schema in schemas:
            if schema.hasColumn(self):
                return True
        return False
823245
def match_tuple(self):
        
        assert self.flow_format() == ofproto_v1_0.NXFF_OPENFLOW10
        wildcards = ofproto_v1_0.OFPFW_ALL

        if not self.wc.wildcards & FWW_IN_PORT:
            wildcards &= ~ofproto_v1_0.OFPFW_IN_PORT

        if self.flow.dl_src != mac.DONTCARE:
            wildcards &= ~ofproto_v1_0.OFPFW_DL_SRC

        if self.flow.dl_dst != mac.DONTCARE:
            wildcards &= ~ofproto_v1_0.OFPFW_DL_DST

        if not self.wc.wildcards & FWW_DL_TYPE:
            wildcards &= ~ofproto_v1_0.OFPFW_DL_TYPE

        if self.flow.dl_vlan != 0:
            wildcards &= ~ofproto_v1_0.OFPFW_DL_VLAN

        if self.flow.dl_vlan_pcp != 0:
            wildcards &= ~ofproto_v1_0.OFPFW_DL_VLAN_PCP

        if self.flow.nw_tos != 0:
            wildcards &= ~ofproto_v1_0.OFPFW_NW_TOS

        if self.flow.nw_proto != 0:
            wildcards &= ~ofproto_v1_0.OFPFW_NW_PROTO

        if self.wc.nw_src_mask != 0 and "01" not in bin(self.wc.nw_src_mask):
            wildcards &= ~ofproto_v1_0.OFPFW_NW_SRC_MASK
            maskbits = (bin(self.wc.nw_src_mask).count("0") - 1)
            wildcards |= (maskbits << ofproto_v1_0.OFPFW_NW_SRC_SHIFT)

        if self.wc.nw_dst_mask != 0 and "01" not in bin(self.wc.nw_dst_mask):
            wildcards &= ~ofproto_v1_0.OFPFW_NW_DST_MASK
            maskbits = (bin(self.wc.nw_dst_mask).count("0") - 1)
            wildcards |= (maskbits << ofproto_v1_0.OFPFW_NW_DST_SHIFT)

        if self.flow.tp_src != 0:
            wildcards &= ~ofproto_v1_0.OFPFW_TP_SRC

        if self.flow.tp_dst != 0:
            wildcards &= ~ofproto_v1_0.OFPFW_TP_DST

        return (wildcards, self.flow.in_port, self.flow.dl_src,
                self.flow.dl_dst, self.flow.dl_vlan, self.flow.dl_vlan_pcp,
                self.flow.dl_type, self.flow.nw_tos & IP_DSCP_MASK,
                self.flow.nw_proto, self.flow.nw_src, self.flow.nw_dst,
                self.flow.tp_src, self.flow.tp_dst)
803492
def is_tuple(node):
    """"""
    if isinstance(node, Node) and node.children == [LParen(), RParen()]:
        return True
    return (isinstance(node, Node)
            and len(node.children) == 3
            and isinstance(node.children[0], Leaf)
            and isinstance(node.children[1], Node)
            and isinstance(node.children[2], Leaf)
            and node.children[0].value == u"("
            and node.children[2].value == u")")
256276
def is_uri_to_be_filtered(uri, filter_list):
    """"""
    match = False
    if filter_list:
        for uri_filter in filter_list:
            if re.search(uri_filter, uri, flags=re.IGNORECASE):
                match = True
        return match
893690
def iswhat(o):
    
    import inspect
    isfs = {n: f for n, f in inspect.getmembers(inspect) if n[0:2] == "is"}
    return {n: f(o) for n, f in isfs.items()}
292481
def __format_filters(filters):
        
        if filters is not None:
            for k in filters:
                if 'filter[' not in k:
                    filters['filter[{}]'.format(k)] = filters.pop(k)
        return filters
936372
def is_tuple_end(self, extra_end_rules=None):
        """"""
        if self.stream.current.type in ('variable_end', 'block_end', 'rparen'):
            return True
        elif extra_end_rules is not None:
            return self.stream.current.test_any(extra_end_rules)
        return False