Esempio n. 1
0
 public static function removeFlagFromCommands($text, $command, $full_flag)
 {
     foreach (BashInterpreter::matchCommand($text, $command) as $match) {
         $text = BashInterpreter::removeFlagFromCommand($text, $match, $full_flag);
     }
     return $text;
 }
Esempio n. 2
0
 private function optimize()
 {
     $commands = BashInterpreter::matchCommand($this->task, "python execute.py");
     foreach ($commands as $command) {
         // Any execute without benchmarks don't need to get run.
         if (count(BashInterpreter::matchFlag($command, "-b")) == 0) {
             $this->task = BashInterpreter::removeCommand($this->task, $command);
         }
     }
 }
Esempio n. 3
0
 public function benchmarks()
 {
     $benchmarks = array();
     $commands = BashInterpreter::matchCommand($this->task, "python execute.py");
     foreach ($commands as $command) {
         $benchmark_matches = BashInterpreter::matchFlag($command, "-b");
         foreach ($benchmark_matches as $match) {
             $benchmarks[] = $match;
         }
     }
     return array_values(array_unique($benchmarks));
 }