def METHOD_NAME(file, config, env=os.environ):
    """Write JSON data about the configuration specified in config and an
    environment variable dict to ``|file|``, which may be a filename or file-like
    object.
    See build_dict for information about what  environment variables are used,
    and what keys are produced.
    """
    build_conf = build_dict(config, env)
    if isinstance(file, six.text_type):
        file = open(file, "wt")
    json.dump(build_conf, file, sort_keys=True, indent=4)