format :json
debug_output $stdout
483022
def get_long_token(short_token)
	  	params = { 
	  		grant_type: "fb_exchange_token",
	  		client_id: ENV["FB_APP_ID1"],
	  		client_secret: ENV["FB_APP_SECRET1"],
	  		fb_exchange_token: short_token
	  	}
	  	headers =	{ 'Content-Type' => 'application/json' }
	    response = self.class.get("/oauth/access_token", query: params, headers: headers)
	    if response.code == 200
	    	return parse_token(response.body)
	    else
	    	return ""
	    end
	  end
154643
function debugStr(obj) {
  var summary = JSON.stringify(obj) || '';
  return summary.length > 40 ? summary.substr(0, 39) + '…' : summary;
}
864904
function outputToStdout(prettyPrint) {
  if (prettyPrint && !_.isNumber(prettyPrint)) {
    prettyPrint = 4;
  }
  return function(err, value, callback) {
    if (err) {
      console.error(err);
    } else {
      var str = JSON.stringify(value, null, prettyPrint);
      console.log(str);
    }
    callback(err, value);
  };
}
587509
public static function dump($debug_backtrace)
    {
        if (PHP_SAPI === 'cli') {
            self::cliDump($debug_backtrace);
        }

        ob_end_clean();
        ob_start();
        echo <<<END
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.0.0/highlight.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.0.0/styles/default.min.css" />
<script>hljs.initHighlightingOnLoad();</script>
<style>code.php.hljs{margin: -0.4em 0;}code.active{background-color:#e0e0e0;}code:before{content:attr(data-line);}code.active:before{color:#c00;font-weight:bold;}</style>
</head>
<body>
END;

        echo '<div>Dump: ' . $debug_backtrace['file'] . ':<b>' . $debug_backtrace['line'] . "</b></div>";
        echo '<pre>';
        $i = 0;
        foreach ($debug_backtrace['args'] as $data) {
            echo '<code>';
            var_dump($data);
            echo '</code>';
            $i += 1;
        }
        echo '</pre>';
        echo <<<END
</body>
</html>
END;
        exit;
    }
925620
def jsonFormat(output, statDict = None, query = None, pretty = False):
  """"""
  statDict = statDict or scales.getStats()
  if query:
    statDict = runQuery(statDict, query)
  indent = 2 if pretty else None
  # At first, assume that strings are in UTF-8. If this fails -- if, for example, we have
  # crazy binary data -- then in order to get *something* out, we assume ISO-8859-1,
  # which maps each byte to a unicode code point.
  try:
    serialized = json.dumps(statDict, cls=scales.StatContainerEncoder, indent=indent)
  except UnicodeDecodeError:
    serialized = json.dumps(statDict, cls=scales.StatContainerEncoder, indent=indent, encoding='iso-8859-1')

  output.write(serialized)
  output.write('\n')
333474
function formatOutput(obj) {
	if (argv.m) {
		return JSON.stringify(obj);
	}
	return JSON.stringify(obj, null, 2);
}
1305928
private function prettyPrint($json)
    {
        $result = '';
        $level = 0;
        $prevChar = '';
        $inQuotes = false;
        $endsLineLevel = null;
        $jsonLength = strlen($json);

        for ($i = 0; $i < $jsonLength; ++$i) {
            $char = $json[$i];
            $newLIneLevel = null;
            $post = '';
            if ($endsLineLevel !== null) {
                $newLIneLevel = $endsLineLevel;
                $endsLineLevel = null;
            }
            if ($char === '"' && $prevChar != '\\') {
                $inQuotes = !$inQuotes;
            } elseif (!$inQuotes) {
                switch ($char) {
                    case '}':
                    case ']':
                        $level--;
                        $endsLineLevel = null;
                        $newLIneLevel = $level;
                        break;

                    case '{':
                    case '[':
                        $level++;
                        break;
                    case ',':
                        $endsLineLevel = $level;
                        break;

                    case ':':
                        $post = ' ';
                        break;

                    case ' ':
                    case "\t":
                    case "\n":
                    case "\r":
                        $char = '';
                        $endsLineLevel = $newLIneLevel;
                        $newLIneLevel = null;
                        break;
                }
            }
            if ($newLIneLevel !== null) {
                $result .= "\n" . str_repeat("\t", $newLIneLevel);
            }
            $result .= $char . $post;
            $prevChar = $char;
        }

        return $result;
    }
57352
def outformat_is_json():
    
    ctx = click.get_current_context()
    state = ctx.ensure_object(CommandState)
    return state.outformat_is_json()
158421
def output_for_debugging(self, stream, data):
        """"""
        with open('%s.spec.out' % stream.name, 'w') as f: f.write(str(data))
1336250
function debug($str, $TYPE = 0, $file = "", $line = 0)
    {
        if ($this->debug)
        {
            echo "<br>[$file:$line:" . ($this->getDiffTime()) . "]$str";
            flush();
            if ($TYPE == 1)
            {
                exit;
            }
        }
    }
1195629
protected static function prettyPrint($json)
    {
        $result = '';
        $pos = 0;
        $indentation = '    ';
        $newline = "\n";
        $previousChar = '';
        $outOfQuotes = true;

        // Unescape slashes.
        if (strpos($json, '/')) {
            $json = preg_replace('#\134{1}/#', '/', $json);
        }

        $stringLength = strlen($json);

        for ($i = 0; $i <= $stringLength; $i++) {

            // Grab the next character in the string.
            $char = substr($json, $i, 1);

            if (':' == $previousChar && $outOfQuotes) {
                $result .= ' ';
            }

            // Are we inside a quoted string?
            if ('"' == $char && $previousChar != '\\') {
                $outOfQuotes = !$outOfQuotes;

                // If this character is the end of an element,
                // output a new line and indent the next line.
            } elseif (('}' == $char || ']' == $char) && $outOfQuotes) {
                $result .= $newline;
                $pos --;
                for ($j = 0; $j < $pos; $j++) {
                    $result .= $indentation;
                }
            }

            // Add the character to the result string.
            $result .= $char;

            // If the last character was the beginning of an element,
            // output a new line and indent the next line.
            if ((',' == $char || '{' == $char || '[' == $char) && $outOfQuotes) {
                $result .= $newline;
                if ('{' == $char || '[' == $char) {
                    $pos ++;
                }

                for ($j = 0; $j < $pos; $j++) {
                    $result .= $indentation;
                }
            }

            $previousChar = $char;
        }

        return $result;
    }
437898
function formatjson(pis) {
	return pis.map(function(pi) {
		var newpi = {};
		newpi[pi.tag] = pi.att;
		return newpi;
	});
}
1062859
def prettyprint(self):
        """"""
        return json.dumps(self.asJSON(), sort_keys=True, indent=4, separators=(',', ': '))
1145038
def export_debug(self, output_path):
        

        file_hash = hashlib.md5(open(output_path, 'rb').read()).hexdigest()
        avm_name = os.path.splitext(os.path.basename(output_path))[0]

        json_data = self.generate_debug_json(avm_name, file_hash)

        mapfilename = output_path.replace('.avm', '.debug.json')
        with open(mapfilename, 'w+') as out_file:
            out_file.write(json_data)
746945
def output_json(data, code, headers=None):
    ''''''
    resp = make_response(json.dumps(data), code)
    resp.headers.extend(headers or {})
    return resp
966482
function log( type, level, json ) {
  var stream, args, msg;

  if ( level >= loglevel ) {
    args = Array.prototype.slice.call( arguments, 3 );
    msg = json === true ? args[ 0 ] : format( type, args );
    stream = level > 3 ? 'stderr' : 'stdout';
    exports[ stream ].write( msg );
    exports.emit( type.toLowerCase(), msg );
  }
}
1326970
private function formatJson($json)
    {
        $tab = '  ';
        $newJson = '';
        $indentLevel = 0;
        $inString = false;
        $len = strlen($json);
        for ($c = 0; $c < $len; $c++) {
            $char = $json [$c];
            switch ($char) {
                case '{':
                case '[':
                    if (!$inString) {
                        $newJson .= $char . "\n" .
                            str_repeat($tab, $indentLevel + 1);
                        $indentLevel++;
                    } else {
                        $newJson .= $char;
                    }
                    break;
                case '}':
                case ']':
                    if (!$inString) {
                        $indentLevel--;
                        $newJson .= "\n" .
                            str_repeat($tab, $indentLevel) . $char;
                    } else {
                        $newJson .= $char;
                    }
                    break;
                case ',':
                    if (!$inString) {
                        $newJson .= ",\n" .
                            str_repeat($tab, $indentLevel);
                    } else {
                        $newJson .= $char;
                    }
                    break;
                case ':':
                    if (!$inString) {
                        $newJson .= ': ';
                    } else {
                        $newJson .= $char;
                    }
                    break;
                case '"':
                    if ($c == 0) {
                        $inString = true;
                    } elseif ($c > 0 && $json [$c - 1] != '\\') {
                        $inString = !$inString;
                    }
                    // fall-through
                default:
                    $newJson .= $char;
                    break;
            }
        }

        return $newJson;
    }