558cf909ff79341e699cf872082231f83f4cdc50,donkey/remotes.py,CameraMJPEGHandler,get,#CameraMJPEGHandler#Any#Any#,306
Before Change
my_boundary = "--boundarydonotcross"
while True:
interval = .2
if self.served_image_timestamp + interval < time.time():
img = self.application.vehicles[vehicle_id]["img"]
img = dk.utils.img_to_binary(img)
self.write(my_boundary)
self.write("Content-type: image/jpeg\r\n")
self.write("Content-length: %s\r\n\r\n" % len(img))
self.write(img)
self.served_image_timestamp = time.time()
yield tornado.gen.Task(self.flush)
else:
yield tornado.gen.Task(ioloop.add_timeout, ioloop.time() + interval)
After Change
sessions_path = self.application.sessions_path
path = os.path.join(sessions_path, session_id, img_name)
f = Image.open(path)
o = io.BytesIO()
f.save(o, format="JPEG")
s = o.getvalue()
self.set_header("Content-type", "image/jpg")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: autorope/donkeycar
Commit Name: 558cf909ff79341e699cf872082231f83f4cdc50
Time: 2017-02-08
Author: wroscoe@gmail.com
File Name: donkey/remotes.py
Class Name: CameraMJPEGHandler
Method Name: get
Project Name: pandas-dev/pandas
Commit Name: 6ff2e7c602123787c3b0061466ab5bb8663eae81
Time: 2021-01-18
Author: twoertwein@users.noreply.github.com
File Name: pandas/_testing/contexts.py
Class Name:
Method Name: ensure_clean
Project Name: EducationalTestingService/skll
Commit Name: ca10c185d94470054d693f19e7691523dbe3ec55
Time: 2019-03-05
Author: jbiggs@ets.org
File Name: skll/data/readers.py
Class Name: NDJReader
Method Name: _sub_read