Lines Matching full:structure

729 def nested_get(key_name, structure):  argument
731 Return a list of all values from the nested structure that have the given key name.
735 Given a dictionary structure named "personnel" with the following contents:
758structure Any nested combination of lists or dictionaries (e.g. a dictionary…
760 … will locate the given key at any level within the structure and include
765 if type(structure) is list:
766 for entry in structure:
769 elif gp.is_dict(structure):
770 for key, value in structure.items():
778 def match_struct(structure, match_dict, regex=False): argument
780 Return True or False to indicate whether the structure matches the match dictionary.
784 Given a dictionary structure named "personnel" with the following contents:
803structure Any nested combination of lists or dictionaries. See the prolog of
805 …h_dict Each key/value pair in match_dict must exist somewhere in the structure
806 … for the structure to be considered a match. A match value of None is
807 … considered a special case where the structure would be considered a match
808 only if the key in question is found nowhere in the structure.
813 …# The structure must match for each match_dict entry to be considered a match. Therefore, any fai…
816 struct_key_values = nested_get(match_key, structure)
838 def filter_struct(structure, filter_dict, regex=False, invert=False): argument
840 …Filter the structure by removing any entries that do NOT contain the keys/values specified in filt…
843 The selection process is directed only at the first-level entries of the structure.
847 Given a dictionary named "properties" that has the following structure:
877 …that the first item in the original properties directory had no key anywhere in the structure named
879 …whose value was "OK" so it was included in the new structure. The third item had a key named "Hea…
883structure Any nested combination of lists or dictionaries. See the prolog of
885 …filter_dict For each key/value pair in filter_dict, each entry in structure mu…
900 …# Determine whether structure is a list or a dictionary and process accordingly. The result retur…
901 # will be of the same type as the structure.
902 if type(structure) is list:
904 for element in structure:
912 for struct_key, struct_value in structure.items():