<commit_before># JSON Client!
use JSON::RPC::Client;

my $json-client;
sub init_js is export {
  if ! $json-client {
     # create new client with url to server
     say "Creating js client";
     my $url = 'http://localhost:8080';
     sub transport ( Str :$json, Bool :$get_response ) {
       my $t = LWP::Simple.post( ~$url, { 'Content-Type' => 'application/json' }, $json );
       return $t.decode('utf-8');
     }
      $json-client = JSON::RPC::Client.new( transport => &transport );
  }
}

class Atom::Electron::BrowserWindow {

  has Int $!handle_id;
  has Int $.width = 800;
  has Int $.height = 600;
  has Bool $.dev_tools_enabled = False;
  has Bool $.show;

  submethod BUILD(
     :$!width = 800,
     :$!height = 600,
     :$!dev_tools_enabled = False,
   ) {
     my $result = $json-client.BrowserWindow-new(
       width => $!width, 
       height => $!height, 
       dev_tools_enabled => $!dev_tools_enabled
     );
     if $result.defined {
       $!handle_id = 0 + $result:handle_id;
       say "handle before $($result:handle_id)";
       say "handle after $!handle_id";
     } 
  }
  
  method load_url(Str $url) {
    $json-client.BrowserWindow-load_url(handle_id => $!handle_id, url => $url);
	}<commit_msg>Remove redundant declaration<commit_after># JSON Client!
use JSON::RPC::Client;

my $json-client;
sub init_js is export {
  if ! $json-client {
     # create new client with url to server
     say "Creating js client";
     my $url = 'http://localhost:8080';
     sub transport ( Str :$json, Bool :$get_response ) {
       my $t = LWP::Simple.post( ~$url, { 'Content-Type' => 'application/json' }, $json );
       return $t.decode('utf-8');
     }
      $json-client = JSON::RPC::Client.new( transport => &transport );
  }
}

class Atom::Electron::BrowserWindow {

  has Int $!handle_id;
  has Int $.width;
  has Int $.height;
  has Bool $.dev_tools_enabled;
  has Bool $.show;

  submethod BUILD(
     :$!width = 800,
     :$!height = 600,
     :$!dev_tools_enabled = False,
   ) {
     my $result = $json-client.BrowserWindow-new(
       width => $!width, 
       height => $!height, 
       dev_tools_enabled => $!dev_tools_enabled
     );
     if $result.defined {
       $!handle_id = 0 + $result:handle_id;
       say "handle before $($result:handle_id)";
       say "handle after $!handle_id";
     } 
  }
  
  method load_url(Str $url) {
    $json-client.BrowserWindow-load_url(handle_id => $!handle_id, url => $url);
	}
{'fraction_non_alphanumeric': 0.1580658268996343, 'fraction_numerical': 0.012190166598943519, 'mean_word_length': 2.793528505392912, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6941725', 'n_tokens_mistral': 891, 'n_tokens_neox': 835, 'n_words': 205}