Stores the contents of the file like @data object in a blob under the
        given table and digest.
543561
def blob_put(self, table, digest, data):
        
        response = self._request('PUT', _blob_path(table, digest),
                                 data=data)
        if response.status == 201:
            # blob created
            return True
        if response.status == 409:
            # blob exists
            return False
        if response.status in (400, 404):
            raise BlobLocationNotFoundException(table, digest)
        _raise_for_status(response)
704212
private void loadDataFromInternetAndSave() throws IOException {
		InputStream is = null;
		FileOutputStream fos = null;
		try {
			URL url = new URL(DATA_RETRIVE_URL);
			is = url.openStream();
			fos = new FileOutputStream(getCacheFile());
			byte[] buff = new byte[1024 * 8];
			int len = 0;
			while ((len = is.read(buff)) != -1) {
				fos.write(buff, 0, len);
			}
		} finally {
			if (is != null) {
				is.close();
			}
			if (fos != null) {
				fos.close();
			}
		}

	}
542666
def update_contents(self, stream, seek=0, size=None, chunk_size=None,
                        progress_callback=None, **kwargs):
        
        self.checksum = None
        return self.storage(**kwargs).update(
            stream, seek=seek, size=size, chunk_size=chunk_size,
            progress_callback=progress_callback
        )
93128
def store(self, filename=None, location=None, path=None, container=None, region=None, access=None, base64decode=None):
        
        if path:
            path = '"{}"'.format(path)

        filelink_obj = self.add_transform_task('store', locals())
        response = utils.make_call(filelink_obj.url, 'get')

        if response.ok:
            data = json.loads(response.text)
            handle = re.match(r'(?:https:\/\/cdn\.filestackcontent\.com\/)(\w+)', data['url']).group(1)
            return filestack.models.Filelink(handle, apikey=self.apikey, security=self.security)
        else:
            raise Exception(response.text)
430828
def table_for_data( data )
    buf = ""
    buf << "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'></head><body>\n"
    buf << "<table>\n"
    data.each do |rec|
      buf << "  <tr>"
      rec.values.each do |value|
        buf << "<td>#{value}</td>"
      end
      buf << "</tr>\n"
    end
    buf << "</table>\n"
    buf << "</body></html>"
    buf
  end
1136492
def table_dump(self, table):
        """"""
        if not table: raise ValueError("no table")

        print('------- dumping table {}'.format(table))
        pipes = ["gzip"]
        outfile_path = self._get_outfile_path(table)
        cmd = self._get_args(
            "pg_dump",
            "--table={}".format(table),
            #"--data-only",
            "--clean",
            "--no-owner",
            "--column-inserts",
        )
        cmd = ' '.join(cmd)
        cmd += ' | {}'.format(' | '.join(pipes))
        cmd += ' > {}'.format(outfile_path)

        self._run_cmd(cmd)
        print('------- dumped table {}'.format(table))
        return True
979528
def get_digest(filename):
    """"""
    h = hashlib.md5()
    with open(filename, 'rb') as f:
        data = f.read(1 * MB)
        while data:
            h.update(data)
            data = f.read(1 * MB)
        return h.hexdigest()
1081138
def store_contents(self):
        
        string_buffer = os.linesep.join(
            map(
                lambda x: os.linesep.join(
                    ["<begin_table>"] + [x.name] + x.columns + ["<end_table>"]
                ),
                self.tables
            )
        )

        with open(METADATA_FILE, "w") as f:
            f.write(string_buffer)

        for i in self.tables:
            i.store_contents()
965280
function Blob(source, parent, githubClient) {
    this.gh = githubClient;
    this.parent = parent;
    this.sha = source.sha;
    this.rawContent = source.content;
    this.size = source.size;
    this.contents = new Buffer(this.rawContent, 'base64').toString('utf-8');
}
575171
function readBlobAsDataURL(blob, path) {
                    var reader = new FileReader();
                    reader.onloadend = function(loadedEvent) {
                        var dataURL = loadedEvent.target.result;
                        var blobtype = 'Blob';
                        if (blob instanceof File) {
                            //blobtype = 'File';
                        }
                        updateEncodedBlob(dataURL, path, blobtype);
                    };
                    reader.readAsDataURL(blob);
                }
394756
def blob_get(table, digest)
      uri = blob_path(table, digest)
      @logger.debug("BLOB GET #{uri}")
      req = Net::HTTP::Get.new(uri, headers)
      response = request(req)
      case response.code
      when '200'
        response.body
      else
        @logger.info("Response #{response.code}: #{response.body}")
        false
      end
    end
