MCPcopy Index your code
hub / github.com/python/cpython / _as_int2

Function _as_int2

Lib/gettext.py:177–193  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

175 return _as_int2(n)
176
177def _as_int2(n):
178 try:
179 return operator.index(n)
180 except TypeError:
181 pass
182
183 import warnings
184 frame = sys._getframe(1)
185 stacklevel = 2
186 while frame.f_back is not None and frame.f_globals.get('__name__') == __name__:
187 stacklevel += 1
188 frame = frame.f_back
189 warnings.warn('Plural value must be an integer, got %s' %
190 (n.__class__.__name__,),
191 DeprecationWarning,
192 stacklevel)
193 return n
194
195
196def c2py(plural):

Callers 5

_as_intFunction · 0.85
ngettextMethod · 0.85
npgettextMethod · 0.85
dngettextFunction · 0.85
dnpgettextFunction · 0.85

Calls 3

indexMethod · 0.45
getMethod · 0.45
warnMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…