Generate delay millis list by given plans string, separated by comma.<br/>
eg, 03:00-05:00,13:00-14:00
177337
public static List<Long> getDelayMillsList(String schedulePlans) {
		List<Long> result = new ArrayList<>();
		String[] plans = StringUtils.split(schedulePlans, ',');
		for (String plan : plans) {
			result.add(getDelayMillis(plan));
		}
		return result;
	}
892499
def compact_timeslot(sind_list):
    
    tls = sorted(sind_list)
    conversion = {val: idx for idx, val in enumerate(tls)}
    return conversion
1343856
def time_to_text(time):
    """"""
    
    if time < 0.001:
        return str(round(time * 1000000)) + " µs"
    elif time < 1:
        return str(round(time * 1000)) + " ms"
    elif time < 60:
        return str(round(time, 1)) + " s"
    else:
        return str(round(time / 60, 1)) + " min"
880927
public String getMilliseconds() {
        if (myTimerIsRunning) {
            throw new IllegalStateException(LOGGER.getI18n(MessageCodes.UTIL_042));
        }

        return new StringBuilder().append(myStop - myStart).append(" msecs").toString();
    }
989954
public static String toTimeWithMinorUnit(long millis) {
		if (millis < MILLIS_PER_SECOND) {
			return String.format("%4dms", millis);
		}

		if (millis < MILLIS_PER_MINUTE) {
			return String.format("%02ds", millis / MILLIS_PER_SECOND);
		}

		if (millis < MILLIS_PER_HOUR) {
			return String.format("%02dm%02ds", millis / MILLIS_PER_MINUTE, (millis / MILLIS_PER_SECOND) % 60);
		}

		if (millis < MILLIS_PER_DAY) {
			return String.format("%02dh%02dm", millis / MILLIS_PER_HOUR, (millis / MILLIS_PER_MINUTE) % 60);
		}

		return String.format("%dd%02dh", millis / MILLIS_PER_DAY, (millis / MILLIS_PER_HOUR) % 24);
	}
1083006
def _build_str_from_time_items(items):
    
    if not items:
        return None
    items = [int(item) for item in items if item]
    items = items + [0 for _ in xrange(6-len(items))]
    return '%d-%02d-%02d %02d:%02d:%02d' % (items[0], items[1], items[2], items[3], items[4], items[5])
1365068
private static List<String> getExtensionForWildcard(final String pMIME) {
        final String family = pMIME.substring(0, pMIME.length() - 1);
        Set<String> extensions = new LinkedHashSet<String>();
        for (Map.Entry<String, List<String>> mimeToExt : sMIMEToExt.entrySet()) {
            if ("*/".equals(family) || mimeToExt.getKey().startsWith(family)) {
                extensions.addAll(mimeToExt.getValue());
            }
        }
        return Collections.unmodifiableList(new ArrayList<String>(extensions));
    }
454619
private static String millisToOffset(int millis) {
        StringBuilder sb = new StringBuilder(7);
        if (millis >= 0) {
            sb.append('+');
        } else {
            sb.append('-');
            millis = -millis;
        }
        int hour, min, sec;
        int t = millis / 1000;

        sec = t % 60;
        t = (t - sec) / 60;
        min = t % 60;
        hour = t / 60;

        sb.append(numToString(hour, 2));
        sb.append(numToString(min, 2));
        sb.append(numToString(sec, 2));

        return sb.toString();
    }
908454
def prepare_time_millis(data, schema):
    """"""
    if isinstance(data, datetime.time):
        return int(
            data.hour * MLS_PER_HOUR + data.minute * MLS_PER_MINUTE
            + data.second * MLS_PER_SECOND + int(data.microsecond / 1000))
    else:
        return data
1023748
def str_to_time(self):
        

        return datetime(*list(map(int, re.split(r'-|:|T', self.time))))
389839
public static String formatTimeConsumingInfo(long startPoint) {
        StringBuffer buff = new StringBuffer();
        long totalMilTimes = System.currentTimeMillis() - startPoint;
        int hour = (int) Math.floor(totalMilTimes / (60*60*1000));
        int mi = (int) Math.floor(totalMilTimes / (60*1000));
        int se = (int) Math.floor((totalMilTimes - 60000 * mi) / 1000);
        if(hour > 0)buff.append(hour).append("小时");
        if(mi > 0)buff.append(mi).append("分");
        if(hour == 0)buff.append(se).append("秒");
        return buff.toString();
    }
837872
public static String printTiming(long start, long end) {
    long totalMillis = end - start;
    long mins = TimeUnit.MILLISECONDS.toMinutes(totalMillis);
    long secs = TimeUnit.MILLISECONDS.toSeconds(totalMillis) - TimeUnit.MINUTES.toSeconds(mins);
    long millis =
        TimeUnit.MILLISECONDS.toMillis(totalMillis) - TimeUnit.MINUTES.toMillis(mins) - TimeUnit.SECONDS.toMillis(secs);
    return String.format("%d min, %d sec, %d millis", mins, secs, millis);
  }
667919
@Deprecated
    public static void appendEpoch(StringBuilder buf, long timeMillis) {
        buf.append(dateTimeFormatter.format(Instant.ofEpochMilli(timeMillis)))
           .append('(').append(timeMillis).append(')');
    }
753598
def generate_scheduling_block_id(num_blocks, project='test'):
    """"""
    _date = strftime("%Y%m%d", gmtime())
    _project = project
    for i in range(num_blocks):
        yield '{}-{}-sbi{:03d}'.format(_date, _project, i)
26064
public static long getDelayMillis(String time) {
		String pattern = "HH:mm";
		Date now = new Date();
		if (StringUtils.contains(time, "-")) {
			String start = time.split("-")[0];
			String end = time.split("-")[1];
			if (StringUtils.contains(start, ":") && StringUtils.contains(end, ":")) {
				Date d1 = getCurrentDateByPlan(start, pattern);
				Date d2 = getCurrentDateByPlan(end, pattern);
				while (d1.before(now)) {
					d1 = DateUtils.addDays(d1, 1);
				}

				while (d2.before(d1)) {
					d2 = DateUtils.addDays(d2, 1);
				}

				return RandomUtil.nextLong(d1.getTime() - now.getTime(), d2.getTime() - now.getTime());
			}
		} else if (StringUtils.isNumeric(time)) {
			return Long.parseLong(time);
		}

		// default
		return getDelayMillis("02:00-05:00");
	}
1121888
@Override
    public <B extends Appendable> B format(final long millis, final B buf) {
        final Calendar c = newCalendar();
        c.setTimeInMillis(millis);
        return applyRules(c, buf);
    }
6746
def decode_schedule(string):
  
  splits = string.split()
  steps = [int(x[1:]) for x in splits[1:] if x[0] == '@']
  pmfs = np.reshape(
      [float(x) for x in splits[1:] if x[0] != '@'], [len(steps), -1])
  return splits[0], tuplize(steps), tuplize(pmfs)