def _get_strategy_cache_key(self, sensor_name):
        """Lookup sensor name in cache, allowing names in escaped form

        The strategy cache uses the normal KATCP sensor names as the keys.
        In order to allow access using an escaped sensor name, this method
        tries to find the normal form of the name.

        Returns
        -------

        key : str
            If there is a match, the cache key is returned.
            If no match, then the sensor_name is returned unchanged.

        """
        # try for a direct match first, otherwise do full comparison
        if sensor_name in self._strategy_cache:
            return sensor_name
        else:
            escaped_name = resource.escape_name(sensor_name)
            for key in self._strategy_cache:
                escaped_key = resource.escape_name(key)
                if escaped_key == escaped_name:
                    return key
        # no match
        return sensor_name
Lookup sensor name in cache, allowing names in escaped form

        The strategy cache uses the normal KATCP sensor names as the keys.
        In order to allow access using an escaped sensor name, this method
        tries to find the normal form of the name.

        Returns
        -------

        key : str
            If there is a match, the cache key is returned.
            If no match, then the sensor_name is returned unchanged.