Transform a sassValue into a structured value based on the value type
503994
function makeValue(sassValue) {
  switch(sassValue.constructor) {
    case sass.types.String:
    case sass.types.Boolean:
      return { value: sassValue.getValue() };

    case sass.types.Number:
      return { value: sassValue.getValue(), unit: sassValue.getUnit() };

    case sass.types.Color:
      const r = Math.round(sassValue.getR());
      const g = Math.round(sassValue.getG());
      const b = Math.round(sassValue.getB());

      return {
        value: {
          r, g, b,
          a: sassValue.getA(),
          hex: `#${toColorHex(r)}${toColorHex(g)}${toColorHex(b)}`
        },
      };

    case sass.types.Null:
      return { value: null };

    case sass.types.List:
      const listLength = sassValue.getLength();
      const listValue = [];
      for(let i = 0; i < listLength; i++) {
        listValue.push(createStructuredValue(sassValue.getValue(i)));
      }
      return { value: listValue, separator: sassValue.getSeparator() ? ',' : ' ' };

    case sass.types.Map:
      const mapLength = sassValue.getLength();
      const mapValue = {};
      for(let i = 0; i < mapLength; i++) {
        // Serialize map keys of arbitrary type for extracted struct
        const serializedKey = serialize(sassValue.getKey(i));
        mapValue[serializedKey] = createStructuredValue(sassValue.getValue(i));
      }
      return { value: mapValue };

    default:
      throw new Error(`Unsupported sass variable type '${sassValue.constructor.name}'`)
  };
}
677086
function(node, propertyType) {
			var context = this,
				children = [],
				out = [],
				child,
				x,
				i;

			children = modules.domUtils.getChildren( node );

			x = 0;
			i = children.length;
			while(x < i) {
				child = children[x];
				var value = null;
				if(modules.domUtils.hasAttributeValue(child, 'class', 'value')) {
					switch(propertyType) {
					case 'p':
						value = context.getPValue(child, false);
						break;
					case 'u':
						value = context.getUValue(child, false);
						break;
					case 'dt':
						value = context.getDTValue(child, '', null, false);
						break;
					}
					if(value) {
						out.push(modules.utils.trim(value));
					}
				}
				x++;
			}
			if(out.length > 0) {
				if(propertyType === 'p') {
					return modules.text.parseText( this.document, out.join(''), this.options.textFormat);
				}
				if(propertyType === 'u') {
					return out.join('');
				}
				if(propertyType === 'dt') {
					var format = 'microformat2';
					return modules.dates.concatFragments(out,format).toString(format);
				}
			} else {
				return null;
			}
		}
1189386
function(value) {
      var parts = [];
      for (var key in value) {
        parts.push(convertStylePropertyName(key) + ': ' + value[key]);
      }
      return parts.join('; ');
    }
463521
function(done) {
    var isSync = (typeof done !== 'function');
    var sass = require('node-sass');
    var opts = this.sassCSSOptions();

    if (isSync) {
      try {
        return sass.renderSync(opts).css.toString();
      } catch (err) {
        throw formatSassError(err, opts.data);
      }
    }

    sass.render(opts, function(err, result) {
      if (err) return done(formatSassError(err, opts.data));
      done(null, result.css.toString());
    });
  }
126737
def wrap_value(self, value):
        ''' '''
        try:
            return self.item_type.wrap_value(value)
        except BadValueException:
            pass
        try:
            return self.wrap(value)
        except BadValueException:
            pass
        self._fail_validation(value, 'Could not wrap value as the correct type.  Tried %s and %s' % (self.item_type, self))
