def _get_path(path, key, name):
 if (path is not None):
  if (not isinstance(path, string_types)):
   raise ValueError('path must be a string or None')
  return path
 path = get_config(key, get_config('MNE_DATA'))
 if (path is not None):
  return path
 logger.info(('Using default location ~/mne_data for %s...' % name))
 path = op.join(os.getenv('_MNE_FAKE_HOME_DIR', op.expanduser('~')), 'mne_data')
 if (not op.exists(path)):
  logger.info('Creating ~/mne_data')
  try:
   os.mkdir(path)
  except OSError:
   raise OSError(("User does not have write permissions at '%s', try giving the path as an argument to data_path() where user has write permissions, for ex:data_path('/home/xyz/me2/')" % path))
 return path

def _get_path ( path , key , name ) : if ( path is not None ) : if ( not isinstance ( path , string_types ) ) : raise ValueError ( 'path must be a string or None' ) return path path = get_config ( key , get_config ( 'MNE_DATA' ) ) if ( path is not None ) : return path logger . info ( ( 'Using default location ~/mne_data for %s...' % name ) ) path = op . join ( os . getenv ( '_MNE_FAKE_HOME_DIR' , op . expanduser ( '~' ) ) , 'mne_data' ) if ( not op . exists ( path ) ) : logger . info ( 'Creating ~/mne_data' ) try : os . mkdir ( path ) except OSError : raise OSError ( ( "User does not have write permissions at '%s', try giving the path as an argument to data_path() where user has write permissions, for ex:data_path('/home/xyz/me2/')" % path ) ) return path
builds a path given some values .