<commit_before>import maya.mel as mel
from StringIO import StringIO
import constants

_is_widget  = lambda helptext: 'dragCallback' in helptext
_is_layout = lambda helptext: 'childArray' in helptext
__layout_cmds = []  # filled out on module initialize
__control_cmds = [] # filled out on module initialize
for item in mel.eval('help -list "*"'):
    help = mel.eval('help %s' % item)
    if _is_widget(help):
        if _is_layout(help):
            __layout_cmds.append(item)
        else:
            __control_cmds.append(item)

class CommandInfo(object):
    '''
    This class uses the mel help strings for commands to generate class wrapper classes
    '''
    DEFAULTS = constants.CONTROL_ATTRIBS
    INHERITS = 'Control'

    def __init__(self, name, **flags ):
        self.Name = name
        self.Flags = flags

    def template(self):
        code = StringIO()
        code.write('class %s(%s):\n' % (self.Name[0].upper() + self.Name[1:], self.INHERITS))
        code.write("    '''Wrapper class for cmds.%s'''\n"  % self.Name)
        code.write('    CMD = cmds.%s\n' % self.Name)
        attribs = [k for k in self.Flags.values() if not k in self.DEFAULTS]
        ##attribs += [k for k in self.Flags.keys() if not k in _CONTROL_ATTRIBS]
        attribs.sort()
        # note this deliberately excludes short names of callbacks!
        callbacks = [c for c in attribs if 'Command' in c or 'Callback' in c]
        attribs = list(set(attribs) - set(callbacks))
        quoted = lambda p : "'%s'" % p
        attrib_names = map (quoted, attribs)
        code.write('    _ATTRIBS = [%s]\n' %','.join(attrib_names))
        callback_names = map (quoted, callbacks)
        code.write('    _CALLBACKS = [%s]\n' %','.join(callback_names))
        return code.getvalue()

    @classmethod
    def from_command(cls, commandname):
        if hasattr(commandname, "__name__"): commandname = commandname.__name__
        helptext  = mel.eval("help %s;" % commandname)
        if not helptext: raise RuntimeError, 'no command "%s" found' % commandname
        results = {}
        for line in helptext.split("\n")[4:-2]:
            tokens = line.split()
            if len(tokens) > 1:
                results[str(tokens[0][1:])] = str(tokens[1][1:])
        return cls(commandname, **results)

class LayoutInfo(CommandInfo):
    DEFAULTS = constants.CONTROL_ATTRIBS + constants.LAYOUT_ATTRIBS
    INHERITS = 'Layout'

def generate_controls(filename):
    with open (filename, 'wt') as filehandle:
        filehandle.write("'''\nmGui wrapper classes\n\nAuto-generated wrapper classes for use with mGui\n'''\n\n")
        filehandle.write('import maya.cmds as cmds\n')
        filehandle.write('from .core import Control\n')

        for each_class in constants.CONTROL_COMMANDS:
            try:
                filehandle.write(CommandInfo.from_command(each_class).template())
                filehandle.write('\n\n')
            except RuntimeError:
                filehandle.write("# command '%s' not present in this maya" % each_class)

def generate_layouts(filename):
    with open (filename, 'wt') as filehandle:
        filehandle.write("'''\nmGui wrapper classes\n\nAuto-generated wrapper classes for use with mGui\n'''\n\n")
        filehandle.write('import maya.cmds as cmds\n')
        filehandle.write('from .core import Layout\n\n')
        for each_class in constants.LAYOUT_COMMANDS:
            try:
                filehandle.write(LayoutInfo.from_command(each_class).template())
                filehandle.write('\n\n')
            except RuntimeError:
                filehandle.write("# command '%s' not present in this maya" % each_class)

            <commit_msg>tweaks to default settibgs<commit_after>import maya.mel as mel
from StringIO import StringIO
import constants
import mGui.core as core

_is_widget  = lambda helptext: 'dragCallback' in helptext
_is_layout = lambda helptext: 'childArray' in helptext
__layout_cmds = []  # filled out on module initialize
__control_cmds = [] # filled out on module initialize
for item in mel.eval('help -list "*"'):
    help = mel.eval('help %s' % item)
    if _is_widget(help):
        if _is_layout(help):
            __layout_cmds.append(item)
        else:
            __control_cmds.append(item)

class CommandInfo(object):
    '''
    This class uses the mel help strings for commands to generate class wrapper classes
    '''
    DEFAULTS = core.Control._ATTRIBS + core.Control._READ_ONLY
    INHERITS = 'Control'

    def __init__(self, name, **flags ):
        self.Name = name
        self.Flags = flags

    def template(self):
        code = StringIO()
        code.write('class %s(%s):\n' % (self.Name[0].upper() + self.Name[1:], self.INHERITS))
        code.write("    '''Wrapper class for cmds.%s'''\n"  % self.Name)
        code.write('    CMD = cmds.%s\n' % self.Name)
        attribs = [k for k in self.Flags.values() if not k in self.DEFAULTS]
        attribs.sort()
        callbacks = [c for c in attribs if 'ommand' in c or 'allback' in c]
        attribs = list(set(attribs) - set(callbacks))
        quoted = lambda p : "'%s'" % p
        attrib_names = map (quoted, attribs)
        code.write('    _ATTRIBS = [%s]\n' %','.join(attrib_names))
        callback_names = map (quoted, callbacks)
        code.write('    _CALLBACKS = [%s]\n' %','.join(callback_names))
        return code.getvalue()

    @classmethod
    def from_command(cls, commandname):
        if hasattr(commandname, "__name__"): commandname = commandname.__name__
        helptext  = mel.eval("help %s;" % commandname)
        if not helptext: raise RuntimeError, 'no command "%s" found' % commandname
        results = {}
        for line in helptext.split("\n")[4:-2]:
            tokens = line.split()
            if len(tokens) > 1:
                results[str(tokens[0][1:])] = str(tokens[1][1:])
        return cls(commandname, **results)

class LayoutInfo(CommandInfo):
    DEFAULTS = core.Layout._ATTRIBS + core.Layout._READ_ONLY
    INHERITS = 'Layout'

def generate_controls(filename):
    with open (filename, 'wt') as filehandle:
        filehandle.write("'''\nmGui wrapper classes\n\nAuto-generated wrapper classes for use with mGui\n'''\n\n")
        filehandle.write('import maya.cmds as cmds\n')
        filehandle.write('from .core import Control\n')

        for each_class in constants.CONTROL_COMMANDS:
            try:
                filehandle.write(CommandInfo.from_command(each_class).template())
                filehandle.write('\n\n')
            except RuntimeError:
                filehandle.write("# command '%s' not present in this maya" % each_class)

def generate_layouts(filename):
    with open (filename, 'wt') as filehandle:
        filehandle.write("'''\nmGui wrapper classes\n\nAuto-generated wrapper classes for use with mGui\n'''\n\n")
        filehandle.write('import maya.cmds as cmds\n')
        filehandle.write('from .core import Layout\n\n')
        for each_class in constants.LAYOUT_COMMANDS:
            try:
                filehandle.write(LayoutInfo.from_command(each_class).template())
                filehandle.write('\n\n')
            except RuntimeError:
                filehandle.write("# command '%s' not present in this maya" % each_class)

            <|endoftext|>


<commit_before>from setuptools import setup

setup(
    name="ftfy",
    version='2.0.1',
    maintainer='Luminoso, LLC',
    maintainer_email='dev@lumino.so',
    license="MIT",
    url='http://github.com/LuminosoInsight/python-ftfy',
    platforms=["any"],
    description="Fixes some problems with Unicode text after the fact",
    packages=['ftfy'],
    classifiers=[
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.6",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.2",
        "Programming Language :: Python :: 3.3",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Topic :: Text Processing :: Filters",
        "Development Status :: 5 - Production/Stable"
    ],
    entry_points={
        'console_scripts': [
            'ftfy = ftfy.cli:main'
        ]
    }
)
<commit_msg>bugfix release 2.0.2<commit_after>from setuptools import setup

setup(
    name="ftfy",
    version='2.0.2',
    maintainer='Luminoso, LLC',
    maintainer_email='dev@lumino.so',
    license="MIT",
    url='http://github.com/LuminosoInsight/python-ftfy',
    platforms=["any"],
    description="Fixes some problems with Unicode text after the fact",
    packages=['ftfy'],
    classifiers=[
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.6",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.2",
        "Programming Language :: Python :: 3.3",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Topic :: Text Processing :: Filters",
        "Development Status :: 5 - Production/Stable"
    ],
    entry_points={
        'console_scripts': [
            'ftfy = ftfy.cli:main'
        ]
    }
)
<|endoftext|>


<commit_before>from __future__ import unicode_literals

import re
from setuptools import setup, find_packages

def get_version(filename):
    content = open(filename).read()
    metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content))
    return metadata['version']

setup(
    name='Mopidy-Podcast-iTunes',
    version=get_version('mopidy_podcast_itunes/__init__.py'),
    url='https://github.com/tkem/mopidy-podcast-itunes',
    license='Apache License, Version 2.0',
    author='Thomas Kemmer',
    author_email='tkemmer@computer.org',
    description='Mopidy-Podcast extension for searching and browsing Podcasts on the iTunes Store',  # noqa
    long_description=open('README.rst').read(),
    packages=find_packages(exclude=['tests', 'tests.*']),
    zip_safe=False,
    include_package_data=True,
    install_requires=[
        'setuptools',
        'Mopidy >= 0.18',
        'Pykka >= 1.1',
        'requests >= 2.0.0',
    ],
    test_suite='nose.collector',
    tests_require=[
        'nose',
        'mock >= 1.0',
    ],
    entry_points={
        'mopidy.ext': [
            'podcast-itunes = mopidy_podcast_itunes:Extension',
        ],
    },
    classifiers=[
        'Environment :: No Input/Output (Daemon)',
        'Intended Audience :: End Users/Desktop',
        'License :: OSI Approved :: Apache Software License',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 2',
        'Topic :: Multimedia :: Sound/Audio :: Players',
    ],
)
<commit_msg>Add dependency on Mopidy-Podcast<commit_after>from __future__ import unicode_literals

import re
from setuptools import setup, find_packages

def get_version(filename):
    content = open(filename).read()
    metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content))
    return metadata['version']