435892
def css_to_func(css, flags, css_namespaces, lang):
    """"""
    from cssselect import parse, HTMLTranslator
    from cssselect.parser import FunctionalPseudoElement
    #  FIXME HACK need lessc to support functional-pseudo-selectors instead
    #  of marking as strings and stripping " here.
    if not (css):
        return None

    sel = parse(css.strip('" '))[0]
    xpath = HTMLTranslator().selector_to_xpath(sel)

    first_letter = False
    if sel.pseudo_element is not None:
        if type(sel.pseudo_element) == FunctionalPseudoElement:
            if sel.pseudo_element.name in ('attr', 'first-letter'):
                xpath += '/@' + sel.pseudo_element.arguments[0].value
                if sel.pseudo_element.name == 'first-letter':
                    first_letter = True
        elif isinstance(sel.pseudo_element, type(u'')):
            if sel.pseudo_element == 'first-letter':
                first_letter = True

    xp = etree.XPath(xpath, namespaces=css_namespaces)

    def toupper(u):
        """Use icu library for locale sensitive uppercasing (python2)."""
        loc = Locale(lang) if lang else Locale()
        return UnicodeString(u).toUpper(loc).encode('utf-8').decode('utf-8')

    def func(elem):
        res = xp(elem)
        if res:
            if etree.iselement(res[0]):
                res_str = etree.tostring(res[0], encoding='unicode',
                                         method="text")
            else:
                res_str = res[0]
            if first_letter:
                if res_str:
                    if flags and 'nocase' in flags:
                        return toupper(res_str[0])
                    else:
                        return res_str[0]
                else:
                    return res_str
            else:
                if flags and 'nocase' in flags:
                    return toupper(res_str)
                else:
                    return res_str

    return func
392122
function resolveStyleValue(cssProperty, value) {
    if (typeof value === "number") {
        return isUnitlessProperty[cssProperty] || value === 0 ?
            ("" + value) :
            (value + "px");
    } else {
        return value ? ("" + value) : "";
    }
}
926254
def render_value(value):
    """"""
    if isinstance(value, list):
        return '[' + ', '.join(render_value(v) for v in value) + ']'
    elif isinstance(value, dict):
        return (
            '{' +
            ', '.join('{k!r}: {v}'.format(
                k=k, v=render_value(v)) for k, v in sorted(value.items())) +
            '}')
    else:
        return repr(value)
1120928
def value_needs_parens?
      return false if custom_property?

      root = value.first
      root.is_a?(Sass::Script::Tree::Operation) &&
        root.operator == :div &&
        root.operand1.is_a?(Sass::Script::Tree::Literal) &&
        root.operand1.value.is_a?(Sass::Script::Value::Number) &&
        root.operand1.value.original.nil? &&
        root.operand2.is_a?(Sass::Script::Tree::Literal) &&
        root.operand2.value.is_a?(Sass::Script::Value::Number) &&
        root.operand2.value.original.nil?
    end
975801
function setValueForStyles(node, styles, getStack) {
  const style = node.style;
  for (let styleName in styles) {
    if (!styles.hasOwnProperty(styleName)) {
      continue;
    }
    const isCustomProperty = styleName.indexOf('--') === 0;
    if (process.env.NODE_ENV !== 'production') {
      if (!isCustomProperty) {
        warnValidStyle(styleName, styles[styleName], getStack);
      }
    }
    const styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
    if (styleName === 'float') {
      styleName = 'cssFloat';
    }
    if (isCustomProperty) {
      const name = isCustomProperty ? styleName : hyphenateStyleName(styleName);
      style.setProperty(name, styleValue);
    } else {
      style[styleName] = styleValue;
    }
  }
}
21833
function (type, element, propertyValue) {
                    if (IE <= 8) {
                        switch (type) {
                            case "name":
                                return "filter";
                            case "extract":
                                /* <=IE8 return a "filter" value of "alpha(opacity=\d{1,3})".
                                   Extract the value and convert it to a decimal value to match the standard CSS opacity property's formatting. */
                                var extracted = propertyValue.toString().match(/alpha\(opacity=(.*)\)/i);

                                if (extracted) {
                                    /* Convert to decimal value. */
                                    propertyValue = extracted[1] / 100;
                                } else {
                                    /* When extracting opacity, default to 1 since a null value means opacity hasn't been set. */
                                    propertyValue = 1;
                                }

                                return propertyValue;
                            case "inject":
                                /* Opacified elements are required to have their zoom property set to a non-zero value. */
                                element.style.zoom = 1;

                                /* Setting the filter property on elements with certain font property combinations can result in a
                                   highly unappealing ultra-bolding effect. There's no way to remedy this throughout a tween, but dropping the
                                   value altogether (when opacity hits 1) at leasts ensures that the glitch is gone post-tweening. */
                                if (parseFloat(propertyValue) >= 1) {
                                    return "";
                                } else {
                                  /* As per the filter property's spec, convert the decimal value to a whole number and wrap the value. */
                                  return "alpha(opacity=" + parseInt(parseFloat(propertyValue) * 100, 10) + ")";
                                }
                        }
                    /* With all other browsers, normalization is not required; return the same values that were passed in. */
                    } else {
                        switch (type) {
                            case "name":
                                return "opacity";
                            case "extract":
                                return propertyValue;
                            case "inject":
                                return propertyValue;
                        }
                    }
                }
