29d4c8008bf062f0e90b0c0653907bed2ee3d48b,src/syft/core/node/domain/service/request_handler_service.py,UpdateRequestHandlerService,process,#Any#Any#Any#,279

Before Change


                    keys = set(existing_handler.keys())
                    keys.remove("created_time")  // the new handler has none
                    values = [existing_handler[key] for key in keys]
                    if keys == new_keys and set(new_values) == set(values):
                        // if keep is True we will add a new one
                        // if keep is False we will drop this anyway
                        continue

After Change


                for existing_handler in existing_handlers:
                    // we match two handlers according to their tags
                    if existing_handler["tags"] == msg.handler["tags"]:
                        matched = existing_handler
                        // if an existing_handler match the passed in handler,
                        // we ignore it in for loop
                        continue
                    else:
                        // if an existing_handler does not match the passed in
                        // handler, we keep it
                        replacement_handlers.append(existing_handler)

                if msg.keep:
                    msg.handler["created_time"] = time.time()
                    replacement_handlers.append(msg.handler)
                    if matched is not None:
                        debug(
                            f"> Replacing a Request Handler {matched} with: {msg.handler}"
                        )
                    else:
                        debug(f"> Adding a Request Handler {msg.handler}")
                else:
                    debug(f"> Removing a Request Handler with: {msg.handler}")

                setattr(node, "request_handlers", replacement_handlers)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: OpenMined/PySyft
Commit Name: 29d4c8008bf062f0e90b0c0653907bed2ee3d48b
Time: 2021-02-02
Author: xvtongye1986@163.com
File Name: src/syft/core/node/domain/service/request_handler_service.py
Class Name: UpdateRequestHandlerService
Method Name: process


Project Name: deepfakes/faceswap
Commit Name: 533025215d6629a1f506838fc9eeed33f2417591
Time: 2019-06-28
Author: 36920800+torzdf@users.noreply.github.com
File Name: lib/gui/display_graph.py
Class Name: TrainingGraph
Method Name: refresh


Project Name: home-assistant/home-assistant
Commit Name: 8703124c760df303d29571aa975a72cc4f868f09
Time: 2018-01-17
Author: pierre.staahl@gmail.com
File Name: homeassistant/components/media_player/yamaha.py
Class Name:
Method Name: setup_platform