<s> """<STR_LIT>""" <EOL> import os <EOL> import shutil <EOL> def abspath ( path ) : <EOL> """<STR_LIT>""" <EOL> return os . path . abspath ( os . path . expanduser ( path ) ) <EOL> def backup ( path , suffix = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> count = - <NUM_LIT:1> <EOL> new_path = None <EOL> while True : <EOL> if os . path . exists ( path ) : <EOL> if count == - <NUM_LIT:1> : <EOL> new_path = "<STR_LIT>" % ( path , suffix ) <EOL> else : <EOL> new_path = "<STR_LIT>" % ( path , suffix , count ) <EOL> if os . path . exists ( new_path ) : <EOL> count += <NUM_LIT:1> <EOL> continue <EOL> else : <EOL> if os . path . isfile ( path ) : <EOL> shutil . copy ( path , new_path ) <EOL> elif os . path . isdir ( path ) : <EOL> shutil . copytree ( path , new_path ) <EOL> break <EOL> else : <EOL> break <EOL> return new_path <EOL> if '<STR_LIT>' in os . environ : <EOL> HOME_DIR = abspath ( os . environ [ '<STR_LIT>' ] ) <EOL> else : <EOL> HOME_DIR = abspath ( '<STR_LIT>' ) </s>