setup(
    name='Mopidy-Podcast-iTunes',
    version=get_version('mopidy_podcast_itunes/__init__.py'),
    url='https://github.com/tkem/mopidy-podcast-itunes',
    license='Apache License, Version 2.0',
    author='Thomas Kemmer',
    author_email='tkemmer@computer.org',
    description='Mopidy-Podcast extension for searching and browsing Podcasts on the iTunes Store',  # noqa
    long_description=open('README.rst').read(),
    packages=find_packages(exclude=['tests', 'tests.*']),
    zip_safe=False,
    include_package_data=True,
    install_requires=[
        'setuptools',
        'Mopidy >= 0.18',
        'Mopidy-Podcast >= 0.3.0',
        'requests >= 2.0.0',
    ],
    test_suite='nose.collector',
    tests_require=[
        'nose',
        'mock >= 1.0',
    ],
    entry_points={
        'mopidy.ext': [
            'podcast-itunes = mopidy_podcast_itunes:Extension',
        ],
    },
    classifiers=[
        'Environment :: No Input/Output (Daemon)',
        'Intended Audience :: End Users/Desktop',
        'License :: OSI Approved :: Apache Software License',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 2',
        'Topic :: Multimedia :: Sound/Audio :: Players',
    ],
)
<|endoftext|>


<commit_before>
import sys

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

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

    def run_tests(self):
        import pytest
        errno = pytest.main(self.test_args)
        sys.exit(errno)

requires = [
    'PyYAML >= 3.11, < 5.0',
    'click >= 7.0, < 8.0',
    'flask >= 1.0, < 2.0',
    'markdown >= 3.0, < 4.0',
    'plotly >= 3.0, < 4.0',
    'blessings >= 1.7, < 2.0',
    'elsa >= 0.1.5, < 1.0',
    'networkx >= 2.2, < 3.0',
]

tests_require = ['pytest']

setup_args = dict(
    name='portingdb',
    version='0.1',
    packages=['portingdb'],
    url='https://github.com/fedora-python/portingdb',

    description="""Database of packages that need Python 3 porting""",
    author='Petr Viktorin',
    author_email='pviktori@redhat.com',
    classifiers=[
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
    ],

    install_requires=requires,

    tests_require=tests_require,
    cmdclass={'test': PyTest},

)

if __name__ == '__main__':
    setup(**setup_args)
<commit_msg>Require python-bugzilla<commit_after>
import sys

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

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

    def run_tests(self):
        import pytest
        errno = pytest.main(self.test_args)
        sys.exit(errno)

requires = [
    'PyYAML >= 3.11, < 5.0',
    'click >= 7.0, < 8.0',
    'flask >= 1.0, < 2.0',
    'markdown >= 3.0, < 4.0',
    'plotly >= 3.0, < 4.0',
    'blessings >= 1.7, < 2.0',
    'elsa >= 0.1.5, < 1.0',
    'networkx >= 2.2, < 3.0',
    'python-bugzilla >= 2.5, < 3.0',
]

tests_require = ['pytest']

setup_args = dict(
    name='portingdb',
    version='0.1',
    packages=['portingdb'],
    url='https://github.com/fedora-python/portingdb',

    description="""Database of packages that need Python 3 porting""",
    author='Petr Viktorin',
    author_email='pviktori@redhat.com',
    classifiers=[
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
    ],

    install_requires=requires,

    tests_require=tests_require,
    cmdclass={'test': PyTest},

)

if __name__ == '__main__':
    setup(**setup_args)
<|endoftext|>


<commit_before># coding=utf-8

########################################################################################################################
### Do not forget to adjust the following variables to your own plugin.

# The plugin's identifier, has to be unique
plugin_identifier = "tempsgraph"

# The plugin's python package, should be "octoprint_<plugin identifier>", has to be unique
plugin_package = "octoprint_tempsgraph"

# The plugin's human readable name. Can be overwritten within OctoPrint's internal data via __plugin_name__ in the
# plugin module
plugin_name = "OctoPrint-Tempsgraph"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "0.3.3"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
plugin_description = """Interactive temperature graph"""

# The plugin's author. Can be overwritten within OctoPrint's internal data via __plugin_author__ in the plugin module
plugin_author = "Robin Vanhove"

# The plugin's author's mail address.
plugin_author_email = "1r0b1n0@gmail.com"

# The plugin's homepage URL. Can be overwritten within OctoPrint's internal data via __plugin_url__ in the plugin module
plugin_url = "https://github.com/1r0b1n0/OctoPrint-Tempsgraph"

# The plugin's license. Can be overwritten within OctoPrint's internal data via __plugin_license__ in the plugin module
plugin_license = "MIT"

# Any additional requirements besides OctoPrint should be listed here
plugin_requires = []

### --------------------------------------------------------------------------------------------------------------------
### More advanced options that you usually shouldn't have to touch follow after this point
### --------------------------------------------------------------------------------------------------------------------

# Additional package data to install for this plugin. The subfolders "templates", "static" and "translations" will
# already be installed automatically if they exist.
plugin_additional_data = []

# Any additional python packages you need to install with your plugin that are not contained in <plugin_package>.*
plugin_additional_packages = []

# Any python packages within <plugin_package>.* you do NOT want to install with your plugin
plugin_ignored_packages = []

# Additional parameters for the call to setuptools.setup. If your plugin wants to register additional entry points,
# define dependency links or other things like that, this is the place to go. Will be merged recursively with the
# default setup parameters as provided by octoprint_setuptools.create_plugin_setup_parameters using
# octoprint.util.dict_merge.
#
# Example:
#     plugin_requires = ["someDependency==dev"]
#     additional_setup_parameters = {"dependency_links": ["https://github.com/someUser/someRepo/archive/master.zip#egg=someDependency-dev"]}
additional_setup_parameters = {}

########################################################################################################################

from setuptools import setup

try:
	import octoprint_setuptools
except:
	print("Could not import OctoPrint's setuptools, are you sure you are running that under "
	      "the same python installation that OctoPrint is installed under?")
	import sys
	sys.exit(-1)

setup_parameters = octoprint_setuptools.create_plugin_setup_parameters(
	identifier=plugin_identifier,
	package=plugin_package,
	name=plugin_name,
	version=plugin_version,
	description=plugin_description,
	author=plugin_author,
	mail=plugin_author_email,
	url=plugin_url,
	license=plugin_license,
	requires=plugin_requires,
	additional_packages=plugin_additional_packages,
	ignored_packages=plugin_ignored_packages,
	additional_data=plugin_additional_data
)

if len(additional_setup_parameters):
	from octoprint.util import dict_merge
	setup_parameters = dict_merge(setup_parameters, additional_setup_parameters)

setup(**setup_parameters)
<commit_msg>increase version to 0.3.4<commit_after># coding=utf-8

########################################################################################################################
### Do not forget to adjust the following variables to your own plugin.

# The plugin's identifier, has to be unique
plugin_identifier = "tempsgraph"

# The plugin's python package, should be "octoprint_<plugin identifier>", has to be unique
plugin_package = "octoprint_tempsgraph"

# The plugin's human readable name. Can be overwritten within OctoPrint's internal data via __plugin_name__ in the
# plugin module
plugin_name = "OctoPrint-Tempsgraph"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "0.3.4"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
plugin_description = """Interactive temperature graph"""

# The plugin's author. Can be overwritten within OctoPrint's internal data via __plugin_author__ in the plugin module
plugin_author = "Robin Vanhove"

# The plugin's author's mail address.
plugin_author_email = "1r0b1n0@gmail.com"

# The plugin's homepage URL. Can be overwritten within OctoPrint's internal data via __plugin_url__ in the plugin module
plugin_url = "https://github.com/1r0b1n0/OctoPrint-Tempsgraph"

# The plugin's license. Can be overwritten within OctoPrint's internal data via __plugin_license__ in the plugin module
plugin_license = "MIT"

# Any additional requirements besides OctoPrint should be listed here
plugin_requires = []

### --------------------------------------------------------------------------------------------------------------------
### More advanced options that you usually shouldn't have to touch follow after this point
### --------------------------------------------------------------------------------------------------------------------

# Additional package data to install for this plugin. The subfolders "templates", "static" and "translations" will
# already be installed automatically if they exist.
plugin_additional_data = []

# Any additional python packages you need to install with your plugin that are not contained in <plugin_package>.*
plugin_additional_packages = []

# Any python packages within <plugin_package>.* you do NOT want to install with your plugin
plugin_ignored_packages = []

# Additional parameters for the call to setuptools.setup. If your plugin wants to register additional entry points,
# define dependency links or other things like that, this is the place to go. Will be merged recursively with the
# default setup parameters as provided by octoprint_setuptools.create_plugin_setup_parameters using
# octoprint.util.dict_merge.
#
# Example:
#     plugin_requires = ["someDependency==dev"]
#     additional_setup_parameters = {"dependency_links": ["https://github.com/someUser/someRepo/archive/master.zip#egg=someDependency-dev"]}
additional_setup_parameters = {}

########################################################################################################################

from setuptools import setup

try:
	import octoprint_setuptools
except:
	print("Could not import OctoPrint's setuptools, are you sure you are running that under "
	      "the same python installation that OctoPrint is installed under?")
	import sys
	sys.exit(-1)

setup_parameters = octoprint_setuptools.create_plugin_setup_parameters(
	identifier=plugin_identifier,
	package=plugin_package,
	name=plugin_name,
	version=plugin_version,
	description=plugin_description,
	author=plugin_author,
	mail=plugin_author_email,
	url=plugin_url,
	license=plugin_license,
	requires=plugin_requires,
	additional_packages=plugin_additional_packages,
	ignored_packages=plugin_ignored_packages,
	additional_data=plugin_additional_data
)

if len(additional_setup_parameters):
	from octoprint.util import dict_merge
	setup_parameters = dict_merge(setup_parameters, additional_setup_parameters)

setup(**setup_parameters)
<|endoftext|>


<commit_before>from distutils.core import setup
from distutils.extension import Extension

noaho_module = Extension("noaho",
                         sources = ["noaho/noaho.cpp", "noaho/array-aho.cpp"],
                         depends = ["noaho/array-aho.h", "noaho/HashMap.h", "noaho/LinearHashTable.h",
                                    'noaho/noaho.pyx']
                         )

