<commit_before># Copyright FuseSoC contributors
# Licensed under the 2-Clause BSD License, see LICENSE for details.
# SPDX-License-Identifier: BSD-2-Clause

import copy
from functools import total_ordering


@total_ordering
class Vlnv:
    def __init__(self, s, default_relation=">="):
        def _is_rev(s):
            return s.startswith("r") and s[1:].isdigit()

        def _is_version(s):
            return s[0].isdigit()

        if s.startswith("!"):
            self.conflict = True
            _s = s[1:]
        else:
            self.conflict = False
            _s = s[:]
        if _s[0:2] in [">=", "<="]:
            self.relation = _s[0:2]
            _s = _s[2:]
        elif s[0] in [">", "<", "~", "^"]:
            self.relation = s[0]
            _s = _s[1:]
        elif s[0] in ["="]:
            self.relation = "=="
            _s = _s[1:]
        else:
            self.relation = ""

        vlnv_parts = _s.split(":")

        self.revision = 0
        # legacy naming. Only name<commit_msg>Check if core name is empty string.<commit_after># Copyright FuseSoC contributors
# Licensed under the 2-Clause BSD License, see LICENSE for details.
# SPDX-License-Identifier: BSD-2-Clause

import copy
from functools import total_ordering


@total_ordering
class Vlnv:
    def __init__(self, s, default_relation=">="):
        def _is_rev(s):
            return s.startswith("r") and s[1:].isdigit()

        def _is_version(s):
            return s[0].isdigit()

        if not s:
            raise SyntaxError("Core name is empty string")

        if s.startswith("!"):
            self.conflict = True
            _s = s[1:]
        else:
            self.conflict = False
            _s = s[:]
        if _s[0:2] in [">=", "<="]:
            self.relation = _s[0:2]
            _s = _s[2:]
        elif s[0] in [">", "<", "~", "^"]:
            self.relation = s[0]
            _s = _s[1:]
        elif s[0] in ["="]:
            self.relation = "=="
            _s = _s[1:]
        else:
            self.relation = ""

        vlnv_parts = _s.split(":")

        self.revision = 0
        # legacy naming. Only name
{'fraction_non_alphanumeric': 0.146455223880597, 'fraction_numerical': 0.014925373134328358, 'mean_word_length': 1.7015113350125946, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 9, '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': '5782596', 'n_tokens_mistral': 735, 'n_tokens_neox': 705, 'n_words': 174}