<commit_before>

def generate_ips(start_ip, end_ip):
    start = list(map(int, start_ip.split(".")))
    end = list(map(int, end_ip.split(".")))
    temp = start
    ip_range = []

    ip_range.append(start_ip)
    while temp != end:
        start[3] += 1
        for i in (3, 2, 1):
            if temp[i] == 256:
                temp[i] = 0
                temp[i-1] += 1
        ip_range.append(".".join(map(str, temp)))

    return ip_range

<commit_msg>[RM-11788] create a bare class for testing strict attributes<commit_after>

def generate_ips(start_ip, end_ip):
    start = list(map(int, start_ip.split(".")))
    end = list(map(int, end_ip.split(".")))
    temp = start
    ip_range = []

    ip_range.append(start_ip)
    while temp != end:
        start[3] += 1
        for i in (3, 2, 1):
            if temp[i] == 256:
                temp[i] = 0
                temp[i-1] += 1
        ip_range.append(".".join(map(str, temp)))

    return ip_range

class Empty(object):
    """
    A bare class, with explicit behavior for key/value items to be set at
    instantiation.
    """
    def __init__(self, **kw):
        for k, v in kw.items():
            setattr(self, k, v)
<|endoftext|>


<commit_before>import glob
import os
import subprocess
import sys

from distutils import ccompiler
from distutils.command.build import build
from setuptools import setup, Command
from setuptools.command.develop import develop
from setuptools.command.test import test

MAJOR = 0
MINOR = 10
MICRO = 0
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)

with open('README.md') as readme:
    readme_lines = readme.readlines()

in_comment_block = False
for i in range(len(readme_lines)):
    line = readme_lines[i]
    # Get the short description based on the comment.
    if 'Short Description' in line:
        description = readme_lines[i + 1].strip()
    # Also, remove all comments.
    if '<!---' in line or in_comment_block:
        if '--->' not in line:
            in_comment_block = True
        else:
            in_comment_block = False
        readme_lines[i] = ''

try:
    import pandoc
    doc = pandoc.Document()
    doc.markdown = ''.join(readme_lines)
    long_description = doc.rst.replace(r'\_\_', '__')
except ImportError:
    long_description = ''.join(readme_lines)

def build_cara(command_cls):
    # Have to build the .capnp files into .py files before the packages are
    # checked, otherwise these would be sub_commands.
    command_cls.run_command('build_generator')
    command_cls.run_command('build_included_capnp')

class cara_build(build):
    def run(self):
        build_cara(self)
        super().run()

class cara_develop(develop):
    def run(self):
        build_cara(self)
        super().run()

class update_submodules(Command):
    """Inspired by IPython's UpdateSubmodules:
    https://github.com/ipython/ipython/blob/01a6d2384331e07a7e8249d75f4baa49aa85069c/setupbase.py#L532
    """
    description = "Update git submodules."
    user_options = []
    initialize_options = finalize_options = lambda self: None

    def run(self):
        capnp_generic_gen = os.path.join('gen', 'capnp_generic_gen')
        if not os.path.exists(capnp_generic_gen):
            # Clone capnp_generic_gen if it doesn't exist.
            self.spawn(
                ('git clone https://github.com/chainreactionmfg/'
                 'capnp_generic_gen.git %s' % capnp_generic_gen).split())
        elif os.path.exists('.git'):
            # If we're in git, then submodule init/update
            self.spawn('git submodule update --init'.split())

class build_generator(build):
    def run(self):
        self.run_command('update_submodules')

        # Check if it needs to be compiled or not.
        output_bin = os.path.join('gen', 'capnpc-cara')
        if os.path.exists(output_bin):
            output_mtime = os.stat(output_bin).st_mtime
            inputs = [
                os.path.join('gen', 'capnpc-cara.c++'),
            ]
            input_mtimes = [os.stat(filename).st_mtime for filename in inputs]
            if all(input_mtime <= output_mtime for input_mtime in input_mtimes):
                return

        compiler = ccompiler.new_compiler()
        if os.getenv('CC'):
            compiler.set_executable('compiler_cc', os.getenv('CC'))
            compiler.set_executable('compiler_cxx', (
                os.getenv('CXX') or os.getenv('CC')))
            compiler.set_executable('compiler_so', os.getenv('CC'))
            compiler.set_executable('linker_exe', os.getenv('CC'))
        libs = ['kj', 'capnp', 'capnpc', 'stdc++', 'm']
        for lib in libs:
            compiler.add_library(lib)
        compiler.add_include_dir(os.path.join('gen', 'capnp_generic_gen'))
        extra_args = '-std=c++14 -fpermissive -Wall'.split()
        # Optionally, install DeathHandler if you want segfault info.
        if os.path.exists('DeathHandler'):
            compiler.add_include_dir('DeathHandler')
            compiler.add_library('ld')
            compiler.define_macro('USE_DEATH_HANDLER', '1')
            extra_args.extend('-g -rdynamic'.split())
        # capnp has .c++ as the extension, so to fit that world, we use .c++ as
        # well, but not that many people do so here we tell the compiler to
        # trust us that it can handle .c++.
        compiler.src_extensions = list(compiler.src_extensions) + ['.c++']
        objects = compiler.compile(
            [os.path.join('gen', 'capnpc-cara.c++')], extra_postargs=extra_args)
        [compiler.add_link_object(obj) for obj in objects]
        compiler.link_executable(
            [], 'capnpc-cara', output_dir='gen',
            extra_postargs=extra_args)

class build_capnp_files(build):
    def execute(self, cmd):
        return subprocess.check_output(cmd)

    def compile_file(self, filename, target_dir):
        self.execute([
            'capnp', 'compile', '-o', os.path.join('gen', 'capnpc-cara'),
            '--src-prefix', os.path.dirname(filename),
            '-I', 'cara',
            filename])
        output = os.path.basename(filename).replace(b'.capnp', b'_capnp.py')
        output = output.replace(b'+', b'x').replace(b'-', b'_')
        self.move_file(output.decode('ascii'), target_dir)

class build_included_capnp(build_capnp_files):
    def run(self, keep_local=False):
        # Find c++.capnp and friends first.
        capnp_dir = self.execute(
            'pkg-config --variable=includedir capnp'.split()).strip()
        if keep_local:
            target = os.path.join('cara', 'capnp')
        else:
            target = os.path.join(self.build_lib, 'cara', 'capnp')
        self.mkpath(target)
        for filename in glob.glob(capnp_dir + b'/capnp/*.capnp'):
            # Then run capnp compile -ocara filename --src-prefix=dirname
            self.compile_file(filename, target)
        self.compile_file(
            os.path.join(b'cara', b'capnp', b'cara.capnp'), target)

class build_test_capnp(build_capnp_files):
    def run(self):
        for filename in glob.glob(os.path.join(b'tests', b'*.capnp')):
            self.compile_file(filename, os.path.join('tests'))

class pytest(test):
    user_options = [
        ('pytest-args=', None, "Arguments to pass to py.test"),
        ('pytest-cov=', None, "Enable coverage. Choose output type: "
         "term, html, xml, annotate, or multiple with comma separation"),
    ]

    def initialize_options(self):
        super().initialize_options()
        self.pytest_args = 'tests'
        self.pytest_cov = None

    def finalize_options(self):
        super().finalize_options()
        self.test_args = []
        self.test_suite = True

    def run(self):
        self.run_command('build_generator')
        self.run_command('build_test_capnp')
        build_included = self.distribution.get_command_obj(
            'build_included_capnp')
        build_included.run(keep_local=True)
        import pytest
        cov = ''
        if self.pytest_cov is not None:
            outputs = ' '.join('--cov-report %s' % output
                               for output in self.pytest_cov.split(','))
            cov = ' --cov cara ' + outputs
        sys.exit(pytest.main(self.pytest_args + cov))

setup(
    name='cara',
    packages=['cara', 'cara.capnp'],
    description=description,
    long_description=long_description,
    keywords='cara pseud capnp network rpc schema',
    version=VERSION,
    license='Apache 2.0',
    author='Fahrzin Hemmati',
    author_email='fahhem@gmail.com',
    url='https://github.com/chainreactionmfg/cara',
    cmdclass={
        'build': cara_build,
        'build_generator': build_generator,
        'build_included_capnp': build_included_capnp,
        'build_test_capnp': build_test_capnp,
        'develop': cara_develop,
        'update_submodules': update_submodules,
        'test': pytest,
    },
    data_files=[
        ('bin', ['gen/capnpc-cara']),
    ],
    install_requires=[
        'crmfg-utils',
        'tornado',
    ],
    extras_require={
        'pseud': ['pseud[Tornado]>=0.1.0'],
    },
    tests_require=[
        'pytest',
    ],
    classifiers=[
        'Development Status :: 2 - Pre-Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: C++',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Topic :: Utilities',
        'Topic :: System :: Networking',
        'Topic :: Software Development :: Code Generators',
        'Topic :: Software Development :: Libraries',
    ]
)
<commit_msg>[SETUP] Switch requires to mutablerecords too<commit_after>import glob
import os
import subprocess
import sys

from distutils import ccompiler
from distutils.command.build import build
from setuptools import setup, Command
from setuptools.command.develop import develop
from setuptools.command.test import test

MAJOR = 0
MINOR = 10
MICRO = 1
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)

with open('README.md') as readme:
    readme_lines = readme.readlines()

in_comment_block = False
for i in range(len(readme_lines)):
    line = readme_lines[i]
    # Get the short description based on the comment.
    if 'Short Description' in line:
        description = readme_lines[i + 1].strip()
    # Also, remove all comments.
    if '<!---' in line or in_comment_block:
        if '--->' not in line:
            in_comment_block = True
        else:
            in_comment_block = False
        readme_lines[i] = ''

try:
    import pandoc
    doc = pandoc.Document()
    doc.markdown = ''.join(readme_lines)
    long_description = doc.rst.replace(r'\_\_', '__')
except ImportError:
    long_description = ''.join(readme_lines)

def build_cara(command_cls):
    # Have to build the .capnp files into .py files before the packages are
    # checked, otherwise these would be sub_commands.
    command_cls.run_command('build_generator')
    command_cls.run_command('build_included_capnp')

class cara_build(build):
    def run(self):
        build_cara(self)
        super().run()

class cara_develop(develop):
    def run(self):
        build_cara(self)
        super().run()

class update_submodules(Command):
    """Inspired by IPython's UpdateSubmodules:
    https://github.com/ipython/ipython/blob/01a6d2384331e07a7e8249d75f4baa49aa85069c/setupbase.py#L532
    """
    description = "Update git submodules."
    user_options = []
    initialize_options = finalize_options = lambda self: None

    def run(self):
        capnp_generic_gen = os.path.join('gen', 'capnp_generic_gen')
        if not os.path.exists(capnp_generic_gen):
            # Clone capnp_generic_gen if it doesn't exist.
            self.spawn(
                ('git clone https://github.com/chainreactionmfg/'
                 'capnp_generic_gen.git %s' % capnp_generic_gen).split())
        elif os.path.exists('.git'):
            # If we're in git, then submodule init/update
            self.spawn('git submodule update --init'.split())

