def _get_root_dir():
 root_dir = op.abspath(op.dirname(__file__))
 up_dir = op.join(root_dir, '..')
 if (op.isfile(op.join(up_dir, 'setup.py')) and all((op.isdir(op.join(up_dir, x)) for x in ('mne', 'examples', 'doc')))):
  root_dir = op.abspath(up_dir)
 return root_dir

def _get_root_dir ( ) : root_dir = op . abspath ( op . dirname ( __file__ ) ) up_dir = op . join ( root_dir , '..' ) if ( op . isfile ( op . join ( up_dir , 'setup.py' ) ) and all ( ( op . isdir ( op . join ( up_dir , x ) ) for x in ( 'mne' , 'examples' , 'doc' ) ) ) ) : root_dir = op . abspath ( up_dir ) return root_dir
get as close to the repo root as possible .