Spaces:
Paused
Paused
Download venv/lib/python3.11/site-packages/gitdb/utils/encoding.py from Tejasw1/Statute_Prediction: direct link, hf CLI and curl.
- Browser
- Download file 372 Bytes
-
https://huggingface.co/spaces/Tejasw1/Statute_Prediction/resolve/main/venv/lib/python3.11/site-packages/gitdb/utils/encoding.py
- Command line
-
hf download hf://spaces/Tejasw1/Statute_Prediction/venv/lib/python3.11/site-packages/gitdb/utils/encoding.py
-
curl -L -o encoding.py https://huggingface.co/spaces/Tejasw1/Statute_Prediction/resolve/main/venv/lib/python3.11/site-packages/gitdb/utils/encoding.py
372 Bytes
| def force_bytes(data, encoding="utf-8"): | |
| if isinstance(data, bytes): | |
| return data | |
| if isinstance(data, str): | |
| return data.encode(encoding) | |
| return data | |
| def force_text(data, encoding="utf-8"): | |
| if isinstance(data, str): | |
| return data | |
| if isinstance(data, bytes): | |
| return data.decode(encoding) | |
| return str(data, encoding) | |