How to use the hdijupyterutils.configuration.with_override function in hdijupyterutils

To help you get started, we’ve selected a few hdijupyterutils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyter-incubator / sparkmagic / sparkmagic / sparkmagic / utils / configuration.py View on Github external
import sparkmagic.utils.constants as constants


d = {}
path = join_paths(HOME_PATH, CONFIG_FILE)

    
def override(config, value):
    _override(d, path, config, value)


def override_all(obj):
    _override_all(d, obj)


_with_override = with_override(d, path)


# Helpers

def get_livy_kind(language):
    if language == LANG_SCALA:
        return SESSION_KIND_SPARK
    elif language == LANG_PYTHON:
        return SESSION_KIND_PYSPARK
    elif language == LANG_R:
        return SESSION_KIND_SPARKR
    else:
        raise BadUserConfigurationException("Cannot get session kind for {}.".format(language))


def get_auth_value(username, password):