MCPcopy Index your code
hub / github.com/RustPython/RustPython / _as_int2

Function _as_int2

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

Source from the content-addressed store, hash-verified

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