<commit_before>"""Branch naming conventions for 'arcyd-review/description/base' style."""
# =============================================================================
# CONTENTS
# -----------------------------------------------------------------------------
# abdt_classicnaming
#
# Public Classes:
#   Naming
#    .make_tracker_branch_from_name
#    .make_tracker_branch_name
#    .make_review_branch_from_name
#    .make_review_branch_name
#    .make_review_branch_name_from_tracker
#
# -----------------------------------------------------------------------------
# (this contents block is generated, edits will be lost)
# =============================================================================

from __future__ import absolute_import

import phlsys_string

import abdt_naming


class Naming(object):

    def __init__(self):
        super(Naming, self).__init__()
        self._tracking_branch_prefix = 'dev/arcyd/'
        self._reserve_branch_prefix = 'dev/arcyd/reserve'
        self._review_branch_prefix = 'arcyd-review/'
        self._remote = 'origin'

    def make_tracker_branch_from_name(self, branch_name):
        """Return the WorkingBranch for 'branch_name' or None if invalid.

        Usage example:
            >>> naming = Naming()
            >>> make_branch = naming.make_tracker_branch_from_name
            >>> make_branch('dev/arcyd/ok/mywork/master/99')
            ... # doctest: +NORMALIZE_WHITESPACE
            abdt_naming.TrackerBranch("dev/arcyd/ok/mywork/master/99")

            >>> make_branch('invalid/mywork/master')
            Traceback (most recent call last):
                ...
            Error

        :branch_name: string name of the working branch
        :returns: WorkingBranch or None if invalid

        """
        if branch_name == self._reserve_branch_prefix:
            raise abdt_naming.Error()  # ignore the reserved branch

        suffix = phlsys_string.after_prefix(
            branch_name, self._tracking_branch_prefix)<commit_msg>Arcyd classicnaming: fix collision with r branches<commit_after>"""Branch naming conventions for 'arcyd-review/description/base' style."""
# =============================================================================
# CONTENTS
# -----------------------------------------------------------------------------
# abdt_classicnaming
#
# Public Classes:
#   Naming
#    .make_tracker_branch_from_name
#    .make_tracker_branch_name
#    .make_review_branch_from_name
#    .make_review_branch_name
#    .make_review_branch_name_from_tracker
#
# -----------------------------------------------------------------------------
# (this contents block is generated, edits will be lost)
# =============================================================================

from __future__ import absolute_import

import phlsys_string

import abdt_naming


class Naming(object):

    def __init__(self):
        super(Naming, self).__init__()
        self._tracking_branch_prefix = 'dev/arcyd/'
        self._new_tracking_branch_prefix = 'dev/arcyd/trackers'
        self._reserve_branch_prefix = 'dev/arcyd/reserve'
        self._review_branch_prefix = 'arcyd-review/'
        self._remote = 'origin'

    def make_tracker_branch_from_name(self, branch_name):
        """Return the WorkingBranch for 'branch_name' or None if invalid.

        Usage example:
            >>> naming = Naming()
            >>> make_branch = naming.make_tracker_branch_from_name
            >>> make_branch('dev/arcyd/ok/mywork/master/99')
            ... # doctest: +NORMALIZE_WHITESPACE
            abdt_naming.TrackerBranch("dev/arcyd/ok/mywork/master/99")

            >>> make_branch('dev/arcyd/trackers/x/ok/r/master/do/99')
            Traceback (most recent call last):
                ...
            Error

            >>> make_branch('invalid/mywork/master')
            Traceback (most recent call last):
                ...
            Error

        :branch_name: string name of the working branch
        :returns: WorkingBranch or None if invalid

        """
        if branch_name == self._reserve_branch_prefix:
            raise abdt_naming.Error()  # ignore the reserved branch

        if branch_name.startswith(self._new_tracking_branch_prefix):
            raise abdt_naming.Error()  # ignore all new tracker branches

        suffix = phlsys_string.after_prefix(
            branch_name, self._tracking_branch_prefix)
{'fraction_non_alphanumeric': 0.22053490480507706, 'fraction_numerical': 0.0022665457842248413, 'mean_word_length': 2.2859270290394638, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 30, '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': '748290', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1161, 'n_words': 227}