

def _format_node(self, op):
    formatted_args = []

    def visit(what, extra_indents=0):
        if isinstance(what, ir.Expr):
            result = self._format_subexpr(what)
        else:
            result = self._indent(str(what))
        if (extra_indents > 0):
            result = util.indent(result, self.indent_size)
        formatted_args.append(result)
    arg_names = getattr(op, '_arg_names', None)
    if (arg_names is None):
        for arg in op.args:
            if isinstance(arg, list):
                for x in self:
                    visit(x)
            else:
                visit(arg)
    else:
        for (arg, name) in zip(op.args, arg_names):
            if (name is not None):
                name = self._indent('{0}:'.format(name))
            if isinstance(arg, list):
                if ((name is not None) and (len(arg) > 0)):
                    formatted_args.append(name)
                    indents = 1
                else:
                    indents = 0
                for x in arg:
                    visit(x, extra_indents=indents)
            else:
                if (name is not None):
                    formatted_args.append(name)
                    indents = 1
                else:
                    indents = 0
                visit(arg, extra_indents=indents)
    opname = type(op).__name__
    type_display = self._get_type_display(op)
    opline = ('%s[%s]' % (opname, type_display))
    return '\n'.join(([opline] + formatted_args))

dataset/ETHPy150Open cloudera/ibis/ibis/expr/format.py ExprFormatter._format_node/VarMisuse@142/176 `arg`->`self`