Check if the target descriptor is in the descriptors.
516614
def contain(descriptors, target_descriptor):
    """"""
    for descriptor in descriptors:
        if edit_distance(descriptor, target_descriptor) < 1e-5:
            return True
    return False
112519
public boolean checkInstanceOf(Context context, CharSequence targetClassName,
            CharSequence loaderPackage, Class<?> referenceClass) {
        if ((targetClassName == null) || (referenceClass == null)) {
            return false;
        }

        final Class<?> targetClass = loadOrGetCachedClass(context, targetClassName, loaderPackage);
        if (targetClass == null) {
            return false;
        }

        return referenceClass.isAssignableFrom(targetClass);
    }
591982
def is_defined(self, obj, force_import=False):
        """"""
        from spyder_kernels.utils.dochelpers import isdefined

        ns = self._get_current_namespace(with_magics=True)
        return isdefined(obj, force_import=force_import, namespace=ns)
214009
def is_type_target(self):
        
        if self._is_type_target is None:
            #All we need to do is search through the custom types in the parent
            #module and see if any of their executables points to this method.
            self._is_type_target = False
            for tkey in self.module.types:
                custype = self.module.types[tkey]
                for execkey, execinst in custype.executables.items():
                    if execinst.target is self:
                        self._is_type_target = custype
                        break
                if self._is_type_target:
                    break

        return self._is_type_target
1232515
def _is_deserialized(cls, cls_target, obj):
        

        if cls_target is None:
            return True

        if cls_target in {list, dict}:
            return True

        if cls._is_bytes_type(cls_target):
            return True

        if obj is None:
            return True

        if type(obj) in {list, cls_target}:
            return True

        return False
915462
def isinstance(instance, ifaces):
    """"""
    ifaces = _ensure_ifaces_tuple(ifaces)
    for iface in ifaces:

        attributes = (
            attr
            for attr in iface.__abstractmethods__
            if hasattr(getattr(iface, attr), '__iattribute__')
        )
        for attribute in attributes:

            if not hasattr(instance, attribute):

                return False

        if not issubclass(type(instance), ifaces):

            return False

    return True
955071
function(target){
            if(this.exclude){
                if(target === this.exclude){
                    return false;
                }
                // if exclude is array and target is in it
                if(Object.isArray(this.exclude) && this.exclude.indexOf(target) !== -1){
                    return false;
                }
            }
            if(!this.checkValidType(target)){
                return false;
            }
            if(this.filter && !this.filter(target)){
                return false;
            }

            return true;
        }
1346218
def is_pk_descriptor(descriptor, include_alt=False):
    """"""
    if descriptor.pk is True or type(descriptor.pk) is int:
        return True
    if include_alt:
        return descriptor.alt_pk is True or type(descriptor.alt_pk) is int
    else:
        return False
1064798
def pick_target_decoy(tfeature, dfeature):
    """"""
    tscore, dscore = get_score(tfeature), get_score(dfeature)
    if tscore == dscore:
        # same score or both False
        return False
    elif False in [tscore, dscore]:
        # return the non-False feature
        return [v for k, v in {tscore: tfeature, dscore: dfeature}.items()
                if k is not False][0]
    elif tscore > dscore:
        return tfeature
    elif tscore < dscore:
        return dfeature
    else:
        # in case uncaught edgecase occurs
        print('WARNING, target score {} and decoy score {} could not be '
              'compared'.format(tscore, dscore))
        return False
1344183
def check_denotation(target_values, predicted_values):
    
    # Check size
    if len(target_values) != len(predicted_values):
        return False
    # Check items
    for target in target_values:
        if not any(target.match(pred) for pred in predicted_values):
            return False
    return True
5685
def check(self, feature):
        """"""
        mapper = feature.as_dataframe_mapper()
        mapper.fit(self.X, y=self.y)
401527
def _is_target_a_directory(link, rel_target):
	
	target = os.path.join(os.path.dirname(link), rel_target)
	return os.path.isdir(target)
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
1284513
def check_target(target_path):
    

    if not path.exists(target_path):
        return

    with scandir(target_path) as d:
        for entry in d:
            if not entry.name.startswith('.'):
                fail(f'Target directory "{target_path}" is not empty')
256032
def has(*permissions, **kwargs):
    

    target = kwargs['target']

    kwargs['target'] = type_for(target)

    # TODO: Predicate evaluation?
    return target in filter_(*permissions, **kwargs)
1335964
def target_exists(self, target_id=0):
        
        try:
            target = self._target(target_id=target_id)
        except Exception as e:
            log.error("Exception checking if target exists: {} {}".format(type(e), e))
            return False
        return target is not None
438595
def check_definition(self):
        
        if not self.write_codec:
            self.__write_codec = self.defined.data_ext

        # TODO need to add back a class scope target limited for subprojects with sub target sets
        targets = self.get_defined_targets()
        if self.__target_only:
            if self.__target_only not in targets:
                raise RuntimeError("invalid target '%s'" % self.__target_only)

            self.targets = [self.__target_only]
        else:
            self.targets = targets