class build_generator(build):
    def run(self):
        self.run_command('update_submodules')

        # Check if it needs to be compiled or not.
        output_bin = os.path.join('gen', 'capnpc-cara')
        if os.path.exists(output_bin):
            output_mtime = os.stat(output_bin).st_mtime
            inputs = [
                os.path.join('gen', 'capnpc-cara.c++'),
            ]
            input_mtimes = [os.stat(filename).st_mtime for filename in inputs]
            if all(input_mtime <= output_mtime for input_mtime in input_mtimes):
                return

        compiler = ccompiler.new_compiler()
        if os.getenv('CC'):
            compiler.set_executable('compiler_cc', os.getenv('CC'))
            compiler.set_executable('compiler_cxx', (
                os.getenv('CXX') or os.getenv('CC')))
            compiler.set_executable('compiler_so', os.getenv('CC'))
            compiler.set_executable('linker_exe', os.getenv('CC'))
        libs = ['kj', 'capnp', 'capnpc', 'stdc++', 'm']
        for lib in libs:
            compiler.add_library(lib)
        compiler.add_include_dir(os.path.join('gen', 'capnp_generic_gen'))
        extra_args = '-std=c++14 -fpermissive -Wall'.split()
        # Optionally, install DeathHandler if you want segfault info.
        if os.path.exists('DeathHandler'):
            compiler.add_include_dir('DeathHandler')
            compiler.add_library('ld')
            compiler.define_macro('USE_DEATH_HANDLER', '1')
            extra_args.extend('-g -rdynamic'.split())
        # capnp has .c++ as the extension, so to fit that world, we use .c++ as
        # well, but not that many people do so here we tell the compiler to
        # trust us that it can handle .c++.
        compiler.src_extensions = list(compiler.src_extensions) + ['.c++']
        objects = compiler.compile(
            [os.path.join('gen', 'capnpc-cara.c++')], extra_postargs=extra_args)
        [compiler.add_link_object(obj) for obj in objects]
        compiler.link_executable(
            [], 'capnpc-cara', output_dir='gen',
            extra_postargs=extra_args)

class build_capnp_files(build):
    def execute(self, cmd):
        return subprocess.check_output(cmd)

    def compile_file(self, filename, target_dir):
        self.execute([
            'capnp', 'compile', '-o', os.path.join('gen', 'capnpc-cara'),
            '--src-prefix', os.path.dirname(filename),
            '-I', 'cara',
            filename])
        output = os.path.basename(filename).replace(b'.capnp', b'_capnp.py')
        output = output.replace(b'+', b'x').replace(b'-', b'_')
        self.move_file(output.decode('ascii'), target_dir)

class build_included_capnp(build_capnp_files):
    def run(self, keep_local=False):
        # Find c++.capnp and friends first.
        capnp_dir = self.execute(
            'pkg-config --variable=includedir capnp'.split()).strip()
        if keep_local:
            target = os.path.join('cara', 'capnp')
        else:
            target = os.path.join(self.build_lib, 'cara', 'capnp')
        self.mkpath(target)
        for filename in glob.glob(capnp_dir + b'/capnp/*.capnp'):
            # Then run capnp compile -ocara filename --src-prefix=dirname
            self.compile_file(filename, target)
        self.compile_file(
            os.path.join(b'cara', b'capnp', b'cara.capnp'), target)

class build_test_capnp(build_capnp_files):
    def run(self):
        for filename in glob.glob(os.path.join(b'tests', b'*.capnp')):
            self.compile_file(filename, os.path.join('tests'))

class pytest(test):
    user_options = [
        ('pytest-args=', None, "Arguments to pass to py.test"),
        ('pytest-cov=', None, "Enable coverage. Choose output type: "
         "term, html, xml, annotate, or multiple with comma separation"),
    ]

    def initialize_options(self):
        super().initialize_options()
        self.pytest_args = 'tests'
        self.pytest_cov = None

    def finalize_options(self):
        super().finalize_options()
        self.test_args = []
        self.test_suite = True

    def run(self):
        self.run_command('build_generator')
        self.run_command('build_test_capnp')
        build_included = self.distribution.get_command_obj(
            'build_included_capnp')
        build_included.run(keep_local=True)
        import pytest
        cov = ''
        if self.pytest_cov is not None:
            outputs = ' '.join('--cov-report %s' % output
                               for output in self.pytest_cov.split(','))
            cov = ' --cov cara ' + outputs
        sys.exit(pytest.main(self.pytest_args + cov))

setup(
    name='cara',
    packages=['cara', 'cara.capnp'],
    description=description,
    long_description=long_description,
    keywords='cara pseud capnp network rpc schema',
    version=VERSION,
    license='Apache 2.0',
    author='Fahrzin Hemmati',
    author_email='fahhem@gmail.com',
    url='https://github.com/chainreactionmfg/cara',
    cmdclass={
        'build': cara_build,
        'build_generator': build_generator,
        'build_included_capnp': build_included_capnp,
        'build_test_capnp': build_test_capnp,
        'develop': cara_develop,
        'update_submodules': update_submodules,
        'test': pytest,
    },
    data_files=[
        ('bin', ['gen/capnpc-cara']),
    ],
    install_requires=[
        'mutablerecords',
        'tornado',
    ],
    extras_require={
        'pseud': ['pseud[Tornado]>=0.1.0'],
    },
    tests_require=[
        'pytest',
    ],
    classifiers=[
        'Development Status :: 2 - Pre-Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: C++',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Topic :: Utilities',
        'Topic :: System :: Networking',
        'Topic :: Software Development :: Code Generators',
        'Topic :: Software Development :: Libraries',
    ]
)
<|endoftext|>


<commit_before>from setuptools import setup

setup(name='mypytools',
      version='0.1.7',
      description='A bundle of tools to make using mypy easier',
      url='https://github.com/nylas/mypy-tools',
      license='MIT',
      install_requires=[
          'click',
          'findimports',
          'typing',
          'watchdog'
      ],
      packages=['mypytools', 'mypytools.server'],
      scripts=[
          'bin/check_mypy_annotations.py',
          'bin/mypy_server.py',
          'bin/print_mypy_coverage.py',
      ],
      zip_safe=False)
<commit_msg>Bump package version<commit_after>from setuptools import setup

setup(name='mypytools',
      version='0.1.8',
      description='A bundle of tools to make using mypy easier',
      url='https://github.com/nylas/mypy-tools',
      license='MIT',
      install_requires=[
          'click',
          'findimports',
          'typing',
          'watchdog'
      ],
      packages=['mypytools', 'mypytools.server'],
      scripts=[
          'bin/check_mypy_annotations.py',
          'bin/mypy_server.py',
          'bin/print_mypy_coverage.py',
      ],
      zip_safe=False)
<|endoftext|>


<commit_before><commit_msg>make game human-playable<commit_after><|endoftext|>


<commit_before>from setuptools import setup, find_packages

from django_python3_ldap import __version__

version_str = ".".join(str(n) for n in __version__)

setup(
    name="django-python3-ldap",
    version=version_str,
    license="BSD",
    description="Django LDAP user authentication backend for Python 3.",
    author="Dave Hall",
    author_email="dave@etianen.com",
    url="https://github.com/etianen/django-python3-ldap",
    packages=find_packages(),
    install_requires=[
        "django>=1.8",
        "ldap3==2.3",
        "pyasn1==0.3.2",
    ],
    classifiers=[
        "Development Status :: 4 - Beta",
        "Environment :: Web Environment",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: BSD License",
        "Operating System :: OS Independent",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: 3.5",
        "Framework :: Django",
    ],
)
<commit_msg>Upgrading ldap3 library<commit_after>from setuptools import setup, find_packages

from django_python3_ldap import __version__

version_str = ".".join(str(n) for n in __version__)

setup(
    name="django-python3-ldap",
    version=version_str,
    license="BSD",
    description="Django LDAP user authentication backend for Python 3.",
    author="Dave Hall",
    author_email="dave@etianen.com",
    url="https://github.com/etianen/django-python3-ldap",
    packages=find_packages(),
    install_requires=[
        "django>=1.8",
        "ldap3==2.4.1",
        "pyasn1==0.4.2",
    ],
    classifiers=[
        "Development Status :: 4 - Beta",
        "Environment :: Web Environment",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: BSD License",
        "Operating System :: OS Independent",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: 3.5",
        "Framework :: Django",
    ],
)
<|endoftext|>


<commit_before><commit_msg>FIX: wrong imports<commit_after><|endoftext|>


<commit_before>try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

# For making things look nice on pypi:
# try:
#     import pypandoc
#     long_description = pypandoc.convert('README.md', 'rst')
# except (IOError, ImportError):

long_description = 'Tool for parsing Variant Call Format (VCF) files. Works like a lightweight version of PyVCF.'

setup(name='vcf_parser',
    version='1.1.8',
    description='Parsing vcf files',
    author = 'Mans Magnusson',
    author_email = 'mans.magnusson@scilifelab.se',
    url = 'http://github.com/moonso/vcf_parser',
    license = 'MIT License',
    install_requires=[
        'pytest',
        'click'
    ],
    packages = [
        'vcf_parser'
    ],
    keywords = [
        'parser',
        'vcf',
        'variants'
    ],
    scripts = [
        'scripts/vcf_parser'
    ],
    classifiers = [
        "Programming Language :: Python",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: MIT License",
        "Development Status :: 4 - Beta",
        "Operating System :: MacOS :: MacOS X",
        "Operating System :: Unix",
        "Intended Audience :: Science/Research",
        "Topic :: Scientific/Engineering :: Bio-Informatics",
    ],
    long_description = long_description,
)<commit_msg>Bumped version to 1.2<commit_after>try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

# For making things look nice on pypi:
# try:
#     import pypandoc
#     long_description = pypandoc.convert('README.md', 'rst')
# except (IOError, ImportError):

long_description = 'Tool for parsing Variant Call Format (VCF) files. Works like a lightweight version of PyVCF.'

setup(name='vcf_parser',
    version='1.2',
    description='Parsing vcf files',
    author = 'Mans Magnusson',
    author_email = 'mans.magnusson@scilifelab.se',
    url = 'http://github.com/moonso/vcf_parser',
    license = 'MIT License',
    install_requires=[
        'pytest',
        'click'
    ],
    packages = [
        'vcf_parser'
    ],
    keywords = [
        'parser',
        'vcf',
        'variants'
    ],
    scripts = [
        'scripts/vcf_parser'
    ],
    classifiers = [
        "Programming Language :: Python",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: MIT License",
        "Development Status :: 4 - Beta",
        "Operating System :: MacOS :: MacOS X",
        "Operating System :: Unix",
        "Intended Audience :: Science/Research",
        "Topic :: Scientific/Engineering :: Bio-Informatics",
    ],
    long_description = long_description,
)<|endoftext|>


<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
from setuptools import setup, find_packages
import re
import os
import codecs

def read(*parts):
    path = os.path.join(os.path.dirname(__file__), *parts)
    with codecs.open(path, encoding='utf-8') as fobj:
        return fobj.read()

def find_version(*file_paths):
    version_file = read(*file_paths)
    version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
                              version_file, re.M)
    if version_match:
        return version_match.group(1)
    raise RuntimeError("Unable to find version string.")

with open('requirements.txt') as f:
    install_requires = f.read().splitlines()

with open('requirements-dev.txt') as f:
    tests_require = f.read().splitlines()

print install_requires
print tests_require

setup(
    name='deployer',
    version=find_version("deployer", "__init__.py"),
    description='',
    url='https://github.com/sportsy/deployer',
    author='Sportsy',
    license='MIT',
    packages=find_packages(exclude=['tests.*', 'tests']),
    include_package_data=True,
    test_suite='nose.collector',
    install_requires=install_requires,
    dependency_links=['https://github.com/ekulyk/PythonPusherClient.git#egg=pusherclient==0.2.0'],
    tests_require=tests_require,
    entry_points="""
    [console_scripts]
    deployer=deployer.main:main
    """,
)
<commit_msg>adjusted dependencies<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
from setuptools import setup, find_packages
import re
import os
import codecs

def read(*parts):
    path = os.path.join(os.path.dirname(__file__), *parts)
    with codecs.open(path, encoding='utf-8') as fobj:
        return fobj.read()

