The assertion can contain zero or more attributeStatements
972800
def get_identity(self):
        
        ava = {}
        for _assertion in self.assertions:
            if _assertion.advice:
                if _assertion.advice.assertion:
                    for tmp_assertion in _assertion.advice.assertion:
                        if tmp_assertion.attribute_statement:
                            assert len(tmp_assertion.attribute_statement) == 1
                            ava.update(self.read_attribute_statement(
                                tmp_assertion.attribute_statement[0]))
            if _assertion.attribute_statement:
                logger.debug("Assertion contains %s attribute statement(s)",
                             (len(self.assertion.attribute_statement)))
                for _attr_statem in _assertion.attribute_statement:
                    logger.debug("Attribute Statement: %s" % (_attr_statem,))
                    ava.update(self.read_attribute_statement(_attr_statem))
            if not ava:
                logger.debug("Assertion contains no attribute statements")
        return ava
947060
def _assertsanity(self):
        """"""
        assert self.len >= 0
        assert 0 <= self._offset, "offset={0}".format(self._offset)
        assert (self.len + self._offset + 7) // 8 == self._datastore.bytelength + self._datastore.byteoffset
        return True
1186570
def assert(assertion, desc = nil)
      if assertion
        pass
      else
        what = if block_given?
          yield
        else
          "Failed assert: assertion was "\
          "`#{Assert::U.show(assertion, __assert_config__)}`."
        end
        fail(fail_message(desc, what))
      end
    end
648356
def __assert_empty(returned):
        '''
        
        '''
        result = "Pass"
        try:
            assert (not returned), "{0} is not empty".format(returned)
        except AssertionError as err:
            result = "Fail: " + six.text_type(err)
        return result
384917
function internalAssert(condition, message) {
  if (!condition) {
    throw new AssertionError({
      message,
      actual: false,
      expected: true,
      operator: '=='
    });
  }
}
1354503
function assertEquals(assert, actual, expected, message) {
  const assertionType = Symbol.for('@@meta:magical:assertion-type');
  const rest          = Symbol.for('@@meta:magical:assertion-rest');
  const keys          = Object.keys;

  function isSetoid(value) {
    return value
    &&     typeof value.equals === 'function';
  }

  function isRecord(value) {
    return value
    &&     value[assertionType] === 'record';
  }

  function check(predicate, ...values) {
    return values.every(predicate);
  }

  function getSpecialArrayLength(array) {
    const rests = array.map((x, i) => [x, i]).filter(pair => pair[0] === rest);
    if (rests.length > 1 || (rests[0] && rests[0][1] !== array.length - 1)) {
      assert.ok(false, `${message}. Assertions only support a single trailing rest indication for arrays currently.`);
    }
    return (rests[0] || [null, array.length])[1];
  }

  function compareArrays(left, right) {
    const expectedLength = getSpecialArrayLength(right);
    assert.ok(Array.isArray(left), `${message}. The LHS is not an array.`);
    if (left.length < expectedLength) {
      assert.ok(false, `${message}. The LHS does not have the minimum expected length (${left.length} < ${expectedLength})`);
    }
    for (let i = 0; i < expectedLength; ++i) {
      compare(left[i], right[i]);
    }
  }

  function compareRecord(left, right) {
    const isPartial = right[rest];
    assert.ok(Object(left) === left, message);
    if (!isPartial) {
      assert.deepStrictEqual(keys(left).sort(), keys(right).sort(), `${message}. The objects have different keys ([${keys(left).sort().join(', ')}] vs. [${keys(right).sort().join(', ')}])`);
    }
    Object.keys(right).forEach(key => {
      if (!(key in left)) {
        assert.ok(false, `${message}. The expected key ${key} is not present in the actual object.`);
      }
      compare(left[key], right[key]);
    });
  }


  function compare(l, r) {
    return check(isSetoid, l, r)  ?  assert.ok(l.equals(r), `${message}. The LHS (${l}) setoid instance says the LHS and RHS (${r}) are not equal.`)
    :      Array.isArray(r)       ?  compareArrays(l, r)
    :      isRecord(r)            ?  compareRecord(l, r)
    :      /* otherwise */           assert.deepStrictEqual(l, r, `${message}. The LHS (${l}) and the RHS (${r}) are not structually equal.`);
  }

  compare(actual, expected);
}
136980
def attributeDefault(self, project, attribute, default):
        """"""
        assert isinstance(project, basestring)
        assert isinstance(attribute, basestring)
        assert isinstance(default, basestring) or default is None
        return self.module2attributes[project].getDefault(attribute, default)
