Download venv/Lib/site-packages/setuptools/_distutils/_functools.py from parthraninga/contextClassifier: direct link, hf CLI and curl.
- Browser
- Download file 411 Bytes
-
https://huggingface.co/parthraninga/contextClassifier/resolve/main/venv/Lib/site-packages/setuptools/_distutils/_functools.py
- Command line
-
hf download hf://parthraninga/contextClassifier/venv/Lib/site-packages/setuptools/_distutils/_functools.py
-
curl -L -o _functools.py https://huggingface.co/parthraninga/contextClassifier/resolve/main/venv/Lib/site-packages/setuptools/_distutils/_functools.py
411 Bytes
| import functools | |
| # from jaraco.functools 3.5 | |
| def pass_none(func): | |
| """ | |
| Wrap func so it's not called if its first param is None | |
| >>> print_text = pass_none(print) | |
| >>> print_text('text') | |
| text | |
| >>> print_text(None) | |
| """ | |
| def wrapper(param, *args, **kwargs): | |
| if param is not None: | |
| return func(param, *args, **kwargs) | |
| return wrapper | |