Handle a 'transform' callback.
422000
def handle_transform(self, task):
		""""""
		self.transformed += 1

		file = task.result()
		if file:
			self.next.append_file(file)

		self.flush_if_ended()
1290843
def _call_callbacks(self):
        """"""
        for callback in self._callbacks:
            callback(self, self._changeset)
        self._changeset = {}
1336713
function transform(input, process = () => undefined, finish = () => undefined) {
  if (isStream(input)) {
    return transformRaw(input, {
      async transform(value, controller) {
        try {
          const result = await process(value);
          if (result !== undefined) controller.enqueue(result);
        } catch(e) {
          controller.error(e);
        }
      },
      async flush(controller) {
        try {
          const result = await finish();
          if (result !== undefined) controller.enqueue(result);
        } catch(e) {
          controller.error(e);
        }
      }
    });
  }
  const result1 = process(input);
  const result2 = finish();
  if (result1 !== undefined && result2 !== undefined) return concat([result1, result2]);
  return result1 !== undefined ? result1 : result2;
}
5673
def update_callback(self, handle, events):
        """"""
        if self._poll is None:
            raise RuntimeError('poll instance is closed')
        if not has_callback(self, handle):
            raise ValueError('no such callback')
        if events & ~(READABLE|WRITABLE):
            raise ValueError('illegal event mask: {}'.format(events))
        if handle.extra == events:
            return
        if handle.extra & READABLE:
            self._readers -= 1
        if handle.extra & WRITABLE:
            self._writers -= 1
        if events & READABLE:
            self._readers += 1
        if events & WRITABLE:
            self._writers += 1
        handle.extra = events
        self._sync()
1036667
function transform(animate) {
    var base = animate ? g.transition().duration(DURATION) : g;
    base.attr('transform', `translate(${panX}, ${panY}) scale(${scale})`);
  }
966449
function If(transform, node) {
  var if_ = ifHelper(transform, node);
  var block = es.BlockStatement(null, [if_]);
  var fn = es.FunctionExpression(null, null, [], block);
  return es.CallExpression(null, fn, []);
}
1070282
function transform(chunk, encoding, cb) {
    // Allow objects straight through
    if (_.isPlainObject(chunk)) return cb(null, chunk);

    async.eachSeries(
      tokenize(chunk.toString('utf8')),
      (output, next) => transclude.call(this, output, next),
      err => {
        if (err) inputBuffer = '';
        cb(err);
      }
    );
  }
329375
def transform(self, offset, newseqid=None):
        """"""
        for feature in self:
            feature._range.transform(offset)
            if newseqid is not None:
                feature.seqid = newseqid
431321
function handleIt(cb) {
    callbacks = cb;
    broadcast = callbacks.broadcast;

    let msg = {
      cmd: MessageType.RockPaperScissors,
      handlerId: id
    };
    broadcast("action", msg);

    // Return a promise for the result
    deferred = q.defer();
    return deferred.promise;
  }
161271
function handler(instance, context, func, index, callback) {
	return function() {
		var old = instance.results[index];
		instance.results[index] = tryExpr(func, context);
		if (old === instance.results[index])
			return;
		if (instance.dependenciesCount === 1 || !Interpolable.allowDelayedUpdate)
			callback(instance.output(context), 'set');
		else if (!instance.willFire)
			instance.willFire = context.delay(function() { // call on nextTick to manage other dependencies update without multiple rerender
				if (instance.willFire) {
					instance.willFire = null;
					callback(instance.output(context), 'set');
				}
			}, 0);
	};
}
455807
function transform(req, res, next) {
    const state = res.state;
    const body = state.body;
    const type = typeof body;
    const isBuffer = body instanceof Buffer;
    let contentType;

    // error conversion
    if (body instanceof Error) {
        res.log('transform', 'Converting Error to response');
        res.status(500).body(httpStatus[500]).set('content-type', 'text/plain');

    // buffer conversion
    } else if (isBuffer) {
        res.log('transform', 'Converting Buffer to base64 string');
        res.body(body.toString('base64'));
        contentType = 'application/octet-stream';

    // object conversion
    } else if (type === 'object') {
        res.log('transform', 'Converting object to JSON string');
        res.body(JSON.stringify(body));
        contentType = 'application/json';

    // not string conversion
    } else if (type !== 'string') {
        res.log('transform', 'Converting ' + type + ' to string');
        res.body(String(body));
        contentType = 'text/plain';

    } else {
        contentType = 'text/html';
    }

    // set content type if not yet set
    if (!state.headers.hasOwnProperty('content-type') && contentType) {
        res.log('transform', 'Set content type');
        res.set('Content-Type', contentType);
    }

    next();
}
1167037
def _handle_log_rotations(self):
        '''  '''
        for h in self.capture_handlers:
            if self._should_rotate_log(h):
                self._rotate_log(h)
1326762
function applyTransform(data, headers, status, fns) {
		if (typeof fns === 'function') {
			data = fns(data, headers, status);
		} else {
			for (var i = 0; i < fns.length; i++) {
				data = fns[i](data, headers, status);
			}
		}
		return data;
	}
1092
def transform(self, m):
        """"""
        if not len(m) == 6:
            raise ValueError("bad sequ. length")
        self.x0, self.y0, self.x1, self.y1 = TOOLS._transform_rect(self, m)
        return self
1154311
def on(self, handler):
        """"""
        if not hasattr(handler, '__call__'):
            raise TypeError('handler is not a callable object.')
        self.handlers.add(handler)
467429
private function transform()
    {
        $this->data->transform(function ($data) {
            return collect($data)->map(function ($value) {
                return is_int($value) || is_float($value) || is_null($value) ? (string) $value : $value;
            })->filter(function ($value) {
                return is_string($value);
            });
        });
    }
671623
def _process_transform(self, data, transform, step_size):
    '''
    
    '''
    if isinstance(transform, (list,tuple,set)):
      return { t : self._transform(data,t,step_size) for t in transform }
    elif isinstance(transform, dict):
      return { tn : self._transform(data,tf,step_size) for tn,tf in transform.items() }
    return self._transform(data,transform,step_size)