<commit_before>#!/usr/bin/python

from virtualenv.manage import VirtualEnvironment

def example(path='/tmp/virtualenv.test'):
    env = VirtualEnvironment(path)

    print 'django 1.5 installed?', env.is_installed('django==1.5')

    print 'mezzanine installed?', env.is_installed('mezzanine')
    env.install('mezzanine')
    print 'mezzanine installed?', env.is_installed('mezzanine')

    print env.installed_packages

    payments_repo = 'git+git://github.com/sjkingo/cartridge-payments.git'
    print 'cartridge-payments installed?', env.is_installed(payments_repo)
    env.install(payments_repo)
    print 'cartridge-payments installed?', env.is_installed(payments_repo)
    print env.installed_packages

    env.uninstall('mezzanine')
    print 'mezzanine installed?', env.is_installed('mezzanine')
    print env.installed_packages


if __name__ == '__main__':
    example()<commit_msg>update example.py for v2.0.0<commit_after>#!/usr/bin/python

from virtualenvapi.manage import VirtualEnvironment

def example(path='/tmp/virtualenv.test'):
    env = VirtualEnvironment(path)

    print 'django 1.5 installed?', env.is_installed('django==1.5')

    print 'mezzanine installed?', env.is_installed('mezzanine')
    env.install('mezzanine')
    print 'mezzanine installed?', env.is_installed('mezzanine')

    print env.installed_packages

    payments_repo = 'git+git://github.com/sjkingo/cartridge-payments.git'
    print 'cartridge-payments installed?', env.is_installed(payments_repo)
    env.install(payments_repo)
    print 'cartridge-payments installed?', env.is_installed(payments_repo)
    print env.installed_packages

    env.uninstall('mezzanine')
    print 'mezzanine installed?', env.is_installed('mezzanine')
    print env.installed_packages

    pkgs = env.search('requests')
    print 'search for \'requests\':'
    print len(pkgs), 'found:'
    print pkgs


if __name__ == '__main__':
    example()
{'fraction_non_alphanumeric': 0.12805830296720458, 'fraction_numerical': 0.005726184279021343, 'mean_word_length': 4.669616519174041, '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': '1584139', 'n_tokens_mistral': 668, 'n_tokens_neox': 606, 'n_words': 111}