input: def translate_code(code: str, source_language: str, target_language: str) -> str:
      """Translates the given code from the source programming language to the target programming language.
      The input code is expected to be a valid code snippet in the source language, which should be functionally
      equivalent to the provided example. The output should be a code snippet in the target language that performs
      the same functionality.
      >>> translate_code('// JavaScript code\\nlet arr = [1, 2, 3, 4, 5];\\narr.forEach(item => {\\n console.log(item * 2);\\n});', 'JavaScript', 'Python')
      '# Python code\\narr = [1, 2, 3, 4, 5]\\n\\nfor item in arr:\\n print(item * 2)'
      """
output:     if source_language == 'JavaScript' and target_language == 'Python':
          code = code.replace('// JavaScript code', '# Python code')
          code = code.replace('let arr = ', 'arr = ')
          code = code.replace('arr.forEach(item => {', 'for item in arr:')
          code = code.replace('console.log(', 'print(')
          code = code.replace('});', '')
          return code.strip()
      else:
          raise ValueError("Unsupported language translation")