<SYSTEM_TASK:>
Given the following text problem statement, write Python code to implement the functionality described below in problem statement
<END_TASK>
<USER_TASK:>
Problem:
I'm using tensorflow 2.10.0.
<ASSISTANT_TASK:>
Python Code:
import tensorflow as tf
labels = [0, 6, 5, 4, 2]
def g(labels):
    return tf.one_hot(indices=labels, depth=10, on_value=1, off_value=0, axis=-1)
result = g(labels.copy())
<END_TASK>