Edit metadata of an image

@param {String}   imageIdentifier
@param {Object}   data
@param {Function} callback
@param {String}   method HTTP method to use (POST/PUT)
@return {ImboClient}
517407
function(imageIdentifier, data, callback, method) {
        var url = this.getMetadataUrl(imageIdentifier);

        request({
            method: method || 'POST',
            uri: this.getSignedResourceUrl(method || 'POST', url),
            json: data,
            onComplete: function(err, res, body) {
                callback(err, body, res);
            }
        });

        return this;
    }
136272
function ApiclientAdapter(resource) {
    this.admin = admin;
    this.resource = resource || {};

    // loop through API interface for resource to get methods to expose
    var me = this;
    _.each(resource.api, function (methodInfo, httpMethod) {
        _.each(methodInfo, function (operation, path) {
            me[operation] = function (req) {
                return me.send(httpMethod, path, req);
            };
        });
    });
}
341369
function (object, label, callback) {

                var labelObject = this.$.dataSource.createEntity(ObjectLabel);

                labelObject.set({
                    object: object,
                    objectType: this.$.dataSource.createEntity(ObjectType, this.getObjectTypeIdForElement(object)),
                    label: label
                });

                labelObject.save(callback);
            }
53651
function (request, response) {
    if (request.querystring.action === 'delete') {
      this.photo.delete.apply(this, arguments)
    } else if (request.querystring.action === 'put') {
      this.photo.put.apply(this, arguments)
    } else {
      response.serveJSON()
    }
  }
599736
function (method, model, options) {
        options = options ? _.clone(options) : {};
        var jsonPayload;
        var promise;

        // Ensure that we have a hoodie object type.
        if (!model.HOODIE_TYPE) {
            throw new Error('A HOODIE_TYPE property must be specified');
        }

        // Ensure that we have the appropriate request data.
        if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
            jsonPayload = options.attrs || model.toJSON(options) || options.data;
        }

        switch(method) {
            case 'read':
                if (options && options.id) {
                    promise = window.hoodie.store.find(model.HOODIE_TYPE, options.id);
                } else {
                    promise = window.hoodie.store.findAll(model.HOODIE_TYPE);
                }
                break;
            case 'create':
                if (!jsonPayload) {
                    throw new Error('Trying to add a model, but no data provided');
                } else {
                    promise = window.hoodie.store.add(model.HOODIE_TYPE, jsonPayload, options.silent);
                }
                break;
            case 'update':
            case 'patch':
                if (! jsonPayload) {
                    throw new Error('Trying to update a model, but no data provided');
                } else if (!model.id) {
                    throw new Error('Cannot update model - no id provided');
                } else {
                    promise = window.hoodie.store.update(model.HOODIE_TYPE, model.id, jsonPayload, options.silent);
                }
                break;
            case 'delete':
                if (!model.id) {
                    throw new Error('Cannot delete model - no id provided');
                } else {
                    promise = window.hoodie.store.remove(model.HOODIE_TYPE, model.id, options.silent);
                }
                break;
            default:
                throw new Error('Undefined hoodie method requested: ' + methodMap[method] + ' original: ' + method);
                break
        }

        promise.done(function(body) {
            if (options.success) return options.success(body, 'success');
        });
        promise.fail(function(error) {
            if (options.error) return options.error({}, 'error', error);
        });
    }
590120
function (data, callback) {
    if (typeof callback !== 'function') {
        this.debug("Registering dummy callback, because a response message is expected");
    } else {
        this.debug("Registering callback");
    }
    this.waitingCallbacks.push(callback);
    send.call(this, data);
}
1037601
function(image, callback) {
        var self = this,
            imageId = image instanceof rackspace.Image ? image.id : image;

        var destroyOptions = {
            method: 'DELETE',
            uri: '/images/' + imageId
        };

        self.authorizedRequest(destroyOptions, function(err, res, body) {
            if (err || res.statusCode !== 204) {
                callback(err);
                return;
            }

            callback(err, true);
        });
    }
