Checks several conditions and set options needed
 to handle DateTime indexes properly.
331169
def provide_with_datetime_format(data, using)
      return unless defined?(Daru)
      return unless data.is_a?(Daru::DataFrame) || data.is_a?(Daru::Vector)
      return unless data.index.first.is_a?(DateTime)
      return if using[0..1] != '1:'
      @options = Hamster::Hash.new(
        xdata: 'time',
        timefmt: '%Y-%m-%dT%H:%M:%S',
        format_x: '%d\n%b\n%Y'
      ).merge(@options)
    end
188356
def check_in_bounds(self, date):
        '''
        '''
        dt = Timestamp(date)
        return ((self._lbound is None or dt >= self._lbound) and
                (self._rbound is None or dt <= self._rbound))
881177
public void checkForTimeAndDate(final ZonedDateTime DATE_TIME) {
        if (days.contains(DATE_TIME.getDayOfWeek())) { checkForTime(DATE_TIME.toLocalTime()); }
    }
44685
private static void checkPreconditions(final String dateFormat, final Locale locale) {
		if( dateFormat == null ) {
			throw new NullPointerException("dateFormat should not be null");
		} else if( locale == null ) {
			throw new NullPointerException("locale should not be null");
		}
	}
572303
def _new_DatetimeIndex(cls, d):
    

    if "data" in d and not isinstance(d["data"], DatetimeIndex):
        # Avoid need to verify integrity by calling simple_new directly
        data = d.pop("data")
        result = cls._simple_new(data, **d)
    else:
        with warnings.catch_warnings():
            # we ignore warnings from passing verify_integrity=False
            # TODO: If we knew what was going in to **d, we might be able to
            #  go through _simple_new instead
            warnings.simplefilter("ignore")
            result = cls.__new__(cls, verify_integrity=False, **d)

    return result
512506
def apply_time_to_configurations(self, configurations, data):
        """"""

        time_value = None
        if data.get('time'):
            time_value = data['time']

            # Only single time values are supported. For extents, just grab the first value
            if isinstance(data['time'], (tuple, list)):
                time_value = time_value[0]

        if time_value:
            for config in configurations:
                config.set_time_index_from_datetime(time_value, best_fit=ALLOW_BEST_FIT_TIME_INDEX)

        return configurations
453640
def issue_date(self, value):
        
        self._issue_date = parse(value).date() if isinstance(value, type_check) else value
677370
private static void updateCheckConflict(
            Map<TemporalField, Long> fieldValues,
            TemporalField targetField,
            TemporalField changeField,
            long changeValue) {
        
        Long old = fieldValues.put(changeField, changeValue);
        if (old != null && changeValue != old.longValue()) {
            throw new DateTimeException(
                    "Conflict found: " + changeField + " " + old +
                    " differs from " + changeField + " " + changeValue +
                    " while resolving  " + targetField);
        }
    }
1156427
def has_data_for_dates(series_or_df, first_date, last_date):
    
    dts = series_or_df.index
    if not isinstance(dts, pd.DatetimeIndex):
        raise TypeError("Expected a DatetimeIndex, but got %s." % type(dts))
    first, last = dts[[0, -1]]
    return (first <= first_date) and (last >= last_date)
970071
private void autoSetMissingValues() {
        // Ensure that a timestamp is set (to now at least!)
        if (event.getTimestamp() == null) {
            event.setTimestamp(new Date());
        }

        // Ensure that a platform is set
        if (event.getPlatform() == null) {
            event.setPlatform(DEFAULT_PLATFORM);
        }

        // Ensure that an SDK is set
        if (event.getSdk() == null) {
            event.setSdk(new Sdk(SentryEnvironment.SDK_NAME, SentryEnvironment.SDK_VERSION,
                sdkIntegrations));
        }

        // Ensure that a hostname is set
        if (event.getServerName() == null) {
            event.setServerName(HOSTNAME_CACHE.getHostname());
        }
    }
1004171
def quote_datetime(self, value):
        
        if value:
            if isinstance(value, type_check):
                self._quote_datetime = parse(value)
            elif isinstance(value, datetime.datetime):
                self._quote_datetime = value
1187403
private static void checkPreconditions(final Class<?> jodaClass,
			final DateTimeFormatter formatter) {
		if (jodaClass == null) {
			throw new NullPointerException("jodaClass should not be null");
		} else if (formatter == null) {
			throw new NullPointerException("formatter should not be null");
		}
	}
507907
public void validate() {
    if (start == null || start.isEmpty()) {
      throw new IllegalArgumentException("missing or empty start");
    }
    DateTime.parseDateTimeString(start, timezone);
    
    if (end != null && !end.isEmpty()) {
      DateTime.parseDateTimeString(end, timezone);
    }
    
    if (downsampler != null) {
      downsampler.validate();
    }
    
    if (aggregator == null || aggregator.isEmpty()) {
      throw new IllegalArgumentException("Missing or empty aggregator");
    }
    
    try {
      Aggregators.get(aggregator.toLowerCase());
    } catch (final NoSuchElementException e) {
      throw new IllegalArgumentException("Invalid aggregator");
    }
  }
474300
def validate(self,
                 asset,
                 amount,
                 portfolio,
                 algo_datetime,
                 algo_current_data):
        
        if self.restrictions.is_restricted(asset, algo_datetime):
            self.handle_violation(asset, amount, algo_datetime)
1130731
def value_validate(self, value):
        
        if not isinstance(value, datetime.datetime):
            raise tldap.exceptions.ValidationError("is invalid date time")
586041
def events_for_date_range(start_d, end_d, find_options = {})
      self.scoped(find_options).find(
        :all,
        :conditions => [ "(? <= #{self.quoted_table_name}.#{self.end_at_field}) AND (#{self.quoted_table_name}.#{self.start_at_field}< ?)", start_d.to_time.utc, end_d.to_time.utc ],
        :order => "#{self.quoted_table_name}.#{self.start_at_field} ASC"
      )
    end
1191529
public static function check(int $offsetMinute) : void
    {
        if ($offsetMinute < -59 || $offsetMinute > 59) {
            throw DateTimeException::fieldNotInRange(self::NAME, $offsetMinute, -59, 59);
        }
    }