<s> """<STR_LIT>""" <EOL> import os <EOL> import stat <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> def exists ( path ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> st = os . stat ( path ) <EOL> except os . error : <EOL> return False <EOL> return True <EOL> def isfile ( path ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> st = os . stat ( path ) <EOL> except os . error : <EOL> return False <EOL> return stat . S_ISREG ( st . st_mode ) <EOL> def isdir ( s ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> st = os . stat ( s ) <EOL> except os . error : <EOL> return False <EOL> return stat . S_ISDIR ( st . st_mode ) <EOL> def getsize ( filename ) : <EOL> """<STR_LIT>""" <EOL> return os . stat ( filename ) . st_size <EOL> def getmtime ( filename ) : <EOL> """<STR_LIT>""" <EOL> return os . stat ( filename ) . st_mtime <EOL> def getatime ( filename ) : <EOL> """<STR_LIT>""" <EOL> return os . stat ( filename ) . st_atime <EOL> def getctime ( filename ) : <EOL> """<STR_LIT>""" <EOL> return os . stat ( filename ) . st_ctime <EOL> def commonprefix ( m ) : <EOL> "<STR_LIT>" <EOL> if not m : return '<STR_LIT>' <EOL> s1 = min ( m ) <EOL> s2 = max ( m ) <EOL> for i , c in enumerate ( s1 ) : <EOL> if c != s2 [ i ] : <EOL> return s1 [ : i ] <EOL> return s1 <EOL> def _splitext ( p , sep , altsep , extsep ) : <EOL> """<STR_LIT>""" <EOL> sepIndex = p . rfind ( sep ) <EOL> if altsep : <EOL> altsepIndex = p . rfind ( altsep ) <EOL> sepIndex = max ( sepIndex , altsepIndex ) <EOL> dotIndex = p . rfind ( extsep ) <EOL> if dotIndex > sepIndex : <EOL> filenameIndex = sepIndex + <NUM_LIT:1> <EOL> while filenameIndex < dotIndex : <EOL> if p [ filenameIndex ] != extsep : <EOL> return p [ : dotIndex ] , p [ dotIndex : ] <EOL> filenameIndex += <NUM_LIT:1> <EOL> return p , '<STR_LIT>' </s>
