def _serial_sanitizer(instr):
 length = len(instr)
 index = int(math.floor((length * 0.75)))
 return '{0}{1}'.format(instr[:index], ('X' * (length - index)))

def _serial_sanitizer ( instr ) : length = len ( instr ) index = int ( math . floor ( ( length * 0.75 ) ) ) return '{0}{1}' . format ( instr [ : index ] , ( 'X' * ( length - index ) ) )
replaces the last 1/4 of a string with xs .