<commit_before># -*- coding: utf-8 -*-
#
# Copyright 2007-2012  Red Hat, Inc.
# This file is part of python-fedora
#
# python-fedora is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# python-fedora is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with python-fedora; if not, see <http://www.gnu.org/licenses/>
#
"""
This module provides a client interface for bodhi.


.. moduleauthor:: <NAME> <<EMAIL>>
.. moduleauthor:: <NAME> <<EMAIL>>
"""

import os
import logging
import textwrap
import warnings
import requests

from six.moves import urllib
from distutils.version import LooseVersion

from fedora.client import OpenIdBaseClient, FedoraClientError, BaseClient, AuthError
import fedora.client.openidproxyclient

__version__ = '2.0.0'
log = logging.getLogger(__name__)

BASE_URL = 'https://admin.fedoraproject.org/updates/'
STG_BASE_URL = 'https://admin.stg.fedoraproject.org/updates/'
STG_OPENID_API = 'https://id.stg.fedoraproject.org/api/v1/'


class BodhiClientException(FedoraClientError):
    pass


def BodhiClient(base_url=BASE_URL, staging=False, **kwargs):
    if staging:
        log.info('Using bodhi2 STAGING environment')
        base_url = STG_BASE_URL
        fedora.client.openidproxyclient.FEDORA_OPENID_API = STG_OPENID_API
<commit_msg>Make the bodhiclient happy on rhel7.<commit_after># -*- coding: utf-8 -*-
#
# Copyright 2007-2012  Red Hat, Inc.
# This file is part of python-fedora
#
# python-fedora is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# python-fedora is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with python-fedora; if not, see <http://www.gnu.org/licenses/>
#
"""
This module provides a client interface for bodhi.


.. moduleauthor:: <NAME> <<EMAIL>>
.. moduleauthor:: <NAME> <<EMAIL>>
"""

import os
import logging
import textwrap
import warnings
import requests

from distutils.version import LooseVersion

# We unfortunately can't use python-six for this because there's an ancient
# version on rhel7.  https://github.com/fedora-infra/python-fedora/issues/132
try:
    from urlparse import urlparse
except ImportError:
    # Python3 support
    from urllib.parse import urlparse

from fedora.client import OpenIdBaseClient, FedoraClientError, BaseClient, AuthError
import fedora.client.openidproxyclient

__version__ = '2.0.0'
log = logging.getLogger(__name__)

BASE_URL = 'https://admin.fedoraproject.org/updates/'
STG_BASE_URL = 'https://admin.stg.fedoraproject.org/updates/'
STG_OPENID_API = 'https://id.stg.fedoraproject.org/api/v1/'


class BodhiClientException(FedoraClientError):
    pass


def BodhiClient(base_url=BASE_URL, staging=False, **kwargs):
    if staging:
        log.info('Using bodhi2 STAGING environment')
        base_url = STG_BASE_URL
        fedora.client.openidproxyclient.FEDORA_OPENID_API = STG_OPENID_API

{'fraction_non_alphanumeric': 0.09100700053850296, 'fraction_numerical': 0.010231556273559504, 'mean_word_length': 4.3762662807525325, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 7, 'lorem ipsum': 0, 'www.': 2, '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': '78771', 'n_tokens_mistral': 1149, 'n_tokens_neox': 1116, 'n_words': 391}