Edit Mode Transform Median X, Y, Z location. How to read the N-Panel Rather than recalculate it - How can I read the Transform Median X,Y,Z that is displayed in the Transform Median Dialog..

The code to calculate it is straight forward but I'm just curious as to "where this data is coming from"?.    It's right there and I can't get my pythonic hands on it.

The tool help for it is bpy.ops.ui.editsource but the documentation doesn't reveal anything.   

Should I be looking in the BMesh class?   

Similarly:   In object mode - the Transform Location is that of the last selected object.
But the "pop up tool tip" at least gives me the "Slot Info"
I didn't see a response but this is the code that I used:
I think the original author was CodeManX

    def calcpivotpoint(theobject):
        ob = theobject
        me = ob.data    

        bm = bmesh.from_edit_mesh(me)
        verts_sel = [v.co for v in bm.verts if v.select]

        pivot = sum(verts_sel, Vector()) / len(verts_sel)

        return ob.matrix_world @ pivot