Best Python code snippet using grail_python
car_data_gen_test.py
Source:car_data_gen_test.py  
...469        #    planner.step_with_sample(system, sample, 20, 200, 0.002)470        #else:471        if iteration % int(0.1 * max_iter) == 0:        472            print('iteration: %d/%d' % (iteration, max_iter))473        #steer_start, steer_end = planner.step_with_output(system, min_time_steps, max_time_steps, integration_step)474        planner.step(system, min_time_steps, max_time_steps, integration_step)475        476        if planner.get_solution():477            cur_cost = np.sum(planner.get_solution()[2])478            if cur_cost < min_cost:479                print('iteration: ', iteration, 'cost: ', cur_cost)480                481                min_cost = cur_cost482        #    break483        #print('start:')484        #print(steer_start)485        #print('end:')486        #print(steer_end)487        #ax.scatter(steer_start[0], steer_start[1], steer_start[4], c='red')...rally_car_data_gen_test.py
Source:rally_car_data_gen_test.py  
...515        #    planner.step_with_sample(system, sample, 20, 200, 0.002)516        #else:517        if iteration % int(0.1 * max_iter) == 0:        518            print('iteration: %d/%d' % (iteration, max_iter))519        steer_start, steer_end = planner.step_with_output(system, min_time_steps, max_time_steps, integration_step)520        #if planner.get_solution():521        #    break522        #print('start:')523        #print(steer_start)524        #print('end:')525        #print(steer_end)526        #ax.scatter(steer_start[0], steer_start[1], steer_start[4], c='red')527        #ax.scatter(steer_end[0], steer_end[1], steer_end[4], c='blue')528        #    #sample = np.random.uniform(low=low, high=high)529        #print('iteration: %d' % (iteration))530        # interation: 0.002531        #planner.step_with_sample(system, sample, 2, 20, 0.01)532        #if iteration % 100 == 0:533    solution = planner.get_solution()...test_steps.py
Source:test_steps.py  
...102    def pending_step(self):103        pass104class TestLogOutput(TestCase):105    @step106    def step_with_output(self):107        return 'Printed data'108    @step(log_output=False)109    def step_with_disabled_output(self):110        return 'Should not be shown'111    def test_enabled_output(self):112        validate_method_output(self.step_with_output, 'PASSED step with output -> Printed data')113    def test_disabled_output(self):114        validate_method_output(self.step_with_disabled_output, 'PASSED step with disabled output')115class TestLogInput(TestCase):116    @step117    def step_with_logged_input(self, input):118        pass119    @step(log_input=False)120    def step_with_not_logged_input(self, input):...Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
