<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def neighbors(self, distance=2.0):
 """Get all neighbors for all neurons."""

        dgrid = self.distance_grid.reshape(self.num_neurons, self.num_neurons)
        for x, y in zip(*np.nonzero(dgrid <= distance)):
            if x != y:
                yield x, y