MCPcopy Index your code
hub / github.com/numpy/numpy / as_terms

Function as_terms

numpy/f2py/symbolic.py:1058–1070  ·  view source on GitHub ↗

Return expression as TERMS expression.

(obj)

Source from the content-addressed store, hash-verified

1056
1057
1058def as_terms(obj):
1059 """Return expression as TERMS expression.
1060 """
1061 if isinstance(obj, Expr):
1062 obj = normalize(obj)
1063 if obj.op is Op.TERMS:
1064 return obj
1065 if obj.op is Op.INTEGER:
1066 return Expr(Op.TERMS, {as_integer(1, obj.data[1]): obj.data[0]})
1067 if obj.op is Op.REAL:
1068 return Expr(Op.TERMS, {as_real(1, obj.data[1]): obj.data[0]})
1069 return Expr(Op.TERMS, {obj: 1})
1070 raise OpError(f'cannot convert {type(obj)} to terms Expr')
1071
1072
1073def as_factors(obj):

Callers 3

test_sanityMethod · 0.90
__add__Method · 0.85
__mul__Method · 0.85

Calls 5

normalizeFunction · 0.85
ExprClass · 0.85
as_integerFunction · 0.85
as_realFunction · 0.85
OpErrorClass · 0.85

Tested by 1

test_sanityMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…