code: def cfg_dir(self, pyemma_cfg_dir):
          
          if not os.path.exists(pyemma_cfg_dir):
              try:
                  mkdir_p(pyemma_cfg_dir)
              except NotADirectoryError:  # on Python 3
                  raise ConfigDirectoryException("pyemma cfg dir (%s) is not a directory" % pyemma_cfg_dir)
              except EnvironmentError:
                  raise ConfigDirectoryException("could not create configuration directory '%s'" % pyemma_cfg_dir)
  
          if not os.path.isdir(pyemma_cfg_dir):
              raise ConfigDirectoryException("%s is no valid directory" % pyemma_cfg_dir)
          if not os.access(pyemma_cfg_dir, os.W_OK):
              raise ConfigDirectoryException("%s is not writeable" % pyemma_cfg_dir)
  
          # give user the default cfg file, if its not there
          self.__copy_default_files_to_cfg_dir(pyemma_cfg_dir)
          self._cfg_dir = pyemma_cfg_dir
  
          if self.show_config_notification:
              stars = '*' * 80
              print(stars, '\n',
                    'Changed PyEMMAs config directory to "{dir}".\n'
                    'To make this change permanent, export the environment variable'
                    ' "PYEMMA_CFG_DIR" \nto point to this location. Eg. edit your .bashrc file!'
                    .format(dir=pyemma_cfg_dir), '\n', stars, sep='')
docs: Sets PyEMMAs configuration directory.
          Also creates it with some default files, if does not exists.