<commit_before>from functools import wraps, partial
import warnings

Version, version, __version__, VERSION = ('0.9.0',) * 4

JSON_HEADERS = {
    'Content-type': 'application/json',
    'Accept': 'application/json',
    'client-lib': 'python',
    'version-number': VERSION
}

from indicoio.text.twitter_engagement import twitter_engagement
from indicoio.text.sentiment import political, posneg, sentiment_hq
from indicoio.text.sentiment import posneg as sentiment
from indicoio.text.lang import language
from indicoio.text.tagging import text_tags
from indicoio.text.keywords import keywords
from indicoio.text.ner import named_entities
from indicoio.images.fer import fer
from indicoio.images.features import facial_features
from indicoio.images.features import image_features
from indicoio.images.filtering import content_filtering
from indicoio.utils.multi import predict_image, predict_text

from indicoio.config import API_NAMES

def deprecation_decorator(f, api):
    @wraps(f)
    def wrapper(*args, **kwargs):
        warnings.warn(
            "'batch_" + api + "' will be deprecated in the next major update.  Please call '" + api + "' instead with the same arguments.",
            DeprecationWarning
        )
        return f(*args, **kwargs)
    return wrapper

def detect_batch_decorator(f):
    @wraps(f)
    def wrapper(*args, **kwargs):
        if isinstance(args[0], list):
            kwargs['batch'] = True
        return f(*args, **kwargs)
    return wrapper

apis = dict((api, globals().get(api)) for api in API_NAMES)

for api in apis:
    globals()[api] = partial(detect_batch_decorator(apis[api]))
    globals()['batch_' + api] = partial(deprecation_decorator(apis[api], api), batch=True)<commit_msg>remove partial with no extra arguments<commit_after>from functools import wraps, partial
import warnings

Version, version, __version__, VERSION = ('0.9.0',) * 4

JSON_HEADERS = {
    'Content-type': 'application/json',
    'Accept': 'application/json',
    'client-lib': 'python',
    'version-number': VERSION
}

from indicoio.text.twitter_engagement import twitter_engagement
from indicoio.text.sentiment import political, posneg, sentiment_hq
from indicoio.text.sentiment import posneg as sentiment
from indicoio.text.lang import language
from indicoio.text.tagging import text_tags
from indicoio.text.keywords import keywords
from indicoio.text.ner import named_entities
from indicoio.images.fer import fer
from indicoio.images.features import facial_features
from indicoio.images.features import image_features
from indicoio.images.filtering import content_filtering
from indicoio.utils.multi import predict_image, predict_text

from indicoio.config import API_NAMES

def deprecation_decorator(f, api):
    @wraps(f)
    def wrapper(*args, **kwargs):
        warnings.warn(
            "'batch_" + api + "' will be deprecated in the next major update.  Please call '" + api + "' instead with the same arguments.",
            DeprecationWarning
        )
        return f(*args, **kwargs)
    return wrapper

def detect_batch_decorator(f):
    @wraps(f)
    def wrapper(*args, **kwargs):
        if isinstance(args[0], list):
            kwargs['batch'] = True
        return f(*args, **kwargs)
    return wrapper

apis = dict((api, globals().get(api)) for api in API_NAMES)

for api in apis:
    globals()[api] = detect_batch_decorator(apis[api])
    globals()['batch_' + api] = partial(deprecation_decorator(apis[api], api), batch=True)
{'fraction_non_alphanumeric': 0.10483870967741936, 'fraction_numerical': 0.002880184331797235, 'mean_word_length': 4.199101796407185, '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': '7179905', 'n_tokens_mistral': 1048, 'n_tokens_neox': 1046, 'n_words': 294}