Add an entry to data_files
334617
def add_data_file(data_files, target, source):
    """"""
    for t, f in data_files:
        if t == target:
            break
    else:
        data_files.append((target, []))
        f = data_files[-1][1]
    if source not in f:
        f.append(source)
796591
public static void addEntry(File zip, String path, byte[] bytes, File destZip) {
    addEntry(zip, new ByteSource(path, bytes), destZip);
  }
1003592
def add_files(self, files):
        
        for file in files:
            file.copy(project=self.id)
1242896
def _add_tag_files(
    zip_file, dir_name, payload_info_list, payload_byte_count, payload_file_count
):
    """"""
    tag_info_list = []
    _add_tag_file(zip_file, dir_name, tag_info_list, _gen_bagit_text_file_tup())
    _add_tag_file(
        zip_file,
        dir_name,
        tag_info_list,
        _gen_bag_info_file_tup(payload_byte_count, payload_file_count),
    )
    _add_tag_file(
        zip_file, dir_name, tag_info_list, _gen_pid_mapping_file_tup(payload_info_list)
    )
    return tag_info_list
1028491
def insert(self, index, filename):
        """"""
        base = self._base
        dct = {'__module__': base.__module__, 'filename': filename, '_stack': self}
        cls = type(base.__name__, (base,), dct)

        self._map[cls.filename] = cls
        self._classes.insert(index, cls)
231644
def add_input_file(self, filename):
    
    if filename not in self.__input_files:
      self.__input_files.append(filename)
1176937
def add(context, filenames):
    
    logging.info(_('Current Mode: Add Linux data'))
    context.obj['database'].add_data(filenames)
    sys.exit(0)
253498
def add_entry(self, net_type, cn, addresses):
        
        self.entries.append({
            'cn': cn,
            'addresses': addresses})
982337
def add(self, entries, table=None, columns=None, ignore=False):
        """"""
        # Default table and columns #
        if table is None:   table   = self.main_table
        if columns is None: columns = self.get_columns_of_table(table)
        # Default columns #
        question_marks = ','.join('?' for c in columns)
        cols           = ','.join('"' + c + '"' for c in columns)
        ignore         = " OR IGNORE" if ignore else ""
        sql_command    = 'INSERT%s into "%s"(%s) VALUES (%s);'
        sql_command    = sql_command % (ignore, table, cols, question_marks)
        # Possible errors we want to catch #
        errors  = (sqlite3.OperationalError, sqlite3.ProgrammingError)
        errors += (sqlite3.IntegrityError, sqlite3.InterfaceError, ValueError)
        # Do it #
        try:
            new_cursor = self.own_connection.cursor()
            new_cursor.executemany(sql_command, entries)
        except errors as err:
            raise Exception(self.detailed_error(sql_command, columns, entries, err))
        except KeyboardInterrupt as err:
            print("You interrupted the data insertion.")
            print("Committing everything done up to this point.")
            self.own_connection.commit()
            raise err
404890
def _addDPFilesToOldEntry(self, *files):
        """"""
        # quiet flag is always true
        self.view_entry_dialog.addDataProducts(self.purrer.makeDataProducts(
            [(file, True) for file in files], unbanish=True, unignore=True))
154561
def add_entry(id, title, updated, link, options={})
      entries << {
        :id => id,
        :title => title,
        :updated => updated,
        :link => link
        }.merge(options)
    end
955977
def add_data_dict(self, datadict):
        '''
        '''

        self.set_codes(list(datadict.keys()))
        self.add_data(list(datadict.values()))
247155
def append(self, entry):
        """"""
        if not self.is_appendable(entry):
            raise ValueError('entry not appendable')
        self.data += entry.data
256972
def add(self, data):
        """"""
        assert isinstance(data, bytes)
        with self.lock:
            self.buf += data
918780
def add(self, files, items):
        
        if isinstance(files, (str, bytes)):
            files = iter([files])
        for pathname in files:
            try:
                values = self._filemap[pathname]
            except KeyError:
                self._filemap[pathname] = items
            else:
                values.extend(items)
711903
def add_entry(e)
      @entries.push(e)
      if @md5_to_entries.has_key?(e.md5)
        @md5_to_entries[e.md5].push(e)
      else
        @md5_to_entries[e.md5] = [e]
      end
    end
102602
def _add_to_tbz(tfile, filename, data_str):
    '''
    
    '''

    # Create a bytesio object for adding to a tarfile
    # https://stackoverflow.com/a/52724508
    encoded_data = data_str.encode('utf-8')
    ti = tarfile.TarInfo(name=filename)
    ti.size = len(encoded_data)
    tfile.addfile(tarinfo=ti, fileobj=io.BytesIO(encoded_data))