def find_systemjs_location():
    """
    Figure out where `jspm_packages/system.js` will be put by JSPM.
    """
    location = os.path.abspath(os.path.dirname(locate_package_json()))
    conf = parse_package_json()

    if 'jspm' in conf:
        conf = conf['jspm']

    try:
        conf = conf['directories']
    except __HOLE__:
        raise ImproperlyConfigured("`package.json` doesn't appear to be a valid json object. "
                                   "Location: %s" % location)
    except KeyError:
        raise ImproperlyConfigured("The `directories` configuarion was not found in package.json. "
                                   "Please check your jspm install and/or configuarion. `package.json` "
                                   "location: %s" % location)

    # check for explicit location, else fall back to the default as jspm does
    jspm_packages = conf['packages'] if 'packages' in conf else 'jspm_packages'
    base = conf['baseURL'] if 'baseURL' in conf else '.'
    return os.path.join(location, base, jspm_packages, 'system.js')
dataset/ETHPy150Open sergei-maertens/django-systemjs/systemjs/jspm.py/find_systemjs_location