Download ScaleDF_rebuttal/python_dedup_pkgs/sympy/utilities/pkgdata.py from VideoUFO/ResearchData_P1: direct link, hf CLI and curl.
- Browser
- Download file 935 Bytes
-
https://huggingface.co/datasets/VideoUFO/ResearchData_P1/resolve/main/ScaleDF_rebuttal/python_dedup_pkgs/sympy/utilities/pkgdata.py
- Command line
-
hf download hf://datasets/VideoUFO/ResearchData_P1/ScaleDF_rebuttal/python_dedup_pkgs/sympy/utilities/pkgdata.py
-
curl -L -o pkgdata.py https://huggingface.co/datasets/VideoUFO/ResearchData_P1/resolve/main/ScaleDF_rebuttal/python_dedup_pkgs/sympy/utilities/pkgdata.py
935 Bytes
| # This module is deprecated and will be removed. | |
| import sys | |
| import os | |
| from io import StringIO | |
| from sympy.utilities.decorator import deprecated | |
| def get_resource(identifier, pkgname=__name__): | |
| mod = sys.modules[pkgname] | |
| fn = getattr(mod, '__file__', None) | |
| if fn is None: | |
| raise OSError("%r has no __file__!") | |
| path = os.path.join(os.path.dirname(fn), identifier) | |
| loader = getattr(mod, '__loader__', None) | |
| if loader is not None: | |
| try: | |
| data = loader.get_data(path) | |
| except (OSError, AttributeError): | |
| pass | |
| else: | |
| return StringIO(data.decode('utf-8')) | |
| return open(os.path.normpath(path), 'rb') | |