def fix_whitespace(line, offset, replacement):
 left = line[:offset].rstrip(u'\n\r  DCTB \\')
 right = line[offset:].lstrip(u'\n\r  DCTB \\')
 if right.startswith(u'#'):
  return line
 else:
  return ((left + replacement) + right)

def fix_whitespace ( line , offset , replacement ) : left = line [ : offset ] . rstrip ( u'\n\r  DCTB \\' ) right = line [ offset : ] . lstrip ( u'\n\r  DCTB \\' ) if right . startswith ( u'#' ) : return line else : return ( ( left + replacement ) + right )
replace whitespace at offset and return fixed line .