Parsers the given value as JSON if it is define
963162
function parsePreferencesJson(value, key) {
        var answer = null;
        if (angular.isDefined(value)) {
            answer = Core.parseJsonText(value, "localStorage for " + key);
        }
        return answer;
    }
893203
def to_json(self, value):
        
        if self._enable_enforce_type:
            value = self.enforce_type(value)
        return super(XMLString, self).to_json(value)
560386
function (str, parserOptions) {
  parserOptions = parserOptions || {};
  // Do a naive test whether this is a string or an object
  var mapFn = parserOptions.map ? str.trim().charAt(0) === '[' ? underscore.map : underscore.mapObject : identity;
  var jsonParser = JSON.parse;
  return mapFn(jsonParser(str, parserOptions.reviver, parserOptions.filename), parserOptions.map);
}
1073882
def get_prep_value(self, value):
        """"""
        try:
            return json.dumps(value, cls=DjangoJSONEncoder)
        except Exception as e:
            raise ValidationError(str(e))
871996
def _get_json(value):
    """"""
    if hasattr(value, 'replace'):
        value = value.replace('\n', ' ')
    try:
        return json.loads(value)
    except json.JSONDecodeError:
        # Escape double quotes.
        if hasattr(value, 'replace'):
            value = value.replace('"', '\\"')
        # try putting the value into a string
        return json.loads('"{}"'.format(value))
582792
def fromJSON(value):
        """"""
        if isinstance(value, str):
            value = json.loads(value)
        elif isinstance(value, dict): pass
        else:
            raise AttributeError("Invalid input")
        return Extension(typeName=value['typeName'],
                         capabilities=value['capabilities'],
                         enabled=value['enabled'] == "true",
                         maxUploadFileSize=value['maxUploadFileSize'],
                         allowedUploadFileType=value['allowedUploadFileTypes'],
                         properties=value['properties'])
1084612
function stringify(value) {
  "use strict";

  if (typeof value === 'function') {
    return value.toString();
  }
  return value !== undefined ? JSON.stringify(value) : "undefined";
}
1084673
function deserializeValue(value) {
  var num
  try {
    return value ?
      value == 'true' || value == true ||
      (value == 'false' || value == false ? false :
        value == 'null' ? null :
        !/^0/.test(value) && !isNaN(num = Number(value)) ? num :
        /^[\[\{]/.test(value) ? JSON.parse(value) :
        value)
      : value
  } catch (e) {
    return value
  }
}
3708
def encode(cls, value):
        
        try:
            coerced = list(value)
            if coerced == value:
                return json.dumps(coerced).encode(cls._encoding)
        except TypeError:
            pass

        raise InvalidValue('not a list')
1024416
def process_result_value(self, value, dialect):
        """"""
        if value is not None:
            value = simplejson.loads(value)
        return value
898014
def _decode(cls, value):
        """"""

        value = cls._DEC_RE.sub(lambda x: '%c' % int(x.group(1), 16), value)
        return json.loads(value)
590079
def _parse_value(value):
    ''''''
    if isinstance(value, bool):
        return 'true' if value else 'false'
    elif isinstance(value, six.string_types):
        # parse compacted notation to dict
        listparser = re.compile(r'''((?:[^,"']|"[^"]*"|'[^']*')+)''')

        value = value.strip()
        if value.startswith('[') and value.endswith(']'):
            return listparser.split(value[1:-1])[1::2]
        elif value.startswith('(') and value.endswith(')'):
            rval = {}
            for pair in listparser.split(value[1:-1])[1::2]:
                pair = pair.split('=')
                if '"' in pair[1]:
                    pair[1] = pair[1].replace('"', '')
                if pair[1].isdigit():
                    rval[pair[0]] = int(pair[1])
                elif pair[1] == 'true':
                    rval[pair[0]] = True
                elif pair[1] == 'false':
                    rval[pair[0]] = False
                else:
                    rval[pair[0]] = pair[1]
            return rval
        else:
            if '"' in value:
                value = value.replace('"', '')
            if value.isdigit():
                return int(value)
            elif value == 'true':
                return True
            elif value == 'false':
                return False
            else:
                return value
    else:
        return value
289828
function ( value ) {
		var tmp;

		if ( value === null || value === undefined ) {
			return undefined;
		}
		else if ( value === "true" ) {
			return true;
		}
		else if ( value === "false" ) {
			return false;
		}
		else if ( value === "null" ) {
			return null;
		}
		else if ( value === "undefined" ) {
			return undefined;
		}
		else if ( value === "" ) {
			return value;
		}
		else if ( !isNaN( tmp = Number( value ) ) ) {
			return tmp;
		}
		else if ( regex.json_wrap.test( value ) ) {
			return json.decode( value, true ) || value;
		}
		else {
			return value;
		}
	}
837228
def set_json(self, value: object):
        '''
        
        '''
        self.set_content(modjson.dumps(value, cls=ExtendedJSONEncoder),
                         content_type='application/json')
496892
def process_bind_param(self, value, dialect):
        """"""
        if value is not None:
            value = simplejson.dumps(value)
        return value
676925
def get_prep_value(self, value):
        """"""

        if value == "":
            return None

        if isinstance(value, dict):
            value = json.dumps(value, cls=DjangoJSONEncoder)

        return value
785494
function(value) {
		if ([
			['%5B', '%5D'],
			['%7B', '%7D']
		].some(function isencoded(tokens) {
			return value.startsWith(tokens[0]) && value.endsWith(tokens[1]);
		})) {
			try {
				value = JSON.parse(decodeURIComponent(value));
			} catch (exception) {
				value = null;
				console.error(this + ': Bad JSON: ' + exception.message);
			}
		}
		return value;
	}