Print all keys and values where key matches PATTERN. Default pattern is * (all keys)
543357
def dump(file_name, pattern):
    
    db = XonoticDB.load_path(file_name)
    items = sorted(db.filter(pattern), key=lambda x: natural_sort_key(x[0]))
    for k, v in items:
        click.echo('%s: %s' % (k, v))
881509
def keys(pattern='*', host=None, port=None, db=None, password=None):
    '''
    
    '''
    server = _connect(host, port, db, password)
    return server.keys(pattern)
739209
public static List<String> getCamelKeys(String pattern) {
        List<String> keys = new ArrayList<String>();
        for (String s : getOriginalKeys(pattern)) {
            keys.add(StringUtil.underlineToCamel(s));
        }
        return keys;
    }
296260
def _print_dict_files(self, case, target):
        
        if case in self.live and target in self.live[case]:
            lines = []
            data = self.live[case][target]
            skeys = list(sorted(data.keys()))
            for key in skeys:
                props = ", ".join(sorted(data[key].keys()))
                lines.append("'{}': {}".format(key, props))
            return '\n'.join(lines)
        else:
            msg.err("Can't find the result set {} in {}".format(target, case))
280515
def print_all() -> None:
    
    for code in sorted(term2hex_map):
        print(' '.join((
            '\033[48;5;{code}m{code:<3}:{hexval:<6}\033[0m',
            '\033[38;5;{code}m{code:<3}:{hexval:<6}\033[0m'
        )).format(code=code, hexval=term2hex_map[code]))
467696
public void println(String pattern, Object... arguments) {
    println(String.format(pattern, arguments));
  }
94000
def _prepare_patterns(self, pattern_dict):
        """"""
        dict_compiled = {}
        dict_text = {}
        dict_dscr = {}
        for platform, patterns in pattern_dict.items():
            dict_text[platform] = {}
            dict_compiled[platform] = {}
            dict_dscr[platform] = {}

            for key, pattern in patterns.items():
                try:
                    text_pattern = None
                    compiled_pattern = None
                    description_pattern = None

                    if isinstance(pattern, str):
                        text_pattern = pattern
                        compiled_pattern = re.compile(text_pattern, re.MULTILINE)
                        description_pattern = key

                    elif isinstance(pattern, dict):
                        text_pattern = pattern['pattern']
                        compiled_pattern = re.compile(text_pattern, re.MULTILINE)
                        description_pattern = pattern['description']

                    elif isinstance(pattern, list):
                        text_pattern = self._concatenate_patterns(key, pattern)
                        compiled_pattern = re.compile(text_pattern, re.MULTILINE)
                        description_pattern = key

                    dict_text[platform][key] = text_pattern
                    dict_compiled[platform][key] = compiled_pattern
                    dict_dscr[platform][key] = description_pattern

                except re.error as e:
                    raise RuntimeError("Pattern compile error: {} ({}:{})".format(e.message, platform, key))

        return dict_compiled, dict_text, dict_dscr
882846
def scan(pattern, string, *args, **kwargs):
    
    return compile(pattern, *args, **kwargs).scan(string)
647894
function match(str, patterns) {
    var matched = false;
    if (!_.is(patterns, 'Array')) {
      patterns = [patterns];
    }
    patterns.every(function(pattern) {
      if (!pattern) {
        return true;
      }
      matched = matched || str.search(normalize(pattern)) > -1;
      return !matched;
    });
    return matched;
  }
595662
def grep(pattern, &block)
      result = select { |item| pattern === item }
      result = result.map(&block) if block_given?
      return result
    end
406506
public void findPatterns() 
        throws Exception {
        HashSet<String> patterns = new HashSet<String>();
        for (String phrase : filtered_phrases) {
            String phrase_arr[] = phrase.split(":");
            String A = phrase_arr[0];
            String B = phrase_arr[1];
            //System.err.println(A + ": " + B);

            patterns.addAll(searchDirectoryForPattern(new File(DATA_DIR), A, B));
        }
        Iterator iter = patterns.iterator();
        while (iter.hasNext()) {
            String curr_pattern_str = (String)iter.next();
            String[] curr_pattern = curr_pattern_str.split("\\s");
            int curr_length = curr_pattern.length;
            //System.err.println("length of pattern: " + curr_length);
            //do a for loop with all combinatorials of wildcard patterns
            //for each iteration do a wildcard search
            for (int comb = 0; comb < (int)Math.pow(2.0,(double)curr_length); comb++) {
                String comb_pattern = "\\s" + combinatorialPatternMaker(curr_pattern, curr_length, comb);
                try {
                    int score = countWildcardPhraseFrequencies(new File(DATA_DIR), ".*" + comb_pattern + ".*");
                    InterveningWordsPattern db_pattern = new InterveningWordsPattern(comb_pattern);
                    db_pattern.setOccurrences(score);
                    pattern_list.put(db_pattern, score); //insert the pattern into database (only if it has a high enough score)

                    //System.err.println(comb_pattern + ": " + score);
                } catch (Exception e) {
                    System.err.println("could not perform wildcard search");
                }
            }
        }
    }