version = "0.9.02"

setup(name = "NoAho",
      version=version,
      author="Jeff Donner",
      author_email="jeffrey.donner@gmail.com",
      maintainer="Jeff Donner",
      maintainer_email="jeffrey.donner@gmail.com",
      url="https://github.com/JDonner/NoAho",
      download_url="http://pypi.python.org/packages/source/N/NoAho/NoAho-%s.tar.gz" % version,
      description="Fast, non-overlapping simultaneous multiple keyword search",
      long_description = open('README.txt').read(),
      ext_modules = [noaho_module],
      packages = ['noaho'],

      classifiers = [
        'Intended Audience :: Developers',
        'Intended Audience :: Information Technology',
        'License :: OSI Approved :: MIT License',
        "Development Status :: 4 - Beta",
        'Programming Language :: C++',
        'Programming Language :: Cython',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.0',
        'Programming Language :: Python :: 3.1',
        'Programming Language :: Python :: 3.2',
        'Operating System :: OS Independent',
        "Environment :: Console",
        'Topic :: Text Processing',
        ]
      )
<commit_msg>Clean setup.py and remove module=['noaho'] to fix a weird install bug<commit_after>from distutils.core import setup
from distutils.extension import Extension

noaho_module = Extension(
    "noaho",
    sources=["noaho/noaho.cpp", "noaho/array-aho.cpp"],
    depends=[
        "noaho/array-aho.h",
        "noaho/HashMap.h",
        "noaho/LinearHashTable.h",
        'noaho/noaho.pyx']
)

version = "0.9.02"

setup(
    name="NoAho",
    version=version,
    author="Jeff Donner",
    author_email="jeffrey.donner@gmail.com",
    maintainer="Jeff Donner",
    maintainer_email="jeffrey.donner@gmail.com",
    url="https://github.com/JDonner/NoAho",
    download_url="http://pypi.python.org/packages/source/N/NoAho/NoAho-%s.tar.gz" % version,
    description="Fast, non-overlapping simultaneous multiple keyword search",
    long_description=open('README.txt').read(),
    ext_modules=[noaho_module],
    classifiers=[
        'Intended Audience :: Developers',
        'Intended Audience :: Information Technology',
        'License :: OSI Approved :: MIT License',
        "Development Status :: 4 - Beta",
        'Programming Language :: C++',
        'Programming Language :: Cython',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.0',
        'Programming Language :: Python :: 3.1',
        'Programming Language :: Python :: 3.2',
        'Operating System :: OS Independent',
        "Environment :: Console",
        'Topic :: Text Processing',
    ]
)
<|endoftext|>


<commit_before>from setuptools import setup
from os import path
import codecs

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

with codecs.open(path.join(here, 'README.rst'), encoding='utf-8') as f:
    long_description = f.read()

setup(
    name='mri_meta_extract',
    version='1.1.5',
    url='https://github.com/LREN-CHUV/mri-meta-extract',
    description='Extract meta-data from DICOM and NIFTI files',
    long_description=long_description,
    author='Mirco Nasuti',
    author_email='mirco.nasuti@chuv.ch',
    license='Apache 2.0',
    packages=['mri_meta_extract'],
    extras_require={
        'test': ['unittest'],
    },
    install_requires=['airflow', 'pydicom', 'sqlalchemy']
)
<commit_msg>update version number<commit_after>from setuptools import setup
from os import path
import codecs

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

with codecs.open(path.join(here, 'README.rst'), encoding='utf-8') as f:
    long_description = f.read()

setup(
    name='mri_meta_extract',
    version='1.1.6',
    url='https://github.com/LREN-CHUV/mri-meta-extract',
    description='Extract meta-data from DICOM and NIFTI files',
    long_description=long_description,
    author='Mirco Nasuti',
    author_email='mirco.nasuti@chuv.ch',
    license='Apache 2.0',
    packages=['mri_meta_extract'],
    extras_require={
        'test': ['unittest'],
    },
    install_requires=['airflow', 'pydicom', 'sqlalchemy']
)
<|endoftext|>


<commit_before># -*- coding: utf-8 -*-
"""
MVC Web Application Framework with Tornado, Python 2 and 3

To install the package run:

    pip install dp-tornado

Run
-----

    $ pip install virtualenv
    $ virtualenv ./venv
    $ . ./venv/bin/activate
    $ pip install dp-tornado
    $ dp4p init --path app

"""

import sys
import os

from setuptools import setup

try:
    from setuptools.command.install import install

except ImportError:
    from distutils.command.install import install

with open('dp_tornado/version.py', 'r') as fp_v:
    for c in fp_v.read().split('\n'):
        exec(c)

dp_project_name = 'dp-tornado'
dp_version = __version__
dp_github_url = 'http://github.com/why2pac/dp-tornado'
dp_license = 'MIT'

dp_author = 'Parker'
dp_author_email = 'oss@dp.farm'

dp_maintainer = dp_author
dp_maintainer_email = dp_author_email

dp_description = 'MVC Web Application Framework with Tornado.'

install_requires = [
        'BeautifulSoup4==4.6.0',
        'boto3==1.4.7',
        'croniter==0.3.20',
        'CyMySQL==0.9.2',
        'httpagentparser==1.8.0',
        'lxml==4.1.1',
        'Pillow==4.3.0',
        'pycrypto==2.6.1',
        'pytz==2017.3',
        'redis==2.10.6',
        'requests==2.18.4',
        'SQLAlchemy==1.1.15',
        'tornado==4.5.2',
        'validate_email==1.3',
        'validators==0.12.0',
        'wand==0.4.4',
        # , 'selenium'
    ]

if sys.version_info[0] <= 2:
    install_requires.append('futures==3.0.5')

# Will not install pillow when it starts from readthedocs.
# if os.environ.get('READTHEDOCS') != 'True':
#     pass

setup(
    name=dp_project_name,
    version=dp_version,
    url=dp_github_url,
    license=dp_license,
    author=dp_author,
    author_email=dp_author_email,
    maintainer=dp_maintainer,
    maintainer_email=dp_maintainer_email,
    description=dp_description,
    long_description=__doc__,
    packages=['dp_tornado'],
    include_package_data=True,
    install_requires=install_requires,
    keywords=['MVC', 'Web Application Framework'],
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.4'
    ],
    entry_points={
        'console_scripts': [
            'dp4p = dp_tornado.cli:main'
        ]
    }
)
<commit_msg>update requirements.<commit_after># -*- coding: utf-8 -*-
"""
MVC Web Application Framework with Tornado, Python 2 and 3

To install the package run:

    pip install dp-tornado

Run
-----

    $ pip install virtualenv
    $ virtualenv ./venv
    $ . ./venv/bin/activate
    $ pip install dp-tornado
    $ dp4p init --path app

"""

import sys
import os

from setuptools import setup

try:
    from setuptools.command.install import install

except ImportError:
    from distutils.command.install import install

with open('dp_tornado/version.py', 'r') as fp_v:
    for c in fp_v.read().split('\n'):
        exec(c)

dp_project_name = 'dp-tornado'
dp_version = __version__
dp_github_url = 'http://github.com/why2pac/dp-tornado'
dp_license = 'MIT'

dp_author = 'Parker'
dp_author_email = 'oss@dp.farm'

dp_maintainer = dp_author
dp_maintainer_email = dp_author_email

dp_description = 'MVC Web Application Framework with Tornado.'

install_requires = [
        'BeautifulSoup4==4.6.0',
        'boto3==1.5.1',
        'croniter==0.3.20',
        'CyMySQL==0.9.4',
        'httpagentparser==1.8.1',
        'lxml==4.1.1',
        'Pillow==4.3.0',
        'pycrypto==2.6.1',
        'pytz==2017.3',
        'redis==2.10.6',
        'requests==2.18.4',
        'SQLAlchemy==1.1.15',
        'tornado==4.5.2',
        'validate_email==1.3',
        'validators==0.12.0',
        'wand==0.4.4',
        # , 'selenium'
    ]

if sys.version_info[0] <= 2:
    install_requires.append('futures==3.0.5')

# Will not install pillow when it starts from readthedocs.
# if os.environ.get('READTHEDOCS') != 'True':
#     pass

setup(
    name=dp_project_name,
    version=dp_version,
    url=dp_github_url,
    license=dp_license,
    author=dp_author,
    author_email=dp_author_email,
    maintainer=dp_maintainer,
    maintainer_email=dp_maintainer_email,
    description=dp_description,
    long_description=__doc__,
    packages=['dp_tornado'],
    include_package_data=True,
    install_requires=install_requires,
    keywords=['MVC', 'Web Application Framework'],
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.4'
    ],
    entry_points={
        'console_scripts': [
            'dp4p = dp_tornado.cli:main'
        ]
    }
)
<|endoftext|>


<commit_before>import kfp
from kfp import components

chicago_taxi_dataset_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/e3337b8bdcd63636934954e592d4b32c95b49129/components/datasets/Chicago%20Taxi/component.yaml')
pandas_transform_csv_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/e69a6694/components/pandas/Transform_DataFrame/in_CSV_format/component.yaml')

catboost_train_classifier_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/f97ad2/components/CatBoost/Train_classifier/from_CSV/component.yaml')
catboost_train_regression_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/f97ad2/components/CatBoost/Train_regression/from_CSV/component.yaml')
catboost_predict_classes_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/f97ad2/components/CatBoost/Predict_classes/from_CSV/component.yaml')
catboost_predict_values_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/f97ad2/components/CatBoost/Predict_values/from_CSV/component.yaml')
catboost_predict_class_probabilities_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/f97ad2/components/CatBoost/Predict_class_probabilities/from_CSV/component.yaml')
catboost_to_apple_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/f97ad2/components/CatBoost/convert_CatBoostModel_to_AppleCoreMLModel/component.yaml')
catboost_to_onnx_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/f97ad2/components/CatBoost/convert_CatBoostModel_to_ONNX/component.yaml')

