Spaces:
Running on Zero
Running on Zero
File size: 675 Bytes
8448f43 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | """Compatibility shims required before importing chumpy/FLAME."""
import inspect
from collections import namedtuple
import numpy as np
for _name, _value in {
"bool": bool,
"int": int,
"float": float,
"complex": complex,
"object": object,
"unicode": str,
"str": str,
}.items():
if _name not in np.__dict__:
setattr(np, _name, _value)
if not hasattr(inspect, "getargspec"):
_ArgSpec = namedtuple("ArgSpec", "args varargs keywords defaults")
def _getargspec(func):
spec = inspect.getfullargspec(func)
return _ArgSpec(spec.args, spec.varargs, spec.varkw, spec.defaults)
inspect.getargspec = _getargspec
|