def inspect(subject, raiseerr=True):
 type_ = type(subject)
 for cls in type_.__mro__:
  if (cls in _registrars):
   reg = _registrars[cls]
   if (reg is True):
    return subject
   ret = reg(subject)
   if (ret is not None):
    break
 else:
  reg = ret = None
 if (raiseerr and ((reg is None) or (ret is None))):
  raise exc.NoInspectionAvailable(('No inspection system is available for object of type %s' % type_))
 return ret

def inspect ( subject , raiseerr = True ) : type_ = type ( subject ) for cls in type_ . __mro__ : if ( cls in _registrars ) : reg = _registrars [ cls ] if ( reg is True ) : return subject ret = reg ( subject ) if ( ret is not None ) : break else : reg = ret = None if ( raiseerr and ( ( reg is None ) or ( ret is None ) ) ) : raise exc . NoInspectionAvailable ( ( 'No inspection system is available for object of type %s' % type_ ) ) return ret
produce an inspection object for the given target .