Get the `cancellation_state` of an objct

    :param brain_or_object: A single catalog brain or content object
    :type brain_or_object: ATContentType/DexterityContentType/CatalogBrain
    :returns: Value of the review_status variable
    :rtype: String
508071
def get_inactive_status(brain_or_object, default="active"):
    
    if is_brain(brain_or_object):
        return getattr(brain_or_object, "inactive_state", default)
    workflows = get_workflows_for(brain_or_object)
    if 'bika_inactive_workflow' not in workflows:
        return default
    return get_workflow_status_of(brain_or_object, 'inactive_state')
770827
def get_objects_in_sequence(brain_or_object, ctype, cref):
    
    obj = api.get_object(brain_or_object)
    if ctype == "backreference":
        return get_backreferences(obj, cref)
    if ctype == "contained":
        return get_contained_items(obj, cref)
    raise ValueError("Reference value is mandatory for sequence type counter")
695825
def get_portal_type(brain_or_object):
    
    if not is_object(brain_or_object):
        fail("{} is not supported.".format(repr(brain_or_object)))
    return brain_or_object.portal_type
1113395
def get_brain_by_uid(self, uid):
        
        if uid == "0":
            return api.get_portal()

        # ensure we have the primary catalog
        if self._catalog is None:
            uid_catalog = api.get_tool("uid_catalog")
            results = uid_catalog({"UID": uid})
            if len(results) != 1:
                raise ValueError("No object found for UID '{}'".format(uid))
            brain = results[0]
            self._catalog = self.get_catalog_for(brain)

        # Fetch the brain with the primary catalog
        results = self.catalog({"UID": uid})
        if not results:
            raise ValueError("No results found for UID '{}'".format(uid))
        if len(results) != 1:
            raise ValueError("Found more than one object for UID '{}'"
                             .format(uid))
        return results[0]
1167183
def get_review_history_statuses(instance, reverse=False):
    
    review_history = getReviewHistory(instance, reverse=reverse)
    return map(lambda event: event["review_state"], review_history)
395317
def workflow_states_column(self, obj):
        
        workflow_states = models.WorkflowState.objects.filter(
            content_type=self._get_obj_ct(obj),
            object_id=obj.pk,
        )
        return ', '.join([unicode(wfs) for wfs in workflow_states])
243407
def default_marshaller(obj):
    
    if hasattr(obj, '__getstate__'):
        return obj.__getstate__()

    try:
        return obj.__dict__
    except AttributeError:
        raise TypeError('{!r} has no __dict__ attribute and does not implement __getstate__()'
                        .format(obj.__class__.__name__))
86291
def get_url(brain_or_object):
    
    if is_brain(brain_or_object) and base_hasattr(brain_or_object, "getURL"):
        return brain_or_object.getURL()
    return get_object(brain_or_object).absolute_url()
102107
def get_parent(brain_or_object):
    

    if is_root(brain_or_object):
        return get_portal()

    if is_brain(brain_or_object):
        parent_path = get_parent_path(brain_or_object)
        return get_object_by_path(parent_path)

    return brain_or_object.aq_parent
1208674
def get_state(self, caller):
        

        if caller in self.state:
            return self.state[caller]
        else:
            rv = self.state[caller] = DictObject()
            return rv
586487
def get_uid(value):
    
    if not value:
        return ''
    # Is value a brain?
    if ICatalogBrain.providedBy(value):
        value = value.getObject()
    # validate UID
    uid = value.UID()
    uc = get_tool('uid_catalog')
    if uc(UID=uid):
        # The object is valid
        return uid
    # Otherwise the object is an old version
    brains = uc(portal_type=value.portal_type, Title=value.Title())
    if not brains:
        # Cannot find UID
        raise RuntimeError('The UID for %s/%s cannot be found!' %
                           (value.portal_type, value.Title()))
    if len(brains) > 1:
        # Found multiple objects, this is a failure
        raise RuntimeError('Searching for %s/%s returned multiple objects.' %
                           (value.portal_type, value.Title()))
    return brains[0].UID
572869
def as_status(cls, obj):
        """"""
        if obj is None: return None
        return obj if isinstance(obj, cls) else cls.from_string(obj)
575188
def get_field(brain_or_object, name, default=None):
    
    fields = get_fields(brain_or_object)
    return fields.get(name, default)
101666
def object_result(self):
        
        num_obj_results = len(self._object_results)

        if num_obj_results < 1:
            return None
        elif num_obj_results < 2:
            return self._object_results[0]
        else:
            raise ValueError("There is more than one result; use 'object_results'")
1223440
def get_status(self):
        
        entries = self.__query('/samlp:LogoutResponse/samlp:Status/samlp:StatusCode')
        if len(entries) == 0:
            return None
        status = entries[0].attrib['Value']
        return status
1306678
def _status(self):
        """"""
        text = ""
        # Turns out that is related field in null, Django
        # doesn't even make it a property of the object
        # http://code.djangoproject.com/ticket/11920
        if hasattr(self, "reverts"):
            text += '(reverts <a href="%s">%s</a>)<br/>' % (
                self.reverts.get_absolute_url(),
                self.reverts.id
            )
        if self.reverted:
            text += '(reverted in <a href="%s">%s</a>)<br/>' % (
                self.reverted.get_absolute_url(),
                self.reverted.id
            )
        return text
660605
def get_status(api_subject):
  ''' 
  '''
  summary = api_subject.healthSummary
  if summary is None:
    return None
  # status string always starts with "<nagios code>: <summary>"
  status = "%s: %s" % (NAGIOS_CODE_MESSAGES[CM_STATE_CODES[summary]], summary)
  if summary != "GOOD" and summary != "DISABLED":
    # if the summary is CONCERNING or BAD, then append the health checks
    for health_check in api_subject.healthChecks:
      if health_check['summary'] != "GOOD" and health_check['summary'] != "DISABLED":
        status = ("%s, %s=%s" % (status, health_check['name'], health_check['summary']))
  return status