def get_sensor_instance(self, config=None, poll_interval=None):
        """
        Retrieve instance of the sensor class.
        """
        kwargs = {"sensor_service": self.sensor_service}

        if config:
            kwargs["config"] = config

        if poll_interval is not None:
            kwargs["poll_interval"] = poll_interval

        instance = self.sensor_cls(**kwargs)  # pylint: disable=not-callable
        return instance

        Retrieve instance of the sensor class.
        
st2tests/st2tests/sensors.py