def node_import_from(self, node):
        jsvars = self.jsvars.copy()
        imports = []
        if isinstance(node.children[1], Leaf):
            modname = node.children[1].value
        else:
            modname = '.'.join(self.dispatch(node.children[1]))
        for child in node.children[3:]:
            if isinstance(child, Leaf):
                if child.value in ['(', ')']:
                    continue
                names = [[child.value, None]]
            else:
                names = self.dispatch(child)
            if not isinstance(names, list):
                names = [names]
            if modname == '__pyjamas__':
                for name, assname in names:
                    if not hasattr(__Pyjamas__, name):
                        raise self.TranslationError(
                            "ImportError: cannot import name %s from %s" % (
                                name, modname,
                            ),
                        )
                    to_js = getattr(__Pyjamas__, name)(self)
                    self.add_name(name, to_js=to_js, force=True)
                return
            if modname == '__javascript__':
                for name, assname in names:
                    if assname is None:
                        assname = name
                    self.add_name(assname, to_js=name, force=True)
                return
            if modname == '__future__':
                for name, assname in names:
                    imp = 'import_%s' % name
                    imp = getattr(self.__future__, imp, None)
                    if imp is None:
                        raise self.TranslationError(
                            "SyntaxError: future feature %s is not defined" % (
                                name,
                            ),
                        )
                    imp(self)
            level = modname
            modname = modname.lstrip('.')
            level = len(level) - len(modname)
            if level == 0:
                level = 'null'
            else:
                modname = ''
            c_modname = self.add_const_str(modname)
            assnames = []
            fromlist = []
            for name, assname in names:
                c_name = self.add_const_str(name)
                fromlist.append(c_name)
                if assname is None:
                    assnames.append([c_name, 'null'])
                    assname = name
                else:
                    c_assname = self.add_const_str(assname)
                    assnames.append([c_name, c_assname])
                self.add_name(assname)
                self.add_import(modname, [name])
            if assnames:
                assnames = "[%s]" % '], ['.join(["%s, %s" % (i, j) for (i, j) in assnames])
            else:
                assnames = ''
            fromlist = ', '.join(fromlist)
            jsvars.update(
                modname=c_modname,
                fromlist=fromlist,
                assnames=assnames,
                level=level,
            )
            imports.append("""\
%(builtin)s['_import']([%(assnames)s], %(modname)s, %(globals)s, %(locals)s, [%(fromlist)s], %(level)s);""" % jsvars)
        return "\n".join(imports)
dataset/ETHPy150Open anandology/pyjamas/pyjs/src/pyjs/translator_dict.py/Translator.node_import_from/original