A method to check that elements of time_vary are lists.
965966
def checkElementsOfTimeVaryAreLists(self):
        
        for param in self.time_vary:
            assert type(getattr(self,param))==list,param + ' is not a list, but should be' + \
                                                   ' because it is in time_vary'
254033
def check_array_or_list(input):
    """"""
    if type(input) != np.ndarray:
        if type(input) == list:
            output = np.array(input)
        else:
            raise TypeError('Expecting input type as ndarray or list.')
    else:
        output = input

    if output.ndim != 1:
        raise ValueError('Input array must have 1 dimension.')

    if np.sum(output < 0.) > 0:
            raise ValueError("Input array values cannot be negative.")

    return output
1050587
def run_checks(self):
        

        result = True
        differences_dict = {}

        if 'tables' not in self.ignore_list:
            tmp_result, differences_dict['tables'] = self.check_tables()
            result = False if not tmp_result else result
        if 'columns' not in self.ignore_list:
            tmp_result, differences_dict['columns'] = self.check_columns(
                'views' not in self.ignore_list)
            result = False if not tmp_result else result
        if 'constraints' not in self.ignore_list:
            tmp_result, differences_dict['constraints'] = \
                self.check_constraints()
            result = False if not tmp_result else result
        if 'views' not in self.ignore_list:
            tmp_result, differences_dict['views'] = self.check_views()
            result = False if not tmp_result else result
        if 'sequences' not in self.ignore_list:
            tmp_result, differences_dict['sequences'] = self.check_sequences()
            result = False if not tmp_result else result
        if 'indexes' not in self.ignore_list:
            tmp_result, differences_dict['indexes'] = self.check_indexes()
            result = False if not tmp_result else result
        if 'triggers' not in self.ignore_list:
            tmp_result, differences_dict['triggers'] = self.check_triggers()
            result = False if not tmp_result else result
        if 'functions' not in self.ignore_list:
            tmp_result, differences_dict['functions'] = self.check_functions()
            result = False if not tmp_result else result
        if 'rules' not in self.ignore_list:
            tmp_result, differences_dict['rules'] = self.check_rules()
            result = False if not tmp_result else result
        if self.verbose_level == 0:
            differences_dict = None
        return result, differences_dict
836930
def has_multiple_timesteps(data):
    """"""
    if "timestep" in data.keys():
        if len(np.unique(data["timestep"])) > 1:
            return True
    return False
1331236
public boolean containsInterval(Interval<T> i) {

        for (Interval<T> item : intervals) {
            if (item.contains(i)) {
                return true;
            }
        }

        return false;
    }
284974
def _all_correct_list(array):
    
    if type(array) not in _ITERABLE_TYPES:
        return False

    for item in array:
        if not type(item) in _ITERABLE_TYPES:
            return False

        if len(item) != 2:
            return False

    return True
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
863581
def timestamps_from_file_list(file_list):
        ""
        timestamps = np.array([Kinect.timestamp_from_filename(fname) for fname in file_list])

        # Handle overflow
        diff = np.diff(timestamps)
        idxs = np.flatnonzero(diff < 0)
        ITEM_SIZE = 2**32
        for i in idxs:
            timestamps[i+1:] += ITEM_SIZE

        return timestamps.flatten()
405098
def check_schedule():
    """"""
    all_items = prefetch_schedule_items()
    for validator, _type, _msg in SCHEDULE_ITEM_VALIDATORS:
        if validator(all_items):
            return False

    all_slots = prefetch_slots()
    for validator, _type, _msg in SLOT_VALIDATORS:
        if validator(all_slots):
            return False
    return True
520124
def is_dictlist(data):
    '''
    
    '''
    if isinstance(data, list):
        for element in data:
            if isinstance(element, dict):
                if len(element) != 1:
                    return False
            else:
                return False
        return True
    return False
787109
def timeseries(datasets):
    """"""
    expanded_ds = []
    for ds in datasets:
        tmp = ds.expand_dims("time")
        tmp.coords["time"] = pd.DatetimeIndex([ds.attrs["start_time"]])
        expanded_ds.append(tmp)

    res = xr.concat(expanded_ds, dim="time")
    res.attrs = combine_metadata(*[x.attrs for x in expanded_ds])
    return res
1175907
private void validateSameDay(ProjectCalendar calendar, LinkedList<TimephasedWork> list)
   {
      for (TimephasedWork assignment : list)
      {
         Date assignmentStart = assignment.getStart();
         Date calendarStartTime = calendar.getStartTime(assignmentStart);
         Date assignmentStartTime = DateHelper.getCanonicalTime(assignmentStart);
         Date assignmentFinish = assignment.getFinish();
         Date calendarFinishTime = calendar.getFinishTime(assignmentFinish);
         Date assignmentFinishTime = DateHelper.getCanonicalTime(assignmentFinish);
         double totalWork = assignment.getTotalAmount().getDuration();

         if (assignmentStartTime != null && calendarStartTime != null)
         {
            if ((totalWork == 0 && assignmentStartTime.getTime() != calendarStartTime.getTime()) || (assignmentStartTime.getTime() < calendarStartTime.getTime()))
            {
               assignmentStart = DateHelper.setTime(assignmentStart, calendarStartTime);
               assignment.setStart(assignmentStart);
            }
         }

         if (assignmentFinishTime != null && calendarFinishTime != null)
         {
            if ((totalWork == 0 && assignmentFinishTime.getTime() != calendarFinishTime.getTime()) || (assignmentFinishTime.getTime() > calendarFinishTime.getTime()))
            {
               assignmentFinish = DateHelper.setTime(assignmentFinish, calendarFinishTime);
               assignment.setFinish(assignmentFinish);
            }
         }
      }
   }
299039
function isValueInList(list, value) {
    for (var i = list.length - 1; i >= 0; i--) {
        if (list[i] == value) {
            return true;
        }
    }
    return false;
}
1043960
def _check_data(self, X):
        '''
        
        '''

        if len(X) > 1:
            sval = np.unique(X[0][:, 1])
            if np.all([np.all(np.unique(X[i][:, 1]) == sval) for i in range(1, len(X))]):
                pass
            else:
                raise ValueError("Unique identifier var_types not consistent between time series")
408485
private boolean isTimeAfterOrEquals(Calendar time1, Calendar time2) {
        return !(time1 == null || time2 == null) && time1.getTimeInMillis() >= time2.getTimeInMillis();
    }
1104256
def ensure_list(value: Union[T, Sequence[T]]) -> Sequence[T]:
    """"""
    if value is None:
        return []
    return value if isinstance(value, list) else [value]
440446
private boolean hasTimestamp(Iterable<TimestampedValue<Object>> elements) {
		Iterator<TimestampedValue<Object>> it = elements.iterator();
		if (it.hasNext()) {
			return it.next().hasTimestamp();
		}
		return false;
	}