<commit_before># Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

from __future__ import absolute_import

from designateclient.v1 import Client  # noqa
from designateclient.v1.domains import Domain  # noqa
from designateclient.v1.records import Record  # noqa
from django.conf import settings  # noqa

from horizon import exceptions
import logging

from openstack_dashboard.api.base import url_for  # noqa

LOG = logging.getLogger(__name__)


def designateclient(request):
    designate_url = ""
    try:
        designate_url = url_for(request, 'dns')
    except exceptions.ServiceCatalogException:
        LOG.debug('no dns service configured.')
        return None

    LOG.debug('designateclient connection created using token "%s"'
              'and url "%s"' % (request.user.token.id, designate_url))

    insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
    cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None)

    return Client(endpoint=designate_url,
                  token=request.user.token.id,<commit_msg>Remove token logging<commit_after># Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

from __future__ import absolute_import

from designateclient.v1 import Client  # noqa
from designateclient.v1.domains import Domain  # noqa
from designateclient.v1.records import Record  # noqa
from django.conf import settings  # noqa

from horizon import exceptions
import logging

from openstack_dashboard.api.base import url_for  # noqa

LOG = logging.getLogger(__name__)


def designateclient(request):
    designate_url = ""
    try:
        designate_url = url_for(request, 'dns')
    except exceptions.ServiceCatalogException:
        LOG.debug('no dns service configured.')
        return None

    insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
    cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None)

    return Client(endpoint=designate_url,
                  token=request.user.token.id,
{'fraction_non_alphanumeric': 0.07463175122749591, 'fraction_numerical': 0.007201309328968904, 'mean_word_length': 4.026315789473684, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '651919', 'n_tokens_mistral': 863, 'n_tokens_neox': 828, 'n_words': 308}