This function calls the ``json_out`` function, if it was specified,
        otherwise continues with JSON conversion of the value in the slot by
        calling ``to_json_func`` on it.
481075
def to_json(self, propval, extraneous=False, to_json_func=None):
        
        if self.json_out:
            return self.json_out(propval)
        else:
            if not to_json_func:
                from normalize.record.json import to_json
                to_json_func = to_json
            return to_json_func(propval, extraneous)
536593
def json_or_jsonp(func):
    """"""
    @wraps(func)
    def _(*args, **kwargs):
        mimetype = 'application/javascript'
        callback = request.args.get('callback', None)
        if callback is None:
            content = func(*args, **kwargs)

        else:
            content = "%s(%s)" % (callback, func(*args, **kwargs))
        return current_app.response_class(content, mimetype=mimetype)
    return _
136496
def json_to_featureclass(json_file, out_fc):
    
    if arcpyFound == False:
        raise Exception("ArcPy is required to use this function")
    return arcpy.JSONToFeatures_conversion(in_json_file=json_file,
                                    out_features=out_fc)[0]
1326815
def render_as_json(func):
    
    if inspect.isclass(func):
        setattr(func, "_renderer", json_renderer)
        return func
    else:
        @functools.wraps(func)
        def decorated_view(*args, **kwargs):
            data = func(*args, **kwargs)
            return _build_response(data, jsonify)
        return decorated_view
477962
def call_receivers(self, client, clients_list, message):
        
        # Try to parse JSON
        try:
            json_message = json.loads(message)
        except ValueError:
            json_message = None

        for func, to_json in self.receivers:

            # Check if json version is available
            if to_json:
                if json_message is None:
                    continue
                msg = json_message
            else:
                msg = message

            # Call callback
            func(client, clients_list, msg)
504593
protected void jSONSuccess(PMStrutsContext ctx, Object object) throws PMForwardException {
        final String toJson = new Gson().toJson(object);
        ctx.put(PM_VOID_TEXT, toJson);
        success(ctx, "converters/void.jsp", false);
    }
1118554
def dump(obj, fp, **user_kwargs):
    
    return json.dump(obj, fp, **_encoder_kwargs(user_kwargs))
653881
def json_output(f):
    

    @wraps(f)
    def json_output_decorator(*args, **kwargs):
        @inject(config=Config)
        def get_config(config):
            return config

        config = get_config()

        rv = f(*args, **kwargs)
        indent = None
        if config.get('DEBUG', False):
            logging.getLogger(__name__).debug("Formatting JSON nicely.")
            indent = 2
        rv = json.dumps(rv, cls=AppModelJSONEncoder, indent=indent)
        _set_json_response_content_type()
        return rv

    return json_output_decorator
371845
private static boolean shouldRetry(JsonObject errorJson) {
        if (errorJson == null) return false;
        Integer code = errorJson.getInt(ERROR_FIELD_CODE);
        String msg = errorJson.getString(ERROR_FIELD_MSG);

        if (code == null || msg == null) return false;

        if (code == 4050 || code == 4070 ||
                (code == 5000 && msg.contains(ERROR_5000_SPECIFIC_MESSAGE))) {
            return true;
        }
        return false;
    }
1164560
function jsonStringifyWithFunctions (value) {
  function replacer (key, value) {
    if (typeof value === 'function') {
      // Stringify this function, and slightly minify it.
      value = String(value).replace(/\s+/g, ' ');
    }
    return options.jsonStringifyReplacer(key, value);
  }
  return JSON.stringify(value, replacer, options.jsonStringifySpaces);
}
1261475
function(json) {
      var decoder = AV.Op._opDecoderMap[json.__op];
      if (decoder) {
        return decoder(json);
      } else {
        return undefined;
      }
    }
670329
def json_wrap(function, *args, **kwargs):
    ''''''
    try:
        # Some responses have data = None, but they generally signal a
        # successful API call as well.
        response = json.loads(function(*args, **kwargs).content)
        if 'data' in response:
            return response['data'] or True
        else:
            return response
    except Exception as exc:
        raise ClientException(exc)
1328387
def to_json(self, *args, **kwargs):
        
        return json.dumps(self.serialized, *args, **kwargs)
129030
def put(self, json=None):
        
        return self._call('put', url=self.endpoint, json=json)
964248
function switchOutput(type, json) {
  if (type[0] === '.') type = type.slice(1);
  var result = '';

  switch (type) {
    case 'md':
      result = ''
        + '\n```json\n'
        + json
        + '\n```\n';
      break;
    case 'html':
      result = ''
        + '<div class="highlight highlight-json">\n'
        + '<pre><code>\n'
        + json
        + '</code></pre>'
        + '</div>';
      break;
    default: {
      result = json;
      break;
    }
  }
  return result;
}
716022
def maybe_print_as_json(opts, data, page_info=None):
    """"""
    if opts.output not in ("json", "pretty_json"):
        return False

    root = {"data": data}

    if page_info is not None and page_info.is_valid:
        meta = root["meta"] = {}
        meta["pagination"] = page_info.as_dict(num_results=len(data))

    if opts.output == "pretty_json":
        dump = json.dumps(root, indent=4, sort_keys=True)
    else:
        dump = json.dumps(root, sort_keys=True)

    click.echo(dump)
    return True
392117
def format_json(json_output)
        unless json_output.is_a?(String)
          json_engine = Rabl.configuration.json_engine
          json_output = if json_engine.respond_to?(:dump)
            json_engine.dump(json_output)
          else
            json_engine.encode(json_output)
          end
        end

        use_callback = Rabl.configuration.enable_json_callbacks && request_params[:callback].present?
        json_output = "#{request_params[:callback]}(#{json_output})" if use_callback

        json_output
      end