remove a calendar config.

        Args:
            *dic (dict): dictionary with format {'Day': 12, 'Hour': 34} Avaliable keys are Month, Day, Weekday, Hour, Minute. *Note the uppercase.* You can use gen(), genMix() to generate complex config dictionary.
552429
def remove(self, *dic):
        '''
        '''
        dicList = list(flatten(dic))
        for d in dicList:
            di = []
            for k in d:
                # checkkey(k, self.keyword)
                di.append(Pair(k, IntegerSingle(d[k])))
            dictSingle = DictSingle(di)
            # append dict single to array single
            self._remove([dictSingle], self.l)
539801
def valid_date(key, config_date):
    
    key_date = "/".join(key.split("/")[4:7])
    return parse_date(key_date) > parse_date(config_date)
1069388
def writeICCdatetime(t=None):
    

    import time
    if t is None:
        t = time.gmtime()
    return struct.pack('>6H', *t[:6])
638542
def day_events_card(date):
    
    d = date.strftime(app_settings.DATE_FORMAT)
    card_title = 'Events on {}'.format(d)
    return {
            'card_title': card_title,
            'event_list': day_events(date=date),
            }
1279057
def generate_config(conf):
    

    c = {}
    def to_key(key, default):
        if conf.get(key):
            c[key] = '{} = {}'.format(key, conf.get(key))
        else:
            c[key] = default

    to_key('username', '# username = u1234...')
    to_key('password', '# password = secret...')
    to_key('from', '# from = elkme')
    to_key('to', '# to = +46700000000')
    return (True, c)
210136
function monthConfigs () {
  return [
    [{
      interval: Plottable.TimeInterval.month,
      step: 1,
      // full month name
      formatter: Plottable.Formatters.time('%B')
    }, {
      interval: Plottable.TimeInterval.year,
      step: 1,
      formatter: Plottable.Formatters.time('%Y')
    }],
    [{
      interval: Plottable.TimeInterval.month,
      step: 1,
      // short month name
      formatter: Plottable.Formatters.time('%b')
    }, {
      interval: Plottable.TimeInterval.year,
      step: 1,
      formatter: Plottable.Formatters.time('%Y')
    }],
    [{
      interval: Plottable.TimeInterval.month,
      step: 1,
      // month in numbers
      formatter: Plottable.Formatters.time('%m')
    }, {
      interval: Plottable.TimeInterval.year,
      step: 1,
      formatter: Plottable.Formatters.time('%Y')
    }],
    [{
      interval: Plottable.TimeInterval.month,
      step: 1,
      // month in numbers
      formatter: Plottable.Formatters.time('%-m')
    }, {
      interval: Plottable.TimeInterval.year,
      step: 1,
      formatter: Plottable.Formatters.time('%Y')
    }]
  ]
}
220877
def get_day_name(self) -> str:
        
        weekday = self.value.isoweekday() - 1
        return calendar.day_name[weekday]
1060917
def config_to_api_list(dic):
  
  config = [ ]
  for k, v in dic.iteritems():
    config.append({ 'name' : k, 'value': v })
  return { ApiList.LIST_KEY : config }
1370704
def dates(self, desc=None):
        ''''''
        c = self.dateinverse
        for key in self.keys(desc=desc):
            yield c(key)
546087
function configFromRFC2822(config) {
    var string, match, dayFormat,
        dateFormat, timeFormat, tzFormat;
    var timezones = {
        ' GMT': ' +0000',
        ' EDT': ' -0400',
        ' EST': ' -0500',
        ' CDT': ' -0500',
        ' CST': ' -0600',
        ' MDT': ' -0600',
        ' MST': ' -0700',
        ' PDT': ' -0700',
        ' PST': ' -0800'
    };
    var military = 'YXWVUTSRQPONZABCDEFGHIKLM';
    var timezone, timezoneIndex;

    string = config._i
        .replace(/\([^\)]*\)|[\n\t]/g, ' ') // Remove comments and folding whitespace
        .replace(/(\s\s+)/g, ' ') // Replace multiple-spaces with a single space
        .replace(/^\s|\s$/g, ''); // Remove leading and trailing spaces
    match = basicRfcRegex.exec(string);

    if (match) {
        dayFormat = match[1] ? 'ddd' + ((match[1].length === 5) ? ', ' : ' ') : '';
        dateFormat = 'D MMM ' + ((match[2].length > 10) ? 'YYYY ' : 'YY ');
        timeFormat = 'HH:mm' + (match[4] ? ':ss' : '');

        // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.
        if (match[1]) { // day of week given
            var momentDate = new Date(match[2]);
            var momentDay = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'][momentDate.getDay()];

            if (match[1].substr(0,3) !== momentDay) {
                getParsingFlags(config).weekdayMismatch = true;
                config._isValid = false;
                return;
            }
        }

        switch (match[5].length) {
            case 2: // military
                if (timezoneIndex === 0) {
                    timezone = ' +0000';
                } else {
                    timezoneIndex = military.indexOf(match[5][1].toUpperCase()) - 12;
                    timezone = ((timezoneIndex < 0) ? ' -' : ' +') +
                        (('' + timezoneIndex).replace(/^-?/, '0')).match(/..$/)[0] + '00';
                }
                break;
            case 4: // Zone
                timezone = timezones[match[5]];
                break;
            default: // UT or +/-9999
                timezone = timezones[' GMT'];
        }
        match[5] = timezone;
        config._i = match.splice(1).join('');
        tzFormat = ' ZZ';
        config._f = dayFormat + dateFormat + timeFormat + tzFormat;
        configFromStringAndFormat(config);
        getParsingFlags(config).rfc2822 = true;
    } else {
        config._isValid = false;
    }
}
547795
def parse_stupid_date(c):
    
    start_time = {
        1: { "hour": 8, "minute": 40 },
        2: { "hour": 10, "minute": 10 },
        3: { "hour": 12, "minute": 15 },
        4: { "hour": 13, "minute": 45 },
        5: { "hour": 15, "minute": 15 },
        6: { "hour": 16, "minute": 45 },
    }

    end_time = {
        1: { "hour": 9, "minute": 55 },
        2: { "hour": 11, "minute": 25 },
        3: { "hour": 13, "minute": 30 },
        4: { "hour": 15, "minute": 0 },
        5: { "hour": 16, "minute": 30 },
        6: { "hour": 18, "minute": 0 },
    }

    periods = c['periods']
    dates = []
    while len(periods) > 0:
        m = re.search('((?:.・)*(?:.))([0-9])([,-])([0-9])', periods)
        assert(m is not None)

        groups = list(reversed(list(m.groups())))
        weekdays = groups.pop().split('・')
        period_start = int(groups.pop())

        if len(groups) == 0:
            sep = ','
            period_end = period_start
        else:
            sep = groups.pop()
            period_end = int(groups.pop())

        assert(sep in ['-', ','])
        assert(1 <= period_start <= 6)
        assert(1 <= period_end <= 6)

        if sep == ',':
            assert(period_end - period_start == 1)

        for weekday in weekdays:
            dt = get_start_date(c['modules'], weekday)
            dt_start = dt.replace(**start_time[period_start])
            dt_end = dt.replace(**end_time[period_end])
            dates.append((dt_start, dt_end))

        periods = periods[m.span()[1]:]

    return dates
