MCPcopy
hub / github.com/pydata/xarray / get

Method get

xarray/core/treenode.py:520–530  ·  view source on GitHub ↗

Return the child node with the specified key. Only looks for the node within the immediate children of this node, not in other nodes of the tree.

(self, key: str, default: Self | None = None)

Source from the content-addressed store, hash-verified

518 pass
519
520 def get(self, key: str, default: Self | None = None) -> Self | None:
521 """
522 Return the child node with the specified key.
523
524 Only looks for the node within the immediate children of this node,
525 not in other nodes of the tree.
526 """
527 if key in self.children:
528 return self.children[key]
529 else:
530 return default
531
532 # TODO `._walk` method to be called by both `_get_item` and `_set_item`
533

Callers 15

create_transform_daFunction · 0.45
is_ignoredFunction · 0.45
_skip_slowFunction · 0.45
time_assignment_basicMethod · 0.45
time_assignment_outerMethod · 0.45
setupMethod · 0.45
linkcode_resolveFunction · 0.45
_item_or_defaultFunction · 0.45
decode_cf_variablesFunction · 0.45

Calls

no outgoing calls

Tested by 15

create_transform_daFunction · 0.36
counting_getMethod · 0.36
series_reduceFunction · 0.36
test_shiftMethod · 0.36
test_padMethod · 0.36
attach_unitsFunction · 0.36
convert_unitsFunction · 0.36
test_squeezeMethod · 0.36
test_squeezeMethod · 0.36
test_squeezeMethod · 0.36
test_empty_str_methodsFunction · 0.36