Basically a wrapper for docker-compose scale.
160282
public function scale($scale)
    {
        $cmd = "docker-compose scale app=$scale && docker-compose up -d --no-deps load";
        $process = new Process($cmd, $this->getDockerComposePath());
        $process->setTimeout(null);
        $process->run(function ($type, $buffer) {
            if (Process::ERR === $type) {
                echo 'DOCKER > '.$buffer;
            } else {
                echo 'DOCKER > '.$buffer;
            }
        });
        if (!$process->isSuccessful()) {
            return false;
        } else {
            return $process->getOutput();
        }
    }
708659
def _generate_base_anchors(base_size, scales, ratios):
        
        base_anchor = np.array([1, 1, base_size, base_size]) - 1
        ratio_anchors = AnchorGenerator._ratio_enum(base_anchor, ratios)
        anchors = np.vstack([AnchorGenerator._scale_enum(ratio_anchors[i, :], scales)
                             for i in range(ratio_anchors.shape[0])])
        return anchors
250209
def scale_transform(t, scale):
    
    if isinstance(scale, float) or isinstance(scale, int):
        scale = [scale, scale, scale]

    if _is_indexable(t[0]):
        return [[t[0][0] * scale[0], t[0][1] * scale[1], t[0][2] * scale[2]],
                t[1]]
    else:
        return [t[0] * scale[0], t[1] * scale[1], t[2] * scale[2]]
471006
def harpoon_spec(self):
        """"""
        formatted_string = formatted(string_spec(), MergedOptionStringFormatter, expected_type=six.string_types)
        formatted_boolean = formatted(boolean(), MergedOptionStringFormatter, expected_type=bool)

        return create_spec(Harpoon
            , config = optional_spec(file_spec())

            , tag = optional_spec(string_spec())
            , extra = defaulted(formatted_string, "")
            , debug = defaulted(boolean(), False)
            , addons = dictof(string_spec(), listof(string_spec()))
            , artifact = optional_spec(formatted_string)
            , extra_files = listof(string_spec())
            , chosen_task = defaulted(formatted_string, "list_tasks")
            , chosen_image = defaulted(formatted_string, "")

            , flat = defaulted(formatted_boolean, False)
            , no_cleanup = defaulted(formatted_boolean, False)
            , interactive = defaulted(formatted_boolean, True)
            , silent_build = defaulted(formatted_boolean, False)
            , keep_replaced = defaulted(formatted_boolean, False)
            , ignore_missing = defaulted(formatted_boolean, False)
            , no_intervention = defaulted(formatted_boolean, False)
            , intervene_afterwards = defaulted(formatted_boolean, False)

            , do_push = defaulted(formatted_boolean, False)
            , only_pushable = defaulted(formatted_boolean, False)
            , docker_context = any_spec()
            , docker_context_maker = any_spec()

            , stdout = defaulted(any_spec(), sys.stdout)
            , tty_stdin = defaulted(any_spec(), None)
            , tty_stdout = defaulted(any_spec(), lambda: sys.stdout)
            , tty_stderr = defaulted(any_spec(), lambda: sys.stderr)
            )
78810
function remScale(config){
return R.compose(
R.merge(config),
R.converge(R.merge,[
toRems(config.rem,'scale'),
toRems(config.rem,'typeScale')]))(

config);
}
121486
function scale(appName, configuration, callback) {
    if (!isObject(configuration)) {
      return callback(new Error('To scale pass an object with the type as key'));
    }

    var url = format('/%s/apps/%s/scale/', deis.version, appName);
    commons.post(url, configuration, 204, callback);
  }
597620
def build(config, services):
    
    filtered_services = {name: service for name, service in services.iteritems() if 'build' in service}

    _call_output('docker-compose build {}'.format(' '.join(filtered_services.iterkeys())))

    version = _get_version()

    for service_name, service_dict in filtered_services.iteritems():
        # Tag with proper version, they're already tagged latest from build
        image = service_dict['image']
        _call('docker tag {image}:latest {image}:{version}'.format(
                image=image,
                version=version
            )
        )
487354
def _container_attrib_builder(name, container, mapper):
    """"""
    context = {'@container': '@{0}'.format(name)}

    def _attrib(type, **kwargs):
        """Define a container attribute."""
        kwargs.setdefault('metadata', {})
        kwargs['metadata'][KEY_CLS] = type
        kwargs['default'] = Factory(container)

        def _converter(value):
            """Convert value to the given type."""
            if isinstance(value, container):
                return mapper(type, value)
            elif value is None:
                return value
            raise ValueError(value)

        kwargs.setdefault('converter', _converter)
        context_ib = context.copy()
        context_ib.update(kwargs.pop('context', {}))
        return attrib(context=context_ib, **kwargs)

    return _attrib
27429
def scale(self, s=None):
        """"""
        if s is None:
            return np.array(self.GetScale())
        self.SetScale(s)
        return self
1256669
def dockerize_package(ctx, os, host):
    """"""
    from canari.commands.dockerize_package import dockerize_package
    dockerize_package(ctx.project, os, host)
