Creates the DATA_DIR.
    :return:
16239
def create_data_dir():
    
    from django_productline.context import PRODUCT_CONTEXT
    if not os.path.exists(PRODUCT_CONTEXT.DATA_DIR):
        os.mkdir(PRODUCT_CONTEXT.DATA_DIR)
        print('*** Created DATA_DIR in %s' % PRODUCT_CONTEXT.DATA_DIR)
    else:
        print('...DATA_DIR already exists.')
1319352
def Dir(self, name, create=True):
        """"""
        return self.dir.Dir(name, create=create)
115234
def _create_dir(path):
    '''
    '''
    try:
        os.makedirs(path)
    except OSError, exc:
        if exc.errno == errno.EEXIST:
            pass
        else:
            raise
139990
def _setup_dir(self, base_dir):
        
        stats_dir = self._sdir(base_dir)

        if not os.path.isdir(stats_dir):
            try:
                os.mkdir(stats_dir)
            except OSError:
                raise errors.DirectorySetupFail()
518273
def _create_path(self):
        """"""

        if self.driver == 'sqlite' and 'memory' not in self.dsn and self.dsn != 'sqlite://':

            dir_ = os.path.dirname(self.path)

            if dir_ and not os.path.exists(dir_):
                try:
                    # Multiple process may try to make, so it could already
                    # exist
                    os.makedirs(dir_)
                except Exception:
                    pass

                if not os.path.exists(dir_):
                    raise Exception("Couldn't create directory " + dir_)
1007971
def importData(directory):
    """"""
    dataTask = OrderedDict()
    dataQueue = OrderedDict()
    for fichier in sorted(os.listdir(directory)):
        try:
            with open("{directory}/{fichier}".format(**locals()), 'rb') as f:
                fileName, fileType = fichier.rsplit('-', 1)
                if fileType == "QUEUE":
                    dataQueue[fileName] = pickle.load(f)
                else:
                    dataTask[fileName] = pickle.load(f)
        except:
            # Can be a directory
            pass
    return dataTask, dataQueue
1194110
def get_data_dir():
    """"""
    base_odl_dir = os.environ.get('ODL_HOME', expanduser(join('~', '.odl')))
    data_home = join(base_odl_dir, 'datasets')
    if not exists(data_home):
        os.makedirs(data_home)
    return data_home
887182
def make_dir(project):
    
    project_path = os.path.join(os.path.dirname(__file__), project)
    # Delete the directory and the files inside it
    if os.path.exists(project_path):
        shutil.rmtree(project_path)
    # Create the directory
    os.mkdir(project_path)
    # We need a __init__.py file inside the directory
    with open(os.path.join(project_path, '__init__.py'), 'w') as fp:
        fp.write('__version__ = "' + str(get_property('__version__', 'geomdl')) + '"\n')
        fp.write('__author__ = "' + str(get_property('__author__', 'geomdl')) + '"\n')
        fp.write('__license__ = "' + str(get_property('__license__', 'geomdl')) + '"\n')
533892
def ensure_data():
    '''
    
    '''
    if not os.path.exists(GARUDA_DIR):
        os.makedirs(GARUDA_DIR)
    Path(f'{GARUDA_DIR}/__init__.py').touch()
520984
def data_directory():
    """"""
    package_directory = os.path.abspath(os.path.dirname(__file__))
    return os.path.join(package_directory, "data")
503093
def showDataDirectoriesData(peInstance):
    
    
    print "[+] Data directories:\n"
    dirs = peInstance.ntHeaders.optionalHeader.dataDirectory
    counter = 1
    for dir in dirs:
        print "[%d] --> Name: %s -- RVA: 0x%08x -- SIZE: 0x%08x" % (counter,  dir.name.value,  dir.rva.value,  dir.size.value)
        counter += 1
1003319
def make_dir_structure(base_dir):
    

    def maybe_makedir(*args):

        p = join(base_dir, *args)

        if exists(p) and not isdir(p):
            raise IOError("File '{}' exists but is not a directory ".format(p))

        if not exists(p):
            makedirs(p)

    maybe_makedir(DOWNLOAD_DIR)
    maybe_makedir(PACKAGE_DIR)
    maybe_makedir(OLD_DIR)
1130867
def _create_training_directories():
    
    logger.info('Creating a new training folder under %s .' % base_dir)

    os.makedirs(model_dir)
    os.makedirs(input_config_dir)
    os.makedirs(output_data_dir)

    _write_json({}, hyperparameters_file_dir)
    _write_json({}, input_data_config_file_dir)

    host_name = socket.gethostname()

    resources_dict = {
        "current_host": host_name,
        "hosts": [host_name]
    }
    _write_json(resources_dict, resource_config_file_dir)
1267419
def write_to_directory(self, dataset_info_dir):
    """"""
    # Save the metadata from the features (vocabulary, labels,...)
    if self.features:
      self.features.save_metadata(dataset_info_dir)

    if self.redistribution_info.license:
      with tf.io.gfile.GFile(self._license_filename(dataset_info_dir),
                             "w") as f:
        f.write(self.redistribution_info.license)

    with tf.io.gfile.GFile(self._dataset_info_filename(dataset_info_dir),
                           "w") as f:
      f.write(self.as_json)
1132171
def make_dir(cls, directory_name):
        """"""
        if not os.path.exists(directory_name):
            os.makedirs(directory_name)
1136394
def create_data_file_by_format(directory_path = None):
    
    stata_files = []
    sas_files = []

    for root, subdirs, files in os.walk(directory_path):
        for file_name in files:
            file_path = os.path.join(root, file_name)
            if os.path.basename(file_name).endswith(".dta"):
                log.info("Found stata file {}".format(file_path))
                stata_files.append(file_path)
            if os.path.basename(file_name).endswith(".sas7bdat"):
                log.info("Found sas file {}".format(file_path))
                sas_files.append(file_path)
    return {'stata': stata_files, 'sas': sas_files}
833024
def create_directories(datadir, sitedir, srcdir=None):
    
    # It's possible that the datadir already exists
    # (we're making a secondary site)
    if not path.isdir(datadir):
        os.makedirs(datadir, mode=0o700)
    try:
        # This should take care if the 'site' subdir if needed
        os.makedirs(sitedir, mode=0o700)
    except OSError:
        raise DatacatsError("Site already exists.")

    # venv isn't site-specific, the rest are.
    if not docker.is_boot2docker():
        if not path.isdir(datadir + '/venv'):
            os.makedirs(datadir + '/venv')
        os.makedirs(sitedir + '/postgres')
    os.makedirs(sitedir + '/solr')
    os.makedirs(sitedir + '/files')
    os.makedirs(sitedir + '/run')

    if srcdir:
        os.makedirs(srcdir)