Do the interaction with the end user.
344993
protected function doInteract()
    {
        $this->assistant->writeLine(array("This command helps you to generate a new entity.\n"));

        /*
         * Ask for which bundle we need to create the pagepart
         */
        $this->bundle = $this->askForBundleName('entity');

        /*
         * Ask the database table prefix
         */
        $this->prefix = $this->askForPrefix(null, $this->bundle->getNamespace());

        /*
         * Ask the name of the pagepart
         */
        $this->assistant->writeLine(array(
            '',
            'The name of your Entity: For example: <comment>Address</comment>',
            '',
        ));
        $generator = $this->getGenerator();
        $bundlePath = $this->bundle->getPath();
        $name = $this->assistant->askAndValidate(
            'Entity name',
            function ($name) use ($generator, $bundlePath) {
                // Check reserved words
                if ($generator->isReservedKeyword($name)) {
                    throw new \InvalidArgumentException(sprintf('"%s" is a reserved word', $name));
                }

                if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $name)) {
                    throw new \InvalidArgumentException(sprintf('Invalid entity name: %s', $name));
                }

                // Check that entity does not already exist
                if (file_exists($bundlePath.'/Entity/'.$name.'.php')) {
                    throw new \InvalidArgumentException(sprintf('Entity "%s" already exists', $name));
                }

                return $name;
            }
        );
        $this->entityName = $name;

        /*
         * Ask which fields need to be present
         */
        $this->assistant->writeLine(array("\nInstead of starting with a blank entity, you can add some fields now.\n"));
        $fields = $this->askEntityFields($this->bundle);
        $this->fields = array_map(function ($fieldInfo) {
            switch ($fieldInfo['type']) {
                case 'image':
                    return $this->getEntityFields($this->bundle, $this->entityName, $this->prefix, $fieldInfo['name'], $fieldInfo['type'],
                        $fieldInfo['extra'], true, $fieldInfo['minHeight'], $fieldInfo['maxHeight'], $fieldInfo['minWidth'], $fieldInfo['maxWidth'], $fieldInfo['mimeTypes']);

                    break;

                case 'media':
                    return $this->getEntityFields($this->bundle, $this->entityName, $this->prefix, $fieldInfo['name'], $fieldInfo['type'],
                        $fieldInfo['extra'], true, null, null, null, null, $fieldInfo['mimeTypes']);

                    break;

                default:
                    return $this->getEntityFields($this->bundle, $this->entityName, $this->prefix, $fieldInfo['name'], $fieldInfo['type'], $fieldInfo['extra'], true);

                    break;
            }
        }, $fields);

        /*
         * Ask if a repository class needs to be generated
         */
        $this->withRepository = $this->askForWithRepository();
    }
799819
protected function performAction()
    {
        $data = $this->getModel()->loadFirst();

        parent::performAction();

        $this->accesslog->logChange($this->request, $this->getTitle(), $data);
    }
231218
protected function onInputEnd()
    {
        if ($this->sort) {
            ksort($this->gData, SORT_STRING);
        }
        foreach ($this->gData as $index => $data) {
            $this->next($data);
        }
    }
250060
def interact(self,
	            msg='SHUTIT PAUSE POINT',
	            shutit_pexpect_child=None,
	            print_input=True,
	            level=1,
	            resize=True,
	            color='32',
	            default_msg=None,
	            wait=-1):
		""""""
		shutit_global.shutit_global_object.yield_to_draw()
		self.pause_point(msg=msg,
		                 shutit_pexpect_child=shutit_pexpect_child,
		                 print_input=print_input,
		                 level=level,
		                 resize=resize,
		                 color=color,
		                 default_msg=default_msg,
		                 interact=True,
		                 wait=wait)
415352
def _handle_end_way(self):
        
        self._result.append(Way(result=self._result, **self._curr))
        self._curr = {}
1266793
function emit() {
  var self = this;
  (function execute() {
    try {
      if(self.i >= self.length) {
        self.emit('end');
      }
      else {
        var k = self.keys[self.i];
        self.emit('data', self.arr[k], k); 
        self.i++;
        if (!self.paused) nextTick(execute);
      }
    } catch (e) {
      self.emit('error', e);
      if (self._options.tolerant) {
        self.i++;
        if (!self.paused) nextTick(execute);
      }
      else {
        self.emit('end');
        self.readable = false;
      }
    }
  })();
}
302073
def start(self):
        

        run_by_ui = False
        if not self.current_user.algo:
            # If user connects as a human (CLI execution)
            self._job = Job(self._project.id, self._software.id).save()
            user_job = User().fetch(self._job.userJob)
            self.set_credentials(user_job.publicKey, user_job.privateKey)
        else:
            # If the user executes the job through the Cytomine interface
            self._job = Job().fetch(self.current_user.job)
            run_by_ui = True

        # set job state to RUNNING
        self._job.status = Job.RUNNING
        self._job.update()

        # add software parameters
        if not run_by_ui and self._parameters is not None:
            parameters = vars(self._parameters)
            for software_param in self._software.parameters:
                name = software_param["name"]
                if name in parameters:
                    value = parameters[name]
                else:
                    value = software_param["defaultParamValue"]

                JobParameter(self._job.id, software_param["id"], value).save()
