def node_decorated(self, node):
        self.assert_instance(node, node.children[0], Node)
        self.assert_instance(node, node.children[1], Node)
        assert len(node.children) == 2
        decorators = self.dispatch(node.children[0])
        func = node.children[1]
        if not isinstance(decorators, list):
            decorators = [decorators]
        lineno = self.track_lineno(decorators[0])
        next_func_type = None
        if isinstance(self.names[-1], ClassNames):
            next_func_type = func_type['function']
            if decorators[-1].name == 'staticmethod':
                next_func_type = func_type['staticmethod']
            elif decorators[-1].name == 'classmethod':
                next_func_type = func_type['classmethod']
            self.next_func_type.append(next_func_type)
        self.assert_value(func, func.children[0].value, 'def')
        name = func.children[1].value
        self.add_name(name, self.track_lineno(func), force=True)
        src = self.get_jsname(name)
        dst = "%s = " % src
        jsvars = self.jsvars.copy()
        for decorator in decorators:
            if decorator is decorators[-1] and \
               next_func_type is not None and \
               decorator.name in ['staticmethod', 'classmethod']:
                pass
            else:
                deco = decorator.name.split('.')
                if len(deco) == 1:
                    deco = self.get_jsname(decorator.name)
                else:
                    dst = ''
                    deco = "%s(%s, ['%s'])" %(
                        jsvars['getattr'],
                        self.get_jsname(deco[0]),
                        "', '".join(deco[1:]),
                    )
                jsvars.update(locals())
                self.add_lines("""\
%(src)s = %(fcall)s(%(module)s, %(lineno)s, %(deco)s, null,""" % jsvars)
                dst = ''
                self.indent()

        name = self.dispatch(func)

        for decorator in decorators:
            if decorator is decorators[-1] and \
               next_func_type is not None and \
               decorator.name in ['staticmethod', 'classmethod']:
                pass
            else:
                self.dedent()
                # remove trailing ';' from last line
                assert self.lines[-1][1][-1] == ';'
                self.lines[-1][1] = self.lines[-1][1][:-1]
                self.add_lines(");")

        if next_func_type is not None:
            self.next_func_type.pop()
        return
dataset/ETHPy150Open anandology/pyjamas/pyjs/src/pyjs/translator_dict.py/Translator.node_decorated/original