<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _translate_equivalent_locations(match_query, location_translations):
 """Translate Location objects into their equivalent locations, based on the given dict."""

    new_match_traversals = []

    def visitor_fn(expression):
        """Expression visitor function used to rewrite expressions with updated Location data."""
        if isinstance(expression, (ContextField, GlobalContextField)):
            old_location = expression.location.at_vertex()
            new_location = location_translations.get(old_location, old_location)
            if expression.location.field is not None:
                new_location = new_location.navigate_to_field(expression.location.field)

            # The Expression could be one of many types, including:
            #   - ContextField
            #   - GlobalContextField
            # We determine its exact class to make sure we return an object of the same class
            # as the expression being replaced.
            expression_cls = type(expression)
            return expression_cls(new_location, expression.field_type)
        elif isinstance(expression, ContextFieldExistence):
            old_location = expression.location
            new_location = location_translations.get(old_location, old_location)

            return ContextFieldExistence(new_location)
        elif isinstance(expression, FoldedContextField):
            # Update the Location within FoldedContextField
            old_location = expression.fold_scope_location.base_location
            new_location = location_translations.get(old_location, old_location)

            fold_path = expression.fold_scope_location.fold_path
            fold_field = expression.fold_scope_location.field
            new_fold_scope_location = FoldScopeLocation(new_location, fold_path, field=fold_field)
            field_type = expression.field_type

            return FoldedContextField(new_fold_scope_location, field_type)
        else:
            return expression

    # Rewrite the Locations in the steps of each MATCH traversal.
    for current_match_traversal in match_query.match_traversals:
        new_traversal = []
        for step in current_match_traversal:
            new_step = step

            # If the root_block is a Backtrack, translate its Location if necessary.
            if isinstance(new_step.root_block, Backtrack):
                old_location = new_step.root_block.location
                if old_location in location_translations:
                    new_location = location_translations[old_location]
                    new_step = new_step._replace(root_block=Backtrack(new_location))

            # If the as_block exists, translate its Location if necessary.
            if new_step.as_block is not None:
                old_location = new_step.as_block.location
                if old_location in location_translations:
                    new_location = location_translations[old_location]
                    new_step = new_step._replace(as_block=MarkLocation(new_location))

            # If the where_block exists, update any Location objects in its predicate.
            if new_step.where_block is not None:
                new_where_block = new_step.where_block.visit_and_update_expressions(visitor_fn)
                new_step = new_step._replace(where_block=new_where_block)

            new_traversal.append(new_step)

        new_match_traversals.append(new_traversal)

    new_folds = {}
    # Update the Location within each FoldScopeLocation
    for fold_scope_location, fold_ir_blocks in six.iteritems(match_query.folds):
        fold_path = fold_scope_location.fold_path
        fold_field = fold_scope_location.field
        old_location = fold_scope_location.base_location
        new_location = location_translations.get(old_location, old_location)
        new_fold_scope_location = FoldScopeLocation(new_location, fold_path, field=fold_field)

        new_folds[new_fold_scope_location] = fold_ir_blocks

    # Rewrite the Locations in the ConstructResult output block.
    new_output_block = match_query.output_block.visit_and_update_expressions(visitor_fn)

    # Rewrite the Locations in the global where block.
    new_where_block = None
    if match_query.where_block is not None:
        new_where_block = match_query.where_block.visit_and_update_expressions(visitor_fn)

    return match_query._replace(match_traversals=new_match_traversals, folds=new_folds,
                                output_block=new_output_block, where_block=new_where_block)