Best Python code snippet using yandex-tank
Battle.py
Source:Battle.py
...276 def shooting(self,shoot_cmd,controller):277 shoot_cmd.fric_wheel_run = 1#å¼å
³æ©æ¦è½®278 shoot_cmd.shoot_cmd = 1#ååå½ä»¤279 shoot_cmd.c_shoot_cmd =0#è¿åå½ä»¤280 controller.shoot(shoot_cmd)#åå¸å°å»å½ä»¤281 def shooting_plus(self, shoot_cmd, controller):282 # shoot_cmd.fric_wheel_spd = 1215 # æ©æ¦è½®è½¬é设置283 shoot_cmd.fric_wheel_run = 1 # å¼å
³æ©æ¦è½®284 shoot_cmd.shoot_cmd = 0 # ååå½ä»¤285 shoot_cmd.c_shoot_cmd = 1 # è¿åå½ä»¤286 controller.shoot(shoot_cmd) # åå¸å°å»å½ä»¤287 def shooting_stop(self, shoot_cmd, controller):288 # shoot_cmd.fric_wheel_spd = 1215# æ©æ¦è½®è½¬é设置289 shoot_cmd.fric_wheel_run = 1 # å¼å
³æ©æ¦è½®290 shoot_cmd.shoot_cmd = 0 # ååå½ä»¤291 shoot_cmd.c_shoot_cmd = 0 # è¿åå½ä»¤292 controller.shoot(shoot_cmd) # åå¸å°å»å½ä»¤293if __name__ == '__main__':294 env = BattleEnv()295 initialobservation = env.reset()296 action = [1, 0, 0, 0, 0]297 #env.step(action, initialobservation)298 # Image._show(env.map)...
teleop_controlA.py
Source:teleop_controlA.py
...103 self.nav_goal_pub.publish(goal)104 time.sleep(0.1)105 def send_vel(self, vel):106 self.vel_pub.publish(vel)107 def shoot(self,shoot):108 self.shoot_pub.publish(shoot)109 time.sleep(0.1)110 def mode_switch(self, mode):111 self.modesw_pub.publish(mode)112 time.sleep(0.1)113if __name__ == "__main__":114 teleop = Controller()115 settings = termios.tcgetattr(sys.stdin)116 rospy.init_node('teleop_control_keyboard')117 speed = rospy.get_param("~speed", 0.5)118 turn = rospy.get_param("~turn", 1.0)119 gimbalstep = rospy.get_param("~gimbalstep", 1.0)120 x = 0121 y = 0...
views.py
Source:views.py
1from django.http import Http4042from django.shortcuts import render3from django.contrib.auth.mixins import LoginRequiredMixin4from .models import Shoot5from datetime import datetime6from django.utils import formats7from formikaro.utils import urlify8# from wkhtmltopdf.views import PDFTemplateView, PDFTemplateResponse9class PDFTemplateView:10 pass11class ProjectShootPDF(LoginRequiredMixin, PDFTemplateView):12 login_url = '/accounts/login/'13 template = 'Reports/shoot_report.html'14 cmd_options = {15 'margin-top': 1, 'enable-local-file-access': True, 'quiet': False,16 }17 def get(self, request, **kwargs):18 shoot_id = kwargs.get('shoot_id', None)19 shoot = Shoot.objects.get(id=shoot_id)20 #shoot_date = datetime.fromtimestamp(shoot.starttime)21 shoot_date = format(shoot.starttime, '%d%m%y')22 now = datetime.now()23 report_time = now.strftime("%d%m%y-%H%M%S")24 filename = 'ShootReport_%s_%s_%s_%s' % (shoot.project.abbreviation, shoot_date, urlify(shoot.location), report_time )25 context = {'shoot': shoot,26 'report_filename' :filename, }27 #ShootReport_MAR_Location28 if not shoot:29 raise Http404('No shoot id matches the given query.')30 # response = PDFTemplateResponse(request=request,31 # template=self.template,32 # filename=filename,33 # context= context,34 # show_content_in_browser=False,35 # cmd_options=self.cmd_options,36 # )37 return None # response...
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!!