def find_version(*file_paths):
    version_file = read(*file_paths)
    version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
                              version_file, re.M)
    if version_match:
        return version_match.group(1)
    raise RuntimeError("Unable to find version string.")

with open('requirements.txt') as f:
    install_requires = f.read().splitlines()

with open('requirements-dev.txt') as f:
    tests_require = f.read().splitlines()

print install_requires
print tests_require

setup(
    name='deployer',
    version=find_version("deployer", "__init__.py"),
    description='',
    url='https://github.com/sportsy/deployer',
    author='Sportsy',
    license='MIT',
    packages=find_packages(exclude=['tests.*', 'tests']),
    include_package_data=True,
    test_suite='nose.collector',
    install_requires=install_requires,
    dependency_links=['https://github.com/ekulyk/PythonPusherClient/tarball/master#egg=pusherclient==0.2.0'],
    tests_require=tests_require,
    entry_points="""
    [console_scripts]
    deployer=deployer.main:main
    """,
)
<|endoftext|>


<commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages

"""
Documentation can be found at https://docs.python.org/2/distutils/index.html, but usually you only need to do the
following steps to publish a new package version to PyPI::

    # Update the version tag in this file (setup.py)
    python setup.py register
    python setup.py sdist --formats=gztar,zip upload

That's already it. You should get the following output written to your command line::

    Server response (200): OK

If you get errors, check the following things:

- Are you behind a proxy? --> Try not to be behind a proxy (I don't actually know how to configure setup.py to be proxy-aware)
- Is your command correct? --> Double-check using the reference documentation
- Do you have all the necessary libraries to generate the wanted formats? --> Reduce the set of formats or install libs
"""

setup(name='CleanerVersion',
      version='1.4.3',
      description='A versioning solution for relational data models using the Django ORM',
      long_description='CleanerVersion is a solution that allows you to read and write multiple versions of an entry '
                       'to and from your relational database. It allows to keep track of modifications on an object '
                       'over time, as described by the theory of **Slowly Changing Dimensions** (SCD) **- Type 2**. '
                       ''
                       'CleanerVersion therefore enables a Django-based Datawarehouse, which was the initial idea of '
                       'this package.',
      author='Manuel Jeckelmann, Jean-Christophe Zulian, Brian King, Andrea Marcacci',
      author_email='engineering.sophia@swisscom.com',
      license='Apache License 2.0',
      packages=find_packages(exclude=['cleanerversion', 'cleanerversion.*']),
      url='https://github.com/swisscom/cleanerversion',
      install_requires=['django'],
      classifiers=[
          'Development Status :: 4 - Beta',
          'Framework :: Django',
          'Intended Audience :: Developers',
          'Programming Language :: Python :: 2.7',
          'Programming Language :: Python :: 3.4',
          'Topic :: Database',
          'Topic :: System :: Archiving',
      ])
<commit_msg>Bumped version number to 1.4.4; M2M self-references have been added<commit_after>#!/usr/bin/env python
from setuptools import setup, find_packages

"""
Documentation can be found at https://docs.python.org/2/distutils/index.html, but usually you only need to do the
following steps to publish a new package version to PyPI::

    # Update the version tag in this file (setup.py)
    python setup.py register
    python setup.py sdist --formats=gztar,zip upload

That's already it. You should get the following output written to your command line::

    Server response (200): OK

If you get errors, check the following things:

- Are you behind a proxy? --> Try not to be behind a proxy (I don't actually know how to configure setup.py to be proxy-aware)
- Is your command correct? --> Double-check using the reference documentation
- Do you have all the necessary libraries to generate the wanted formats? --> Reduce the set of formats or install libs
"""

setup(name='CleanerVersion',
      version='1.4.4',
      description='A versioning solution for relational data models using the Django ORM',
      long_description='CleanerVersion is a solution that allows you to read and write multiple versions of an entry '
                       'to and from your relational database. It allows to keep track of modifications on an object '
                       'over time, as described by the theory of **Slowly Changing Dimensions** (SCD) **- Type 2**. '
                       ''
                       'CleanerVersion therefore enables a Django-based Datawarehouse, which was the initial idea of '
                       'this package.',
      author='Manuel Jeckelmann, Jean-Christophe Zulian, Brian King, Andrea Marcacci',
      author_email='engineering.sophia@swisscom.com',
      license='Apache License 2.0',
      packages=find_packages(exclude=['cleanerversion', 'cleanerversion.*']),
      url='https://github.com/swisscom/cleanerversion',
      install_requires=['django'],
      classifiers=[
          'Development Status :: 4 - Beta',
          'Framework :: Django',
          'Intended Audience :: Developers',
          'Programming Language :: Python :: 2.7',
          'Programming Language :: Python :: 3.4',
          'Topic :: Database',
          'Topic :: System :: Archiving',
      ])
<|endoftext|>


<commit_before># -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Invenio is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Invenio; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
# In applying this license, CERN does not
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.

"""Invenio-Records is a metadata storage module."""

import os
import sys

from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand

readme = open('README.rst').read()
history = open('CHANGES.rst').read()

tests_require = [
    'check-manifest>=0.25',
    'coverage>=4.0',
    'isort>=4.2.2',
    'pep257>=0.7.0',
    'pytest-cache>=1.0',
    'pytest-cov>=1.8.0',
    'pytest-pep8>=1.0.6',
    'pytest>=2.8.0',
]

extras_require = {
    'access': [
        'invenio-access>=1.0.0a1',
    ],
    'docs': [
        'Sphinx>=1.3',
    ],
    'mysql': [
        'invenio-db[mysql]>=1.0.0a6',
    ],
    'postgresql': [
        'invenio-db[postgresql]>=1.0.0a6',
    ],
    'sqlite': [
        'invenio-db>=1.0.0a6',
    ],
    'tests': tests_require,
}

extras_require['all'] = []
for name, reqs in extras_require.items():
    if name in ('mysql', 'postgresql', 'sqlite'):
        continue
    extras_require['all'].extend(reqs)

setup_requires = [
    'Babel>=1.3',
]

install_requires = [
    'blinker>=1.4',
    'flask-celeryext>=0.1.0',
    'jsonpatch>=1.11',
    'jsonresolver>=0.1.0',
    'jsonschema>=2.5.1',
    'sqlalchemy-continuum>=1.2.1',
    'sqlalchemy-utils>=0.31.0',
]

packages = find_packages()

class PyTest(TestCommand):
    """PyTest Test."""

    user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]

    def initialize_options(self):
        """Init pytest."""
        TestCommand.initialize_options(self)
        self.pytest_args = []
        try:
            from ConfigParser import ConfigParser
        except ImportError:
            from configparser import ConfigParser
        config = ConfigParser()
        config.read('pytest.ini')
        self.pytest_args = config.get('pytest', 'addopts').split(' ')

    def finalize_options(self):
        """Finalize pytest."""
        TestCommand.finalize_options(self)
        if hasattr(self, '_test_args'):
            self.test_suite = ''
        else:
            self.test_args = []
            self.test_suite = True

    def run_tests(self):
        """Run tests."""
        # import here, cause outside the eggs aren't loaded
        import pytest
        errno = pytest.main(self.pytest_args)
        sys.exit(errno)

# Get the version string. Cannot be done with import!
g = {}
with open(os.path.join('invenio_records', 'version.py'), 'rt') as fp:
    exec(fp.read(), g)
    version = g['__version__']

setup(
    name='invenio-records',
    version=version,
    description=__doc__,
    long_description=readme + '\n\n' + history,
    keywords='invenio metadata',
    license='GPLv2',
    author='CERN',
    author_email='info@invenio-software.org',
    url='https://github.com/inveniosoftware/invenio-records',
    packages=packages,
    zip_safe=False,
    include_package_data=True,
    platforms='any',
    entry_points={
        'invenio_base.apps': [
            'invenio_records = invenio_records:InvenioRecords',
        ],
        'invenio_celery.tasks': [
            'invenio_records = invenio_records.tasks.api',
        ],
        'invenio_db.models': [
            'invenio_records = invenio_records.models',
        ],
        'invenio_i18n.translations': [
            'invenio_records = invenio_records',
        ],
        'invenio_access.actions': [
            'records_read_all = invenio_records.permissions:records_read_all',
        ]
    },
    extras_require=extras_require,
    install_requires=install_requires,
    setup_requires=setup_requires,
    tests_require=tests_require,
    classifiers=[
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Development Status :: 3 - Alpha',
    ],
    cmdclass={'test': PyTest},
)
<commit_msg>i18n: entry point name fix<commit_after># -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Invenio is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Invenio; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
# In applying this license, CERN does not
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.

"""Invenio-Records is a metadata storage module."""

import os
import sys

from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand

readme = open('README.rst').read()
history = open('CHANGES.rst').read()

tests_require = [
    'check-manifest>=0.25',
    'coverage>=4.0',
    'isort>=4.2.2',
    'pep257>=0.7.0',
    'pytest-cache>=1.0',
    'pytest-cov>=1.8.0',
    'pytest-pep8>=1.0.6',
    'pytest>=2.8.0',
]

extras_require = {
    'access': [
        'invenio-access>=1.0.0a1',
    ],
    'docs': [
        'Sphinx>=1.3',
    ],
    'mysql': [
        'invenio-db[mysql]>=1.0.0a6',
    ],
    'postgresql': [
        'invenio-db[postgresql]>=1.0.0a6',
    ],
    'sqlite': [
        'invenio-db>=1.0.0a6',
    ],
    'tests': tests_require,
}

extras_require['all'] = []
for name, reqs in extras_require.items():
    if name in ('mysql', 'postgresql', 'sqlite'):
        continue
    extras_require['all'].extend(reqs)

setup_requires = [
    'Babel>=1.3',
]

install_requires = [
    'blinker>=1.4',
    'flask-celeryext>=0.1.0',
    'jsonpatch>=1.11',
    'jsonresolver>=0.1.0',
    'jsonschema>=2.5.1',
    'sqlalchemy-continuum>=1.2.1',
    'sqlalchemy-utils>=0.31.0',
]

packages = find_packages()

class PyTest(TestCommand):
    """PyTest Test."""

    user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]

    def initialize_options(self):
        """Init pytest."""
        TestCommand.initialize_options(self)
        self.pytest_args = []
        try:
            from ConfigParser import ConfigParser
        except ImportError:
            from configparser import ConfigParser
        config = ConfigParser()
        config.read('pytest.ini')
        self.pytest_args = config.get('pytest', 'addopts').split(' ')

    def finalize_options(self):
        """Finalize pytest."""
        TestCommand.finalize_options(self)
        if hasattr(self, '_test_args'):
            self.test_suite = ''
        else:
            self.test_args = []
            self.test_suite = True

    def run_tests(self):
        """Run tests."""
        # import here, cause outside the eggs aren't loaded
        import pytest
        errno = pytest.main(self.pytest_args)
        sys.exit(errno)

# Get the version string. Cannot be done with import!
g = {}
with open(os.path.join('invenio_records', 'version.py'), 'rt') as fp:
    exec(fp.read(), g)
    version = g['__version__']