294017
def build(port=8000, fixtures=None):
    
    extractor = Extractor()
    parser = Parser(extractor.url_details, fixtures)
    parser.parse()
    url_details = parser.results
    _store = get_store(url_details)
    store = json.dumps(_store)
    variables = str(Variable('let', 'store', store))
    functions = DATA_FINDER + GET_HANDLER + MODIFY_HANDLER + POST_HANDLER
    endpoints = []
    endpoint_uris = []
    for u in parser.results:
        endpoint = Endpoint()
        if u['method'].lower() in ['get', 'post']:
            method = u['method'].lower()
        else:
            method = 'modify'
        response = str(ResponseBody(method))

        # Check in store if the base url has individual instances
        u['url'], list_url = clean_url(u['full_url'], _store, u['method'].lower())
        if list_url is not None and u['method'].lower() == 'get':
            list_endpoint = Endpoint()
            list_endpoint.construct('get', list_url, response)
            if str(list_endpoint) not in endpoints:
                endpoints.append(str(list_endpoint))
            if list_endpoint.uri not in endpoint_uris:
                endpoint_uris.append(list_endpoint.uri)

        if method == 'modify':
            without_prefix = re.sub(r'\/(\w+)\_\_', '', u['url'])
            for k, v in _store.items():
                if without_prefix in k:
                    options = v.get('options', '{}')
                    options = ast.literal_eval(options)
                    modifiers = []
                    if options is not None:
                        modifiers = options.get('modifiers', [])
                    if modifiers:
                        for mod in modifiers:
                            if u['method'].lower() == mod:
                                mod_endpoint = Endpoint()
                                uri = without_prefix
                                if v.get('position') is not None and v['position'] == 'url':
                                    uri = re.sub(r'\/?\_\_key', '/:id', u['full_url'])
                                mod_endpoint.construct(u['method'].lower(), uri, response)
                                if str(mod_endpoint) not in endpoints:
                                    endpoints.append(str(mod_endpoint))
                                if mod_endpoint.uri not in endpoint_uris:
                                    endpoint_uris.append(mod_endpoint.uri)
        else:
            endpoint.construct(u['method'], u['url'], response)
            if str(endpoint) not in endpoints:
                endpoints.append(str(endpoint))
            if endpoint.uri not in endpoint_uris:
                endpoint_uris.append(endpoint.uri)

    endpoints = ''.join(endpoints)
    express = ExpressServer()
    express.construct(variables, functions, endpoints, port)
    return express
211109
def __dump_docker_compose(path, content, already_existed):
    '''
    
    '''
    try:
        dumped = yaml.safe_dump(content, indent=2, default_flow_style=False)
        return __write_docker_compose(path, dumped, already_existed)
    except TypeError as t_err:
        msg = 'Could not dump {0} {1}'.format(content, t_err)
        return __standardize_result(False, msg,
                                    None, None)
247815
function buildScales() {
            colorScale = d3Scale.scaleLinear()
                .range([colorSchema[0], colorSchema[colorSchema.length - 1]])
                .domain(d3Array.extent(data, getValue))
                .interpolate(d3Interpolate.interpolateHcl);
        }
40226
def units(cls, scale=1):
        '''
        

        '''
        return [cls(x=scale), cls(y=scale), cls(z=scale)]
647803
function(container) {

    // Inspect the container
    return kbox.engine.inspect(container)

    // Return summary of info
    .then(function(data) {

      // Get service name =
      var name = data.Config.Labels['com.docker.compose.service'];
      var project = data.Config.Labels['com.docker.compose.project'];

      // Defaults
      var serviceSummary = {
        name: name,
        project: project
      };

      // See if these are proxied services
      var proxied = _.find(
        config.pluginconfig.services,
        function(data, key) {return key === name;}
      );
      if (!_.isEmpty(proxied)) {
        serviceSummary.url = getServiceUrls(proxied);
      }

      // Add in database credentials
      // @todo: get engine ip from provider.getIp()
      if (name === 'db') {

        // Get framework
        var framework = app.config.pluginconfig.php.framework;
        var host = [app.name, app.domain].join('.');

        // Get port from inspect data
        var portInfo = _.get(data, 'NetworkSettings.Ports.3306/tcp');

        // Build an external array
        serviceSummary.external_connection_info = {
          database: framework,
          user: framework,
          password: framework,
          host: host,
          port: portInfo[0].HostPort
        };

        // Build an internal array
        serviceSummary.internal_connection_info = {
          database: framework,
          user: framework,
          password: framework,
          host: 'database',
          port: 3306
        };

      }

      return serviceSummary;

    });

  }
782601
def docker2singularity(self, runscript="/bin/bash", force=False):
    '''
    '''

    recipe = ['Bootstrap: docker']
    recipe += [ "From: %s" %self.fromHeader ]
  
    # Sections with key value pairs
    recipe += self._create_section('files')
    recipe += self._create_section('labels')
    recipe += self._create_section('install', 'post')
    recipe += self._create_section('environ', 'environment')    

    # Take preference for user, entrypoint, command, then default
    runscript = self._create_runscript(runscript, force)
    recipe += finish_section(runscript, 'runscript')

    if self.test is not None:
        recipe += finish_section(self.test, 'test')

    # Clean up extra white spaces
    return '\n'.join(recipe).replace('\n\n','\n')
272023
def compose(self, bbox=None, **kwargs):
        
        from psd_tools.api.composer import compose
        return compose(self, bbox=bbox or self.bbox, **kwargs)