def MkDirs(directory, force_mode=None):
  name = os.path.normpath(directory)
  dirs = name.split(os.path.sep)
  for i in range(0, len(dirs)):
    path = os.path.sep.join(dirs[:i+1])
    try:
      if path:
        os.mkdir(path)
        # only chmod if we created
        if force_mode is not None:
          os.chmod(path, force_mode)
    except OSError, exc:
      if not (exc.errno == errno.EEXIST and os.path.isdir(path)):
        raise
Can edit badge detail
dataset/ETHPy150Open google/google-apputils/google/apputils/file_util.py/MkDirs--crossover with--dataset/ETHPy150Open mozilla/django-badger/badger/tests/test_views.py/BadgerViewsTest.test_edit