def create_call_stmt(self, fname='fn', args=None, subst_base=None, subst_args=None):
        if args is None or len(args) == 0:
            a = ''
        else:
            a = []
            for arg in args:
                if isinstance(arg, Node) or isinstance(arg, Leaf):
                    a.append('1')
                else:
                    a.append(arg)
            a = ', '.join(a)
        stmt = self.driver.parse_string(
            "%(fname)s(%(a)s)\n" % locals(),
            True,
        ).children[0]
        # driver.parse_string("fn()\n", True).children[0]
        # Node(simple_stmt, [Node(power, [Leaf(1, 'fn'), Node(trailer, [Leaf(7, '('), Leaf(8, ')')])]), Leaf(4, '\n')]), Leaf(0, '')
        # driver.parse_string("fn(1)\n", True).children[0]
        # Node(simple_stmt, [Node(power, [Leaf(1, 'fn'), Node(trailer, [Leaf(7, '('), Leaf(2, '1'), Leaf(8, ')')])]), Leaf(4, '\n')]), Leaf(0, '')
        # driver.parse_string("fn(1,2)\n", True).children[0]
        # Node(simple_stmt, [Node(power, [Leaf(1, 'fn'), Node(trailer, [Leaf(7, '('), Node(arglist, [Leaf(2, '1'), Leaf(12, ','), Leaf(2, '2')]), Leaf(8, ')')])]), Leaf(4, '\n')]), Leaf(0, '')
        trailer_childs = stmt.children[0].children[-1].children
        if args is None or len(args) == 0:
            pass
        elif len(args) == 1:
            arg = args[0]
            if isinstance(arg, Node) or isinstance(arg, Leaf):
                trailer_childs[1] = arg
        else:
            self.assert_type(stmt, trailer_childs[1].type, 'arglist')
            arglist_childs = trailer_childs[1].children
            for idx, arg in enumerate(args):
                idx *= 2
                if isinstance(arg, Node) or isinstance(arg, Leaf):
                    arglist_childs[idx] = arg
        if subst_base is not None:
            if isinstance(subst_base, basestring):
                stmt.children[0].children[0].value = subst_base
            else:
                stmt.children[0].children[0] = subst_base
        if subst_args is not None:
            self.assert_type(stmt, trailer_childs[1].type, 'arglist')
            arglist_childs = trailer_childs[1].children
            if len(args) == 1:
                arg = args[0]
                if arg is None:
                    pass
                elif isinstance(arg, basestring):
                    trailer_childs[1].value = arg
                else:
                    trailer_childs[1] = arg
            elif len(args) > 1:
                for idx, arg in enumerate(subst_args):
                    idx *= 2
                    if arg is None:
                        pass
                    elif isinstance(arg, basestring):
                        arglist_childs[idx].value = arg
                    else:
                        arglist_childs[idx] = arg
        return stmt
dataset/ETHPy150Open anandology/pyjamas/pyjs/src/pyjs/translator_dict.py/Translator.create_call_stmt/original