707162
function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
	{
	$blob_id = ibase_blob_create($this->_connectionID);

	// ibase_blob_add($blob_id, $val);

	// replacement that solves the problem by which only the first modulus 64K /
	// of $val are stored at the blob field ////////////////////////////////////
	// Thx Abel Berenstein  aberenstein#afip.gov.ar
	$len = strlen($val);
	$chunk_size = 32768;
	$tail_size = $len % $chunk_size;
	$n_chunks = ($len - $tail_size) / $chunk_size;

	for ($n = 0; $n < $n_chunks; $n++) {
		$start = $n * $chunk_size;
		$data = substr($val, $start, $chunk_size);
		ibase_blob_add($blob_id, $data);
	}

	if ($tail_size) {
		$start = $n_chunks * $chunk_size;
		$data = substr($val, $start, $tail_size);
		ibase_blob_add($blob_id, $data);
	}
	// end replacement /////////////////////////////////////////////////////////

	$blob_id_str = ibase_blob_close($blob_id);

	return $this->Execute("UPDATE $table SET $column=(?) WHERE $where",array($blob_id_str)) != false;

	}
683000
def _finalize_block_blob(self, sd, metadata, digest):
        # type: (SyncCopy, blobxfer.models.synccopy.Descriptor, dict,
        #        str) -> None
        
        blobxfer.operations.azure.blob.block.put_block_list(
            sd.dst_entity, sd.last_block_num, digest, metadata)
        if blobxfer.util.is_not_empty(sd.dst_entity.replica_targets):
            for ase in sd.dst_entity.replica_targets:
                blobxfer.operations.azure.blob.block.put_block_list(
                    ase, sd.last_block_num, digest, metadata)
351383
def save
      bytes = [ @blob_address, @size,
                @parent ? @parent.node_address : 0,
                @smaller ? @smaller.node_address : 0,
                @equal ? @equal.node_address : 0,
                @larger ? @larger.node_address : 0].pack(NODE_BYTES_FORMAT)
      @tree.nodes.store_blob(@node_address, bytes)
    end
457697
def load_data_table(file,
                    index_col,
                    show_progress=False):
    
    with ZipFile(file) as zip_file:
        file_names = zip_file.namelist()
        assert len(file_names) == 1, "Expected a single file from Quandl."
        wiki_prices = file_names.pop()
        with zip_file.open(wiki_prices) as table_file:
            if show_progress:
                log.info('Parsing raw data.')
            data_table = pd.read_csv(
                table_file,
                parse_dates=['date'],
                index_col=index_col,
                usecols=[
                    'ticker',
                    'date',
                    'open',
                    'high',
                    'low',
                    'close',
                    'volume',
                    'ex-dividend',
                    'split_ratio',
                ],
            )

    data_table.rename(
        columns={
            'ticker': 'symbol',
            'ex-dividend': 'ex_dividend',
        },
        inplace=True,
        copy=False,
    )
    return data_table
1197192
def _process_data(self, dd, offsets, data):
        # type: (Downloader, blobxfer.models.download.Descriptor,
        #        blobxfer.models.download.Offsets, bytes) -> None
        
        # decrypt if necessary
        if dd.entity.is_encrypted:
            # slice data to proper bounds and get iv for chunk
            if offsets.chunk_num == 0:
                # set iv
                iv = dd.entity.encryption_metadata.content_encryption_iv
                # set data to decrypt
                encdata = data
                # send iv through hmac
                dd.hmac_iv(iv)
            else:
                # set iv
                iv = data[:blobxfer.models.crypto.AES256_BLOCKSIZE_BYTES]
                # set data to decrypt
                encdata = data[blobxfer.models.crypto.AES256_BLOCKSIZE_BYTES:]
            # write encdata to disk for hmac later
            _hmac_datafile = dd.write_unchecked_hmac_data(
                offsets, encdata)
            # decrypt data
            if self._crypto_offload is not None:
                self._crypto_offload.add_decrypt_chunk(
                    str(dd.final_path), dd.view.fd_start, offsets,
                    dd.entity.encryption_metadata.symmetric_key,
                    iv, _hmac_datafile)
                # data will be integrity checked and written once
                # retrieved from crypto queue
                return
            else:
                data = blobxfer.operations.crypto.aes_cbc_decrypt_data(
                    dd.entity.encryption_metadata.symmetric_key,
                    iv, encdata, offsets.unpad)
                dd.write_data(offsets, data)
        else:
            # write data to disk
            dd.write_unchecked_data(offsets, data)
        # finalize chunk
        self._finalize_chunk(dd, offsets)
230186
public Blob open_blob( String db, String table, String column, long row, boolean rw ) throws jsqlite.Exception {
        synchronized (this) {
            Blob blob = new Blob();
            _open_blob(db, table, column, row, rw, blob);
            return blob;
        }
    }