def _check_mode(handle):
 mode = ''
 if hasattr(handle, 'mode'):
  mode = handle.mode
  if (mode == 1):
   return
  mode = str(mode)
 if (mode and ('U' in mode.upper())):
  raise ValueError('SFF files must NOT be opened in universal new lines mode. Binary mode is recommended (although on Unix the default mode is also fine).')
 elif (mode and ('B' not in mode.upper()) and (sys.platform == 'win32')):
  raise ValueError('SFF files must be opened in binary mode on Windows')

def _check_mode ( handle ) : mode = '' if hasattr ( handle , 'mode' ) : mode = handle . mode if ( mode == 1 ) : return mode = str ( mode ) if ( mode and ( 'U' in mode . upper ( ) ) ) : raise ValueError ( 'SFF files must NOT be opened in universal new lines mode. Binary mode is recommended (although on Unix the default mode is also fine).' ) elif ( mode and ( 'B' not in mode . upper ( ) ) and ( sys . platform == 'win32' ) ) : raise ValueError ( 'SFF files must be opened in binary mode on Windows' )
ensure handle not opened in text mode .