<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find(self, name, required):
 """ Finds all matching dependencies by their name. :param name: the dependency name to locate. :param required: true to raise an exception when no dependencies are found. :return: a list of found dependencies """

        if name == None:
            raise Exception("Name cannot be null")
        
        locator = self._locate(name)
        if locator == None:
            if required:
                raise ReferenceException(None, name)
            return None
        
        return self._references.find(locator, required)