<s> class Clock : <EOL> def __init__ ( self , area ) : <EOL> self . area = area <EOL> def clock ( self , feature ) : <EOL> if '<STR_LIT>' in feature : <EOL> feature [ '<STR_LIT>' ] = map ( self . clock_geometry , feature [ '<STR_LIT>' ] ) <EOL> elif '<STR_LIT>' in feature : <EOL> feature [ '<STR_LIT>' ] = self . clock_geometry ( feature [ '<STR_LIT>' ] ) <EOL> return feature <EOL> def clock_geometry ( self , geo ) : <EOL> if '<STR_LIT:type>' in geo : <EOL> if geo [ '<STR_LIT:type>' ] == '<STR_LIT>' or geo [ '<STR_LIT:type>' ] == '<STR_LIT>' : <EOL> geo [ '<STR_LIT>' ] = self . clockwise_polygon ( geo [ '<STR_LIT>' ] ) <EOL> elif geo [ '<STR_LIT:type>' ] == '<STR_LIT>' : <EOL> geo [ '<STR_LIT>' ] = map ( lambda x : self . clockwise_polygon ( x ) , geo [ '<STR_LIT>' ] ) <EOL> elif geo [ '<STR_LIT:type>' ] == '<STR_LIT>' : <EOL> geo [ '<STR_LIT>' ] = self . clockwise_ring ( geo [ '<STR_LIT>' ] ) <EOL> return geo <EOL> def clockwise_polygon ( self , rings ) : <EOL> return map ( lambda x : self . clockwise_ring ( x ) , rings ) <EOL> def clockwise_ring ( self , ring ) : <EOL> if self . area ( ring ) > <NUM_LIT:0> : <EOL> return list ( reversed ( ring ) ) <EOL> else : <EOL> return ring </s>
