def test_adapts(self):
        class IFoo(Interface):
            """ A simple interface. """
            def foo(self):
                """ The only method for the IFoo interface. """

        class Bar(HasTraits):
            """ A type that *doesn't* implement 'IFoo'. """

        class BarToIFooAdapter(Adapter):
            """ Adapts from Bar to IFoo. """
            adapts(Bar, to=IFoo)

            def foo(self):
                """ An implementation of the single method in the interface."""
                return 'foo'

        b = Bar()

        # Make sure that the Bar instance can be adapted to 'IFoo'.
        self.assertNotEqual(None, IFoo(b))
        self.assertEqual('foo', IFoo(b).foo())
Select the preemptable or non-premptable delegate
dataset/ETHPy150Open enthought/traits/traits/tests/test_protocols_usage.py/ProtocolsUsageTestCase.test_adapts--crossover with--dataset/ETHPy150Open BD2KGenomics/toil/src/toil/test/provisioners/clusterScalerTest.py/MockBatchSystemAndProvisioner._pick