<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import argparse
import json
import jsonschema
import os
import re
import requests

from config import REPO_URI, OAUTH_TOKEN
from schema import SCHEMA
from termcolor import cprint


def create_issue(payload):
    headers = {'Authorization': 'token {0}'.format(OAUTH_TOKEN)}
    uri = 'https://api.github.com/repos/{0}/issues'.format(REPO_URI)
    r = requests.post(uri, data=json.dumps(payload, ensure_ascii=True),
                      headers=headers)
    if r.status_code != 201:<commit_msg>Pass in our own User Agent.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import argparse
import json
import jsonschema
import os
import re
import requests

from config import REPO_URI, OAUTH_TOKEN
from schema import SCHEMA
from termcolor import cprint


def create_issue(payload):
    headers = {
        'Authorization': 'token {0}'.format(OAUTH_TOKEN),
        'User-Agent': 'Webcompat-Issue-Importer'
    }
    uri = 'https://api.github.com/repos/{0}/issues'.format(REPO_URI)
    r = requests.post(uri, data=json.dumps(payload, ensure_ascii=True),
                      headers=headers)
    if r.status_code != 201:
{'fraction_non_alphanumeric': 0.11223203026481715, 'fraction_numerical': 0.012610340479192938, 'mean_word_length': 3.457865168539326, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5722023', 'n_tokens_mistral': 513, 'n_tokens_neox': 495, 'n_words': 164}