MCPcopy Create free account
hub / github.com/PyImageSearch/imutils / find_function

Function find_function

imutils/meta.py:9–26  ·  view source on GitHub ↗
(name, pretty_print=True, module=None)

Source from the content-addressed store, hash-verified

7import re
8
9def 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))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…