Create a 'file' analog called 'name' and put 'data' to the d_data dictionary
            under key 'name'.

            The 'name' can contain a path specifier.
192974
def touch(self, name, data):
            
            b_OK        = True
            str_here    = self.cwd()
            # print("here!")
            # print(self.snode_current)
            # print(self.snode_current.d_nodes)
            l_path = name.split('/')
            if len(l_path) > 1:
                self.cd('/'.join(l_path[0:-1]))
            name = l_path[-1]
            self.snode_current.d_data[name] = data
            # print(self.snode_current)
            self.cd(str_here)
            return b_OK
174361
def file(ctx, data_dir, data_file):
    """"""
    if not ctx.file:
        ctx.data_file = data_file

    if not ctx.data_dir:
        ctx.data_dir = data_dir

    ctx.type = 'file'
903509
def create_from_name_and_dictionary(self, name, datas):
        
        parameter = ObjectParameter()
        self.set_common_datas(parameter, name, datas)

        if "optional" in datas:
            parameter.optional = to_boolean(datas["optional"])
        if "type" in datas:
            parameter.type = str(datas["type"])
        if "generic" in datas:
            parameter.generic = to_boolean(datas["generic"])

        return parameter
904841
def _append_value(self, value, _file, _name):
        
        _tabs = '\t' * self._tctr
        _keys = '{tabs}<key>{name}</key>\n'.format(tabs=_tabs, name=_name)
        _file.seek(self._sptr, os.SEEK_SET)
        _file.write(_keys)

        self._append_dict(value, _file)
291846
def create_file(filename):
    

    expanded_filename = os.path.expanduser(os.path.expandvars(filename))
    if not os.path.exists(expanded_filename):
        open(expanded_filename, "a").close()
1328916
def _makeUniqueFilename(taken_names, name):
    
    if name in taken_names:
        # try to form up new name
        basename, ext = os.path.splitext(name)
        num = 1
        name = "%s-%d%s" % (basename, num, ext)
        while name in taken_names:
            num += 1
            name = "%s-%d%s" % (basename, num, ext)
    # finally, enter name into set
    taken_names.add(name)
    return name
226964
def from_name_func(cls, path:PathOrStr, fnames:FilePathList, label_func:Callable, valid_pct:float=0.2, **kwargs):
        ""
        src = ImageList(fnames, path=path).split_by_rand_pct(valid_pct)
        return cls.create_from_ll(src.label_from_func(label_func), **kwargs)
1090420
def _add_file(self, key, path):
        """"""
        filename = os.path.basename(path)
        base, ext = os.path.splitext(filename)
        if os.path.exists(self.file_path(filename)):
            with tempfile.NamedTemporaryFile(
                    dir=self.path, prefix=base, suffix=ext) as tf:
                filename = os.path.basename(tf.name)
        shutil.copyfile(path, self.file_path(filename))
        self.contents['files'][key] = filename
476610
def move_to(name):
    
    datapath = path.join(path.dirname(path.realpath(__file__)), path.pardir)
    datapath = path.join(datapath, '../gzoo_data', 'images', name)
    print path.normpath(datapath)
    return path.normpath(datapath)
552404
def add_file(self, name="", hashalg="", hash="", comClasses=None, 
                 typelibs=None, comInterfaceProxyStubs=None, 
                 windowClasses=None):
        
        self.files.append(File(name, hashalg, hash, comClasses, 
                          typelibs, comInterfaceProxyStubs, windowClasses))
217293
def save(fname, d, link_copy=True,raiseError=False):
    
    # make sure the object is dict (recursively) this allows reading it
    # without the DataStorage module
    fname = pathlib.Path(fname)
    d = toDict(d, recursive=True)
    d['filename'] = str(fname)
    extension = fname.suffix
    log.info("Saving storage file %s" % fname)
    try:
        if extension == ".npz":
            return dictToNpz(fname, d)
        elif extension == ".h5":
            return dictToH5(fname, d, link_copy=link_copy)
        elif extension == ".npy":
            return dictToNpy(fname, d)
        else:
            raise ValueError(
                "Extension must be h5, npy or npz, it was %s" % extension)
    except Exception as e:
        log.exception("Could not save %s" % fname)
        if raiseError: raise  e
278089
def set_name(self, name):
        
        path = self._filename.split("/")
        parts = path[-1].split(".")
        if len(parts) == 1:
            path[-1] = name
        else:
            path[-1] = name + "." + parts[-1]
        return File("/".join(path))
377472
def create(self, name):
        """"""
        if not os.path.exists(self.directory):
            os.makedirs(self.directory)

        filename = self.get_new_filename(name)
        with open(os.path.join(self.directory, filename), 'w') as fp:
            fp.write("def up(db): pass\n\n\n")
            fp.write("def down(db): pass\n")
            logger.info(filename)
1373709
def create_file_name(file, base_dir)
      file_name = file.split("/").delete_if { |f| f.include?(".") }.first
      unless File.exists?(File.join(base_dir, file_name))
        Dir.mkdir(File.join(base_dir, file_name))
      end
      file_name
    end
69670
def store_file(self, folder, name):
        """"""
        path = os.path.join(folder, name)
        length = self.headers['content-length']

        with open(path, 'wb') as sample:
            sample.write(self.rfile.read(int(length)))

        return path
743712
def save_metadata(self, data_dir, feature_name=None):
    """"""
    filepath = _get_metadata_filepath(data_dir, feature_name)
    with tf.io.gfile.GFile(filepath, 'w') as f:
      json.dump({
          'shape': [-1 if d is None else d for d in self._shape],
          'encoding_format': self._encoding_format,
      }, f, sort_keys=True)
66122
def load_data(data_file, key_name = None, local_file = False, format = 'json'):
    
    if local_file:
        if data_file.startswith('/'):
            src_file = data_file
        else:
            src_dir = os.getcwd()
            src_file = os.path.join(src_dir, data_file)
    else:
        src_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data')
        if not os.path.isdir(src_dir):
            src_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../data')
        src_file = os.path.join(src_dir, data_file)
    with open(src_file) as f:
        if format == 'json':
            data = json.load(f)
        elif format == 'yaml':
            data = yaml.load(f)
        elif format not in ['json', 'yaml'] and not key_name:
            data = f.read()
        else:
            printError('Error, argument \'key_name\' may not be used with data in %s format.' % format)
            return None
    if key_name:
        data = data[key_name]
    return data