setup(
    name='invenio-records',
    version=version,
    description=__doc__,
    long_description=readme + '\n\n' + history,
    keywords='invenio metadata',
    license='GPLv2',
    author='CERN',
    author_email='info@invenio-software.org',
    url='https://github.com/inveniosoftware/invenio-records',
    packages=packages,
    zip_safe=False,
    include_package_data=True,
    platforms='any',
    entry_points={
        'invenio_base.apps': [
            'invenio_records = invenio_records:InvenioRecords',
        ],
        'invenio_celery.tasks': [
            'invenio_records = invenio_records.tasks.api',
        ],
        'invenio_db.models': [
            'invenio_records = invenio_records.models',
        ],
        'invenio_i18n.translations': [
            'messages = invenio_records',
        ],
        'invenio_access.actions': [
            'records_read_all = invenio_records.permissions:records_read_all',
        ]
    },
    extras_require=extras_require,
    install_requires=install_requires,
    setup_requires=setup_requires,
    tests_require=tests_require,
    classifiers=[
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Software Development :: Libraries :: Python Modules',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Development Status :: 3 - Alpha',
    ],
    cmdclass={'test': PyTest},
)
<|endoftext|>


<commit_before>import os

import pytest

from zorn import elements

def test_page():
    page = elements.Page('Test', 'test')
    assert page.title == 'Test'
    assert page.file_name == 'test'
    assert page.sub_pages == []

def test_page_with_sub_pages():
    sub_page = elements.SubPage('Sub Test', 'subtest')
    page = elements.Page('Test', 'test', [sub_page])
    assert page.title == 'Test'
    assert page.file_name == 'test'
    assert page.sub_pages == [sub_page]

def test_page_raises_error_if_sub_page_is_not_a_sub_page():
    with pytest.raises(elements.PageError):
        page = elements.Page('Test', 'test', [elements.Page('Fail', 'fail')])  # noqa: ignore=F841

def test_page_generate_content_menu_with_flat_url_style():
    page = elements.Page('Test', 'test', [
        elements.SubPage('Sub Page 1', 'subpage1'),
        elements.SubPage('Sub Page 2', 'subpage2'),
        elements.SubPage('Sub Page 3', 'subpage3'),
    ])
    result_menu = '#Test\n- [Sub Page 1](./subpage1.html)\n- [Sub Page 2](./subpage2.html)\n- [Sub Page 3](' \
                  './subpage3.html)\n'
    assert result_menu == page.generate_content_menu('flat')

def test_page_generate_content_menu_with_nested_url_style():
    page = elements.Page('Test', 'test', [
        elements.SubPage('Sub Page 1', 'subpage1'),
        elements.SubPage('Sub Page 2', 'subpage2'),
        elements.SubPage('Sub Page 3', 'subpage3'),
    ])
    result_menu = '#Test\n- [Sub Page 1](./test/subpage1.html)\n- [Sub Page 2](./test/subpage2.html)\n- [Sub Page ' \
                  '3](./test/subpage3.html)\n'
    assert result_menu == page.generate_content_menu('nested')

def test_page_casting_to_string():
    page = elements.Page('Test', 'test')
    assert str(page) == 'Test'

def test_page_render_html():
    templates_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'fixtures')
    test_content = elements.Page.render_html({'test_content': 'This is a test.'}, templates_dir)
    assert test_content == 'This is a test.'

def test_subpage():
    sub_page = elements.SubPage('Test', 'test')
    assert sub_page.title == 'Test'
    assert sub_page.file_name == 'test'

def test_subpage_cannot_have_subpages():
    with pytest.raises(TypeError):
        sub_page = elements.SubPage('Test', 'test', [elements.SubPage('Test', 'test')])  # noqa: ignore=F841

def test_unlinkedpage():
    unlinked_page = elements.UnlinkedPage('Test', 'test', ['path', 'to', 'page'])
    assert unlinked_page.title == 'Test'
    assert unlinked_page.file_name == 'test'
    assert unlinked_page.path == ['path', 'to', 'page']

def test_unlinkedpage_with_path_as_string():
    unlinked_page = elements.UnlinkedPage('Test', 'test', 'path/to/page')
    assert unlinked_page.title == 'Test'
    assert unlinked_page.file_name == 'test'
    assert unlinked_page.path == ['path', 'to', 'page']

def test_unlinkedpage_without_path():
    unlinked_page = elements.UnlinkedPage('Test', 'test')
    assert unlinked_page.title == 'Test'
    assert unlinked_page.file_name == 'test'
    assert unlinked_page.path == []
<commit_msg>remove unused variables when not needed<commit_after>import os

import pytest

from zorn import elements

def test_page():
    page = elements.Page('Test', 'test')
    assert page.title == 'Test'
    assert page.file_name == 'test'
    assert page.sub_pages == []

def test_page_with_sub_pages():
    sub_page = elements.SubPage('Sub Test', 'subtest')
    page = elements.Page('Test', 'test', [sub_page])
    assert page.title == 'Test'
    assert page.file_name == 'test'
    assert page.sub_pages == [sub_page]

def test_page_raises_error_if_sub_page_is_not_a_sub_page():
    with pytest.raises(elements.PageError):
        elements.Page('Test', 'test', [elements.Page('Fail', 'fail')])

def test_page_generate_content_menu_with_flat_url_style():
    page = elements.Page('Test', 'test', [
        elements.SubPage('Sub Page 1', 'subpage1'),
        elements.SubPage('Sub Page 2', 'subpage2'),
        elements.SubPage('Sub Page 3', 'subpage3'),
    ])
    result_menu = '#Test\n- [Sub Page 1](./subpage1.html)\n- [Sub Page 2](./subpage2.html)\n- [Sub Page 3](' \
                  './subpage3.html)\n'
    assert result_menu == page.generate_content_menu('flat')

def test_page_generate_content_menu_with_nested_url_style():
    page = elements.Page('Test', 'test', [
        elements.SubPage('Sub Page 1', 'subpage1'),
        elements.SubPage('Sub Page 2', 'subpage2'),
        elements.SubPage('Sub Page 3', 'subpage3'),
    ])
    result_menu = '#Test\n- [Sub Page 1](./test/subpage1.html)\n- [Sub Page 2](./test/subpage2.html)\n- [Sub Page ' \
                  '3](./test/subpage3.html)\n'
    assert result_menu == page.generate_content_menu('nested')

def test_page_casting_to_string():
    page = elements.Page('Test', 'test')
    assert str(page) == 'Test'

def test_page_render_html():
    templates_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'fixtures')
    test_content = elements.Page.render_html({'test_content': 'This is a test.'}, templates_dir)
    assert test_content == 'This is a test.'

def test_subpage():
    sub_page = elements.SubPage('Test', 'test')
    assert sub_page.title == 'Test'
    assert sub_page.file_name == 'test'

def test_subpage_cannot_have_subpages():
    with pytest.raises(TypeError):
        elements.SubPage('Test', 'test', [elements.SubPage('Test', 'test')])

def test_unlinkedpage():
    unlinked_page = elements.UnlinkedPage('Test', 'test', ['path', 'to', 'page'])
    assert unlinked_page.title == 'Test'
    assert unlinked_page.file_name == 'test'
    assert unlinked_page.path == ['path', 'to', 'page']

def test_unlinkedpage_with_path_as_string():
    unlinked_page = elements.UnlinkedPage('Test', 'test', 'path/to/page')
    assert unlinked_page.title == 'Test'
    assert unlinked_page.file_name == 'test'
    assert unlinked_page.path == ['path', 'to', 'page']

def test_unlinkedpage_without_path():
    unlinked_page = elements.UnlinkedPage('Test', 'test')
    assert unlinked_page.title == 'Test'
    assert unlinked_page.file_name == 'test'
    assert unlinked_page.path == []
<|endoftext|>


<commit_before>try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

setup(
    name='django-pager-duty',
    description='PagerDuty Filtering and On Call Display',
    author='Paul Traylor',
    url='http://github.com/kfdm/django-pager-duty/',
    version='0.0.1',
    packages=['pagerduty'],
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Framework :: Django',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
    ],
)
<commit_msg>Release 0.1.0<commit_after>try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

setup(
    name='django-pager-duty',
    description='PagerDuty Filtering and On Call Display',
    author='Paul Traylor',
    url='http://github.com/kfdm/django-pager-duty/',
    version='0.1.0',
    packages=['pagerduty'],
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Framework :: Django',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
    ],
)
<|endoftext|>


<commit_before>import collections
import gc

import pytest

from bloop.models import BaseModel, Column
from bloop.types import Integer
from bloop.util import (
    Sentinel,
    WeakDefaultDictionary,
    index,
    ordered,
    walk_subclasses,
)

def test_index():
    """Index by each object's value for an attribute"""
    class Person:
        def __init__(self, name):
            self.name = name

    p1, p2, p3 = Person("foo"), Person("bar"), Person("baz")
    assert index([p1, p2, p3], "name") == {
        "foo": p1,
        "bar": p2,
        "baz": p3
    }

@pytest.mark.parametrize("obj", [None, object(), 2, False, "abc"])
def test_ordered_basic_objects(obj):
    """Things that don't need to be unpacked or flattened for comparison"""
    assert ordered(obj) is obj

@pytest.mark.parametrize("it", [
    iter(list("bac")),
    ["b", "c", "a"],
    ("c", "a", "b"),
    (x for x in "cba"),
    {"a", "c", "b"}
])
def test_ordered_iterable(it):
    """Any non-mapping iterable is sorted, even if it's consumable"""
    expected = ["a", "b", "c"]
    assert ordered(it) == expected

@pytest.mark.parametrize("mapping", [
    {"b": True, "a": "zebra", "c": None},
    collections.OrderedDict([("c", None), ("b", True), ("a", "zebra")])
])
def test_ordered_mapping(mapping):
    """Mappings are flattened into (key, value) tuples and then those tuples are sorted"""
    expected = [
        ("a", "zebra"),
        ("b", True),
        ("c", None)
    ]
    assert ordered(mapping) == expected

@pytest.mark.parametrize("obj, expected", [
    # mapping int -> set(str)
    ({3: {"a", "b"}, 2: {"c", "b"}, 1: {"a", "c"}}, [(1, ["a", "c"]), (2, ["b", "c"]), (3, ["a", "b"])]),
    # mapping str -> list(int)
    ({"b": [1, 2], "a": [3, 2], "c": [1, 3]}, [("a", [2, 3]), ("b", [1, 2]), ("c", [1, 3])]),
    # list(set(bool))
    ([{False}, {True}], [[False], [True]]),
])
def test_ordered_recursion(obj, expected):
    """Mappings and iterables inside each other are sorted and flattened"""
    assert ordered(obj) == expected

def test_walk_subclasses():
    class A:
        pass

    class B:  # Not included
        pass

    class C(A):
        pass

    class D(A):
        pass

    class E(C, A):  # would be visited twice without dedupe
        pass

    class F(D, A):  # would be visited twice without dedupe
        pass

    # list instead of set ensures we don't false succeed on duplicates
    subclasses = sorted(walk_subclasses(A), key=lambda c: c.__name__)
    assert subclasses == [C, D, E, F]

def test_sentinel_uniqueness():
    sentinel = Sentinel("name")
    same_sentinel = Sentinel("NAME")
    assert sentinel is same_sentinel

def test_sentinel_repr():
    foo = Sentinel("foo")
    assert repr(foo) == "<Sentinel[foo]>"

def test_weakref_default_dict():
    """Provides defaultdict behavior for a WeakKeyDictionary"""
    class MyModel(BaseModel):
        id = Column(Integer, hash_key=True)
        data = Column(Integer)

    def new(i):
        obj = MyModel(id=i, data=2*i)
        return obj

    weak_dict = WeakDefaultDictionary(lambda: {"foo": "bar"})

    n_objs = 10
    objs = [new(i) for i in range(n_objs)]

    for obj in objs:
        # default_factory is called
        assert weak_dict[obj] == {"foo": "bar"}
    # don't keep a reference to the last obj, throws off the count below
    del obj

    calls = 0
    while weak_dict:
        del objs[0]
        gc.collect()
        calls += 1
        assert len(weak_dict) == len(objs)
    assert calls == n_objs
