import sys

def binary_stdin():
    """
    Get a file object for reading binary bytes from stdin instead of text.
    Compatible with Py2/3, POSIX & win32.
    Credits: https://stackoverflow.com/a/38939320/531179 (CC BY-SA 3.0)
    """
    if hasattr(sys.stdin, 'buffer'): # Py3+
        return sys.stdin.buffer
    else:
        if sys.platform == 'win32':
            import os, msvcrt
            msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
        return sys.stdin

@@ -5,16 +5,17 @@
 rt sys%0A%0A
+%0A
 def bina
@@ -267,16 +267,17 @@
 uffer'):
+ 
  # Py3+%0A

Enhance PEP8