"""
Wood author: thislight

Copyright 2016 thislight

   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.

Under License Apache v2, more information, see file 'LICENSE' in project root directory.
"""


class functools(object):
    @staticmethod
    def pass_func(func):
        def hook(self, *args, **kargs):
            print('Wraning: a passed function was called,name {}'.format(func.__name__))
            return

        return hook

    @staticmethod
    def call_or_not(f, *args, **kargs):
        if f:
            return f(*args, **kargs)
        else:
            return None


class LazyProxy(object):
    def __init__(self, cls):
        self._cls = cls
        self._mocks = {}

    def __call__(self, *args, **kargs):
        self._obj = self._cls(*args, **kargs)

    def mock(self, name, value):
        self._mocks[name] = value

    def __getattr__(self, item):
        if item in self._mocks:
            return self._mocks[item]
        elif self._obj and hasattr(self._obj, item):
            return getattr(self._obj, item)
        else:
            return getattr(self._cls, item)

    def __setattr__(self, name, value):
        if name in self._mocks:
            self._mocks[name] = value
        elif not self._obj:
            setattr(self._cls, name, value)
        else:
            setattr(self._obj, name, value)

@@ -698,1148 +698,5 @@
 %22%0A%0A%0A
-class functools(object):%0A    @staticmethod%0A    def pass_func(func):%0A        def hook(self, *args, **kargs):%0A            print('Wraning: a passed function was called,name %7B%7D'.format(func.__name__))%0A            return%0A%0A        return hook%0A%0A    @staticmethod%0A    def call_or_not(f, *args, **kargs):%0A        if f:%0A            return f(*args, **kargs)%0A        else:%0A            return None%0A%0A%0Aclass LazyProxy(object):%0A    def __init__(self, cls):%0A        self._cls = cls%0A        self._mocks = %7B%7D%0A%0A    def __call__(self, *args, **kargs):%0A        self._obj = self._cls(*args, **kargs)%0A%0A    def mock(self, name, value):%0A        self._mocks%5Bname%5D = value%0A%0A    def __getattr__(self, item):%0A        if item in self._mocks:%0A            return self._mocks%5Bitem%5D%0A        elif self._obj and hasattr(self._obj, item):%0A            return getattr(self._obj, item)%0A        else:%0A            return getattr(self._cls, item)%0A%0A    def __setattr__(self, name, value):%0A        if name in self._mocks:%0A            self._mocks%5Bname%5D = value%0A        elif not self._obj:%0A            setattr(self._cls, name, value)%0A        else:%0A            setattr(self._obj, name, value)
 %0A

Remove useless utils.