1197742
public void assertAtLeastOneDefined(final String param1, final String... moreParams) {
    if (!isPresent(param1)) {
      for (final String moreParam : moreParams) {
        if (isPresent(moreParam)) {
          return;
        }
      }
      final List<String> paramsForError = Lists.newArrayList();
      paramsForError.add(param1);
      paramsForError.addAll(Arrays.asList(moreParams));
      throw new ParameterException(
          String.format("At least one of %s must be defined.",
              StringUtils.CommaSpaceJoiner.join(paramsForError)));
    }
  }
661652
function(attrs, options) {
        if (options.silent || !this.validate) {
          return;
        }
        attrs = _.extend({}, this.attributes, attrs);
        this.validate(attrs);
      }
600912
int writeJavaAnnotations(List<Attribute.Compound> attrs) {
        if (attrs.isEmpty()) return 0;
        ListBuffer<Attribute.Compound> visibles = new ListBuffer<Attribute.Compound>();
        ListBuffer<Attribute.Compound> invisibles = new ListBuffer<Attribute.Compound>();
        for (Attribute.Compound a : attrs) {
            switch (types.getRetention(a)) {
            case SOURCE: break;
            case CLASS: invisibles.append(a); break;
            case RUNTIME: visibles.append(a); break;
            default: ;// /* fail soft */ throw new AssertionError(vis);
            }
        }

        int attrCount = 0;
        if (visibles.length() != 0) {
            int attrIndex = writeAttr(names.RuntimeVisibleAnnotations);
            databuf.appendChar(visibles.length());
            for (Attribute.Compound a : visibles)
                writeCompoundAttribute(a);
            endAttr(attrIndex);
            attrCount++;
        }
        if (invisibles.length() != 0) {
            int attrIndex = writeAttr(names.RuntimeInvisibleAnnotations);
            databuf.appendChar(invisibles.length());
            for (Attribute.Compound a : invisibles)
                writeCompoundAttribute(a);
            endAttr(attrIndex);
            attrCount++;
        }
        return attrCount;
    }
1252793
private void initAttribute(Object pAttrval) {
        if (pAttrval instanceof String) {
            attributeNames = EscapeUtil.split((String) pAttrval,EscapeUtil.CSV_ESCAPE,",");
            multiAttributeMode = attributeNames.size() > 1;
        } else if (pAttrval instanceof Collection) {
            Collection<String> attributes = (Collection<String>) pAttrval;
            if (attributes.size() == 1 && attributes.iterator().next() == null) {
                attributeNames = null;
                multiAttributeMode = false;
            } else {
                attributeNames = new ArrayList<String>(attributes);
                multiAttributeMode = true;
            }
        } else if (pAttrval == null) {
            attributeNames = null;
            multiAttributeMode = false;
        } else {
            throw new IllegalArgumentException("Attribute names must be either a String, Collection or null (and not " + pAttrval.getClass() + ")");
        }
    }
939458
static void assign(ManyValueAttributeValue v1, AttributeValue v2) {
		if (v2 != null) {
			v1.setTopType(v2.getType());
		}
		if (v2 == null || !v2.isAssigned()) {
			v1.setMultipleValues(true);
		} else {
			assert v2.isAssigned();
			if (!v1.isAssigned()) {
				v1.setValue(v2);
			} else if (!v2.equals(v1)) {
				v1.setMultipleValues(true);
				if (!v1.isAssignableFrom(v2)) {
					if (!v2.isAssignableFrom(v1)) {
						v1.setInternalValue(null, AttributeType.OBJECT);
					} else {
						v1.setInternalValue(null, v2.getType());
					}
				}
			}
		}
	}
