Company vote 1 ============== The file :download:`votes.txt` contains the result of the vote held in a company. In each line there is the name of a shareholder (:class:`str`), the number of shares she has (:class:`int`), a Boolean (:class:`bool`) that is ``True`` if she is a partner founder of the company and ``False`` otherwise, and another Boolean (:class:`bool`) that is ``True`` if she approves the reform proposed and ``False`` otherwise. The file contains the following lines: .. literalinclude:: examples/votes.txt :language: python The first two lines correspond to the partner founder Dani, who has 100 shares and to the partner (not-founder) Manel, with 5 shares. Both have approved the reform. The rules to approve a reform in this company are the following: - The partner founders have the right to veto. That is, if a partner founder votes against the reform, this is rejected. - The vote of each shareholder is weighted with the number of shares she has. For instance, the vote of a shareholder has a value of 200 if she has 200 shares. Write function :py:func:`company` that takes the name of a file (:class:`str`) of the aforementioned characteristics, and returns a Boolean (:class:`bool`) showing whether the reform has been approved or not. The reform will be approved if nobody with a right to veto has voted against it, and if more than half of the (weighted) votes are favourable. If the reform has been approved this function also returns the approval percentage (:class:`float`); if it has not been approved due to a veto it must also return the string ``'veto'``, and if it has not been approved due to the percentage, it must also return it (:class:`float`). In the example given, the reform would pass since no partner founder has voted against and there are 155 votes in favour and 150 against. Therefore the function will return ``True`` and a percentage of ``50.82``. Save this function into file ``company.py`` .. note:: More tests are provided in file :download:`test-company.txt` .. rubric:: Solution A solution of these functions is provided in file :download:`company.py`.