code: def _validate(self, all_valid_addresses):
      
      for dependency, dependents in iteritems(self._dependent_address_map):
        if dependency not in all_valid_addresses:
          raise AddressLookupError(
              'Dependent graph construction failed: {} did not exist. Was depended on by:\n  {}'.format(
               dependency.spec,
               '\n  '.join(d.spec for d in dependents)
            )
          )
docs: Validate that all of the dependencies in the graph exist in the given addresses set.