MCPcopy Index your code
hub / github.com/pydata/xarray / _get_boolean_with_default

Function _get_boolean_with_default

xarray/core/options.py:183–193  ·  view source on GitHub ↗
(option: Options, default: bool)

Source from the content-addressed store, hash-verified

181
182
183def _get_boolean_with_default(option: Options, default: bool) -> bool:
184 global_choice = OPTIONS[option]
185
186 if global_choice == "default":
187 return default
188 elif isinstance(global_choice, bool):
189 return global_choice
190 else:
191 raise ValueError(
192 f"The global option {option} must be one of True, False or 'default'."
193 )
194
195
196def _get_keep_attrs(default: bool) -> bool:

Callers 10

_mapping_sectionFunction · 0.90
array_sectionFunction · 0.90
array_reprFunction · 0.90
dataset_reprFunction · 0.90
_datatree_node_sectionsFunction · 0.90
_mapping_reprFunction · 0.90
array_reprFunction · 0.90
dataset_reprFunction · 0.90
_datatree_node_reprFunction · 0.90
_get_keep_attrsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…