<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_brain_region(self, abs_pos, parc_type='aparc', max_approx=None, exclude_regions=None):
 """Find the name of the brain region in which an electrode is located. Parameters abs_pos : numpy.ndarray 3x0 vector with the position of interest. parc_type : str 'aparc', 'aparc.a2009s', 'BA', 'BA.thresh', or 'aparc.DKTatlas40' 'aparc.DKTatlas40' is only for recent freesurfer versions max_approx : int, optional max approximation to define position of the electrode. exclude_regions : list of str or empty list do not report regions if they contain these substrings. None means that it does not exclude any region. Notes ----- It determines the possible brain region in which one electrode is present, based on Freesurfer segmentation. You can imagine that sometimes one electrode is not perfectly located within one region, but it's a few mm away. The parameter "approx" specifies this tolerance where each value is one mm. It keeps on searching in larger and larger spots until it finds at least one region which is not white matter. If there are multiple regions, it returns the region with the most detection. Minimal value is 0, which means only if the electrode is in the precise location. If you want to exclude white matter regions with 'aparc', use exclude_regions = ('White', 'WM', 'Unknown') and with 'aparc.a2009s', use: exclude_regions = ('White-Matter') """

        # convert to freesurfer coordinates of the MRI
        pos = around(dot(FS_AFFINE, append(abs_pos, 1)))[:3].astype(int)
        lg.debug('Position in the MRI matrix: {}'.format(pos))

        mri_dat, _ = self.read_seg(parc_type)

        if max_approx is None:
            max_approx = 3

        for approx in range(max_approx + 1):
            lg.debug('Trying approx {} out of {}'.format(approx, max_approx))
            regions = _find_neighboring_regions(pos, mri_dat,
                                                self.lookuptable, approx,
                                                exclude_regions)
            if regions:
                break

        if regions:
            c_regions = Counter(regions)
            return c_regions.most_common(1)[0][0], approx
        else:
            return '--not found--', approx