Filter to beliefs above a given threshold.
13237
def filter_belief():
    """"""
    if request.method == 'OPTIONS':
        return {}
    response = request.body.read().decode('utf-8')
    body = json.loads(response)
    stmts_json = body.get('statements')
    belief_cutoff = body.get('belief_cutoff')
    if belief_cutoff is not None:
        belief_cutoff = float(belief_cutoff)
    stmts = stmts_from_json(stmts_json)
    stmts_out = ac.filter_belief(stmts, belief_cutoff)
    return _return_stmts(stmts_out)
1135160
def mask_nonfinite(self):
        """"""
        self.mask = np.logical_and(self.mask, (np.isfinite(self.intensity)))
668769
def within(self, lat, lon, radius):
		''''''
		return self.filter(filter_helpers.within_(lat, lon, radius))
493503
def _filter(self, value):
        
        if self.ignores and value in self.ignores:
            return False
        return True
379759
def make_filter(**tests):
    """"""
    tests = [AttrTest(k, v) for k, v in tests.items()]
    return Filter(tests)
493834
function filterValue(value, channel) {
        var type;
        for (var key in DATATYPES) {
            type = DATATYPES[key];
            if (type.flag & channel.dataType) {
                var val = type.parse(value);
                if (val !== false) {
                    if (type.flag === PERCENT) {
                        val *= Math.abs(channel.range[1] - channel.range[0]);
                    }
                    return channel.filter(val);
                }
            }
        }
        return channel.initial;
    }
1214399
def filter_by_rand(self, p:float, seed:int=None):
        ""
        if seed is not None: np.random.seed(seed)
        return self.filter_by_func(lambda o: rand_bool(p))
482428
def filter(self, table, flavors, filter_string):
        """"""
        q = filter_string.lower()

        def comp(flavor):
            return q in flavor.name.lower()

        return filter(comp, flavors)
959211
def check_candidate(a, d, n, s):
    """"""
    if pow(a, d, n) == 1:
        return False
    for i in range(s):
        if pow(a, 2 ** i * d, n) == n - 1:
            return False
    return True
625990
def _filter_messages(messages, products=None, levels=None):
    """"""
    if products is None:
        products = []
    if levels is None:
        levels = []
    segments = []
    bounds = len(messages)
    for i, message in enumerate(messages):
        if (message[3] in products or len(products) == 0) and \
                (message[4] in levels or len(levels) == 0):
            start = int(message[1])
            if i == (bounds - 1):
                end = None
            else:
                end = int(messages[i+1][1])
            segments.append((start, end))
    return _join(segments)
72675
def do_filter(self, arg):
        """"""
        if arg == "list":
            msg.info("TEST CASE FILTERS")
            for f in self.curargs["tfilter"]:
                if f == "*":
                    msg.info("  * (default, matches all)")
                else:
                    msg.info("  " + f)
        elif arg not in self.curargs["tfilter"]:
            self.curargs["tfilter"].append(arg)
            self.do_filter("list")
116420
def filter(self, collection, data, **kwargs):
        """"""
        ops = self.parse(data)
        collection = self.apply(collection, ops, **kwargs)
        return ops, collection
226529
def filter(self, predicate) -> 'Observable':
        """"""
        source = self

        def subscribe(on_next):
            def _next(x):
                if predicate(x):
                    on_next(x)

            return source.subscribe(_next)
        return Observable(subscribe)
104886
public Filter<T> greaterThan(T value) {
		return new ComparableFilter<T>(this, value, Operator.GREATER_THAN);
	}
1229120
def during(self, year, month):
		""""""
		return self.filter(created__year=year, created__month=month)
806630
def thresholds(self):
        """"""
        return numpy.array(
            sorted(self._key2float(key) for key in self._coefs), dtype=float)
525663
def validate_filters_or_records(filters_or_records):
    """"""
    # If filters_or_records is empty, fail
    if not filters_or_records:
        raise ValueError('Must provide at least one filter tuples or Records')
    # If filters_or_records is not list of Record or tuple, fail
    if not isinstance(filters_or_records[0], (Record, tuple)):
        raise ValueError('Cannot provide both filter tuples and Records')
    # If filters_or_records is not list of either Record or only tuple, fail
    _type = type(filters_or_records[0])
    for item in filters_or_records:
        if not isinstance(item, _type):
            raise ValueError("Expected filter tuple or Record, received {0}".format(item))

    return _type