def _create_tmp_config_dir():
 import getpass
 import tempfile
 from matplotlib.cbook import mkdirs
 try:
  tempdir = tempfile.gettempdir()
 except NotImplementedError:
  return None
 try:
  username = getpass.getuser()
 except KeyError:
  username = str(os.getuid())
 tempdir = tempfile.mkdtemp(prefix=(u'matplotlib-%s-' % username), dir=tempdir)
 os.environ[u'MPLCONFIGDIR'] = tempdir
 return tempdir

def _create_tmp_config_dir ( ) : import getpass import tempfile from matplotlib . cbook import mkdirs try : tempdir = tempfile . gettempdir ( ) except NotImplementedError : return None try : username = getpass . getuser ( ) except KeyError : username = str ( os . getuid ( ) ) tempdir = tempfile . mkdtemp ( prefix = ( u'matplotlib-%s-' % username ) , dir = tempdir ) os . environ [ u'MPLCONFIGDIR' ] = tempdir return tempdir
if the config directory can not be created .