<commit_before>from rdflib import Graph


class GraphStore(Graph):
    def __init__(self, connect_args, *args, **kwargs):
        super(GraphStore, self).__init__(*args, **kwargs)
        self.connect_args = connect_args

    def connect(self):
        self.open(*self.connect_args)<commit_msg>Improve connect() of GraphStore<commit_after>from rdflib import Graph


class GraphStore(Graph):
    def __init__(self, connect_args, *args, **kwargs):
        super(GraphStore, self).__init__(*args, **kwargs)
        self.connect_args = connect_args

    def connect(self):
        if isinstance(self.connect_args, list):
            self.open(*self.connect_args)
        elif isinstance(self.connect_args, dict):
            self.open(**self.connect_args)
        else:
            raise TypeError("connect_args must be either a list or a dict.")

    def create(self):
        pass
{'fraction_non_alphanumeric': 0.11047835990888383, 'fraction_numerical': 0.0, 'mean_word_length': 3.1658767772511847, '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': '1846738', 'n_tokens_mistral': 262, 'n_tokens_neox': 251, 'n_words': 61}