def put_task(self, dp, callback=None):
        """
        Same as in :meth:`AsyncPredictorBase.put_task`.
        """
        f = Future()
        if callback is not None:
            f.add_done_callback(callback)
        self.input_queue.put((dp, f))
        return f
def put_task ( self , dp , callback = None ) : f = Future ( ) if callback is not None : f . add_done_callback ( callback ) self . input_queue . put ( ( dp , f ) ) return f
Same as in :meth:`AsyncPredictorBase.put_task`.