check if each properties of timeperiods are valid

        :return: True if is correct, otherwise False
        :rtype: bool
978793
def is_correct(self):
        
        valid = True
        # We do not want a same hg to be explode again and again
        # so we tag it
        for timeperiod in list(self.items.values()):
            timeperiod.rec_tag = False

        for timeperiod in list(self.items.values()):
            for tmp_tp in list(self.items.values()):
                tmp_tp.rec_tag = False
            valid = timeperiod.check_exclude_rec() and valid

        # We clean the tags and collect the warning/erro messages
        for timeperiod in list(self.items.values()):
            del timeperiod.rec_tag

            # Now other checks
            if not timeperiod.is_correct():
                valid = False
                source = getattr(timeperiod, 'imported_from', "unknown source")
                msg = "Configuration in %s::%s is incorrect; from: %s" % (
                    timeperiod.my_type, timeperiod.get_name(), source
                )
                self.add_error(msg)

            self.configuration_errors += timeperiod.configuration_errors
            self.configuration_warnings += timeperiod.configuration_warnings

        # And check all timeperiods for correct (sunday is false)
        for timeperiod in self:
            valid = timeperiod.is_correct() and valid

        return valid
1143410
def isValid(self):
        
        today = DateTime()
        expiry_date = self.getExpiryDate()
        if expiry_date and today > expiry_date:
            return False
        # TODO: Do We really need ExpiryDate + DateExpired? Any difference?
        date_expired = self.getDateExpired()
        if date_expired and today > date_expired:
            return False

        date_disposed = self.getDateDisposed()
        if date_disposed and today > date_disposed:
            return False

        return True
230944
def valid(self):
        
        if self.end is None:
            if self.start is not None:
                return self.start <= datetime.datetime.utcnow()
            else:
                return True
        else:
            if self.start is not None:
                return self.start <= datetime.datetime.utcnow() <= self.end
            else:
                return datetime.datetime.utcnow() <= self.end
668428
def valid(*things):
	''''''
	for thing in things:
		if type(thing) is str and not os.path.exists(thing):
			return False
		if thing.valid is None:
			return False
	return True
184806
def _before_valid_time_range(self):
        
        if self.start_time is not None:
            try:
                if self.time < self.start_time:
                    return True
            except TypeError:
                return False
        return False
1207389
def _validate_time_range(trange, status, msg):
    '''
    
    '''
    # If trange is empty, just return the current status & msg
    if not trange:
        return status, msg

    if not isinstance(trange, dict):
        status = False
        msg = ('The time_range parameter for '
               'wtmp beacon must '
               'be a dictionary.')

    if not all(k in trange for k in ('start', 'end')):
        status = False
        msg = ('The time_range parameter for '
               'wtmp beacon must contain '
               'start & end options.')

    return status, msg
465571
def valid?
      schedule_type_validator = EnumAttributeValidator.new('String', ["SCHEDULED", "ASAP"])
      return false unless schedule_type_validator.valid?(@schedule_type)
      return false if !@note.nil? && @note.to_s.length > 500
      return false if !@cancel_reason.nil? && @cancel_reason.to_s.length > 100
      return true
    end
1216022
def is_continuous(self):
        """"""
        if self._validated_a_period is True and \
                len(self.values) == len(self.header.analysis_period.months_int):
            return True
        else:
            return False
706778
private static boolean isValidityRange(Date currentTime, Date thisUpdate, Date nextUpdate)
  {
    long tolerableValidity = calculateTolerableVadility(thisUpdate, nextUpdate);
    return thisUpdate.getTime() - MAX_CLOCK_SKEW_IN_MILLISECONDS <= currentTime.getTime() &&
           currentTime.getTime() <= nextUpdate.getTime() + tolerableValidity;
  }
643024
def _check_time_range(time_range, now):
    '''
    
    '''
    if _TIME_SUPPORTED:
        _start = dateutil_parser.parse(time_range['start'])
        _end = dateutil_parser.parse(time_range['end'])

        return bool(_start <= now <= _end)
    else:
        log.error('Dateutil is required.')
        return False
