<commit_before># coding: utf-8
"""
    flask_storage.upyun
    ~~~~~~~~~~~~~~~~~~~

    Upyun storage, upload files to upyun.

    :copyright: (c) 2013 <NAME>.
"""

import os
import log
import base64

from ._base import BaseStorage
from ._compat import http, urljoin
from ._utils import ConfigItem


_missing = object()


def http_request(uri, headers=None, data=None, method=None):
    if headers is None:
        headers = {}

    if data and not method:
        method = 'POST'
    elif not method:
        method = 'GET'

    log.debug('Request %r with %r method' % (uri, method))
    req = http.Request(uri, headers=headers, data=data)
    req.get_method = lambda: method.upper()
    try:
        resp = http.urlopen(req)
    except http.HTTPError as resp:
        pass<commit_msg>Fix import exception<commit_after># coding: utf-8
"""
    flask_storage.upyun
    ~~~~~~~~~~~~~~~~~~~

    Upyun storage, upload files to upyun.

    :copyright: (c) 2013 <NAME>.
"""

import os
import base64

from ._base import BaseStorage
from ._compat import http, urljoin
from ._utils import ConfigItem


_missing = object()


def http_request(uri, headers=None, data=None, method=None):
    if headers is None:
        headers = {}

    if data and not method:
        method = 'POST'
    elif not method:
        method = 'GET'

    req = http.Request(uri, headers=headers, data=data)
    req.get_method = lambda: method.upper()
    try:
        resp = http.urlopen(req)
    except http.HTTPError as resp:
        pass
{'fraction_non_alphanumeric': 0.1265738899933731, 'fraction_numerical': 0.00927766732935719, 'mean_word_length': 2.871794871794872, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7423574', 'n_tokens_mistral': 494, 'n_tokens_neox': 471, 'n_words': 150}