<commit_before><?php

namespace Runewell;

use JsonRPC\Client;

class EthereumClient
{
    /**
     * Main Obj
     */
    protected $main;

    /**
     * Ethereum Unit Map
     */
     public $unitMap = [
         'noether'=>      '0',
         'wei'=>          '1',
         'kwei'=>         '1000',
         'Kwei'=>         '1000',
         'babbage'=>      '1000',
         'femtoether'=>   '1000',
         'mwei'=>        '1000000',
         'Mwei'=>         '1000000',
         'lovelace'=>     '1000000',
         'picoether'=>    '1000000',
         'gwei'=>         '1000000000',
         'Gwei'=>         '1000000000',
         'shannon'=>      '1000000000',
         'nanoether'=>    '1000000000',
         'nano'=>         '1000000000',
         'szabo'=>        '1000000000000',
         'microether'=>   '1000000000000',
         'micro'=>        '1000000000000',
         'finney'=>       '1000000000000000',
         'milliether'=>    '1000000000000000',
         'milli'=>         '1000000000000000',
         'ether'=>        '1000000000000000000',
         'kether'=>       '1000000000000000000000',
         'grand'=>        '1000000000000000000000',
         'mether'=>       '1000000000000000000000000',
         'gether'=>       '1000000000000000000000000000',
         'tether'=>       '1000000000000000000000000000000'
     ];

     /**
      * Converts Numerical Hex String to Float
      * @param  String $hex numerical hex String
      * @return float decimal amount
      */
     public function hexToFloat($hex)
     {
         $dec = 0;
         $len = strlen($hex);
         for ($i = 1; $i <= $len; $i++) {
             $dec = bcadd($dec, bcmul(strval(hexdec($hex[$i - 1])), bcpow('16', strval($len - $i))));
         }
         return (float)$dec;
     }

     public function getAccountBalance($address, $unitType='ether')
     {
         $result = $this->exec('eth_getBalance', [$address, 'latest']);
         $balance = hexToFloat($result) / $this->unitMap[$unitType];
         return $balance;
     }
<commit_msg>float correction<commit_after><?php

namespace Runewell;

use JsonRPC\Client;

class EthereumClient
{
    /**
     * Main Obj
     */
    protected $main;

    /**
     * Ethereum Unit Map
     */
     public $unitMap = [
         'noether'=>      '0',
         'wei'=>          '1',
         'kwei'=>         '1000',
         'Kwei'=>         '1000',
         'babbage'=>      '1000',
         'femtoether'=>   '1000',
         'mwei'=>        '1000000',
         'Mwei'=>         '1000000',
         'lovelace'=>     '1000000',
         'picoether'=>    '1000000',
         'gwei'=>         '1000000000',
         'Gwei'=>         '1000000000',
         'shannon'=>      '1000000000',
         'nanoether'=>    '1000000000',
         'nano'=>         '1000000000',
         'szabo'=>        '1000000000000',
         'microether'=>   '1000000000000',
         'micro'=>        '1000000000000',
         'finney'=>       '1000000000000000',
         'milliether'=>    '1000000000000000',
         'milli'=>         '1000000000000000',
         'ether'=>        '1000000000000000000',
         'kether'=>       '1000000000000000000000',
         'grand'=>        '1000000000000000000000',
         'mether'=>       '1000000000000000000000000',
         'gether'=>       '1000000000000000000000000000',
         'tether'=>       '1000000000000000000000000000000'
     ];

     /**
      * Converts Numerical Hex String to Float
      * @param  String $hex numerical hex String
      * @return float decimal amount
      */
     public function hexToFloat($hex)
     {
         $dec = 0;
         $len = strlen($hex);
         for ($i = 1; $i <= $len; $i++) {
             $dec = bcadd($dec, bcmul(strval(hexdec($hex[$i - 1])), bcpow('16', strval($len - $i))));
         }
         return (float)$dec;
     }

     public function getAccountBalance($address, $unitType='ether')
     {
         $result = $this->exec('eth_getBalance', [$address, 'latest']);
         $balance = hexToFloat($result) / (float)$this->unitMap[$unitType];
         return $balance;
     }

{'fraction_non_alphanumeric': 0.16124332200097136, 'fraction_numerical': 0.16270033997085964, 'mean_word_length': 1.699213630406291, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 34, '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': '489527', 'n_tokens_mistral': 1754, 'n_tokens_neox': 1191, 'n_words': 243}