Constructor.
Prepare data for deploy.
195910
function Cluster(data) {
  var self = this;
  self.data = data;

  if (cluster.isMaster) {
    if (data.pid) {
      fs.writeFileSync(data.pid, process.pid);
    }
    let numCPUs = 1;
    if (data.count) {
      numCPUs = data.count;
    } else {
      numCPUs = require('os').cpus().length;
    }

    self.debug.log('Starting up %s workers.', numCPUs);
    for (var i = 0; i < numCPUs; i++) {
      cluster.fork();
    }

    cluster.on('online', function(worker) {
      self.debug.log('Worker %s is online', worker.process.pid);
    });

    cluster.on('exit', function(worker, code, signal) {
      self.debug.log('Worker %s died. code %s signal %s', worker.process.pid, code, signal);
      self.debug.log('Starting a new worker');
      cluster.fork();
    });

    cluster.on('listening', function(worker, address) {
      if (self.data.callbacks['init']) {
        self.data.callbacks['init'](cluster, worker, address);
      }
    });

    process.on('SIGINT', function() {
      self.debug.log('Caught interrupt signal');
      if (data.pid) {
        fs.unlinkSync(data.pid);
      }
      process.exit();
    });
  } else {
    var webServer = new WebHttp(self.data);

    process.on('SIGINT', function() {
      self.debug.worker('Caught interrupt signal');
      webServer.stop();
    });

    process.on('SIGTERM', function() {
        self.debug.worker('Caught termination signal');
        webServer.stop();
      }
    );
  }
  return cluster;
}
820309
protected function prepareResources()
    {
        // Publish our views
        $this->loadViewsFrom(base_path("resources/views"), 'base');
        $this->publishes([
            __DIR__ .  '/views' => base_path("resources/views")
        ]);

        // Publish our migrations
        $this->publishes([
            __DIR__ .  '/migrations' => base_path("database/migrations")
        ], 'migrations');

        // Publish a config file
        $this->publishes([
            __DIR__ . '/config' => base_path('/config')
        ], 'config');

        // Publish our routes
        $this->publishes([
            __DIR__ .  '/routes.php' => base_path("app/Http/comments_routes.php")
        ], 'routes');

        // Include the routes file
        if(file_exists(base_path("app/Http/comments_routes.php")))
            include base_path("app/Http/comments_routes.php");
    }
271042
protected function prepareDatabase() {
        $this->migrator->setConnection($this->input->getOption('database'));

        if(!$this->migrator->repositoryExists()) {
            $options = ['--database' => $this->input->getOption('database')];

            $this->call('migrate:install', $options);
        }
    }
557373
def prepare(self):
        """"""
        SCons.Node.Node.prepare(self)

        if self.get_state() != SCons.Node.up_to_date:
            if self.exists():
                if self.is_derived() and not self.precious:
                    self._rmv_existing()
            else:
                try:
                    self._createDir()
                except SCons.Errors.StopError as drive:
                    raise SCons.Errors.StopError("No drive `{}' for target `{}'.".format(drive, self))
949839
private function prepare()
    {
        if (!$this->storage->has(self::FLASH_KEY)) {
            $this->storage->set(self::FLASH_KEY, array());
        }
    }
805644
def get_deploy_data(self):
        '''
        
        '''

        if self.state and self.state.deploy_data:
            return self.state.deploy_data

        return {}
1112453
function deploy(req, res, next) {
  var options = req.connectionOptions;
  var form = req.body;
  req.user = req.user || {};

  if (req.appformsResultPayload && _.isObject(req.appformsResultPayload.data)) {
    form = req.appformsResultPayload.data;
  }

  //Expect A Data Source Data Set To Be Available If Deploying A Form.
  var params = {
    userEmail: req.user.email || req.body.updatedBy,
    expectDataSourceCache: true
  };

  options = _.extend(options, params);

  logger.debug("Middleware: Deploy form: ", {options: options});

  forms.updateOrCreateForm(options, form, formsResultHandlers(constants.resultTypes.forms, req, next));
}
553392
def prepare(datasource = nil)
      # Compile it, if needed
      if @source_file && ((!@object_file.exist? && @source_file.exist?) || (@source_file.exist? && @source_file.mtime > @object_file.mtime))
        _JasperCompileManager = Rjb.import('net.sf.jasperreports.engine.JasperCompileManager')
        _JasperCompileManager.compileReportToFile(@source_file.to_s, @object_file.to_s)
      end
      load_datasource(datasource)
    end
