Spaces:
Build error
Build error
Download src/utils.py from e1250/badge-generator: direct link, hf CLI and curl.
- Browser
- Download file 664 Bytes
-
https://huggingface.co/spaces/e1250/badge-generator/resolve/main/src/utils.py
- Command line
-
hf download hf://spaces/e1250/badge-generator/src/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/e1250/badge-generator/resolve/main/src/utils.py
664 Bytes
| from base import types | |
| def link_prepare(url:str , type:types) ->str : | |
| """Preparing links for badges | |
| Args: | |
| url (str): Link of the notebook in github or kaggle | |
| type (str): Type of the badge (Colab - Codespace - Livebook - Binder - Kaggle) | |
| Return: | |
| str: Link of badge type | |
| """ | |
| match(type): | |
| case types.kaggle: | |
| return url | |
| case types.binder: | |
| pass | |
| case types.colab: | |
| pass | |
| case types.codespace: | |
| pass | |
| case types.livebook: | |
| return url | |
| case types.githubdev: | |
| pass | |
| case _: | |
| raise("Invalid Input") |