def get_ipdir():

    # Initialize arguments and check location
    try:
        ipdir = sys.argv[1]
    except IndexError:
        ipdir = '..'

    ipdir = os.path.abspath(ipdir)

    cd(ipdir)
    if not os.path.isdir('IPython') and os.path.isfile('setup.py'):
        raise SystemExit('Invalid ipython directory: %s' % ipdir)
    return ipdir
UNIT test: services.accounts.utils - user from HTTP request
dataset/ETHPy150Open ipython/ipython-py3k/tools/toollib.py/get_ipdir--crossover with--dataset/ETHPy150Open satnet-project/server/services/accounts/tests/test_utils.py/UtilsTest.test_get_user