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

"""
Wordpress API Class
"""

__title__ = "wordpress-api"

from requests import request
from json import dumps as jsonencode
from wordpress.oauth import OAuth, OAuth_3Leg
from wordpress.transport import API_Requests_Wrapper
from wordpress.helpers import UrlUtils
from requests_oauth2 import OAuth2


class API(object):
    """ API Class """

    def __init__(self, url, consumer_key, consumer_secret, oauth=1, **kwargs):

        self.requester = API_Requests_Wrapper(url=url, **kwargs)

        oauth_kwargs = dict(
            requester=self.requester,
            consumer_key=consumer_key,
            consumer_secret=consumer_secret,
            force_nonce=kwargs.get('force_nonce'),
            force_timestamp=kwargs.get('force_timestamp')
        )

        if kwargs.get("oauth", 1) is 2:
            self.oauth2 = True
            self.oauth2 = OAuth2(consumer_key, consumer_secret, url, "")<commit_msg>just a test<commit_after># -*- coding: utf-8 -*-

"""
Wordpress API Class
"""

__title__ = "wordpress-api"

from requests import request
from json import dumps as jsonencode
from wordpress.oauth import OAuth, OAuth_3Leg
from wordpress.transport import API_Requests_Wrapper
from wordpress.helpers import UrlUtils
from requests_oauth2 import OAuth2


class API(object):
    """ API Class """

    def __init__(self, url, consumer_key, consumer_secret, oauth=1, **kwargs):

        self.requester = API_Requests_Wrapper(url=url, **kwargs)

        oauth_kwargs = dict(
            requester=self.requester,
            consumer_key=consumer_key,
            consumer_secret=consumer_secret,
            force_nonce=kwargs.get('force_nonce'),
            force_timestamp=kwargs.get('force_timestamp')
        )

        if oauth is 2:
            self.oauth2 = True
            self.oauth2 = OAuth2(consumer_key, consumer_secret, url, "")
{'fraction_non_alphanumeric': 0.09750927397986221, 'fraction_numerical': 0.010068892421833599, 'mean_word_length': 3.1312910284463893, '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': '1728228', 'n_tokens_mistral': 575, 'n_tokens_neox': 560, 'n_words': 135}