<commit_before># -*- coding: utf-8 -*-

import os
import requests
import json
import uuid
import copy
import mimetypes

from . import utils
from .resource import Resource
from .exceptions import Conflict, NotFound

DEFAULT_BASE_URL = os.environ.get('COUCHDB_URL', 'http://localhost:5984/')


class Server(object):
    """
    Class that represents a couchdb connection.

    :param base_url: a full url to couchdb (can contain auth data).
    :param full_commit: If ``False``, couchdb not commits all data on a request is finished.
    :param authmethod: specify a authentication method. By default "basic" method is used but also exists
            "session" (that requires some server configuration changes).

    .. versionchanged: 1.4
       Set basic auth method as default instead of session method.

    """

    def __init__(self, base_url=DEFAULT_BASE_URL, full_commit=True,
                 authmethod="basic", verify=False):

        self.base_url, credentials = utils._extract_credentials(base_url)
        self.resource = Resource(self.base_url, full_commit, credentials=credentials, authmethod=authmethod, verify=verify)

    def __contains__(self, name):
        r = self.resource.head(name)
        return r.status_code == 200<commit_msg>Update docstrings for last changes.<commit_after># -*- coding: utf-8 -*-

import os
import requests
import json
import uuid
import copy
import mimetypes

from . import utils
from .resource import Resource
from .exceptions import Conflict, NotFound

DEFAULT_BASE_URL = os.environ.get('COUCHDB_URL', 'http://localhost:5984/')


class Server(object):
    """
    Class that represents a couchdb connection.

    :param verify: setup ssl verifycation.
    :param base_url: a full url to couchdb (can contain auth data).
    :param full_commit: If ``False``, couchdb not commits all data on a
                        request is finished.
    :param authmethod: specify a authentication method. By default "basic"
                       method is used but also exists "session" (that requires
                       some server configuration changes).

    .. versionchanged: 1.4
       Set basic auth method as default instead of session method.

    .. versionchanged: 1.5
        Add verify parameter for setup ssl verifycaton

    """

    def __init__(self, base_url=DEFAULT_BASE_URL, full_commit=True,
                 authmethod="basic", verify=False):

        self.base_url, credentials = utils._extract_credentials(base_url)
        self.resource = Resource(self.base_url, full_commit,
                                 credentials=credentials,
                                 authmethod=authmethod,
                                 verify=verify)

    def __contains__(self, name):
        r = self.resource.head(name)
        return r.status_code == 200
{'fraction_non_alphanumeric': 0.08247422680412371, 'fraction_numerical': 0.007820831852115179, 'mean_word_length': 2.7670682730923697, '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': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3699432', 'n_tokens_mistral': 760, 'n_tokens_neox': 732, 'n_words': 257}