Filter available varaibles
513185
def filter_data(self, pattern=''):
        
        filtered_profiles = {}
        with open(self.abspath) as fobj:
            for idx, line in enumerate(fobj):
                if 'TIME SERIES' in line:
                    break
                if pattern in line and (idx-self._attributes['CATALOG']-1) > 0:
                    filtered_profiles[idx-self._attributes['CATALOG']-1] = line
        return filtered_profiles
283859
function filterPaths(paths, allowed) {
  if (!allowed) { return []; }
  if (!allowed.only.length) { return paths; }

  return paths.filter(
    path => {
      let match = false;

      for (const filter of allowed.only) {
        try {
          switch (typeof filter) {
            case 'function':
              match = filter(path.path);
              break;
            case 'string':
              match = path.path === filter;
              break;
            default:
              match = filter.test(path.path);
         }
        } catch (e) {
          throw new Error(`${ typeof filter } is not an allowed filter type. Must be String, RegExp or Function`);
        }
        if (match) { return match; }
      }
      return match;
    }
  );
}
477016
def filter_products(self, desired_prods):
        """"""

        self.filter_prods = True
        self.desired_prods = set(desired_prods)
841573
def filter(self, table, vg_snapshots, filter_string):
        """"""
        query = filter_string.lower()
        return [vg_snapshot for vg_snapshot in vg_snapshots
                if query in vg_snapshot.name.lower()]
443912
def filter(cls, iterable, cond, *a, **kw):
    

    return cls(x for x in iterable if cond(x, *a, **kw))
145510
def filter(self, value=None, exclude=False, **selection):
        
        filters = self.meta.setdefault('filters', [])

        if value and len(selection):
            raise ValueError("Cannot specify a filter string and a filter keyword selection at the same time.")
        elif value:
            value = [value]
        elif len(selection):
            value = select(self.api.columns, selection, invert=exclude)

        filters.append(value)
        self.raw['filters'] = utils.paste(filters, ',', ';')
        return self
735237
def filter(self, table, group_types, filter_string):
        """"""
        query = filter_string.lower()
        return [group_type for group_type in group_types
                if query in group_type.name.lower()]
381359
private function filterVariablesUsedAsPlaceholders($string, array $variables)
    {
        if (empty($string)) {
            return $variables;
        }

        // array_filter() is not used because ARRAY_FILTER_USE_KEY requires PHP 5.6
        $filteredVariables = array();
        foreach ($variables as $key => $value) {
            if (false === strpos($string, '{'.$key.'}')) {
                $filteredVariables[$key] = $value;
            }
        }

        return $filteredVariables;
    }
297945
def _match_filters(parameter, filters=None):
        """"""
        for filter_obj in (filters or []):
            key = filter_obj['Key']
            option = filter_obj.get('Option', 'Equals')
            values = filter_obj.get('Values', [])

            what = None
            if key == 'Type':
                what = parameter.type
            elif key == 'KeyId':
                what = parameter.keyid

            if option == 'Equals'\
                    and not any(what == value for value in values):
                return False
            elif option == 'BeginsWith'\
                    and not any(what.startswith(value) for value in values):
                return False
        # True if no false match (or no filters at all)
        return True
449877
function filter( arr, str ) {
	var len = arr.length,
		out = [],
		i;

	for ( i = 0; i < len; i++ ) {
		if ( arr[ i ] !== str ) {
			out.push( arr[ i ] );
		}
	}
	return out;
}
575552
def filter(self, table, security_groups, filter_string):
        """"""
        query = filter_string.lower()
        return [security_group for security_group in security_groups
                if query in security_group.name.lower()]
36488
protected function filterEmpty()
    {
        $vars = $this->toArray();
        foreach ($vars as $name => $value) {
            if (!strlen($value)) {
                unset($this->{$name});
            }
        }
    }
788788
def _filter_options(self, aliases=True, comments=True, historical=True):
        """"""
        options = []
        if not aliases:
            options.append('noaliases')
        if not comments:
            options.append('nocomments')
        if not historical:
            options.append('nohistorical')
        return options
824375
def filter(self, table, items, filter_string):
        """"""
        query = filter_string.lower()
        return [item for item in items
                if query in item.name.lower()]
165020
def filter(self, table, volume_types, filter_string):
        """"""
        query = filter_string.lower()
        return [volume_type for volume_type in volume_types
                if query in volume_type.name.lower()]
1255251
def filter(self, func):
        """"""  # noqa: E501
        return self.__class__([x for x in self.res if func(x)],
                              name="filtered %s" % self.listname)
1147126
def filter_keys(self, **kwargs):
        ""
        self._used_index = False
        keys = set(self.data.keys())
        for key_filter, v_filter in kwargs.items():
            if key_filter in self.indexes:
                self._used_index = True
                if v_filter not in self.indexes[key_filter]:
                    keys = set([])
                else:
                    keys = keys.intersection(
                        self.indexes[key_filter][v_filter])
            else:
                keys = keys.intersection(
                    self.simple_filter(key_filter, v_filter))
        return keys