<commit_msg>flake8<commit_after>import collections
import gc

import pytest

from bloop.models import BaseModel, Column
from bloop.types import Integer
from bloop.util import (
    Sentinel,
    WeakDefaultDictionary,
    index,
    ordered,
    walk_subclasses,
)

def test_index():
    """Index by each object's value for an attribute"""
    class Person:
        def __init__(self, name):
            self.name = name

    p1, p2, p3 = Person("foo"), Person("bar"), Person("baz")
    assert index([p1, p2, p3], "name") == {
        "foo": p1,
        "bar": p2,
        "baz": p3
    }

@pytest.mark.parametrize("obj", [None, object(), 2, False, "abc"])
def test_ordered_basic_objects(obj):
    """Things that don't need to be unpacked or flattened for comparison"""
    assert ordered(obj) is obj

@pytest.mark.parametrize("it", [
    iter(list("bac")),
    ["b", "c", "a"],
    ("c", "a", "b"),
    (x for x in "cba"),
    {"a", "c", "b"}
])
def test_ordered_iterable(it):
    """Any non-mapping iterable is sorted, even if it's consumable"""
    expected = ["a", "b", "c"]
    assert ordered(it) == expected

@pytest.mark.parametrize("mapping", [
    {"b": True, "a": "zebra", "c": None},
    collections.OrderedDict([("c", None), ("b", True), ("a", "zebra")])
])
def test_ordered_mapping(mapping):
    """Mappings are flattened into (key, value) tuples and then those tuples are sorted"""
    expected = [
        ("a", "zebra"),
        ("b", True),
        ("c", None)
    ]
    assert ordered(mapping) == expected

@pytest.mark.parametrize("obj, expected", [
    # mapping int -> set(str)
    ({3: {"a", "b"}, 2: {"c", "b"}, 1: {"a", "c"}}, [(1, ["a", "c"]), (2, ["b", "c"]), (3, ["a", "b"])]),
    # mapping str -> list(int)
    ({"b": [1, 2], "a": [3, 2], "c": [1, 3]}, [("a", [2, 3]), ("b", [1, 2]), ("c", [1, 3])]),
    # list(set(bool))
    ([{False}, {True}], [[False], [True]]),
])
def test_ordered_recursion(obj, expected):
    """Mappings and iterables inside each other are sorted and flattened"""
    assert ordered(obj) == expected

def test_walk_subclasses():
    class A:
        pass

    class B:  # Not included
        pass

    class C(A):
        pass

    class D(A):
        pass

    class E(C, A):  # would be visited twice without dedupe
        pass

    class F(D, A):  # would be visited twice without dedupe
        pass

    # list instead of set ensures we don't false succeed on duplicates
    subclasses = sorted(walk_subclasses(A), key=lambda c: c.__name__)
    assert subclasses == [C, D, E, F]

def test_sentinel_uniqueness():
    sentinel = Sentinel("name")
    same_sentinel = Sentinel("NAME")
    assert sentinel is same_sentinel

def test_sentinel_repr():
    foo = Sentinel("foo")
    assert repr(foo) == "<Sentinel[foo]>"

def test_weakref_default_dict():
    """Provides defaultdict behavior for a WeakKeyDictionary"""
    class MyModel(BaseModel):
        id = Column(Integer, hash_key=True)
        data = Column(Integer)

    def new(i):
        obj = MyModel(id=i, data=2 * i)
        return obj

    weak_dict = WeakDefaultDictionary(lambda: {"foo": "bar"})

    n_objs = 10
    objs = [new(i) for i in range(n_objs)]

    for obj in objs:
        # default_factory is called
        assert weak_dict[obj] == {"foo": "bar"}
    # don't keep a reference to the last obj, throws off the count below
    del obj

    calls = 0
    while weak_dict:
        del objs[0]
        gc.collect()
        calls += 1
        assert len(weak_dict) == len(objs)
    assert calls == n_objs
<|endoftext|>


<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ECCpy is a user-friendly program for the high-throughput calculation of EC50 values.

Copyright (C) 2016  Mark George Teese

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""
from setuptools import setup, find_packages
from codecs import open
from os import path

here = path.abspath(path.dirname(__file__))

# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
    long_description = f.read()

classifiers = """\
"Development Status :: 3 - Alpha",
Intended Audience :: Science/Research
License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
Programming Language :: Python :: 3
Topic :: Scientific/Engineering :: Bio-Informatics
Topic :: Scientific/Engineering :: Medical Science Apps.
Topic :: Scientific/Engineering :: Chemistry
Classifier: Operating System :: OS Independent
"""

setup(name='eccpy',
    description="High-throughput calculation of EC50 values.",
    url="https://github.com/teese/eccpy",
    download_url = 'https://github.com/teese/eccpy/archive/0.4.4.tar.gz',
    project_urls={'Wiki': 'https://github.com/teese/eccpy/wiki', 'GroupHomepage':'http://cbp.wzw.tum.de/index.php?id=9'},
    long_description=long_description,
    long_description_content_type='text/markdown',
    license='LGPLv3',
    packages=find_packages(),
    classifiers=classifiers.splitlines(),
    install_requires=["pandas", "numpy", "matplotlib"],
    keywords="EC50 LD50 IC50 doseresponse concentration dose inhibitor sigmoidal curve",
    requires=['pandas', 'matplotlib', 'numpy', 'scipy'],
    # obtains package data from MANIFEST.in
    include_package_data=True,
    version='0.4.4')<commit_msg>setup.py version<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ECCpy is a user-friendly program for the high-throughput calculation of EC50 values.

Copyright (C) 2016  Mark George Teese

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""
from setuptools import setup, find_packages
from codecs import open
from os import path

here = path.abspath(path.dirname(__file__))

# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
    long_description = f.read()

classifiers = """\
"Development Status :: 3 - Alpha",
Intended Audience :: Science/Research
License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
Programming Language :: Python :: 3
Topic :: Scientific/Engineering :: Bio-Informatics
Topic :: Scientific/Engineering :: Medical Science Apps.
Topic :: Scientific/Engineering :: Chemistry
Classifier: Operating System :: OS Independent
"""

setup(name='eccpy',
    description="High-throughput calculation of EC50 values.",
    url="https://github.com/teese/eccpy",
    download_url = 'https://github.com/teese/eccpy/archive/0.4.5.tar.gz',
    project_urls={'Wiki': 'https://github.com/teese/eccpy/wiki', 'GroupHomepage':'http://cbp.wzw.tum.de/index.php?id=9'},
    long_description=long_description,
    long_description_content_type='text/markdown',
    license='LGPLv3',
    packages=find_packages(),
    classifiers=classifiers.splitlines(),
    install_requires=["pandas", "numpy", "matplotlib"],
    keywords="EC50 LD50 IC50 doseresponse concentration dose inhibitor sigmoidal curve",
    requires=['pandas', 'matplotlib', 'numpy', 'scipy'],
    # obtains package data from MANIFEST.in
    include_package_data=True,
    version='0.4.5')<|endoftext|>


<commit_before># test ffi float support
import sys
try:
    import ffi
except ImportError:
    print("SKIP")
    sys.exit()

def ffi_open(names):
    err = None
    for n in names:
        try:
            mod = ffi.open(n)
            return mod
        except OSError as e:
            err = e
    raise err

libc = ffi_open(('libc.so', 'libc.so.0', 'libc.so.6', 'libc.dylib'))

strtof = libc.func("f", "strtof", "sp")
print('%.6f' % strtof('1.23', None))

strtod = libc.func("d", "strtod", "sp")
print('%.6f' % strtod('1.23', None))

# test passing double and float args
libm = ffi_open(('libm.so', 'libc.so.0', 'libc.so.6', 'libc.dylib'))
tgamma = libm.func('d', 'tgamma', 'd')
tgammaf = libm.func('f', 'tgammaf', 'f')
for fun in (tgamma, tgammaf):
    for val in (0.5, 1, 1.0, 1.5, 4, 4.0):
        print('%.6f' % fun(val))
<commit_msg>tests: For unix ffi float test, add libm.so.6 to library search list.<commit_after># test ffi float support
import sys
try:
    import ffi
except ImportError:
    print("SKIP")
    sys.exit()

def ffi_open(names):
    err = None
    for n in names:
        try:
            mod = ffi.open(n)
            return mod
        except OSError as e:
            err = e
    raise err

libc = ffi_open(('libc.so', 'libc.so.0', 'libc.so.6', 'libc.dylib'))

strtof = libc.func("f", "strtof", "sp")
print('%.6f' % strtof('1.23', None))

strtod = libc.func("d", "strtod", "sp")
print('%.6f' % strtod('1.23', None))

# test passing double and float args
libm = ffi_open(('libm.so', 'libm.so.6', 'libc.so.0', 'libc.so.6', 'libc.dylib'))
tgamma = libm.func('d', 'tgamma', 'd')
tgammaf = libm.func('f', 'tgammaf', 'f')
for fun in (tgamma, tgammaf):
    for val in (0.5, 1, 1.0, 1.5, 4, 4.0):
        print('%.6f' % fun(val))
<|endoftext|>


<commit_before>import numpy

from chainer import cuda
from chainer import function
from chainer.utils import type_check

class Copy(function.Function):

    """Copy an input GPUArray onto another device."""

    def __init__(self, out_device):
        self.out_device = out_device

    def check_type_forward(self, in_types):
        type_check.expect(
            in_types.size() == 1
        )

    def check_type_backward(self, in_types, out_types):
        type_check.expect(
            out_types.size() == 1,
            in_types[0].dtype == out_types[0].dtype,
            in_types[0].ndim == out_types[0].ndim,
            in_types[0].shape == out_types[0].shape
        )

    def forward_cpu(self, x):
        return x[0].copy(),

    def forward_gpu(self, x):
        return cuda.copy(x[0], out_device=self.out_device),

    def backward_cpu(self, x, gy):
        return gy[0].copy(),

    def backward_gpu(self, x, gy):
        return cuda.copy(gy[0], out_device=cuda.get_device(x[0])),

def copy(x, dst):
    """Copies the input variable onto the specified device.

    This function copies the array of input variable onto the device specified
    by ``dst`` if the original array is on GPU, and otherwise just copies the
    array within host memory.

    Args:
        x (~chainer.Variable): Variable to be copied.
        dst: Target device specifier.

    Returns:
        ~chainer.Variable: Output variable.

    """
    return Copy(dst)(x)
<commit_msg>Remove import of numpy from functions.copy module<commit_after>from chainer import cuda
from chainer import function
from chainer.utils import type_check

class Copy(function.Function):

    """Copy an input GPUArray onto another device."""

    def __init__(self, out_device):
        self.out_device = out_device

    def check_type_forward(self, in_types):
        type_check.expect(
            in_types.size() == 1
        )

    def check_type_backward(self, in_types, out_types):
        type_check.expect(
            out_types.size() == 1,
            in_types[0].dtype == out_types[0].dtype,
            in_types[0].ndim == out_types[0].ndim,
            in_types[0].shape == out_types[0].shape
        )

    def forward_cpu(self, x):
        return x[0].copy(),

    def forward_gpu(self, x):
        return cuda.copy(x[0], out_device=self.out_device),

    def backward_cpu(self, x, gy):
        return gy[0].copy(),

    def backward_gpu(self, x, gy):
        return cuda.copy(gy[0], out_device=cuda.get_device(x[0])),

def copy(x, dst):
    """Copies the input variable onto the specified device.

    This function copies the array of input variable onto the device specified
    by ``dst`` if the original array is on GPU, and otherwise just copies the
    array within host memory.

    Args:
        x (~chainer.Variable): Variable to be copied.
        dst: Target device specifier.

    Returns:
        ~chainer.Variable: Output variable.

    """
    return Copy(dst)(x)
