def __new__(cls, *args, **kwargs):
    if (cls is _QueryEntity):
        entity = args[1]
        if ((not isinstance(entity, util.string_types)) and _is_mapped_class(entity)):
            cls = _MapperEntity
        elif isinstance(entity, Bundle):
            cls = _BundleEntity
        else:
            cls = _ColumnEntity
    return object.__new__(cls)
def __new__(cls, *args, **kwargs):
    if (cls is _QueryEntity):
        entity = args[1]
        if ((not isinstance(entity, util.string_types)) and _is_mapped_class(entity)):
            cls = _MapperEntity
        elif isinstance(entity, Bundle):
            cls = _BundleEntity
        else:
            cls = _ColumnEntity
    return object.__new__(cls)