06a20d0d1540d35dc4e2446592e1a8b08ef56420,homeassistant/components/octoprint.py,OctoPrintAPI,get_tools,#OctoPrintAPI#,62

Before Change


    def get_tools(self):
        Get the dynamic list of tools that temperature is monitored on.
        tools = self.printer_last_reading[0]["temperature"]
        return tools.keys()

    def get(self, endpoint):
        Send a get request, and return the response as a dict.
        // Only query the API at most every 30 seconds

After Change


        Get the list of tools that temperature is monitored on.
        tools = []
        if self.number_of_tools > 0:
            for tool_number in range(0, self.number_of_tools):
                tools.append("tool" + str(tool_number))
        if self.bed:
            tools.append("bed")
        if not self.bed and self.number_of_tools == 0:
            temps = self.printer_last_reading[0].get("temperature")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: home-assistant/home-assistant
Commit Name: 06a20d0d1540d35dc4e2446592e1a8b08ef56420
Time: 2017-08-22
Author: wjs.scanlon@gmail.com
File Name: homeassistant/components/octoprint.py
Class Name: OctoPrintAPI
Method Name: get_tools


Project Name: CellProfiler/CellProfiler
Commit Name: 53059cec9053a8429b7f0a8f06e6cbe1672b60e7
Time: 2013-01-16
Author: leek@broadinstitute.org
File Name: cellprofiler/modules/tests/test_groups.py
Class Name: TestGroups
Method Name: test_02_01_group_on_one


Project Name: mindsdb/mindsdb
Commit Name: 888ec7fe2b26ec280ac39244963b411657e56ea1
Time: 2019-02-20
Author: george@cerebralab.com
File Name: mindsdb/libs/phases/model_predictor/model_predictor.py
Class Name: ModelPredictor
Method Name: run