def show_instances(server, cim_class):
    """
    Display the instances of the CIM_Class defined by cim_class. If the
    namespace is None, use the interop namespace. Search all namespaces for
    instances except for CIM_RegisteredProfile
    """
    if cim_class == 'CIM_RegisteredProfile':
        for inst in server.profiles:
            print(inst.tomof())
        return

    for ns in server.namespaces:
        try:
            insts = server.conn.EnumerateInstances(cim_class, namespace=ns)
            if len(insts):
                print('INSTANCES OF %s ns=%s' % (cim_class, ns))
                for inst in insts:
                    print(inst.tomof())
        except pywbem.Error as er:
            if er.status_code != pywbem.CIM_ERR_INVALID_CLASS:
                print('%s namespace %s Enumerate failed for conn=%s\n'
                      'exception=%s'
                      % (cim_class, ns, server, er))
Display the instances of the CIM_Class defined by cim_class. If the
    namespace is None, use the interop namespace. Search all namespaces for
    instances except for CIM_RegisteredProfile