:type: bool

        True when the current object has the expected content models
        for whatever subclass of :class:`DigitalObject` it was
        initialized as.
187860
def has_requisite_content_models(self):
        ''''''
        for cmodel in getattr(self, 'CONTENT_MODELS', ()):
            if not self.has_model(cmodel):
                return False
        return True
416232
def _type_bool(label,default=False):
    """"""
    return label, abstractSearch.nothing, abstractRender.boolen, default
160802
def binary(self):
        

        return self._project.loader.find_object_containing(self.addr, membership_check=False)
804050
public static boolean isBoolean( Object obj ) {
      if( (obj instanceof Boolean) || (obj != null && obj.getClass() == Boolean.TYPE) ){
         return true;
      }
      return false;
   }
875960
def _bool_method_SERIES(cls, op, special):
    
    op_name = _get_op_name(op, special)

    def na_op(x, y):
        try:
            result = op(x, y)
        except TypeError:
            assert not isinstance(y, (list, ABCSeries, ABCIndexClass))
            if isinstance(y, np.ndarray):
                # bool-bool dtype operations should be OK, should not get here
                assert not (is_bool_dtype(x) and is_bool_dtype(y))
                x = ensure_object(x)
                y = ensure_object(y)
                result = libops.vec_binop(x, y, op)
            else:
                # let null fall thru
                assert lib.is_scalar(y)
                if not isna(y):
                    y = bool(y)
                try:
                    result = libops.scalar_binop(x, y, op)
                except (TypeError, ValueError, AttributeError,
                        OverflowError, NotImplementedError):
                    raise TypeError("cannot compare a dtyped [{dtype}] array "
                                    "with a scalar of type [{typ}]"
                                    .format(dtype=x.dtype,
                                            typ=type(y).__name__))

        return result

    fill_int = lambda x: x.fillna(0)
    fill_bool = lambda x: x.fillna(False).astype(bool)

    def wrapper(self, other):
        is_self_int_dtype = is_integer_dtype(self.dtype)

        self, other = _align_method_SERIES(self, other, align_asobject=True)
        res_name = get_op_result_name(self, other)

        if isinstance(other, ABCDataFrame):
            # Defer to DataFrame implementation; fail early
            return NotImplemented

        elif isinstance(other, (ABCSeries, ABCIndexClass)):
            is_other_int_dtype = is_integer_dtype(other.dtype)
            other = fill_int(other) if is_other_int_dtype else fill_bool(other)

            ovalues = other.values
            finalizer = lambda x: x

        else:
            # scalars, list, tuple, np.array
            is_other_int_dtype = is_integer_dtype(np.asarray(other))
            if is_list_like(other) and not isinstance(other, np.ndarray):
                # TODO: Can we do this before the is_integer_dtype check?
                # could the is_integer_dtype check be checking the wrong
                # thing?  e.g. other = [[0, 1], [2, 3], [4, 5]]?
                other = construct_1d_object_array_from_listlike(other)

            ovalues = other
            finalizer = lambda x: x.__finalize__(self)

        # For int vs int `^`, `|`, `&` are bitwise operators and return
        #   integer dtypes.  Otherwise these are boolean ops
        filler = (fill_int if is_self_int_dtype and is_other_int_dtype
                  else fill_bool)
        res_values = na_op(self.values, ovalues)
        unfilled = self._constructor(res_values,
                                     index=self.index, name=res_name)
        filled = filler(unfilled)
        return finalizer(filled)

    wrapper.__name__ = op_name
    return wrapper
1337816
def set_content_type(self):
        
        if self.object_name and not self.content_type:
            # XXX nothing is currently done with the encoding... we may
            # need to in the future
            self.content_type, encoding = mimetypes.guess_type(
                self.object_name, strict=False)
494441
def is_module(obj):
    
    return True if obj and isinstance(obj, ModuleType) or inspect.isclass(obj) else False
