Return True if the minion matches the given data target

    CLI Example:

    .. code-block:: bash

        salt '*' match.data 'spam:eggs'
4712
def data(tgt):
    '''
    
    '''
    matchers = salt.loader.matchers(__opts__)
    try:
        return matchers['data_match.match'](tgt, opts=__opts__)
    except Exception as exc:
        log.exception(exc)
        return False
1316406
def match(tgt, delimiter=DEFAULT_TARGET_DELIM, opts=None):
    '''
    
    '''
    if not opts:
        opts = __opts__
    log.debug('grains pcre target: %s', tgt)
    if delimiter not in tgt:
        log.error('Got insufficient arguments for grains pcre match '
                  'statement from master')
        return False

    return salt.utils.data.subdict_match(
        opts['grains'], tgt, delimiter=delimiter, regex_match=True)
112756
def matches_pattern(self, other):
        """"""
        ismatch = False
        if isinstance(other, Userdata):
            for key in self._userdata:
                if self._userdata[key] is None or other[key] is None:
                    ismatch = True
                elif self._userdata[key] == other[key]:
                    ismatch = True
                else:
                    ismatch = False
                    break
        return ismatch
539914
def _checkblk(name):
    '''
    
    '''

    blk = __salt__['cmd.run']('blkid -o value -s TYPE {0}'.format(name),
                              ignore_retcode=True)
    return '' if not blk else blk
63001
def is_match(subject: Expression, pattern: Expression) -> bool:
    
    return any(True for _ in match(subject, pattern))
990183
def check_egg(pth):
    """"""
    if is_py23:
        if os.path.altsep:
            pth = pth.replace(os.path.altsep, os.path.sep)
        components = pth.split(os.path.sep)
        sep = os.path.sep
    else:
        components = pth.replace("\\", "/").split("/")
        sep = "/"
        if is_win:
            sep = "\\"
    for i, name in zip(range(0, len(components)), components):
        if name.lower().endswith(".egg"):
            eggpth = sep.join(components[:i + 1])
            if os.path.isfile(eggpth):
                # eggs can also be directories!
                return True
    return False
407129
async def check(self, *args):
        
        data = {}
        for target in self.targets:
            result = await target(*args)
            if not result:
                return False
            if isinstance(result, dict):
                data.update(result)
        if not data:
            return True
        return data
971095
function matches(url, command) {
		var cap;
		if (cap = commandReg.exec(url)) return cap[1] === command;
	}
1348222
def catch_em_all(data_file=None, return_names=False):
    '''
    '''
    if data_file == None:
        data_file = "%s/database/pokemons.json" %(base)

    pokemons = load_json(data_file)

    if return_names is True:
        names = []
        for key,meta in pokemons.items():
            names.append(meta['name'])
        return names
    return pokemons
1180955
def match_data(self, tokens, item):
        """"""
        if len(tokens) == 2:
            data_type, matches = tokens
            star_match = None
        elif len(tokens) == 3:
            data_type, matches, star_match = tokens
        else:
            raise CoconutInternalException("invalid data match tokens", tokens)
        self.add_check("_coconut.isinstance(" + item + ", " + data_type + ")")
        if star_match is None:
            self.add_check("_coconut.len(" + item + ") == " + str(len(matches)))
        elif len(matches):
            self.add_check("_coconut.len(" + item + ") >= " + str(len(matches)))
        self.match_all_in(matches, item)
        if star_match is not None:
            self.match(star_match, item + "[" + str(len(matches)) + ":]")
805480
def matches_pattern(self, other):
        
        properties = self._message_properties()
        ismatch = False
        if isinstance(other, Message) and self.code == other.code:
            for prop in properties:
                for key, prop_val in prop.items():
                    if hasattr(other, key):
                        key_val = getattr(other, key)
                        ismatch = self._test_match(prop_val, key_val)
                    else:
                        ismatch = False
                    if not ismatch:
                        break
                if not ismatch:
                    break
        return ismatch
647527
public function match(array $data): bool
    {
        $result = $this->checkMatchArray($data, $this->matchArray);
        if ($result && isset($data['fieldConfig']['config']['foreign_table'])) {
            $result = true;
        } else {
            $result = false;
        }
        return $result;
    }
1288835
def targets(tgt, tgt_type='glob', **kwargs):
    '''
    
    '''
    ssh_config_file = _get_ssh_config_file(__opts__)
    with salt.utils.files.fopen(ssh_config_file, 'r') as fp:
        all_minions = parse_ssh_config([line.rstrip() for line in fp])
    rmatcher = RosterMatcher(all_minions, tgt, tgt_type)
    matched = rmatcher.targets()
    return matched
730293
def recv_match(self, condition=None, type=None, blocking=False, timeout=None):
        ''''''
        if type is not None and not isinstance(type, list):
            type = [type]
        start_time = time.time()
        while True:
            if timeout is not None:
                now = time.time()
                if now < start_time:
                    start_time = now # If an external process rolls back system time, we should not spin forever.
                if start_time + timeout < time.time():
                    return None
            m = self.recv_msg()
            if m is None:
                if blocking:
                    for hook in self.idle_hooks:
                        hook(self)
                    if timeout is None:
                        self.select(0.05)
                    else:
                        self.select(timeout/2)
                    continue
                return None
            if type is not None and not m.get_type() in type:
                continue
            if not evaluate_condition(condition, self.messages):
                continue
            return m
576169
def match(self, url):
        
        return list({
            message for message in self.active() if
            message.is_global or message.match(url)
        })
882194
function matchDatum(node, datum, ignored) {
    var subFilter;
    for (var i in datum) {
      if (ignored !== i && (subFilter = filters[i]) && !subFilter(node, datum[i])) {
        return false;
      }
    }
    return true;
  }
188414
def _check_names_match(data_names, data_shapes, name, throw):
    """"""
    actual = [x[0] for x in data_shapes]
    if sorted(data_names) != sorted(actual):
        msg = "Data provided by %s_shapes don't match names specified by %s_names (%s vs. %s)"%(
            name, name, str(data_shapes), str(data_names))
        if throw:
            raise ValueError(msg)
        else:
            warnings.warn(msg)