def _format_invariants(invariants: List[icontract._Contract]) -> List[str]:
    """Format invariants as reST."""
    if not invariants:
        return []

    result = [":establishes:"]  # type: List[str]
    for invariant in invariants:
        result.append("    * {}".format(_format_contract(contract=invariant)))

    return result
def _format_invariants ( invariants : List [ icontract . _Contract ] ) -> List [ str ] : if not invariants : return [ ] result = [ ":establishes:" ] for invariant in invariants : result . append ( "    * {}" . format ( _format_contract ( contract = invariant ) ) ) return result
Format invariants as reST.