code: def _format_preconditions(preconditions: List[List[icontract._Contract]], prefix: Optional[str] = None) -> List[str]:
      
      if not preconditions:
          return []
  
      result = []  # type: List[str]
      for i, group in enumerate(preconditions):
          if i == 0:
              if prefix is not None:
                  result.append(":{} requires:".format(prefix))
              else:
                  result.append(":requires:")
          else:
              if prefix is not None:
                  result.append(":{} requires else:".format(prefix))
              else:
                  result.append(":requires else:")
  
          for precondition in group:
              result.append("    * {}".format(_format_contract(contract=precondition)))
  
      return result
docs: Format preconditions as reST.
  
      :param preconditions: preconditions of a function
      :param prefix: prefix of the ``:requires:`` and ``:requires else:`` directive
      :return: list of lines