human readable schedule
481760
def to_s
      res = ""
      res << "#{self.gamedays.size.to_s} gamedays\n"
      self.gamedays.each do |gd|
        res << gd.date.strftime("%Y-%m-%d") + "\n"
        res << "==========\n"
        gd.games.sort{|g1,g2| g1.gt == g2.gt ? g1.ps <=> g2.ps : g1.gt <=> g2.gt}.each do |g|
          res << "#{g.ta.to_s} VS #{g.tb.to_s} on playing surface #{g.ps} at #{g.gt.strftime("%I:%M %p")}\n"
        end
        res << "\n"
      end
      res
    end
180761
function CalendarList(_super) {
  _super(this, {
     flexGrow: 1,
     alignSelf: FlexLayout.AlignSelf.STRETCH,
     backgroundColor: Color.GREEN, 
  });
  
  this.init();
}
53520
def handle_time(msg):
    """"""
    return msg.copy(ack=0, payload=calendar.timegm(time.localtime()))
17602
private void processCalendars()
   {
      List<Row> rows = getRows("calendar", null, null);
      m_reader.processCalendars(rows);
   }
460008
public static String schedule(String schedulingPattern, Runnable task) {
		return scheduler.schedule(schedulingPattern, task);
	}
53512
private ScheduledFuture<?> scheduleWriterMetricsUpdater(ScheduledThreadPoolExecutor writerMetricsUpdater,
      long scheduleInterval) {
    return writerMetricsUpdater.scheduleAtFixedRate(new WriterMetricsUpdater(), scheduleInterval, scheduleInterval,
        TimeUnit.MILLISECONDS);
  }
226657
def to_html
      time_header, rows = '<th></th>', Array.new
      end_time = Time.new(2013, 1, 1, 21, 0, 0)

      # make the time row
      @time = Time.new(2013, 1, 1, 9, 0, 0)
      while @time < end_time
        time_header += "<th>#{@time.strftime("%-k:%M")}</th>"
        @time += 900
      end

      #make each day row
      (0..4).each do |day|
        classes = @timetable.classes_for_day(day)
        rows << day_row(day, classes)
      end

      rows_str, id_str = '', "id=\"#{@timetable.name}\""
      rows.each{ |r| rows_str += "<tr class=\"day\">\n#{r}\n</tr>\n" }

      %Q{
        <!DOCTYPE html>
        <html>
        <head>
          <title>#{@timetable.name || 'Timetable' } - Timetablr.co</title>
          <style>#{build_css}</style>
        </head>
        <body>
          <h3>#{@timetable.name}</h3>
          <table #{id_str if @timetable.name}>
            <tr id="time">#{time_header}</tr>
            #{rows_str}
          </table>
        </body>
        </html>
      }
    end
