def singleton(cls):
    """
    Decorator to generate a singleton, prevents
    from creating multiple instances of a class
    """
    instance = None

    def get_instance(*args, **kwargs):
        nonlocal instance
        if instance is None:
            instance = cls(*args, **kwargs)
        return instance

    return get_instance