MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _to_int

Function _to_int

lib/matplotlib/_afm.py:42–48  ·  view source on GitHub ↗
(x: bytes | str)

Source from the content-addressed store, hash-verified

40
41
42def _to_int(x: bytes | str) -> int:
43 # Some AFM files have floats where we are expecting ints -- there is
44 # probably a better way to handle this (support floats, round rather than
45 # truncate). But I don't know what the best approach is now and this
46 # change to _to_int should at least prevent Matplotlib from crashing on
47 # these. JDH (2009-11-06)
48 return int(float(x))
49
50
51def _to_float(x: bytes | str) -> float:

Callers 10

_to_list_of_intsFunction · 0.85
_parse_char_metricsFunction · 0.85
_parse_compositesFunction · 0.85
backend_qt.pyFile · 0.85
_mpl_buttonsMethod · 0.85
_mpl_modifiersMethod · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
keyMethod · 0.85

Calls

no outgoing calls

Tested by 1

keyMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…