Reproduction: Spawn a new instance of this app
555313
function (thisAddressBook) {
      return UI.authn.newAppInstance(dom,
        {noun: 'address book', appPathSegment: 'contactorator.timbl.com'}, function (ws, newBase) {
          thisPane.clone(thisAddressBook, newBase, {me: me, div: div, dom: dom})
        })
    }
831499
def clone(self, spawn_mapping=None):
        
        c = self.spawn(spawn_mapping)
        self.register_clone(c)
        c.register_parent(self)
        return c
113302
@Override
	@Deprecated
	public UUID spawn(Class<? extends Agent> agentType, Object... params) {
		return getLifecycleSkill().spawnInContext(agentType, this.parentContext, params);
	}
1346641
def new(self, name=None, stack='cedar', region=None):
        """"""

        payload = {}

        if name:
            payload['app[name]'] = name

        if stack:
            payload['app[stack]'] = stack

        if region:
            payload['app[region]'] = region

        r = self._h._http_resource(
            method='POST',
            resource=('apps',),
            data=payload
        )

        name = json.loads(r.content).get('name')
        return self._h.apps.get(name)
1373704
def instantiate(self, seed=0, serial_id=0, preset='default', extra_args=None) -> gym.Env:
        
        settings = self.get_preset(preset)
        return wrapped_env_maker(self.envname, seed, serial_id, **settings)
326720
def populate(content, **options)
      generator.create_file(RubyEdit::SOURCE_FILE_LOCATION,
                            content,
                            force: true,
                            verbose: false,
                            **options)
    end
1104664
def spawnPythonProcess(processProtocol, args=(), env={},
                       path=None, uid=None, gid=None, usePTY=0,
                       packages=()):
    
    return spawnProcess(processProtocol, sys.executable,
                        args, env, path, uid, gid, usePTY,
                        packages)
47378
function spawnWorker() {

        // Create a new worker
        const worker = cluster.fork();

        // Automatically respawn the workers on exit
        worker.on("exit", function () {
            logger("Spawning new worker to replace", worker.process.pid);
            spawnWorker();
        });

        // Listen for messages from this worker
        worker.on("message", messageFromWorker);
    }
1271866
def spawn(self, monitor, kind=None, **params):
        '''
        '''
        proxy = _spawn_actor(kind, monitor, **params)
        # Add to the list of managed actors if this is a remote actor
        if isinstance(proxy, Actor):
            self._register(proxy)
            return proxy
        else:
            proxy.monitor = monitor
            self.managed_actors[proxy.aid] = proxy
            future = actor_proxy_future(proxy)
            proxy.start()
            return future
589288
def spawn_processes(self):
        """"""
        for port in self.ports_to_spawn:
            process = self.spawn_process(port)
            process.start()
            self.children.append(process)
44718
def spawn_new(self, key):
        """"""
        # Check if path exists
        if not os.path.exists(self.queue[key]['path']):
            self.queue[key]['status'] = 'failed'
            error_msg = "The directory for this command doesn't exist anymore: {}".format(self.queue[key]['path'])
            self.logger.error(error_msg)
            self.queue[key]['stdout'] = ''
            self.queue[key]['stderr'] = error_msg

        else:
            # Get file descriptors
            stdout, stderr = self.get_descriptor(key)

            if self.custom_shell != 'default':
                # Create subprocess
                self.processes[key] = subprocess.Popen(
                    [
                        self.custom_shell,
                        '-i',
                        '-c',
                        self.queue[key]['command'],
                    ],
                    stdout=stdout,
                    stderr=stderr,
                    stdin=subprocess.PIPE,
                    universal_newlines=True,
                    preexec_fn=os.setsid,
                    cwd=self.queue[key]['path']
                )
            else:
                # Create subprocess
                self.processes[key] = subprocess.Popen(
                    self.queue[key]['command'],
                    shell=True,
                    stdout=stdout,
                    stderr=stderr,
                    stdin=subprocess.PIPE,
                    universal_newlines=True,
                    preexec_fn=os.setsid,
                    cwd=self.queue[key]['path']
                )
            self.queue[key]['status'] = 'running'
            self.queue[key]['start'] = str(datetime.now().strftime("%H:%M"))

        self.queue.write()
994118
def clone(self, newname, config_path=None, flags=0, bdevtype=None,
              bdevdata=None, newsize=0, hookargs=()):
        

        args = {}
        args['newname'] = newname
        args['flags'] = flags
        args['newsize'] = newsize
        args['hookargs'] = hookargs
        if config_path:
            args['config_path'] = config_path
        if bdevtype:
            args['bdevtype'] = bdevtype
        if bdevdata:
            args['bdevdata'] = bdevdata

        if _lxc.Container.clone(self, **args):
            return Container(newname, config_path=config_path)
        else:
            return False
555205
def spawn(self, context=None):
        
        if context is None:
            context = self.default_context

        if isinstance(context, collections.Callable):
            context = context()

        if not isinstance(context, collections.Mapping):
            raise PatchboardError('Cannot determine a valid context')

        return Client(self, context, self.api, self.endpoint_classes)
1055679
def create_spawnve(original_name):
    

    def new_spawnve(mode, path, args, env):
        import os
        send_process_created_message()
        return getattr(os, original_name)(mode, path, patch_args(args), env)

    return new_spawnve
1056421
def run(self, app):
        """"""
        project_path = os.getcwd()
        if self.args.name is not None:
            project_path = os.path.join(project_path, self.args.name)

        proto_path = paths.PROTO_PATH

        try:
            copytree(proto_path, project_path)
            print(colored('A new glim app created successfully! Happy coding :)', 'green'))
        except FolderExistsError as e:
            print(e)
            print(colored('App already exists', 'red'))
1276407
def _spawn_new(self, count=1):
        """"""
        free = self.free_cells()
        for x, y in random.sample(free, min(count, len(free))):
            self.grid[y][x] = random.randint(0, 10) and 2 or 4
707596
def instantiate_single(self, seed=0, preset='default'):
        
        env = self.env.instantiate(seed=seed, serial_id=0, preset=preset)

        if self.frame_history is not None:
            env = FrameStack(env, self.frame_history)

        return env