MCPcopy Create free account
hub / github.com/numpy/numpy / dictappend

Function dictappend

numpy/f2py/auxfuncs.py:806–832  ·  view source on GitHub ↗
(rd, ar)

Source from the content-addressed store, hash-verified

804
805
806def dictappend(rd, ar):
807 if isinstance(ar, list):
808 for a in ar:
809 rd = dictappend(rd, a)
810 return rd
811 for k in ar.keys():
812 if k[0] == '_':
813 continue
814 if k in rd:
815 if isinstance(rd[k], str):
816 rd[k] = [rd[k]]
817 if isinstance(rd[k], list):
818 if isinstance(ar[k], list):
819 rd[k] = rd[k] + ar[k]
820 else:
821 rd[k].append(ar[k])
822 elif isinstance(rd[k], dict):
823 if isinstance(ar[k], dict):
824 if k == 'separatorsfor':
825 for k1 in ar[k].keys():
826 if k1 not in rd[k]:
827 rd[k][k1] = ar[k][k1]
828 else:
829 rd[k] = dictappend(rd[k], ar[k])
830 else:
831 rd[k] = ar[k]
832 return rd
833
834
835def applyrules(rules, d, var={}):

Callers 10

buildhooksFunction · 0.85
sign2mapFunction · 0.85
cb_sign2mapFunction · 0.85
common_sign2mapFunction · 0.85
buildusevarsFunction · 0.85
buildusevarFunction · 0.85
applyrulesFunction · 0.85
buildcallbackFunction · 0.85
buildmoduleFunction · 0.85
buildapiFunction · 0.85

Calls 1

keysMethod · 0.80

Tested by

no test coverage detected