<commit_before>import sys

import pytest

pytestmark = pytest.mark.skipif(sys.platform == 'win32',
                                reason='Requires Mac or Linux')

sa = pytest.importorskip('sqlalchemy')
boto = pytest.importorskip('boto')
pytest.importorskip('psycopg2')
pytest.importorskip('redshift_sqlalchemy')

is_authorized = tried = False


@pytest.fixture(scope='module')
def rs_auth():
    # if we aren't authorized and we've tried to authorize then skip, prevents
    # us from having to deal with timeouts

    # TODO: this will fail if we want to use a testing cluster with a different
    # security group than 'default'
    global is_authorized, tried

    if not is_authorized and not tried:
        if not tried:
            try:
                conn = boto.connect_redshift()
            except NoAuthHandlerFound as e:
                pytest.skip('authorization to access redshift cluster failed '
                            '%s' % e)
            try:
                conn.authorize_cluster_security_group_ingress('default',
                                                              cidrip=cidrip)<commit_msg>Namespace error.<commit_after>import sys

import pytest

pytestmark = pytest.mark.skipif(sys.platform == 'win32',
                                reason='Requires Mac or Linux')

sa = pytest.importorskip('sqlalchemy')
boto = pytest.importorskip('boto')
pytest.importorskip('psycopg2')
pytest.importorskip('redshift_sqlalchemy')


is_authorized = tried = False


@pytest.fixture(scope='module')
def rs_auth():
    # if we aren't authorized and we've tried to authorize then skip, prevents
    # us from having to deal with timeouts

    # TODO: this will fail if we want to use a testing cluster with a different
    # security group than 'default'
    global is_authorized, tried

    if not is_authorized and not tried:
        if not tried:
            try:
                conn = boto.connect_redshift()
            except boto.exception.NoAuthHandlerFound as e:
                pytest.skip('authorization to access redshift cluster failed '
                            '%s' % e)
            try:
                conn.authorize_cluster_security_group_ingress('default',
                                                              cidrip=cidrip)
{'fraction_non_alphanumeric': 0.0776656428258008, 'fraction_numerical': 0.0026327336551118913, 'mean_word_length': 2.1404958677685952, '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': '4639702', 'n_tokens_mistral': 634, 'n_tokens_neox': 617, 'n_words': 182}