<s> import os <EOL> abspath = lambda * p : os . path . abspath ( os . path . join ( * p ) ) <EOL> def get_dirs_for_path ( * paths ) : <EOL> """<STR_LIT>""" <EOL> for path in paths : <EOL> head = path <EOL> while head : <EOL> head , tail = os . path . split ( head ) <EOL> if head : <EOL> yield head <EOL> else : <EOL> break <EOL> def get_dir_size ( path ) : <EOL> root_path = path <EOL> size = <NUM_LIT:0> <EOL> for path , dirs , files in os . walk ( root_path ) : <EOL> for f in files : <EOL> try : <EOL> size += os . path . getsize ( os . path . join ( path , f ) ) <EOL> except OSError : <EOL> pass <EOL> return size <EOL> def get_user_home ( ) : <EOL> """<STR_LIT>""" <EOL> return os . getenv ( '<STR_LIT>' , os . getenv ( '<STR_LIT>' ) ) or '<STR_LIT>' </s>
