(name, pretty_print=True, module=None)
| 7 | import re |
| 8 | |
| 9 | def find_function(name, pretty_print=True, module=None): |
| 10 | # if the module is None, initialize it to to the root `cv2` |
| 11 | # library |
| 12 | if module is None: |
| 13 | module = cv2 |
| 14 | |
| 15 | # grab all function names that contain `name` from the module |
| 16 | p = ".*{}.*".format(name) |
| 17 | filtered = filter(lambda x: re.search(p, x, re.IGNORECASE), dir(module)) |
| 18 | |
| 19 | # check to see if the filtered names should be returned to the |
| 20 | # calling function |
| 21 | if not pretty_print: |
| 22 | return filtered |
| 23 | |
| 24 | # otherwise, loop over the function names and print them |
| 25 | for (i, funcName) in enumerate(filtered): |
| 26 | print("{}. {}".format(i + 1, funcName)) |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…