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

"""
gspread
~~~~~~~

Google Spreadsheets client library.

"""


__version__ = '2.1.1'
__author__ = '<NAME>'


try:
    from urllib import urlencode
except ImportError:
    from urllib.parse import urlencode


from .client import Client
from .models import Spreadsheet, Worksheet, Cell
from .exceptions import (GSpreadException, AuthenticationError,
                         SpreadsheetNotFound, NoValidUrlKeyFound,
                         IncorrectCellLabel, WorksheetNotFound,
                         UpdateCellError, RequestError, CellNotFound)

from . import v4


def authorize(credentials, client_class=v4.Client):
    """Login to Google API using OAuth2 credentials.
    This is a shortcut function which
    instantiates :class:`gspread.v4.client.Client`
    and performs login right away.

    :returns: :class:`gspread.v4.client.Client` instance.
    """
    client = client_class(auth=credentials)<commit_msg>Import v4 client from `gspread.client`<commit_after># -*- coding: utf-8 -*-

"""
gspread
~~~~~~~

Google Spreadsheets client library.

"""


__version__ = '2.1.1'
__author__ = '<NAME>'


try:
    from urllib import urlencode
except ImportError:
    from urllib.parse import urlencode


from .client import Client
from .models import Spreadsheet, Worksheet, Cell
from .exceptions import (GSpreadException, AuthenticationError,
                         SpreadsheetNotFound, NoValidUrlKeyFound,
                         IncorrectCellLabel, WorksheetNotFound,
                         UpdateCellError, RequestError, CellNotFound)


def authorize(credentials, client_class=Client):
    """Login to Google API using OAuth2 credentials.
    This is a shortcut function which
    instantiates :class:`gspread.client.Client`
    and performs login right away.

    :returns: :class:`gspread.client.Client` instance.
    """
    client = client_class(auth=credentials)
{'fraction_non_alphanumeric': 0.09332638164754953, 'fraction_numerical': 0.007820646506777894, 'mean_word_length': 3.1626898047722345, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1414214', 'n_tokens_mistral': 558, 'n_tokens_neox': 521, 'n_words': 152}