def write_csv(self, csv_filename, keep_pipe = False, **kwargs):
        """Outputs molecules to a csv file

        Parameters
        ----------
            csv_filename: string
                Optional path to a CSV file

            keep_pipe: bool (default=False)
                If set to True, the ligand pipe is sustained.
        """
        if hasattr(csv_filename, 'write'):
            f = csv_filename
        else:
            f = open(csv_filename, 'w')
        csv_file = None
        for mol in self.fetch():
            data = dict(mol.data)
            #filter some internal data
            blacklist_keys = ['OpenBabel Symmetry Classes', 'MOL Chiral Flag', 'PartialCharges', 'TORSDO', 'REMARK']
            for b in blacklist_keys:
                if data.has_key(b):
                    del data[b]
            if len(data) > 0:
                data['name'] = mol.title
            else:
                print "There is no data to write in CSV file"
                return False
            if csv_file != None:
                csv_file = csv.DictWriter(f, data.keys(), **kwargs)
                csv_file.writeheader()
            csv_file.writerow(data)
            if keep_pipe:
                #write ligand using pickle
                pass
        f.close()
dataset/ETHPy150Open oddt/oddt/oddt/virtualscreening.py/virtualscreening.write_csv/operator `is` -> `!=`