se Exporter qw(import);
use File::Basename qw/fileparse basename dirname/;
use Data::Dumper;
use JSON ();
use Encode qw/encode decode/;
&implements( 'Bio::Sketch' );
our $VERSION = 0.9;
our @EXPOR
write it to a json-formatted file
my $msh2 = Bio::Sketch::Mash->new("all.msh");
$msh2->writeJson("all.json");
# Read the json file
my $mashJson = Bio::Sketch::Mash->new("all.json");
my $dist
= $msh2->dist($mashJson); # yields a zero distance
=head1 DESCRIPTION
This is a module to read mash files produced by the Mash executable. For more information on Mash, see L<mash.readthedocs.org>.
Moo;
use JSON;
use URI::Escape;
use REST::Client;
#use Data::Dumper;
use Carp;
use Log::Any;
use HTTP::Cache::Transparent;
#use JSON::MultiValueOrdered;
#use YAML;
use JSON::Path;
u
oi('10.1088/0004-637X/722/2/971');
print Dumper($data), "\n"; #$data is a hash ref of the json data converted to perl
#unfold the data to something like
# field1/subfield1/subfield2
to => 'dokpe@unifr.ch',
spit_raw_data => 0,
add_end_flag => 1,
json_path => [
['$.author[*]'],
['$.title'],
['$.container
se strict;
use warnings;
use Carp;
use Time::Piece;
use WebService::Mackerel;
use JSON::XS qw/decode_json encode_json/;
sub new {
my ( $class, %opt ) = @_;
my $mackerel = WebService::Macker
id metric type of mackerel: type=$metric_type";
}
};
my $content = eval { decode_json $res; };
if (chomp $@) {
carp "Failed mackerel post $metric_type metrics: err=$@, res
es";
return;
}
my $is_success = $content->{success} || 0;
if ($is_success != JSON::true or $content->{error}) {
use Data::Dumper;
local $Data::Dumper::Terse = 1;
ta::ICal::Entry::Alarm::Display;
use DateTime::Format::ICal;
use DateTime::TimeZone;
use JSON::XS qw(encode_json);
use Text::JSCalendar::TimeZones;
use Text::VCardFast qw(vcard2hash);
use XML::Spice;
IME::Types;
use Digest::SHA qw(sha1_hex);
use URI::Escape qw(uri_unescape);
use Data::Dumper;
use JSON;
use Text::JSCalendar::TimeZones;
# monkey patch like a bandit
BEGIN {
my @properties = Data:
ions => [2, 'object', 0, undef],
isAllDay => [0, 'bool', 0, $JSON::false],
start => [0, 'localdate', 1, undef],
timeZone =>
=>24,time=>1.66745,vs_slowest=>13.3943},{errors=>1.7e-09,p_tags=>"int, str",participant=>"Cpanel::JSON::XS",rate=>670000,samples=>20,time=>1.5,vs_slowest=>15},{errors=>4.5e-10,p_tags=>"int",participan
ame=>"Cpanel::JSON::XS",code_template=>"Cpanel::JSON::XS::encode_json(<array1>) eq Cpanel::JSON::XS::encode_json(<array2>)",func=>"encode_json",include_by_default=>1,module=>"Cpanel::JSON::XS",seq=>8,
ule_versions"=>{"Array::Compare"=>"3.0.2","Arrays::Same"=>0.002,"Benchmark::Dumb"=>0.111,"Cpanel::JSON::XS"=>3.0239,"Data::Cmp"=>0.006,"Devel::Platform::Info"=>0.16,"Sereal::Encoder"=>4.005,Storable=>
;
use OD::Prometheus::Metric;
use OD::Prometheus::Set;
use Scalar::Util qw(reftype);
use URI;
use JSON;
=head1 NAME
OD::Prometheus::Query - Query library to talk to Prometheus servers
=head1 VERSIO
->request( @_ ));
if ($res->is_success) {
my $ret = OD::Prometheus::Set->new;
my $j = decode_json $res->decoded_content;
if( $j->{ status } eq 'success' ) {
if( $j->{ warnings } ) {
warn
perl
use strict;
use warnings;
use Data::Dumper;
use DateTime;
use JSON::XS;
use Test::Deep::NoTest;
my (
%DaysOfWeek,
$JSON,
%Links,
$Path,
%RulesByZone,
%Rules,
%RuleMapping,
%Zon
ning $ARGV[0] ($!)";
my $JSON = do {local $/; <$Fh>};
unless (($JSON || '') =~ /O.TimeZone/s) {
die 'No timezone definitions found';
}
foreach my $Part ($JSON =~ /O.TimeZone.load\((.*?)
\);/smg) {
my $Definitions = decode_json($Part);
@Links{keys %{$Definitions->{link}}} = values %{$Definitions->{link}};
@Rules{keys %{$Definitions->{rules}}} = values %{$Definitions->{ru
module => 'Cpanel::JSON::XS',
func => 'encode_json',
code_template => 'Cpanel::JSON::XS::encode_json(<array1>) eq Cpanel::JSON::XS::encode_json(<array2>)',
t
sed when running the sample benchmark.
L<Array::Compare> 3.0.2
L<Arrays::Same> 0.002
L<Cpanel::JSON::XS> 3.0239
L<Data::Cmp> 0.006
L<Sereal::Encoder> 4.005
L<Storable> 2.62
=head1 BENCHMARK PAR
de_sereal(<array2>)
=item * Cpanel::JSON::XS (perl_code) [int, str]
Code template:
Cpanel::JSON::XS::encode_json(<array1>) eq Cpanel::JSON::XS::encode_json(<array2>)
=back
=head1 BENCHMARK D
attrs ], $class;
}
sub get {
my ( $self, $attr ) = @_;
#Do we need to clone this? Could JSON suffice, or do we need Clone?
return $self->[1]{$attr};
}
sub to_string {
my ($self) = @
some of the API details, and throws rich exceptions rather than
# requiring the caller deal with JSON data structures directly.
#
# SPDX-License-Identifier: MIT
package Net::Duo::Admin 1.02;
use 5.
y ($self) = @_;
# Make the Duo call and get the decoded result.
my $result = $self->call_json_paged('GET', '/admin/v1/integrations');
# Convert the returned integrations into Net::Duo::A
=> $mintime } : {};
my $uri = '/admin/v1/logs/administrator';
my $result = $self->call_json('GET', $uri, $args);
# Return the result as a list.
return @{$result};
}
# Retrieve aut
coding'))
and ( $res->headers->content_type =~ qr{^text|xml$|javascript$|^application/json$} )
) {
return undef;
}
eval { local $/; $body = <$body> } if ref $body;
p Content-types that start with "text/", or end in "xml" or "javascript",
along with "application/json". This may be configurable in the future.
=head1 SUPPORT
You can find documentation for this mo
(which is
# to say the extension is given by the user's input)
our @EXTS = ( "", qw( .yml .yaml .json .xml .pl ) );
# A regex to use to remove the container's name
my $EXT_RE = qr/(?:@{[ join '|', @E
use strict;
use warnings;
use parent qw(Net::Duo::Object);
# Data specification for converting JSON into our object representation. See
# the Net::Duo::Object documentation for syntax information.
rs;
# Override the new method to support creating an integration from an ID
# instead of decoded JSON data.
#
# $class - Class of object to create
# $duo - Net::Duo object to use to creat
data)) {
my $uri = "/admin/v1/integrations/$id_or_data";
$id_or_data = $duo->call_json('GET', $uri);
}
return $class->SUPER::new($duo, $id_or_data);
}
# Override the create me
/www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1
# perl 5.6 ready UTF-8 encoding adapted from JSON::PP
# adapted from HTTP/Tiny.pm
my %escapes = map { chr($_) => sprintf('%%%02X', $_) } 0..255;
$e
RO;
use Code::Statistics::MooseTypes;
use Code::Statistics::Metric;
use Carp 'confess';
use JSON 'from_json';
use File::Slurp 'read_file';
use List::Util qw( reduce max sum min );
use Data::Section -
h => ( isa => 'Int', default => 10 );
sub report {
my ( $self ) = @_;
my $stats = from_json read_file('codestat.out');
$stats->{files} = $self->_strip_ignored_files( @{ $stats->{files}
use strict;
use warnings;
use parent qw( HTTP::Tiny::UA::Response );
use Call::Context ();
use JSON ();
use Net::ACME::X ();
sub die_because_unexpected {
my ($self) = @_;
die Ne
thing but certificate issuance, apparently?
sub content_struct {
my ($self) = @_;
return JSON->new()->allow_nonref()->decode( $self->content() );
}
#A “poor man’s Link header parser” t
tistics on the current directory and sub-directories,
# then store results in codestat.out as json
codestat collect
# compile a report from codestat.out and print to the terminal
code
les living under Code::Statistics::Metric:: are collected for all targets.
All data is dumped as json to C<codestat.out>.
=head2 Reporting
Data from the local C<codestat.out> is read.
Data is grou
e::Statistics::Collector::VERSION = '1.190680';
# ABSTRACT: collects statistics and dumps them to json
use 5.006_003;
use Moose;
use MooseX::HasDefaults::RO;
use Code::Statistics::MooseTypes;
use Mo
c;
use Code::Statistics::Target;
use File::Find::Rule::Perl;
use Code::Statistics::File;
use JSON 'to_json';
use File::Slurp 'write_file';
use Term::ProgressBar::Simple;
use File::Find::Rule;
has no
;
$_->analyze for @{ $self->files };
my $json = $self->_measurements_as_json;
$self->_dump_file_measurements( $json );
return $json;
}
sub _find_files {
my ( $self ) = @_;
console.
=head1 METHODS
=head2 register
# in Mojolicious
sub format_output {
return JSON::XS->new->encode( shift );
}
$app->plugin(
'JavaScript::Console' => {
charset
to a call to protocol().
#
# $class - Class of the exception to create
# $object - The decoded JSON object representing the error reply
# $content - The undecoded content of the server reply
#
# Re
key.
if (!defined($object->{stat})) {
return $class->protocol('missing stat value in JSON reply', $content);
} elsif ($object->{stat} ne 'FAIL') {
my $e = $class->protocol('in
detail} = $object->{stat};
return $e;
}
# Set the exception information from the JSON object.
my $self = {
code => $object->{code} // 50000,
message => $obje