get a scheduled lambda name
2268
function getScheduledName(arr) {
    var name = arr.slice(0).shift()
    return [`${app}-production-${name}`, `${app}-staging-${name}`]
  }
648668
def get_lambda_runtime_info(context):
    '''
    
    '''

    runtime_info = {
        'remaining_time': context.get_remaining_time_in_millis(),
        'function_name': context.function_name,
        'function_version': context.function_version,
        'invoked_function_arn': context.invoked_function_arn,
        'memory_limit': context.memory_limit_in_mb,
        'aws_request_id': context.aws_request_id,
        'log_group_name': context.log_group_name,
        'log_stream_name': context.log_stream_name
    }

    return runtime_info
481009
def str_eta(self):
        """"""
        if self.done:
            return eta_hms(self._eta.elapsed, always_show_hours=True, hours_leading_zero=True)
        if not self._eta_string:
            return ''
        return '{0} ETA'.format(self._eta_string)
1372423
def primal_name(func, wrt):
  """"""
  if not isinstance(func, types.FunctionType):
    raise TypeError(func)
  varnames = six.get_function_code(func).co_varnames
  return PRIMAL_NAME.format(func.__name__, ''.join(varnames[i] for i in wrt))
88501
def _get_notifier(config):
    '''
    
    '''
    if 'inotify.notifier' not in __context__:
        __context__['inotify.queue'] = collections.deque()
        wm = pyinotify.WatchManager()
        __context__['inotify.notifier'] = pyinotify.Notifier(wm, _enqueue)
        if ('coalesce' in config and
                isinstance(config['coalesce'], bool) and
                config['coalesce']):
            __context__['inotify.notifier'].coalesce_events()
    return __context__['inotify.notifier']
1027854
def schedule_enabled():
    '''
    
    '''
    cmd = ['softwareupdate', '--schedule']
    ret = salt.utils.mac_utils.execute_return_result(cmd)

    enabled = ret.split()[-1]

    return salt.utils.mac_utils.validate_enabled(enabled) == 'on'
163721
def _parse_schedule(self, schedule):
        
        result = {}

        for param in shlex.split(str(schedule)): # do not feed unicode to shlex
            try:
                key, val = param.split('=', 1)
            except (TypeError, ValueError):
                self.fatal("Bad param '%s' in job schedule '%s'" % (param, schedule))
            else:
                result[key] = val

        return result
819022
def tzname(self, dt):
        """"""
        tt = _localtime(_mktime((dt.year, dt.month, dt.day,
                 dt.hour, dt.minute, dt.second, dt.weekday(), 0, -1)))
        return _time.tzname[tt.tm_isdst > 0]
857626
@Override
  public IScheduleBuilder <IDailyTimeIntervalTrigger> getScheduleBuilder ()
  {

    final DailyTimeIntervalScheduleBuilder cb = DailyTimeIntervalScheduleBuilder.dailyTimeIntervalSchedule ()
                                                                                .withInterval (getRepeatInterval (),
                                                                                               getRepeatIntervalUnit ())
                                                                                .onDaysOfTheWeek (getDaysOfWeek ())
                                                                                .startingDailyAt (getStartTimeOfDay ())
                                                                                .endingDailyAt (getEndTimeOfDay ());

    switch (getMisfireInstruction ())
    {
      case MISFIRE_INSTRUCTION_DO_NOTHING:
        cb.withMisfireHandlingInstructionDoNothing ();
        break;
      case MISFIRE_INSTRUCTION_FIRE_ONCE_NOW:
        cb.withMisfireHandlingInstructionFireAndProceed ();
        break;
    }

    return cb;
  }
1162303
public java.util.List<String> getScheduleDefinitions() {
        if (scheduleDefinitions == null) {
            scheduleDefinitions = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return scheduleDefinitions;
    }
829793
private static Method lambdaMethod(SerializedLambda serializedLambda) {
        Class<?> containingClass = getClassForName(serializedLambda.getImplClass());
        String implMethodName = serializedLambda.getImplMethodName();
        return getMethod(containingClass, implMethodName);
    }
1087906
def _get_job_collection_name(self, process_name):
        """"""
        qualifier = context.process_context[process_name].time_qualifier

        if qualifier == QUALIFIER_HOURLY:
            collection_name = COLLECTION_JOB_HOURLY
        elif qualifier == QUALIFIER_DAILY:
            collection_name = COLLECTION_JOB_DAILY
        elif qualifier == QUALIFIER_MONTHLY:
            collection_name = COLLECTION_JOB_MONTHLY
        elif qualifier == QUALIFIER_YEARLY:
            collection_name = COLLECTION_JOB_YEARLY
        else:
            raise ValueError('Unknown time qualifier: {0} for {1}'.format(qualifier, process_name))
        return collection_name
1011002
def get_name(self, func):
        '''
        
        '''
        if hasattr(func, 'name'):
            return func.name

        return '%s.%s' % (
            func.__module__,
            func.__name__
        )
188588
function executeScheduleItem(schedule, iteration, value) {
  if (schedule.length < iteration + 1) {
    throw Error("ZLIQ: schedule for iteration " + iteration + " not defined");
  }
  let item = schedule[iteration];
  if (typeof item === "function") {
    return item(value);
  } else {
    return item;
  }
}
41494
def _sort_lambda(sortedby='cpu_percent',
                 sortedby_secondary='memory_percent'):
    """"""
    ret = None
    if sortedby == 'io_counters':
        ret = _sort_io_counters
    elif sortedby == 'cpu_times':
        ret = _sort_cpu_times
    return ret
853242
def get_scheduler_info():
    """"""

    scheduler = current_app.apscheduler

    d = OrderedDict([
        ('current_host', scheduler.host_name),
        ('allowed_hosts', scheduler.allowed_hosts),
        ('running', scheduler.running)
    ])

    return jsonify(d)
421822
def get_scheduler_from_hostname(self, host_name):
        
        scheduler_uuid = self.hosts_schedulers.get(host_name, None)
        return self.schedulers.get(scheduler_uuid, None)