def slave(self, fltr):
        """Returns the slave that has `fltr` in its ID.  Raises a
        DCOSException if there is not exactly one such slave.

        :param fltr: filter string
        :type fltr: str
        :returns: the slave that has `fltr` in its ID
        :rtype: Slave
        """

        slaves = self.slaves(fltr)

        if len(slaves) == 0:
            raise DCOSException('No slave found with ID "{}".'.format(fltr))

        elif len(slaves) > 1:
            matches = ['\t{0}'.format(slave['id']) for slave in slaves]
            raise DCOSException(
                "There are multiple slaves with that ID. " +
                "Please choose one: {}".format('\n'.join(matches)))

        else:
            return slaves[0]
dataset/ETHPy150Open dcos/dcos-cli/dcos/mesos.py/Master.slave/original