665516
function(schedule, useSeconds) {
    var textParts = [];

    // A later.js schedules contains no member for time units where an asterisk is used,
    // but schedules that means the same (e.g 0/1 is essentially the same as *) are
    // returned with populated members.
    // Remove all members that are fully populated to reduce complexity of code
    removeFromSchedule( schedule, 'M', 12 );
    removeFromSchedule( schedule, 'D', 31 );
    removeFromSchedule( schedule, 'd', 7 );
    removeFromSchedule( schedule, 'h', 24 );
    removeFromSchedule( schedule, 'm', 60 );
    removeFromSchedule( schedule, 's', 60 );

    var everySecond = useSeconds && schedule['s'] === undefined,
        everyMinute = schedule['m'] === undefined,
        everyHour = schedule['h'] === undefined
        everyWeekday = schedule['d'] === undefined
        everyDayInMonth = schedule['D'] === undefined,
        everyMonth = schedule['M'] === undefined;

    var oneOrTwoSecondsPerMinute = schedule['s'] && schedule['s'].length <= 2;
    var oneOrTwoMinutesPerHour = schedule['m'] && schedule['m'].length <= 2;
    var oneOrTwoHoursPerDay = schedule['h'] && schedule['h'].length <= 2;
    var onlySpecificDaysOfMonth = schedule['D'] && schedule['D'].length !== 31;
    if ( oneOrTwoHoursPerDay && oneOrTwoMinutesPerHour && oneOrTwoSecondsPerMinute ) {
      // If there are only one or two specified values for
      // hour or minute, print them in HH:MM format, or HH:MM:ss if seconds are used
      // If seconds are not used, later.js returns one element for the seconds (set to zero)

      var hm = [];
      var m = moment();
      for (var i=0; i < schedule['h'].length; i++) {
        for (var j=0; j < schedule['m'].length; j++) {
          for (var k=0; k < schedule['s'].length; k++) {
            m.hour(schedule['h'][i]);
            m.minute(schedule['m'][j]);
            m.second(schedule['s'][k]);
            hm.push(m.format( useSeconds ? 'HH:mm:ss' : 'HH:mm'));
          }
        }
      }
      if (hm.length < 2) {
        textParts.push( hm[0] );
      } else {
        var last_val = hm.pop();
        textParts.push( hm.join(', ') + ' and ' + last_val );
      }
      if (everyWeekday && everyDayInMonth) {
        textParts.push('every day');
      }

    } else {
      var seconds = getSecondsTextParts(schedule['s']);
      var minutes = getMinutesTextParts(schedule['m']);
      var beginning = '';
      var end = '';

      textParts.push('Every');

      // Otherwise, list out every specified hour/minute value.
      var hasSpecificSeconds = schedule['s'] && (
          schedule['s'].length > 1 && schedule['s'].length < 60 ||
          schedule['s'].length === 1 && schedule['s'][0] !== 0 );
      if(hasSpecificSeconds) {
        beginning = seconds.beginning;
        end = seconds.text;
      }

      if(schedule['h']) { // runs only at specific hours
        if( hasSpecificSeconds ) {
          end += ' on the ';
        }
        if (schedule['m']) { // and only at specific minutes
          var hours = numberList(schedule['h']) + ' hour';
          if( !hasSpecificSeconds && isOnTheHour(schedule['m']) ) {
            textParts = [ 'On the' ];
            end += hours;
          } else {
            beginning = minutes.beginning;
            end += minutes.text + ' past the ' + hours;
          }
        } else { // specific hours, but every minute
          end += 'minute of ' + numberList(schedule['h']) + ' hour';
        }
      } else if(schedule['m']) { // every hour, but specific minutes
        beginning = minutes.beginning;
        end += minutes.text;
        if( !isOnTheHour(schedule['m']) && ( onlySpecificDaysOfMonth || schedule['d'] || schedule['M'] ) ) {
          end += ' past every hour';
        }
      } else if( !schedule['s'] && !schedule['m'] ) {
        beginning = seconds.beginning;
      } else if( !useSeconds || !hasSpecificSeconds) { // cronspec has "*" for both hour and minute
        beginning += minutes.beginning;
      }
      textParts.push(beginning);
      textParts.push(end);
    }

    if (onlySpecificDaysOfMonth) { // runs only on specific day(s) of month
      textParts.push('on the ' + numberList(schedule['D']));
      if (!schedule['M']) {
        textParts.push('of every month');
      }
    }

    if (schedule['d']) { // runs only on specific day(s) of week
      if (schedule['D']) {
        // if both day fields are specified, cron uses both; superuser.com/a/348372
        textParts.push('and every');
      } else {
        textParts.push('on');
      }
      textParts.push(dateList(schedule['d'], 'dow'));
    }

    if (schedule['M']) {
      if( schedule['M'].length === 12 ) {
        textParts.push('day of every month');
      } else {
        // runs only in specific months; put this output last
        textParts.push('in ' + dateList(schedule['M'], 'mon'));
      }
    }

    return textParts.filter(function(p) { return p; }).join(' ');
  }
943505
def schedule(dev):
    
    # TODO: expose setting the schedule somehow?
    for d in range(7):
        dev.query_schedule(d)
    for day in dev.schedule.values():
        click.echo("Day %s, base temp: %s" % (day.day, day.base_temp))
        current_hour = day.next_change_at
        for hour in day.hours:
            if current_hour == 0: continue
            click.echo("\t[%s-%s] %s" % (current_hour, hour.next_change_at, hour.target_temp))
            current_hour = hour.next_change_at
