(cls, write, data)
`write` is a callback that accepts an iterable
`write` is a callback that accepts an iterable
write is a callback that accepts an iterable
def write_data(cls, write, data):
        """`write` is a callback that accepts an iterable"""
        vars_ = list(
            chain((ContinuousVariable('_w'),) if data.has_weights() else (),
                  data.domain.attributes,
                  data.domain.class_vars,
                  data.domain.metas))

        formatters = [cls.formatter(v) for v in vars_]
        for row in zip(data.W if data.W.ndim > 1 else data.W[:, np.newaxis],
                       data.X,
                       data.Y if data.Y.ndim > 1 else data.Y[:, np.newaxis],
                       data.metas):
            write([fmt(v) for fmt, v in zip(formatters, flatten(row))])
def write_data ( cls , write , data ) : vars_ = list ( chain ( ( ContinuousVariable ( '_w' ) , ) if data . has_weights ( ) else ( ) , data . domain . attributes , data . domain . class_vars , data . domain . metas ) ) formatters = [ cls . formatter ( v ) for v in vars_ ] for row in zip ( data . W if data . W . ndim > 1 else data . W [ : , np . newaxis ] , data . X , data . Y if data . Y . ndim > 1 else data . Y [ : , np . newaxis ] , data . metas ) : write ( [ fmt ( v ) for fmt , v in zip ( formatters , flatten ( row ) ) ] )