969959
def all_keys(self, uppercase_keys=False):
        """"""
        d = {}

        for k in self._override.keys():
            d[k.upper() if uppercase_keys else k.lower()] = {}

        for k in self._args.keys():
            d[k.upper() if uppercase_keys else k.lower()] = {}

        for k in self._env.keys():
            d[k.upper() if uppercase_keys else k.lower()] = {}

        for k in self._config.keys():
            d[k.upper() if uppercase_keys else k.lower()] = {}

        for k in self._kvstore.keys():
            d[k.upper() if uppercase_keys else k.lower()] = {}

        for k in self._defaults.keys():
            d[k.upper() if uppercase_keys else k.lower()] = {}

        for k in self._aliases.keys():
            d[k.upper() if uppercase_keys else k.lower()] = {}

        return d.keys()
819173
def __do_grep(curr_line, pattern, **kwargs):
    
    # currently found position
    position = -1
    end_pos = -1

    # check if fixed strings mode
    if kwargs.get('fixed_strings'):

        # if case insensitive fix case
        if kwargs.get('ignore_case'):
            pattern = pattern.lower()
            curr_line = curr_line.lower()

        # if pattern is a single string, match it:
        pattern_len = 0
        if isinstance(pattern, _basestring):
            position = curr_line.find(pattern)
            pattern_len = len(pattern)

        # if not, treat it as a list of strings and match any
        else:
            for p in pattern:
                position = curr_line.find(p)
                pattern_len = len(p)
                if position != -1:
                    break

        # calc end position
        end_pos = position + pattern_len

        # check if need to match whole words
        if kwargs.get('words') and position != -1:

            foundpart = (' ' + curr_line + ' ')[position:position+len(pattern)+2]
            if _is_part_of_word(foundpart[0]):
                position = -1
            elif _is_part_of_word(foundpart[-1]):
                position = -1

    # if not fixed string, it means its a regex
    else:

        # set regex flags
        flags = kwargs.get('regex_flags') or 0
        flags |= re.IGNORECASE if kwargs.get('ignore_case') else 0

        # add whole-words option
        if kwargs.get('words'):
            pattern = r'\b' + pattern + r'\b'

        # do search
        result = re.search(pattern, curr_line, flags)

        # if found, set position
        if result:
            position = result.start()
            end_pos = result.end()

    # check if need to match whole line
    if kwargs.get('line') and (position != 0 or end_pos != len(curr_line)):
        position = -1

    # parse return value
    matched = position != -1

    # if invert flag is on, invert value
    if kwargs.get('invert'):
        matched = not matched

    # if position is -1 reset end pos as well
    if not matched:
        end_pos = -1

    # return result
    return matched, position, end_pos
215602
def ls(pattern, follow_references: true)

            pattern = /#{Regexp.escape(pattern)}/i if pattern.is_a?(::String)
            raise TypeError, "Expected a String or Regexp" unless pattern.is_a?(Regexp)

            self.grep(pattern, streams: false, object_streams: true)
                .select {|object| object.is_a?(Name) and object.parent.is_a?(Dictionary) and object.parent.key?(object) }
                .collect {|object| result = object.parent[object]; follow_references ? result.solve : result }
        end
533617
def process_regex(self, key):
        
        return re.compile(self.output_dict[key]) if \
            key in self.output_dict else None
1041170
def list_keys(self, pattern='*', db=0):
        
        lines = output_lines(self.exec_redis_cli('KEYS', [pattern], db=db))
        return [] if lines == [''] else lines
682836
def _fill_default_values(cls, cls_context, dict_):
        

        dict_with_default_values = dict(dict_)
        params = re.findall(cls._PATTERN_PARAM_NAME_TYPED_ANY,
                            cls_context.__doc__)

        for param in params:
            if param not in dict_with_default_values:
                dict_with_default_values[param] = None

        return dict_with_default_values