def deflood(s, n=<NUM_LIT:3>):
if n == <NUM_LIT:0>:<EOL><INDENT>return s[<NUM_LIT:0>:<NUM_LIT:0>]<EOL><DEDENT>return re.sub(r"<STR_LIT>" % (n-<NUM_LIT:1>), lambda m: m.group(<NUM_LIT:1>)[<NUM_LIT:0>] * n, s)<EOL>
Returns the string with no more than n repeated characters, e.g.,
        deflood("NIIIICE!!", n=1) => "Nice!"
        deflood("nice.....", n=3) => "nice..."