768884
def pretty_print_schedule(self, hyperband_schedule, describe_hyperband=True):
        
        print("=========================================")
        print("|           Hyperband Schedule          |")
        print("=========================================")
        if describe_hyperband:
            # Print a message indicating what the below schedule means
            print(
                "Table consists of tuples of "
                "(num configs, num_resources_per_config) "
                "which specify how many configs to run and "
                "for how many epochs. "
            )
            print(
                "Each bracket starts with a list of random "
                "configurations which is successively halved "
                "according the schedule."
            )
            print(
                "See the Hyperband paper "
                "(https://arxiv.org/pdf/1603.06560.pdf) for more details."
            )
            print("-----------------------------------------")
        for bracket_index, bracket in enumerate(hyperband_schedule):
            bracket_string = "Bracket %d:" % bracket_index
            for n_i, r_i in bracket:
                bracket_string += " (%d, %d)" % (n_i, r_i)
            print(bracket_string)
        print("-----------------------------------------")
684888
function( day, opens, closes, timezone, name = 'default' ) {
    const schedule = this.get( 'schedule' );
    const hours = expand( day ).map( day => {
      return {
        day,
        closes: normalize( closes ),
        opens: normalize( opens ),
        timezone: timezone
      };
    } );
    const season = schedule[ name ] || [];
    this.set( 'schedule', {
      ...schedule,
      [ name ]: [ ...season, ...hours ]
    } );
  }
1289767
def _expand_scheduledict(scheduledict):
    """"""
    result = []
    def f(d):
        nonlocal result
        #print(d)
        d2 = {}
        for k,v in d.items():
            if isinstance(v, str) and _cronslash(v, k) is not None:
                d[k] = _cronslash(v, k)

        for k,v in d.items():
            if isinstance(v, Iterable):
                continue
            else:
                d2[k] = v

        if len(d2.keys()) == len(d.keys()):
            result.append(d2)
            return

        for k,v in d.items():
            if isinstance(v, Iterable):
                for i in v:
                    dprime = dict(**d)
                    dprime[k] = i
                    f(dprime)
                break
    f(scheduledict)
    return result
270517
function matchSchedule (value, sequence) {
    for (var i = 0, c = sequence.length; i < c; i++) {
      if (sequence[i] >= value) {
        return sequence[i] === value;
      }
    }

    return sequence[0] === value;
  }
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)
960077
def every(time)
            ms = Scheduler.parse_in(time)
            event = Repeat.new(self, ms)
            event.progress &Proc.new if block_given?
            schedule(event)
            event
        end
831524
def make_schedule_row(schedule_day, slot, seen_items):
    """"""
    row = ScheduleRow(schedule_day, slot)
    skip = {}
    expanding = {}
    all_items = list(slot.scheduleitem_set
                     .select_related('talk', 'page', 'venue')
                     .all())

    for item in all_items:
        if item in seen_items:
            # Inc rowspan
            seen_items[item]['rowspan'] += 1
            # Note that we need to skip this during colspan checks
            skip[item.venue] = seen_items[item]
            continue
        scheditem = {'item': item, 'rowspan': 1, 'colspan': 1}
        row.items[item.venue] = scheditem
        seen_items[item] = scheditem
        if item.expand:
            expanding[item.venue] = []

    empty = []
    expanding_right = None
    skipping = 0
    skip_item = None
    for venue in schedule_day.venues:
        if venue in skip:
            # We need to skip all the venues this item spans over
            skipping = 1
            skip_item = skip[venue]
            continue
        if venue in expanding:
            item = row.items[venue]
            for empty_venue in empty:
                row.items.pop(empty_venue)
                item['colspan'] += 1
            empty = []
            expanding_right = item
        elif venue in row.items:
            empty = []
            expanding_right = None
        elif expanding_right:
            expanding_right['colspan'] += 1
        elif skipping > 0 and skipping < skip_item['colspan']:
            skipping += 1
        else:
            skipping = 0
            empty.append(venue)
            row.items[venue] = {'item': None, 'rowspan': 1, 'colspan': 1}

    return row
761538
function getChannelsSchedule(channel,date){
  var p = '/ibl/v1/channels/{channel}/schedule/{date}';
  p = p.replace('{channel}',channel);
  p = p.replace('{date}',date);
  return p;
}