<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import plotlywrapper as pw
import numpy as np
from numpy import random as rng

def compare_figs(d1, d2):
    assert isinstance(d1, dict)
    assert isinstance(d2, dict)
    for k in d1:
        assert k in d2
        if isinstance(d1[k], dict):
            compare_figs(d1[k], d2[k])
        elif isinstance(d1[k], np.ndarray):
            assert (d1[k] == d2[k]).all()
        elif hasattr(d1[k], '__iter__'):
            for v1, v2 in zip(d1[k], d2[k]):
                compare_figs(v1, v2)
        else:
            assert d1[k] == d2[k]


def test_one():
    x = np.arange(3)

    bars = pw.Bar(x=x, y=[20, 14, 23], label='new york')
    bars2 = pw.Bar(x=x, y=[12, 18, 29]) #, label='la')
    line = pw.Line(x=x, y=[3, 8, 9], label='hello', color='red', dash='dashdot', width=5)<commit_msg>fix string compare<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from builtins import str

import plotlywrapper as pw
import numpy as np
from numpy import random as rng

def compare_figs(d1, d2):
    assert isinstance(d1, dict)
    assert isinstance(d2, dict)
    for k in d1:
        assert k in d2
        if isinstance(d1[k], dict):
            compare_figs(d1[k], d2[k])
        elif isinstance(d1[k], str):
            assert d1[k] == d2[k]
        elif isinstance(d1[k], np.ndarray):
            assert (d1[k] == d2[k]).all()
        elif hasattr(d1[k], '__iter__'):
            for v1, v2 in zip(d1[k], d2[k]):
                compare_figs(v1, v2)
        else:
            assert d1[k] == d2[k]


def test_one():
    x = np.arange(3)

    bars = pw.Bar(x=x, y=[20, 14, 23], label='new york')
    bars2 = pw.Bar(x=x, y=[12, 18, 29]) #, label='la')
    line = pw.Line(x=x, y=[3, 8, 9], label='hello', color='red', dash='dashdot', width=5)
{'fraction_non_alphanumeric': 0.17199558985667035, 'fraction_numerical': 0.04575523704520397, 'mean_word_length': 2.4310018903591684, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '565737', 'n_tokens_mistral': 742, 'n_tokens_neox': 706, 'n_words': 185}