Download lib/python3.12/site-packages/gitdb/utils/encoding.py from parallel-reasoner/env-full: direct link, hf CLI and curl.
- Browser
- Download file 372 Bytes
-
https://huggingface.co/parallel-reasoner/env-full/resolve/2f00a8badb7f953ffc93515c2b0646dc658d8ce8/lib/python3.12/site-packages/gitdb/utils/encoding.py
- Command line
-
hf download hf://parallel-reasoner/env-full@2f00a8badb7f953ffc93515c2b0646dc658d8ce8/lib/python3.12/site-packages/gitdb/utils/encoding.py
-
curl -L -o encoding.py https://huggingface.co/parallel-reasoner/env-full/resolve/2f00a8badb7f953ffc93515c2b0646dc658d8ce8/lib/python3.12/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) | |