def catboost_pipeline():
    training_data_in_csv = chicago_taxi_dataset_op(
        where='trip_start_timestamp >= "2019-01-01" AND trip_start_timestamp < "2019-02-01"',
        select='tips,trip_seconds,trip_miles,pickup_community_area,dropoff_community_area,fare,tolls,extras,trip_total',
        limit=10000,
    ).output

    training_data_for_classification_in_csv = pandas_transform_csv_op(
        table=training_data_in_csv,
        transform_code='''df.insert(0, "was_tipped", df["tips"] > 0); del df["tips"]''',
    ).output

    catboost_train_regression_task = catboost_train_regression_op(
        training_data=training_data_in_csv,
        loss_function='RMSE',
        label_column=0,
        num_iterations=200,
    )

    regression_model = catboost_train_regression_task.outputs['model']

    catboost_train_classifier_task = catboost_train_classifier_op(
        training_data=evaluation_data_for_classification_in_csv,
        label_column=0,
        num_iterations=200,
    )

    classification_model = catboost_train_classifier_task.outputs['model']

    evaluation_data_for_regression_in_csv = training_data_in_csv
    evaluation_data_for_classification_in_csv = training_data_for_classification_in_csv

    catboost_predict_values_op(
        data=evaluation_data_for_regression_in_csv,
        model=regression_model,
        label_column=0,
    )

    catboost_predict_classes_op(
        data=evaluation_data_for_classification_in_csv,
        model=classification_model,
        label_column=0,
    )

    catboost_predict_class_probabilities_op(
        data=evaluation_data_for_classification_in_csv,
        model=classification_model,
        label_column=0,
    )

    catboost_to_apple_op(regression_model)
    catboost_to_apple_op(classification_model)

    catboost_to_onnx_op(regression_model)
    catboost_to_onnx_op(classification_model)

if __name__ == '__main__':
    kfp_endpoint=None
    kfp.Client(host=kfp_endpoint).create_run_from_pipeline_func(catboost_pipeline, arguments={})