146758
def is_valid(self):
        
        if not isinstance(self._expiration, datetime.datetime):
            raise InvalidArgumentError('Expiration datetime must be specified.')

        if 'key' not in self.form_data:
            raise InvalidArgumentError('object key must be specified.')

        if 'bucket' not in self.form_data:
            raise InvalidArgumentError('bucket name must be specified.')
531428
def is_valid(self):
        

        if not self:
            return True

        if self.left and self.data[self.axis] < self.left.data[self.axis]:
            return False

        if self.right and self.data[self.axis] > self.right.data[self.axis]:
            return False

        return all(c.is_valid() for c, _ in self.children) or self.is_leaf
1036658
def validate_a_time_filter(self, value):
        
        if value:
            try:
                utils.parse_datetime_range(value)
            except Exception as e:
                raise serializers.ValidationError(e.message)

        return value
57163
def valid(cls, token, **kwargs):
        
        try:
            token = yield cls.get(token)
        except couch.NotFound:
            raise Return(False)

        raise Return(token.ttl >= datetime.utcnow())
76644
def check(self):
        '''  '''
        if self.lastrun + self.interval < time.time():
            return True
        else:
            return False
1249157
def _is_valid_duration(self, inpt, metadata):
        """"""
        # NEED TO ADD CHECKS FOR OTHER METADATA, LIKE MINIMUM, MAXIMUM, ETC.
        from dlkit.abstract_osid.calendaring.primitives import Duration as abc_duration
        if isinstance(inpt, abc_duration):
            return True
        else:
            return False
2558
def is_correct(self):
        # pylint: disable=too-many-branches
        
        state = True

        if hasattr(self, 'trigger') and getattr(self, 'trigger', None):
            self.add_warning("[%s::%s] 'trigger' property is not allowed"
                             % (self.my_type, self.get_name()))

        # If no notif period, set it to None, mean 24x7
        if not hasattr(self, 'notification_period'):
            self.notification_period = None

        # If freshness_threshold is not set, use check interval or retry interval
        if hasattr(self, 'freshness_threshold') and not self.freshness_threshold:
            if getattr(self, 'check_interval', 0):
                self.freshness_threshold = self.check_interval * 60
                # self.add_warning("[%s::%s] using check interval as a freshness threshold: %d s"
                #                  % (self.my_type, self.get_name(), self.freshness_threshold))
            elif getattr(self, 'retry_interval', 0):
                self.freshness_threshold = self.retry_interval * 60
                # self.add_warning("[%s::%s] using retry interval as a freshness threshold: %d s"
                #                  % (self.my_type, self.get_name(), self.freshness_threshold))

        # If we got an event handler, it should be valid
        if getattr(self, 'event_handler', None) and not self.event_handler.is_valid():
            self.add_error("[%s::%s] event_handler '%s' is invalid"
                           % (self.my_type, self.get_name(), self.event_handler.command))
            state = False

        if not hasattr(self, 'check_command'):
            # todo: This should never happen because the default exists as an empty string
            self.add_error("[%s::%s] no property check_command" % (self.my_type, self.get_name()))
            state = False
        # Ok got a command, but maybe it's invalid
        else:
            # if not self.check_command:
            #     self.add_warning("[%s::%s] no check_command, will always be considered as Up"
            #                      % (self.my_type, self.get_name()))
            if self.check_command and not self.check_command.is_valid():
                self.add_error("[%s::%s] check_command '%s' invalid"
                               % (self.my_type, self.get_name(), self.check_command.command))
                state = False
            if self.got_business_rule:
                if not self.business_rule.is_valid():
                    self.add_error("[%s::%s] business_rule invalid"
                                   % (self.my_type, self.get_name()))
                    for bperror in self.business_rule.configuration_errors:
                        self.add_error("[%s::%s]: %s" % (self.my_type, self.get_name(), bperror))
                    state = False

        if not hasattr(self, 'notification_interval') \
                and self.notifications_enabled is True:  # pragma: no cover, should never happen
            self.add_error("[%s::%s] no notification_interval but notifications enabled"
                           % (self.my_type, self.get_name()))
            state = False

        # if no check_period, means 24x7, like for services
        if not hasattr(self, 'check_period'):
            self.check_period = None

        state = super(SchedulingItem, self).is_correct()
        return state