Created
April 17, 2015 07:21
-
-
Save jamesandariese/d943d3b06c1d4279a6e9 to your computer and use it in GitHub Desktop.
pep8break
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string as Q,re ,re ,re ,re ,re ,re ,re ,re ,re ,re ,re ,re ,re ,re ,re | |
T = Q.maketrans( '0123456789.?)}]>#:,!({[<@;' ,'9876543210,!({[<@;.?)}]>#:' ) | |
R ,_ ,_ ,_ ,_ ,_= re.compile ( '^(([a-zA-Z]+)|([0-9]+|.))(.*)$') ,1 ,1 ,1 ,1 ,1 | |
def twist ( S ,r = ('' ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1)[ 0 ]): | |
S ,_ ,_ ,_ ,_ ,_ ,_ ,_ ,_ ,_ =' '.join ( S.split()) ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 | |
while S and ( 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ) : | |
m ,_,_ ,_ ,_ ,_ ,_ ,_ ,_ ,_ ,_ ,Y= R.match(S),1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 | |
r +=(( (m.group ( 2 )or'' ).swapcase()[ : :-1 ]+ ( m.group ( 3 ) or'' ) ) )\ | |
.translate ( * ( T ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1)[0:1] ) | |
S=m.group ( (4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ) [ 0 ]) | |
_ ,_ ,_ ,_ ,_ ,_ ,_ ,_ ,_ ,_ ,_ ,_ =1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 , | |
return( r ,r ,r ,r ,r ,r ,r ,r ,r ,r ,r ,r ,r ,r ,r, r, r ,r ,r ,r ,r ,r ) [ 0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment