summaryrefslogtreecommitdiffstats
path: root/examples/include_no_requirements.py
blob: c51a85cb94ef41ec05e3138606e5a1d3cbb99525 (plain)
1
2
3
4
5
6
7
8
9
10
11
# How to import tqdm in any frontend without enforcing it as a dependency
try:
    from tqdm.auto import tqdm
except ImportError:

    def tqdm(*args, **kwargs):
        if args:
            return args[0]
        return kwargs.get('iterable', None)

__all__ = ['tqdm']