_formatSendBody
@param {*} _body the body to be formatted
@return {*} the body formatted
965964
function(_body) {
    if(undefined === _body || null === _body) {
        return null;
    }

    if(_body instanceof Date || _body instanceof Error) {
        return _body;
    }

    if(util.isArray(_body)) {
        return _body.map(function(body) {
            return _formatSendBody(body);
        });
    }

    if(typeof _body === "object") {
        var res = {};
        for(var key in _body) {
            if(!_body.hasOwnProperty(key)) continue;
            res[key] = _formatSendBody(_body[key]);
        }
        return res;
    }

    if(typeof _body === "number" &&
       (isNaN(_body) || !isFinite(_body))) return null;
    return _body;
}
847754
function getBodyAsBuffer(body, encoding) {
  return body instanceof Buffer
    ? body
    : Buffer.from(`${body || ''}`, normalizeBodyEncoding(encoding));
}
943092
function format (obj, sub) {
    var x = utils.clone(obj);
    if (x) {
        if ('Binary' === x.constructor.name) {
            x = '[object Buffer]';
        } else if ('ObjectID' === x.constructor.name) {
            var representation = 'ObjectId("' + x.toHexString() + '")';
            x = { inspect: function() { return representation; } };
        } else if ('Date' === x.constructor.name) {
            var representation = 'new Date("' + x.toUTCString() + '")';
            x = { inspect: function() { return representation; } };
        } else if ('Object' === x.constructor.name) {
            var keys = Object.keys(x)
                , i = keys.length
                , key
            while (i--) {
                key = keys[i];
                if (x[key]) {
                    if ('Binary' === x[key].constructor.name) {
                        x[key] = '[object Buffer]';
                    } else if ('Object' === x[key].constructor.name) {
                        x[key] = format(x[key], true);
                    } else if ('ObjectID' === x[key].constructor.name) {
                        ;(function(x){
                            var representation = 'ObjectId("' + x[key].toHexString() + '")';
                            x[key] = { inspect: function() { return representation; } };
                        })(x)
                    } else if ('Date' === x[key].constructor.name) {
                        ;(function(x){
                            var representation = 'new Date("' + x[key].toUTCString() + '")';
                            x[key] = { inspect: function() { return representation; } };
                        })(x)
                    } else if (Array.isArray(x[key])) {
                        x[key] = x[key].map(function (o) {
                            return format(o, true)
                        });
                    }
                }
            }
        }
        if (sub) return x;
    }

    return require('util')
        .inspect(x, false, 10, true)
        .replace(/\n/g, '')
        .replace(/\s{2,}/g, ' ')
}
366780
function parseBody(req) {
    return extractBody(req)
        .then(() => {
            if (req.body && typeof req.body === 'object') return req.body;
            try {
                return JSON.parse(req.body);
            } catch (err) {
                throw Error('Unexpected body format received. Expected application/json, received: ' + req.body);
            }
        });
}
363589
function generateDebugBody( body ) {

		var frameUnit           = 2;// In pixels
		var debugBody           = Crafty.e( RenderingMode );
        var debugBodyBody       = Crafty.e( RenderingMode + ', Color' );
        var debugBodyTopFrame   = Crafty.e( RenderingMode + ', Color' );
		var debugBodyRightFrame = Crafty.e( RenderingMode + ', Color' );
        var debugBodyDownFrame  = Crafty.e( RenderingMode + ', Color' );
        var debugBodyLeftFrame  = Crafty.e( RenderingMode + ', Color' );

		debugBody.attach( debugBodyBody );
		debugBody.attach( debugBodyTopFrame );
		debugBody.attach( debugBodyRightFrame );
		debugBody.attach( debugBodyDownFrame );
		debugBody.attach( debugBodyLeftFrame );

		// TODO cleaner code.
		var attr = {
			x: body.vertices[ 0 ].x,
			y: body.vertices[ 0 ].y,
			w: body.vertices[ 0 ].x,
			h: body.vertices[ 0 ].y
		};

		//We iterate to have a square shape for circles and polygons/
		for ( var i = 1; i < body.vertices.length; i++ ) {
			if ( body.vertices[ i ].x < attr.x ) {
				attr.x = body.vertices[ i ].x;
			}

			if ( body.vertices[ i ].y < attr.y ) {
				attr.y = body.vertices[ i ].y;
			}

			if ( body.vertices[ i ].x > attr.w ) {
				attr.w = body.vertices[ i ].x;
			}

			if ( body.vertices[ i ].y > attr.h ) {
				attr.h = body.vertices[ i ].y;
			}
		}

		debugBody.attr( {
			x: attr.x,
			y: attr.y,
			w: Math.abs( attr.w - attr.x ),
			h: Math.abs( attr.h - attr.y )
		} );

		debugBody.origin( 'center' );

		debugBodyBody.color( 'blue' );
		debugBodyBody.alpha = 0.5;
		debugBodyBody.z = debugBody._z + 1;
		debugBodyBody.origin( 'center' );

		debugBodyTopFrame.color( 'blue' );
		debugBodyTopFrame.h = frameUnit;
		debugBodyTopFrame.z = debugBody._z + 1;
		debugBodyTopFrame.origin( 'center' );

		debugBodyRightFrame.color( 'blue' );
		debugBodyRightFrame.x = debugBodyBody._x + ( debugBodyBody._w - frameUnit );
		debugBodyRightFrame.w = frameUnit;
		debugBodyRightFrame.z = debugBody._z + 1;
		debugBodyRightFrame.origin( 'center' );

		debugBodyDownFrame.color( 'blue' );
		debugBodyDownFrame.y = debugBodyBody._y + ( debugBodyBody._h - frameUnit );
		debugBodyDownFrame.h = frameUnit;
		debugBodyDownFrame.z = debugBody._z + 1;
		debugBodyDownFrame.origin( 'center' );

		debugBodyLeftFrame.color( 'blue' );
		debugBodyLeftFrame.w = frameUnit;
		debugBodyLeftFrame.z = debugBody._z + 1;
		debugBodyLeftFrame.origin( 'center' );

		return debugBody;
	}
