Return the minions found by looking via regular expressions
10870
def _check_pcre_minions(self, expr, greedy):  # pylint: disable=unused-argument
        '''
        
        '''
        reg = re.compile(expr)
        return {'minions': [m for m in self._pki_minions() if reg.match(m)],
                'missing': []}
154873
def get_minions(returner):
    '''
    
    '''
    returners = salt.loader.returners(__opts__, __salt__)
    return returners['{0}.get_minions'.format(returner)]()
1045579
function getIgnoreRegexes(rootFolder) {
    const gasignoreFilepath = path.join(rootFolder, constants.IGNORE_FILE);

    let regexes = [];
    if (fs.existsSync(gasignoreFilepath)) {
        regexes = parse(fs.readFileSync(gasignoreFilepath));
    }
    return regexes;
}
308927
def get_minions():
    '''
    
    '''
    log.debug('sdstack_etcd returner <get_minions> called')
    ret = []
    client, path = _get_conn(__opts__)
    items = client.get('/'.join((path, 'minions')))
    for item in items.children:
        comps = str(item.key).split('/')
        ret.append(comps[-1])
    return ret
637896
def re_filter(text, regexps):
    """"""
    if not regexps:
        return text

    matched_text = []
    compiled_regexps = [re.compile(x) for x in regexps]
    for line in text:
        if line in matched_text:
            continue

        for regexp in compiled_regexps:
            found = regexp.search(line)
            if found and found.group():
                matched_text.append(line)

    return matched_text or text
754755
def exact_find_in_pattern(fixed_text, cur=0, patterns=PATTERNS):
    """"""
    return [x for x in patterns if (cur + len(x['find']) <= len(fixed_text))
             and x['find'] == fixed_text[cur:(cur + len(x['find']))]]
1281808
def find_matches(text):
    
    """
    path = os.path.expanduser(text)
    if os.path.isdir(path) and not path.endswith('/'):
        return [ text + '/' ]

    pattern = path + '*'
    is_implicit_cwd = not (path.startswith('/') or path.startswith('./'))
    if is_implicit_cwd:
        pattern = './' + pattern
    rawlist = glob.glob(pattern)
    ret = []
    for fname in rawlist:
        if is_implicit_cwd:
            fname = fname[2:]
        if os.path.isdir(fname):
            ret.append(fname + '/')
        else:
            ret.append(fname)
    return ret
1283095
def filter_wildcard(names, pattern):
    
    return tuple(name for name in names
                 if fnmatch.fnmatch(name, pattern))
1175289
def _reExec(regex, string):
    ''''''
    m = regex.search(string)
    if not m: return None
    return [m.group()] + list(m.groups())
273112
def match_check(self, regex, fun):
        '''
        
        '''
        vals = []
        if isinstance(fun, six.string_types):
            fun = [fun]
        for func in fun:
            try:
                if re.match(regex, func):
                    vals.append(True)
                else:
                    vals.append(False)
            except Exception:
                log.error('Invalid regular expression: %s', regex)
        return vals and all(vals)
250135
def _all_minions(self, expr=None):
        '''
        
        '''
        mlist = []
        for fn_ in salt.utils.data.sorted_ignorecase(os.listdir(os.path.join(self.opts['pki_dir'], self.acc))):
            if not fn_.startswith('.') and os.path.isfile(os.path.join(self.opts['pki_dir'], self.acc, fn_)):
                mlist.append(fn_)
        return {'minions': mlist, 'missing': []}
609840
def regex_search(self, regex: str) -> List[HistoryItem]:
        
        regex = regex.strip()
        if regex.startswith(r'/') and regex.endswith(r'/'):
            regex = regex[1:-1]
        finder = re.compile(regex, re.DOTALL | re.MULTILINE)

        def isin(hi):
            """filter function for doing a regular expression search of history"""
            return finder.search(hi) or finder.search(hi.expanded)
        return [itm for itm in self if isin(itm)]
1164280
function hasMagic(pattern, options) {
  // Support RegExp as well as glob
  if (pattern instanceof RegExp) {
    return {
      match: function match(str) {
        return pattern.test(str);
      }
    };
  }

  var minimatch = new _minimatch.Minimatch(pattern, options);
  var set = minimatch.set;

  if (set.length > 1) {
    return minimatch;
  }

  for (var j = 0; j < set[0].length; j++) {
    if (typeof set[0][j] !== 'string') {
      return minimatch;
    }
  }

  return false;
}
375195
def get_fun(fun):
    '''
    
    '''
    serv = _get_serv(ret=None)
    minions = _get_list(serv, 'minions')
    returns = serv.get_multi(minions, key_prefix='{0}:'.format(fun))
    # returns = {minion: return, minion: return, ...}
    ret = {}
    for minion, data in six.iteritems(returns):
        ret[minion] = salt.utils.json.loads(data)
    return ret
1032507
def get_minions():
    '''
    
    '''
    conn, mdb = _get_conn(ret=None)
    ret = []
    name = mdb.saltReturns.distinct('minion')
    ret.append(name)
    return ret
342942
def _namematcher(regex):
    """"""

    matcher = re_compile(regex)

    def match(target):
        target_name = getattr(target, '__name__', '')
        result = matcher.match(target_name)
        return result

    return match
546823
def _match_and_pop(self, regex_pattern):
        
        results = []
        self.lock.acquire()
        for name in self.event_dict.keys():
            if re.match(regex_pattern, name):
                q = self.event_dict[name]
                if q:
                    try:
                        results.append(q.get(False))
                    except:
                        pass
        self.lock.release()
        return results