def generate(self, tree):
        for middleware in DEFAULT_MIDDLEWARES + self.middlewares:
            tree = middleware.process(tree) # changed in place!!
        original = self._generate_node(tree)
        # first n lines n dependencies
        # after that additional code

        if self.a and tree.type == 'module':
            p = original.split('\n')
            r = '\n'.join(p[:len(tree.dependencies)] + (['\n'] if tree.dependencies else []) + self.a + ['\n'] + p[len(tree.dependencies):]) + '\n'
        else:
            r = original
        r = re.sub(CLOSING_CURLY_ENDLINES, r'}\n\2}', r)
        r = re.sub(JS_BRACKET, r'}\1', r)
        return re.sub(TOO_MANY_ENDLINES, r'\n\n', r)
Returns a list of all waiting threads.
dataset/ETHPy150Open alehander42/pseudo/pseudo/code_generator.py/CodeGenerator.generate--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/locking.py/PipeCondition.get_waiting