520831
function jsonBodyParser(options) {
    assert.optionalObject(options, 'options');
    var opts = options || {};

    var override = opts.overrideParams;

    function parseJson(req, res, next) {
        // save original body on req.rawBody and req._body
        req.rawBody = req._body = req.body;

        if (req.getContentType() !== 'application/json' || !req.body) {
            return next();
        }

        var params;

        try {
            params = JSON.parse(req.body, opts.reviver);
        } catch (e) {
            return next(new errors.InvalidContentError('Invalid JSON: ' +
                e.message));
        }

        if (opts.mapParams === true) {
            if (Array.isArray(params)) {
                // if req.params exists, we have url params. we can't map an
                // array safely onto req.params, throw an error.
                if (req.params &&
                    Object.keys(req.params).length > 0 &&
                    !(req.params instanceof Array)) {
                    return next(new errors.InternalServerError(
                        'Cannot map POST body of [Array array] onto req.params'
                    ));
                }
                req.params = params;
            } else if (typeof (params) === 'object' && params !== null) {
                // else, try to merge the objects
                Object.keys(params).forEach(function (k) {
                    var p = req.params[k];

                    if (p && !override) {
                        return;
                    }
                    req.params[k] = params[k];
                });
            } else {
                // otherwise, do a wholesale stomp, no need to merge one by one.
                req.params = params || req.params;
            }
        }

        req.body = params;

        return next();
    }

    var chain = [];

    if (!opts.bodyReader) {
        chain.push(bodyReader(opts));
    }
    chain.push(parseJson);
    return chain;
}
1088473
def build_body(self):
        '''
        
        '''
        _increase_indent()
        body_array = [x.build() for x in self.iterable]

        nl = '\n' if self.append_extra_newline else ''

        if len(self.iterable) >= 1:
            body = self.join_body_on.join(body_array) + nl
        else:
            body = ''

        _decrease_indent()
        return body
1361672
function isValidBody(body) {
  return (
    body === undefined ||
    typeof body === 'string' ||
    (typeof FormData !== 'undefined' && body instanceof FormData) ||
    (typeof URLSearchParams !== 'undefined' && body instanceof URLSearchParams)
  );
}
212128
def parse_body(body)
      format = determine_format(@options[:parse])
      case format
      when :json
        unless ::Boson::Util.safe_require 'json'
          return puts("Install the json gem to parse json: sudo gem install json")
        end
        JSON.parse body
      when :yaml
        YAML::load body
      else
        puts "Can't parse this format."
      end
    rescue
      @options[:raise_error] ? raise : puts("Error while parsing #{format} response of '#{@url}': #{$!.class}")
    end
