There is all sorts of mess in constants definitions.
Why are they indented? Python holds meaning to indentation so there shouldn't be any indentation in constants.
Also some constants are defined in lower case, some in upper case and some in mixed case. Does this make sense? All of them should be upper case as constants normally are.
Hex values and integer values should not be placed inside quotes as they have been in some places
Binary values need to be written as int('binary_number', 2)
There is all sorts of mess in constants definitions.