Update dimacs_parser.py

refactored