Returns True or False indicating whether or not the specified
        target is present and valid.

        `target_id` is a target ID (or None for the first target)
484772
def target_is_valid(self, target_id=0):
        
        try:
            target = self._target(target_id=target_id)
        except:
            return False
        return target['state'] != "invalid"
416742
def check_plan_id(self, plan_id) -> bool:
        
        for plan in self.catalog().plans:
            if plan.id == plan_id:
                return True
        return False
1320977
def firstId(self) -> BaseReference:
        
        if self.childIds is not None:
            if len(self.childIds) > 0:
                return self.childIds[0]
            return None
        else:
            raise NotImplementedError
441689
def target_is_busy(self, target_id=0):
        
        try:
            target = self._target(target_id=target_id)
        except:
            raise NoSuchTargetException()
        return target['state'] == "running"
1171055
function(target){
            // skip valid type check if value evaluating to false or empty array.
            if(!this.validTypes || !this.validTypes.length){
                return true;
            }

            for(var i = this.validTypes.length - 1; i >= 0; i--){
                var type = this.validTypes[i];
                if(target instanceof type){
                    return true;
                }
            }

            // no valid type match found
            return false;
        }
110967
def has_main_target (self, name):
        """"""
        assert isinstance(name, basestring)
        if not self.built_main_targets_:
            self.build_main_targets()

        return name in self.main_target_
840595
def is_id?(identifier, str)
      return false unless identifier && str && known_type?(identifier)
      identifier &&= identifier.to_sym
      str &&= str.to_s.strip
      str.split('-').first == Rudy::ID_MAP[identifier].to_s
    end
629604
protected boolean check(String id, List<String> includes, List<String> excludes) {
		return check(id, includes) && !check(id, excludes);
	}
447985
def valid_id(opts, id_):
    '''
    
    '''
    try:
        if any(x in id_ for x in ('/', '\\', str('\0'))):
            return False
        return bool(clean_path(opts['pki_dir'], id_))
    except (AttributeError, KeyError, TypeError, UnicodeDecodeError):
        return False
763215
def put(self, targetId):
        
        json = request.get_json()
        if 'hinge' in json:
            logger.info('Storing target ' + targetId)
            if self._targetController.storeFromHinge(targetId, json['hinge']):
                logger.info('Stored target ' + targetId)
                return None, 200
            else:
                return None, 500
        else:
            return None, 400
668511
def has_item(self, url):
        

        _hash = self.build_hash(url)
        query = {'_id': _hash}
        doc = self.dbase.cache.find_one(query, {'id': 1})
        return doc is not None
1061558
def _check_id_validity(self, p_ids):
        
        errors = []
        valid_ids = self.todolist.ids()

        if len(p_ids) == 0:
            errors.append('No todo item was selected')
        else:
            errors = ["Invalid todo ID: {}".format(todo_id)
                      for todo_id in p_ids - valid_ids]

        errors = '\n'.join(errors) if errors else None
        return errors
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
564189
public boolean isValid (Object target)
    {
        TileSet set = (TileSet)target;
        boolean valid = true;

        // check for the 'name' attribute
        if (StringUtil.isBlank(set.getName())) {
            log.warning("Tile set definition missing 'name' attribute " +
                        "[set=" + set + "].");
            valid = false;
        }

        // check for an <imagePath> element
        if (StringUtil.isBlank(set.getImagePath())) {
            log.warning("Tile set definition missing <imagePath> element " +
                        "[set=" + set + "].");
            valid = false;
        }

        return valid;
    }
1189078
def identify_id(id: str) -> bool:
    
    return re.match(r'^https?://', id, flags=re.IGNORECASE) is not None
696844
def get_target_list(self, scan_id):
        

        target_list = []
        for target, _, _ in self.scans_table[scan_id]['targets']:
            target_list.append(target)
        return target_list
485757
def target_delete(self, id, **kwargs):
        ""
        api_path = "/api/v2/targets/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, method="DELETE", **kwargs)