Construct a transformation object
517569
def get_transformation(self, coordinates):
        """"""
        atom1, atom2 = self.hinge_atoms
        direction = coordinates[atom1] - coordinates[atom2]
        direction /= np.linalg.norm(direction)
        direction *= np.random.uniform(-self.max_amplitude, self.max_amplitude)
        result = Translation(direction)
        return result
1107750
@JRubyMethod
    public static IRubyObject transform(IRubyObject self) {
        //             System.err.println("()");
        Ruby runtime = self.getRuntime();
        ThreadContext ctx = runtime.getCurrentContext();
        org.yecht.Node orig_n = (org.yecht.Node)self.dataGetStructChecked();
        YAMLExtra x = ((Node)self).x;
        IRubyObject t = new Node(runtime, self.getType(), null, x);
        org.yecht.Node n = null;

        switch(orig_n.kind) {
        case Map:
            n = org.yecht.Node.allocMap();
            t.dataWrapStruct(n);
            org.yecht.Data.Map dm = (org.yecht.Data.Map)orig_n.data;
            for(int i=0; i < dm.idx; i++) {
                IRubyObject k = ((IRubyObject)orig_n.mapRead(MapPart.Key, i)).callMethod(ctx, "transform");
                IRubyObject v = ((IRubyObject)orig_n.mapRead(MapPart.Value, i)).callMethod(ctx, "transform");
                n.mapAdd(k, v);
            }
            break;
        case Seq:
            n = org.yecht.Node.allocSeq();
            t.dataWrapStruct(n);
            org.yecht.Data.Seq ds = (org.yecht.Data.Seq)orig_n.data;
            for(int i=0; i < ds.idx; i++) {
                IRubyObject itm = ((IRubyObject)orig_n.seqRead(i)).callMethod(ctx, "transform");
                n.seqAdd(itm);
            }
            break;
        case Str:
            org.yecht.Data.Str dss = (org.yecht.Data.Str)orig_n.data;
            n = org.yecht.Node.newStr(dss.ptr, dss.len, dss.style);
            t.dataWrapStruct(n);
            break;
        }

        if(orig_n.type_id != null) {
            n.type_id = orig_n.type_id;
        }

        if(orig_n.anchor != null) {
            n.anchor = orig_n.anchor;
        }

        n.id = t;
        //             System.err.println("(), setting id of object on: " + n);
        IRubyObject result = x.DefaultResolver.callMethod(ctx, "node_import", t);
        return result;
    }
1131269
def transform(root, opts={})
      new_copy = opts[:in_place] ? root : clone_sexp(root)
      scope_stack = ScopeStack.new
      transform_tree(new_copy, scope_stack)
      new_copy
    end
58761
function transform( data ) {
	var rows = data.rows;
	var out;
	var i;
	out = new Array( rows.length );
	for ( i = 0; i < rows.length; i++ ) {
		out[ i ] = rows[ i ].key[ 1 ];
	}
	return out;
}
730530
function transform(transform, flush) {
  const stream = new Transform({ objectMode: true });
  stream._transform = transform;
  if (typeof flush === 'function') {
    stream._flush = flush;
  }
  return stream;
}
1266832
function (cfg) {
        if (arguments.length === 0) { var components = (this.css ('transform') || '').match (/^matrix\((.+\))$/)
            if (components) {
                var m = components[1].split (',').map (parseFloat)
                return new Transform ({ a: m[0], b: m[1], c: m[2], d: m[3], e: m[4], f: m[5] }) }
            else {
                return Transform.identity } }
        else {
            return this.css ('transform', (_.isStrictlyObject (cfg) && (
                (cfg.translate ? ('translate(' + cfg.translate.x + 'px,' + cfg.translate.y + 'px) ') : '') +
                (cfg.rotate ? ('rotate(' + cfg.rotate + 'rad) ') : '') +
                (cfg.scale ? ('scale(' + (new Vec2 (cfg.scale).separatedWith (',')) + ')') : ''))) || '') } }
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)
566833
function parseTransforms(value) {
  return value
    .match(/(rotate|translate|scale|skewX|skewY|matrix)\s*\(([^)]*)\)\s*/g)
    .map(transform => transform.match(/[\w.-]+/g));
}
734918
function (state, transformation, res) {
        if (!module.exports.operations.canTransform || !module.exports.operations.transform) {
            log.warn('Transform State operation not implemented by application');
            Utils.sendMessage(res, HttpStatus.NOT_IMPLEMENTED, JSON.stringify({ error: 'operation not implemented' }));
            return state;
        } else if (Utils.isNullOrEmpty(transformation)) {
            log.error('Transformation not provided');
            Utils.sendMessage(res, HttpStatus.BAD_REQUEST, JSON.stringify({ error: 'invalid transformation' }));
            return state;
        } else if (!module.exports.operations.canTransform(state, transformation)) {
            log.error('Unable to apply transformation:', transformation);
            Utils.sendMessage(res, HttpStatus.BAD_REQUEST, JSON.stringify({ error: 'invalid transformation' }));
            return state;
        }
        const result = module.exports.operations.transform(state, transformation);
        log.info('Successfully transformed state');
        log.debug('Transformed state from:', state, 'into:', result, 'using transformation:', transformation);
        Utils.sendMessage(res, HttpStatus.OK, JSON.stringify(result));
        return result;
    }
