def __init__(self, fh, nodes, columns=None):
        # keep track of any file handles opened by this instance so they
        # can be closed.
        self.fh = fh
        self.open_fhs = []

        # fh may be either a file handle, a filename or a node
        # that evaluates to a file handle or name.
        self.writers = {}
        if not isinstance(fh, MDFNode):
            # if fh isn't a node use the same writer for all contexts
            if isinstance(fh, basestring):
                fh = open(fh, "wb")
                self.open_fhs.append(fh)
            writer = csv.writer(fh)
            self.writers = defaultdict(lambda: writer)

        self.handlers = None

        if isinstance(nodes, MDFNode):
            nodes = [nodes]

        if len(nodes) > 1 and columns is None:
            self.nodes, self.columns = _pairs_to_node_label_lists(nodes)
        else:
            self.nodes = nodes

            self.columns = list(columns or [])[:len(nodes)]
            self.columns += [None] * (len(nodes) - len(self.columns))
Writes node values to a csv file for each date.
dataset/ETHPy150Open manahl/mdf/mdf/builders/basic.py/CSVWriter.__init__