<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extern_store_dict(self, context_handle, vals_ptr, vals_len):
 """Given storage and an array of Handles, return a new Handle to represent the dict. It is assumed that an even number of values were passed. """

    c = self._ffi.from_handle(context_handle)
    tup = tuple(c.from_value(val[0]) for val in self._ffi.unpack(vals_ptr, vals_len))
    d = dict()
    for i in range(0, len(tup), 2):
      d[tup[i]] = tup[i + 1]
    return c.to_value(d)