@since(2.0)
def config(self, key=None, value=None, conf=None):
    'Sets a config option. Options set using this method are automatically propagated to\n            both :class:`SparkConf` and :class:`SparkSession`\'s own configuration.\n\n            For an existing SparkConf, use `conf` parameter.\n\n            >>> from pyspark.conf import SparkConf\n            >>> SparkSession.builder.config(conf=SparkConf())\n            <pyspark.sql.session...\n\n            For a (key, value) pair, you can omit parameter names.\n\n            >>> SparkSession.builder.config("spark.some.config.option", "some-value")\n            <pyspark.sql.session...\n\n            :param key: a key name string for configuration property\n            :param value: a value for configuration property\n            :param conf: an instance of :class:`SparkConf`\n            '
    with self._lock:
        if (conf is None):
            self._options[key] = str(value)
        else:
            for (k, v) in conf.getAll():
                self._options[k] = v
        return self
Sets a config option. Options set using this method are automatically propagated to
both :class:`SparkConf` and :class:`SparkSession`'s own configuration.

For an existing SparkConf, use `conf` parameter.

>>> from pyspark.conf import SparkConf
>>> SparkSession.builder.config(conf=SparkConf())
<pyspark.sql.session...

For a (key, value) pair, you can omit parameter names.

>>> SparkSession.builder.config("spark.some.config.option", "some-value")
<pyspark.sql.session...

:param key: a key name string for configuration property
:param value: a value for configuration property
:param conf: an instance of :class:`SparkConf`
@since(2.0)
def config(self, key=None, value=None, conf=None):
    'Sets a config option. Options set using this method are automatically propagated to\n            both :class:`SparkConf` and :class:`SparkSession`\'s own configuration.\n\n            For an existing SparkConf, use `conf` parameter.\n\n            >>> from pyspark.conf import SparkConf\n            >>> SparkSession.builder.config(conf=SparkConf())\n            <pyspark.sql.session...\n\n            For a (key, value) pair, you can omit parameter names.\n\n            >>> SparkSession.builder.config("spark.some.config.option", "some-value")\n            <pyspark.sql.session...\n\n            :param key: a key name string for configuration property\n            :param value: a value for configuration property\n            :param conf: an instance of :class:`SparkConf`\n            '
    with self._lock:
        if (conf is None):
            self._options[key] = str(value)
        else:
            for (k, v) in conf.getAll():
                self._options[k] = v
        return self