Create an instance of the US Weather Forecast Service with
        typical starting settings.
176735
def create(self):
        
        self.service.create()

        # Set env vars for immediate use
        zone_id = predix.config.get_env_key(self.use_class, 'zone_id')
        zone = self.service.settings.data['zone']['http-header-value']
        os.environ[zone_id] = zone

        uri = predix.config.get_env_key(self.use_class, 'uri')
        os.environ[uri] = self.service.settings.data['uri']
600802
def new(cls, settings, *args, **kwargs):
        
        logger.debug('Initializing new "%s" Instance object' % settings['CLOUD'])
        cloud = settings['CLOUD']
        if cloud == 'bare':
            self = BareInstance(settings=settings, *args, **kwargs)
        elif cloud == 'aws':
            self = AWSInstance(settings=settings, *args, **kwargs)
        elif cloud == 'gcp':
            self = GCPInstance(settings=settings, *args, **kwargs)
        else:
            raise DSBException('Cloud "%s" not supported' % cloud)
        return self
413627
public Object startupService(BundleContext bundleContext)
    {
        Map<String,Object> propertiesTemp = new Hashtable<String,Object>();
        Util.parseArgs(propertiesTemp, args);

        //?server = new SApplet(args);
        ThinApplet.main(args);
        return Application.getRootApplet();
        //?Environment env = new Environment(propertiesTemp);
    }
1128405
@Override
    public Object startupService(BundleContext bundleContext)
    {
        service = this.createServiceTracker(context, getHttpContext(), this.getProperties());
        ((HttpServiceTracker)service).open();

        return service;
    }
194157
def create(self):
        
        self.service.create()

        os.environ[predix.config.get_env_key(self.use_class, 'host')] = self.get_eventhub_host()
        os.environ[predix.config.get_env_key(self.use_class, 'port')] = self.get_eventhub_grpc_port()
        os.environ[predix.config.get_env_key(self.use_class, 'wss_publish_uri')] = self.get_publish_wss_uri()
        os.environ[predix.config.get_env_key(self.use_class, 'zone_id')] = self.get_zone_id()
284797
def create(self, parameters={}, create_keys=True, **kwargs):
        
        # Create the service
        cs = self._create_service(parameters=parameters, **kwargs)

        # Create the service key to get config details and
        # store in local cache file.
        if create_keys:
            cfg = parameters
            cfg.update(self._get_service_config())
            self.settings.save(cfg)
568962
function start(mode, target, system, containerDef, container, out, cb) {
    if (mode !== 'preview') {
      main.setup(config, mode, target, system, containerDef, container, out, cb);
    } else {
      cb();
    }
  }
261030
def start(context, mip_config, email, priority, dryrun, command, start_with, family):
    """"""
    mip_cli = MipCli(context.obj['script'])
    mip_config = mip_config or context.obj['mip_config']
    email = email or environ_email()
    kwargs = dict(config=mip_config, family=family, priority=priority, email=email, dryrun=dryrun, start_with=start_with)
    if command:
        mip_command = mip_cli.build_command(**kwargs)
        click.echo(' '.join(mip_command))
    else:
        try:
            mip_cli(**kwargs)
            if not dryrun:
                context.obj['store'].add_pending(family, email=email)
        except MipStartError as error:
            click.echo(click.style(error.message, fg='red'))
773771
def generate_hourly(calib_data, hourly_data, process_from):
    """"""
    start = hourly_data.before(datetime.max)
    if start is None:
        start = datetime.min
    start = calib_data.after(start + SECOND)
    if process_from:
        if start:
            start = min(start, process_from)
        else:
            start = process_from
    if start is None:
        return start
    # set start of hour in local time (not all time offsets are integer hours)
    start += timezone.standard_offset
    start = start.replace(minute=0, second=0)
    start -= timezone.standard_offset
    del hourly_data[start:]
    # preload pressure history, and find last valid rain
    prev = None
    pressure_history = deque()
    last_rain = None
    for data in calib_data[start - HOURx3:start]:
        if data['rel_pressure']:
            pressure_history.append((data['idx'], data['rel_pressure']))
        if data['rain'] is not None:
            last_rain = data['rain']
        prev = data
    # iterate over data in one hour chunks
    stop = calib_data.before(datetime.max)
    acc = HourAcc(last_rain)
    def hourlygen(inputdata, prev):
        """Internal generator function"""
        hour_start = start
        count = 0
        while hour_start <= stop:
            count += 1
            if count % 1008 == 0:
                logger.info("hourly: %s", hour_start.isoformat(' '))
            elif count % 24 == 0:
                logger.debug("hourly: %s", hour_start.isoformat(' '))
            hour_end = hour_start + HOUR
            acc.reset()
            for data in inputdata[hour_start:hour_end]:
                if data['rel_pressure']:
                    pressure_history.append((data['idx'], data['rel_pressure']))
                if prev:
                    err = data['idx'] - prev['idx']
                    if abs(err - timedelta(minutes=data['delay'])) > TIME_ERR:
                        logger.info('unexpected data interval %s %s',
                                    data['idx'].isoformat(' '), str(err))
                acc.add_raw(data)
                prev = data
            new_data = acc.result()
            if new_data and (new_data['idx'] - hour_start) >= timedelta(minutes=9):
                # compute pressure trend
                new_data['pressure_trend'] = None
                if new_data['rel_pressure']:
                    target = new_data['idx'] - HOURx3
                    while (len(pressure_history) >= 2 and
                           abs(pressure_history[0][0] - target) >
                           abs(pressure_history[1][0] - target)):
                        pressure_history.popleft()
                    if (pressure_history and
                            abs(pressure_history[0][0] - target) < HOUR):
                        new_data['pressure_trend'] = (
                            new_data['rel_pressure'] - pressure_history[0][1])
                # store new hourly data
                yield new_data
            hour_start = hour_end
    hourly_data.update(hourlygen(calib_data, prev))
    return start