<|endoftext|>


<commit_before>"""
The setup package to install SeleniumBase dependencies and plugins
(Uses selenium 3.x and is compatible with Python 2.7+ and Python 3.5+)
"""

from setuptools import setup, find_packages  # noqa
import os
import sys

this_directory = os.path.abspath(os.path.dirname(__file__))
long_description = None
try:
    with open(os.path.join(this_directory, 'README.md'), 'rb') as f:
        long_description = f.read().decode('utf-8')
except IOError:
    long_description = 'Reliable Browser Automation & Testing Framework'

if sys.argv[-1] == 'publish':
    reply = None
    input_method = input
    if not sys.version_info[0] >= 3:
        input_method = raw_input  # noqa
    reply = str(input_method(
        '>>> Confirm release PUBLISH to PyPI? (yes/no): ')).lower().strip()
    if reply == 'yes':
        print("\n*** Checking code health with flake8:\n")
        flake8_status = os.system("flake8 --exclude=temp")
        if flake8_status != 0:
            print("\nWARNING! Fix flake8 issues before publishing to PyPI!\n")
            sys.exit()
        else:
            print("*** No flake8 issues detected. Continuing...")
        print("\n*** Rebuilding distribution packages: ***\n")
        os.system('rm -f dist/*.egg; rm -f dist/*.tar.gz; rm -f dist/*.whl')
        os.system('python setup.py sdist bdist_wheel')  # Create new tar/wheel
        print("\n*** Installing twine: *** (Required for PyPI uploads)\n")
        os.system("python -m pip install 'twine>=1.15.0'")
        print("\n*** Installing tqdm: *** (Required for PyPI uploads)\n")
        os.system("python -m pip install 'tqdm>=4.46.0'")
        print("\n*** Publishing The Release to PyPI: ***\n")
        os.system('python -m twine upload dist/*')  # Requires ~/.pypirc Keys
        print("\n*** The Release was PUBLISHED SUCCESSFULLY to PyPI! :) ***\n")
    else:
        print("\n>>> The Release was NOT PUBLISHED to PyPI! <<<\n")
    sys.exit()

setup(
    name='seleniumbase',
    version='1.38.2',
    description='Fast, Easy, and Reliable Browser Automation & Testing.',
    long_description=long_description,
    long_description_content_type='text/markdown',
    url='https://github.com/seleniumbase/SeleniumBase',
    platforms=["Windows", "Linux", "Mac OS-X"],
    author='Michael Mintz',
    author_email='mdmintz@gmail.com',
    maintainer='Michael Mintz',
    license="MIT",
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "Framework :: Pytest",
        "Intended Audience :: Developers",
        "Intended Audience :: Information Technology",
        "License :: OSI Approved :: MIT License",
        "Operating System :: MacOS :: MacOS X",
        "Operating System :: Microsoft :: Windows",
        "Operating System :: POSIX :: Linux",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Topic :: Internet",
        "Topic :: Scientific/Engineering",
        "Topic :: Software Development",
        "Topic :: Software Development :: Quality Assurance",
        "Topic :: Software Development :: Libraries",
        "Topic :: Software Development :: Testing",
        "Topic :: Software Development :: Testing :: Acceptance",
        "Topic :: Software Development :: Testing :: Traffic Generation",
        "Topic :: Utilities",
    ],
    install_requires=[
        'pip>=20.1',
        'setuptools',
        'setuptools-scm',
        'wheel',
        'six',
        'nose',
        'ipdb',
        'idna==2.9',  # Must stay in sync with "requests"
        'chardet==3.0.4',  # Must stay in sync with "requests"
        'urllib3==1.25.9',  # Must stay in sync with "requests"
        'requests==2.23.0',
        'selenium==3.141.0',
        'pluggy==0.13.1',
        'attrs>=19.3.0',
        'pytest==4.6.10;python_version<"3.5"',
        'pytest==5.4.2;python_version>="3.5"',
        'pytest-cov==2.8.1',
        'pytest-forked==1.1.3',
        'pytest-html==1.22.1;python_version<"3.6"',
        'pytest-html==2.0.1;python_version>="3.6"',
        'pytest-metadata==1.8.0;python_version<"3.6"',
        'pytest-metadata==1.9.0;python_version>="3.6"',
        'pytest-ordering==0.6',
        'pytest-rerunfailures==8.0;python_version<"3.6"',
        'pytest-rerunfailures==9.0;python_version>="3.6"',
        'pytest-xdist==1.32.0',
        'parameterized==0.7.4',
        'soupsieve==1.9.6;python_version<"3.5"',
        'soupsieve==2.0.1;python_version>="3.5"',
        'beautifulsoup4==4.9.1',
        'cryptography==2.9.2',
        'pyopenssl==19.1.0',
        'pygments==2.5.2;python_version<"3.5"',
        'pygments==2.6.1;python_version>="3.5"',
        'packaging>=20.3',
        'colorama==0.4.3',
        'brython==3.8.8',
        'pymysql==0.9.3',
        'coverage==5.1',
        'pyotp==2.3.0',
        'boto==2.49.0',
        'cffi==1.14.0',
        'flake8==3.7.9;python_version<"3.5"',
        'flake8==3.8.1;python_version>="3.5"',
        'pyflakes==2.1.1;python_version<"3.5"',
        'pyflakes==2.2.0;python_version>="3.5"',
        'certifi>=2020.4.5.1',
        'pdfminer.six==20191110;python_version<"3.5"',
        'pdfminer.six==20200517;python_version>="3.5"',
    ],
    packages=[
        'seleniumbase',
        'seleniumbase.common',
        'seleniumbase.config',
        'seleniumbase.console_scripts',
        'seleniumbase.core',
        'seleniumbase.drivers',
        'seleniumbase.extensions',
        'seleniumbase.fixtures',
        'seleniumbase.masterqa',
        'seleniumbase.plugins',
        'seleniumbase.translate',
        'seleniumbase.utilities',
        'seleniumbase.utilities.selenium_grid',
        'seleniumbase.utilities.selenium_ide',
        'seleniumbase.virtual_display',
    ],
    include_package_data=True,
    entry_points={
        'console_scripts': [
            'seleniumbase = seleniumbase.console_scripts.run:main',
        ],
        'nose.plugins': [
            'base_plugin = seleniumbase.plugins.base_plugin:Base',
            'selenium = seleniumbase.plugins.selenium_plugin:SeleniumBrowser',
            'page_source = seleniumbase.plugins.page_source:PageSource',
            'screen_shots = seleniumbase.plugins.screen_shots:ScreenShots',
            'test_info = seleniumbase.plugins.basic_test_info:BasicTestInfo',
            ('db_reporting = '
             'seleniumbase.plugins.db_reporting_plugin:DBReporting'),
            's3_logging = seleniumbase.plugins.s3_logging_plugin:S3Logging',
        ],
        'pytest11': ['seleniumbase = seleniumbase.plugins.pytest_plugin']
    }
)

# print(os.system("cat seleniumbase.egg-info/PKG-INFO"))
print("\n*** SeleniumBase Installation Complete! ***\n")
<commit_msg>Update setup.py<commit_after>"""
The setup package to install SeleniumBase dependencies and plugins
(Uses selenium 3.x and is compatible with Python 2.7+ and Python 3.5+)
"""

from setuptools import setup, find_packages  # noqa
import os
import sys

this_directory = os.path.abspath(os.path.dirname(__file__))
long_description = None
total_description = None
try:
    with open(os.path.join(this_directory, 'README.md'), 'rb') as f:
        total_description = f.read().decode('utf-8')
    description_lines = total_description.split('\n')
    long_description_lines = []
    for line in description_lines:
        if not line.startswith("<meta ") and not line.startswith("<link "):
            long_description_lines.append(line)
    long_description = "\n".join(long_description_lines)
except IOError:
    long_description = 'Reliable Browser Automation & Testing Framework'

if sys.argv[-1] == 'publish':
    reply = None
    input_method = input
    if not sys.version_info[0] >= 3:
        input_method = raw_input  # noqa
    reply = str(input_method(
        '>>> Confirm release PUBLISH to PyPI? (yes/no): ')).lower().strip()
    if reply == 'yes':
        print("\n*** Checking code health with flake8:\n")
        flake8_status = os.system("flake8 --exclude=temp")
        if flake8_status != 0:
            print("\nWARNING! Fix flake8 issues before publishing to PyPI!\n")
            sys.exit()
        else:
            print("*** No flake8 issues detected. Continuing...")
        print("\n*** Rebuilding distribution packages: ***\n")
        os.system('rm -f dist/*.egg; rm -f dist/*.tar.gz; rm -f dist/*.whl')
        os.system('python setup.py sdist bdist_wheel')  # Create new tar/wheel
        print("\n*** Installing twine: *** (Required for PyPI uploads)\n")
        os.system("python -m pip install 'twine>=1.15.0'")
        print("\n*** Installing tqdm: *** (Required for PyPI uploads)\n")
        os.system("python -m pip install 'tqdm>=4.46.0'")
        print("\n*** Publishing The Release to PyPI: ***\n")
        os.system('python -m twine upload dist/*')  # Requires ~/.pypirc Keys
        print("\n*** The Release was PUBLISHED SUCCESSFULLY to PyPI! :) ***\n")
    else:
        print("\n>>> The Release was NOT PUBLISHED to PyPI! <<<\n")
    sys.exit()

