Saves the contents of a file handle as the contents of an object in a bucket.
197316
def upload_file_handle(
            self,
            bucket: str,
            key: str,
            src_file_handle: typing.BinaryIO,
            content_type: str=None,
            metadata: dict=None):
        
        raise NotImplementedError()
1041471
def store_json(self, filename, dict_to_store):
        """"""
        epoch = int(time.time() * (10 ** 6))
        s3_key = Key(self.bucket)
        s3_key.key = os.path.join(
            '/data',
            "%s_%s.json" % (filename, epoch)
        )
        s3_key.set_contents_from_string(
            json.dumps(dict_to_store),
            headers={'Content-Type': 'application/json; charset=UTF-8'},
            replace=True
        )
1273367
def save(self, filename, content):
        
        with open(filename, "w") as f:
            if hasattr(content, '__iter__'):
                f.write('\n'.join([row for row in content]))
            else:
                print('WRINGI CONTWETESWREWR')
                f.write(str(content))
547612
def save(self, obj):
        """"""
        if not obj.id:
            obj.id = uuid()

        stored_data = {
            'id': obj.id,
            'value': obj.to_data()
        }

        index_vals = obj.indexes() or {}
        for key in obj.__class__.index_names() or []:
            val = index_vals.get(key, '')
            stored_data[key] = DynamoMappings.map_index_val(val)

        table = self.get_class_table(obj.__class__)
        item = Item(table, data=stored_data)

        item.save(overwrite=True)
177980
def save(self, outfile):
        """"""
        if isinstance(outfile, compat.string_type):
            outfile = open(outfile, 'wb')
        outfile.write(compat.urllib2.urlopen(self.href).read())
9118
def save(self, outfile):
        """"""
        if isinstance(outfile, compat.string_type):
            outfile = open(outfile, 'wb')
        assert hasattr(outfile, 'write') and callable(outfile.write), \
            "Expect a file or file-like object with a .write() method"
        outfile.write(self.data)
1322716
private void saveBuckets() {
        if (lastModifiedOn > lastSavedOn) {
            System.out.println("Persisting current rates to: " + savedRates); //$NON-NLS-1$
            Properties props = new Properties();
            for (Entry<String, RateLimiterBucket> entry : buckets.entrySet()) {
                String value = entry.getValue().getCount() + "|" + entry.getValue().getLast(); //$NON-NLS-1$
                props.setProperty(entry.getKey(), value);
            }
            try (FileWriter writer = new FileWriter(savedRates)) {
                props.store(writer, "All apiman rate limits"); //$NON-NLS-1$
            } catch (IOException e) {
                e.printStackTrace();
            }
            lastSavedOn = System.currentTimeMillis();
        }
    }
1365964
def save(self, filename):
        """"""
        proxies = {'http': [], 'https': []}
        for protocol in ['http', 'https']:
            for proxy in self.proxies[protocol]:
                serializable_proxy = self.proxies[protocol][proxy].to_dict()
                proxies[protocol].append(serializable_proxy)
        with open(filename, 'w') as fout:
            json.dump(proxies, fout)
1371680
function(bucket) {
    var fs = require('fs');
    var path = require('path');
    var filePath = path.resolve('integ.buckets.json');
    var cache;
    if (fs.existsSync(filePath)) {
      try {
        cache = JSON.parse(fs.readFileSync(filePath));
        cache.buckets.push(bucket);
        fs.writeFileSync(filePath, JSON.stringify(cache));
      } catch (fileErr) {
        throw fileErr;
      }
    } else {
      cache = {};
      cache.buckets = [bucket];
      fs.writeFileSync(filePath, JSON.stringify(cache));
    }
  }
1044127
def save(self, *args):
        
        with open(self.file_root + '.pkl', "wb") as f:
            pickle.dump(args, f, protocol=pickle.HIGHEST_PROTOCOL)
321720
def _handle_dump(self, handler, file_object, **kwargs):
    

    return handler.dump(self.__class__, to_dict(self), file_object, **kwargs)
1254636
def save_img(object, handle, **kwargs):
    """"""

    if isinstance(object, np.ndarray):
        normalized = _normalize_array(object)
        object = PIL.Image.fromarray(normalized)

    if isinstance(object, PIL.Image.Image):
        object.save(handle, **kwargs)  # will infer format from handle's url ext.
    else:
        raise ValueError("Can only save_img for numpy arrays or PIL.Images!")
262990
def save(self, path):
        
        with open(path, 'w') as f:
            f.write(self.contents())
89159
function __save(filename, content, json){
  json = json === true

  if (json) {
    fs.writeFileSync(filename, JSON.stringify(content))
  } else {
    fs.writeFileSync(filename, content)
  }
}
594150
def saveShp(self, target):
        """"""
        if not hasattr(target, "write"):
            target = os.path.splitext(target)[0] + '.shp'
        if not self.shapeType:
            self.shapeType = self._shapes[0].shapeType
        self.shp = self.__getFileObj(target)
        self.__shapefileHeader(self.shp, headerType='shp')
        self.__shpRecords()
62782
function fileRef(item, network, bucket, selected){

		this.els = [];
		this.selected = false;

		this.item = {};

		// Item contents change
		this.update = function(item){
			if(!item){
				return this.item;
			}
			else {
				// Merge the two together
				this.item = hello.utils.merge(this.item, item);
			}

			// Loop through the elements and update their content
			for(var i=0;i<this.els.length;i++){
				this.els[i].getElementsByTagName('span')[0].innerHTML = this.item.name;
				if(this.item.thumbnail){
					this.els[i].getElementsByTagName('img')[0].src = this.item.thumbnail;
				}
			}
		};

		// Create an element in the given bucket,
		// adding on click event handlers
		this.create = function(bucket){
			var item = this.item;
			var self = this;
			var el = doc.createElement('li');
			el.title = item.name;
			el.innerHTML = "<img "+(item.thumbnail?"src='"+item.thumbnail+"'":"")+"/>"
							+"<span>"+(item.name||'')+"</span>";
			el.onclick = function(){
				// Is this a folder?
				if(item.type==='folder'||item.type==='album'){
					getBucket(network+":"+(item.files?item.files:item.id+"/files"), item.name, bucket.id );
				}
				else {
					// Toggle selected
					self.toggleSelect();
				}
			};
			// Add to bucket
			bucket.appendChild(el);

			// Add to local store
			this.els.push(el);

			return el;
		};


		this.toggleSelect = function(bool){

			if(bool===this.selected){
				// nothing
				return;
			}
			// else change

			// toggle
			this.selected = !this.selected;

			// Selected
			if(this.selected){
				// Does the element exist within the local bucket
				var local = false;
				for(i=0;i<this.els.length;i++){
					if( this.els[i].parentNode === select_el ){
						local=true;
						break;
					}
				}
				if(!local){
					// create it
					this.create(select_el);
				}
			}

			// Loop through the elements and update their content
			for(i=0;i<this.els.length;i++){
				this.els[i].className = this.selected ? "select" : "";
			}

			// get the number of selected items in ref and update
			info_el.innerHTML = ( this.selected ? ++global_counter : --global_counter );
		};

		// Create the initial element
		this.update(item);
		this.create(bucket);

		// if this is selected
		if(selected){
			this.toggleSelect();
		}
	}
394985
def wrap(self, data, many):
        """"""
        if not many:
            return data
        else:
            data = {'contents': data}
            bucket = self.context.get('bucket')
            if bucket:
                data.update(BucketSchema().dump(bucket).data)
            return data