code: def dict_to_kv(dict_val):
      result = [{"key": k, "value": v} for k, v in dict_val.items()]
      result.sort(key=lambda e: e["key"])
  
      return result
  
imports: import logging
  from django.db import connection
label_desc: Use image node_id 3 for calling a global function with example usage: dict_to_kv(dict_val) and returns: result