setup(
    name='seleniumbase',
    version='1.38.2',
    description='Fast, Easy, and Reliable Browser Automation & Testing.',
    long_description=long_description,
    long_description_content_type='text/markdown',
    url='https://github.com/seleniumbase/SeleniumBase',
    platforms=["Windows", "Linux", "Mac OS-X"],
    author='Michael Mintz',
    author_email='mdmintz@gmail.com',
    maintainer='Michael Mintz',
    license="MIT",
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "Framework :: Pytest",
        "Intended Audience :: Developers",
        "Intended Audience :: Information Technology",
        "License :: OSI Approved :: MIT License",
        "Operating System :: MacOS :: MacOS X",
        "Operating System :: Microsoft :: Windows",
        "Operating System :: POSIX :: Linux",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Topic :: Internet",
        "Topic :: Scientific/Engineering",
        "Topic :: Software Development",
        "Topic :: Software Development :: Quality Assurance",
        "Topic :: Software Development :: Libraries",
        "Topic :: Software Development :: Testing",
        "Topic :: Software Development :: Testing :: Acceptance",
        "Topic :: Software Development :: Testing :: Traffic Generation",
        "Topic :: Utilities",
    ],
    install_requires=[
        'pip>=20.1',
        'setuptools',
        'setuptools-scm',
        'wheel',
        'six',
        'nose',
        'ipdb',
        'idna==2.9',  # Must stay in sync with "requests"
        'chardet==3.0.4',  # Must stay in sync with "requests"
        'urllib3==1.25.9',  # Must stay in sync with "requests"
        'requests==2.23.0',
        'selenium==3.141.0',
        'pluggy==0.13.1',
        'attrs>=19.3.0',
        'pytest==4.6.10;python_version<"3.5"',
        'pytest==5.4.2;python_version>="3.5"',
        'pytest-cov==2.8.1',
        'pytest-forked==1.1.3',
        'pytest-html==1.22.1;python_version<"3.6"',
        'pytest-html==2.0.1;python_version>="3.6"',
        'pytest-metadata==1.8.0;python_version<"3.6"',
        'pytest-metadata==1.9.0;python_version>="3.6"',
        'pytest-ordering==0.6',
        'pytest-rerunfailures==8.0;python_version<"3.6"',
        'pytest-rerunfailures==9.0;python_version>="3.6"',
        'pytest-xdist==1.32.0',
        'parameterized==0.7.4',
        'soupsieve==1.9.6;python_version<"3.5"',
        'soupsieve==2.0.1;python_version>="3.5"',
        'beautifulsoup4==4.9.1',
        'cryptography==2.9.2',
        'pyopenssl==19.1.0',
        'pygments==2.5.2;python_version<"3.5"',
        'pygments==2.6.1;python_version>="3.5"',
        'packaging>=20.3',
        'colorama==0.4.3',
        'brython==3.8.8',
        'pymysql==0.9.3',
        'coverage==5.1',
        'pyotp==2.3.0',
        'boto==2.49.0',
        'cffi==1.14.0',
        'flake8==3.7.9;python_version<"3.5"',
        'flake8==3.8.1;python_version>="3.5"',
        'pyflakes==2.1.1;python_version<"3.5"',
        'pyflakes==2.2.0;python_version>="3.5"',
        'certifi>=2020.4.5.1',
        'pdfminer.six==20191110;python_version<"3.5"',
        'pdfminer.six==20200517;python_version>="3.5"',
    ],
    packages=[
        'seleniumbase',
        'seleniumbase.common',
        'seleniumbase.config',
        'seleniumbase.console_scripts',
        'seleniumbase.core',
        'seleniumbase.drivers',
        'seleniumbase.extensions',
        'seleniumbase.fixtures',
        'seleniumbase.masterqa',
        'seleniumbase.plugins',
        'seleniumbase.translate',
        'seleniumbase.utilities',
        'seleniumbase.utilities.selenium_grid',
        'seleniumbase.utilities.selenium_ide',
        'seleniumbase.virtual_display',
    ],
    include_package_data=True,
    entry_points={
        'console_scripts': [
            'seleniumbase = seleniumbase.console_scripts.run:main',
        ],
        'nose.plugins': [
            'base_plugin = seleniumbase.plugins.base_plugin:Base',
            'selenium = seleniumbase.plugins.selenium_plugin:SeleniumBrowser',
            'page_source = seleniumbase.plugins.page_source:PageSource',
            'screen_shots = seleniumbase.plugins.screen_shots:ScreenShots',
            'test_info = seleniumbase.plugins.basic_test_info:BasicTestInfo',
            ('db_reporting = '
             'seleniumbase.plugins.db_reporting_plugin:DBReporting'),
            's3_logging = seleniumbase.plugins.s3_logging_plugin:S3Logging',
        ],
        'pytest11': ['seleniumbase = seleniumbase.plugins.pytest_plugin']
    }
)

# print(os.system("cat seleniumbase.egg-info/PKG-INFO"))
print("\n*** SeleniumBase Installation Complete! ***\n")
<|endoftext|>


<commit_before># coding=utf8
"""Test vnd.error."""

import uuid

import halogen
from halogen.vnd.error import Error, VNDError

class APIError(Error):

    def __init__(self, status_code, **kwargs):
        super(APIError, self).__init__(**kwargs)
        self.status_code = status_code
        self.logref = uuid.uuid4().hex

class AuthorSchema(halogen.Schema):

    name = halogen.Attr(required=True)

class PublisherSchema(halogen.Schema):

    name = halogen.Attr(required=True)
    address = halogen.Attr()

class BookSchema(halogen.Schema):

    title = halogen.Attr(required=True)
    year = halogen.Attr(halogen.types.Int(), required=True)
    authors = halogen.Attr(halogen.types.List(AuthorSchema), required=True)
    publisher = halogen.Attr(PublisherSchema)

def test_validation():
    try:
        BookSchema.deserialize(
            dict(
                # title is skipped
                year=u"☃bc",  # Not an integer
                authors=[dict(name="John Smith"), dict()],  # Second author has no name
                publisher=dict(address="Chasey Lane 42, Los Angeles, US"),  # No name
            ),
        )
    except halogen.exceptions.ValidationError as e:
        error = APIError.from_validation_exception(e, status_code=400)

    assert error.status_code == 400

    data = VNDError.serialize(error)
    assert uuid.UUID(data["logref"])
    assert data["message"] == "Validation error."

    expected_errors = [
        dict(path="/authors/1/name", message="Missing attribute."),
        dict(path="/title", message="Missing attribute."),
        dict(path="/year", message=u"'☃bc' is not an integer"),
        dict(path="/publisher/name", message="Missing attribute."),
    ]
    expected = {e["path"]: e for e in expected_errors}
    errors = {e["path"]: e for e in data["_embedded"]["errors"]}

    assert errors.keys() == expected.keys()
    for path, exp in expected.items():
        err = errors[path]
        assert exp == dict(err)
<commit_msg>Fixing test PR comment<commit_after># coding=utf8
"""Test vnd.error."""

import uuid

import halogen
from halogen.vnd.error import Error, VNDError

class APIError(Error):

    def __init__(self, status_code, **kwargs):
        super(APIError, self).__init__(**kwargs)
        self.status_code = status_code
        self.logref = uuid.uuid4().hex

class AuthorSchema(halogen.Schema):

    name = halogen.Attr(required=True)

class PublisherSchema(halogen.Schema):

    name = halogen.Attr(required=True)
    address = halogen.Attr()

class BookSchema(halogen.Schema):

    title = halogen.Attr(required=True)
    year = halogen.Attr(halogen.types.Int(), required=True)
    authors = halogen.Attr(halogen.types.List(AuthorSchema), required=True)
    publisher = halogen.Attr(PublisherSchema)

def test_validation():
    try:
        BookSchema.deserialize(
            dict(
                # title is skipped
                year=u"☃bc",  # Not an integer
                authors=[dict(name="John Smith"), dict()],  # Second author has no name
                publisher=dict(address="Chasey Lane 42, Los Angeles, US"),  # No name
            ),
        )
    except halogen.exceptions.ValidationError as e:
        error = APIError.from_validation_exception(e, status_code=400)

    assert error.status_code == 400

    data = VNDError.serialize(error)
    assert uuid.UUID(data["logref"])
    assert data["message"] == "Validation error."

    expected_errors = [
        dict(path="/authors/1/name", message="Missing attribute."),
        dict(path="/publisher/name", message="Missing attribute."),
        dict(path="/title", message="Missing attribute."),
        dict(path="/year", message=u"'☃bc' is not an integer"),
    ]

    assert data["_embedded"]["errors"] == expected_errors
<|endoftext|>


<commit_before>#!/usr/bin/python

import urllib2, json, traceback # ConfigParser, argparse	     #, logging
from datetime import timedelta, datetime, date
from string import join
from os import sys

from nat_lib import *
from reset_lib import NoGameException, NoTeamException, DabException

intRolloverLocalTime = 1000		# for resetter this is UTC because Lambda runs in UTC

#logLevel = logging.DEBUG
#logFN = "resetter.log"

def findGameNodes(sapiDict,team):
	ret = []

	if team.lower() in ("schedule","scoreboard"):
		for sapiDate in sapiDict["dates"]:
			ret = ret + sapiDate["games"]
	else:
		for sapiDate in sapiDict["dates"]:
			for gm in sapiDate["games"]:
				if ((gm["teams"]["home"]["team"]["abbreviation"] == team) or (gm["teams"]["away"]["team"]["abbreviation"] == team)):
					ret.append(gm)

	#print "I was called for " + team + " and I'm returning " + str(len(ret)) + " values"
	return ret

def buildVarsToCode():
	vtoc = {"schedule":"schedule", "scoreboard":"scoreboard"}
	for k in codeToVariants:
		for var in codeToVariants[k]:
			if var in vtoc:
				raise Exception("OOPS: trying to duplicate pointer " + var + " as " + k + ", it's already " + vtoc[var])
			else:
				vtoc[var] = k
				vtoc[var.lower()] = k
				vtoc[var.upper()] = k
		# and before we go, do k = k too
		vtoc[k] = k
		vtoc[k.lower()] = k	# it's already upper

	return vtoc

def placeAndScore(g):

	loc = g.get("location").split(",")[0]
	if not loc:
		reset = "at " + g.get("venue")
	elif loc == "Bronx":
		reset = "in the Bronx"
	else:
		reset = "in " + loc

	reset +=  ", "

	# score
	hruns = g.find("linescore/r").attrib["home"]
	aruns = g.find("linescore/r").attrib["away"]
	if int(hruns) > int(aruns):
		reset += (g.attrib["home_team_name"] + " " + hruns + ", " + g.attrib["away_team_name"] + " " + aruns)
	else:
		reset += (g.attrib["away_team_name"] + " " + aruns + ", " + g.attrib["home_team_name"] + " " + hruns)

	return reset

def is_doubleheader(g):
	return (g.get("double_header_sw") in ("Y","S"))

def getReset(g,team,fluidVerbose):
	if g == None:
		return "No game today."

	statNode = g.find("status")
	stat = statNode.get("status")
	reset = ""

	is_dh = is_doubleheader(g)

	if stat in PREGAME_STATUS_CODES:
		if fluidVerbose:
			reset += getProbables(g,team)
		else:
			reset += g.attrib["away_team_name"] + " at " + g.attrib["home_team_name"]
			if is_dh:
				reset += ' (game ' + str(g.attrib["game_nbr"]) + ')'
			reset += " starts at " + g.attrib["time"] + " " + g.attrib["time_zone"] + "."
		if stat in ANNOUNCE_STATUS_CODES:	# delayed start
			reset = reset[:-1] + " (" + stat.lower() + ")."

	if stat in UNDERWAY_STATUS_CODES:

		inningState = statNode.get("inning_state").lower()
		reset = placeAndScore(g) + ", " + inningState + " of the " + divOrdinal(statNode.get("inning")) + ". "

		# might have at, might have in as the front.
		if is_dh:
			reset = "Game " + g.get("game_nbr") + " " + reset
		else:
			reset = reset[0].upper() + reset[1:]

		if inningState in ("top","bottom"): 	#in play
			obstrs = { "0": "",	# don't need to say anything
						"1": "Runner on first. ",
						"2": "Runner on second. ",
						"3": "Runner on third. ",
						"4": "Runners on first and second. ",
						"5": "Runners on first and third. ",
						"6": "Runners on second and third. ",
				 		"7": "Bases loaded. "}
			onBaseStatus = g.find("runners_on_base").attrib["status"]
			reset += obstrs[onBaseStatus]

			outs = statNode.get("o")
			if outs == "0":
				reset += "No outs. "
			elif outs == "1":
				reset += outs + " out. "
			else:
				reset += outs + " outs. "

	if stat in FINAL_STATUS_CODES:
		reset += "Final "
		if is_dh:
			reset += "of game " + g.get("game_nbr") + " "
		reset += placeAndScore(g)
		if (int(statNode.get("inning")) != 9):
			reset += " in " + statNode.get("inning") + " innings"
		reset += ". "

	if (len(reset) == 0):
		# give up
		reset = g.attrib["away_team_name"] + " at " + g.attrib["home_team_name"]
		if is_dh:
			reset += ' (game ' + str(g.attrib["game_nbr"]) + ')'
		reset += " is " + stat.lower()

		if stat in POSTPONED_STATUS_CODES:
			try:
				desc = g.attrib["description"]
				if desc and len(desc.strip()) > 0:
					reset += " (" + desc + ")"
			except:
				pass

		reset += "."

	return reset

