dfa81b0117708a41a64d3bb7d11104d115d35d2b,homeassistant/components/camera/mjpeg.py,MjpegCamera,camera_image,#MjpegCamera#,42

Before Change


            opener = urllib.request.build_opener(handler)
            urllib.request.install_opener(opener)

        stream = urllib.request.urlopen(self._mjpeg_url)
        charset = stream.headers.get_param("charset")
        bytes = b""
        while True:
            bytes += stream.read(1024)
            a = bytes.find(b"\xff\xd8")
            b = bytes.find(b"\xff\xd9")
            if a != -1 and b != -1:
                jpg = bytes[a:b+2]

After Change


                    jpg = data[jpg_start:jpg_end + 2]
                    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:
                return process_response(response)

    @property
    def name(self):
         Return the name of this device. 
        return self._name
Italian Trulli
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: okfn-brasil/serenata-de-amor
Commit Name: e1d39a4c9158c9a9db1218cb5be9946152e2ca1b
Time: 2017-04-14
Author: marcus.rehm@gmail.com
File Name: src/fetch_cnpj_info.py
Class Name:
Method Name: fetch_cnpj_info


Project Name: matplotlib/matplotlib
Commit Name: 29a495aa6c877977df73aed5b7873e1411b80ce3
Time: 2018-06-10
Author: choldgraf@berkeley.edu
File Name: examples/lines_bars_and_markers/timeline.py
Class Name:
Method Name: