Input filtering.
17220
def input(self, _in, out, **kw):
        """"""
        args = [self.binary or 'cleancss'] + self.rebase_opt
        if self.extra_args:
            args.extend(self.extra_args)
        self.subprocess(args, out, _in)
1086307
def _filter_by_pattern(self, pattern):
        """"""
        try:
            _len = len(pattern)
        except TypeError:
            raise TypeError("pattern is not a list of Booleans. Got {}".format(
                type(pattern)))
        _filt_values = [d for i, d in enumerate(self._values) if pattern[i % _len]]
        _filt_datetimes = [d for i, d in enumerate(self.datetimes) if pattern[i % _len]]
        return _filt_values, _filt_datetimes
1219282
def _filter(self, objects, **kwargs):
        """"""
        for obj in objects:
            if self.filter(obj, **kwargs) is False:
                return False

        return True
1311036
def filter_(input_, filename='<internal>', state='INITIAL'):
    
    global CURRENT_DIR

    prev_dir = CURRENT_DIR
    CURRENT_FILE.append(filename)
    CURRENT_DIR = os.path.dirname(CURRENT_FILE[-1])
    LEXER.input(input_, filename)
    LEXER.lex.begin(state)
    parser.parse(lexer=LEXER, debug=OPTIONS.Debug.value > 2)
    CURRENT_FILE.pop()
    CURRENT_DIR = prev_dir
592194
def filter(self, search):
        '''
        
        '''
        if not self._filters:
            return search
        filters = Q('match_all')
        for f in self._filters.values():
            filters &= f
        return search.filter(filters)
97716
def process_with_filter(input, filter_class)
      filter = filter_class.new

      output = MemoryFileWrapper.new("/output", input.path, "UTF-8")
      output.create { filter.generate_output([input], output) }

      output
    end
835327
private function filterEmptyInput($input)
    {
        foreach ($input as $key => $value)
        {
            if (empty($value))
            {
                unset($input[$key]);
            }
        }

        return $input;
    }
403360
def filter_by(self, string):
        """"""

        self._reatach()
        if string == '':
            self.filter_remove()
            return

        self._expand_all()
        self.treeview.selection_set('')

        children = self.treeview.get_children('')
        for item in children:
            _, detached = self._detach(item)
            if detached:
                self._detached.extend(detached)
        for i, p, idx in self._detached:
            # txt = self.treeview.item(i, 'text')
            self.treeview.detach(i)
        self.filter_on = True
1306388
def Validate(self):
    """"""
    # All filters can handle the input type.
    bad_filters = []
    for f in self.filters:
      try:
        f.Validate()
      except DefinitionError as e:
        bad_filters.append("%s: %s" % (f.expression, e))
    if bad_filters:
      raise DefinitionError(
          "Filters with invalid expressions: %s" % ", ".join(bad_filters))
1132735
def filter(self, table, users, filter_string):
        """"""
        q = filter_string.lower()
        return [user for user in users
                if (q in user.name.lower() or
                    q in (getattr(user, 'email', None) or '').lower())]
729904
def scrub(data):
    """"""
    # blanks, Nones, and empty strings can stay as is
    if not data:
        return data
    if isinstance(data, (int, float)):
        return data
    if isinstance(data, list):
        return [scrub(entry) for entry in data]
    if isinstance(data, dict):
        return {scrub(key): scrub(value) for key, value in data.items()}
    try:
        return json.encoder.encode_basestring(data)[1:-1]
    except TypeError as exc:
        raise ValidationError("Input '%s' is not a permitted type: %s" % (data,
                                                                          exc))
    except Exception as exc:
        raise ValidationError("Input '%s' not permitted: %s" % (data, exc))
588531
def _filter(self):
        
        pattern = u"[\s+\.\!\-\/_,$%^*(+\"\']+|[+——！】【，。？?:、：~@#￥%……&*“”（）]+"
        self.m = re.sub(pattern, "", self.m)
134671
function (filter, keys) {
            if (self.session) {
                var flash = isset(filter) ? self.input[filter](keys) : self.input.all();

                self.session.flash('_old_input', flash);
            }
        }
602935
def _process(self, input):
        '''
        
        '''

        input = re.sub("<[^>]*>", " ", input) 
        punct = list(string.punctuation)
        for symbol in punct:
            input = input.replace(symbol, " %s " % symbol)
        input = filter(lambda x: x != u'', input.lower().split(' '))
        return input
262531
def apply_filter(x, filter=None, axis=0):
    """"""
    x = _as_array(x)
    if x.shape[axis] == 0:
        return x
    b, a = filter
    return signal.filtfilt(b, a, x, axis=axis)
781075
def get_inputs_from_cm(index, cm):
    """"""
    return tuple(i for i in range(cm.shape[0]) if cm[i][index])
396497
def allow_filtering(self):
        
        clone = copy.deepcopy(self)
        clone._allow_filtering = True
        return clone