fix typo in datapoint_extractor, import sys in cosm_writer