<commit_before>
import jwt
import json
import requests
import bcrypt

from datetime import datetime, timedelta
from functools import wraps
from flask import g, request, redirect
from flask.ext.cors import cross_origin
from jwt import DecodeError, ExpiredSignature, InvalidAudience
from base64 import urlsafe_b64decode
from urlparse import parse_qsl
from urllib import urlencode
from requests_oauthlib import OAuth1
from uuid import uuid4

from alerta.app import app, db
from alerta.app.utils import jsonify, jsonp, DateEncoder

BASIC_AUTH_REALM = "Alerta"


class AuthError(Exception):
    pass


class Forbidden(Exception):
    pass


def verify_api_key(key, method):
    perm = db.is_key_valid(key)<commit_msg>Change import from flask extension for CORS<commit_after>
import jwt
import json
import requests
import bcrypt

from datetime import datetime, timedelta
from functools import wraps
from flask import g, request, redirect
from flask_cors import cross_origin
from jwt import DecodeError, ExpiredSignature, InvalidAudience
from base64 import urlsafe_b64decode
from urlparse import parse_qsl
from urllib import urlencode
from requests_oauthlib import OAuth1
from uuid import uuid4

from alerta.app import app, db
from alerta.app.utils import jsonify, jsonp, DateEncoder

BASIC_AUTH_REALM = "Alerta"


class AuthError(Exception):
    pass


class Forbidden(Exception):
    pass


def verify_api_key(key, method):
    perm = db.is_key_valid(key)
{'fraction_non_alphanumeric': 0.044137931034482755, 'fraction_numerical': 0.008275862068965517, 'mean_word_length': 5.686635944700461, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6494076', 'n_tokens_mistral': 451, 'n_tokens_neox': 436, 'n_words': 161}