PEP 8 formatting and lint error fixing
Use proper dialect for creating headers

This will take quoting into account
Also use longer sample for better sniffing