<commit_before>from pydashie.dashie_sampler import DashieSampler

import trello


class TrelloSampler(DashieSampler):
    def __init__(self, *args, **kwargs):
        key = '<KEY>'
        token = '9db5d5330fea052698d6b22a3cfd1e9e4dadd3a3fcf0e4d20b37e21dd325d0f3'
        self.api = trello.TrelloApi(key)
        self.api.set_token(token)
        DashieSampler.__init__(self, *args, **kwargs)

    def name(self):
        return 'trello'

    def sample(self):
        cards = self.api.lists.get_card('543c0dd47693971e54abf1c2')
        items = []
        for card in cards:
            members = []
            for member_id in card.get('idMembers', []):
                members.append(self.api.members.get(member_id))
            items.append({
                'label': card.get('name', 'undef'),
                'value': ', '.join([member.get('fullName', 'undef')
                                    for member in members])
            })
        return {'items': items}<commit_msg>Trello: Showing member before card<commit_after>from pydashie.dashie_sampler import DashieSampler

import trello


class TrelloSampler(DashieSampler):
    def __init__(self, *args, **kwargs):
        key = '<KEY>'
        token = '9db5d5330fea052698d6b22a3cfd1e9e4dadd3a3fcf0e4d20b37e21dd325d0f3'
        self.api = trello.TrelloApi(key)
        self.api.set_token(token)
        DashieSampler.__init__(self, *args, **kwargs)

    def name(self):
        return 'trello'

    def sample(self):
        cards = self.api.lists.get_card('543c0dd47693971e54abf1c2')
        items = []
        for card in cards:
            members = []
            for member_id in card.get('idMembers', []):
                members.append(self.api.members.get(member_id))

            members = ', '.join([member.get('fullName', 'undef').split(' ')[0]
                                for member in members])
            items.append({
                'label': '%s: %s ' % (members, card.get('name', 'undef'))
            })
        return {'items': items}
{'fraction_non_alphanumeric': 0.12666996536368136, 'fraction_numerical': 0.0499752597723899, 'mean_word_length': 2.2095238095238097, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1669363', 'n_tokens_mistral': 728, 'n_tokens_neox': 664, 'n_words': 117}