Best Python code snippet using tempest_python
detections.py
Source:detections.py
...72 if is_store:73 bulk_data.append(data_json)74 bulk_delete_ids.append(frame_count)75 if len(bulk_data) > database_update_frequency:76 self.storage.delete_bulk_data(bulk_delete_ids)77 self.storage.insert_bulk_data(bulk_data)78 bulk_data = []79 bulk_delete_ids = []80 if visualize or self.video_writer is not None:81 out_frame = self.draw_info(frame, data_json)82 if self.video_writer is not None:83 self.video_writer.write(out_frame)84 if visualize:85 cv2.imshow('frame', out_frame)86 time.sleep(0.02)87 if cv2.waitKey(1) & 0xFF == ord('q'):88 break89 frame_count += 190 frame = self.video.read_frame()91 except KeyError as ke:92 print(ke)93 self.storage.delete_bulk_data(bulk_delete_ids)94 self.storage.insert_bulk_data(bulk_data)95 self.video.cleanup()...
bulk_middleware_client.py
Source:bulk_middleware_client.py
...26 headers = {}27 resp, body = self.put(url, data, headers)28 self.expected_success(200, resp.status)29 return resp, body30 def delete_bulk_data(self, data=None, headers=None):31 """Delete multiple objects or containers from their account.32 For More information please check:33 http://docs.openstack.org/developer/swift/middleware.html#module-swift.common.middleware.bulk34 """35 url = '?bulk-delete'36 if headers is None:37 headers = {}38 resp, body = self.delete(url, headers=headers, body=data)39 self.expected_success(200, resp.status)40 return resp, body41 def delete_bulk_data_with_post(self, data=None, headers=None):42 """Delete multiple objects or containers with POST request.43 For More information please check:44 http://docs.openstack.org/developer/swift/middleware.html#module-swift.common.middleware.bulk...
storage_edits.py
Source:storage_edits.py
...20 data["data"] = {f"{ModelNames.digital_object_detection_model.name}": data.pop("data")}21 bulk_data.append(data)22 delete_frame_ids.append(frame_id)23 if len(bulk_data) > 5000:24 storage_updated.delete_bulk_data(delete_frame_ids)25 storage_updated.insert_bulk_data(bulk_data)26 bulk_data = []27 print("Frame id: {}".format(frame_id))28 frame_id += 129 data = storage.get_data(frame_id)30 storage_updated.insert_bulk_data(bulk_data)...
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!!