<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _wrap_element(self, element):
 """ We want to know if an item is modified that is stored in this dict. If the element is a list or dict, we wrap it in a ProxyList or ProxyDict, and if it is modified execute a callback that updates this instance. If it is a ZenpyObject, then the callback updates the parent object. """


        def dirty_callback():
            self._set_dirty()

        if isinstance(element, list):
            element = ProxyList(element, dirty_callback=dirty_callback)
        elif isinstance(element, dict):
            element = ProxyDict(element, dirty_callback=dirty_callback)
        # If it is a Zenpy object this will either return None or the previous wrapper.
        elif getattr(element, '_dirty_callback', self._sentinel) is not self._sentinel:
            # Don't set callback if already set.
            if not callable(element._dirty_callback):
                element._dirty_callback = dirty_callback
        return element