# Path: cjktools/smart_cache.py
# def disk_proxy_direct(method, cache_file, dependencies=[]):
#     def proxy_method(*args, **params):
# def disk_proxy(cache_file, dependencies):
# def memory_proxy(method):
#     def proxy_method(*args, **params):
# def try_cache(filename, method_args=[], method_params={}, dependencies=[]):
# def store_cache_object(obj, filename, method_args=[], method_params={}):
# def needs_update(target, dependencies):
# def _get_module_dependencies(module):


import os
import time
import unittest
from cjktools import smart_cache
        self.num_calls = 0

        self.dep_file = 'tmp_dep_file'
        self.cache_file = 'tmp_cache_file'

        # make sure our dep_file exists and is non-empty
        with open(self.dep_file, 'w') as o_stream:
            print('Started file here!!!', file=o_stream)

    def factory_method1(self, x):
        """
        A simple factory method for testing.
        """
        self.num_calls += 1
        return x * 3

    def test_paired_cache(self):
        """
        Tests the combination of using try_cache() and store_cache_object().
        """
        # we shouldn't be returning an object when none have been cached
        obj = smart_cache.try_cache(self.cache_file, dependencies=[
            self.dep_file])
        self.assertEqual(obj, None)

        # create an object, and cache it
        obj = self.factory_method1(10)
        smart_cache.store_cache_object(obj, self.cache_file)

        # load from cache; it should be the same as the old object

# Path: cjktools/smart_cache.py
# def disk_proxy_direct(method, cache_file, dependencies=[]):
#     def proxy_method(*args, **params):
# def disk_proxy(cache_file, dependencies):
# def memory_proxy(method):
#     def proxy_method(*args, **params):
# def try_cache(filename, method_args=[], method_params={}, dependencies=[]):
# def store_cache_object(obj, filename, method_args=[], method_params={}):
# def needs_update(target, dependencies):
# def _get_module_dependencies(module):


# Path: cjktools/tests/test_smart_cache.py
import os
import time
import unittest
from cjktools import smart_cache

        self.num_calls = 0

        self.dep_file = 'tmp_dep_file'
        self.cache_file = 'tmp_cache_file'

        # make sure our dep_file exists and is non-empty
        with open(self.dep_file, 'w') as o_stream:
            print('Started file here!!!', file=o_stream)

    def factory_method1(self, x):
        """
        A simple factory method for testing.
        """
        self.num_calls += 1
        return x * 3

    def test_paired_cache(self):
        """
        Tests the combination of using try_cache() and store_cache_object().
        """
        # we shouldn't be returning an object when none have been cached
        obj = smart_cache.try_cache(self.cache_file, dependencies=[
            self.dep_file])
        self.assertEqual(obj, None)

        # create an object, and cache it
        obj = self.factory_method1(10)
        smart_cache.store_cache_object(obj, self.cache_file)

        # load from cache; it should be the same as the old object

        new_obj = smart_cache.try_cache(self.cache_file,