119310
function bodyParser (options) {
  var opts = {}

  // exclude type option
  if (options) {
    for (var prop in options) {
      if (prop !== 'type') {
        opts[prop] = options[prop]
      }
    }
  }

  var _urlencoded = exports.urlencoded(opts)
  var _json = exports.json(opts)

  return function bodyParser (req, res, next) {
    _json(req, res, function (err) {
      if (err) return next(err)
      _urlencoded(req, res, next)
    })
  }
}
253081
function respond () {
  let res = this.res
  let body = this.body
  let code = this.status

  if (this.respond === false) return endContext(this)
  if (res.headersSent || this._finished != null) return

  this.set('server', 'Toa/' + Toa.VERSION)
  if (this.config.poweredBy) this.set('x-powered-by', this.config.poweredBy)
  // ignore body
  if (statuses.empty[code]) {
    // strip headers
    this.body = null
    res.end()
  } else if (this.method === 'HEAD') {
    if (isJSON(body)) this.length = Buffer.byteLength(JSON.stringify(body))
    res.end()
  } else if (body == null) {
    // status body
    this.type = 'text'
    body = this.message || String(code)
    this.length = Buffer.byteLength(body)
    res.end(body)
  } else if (typeof body === 'string' || Buffer.isBuffer(body)) {
    res.end(body)
  } else if (body instanceof Stream) {
    body.pipe(res)
    // to ensure `res.headersSent === true` before `context.emit("end")`
    // if "error" occured before "data", it will goto `onResError(this, error)`
    body.once('data', () => endContext(this))
    return
  } else {
    // body: json
    body = JSON.stringify(body)
    this.length = Buffer.byteLength(body)
    res.end(body)
  }
  endContext(this)
}
830925
function requestBody(request, onEnd) {
    var fullBody = '';
    request.on('data', function(d) {
        fullBody += d.toString();
    });
    request.on('end', function() {
        onEnd(querystring.parse(fullBody));
    });
}
1089728
function formatResponse(data) {
            delete object.mail[0].options;
            // Sendmail returns extra details we don't need and that don't convert to JSON
            delete object.mail[0].message.transport;
            object.mail[0].status = {
                message: data.message
            };

            return object;
        }
1310893
function format(node) {
  var ret = node.children.map(function (child) {
    var val = stringify(child)
    val = val.replace(/\"function\s*\(\)\s*{\s*return\s*(.*?)}\"/g, function ($0, $1) {
      return $1
    }).replace(/\"([^,]*?)\":/g, function ($0, $1) {
      return $1 + ': '
    }).replace(/(,)(\S)/g, function ($0, $1, $2) {
      return $1 + ' ' + $2
    }).replace(/\"/g, '\'')

    var hasClassList = false
    val = val.replace(/classList:\s*\[(.*?)\]/g, function ($0, $1) {
      var styleMatch = val.match(/,\s*style:\s*({.*?})/)
      hasClassList = true
      var classArr = $1.trim().split(/\s*,\s*/).map(function (klass) {
        return '_s[' + klass + ']'
      })
      classArr.unshift(styleMatch && styleMatch[1] ? styleMatch[1] : '{}')
      return 'style: (function () { var _s = this._css; return Object.assign(' + classArr.join(', ') + '); }).call(this)'
    })
    if (hasClassList) {
      val = val.replace(/,\s*style:\s*({.*?})/g, '')
    }
    return val
  });

  delete node.children
  node.attr = node.attr || {}
  node.attr.value = eval('(function () {return [' + ret.join(', ') + ']})')
}
1102861
function makeFormData( payload ) {
  let body = new FormData()
  for( let k in (payload || {}) ) {
    body.append( k, payload[k] )
  }
  return body
}
127755
private String stripMailBodyEnding(String textBody) throws IOException {
        BufferedReader reader = null;
        StringBuilder body = new StringBuilder();

        try {
            reader = new BufferedReader(new StringReader(textBody));

            String line = reader.readLine();
            while (line != null && !line.equals(".")) {
                body.append(line);
                body.append(System.getProperty("line.separator"));
                line = reader.readLine();
            }
        } finally {
            if (reader != null) {
                try {
                    reader.close();
                } catch (IOException e) {
                    log.warn("Failed to close reader", e);
                }
            }
        }

        return body.toString().trim();
    }
242765
function serializeBody ({ decamelizeBody=true, headers, body }) {
  if (!body || !isJSONRequest(headers)) return
  const transformedBody = decamelizeBody ? decamelizeKeys(body) : body
  return {
    body: JSON.stringify(transformedBody)
  }
}