1319380
def _assertion(self, assertion, verified=False):
        

        if not hasattr(assertion, 'signature') or not assertion.signature:
            logger.debug("unsigned")
            if self.require_signature:
                raise SignatureError("Signature missing for assertion")
        else:
            logger.debug("signed")
            if not verified and self.do_not_verify is False:
                try:
                    self.sec.check_signature(assertion, class_name(assertion),
                                             self.xmlstr)
                except Exception as exc:
                    logger.error("correctly_signed_response: %s", exc)
                    raise

        self.assertion = assertion
        logger.debug("assertion context: %s", self.context)
        logger.debug("assertion keys: %s", assertion.keyswv())
        logger.debug("outstanding_queries: %s", self.outstanding_queries)

        # if self.context == "AuthnReq" or self.context == "AttrQuery":
        if self.context == "AuthnReq":
            self.authn_statement_ok()
        # elif self.context == "AttrQuery":
        #            self.authn_statement_ok(True)

        if not self.condition_ok():
            raise VerificationError("Condition not OK")

        logger.debug("--- Getting Identity ---")

        # if self.context == "AuthnReq" or self.context == "AttrQuery":
        #    self.ava = self.get_identity()
        #    logger.debug("--- AVA: %s", self.ava)

        try:
            self.get_subject()
            if self.asynchop:
                if self.allow_unsolicited:
                    pass
                elif self.came_from is None:
                    raise VerificationError("Came from")
            return True
        except Exception:
            logger.exception("get subject")
            raise
408607
function assertion(value, schema, message, vars, ssf) {
	return Joi.validate(value, schema, function(err, value) {
		// fast way
		if (!err) {
			return value;
		}

		// assemble message
		var msg = '';

		// process message (if any)
		var mtype = typeof message;
		if (mtype === 'string') {
			if (vars && typeof vars === 'object') {
				// mini template
				message = message.replace(/\{([\w]+)\}/gi, function (match, key) {
					if (hasOwnProp.call(vars, key)) {
						return vars[key];
					}
				});
			}
			msg += message + ': ';
		}

		// append schema label
		msg += getLabel(schema.describe(), err);

		// append some of the errors
		var maxDetails = 4;

		msg += err.details.slice(0, maxDetails).map(function(det) {
			if (/^\w+\.\w/.test(det.path)) {
				return '[' + det.path + '] ' + det.message;
			}
			return det.message;
		}).join(', ');

		if (err.details.length > maxDetails) {
			var hidden = (err.details.length - maxDetails);
			msg += '... (showing ' + (err.details.length - hidden) + ' of ' + err.details.length + ')';
		}

		// booya
		throw new AssertionError(msg, {
			details: err.details,
			value: value
		}, ssf);
	});
}
794676
def get_assertion(self, ticket, attributes):
        
        assertion = etree.Element('Assertion')
        assertion.set('xmlns', 'urn:oasis:names:tc:SAML:1.0:assertion')
        assertion.set('AssertionID', self.generate_id())
        assertion.set('IssueInstant', self.instant())
        assertion.set('Issuer', 'localhost')
        assertion.set('MajorVersion', '1')
        assertion.set('MinorVersion', '1')
        assertion.append(self.get_conditions(ticket.service))
        subject = self.get_subject(ticket.user.get_username())
        if attributes:
            assertion.append(self.get_attribute_statement(subject, attributes))
        assertion.append(self.get_authentication_statement(subject, ticket))

        return assertion
316917
def attribute?(attr)
      return false unless container.key?(key_as_sym(attr))
      ![ "", " ", nil, [],[""], [" "], self.class.new({}), [[]]].any? {|a| a == container[key_as_sym(attr)] }
    end
975478
protected static void assertion(boolean b, String msg)
  {
  	if(!b)
  	{
  		throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR, new Object[]{msg}));
  		// "Programmer's assertion in RundundentExprEliminator: "+msg);
  	}
  }