Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/clips/pattern
/ avg
Function
avg
pattern/text/__init__.py:1487–1488 ·
view source on GitHub ↗
(list)
Source
from the content-addressed store, hash-verified
1485
RE_SYNSET = re.compile(r
"^[acdnrv][-_][0-9]+$"
)
1486
1487
def
avg(list):
1488
return
sum(list) / float(len(list) or 1)
1489
1490
class
Score(tuple):
1491
Callers
2
test_sentiment_avg
Method · 0.90
__call__
Method · 0.70
Calls
2
sum
Function · 0.85
len
Function · 0.85
Tested by
1
test_sentiment_avg
Method · 0.72