Where orientation information is present in dipole fitting function

I looked at the MNE dipole fitting function but couldn’t find the information where the orientation of dipole is changed iteratively. Can someone tell me in what line of the code the orientation of the dipole is changed with each iteration?

And also what exactly is a lead field matrix? Does it contain the Voltage/ fT signals information picked up by each sensor for all possible orientations of the sources in the source grid or does it contain information for only a unit source at a particularly defined orientation at given location in source?

I think it happens here:

This is what @agramfort described as well:

It’s the forward model, i.e. a matrix that defines how activity from each grid point in the source space will be represented at the sensor level. The matrix will have n_channels rows and n_sources columns, describing how source activity is linearly combined into sensor (channel) data.