MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / remove_key

Method remove_key

deeplabcut/gui/widgets.py:397–407  ·  view source on GitHub ↗
(self, cfg, keys, ind=None)

Source from the content-addressed store, hash-verified

395 temp.insert(ind, value)
396
397 def remove_key(self, cfg, keys, ind=None):
398 if not len(keys): # Avoid deleting a parent list or dict
399 return
400 temp = self.get_nested_key(cfg, keys)
401 try:
402 temp.pop(keys[-1])
403 except TypeError:
404 if ind is None:
405 ind = self.tree.currentIndex().row()
406 temp.pop(ind)
407 return True
408
409 def populate_tree(self, data, tree_widget):
410 if isinstance(data, dict):

Callers 1

removeMethod · 0.95

Calls 1

get_nested_keyMethod · 0.95

Tested by

no test coverage detected