703448
def var?(literal)
      literal.is_a?(Sass::Script::Value::String) && literal.value =~ /var\(/
    end
219578
private String formatDefaultValue(Object value) {
    if (value instanceof Boolean) {
      return ((Boolean) value) ? "true" : "false";
    }

    if (value instanceof Number) {
      return value.toString();
    }

    if (value instanceof Collection) {
      return formatCollectionValue((Collection) value);
    }

    String string = value.toString();

    if (string.startsWith("$")) {
      return string;
    }

    return SassString.escape(string);
  }
1020716
function compileSass(sassPaths, cb) {

        if (sassPaths.length > 0) {

            var path = pathModule.join(base, sassPaths.shift());

            sass.render({
              file: path,
              includePaths: options.includePaths || []
            },
            function(err, result) {
                if (err) {
                    cb(FOUND_ERROR, 'Error while compiling sass template "' + path + '". Error from "node-sass" plugin: ' + err);
                }

                if (options.autoprefixer) {
                  // Call autoprefixer on current built css
                  postcss([ autoprefixer(options.autoprefixer) ])
                    .process(result.css)
                    .then(function(prefixedResult) {
                      // escape any backticks that comeup in the compiled css
                      cb(FOUND_SUCCESS, prefixedResult.css.toString().replace(/\\([\s\S])|(`)/g,"\\$1$2"), sassPaths);
                    });
                } else {
                  // escape any backticks that comeup in the compiled css
                  cb(FOUND_SUCCESS, result.css.toString().replace(/\\([\s\S])|(`)/g,"\\$1$2"), sassPaths);
                }
            });
        }
        else {
            cb(CODE_EXIT);
        }
    }
325490
function parseValueToColor ( value ) {
	const resolvedColorValue = parseColor(value).rgba;
	return new types.Color(resolvedColorValue[0], resolvedColorValue[1], resolvedColorValue[2], resolvedColorValue[3]);
}
1267692
function convertRawBoolean(rawColumnValue, column, context)
{
  var ret;

  if ((rawColumnValue === '1') || (rawColumnValue === 'TRUE'))
  {
    ret = true;
  }
  else if ((rawColumnValue === '0') || (rawColumnValue === 'FALSE'))
  {
    ret = false;
  }

  return ret;
}
353069
def cast(self, value, custom_formatters=None, strict=True):
        """"""
        if value is None:
            if not self.nullable:
                raise InvalidSchemaValue("Null value for non-nullable schema", value, self.type)
            return self.default

        cast_mapping = self.get_cast_mapping(
            custom_formatters=custom_formatters, strict=strict)

        if self.type is not SchemaType.STRING and value == '':
            return None

        cast_callable = cast_mapping[self.type]
        try:
            return cast_callable(value)
        except ValueError:
            raise InvalidSchemaValue(
                "Failed to cast value {value} to type {type}", value, self.type)