<commit_before>#!/usr/bin/env python

import json
import datetime
import requests
from requests.packages.urllib3.util import Retry
from requests.adapters import HTTPAdapter

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

import IndicatorTypes

# API URLs
API_V1_ROOT = "api/v1"                                                   # API v1 base path
SUBSCRIBED = "{}/pulses/subscribed".format(API_V1_ROOT)                     # pulse subscriptions
EVENTS = "{}/pulses/events".format(API_V1_ROOT)                             # events (user actions)
SEARCH_PULSES = "{}/search/pulses".format(API_V1_ROOT)                      # search pulses
SEARCH_USERS = "{}/search/users".format(API_V1_ROOT)                        # search users
PULSE_DETAILS = "{}/pulses/".format(API_V1_ROOT)                            # pulse meta data
PULSE_INDICATORS = PULSE_DETAILS + "indicators"                             # pulse indicators
PULSE_CREATE = "{}/pulses/create".format(API_V1_ROOT)                       # create pulse
INDICATOR_DETAILS = "{}/indicators/".format(API_V1_ROOT)                    # indicator details
VALIDATE_INDICATOR = "{}/pulses/indicators/validate".format(API_V1_ROOT)    # indicator details


class InvalidAPIKey(Exception):
    def __init__(self, value=None):
        self.value = value or "Invalid API Key"

    def __str__(self):
        return repr(self.value)


class BadRequest(Exception):
    def __init__(self, value=None):
        self.value = value or "Bad Request"<commit_msg>add backslash to API_V1_ROOT variable<commit_after>#!/usr/bin/env python

import json
import datetime
import requests
from requests.packages.urllib3.util import Retry
from requests.adapters import HTTPAdapter

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

import IndicatorTypes

# API URLs
API_V1_ROOT = "/api/v1"                                                   # API v1 base path
SUBSCRIBED = "{}/pulses/subscribed".format(API_V1_ROOT)                     # pulse subscriptions
EVENTS = "{}/pulses/events".format(API_V1_ROOT)                             # events (user actions)
SEARCH_PULSES = "{}/search/pulses".format(API_V1_ROOT)                      # search pulses
SEARCH_USERS = "{}/search/users".format(API_V1_ROOT)                        # search users
PULSE_DETAILS = "{}/pulses/".format(API_V1_ROOT)                            # pulse meta data
PULSE_INDICATORS = PULSE_DETAILS + "indicators"                             # pulse indicators
PULSE_CREATE = "{}/pulses/create".format(API_V1_ROOT)                       # create pulse
INDICATOR_DETAILS = "{}/indicators/".format(API_V1_ROOT)                    # indicator details
VALIDATE_INDICATOR = "{}/pulses/indicators/validate".format(API_V1_ROOT)    # indicator details


class InvalidAPIKey(Exception):
    def __init__(self, value=None):
        self.value = value or "Invalid API Key"

    def __str__(self):
        return repr(self.value)


class BadRequest(Exception):
    def __init__(self, value=None):
        self.value = value or "Bad Request"
{'fraction_non_alphanumeric': 0.09458159666559794, 'fraction_numerical': 0.008015389547932029, 'mean_word_length': 2.406113537117904, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2778354', 'n_tokens_mistral': 947, 'n_tokens_neox': 912, 'n_words': 205}