shomez commited on
Commit
3a5152a
·
verified ·
1 Parent(s): 9418fc9

Upload compat.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. compat.py +13 -0
compat.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from .core import *
2
+ from .codec import *
3
+ from typing import Any, Union
4
+
5
+ def ToASCII(label: str) -> bytes:
6
+ return encode(label)
7
+
8
+ def ToUnicode(label: Union[bytes, bytearray]) -> str:
9
+ return decode(label)
10
+
11
+ def nameprep(s: Any) -> None:
12
+ raise NotImplementedError('IDNA 2008 does not utilise nameprep protocol')
13
+