Bring Your Code: An algorithm for index translation