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