def loadSAPIScoreboard(sapiURL, scheduleDT):

	#logging.debug( "Running scoreboard for " + scheduleDT.strftime("%Y-%m-%d"))
	scheduleUrl = scheduleDT.strftime(sapiURL)

	try:
		usock = urllib2.urlopen(scheduleUrl,timeout=10)
		sapiDict = json.load(usock)
		return sapiDict

	#except socket.timeout as e:
	except urllib2.HTTPError as e:
		print "HTTP " + str(e.code) + " on URL: " + scheduleUrl
		#if e.code in (404,403,500,410):
		#elif e.code != 200:
	#except urllib2.URLError as e:
	except Exception as e:
		print "WENT WRONG: " + e.__module__ + "." + e.__class__.__name__

	return None

def getPitcher(g,ah):
	if ah not in ("away","home"):
		return None

	try:
		pitcher = g.find(ah + "_probable_pitcher")
		pstr = pitcher.get("name_display_roster")
	except:
		return None
	if "," in pstr:
		pstr = pstr + "."
	if pstr == "":
		pstr = "TBA"
	else:
		pstr = pstr + " " + pitcher.get("wins") + "-" + pitcher.get("losses") + ", " + pitcher.get("era")
	return (g.get(ah + "_team_city") + " (" + pstr + ")")

def getProbables(g,tvTeam=None):
	if g == None:
		return None

	awayAbbr = g.attrib["away_name_abbrev"]
	homeAbbr = g.attrib["home_name_abbrev"]

	runningStr = getPitcher(g,"away") + " at " + getPitcher(g,"home")

	if is_doubleheader(g):
		runningStr += ' (game ' + str(g.attrib["game_nbr"]) + ')'

	runningStr += " starts at " + g.attrib["time"] + " " + g.attrib["time_zone"] + "."

	if tvTeam and (tvTeam not in ("suppress","scoreboard","schedule")):
		# lazy default here
		bc = "home"
		if tvTeam == awayAbbr:
			bc = "away"
		try:
			bcast = g.find("broadcast").find(bc).find("tv").text
			if bcast:
				runningStr += " TV broadcast is on " + bcast + "."
			else:
				runningStr += " No TV."
		except Exception, e:
			print "bcast exception:" + str(e)
			pass

	return runningStr

def launch(team,fluidVerbose=True,rewind=False,ffwd=False):

	#logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s',filename=logFN, level=logLevel)

	localRollover = intRolloverLocalTime

	# for testing
	if rewind:
		# force yesterday's games by making the rollover absurd.
		localRollover += 2400
	if ffwd:
		localRollover -= 2400

	vtoc = buildVarsToCode()

	teamLiteral = team
	team = team.strip().lower()

	if team in dabList:
		#return ["Did you mean " + join(dabList[team.lower()]," or ") + "?"]
		raise DabException(dabList[team])
	elif team not in vtoc:
		raise NoTeamException

	todayDT = datetime.now() - timedelta(minutes=((localRollover/100)*60+(localRollover%100)))

	sapiScoreboard = loadSAPIScoreboard(statsApiScheduleUrl,todayDT)

	if sapiScoreboard:
		gns = findGameNodes(sapiScoreboard,vtoc[team])
	else:
		gns = []

	if len(gns) == 0:
		if team in ("schedule","scoreboard"):
			ngstr = "No games today in MLB."
		else:
			ngstr = "No game today for " + team + "."
		raise NoGameException(ngstr)

	rv = []
	for gn in gns:
		rv.append(getReset(gn,vtoc[team],fluidVerbose))

	return rv

<commit_msg>cleanup, is_doubleheader, game status<commit_after>#!/usr/bin/python

import urllib2, json, traceback
from datetime import timedelta, datetime, date
from string import join
from os import sys

from nat_lib import *
from reset_lib import NoGameException, NoTeamException, DabException

intRolloverLocalTime = 1000		# for resetter this is UTC because Lambda runs in UTC

#logLevel = logging.DEBUG
#logFN = "resetter.log"

def findGameNodes(sapiDict,team):
	ret = []

	if team.lower() in ("schedule","scoreboard"):
		for sapiDate in sapiDict["dates"]:
			ret = ret + sapiDate["games"]
	else:
		for sapiDate in sapiDict["dates"]:
			for gm in sapiDate["games"]:
				if ((gm["teams"]["home"]["team"]["abbreviation"] == team) or (gm["teams"]["away"]["team"]["abbreviation"] == team)):
					ret.append(gm)

	return ret

def buildVarsToCode():
	vtoc = {"schedule":"schedule", "scoreboard":"scoreboard"}
	for k in codeToVariants:
		for var in codeToVariants[k]:
			if var in vtoc:
				raise Exception("OOPS: trying to duplicate pointer " + var + " as " + k + ", it's already " + vtoc[var])
			else:
				vtoc[var] = k
				vtoc[var.lower()] = k
				vtoc[var.upper()] = k
		# and before we go, do k = k too
		vtoc[k] = k
		vtoc[k.lower()] = k	# it's already upper

	return vtoc

def placeAndScore(g):

	loc = g.get("location").split(",")[0]
	if not loc:
		reset = "at " + g.get("venue")
	elif loc == "Bronx":
		reset = "in the Bronx"
	else:
		reset = "in " + loc

	reset +=  ", "

	# score
	hruns = g.find("linescore/r").attrib["home"]
	aruns = g.find("linescore/r").attrib["away"]
	if int(hruns) > int(aruns):
		reset += (g.attrib["home_team_name"] + " " + hruns + ", " + g.attrib["away_team_name"] + " " + aruns)
	else:
		reset += (g.attrib["away_team_name"] + " " + aruns + ", " + g.attrib["home_team_name"] + " " + hruns)

	return reset

def is_doubleheader(g):
	return (g["doubleHeader"] in ("Y","S"))

def getReset(g,team,fluidVerbose):
	if g == None:
		return "No game today."

	stat = g["status"]["detailedState"]
	reset = ""

	is_dh = is_doubleheader(g)

	if stat in PREGAME_STATUS_CODES:
		if fluidVerbose:
			reset += getProbables(g,team)
		else:
			reset += g.attrib["away_team_name"] + " at " + g.attrib["home_team_name"]
			if is_dh:
				reset += ' (game ' + str(g.attrib["game_nbr"]) + ')'
			reset += " starts at " + g.attrib["time"] + " " + g.attrib["time_zone"] + "."
		if stat in ANNOUNCE_STATUS_CODES:	# delayed start
			reset = reset[:-1] + " (" + stat.lower() + ")."

	if stat in UNDERWAY_STATUS_CODES:

		inningState = statNode.get("inning_state").lower()
		reset = placeAndScore(g) + ", " + inningState + " of the " + divOrdinal(statNode.get("inning")) + ". "

		# might have at, might have in as the front.
		if is_dh:
			reset = "Game " + g.get("game_nbr") + " " + reset
		else:
			reset = reset[0].upper() + reset[1:]

		if inningState in ("top","bottom"): 	#in play
			obstrs = { "0": "",	# don't need to say anything
						"1": "Runner on first. ",
						"2": "Runner on second. ",
						"3": "Runner on third. ",
						"4": "Runners on first and second. ",
						"5": "Runners on first and third. ",
						"6": "Runners on second and third. ",
				 		"7": "Bases loaded. "}
			onBaseStatus = g.find("runners_on_base").attrib["status"]
			reset += obstrs[onBaseStatus]

			outs = statNode.get("o")
			if outs == "0":
				reset += "No outs. "
			elif outs == "1":
				reset += outs + " out. "
			else:
				reset += outs + " outs. "

	if stat in FINAL_STATUS_CODES:
		reset += "Final "
		if is_dh:
			reset += "of game " + g.get("game_nbr") + " "
		reset += placeAndScore(g)
		if (int(statNode.get("inning")) != 9):
			reset += " in " + statNode.get("inning") + " innings"
		reset += ". "

	if (len(reset) == 0):
		# give up
		reset = g.attrib["away_team_name"] + " at " + g.attrib["home_team_name"]
		if is_dh:
			reset += ' (game ' + str(g.attrib["game_nbr"]) + ')'
		reset += " is " + stat.lower()

		if stat in POSTPONED_STATUS_CODES:
			try:
				desc = g.attrib["description"]
				if desc and len(desc.strip()) > 0:
					reset += " (" + desc + ")"
			except:
				pass

		reset += "."

	return reset

def loadSAPIScoreboard(sapiURL, scheduleDT):

	#logging.debug( "Running scoreboard for " + scheduleDT.strftime("%Y-%m-%d"))
	scheduleUrl = scheduleDT.strftime(sapiURL)

	try:
		usock = urllib2.urlopen(scheduleUrl,timeout=10)
		sapiDict = json.load(usock)
		return sapiDict

	#except socket.timeout as e:
	except urllib2.HTTPError as e:
		print "HTTP " + str(e.code) + " on URL: " + scheduleUrl
		#if e.code in (404,403,500,410):
		#elif e.code != 200:
	#except urllib2.URLError as e:
	except Exception as e:
		print "WENT WRONG: " + e.__module__ + "." + e.__class__.__name__

	return None

def getPitcher(g,ah):
	if ah not in ("away","home"):
		return None

	try:
		pitcher = g.find(ah + "_probable_pitcher")
		pstr = pitcher.get("name_display_roster")
	except:
		return None
	if "," in pstr:
		pstr = pstr + "."
	if pstr == "":
		pstr = "TBA"
	else:
		pstr = pstr + " " + pitcher.get("wins") + "-" + pitcher.get("losses") + ", " + pitcher.get("era")
	return (g.get(ah + "_team_city") + " (" + pstr + ")")

def getProbables(g,tvTeam=None):
	if g == None:
		return None

	awayAbbr = g.attrib["away_name_abbrev"]
	homeAbbr = g.attrib["home_name_abbrev"]

	runningStr = getPitcher(g,"away") + " at " + getPitcher(g,"home")

	if is_doubleheader(g):
		runningStr += ' (game ' + str(g.attrib["game_nbr"]) + ')'

	runningStr += " starts at " + g.attrib["time"] + " " + g.attrib["time_zone"] + "."

	if tvTeam and (tvTeam not in ("suppress","scoreboard","schedule")):
		# lazy default here
		bc = "home"
		if tvTeam == awayAbbr:
			bc = "away"
		try:
			bcast = g.find("broadcast").find(bc).find("tv").text
			if bcast:
				runningStr += " TV broadcast is on " + bcast + "."
			else:
				runningStr += " No TV."
		except Exception, e:
			print "bcast exception:" + str(e)
			pass

	return runningStr

def launch(team,fluidVerbose=True,rewind=False,ffwd=False):

	#logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s',filename=logFN, level=logLevel)

	localRollover = intRolloverLocalTime

	# for testing
	if rewind:
		# force yesterday's games by making the rollover absurd.
		localRollover += 2400
	if ffwd:
		localRollover -= 2400

	vtoc = buildVarsToCode()

	teamLiteral = team
	team = team.strip().lower()

	if team in dabList:
		#return ["Did you mean " + join(dabList[team.lower()]," or ") + "?"]
		raise DabException(dabList[team])
	elif team not in vtoc:
		raise NoTeamException

	todayDT = datetime.now() - timedelta(minutes=((localRollover/100)*60+(localRollover%100)))

	sapiScoreboard = loadSAPIScoreboard(statsApiScheduleUrl,todayDT)

	if sapiScoreboard:
		gns = findGameNodes(sapiScoreboard,vtoc[team])
	else:
		gns = []

	if len(gns) == 0:
		if team in ("schedule","scoreboard"):
			ngstr = "No games today in MLB."
		else:
			ngstr = "No game today for " + team + "."
		raise NoGameException(ngstr)

	rv = []
	for gn in gns:
		rv.append(getReset(gn,vtoc[team],fluidVerbose))

	return rv

<|endoftext|>