def singleton(cls, *args, **kw):
    """
    Create a single instance of an object, in this case a single object of RedisDB
    Taken from: https://stackoverflow.com/questions/42237752/single-instance-of-class-in-python
    :param cls: class to create only once
    :param args: arguments passed to class constructor
    :param kw: keyword passed to class constructor
    :return: A single instance of the cls
    """
    instances = {}

    def _singleton():
        if cls not in instances:
            instances[cls] = cls(*args, **kw)
        return instances[cls]

    return _singleton