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

Method _make_id

lib/matplotlib/backends/backend_svg.py:495–502  ·  view source on GitHub ↗
(self, type, content)

Source from the content-addressed store, hash-verified

493 writer.end('defs')
494
495 def _make_id(self, type, content):
496 salt = mpl.rcParams['svg.hashsalt']
497 if salt is None:
498 salt = str(uuid.uuid4())
499 m = hashlib.sha256()
500 m.update(salt.encode('utf8'))
501 m.update(str(content).encode('utf8'))
502 return f'{type}{m.hexdigest()[:10]}'
503
504 def _make_flip_transform(self, transform):
505 return transform + Affine2D().scale(1, -1).translate(0, self.height)

Callers 5

_get_hatchMethod · 0.95
_get_clip_attrsMethod · 0.95
draw_markersMethod · 0.95
draw_path_collectionMethod · 0.95
draw_imageMethod · 0.95

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected