def _common_formatStatus(tofd, response, childActorTag, showAddress=str):
    tofd.write('  |%s Actors [%d]:\n'%(childActorTag, len(response.childActors)))
    for A in response.childActors:
        tofd.write('    @ %s\n'%(showAddress(A)))
    if response.governer:
        tofd.write('  |Rate Governer: %s\n'%(str(response.governer)))
    tofd.write('  |Pending Messages [%d]:\n'%len(response.pendingMessages))
    for F,T,M in response.pendingMessages:
        tofd.write('    %s --> %s:  %s\n'%(showAddress(F), showAddress(T), M))
    tofd.write('  |Received Messages [%d]:\n'%len(response.receivedMessages))
    for F,T,M in response.receivedMessages:
        tofd.write('    %s <-- %s:  %s\n'%(showAddress(T), showAddress(F), M))
    tofd.write('  |Pending Wakeups [%d]:\n'%len(response.pendingWakeups))
    import datetime
    for W in response.pendingWakeups:
        tofd.write('    %s%s\n'%(str(W),
                                 (' (in %s)'%(W - datetime.datetime.now()) if isinstance(W, datetime.datetime)
                                  else '')))
    tofd.write('  |Pending Address Resolution [%d]:\n'%(len(response._pendingAddrCnts)))
    for A in response._pendingAddrCnts:
        tofd.write('    %s: %s\n'%(A, response._pendingAddrCnts[A]))
    if response.miscKeyVals:
        miscKeys = list(response.miscKeyVals.keys())
        miscKeys.sort()
        # Adjust all output for the longest value... up to 40 characters max
        maxValLen = min(40, max(map(len, map(str, response.miscKeyVals.values()))))
        for K in miscKeys:
            tofd.write('  |> %%%ds - %%s\n'%maxValLen%(str(response.miscKeyVals[K]), K))
dataset/ETHPy150Open godaddy/Thespian/thespian/system/messages/status.py/_common_formatStatus/original