def replaceKnownMemberChainsWithRenamedVariables(self,
                                                     objectIdToForaFunctionExpression,
                                                     renamedVariableMapping,
                                                     objectIdToObjectDefinition,
                                                     stronglyConnectedComponent):
        """
        Given a strongly connected component of functions, and a renamed object mapping
        replace known free variable access chains in the function expressions with the
        renamed variables
        """
        tr = dict()
        for objectId in stronglyConnectedComponent:
            objectDefinition = objectIdToObjectDefinition[objectId]
            foraFunctionExpression = objectIdToForaFunctionExpression[objectId]

            transformedFunction = foraFunctionExpression
            for freeVariableMemberAccessChain, dependentObjectId in \
                objectDefinition.freeVariableMemberAccessChainsToId.iteritems():
                if dependentObjectId in stronglyConnectedComponent:
                    transformedFunction = transformedFunction.rebindFreeVariableMemberAccessChain(
                        tuple(freeVariableMemberAccessChain.split('.')),
                        renamedVariableMapping[dependentObjectId]
                        )

            tr[objectId] = transformedFunction

        return tr
dataset/ETHPy150Open ufora/ufora/ufora/FORA/python/PurePython/Converter.py/Converter.replaceKnownMemberChainsWithRenamedVariables/original