This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from types import MappingProxyType | |
__all__ = ['str2num'] | |
NUMBase = MappingProxyType({ | |
'one': 1, | |
'two': 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
This module implements UFCS for Python. | |
[Uniform Function Call Syntax (UFCS)](https://tour.dlang.org/tour/en/gems/uniform-function-call-syntax-ufcs) | |
UFCS is a key feature of D and enables code reusability and scalability through well-defined encapsulation. | |
UFCS allows any call to a free function fun(a) to be written as a member function call a.fun(). | |
If a.fun() is seen by the compiler and the type doesn't have a member function called fun(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# coding: utf-8 | |
''' | |
4 decorators (as below) are provided to implement `currying` for Python functions: | |
- currying 👍 | |
- partial_currying | |
- fast_currying | |
- Currying 👍 | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# coding: utf-8 | |
__author__ = 'ChenyangGao <https://chenyanggao.github.io/>' | |
__version__ = (0, 0, 4) | |
__all__ = [ | |
'BRACKET_PATTERN', 'bracket_pattern', 'translate', 'compile', | |
'replace', 'get_dict_of_match', 'template_replace', | |
] | |
__doc__ = ''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# coding: utf-8 | |
__author__ = "ChenyangGao <https://chenyanggao.github.io/>" | |
__version__ = (0, 1) | |
__all__ = ["process"] | |
if __name__ == "__main__": | |
from argparse import ArgumentParser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#? 设置代理 ip,请运行 proxy# 获取帮助信息 | |
# AUTHOR='ChenyangGao <https://chenyanggao.github.io/>'' | |
# VERSION=0.2 | |
if [ -n "${MOD_PROXY_sourced+x}" ]; then | |
return 0 | |
fi | |
# inetutils (apt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# coding: utf-8 | |
assert __name__ == "__main__", "不能被引入模块" | |
__author__ = "ChenyangGao <https://chenyanggao.github.io/>" | |
__version__ = (0, 1, 1) | |
from argparse import ArgumentParser, RawTextHelpFormatter | |
from sys import argv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# coding: utf-8 | |
__author__ = "ChenyangGao <https://chenyanggao.github.io/>" | |
__version__ = (0, 1, 1) | |
__all__ = ["func_cmdline"] | |
# Inspired by: | |
# - https://pypi.org/project/typer/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# coding: utf-8 | |
__author__ = "ChenyangGao <https://chenyanggao.github.io/>" | |
__version__ = (0, 1, 1) | |
__all__ = ["AttrDict", "DictAttr", "Properties"] | |
import builtins | |
from pathlib import Path |
OlderNewer