def singleton(cls):
    """Return wrapped class that has only one instance."""
    inst = []

    def get_instance(*args, **kwargs):
        if not inst:
            inst.append(cls(*args, **kwargs))
        return inst[0]
    return get_instance