code: def is_valid(self):
          
          return super(SimpleDependency, self).is_valid() or (
              self.requirement.immediate_rebind and self._pending_ref is not None
          )
docs: Tests if the dependency is in a valid state