def create_directory(dirname):
    # Allow group permissions on the directory we are about to create
    old_umask = os.umask(0o007)
    try:
        os.makedirs(dirname)
    except OSError, e:
        if e.errno != errno.EEXIST or not os.path.isdir(dirname):
            raise DatasetError('Directory %s could not be created' % dirname)
    finally:
        # Put back the old umask
        os.umask(old_umask)
Create dirname, including any intermediate directories necessary to
dataset/ETHPy150Open GeoscienceAustralia/agdc/src/cube_util.py/create_directory