254177
def transformToNative(obj):
        
        if not obj.isNative:
            object.__setattr__(obj, '__class__', RecurringComponent)
            obj.isNative = True
        return obj
1111053
function _transform() {
	var codeIn = $('#codeIn').val();
	try {
		var codeOut = Streamline.transform(codeIn, {
			runtime: _generators ? "generators" : "callbacks",
		});
		$('#codeOut').val(codeOut);
		info("ready");
	} catch (ex) {
		console.error(ex);
		error(ex.message);
	}
}
495823
@SuppressWarnings("unchecked")
    public Object transform(final Object obj) {
        if (obj != null && !(obj instanceof BeanMap)) {
            Class clazz = obj.getClass();
            if (clazz.isArray()) {
                return _transform((Object[]) obj);
            } else if (obj instanceof Map) {
                return _transform((Map) obj);
            } else if (obj instanceof List) {
                return _transform((List) obj);
            } else if (obj instanceof Set) {
                return _transform((Set) obj);
            } else if (obj instanceof Collection) {
                return _transform((Collection) obj);
            } else if (obj instanceof Iterable) {
                return _transform((Iterable) obj);
            } else if (obj instanceof Iterator) {
                return _transform((Iterator) obj);
            } else if (needTransform(obj)) {
                return onTransform(obj);
            }
        }
        return obj;
    }
1209095
function _transformShape(canvas, ctx, params, width, height) {

	// Get conversion factor for radians
	params._toRad = (params.inDegrees ? (PI / 180) : 1);

	params._transformed = true;
	ctx.save();

	// Optionally measure (x, y) position from top-left corner
	if (!params.fromCenter && !params._centered && width !== undefined) {
		// Always draw from center unless otherwise specified
		if (height === undefined) {
			height = width;
		}
		params.x += width / 2;
		params.y += height / 2;
		params._centered = true;
	}
	// Optionally rotate shape
	if (params.rotate) {
		_rotateCanvas(ctx, params, null);
	}
	// Optionally scale shape
	if (params.scale !== 1 || params.scaleX !== 1 || params.scaleY !== 1) {
		_scaleCanvas(ctx, params, null);
	}
	// Optionally translate shape
	if (params.translate || params.translateX || params.translateY) {
		_translateCanvas(ctx, params, null);
	}

}
880411
function transformer(data) {
        var newData = {};
        var keys = Object.keys(data), length = keys.length, key, i;
        for ( i = 0; i < length; i++) {
          key = keys[i];
          newData[key] = data[key];
        }
        return newData;
      }
261017
function transformType (type) {
  if (Array.isArray(type)) {
    return transformArray(type)
  }

  if (typeof type === 'object') {
    return transformObject(type)
  }

  if (
    typeof type === 'function' &&
    (!type.prototype || type.name === '')
  ) {
    return type
  }

  return findType(type)
}
278685
function transformStyle(object) {
  if ((0, _has2.default)(object, 'style')) {
    object.style = (0, _transform2.default)((0, _split2.default)(object.style, ';'), (result, style) => {
      const firstColon = style.indexOf(':'),
            key = (0, _trim2.default)(style.substr(0, firstColon));

      if (key) {
        result[toJSXKey((0, _toLower2.default)(key))] = (0, _trim2.default)(style.substr(firstColon + 1));
      }
    }, {});
  }
}
356234
function transformRaw(input, options) {
  const transformStream = new TransformStream(options);
  pipe(input, transformStream.writable);
  return transformStream.readable;
}