# Path: disentanglement_lib/utils/results.py
# def update_result_directory(result_directory,
#                             step_name,
#                             results_dict,
#                             old_result_directory=None):
# def _copy_recursively(path_to_old_dir, path_to_new_dir):
# def copydir(path_to_old_dir, path_to_new_dir):
# def save_gin(config_path):
#   def default(self, obj):
# def save_dict(config_path, dict_with_info):
# def gin_dict(config_path=None):
# def namespaced_dict(base_dict=None, **named_dicts):
# def aggregate_json_results(base_path):
# class Encoder(json.JSONEncoder):


import os
import tensorflow.compat.v1 as tf
import gin.tf
from disentanglement_lib.utils import results
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for results.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function


@gin.configurable("test")
def test_fn(value=gin.REQUIRED):
  return value


class ResultsTest(tf.test.TestCase):

  def test_namespaced_dict(self):
    """Tests namespacing functionality."""
    base_dict = {"!": "!!"}
    numbers = {"1": "one"}
    chars = {"a": "A"}

# Path: disentanglement_lib/utils/results.py
# def update_result_directory(result_directory,
#                             step_name,
#                             results_dict,
#                             old_result_directory=None):
# def _copy_recursively(path_to_old_dir, path_to_new_dir):
# def copydir(path_to_old_dir, path_to_new_dir):
# def save_gin(config_path):
#   def default(self, obj):
# def save_dict(config_path, dict_with_info):
# def gin_dict(config_path=None):
# def namespaced_dict(base_dict=None, **named_dicts):
# def aggregate_json_results(base_path):
# class Encoder(json.JSONEncoder):


# Path: disentanglement_lib/utils/results_test.py
import os
import tensorflow.compat.v1 as tf
import gin.tf
from disentanglement_lib.utils import results

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for results.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function


@gin.configurable("test")
def test_fn(value=gin.REQUIRED):
  return value


class ResultsTest(tf.test.TestCase):

  def test_namespaced_dict(self):
    """Tests namespacing functionality."""
    base_dict = {"!": "!!"}
    numbers = {"1": "one"}
    chars = {"a": "A"}

    new_dict = results.namespaced_dict(base_dict, numbers=numbers, chars=chars)