def formatStatus(response, showAddress=str, tofd=None):
    if tofd is None:
        import sys
        tofd = sys.stdout
    if isinstance(response, Thespian_SystemStatus):
        tofd.write('Status of ActorSystem @ %s:%s\n'%(showAddress(response.adminAddress),
                                                      '  [IN SHUTDOWN]' if response.inShutdown else ''))
        tofd.write('  |Capabilities[%d]:\n'%len(response.capabilities))
        for k in response.capabilities:
            tofd.write('    %29s: %s\n'%(k, response.capabilities[k]))
        if response.conventionLeader:
            tofd.write('  |Convention Leader: %s\n'%(showAddress(response.conventionLeader)))
            if response.conventionRegisterTime:
                tofd.write('  Registration valid %s\n'%(str(response.conventionRegisterTime)))
        elif response.conventionAttendees:
            tofd.write('  Appears to be the Convention Leader\n')
        if response.notifyAddresses:
            tofd.write('  |Convention Notifications [%d]:\n'%len(response.notifyAddresses))
            for each in response.notifyAddresses:
                tofd.write('    ' + showAddress(each) + '\n')
        tofd.write('  |Convention Attendees [%d]:\n'%len(response.conventionAttendees))
        for addr,validtime in response.conventionAttendees:
            tofd.write('    @ %s: %s\n'%(showAddress(addr), str(validtime)))
        _common_formatStatus(tofd, response, 'Primary', showAddress)
        if response.deadLetterHandler:
            tofd.write(showAddress(response.deadLetterHandler)%'  |DeadLetter Handler: %s\n')
        tofd.write('  |DeadLetter Addresses [%d]:\n'%len(response.deadLetterAddresses))
        for A in response.deadLetterAddresses:
            tofd.write('    %s\n'%(showAddress(A)))
        tofd.write('  |Source Authority: %s\n'%(showAddress(response.sourceAuthority)))
        tofd.write('  |Loaded Sources [%d]:\n'%len(response.loadedSources))
        for S in response.loadedSources:
            tofd.write('    %s\n'%(str(S)))
        tofd.write('  |Global Actors [%d]:\n'%len(response.globalActors))
        for N in response.globalActors:
            tofd.write('    %s: %s\n'%(N, showAddress(response.globalActors[N])))
    elif isinstance(response, Thespian_ActorStatus):
        tofd.write('Status of %s Actor @ %s:\n'%(response.actorClass,
                                                 showAddress(response.actorAddress)))
        if response.sourceHash:
            tofd.write('  |Source Hash: %s\n'%(response.sourceHash))
        tofd.write('  |Administrator: %s\n'%(showAddress(response.adminAddress)))
        tofd.write('  |Parent  Actor: %s\n'%(showAddress(response.parentAddress)))
        _common_formatStatus(tofd, response, 'Child', showAddress)
    else:
        tofd.write('Status Query Response: %s\n'%(str(response)))
dataset/ETHPy150Open godaddy/Thespian/thespian/system/messages/status.py/formatStatus/swapped operands of `%`