<commit_before>from panoptes_client.panoptes import Panoptes, PanoptesAPIException


class Caesar(object):
    EXTRACTOR_TYPES = ['blank', 'external', 'question', 'survey', 'who', 'pluck_field', 'shape']
    REDUCER_TYPES = [
        'consensus', 'count', 'placeholder', 'external', 'first_extract', 'stats',
        'unique_count', 'rectangle', 'sqs'
    ]
    RULE_TO_ACTION_TYPES = {
        'subject': ['retire_subject', 'add_subject_to_set', 'add_to_collection', 'external'],
        'user': ['promote_user']
    }

    def __init__(
        self,
        endpoint='https://caesar.zooniverse.org',
        redirect_url='https://caesar.zooniverse.org/auth/zooniverse/callback'
    ):
        self.endpoint = endpoint
        self.headers = {
            'Accept': 'application/json'
        }

    def http_get(self, *args, **kwargs):
        kwargs['endpoint'] = self.endpoint
        kwargs['headers'] = self.headers
        return Panoptes.client().get(*args, **kwargs)

    def http_post(self, *args, **kwargs):<commit_msg>add docstring to Caesar class<commit_after>from panoptes_client.panoptes import Panoptes, PanoptesAPIException


class Caesar(object):
    """
    The low-level Caesar HTTP client class. Use this class to interact with the
    Caesar API. User credentials are shared with Panoptes, so log in via
    :py:meth:`.Panoptes.connect` before use.
    """
    EXTRACTOR_TYPES = ['blank', 'external', 'question', 'survey', 'who', 'pluck_field', 'shape']
    REDUCER_TYPES = [
        'consensus', 'count', 'placeholder', 'external', 'first_extract', 'stats',
        'unique_count', 'rectangle', 'sqs'
    ]
    RULE_TO_ACTION_TYPES = {
        'subject': ['retire_subject', 'add_subject_to_set', 'add_to_collection', 'external'],
        'user': ['promote_user']
    }

    def __init__(
        self,
        endpoint='https://caesar.zooniverse.org',
        redirect_url='https://caesar.zooniverse.org/auth/zooniverse/callback'
    ):
        self.endpoint = endpoint
        self.headers = {
            'Accept': 'application/json'
        }

    def http_get(self, *args, **kwargs):
        kwargs['endpoint'] = self.endpoint
        kwargs['headers'] = self.headers
        return Panoptes.client().get(*args, **kwargs)

    def http_post(self, *args, **kwargs):
{'fraction_non_alphanumeric': 0.14834205933682373, 'fraction_numerical': 0.0, 'mean_word_length': 3.1315315315315315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '6168783', 'n_tokens_mistral': 729, 'n_tokens_neox': 721, 'n_words': 147}