MCPcopy Create free account
hub / github.com/NCAR/wrf-python / viewitems

Function viewitems

src/wrf/py3compat.py:8–23  ·  view source on GitHub ↗

Return either the items or viewitems method for a dictionary. Args: d (:obj:`dict`): A dictionary. Returns: view method: Either the items or viewitems method.

(d)

Source from the content-addressed store, hash-verified

6
7# Dictionary python 2-3 compatibility stuff
8def viewitems(d):
9 """Return either the items or viewitems method for a dictionary.
10
11 Args:
12
13 d (:obj:`dict`): A dictionary.
14
15 Returns:
16
17 view method: Either the items or viewitems method.
18
19 """
20 func = getattr(d, "viewitems", None)
21 if func is None:
22 func = d.items
23 return func()
24
25
26def viewkeys(d):

Callers 15

extract_proj_paramsFunction · 0.90
dict_keys_to_upperFunction · 0.85
constants.pyFile · 0.85
_kwarg_proj_paramsFunction · 0.85
func_wrapperFunction · 0.85
func_wrapperFunction · 0.85
_set_2dxy_metaFunction · 0.85
_build_data_arrayFunction · 0.85
_extract_time_mapFunction · 0.85
_args_to_list2Function · 0.85
get_idFunction · 0.85
_pynglMethod · 0.85

Calls 1

funcFunction · 0.70

Tested by 1

extract_proj_paramsFunction · 0.72