686483
def for_class(digobj, repo):
        ''''''
        full_name = '%s.%s' % (digobj.__module__, digobj.__name__)
        cmodels = getattr(digobj, 'CONTENT_MODELS', None)
        if not cmodels:
            logger.debug('%s has no content models', full_name)
            return None
        if len(cmodels) > 1:
            logger.debug('%s has %d content models', full_name, len(cmodels))
            raise ValueError(('Cannot construct ContentModel object for ' +
                              '%s, which has %d CONTENT_MODELS (only 1 is ' +
                              'supported)') %
                             (full_name, len(cmodels)))

        cmodel_uri = cmodels[0]
        logger.debug('cmodel for %s is %s', full_name, cmodel_uri)
        cmodel_obj = repo.get_object(cmodel_uri, type=ContentModel,
                                     create=False)
        if cmodel_obj.exists:
            logger.debug('%s already exists', cmodel_uri)
            return cmodel_obj

        # otherwise the cmodel doesn't exist. let's create it.
        logger.debug('creating %s from %s', cmodel_uri, full_name)
        cmodel_obj = repo.get_object(cmodel_uri, type=ContentModel,
                                     create=True)
        # XXX: should this use _defined_datastreams instead?
        for ds in digobj._local_datastreams.values():
            ds_composite_model = cmodel_obj.ds_composite_model.content
            type_model = ds_composite_model.get_type_model(ds.id, create=True)
            type_model.mimetype = ds.default_mimetype
            if ds.default_format_uri:
                type_model.format_uri = ds.default_format_uri
        cmodel_obj.save()
        return cmodel_obj
1075043
def certify_bool(value, required=True):
    
    if certify_required(
        value=value,
        required=required,
    ):
        return

    if not isinstance(value, bool):
        raise CertifierTypeError(
            message="expected bool, but value is of type {cls!r}".format(
                cls=value.__class__.__name__),
            value=value,
            required=required,
        )
1139089
def BinaryBool(pred):
    
    class Predicate(Bool):
        def __init__(self, value, ignore_case=False):
            self.value = caseless(value) if ignore_case else value
            self.ignore_case = ignore_case

        def __call__(self, data):
            if not isinstance(data, list):
                data = [data]
            for d in data:
                try:
                    if pred(caseless(d) if self.ignore_case else d, self.value):
                        return True
                except:
                    pass
            return False
    return Predicate
1268684
def has(prop, object_or_dct):
    
    return prop in object_or_dct if isinstance(dict, object_or_dct) else hasattr(object_or_dct, prop)
770046
def check_expected_type(model, expected_type):
    
    if (model.__class__.__name__ != expected_type.__name__):
        raise TypeError("Expected model of type '%s' (got %s)" % \
                (expected_type.__name__, model.__class__.__name__))
396650
def is_class(data):
    

    try:
        with unpack(data) as up:
            magic = up.unpack_struct(_BBBB)

        return magic == JAVA_CLASS_MAGIC

    except UnpackException:
        return False
949225
def is_all_initialized(self):
        '''
        '''
        return frozenset(self._class_map.keys()) == \
            frozenset(self._instance_map.keys())
560518
public boolean inObject() {
      return writeStack.peek() == JsonTokenType.BEGIN_OBJECT || (writeStack.peek() == JsonTokenType.BEGIN_DOCUMENT && !isArray);
   }
997192
def is_sequence(obj):
    """"""
    return isinstance(obj, Sequence) and not (
        isinstance(obj, str) or BinaryClass.is_valid_type(obj))
631710
def boolean(self):
        
        try:
            return self._boolean
        except AttributeError:
            nbits = len(self.bits)
            boolean = numpy.zeros((self.size, nbits), dtype=bool)
            for i, sample in enumerate(self.value):
                boolean[i, :] = [int(sample) >> j & 1 for j in range(nbits)]
            self._boolean = Array2D(boolean, name=self.name,
                                    x0=self.x0, dx=self.dx, y0=0, dy=1)
            return self.boolean