179385
function startRefreshWeather() {
      interval = $interval(getWeatherFromServer(options.city), options.delay);
      localforage.setItem('aw.refreshing', true);
    }
222547
def start(self):
        """"""
        if self._properties.get("startMs") is None:
            return None
        return _helpers._datetime_from_microseconds(
            int(self._properties.get("startMs")) * 1000.0
        )
772990
def start_container(self, cls, **kwargs):
        """"""
        # Convert stylename strings to actual style elements.
        kwargs = self._replace_stylename(kwargs)
        # Create the container.
        container = cls(**kwargs)
        self._containers.append(container)
837881
def get_forecast(self, time_zone):
        """"""
        if self.data is None:
            return []

        now = datetime.datetime.now(time_zone).replace(hour=12, minute=0,
                                                       second=0, microsecond=0)
        times = [now + datetime.timedelta(days=k) for k in range(1, 6)]
        return [self.get_weather(_time) for _time in times]
623638
def start(name, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The show_instance action must be called with -a or --action.'
        )

    data = query(action='ve', command='{0}/start'.format(name), method='PUT')

    if 'error' in data:
        return data['error']

    return {'Started': '{0} was started.'.format(name)}
1223333
private void initialize() {
        if (locale == null) {
            locale = ULocale.getDefault(Category.FORMAT);
        }
        if (formatData == null) {
            formatData = new DateFormatSymbols(locale);
        }
        if (calendar == null) {
            calendar = Calendar.getInstance(locale);
        }
        if (numberFormat == null) {
            NumberingSystem ns = NumberingSystem.getInstance(locale);
            if (ns.isAlgorithmic()) {
                numberFormat = NumberFormat.getInstance(locale);
            } else {
                String digitString = ns.getDescription();
                String nsName = ns.getName();
                // Use a NumberFormat optimized for date formatting
                numberFormat = new DateNumberFormat(locale, digitString, nsName);
            }
        }
        // Note: deferring calendar calculation until when we really need it.
        // Instead, we just record time of construction for backward compatibility.
        defaultCenturyBase = System.currentTimeMillis();

        setLocale(calendar.getLocale(ULocale.VALID_LOCALE ), calendar.getLocale(ULocale.ACTUAL_LOCALE));
        initLocalZeroPaddingNumberFormat();

        if (override != null) {
           initNumberFormatters(locale);
        }

        parsePattern();
    }
1033802
def set_default(nick, location, session, send, apikey):
    """"""
    if valid_location(location, apikey):
        send("Setting default location")
        default = session.query(Weather_prefs).filter(Weather_prefs.nick == nick).first()
        if default is None:
            default = Weather_prefs(nick=nick, location=location)
            session.add(default)
        else:
            default.location = location
    else:
        send("Invalid or Ambiguous Location")
507760
def create_subscriptions(config, profile_name):
    '''  '''
    if 'kinesis' in config.subscription.keys():
        data = config.subscription['kinesis']
        function_name = config.name
        stream_name = data['stream']
        batch_size = data['batch_size']
        starting_position = data['starting_position']
        starting_position_ts = None
        if starting_position == 'AT_TIMESTAMP':
            ts = data.get('starting_position_timestamp')
            starting_position_ts = datetime.strptime(ts, '%Y-%m-%dT%H:%M:%SZ')
        s = KinesisSubscriber(config, profile_name,
                              function_name, stream_name, batch_size,
                              starting_position,
                              starting_position_ts=starting_position_ts)
        s.subscribe()