Checks if tile has tile info and valid timestamp

        :return: `True` if tile is valid and `False` otherwise
        :rtype: bool
559078
def tile_is_valid(self):
        
        return self.tile_info is not None \
            and (self.datetime == self.date or self.datetime == self.parse_datetime(self.tile_info['timestamp']))
90857
def _is_valid_scan(self):
        
        if self._scan is not None:
            return self._scan
        if self._ordering:
            return False
        if self._facets:
            return False
            #TODO check for child or nested query
        return True
1314076
def _check_touch(name, atime, mtime):
    '''
    
    '''
    ret = {
        'result': None,
        'comment': '',
        'changes': {'new': name},
    }
    if not os.path.exists(name):
        ret['comment'] = 'File {0} is set to be created'.format(name)
    else:
        stats = __salt__['file.stats'](name, follow_symlinks=False)
        if ((atime is not None
             and six.text_type(atime) != six.text_type(stats['atime'])) or
            (mtime is not None
                and six.text_type(mtime) != six.text_type(stats['mtime']))):
            ret['comment'] = 'Times set to be updated on file {0}'.format(name)
            ret['changes'] = {'touched': name}
        else:
            ret['result'] = True
            ret['comment'] = 'File {0} exists and has the correct times'.format(name)
    return ret
233035
def verify(self):
        
        try:
            if self.timestamp_mismatch is not None:
                m = _iso8601_timestamp_regex.match(self.request_timestamp)
                year = int(m.group("year"))
                month = int(m.group("month"))
                day = int(m.group("day"))
                hour = int(m.group("hour"))
                minute = int(m.group("minute"))
                second = int(m.group("second"))

                req_ts = datetime(year, month, day, hour, minute, second)
                now = datetime.utcnow()

                if abs(req_ts - now) > timedelta(0, self.timestamp_mismatch):
                    raise InvalidSignatureError("Timestamp mismatch")

            if self.expected_signature != self.request_signature:
                raise InvalidSignatureError(
                    "Signature mismatch: expected %r, got %r" % (
                        self.expected_signature, self.request_signature))
        except (AttributeError, KeyError, ValueError) as e:
            raise InvalidSignatureError(str(e))

        return True
1082207
def tilequeue_tile_status(cfg, peripherals, args):
    
    logger = make_logger(cfg, 'tile_status')

    # friendly warning to avoid confusion when this command outputs nothing
    # at all when called with no positional arguments.
    if not args.coords:
        logger.warning('No coordinates given on the command line.')
        return

    # pre-load TOI to avoid having to do it for each coordinate
    toi = None
    if peripherals.toi:
        toi = peripherals.toi.fetch_tiles_of_interest()

    # TODO: make these configurable!
    tile_format = lookup_format_by_extension('zip')
    store = _make_store(cfg)

    for coord_str in args.coords:
        coord = deserialize_coord(coord_str)

        # input checking! make sure that the coordinate is okay to use in
        # the rest of the code.
        if not coord:
            logger.warning('Could not deserialize %r as coordinate', coord_str)
            continue

        if not coord_is_valid(coord):
            logger.warning('Coordinate is not valid: %r (parsed from %r)',
                           coord, coord_str)
            continue

        # now we think we probably have a valid coordinate. go look up
        # whether it exists in various places.

        logger.info("=== %s ===", coord_str)
        coord_int = coord_marshall_int(coord)

        if peripherals.inflight_mgr:
            is_inflight = peripherals.inflight_mgr.is_inflight(coord)
            logger.info('inflight: %r', is_inflight)

        if toi:
            in_toi = coord_int in toi
            logger.info('in TOI: %r' % (in_toi,))

        data = store.read_tile(coord, tile_format)
        logger.info('tile in store: %r', bool(data))
524677
def is_time(self):
        """"""
        dt = DATA_TYPES['time']
        if type(self.data) is dt['type'] and ':' in str(self.data) and str(self.data).count(':') == 2:
            # Separate hour, month, second
            date_split = str(self.data).split(':')
            h, m, s = date_split[0], date_split[1], date_split[2]

            # Validate values
            valid_hour, valid_min, valid_sec = int(h) in HOURS, int(m) in MINUTES, int(float(s)) in SECONDS

            if all(i is True for i in (valid_hour, valid_min, valid_sec)):
                self.type = 'time'.upper()
                self.len = None
                return True
55363
def timestamp
      if File.exist?(name)
        File.mtime(name.to_s)
      else
        Rake::EARLY
      end
    end
1292194
def is_up_to_date(outfile, basedatetime):
        # type: (AnyStr, datetime) -> bool
        """"""
        if os.path.exists(outfile):
            if os.path.getmtime(outfile) >= basedatetime:
                return True
        return False
930688
def is_valid(self) -> bool:
        """"""
        if self.bot.config.SESSION_EXPIRE_TIMEOUT and \
                self._last_interaction and \
                datetime.now() - self._last_interaction > \
                self.bot.config.SESSION_EXPIRE_TIMEOUT:
            return False
        return True
859490
function verifyNonce( $timestamp, $md5 ) {

		// Within range of 5 minutes?
		$within_range = time() - $timestamp;
		if ( $within_range > ( MINUTE_IN_SECONDS * 5 ) ) {
			return false;
		}

		// Correct md5?
		if ( md5( NONCE_KEY . $timestamp ) !== $md5 ) {
			return false;
		}

		return true;
	}
59696
boolean hasValidTimes() {

        if ((getEnd() > 0L) && (getEnd() < System.currentTimeMillis())) {
            return false;
        }

        return ((getEnd() == 0) | (getStart() == 0)) || (getEnd() >= getStart());
    }
841451
def check_stale(package_info, *args):
    
    reason = 'Package not updated in {} days'.format(DAYS_STALE)
    result = False

    now = datetime.utcnow()

    release_urls = args[0]
    if len(release_urls) > 0:
        package_uploaded_time = release_urls[0]['upload_time']
        if now - timedelta(days=DAYS_STALE) <= package_uploaded_time:
            result = True

    return result, reason, NOT_STALE
959042
def is_timestamp(instance):
    """"""
    if not isinstance(instance, (int, str)):
        return True
    return datetime.fromtimestamp(int(instance))
559698
function() {
          return {
            tileCount: tileSpans.length,
            layoutTime: layoutTime,
            mapTime: mapTime,
            reflowTime: reflowTime,
            totalTime: layoutTime + mapTime + reflowTime
          };
        }
50026
def is_time_day_valid(self, timestamp):
        
        (start_time, end_time) = self.get_start_and_end_time(timestamp)
        return start_time <= timestamp <= end_time
466857
def certify_time(value, required=True):
    
    if certify_required(
        value=value,
        required=required,
    ):
        return

    if not isinstance(value, time):
        raise CertifierTypeError(
            message="expected timestamp (time), but value is of type {cls!r}".format(
                cls=value.__class__.__name__),
            value=value,
            required=required,
        )
295707
def certify_timestamp(value, required=True):
    
    if certify_required(
        value=value,
        required=required,
    ):
        return

    if not isinstance(value, datetime):
        raise CertifierTypeError(
            message="expected timestamp (datetime), but value is of type {cls!r}".format(
                cls=value.__class__.__name__),
            value=value,
            required=required,
        )