def __init__(self, tosca_yaml, parent_dir=None, log_to_console = False):
        # TOSCA will look for imports using a relative path from where the
        # template file is located, so we have to put the template file
        # in a specific place.
        if not parent_dir:
            parent_dir = os.getcwd()

        tmp_pathname = None
        try:
            (tmp_handle, tmp_pathname) = tempfile.mkstemp(dir=parent_dir)
            os.write(tmp_handle, tosca_yaml)
            os.close(tmp_handle)

            self.template = ToscaTemplate(tmp_pathname)
        except:
            traceback.print_exc()
            raise
        finally:
            if tmp_pathname:
                os.remove(tmp_pathname)

        self.log_to_console = log_to_console
        self.log_msgs = []

        self.compute_dependencies()

        self.deferred_sync = []

        self.ordered_nodetemplates = []
        self.ordered_names = self.topsort_dependencies()
        self.log(self.ordered_names % "ordered_names: %s")
        for name in self.ordered_names:
            if name in self.nodetemplates_by_name:
                self.ordered_nodetemplates.append(self.nodetemplates_by_name[name])

        #pdb.set_trace()
dataset/ETHPy150Open open-cloud/xos/xos/tosca/engine.py/XOSTosca.__init__/swapped operands of `%`