Translate the following [source language] code to [target language]: [code snippet].
Convert the given [source language] class or module to [target language] while preserving its functionality and structure: [code snippet].
Migrate the following [source language] code that uses [library or framework] to [target language] with a similar library or framework: [code snippet].
Rewrite the given [source language] algorithm in [target language] with equivalent performance characteristics: [algorithm or pseudocode].
Adapt the following [source language] code snippet to [target language] while adhering to [target language's best practices]: [code snippet].
Translate the given [source language] function that handles [specific task or operation] to [target language]: [code snippet].