Maps values from 0 to 1 to the provided start and end time

    Input is a list of tuples of the form
    ([(time1, pitch1), (time2, pitch2),...]
18336
def _makeTimingAbsolute(relativeDataList, startTime, endTime):
    '''
    
    '''

    timingSeq = [row[0] for row in relativeDataList]
    valueSeq = [list(row[1:]) for row in relativeDataList]
    
    absTimingSeq = makeSequenceAbsolute(timingSeq, startTime, endTime)

    absDataList = [tuple([time, ] + row) for time, row
                   in zip(absTimingSeq, valueSeq)]

    return absDataList
1037126
def iterperiods(self, start=None, end=None, value=None):
        
        start, end, mask = \
            self._check_boundaries(start, end, allow_infinite=False)

        value_function = self._value_function(value)

        # get start index and value
        start_index = self._d.bisect_right(start)
        if start_index:
            start_value = self._d[self._d.iloc[start_index - 1]]
        else:
            start_value = self.default

        # get last index before end of time span
        end_index = self._d.bisect_right(end)

        interval_t0, interval_value = start, start_value

        for interval_t1 in self._d.islice(start_index, end_index):

            if value_function(interval_t0, interval_t1, interval_value):
                yield interval_t0, interval_t1, interval_value

            # set start point to the end of this interval for next
            # iteration
            interval_t0 = interval_t1
            interval_value = self[interval_t0]

        # yield the time, duration, and value of the final period
        if interval_t0 < end:
            if value_function(interval_t0, end, interval_value):
                yield interval_t0, end, interval_value
811496
def touch(file, times=None):
  
  if times:
    if len(times) > 2:
      raise ValueError('times must either be a tuple of (atime, mtime) or else a single time value '
                       'to use for both.')

    if len(times) == 1:
      times = (times, times)

  with safe_open(file, 'a'):
    os.utime(file, times)
1225964
function(start, end, options) {
    var values = [], i;
    for (i = start; i < end; i++) {
      if (options && options.skip) {
        if (i % options.skip === 0) {
          values.push(i);
        } else {
          values.push(undefined);
        }
      } else {
        values.push(i);
      }
    }
    return values;
  }
724101
public Map<Integer, List<Row>> createTimeEntryMap(List<Row> rows)
   {
      Map<Integer, List<Row>> map = new HashMap<Integer, List<Row>>();
      for (Row row : rows)
      {
         Integer workPatternID = row.getInteger("TIME_ENTRYID");
         List<Row> list = map.get(workPatternID);
         if (list == null)
         {
            list = new LinkedList<Row>();
            map.put(workPatternID, list);
         }
         list.add(row);
      }
      return map;
   }
1245288
def set_interval(self, start, end, value, compact=False):
        
        # for each interval to render
        for i, (s, e, v) in enumerate(self.iterperiods(start, end)):
            # look at all intervals included in the current interval
            # (always at least 1)
            if i == 0:
                # if the first, set initial value to new value of range
                self.set(s, value, compact)
            else:
                # otherwise, remove intermediate key
                del self[s]

        # finish by setting the end of the interval to the previous value
        self.set(end, v, compact)
625176
def to_ut1unix(time: Union[str, datetime, float, np.ndarray]) -> np.ndarray:
    
    # keep this order
    time = totime(time)

    if isinstance(time, (float, int)):
        return time

    if isinstance(time, (tuple, list, np.ndarray)):
        assert isinstance(time[0], datetime), f'expected datetime, not {type(time[0])}'
        return np.array(list(map(dt2ut1, time)))
    else:
        assert isinstance(time, datetime)
        return dt2ut1(time)
500726
def fill_date_range(start_date, end_date, date_format=None):
    

    if date_format:
        start_date = datetime.strptime(start_date, date_format).date()
        end_date = datetime.strptime(end_date, date_format).date()
    date_list = []
    while start_date <= end_date:
        date_list.append(start_date)
        start_date = start_date + timedelta(days=1)
    return date_list
983892
private Map<Integer, List<Row>> createTimeEntryMap(List<Row> rows) throws ParseException
   {
      Map<Integer, List<Row>> map = new HashMap<Integer, List<Row>>();
      for (Row row : rows)
      {
         Integer workPatternID = row.getInteger("ID");
         String shifts = row.getString("SHIFTS");
         map.put(workPatternID, createTimeEntryRowList(shifts));
      }
      return map;
   }
589276
private TimeUnit[] TimeEx(String tar,String timebase)
	{
		Matcher match;
		int startline=-1,endline=-1;

		String [] temp = new String[99];
		int rpointer=0;
		TimeUnit[] Time_Result = null;

		match=patterns.matcher(tar);	
		boolean startmark=true;
		while(match.find())
		{
			startline=match.start();
			if (endline==startline) 
			{
				rpointer--;
				temp[rpointer]=temp[rpointer]+match.group();
			}
			else
			{
				if(!startmark)
				{
					rpointer--;
					//System.out.println(temp[rpointer]);
					rpointer++;	
				}	
				startmark=false;
				temp[rpointer]=match.group();
			}
			endline=match.end();
			rpointer++;
		}
		if(rpointer>0)
		{
			rpointer--;
			//System.out.println(temp[rpointer]);
			rpointer++;
		}
		Time_Result=new TimeUnit[rpointer];
		//	System.out.println("Basic Data is " + timebase); 
		for(int j=0;j<rpointer;j++)
		{
			Time_Result[j]=new TimeUnit(temp[j],this);
			//System.out.println(result[j]);
		}

		return Time_Result;
	}
858686
function(start, end) {
      var current = parseInt(start), end = parseInt(end), values = [current]
      if (end > current) while (++current <= end) values.push(current)
      else               while (--current >= end) values.push(current)
      return '[' + values + ']'
    }
784789
def _makeTimingRelative(absoluteDataList):
    '''
    
    '''

    timingSeq = [row[0] for row in absoluteDataList]
    valueSeq = [list(row[1:]) for row in absoluteDataList]

    relTimingSeq, startTime, endTime = makeSequenceRelative(timingSeq)
    
    relDataList = [tuple([time, ] + row) for time, row
                   in zip(relTimingSeq, valueSeq)]

    return relDataList, startTime, endTime
640193
def _generate_time_values(self):
        
        # Populate time values
        log('writing times', 'INFO')
        d1970 = datetime(1970, 1, 1, tzinfo=utc)
        time_array = [[int((self.start_datetime - d1970).total_seconds())]]

        datetime_nc_start_simulation = self.start_datetime
        for raw_nc_index, raw_nc in enumerate(self.raw_nc_list):
            raw_nc_time = raw_nc.get_time_array(
                datetime_simulation_start=datetime_nc_start_simulation,
                simulation_time_step_seconds=self.time_step_array[
                    raw_nc_index])

            time_array.append(raw_nc_time)
            datetime_nc_start_simulation = \
                datetime.utcfromtimestamp(raw_nc_time[-1])

        self.cf_nc.variables['time'][:] = np.concatenate(time_array)
        end_date = datetime.utcfromtimestamp(self.cf_nc.variables['time'][-1])
        self.cf_nc.time_coverage_start = self.start_datetime.isoformat() + 'Z'
        self.cf_nc.time_coverage_end = end_date.isoformat() + 'Z'
749224
def split_input(cls, mapper_spec):
    
    params = _get_params(mapper_spec)
    shard_count = mapper_spec.shard_count

    # Pick out the overall start and end times and time step per shard.
    start_time = params[cls.START_TIME_PARAM]
    end_time = params[cls.END_TIME_PARAM]
    seconds_per_shard = (end_time - start_time) / shard_count

    # Create a LogInputReader for each shard, modulating the params as we go.
    shards = []
    for _ in xrange(shard_count - 1):
      params[cls.END_TIME_PARAM] = (params[cls.START_TIME_PARAM] +
                                    seconds_per_shard)
      shards.append(LogInputReader(**params))
      params[cls.START_TIME_PARAM] = params[cls.END_TIME_PARAM]

    # Create a final shard to complete the time range.
    params[cls.END_TIME_PARAM] = end_time
    return shards + [LogInputReader(**params)]
225609
def timeslot_options(
    interval=swingtime_settings.TIMESLOT_INTERVAL,
    start_time=swingtime_settings.TIMESLOT_START_TIME,
    end_delta=swingtime_settings.TIMESLOT_END_TIME_DURATION,
    fmt=swingtime_settings.TIMESLOT_TIME_FORMAT
):
    '''
    

    '''
    dt = datetime.combine(date.today(), time(0))
    dtstart = datetime.combine(dt.date(), start_time)
    dtend = dtstart + end_delta
    options = []

    while dtstart <= dtend:
        options.append((str(dtstart.time()), dtstart.strftime(fmt)))
        dtstart += interval

    return options
810805
def strftimegen(start_dt, end_dt):
    
    if start_dt > end_dt:
        raise ValueError("the start datetime is after the end datetime: (%r,%r)" % (start_dt, end_dt))

    def iterftime(string):
        date_subs = [i for i in DATE_FORMATS if i[1].search(string) is not None]
        if not date_subs:
            yield string
        else:
            dt = start_dt
            date_path = string
            while end_dt >= dt:
                for item in date_subs:
                    date_path = item[1].sub(dt.strftime(item[0]), date_path)
                yield date_path
                dt = dt + datetime.timedelta(days=1)

    return iterftime
855003
def rnd_datetime_array(self,
                           size, start=datetime(1970, 1, 1), end=datetime.now()):
        
        if isinstance(start, string_types):
            start = self.str2datetime(start)
        if isinstance(end, str):
            end = self.str2datetime(end)
        if start > end:
            raise ValueError("start time has to be earlier than end time")

        return self.randn(size, self._rnd_datetime, start, end)