replace all the occurrences of '\\\\' in string value with '\\' and all occurrences of '\\"' for '"', substitute the result for value.
value = value . replace ( b'\\\\' , b'\\' ) . replace ( b'\\"' , b'"' )