1081029
def prepare_service(args=None):
    """"""
    options.register_opts(cfg.CONF)
    services.load_service_opts(cfg.CONF)
    _configure(args)
    _setup_logging()

    cfg.CONF.log_opt_values(logging.getLogger(), logging.DEBUG)
591895
public function _construct()
    {
        $this->_init(
            \Dotdigitalgroup\Email\Model\Importer::class,
            \Dotdigitalgroup\Email\Model\ResourceModel\Importer::class
        );
    }
6778
public function initialize() {
    $this->bltRoot = $this->getConfigValue('blt.root');
    $this->repoRoot = $this->getConfigValue('repo.root');
    $this->deployDir = $this->getConfigValue('deploy.dir');
    $this->formatter = new FormatterHelper();
  }
698565
public function _construct()
    {
        $this->_init(
            \Dotdigitalgroup\Email\Model\Automation::class,
            \Dotdigitalgroup\Email\Model\ResourceModel\Automation::class
        );
    }
194342
def prepare_inventory(self):
        
        if self.inventory is None:
            self.inventory  = os.path.join(self.private_data_dir, "inventory")
1106146
def prepare(project_root, environment)
      # Check already prepared nodes
      nodes_to_prepare = check_nodes_to_prepare(project_root, environment)
      # Output the nodes to be prepared
      if nodes_to_prepare.count > 0
        title _('wizard.node.prepare_title')
        nodes_to_prepare.each{|node| msg(node.hostname)}
        linebreak
        # For all environments regenerate the deploy file
        Bebox::Node.regenerate_deploy_file(project_root, environment, nodes_to_prepare)
        # If environment is 'vagrant' Prepare and Up the machines
        up_vagrant_machines(project_root, nodes_to_prepare) if environment == 'vagrant'
        # For all the environments do the preparation
        nodes_to_prepare.each do |node|
          node.prepare
          ok _('wizard.node.preparation_success')
        end
      else
        warn _('wizard.node.no_prepare_nodes')
      end
      return true
    end
576131
function constructor(attributes, options) {
      var hooks = []
        , local = {};

      options = options || {};

      //
      // Set the database name and/or urlRoot if provided in the options.
      //
      if (options.database) this.database = options.database;
      if (options.urlRoot) this.urlRoot = options.urlRoot;

      //
      // Copy attributes to a new object and provide a MongoDB OfbjectID.
      //
      attributes = attributes || {};
      for (var key in attributes) local[key] = attributes[key];

      //
      // If the provided `_id` is an ObjectID assume the model is stored.
      // If it is not an ObjectID, remove it from the provided data.
      // MongoDB will provide an ObjectID by default.
      //
      if ('_id' in local) try {
        local._id = new ObjectID(local._id);
      } catch (error) { delete local._id; }

      //
      // Define restricted non-enumerated properties.
      //
      predefine(this, fossa);

      //
      // Check for presence of before/after hooks and setup.
      //
      if (this.before) hooks.push('before');
      if (this.after) hooks.push('after');
      this.setup(hooks);

      //
      // Call original Backbone Model constructor.
      //
      backbone.Model.call(this, local, options);
    }
884210
public function prePersist()
    {
        if (!$this->getCreatedAt()) {
            $this->setCreatedAt(new \DateTime());
        }

        if (!$this->getUpdatedAt()) {
            $this->setUpdatedAt(new \DateTime());
        }
    }
806576
def prepare(self, data):
        
        result = {}

        if not self.fields:
            # No fields specified. Serialize everything.
            return data

        for fieldname, lookup in self.fields.items():
            if isinstance(lookup, SubPreparer):
                result[fieldname] = lookup.prepare(data)
            else:
                result[fieldname] = self.lookup_data(lookup, data)

        return result