<s> from __future__ import absolute_import <EOL> import os <EOL> import sys <EOL> from subprocess import check_output <EOL> from bd2k . util import memoize <EOL> def toilPackageDirPath ( ) : <EOL> """<STR_LIT>""" <EOL> result = os . path . dirname ( os . path . realpath ( __file__ ) ) <EOL> assert result . endswith ( '<STR_LIT>' ) <EOL> return result <EOL> def resolveEntryPoint ( entryPoint ) : <EOL> """<STR_LIT>""" <EOL> if hasattr ( sys , '<STR_LIT>' ) : <EOL> path = os . path . join ( os . path . dirname ( sys . executable ) , entryPoint ) <EOL> assert os . path . isfile ( path ) <EOL> assert os . access ( path , os . X_OK ) <EOL> return path <EOL> else : <EOL> return entryPoint <EOL> @ memoize <EOL> def physicalMemory ( ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return os . sysconf ( '<STR_LIT>' ) * os . sysconf ( '<STR_LIT>' ) <EOL> except ValueError : <EOL> return int ( check_output ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) . strip ( ) ) </s>
