<commit_before>#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
# 
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
# 
# Author: Enthought, Inc.
# Description: <Enthought util package component>
#------------------------------------------------------------------------------

# NOTE:
# This file, `refresh_run.py`, can not be run by nosetests directly.
# It is run through `refresh_test_case.py`, see notes in there.

import unittest
import gc
import os
import sys
import pickle

from types import ClassType, FunctionType
from enthought.util.refresh import refresh

def create_module(name, code):
    # get rid of pyc file
    remove_module(name)

    f = open(name+'.py','w')                
    f.write(code)
    f.close()

def remove_module(name):
    # get rid of pyc file
    try:
        os.remove(name+'.pyc')
        os.remove(name+'.py')
    except:
        pass

class RefreshTestCase(unittest.TestCase):

    def test_old_style_class(self):<commit_msg>Updated notes<commit_after>#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
# 
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
# Thanks for using Enthought open source!
# 
# Author: Enthought, Inc.
# Description: <Enthought util package component>
#------------------------------------------------------------------------------

# NOTE:
# This file, `refresh.py` can not be run by nosetests directly.
# It is run through `test_spawner.py`, see notes in there.

import unittest
import gc
import os
import sys
import pickle

from types import ClassType, FunctionType
from enthought.util.refresh import refresh

def create_module(name, code):
    # get rid of pyc file
    remove_module(name)

    f = open(name+'.py','w')                
    f.write(code)
    f.close()

def remove_module(name):
    # get rid of pyc file
    try:
        os.remove(name+'.pyc')
        os.remove(name+'.py')
    except:
        pass

class RefreshTestCase(unittest.TestCase):

    def test_old_style_class(self):
{'fraction_non_alphanumeric': 0.1969357249626308, 'fraction_numerical': 0.0029895366218236174, 'mean_word_length': 2.217548076923077, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7225254', 'n_tokens_mistral': 738, 'n_tokens_neox': 709, 'n_words': 256}