def _get_configdir():
configdir = os.environ.get('<STR_LIT>')<EOL>if configdir is not None:<EOL><INDENT>if not _is_writable_dir(configdir):<EOL><INDENT>raise RuntimeError('<STR_LIT>'%configdir)<EOL><DEDENT>return configdir<EOL><DEDENT>h = get_home()<EOL>p = os.path.join(get_home(), '<STR_LIT>')<EOL>if os.path.exists(p):<EOL><INDENT>if not _is_writable_dir(p):<EOL><INDENT>raise RuntimeError("<STR_LIT>"% (h, h))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if not _is_writable_dir(h):<EOL><INDENT>raise RuntimeError("<STR_LIT>"%h)<EOL><DEDENT>os.mkdir(p)<EOL><DEDENT>return p<EOL>
Return the string representing the configuration dir.

default is HOME/.matplotlib.  you can override this with the
MPLCONFIGDIR environment variable