<commit_msg>Components - CatBoost - Fixed small bug in sample (#4032)<commit_after>import kfp
from kfp import components

chicago_taxi_dataset_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/e3337b8bdcd63636934954e592d4b32c95b49129/components/datasets/Chicago%20Taxi/component.yaml')
pandas_transform_csv_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/e69a6694/components/pandas/Transform_DataFrame/in_CSV_format/component.yaml')

catboost_train_classifier_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/f97ad2/components/CatBoost/Train_classifier/from_CSV/component.yaml')
catboost_train_regression_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/f97ad2/components/CatBoost/Train_regression/from_CSV/component.yaml')
catboost_predict_classes_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/f97ad2/components/CatBoost/Predict_classes/from_CSV/component.yaml')
catboost_predict_values_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/f97ad2/components/CatBoost/Predict_values/from_CSV/component.yaml')
catboost_predict_class_probabilities_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/f97ad2/components/CatBoost/Predict_class_probabilities/from_CSV/component.yaml')
catboost_to_apple_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/f97ad2/components/CatBoost/convert_CatBoostModel_to_AppleCoreMLModel/component.yaml')
catboost_to_onnx_op = components.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/f97ad2/components/CatBoost/convert_CatBoostModel_to_ONNX/component.yaml')

def catboost_pipeline():
    training_data_in_csv = chicago_taxi_dataset_op(
        where='trip_start_timestamp >= "2019-01-01" AND trip_start_timestamp < "2019-02-01"',
        select='tips,trip_seconds,trip_miles,pickup_community_area,dropoff_community_area,fare,tolls,extras,trip_total',
        limit=10000,
    ).output

    training_data_for_classification_in_csv = pandas_transform_csv_op(
        table=training_data_in_csv,
        transform_code='''df.insert(0, "was_tipped", df["tips"] > 0); del df["tips"]''',
    ).output

    catboost_train_regression_task = catboost_train_regression_op(
        training_data=training_data_in_csv,
        loss_function='RMSE',
        label_column=0,
        num_iterations=200,
    )

    regression_model = catboost_train_regression_task.outputs['model']

    catboost_train_classifier_task = catboost_train_classifier_op(
        training_data=training_data_for_classification_in_csv,
        label_column=0,
        num_iterations=200,
    )

    classification_model = catboost_train_classifier_task.outputs['model']

    evaluation_data_for_regression_in_csv = training_data_in_csv
    evaluation_data_for_classification_in_csv = training_data_for_classification_in_csv

    catboost_predict_values_op(
        data=evaluation_data_for_regression_in_csv,
        model=regression_model,
        label_column=0,
    )

    catboost_predict_classes_op(
        data=evaluation_data_for_classification_in_csv,
        model=classification_model,
        label_column=0,
    )

    catboost_predict_class_probabilities_op(
        data=evaluation_data_for_classification_in_csv,
        model=classification_model,
        label_column=0,
    )

    catboost_to_apple_op(regression_model)
    catboost_to_apple_op(classification_model)

    catboost_to_onnx_op(regression_model)
    catboost_to_onnx_op(classification_model)

if __name__ == '__main__':
    kfp_endpoint=None
    kfp.Client(host=kfp_endpoint).create_run_from_pipeline_func(catboost_pipeline, arguments={})
<|endoftext|>


<commit_before>from distutils.core import setup

setup(
    name='imap_tools',
    version='0.1.1',
    packages=['imap_tools'],
    url='https://github.com/ikvk/imap_tools',
    license='MIT',
    author='v.kaukin',
    author_email='workkvk@gmail.com',
    description='Tool for work with e-mail messages and not with the imap protocol.',
)
<commit_msg>long_description<commit_after>from distutils.core import setup

setup(
    name='imap_tools',
    version='0.1.4',
    packages=['imap_tools'],
    url='https://github.com/ikvk/imap_tools',
    license='MIT',
    long_description=open("README.rst").read(),
    author='v.kaukin',
    author_email='workkvk@gmail.com',
    description='Tool for work with e-mail messages and not with the imap protocol.',
)
<|endoftext|>


<commit_before>#
# Define tasks depending on each other and execute them.
#
# Copyright (c) 2016 Richard Klees <richard.klees@rwth-aachen.de>
#
# This software is licensed under The MIT License. You should have
# received a copy of the LICENSE with the code.
#

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

config =
    { "description" : "A utility to run tasks."
    , "author" : "Richard Klees"
    , "author_email" : "richard.klees@rwth-aachen.de"
    , "version" : "1.0"
    , "install-requires" : ["nose"]
    , "packages" : ["tsk"]
    , "scripts" : []
    , "name" : "tsk"
    }

setup(**config)
<commit_msg>fixed install<commit_after>#
# Define tasks depending on each other and execute them.
#
# Copyright (c) 2016 Richard Klees <richard.klees@rwth-aachen.de>
#
# This software is licensed under The MIT License. You should have
# received a copy of the LICENSE with the code.
#

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

config = (
    { "description" : "A utility to run tasks."
    , "author" : "Richard Klees"
    , "author_email" : "richard.klees@rwth-aachen.de"
    , "version" : "1.0"
    , "install-requires" : ["nose"]
    , "packages" : ["tsk"]
    , "scripts" : []
    , "name" : "tsk"
    })

setup(**config)
<|endoftext|>


<commit_before>"""Views for the admin interface."""

from django.contrib import admin
from django.forms.models import BaseInlineFormSet
from django.utils.translation import ugettext_lazy as _

from timed.projects import models

@admin.register(models.Customer)
class CustomerAdmin(admin.ModelAdmin):
    """Customer admin view."""

    list_display = ['name']
    search_fields = ['name']

    def has_delete_permission(self, request, obj=None):
        return obj and not obj.projects.exists()

@admin.register(models.BillingType)
class BillingType(admin.ModelAdmin):
    list_display = ['name']
    search_fields = ['name']

class TaskInlineFormset(BaseInlineFormSet):
    """Task formset defaulting to task templates when project is created."""

    def __init__(self, *args, **kwargs):
        kwargs['initial'] = [
            {'name': tmpl.name}
            for tmpl in models.TaskTemplate.objects.order_by('name')
        ]
        super().__init__(*args, **kwargs)

class TaskInline(admin.TabularInline):
    formset = TaskInlineFormset
    model = models.Task

    def get_extra(self, request, obj=None, **kwargs):
        if obj is not None:
            return 0
        return models.TaskTemplate.objects.count()

    def has_delete_permission(self, request, obj=None):
        return obj and not obj.reports.exists()

class ReviewerInline(admin.TabularInline):
    model = models.Project.reviewers.through
    extra = 0
    verbose_name = _('Reviewer')
    verbose_name_plural = _('Reviewers')

@admin.register(models.Project)
class ProjectAdmin(admin.ModelAdmin):
    """Project admin view."""

    list_display  = ['name', 'customer']
    list_filter   = ['customer']
    search_fields = ['name', 'customer__name']

    inlines = [TaskInline, ReviewerInline]
    exclude = ('reviewers', )

    def has_delete_permission(self, request, obj=None):
        return obj and not obj.tasks.exists()

@admin.register(models.TaskTemplate)
class TaskTemplateAdmin(admin.ModelAdmin):
    """Task template admin view."""

    list_display = ['name']
<commit_msg>Task can not be deleted<commit_after>"""Views for the admin interface."""

from django.contrib import admin
from django.forms.models import BaseInlineFormSet
from django.utils.translation import ugettext_lazy as _

from timed.projects import models

@admin.register(models.Customer)
class CustomerAdmin(admin.ModelAdmin):
    """Customer admin view."""

    list_display = ['name']
    search_fields = ['name']

    def has_delete_permission(self, request, obj=None):
        return obj and not obj.projects.exists()

@admin.register(models.BillingType)
class BillingType(admin.ModelAdmin):
    list_display = ['name']
    search_fields = ['name']

class TaskInlineFormset(BaseInlineFormSet):
    """Task formset defaulting to task templates when project is created."""

    def __init__(self, *args, **kwargs):
        kwargs['initial'] = [
            {'name': tmpl.name}
            for tmpl in models.TaskTemplate.objects.order_by('name')
        ]
        super().__init__(*args, **kwargs)

class TaskInline(admin.TabularInline):
    formset = TaskInlineFormset
    model = models.Task

    def get_extra(self, request, obj=None, **kwargs):
        if obj is not None:
            return 0
        return models.TaskTemplate.objects.count()

    def has_delete_permission(self, request, obj=None):
        # for some reason obj is parent object and not task
        # so this doesn't work
        # return obj and not obj.reports.exists()
        return False

class ReviewerInline(admin.TabularInline):
    model = models.Project.reviewers.through
    extra = 0
    verbose_name = _('Reviewer')
    verbose_name_plural = _('Reviewers')

@admin.register(models.Project)
class ProjectAdmin(admin.ModelAdmin):
    """Project admin view."""

    list_display  = ['name', 'customer']
    list_filter   = ['customer']
    search_fields = ['name', 'customer__name']

    inlines = [TaskInline, ReviewerInline]
    exclude = ('reviewers', )

    def has_delete_permission(self, request, obj=None):
        return obj and not obj.tasks.exists()

@admin.register(models.TaskTemplate)
class TaskTemplateAdmin(admin.ModelAdmin):
    """Task template admin view."""

    list_display = ['name']
<|endoftext|>


<commit_before># Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Celery task for processing Plaso storage files."""

import os
import sys

from flask import current_app
# We currently don't have plaso in our Travis setup. This is a workaround
# for that until we fix the Travis environment.
# TODO: Add Plaso to our Travis environment we are running our tests in.
try:
    from plaso.frontend import psort
except ImportError:
    pass

from timesketch import create_celery_app

celery = create_celery_app()

def get_data_location():
    """Path to the plaso data directory.

    Returns:
        The path to where the plaso data directory is or None if not existing.
    """
    data_location = current_app.config.get(u'PLASO_DATA_LOCATION', None)
    if not data_location:
        data_location = os.path.join(sys.prefix, u'share', u'plaso')
    if not os.path.exists(data_location):
        data_location = None
    return data_location

@celery.task(track_started=True)
def run_plaso(source_file_path, timeline_name, index_name, username=None):
    """Create a Celery task for processing Plaso storage file.

    Args:
        source_file_path: Path to plaso storage file.
        timeline_name: Name of the Timesketch timeline.
        index_name: Name of the datastore index.
        username: Username of the user who will own the timeline.

    Returns:
        Dictionary with count of processed events.
    """
    plaso_data_location = get_data_location()
    flush_interval = 1000  # events to queue before bulk index

    # Use Plaso psort frontend tool.
    frontend = psort.PsortFrontend()
    frontend.SetDataLocation(plaso_data_location)
    storage_reader = frontend.CreateStorageReader(source_file_path)

    # Setup the Timesketch output module.
    output_module = frontend.CreateOutputModule(u'timesketch')
    output_module.SetIndexName(index_name)
    output_module.SetTimelineName(timeline_name)
    output_module.SetFlushInterval(flush_interval)
    output_module.SetDocType(u'plaso_event')
    if username:
        output_module.SetUserName(username)

    # Start process the Plaso storage file.

    counter = frontend.ExportEvents(storage_reader, output_module)

    return dict(counter)
<commit_msg>Set doc type in celery task<commit_after># Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Celery task for processing Plaso storage files."""

import os
import sys

from flask import current_app
# We currently don't have plaso in our Travis setup. This is a workaround
# for that until we fix the Travis environment.
# TODO: Add Plaso to our Travis environment we are running our tests in.
try:
    from plaso.frontend import psort
except ImportError:
    pass

from timesketch import create_celery_app

celery = create_celery_app()

def get_data_location():
    """Path to the plaso data directory.

    Returns:
        The path to where the plaso data directory is or None if not existing.
    """
    data_location = current_app.config.get(u'PLASO_DATA_LOCATION', None)
    if not data_location:
        data_location = os.path.join(sys.prefix, u'share', u'plaso')
    if not os.path.exists(data_location):
        data_location = None
    return data_location

@celery.task(track_started=True)
def run_plaso(source_file_path, timeline_name, index_name, username=None):
    """Create a Celery task for processing Plaso storage file.

    Args:
        source_file_path: Path to plaso storage file.
        timeline_name: Name of the Timesketch timeline.
        index_name: Name of the datastore index.
        username: Username of the user who will own the timeline.

    Returns:
        Dictionary with count of processed events.
    """
    plaso_data_location = get_data_location()
    flush_interval = 1000  # events to queue before bulk index
    doc_type = u'plaso_event'  # Document type for Elasticsearch

    # Use Plaso psort frontend tool.
    frontend = psort.PsortFrontend()
    frontend.SetDataLocation(plaso_data_location)
    storage_reader = frontend.CreateStorageReader(source_file_path)

    # Setup the Timesketch output module.
    output_module = frontend.CreateOutputModule(u'timesketch')
    output_module.SetIndexName(index_name)
    output_module.SetTimelineName(timeline_name)
    output_module.SetFlushInterval(flush_interval)
    output_module.SetDocType(doc_type)
    if username:
        output_module.SetUserName(username)

    # Start process the Plaso storage file.

    counter = frontend.ExportEvents(storage_reader, output_module)

    return dict(counter)
<|endoftext|>


<commit_before>from .byoanet import *
from .byobnet import *
from .cspnet import *
from .densenet import *
from .dla import *
from .dpn import *
from .efficientnet import *
from .ghostnet import *
from .gluon_resnet import *
from .gluon_xception import *
from .hardcorenas import *
from .coat import *
from .hrnet import *
from .inception_resnet_v2 import *
from .inception_v3 import *
from .inception_v4 import *
from .mobilenetv3 import *
from .nasnet import *
from .nfnet import *
from .pit import *
from .pnasnet import *
from .regnet import *
from .res2net import *
from .resnest import *
from .resnet import *
from .resnetv2 import *
from .rexnet import *
from .selecsls import *
from .senet import *
from .sknet import *
from .swin_transformer import *
from .tnt import *
from .tresnet import *
from .vgg import *
from .vision_transformer import *
from .vision_transformer_hybrid import *
from .vovnet import *
from .xception import *
from .xception_aligned import *

from .factory import create_model, split_model_name, safe_model_name
from .helpers import load_checkpoint, resume_checkpoint, model_parameters
from .layers import TestTimePoolHead, apply_test_time_pool
from .layers import convert_splitbn_model
from .layers import is_scriptable, is_exportable, set_scriptable, set_exportable, is_no_jit, set_no_jit
from .registry import register_model, model_entrypoint, list_models, is_model, list_modules, is_model_in_modules,\
    has_model_default_key, is_model_default_key, get_model_default_value, is_model_pretrained
<commit_msg>Update __init__.py<commit_after>from .byoanet import *
from .byobnet import *
from .coat import *
from .cspnet import *
from .densenet import *
from .dla import *
from .dpn import *
from .efficientnet import *
from .ghostnet import *
from .gluon_resnet import *
from .gluon_xception import *
from .hardcorenas import *
from .hrnet import *
from .inception_resnet_v2 import *
from .inception_v3 import *
from .inception_v4 import *
from .mobilenetv3 import *
from .nasnet import *
from .nfnet import *
from .pit import *
from .pnasnet import *
from .regnet import *
from .res2net import *
from .resnest import *
from .resnet import *
from .resnetv2 import *
from .rexnet import *
from .selecsls import *
from .senet import *
from .sknet import *
from .swin_transformer import *
from .tnt import *
from .tresnet import *
from .vgg import *
from .vision_transformer import *
from .vision_transformer_hybrid import *
from .vovnet import *
from .xception import *
from .xception_aligned import *

from .factory import create_model, split_model_name, safe_model_name
from .helpers import load_checkpoint, resume_checkpoint, model_parameters
from .layers import TestTimePoolHead, apply_test_time_pool
from .layers import convert_splitbn_model
from .layers import is_scriptable, is_exportable, set_scriptable, set_exportable, is_no_jit, set_no_jit
from .registry import register_model, model_entrypoint, list_models, is_model, list_modules, is_model_in_modules,\
    has_model_default_key, is_model_default_key, get_model_default_value, is_model_pretrained
<|endoftext|>


<commit_before>#!/usr/bin/env python3

from distutils.core import setup
from ipyrmd import __version__

setup(name="ipyrmd",
      version=__version__,
      description="Convert between IPython/Jupyter notebooks and RMarkdown",
      author="Gordon Ball",
      author_email="gordon@chronitis.net",
      url="https://github.com/chronitis/ipyrmd",
      packages=["ipyrmd"],
      license="MIT",
      requires=["ipython (>= 3.0)", "pyyaml"],
      scripts=["scripts/ipyrmd"])
<commit_msg>fix requirements<commit_after>#!/usr/bin/env python3

from distutils.core import setup
from ipyrmd import __version__

setup(name="ipyrmd",
      version=__version__,
      description="Convert between IPython/Jupyter notebooks and RMarkdown",
      author="Gordon Ball",
      author_email="gordon@chronitis.net",
      url="https://github.com/chronitis/ipyrmd",
      packages=["ipyrmd"],
      license="MIT",
      install_requires=["nbformat", "pyyaml"],
      scripts=["scripts/ipyrmd"])
<|endoftext|>


<commit_before>#! /usr/bin/python

from __future__ import absolute_import, division, print_function

import os
from ..utils import logger

class SignatureChecker(object):

    @classmethod
    def signatureLocation(cls, f):
        f.seek(0)
        buf = f.read(1024).lower()
        for sig in cls.signatures:
            try:
                sindex = buf.index(sig.lower())
                logger.debug("Found signature %s in %s at %s; doctype %s.",
                             sig, f.name, sindex, cls)
                return sindex
            except ValueError:
                logger.debug("Signature %s not found in %s for type %s",
                             sig, f.name, cls.__name__)
        return None

class BaseDoctype(object):

    def __init__(self, *args, **kwargs):
        self.source = kwargs.get('source', None)
        self.output = kwargs.get('output', None)
        self.platform = kwargs.get('platform', None)
        assert None not in (self.source, self.output, self.platform)

    def generate(self):
        self.output.prebuild_hook()
        os.chdir(self.output.dirname)
        vector = [self.output.clean(),
                  self.platform_check(),
                  self.create_htmls(),
                  self.create_pdf(),
                  self.create_txt(),
                  self.create_html(),
                  ]
        result = all(vector)
        if result:
            self.output.build_success_hook()
        else:
            self.output.build_failure_hook()
        logger.info("%s generation of all documents %s",
                    self.source.stem, result)
        return all(vector)

#
# -- end of file
<commit_msg>let the prebuild_hook call clean<commit_after>#! /usr/bin/python

from __future__ import absolute_import, division, print_function

import os
from ..utils import logger

class SignatureChecker(object):

    @classmethod
    def signatureLocation(cls, f):
        f.seek(0)
        buf = f.read(1024).lower()
        for sig in cls.signatures:
            try:
                sindex = buf.index(sig.lower())
                logger.debug("Found signature %s in %s at %s; doctype %s.",
                             sig, f.name, sindex, cls)
                return sindex
            except ValueError:
                logger.debug("Signature %s not found in %s for type %s",
                             sig, f.name, cls.__name__)
        return None

class BaseDoctype(object):

    def __init__(self, *args, **kwargs):
        self.source = kwargs.get('source', None)
        self.output = kwargs.get('output', None)
        self.platform = kwargs.get('platform', None)
        assert None not in (self.source, self.output, self.platform)

    def generate(self):
        self.output.prebuild_hook()
        os.chdir(self.output.dirname)
        vector = [self.platform_check(),
                  self.create_htmls(),
                  self.create_pdf(),
                  self.create_txt(),
                  self.create_html(),
                  ]
        result = all(vector)
        if result:
            self.output.build_success_hook()
        else:
            self.output.build_failure_hook()
        logger.info("%s generation of all documents %s",
                    self.source.stem, result)
        return all(vector)

#
# -- end of file
<|endoftext|>


<commit_before>import subprocess

from setuptools import Command, find_packages, setup

# -----------------------------------------------------------------------------

def system(command):
    class SystemCommand(Command):
        user_options = []

        def initialize_options(self):
            pass

        def finalize_options(self):
            pass

        def run(self):
            subprocess.check_call(command, shell=True)

    return SystemCommand

# -----------------------------------------------------------------------------

setup(
    name="Flask-RESTy",
    version='0.16.3',
    description="Building blocks for REST APIs for Flask",
    url='https://github.com/4Catalyzer/flask-resty',
    author="Jimmy Jia",
    author_email='tesrin@gmail.com',
    license='MIT',
    classifiers=(
        'Development Status :: 3 - Alpha',
        'Framework :: Flask',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 3',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ),
    keywords='rest flask',
    packages=find_packages(exclude=('tests',)),
    install_requires=(
        'Flask >= 0.10',
        'Flask-SQLAlchemy >= 1.0',
        'marshmallow >= 2.2.0',
        'SQLAlchemy >= 1.0.0',
        'Werkzeug >= 0.11',
    ),
    extras_require={
        'jwt': ('PyJWT >= 1.4.0', 'cryptography >= 2.0.0'),
    },
    cmdclass={
        'clean': system('rm -rf build dist *.egg-info'),
        'package': system('python setup.py pandoc sdist bdist_wheel'),
        'pandoc': system('pandoc README.md -o README.rst'),
        'publish': system('twine upload dist/*'),
        'release': system('python setup.py clean package publish'),
        'test': system('tox'),
    },
)
<commit_msg>v0.17.0<commit_after>import subprocess

from setuptools import Command, find_packages, setup

# -----------------------------------------------------------------------------

def system(command):
    class SystemCommand(Command):
        user_options = []

        def initialize_options(self):
            pass

        def finalize_options(self):
            pass

        def run(self):
            subprocess.check_call(command, shell=True)

    return SystemCommand

# -----------------------------------------------------------------------------

setup(
    name="Flask-RESTy",
    version='0.17.0',
    description="Building blocks for REST APIs for Flask",
    url='https://github.com/4Catalyzer/flask-resty',
    author="Jimmy Jia",
    author_email='tesrin@gmail.com',
    license='MIT',
    classifiers=(
        'Development Status :: 3 - Alpha',
        'Framework :: Flask',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 3',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ),
    keywords='rest flask',
    packages=find_packages(exclude=('tests',)),
    install_requires=(
        'Flask >= 0.10',
        'Flask-SQLAlchemy >= 1.0',
        'marshmallow >= 2.2.0',
        'SQLAlchemy >= 1.0.0',
        'Werkzeug >= 0.11',
    ),
    extras_require={
        'jwt': ('PyJWT >= 1.4.0', 'cryptography >= 2.0.0'),
    },
    cmdclass={
        'clean': system('rm -rf build dist *.egg-info'),
        'package': system('python setup.py pandoc sdist bdist_wheel'),
        'pandoc': system('pandoc README.md -o README.rst'),
        'publish': system('twine upload dist/*'),
        'release': system('python setup.py clean package publish'),
        'test': system('tox'),
    },
)
<|endoftext|>


<commit_before># Copyright (c) Hynek Schlawack, Richard Wall
# See LICENSE for details.

from twisted.trial.unittest import SynchronousTestCase
import getdns
from tlsep import _dane

class TLSADomainNameTests(SynchronousTestCase):
    def test_tlsaDomainName(self):
        """
        L{_dane.tlsaDomainName} returns the port, proto and parent domain as
        labels of a new domain name string.
        """
        self.assertEqual(
            "_443._tcp.example.com",
            _dane.tlsaDomainName('example.com', 443, 'tcp')
        )

class FakeGetdns(object):
    """
    An in memory fake of the getdns api for testing.
    """
    def __init__(self, generalResult=None):
        self._generalResult = generalResult

        for k, v in getdns.__dict__.items():
            if k.startswith('GETDNS_'):
                setattr(self, k, v)

    def context_create(self):
        """
        """

    def general(self, context, name, request_type, extensions):
        """
        """
        return self._generalResult

class TLSATests(SynchronousTestCase):
    def test_tlsaCert(self):
        """
        L{_dane.lookup_tlsa_records} returns a L{_dane.TLSARecord} instance if
        the domain name exists and a verified record is found and the record
        selector type is CERT.
        """
        fakeGetdns = FakeGetdns(
            generalResult=createResults(status=getdns.GETDNS_RESPSTATUS_GOOD,
                                        selector=_dane.SELECTOR.CERT.value,
                                        certificate_association_data=b'FOOBAR'))
        res = _dane.lookup_tlsa_records(
            'example.com', 443, 'tcp', getdns=fakeGetdns)
        self.assertEqual(
            (_dane.SELECTOR.CERT, b'FOOBAR'),
            (res.selector, res.payload)
        )

    def test_tlsaSPKI(self):
        """
        L{_dane.lookup_tlsa_records} returns a L{_dane.TLSARecord} instance if
        the domain name exists and a verfied record is found and the record
        selector type is SPKI.
        """
        fakeGetdns = FakeGetdns(
            generalResult=createResults(status=getdns.GETDNS_RESPSTATUS_GOOD,
                                        selector=_dane.SELECTOR.SPKI.value,
                                        certificate_association_data=b'FOOBAR'))
        res = _dane.lookup_tlsa_records(
            'example.com', 443, 'tcp', getdns=fakeGetdns)
        self.assertEqual(
            (_dane.SELECTOR.SPKI, b'FOOBAR'),
            (res.selector, res.payload)
        )

    def test_tlsaNoname(self):
        """
        L{_dane.lookup_tlsa_records} raises LookupError if the domain name does
        not exist.
        """
        e = self.assertRaises(
            _dane.GetdnsResponseError,
            _dane.lookup_tlsa_records, 'example.com', 443, 'tcp',
            getdns=FakeGetdns(
                generalResult=createResults(
                    status=getdns.GETDNS_RESPSTATUS_NO_NAME
                )
            )
        )
        self.assertEqual(
            getdns.GETDNS_RESPSTATUS_NO_NAME,
            e.errorCode
        )

def createResults(status=getdns.GETDNS_RESPSTATUS_GOOD,
                  selector=None,
                  certificate_association_data=b"",):
    return {'answer_type': 800,
            'canonical_name': '_443._tcp.getdnsapi.org.',
            'just_address_answers': [],
            # 'replies_full': [<read-only buffer ptr 0x7fe2e0029e80, size 636 at 0x7fe2e4e58fb0>],
            'replies_tree': [{'answer': [{'class': 1,
                                          'name': '_443._tcp.getdnsapi.org.',
                                          'rdata': {
                                              'certificate_association_data': certificate_association_data,
                                              'certificate_usage': 3,
                                              'matching_type': 1,
                                              # 'rdata_raw': "",
                                              'selector': selector
                                          },
                                          # 'ttl': 450,
                                          # 'type': 52},
                                         # {'class': 1,
                                         #  'name': '_443._tcp.getdnsapi.org.',
                                         #  'rdata': {'algorithm': 7,
                                         #            'key_tag': 49262,
                                         #            'labels': 4,
                                         #            'original_ttl': 450,
                                         #            'rdata_raw': <read-only buffer ptr 0x7fe2e0261b70, size 161 at 0x7fe2e4e60130>,
                                         #            'signature': <read-only buffer ptr 0x7fe2e0254c40, size 128 at 0x7fe2e4e60170>,
                                         #            'signature_expiration': 1399325172,
                                         #            'signature_inception': 1398100703,
                                         #            'signers_name': 'getdnsapi.org.',
                                         #            'type_covered': 52},
                                         #  'ttl': 450,
                                         #  'type': 46
                                      }
                                     ],
                               'answer_type': 800,
                              # 'authority': [{'class': 1,
                              #                'name': 'getdnsapi.org.',
                              #                'rdata': {'nsdname': 'ns.secret-wg.org.',
                              #                          'rdata_raw': 'ns.secret-wg.org.'},
                              #                'ttl': 450,
                              #                'type': 2},
                              #               {'class': 1,
                              #                'name': 'getdnsapi.org.',
                              #                'rdata': {'nsdname': 'mcvax.nlnetlabs.nl.',
                              #                          'rdata_raw': 'mcvax.nlnetlabs.nl.'},
                              #                'ttl': 450,
                              #                'type': 2},
                              #               {'class': 1,
                              #                'name': 'getdnsapi.org.',
                              #                'rdata': {'nsdname': 'open.nlnetlabs.nl.',
                              #                          'rdata_raw': 'open.nlnetlabs.nl.'},
                              #                'ttl': 450,
                              #                'type': 2},
                              #               {'class': 1,
                              #                'name': 'getdnsapi.org.',
                              #                'rdata': {'algorithm': 7,
                              #                          'key_tag': 49262,
                              #                          'labels': 2,
                              #                          'original_ttl': 450,
                              #                          'rdata_raw': <read-only buffer ptr 0x7fe2e0261f90, size 161 at 0x7fe2e4e601f0>,
                              #                          'signature': <read-only buffer ptr 0x7fe2e0028120, size 128 at 0x7fe2e4e60230>,
                              #                          'signature_expiration': 1399278072,
                              #                          'signature_inception': 1398093503,
                              #                          'signers_name': 'getdnsapi.org.',
                              #                          'type_covered': 2},
                              #                'ttl': 450,
                              #                'type': 46}],
                              'canonical_name': '_443._tcp.getdnsapi.org.',
                              'dnssec_status': 400,
                              'header': {'aa': 0,
                                         'ad': 1,
                                         'ancount': 2,
                                         'arcount': 0,
                                         'cd': 0,
                                         'id': 0,
                                         'nscount': 4,
                                         'opcode': 0,
                                         'qdcount': 1,
                                         'qr': 1,
                                         'ra': 1,
                                         'rcode': 0,
                                         'rd': 1,
                                         'tc': 0,
                                         'z': 0},
                              'question': {'qclass': 1,
                                           'qname': '_443._tcp.getdnsapi.org.',
                                           'qtype': 52}}],
            'status': status}
<commit_msg>Tests for GetdnsResponseError<commit_after># Copyright (c) Hynek Schlawack, Richard Wall
# See LICENSE for details.

from twisted.trial.unittest import SynchronousTestCase
import getdns
from tlsep import _dane

class TLSADomainNameTests(SynchronousTestCase):
    def test_tlsaDomainName(self):
        """
        L{_dane.tlsaDomainName} returns the port, proto and parent domain as
        labels of a new domain name string.
        """
        self.assertEqual(
            "_443._tcp.example.com",
            _dane.tlsaDomainName('example.com', 443, 'tcp')
        )

class GetdnsResponseErrorTests(SynchronousTestCase):
    def test_errorText(self):
        """
        L{_dane.GetdnsResponseError} has an C{errorText} attribute which is the name
        of the corresponding L{getdns} constant.
        """
        self.assertEqual(
            "GETDNS_RESPSTATUS_NO_NAME",
            _dane.GetdnsResponseError(getdns.GETDNS_RESPSTATUS_NO_NAME).errorText
        )

class FakeGetdns(object):
    """
    An in memory fake of the getdns api for testing.
    """
    def __init__(self, generalResult=None):
        self._generalResult = generalResult

        for k, v in getdns.__dict__.items():
            if k.startswith('GETDNS_'):
                setattr(self, k, v)

    def context_create(self):
        """
        """

    def general(self, context, name, request_type, extensions):
        """
        """
        return self._generalResult

class TLSATests(SynchronousTestCase):
    def test_tlsaCert(self):
        """
        L{_dane.lookup_tlsa_records} returns a L{_dane.TLSARecord} instance if
        the domain name exists and a verified record is found and the record
        selector type is CERT.
        """
        fakeGetdns = FakeGetdns(
            generalResult=createResults(status=getdns.GETDNS_RESPSTATUS_GOOD,
                                        selector=_dane.SELECTOR.CERT.value,
                                        certificate_association_data=b'FOOBAR'))
        res = _dane.lookup_tlsa_records(
            'example.com', 443, 'tcp', getdns=fakeGetdns)
        self.assertEqual(
            (_dane.SELECTOR.CERT, b'FOOBAR'),
            (res.selector, res.payload)
        )

    def test_tlsaSPKI(self):
        """
        L{_dane.lookup_tlsa_records} returns a L{_dane.TLSARecord} instance if
        the domain name exists and a verfied record is found and the record
        selector type is SPKI.
        """
        fakeGetdns = FakeGetdns(
            generalResult=createResults(status=getdns.GETDNS_RESPSTATUS_GOOD,
                                        selector=_dane.SELECTOR.SPKI.value,
                                        certificate_association_data=b'FOOBAR'))
        res = _dane.lookup_tlsa_records(
            'example.com', 443, 'tcp', getdns=fakeGetdns)
        self.assertEqual(
            (_dane.SELECTOR.SPKI, b'FOOBAR'),
            (res.selector, res.payload)
        )

    def test_tlsaNoname(self):
        """
        L{_dane.lookup_tlsa_records} raises LookupError if the domain name does
        not exist.
        """
        e = self.assertRaises(
            _dane.GetdnsResponseError,
            _dane.lookup_tlsa_records, 'example.com', 443, 'tcp',
            getdns=FakeGetdns(
                generalResult=createResults(
                    status=getdns.GETDNS_RESPSTATUS_NO_NAME
                )
            )
        )
        self.assertEqual(
            getdns.GETDNS_RESPSTATUS_NO_NAME,
            e.errorCode
        )

def createResults(status=getdns.GETDNS_RESPSTATUS_GOOD,
                  selector=None,
                  certificate_association_data=b"",):
    return {'answer_type': 800,
            'canonical_name': '_443._tcp.getdnsapi.org.',
            'just_address_answers': [],
            # 'replies_full': [<read-only buffer ptr 0x7fe2e0029e80, size 636 at 0x7fe2e4e58fb0>],
            'replies_tree': [{'answer': [{'class': 1,
                                          'name': '_443._tcp.getdnsapi.org.',
                                          'rdata': {
                                              'certificate_association_data': certificate_association_data,
                                              'certificate_usage': 3,
                                              'matching_type': 1,
                                              # 'rdata_raw': "",
                                              'selector': selector
                                          },
                                          # 'ttl': 450,
                                          # 'type': 52},
                                         # {'class': 1,
                                         #  'name': '_443._tcp.getdnsapi.org.',
                                         #  'rdata': {'algorithm': 7,
                                         #            'key_tag': 49262,
                                         #            'labels': 4,
                                         #            'original_ttl': 450,
                                         #            'rdata_raw': <read-only buffer ptr 0x7fe2e0261b70, size 161 at 0x7fe2e4e60130>,
                                         #            'signature': <read-only buffer ptr 0x7fe2e0254c40, size 128 at 0x7fe2e4e60170>,
                                         #            'signature_expiration': 1399325172,
                                         #            'signature_inception': 1398100703,
                                         #            'signers_name': 'getdnsapi.org.',
                                         #            'type_covered': 52},
                                         #  'ttl': 450,
                                         #  'type': 46
                                      }
                                     ],
                               'answer_type': 800,
                              # 'authority': [{'class': 1,
                              #                'name': 'getdnsapi.org.',
                              #                'rdata': {'nsdname': 'ns.secret-wg.org.',
                              #                          'rdata_raw': 'ns.secret-wg.org.'},
                              #                'ttl': 450,
                              #                'type': 2},
                              #               {'class': 1,
                              #                'name': 'getdnsapi.org.',
                              #                'rdata': {'nsdname': 'mcvax.nlnetlabs.nl.',
                              #                          'rdata_raw': 'mcvax.nlnetlabs.nl.'},
                              #                'ttl': 450,
                              #                'type': 2},
                              #               {'class': 1,
                              #                'name': 'getdnsapi.org.',
                              #                'rdata': {'nsdname': 'open.nlnetlabs.nl.',
                              #                          'rdata_raw': 'open.nlnetlabs.nl.'},
                              #                'ttl': 450,
                              #                'type': 2},
                              #               {'class': 1,
                              #                'name': 'getdnsapi.org.',
                              #                'rdata': {'algorithm': 7,
                              #                          'key_tag': 49262,
                              #                          'labels': 2,
                              #                          'original_ttl': 450,
                              #                          'rdata_raw': <read-only buffer ptr 0x7fe2e0261f90, size 161 at 0x7fe2e4e601f0>,
                              #                          'signature': <read-only buffer ptr 0x7fe2e0028120, size 128 at 0x7fe2e4e60230>,
                              #                          'signature_expiration': 1399278072,
                              #                          'signature_inception': 1398093503,
                              #                          'signers_name': 'getdnsapi.org.',
                              #                          'type_covered': 2},
                              #                'ttl': 450,
                              #                'type': 46}],
                              'canonical_name': '_443._tcp.getdnsapi.org.',
                              'dnssec_status': 400,
                              'header': {'aa': 0,
                                         'ad': 1,
                                         'ancount': 2,
                                         'arcount': 0,
                                         'cd': 0,
                                         'id': 0,
                                         'nscount': 4,
                                         'opcode': 0,
                                         'qdcount': 1,
                                         'qr': 1,
                                         'ra': 1,
                                         'rcode': 0,
                                         'rd': 1,
                                         'tc': 0,
                                         'z': 0},
                              'question': {'qclass': 1,
                                           'qname': '_443._tcp.getdnsapi.org.',
                                           'qtype': 52}}],
            'status': status}
<|endoftext|>


<commit_before># Copyright (c) 2014. Mount Sinai School of Medicine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os

readme_filename = os.path.join(os.path.dirname(__file__), 'README.md')
with open(readme_filename, 'r') as f:
  readme = f.read()

try:
  import pypandoc
  readme = pypandoc.convert(readme, to='rst', format='md')
except:
  #print "Conversion of long_description from markdown to reStructuredText failed, skipping..."
  pass

from setuptools import setup

if __name__ == '__main__':
    setup(
        name='epitopes',
        version="0.2",
        description="Python interface to IEDB and other immune epitope data",
        author="Alex Rubinsteyn",
        author_email="alex {dot} rubinsteyn {at} mssm {dot} edu",
        url="https://github.com/hammerlab/epitopes",
	license="http://www.apache.org/licenses/LICENSE-2.0.html",
        classifiers=[
            'Development Status :: 3 - Alpha',
            'Environment :: Console',
            'Operating System :: OS Independent',
            'Intended Audience :: Science/Research',
	    'License :: OSI Approved :: Apache Software License',
            'Programming Language :: Python',
            'Topic :: Scientific/Engineering :: Bio-Informatics',
             ],
        requires=[
            'numpy(>=1.7)',
            'pandas(>=0.13.1)',
            'scikit.learn(>=0.14.1)',
            'appdirs',
            'progressbar',
            'biopython',
        ],
        long_description=readme,
        packages=['epitopes'],
        package_data = { 'epitopes' : ['data/*csv'] },
        include_package_data = True
    )
<commit_msg>add datacache dependency<commit_after># Copyright (c) 2014. Mount Sinai School of Medicine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os

readme_filename = os.path.join(os.path.dirname(__file__), 'README.md')
with open(readme_filename, 'r') as f:
  readme = f.read()

try:
  import pypandoc
  readme = pypandoc.convert(readme, to='rst', format='md')
except:
  #print "Conversion of long_description from markdown to reStructuredText failed, skipping..."
  pass

from setuptools import setup

if __name__ == '__main__':
    setup(
        name='epitopes',
        version="0.2",
        description="Python interface to IEDB and other immune epitope data",
        author="Alex Rubinsteyn",
        author_email="alex {dot} rubinsteyn {at} mssm {dot} edu",
        url="https://github.com/hammerlab/epitopes",
	license="http://www.apache.org/licenses/LICENSE-2.0.html",
        classifiers=[
            'Development Status :: 3 - Alpha',
            'Environment :: Console',
            'Operating System :: OS Independent',
            'Intended Audience :: Science/Research',
	    'License :: OSI Approved :: Apache Software License',
            'Programming Language :: Python',
            'Topic :: Scientific/Engineering :: Bio-Informatics',
             ],
        requires=[
            'numpy(>=1.7)',
            'pandas(>=0.13.1)',
            'scikit.learn(>=0.14.1)',
            'progressbar',
            'biopython',
	    'datacache',
        ],
        long_description=readme,
        packages=['epitopes'],
        package_data = { 'epitopes' : ['data/*csv'] },
        include_package_data = True
    )
<|endoftext|>


<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import re
from glob import glob
from setuptools import find_packages, setup
from os.path import join, dirname

execfile(join(dirname(__file__), 'openerp', 'release.py'))  # Load release variables
lib_name = 'openerp'

def py2exe_datafiles():
    data_files = {}
    data_files['Microsoft.VC90.CRT'] = glob('C:\Microsoft.VC90.CRT\*.*')

    for root, dirnames, filenames in os.walk('openerp'):
        for filename in filenames:
            if not re.match(r'.*(\.pyc|\.pyo|\~)$', filename):
                data_files.setdefault(root, []).append(join(root, filename))

    import babel
    data_files['babel/localedata'] = glob(join(dirname(babel.__file__), 'localedata', '*'))
    others = ['global.dat', 'numbers.py', 'support.py', 'plural.py']
    data_files['babel'] = map(lambda f: join(dirname(babel.__file__), f), others)
    others = ['frontend.py', 'mofile.py']
    data_files['babel/messages'] = map(lambda f: join(dirname(babel.__file__), 'messages', f), others)

    import pytz
    tzdir = dirname(pytz.__file__)
    for root, _, filenames in os.walk(join(tzdir, 'zoneinfo')):
        base = join('pytz', root[len(tzdir) + 1:])
        data_files[base] = [join(root, f) for f in filenames]

    import docutils
    dudir = dirname(docutils.__file__)
    for root, _, filenames in os.walk(dudir):
        base = join('docutils', root[len(dudir) + 1:])
        data_files[base] = [join(root, f) for f in filenames if not f.endswith(('.py', '.pyc', '.pyo'))]

    return data_files.items()

def py2exe_options():
    if os.name == 'nt':
        import py2exe
        return {
            'console': [
                {'script': 'openerp-server', 'icon_resources': [
                    (1, join('setup', 'win32', 'static', 'pixmaps', 'openerp-icon.ico'))
                ]},
            ],
            'options': {
                'py2exe': {
                    'skip_archive': 1,
                    'optimize': 0,  # Keep the assert running as the integrated tests rely on them.
                    'dist_dir': 'dist',
                    'packages': [
                        'asynchat', 'asyncore',
                        'commands',
                        'dateutil',
                        'decimal',
                        'docutils',
                        'email',
                        'encodings',
                        'HTMLParser',
                        'imaplib',
                        'jinja2',
                        'lxml', 'lxml._elementpath', 'lxml.builder', 'lxml.etree', 'lxml.objectify',
                        'mako',
                        'markupsafe',
                        'mock',
                        'openerp',
                        'openid',
                        'PIL',
                        'poplib',
                        'psutil',
                        'pychart',
                        'pydot',
                        'pyparsing',
                        'pytz',
                        'reportlab',
                        'select',
                        'simplejson',
                        'smtplib',
                        'uuid',
                        'vatnumber',
                        'vobject',
                        'win32service', 'win32serviceutil',
                        'xlwt',
                        'xml', 'xml.dom',
                        'yaml',
                    ],
                    'excludes': ['Tkconstants', 'Tkinter', 'tcl'],
                }
            },
            'data_files': py2exe_datafiles()
        }
    else:
        return {}

setup(
    name='openerp',
    version=version,
    description=description,
    long_description=long_desc,
    url=url,
    author=author,
    author_email=author_email,
    classifiers=filter(None, classifiers.split('\n')),
    license=license,
    scripts=['openerp-server'],
    packages=find_packages(),
    package_dir={'%s' % lib_name: 'openerp'},
    include_package_data=True,
    dependency_links=['http://download.gna.org/pychart/'],
    install_requires=[
        'babel',
        'docutils',
        'feedparser',
        'gdata',
        'Jinja2',
        'lxml',  # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
        'mako',
        'mock',
        'PIL', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
        'psutil',  # windows binary code.google.com/p/psutil/downloads/list
        'psycopg2 >= 2.2',
        'pychart',  # not on pypi, use: pip install http://download.gna.org/pychart/PyChart-1.39.tar.gz
        'pydot',
        'python-dateutil < 2',
        'python-ldap',  # optional
        'python-openid',
        'pytz',
        'pywebdav < 0.9.8',
        'pyyaml',
        'reportlab',  # windows binary pypi.python.org/pypi/reportlab
        'simplejson',
        'unittest2',
        'vatnumber',
        'vobject',
        'werkzeug',
        'xlwt',
    ],
    extras_require={
        'SSL': ['pyopenssl'],
    },
    tests_require=[
        'unittest2',
    ],
    **py2exe_options()
)
<commit_msg>use the pypi version of PyChart<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import re
from glob import glob
from setuptools import find_packages, setup
from os.path import join, dirname

execfile(join(dirname(__file__), 'openerp', 'release.py'))  # Load release variables
lib_name = 'openerp'

def py2exe_datafiles():
    data_files = {}
    data_files['Microsoft.VC90.CRT'] = glob('C:\Microsoft.VC90.CRT\*.*')

    for root, dirnames, filenames in os.walk('openerp'):
        for filename in filenames:
            if not re.match(r'.*(\.pyc|\.pyo|\~)$', filename):
                data_files.setdefault(root, []).append(join(root, filename))

    import babel
    data_files['babel/localedata'] = glob(join(dirname(babel.__file__), 'localedata', '*'))
    others = ['global.dat', 'numbers.py', 'support.py', 'plural.py']
    data_files['babel'] = map(lambda f: join(dirname(babel.__file__), f), others)
    others = ['frontend.py', 'mofile.py']
    data_files['babel/messages'] = map(lambda f: join(dirname(babel.__file__), 'messages', f), others)

    import pytz
    tzdir = dirname(pytz.__file__)
    for root, _, filenames in os.walk(join(tzdir, 'zoneinfo')):
        base = join('pytz', root[len(tzdir) + 1:])
        data_files[base] = [join(root, f) for f in filenames]

    import docutils
    dudir = dirname(docutils.__file__)
    for root, _, filenames in os.walk(dudir):
        base = join('docutils', root[len(dudir) + 1:])
        data_files[base] = [join(root, f) for f in filenames if not f.endswith(('.py', '.pyc', '.pyo'))]

    return data_files.items()

def py2exe_options():
    if os.name == 'nt':
        import py2exe
        return {
            'console': [
                {'script': 'openerp-server', 'icon_resources': [
                    (1, join('setup', 'win32', 'static', 'pixmaps', 'openerp-icon.ico'))
                ]},
            ],
            'options': {
                'py2exe': {
                    'skip_archive': 1,
                    'optimize': 0,  # Keep the assert running as the integrated tests rely on them.
                    'dist_dir': 'dist',
                    'packages': [
                        'asynchat', 'asyncore',
                        'commands',
                        'dateutil',
                        'decimal',
                        'docutils',
                        'email',
                        'encodings',
                        'HTMLParser',
                        'imaplib',
                        'jinja2',
                        'lxml', 'lxml._elementpath', 'lxml.builder', 'lxml.etree', 'lxml.objectify',
                        'mako',
                        'markupsafe',
                        'mock',
                        'openerp',
                        'openid',
                        'PIL',
                        'poplib',
                        'psutil',
                        'python-chart',
                        'pydot',
                        'pyparsing',
                        'pytz',
                        'reportlab',
                        'select',
                        'simplejson',
                        'smtplib',
                        'uuid',
                        'vatnumber',
                        'vobject',
                        'win32service', 'win32serviceutil',
                        'xlwt',
                        'xml', 'xml.dom',
                        'yaml',
                    ],
                    'excludes': ['Tkconstants', 'Tkinter', 'tcl'],
                }
            },
            'data_files': py2exe_datafiles()
        }
    else:
        return {}

setup(
    name='openerp',
    version=version,
    description=description,
    long_description=long_desc,
    url=url,
    author=author,
    author_email=author_email,
    classifiers=filter(None, classifiers.split('\n')),
    license=license,
    scripts=['openerp-server'],
    packages=find_packages(),
    package_dir={'%s' % lib_name: 'openerp'},
    include_package_data=True,
    install_requires=[
        'babel',
        'docutils',
        'feedparser',
        'gdata',
        'Jinja2',
        'lxml',  # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
        'mako',
        'mock',
        'PIL', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/
        'psutil',  # windows binary code.google.com/p/psutil/downloads/list
        'psycopg2 >= 2.2',
        'python-chart',
        'pydot',
        'python-dateutil < 2',
        'python-ldap',  # optional
        'python-openid',
        'pytz',
        'pywebdav < 0.9.8',
        'pyyaml',
        'reportlab',  # windows binary pypi.python.org/pypi/reportlab
        'simplejson',
        'unittest2',
        'vatnumber',
        'vobject',
        'werkzeug',
        'xlwt',
    ],
    extras_require={
        'SSL': ['pyopenssl'],
    },
    tests_require=[
        'unittest2',
    ],
    **py2exe_options()
)
<|endoftext|>