'Singleton to avoid duplicated initialization.'

def __new__(cls, *args, **kwargs):

    if cls._instance:
        return cls._instance
    with cls._instance_lock:
        if (not cls._instance):
            cls._instance = super(NodeManager, cls).__new__(cls, *args, **kwargs)
    return cls._instance
