// GetPeriod returns the window size.
519257
func (sma SMASeries) GetPeriod(defaults ...int) int {
	if sma.Period == 0 {
		if len(defaults) > 0 {
			return defaults[0]
		}
		return DefaultSimpleMovingAveragePeriod
	}
	return sma.Period
}
799872
func (c Calendar) formatDateTimeComponentPeriod(datetime time.Time, length int) (string, error) {
	hour := datetime.Hour()

	switch length {
	case datetimeFormatLength1Plus:
		return c.formatDateTimeComponentPeriodWide(hour), nil
	case datetimeFormatLengthAbbreviated:
		return c.formatDateTimeComponentPeriodAbbreviated(hour), nil
	case datetimeFormatLengthWide:
		return c.formatDateTimeComponentPeriodWide(hour), nil
	case datetimeFormatLengthNarrow:
		return c.formatDateTimeComponentPeriodNarrow(hour), nil
	}

	return "", fmt.Errorf("unsupported day-period: %d", length)
}
903325
func (s *Datastore) SetRetentionPeriod(v *RetentionPeriod) *Datastore {
	s.RetentionPeriod = v
	return s
}
1004148
func getVersionPeriodically(stopCh <-chan struct{}) {
	lastSeenBinaryVersion := ""
	for {
		if err := getVersion(&lastSeenBinaryVersion); err != nil {
			klog.Errorf("Failed to fetch etcd version: %v", err)
		}
		select {
		case <-stopCh:
			break
		case <-time.After(scrapeTimeout):
		}
	}
}
50388
func (s *ClusterSnapshotCopyStatus) SetRetentionPeriod(v int64) *ClusterSnapshotCopyStatus {
	s.RetentionPeriod = &v
	return s
}
242735
func (s *Session) RenewPeriodic(initialTTL string, id string, q *WriteOptions, doneCh <-chan struct{}) error {
	ctx := q.Context()

	ttl, err := time.ParseDuration(initialTTL)
	if err != nil {
		return err
	}

	waitDur := ttl / 2
	lastRenewTime := time.Now()
	var lastErr error
	for {
		if time.Since(lastRenewTime) > ttl {
			return lastErr
		}
		select {
		case <-time.After(waitDur):
			entry, _, err := s.Renew(id, q)
			if err != nil {
				waitDur = time.Second
				lastErr = err
				continue
			}
			if entry == nil {
				return ErrSessionExpired
			}

			// Handle the server updating the TTL
			ttl, _ = time.ParseDuration(entry.TTL)
			waitDur = ttl / 2
			lastRenewTime = time.Now()

		case <-doneCh:
			// Attempt a session destroy
			s.Destroy(id, q)
			return nil

		case <-ctx.Done():
			// Bail immediately since attempting the destroy would
			// use the canceled context in q, which would just bail.
			return ctx.Err()
		}
	}
}
786060
func (s *BudgetedAndActualAmounts) SetTimePeriod(v *TimePeriod) *BudgetedAndActualAmounts {
	s.TimePeriod = v
	return s
}
101395
func (s *ElasticsearchDestinationConfiguration) SetIndexRotationPeriod(v string) *ElasticsearchDestinationConfiguration {
	s.IndexRotationPeriod = &v
	return s
}
596086
func (s *PendingModifiedValues) SetBackupRetentionPeriod(v int64) *PendingModifiedValues {
	s.BackupRetentionPeriod = &v
	return s
}
586417
func (s *Dataset) SetRetentionPeriod(v *RetentionPeriod) *Dataset {
	s.RetentionPeriod = v
	return s
}
700481
func (v *Window) GetSize() (width int, height int) {
	var cwidth, cheight C.gint
	C.gtk_window_get_size(WINDOW(v), &cwidth, &cheight)
	return int(cwidth), int(cheight)
}
139620
func (s *HlsGroupSettings) SetProgramDateTimePeriod(v int64) *HlsGroupSettings {
	s.ProgramDateTimePeriod = &v
	return s
}
1305578
func (c *ConfigurationData) GetUserDeactivationInactivityPeriodDays() time.Duration {
	return time.Duration(c.v.GetInt(varUserDeactivationInactivityPeriodDays)) * 24 * time.Hour
}
1255083
func (s *CreateChannelInput) SetRetentionPeriod(v *RetentionPeriod) *CreateChannelInput {
	s.RetentionPeriod = v
	return s
}
389818
func (s *CreateDatasetOutput) SetRetentionPeriod(v *RetentionPeriod) *CreateDatasetOutput {
	s.RetentionPeriod = v
	return s
}
139446
func MinCyclePeriod(d time.Duration) detector.Option {
	return func(di interface{}) detector.Option {
		md := di.(*MasterDetector)
		old := md.minDetectorCyclePeriod
		md.minDetectorCyclePeriod = d
		return MinCyclePeriod(old)
	}
}
428592
func CheckPeriod(d time.Duration) CircuitBreakerOption {
	return func(c *CircuitBreaker) error {
		c.checkPeriod = d
		return nil
	}
}