def make_us_postal_code(s, allowed_lengths=(), allowed_digits=()):
allowed_lengths = allowed_lengths or tuple(N if N < <NUM_LIT:6> else N + <NUM_LIT:1> for N in allowed_digits)<EOL>allowed_lengths = allowed_lengths or (<NUM_LIT:2>, <NUM_LIT:3>, <NUM_LIT:5>, <NUM_LIT:10>)<EOL>ints = int_pair(s)<EOL>z = str(ints[<NUM_LIT:0>]) if ints[<NUM_LIT:0>] else '<STR_LIT>'<EOL>z4 = '<STR_LIT:->' + str(ints[<NUM_LIT:1>]) if ints[<NUM_LIT:1>] else '<STR_LIT>'<EOL>if len(z) == <NUM_LIT:4>:<EOL><INDENT>z = '<STR_LIT:0>' + z<EOL><DEDENT>if len(z + z4) in allowed_lengths:<EOL><INDENT>return z + z4<EOL><DEDENT>elif len(z) in (min(l, <NUM_LIT:5>) for l in allowed_lengths):<EOL><INDENT>return z<EOL><DEDENT>return '<STR_LIT>'<EOL>
>>> make_us_postal_code(1234)
'01234'
>>> make_us_postal_code(507.6009)
'507'
>>> make_us_postal_code(90210.0)
'90210'
>>> make_us_postal_code(39567.7226)
'39567-7226'
>>> make_us_postal_code(39567.7226)
'39567-7226'