{'type': 'string'}
778483
def _validate_regex(self, pattern, field, value):
        
        if not isinstance(value, _str_type):
            return
        if not pattern.endswith('$'):
            pattern += '$'
        re_obj = re.compile(pattern)
        if not re_obj.match(value):
            self._error(field, errors.REGEX_MISMATCH)
208008
def get_type(obj, **kwargs):
    """"""
    t = type(obj)

    s = extract_type(str(t))

    return 'Type: {}'.format(s)
1229872
function(str, varName, varValue){
    if(str === varName) return varValue;
    var strType = typeof varValue === "string", ln = str.length;
    var patt = (strType || (str.indexOf('{{') !== 0 || str.indexOf('}}') !== (ln-2))) ? varName : '"'+varName+'"';
    var rValue = strType ? varValue : JSON.stringify(varValue);
    return str.replace(patt,function(){ return rValue; });
  }
874515
def jsontype(self, name, path=Path.rootPath()):
        
        return self.execute_command('JSON.TYPE', name, str_path(path))
179381
private void validateString(Type type) throws SerializerException {
        if (null == type || !String.class.equals(TypeToken.of(type).getRawType())) {
            throw new SerializerException("String serializer is able to work only with data types assignable from java.lang.String");
        }
    }
765921
def spl_json(self):
        """"""
        _splj = {}
        _splj["type"] = self._type
        _splj["value"] = self._value
        return _splj
153278
def str_dict(some_dict):
    """"""
    return {str(k): str(v) for k, v in some_dict.items()}
618560
function(object) {
    if (!this.stringify) return JSON.stringify(object);

    return this.stringify(object, function(key, value) {
      return (this[key] instanceof Array) ? this[key] : value;
    });
  }
1252305
function getType(variable) {
        var types = {
            'undefined': 'undefined',
            'number': 'number',
            'boolean': 'boolean',
            'string': 'string',
            '[object Function]': 'function',
            '[object RegExp]': 'regexp',
            '[object Array]': 'array',
            '[object Date]': 'date',
            '[object Error]': 'error'
        };

        return types[typeof variable === 'undefined' ? 'undefined' : _typeof(variable)] || types[{}.toString.call(variable)] || (variable ? 'object' : 'null');
    }
172967
function type (response) {
  return value => {
    if (!(value instanceof Error)) {
      response.setHeader(
        'Content-Type',
        lookup(typeof value === 'object' ? 'json' : 'text')
      )
    }
    return value instanceof Array ? JSON.stringify(value) : value
  }
}
901863
def _api_type(self, value):
        
        if isinstance(value, six.string_types):
            return 'string'
        elif isinstance(value, six.integer_types):
            return 'integer'
        elif type(value) is datetime.datetime:
            return 'date'
1346535
function jsonit(data, type, setType) {
    if ('string' !== typeof data) {
      throw new JsonItError('Invalid JsonIt type: ' + typeof data)
    }
    var result = {}
    if (data.length > 0) {
      try {
        var colonPos = data.indexOf(':')
        var commaPos = data.indexOf(',')
        if (colonPos < 0 || (commaPos >= 0 && commaPos < colonPos)) {
          if (setType) defaultType = setType
          type = type || defaultType
          data = type + ':' + data
        }
        result = jsonic(data)
      } catch(err) {
        throw new JsonItError(err.message)
      }
    }
    return result
  }
724771
function (instance, instanceKey, type, json, jsonKey) {
    try {
        instance[instanceKey] = json[jsonKey];
        return [];
    }
    catch (e) {
        // tslint:disable-next-line:no-string-literal
        throw new JsonConverstionError("Property '" + instanceKey + "' of " + instance.constructor['name'] + " does not match datatype of " + jsonKey, json);
    }
}
633145
def construct_from_string(cls, string):
        
        if string == cls.name:
            return cls()
        raise TypeError("Cannot construct a '{}' from "
                        "'{}'".format(cls, string))
1082790
function toJSON(d) {
    if (!_.isString(d)) {
        d = JSON.stringify(d);
    }

    return d;
}
263885
def _jsTypeof(o):
    ''''''
    if o == None:
        return 'object'
    elif o == Undefined:
        return 'undefined'
    elif isinstance(o, bool):
        return 'boolean'
    if isinstance(o, int) or isinstance(o, float):
        return 'number'
    elif isinstance(o, list) or isinstance(o, dict):
        return 'object'
    elif isinstance(o, stringtype):
        return 'string'
    raise ValueError('Unknown type for object %s (%s)' % (o, type(o)))
740678
def serialize_json_string(self, value):
        

        # Check if the value might be a json string
        if not isinstance(value, six.string_types):
            return value

        # Make sure it starts with a brace
        if not value.startswith('{') or value.startswith('['):
            return value

        # Try to load the string
        try:
            return json.loads(value)
        except:
            return value