1254681
def _parse_weekday(val):
        '''  '''
        val = val.title()
        try:
            return list(calendar.day_abbr).index(val)
        except ValueError:
            try:
                return list(calendar.day_name).index(val)
            except ValueError:
                return None
944342
function getDaysNames () {
            var daysNameList = [];
            for (var i = 0; i < 7 ; i++) {
                daysNameList.push(moment().weekday(i).format('ddd'));
            }
            return daysNameList;
        }
369858
def local_rfcformat(dt):
    
    weekday = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'][dt.weekday()]
    month = [
        'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
        'Oct', 'Nov', 'Dec',
    ][dt.month - 1]
    tz_offset = dt.strftime('%z')
    return '%s, %02d %s %04d %02d:%02d:%02d %s' % (
        weekday, dt.day, month,
        dt.year, dt.hour, dt.minute, dt.second, tz_offset,
    )
1077859
void formatWeekday(StringBuilder b, ZonedDateTime d, int width, FieldVariants weekdays) {
    int weekday = d.getDayOfWeek().getValue() % 7;
    switch (width) {
      case 6:
        b.append(weekdays.short_[weekday]);
        break;

      case 5:
        b.append(weekdays.narrow[weekday]);
        break;

      case 4:
        b.append(weekdays.wide[weekday]);
        break;

      case 3:
      case 2:
      case 1:
        b.append(weekdays.abbreviated[weekday]);
        break;
    }
  }
175754
def method_missing(name, *args)
      add_regex = %r{
        ^([ib])(?:n|ack)?
        (?:\.|_|-| )?
        (\d+)
        (?:\.|_|-| )?
        ([dwmy])
        (?:ays?|eeks?|onths?|ears?)?$
      }x

      weekday_regex = %r{
        ^(tod|tom|y)(?:a?y?|o?r?r?o?w?|e?s?t?e?r?d?a?y?)?$
      }xi
      
      next_weekday_regex = %r{
        ^(n|p)(?:e?x?t|r?e?v?i?o?u?s?)?
        (?:\.|_| |-)?
        (mo|tu|we|th|fr|sa|su)
        (?:n?|e?s?|d?n?e?s?|u?r?s?|i?|t?u?r?|n?)(?:d?a?y?)$ 
      }xi

      next_weekday_in_regex = %r{
        ^(mo|tu|we|th|fr|sa|su)
        (?:n?|e?s?|d?n?e?s?|u?r?s?|i?|t?u?r?|n?)(?:d?a?y?)(?:_?)
        (i|b)
        (?:n?|a?c?k?)(?:_?)
        (\d+)(?:_?)([dwmy])(?:a?y?s?|e?e?k?s?|o?n?t?h?s?|e?a?r?s?)$
      }xi

      return add($1, $2, $3)      if name =~ add_regex
      return weekday($1)          if name =~ weekday_regex
      return next_weekday($1, $2) if name =~ next_weekday_regex
      return next_weekday_in($1, $2, $3, $4) if name =~ next_weekday_in_regex
      super 
    end
1025386
def _shift_date(self, direction, unit, *args):
        
        this_module = sys.modules[__name__]

        num_shifts = 1
        if len(args) > 0:
            num_shifts = int(args[0])

        if unit in ['monday', 'tuesday', 'wednesday', 'thursday', 'friday',
                    'saturday', 'sunday']:
            shift_func = move_datetime_namedday
            dt = shift_func(self._dt, direction, unit)
            if num_shifts > 1:
                for n in range(num_shifts - 1):
                    dt = shift_func(dt, direction, unit)
        else:
            shift_func = getattr(this_module, 'move_datetime_%s' % unit)
            dt = shift_func(self._dt, direction, num_shifts)

        return Delorean(datetime=dt.replace(tzinfo=None), timezone=self.timezone)