<commit_before>from pprint import pprint
from cifsdk.client.plugin import Client
import ujson as json


class Dummy(Client):

    def __init__(self, remote, token):
        self.remote = remote
        self.token = token

    def ping(self, write=False):
        return True

    def indicators_create(self, data):
        if isinstance(data, dict):
            data = self._kv_to_indicator(data)

        if type(data) == dict:
            data = [data]

        return data

    def indicators_search(self, data, decode=True):
        if type(data) == dict:
            data = [data]

        if decode:
            return data

        return json.dumps({'data': data, 'status': 'success', 'message': ''}).encode('utf-8')

Plugin = Dummy<commit_msg>tweaking dummy client (#59)<commit_after>from pprint import pprint
from cifsdk.client.plugin import Client
import ujson as json


class Dummy(Client):

    def __init__(self, remote, token):
        self.remote = remote
        self.token = token

    def ping(self, write=False):
        return True

    def indicators_create(self, data):
        if isinstance(data, dict):
            data = self._kv_to_indicator(data)

        if type(data) == dict:
            data = [data]

        return data

    def indicators_search(self, data, decode=True, test_data=[], test_wl=[]):
        if len(test_data) > 0:
            return test_data

        if type(data) == dict:
            data = [data]

        if decode:
            return data

        return json.dumps({'data': data, 'status': 'success', 'message': ''}).encode('utf-8')

Plugin = Dummy
{'fraction_non_alphanumeric': 0.11401869158878504, 'fraction_numerical': 0.003115264797507788, 'mean_word_length': 2.311340206185567, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '7020555', 'n_tokens_mistral': 491, 'n_tokens_neox': 463, 'n_words': 137}