<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def divide(self, layer=WORDS, by=SENTENCES):
 """Divide the Text into pieces by keeping references to original elements, when possible. This is not possible only, if the _element_ is a multispan. Parameters element: str The element to collect and distribute in resulting bins. by: str Each resulting bin is defined by spans of this element. Returns ------- list of (list of dict) """

        if not self.is_tagged(layer):
            self.tag(layer)
        if not self.is_tagged(by):
            self.tag(by)
        return divide(self[layer], self[by])