def patchMath() :
    mathfn = inspect.getmembers(math, inspect.isbuiltin)
    for mfn in mathfn :
        fname = mfn[0]
        basefn = mfn[1]
        newfn = _patchfn(basefn)
        _thisModule.__setattr__(fname, newfn)

    mathutilsfn = inspect.getmembers(mathutils, inspect.isfunction)
    for mfn in mathutilsfn :
        fname = mfn[0]
        basefn = mfn[1]
        newfn = _patchfn(basefn)
        _thisModule.__setattr__(fname, newfn)

    # builtins that do not need to be manually redefined, curently only abs
    _thisModule.__setattr__('abs', _patchfn(_abs))
Overload various math functions to work element-wise on iterables
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.3/pymel/util/arrays.py/patchMath