<commit_before>from __future__ import print_function

from globus_sdk.base import BaseClient, GlobusError


class NexusClient(BaseClient):
    def __init__(self, environment="default"):
        BaseClient.__init__(self, "nexus", environment)

    def get_goauth_token(self, username, password):
        """
        Legacy method for getting a GOAuth token from nexus using
        globusid username and password. Clients using this should
        be prepared to migrate to Globus Auth.

        Note that these tokens have a long lifetime and should be saved
        and re-used.
        """
        r = self.get('/goauth/token?grant_type=client_credentials',
                     auth=(username, password))
        try:
            return r.json['access_token']
        except KeyError:
            raise GlobusError(r)
        else:
            raise<commit_msg>should have been json_body<commit_after>from __future__ import print_function

from globus_sdk.base import BaseClient, GlobusError


class NexusClient(BaseClient):
    def __init__(self, environment="default"):
        BaseClient.__init__(self, "nexus", environment)

    def get_goauth_token(self, username, password):
        """
        Legacy method for getting a GOAuth token from nexus using
        globusid username and password. Clients using this should
        be prepared to migrate to Globus Auth.

        Note that these tokens have a long lifetime and should be saved
        and re-used.
        """
        r = self.get('/goauth/token?grant_type=client_credentials',
                     auth=(username, password))
        try:
            return r.json_body['access_token']
        except KeyError:
            raise GlobusError(r)
        else:
            raise
{'fraction_non_alphanumeric': 0.07101947308132875, 'fraction_numerical': 0.0, 'mean_word_length': 2.452569169960474, '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': '2053767', 'n_tokens_mistral': 468, 'n_tokens_neox': 451, 'n_words': 148}