1140366
function() {

    var _formatter = this;


    // functions that accept standard <data> and output form data for known services
    _formatter.schemas = {

      "publiclab": function(data) {

        var output = {};

        output.title              = data.title || null;
        output.body               = data.body  || null;

        // we can remove this from server req, since we're authenticated
        output.authenticity_token = data.token || null;

        // Whether note will be draft or not
        output.draft = data.draft || false;

        // Optional:
        output.tags               = data.tags           || null; // comma delimited
        output.has_main_image     = data.has_main_image || null;
        output.main_image         = data.main_image     || null; // id to associate with pre-uploaded image
        output.node_images        = data.node_images    || null; // comma-separated image.ids, I think
        // photo is probably actually a multipart, but we pre-upload anyways, so probably not necessary:
        output.image              = { };
        output.image.photo        = data.image          || null;

        return output;

      }//,

      // "drupal": {
      //   "title":           null,
      //   "body":            null
      // }

    }


    _formatter.convert = function(data, destination) {

      // return formatted version of data
      return _formatter.schemas[destination](data);

    }

  }
390898
function(callback) {
				SourceCollection.prototype[sourceMethodName].call(
					self, filter, update, sourceOptions, callback
				);
			}
448272
function reprovisionInstance(uuid, image_uuid, callback) {
    assert.string(uuid, 'uuid');
    assert.string(image_uuid, 'image_uuid');

    var opts = {};
    opts.image_uuid = image_uuid;

    return (this.put(sprintf('/instances/%s/upgrade', uuid), opts, callback));
}
1264821
def edit_dataset_metadata(request, dataset_id=None):
    
    if request.method == 'POST':
        return add_dataset(request, dataset_id)

    elif request.method == 'GET':
        # create a blank form
        # Edit
        if dataset_id:
            metadata_form = DatasetUploadForm(
                instance=get_object_or_404(Dataset, pk=dataset_id)
            )
        # Upload
        else:
            metadata_form = DatasetUploadForm()

        return render(
            request,
            'datafreezer/upload.html',
            {
                'fileUploadForm': metadata_form,
            }
        )
1003651
function(imageIdentifier, shortUrl, callback) {
        var id = shortUrl instanceof ShortUrl ? shortUrl.getId() : shortUrl,
            url = this.getImageUrl(imageIdentifier).setPath('/shorturls/' + id),
            signed = this.getSignedResourceUrl('DELETE', url);

        request.del(signed, callback);
        return this;
    }
4524
function getImageData(array, callback)
    {
    "use strict";    
    array.map( doSomething);   
    // this is not fully satisfying - I collect the promises and then do the writeFile via timeout
    setTimeout(function(){
        "use strict";  
        Q.all(promises)
            .then(function (first) {
                writeFile();
            }, function (error) {
            // All of the promises were rejected.
        });

    },0);

    }
1143935
function (format) {
        return function (data) {
            var el = makeElement("img", [ "image-output" ]);
            el.src = "data:image/" + format + ";base64," + joinText(data).replace(/\n/g, "");
            return el;
        };
    }
321937
function readImageLayer(map, data, z) {
        // Normalize properties
        me.TMXUtils.applyTMXProperties(data.properties, data);

        // create the layer
        var imageLayer = me.pool.pull("me.ImageLayer",
            // x/y is deprecated since 0.15 and replace by offsetx/y
            +data.offsetx || +data.x || 0,
            +data.offsety || +data.y || 0,
            Object.assign({
                name: data.name,
                image: data.image,
                z: z
            }, data.properties)
        );

        // set some additional flags
        var visible = typeof(data.visible) !== "undefined" ? data.visible : true;
        imageLayer.setOpacity(visible ? +data.opacity : 0);

        return imageLayer;
    }
11248
function(callback) {
      if (fabric.Image) {
        var i = new Image();

        /** @ignore */
        i.onload = function() {
          if (callback) {
            callback(new fabric.Image(i), orig);
          }
          i = i.onload = null;
        };

        var orig = {
          angle: this.get('angle'),
          flipX: this.get('flipX'),
          flipY: this.get('flipY')
        };

        // normalize angle
        this.set('angle', 0).set('flipX', false).set('flipY', false);
        this.toDataURL(function(dataURL) {
          i.src = dataURL;
        });
      }
      return this;
    }
245881
function(imageIdentifier, options) {
        if (typeof imageIdentifier !== 'string' || imageIdentifier.length === 0) {
            throw new Error(
                '`imageIdentifier` must be a non-empty string, was "' + imageIdentifier + '"' +
                ' (' + typeof imageIdentifier + ')'
            );
        }

        options = options || {};

        return new ImageUrl({
            baseUrl: this.getHostForImageIdentifier(
                imageIdentifier,
                options.usePrimaryHost
            ),
            path: options.path,
            user: this.options.user,
            publicKey: this.options.publicKey,
            privateKey: this.options.privateKey,
            imageIdentifier: imageIdentifier
        });
    }