<commit_before>from __future__ import absolute_import
import base64
import copy
import json
import logging
import re

import requests
from lexicon.providers.base import Provider as BaseProvider
from requests.auth import HTTPBasicAuth


LOGGER = logging.getLogger(__name__)

NAMESERVER_DOMAINS = ['gehirn.jp']


def ProviderParser(subparser):
    subparser.add_argument(
        "--auth-token", help="specify access token for authentication")
    subparser.add_argument(
        "--auth-secret", help="specify access secret for authentication")


BUILD_FORMATS = {
    "A": "{address}",
    "AAAA": "{address}",
    "CNAME": "{cname}",
    "TXT": "{data}",
    "NS": "{nsdname}",
    "MX": "{prio} {exchange}",
    "SRV": "{prio} {weight} {port} {target}",
}

FORMAT_RE = {
    "A": re.compile("(?P<address>.+)"),
    "AAAA": re.compile("(?P<address>.+)"),
    "CNAME": re.compile("(?P<cname>.+)"),
    "TXT": re.compile("(?P<data>.+)"),
    "NS": re.compile("(?P<nsdname>.+)"),
    "MX": re.compile("(?P<prio>\d+)\s+(?P<exchange>.+)"),
    "SRV": re.compile("(?P<prio>\d+)\s+(?P<weight>\d+)\s+(?P<port>\d+)\s+(?P<target>.+)"),
}


class Provider(BaseProvider):
<commit_msg>Fixes #332 with raw string regex<commit_after>from __future__ import absolute_import
import base64
import copy
import json
import logging
import re

import requests
from lexicon.providers.base import Provider as BaseProvider
from requests.auth import HTTPBasicAuth


LOGGER = logging.getLogger(__name__)

NAMESERVER_DOMAINS = ['gehirn.jp']


def ProviderParser(subparser):
    subparser.add_argument(
        "--auth-token", help="specify access token for authentication")
    subparser.add_argument(
        "--auth-secret", help="specify access secret for authentication")


BUILD_FORMATS = {
    "A": "{address}",
    "AAAA": "{address}",
    "CNAME": "{cname}",
    "TXT": "{data}",
    "NS": "{nsdname}",
    "MX": "{prio} {exchange}",
    "SRV": "{prio} {weight} {port} {target}",
}

FORMAT_RE = {
    "A": re.compile(r"(?P<address>.+)"),
    "AAAA": re.compile(r"(?P<address>.+)"),
    "CNAME": re.compile(r"(?P<cname>.+)"),
    "TXT": re.compile(r"(?P<data>.+)"),
    "NS": re.compile(r"(?P<nsdname>.+)"),
    "MX": re.compile(r"(?P<prio>\d+)\s+(?P<exchange>.+)"),
    "SRV": re.compile(r"(?P<prio>\d+)\s+(?P<weight>\d+)\s+(?P<port>\d+)\s+(?P<target>.+)"),
}


class Provider(BaseProvider):

{'fraction_non_alphanumeric': 0.2230185497470489, 'fraction_numerical': 0.002951096121416526, 'mean_word_length': 4.417808219178082, 'pattern_counts': {'":': 28, '<': 25, '<?xml version=': 0, '>': 25, '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': '2459419', 'n_tokens_mistral': 896, 'n_tokens_neox': 861, 'n_words': 169}