python/ray/autoscaler/_private/aws/cloudwatch/cloudwatch_helper.py
def _replace_all_config_variables(
            self,
            collection,
            node_id,
            cluster_name,
            region,
    ):
        """
        Replace known config variable occurrences in the input collection.
        The input collection must be either a dict or list.

        Returns a tuple consisting of the output collection and the number of
        modified strings in the collection (which is not necessarily equal to
        the number of variables replaced).
        """

        modified_value_count = 0
        if type(collection) is dict:
            for key, value in collection.items():
                if type(value) is dict or type(value) is list:
                    (collection[key], modified_count) = \
                        self._replace_all_config_variables(
                            collection[key],
                            node_id,
                            cluster_name,
                            region
                        )
                    modified_value_count += modified_count
                elif type(value) is str:
                    collection[key] = self._replace_config_variables(
                        value,
                        node_id,
                        cluster_name,
                        region,
                    )
                    modified_value_count += (collection[key] != value)
        if type(collection) is list:
            for i in range(len(collection)):
                if type(collection[i]) is dict or type(collection[i]) is list:
                    (collection[i], modified_count) = \
                        self._replace_all_config_variables(
                            collection[i],
                            node_id,
                            cluster_name,
                            region
                        )
                    modified_value_count += modified_count
                elif type(collection[i]) is str:
                    value = collection[i]
                    collection[i] = self._replace_config_variables(
                        value,
                        node_id,
                        cluster_name,
                        region,
                    )
                    modified_value_count += (collection[i] != value)
        return collection, modified_value_count

        Replace known config variable occurrences in the input collection.
        The input collection must be either a dict or list.

        Returns a tuple consisting of the output collection and the number of
        modified strings in the collection (which is not necessarily equal to
        the number of variables replaced).
        
Replace known config variable occurrences in the input collection.
The input collection must be either a dict or list.

Returns a tuple consisting of the output collection and the number of
modified strings in the collection (which is not necessarily equal to
the number of variables replaced).
Replace known config variable occurrences in the input collection . The input collection must be either a dict or list . Returns a tuple consisting of the output collection and the number of modified strings in the collection ( which is not necessarily equal to the number of variables replaced ) .
def _replace_all_config_variables(
            self,
            collection,
            node_id,
            cluster_name,
            region,
    ):
        modified_value_count = 0
        if type(collection) is dict:
            for key, value in collection.items():
                if type(value) is dict or type(value) is list:
                    (collection[key], modified_count) = \
                        self._replace_all_config_variables(
                            collection[key],
                            node_id,
                            cluster_name,
                            region
                        )
                    modified_value_count += modified_count
                elif type(value) is str:
                    collection[key] = self._replace_config_variables(
                        value,
                        node_id,
                        cluster_name,
                        region,
                    )
                    modified_value_count += (collection[key] != value)
        if type(collection) is list:
            for i in range(len(collection)):
                if type(collection[i]) is dict or type(collection[i]) is list:
                    (collection[i], modified_count) = \
                        self._replace_all_config_variables(
                            collection[i],
                            node_id,
                            cluster_name,
                            region
                        )
                    modified_value_count += modified_count
                elif type(collection[i]) is str:
                    value = collection[i]
                    collection[i] = self._replace_config_variables(
                        value,
                        node_id,
                        cluster_name,
                        region,
                    )
                    modified_value_count += (collection[i] != value)
        return collection, modified_value_count
def _replace_all_config_variables ( self , collection , node_id , cluster_name , region , ) : modified_value_count = 0 if type ( collection ) is dict : for key , value in collection . items ( ) : if type ( value ) is dict or type ( value ) is list : ( collection [ key ] , modified_count ) = self . _replace_all_config_variables ( collection [ key ] , node_id , cluster_name , region ) modified_value_count += modified_count elif type ( value ) is str : collection [ key ] = self . _replace_config_variables ( value , node_id , cluster_name , region , ) modified_value_count += ( collection [ key ] != value ) if type ( collection ) is list : for i in range ( len ( collection ) ) : if type ( collection [ i ] ) is dict or type ( collection [ i ] ) is list : ( collection [ i ] , modified_count ) = self . _replace_all_config_variables ( collection [ i ] , node_id , cluster_name , region ) modified_value_count += modified_count elif type ( collection [ i ] ) is str : value = collection [ i ] collection [ i ] = self . _replace_config_variables ( value , node_id , cluster_name , region , ) modified_value_count += ( collection [ i ] != value ) return collection , modified_value_count
Replace known config variable occurrences in the input collection.
Replace known config variable occurrences in the input collection .
"""
        Replace known config variable occurrences in the input collection.
        The input collection must be either a dict or list.

        Returns a tuple consisting of the output collection and the number of
        modified strings in the collection (which is not necessarily equal to
        the number of variables replaced).
        """
self
collection
node_id
cluster_name
region