dfa81b0117708a41a64d3bb7d11104d115d35d2b,homeassistant/components/camera/mjpeg.py,MjpegCamera,camera_image,#MjpegCamera#,42
Before Change
password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()
password_mgr.add_password(None, self._mjpeg_url, self._username, self._password)
handler = urllib.request.HTTPBasicAuthHandler(password_mgr)
opener = urllib.request.build_opener(handler)
urllib.request.install_opener(opener)
stream = urllib.request.urlopen(self._mjpeg_url)
charset = stream.headers.get_param("charset")
After Change
return jpg
if self._username and self._password:
with closing(requests.get(self._mjpeg_url, auth=HTTPBasicAuth(self._username, self._password), stream=True)) as response:
return process_response(response)
else:
with closing(requests.get(self._mjpeg_url, stream=True)) as response:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: home-assistant/home-assistant
Commit Name: dfa81b0117708a41a64d3bb7d11104d115d35d2b
Time: 2015-11-08
Author: ryan.e.t@gmail.com
File Name: homeassistant/components/camera/mjpeg.py
Class Name: MjpegCamera
Method Name: camera_image
Project Name: pytorch/text
Commit Name: 37452ca74a6022d6b67ba0ba9af2b1e406de7578
Time: 2018-04-27
Author: zhshihang@gmail.com
File Name: torchtext/utils.py
Class Name:
Method Name: download_from_url
Project Name: codelucas/newspaper
Commit Name: cc423445e02486f1ea1f191f38320671ef05968c
Time: 2016-02-25
Author: y@yprez.com
File Name: newspaper/images.py
Class Name:
Method Name: fetch_url