<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Subversion object for libvcs.

libvcs.svn
~~~~~~~~~~

The follow are from saltstack/salt (Apache license):

- :py:meth:`SubversionRepo.get_revision_file`

The following are pypa/pip (MIT license):

- :py:meth:`SubversionRepo.get_url_and_revision_from_pip_url`
- :py:meth:`SubversionRepo.get_url`
- :py:meth:`SubversionRepo.get_revision`
- :py:meth:`~.get_rev_options`

"""
from __future__ import absolute_import, print_function, unicode_literals

import logging
import os
import re

from ._compat import urlparse
from .base import BaseRepo

logger = logging.getLogger(__name__)


class SubversionRepo(BaseRepo):
    bin_name = 'svn'
    schemes = ('svn', 'svn+ssh', 'svn+http', 'svn+https', 'svn+svn')

    def __init__(self, url, **kwargs):
        """A svn repository.

        :param url: URL in subversion repository
        :type url: str

        :param svn_username: username to use for checkout and update
        :type svn_username: str or None

        :param svn_password: password to use for checkout and update
        :type svn_password: str or None

        :param svn_trust_cert: trust the Subversion server site certificate
            (default False)
        :type svn_trust_cert: bool
        """
        if 'svn_trust_cert' not in kwargs:
            self.svn_trust_cert = False
        BaseRepo.__init__(self, url, **kwargs)

    def _user_pw_args(self):
        args = []
        for param_name in ['svn_username', 'svn_password']:
            if hasattr(self, param_name):
                args.extend(['--' + param_name[4:], getattr(self, param_name)])
        return args

    def obtain(self, quiet=None):
        self.check_destination()

        url, rev = self.url, self.rev

        cmd = ['checkout', '-q', url, '--non-interactive']
        if self.svn_trust_cert:
            cmd.append('--trust-server-cert')<commit_msg>chore(svn): Update for BaseRepo.__dict__ demystification<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Subversion object for libvcs.

libvcs.svn
~~~~~~~~~~

The follow are from saltstack/salt (Apache license):

- :py:meth:`SubversionRepo.get_revision_file`

The following are pypa/pip (MIT license):

- :py:meth:`SubversionRepo.get_url_and_revision_from_pip_url`
- :py:meth:`SubversionRepo.get_url`
- :py:meth:`SubversionRepo.get_revision`
- :py:meth:`~.get_rev_options`

"""
from __future__ import absolute_import, print_function, unicode_literals

import logging
import os
import re

from ._compat import urlparse
from .base import BaseRepo

logger = logging.getLogger(__name__)


class SubversionRepo(BaseRepo):
    bin_name = 'svn'
    schemes = ('svn', 'svn+ssh', 'svn+http', 'svn+https', 'svn+svn')

    def __init__(self, url, **kwargs):
        """A svn repository.

        :param url: URL in subversion repository
        :type url: str

        :param svn_username: username to use for checkout and update
        :type svn_username: str or None

        :param svn_password: password to use for checkout and update
        :type svn_password: str or None

        :param svn_trust_cert: trust the Subversion server site certificate
            (default False)
        :type svn_trust_cert: bool
        """
        if 'svn_trust_cert' not in kwargs:
            self.svn_trust_cert = False

        self.rev = kwargs.get('rev')
        BaseRepo.__init__(self, url, **kwargs)

    def _user_pw_args(self):
        args = []
        for param_name in ['svn_username', 'svn_password']:
            if hasattr(self, param_name):
                args.extend(['--' + param_name[4:], getattr(self, param_name)])
        return args

    def obtain(self, quiet=None):
        self.check_destination()

        url, rev = self.url, self.rev

        cmd = ['checkout', '-q', url, '--non-interactive']
        if self.svn_trust_cert:
            cmd.append('--trust-server-cert')
{'fraction_non_alphanumeric': 0.12190135445949399, 'fraction_numerical': 0.0010222335803731152, 'mean_word_length': 3.0102459016393444, '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': '2073949', 'n_tokens_mistral': 1307, 'n_tokens_neox': 1265, 'n_words': 323}