537
def interact(self, **local):
    
    import code
    code.interact(local=dict(sess=self, **local))
922251
protected function listen()
    {
        $this->eventEmitter->on('peridot.concurrency.load', [$this, 'setPending']);
        $this->eventEmitter->on('peridot.concurrency.worker.run', [$this, 'addRunning']);
        $this->eventEmitter->on('peridot.concurrency.worker.completed', [$this, 'onWorkerComplete']);
        $this->broker->on('end', [$this, 'onMessageEnd']);
        $this->broker->on('error', [$this, 'onError']);
        $this->broker->on('suite.halt', [$this, 'stop']);
    }
1173420
def do_interact(self, arg):
        
        ns = self.curframe.f_globals.copy()
        ns.update(self.curframe_locals)
        code.interact("*interactive*", local=ns)
458134
function onResponse (res) {
      endTime = getTimeMs(endTime)

      res = Object.assign(res, { opDuration: endTime })

      if (res.error) {
        appendRes = res
      } else {
        log.info(
          {
            res: res,
            duration: endTime
          },
          'end of the request'
        )
      }
    }
15491
def interact(self):
        

        sockets = [sys.stdin, self.channel]
        while True:
            ready = select.select(sockets, [], [])[0]

            if sys.stdin in ready:
                line = sys.stdin.readline().encode('latin1')
                if not line:
                    break
                self.write(line)

            if self.channel in ready:
                self.read(1, echo=True)
424611
public function finalize()
    {
        $this->addItem(new MainMenu());

        if (get_class(\Ease\Shared::user()) == 'SpojeNet\System\User') {
            $this->addItem(new History());
        }
    }
983038
public function execute() {
        global $CFG;

        // Raise the time limit for each discussion.
        \core_php_time_limit::raise(120);

        $this->recipient = \core_user::get_user($this->get_userid());

        // Create the generic messageinboundgenerator.
        $this->inboundmanager = new \core\message\inbound\address_manager();
        $this->inboundmanager->set_handler('\mod_forum\message\inbound\reply_handler');

        $data = $this->get_custom_data();

        $this->prepare_data((array) $data);

        $markposts = [];
        $errorcount = 0;
        $sentcount = 0;
        $this->log_start("Sending messages to {$this->recipient->username} ({$this->recipient->id})");
        foreach ($this->courses as $course) {
            $coursecontext = \context_course::instance($course->id);
            if (!$course->visible and !has_capability('moodle/course:viewhiddencourses', $coursecontext)) {
                // The course is hidden and the user does not have access to it.
                // Permissions may have changed since it was queued.
                continue;
            }
            foreach ($this->courseforums[$course->id] as $forumid) {
                $forum = $this->forums[$forumid];

                $cm = get_fast_modinfo($course)->instances['forum'][$forumid];
                $modcontext = \context_module::instance($cm->id);

                foreach (array_values($this->forumdiscussions[$forumid]) as $discussionid) {
                    $discussion = $this->discussions[$discussionid];

                    if (!forum_user_can_see_discussion($forum, $discussion, $modcontext, $this->recipient)) {
                        // User cannot see this discussion.
                        // Permissions may have changed since it was queued.
                        continue;
                    }

                    if (!\mod_forum\subscriptions::is_subscribed($this->recipient->id, $forum, $discussionid, $cm)) {
                        // The user does not subscribe to this forum as a whole, or to this specific discussion.
                        continue;
                    }

                    foreach ($this->posts[$discussionid] as $post) {
                        if (!forum_user_can_see_post($forum, $discussion, $post, $this->recipient, $cm)) {
                            // User cannot see this post.
                            // Permissions may have changed since it was queued.
                            continue;
                        }

                        if ($this->send_post($course, $forum, $discussion, $post, $cm, $modcontext)) {
                            $this->log("Post {$post->id} sent", 1);
                            // Mark post as read if forum_usermarksread is set off.
                            if (!$CFG->forum_usermarksread) {
                                $markposts[$post->id] = true;
                            }
                            $sentcount++;
                        } else {
                            $this->log("Failed to send post {$post->id}", 1);
                            $errorcount++;
                        }
                    }
                }
            }
        }

        $this->log_finish("Sent {$sentcount} messages with {$errorcount} failures");
        if (!empty($markposts)) {
            if (get_user_preferences('forum_markasreadonnotification', 1, $this->recipient->id) == 1) {
                $this->log_start("Marking posts as read");
                $count = count($markposts);
                forum_tp_mark_posts_read($this->recipient, array_keys($markposts));
                $this->log_finish("Marked {$count} posts as read");
            }
        }
    }
563469
protected function performAction()
    {
        $count = $this->db->delete("gems__appointments", $this->getWhere());

        $this->addMessage(sprintf($this->plural(
                '%d appointment deleted.',
                '%d appointments deleted.',
                $count
                ), $count));


        $this->setAfterCleanupRoute();
    }
996293
def handle(self, **options):
        
        self.flushdb = options.get('flushdb')
        self._pre_tasks()
        self._create_users()
        self._create_badges()
        self._create_awards()
184262
public function execute()
    {
        if (method_exists($this, 'setUp')) {
            call_user_func_array([$this, 'setUp'], [$this->request]);
        }
        call_user_func_array([$this, $this->action], [$this->request]);
    }