MCPcopy Index your code
hub / github.com/python-visualization/folium / deep_copy

Function deep_copy

folium/utilities.py:386–397  ·  view source on GitHub ↗

Return a recursive deep-copy of item where each copy has a new ID.

(item_original: Element)

Source from the content-addressed store, hash-verified

384
385
386def deep_copy(item_original: Element) -> Element:
387 """Return a recursive deep-copy of item where each copy has a new ID."""
388 item = copy.copy(item_original)
389 item._id = uuid.uuid4().hex
390 if hasattr(item, "_children") and len(item._children) > 0:
391 children_new = collections.OrderedDict()
392 for subitem_original in item._children.values():
393 subitem = deep_copy(subitem_original)
394 subitem._parent = item
395 children_new[subitem.get_name()] = subitem
396 item._children = children_new
397 return item
398
399
400def get_obj_in_upper_tree(element: Element, cls: Type) -> Element:

Callers 2

renderMethod · 0.90
test_deep_copyFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_deep_copyFunction · 0.72