def _get_cinspect_object(obj):

    if inspect.isbuiltin(obj):
        if obj.__module__ is None:
            # fixme: we could possibly check in `types` to see if it's really a
            # built-in...
            return BuiltinMethod(obj)
        else:
            # Any builtin/compiled functions ...
            return BuiltinFunction(obj)

    elif inspect.ismethoddescriptor(obj):
        return MethodDescriptor(obj)

    elif inspect.ismodule(obj):
        return Module(obj)

    elif inspect.isclass(obj):
        return Type(obj)

    elif inspect.isclass(type(obj)):
        return Type(obj.__class__)

    else:
        raise NotImplementedError
Should have results for every candidate and contest in 2006 primary
dataset/ETHPy150Open punchagan/cinspect/cinspect/_types.py/_get_cinspect_object--crossover with--dataset/ETHPy150Open openelections/openelections-core/openelex/us/md/validate/__init__.py/validate_result_count_2006_primary