transform field for displaying
770328
def _transform_field(field):
    """"""
    if isinstance(field, bool):
        return TRUE if field else FALSE
    elif isinstance(field, (list, dict)):
        return json.dumps(field, sort_keys=True, ensure_ascii=False)
    else:
        return field
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
1294409
function transform(dataView, options = {}) {
  const map = options.map || {};
  const cleanMap = {};
  if (isPlainObject(map)) {
    forIn(map, (value, key) => {
      if (isString(value) && isString(key)) {
        cleanMap[key] = value;
      }
    });
  }
  dataView.rows.forEach(row => {
    forIn(map, (newKey, key) => {
      const temp = row[key];
      delete row[key];
      row[newKey] = temp;
    });
  });
}
613892
def field(display, pattern, opts = {}, &block)
      actions << lambda {
        action_for(:field, {display: display, pattern: pattern}, opts, &block)
      }
    end
356234
function transformRaw(input, options) {
  const transformStream = new TransformStream(options);
  pipe(input, transformStream.writable);
  return transformStream.readable;
}
860603
def format_field(self, value, format_spec):
        """"""
        if isinstance(value, MissingField):
            if format_spec is not None:
                value.format_spec = format_spec
            return str(value)

        return super(FormatterWrapper, self).format_field(value, format_spec)
642254
function renderAmazonField() {
		$this->renderField(
			[
				'id' => 'amazon',
				'name' => $this->getSlug(),
				'option' => 'amazon',
				'value' => ( isset( $this->options['amazon'] ) ) ? $this->options['amazon'] : '',
				'type' => 'url',
				'class' => 'regular-text code',
			]
		);
	}
741144
def Field(self, field, Value = None):
        '''
        
        '''
        if Value == None:
            try:
                return self.__Bitmap[field]
            except KeyError:
                return None
        elif Value == 1 or Value == 0:
            self.__Bitmap[field] = Value
        else:
            raise ValueError
172545
def format_field(self, value: Any, spec: str) -> str:
        """"""
        from cirq import ops  # HACK: avoids cyclic dependency.
        if isinstance(value, (float, int)):
            if isinstance(value, float):
                value = round(value, self.precision)
            if spec == 'half_turns':
                value = 'pi*{}'.format(value) if value != 0 else '0'
                spec = ''
        elif isinstance(value, ops.Qid):
            value = self.qubit_id_map[value]
        elif isinstance(value, str) and spec == 'meas':
            value = self.meas_key_id_map[value]
            spec = ''
        return super().format_field(value, spec)
647367
public function renderField()
    {
        list($name, $id) = $this->resolveNameID();

        echo CHtml::openTag($this->tagName, array('id' => 'wrapper-' . $id));

        if ($this->hasModel()) {
            echo CHtml::activeCheckBox($this->model, $this->attribute, $this->htmlOptions);
        } else {
            echo CHtml::checkBox($name, $this->value, $this->htmlOptions);
        }

        echo CHtml::closeTag($this->tagName);
    }
444827
public static void displayTransform( InterleavedF32 transform , String name ) {

		// declare storage
		GrayF32 magnitude = new GrayF32(transform.width,transform.height);
		GrayF32 phase = new GrayF32(transform.width,transform.height);

		// Make a copy so that you don't modify the input
		transform = transform.clone();

		// shift the zero-frequency into the image center, as is standard in image processing
		DiscreteFourierTransformOps.shiftZeroFrequency(transform,true);

		// Compute the transform's magnitude and phase
		DiscreteFourierTransformOps.magnitude(transform,magnitude);
		DiscreteFourierTransformOps.phase(transform, phase);

		// Convert it to a log scale for visibility
		PixelMath.log(magnitude,magnitude);

		// Display the results
		BufferedImage visualMag = VisualizeImageData.grayMagnitude(magnitude, null, -1);
		BufferedImage visualPhase = VisualizeImageData.colorizeSign(phase, null, Math.PI);

		ImageGridPanel dual = new ImageGridPanel(1,2,visualMag,visualPhase);
		ShowImages.showWindow(dual,"Magnitude and Phase of "+name);
	}
143309
function TransformTo(element_from, element_to, duration = 500, easing = Animation.easing.linear, HIDE_OTHER) {
    let rect = element_from.getBoundingClientRect();
    let cs = window.getComputedStyle(element_from, null);
    let margin_left = parseFloat(cs.getPropertyValue("margin"));

    let seq = Animation.createSequence({
        obj: element_from,
        width: { value: "0px"},
        height: { value: "0px"},
        backgroundColor: { value: "rgb(1,1,1)"},
        left: [{value:rect.left+"px"},{ value: "0px"}],
        top: [{value:rect.top+"px"},{ value: "0px"}]
    });

    if (!element_to) {

        let a = (seq) => (element_to, duration = 500, easing = Animation.easing.linear,  HIDE_OTHER = false) => {
            setTo(element_to, seq, duration, easing);
            seq.duration = duration;
            return seq;
        };

        return a(seq);
    }

    setTo(element_to, duration, easing);
    seq.duration = duration;
    return seq;
}
403271
function renderOtherServiceField() {
		$this->renderField(
			[
				'id' => 'otherservice',
				'name' => $this->getSlug(),
				'option' => 'otherservice',
				'value' => ( isset( $this->options['otherservice'] ) ) ? $this->options['otherservice'] : '',
				'type' => 'url',
				'class' => 'regular-text code',
			]
		);
	}
1310894
@Override
	protected void transform(XtendField source, JvmGenericType container) {
		super.transform(source, container);
		// Override the visibility
		final JvmField field = (JvmField) this.sarlAssociations.getPrimaryJvmElement(source);
		setVisibility(field, source);

		final GenerationContext context = getContext(container);
		if (context != null) {
			final String name = source.getName();
			if (!Strings.isNullOrEmpty(name)) {
				context.incrementSerial(name.hashCode());
			}
			final JvmTypeReference type = source.getType();
			if (type != null) {
				context.incrementSerial(type.getIdentifier().hashCode());
			}
		}
	}
1119568
function () {
        // Rect before any transform
        var rawRect = this.getBoundingRect();
        var cx = rawRect.x + rawRect.width / 2;
        var cy = rawRect.y + rawRect.height / 2;

        return [cx, cy];
    }
1253437
function renderBarnesAndNobleField() {
		$this->renderField(
			[
				'id' => 'barnesandnoble',
				'name' => $this->getSlug(),
				'option' => 'barnesandnoble',
				'value' => ( isset( $this->options['barnesandnoble'] ) ) ? $this->options['barnesandnoble'] : '',
				'type' => 'url',
				'class' => 'regular-text code',
			]
		);
	}
688987
def _field_value_html(self, field):
        """"""
        if field in self.fields:
            return unicode(self.get(field))
        else:
            return self.get_timemachine_instance(field)._object_name_html()