<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def handle_id_request(msg):
 """Process an internal id request message."""

    node_id = msg.gateway.add_sensor()
    return msg.copy(
        ack=0, sub_type=msg.gateway.const.Internal['I_ID_RESPONSE'],
        payload=node_id) if node_id is not None else None