def get_test(self, node, name=None):
        #print 'get_test:', repr(node)
        if isinstance(node, Node):
            t = type_repr(node.type)
            if t in ['and_test', 'or_test', 'not_test']:
                if name is None:
                    return getattr(self, 'node_%s' % t)(node, True)
                return getattr(self, 'node_%s' % t)(node, name=name)
            elif t in ['comparison']:
                test = self.dispatch(node)
                if name is None:
                    return "%s.valueOf()" % test
                else:
                    return "(%s=%s).valueOf()" % (name, test)
        test = self.dispatch(node)
        if name is None:
            return "%s(%s)" % (self.jsvars['booljs'], test)
        return "%s(%s=%s)" % (self.jsvars['booljs'], name, test)
dataset/ETHPy150Open anandology/pyjamas/pyjs/src/pyjs/translator_dict.py/Translator.get_test/original