Applies function recursively through list-like structures >>> applyFunctionRecursively([1, 2, [3, 4, [19]], -9], lambda _: _ > 0) [True, True, [True, True, [True]], False]
(value, function)
| 4935 | return kb.counters.get(technique, 0) |
| 4936 | |
| 4937 | def applyFunctionRecursively(value, function): |
| 4938 | """ |
| 4939 | Applies function recursively through list-like structures |
| 4940 | |
| 4941 | >>> applyFunctionRecursively([1, 2, [3, 4, [19]], -9], lambda _: _ > 0) |
| 4942 | [True, True, [True, True, [True]], False] |
| 4943 | """ |
| 4944 | |
| 4945 | if isListLike(value): |
| 4946 | retVal = [applyFunctionRecursively(_, function) for _ in value] |
| 4947 | else: |
| 4948 | retVal = function(value) |
| 4949 | |
| 4950 | return retVal |
| 4951 | |
| 4952 | def decodeDbmsHexValue(value, raw=False): |
| 4953 | """ |
no test coverage detected
searching dependent graphs…