commit stringlengths 40 40 | old_file stringlengths 4 118 | new_file stringlengths 4 118 | old_contents stringlengths 0 2.94k | new_contents stringlengths 1 4.43k | subject stringlengths 15 444 | message stringlengths 16 3.45k | lang stringclasses 1
value | license stringclasses 13
values | repos stringlengths 5 43.2k | prompt stringlengths 17 4.58k | response stringlengths 1 4.43k | prompt_tagged stringlengths 58 4.62k | response_tagged stringlengths 1 4.43k | text stringlengths 132 7.29k | text_tagged stringlengths 173 7.33k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3082fb50c028979643d479c0e65cb92ef12de586 | hunter/udacity.py | hunter/udacity.py | import requests
import os
class UnauthorizedToken(Exception):
pass
class UdacityConnection:
def __init__(self):
self.certifications_url = 'https://review-api.udacity.com/api/v1/me/certifications.json'
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': toke... | import requests
import os
class UnauthorizedToken(Exception):
pass
class UdacityConnection:
def __init__(self):
self.certifications_url = 'https://review-api.udacity.com/api/v1/me/certifications.json'
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': toke... | Add request to inside of try | Add request to inside of try
| Python | mit | anapaulagomes/reviews-assigner | import requests
import os
class UnauthorizedToken(Exception):
pass
class UdacityConnection:
def __init__(self):
self.certifications_url = 'https://review-api.udacity.com/api/v1/me/certifications.json'
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': toke... | import requests
import os
class UnauthorizedToken(Exception):
pass
class UdacityConnection:
def __init__(self):
self.certifications_url = 'https://review-api.udacity.com/api/v1/me/certifications.json'
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': toke... | <commit_before>import requests
import os
class UnauthorizedToken(Exception):
pass
class UdacityConnection:
def __init__(self):
self.certifications_url = 'https://review-api.udacity.com/api/v1/me/certifications.json'
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Autho... | import requests
import os
class UnauthorizedToken(Exception):
pass
class UdacityConnection:
def __init__(self):
self.certifications_url = 'https://review-api.udacity.com/api/v1/me/certifications.json'
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': toke... | import requests
import os
class UnauthorizedToken(Exception):
pass
class UdacityConnection:
def __init__(self):
self.certifications_url = 'https://review-api.udacity.com/api/v1/me/certifications.json'
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': toke... | <commit_before>import requests
import os
class UnauthorizedToken(Exception):
pass
class UdacityConnection:
def __init__(self):
self.certifications_url = 'https://review-api.udacity.com/api/v1/me/certifications.json'
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Autho... |
047f061514740d7935cce8e2aa25ef138b93f91f | deployer/__init__.py | deployer/__init__.py | from __future__ import absolute_import
import deployer.logger
from celery.signals import setup_logging
__version__ = '0.3.11'
__author__ = 'sukrit'
deployer.logger.init_logging()
setup_logging.connect(deployer.logger.init_celery_logging)
| from __future__ import absolute_import
import deployer.logger
from celery.signals import setup_logging
__version__ = '0.4.0'
__author__ = 'sukrit'
deployer.logger.init_logging()
setup_logging.connect(deployer.logger.init_celery_logging)
| Prepare for next development version | Prepare for next development version
| Python | mit | totem/cluster-deployer,totem/cluster-deployer,totem/cluster-deployer | from __future__ import absolute_import
import deployer.logger
from celery.signals import setup_logging
__version__ = '0.3.11'
__author__ = 'sukrit'
deployer.logger.init_logging()
setup_logging.connect(deployer.logger.init_celery_logging)
Prepare for next development version | from __future__ import absolute_import
import deployer.logger
from celery.signals import setup_logging
__version__ = '0.4.0'
__author__ = 'sukrit'
deployer.logger.init_logging()
setup_logging.connect(deployer.logger.init_celery_logging)
| <commit_before>from __future__ import absolute_import
import deployer.logger
from celery.signals import setup_logging
__version__ = '0.3.11'
__author__ = 'sukrit'
deployer.logger.init_logging()
setup_logging.connect(deployer.logger.init_celery_logging)
<commit_msg>Prepare for next development version<commit_after> | from __future__ import absolute_import
import deployer.logger
from celery.signals import setup_logging
__version__ = '0.4.0'
__author__ = 'sukrit'
deployer.logger.init_logging()
setup_logging.connect(deployer.logger.init_celery_logging)
| from __future__ import absolute_import
import deployer.logger
from celery.signals import setup_logging
__version__ = '0.3.11'
__author__ = 'sukrit'
deployer.logger.init_logging()
setup_logging.connect(deployer.logger.init_celery_logging)
Prepare for next development versionfrom __future__ import absolute_import
impo... | <commit_before>from __future__ import absolute_import
import deployer.logger
from celery.signals import setup_logging
__version__ = '0.3.11'
__author__ = 'sukrit'
deployer.logger.init_logging()
setup_logging.connect(deployer.logger.init_celery_logging)
<commit_msg>Prepare for next development version<commit_after>fr... |
3e37885f7241b985740bf753ca237c31497ac57e | courriers/management/commands/mailjet_sync_unsubscribed.py | courriers/management/commands/mailjet_sync_unsubscribed.py | from django.core.management.base import BaseCommand
from django.db import DEFAULT_DB_ALIAS
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--connection',
action='store',
dest='connection',
... | from django.core.management.base import BaseCommand
from django.db import DEFAULT_DB_ALIAS
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--connection',
action='store',
dest='connection',
... | Use list comprehension for mailjet_users list | Use list comprehension for mailjet_users list
| Python | mit | ulule/django-courriers,ulule/django-courriers | from django.core.management.base import BaseCommand
from django.db import DEFAULT_DB_ALIAS
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--connection',
action='store',
dest='connection',
... | from django.core.management.base import BaseCommand
from django.db import DEFAULT_DB_ALIAS
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--connection',
action='store',
dest='connection',
... | <commit_before>from django.core.management.base import BaseCommand
from django.db import DEFAULT_DB_ALIAS
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--connection',
action='store',
dest='conne... | from django.core.management.base import BaseCommand
from django.db import DEFAULT_DB_ALIAS
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--connection',
action='store',
dest='connection',
... | from django.core.management.base import BaseCommand
from django.db import DEFAULT_DB_ALIAS
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--connection',
action='store',
dest='connection',
... | <commit_before>from django.core.management.base import BaseCommand
from django.db import DEFAULT_DB_ALIAS
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--connection',
action='store',
dest='conne... |
fa089cabcc3b3aa71bcc86e028066e3dbcf25d5d | commands/cmd_help.py | commands/cmd_help.py | from lib.command import Command
class HelpCommand(Command):
name = 'help'
aliases = ['start']
description = 'Lists all bot commands and their descriptions.'
def run(self, message, args):
reply = 'Hi! I\'m {0} and these are my commands: \n\n'.format(self.bot.telegram.get_me().username)
... | from lib.command import Command
class HelpCommand(Command):
name = 'help'
aliases = ['start']
description = 'Lists all bot commands and their descriptions.'
def run(self, message, args):
reply = 'Hi! I\'m {0} and these are my commands: \n\n'.format(self.bot.telegram.get_me().username)
... | Add slash to all command aliases | Add slash to all command aliases
| Python | agpl-3.0 | TheReverend403/Pyper,TheReverend403/Pyper | from lib.command import Command
class HelpCommand(Command):
name = 'help'
aliases = ['start']
description = 'Lists all bot commands and their descriptions.'
def run(self, message, args):
reply = 'Hi! I\'m {0} and these are my commands: \n\n'.format(self.bot.telegram.get_me().username)
... | from lib.command import Command
class HelpCommand(Command):
name = 'help'
aliases = ['start']
description = 'Lists all bot commands and their descriptions.'
def run(self, message, args):
reply = 'Hi! I\'m {0} and these are my commands: \n\n'.format(self.bot.telegram.get_me().username)
... | <commit_before>from lib.command import Command
class HelpCommand(Command):
name = 'help'
aliases = ['start']
description = 'Lists all bot commands and their descriptions.'
def run(self, message, args):
reply = 'Hi! I\'m {0} and these are my commands: \n\n'.format(self.bot.telegram.get_me().us... | from lib.command import Command
class HelpCommand(Command):
name = 'help'
aliases = ['start']
description = 'Lists all bot commands and their descriptions.'
def run(self, message, args):
reply = 'Hi! I\'m {0} and these are my commands: \n\n'.format(self.bot.telegram.get_me().username)
... | from lib.command import Command
class HelpCommand(Command):
name = 'help'
aliases = ['start']
description = 'Lists all bot commands and their descriptions.'
def run(self, message, args):
reply = 'Hi! I\'m {0} and these are my commands: \n\n'.format(self.bot.telegram.get_me().username)
... | <commit_before>from lib.command import Command
class HelpCommand(Command):
name = 'help'
aliases = ['start']
description = 'Lists all bot commands and their descriptions.'
def run(self, message, args):
reply = 'Hi! I\'m {0} and these are my commands: \n\n'.format(self.bot.telegram.get_me().us... |
ce3028f29e40ce72693394798ca0a8daa98c1a4a | data/make_hash_dict.py | data/make_hash_dict.py | import data, json, os, sys
def make_hash_dict(top):
"""
Returns a dictionary with file paths and corresponding hashes.
Parameters
----------
data : str
The path to the directory containing files needing hashes.
Returns
-------
hash_dict : dict
Dictionary with file ... | import data, json, os, sys
def make_hash_dict(top):
"""
Returns a dictionary with file paths and corresponding hashes.
Parameters
----------
data : str
The path to the directory containing files needing hashes.
Returns
-------
hash_dict : dict
Dictionary with file ... | Make JSON containing paths and hashs | WIP: Make JSON containing paths and hashs
| Python | bsd-3-clause | berkeley-stat159/project-delta | import data, json, os, sys
def make_hash_dict(top):
"""
Returns a dictionary with file paths and corresponding hashes.
Parameters
----------
data : str
The path to the directory containing files needing hashes.
Returns
-------
hash_dict : dict
Dictionary with file ... | import data, json, os, sys
def make_hash_dict(top):
"""
Returns a dictionary with file paths and corresponding hashes.
Parameters
----------
data : str
The path to the directory containing files needing hashes.
Returns
-------
hash_dict : dict
Dictionary with file ... | <commit_before>import data, json, os, sys
def make_hash_dict(top):
"""
Returns a dictionary with file paths and corresponding hashes.
Parameters
----------
data : str
The path to the directory containing files needing hashes.
Returns
-------
hash_dict : dict
Dictio... | import data, json, os, sys
def make_hash_dict(top):
"""
Returns a dictionary with file paths and corresponding hashes.
Parameters
----------
data : str
The path to the directory containing files needing hashes.
Returns
-------
hash_dict : dict
Dictionary with file ... | import data, json, os, sys
def make_hash_dict(top):
"""
Returns a dictionary with file paths and corresponding hashes.
Parameters
----------
data : str
The path to the directory containing files needing hashes.
Returns
-------
hash_dict : dict
Dictionary with file ... | <commit_before>import data, json, os, sys
def make_hash_dict(top):
"""
Returns a dictionary with file paths and corresponding hashes.
Parameters
----------
data : str
The path to the directory containing files needing hashes.
Returns
-------
hash_dict : dict
Dictio... |
8660d5570144894cf4e6e07b3a30526b35575dce | test/Analysis/analyzer_test.py | test/Analysis/analyzer_test.py | import lit.formats
import lit.TestRunner
# Custom format class for static analyzer tests
class AnalyzerTest(lit.formats.ShTest):
def execute(self, test, litConfig):
result = self.executeWithAnalyzeSubstitution(
test, litConfig, '-analyzer-constraints=range')
if result.code == lit.Test... | import lit.formats
import lit.TestRunner
# Custom format class for static analyzer tests
class AnalyzerTest(lit.formats.ShTest):
def execute(self, test, litConfig):
results = []
# Parse any test requirements ('REQUIRES: ')
saved_test = test
lit.TestRunner.parseIntegratedTestScript... | Improve test handling with multiple constraint managers | [analyzer]: Improve test handling with multiple constraint managers
Summary: Modify the test infrastructure to properly handle tests that require z3, and merge together the output of all tests on success. This is required for D28954.
Reviewers: dcoughlin, zaks.anna, NoQ, xazax.hun
Subscribers: cfe-commits
Different... | Python | apache-2.0 | llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-cl... | import lit.formats
import lit.TestRunner
# Custom format class for static analyzer tests
class AnalyzerTest(lit.formats.ShTest):
def execute(self, test, litConfig):
result = self.executeWithAnalyzeSubstitution(
test, litConfig, '-analyzer-constraints=range')
if result.code == lit.Test... | import lit.formats
import lit.TestRunner
# Custom format class for static analyzer tests
class AnalyzerTest(lit.formats.ShTest):
def execute(self, test, litConfig):
results = []
# Parse any test requirements ('REQUIRES: ')
saved_test = test
lit.TestRunner.parseIntegratedTestScript... | <commit_before>import lit.formats
import lit.TestRunner
# Custom format class for static analyzer tests
class AnalyzerTest(lit.formats.ShTest):
def execute(self, test, litConfig):
result = self.executeWithAnalyzeSubstitution(
test, litConfig, '-analyzer-constraints=range')
if result.c... | import lit.formats
import lit.TestRunner
# Custom format class for static analyzer tests
class AnalyzerTest(lit.formats.ShTest):
def execute(self, test, litConfig):
results = []
# Parse any test requirements ('REQUIRES: ')
saved_test = test
lit.TestRunner.parseIntegratedTestScript... | import lit.formats
import lit.TestRunner
# Custom format class for static analyzer tests
class AnalyzerTest(lit.formats.ShTest):
def execute(self, test, litConfig):
result = self.executeWithAnalyzeSubstitution(
test, litConfig, '-analyzer-constraints=range')
if result.code == lit.Test... | <commit_before>import lit.formats
import lit.TestRunner
# Custom format class for static analyzer tests
class AnalyzerTest(lit.formats.ShTest):
def execute(self, test, litConfig):
result = self.executeWithAnalyzeSubstitution(
test, litConfig, '-analyzer-constraints=range')
if result.c... |
ab1ea39c020e39bdc7b739e2ab49b1cacbecd081 | detectem/ws.py | detectem/ws.py | import sys
import json
from detectem.exceptions import SplashError, NoPluginsError
try:
from bottle import run, post, request
except ImportError:
print("Install bottle to use the web service ..")
sys.exit(0)
from detectem.cli import get_detection_results
@post('/detect')
def do_detection():
url = ... | import sys
import json
try:
import bottle
from bottle import run, post, request
except ImportError:
print('[+] Install bottle to use the web service')
sys.exit(0)
from detectem.exceptions import SplashError, NoPluginsError
from detectem.cli import get_detection_results
from detectem.settings import DE... | Add debug mode to webservice | Add debug mode to webservice
Add main function to avoid executing the webserver in tests
Reorder imports
| Python | mit | spectresearch/detectem | import sys
import json
from detectem.exceptions import SplashError, NoPluginsError
try:
from bottle import run, post, request
except ImportError:
print("Install bottle to use the web service ..")
sys.exit(0)
from detectem.cli import get_detection_results
@post('/detect')
def do_detection():
url = ... | import sys
import json
try:
import bottle
from bottle import run, post, request
except ImportError:
print('[+] Install bottle to use the web service')
sys.exit(0)
from detectem.exceptions import SplashError, NoPluginsError
from detectem.cli import get_detection_results
from detectem.settings import DE... | <commit_before>import sys
import json
from detectem.exceptions import SplashError, NoPluginsError
try:
from bottle import run, post, request
except ImportError:
print("Install bottle to use the web service ..")
sys.exit(0)
from detectem.cli import get_detection_results
@post('/detect')
def do_detectio... | import sys
import json
try:
import bottle
from bottle import run, post, request
except ImportError:
print('[+] Install bottle to use the web service')
sys.exit(0)
from detectem.exceptions import SplashError, NoPluginsError
from detectem.cli import get_detection_results
from detectem.settings import DE... | import sys
import json
from detectem.exceptions import SplashError, NoPluginsError
try:
from bottle import run, post, request
except ImportError:
print("Install bottle to use the web service ..")
sys.exit(0)
from detectem.cli import get_detection_results
@post('/detect')
def do_detection():
url = ... | <commit_before>import sys
import json
from detectem.exceptions import SplashError, NoPluginsError
try:
from bottle import run, post, request
except ImportError:
print("Install bottle to use the web service ..")
sys.exit(0)
from detectem.cli import get_detection_results
@post('/detect')
def do_detectio... |
7266d78fa491acc5d2000bdf14cb8bc8dbc8c7f4 | test/testfunctions/__init__.py | test/testfunctions/__init__.py | # -*- coding: utf-8 -*-
#
__all__ = [
'annotate',
'basic_sin',
'circle_patch',
'dual_axis',
'errorband',
'errorbar',
'fancybox',
'heat',
'image_plot',
'legends2',
'legends',
'loglogplot',
'logplot',
'noise',
'noise2',
'patches',
'scatter',
'subplots',
'subplot4x4',
'text_overlay'... | # -*- coding: utf-8 -*-
#
__all__ = [
'annotate',
'basic_sin',
'circle_patch',
'dual_axis',
'errorband',
'errorbar',
'fancybox',
'heat',
'image_plot',
'legends2',
'legends',
'loglogplot',
'logplot',
'marker',
'noise',
'noise2',
'patches',
'scatter',
'subplots',
'subplot4x4',
't... | Add 'marker' to the list of tests to be run | Add 'marker' to the list of tests to be run
| Python | mit | nschloe/matplotlib2tikz,danielhkl/matplotlib2tikz,m-rossi/matplotlib2tikz,dougnd/matplotlib2tikz | # -*- coding: utf-8 -*-
#
__all__ = [
'annotate',
'basic_sin',
'circle_patch',
'dual_axis',
'errorband',
'errorbar',
'fancybox',
'heat',
'image_plot',
'legends2',
'legends',
'loglogplot',
'logplot',
'noise',
'noise2',
'patches',
'scatter',
'subplots',
'subplot4x4',
'text_overlay'... | # -*- coding: utf-8 -*-
#
__all__ = [
'annotate',
'basic_sin',
'circle_patch',
'dual_axis',
'errorband',
'errorbar',
'fancybox',
'heat',
'image_plot',
'legends2',
'legends',
'loglogplot',
'logplot',
'marker',
'noise',
'noise2',
'patches',
'scatter',
'subplots',
'subplot4x4',
't... | <commit_before># -*- coding: utf-8 -*-
#
__all__ = [
'annotate',
'basic_sin',
'circle_patch',
'dual_axis',
'errorband',
'errorbar',
'fancybox',
'heat',
'image_plot',
'legends2',
'legends',
'loglogplot',
'logplot',
'noise',
'noise2',
'patches',
'scatter',
'subplots',
'subplot4x4',
... | # -*- coding: utf-8 -*-
#
__all__ = [
'annotate',
'basic_sin',
'circle_patch',
'dual_axis',
'errorband',
'errorbar',
'fancybox',
'heat',
'image_plot',
'legends2',
'legends',
'loglogplot',
'logplot',
'marker',
'noise',
'noise2',
'patches',
'scatter',
'subplots',
'subplot4x4',
't... | # -*- coding: utf-8 -*-
#
__all__ = [
'annotate',
'basic_sin',
'circle_patch',
'dual_axis',
'errorband',
'errorbar',
'fancybox',
'heat',
'image_plot',
'legends2',
'legends',
'loglogplot',
'logplot',
'noise',
'noise2',
'patches',
'scatter',
'subplots',
'subplot4x4',
'text_overlay'... | <commit_before># -*- coding: utf-8 -*-
#
__all__ = [
'annotate',
'basic_sin',
'circle_patch',
'dual_axis',
'errorband',
'errorbar',
'fancybox',
'heat',
'image_plot',
'legends2',
'legends',
'loglogplot',
'logplot',
'noise',
'noise2',
'patches',
'scatter',
'subplots',
'subplot4x4',
... |
53025df032e1b9296713f3d8f7866e9936ed1af7 | qsimcirq/_version.py | qsimcirq/_version.py | """The version number defined here is read automatically in setup.py."""
__version__ = "0.12.1"
| """The version number defined here is read automatically in setup.py."""
__version__ = "0.12.2.dev20220422"
| Update to dev version 2022-04-22 | Update to dev version 2022-04-22 | Python | apache-2.0 | quantumlib/qsim,quantumlib/qsim,quantumlib/qsim,quantumlib/qsim | """The version number defined here is read automatically in setup.py."""
__version__ = "0.12.1"
Update to dev version 2022-04-22 | """The version number defined here is read automatically in setup.py."""
__version__ = "0.12.2.dev20220422"
| <commit_before>"""The version number defined here is read automatically in setup.py."""
__version__ = "0.12.1"
<commit_msg>Update to dev version 2022-04-22<commit_after> | """The version number defined here is read automatically in setup.py."""
__version__ = "0.12.2.dev20220422"
| """The version number defined here is read automatically in setup.py."""
__version__ = "0.12.1"
Update to dev version 2022-04-22"""The version number defined here is read automatically in setup.py."""
__version__ = "0.12.2.dev20220422"
| <commit_before>"""The version number defined here is read automatically in setup.py."""
__version__ = "0.12.1"
<commit_msg>Update to dev version 2022-04-22<commit_after>"""The version number defined here is read automatically in setup.py."""
__version__ = "0.12.2.dev20220422"
|
3f65b43bce12739af8bb3dfc451a7f58a6af12b1 | dbaas/api/environment.py | dbaas/api/environment.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from rest_framework import viewsets, serializers
from physical import models
class EnvironmentSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = models.Environment
fields = ('url', 'id', 'name',)... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from rest_framework import viewsets, serializers
from physical.models import Environment
class EnvironmentSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Environment
fields = ('url', 'id', 'na... | Add povisioner and stage on env API | Add povisioner and stage on env API
| Python | bsd-3-clause | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from rest_framework import viewsets, serializers
from physical import models
class EnvironmentSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = models.Environment
fields = ('url', 'id', 'name',)... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from rest_framework import viewsets, serializers
from physical.models import Environment
class EnvironmentSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Environment
fields = ('url', 'id', 'na... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from rest_framework import viewsets, serializers
from physical import models
class EnvironmentSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = models.Environment
fields = ('url',... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from rest_framework import viewsets, serializers
from physical.models import Environment
class EnvironmentSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Environment
fields = ('url', 'id', 'na... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from rest_framework import viewsets, serializers
from physical import models
class EnvironmentSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = models.Environment
fields = ('url', 'id', 'name',)... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from rest_framework import viewsets, serializers
from physical import models
class EnvironmentSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = models.Environment
fields = ('url',... |
c897942c8b1c3d9283ea6453bcc6616ca3d5108e | builds/python3.6_ci/src/lint_turtle_files.py | builds/python3.6_ci/src/lint_turtle_files.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
This script takes the path to a directory, and looks for any Turtle files
(https://www.w3.org/TeamSubmission/turtle/), then uses RDFLib to check if
they're valid TTL.
It exits with code 0 if all files are valid, 1 if not.
"""
print("Hello, I am turtle linter")
| #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
This script takes the path to a directory, and looks for any Turtle files
(https://www.w3.org/TeamSubmission/turtle/), then uses RDFLib to check if
they're valid TTL.
It exits with code 0 if all files are valid, 1 if not.
"""
import logging
import os
import daiquir... | Write a proper Turtle linter | Write a proper Turtle linter
| Python | mit | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
This script takes the path to a directory, and looks for any Turtle files
(https://www.w3.org/TeamSubmission/turtle/), then uses RDFLib to check if
they're valid TTL.
It exits with code 0 if all files are valid, 1 if not.
"""
print("Hello, I am turtle linter")
Write... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
This script takes the path to a directory, and looks for any Turtle files
(https://www.w3.org/TeamSubmission/turtle/), then uses RDFLib to check if
they're valid TTL.
It exits with code 0 if all files are valid, 1 if not.
"""
import logging
import os
import daiquir... | <commit_before>#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
This script takes the path to a directory, and looks for any Turtle files
(https://www.w3.org/TeamSubmission/turtle/), then uses RDFLib to check if
they're valid TTL.
It exits with code 0 if all files are valid, 1 if not.
"""
print("Hello, I am turtle... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
This script takes the path to a directory, and looks for any Turtle files
(https://www.w3.org/TeamSubmission/turtle/), then uses RDFLib to check if
they're valid TTL.
It exits with code 0 if all files are valid, 1 if not.
"""
import logging
import os
import daiquir... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
This script takes the path to a directory, and looks for any Turtle files
(https://www.w3.org/TeamSubmission/turtle/), then uses RDFLib to check if
they're valid TTL.
It exits with code 0 if all files are valid, 1 if not.
"""
print("Hello, I am turtle linter")
Write... | <commit_before>#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
This script takes the path to a directory, and looks for any Turtle files
(https://www.w3.org/TeamSubmission/turtle/), then uses RDFLib to check if
they're valid TTL.
It exits with code 0 if all files are valid, 1 if not.
"""
print("Hello, I am turtle... |
62f028d61b9d5669bc05c2bbe5ce5f4e0d4401cc | src/vimapt/library/vimapt/RemoteRepo.py | src/vimapt/library/vimapt/RemoteRepo.py | #!/usr/bin/env python
import os
from .data_format import dumps
class RemoteRepo(object):
def __init__(self, repo_dir):
self.repo_dir = repo_dir
# initial setup
pool_relative_dir = "pool"
package_relative_path = "index/package"
self.pool_absolute_dir = os.path.join(self.r... | #!/usr/bin/env python
import os
from .data_format import dumps
class RemoteRepo(object):
def __init__(self, repo_dir):
self.repo_dir = repo_dir
# initial setup
pool_relative_dir = "pool"
package_relative_path = "index/package"
self.pool_absolute_dir = os.path.join(self.r... | Fix bug when parse version info | Fix bug when parse version info
| Python | mit | howl-anderson/vimapt,howl-anderson/vimapt | #!/usr/bin/env python
import os
from .data_format import dumps
class RemoteRepo(object):
def __init__(self, repo_dir):
self.repo_dir = repo_dir
# initial setup
pool_relative_dir = "pool"
package_relative_path = "index/package"
self.pool_absolute_dir = os.path.join(self.r... | #!/usr/bin/env python
import os
from .data_format import dumps
class RemoteRepo(object):
def __init__(self, repo_dir):
self.repo_dir = repo_dir
# initial setup
pool_relative_dir = "pool"
package_relative_path = "index/package"
self.pool_absolute_dir = os.path.join(self.r... | <commit_before>#!/usr/bin/env python
import os
from .data_format import dumps
class RemoteRepo(object):
def __init__(self, repo_dir):
self.repo_dir = repo_dir
# initial setup
pool_relative_dir = "pool"
package_relative_path = "index/package"
self.pool_absolute_dir = os.p... | #!/usr/bin/env python
import os
from .data_format import dumps
class RemoteRepo(object):
def __init__(self, repo_dir):
self.repo_dir = repo_dir
# initial setup
pool_relative_dir = "pool"
package_relative_path = "index/package"
self.pool_absolute_dir = os.path.join(self.r... | #!/usr/bin/env python
import os
from .data_format import dumps
class RemoteRepo(object):
def __init__(self, repo_dir):
self.repo_dir = repo_dir
# initial setup
pool_relative_dir = "pool"
package_relative_path = "index/package"
self.pool_absolute_dir = os.path.join(self.r... | <commit_before>#!/usr/bin/env python
import os
from .data_format import dumps
class RemoteRepo(object):
def __init__(self, repo_dir):
self.repo_dir = repo_dir
# initial setup
pool_relative_dir = "pool"
package_relative_path = "index/package"
self.pool_absolute_dir = os.p... |
726c4f14fd5ddd49024163182917aeb9f4af504d | src/wirecloud/core/catalogue_manager.py | src/wirecloud/core/catalogue_manager.py | # -*- coding: utf-8 -*-
# Copyright 2012 Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | # -*- coding: utf-8 -*-
# Copyright 2012 Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | Make published mashups visibles to all users | Make published mashups visibles to all users
| Python | agpl-3.0 | jpajuelo/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud | # -*- coding: utf-8 -*-
# Copyright 2012 Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | # -*- coding: utf-8 -*-
# Copyright 2012 Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2012 Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... | # -*- coding: utf-8 -*-
# Copyright 2012 Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | # -*- coding: utf-8 -*-
# Copyright 2012 Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2012 Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... |
32cd8227260f5c2fedc50b9b817ee27df2398a82 | Server/Code/database/model.py | Server/Code/database/model.py | from config import PASSWORD_LENGTH
from sqlalchemy import BigInteger, Column, ForeignKey, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'user'
id = Column(BigInteger, primary_key=True, autoincrement=True)
password = Column(Stri... | from config import PASSWORD_LENGTH
from sqlalchemy import BigInteger, Column, ForeignKey, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'user'
id = Column(BigInteger, primary_key=True, autoincrement=True)
password = Column(Stri... | Update user, fight foreign key dependency | Update user, fight foreign key dependency
| Python | mit | HueyPark/Unreal-Knights,HueyPark/Unreal-Knights,HueyPark/Unreal-Knights,HueyPark/Unreal-Knights | from config import PASSWORD_LENGTH
from sqlalchemy import BigInteger, Column, ForeignKey, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'user'
id = Column(BigInteger, primary_key=True, autoincrement=True)
password = Column(Stri... | from config import PASSWORD_LENGTH
from sqlalchemy import BigInteger, Column, ForeignKey, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'user'
id = Column(BigInteger, primary_key=True, autoincrement=True)
password = Column(Stri... | <commit_before>from config import PASSWORD_LENGTH
from sqlalchemy import BigInteger, Column, ForeignKey, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'user'
id = Column(BigInteger, primary_key=True, autoincrement=True)
passwor... | from config import PASSWORD_LENGTH
from sqlalchemy import BigInteger, Column, ForeignKey, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'user'
id = Column(BigInteger, primary_key=True, autoincrement=True)
password = Column(Stri... | from config import PASSWORD_LENGTH
from sqlalchemy import BigInteger, Column, ForeignKey, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'user'
id = Column(BigInteger, primary_key=True, autoincrement=True)
password = Column(Stri... | <commit_before>from config import PASSWORD_LENGTH
from sqlalchemy import BigInteger, Column, ForeignKey, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'user'
id = Column(BigInteger, primary_key=True, autoincrement=True)
passwor... |
6854f889e38f565acb80c52a74df09730e0f7e45 | uitools/notifications/linux.py | uitools/notifications/linux.py |
from gi.repository import GLib, Notify as LibNotify
class Notification(object):
def __init__(self, title, message, subtitle=None, sticky=False):
self.title = title
self.subtitle = subtitle
self.message = message
self.sticky = sticky
self._sent = False
def send(self):... |
from gi.repository import GLib, Notify as LibNotify
DEV = False
class Notification(object):
def __init__(self, title, message, subtitle=None, sticky=False):
self.title = title
self.subtitle = subtitle
self.message = message
self.sticky = sticky
self._sent = False
de... | Clean up for production Linux use | Clean up for production Linux use
| Python | bsd-3-clause | westernx/uitools |
from gi.repository import GLib, Notify as LibNotify
class Notification(object):
def __init__(self, title, message, subtitle=None, sticky=False):
self.title = title
self.subtitle = subtitle
self.message = message
self.sticky = sticky
self._sent = False
def send(self):... |
from gi.repository import GLib, Notify as LibNotify
DEV = False
class Notification(object):
def __init__(self, title, message, subtitle=None, sticky=False):
self.title = title
self.subtitle = subtitle
self.message = message
self.sticky = sticky
self._sent = False
de... | <commit_before>
from gi.repository import GLib, Notify as LibNotify
class Notification(object):
def __init__(self, title, message, subtitle=None, sticky=False):
self.title = title
self.subtitle = subtitle
self.message = message
self.sticky = sticky
self._sent = False
... |
from gi.repository import GLib, Notify as LibNotify
DEV = False
class Notification(object):
def __init__(self, title, message, subtitle=None, sticky=False):
self.title = title
self.subtitle = subtitle
self.message = message
self.sticky = sticky
self._sent = False
de... |
from gi.repository import GLib, Notify as LibNotify
class Notification(object):
def __init__(self, title, message, subtitle=None, sticky=False):
self.title = title
self.subtitle = subtitle
self.message = message
self.sticky = sticky
self._sent = False
def send(self):... | <commit_before>
from gi.repository import GLib, Notify as LibNotify
class Notification(object):
def __init__(self, title, message, subtitle=None, sticky=False):
self.title = title
self.subtitle = subtitle
self.message = message
self.sticky = sticky
self._sent = False
... |
3f9d79d50890f8605c7dfbaf5147b6f099b063b4 | Machine/admin.py | Machine/admin.py | from django.contrib import admin
from django.db import models
from Machine import models as mmod
class ContactInLine(admin.TabularInline):
model = mmod.Contact
max_num = 2
class StatusAdmin(admin.ModelAdmin):
list_display = ('name', 'description')
fieldsets = (
(None, {'fields': ('name', ... | from django.contrib import admin
from django.db import models
from Machine import models as mmod
class ContactInLine(admin.TabularInline):
model = mmod.Contact
max_num = 2
class StatusAdmin(admin.ModelAdmin):
list_display = ('name', 'description')
fieldsets = (
(None, {'fields': ('name', ... | Change the third item of the search_field from 'mac' to 'mac1' | Change the third item of the search_field from 'mac' to 'mac1'
| Python | apache-2.0 | abztrakt/labtracker,abztrakt/labtracker,abztrakt/labtracker | from django.contrib import admin
from django.db import models
from Machine import models as mmod
class ContactInLine(admin.TabularInline):
model = mmod.Contact
max_num = 2
class StatusAdmin(admin.ModelAdmin):
list_display = ('name', 'description')
fieldsets = (
(None, {'fields': ('name', ... | from django.contrib import admin
from django.db import models
from Machine import models as mmod
class ContactInLine(admin.TabularInline):
model = mmod.Contact
max_num = 2
class StatusAdmin(admin.ModelAdmin):
list_display = ('name', 'description')
fieldsets = (
(None, {'fields': ('name', ... | <commit_before>from django.contrib import admin
from django.db import models
from Machine import models as mmod
class ContactInLine(admin.TabularInline):
model = mmod.Contact
max_num = 2
class StatusAdmin(admin.ModelAdmin):
list_display = ('name', 'description')
fieldsets = (
(None, {'fie... | from django.contrib import admin
from django.db import models
from Machine import models as mmod
class ContactInLine(admin.TabularInline):
model = mmod.Contact
max_num = 2
class StatusAdmin(admin.ModelAdmin):
list_display = ('name', 'description')
fieldsets = (
(None, {'fields': ('name', ... | from django.contrib import admin
from django.db import models
from Machine import models as mmod
class ContactInLine(admin.TabularInline):
model = mmod.Contact
max_num = 2
class StatusAdmin(admin.ModelAdmin):
list_display = ('name', 'description')
fieldsets = (
(None, {'fields': ('name', ... | <commit_before>from django.contrib import admin
from django.db import models
from Machine import models as mmod
class ContactInLine(admin.TabularInline):
model = mmod.Contact
max_num = 2
class StatusAdmin(admin.ModelAdmin):
list_display = ('name', 'description')
fieldsets = (
(None, {'fie... |
513aa1bd78d4f2d592ad5f34835331e315a5af77 | dyngraph/__init__.py | dyngraph/__init__.py | __all__ = ['algorithms', 'dialogs', 'exporter', 'legend', 'mainui', 'puplot', 'tsplot', 'utils']
| __all__ = ['algorithms', 'dialogs', 'exporter', 'legend', 'mainui', 'puplot', 'tsplot', 'utils', 'ui']
| Add ui module to path | Add ui module to path
| Python | isc | jaj42/dyngraph,jaj42/GraPhysio,jaj42/GraPhysio | __all__ = ['algorithms', 'dialogs', 'exporter', 'legend', 'mainui', 'puplot', 'tsplot', 'utils']
Add ui module to path | __all__ = ['algorithms', 'dialogs', 'exporter', 'legend', 'mainui', 'puplot', 'tsplot', 'utils', 'ui']
| <commit_before>__all__ = ['algorithms', 'dialogs', 'exporter', 'legend', 'mainui', 'puplot', 'tsplot', 'utils']
<commit_msg>Add ui module to path<commit_after> | __all__ = ['algorithms', 'dialogs', 'exporter', 'legend', 'mainui', 'puplot', 'tsplot', 'utils', 'ui']
| __all__ = ['algorithms', 'dialogs', 'exporter', 'legend', 'mainui', 'puplot', 'tsplot', 'utils']
Add ui module to path__all__ = ['algorithms', 'dialogs', 'exporter', 'legend', 'mainui', 'puplot', 'tsplot', 'utils', 'ui']
| <commit_before>__all__ = ['algorithms', 'dialogs', 'exporter', 'legend', 'mainui', 'puplot', 'tsplot', 'utils']
<commit_msg>Add ui module to path<commit_after>__all__ = ['algorithms', 'dialogs', 'exporter', 'legend', 'mainui', 'puplot', 'tsplot', 'utils', 'ui']
|
76df79075d0fdfb310a99f0805ccae253d439ee2 | game/player.py | game/player.py | #!/usr/bin/env python
from abc import ABCMeta, abstractmethod
from game.gameboard import GameBoard
class Player(object):
__metaclass__ = ABCMeta
def __init__(self, color):
self._color = color.lower()
def color(self):
return self._color
def is_winner(self, board):
if board.gam... | #!/usr/bin/env python
from abc import ABCMeta, abstractmethod
from game.gameboard import GameBoard
class Player(object):
__metaclass__ = ABCMeta
def __init__(self, color):
self._color = color.lower()
def color(self):
return self._color
def is_winner(self, board):
return board... | Replace the particular boolean returns with a boolean expression on is_winner | Replace the particular boolean returns with a boolean expression on is_winner
| Python | apache-2.0 | apojomovsky/cuatro_en_linea,apojomovsky/cuatro_en_linea | #!/usr/bin/env python
from abc import ABCMeta, abstractmethod
from game.gameboard import GameBoard
class Player(object):
__metaclass__ = ABCMeta
def __init__(self, color):
self._color = color.lower()
def color(self):
return self._color
def is_winner(self, board):
if board.gam... | #!/usr/bin/env python
from abc import ABCMeta, abstractmethod
from game.gameboard import GameBoard
class Player(object):
__metaclass__ = ABCMeta
def __init__(self, color):
self._color = color.lower()
def color(self):
return self._color
def is_winner(self, board):
return board... | <commit_before>#!/usr/bin/env python
from abc import ABCMeta, abstractmethod
from game.gameboard import GameBoard
class Player(object):
__metaclass__ = ABCMeta
def __init__(self, color):
self._color = color.lower()
def color(self):
return self._color
def is_winner(self, board):
... | #!/usr/bin/env python
from abc import ABCMeta, abstractmethod
from game.gameboard import GameBoard
class Player(object):
__metaclass__ = ABCMeta
def __init__(self, color):
self._color = color.lower()
def color(self):
return self._color
def is_winner(self, board):
return board... | #!/usr/bin/env python
from abc import ABCMeta, abstractmethod
from game.gameboard import GameBoard
class Player(object):
__metaclass__ = ABCMeta
def __init__(self, color):
self._color = color.lower()
def color(self):
return self._color
def is_winner(self, board):
if board.gam... | <commit_before>#!/usr/bin/env python
from abc import ABCMeta, abstractmethod
from game.gameboard import GameBoard
class Player(object):
__metaclass__ = ABCMeta
def __init__(self, color):
self._color = color.lower()
def color(self):
return self._color
def is_winner(self, board):
... |
425152f3c65b6c58065cde9ccbcebd360289ec8c | files_and_folders.py | files_and_folders.py | import os
def files_and_folders(dir_path='.'):
files = []
folders = []
for filename in sorted(os.listdir(dir_path)):
if os.path.isdir(os.path.join(dir_path, filename)):
folders.append(filename)
else:
files.append(filename)
return tuple(files), tuple(folders)
| import os
# improvement liberally borrowed from:
# https://forum.omz-software.com/topic/2784/feature-request-pythonista-built-in-file-picker
def files_and_folders(dir_path='.'):
'''Return a dict containing a sorted tuple of files and a sorted
tuple of folders'''
f_and_f = os.listdir(dir_path)
folders... | Cut number of lines in half | Cut number of lines in half
@The-Penultimate-Defenestrator use of sets is a nice optimization!
# improvement liberally borrowed from:
# https://forum.omz-software.com/topic/2784/feature-request-pythonista-built-in-file-picker | Python | apache-2.0 | cclauss/Ten-lines-or-less | import os
def files_and_folders(dir_path='.'):
files = []
folders = []
for filename in sorted(os.listdir(dir_path)):
if os.path.isdir(os.path.join(dir_path, filename)):
folders.append(filename)
else:
files.append(filename)
return tuple(files), tuple(folders)
Cut n... | import os
# improvement liberally borrowed from:
# https://forum.omz-software.com/topic/2784/feature-request-pythonista-built-in-file-picker
def files_and_folders(dir_path='.'):
'''Return a dict containing a sorted tuple of files and a sorted
tuple of folders'''
f_and_f = os.listdir(dir_path)
folders... | <commit_before>import os
def files_and_folders(dir_path='.'):
files = []
folders = []
for filename in sorted(os.listdir(dir_path)):
if os.path.isdir(os.path.join(dir_path, filename)):
folders.append(filename)
else:
files.append(filename)
return tuple(files), tuple... | import os
# improvement liberally borrowed from:
# https://forum.omz-software.com/topic/2784/feature-request-pythonista-built-in-file-picker
def files_and_folders(dir_path='.'):
'''Return a dict containing a sorted tuple of files and a sorted
tuple of folders'''
f_and_f = os.listdir(dir_path)
folders... | import os
def files_and_folders(dir_path='.'):
files = []
folders = []
for filename in sorted(os.listdir(dir_path)):
if os.path.isdir(os.path.join(dir_path, filename)):
folders.append(filename)
else:
files.append(filename)
return tuple(files), tuple(folders)
Cut n... | <commit_before>import os
def files_and_folders(dir_path='.'):
files = []
folders = []
for filename in sorted(os.listdir(dir_path)):
if os.path.isdir(os.path.join(dir_path, filename)):
folders.append(filename)
else:
files.append(filename)
return tuple(files), tuple... |
a1fdc8e14377d4fe619550e12ea359e5e9c60f0e | dear_astrid/test/helpers.py | dear_astrid/test/helpers.py | import datetime
import os
import sys
import time
from dear_astrid.constants import *
from dear_astrid.constants import __all__ as _constants_all
from dear_astrid.tzinfo import *
from dear_astrid.tzinfo import __all__ as _tzinfo_all
__all__ = [
'dtu',
'u',
'timezone',
] + _constants_all + _tzinfo_all
def dtu(*... | import datetime
import os
import sys
import time
from dear_astrid.constants import *
from dear_astrid.constants import __all__ as _constants_all
from dear_astrid.tzinfo import *
from dear_astrid.tzinfo import __all__ as _tzinfo_all
__all__ = [
'dtu',
'u',
'timezone',
] + _constants_all + _tzinfo_all
def dtu(*... | Simplify py 2/3 unicode string helper | Simplify py 2/3 unicode string helper
| Python | mit | rwstauner/dear_astrid,rwstauner/dear_astrid | import datetime
import os
import sys
import time
from dear_astrid.constants import *
from dear_astrid.constants import __all__ as _constants_all
from dear_astrid.tzinfo import *
from dear_astrid.tzinfo import __all__ as _tzinfo_all
__all__ = [
'dtu',
'u',
'timezone',
] + _constants_all + _tzinfo_all
def dtu(*... | import datetime
import os
import sys
import time
from dear_astrid.constants import *
from dear_astrid.constants import __all__ as _constants_all
from dear_astrid.tzinfo import *
from dear_astrid.tzinfo import __all__ as _tzinfo_all
__all__ = [
'dtu',
'u',
'timezone',
] + _constants_all + _tzinfo_all
def dtu(*... | <commit_before>import datetime
import os
import sys
import time
from dear_astrid.constants import *
from dear_astrid.constants import __all__ as _constants_all
from dear_astrid.tzinfo import *
from dear_astrid.tzinfo import __all__ as _tzinfo_all
__all__ = [
'dtu',
'u',
'timezone',
] + _constants_all + _tzinfo_... | import datetime
import os
import sys
import time
from dear_astrid.constants import *
from dear_astrid.constants import __all__ as _constants_all
from dear_astrid.tzinfo import *
from dear_astrid.tzinfo import __all__ as _tzinfo_all
__all__ = [
'dtu',
'u',
'timezone',
] + _constants_all + _tzinfo_all
def dtu(*... | import datetime
import os
import sys
import time
from dear_astrid.constants import *
from dear_astrid.constants import __all__ as _constants_all
from dear_astrid.tzinfo import *
from dear_astrid.tzinfo import __all__ as _tzinfo_all
__all__ = [
'dtu',
'u',
'timezone',
] + _constants_all + _tzinfo_all
def dtu(*... | <commit_before>import datetime
import os
import sys
import time
from dear_astrid.constants import *
from dear_astrid.constants import __all__ as _constants_all
from dear_astrid.tzinfo import *
from dear_astrid.tzinfo import __all__ as _tzinfo_all
__all__ = [
'dtu',
'u',
'timezone',
] + _constants_all + _tzinfo_... |
9c0f06228254a41bd68062feafaf8c8dbaddd06b | marshmallow/base.py | marshmallow/base.py | # -*- coding: utf-8 -*-
'''Abstract base classes.
These are necessary to avoid circular imports between core.py and fields.py.
'''
class FieldABC(object):
'''Abstract base class from which all Field classes inherit.
'''
parent = None
name = None
def format(self, value):
raise NotImplemen... | # -*- coding: utf-8 -*-
'''Abstract base classes.
These are necessary to avoid circular imports between core.py and fields.py.
'''
import copy
class FieldABC(object):
'''Abstract base class from which all Field classes inherit.
'''
parent = None
name = None
def format(self, value):
raise... | Speed up deep copy of fields | Speed up deep copy of fields
| Python | mit | dwieeb/marshmallow,VladimirPal/marshmallow,bartaelterman/marshmallow,mwstobo/marshmallow,maximkulkin/marshmallow,Tim-Erwin/marshmallow,jmcarp/marshmallow,0xDCA/marshmallow,daniloakamine/marshmallow,marshmallow-code/marshmallow,xLegoz/marshmallow,Bachmann1234/marshmallow,jmcarp/marshmallow,0xDCA/marshmallow,etataurov/ma... | # -*- coding: utf-8 -*-
'''Abstract base classes.
These are necessary to avoid circular imports between core.py and fields.py.
'''
class FieldABC(object):
'''Abstract base class from which all Field classes inherit.
'''
parent = None
name = None
def format(self, value):
raise NotImplemen... | # -*- coding: utf-8 -*-
'''Abstract base classes.
These are necessary to avoid circular imports between core.py and fields.py.
'''
import copy
class FieldABC(object):
'''Abstract base class from which all Field classes inherit.
'''
parent = None
name = None
def format(self, value):
raise... | <commit_before># -*- coding: utf-8 -*-
'''Abstract base classes.
These are necessary to avoid circular imports between core.py and fields.py.
'''
class FieldABC(object):
'''Abstract base class from which all Field classes inherit.
'''
parent = None
name = None
def format(self, value):
ra... | # -*- coding: utf-8 -*-
'''Abstract base classes.
These are necessary to avoid circular imports between core.py and fields.py.
'''
import copy
class FieldABC(object):
'''Abstract base class from which all Field classes inherit.
'''
parent = None
name = None
def format(self, value):
raise... | # -*- coding: utf-8 -*-
'''Abstract base classes.
These are necessary to avoid circular imports between core.py and fields.py.
'''
class FieldABC(object):
'''Abstract base class from which all Field classes inherit.
'''
parent = None
name = None
def format(self, value):
raise NotImplemen... | <commit_before># -*- coding: utf-8 -*-
'''Abstract base classes.
These are necessary to avoid circular imports between core.py and fields.py.
'''
class FieldABC(object):
'''Abstract base class from which all Field classes inherit.
'''
parent = None
name = None
def format(self, value):
ra... |
50c734268a1380379d8d326a0860b2a9f2fade23 | restpose/__init__.py | restpose/__init__.py | # -*- coding: utf-8 -
#
# This file is part of the restpose python module, released under the MIT
# license. See the COPYING file for more information.
"""Python client for the RestPose search server.
"""
from .client import Server
from .version import dev_release, version_info, __version__
from restkit import Reso... | # -*- coding: utf-8 -
#
# This file is part of the restpose python module, released under the MIT
# license. See the COPYING file for more information.
"""Python client for the RestPose search server.
"""
from .client import Server
from .errors import RestPoseError, CheckPointExpiredError
from .version import dev_re... | Add RestPoseError and CheckPointExpiredError to top-level module symbols | Add RestPoseError and CheckPointExpiredError to top-level module symbols
| Python | mit | restpose/restpose-py,restpose/restpose-py | # -*- coding: utf-8 -
#
# This file is part of the restpose python module, released under the MIT
# license. See the COPYING file for more information.
"""Python client for the RestPose search server.
"""
from .client import Server
from .version import dev_release, version_info, __version__
from restkit import Reso... | # -*- coding: utf-8 -
#
# This file is part of the restpose python module, released under the MIT
# license. See the COPYING file for more information.
"""Python client for the RestPose search server.
"""
from .client import Server
from .errors import RestPoseError, CheckPointExpiredError
from .version import dev_re... | <commit_before># -*- coding: utf-8 -
#
# This file is part of the restpose python module, released under the MIT
# license. See the COPYING file for more information.
"""Python client for the RestPose search server.
"""
from .client import Server
from .version import dev_release, version_info, __version__
from rest... | # -*- coding: utf-8 -
#
# This file is part of the restpose python module, released under the MIT
# license. See the COPYING file for more information.
"""Python client for the RestPose search server.
"""
from .client import Server
from .errors import RestPoseError, CheckPointExpiredError
from .version import dev_re... | # -*- coding: utf-8 -
#
# This file is part of the restpose python module, released under the MIT
# license. See the COPYING file for more information.
"""Python client for the RestPose search server.
"""
from .client import Server
from .version import dev_release, version_info, __version__
from restkit import Reso... | <commit_before># -*- coding: utf-8 -
#
# This file is part of the restpose python module, released under the MIT
# license. See the COPYING file for more information.
"""Python client for the RestPose search server.
"""
from .client import Server
from .version import dev_release, version_info, __version__
from rest... |
f41ff2e0a2eee56dd090e729b4470923958444b9 | conditional/util/flask.py | conditional/util/flask.py | from flask import render_template as flask_render_template
from db.models import EvalSettings
from util.ldap import ldap_is_active
from util.ldap import ldap_is_alumni
from util.ldap import ldap_is_eboard
from util.ldap import ldap_is_financial_director
from util.ldap import ldap_is_eval_director
from util.ldap import... | from flask import render_template as flask_render_template
from db.models import EvalSettings
from util.ldap import ldap_is_active
from util.ldap import ldap_is_alumni
from util.ldap import ldap_is_eboard
from util.ldap import ldap_is_financial_director
from util.ldap import ldap_is_eval_director
from util.ldap import... | Fix template var exports for directors | Fix template var exports for directors
| Python | mit | ComputerScienceHouse/conditional,RamZallan/conditional,ComputerScienceHouse/conditional,RamZallan/conditional,RamZallan/conditional,ComputerScienceHouse/conditional | from flask import render_template as flask_render_template
from db.models import EvalSettings
from util.ldap import ldap_is_active
from util.ldap import ldap_is_alumni
from util.ldap import ldap_is_eboard
from util.ldap import ldap_is_financial_director
from util.ldap import ldap_is_eval_director
from util.ldap import... | from flask import render_template as flask_render_template
from db.models import EvalSettings
from util.ldap import ldap_is_active
from util.ldap import ldap_is_alumni
from util.ldap import ldap_is_eboard
from util.ldap import ldap_is_financial_director
from util.ldap import ldap_is_eval_director
from util.ldap import... | <commit_before>from flask import render_template as flask_render_template
from db.models import EvalSettings
from util.ldap import ldap_is_active
from util.ldap import ldap_is_alumni
from util.ldap import ldap_is_eboard
from util.ldap import ldap_is_financial_director
from util.ldap import ldap_is_eval_director
from u... | from flask import render_template as flask_render_template
from db.models import EvalSettings
from util.ldap import ldap_is_active
from util.ldap import ldap_is_alumni
from util.ldap import ldap_is_eboard
from util.ldap import ldap_is_financial_director
from util.ldap import ldap_is_eval_director
from util.ldap import... | from flask import render_template as flask_render_template
from db.models import EvalSettings
from util.ldap import ldap_is_active
from util.ldap import ldap_is_alumni
from util.ldap import ldap_is_eboard
from util.ldap import ldap_is_financial_director
from util.ldap import ldap_is_eval_director
from util.ldap import... | <commit_before>from flask import render_template as flask_render_template
from db.models import EvalSettings
from util.ldap import ldap_is_active
from util.ldap import ldap_is_alumni
from util.ldap import ldap_is_eboard
from util.ldap import ldap_is_financial_director
from util.ldap import ldap_is_eval_director
from u... |
746be2e5557f6626e984a679f1699c6a76fa932e | miner/block_test.py | miner/block_test.py | import unittest
from block import Block
class TestBlock(unittest.TestCase):
class MerkleTreeMock:
pass
def test_init(self):
prev = 0x123123
tree = TestBlock.MerkleTreeMock()
time = 0x432432
bits = 0x1a44b9f2
b = Block(prev, tree, time, bits)
self.ass... | import unittest
from block import Block
class TestBlock(unittest.TestCase):
class MerkleTreeMock:
pass
def test_init(self):
prev = bytes([123] * 32)
tree = TestBlock.MerkleTreeMock()
time = 432432
bits = 0x1a44b9f2
b = Block(prev, tree, time, bits)
s... | Change block init test to pass bytes for hash | Change block init test to pass bytes for hash
| Python | mit | DrPandemic/pickaxe,DrPandemic/pickaxe,DrPandemic/pickaxe,DrPandemic/pickaxe | import unittest
from block import Block
class TestBlock(unittest.TestCase):
class MerkleTreeMock:
pass
def test_init(self):
prev = 0x123123
tree = TestBlock.MerkleTreeMock()
time = 0x432432
bits = 0x1a44b9f2
b = Block(prev, tree, time, bits)
self.ass... | import unittest
from block import Block
class TestBlock(unittest.TestCase):
class MerkleTreeMock:
pass
def test_init(self):
prev = bytes([123] * 32)
tree = TestBlock.MerkleTreeMock()
time = 432432
bits = 0x1a44b9f2
b = Block(prev, tree, time, bits)
s... | <commit_before>import unittest
from block import Block
class TestBlock(unittest.TestCase):
class MerkleTreeMock:
pass
def test_init(self):
prev = 0x123123
tree = TestBlock.MerkleTreeMock()
time = 0x432432
bits = 0x1a44b9f2
b = Block(prev, tree, time, bits)
... | import unittest
from block import Block
class TestBlock(unittest.TestCase):
class MerkleTreeMock:
pass
def test_init(self):
prev = bytes([123] * 32)
tree = TestBlock.MerkleTreeMock()
time = 432432
bits = 0x1a44b9f2
b = Block(prev, tree, time, bits)
s... | import unittest
from block import Block
class TestBlock(unittest.TestCase):
class MerkleTreeMock:
pass
def test_init(self):
prev = 0x123123
tree = TestBlock.MerkleTreeMock()
time = 0x432432
bits = 0x1a44b9f2
b = Block(prev, tree, time, bits)
self.ass... | <commit_before>import unittest
from block import Block
class TestBlock(unittest.TestCase):
class MerkleTreeMock:
pass
def test_init(self):
prev = 0x123123
tree = TestBlock.MerkleTreeMock()
time = 0x432432
bits = 0x1a44b9f2
b = Block(prev, tree, time, bits)
... |
65695bd7c4c7fcf3449358c0946e4584bb30a8ec | climate_data/migrations/0024_auto_20170623_0308.py | climate_data/migrations/0024_auto_20170623_0308.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-23 03:08
from __future__ import unicode_literals
from django.db import migrations
# noinspection PyUnusedLocal
def add_station_sensor_link_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_model('climate_data', 'Rea... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-23 03:08
from __future__ import unicode_literals
from django.db import migrations
import sys
# noinspection PyUnusedLocal
def add_station_sensor_link_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_model('climate... | Increase page size again in station-sensor link / reading migration, and add a percent indicator. Exclude any readings that have previously been fixed up by the migration. | Increase page size again in station-sensor link / reading migration, and add a percent indicator. Exclude any readings that have previously been fixed up by the migration.
| Python | apache-2.0 | qubs/data-centre,qubs/climate-data-api,qubs/data-centre,qubs/climate-data-api | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-23 03:08
from __future__ import unicode_literals
from django.db import migrations
# noinspection PyUnusedLocal
def add_station_sensor_link_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_model('climate_data', 'Rea... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-23 03:08
from __future__ import unicode_literals
from django.db import migrations
import sys
# noinspection PyUnusedLocal
def add_station_sensor_link_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_model('climate... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-23 03:08
from __future__ import unicode_literals
from django.db import migrations
# noinspection PyUnusedLocal
def add_station_sensor_link_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_model('clim... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-23 03:08
from __future__ import unicode_literals
from django.db import migrations
import sys
# noinspection PyUnusedLocal
def add_station_sensor_link_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_model('climate... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-23 03:08
from __future__ import unicode_literals
from django.db import migrations
# noinspection PyUnusedLocal
def add_station_sensor_link_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_model('climate_data', 'Rea... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-23 03:08
from __future__ import unicode_literals
from django.db import migrations
# noinspection PyUnusedLocal
def add_station_sensor_link_to_reading(apps, schema_editor):
# noinspection PyPep8Naming
Reading = apps.get_model('clim... |
5c353a23dfc2378c97fb4888db09e4a505bf8f8f | editorconfig/__init__.py | editorconfig/__init__.py | """EditorConfig Python Core"""
from versiontools import join_version
VERSION = (0, 11, 0, "final")
__all__ = ['get_properties', 'EditorConfigError', 'exceptions']
__version__ = join_version(VERSION)
def get_properties(filename):
"""Locate and parse EditorConfig files for the given filename"""
handler = Ed... | """EditorConfig Python Core"""
from editorconfig.versiontools import join_version
VERSION = (0, 11, 0, "final")
__all__ = ['get_properties', 'EditorConfigError', 'exceptions']
__version__ = join_version(VERSION)
def get_properties(filename):
"""Locate and parse EditorConfig files for the given filename"""
... | Fix import style for Python3 | Fix import style for Python3
| Python | bsd-2-clause | johnfraney/editorconfig-vim,johnfraney/editorconfig-vim,johnfraney/editorconfig-vim,benjifisher/editorconfig-vim,VictorBjelkholm/editorconfig-vim,benjifisher/editorconfig-vim,benjifisher/editorconfig-vim,pocke/editorconfig-vim,VictorBjelkholm/editorconfig-vim,pocke/editorconfig-vim,VictorBjelkholm/editorconfig-vim,pock... | """EditorConfig Python Core"""
from versiontools import join_version
VERSION = (0, 11, 0, "final")
__all__ = ['get_properties', 'EditorConfigError', 'exceptions']
__version__ = join_version(VERSION)
def get_properties(filename):
"""Locate and parse EditorConfig files for the given filename"""
handler = Ed... | """EditorConfig Python Core"""
from editorconfig.versiontools import join_version
VERSION = (0, 11, 0, "final")
__all__ = ['get_properties', 'EditorConfigError', 'exceptions']
__version__ = join_version(VERSION)
def get_properties(filename):
"""Locate and parse EditorConfig files for the given filename"""
... | <commit_before>"""EditorConfig Python Core"""
from versiontools import join_version
VERSION = (0, 11, 0, "final")
__all__ = ['get_properties', 'EditorConfigError', 'exceptions']
__version__ = join_version(VERSION)
def get_properties(filename):
"""Locate and parse EditorConfig files for the given filename"""
... | """EditorConfig Python Core"""
from editorconfig.versiontools import join_version
VERSION = (0, 11, 0, "final")
__all__ = ['get_properties', 'EditorConfigError', 'exceptions']
__version__ = join_version(VERSION)
def get_properties(filename):
"""Locate and parse EditorConfig files for the given filename"""
... | """EditorConfig Python Core"""
from versiontools import join_version
VERSION = (0, 11, 0, "final")
__all__ = ['get_properties', 'EditorConfigError', 'exceptions']
__version__ = join_version(VERSION)
def get_properties(filename):
"""Locate and parse EditorConfig files for the given filename"""
handler = Ed... | <commit_before>"""EditorConfig Python Core"""
from versiontools import join_version
VERSION = (0, 11, 0, "final")
__all__ = ['get_properties', 'EditorConfigError', 'exceptions']
__version__ = join_version(VERSION)
def get_properties(filename):
"""Locate and parse EditorConfig files for the given filename"""
... |
afd67433190427f0234bc27ef67cde8b2f6ae746 | gravatar/gravatar.py | gravatar/gravatar.py | """
Gravatar plugin for Pelican
===========================
This plugin assigns the ``author_gravatar`` variable to the Gravatar URL and
makes the variable available within the article's context.
"""
import hashlib
import six
from pelican import signals
def add_gravatar(generator, metadata):
#first check emai... | """
Gravatar plugin for Pelican
===========================
This plugin assigns the ``author_gravatar`` variable to the Gravatar URL and
makes the variable available within the article's context.
"""
import hashlib
import six
from pelican import signals
def add_gravatar(generator, metadata):
#first check emai... | Use https instead http to get secure resources content in blog over https | Use https instead http to get secure resources content in blog over https | Python | agpl-3.0 | farseerfc/pelican-plugins,MarkusH/pelican-plugins,farseerfc/pelican-plugins,danmackinlay/pelican-plugins,florianjacob/pelican-plugins,cctags/pelican-plugins,farseerfc/pelican-plugins,rlaboiss/pelican-plugins,jakevdp/pelican-plugins,rlaboiss/pelican-plugins,if1live/pelican-plugins,kdheepak89/pelican-plugins,florianjacob... | """
Gravatar plugin for Pelican
===========================
This plugin assigns the ``author_gravatar`` variable to the Gravatar URL and
makes the variable available within the article's context.
"""
import hashlib
import six
from pelican import signals
def add_gravatar(generator, metadata):
#first check emai... | """
Gravatar plugin for Pelican
===========================
This plugin assigns the ``author_gravatar`` variable to the Gravatar URL and
makes the variable available within the article's context.
"""
import hashlib
import six
from pelican import signals
def add_gravatar(generator, metadata):
#first check emai... | <commit_before>"""
Gravatar plugin for Pelican
===========================
This plugin assigns the ``author_gravatar`` variable to the Gravatar URL and
makes the variable available within the article's context.
"""
import hashlib
import six
from pelican import signals
def add_gravatar(generator, metadata):
#f... | """
Gravatar plugin for Pelican
===========================
This plugin assigns the ``author_gravatar`` variable to the Gravatar URL and
makes the variable available within the article's context.
"""
import hashlib
import six
from pelican import signals
def add_gravatar(generator, metadata):
#first check emai... | """
Gravatar plugin for Pelican
===========================
This plugin assigns the ``author_gravatar`` variable to the Gravatar URL and
makes the variable available within the article's context.
"""
import hashlib
import six
from pelican import signals
def add_gravatar(generator, metadata):
#first check emai... | <commit_before>"""
Gravatar plugin for Pelican
===========================
This plugin assigns the ``author_gravatar`` variable to the Gravatar URL and
makes the variable available within the article's context.
"""
import hashlib
import six
from pelican import signals
def add_gravatar(generator, metadata):
#f... |
a89983d2e218c6438587be9e6ea89e76f4c5a8c6 | 14B-088/Combined_HI/HI_single_channel_clean.py | 14B-088/Combined_HI/HI_single_channel_clean.py |
import sys
from casa_tools import myclean
'''
Cleans an MS with a single channel given a mask and a model
'''
vis_1 = sys.argv[-5]
vis_2 = sys.argv[-4]
model = sys.argv[-3]
mask = sys.argv[-2]
out_root = sys.argv[-1]
if model == "None":
model = None
else:
model = [model] * 2
if mask == "None":
mask = ... |
import sys
from casa_tools import myclean
'''
Cleans an MS with a single channel given a mask and a model
'''
vis_1 = sys.argv[-5]
vis_2 = sys.argv[-4]
model = sys.argv[-3]
mask = sys.argv[-2]
out_root = sys.argv[-1]
if model == "None":
model = None
else:
model = [model] * 2
if mask == "None":
mask = ... | Add larger scale to match C config only map | Add larger scale to match C config only map
| Python | mit | e-koch/VLA_Lband,e-koch/VLA_Lband |
import sys
from casa_tools import myclean
'''
Cleans an MS with a single channel given a mask and a model
'''
vis_1 = sys.argv[-5]
vis_2 = sys.argv[-4]
model = sys.argv[-3]
mask = sys.argv[-2]
out_root = sys.argv[-1]
if model == "None":
model = None
else:
model = [model] * 2
if mask == "None":
mask = ... |
import sys
from casa_tools import myclean
'''
Cleans an MS with a single channel given a mask and a model
'''
vis_1 = sys.argv[-5]
vis_2 = sys.argv[-4]
model = sys.argv[-3]
mask = sys.argv[-2]
out_root = sys.argv[-1]
if model == "None":
model = None
else:
model = [model] * 2
if mask == "None":
mask = ... | <commit_before>
import sys
from casa_tools import myclean
'''
Cleans an MS with a single channel given a mask and a model
'''
vis_1 = sys.argv[-5]
vis_2 = sys.argv[-4]
model = sys.argv[-3]
mask = sys.argv[-2]
out_root = sys.argv[-1]
if model == "None":
model = None
else:
model = [model] * 2
if mask == "Non... |
import sys
from casa_tools import myclean
'''
Cleans an MS with a single channel given a mask and a model
'''
vis_1 = sys.argv[-5]
vis_2 = sys.argv[-4]
model = sys.argv[-3]
mask = sys.argv[-2]
out_root = sys.argv[-1]
if model == "None":
model = None
else:
model = [model] * 2
if mask == "None":
mask = ... |
import sys
from casa_tools import myclean
'''
Cleans an MS with a single channel given a mask and a model
'''
vis_1 = sys.argv[-5]
vis_2 = sys.argv[-4]
model = sys.argv[-3]
mask = sys.argv[-2]
out_root = sys.argv[-1]
if model == "None":
model = None
else:
model = [model] * 2
if mask == "None":
mask = ... | <commit_before>
import sys
from casa_tools import myclean
'''
Cleans an MS with a single channel given a mask and a model
'''
vis_1 = sys.argv[-5]
vis_2 = sys.argv[-4]
model = sys.argv[-3]
mask = sys.argv[-2]
out_root = sys.argv[-1]
if model == "None":
model = None
else:
model = [model] * 2
if mask == "Non... |
f6b7a4ec8aa72acfd93e7f85199b251e91ca4465 | cherrypy/test/test_refleaks.py | cherrypy/test/test_refleaks.py | """Tests for refleaks."""
from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, ntob
import threading
import cherrypy
data = object()
from cherrypy.test import helper
class ReferenceTests(helper.CPWebCase):
@staticmethod
def setup_server():
class Root:
@cherrypy.expose
... | """Tests for refleaks."""
import itertools
from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, ntob
import threading
import cherrypy
data = object()
from cherrypy.test import helper
class ReferenceTests(helper.CPWebCase):
@staticmethod
def setup_server():
class Root:
... | Use a simple counter rather than appending booleans to a list and counting them. | Use a simple counter rather than appending booleans to a list and counting them.
| Python | bsd-3-clause | cherrypy/cheroot,Safihre/cherrypy,cherrypy/cherrypy,cherrypy/cherrypy,Safihre/cherrypy | """Tests for refleaks."""
from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, ntob
import threading
import cherrypy
data = object()
from cherrypy.test import helper
class ReferenceTests(helper.CPWebCase):
@staticmethod
def setup_server():
class Root:
@cherrypy.expose
... | """Tests for refleaks."""
import itertools
from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, ntob
import threading
import cherrypy
data = object()
from cherrypy.test import helper
class ReferenceTests(helper.CPWebCase):
@staticmethod
def setup_server():
class Root:
... | <commit_before>"""Tests for refleaks."""
from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, ntob
import threading
import cherrypy
data = object()
from cherrypy.test import helper
class ReferenceTests(helper.CPWebCase):
@staticmethod
def setup_server():
class Root:
@ch... | """Tests for refleaks."""
import itertools
from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, ntob
import threading
import cherrypy
data = object()
from cherrypy.test import helper
class ReferenceTests(helper.CPWebCase):
@staticmethod
def setup_server():
class Root:
... | """Tests for refleaks."""
from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, ntob
import threading
import cherrypy
data = object()
from cherrypy.test import helper
class ReferenceTests(helper.CPWebCase):
@staticmethod
def setup_server():
class Root:
@cherrypy.expose
... | <commit_before>"""Tests for refleaks."""
from cherrypy._cpcompat import HTTPConnection, HTTPSConnection, ntob
import threading
import cherrypy
data = object()
from cherrypy.test import helper
class ReferenceTests(helper.CPWebCase):
@staticmethod
def setup_server():
class Root:
@ch... |
0141527409771ff9396252eedd02c6729aa3f3d9 | eegtools/data/schalk_physiobank_test.py | eegtools/data/schalk_physiobank_test.py | import schalk_physiobank
def test_s1():
r = schalk_physiobank.load(1)
assert str(r) == 'Recording "schalk-physiobank-s1" (64 channels x 259520 '\
'samples) at 160.00 Hz in 14 continuous blocks, with 362 events in 11 '\
'classes.'
def test_s14():
'''Test subject 14 which contains runs *without* any event... | import schalk_physiobank
def test_s1():
r = schalk_physiobank.load(1)
assert str(r) == 'Recording "schalk-physiobank-s1" (64 channels x 259520 '\
'samples) at 160.00 Hz in 14 continuous blocks, with 362 events in 11 '\
'classes.'
def test_s14():
'''Test subject 14 which contains runs *without* any event... | Fix regression test after EDF+ annotation fix in 60753f. | Fix regression test after EDF+ annotation fix in 60753f.
| Python | bsd-3-clause | breuderink/eegtools | import schalk_physiobank
def test_s1():
r = schalk_physiobank.load(1)
assert str(r) == 'Recording "schalk-physiobank-s1" (64 channels x 259520 '\
'samples) at 160.00 Hz in 14 continuous blocks, with 362 events in 11 '\
'classes.'
def test_s14():
'''Test subject 14 which contains runs *without* any event... | import schalk_physiobank
def test_s1():
r = schalk_physiobank.load(1)
assert str(r) == 'Recording "schalk-physiobank-s1" (64 channels x 259520 '\
'samples) at 160.00 Hz in 14 continuous blocks, with 362 events in 11 '\
'classes.'
def test_s14():
'''Test subject 14 which contains runs *without* any event... | <commit_before>import schalk_physiobank
def test_s1():
r = schalk_physiobank.load(1)
assert str(r) == 'Recording "schalk-physiobank-s1" (64 channels x 259520 '\
'samples) at 160.00 Hz in 14 continuous blocks, with 362 events in 11 '\
'classes.'
def test_s14():
'''Test subject 14 which contains runs *wit... | import schalk_physiobank
def test_s1():
r = schalk_physiobank.load(1)
assert str(r) == 'Recording "schalk-physiobank-s1" (64 channels x 259520 '\
'samples) at 160.00 Hz in 14 continuous blocks, with 362 events in 11 '\
'classes.'
def test_s14():
'''Test subject 14 which contains runs *without* any event... | import schalk_physiobank
def test_s1():
r = schalk_physiobank.load(1)
assert str(r) == 'Recording "schalk-physiobank-s1" (64 channels x 259520 '\
'samples) at 160.00 Hz in 14 continuous blocks, with 362 events in 11 '\
'classes.'
def test_s14():
'''Test subject 14 which contains runs *without* any event... | <commit_before>import schalk_physiobank
def test_s1():
r = schalk_physiobank.load(1)
assert str(r) == 'Recording "schalk-physiobank-s1" (64 channels x 259520 '\
'samples) at 160.00 Hz in 14 continuous blocks, with 362 events in 11 '\
'classes.'
def test_s14():
'''Test subject 14 which contains runs *wit... |
0c8e3f6d962a573618d5224b20b68e57790f4beb | feder/institutions/forms.py | feder/institutions/forms.py | # -*- coding: utf-8 -*-
from atom.forms import SingleButtonMixin
from braces.forms import UserKwargModelFormMixin
from django import forms
from .models import Institution
class InstitutionForm(SingleButtonMixin, UserKwargModelFormMixin, forms.ModelForm):
def __init__(self, *args, **kwargs):
super(Instit... | # -*- coding: utf-8 -*-
from atom.forms import SingleButtonMixin
from braces.forms import UserKwargModelFormMixin
from django import forms
from .models import Institution
class InstitutionForm(SingleButtonMixin, UserKwargModelFormMixin, forms.ModelForm):
def __init__(self, *args, **kwargs):
super(Instit... | Fix InstitutionForm to include jst field | Fix InstitutionForm to include jst field
| Python | mit | watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder | # -*- coding: utf-8 -*-
from atom.forms import SingleButtonMixin
from braces.forms import UserKwargModelFormMixin
from django import forms
from .models import Institution
class InstitutionForm(SingleButtonMixin, UserKwargModelFormMixin, forms.ModelForm):
def __init__(self, *args, **kwargs):
super(Instit... | # -*- coding: utf-8 -*-
from atom.forms import SingleButtonMixin
from braces.forms import UserKwargModelFormMixin
from django import forms
from .models import Institution
class InstitutionForm(SingleButtonMixin, UserKwargModelFormMixin, forms.ModelForm):
def __init__(self, *args, **kwargs):
super(Instit... | <commit_before># -*- coding: utf-8 -*-
from atom.forms import SingleButtonMixin
from braces.forms import UserKwargModelFormMixin
from django import forms
from .models import Institution
class InstitutionForm(SingleButtonMixin, UserKwargModelFormMixin, forms.ModelForm):
def __init__(self, *args, **kwargs):
... | # -*- coding: utf-8 -*-
from atom.forms import SingleButtonMixin
from braces.forms import UserKwargModelFormMixin
from django import forms
from .models import Institution
class InstitutionForm(SingleButtonMixin, UserKwargModelFormMixin, forms.ModelForm):
def __init__(self, *args, **kwargs):
super(Instit... | # -*- coding: utf-8 -*-
from atom.forms import SingleButtonMixin
from braces.forms import UserKwargModelFormMixin
from django import forms
from .models import Institution
class InstitutionForm(SingleButtonMixin, UserKwargModelFormMixin, forms.ModelForm):
def __init__(self, *args, **kwargs):
super(Instit... | <commit_before># -*- coding: utf-8 -*-
from atom.forms import SingleButtonMixin
from braces.forms import UserKwargModelFormMixin
from django import forms
from .models import Institution
class InstitutionForm(SingleButtonMixin, UserKwargModelFormMixin, forms.ModelForm):
def __init__(self, *args, **kwargs):
... |
4ea698622a7a581b84ce61de8f5f65ce12f0c129 | morenines/output.py | morenines/output.py | import click
def print_message(message):
print message
def print_filelist(header, filelist, colour=None):
click.echo(header)
for line in filelist:
if colour:
line = click.style(line, fg=colour)
click.echo(" {}".format(line))
def print_filelists(new_files, changed_files, m... | import click
def print_message(message):
print message
def print_filelist(header, filelist, colour=None):
click.echo(header)
for line in sorted(filelist):
if colour:
line = click.style(line, fg=colour)
click.echo(" {}".format(line))
def print_filelists(new_files, changed_... | Make print_filelist sort the list before printing | Make print_filelist sort the list before printing
| Python | mit | mcgid/morenines,mcgid/morenines | import click
def print_message(message):
print message
def print_filelist(header, filelist, colour=None):
click.echo(header)
for line in filelist:
if colour:
line = click.style(line, fg=colour)
click.echo(" {}".format(line))
def print_filelists(new_files, changed_files, m... | import click
def print_message(message):
print message
def print_filelist(header, filelist, colour=None):
click.echo(header)
for line in sorted(filelist):
if colour:
line = click.style(line, fg=colour)
click.echo(" {}".format(line))
def print_filelists(new_files, changed_... | <commit_before>import click
def print_message(message):
print message
def print_filelist(header, filelist, colour=None):
click.echo(header)
for line in filelist:
if colour:
line = click.style(line, fg=colour)
click.echo(" {}".format(line))
def print_filelists(new_files, c... | import click
def print_message(message):
print message
def print_filelist(header, filelist, colour=None):
click.echo(header)
for line in sorted(filelist):
if colour:
line = click.style(line, fg=colour)
click.echo(" {}".format(line))
def print_filelists(new_files, changed_... | import click
def print_message(message):
print message
def print_filelist(header, filelist, colour=None):
click.echo(header)
for line in filelist:
if colour:
line = click.style(line, fg=colour)
click.echo(" {}".format(line))
def print_filelists(new_files, changed_files, m... | <commit_before>import click
def print_message(message):
print message
def print_filelist(header, filelist, colour=None):
click.echo(header)
for line in filelist:
if colour:
line = click.style(line, fg=colour)
click.echo(" {}".format(line))
def print_filelists(new_files, c... |
a5b3dd62e58dc23c03b7876ee99b757022413e94 | billjobs/urls.py | billjobs/urls.py | from django.conf.urls import url, include
from rest_framework.authtoken.views import obtain_auth_token
from . import views
urlpatterns = [
url(r'^generate_pdf/(?P<bill_id>\d+)$', views.generate_pdf,
name='generate-pdf'),
url(r'^user/$', views.UserAdmin.as_view(), name='user'),
url(r'^user/(?P<pk>[0... | from django.conf.urls import url, include
from rest_framework.authtoken.views import obtain_auth_token
from . import views
api_patterns = [
url(r'^auth/',
include('rest_framework.urls', namespace='rest_framework')),
url(r'^token-auth/', obtain_auth_token, name='api-token-auth'),
url... | Move api auth url to api_patterns | Move api auth url to api_patterns
| Python | mit | ioO/billjobs | from django.conf.urls import url, include
from rest_framework.authtoken.views import obtain_auth_token
from . import views
urlpatterns = [
url(r'^generate_pdf/(?P<bill_id>\d+)$', views.generate_pdf,
name='generate-pdf'),
url(r'^user/$', views.UserAdmin.as_view(), name='user'),
url(r'^user/(?P<pk>[0... | from django.conf.urls import url, include
from rest_framework.authtoken.views import obtain_auth_token
from . import views
api_patterns = [
url(r'^auth/',
include('rest_framework.urls', namespace='rest_framework')),
url(r'^token-auth/', obtain_auth_token, name='api-token-auth'),
url... | <commit_before>from django.conf.urls import url, include
from rest_framework.authtoken.views import obtain_auth_token
from . import views
urlpatterns = [
url(r'^generate_pdf/(?P<bill_id>\d+)$', views.generate_pdf,
name='generate-pdf'),
url(r'^user/$', views.UserAdmin.as_view(), name='user'),
url(r'... | from django.conf.urls import url, include
from rest_framework.authtoken.views import obtain_auth_token
from . import views
api_patterns = [
url(r'^auth/',
include('rest_framework.urls', namespace='rest_framework')),
url(r'^token-auth/', obtain_auth_token, name='api-token-auth'),
url... | from django.conf.urls import url, include
from rest_framework.authtoken.views import obtain_auth_token
from . import views
urlpatterns = [
url(r'^generate_pdf/(?P<bill_id>\d+)$', views.generate_pdf,
name='generate-pdf'),
url(r'^user/$', views.UserAdmin.as_view(), name='user'),
url(r'^user/(?P<pk>[0... | <commit_before>from django.conf.urls import url, include
from rest_framework.authtoken.views import obtain_auth_token
from . import views
urlpatterns = [
url(r'^generate_pdf/(?P<bill_id>\d+)$', views.generate_pdf,
name='generate-pdf'),
url(r'^user/$', views.UserAdmin.as_view(), name='user'),
url(r'... |
71798ca99fe7245a578ea1d6ba367e485d9ad5f8 | mvp/renderlayers.py | mvp/renderlayers.py | # -*- coding: utf-8 -*-
from contextlib import contextmanager
import maya.app.renderSetup.model.renderSetup as renderSetup
from maya import cmds
@contextmanager
def enabled_render_layers():
old_layer = cmds.editRenderLayerGlobals(query=True, currentRenderLayer=True)
try:
rs = renderSetup.instance()
... | # -*- coding: utf-8 -*-
from contextlib import contextmanager
import maya.app.renderSetup.model.renderSetup as renderSetup
from maya import cmds
@contextmanager
def enabled_render_layers():
old_layer = cmds.editRenderLayerGlobals(
query=True,
currentRenderLayer=True,
)
try:
rs = r... | Fix defaultRenderLayer was not included when blasting all layers. | Fix defaultRenderLayer was not included when blasting all layers.
| Python | mit | danbradham/mvp | # -*- coding: utf-8 -*-
from contextlib import contextmanager
import maya.app.renderSetup.model.renderSetup as renderSetup
from maya import cmds
@contextmanager
def enabled_render_layers():
old_layer = cmds.editRenderLayerGlobals(query=True, currentRenderLayer=True)
try:
rs = renderSetup.instance()
... | # -*- coding: utf-8 -*-
from contextlib import contextmanager
import maya.app.renderSetup.model.renderSetup as renderSetup
from maya import cmds
@contextmanager
def enabled_render_layers():
old_layer = cmds.editRenderLayerGlobals(
query=True,
currentRenderLayer=True,
)
try:
rs = r... | <commit_before># -*- coding: utf-8 -*-
from contextlib import contextmanager
import maya.app.renderSetup.model.renderSetup as renderSetup
from maya import cmds
@contextmanager
def enabled_render_layers():
old_layer = cmds.editRenderLayerGlobals(query=True, currentRenderLayer=True)
try:
rs = renderSet... | # -*- coding: utf-8 -*-
from contextlib import contextmanager
import maya.app.renderSetup.model.renderSetup as renderSetup
from maya import cmds
@contextmanager
def enabled_render_layers():
old_layer = cmds.editRenderLayerGlobals(
query=True,
currentRenderLayer=True,
)
try:
rs = r... | # -*- coding: utf-8 -*-
from contextlib import contextmanager
import maya.app.renderSetup.model.renderSetup as renderSetup
from maya import cmds
@contextmanager
def enabled_render_layers():
old_layer = cmds.editRenderLayerGlobals(query=True, currentRenderLayer=True)
try:
rs = renderSetup.instance()
... | <commit_before># -*- coding: utf-8 -*-
from contextlib import contextmanager
import maya.app.renderSetup.model.renderSetup as renderSetup
from maya import cmds
@contextmanager
def enabled_render_layers():
old_layer = cmds.editRenderLayerGlobals(query=True, currentRenderLayer=True)
try:
rs = renderSet... |
56528264cdc76dc1b00804b7f67908d3bb1b1b0e | flask_appconfig/docker.py | flask_appconfig/docker.py | #!/usr/bin/env python
import os
from six.moves.urllib_parse import urlparse
def from_docker_envvars(config):
# linked postgres database (link name 'pg' or 'postgres')
if 'PG_PORT' in os.environ:
pg_url = urlparse(os.environ['PG_PORT'])
if not pg_url.scheme == 'tcp':
raise ValueEr... | #!/usr/bin/env python
import os
from six.moves.urllib_parse import urlparse
def from_docker_envvars(config):
# linked postgres database (link name 'pg' or 'postgres')
if 'PG_PORT' in os.environ:
pg_url = urlparse(os.environ['PG_PORT'])
if not pg_url.scheme == 'tcp':
raise ValueEr... | Use correct database name instead of None when not supplied. | Use correct database name instead of None when not supplied.
| Python | mit | mbr/flask-appconfig | #!/usr/bin/env python
import os
from six.moves.urllib_parse import urlparse
def from_docker_envvars(config):
# linked postgres database (link name 'pg' or 'postgres')
if 'PG_PORT' in os.environ:
pg_url = urlparse(os.environ['PG_PORT'])
if not pg_url.scheme == 'tcp':
raise ValueEr... | #!/usr/bin/env python
import os
from six.moves.urllib_parse import urlparse
def from_docker_envvars(config):
# linked postgres database (link name 'pg' or 'postgres')
if 'PG_PORT' in os.environ:
pg_url = urlparse(os.environ['PG_PORT'])
if not pg_url.scheme == 'tcp':
raise ValueEr... | <commit_before>#!/usr/bin/env python
import os
from six.moves.urllib_parse import urlparse
def from_docker_envvars(config):
# linked postgres database (link name 'pg' or 'postgres')
if 'PG_PORT' in os.environ:
pg_url = urlparse(os.environ['PG_PORT'])
if not pg_url.scheme == 'tcp':
... | #!/usr/bin/env python
import os
from six.moves.urllib_parse import urlparse
def from_docker_envvars(config):
# linked postgres database (link name 'pg' or 'postgres')
if 'PG_PORT' in os.environ:
pg_url = urlparse(os.environ['PG_PORT'])
if not pg_url.scheme == 'tcp':
raise ValueEr... | #!/usr/bin/env python
import os
from six.moves.urllib_parse import urlparse
def from_docker_envvars(config):
# linked postgres database (link name 'pg' or 'postgres')
if 'PG_PORT' in os.environ:
pg_url = urlparse(os.environ['PG_PORT'])
if not pg_url.scheme == 'tcp':
raise ValueEr... | <commit_before>#!/usr/bin/env python
import os
from six.moves.urllib_parse import urlparse
def from_docker_envvars(config):
# linked postgres database (link name 'pg' or 'postgres')
if 'PG_PORT' in os.environ:
pg_url = urlparse(os.environ['PG_PORT'])
if not pg_url.scheme == 'tcp':
... |
809f2f781fb2186e3bad27cdd19115b6f425cd0b | tint/tests/test_grid_utils.py | tint/tests/test_grid_utils.py | """ Unit tests for grid_utils module. """
from datetime import datetime
import numpy as np
from tint import grid_utils
from tint.testing.sample_objects import grid, field
from tint.testing.sample_objects import params, grid_size
def test_parse_grid_datetime():
dt = grid_utils.parse_grid_datetime(grid)
asser... | """ Unit tests for grid_utils module. """
from datetime import datetime
import numpy as np
from tint import grid_utils
from tint.testing.sample_objects import grid, field
from tint.testing.sample_objects import params, grid_size
def test_parse_grid_datetime():
dt = grid_utils.parse_grid_datetime(grid)
asser... | Update for unit tests for PR 37 | TST: Update for unit tests for PR 37
| Python | bsd-2-clause | openradar/TINT,openradar/TINT | """ Unit tests for grid_utils module. """
from datetime import datetime
import numpy as np
from tint import grid_utils
from tint.testing.sample_objects import grid, field
from tint.testing.sample_objects import params, grid_size
def test_parse_grid_datetime():
dt = grid_utils.parse_grid_datetime(grid)
asser... | """ Unit tests for grid_utils module. """
from datetime import datetime
import numpy as np
from tint import grid_utils
from tint.testing.sample_objects import grid, field
from tint.testing.sample_objects import params, grid_size
def test_parse_grid_datetime():
dt = grid_utils.parse_grid_datetime(grid)
asser... | <commit_before>""" Unit tests for grid_utils module. """
from datetime import datetime
import numpy as np
from tint import grid_utils
from tint.testing.sample_objects import grid, field
from tint.testing.sample_objects import params, grid_size
def test_parse_grid_datetime():
dt = grid_utils.parse_grid_datetime(... | """ Unit tests for grid_utils module. """
from datetime import datetime
import numpy as np
from tint import grid_utils
from tint.testing.sample_objects import grid, field
from tint.testing.sample_objects import params, grid_size
def test_parse_grid_datetime():
dt = grid_utils.parse_grid_datetime(grid)
asser... | """ Unit tests for grid_utils module. """
from datetime import datetime
import numpy as np
from tint import grid_utils
from tint.testing.sample_objects import grid, field
from tint.testing.sample_objects import params, grid_size
def test_parse_grid_datetime():
dt = grid_utils.parse_grid_datetime(grid)
asser... | <commit_before>""" Unit tests for grid_utils module. """
from datetime import datetime
import numpy as np
from tint import grid_utils
from tint.testing.sample_objects import grid, field
from tint.testing.sample_objects import params, grid_size
def test_parse_grid_datetime():
dt = grid_utils.parse_grid_datetime(... |
c8a08042cc7eb0ddb0b617f1fb935691a5803a29 | gitcommitautosave.py | gitcommitautosave.py | """Git Commit Auto Save.
Sublime Text 3 package to auto save commit messages when the window is closed.
This allows the user to close the window without having to save before,
or having to deal with the "Save File" popup.
"""
import sublime_plugin
class GitCommitAutoSave(sublime_plugin.EventListener):
def on_load(s... | """Git Commit Auto Save.
Sublime Text 3 package to auto save commit messages when the window is closed.
This allows the user to close the window without having to save before,
or having to deal with the "Save File" popup.
"""
import sublime_plugin
class GitCommitAutoSave(sublime_plugin.EventListener):
def on_load(s... | Add PULLREQ_EDITMSG for hub pull requests | Add PULLREQ_EDITMSG for hub pull requests
| Python | mit | aristidesfl/sublime-git-commit-message-auto-save | """Git Commit Auto Save.
Sublime Text 3 package to auto save commit messages when the window is closed.
This allows the user to close the window without having to save before,
or having to deal with the "Save File" popup.
"""
import sublime_plugin
class GitCommitAutoSave(sublime_plugin.EventListener):
def on_load(s... | """Git Commit Auto Save.
Sublime Text 3 package to auto save commit messages when the window is closed.
This allows the user to close the window without having to save before,
or having to deal with the "Save File" popup.
"""
import sublime_plugin
class GitCommitAutoSave(sublime_plugin.EventListener):
def on_load(s... | <commit_before>"""Git Commit Auto Save.
Sublime Text 3 package to auto save commit messages when the window is closed.
This allows the user to close the window without having to save before,
or having to deal with the "Save File" popup.
"""
import sublime_plugin
class GitCommitAutoSave(sublime_plugin.EventListener):... | """Git Commit Auto Save.
Sublime Text 3 package to auto save commit messages when the window is closed.
This allows the user to close the window without having to save before,
or having to deal with the "Save File" popup.
"""
import sublime_plugin
class GitCommitAutoSave(sublime_plugin.EventListener):
def on_load(s... | """Git Commit Auto Save.
Sublime Text 3 package to auto save commit messages when the window is closed.
This allows the user to close the window without having to save before,
or having to deal with the "Save File" popup.
"""
import sublime_plugin
class GitCommitAutoSave(sublime_plugin.EventListener):
def on_load(s... | <commit_before>"""Git Commit Auto Save.
Sublime Text 3 package to auto save commit messages when the window is closed.
This allows the user to close the window without having to save before,
or having to deal with the "Save File" popup.
"""
import sublime_plugin
class GitCommitAutoSave(sublime_plugin.EventListener):... |
07e7f5023958538933802f78c7bdd5d61f04a825 | flocker/restapi/__init__.py | flocker/restapi/__init__.py | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Infrastructure for publishing a REST HTTP API.
"""
from ._infrastructure import structured
__all__ = ["structured"]
| # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Infrastructure for publishing a REST HTTP API.
"""
from ._infrastructure import (
structured, EndpointResponse, userDocumentation,
)
__all__ = ["structured", "EndpointResponse", "userDocumentation"]
| Address review comment: Make more APIs public. | Address review comment: Make more APIs public.
| Python | apache-2.0 | moypray/flocker,adamtheturtle/flocker,Azulinho/flocker,agonzalezro/flocker,1d4Nf6/flocker,1d4Nf6/flocker,runcom/flocker,1d4Nf6/flocker,moypray/flocker,lukemarsden/flocker,LaynePeng/flocker,jml/flocker,moypray/flocker,adamtheturtle/flocker,lukemarsden/flocker,wallnerryan/flocker-profiles,mbrukman/flocker,jml/flocker,And... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Infrastructure for publishing a REST HTTP API.
"""
from ._infrastructure import structured
__all__ = ["structured"]
Address review comment: Make more APIs public. | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Infrastructure for publishing a REST HTTP API.
"""
from ._infrastructure import (
structured, EndpointResponse, userDocumentation,
)
__all__ = ["structured", "EndpointResponse", "userDocumentation"]
| <commit_before># Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Infrastructure for publishing a REST HTTP API.
"""
from ._infrastructure import structured
__all__ = ["structured"]
<commit_msg>Address review comment: Make more APIs public.<commit_after> | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Infrastructure for publishing a REST HTTP API.
"""
from ._infrastructure import (
structured, EndpointResponse, userDocumentation,
)
__all__ = ["structured", "EndpointResponse", "userDocumentation"]
| # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Infrastructure for publishing a REST HTTP API.
"""
from ._infrastructure import structured
__all__ = ["structured"]
Address review comment: Make more APIs public.# Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Infrastructure for publ... | <commit_before># Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Infrastructure for publishing a REST HTTP API.
"""
from ._infrastructure import structured
__all__ = ["structured"]
<commit_msg>Address review comment: Make more APIs public.<commit_after># Copyright Hybrid Logic Ltd. See LICENSE file ... |
b016fad5d55993b064a1c4d15fd281f439045491 | gateway/camera/device.py | gateway/camera/device.py | from gateway import net
class CameraDevice(object):
def __init__(self, stream, address):
self.resolution = None
self.framerate = None
self.__stream = stream
self.__address = address
def send(self, opcode, body=None):
packet = net.encode_packet(opcode, body)
yie... | from tornado import gen
from gateway import net
class CameraDevice(object):
def __init__(self, stream, address):
self.resolution = None
self.framerate = None
self.__stream = stream
self.__address = address
@gen.coroutine
def send(self, opcode, body=None):
packet =... | Fix CameraDevice's send method is not called | Fix CameraDevice's send method is not called
Add send method @gen.coroutine decorator | Python | mit | walkover/auto-tracking-cctv-gateway | from gateway import net
class CameraDevice(object):
def __init__(self, stream, address):
self.resolution = None
self.framerate = None
self.__stream = stream
self.__address = address
def send(self, opcode, body=None):
packet = net.encode_packet(opcode, body)
yie... | from tornado import gen
from gateway import net
class CameraDevice(object):
def __init__(self, stream, address):
self.resolution = None
self.framerate = None
self.__stream = stream
self.__address = address
@gen.coroutine
def send(self, opcode, body=None):
packet =... | <commit_before>from gateway import net
class CameraDevice(object):
def __init__(self, stream, address):
self.resolution = None
self.framerate = None
self.__stream = stream
self.__address = address
def send(self, opcode, body=None):
packet = net.encode_packet(opcode, bo... | from tornado import gen
from gateway import net
class CameraDevice(object):
def __init__(self, stream, address):
self.resolution = None
self.framerate = None
self.__stream = stream
self.__address = address
@gen.coroutine
def send(self, opcode, body=None):
packet =... | from gateway import net
class CameraDevice(object):
def __init__(self, stream, address):
self.resolution = None
self.framerate = None
self.__stream = stream
self.__address = address
def send(self, opcode, body=None):
packet = net.encode_packet(opcode, body)
yie... | <commit_before>from gateway import net
class CameraDevice(object):
def __init__(self, stream, address):
self.resolution = None
self.framerate = None
self.__stream = stream
self.__address = address
def send(self, opcode, body=None):
packet = net.encode_packet(opcode, bo... |
9f0c05eb9926dc5a9be6eb65bd71f7f1218e24e1 | grano/logic/validation.py | grano/logic/validation.py | import re
import colander
from colander import Invalid
from grano.logic.references import ProjectRef
from grano.core import db
from grano.model import Schema, Attribute
FORBIDDEN = ['project', 'source', 'target', 'id', 'created_at', 'updated_at', 'author', 'author_id']
database_forbidden = colander.Function(lambda v... | import colander
from colander import Invalid
class All(object):
""" Composite validator which succeeds if none of its
subvalidators raises an :class:`colander.Invalid` exception"""
def __init__(self, *validators):
self.validators = validators
def __call__(self, node, value):
for valid... | Fix handling of All() exceptions. | Fix handling of All() exceptions. | Python | mit | 4bic/grano,CodeForAfrica/grano,4bic-attic/grano,granoproject/grano | import re
import colander
from colander import Invalid
from grano.logic.references import ProjectRef
from grano.core import db
from grano.model import Schema, Attribute
FORBIDDEN = ['project', 'source', 'target', 'id', 'created_at', 'updated_at', 'author', 'author_id']
database_forbidden = colander.Function(lambda v... | import colander
from colander import Invalid
class All(object):
""" Composite validator which succeeds if none of its
subvalidators raises an :class:`colander.Invalid` exception"""
def __init__(self, *validators):
self.validators = validators
def __call__(self, node, value):
for valid... | <commit_before>import re
import colander
from colander import Invalid
from grano.logic.references import ProjectRef
from grano.core import db
from grano.model import Schema, Attribute
FORBIDDEN = ['project', 'source', 'target', 'id', 'created_at', 'updated_at', 'author', 'author_id']
database_forbidden = colander.Fu... | import colander
from colander import Invalid
class All(object):
""" Composite validator which succeeds if none of its
subvalidators raises an :class:`colander.Invalid` exception"""
def __init__(self, *validators):
self.validators = validators
def __call__(self, node, value):
for valid... | import re
import colander
from colander import Invalid
from grano.logic.references import ProjectRef
from grano.core import db
from grano.model import Schema, Attribute
FORBIDDEN = ['project', 'source', 'target', 'id', 'created_at', 'updated_at', 'author', 'author_id']
database_forbidden = colander.Function(lambda v... | <commit_before>import re
import colander
from colander import Invalid
from grano.logic.references import ProjectRef
from grano.core import db
from grano.model import Schema, Attribute
FORBIDDEN = ['project', 'source', 'target', 'id', 'created_at', 'updated_at', 'author', 'author_id']
database_forbidden = colander.Fu... |
5ed5855efe09c92efbf93dab5eb0b37325072381 | opps/api/__init__.py | opps/api/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.contrib.auth import authenticate
from piston.handler import BaseHandler as Handler
from opps.api.models import ApiKey
class BaseHandler(Handler):
def read(self, request):
base = self.model.objects
if ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.contrib.auth import authenticate
from piston.handler import BaseHandler as Handler
from opps.api.models import ApiKey
class BaseHandler(Handler):
def read(self, request):
base = self.model.objects
if ... | Fix method get on ApiKeyAuthentication | Fix method get on ApiKeyAuthentication
| Python | mit | jeanmask/opps,opps/opps,YACOWS/opps,opps/opps,opps/opps,jeanmask/opps,williamroot/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,williamroot/opps,YACOWS/opps,jeanmask/opps | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.contrib.auth import authenticate
from piston.handler import BaseHandler as Handler
from opps.api.models import ApiKey
class BaseHandler(Handler):
def read(self, request):
base = self.model.objects
if ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.contrib.auth import authenticate
from piston.handler import BaseHandler as Handler
from opps.api.models import ApiKey
class BaseHandler(Handler):
def read(self, request):
base = self.model.objects
if ... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.contrib.auth import authenticate
from piston.handler import BaseHandler as Handler
from opps.api.models import ApiKey
class BaseHandler(Handler):
def read(self, request):
base = self.model.obje... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.contrib.auth import authenticate
from piston.handler import BaseHandler as Handler
from opps.api.models import ApiKey
class BaseHandler(Handler):
def read(self, request):
base = self.model.objects
if ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.contrib.auth import authenticate
from piston.handler import BaseHandler as Handler
from opps.api.models import ApiKey
class BaseHandler(Handler):
def read(self, request):
base = self.model.objects
if ... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.contrib.auth import authenticate
from piston.handler import BaseHandler as Handler
from opps.api.models import ApiKey
class BaseHandler(Handler):
def read(self, request):
base = self.model.obje... |
66c0b220188499a5871ee1fbe5b79f0a57db4ec9 | feder/tasks/filters.py | feder/tasks/filters.py | # -*- coding: utf-8 -*-
from atom.filters import CrispyFilterMixin, AutocompleteChoiceFilter
from django.utils.translation import ugettext_lazy as _
import django_filters
from .models import Task
class TaskFilter(CrispyFilterMixin, django_filters.FilterSet):
case = AutocompleteChoiceFilter('CaseAutocomplete')
... | # -*- coding: utf-8 -*-
from atom.filters import CrispyFilterMixin, AutocompleteChoiceFilter
from django.utils.translation import ugettext_lazy as _
import django_filters
from .models import Task
class TaskFilter(CrispyFilterMixin, django_filters.FilterSet):
case = AutocompleteChoiceFilter('CaseAutocomplete')
... | Add is_done filter for task | Add is_done filter for task
| Python | mit | watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder | # -*- coding: utf-8 -*-
from atom.filters import CrispyFilterMixin, AutocompleteChoiceFilter
from django.utils.translation import ugettext_lazy as _
import django_filters
from .models import Task
class TaskFilter(CrispyFilterMixin, django_filters.FilterSet):
case = AutocompleteChoiceFilter('CaseAutocomplete')
... | # -*- coding: utf-8 -*-
from atom.filters import CrispyFilterMixin, AutocompleteChoiceFilter
from django.utils.translation import ugettext_lazy as _
import django_filters
from .models import Task
class TaskFilter(CrispyFilterMixin, django_filters.FilterSet):
case = AutocompleteChoiceFilter('CaseAutocomplete')
... | <commit_before># -*- coding: utf-8 -*-
from atom.filters import CrispyFilterMixin, AutocompleteChoiceFilter
from django.utils.translation import ugettext_lazy as _
import django_filters
from .models import Task
class TaskFilter(CrispyFilterMixin, django_filters.FilterSet):
case = AutocompleteChoiceFilter('CaseAut... | # -*- coding: utf-8 -*-
from atom.filters import CrispyFilterMixin, AutocompleteChoiceFilter
from django.utils.translation import ugettext_lazy as _
import django_filters
from .models import Task
class TaskFilter(CrispyFilterMixin, django_filters.FilterSet):
case = AutocompleteChoiceFilter('CaseAutocomplete')
... | # -*- coding: utf-8 -*-
from atom.filters import CrispyFilterMixin, AutocompleteChoiceFilter
from django.utils.translation import ugettext_lazy as _
import django_filters
from .models import Task
class TaskFilter(CrispyFilterMixin, django_filters.FilterSet):
case = AutocompleteChoiceFilter('CaseAutocomplete')
... | <commit_before># -*- coding: utf-8 -*-
from atom.filters import CrispyFilterMixin, AutocompleteChoiceFilter
from django.utils.translation import ugettext_lazy as _
import django_filters
from .models import Task
class TaskFilter(CrispyFilterMixin, django_filters.FilterSet):
case = AutocompleteChoiceFilter('CaseAut... |
98392a42381470153fe2c13cda8e24cdccc5fe4b | hr_holidays_legal_leave/models/res_config.py | hr_holidays_legal_leave/models/res_config.py | # -*- coding: utf-8 -*-
# © 2015 iDT LABS (http://[email protected])
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models, api
class HumanResourcesConfiguration(models.TransientModel):
_inherit = 'hr.config.settings'
legal_holidays_status_id = fields.Many2on... | # -*- coding: utf-8 -*-
# © 2015 iDT LABS (http://[email protected])
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models, api
class HumanResourcesConfiguration(models.TransientModel):
_inherit = 'hr.config.settings'
legal_holidays_status_id = fields.Many2on... | Remove fields from method definition. | Remove fields from method definition.
| Python | agpl-3.0 | VitalPet/hr,feketemihai/hr,Eficent/hr,open-synergy/hr,VitalPet/hr,thinkopensolutions/hr,Eficent/hr,acsone/hr,open-synergy/hr,thinkopensolutions/hr,acsone/hr,feketemihai/hr | # -*- coding: utf-8 -*-
# © 2015 iDT LABS (http://[email protected])
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models, api
class HumanResourcesConfiguration(models.TransientModel):
_inherit = 'hr.config.settings'
legal_holidays_status_id = fields.Many2on... | # -*- coding: utf-8 -*-
# © 2015 iDT LABS (http://[email protected])
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models, api
class HumanResourcesConfiguration(models.TransientModel):
_inherit = 'hr.config.settings'
legal_holidays_status_id = fields.Many2on... | <commit_before># -*- coding: utf-8 -*-
# © 2015 iDT LABS (http://[email protected])
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models, api
class HumanResourcesConfiguration(models.TransientModel):
_inherit = 'hr.config.settings'
legal_holidays_status_id =... | # -*- coding: utf-8 -*-
# © 2015 iDT LABS (http://[email protected])
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models, api
class HumanResourcesConfiguration(models.TransientModel):
_inherit = 'hr.config.settings'
legal_holidays_status_id = fields.Many2on... | # -*- coding: utf-8 -*-
# © 2015 iDT LABS (http://[email protected])
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models, api
class HumanResourcesConfiguration(models.TransientModel):
_inherit = 'hr.config.settings'
legal_holidays_status_id = fields.Many2on... | <commit_before># -*- coding: utf-8 -*-
# © 2015 iDT LABS (http://[email protected])
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models, api
class HumanResourcesConfiguration(models.TransientModel):
_inherit = 'hr.config.settings'
legal_holidays_status_id =... |
c55a42737a99104734a79e946304849258bfa44b | aplib/__init__.py | aplib/__init__.py | # Copyright (c) 2002-2011 IronPort Systems and Cisco Systems
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mo... | # Copyright (c) 2002-2011 IronPort Systems and Cisco Systems
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mo... | Allow aplib to be imported when coro is not installed. | Allow aplib to be imported when coro is not installed.
| Python | mit | ironport/aplib,ironport/aplib | # Copyright (c) 2002-2011 IronPort Systems and Cisco Systems
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mo... | # Copyright (c) 2002-2011 IronPort Systems and Cisco Systems
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mo... | <commit_before># Copyright (c) 2002-2011 IronPort Systems and Cisco Systems
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# t... | # Copyright (c) 2002-2011 IronPort Systems and Cisco Systems
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mo... | # Copyright (c) 2002-2011 IronPort Systems and Cisco Systems
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mo... | <commit_before># Copyright (c) 2002-2011 IronPort Systems and Cisco Systems
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# t... |
f4701ac73f884ef28e62bb35adc81330ce512171 | goto_last_edit.py | goto_last_edit.py | import sublime_plugin
# the last edited Region, keyed to View.id
_last_edits = {}
class RecordLastEdit(sublime_plugin.EventListener):
def on_modified(self, view):
_last_edits[view.id()] = view.sel()[0]
class GotoLastEdit(sublime_plugin.TextCommand):
def run(self, edit):
last_edit = _last... | import sublime, sublime_plugin
LAST_EDITS_SETTING = 'last_edits'
class RecordLastEdit(sublime_plugin.EventListener):
def on_modified(self, view):
last_edits = view.settings().get(LAST_EDITS_SETTING, {})
edit_position = view.sel()[0]
last_edits[str(view.id())] = {'a': edit_position.a, '... | Return to original if cursor is already at least edit | Return to original if cursor is already at least edit
| Python | mit | abrookins/GotoLastEdit | import sublime_plugin
# the last edited Region, keyed to View.id
_last_edits = {}
class RecordLastEdit(sublime_plugin.EventListener):
def on_modified(self, view):
_last_edits[view.id()] = view.sel()[0]
class GotoLastEdit(sublime_plugin.TextCommand):
def run(self, edit):
last_edit = _last... | import sublime, sublime_plugin
LAST_EDITS_SETTING = 'last_edits'
class RecordLastEdit(sublime_plugin.EventListener):
def on_modified(self, view):
last_edits = view.settings().get(LAST_EDITS_SETTING, {})
edit_position = view.sel()[0]
last_edits[str(view.id())] = {'a': edit_position.a, '... | <commit_before>import sublime_plugin
# the last edited Region, keyed to View.id
_last_edits = {}
class RecordLastEdit(sublime_plugin.EventListener):
def on_modified(self, view):
_last_edits[view.id()] = view.sel()[0]
class GotoLastEdit(sublime_plugin.TextCommand):
def run(self, edit):
la... | import sublime, sublime_plugin
LAST_EDITS_SETTING = 'last_edits'
class RecordLastEdit(sublime_plugin.EventListener):
def on_modified(self, view):
last_edits = view.settings().get(LAST_EDITS_SETTING, {})
edit_position = view.sel()[0]
last_edits[str(view.id())] = {'a': edit_position.a, '... | import sublime_plugin
# the last edited Region, keyed to View.id
_last_edits = {}
class RecordLastEdit(sublime_plugin.EventListener):
def on_modified(self, view):
_last_edits[view.id()] = view.sel()[0]
class GotoLastEdit(sublime_plugin.TextCommand):
def run(self, edit):
last_edit = _last... | <commit_before>import sublime_plugin
# the last edited Region, keyed to View.id
_last_edits = {}
class RecordLastEdit(sublime_plugin.EventListener):
def on_modified(self, view):
_last_edits[view.id()] = view.sel()[0]
class GotoLastEdit(sublime_plugin.TextCommand):
def run(self, edit):
la... |
3a80b55c8a46f46ecd5b458d0aee26b34e8ad1f5 | backend/core/app.py | backend/core/app.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask
from flask_restful import Api
from .db import configure_database
class Application:
def __init__(self):
self.flask_app = Flask(__name__)
self.api = Api(self.flask_app)
self.import_configuration()
self.configur... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask
from flask_restful import Api
from .db import configure_database
class Application:
def __init__(self):
self.flask_app = Flask(__name__)
self.api = Api(self.flask_app)
self.import_configuration()
self.configur... | Add another user in fixture code | Add another user in fixture code
| Python | unlicense | azlyth/tokens,azlyth/tokens,azlyth/tokens | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask
from flask_restful import Api
from .db import configure_database
class Application:
def __init__(self):
self.flask_app = Flask(__name__)
self.api = Api(self.flask_app)
self.import_configuration()
self.configur... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask
from flask_restful import Api
from .db import configure_database
class Application:
def __init__(self):
self.flask_app = Flask(__name__)
self.api = Api(self.flask_app)
self.import_configuration()
self.configur... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask
from flask_restful import Api
from .db import configure_database
class Application:
def __init__(self):
self.flask_app = Flask(__name__)
self.api = Api(self.flask_app)
self.import_configuration()
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask
from flask_restful import Api
from .db import configure_database
class Application:
def __init__(self):
self.flask_app = Flask(__name__)
self.api = Api(self.flask_app)
self.import_configuration()
self.configur... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask
from flask_restful import Api
from .db import configure_database
class Application:
def __init__(self):
self.flask_app = Flask(__name__)
self.api = Api(self.flask_app)
self.import_configuration()
self.configur... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask
from flask_restful import Api
from .db import configure_database
class Application:
def __init__(self):
self.flask_app = Flask(__name__)
self.api = Api(self.flask_app)
self.import_configuration()
... |
c892077dd55405d71cbe6d6191c53260b74447d2 | hubblestack/extmods/grains/hostuuid.py | hubblestack/extmods/grains/hostuuid.py | # -*- coding: utf-8 -*-
'''
Generate a unique uuid for this host, storing it on disk so it persists across
restarts
'''
import logging
import os
import uuid
log = logging.getLogger(__name__)
def host_uuid():
'''
Generate a unique uuid for this host, storing it on disk so it persists
across restarts
'... | # -*- coding: utf-8 -*-
'''
Generate a unique uuid for this host, storing it on disk so it persists across
restarts
'''
import logging
import os
import uuid
log = logging.getLogger(__name__)
def host_uuid():
'''
Generate a unique uuid for this host, storing it on disk so it persists
across restarts
'... | Write the correct variable to disk | Write the correct variable to disk
Maybe I should get more sleep
| Python | apache-2.0 | basepi/hubble,basepi/hubble | # -*- coding: utf-8 -*-
'''
Generate a unique uuid for this host, storing it on disk so it persists across
restarts
'''
import logging
import os
import uuid
log = logging.getLogger(__name__)
def host_uuid():
'''
Generate a unique uuid for this host, storing it on disk so it persists
across restarts
'... | # -*- coding: utf-8 -*-
'''
Generate a unique uuid for this host, storing it on disk so it persists across
restarts
'''
import logging
import os
import uuid
log = logging.getLogger(__name__)
def host_uuid():
'''
Generate a unique uuid for this host, storing it on disk so it persists
across restarts
'... | <commit_before># -*- coding: utf-8 -*-
'''
Generate a unique uuid for this host, storing it on disk so it persists across
restarts
'''
import logging
import os
import uuid
log = logging.getLogger(__name__)
def host_uuid():
'''
Generate a unique uuid for this host, storing it on disk so it persists
across... | # -*- coding: utf-8 -*-
'''
Generate a unique uuid for this host, storing it on disk so it persists across
restarts
'''
import logging
import os
import uuid
log = logging.getLogger(__name__)
def host_uuid():
'''
Generate a unique uuid for this host, storing it on disk so it persists
across restarts
'... | # -*- coding: utf-8 -*-
'''
Generate a unique uuid for this host, storing it on disk so it persists across
restarts
'''
import logging
import os
import uuid
log = logging.getLogger(__name__)
def host_uuid():
'''
Generate a unique uuid for this host, storing it on disk so it persists
across restarts
'... | <commit_before># -*- coding: utf-8 -*-
'''
Generate a unique uuid for this host, storing it on disk so it persists across
restarts
'''
import logging
import os
import uuid
log = logging.getLogger(__name__)
def host_uuid():
'''
Generate a unique uuid for this host, storing it on disk so it persists
across... |
ebb0236d7c68883de7a4202df23e74becd943f29 | hooks/pre_gen_project.py | hooks/pre_gen_project.py | project_slug = '{{ cookiecutter.project_slug }}'
print('pre gen')
if hasattr(project_slug, 'isidentifier'):
assert project_slug.isidentifier(), 'Project slug should be valid Python identifier!'
| project_slug = '{{ cookiecutter.project_slug }}'
if hasattr(project_slug, 'isidentifier'):
assert project_slug.isidentifier(), 'Project slug should be valid Python identifier!'
| Fix a typo in the pre-generation hooks | Fix a typo in the pre-generation hooks
| Python | bsd-3-clause | valerymelou/cookiecutter-django-gulp,valerymelou/cookiecutter-django-gulp,valerymelou/cookiecutter-django-gulp | project_slug = '{{ cookiecutter.project_slug }}'
print('pre gen')
if hasattr(project_slug, 'isidentifier'):
assert project_slug.isidentifier(), 'Project slug should be valid Python identifier!'
Fix a typo in the pre-generation hooks | project_slug = '{{ cookiecutter.project_slug }}'
if hasattr(project_slug, 'isidentifier'):
assert project_slug.isidentifier(), 'Project slug should be valid Python identifier!'
| <commit_before>project_slug = '{{ cookiecutter.project_slug }}'
print('pre gen')
if hasattr(project_slug, 'isidentifier'):
assert project_slug.isidentifier(), 'Project slug should be valid Python identifier!'
<commit_msg>Fix a typo in the pre-generation hooks<commit_after> | project_slug = '{{ cookiecutter.project_slug }}'
if hasattr(project_slug, 'isidentifier'):
assert project_slug.isidentifier(), 'Project slug should be valid Python identifier!'
| project_slug = '{{ cookiecutter.project_slug }}'
print('pre gen')
if hasattr(project_slug, 'isidentifier'):
assert project_slug.isidentifier(), 'Project slug should be valid Python identifier!'
Fix a typo in the pre-generation hooksproject_slug = '{{ cookiecutter.project_slug }}'
if hasattr(project_slug, 'iside... | <commit_before>project_slug = '{{ cookiecutter.project_slug }}'
print('pre gen')
if hasattr(project_slug, 'isidentifier'):
assert project_slug.isidentifier(), 'Project slug should be valid Python identifier!'
<commit_msg>Fix a typo in the pre-generation hooks<commit_after>project_slug = '{{ cookiecutter.project_s... |
b7b38e67ae95a5d5bed68661c2e106149117fa80 | mendel/views.py | mendel/views.py | from django.conf import settings
from django.shortcuts import render
from rest_framework import permissions
from rest_framework.views import APIView
from rest_framework.response import Response
from models import Context, Review, Keyword, Category
def index(request):
context = {'DEBUG': settings.DEBUG}
return... | from django.conf import settings
from django.shortcuts import render
from rest_framework import permissions
from rest_framework.views import APIView
from rest_framework.response import Response
from models import Context, Review, Keyword, Category
def index(request):
context = {'DEBUG': settings.DEBUG}
return... | Handle review deletion when updating categories for a context | Handle review deletion when updating categories for a context
| Python | agpl-3.0 | Architizer/mendel,Architizer/mendel,Architizer/mendel,Architizer/mendel | from django.conf import settings
from django.shortcuts import render
from rest_framework import permissions
from rest_framework.views import APIView
from rest_framework.response import Response
from models import Context, Review, Keyword, Category
def index(request):
context = {'DEBUG': settings.DEBUG}
return... | from django.conf import settings
from django.shortcuts import render
from rest_framework import permissions
from rest_framework.views import APIView
from rest_framework.response import Response
from models import Context, Review, Keyword, Category
def index(request):
context = {'DEBUG': settings.DEBUG}
return... | <commit_before>from django.conf import settings
from django.shortcuts import render
from rest_framework import permissions
from rest_framework.views import APIView
from rest_framework.response import Response
from models import Context, Review, Keyword, Category
def index(request):
context = {'DEBUG': settings.DE... | from django.conf import settings
from django.shortcuts import render
from rest_framework import permissions
from rest_framework.views import APIView
from rest_framework.response import Response
from models import Context, Review, Keyword, Category
def index(request):
context = {'DEBUG': settings.DEBUG}
return... | from django.conf import settings
from django.shortcuts import render
from rest_framework import permissions
from rest_framework.views import APIView
from rest_framework.response import Response
from models import Context, Review, Keyword, Category
def index(request):
context = {'DEBUG': settings.DEBUG}
return... | <commit_before>from django.conf import settings
from django.shortcuts import render
from rest_framework import permissions
from rest_framework.views import APIView
from rest_framework.response import Response
from models import Context, Review, Keyword, Category
def index(request):
context = {'DEBUG': settings.DE... |
5748265d5102ee69e928d65ff3d40779af120dac | count-inversions/count_inversions.py | count-inversions/count_inversions.py | from random import randint
import sys
def sort_and_count(arr):
n = len(arr)
if n == 1:
return 0
else:
first_half = arr[:n/2]
second_half = arr[n/2:]
return merge_and_count_split(sort_and_count(first_half), sort_and_count(second_half))
def merge_and_count_split(arr1, arr2):
return 0
def main(arr_len):
... | from random import randint
import sys
def sort_and_count(arr):
n = len(arr)
if n == 1:
return arr
else:
first_half = arr[:n/2]
second_half = arr[n/2:]
return merge_and_count_split(sort_and_count(first_half), sort_and_count(second_half))
def merge_and_count_split(arr1, arr2):
i, j = 0, 0
result = []
... | Implement merge component of merge_and_count_split | Implement merge component of merge_and_count_split
The merging part of merge_and_count_split was is taken right out
of merge-sort. A test revealed a mistake in merge_and_sort where
0 was returned instead of the array when the array has one
element, so that was fixed.
| Python | mit | timpel/stanford-algs,timpel/stanford-algs | from random import randint
import sys
def sort_and_count(arr):
n = len(arr)
if n == 1:
return 0
else:
first_half = arr[:n/2]
second_half = arr[n/2:]
return merge_and_count_split(sort_and_count(first_half), sort_and_count(second_half))
def merge_and_count_split(arr1, arr2):
return 0
def main(arr_len):
... | from random import randint
import sys
def sort_and_count(arr):
n = len(arr)
if n == 1:
return arr
else:
first_half = arr[:n/2]
second_half = arr[n/2:]
return merge_and_count_split(sort_and_count(first_half), sort_and_count(second_half))
def merge_and_count_split(arr1, arr2):
i, j = 0, 0
result = []
... | <commit_before>from random import randint
import sys
def sort_and_count(arr):
n = len(arr)
if n == 1:
return 0
else:
first_half = arr[:n/2]
second_half = arr[n/2:]
return merge_and_count_split(sort_and_count(first_half), sort_and_count(second_half))
def merge_and_count_split(arr1, arr2):
return 0
def ... | from random import randint
import sys
def sort_and_count(arr):
n = len(arr)
if n == 1:
return arr
else:
first_half = arr[:n/2]
second_half = arr[n/2:]
return merge_and_count_split(sort_and_count(first_half), sort_and_count(second_half))
def merge_and_count_split(arr1, arr2):
i, j = 0, 0
result = []
... | from random import randint
import sys
def sort_and_count(arr):
n = len(arr)
if n == 1:
return 0
else:
first_half = arr[:n/2]
second_half = arr[n/2:]
return merge_and_count_split(sort_and_count(first_half), sort_and_count(second_half))
def merge_and_count_split(arr1, arr2):
return 0
def main(arr_len):
... | <commit_before>from random import randint
import sys
def sort_and_count(arr):
n = len(arr)
if n == 1:
return 0
else:
first_half = arr[:n/2]
second_half = arr[n/2:]
return merge_and_count_split(sort_and_count(first_half), sort_and_count(second_half))
def merge_and_count_split(arr1, arr2):
return 0
def ... |
2f26197d10a1c7cfc010074576c7e1a2c2a31e78 | data_structures/bitorrent/torrent.py | data_structures/bitorrent/torrent.py | import hashlib
import urllib
import bencode
class Torrent(object):
def __init__(self, path):
self.encoded = self._get_meta(path)
self.decoded = bencode.bdecode(self.encoded)
def _get_meta(self, path):
with open(path) as f:
return f.read()
@property
def hash(self):
info_hash = hashlib... | import hashlib
import urllib
import bencode
class Torrent(object):
def __init__(self, path):
self.encoded = self._get_meta(path)
self.decoded = bencode.bdecode(self.encoded)
def _get_meta(self, path):
with open(path) as f:
return f.read()
def __getitem__(self, item):
return self.decode... | Use __getitem__ to improve readbility | Use __getitem__ to improve readbility
| Python | apache-2.0 | vtemian/university_projects,vtemian/university_projects,vtemian/university_projects | import hashlib
import urllib
import bencode
class Torrent(object):
def __init__(self, path):
self.encoded = self._get_meta(path)
self.decoded = bencode.bdecode(self.encoded)
def _get_meta(self, path):
with open(path) as f:
return f.read()
@property
def hash(self):
info_hash = hashlib... | import hashlib
import urllib
import bencode
class Torrent(object):
def __init__(self, path):
self.encoded = self._get_meta(path)
self.decoded = bencode.bdecode(self.encoded)
def _get_meta(self, path):
with open(path) as f:
return f.read()
def __getitem__(self, item):
return self.decode... | <commit_before>import hashlib
import urllib
import bencode
class Torrent(object):
def __init__(self, path):
self.encoded = self._get_meta(path)
self.decoded = bencode.bdecode(self.encoded)
def _get_meta(self, path):
with open(path) as f:
return f.read()
@property
def hash(self):
info... | import hashlib
import urllib
import bencode
class Torrent(object):
def __init__(self, path):
self.encoded = self._get_meta(path)
self.decoded = bencode.bdecode(self.encoded)
def _get_meta(self, path):
with open(path) as f:
return f.read()
def __getitem__(self, item):
return self.decode... | import hashlib
import urllib
import bencode
class Torrent(object):
def __init__(self, path):
self.encoded = self._get_meta(path)
self.decoded = bencode.bdecode(self.encoded)
def _get_meta(self, path):
with open(path) as f:
return f.read()
@property
def hash(self):
info_hash = hashlib... | <commit_before>import hashlib
import urllib
import bencode
class Torrent(object):
def __init__(self, path):
self.encoded = self._get_meta(path)
self.decoded = bencode.bdecode(self.encoded)
def _get_meta(self, path):
with open(path) as f:
return f.read()
@property
def hash(self):
info... |
9caa0aa6c8fddc8a21997cf4df88d407b1598412 | keras_cv/__init__.py | keras_cv/__init__.py | # Copyright 2022 The KerasCV Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright 2022 The KerasCV Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Add export for models module | Add export for models module
| Python | apache-2.0 | keras-team/keras-cv,keras-team/keras-cv,keras-team/keras-cv | # Copyright 2022 The KerasCV Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright 2022 The KerasCV Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | <commit_before># Copyright 2022 The KerasCV Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | # Copyright 2022 The KerasCV Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright 2022 The KerasCV Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | <commit_before># Copyright 2022 The KerasCV Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
4e18d3d3c35e92d6b800f347b65765ca36d6148b | playserver/track.py | playserver/track.py | import configmanager
import osascript
APP_CONFIG_PATH = "../applications/"
applicationConfigs = configmanager.ConfigManager(APP_CONFIG_PATH)
#TODO: Make this user choosable
currentApplication = "radiant"
def getCurrentConfig():
return applicationConfigs[currentApplication]
def _executeCommand(command):
config = g... | import configmanager
import osascript
APP_CONFIG_PATH = "../applications/"
applicationConfigs = configmanager.ConfigManager(APP_CONFIG_PATH)
#TODO: Make this user choosable
currentApplication = "radiant"
def getCurrentConfig():
return applicationConfigs[currentApplication]
def _executeCommand(command):
config = g... | Return full osascript output from getCurrentConfig | Return full osascript output from getCurrentConfig
| Python | mit | ollien/playserver,ollien/playserver,ollien/playserver | import configmanager
import osascript
APP_CONFIG_PATH = "../applications/"
applicationConfigs = configmanager.ConfigManager(APP_CONFIG_PATH)
#TODO: Make this user choosable
currentApplication = "radiant"
def getCurrentConfig():
return applicationConfigs[currentApplication]
def _executeCommand(command):
config = g... | import configmanager
import osascript
APP_CONFIG_PATH = "../applications/"
applicationConfigs = configmanager.ConfigManager(APP_CONFIG_PATH)
#TODO: Make this user choosable
currentApplication = "radiant"
def getCurrentConfig():
return applicationConfigs[currentApplication]
def _executeCommand(command):
config = g... | <commit_before>import configmanager
import osascript
APP_CONFIG_PATH = "../applications/"
applicationConfigs = configmanager.ConfigManager(APP_CONFIG_PATH)
#TODO: Make this user choosable
currentApplication = "radiant"
def getCurrentConfig():
return applicationConfigs[currentApplication]
def _executeCommand(comman... | import configmanager
import osascript
APP_CONFIG_PATH = "../applications/"
applicationConfigs = configmanager.ConfigManager(APP_CONFIG_PATH)
#TODO: Make this user choosable
currentApplication = "radiant"
def getCurrentConfig():
return applicationConfigs[currentApplication]
def _executeCommand(command):
config = g... | import configmanager
import osascript
APP_CONFIG_PATH = "../applications/"
applicationConfigs = configmanager.ConfigManager(APP_CONFIG_PATH)
#TODO: Make this user choosable
currentApplication = "radiant"
def getCurrentConfig():
return applicationConfigs[currentApplication]
def _executeCommand(command):
config = g... | <commit_before>import configmanager
import osascript
APP_CONFIG_PATH = "../applications/"
applicationConfigs = configmanager.ConfigManager(APP_CONFIG_PATH)
#TODO: Make this user choosable
currentApplication = "radiant"
def getCurrentConfig():
return applicationConfigs[currentApplication]
def _executeCommand(comman... |
e7a8c76c1f8f07866a4b7ea55870dacb5c76ef90 | face/tests/model_tests.py | face/tests/model_tests.py | from django.test import TestCase
from functional_tests.factory import FaceFactory
class Facetest(TestCase):
def setUp(self):
self.face = FaceFactory(title='Lokesh')
def test_title_to_share_returns_meet_Lokesh__farmer_from_sivaganga_tamil_nadu(self):
self.assertEqual(self.face.title_to_share,'... | from django.test import TestCase
from functional_tests.factory import FaceFactory
class Facetest(TestCase):
def setUp(self):
self.face = FaceFactory(title='Lokesh')
def test_title_to_share_returns_meet_Lokesh__farmer_from_sivaganga_tamil_nadu(self):
self.assertEqual(self.face.title_to_share,'... | Fix unit test for seo faces url | Fix unit test for seo faces url
| Python | bsd-3-clause | PARINetwork/pari,PARINetwork/pari,PARINetwork/pari,PARINetwork/pari | from django.test import TestCase
from functional_tests.factory import FaceFactory
class Facetest(TestCase):
def setUp(self):
self.face = FaceFactory(title='Lokesh')
def test_title_to_share_returns_meet_Lokesh__farmer_from_sivaganga_tamil_nadu(self):
self.assertEqual(self.face.title_to_share,'... | from django.test import TestCase
from functional_tests.factory import FaceFactory
class Facetest(TestCase):
def setUp(self):
self.face = FaceFactory(title='Lokesh')
def test_title_to_share_returns_meet_Lokesh__farmer_from_sivaganga_tamil_nadu(self):
self.assertEqual(self.face.title_to_share,'... | <commit_before>from django.test import TestCase
from functional_tests.factory import FaceFactory
class Facetest(TestCase):
def setUp(self):
self.face = FaceFactory(title='Lokesh')
def test_title_to_share_returns_meet_Lokesh__farmer_from_sivaganga_tamil_nadu(self):
self.assertEqual(self.face.t... | from django.test import TestCase
from functional_tests.factory import FaceFactory
class Facetest(TestCase):
def setUp(self):
self.face = FaceFactory(title='Lokesh')
def test_title_to_share_returns_meet_Lokesh__farmer_from_sivaganga_tamil_nadu(self):
self.assertEqual(self.face.title_to_share,'... | from django.test import TestCase
from functional_tests.factory import FaceFactory
class Facetest(TestCase):
def setUp(self):
self.face = FaceFactory(title='Lokesh')
def test_title_to_share_returns_meet_Lokesh__farmer_from_sivaganga_tamil_nadu(self):
self.assertEqual(self.face.title_to_share,'... | <commit_before>from django.test import TestCase
from functional_tests.factory import FaceFactory
class Facetest(TestCase):
def setUp(self):
self.face = FaceFactory(title='Lokesh')
def test_title_to_share_returns_meet_Lokesh__farmer_from_sivaganga_tamil_nadu(self):
self.assertEqual(self.face.t... |
8df691acaebffc343dac4535a64f8a809607558a | Demo/sgi/cd/cdaiff.py | Demo/sgi/cd/cdaiff.py | import sys
import readcd
import aiff
import AL
import CD
Error = 'cdaiff.Error'
def writeaudio(a, type, data):
a.writesampsraw(data)
def main():
if len(sys.argv) > 1:
a = aiff.Aiff().init(sys.argv[1], 'w')
else:
a = aiff.Aiff().init('@', 'w')
a.sampwidth = AL.SAMPLE_16
a.nchannels = AL.STEREO
a.samprate = ... | import sys
import readcd
import aifc
import AL
import CD
Error = 'cdaiff.Error'
def writeaudio(a, type, data):
a.writeframesraw(data)
def main():
if len(sys.argv) > 1:
a = aifc.open(sys.argv[1], 'w')
else:
a = aifc.open('@', 'w')
a.setsampwidth(AL.SAMPLE_16)
a.setnchannels(AL.STEREO)
a.setframerate(AL.RATE... | Use module aifc instead of module aiff. | Use module aifc instead of module aiff.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | import sys
import readcd
import aiff
import AL
import CD
Error = 'cdaiff.Error'
def writeaudio(a, type, data):
a.writesampsraw(data)
def main():
if len(sys.argv) > 1:
a = aiff.Aiff().init(sys.argv[1], 'w')
else:
a = aiff.Aiff().init('@', 'w')
a.sampwidth = AL.SAMPLE_16
a.nchannels = AL.STEREO
a.samprate = ... | import sys
import readcd
import aifc
import AL
import CD
Error = 'cdaiff.Error'
def writeaudio(a, type, data):
a.writeframesraw(data)
def main():
if len(sys.argv) > 1:
a = aifc.open(sys.argv[1], 'w')
else:
a = aifc.open('@', 'w')
a.setsampwidth(AL.SAMPLE_16)
a.setnchannels(AL.STEREO)
a.setframerate(AL.RATE... | <commit_before>import sys
import readcd
import aiff
import AL
import CD
Error = 'cdaiff.Error'
def writeaudio(a, type, data):
a.writesampsraw(data)
def main():
if len(sys.argv) > 1:
a = aiff.Aiff().init(sys.argv[1], 'w')
else:
a = aiff.Aiff().init('@', 'w')
a.sampwidth = AL.SAMPLE_16
a.nchannels = AL.STEREO... | import sys
import readcd
import aifc
import AL
import CD
Error = 'cdaiff.Error'
def writeaudio(a, type, data):
a.writeframesraw(data)
def main():
if len(sys.argv) > 1:
a = aifc.open(sys.argv[1], 'w')
else:
a = aifc.open('@', 'w')
a.setsampwidth(AL.SAMPLE_16)
a.setnchannels(AL.STEREO)
a.setframerate(AL.RATE... | import sys
import readcd
import aiff
import AL
import CD
Error = 'cdaiff.Error'
def writeaudio(a, type, data):
a.writesampsraw(data)
def main():
if len(sys.argv) > 1:
a = aiff.Aiff().init(sys.argv[1], 'w')
else:
a = aiff.Aiff().init('@', 'w')
a.sampwidth = AL.SAMPLE_16
a.nchannels = AL.STEREO
a.samprate = ... | <commit_before>import sys
import readcd
import aiff
import AL
import CD
Error = 'cdaiff.Error'
def writeaudio(a, type, data):
a.writesampsraw(data)
def main():
if len(sys.argv) > 1:
a = aiff.Aiff().init(sys.argv[1], 'w')
else:
a = aiff.Aiff().init('@', 'w')
a.sampwidth = AL.SAMPLE_16
a.nchannels = AL.STEREO... |
b097675e5906f7b0e9c050110fea58e40491814b | music/api.py | music/api.py | from django.conf.urls.defaults import url
from tastypie.resources import ModelResource
from jmbo.api import ModelBaseResource
from music.models import Track
class TrackResource(ModelBaseResource):
class Meta:
queryset = Track.permitted.all()
resource_name = 'track'
ordering = ['last_pla... | from django.conf.urls.defaults import url
from tastypie.resources import ModelResource
from tastypie.constants import ALL
from jmbo.api import ModelBaseResource
from music.models import Track
class TrackResource(ModelBaseResource):
class Meta:
queryset = Track.permitted.all()
resource_name = 't... | Allow filtering and ordering on API | Allow filtering and ordering on API
| Python | bsd-3-clause | praekelt/jmbo-music,praekelt/jmbo-music | from django.conf.urls.defaults import url
from tastypie.resources import ModelResource
from jmbo.api import ModelBaseResource
from music.models import Track
class TrackResource(ModelBaseResource):
class Meta:
queryset = Track.permitted.all()
resource_name = 'track'
ordering = ['last_pla... | from django.conf.urls.defaults import url
from tastypie.resources import ModelResource
from tastypie.constants import ALL
from jmbo.api import ModelBaseResource
from music.models import Track
class TrackResource(ModelBaseResource):
class Meta:
queryset = Track.permitted.all()
resource_name = 't... | <commit_before>from django.conf.urls.defaults import url
from tastypie.resources import ModelResource
from jmbo.api import ModelBaseResource
from music.models import Track
class TrackResource(ModelBaseResource):
class Meta:
queryset = Track.permitted.all()
resource_name = 'track'
orderi... | from django.conf.urls.defaults import url
from tastypie.resources import ModelResource
from tastypie.constants import ALL
from jmbo.api import ModelBaseResource
from music.models import Track
class TrackResource(ModelBaseResource):
class Meta:
queryset = Track.permitted.all()
resource_name = 't... | from django.conf.urls.defaults import url
from tastypie.resources import ModelResource
from jmbo.api import ModelBaseResource
from music.models import Track
class TrackResource(ModelBaseResource):
class Meta:
queryset = Track.permitted.all()
resource_name = 'track'
ordering = ['last_pla... | <commit_before>from django.conf.urls.defaults import url
from tastypie.resources import ModelResource
from jmbo.api import ModelBaseResource
from music.models import Track
class TrackResource(ModelBaseResource):
class Meta:
queryset = Track.permitted.all()
resource_name = 'track'
orderi... |
61bfc62937176b580b8b6ae12a90c5b76b00d50d | libcloud/__init__.py | libcloud/__init__.py | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# libcloud.org licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not... | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# libcloud.org licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not... | Add version string to libcloud | Add version string to libcloud
git-svn-id: 353d90d4d8d13dcb4e0402680a9155a727f61a5a@895867 13f79535-47bb-0310-9956-ffa450edef68
| Python | apache-2.0 | Kami/libcloud,jimbobhickville/libcloud,ClusterHQ/libcloud,apache/libcloud,DimensionDataCBUSydney/libcloud,curoverse/libcloud,smaffulli/libcloud,schaubl/libcloud,techhat/libcloud,DimensionDataCBUSydney/libcloud,cryptickp/libcloud,cloudControl/libcloud,supertom/libcloud,ZuluPro/libcloud,Verizon/libcloud,t-tran/libcloud,S... | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# libcloud.org licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not... | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# libcloud.org licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not... | <commit_before># Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# libcloud.org licenses this file to You under the Apache License, Version 2.0
# (the "License... | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# libcloud.org licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not... | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# libcloud.org licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not... | <commit_before># Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# libcloud.org licenses this file to You under the Apache License, Version 2.0
# (the "License... |
372ff487c068da2b31cd25e550e8dcd7bd12d17d | openprocurement/tender/esco/adapters.py | openprocurement/tender/esco/adapters.py | # -*- coding: utf-8 -*-
from openprocurement.tender.openeu.adapters import TenderAboveThresholdEUConfigurator
from openprocurement.tender.esco.models import Tender
class TenderESCOConfigurator(TenderAboveThresholdEUConfigurator):
""" ESCO Tender configuration adapter """
name = "esco Tender configurator"
... | # -*- coding: utf-8 -*-
from openprocurement.tender.openeu.adapters import TenderAboveThresholdEUConfigurator
from openprocurement.tender.esco.models import Tender
class TenderESCOConfigurator(TenderAboveThresholdEUConfigurator):
""" ESCO Tender configuration adapter """
name = "esco Tender configurator"
... | Add awarding criteria field to configurator | Add awarding criteria field to configurator
| Python | apache-2.0 | openprocurement/openprocurement.tender.esco | # -*- coding: utf-8 -*-
from openprocurement.tender.openeu.adapters import TenderAboveThresholdEUConfigurator
from openprocurement.tender.esco.models import Tender
class TenderESCOConfigurator(TenderAboveThresholdEUConfigurator):
""" ESCO Tender configuration adapter """
name = "esco Tender configurator"
... | # -*- coding: utf-8 -*-
from openprocurement.tender.openeu.adapters import TenderAboveThresholdEUConfigurator
from openprocurement.tender.esco.models import Tender
class TenderESCOConfigurator(TenderAboveThresholdEUConfigurator):
""" ESCO Tender configuration adapter """
name = "esco Tender configurator"
... | <commit_before># -*- coding: utf-8 -*-
from openprocurement.tender.openeu.adapters import TenderAboveThresholdEUConfigurator
from openprocurement.tender.esco.models import Tender
class TenderESCOConfigurator(TenderAboveThresholdEUConfigurator):
""" ESCO Tender configuration adapter """
name = "esco Tender co... | # -*- coding: utf-8 -*-
from openprocurement.tender.openeu.adapters import TenderAboveThresholdEUConfigurator
from openprocurement.tender.esco.models import Tender
class TenderESCOConfigurator(TenderAboveThresholdEUConfigurator):
""" ESCO Tender configuration adapter """
name = "esco Tender configurator"
... | # -*- coding: utf-8 -*-
from openprocurement.tender.openeu.adapters import TenderAboveThresholdEUConfigurator
from openprocurement.tender.esco.models import Tender
class TenderESCOConfigurator(TenderAboveThresholdEUConfigurator):
""" ESCO Tender configuration adapter """
name = "esco Tender configurator"
... | <commit_before># -*- coding: utf-8 -*-
from openprocurement.tender.openeu.adapters import TenderAboveThresholdEUConfigurator
from openprocurement.tender.esco.models import Tender
class TenderESCOConfigurator(TenderAboveThresholdEUConfigurator):
""" ESCO Tender configuration adapter """
name = "esco Tender co... |
b94e4971e3bcde718c40dc963a995e8afa5cf99f | examples/rate_limiting_test.py | examples/rate_limiting_test.py | from seleniumbase import BaseCase
from seleniumbase.common import decorators
class MyTestClass(BaseCase):
@decorators.rate_limited(4) # The arg is max calls per second
def print_item(self, item):
print item
def test_rate_limited_printing(self):
print "\nRunning rate-limited print test:"... | from seleniumbase import BaseCase
from seleniumbase.common import decorators
class MyTestClass(BaseCase):
@decorators.rate_limited(3.5) # The arg is max calls per second
def print_item(self, item):
print item
def test_rate_limited_printing(self):
print "\nRunning rate-limited print test... | Make the rate-limiting test more fancy | Make the rate-limiting test more fancy
| Python | mit | mdmintz/SeleniumBase,mdmintz/seleniumspot,possoumous/Watchers,ktp420/SeleniumBase,ktp420/SeleniumBase,mdmintz/SeleniumBase,possoumous/Watchers,possoumous/Watchers,ktp420/SeleniumBase,mdmintz/SeleniumBase,mdmintz/seleniumspot,mdmintz/SeleniumBase,possoumous/Watchers,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,se... | from seleniumbase import BaseCase
from seleniumbase.common import decorators
class MyTestClass(BaseCase):
@decorators.rate_limited(4) # The arg is max calls per second
def print_item(self, item):
print item
def test_rate_limited_printing(self):
print "\nRunning rate-limited print test:"... | from seleniumbase import BaseCase
from seleniumbase.common import decorators
class MyTestClass(BaseCase):
@decorators.rate_limited(3.5) # The arg is max calls per second
def print_item(self, item):
print item
def test_rate_limited_printing(self):
print "\nRunning rate-limited print test... | <commit_before>from seleniumbase import BaseCase
from seleniumbase.common import decorators
class MyTestClass(BaseCase):
@decorators.rate_limited(4) # The arg is max calls per second
def print_item(self, item):
print item
def test_rate_limited_printing(self):
print "\nRunning rate-limit... | from seleniumbase import BaseCase
from seleniumbase.common import decorators
class MyTestClass(BaseCase):
@decorators.rate_limited(3.5) # The arg is max calls per second
def print_item(self, item):
print item
def test_rate_limited_printing(self):
print "\nRunning rate-limited print test... | from seleniumbase import BaseCase
from seleniumbase.common import decorators
class MyTestClass(BaseCase):
@decorators.rate_limited(4) # The arg is max calls per second
def print_item(self, item):
print item
def test_rate_limited_printing(self):
print "\nRunning rate-limited print test:"... | <commit_before>from seleniumbase import BaseCase
from seleniumbase.common import decorators
class MyTestClass(BaseCase):
@decorators.rate_limited(4) # The arg is max calls per second
def print_item(self, item):
print item
def test_rate_limited_printing(self):
print "\nRunning rate-limit... |
50f577e63fe58531447dc0bc2eed80859d3aa1ad | ibmcnx/doc/DataSources.py | ibmcnx/doc/DataSources.py | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | Create script to save documentation to a file | 4: Create script to save documentation to a file
Task-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/4 | Python | apache-2.0 | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | <commit_before>######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Co... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | <commit_before>######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Co... |
6d25dcdb5eaca6d0d0404b4104017a18076174f8 | mass/utils.py | mass/utils.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Helper functions.
"""
# built-in modules
import json
# local modules
from mass.input_handler import InputHandler
from mass.scheduler.swf import config
def submit(job, protocol=None, priority=1):
"""Submit mass job to SWF with specific priority.
"""
impo... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Helper functions.
"""
# built-in modules
import json
# local modules
from mass.exception import UnsupportedScheduler
from mass.input_handler import InputHandler
from mass.scheduler.swf import config
def submit(job, protocol=None, priority=1, scheduler='swf'):
"... | Raise UnsupportedScheduler if specific scheduler for submit is not supported (Now just swf is supported). | Raise UnsupportedScheduler if specific scheduler for submit is not
supported (Now just swf is supported).
| Python | apache-2.0 | KKBOX/mass,badboy99tw/mass,KKBOX/mass,badboy99tw/mass,badboy99tw/mass,KKBOX/mass | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Helper functions.
"""
# built-in modules
import json
# local modules
from mass.input_handler import InputHandler
from mass.scheduler.swf import config
def submit(job, protocol=None, priority=1):
"""Submit mass job to SWF with specific priority.
"""
impo... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Helper functions.
"""
# built-in modules
import json
# local modules
from mass.exception import UnsupportedScheduler
from mass.input_handler import InputHandler
from mass.scheduler.swf import config
def submit(job, protocol=None, priority=1, scheduler='swf'):
"... | <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Helper functions.
"""
# built-in modules
import json
# local modules
from mass.input_handler import InputHandler
from mass.scheduler.swf import config
def submit(job, protocol=None, priority=1):
"""Submit mass job to SWF with specific priority.
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Helper functions.
"""
# built-in modules
import json
# local modules
from mass.exception import UnsupportedScheduler
from mass.input_handler import InputHandler
from mass.scheduler.swf import config
def submit(job, protocol=None, priority=1, scheduler='swf'):
"... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Helper functions.
"""
# built-in modules
import json
# local modules
from mass.input_handler import InputHandler
from mass.scheduler.swf import config
def submit(job, protocol=None, priority=1):
"""Submit mass job to SWF with specific priority.
"""
impo... | <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Helper functions.
"""
# built-in modules
import json
# local modules
from mass.input_handler import InputHandler
from mass.scheduler.swf import config
def submit(job, protocol=None, priority=1):
"""Submit mass job to SWF with specific priority.
... |
adb265a57baed6a94f83ba13f88342313ad78566 | tests/adapter.py | tests/adapter.py | """adapter
Mock storage adapter class for unit tests
"""
class MockStorageAdapter:
"""Mock storage adapter class.
Will be patched for testing purposes
"""
def store_entry(self, entry):
"""Mock store_entry"""
pass
def store_response(self, response):
"""Mock store_response"... | """adapter
Mock storage adapter class for unit tests
"""
class MockStorageAdapter:
"""Mock storage adapter class.
Will be patched for testing purposes
"""
def store_entry(self, entry: dict):
"""Mock store_entry"""
pass
def store_response(self, response: dict):
"""Mock sto... | Add type annotations to MockStorageAdapter methods | Add type annotations to MockStorageAdapter methods
| Python | mit | tjmcginnis/tmj | """adapter
Mock storage adapter class for unit tests
"""
class MockStorageAdapter:
"""Mock storage adapter class.
Will be patched for testing purposes
"""
def store_entry(self, entry):
"""Mock store_entry"""
pass
def store_response(self, response):
"""Mock store_response"... | """adapter
Mock storage adapter class for unit tests
"""
class MockStorageAdapter:
"""Mock storage adapter class.
Will be patched for testing purposes
"""
def store_entry(self, entry: dict):
"""Mock store_entry"""
pass
def store_response(self, response: dict):
"""Mock sto... | <commit_before>"""adapter
Mock storage adapter class for unit tests
"""
class MockStorageAdapter:
"""Mock storage adapter class.
Will be patched for testing purposes
"""
def store_entry(self, entry):
"""Mock store_entry"""
pass
def store_response(self, response):
"""Mock ... | """adapter
Mock storage adapter class for unit tests
"""
class MockStorageAdapter:
"""Mock storage adapter class.
Will be patched for testing purposes
"""
def store_entry(self, entry: dict):
"""Mock store_entry"""
pass
def store_response(self, response: dict):
"""Mock sto... | """adapter
Mock storage adapter class for unit tests
"""
class MockStorageAdapter:
"""Mock storage adapter class.
Will be patched for testing purposes
"""
def store_entry(self, entry):
"""Mock store_entry"""
pass
def store_response(self, response):
"""Mock store_response"... | <commit_before>"""adapter
Mock storage adapter class for unit tests
"""
class MockStorageAdapter:
"""Mock storage adapter class.
Will be patched for testing purposes
"""
def store_entry(self, entry):
"""Mock store_entry"""
pass
def store_response(self, response):
"""Mock ... |
915001e0e46fef2cf1e6b1c78614d0254b9db21e | backoff/_wait_gen.py | backoff/_wait_gen.py | # coding:utf-8
import itertools
def expo(base=2, factor=1, max_value=None):
"""Generator for exponential decay.
Args:
base: The mathematical base of the exponentiation operation
factor: Factor to multiply the exponentation by.
max_value: The maximum value to yield. Once the value in ... | # coding:utf-8
import itertools
def expo(base=2, factor=1, max_value=None):
"""Generator for exponential decay.
Args:
base: The mathematical base of the exponentiation operation
factor: Factor to multiply the exponentiation by.
max_value: The maximum value to yield. Once the value in... | Fix spelling of exponential in pydoc | Fix spelling of exponential in pydoc | Python | mit | litl/backoff | # coding:utf-8
import itertools
def expo(base=2, factor=1, max_value=None):
"""Generator for exponential decay.
Args:
base: The mathematical base of the exponentiation operation
factor: Factor to multiply the exponentation by.
max_value: The maximum value to yield. Once the value in ... | # coding:utf-8
import itertools
def expo(base=2, factor=1, max_value=None):
"""Generator for exponential decay.
Args:
base: The mathematical base of the exponentiation operation
factor: Factor to multiply the exponentiation by.
max_value: The maximum value to yield. Once the value in... | <commit_before># coding:utf-8
import itertools
def expo(base=2, factor=1, max_value=None):
"""Generator for exponential decay.
Args:
base: The mathematical base of the exponentiation operation
factor: Factor to multiply the exponentation by.
max_value: The maximum value to yield. Onc... | # coding:utf-8
import itertools
def expo(base=2, factor=1, max_value=None):
"""Generator for exponential decay.
Args:
base: The mathematical base of the exponentiation operation
factor: Factor to multiply the exponentiation by.
max_value: The maximum value to yield. Once the value in... | # coding:utf-8
import itertools
def expo(base=2, factor=1, max_value=None):
"""Generator for exponential decay.
Args:
base: The mathematical base of the exponentiation operation
factor: Factor to multiply the exponentation by.
max_value: The maximum value to yield. Once the value in ... | <commit_before># coding:utf-8
import itertools
def expo(base=2, factor=1, max_value=None):
"""Generator for exponential decay.
Args:
base: The mathematical base of the exponentiation operation
factor: Factor to multiply the exponentation by.
max_value: The maximum value to yield. Onc... |
32126085f361489bb5c9c18972479b0c313c7d10 | bash_runner/tasks.py | bash_runner/tasks.py | """
Cloudify plugin for running a simple bash script.
Operations:
start: Run a script
"""
from celery import task
from cosmo.events import send_event as send_riemann_event
from cloudify.utils import get_local_ip
get_ip = get_local_ip
send_event = send_riemann_event
@task
def start(__cloudify_id, port=8080, **... | """
Cloudify plugin for running a simple bash script.
Operations:
start: Run a script
"""
from celery import task
from cosmo.events import send_event as send_riemann_event
from cloudify.utils import get_local_ip
get_ip = get_local_ip
send_event = send_riemann_event
@task
def start(__cloudify_id, port=8080, **... | Send the output to a tmp file | Send the output to a tmp file
| Python | apache-2.0 | rantav/cosmo-plugin-bash-runner | """
Cloudify plugin for running a simple bash script.
Operations:
start: Run a script
"""
from celery import task
from cosmo.events import send_event as send_riemann_event
from cloudify.utils import get_local_ip
get_ip = get_local_ip
send_event = send_riemann_event
@task
def start(__cloudify_id, port=8080, **... | """
Cloudify plugin for running a simple bash script.
Operations:
start: Run a script
"""
from celery import task
from cosmo.events import send_event as send_riemann_event
from cloudify.utils import get_local_ip
get_ip = get_local_ip
send_event = send_riemann_event
@task
def start(__cloudify_id, port=8080, **... | <commit_before>"""
Cloudify plugin for running a simple bash script.
Operations:
start: Run a script
"""
from celery import task
from cosmo.events import send_event as send_riemann_event
from cloudify.utils import get_local_ip
get_ip = get_local_ip
send_event = send_riemann_event
@task
def start(__cloudify_id... | """
Cloudify plugin for running a simple bash script.
Operations:
start: Run a script
"""
from celery import task
from cosmo.events import send_event as send_riemann_event
from cloudify.utils import get_local_ip
get_ip = get_local_ip
send_event = send_riemann_event
@task
def start(__cloudify_id, port=8080, **... | """
Cloudify plugin for running a simple bash script.
Operations:
start: Run a script
"""
from celery import task
from cosmo.events import send_event as send_riemann_event
from cloudify.utils import get_local_ip
get_ip = get_local_ip
send_event = send_riemann_event
@task
def start(__cloudify_id, port=8080, **... | <commit_before>"""
Cloudify plugin for running a simple bash script.
Operations:
start: Run a script
"""
from celery import task
from cosmo.events import send_event as send_riemann_event
from cloudify.utils import get_local_ip
get_ip = get_local_ip
send_event = send_riemann_event
@task
def start(__cloudify_id... |
7c460a174b1c461c76d08161698ead77e1236f15 | redshirt/analyze.py | redshirt/analyze.py | import numpy as np
from scipy import ndimage as ndi
from skimage.filters import threshold_otsu
def _extract_roi(image, axis=-1):
max_frame = np.max(image, axis=axis)
initial_mask = max_frame > threshold_otsu(max_frame)
regions = ndi.label(initial_mask)[0]
region_sizes = np.bincount(np.ravel(regions))
... | import numpy as np
from scipy import ndimage as ndi
from skimage.filters import threshold_li
def _extract_roi(image, axis=-1):
max_frame = np.max(image, axis=axis)
initial_mask = max_frame > threshold_li(max_frame)
regions = ndi.label(initial_mask)[0]
region_sizes = np.bincount(np.ravel(regions))
... | Use Li method for thresholding instead of Otsu | Use Li method for thresholding instead of Otsu
| Python | mit | jni/python-redshirt | import numpy as np
from scipy import ndimage as ndi
from skimage.filters import threshold_otsu
def _extract_roi(image, axis=-1):
max_frame = np.max(image, axis=axis)
initial_mask = max_frame > threshold_otsu(max_frame)
regions = ndi.label(initial_mask)[0]
region_sizes = np.bincount(np.ravel(regions))
... | import numpy as np
from scipy import ndimage as ndi
from skimage.filters import threshold_li
def _extract_roi(image, axis=-1):
max_frame = np.max(image, axis=axis)
initial_mask = max_frame > threshold_li(max_frame)
regions = ndi.label(initial_mask)[0]
region_sizes = np.bincount(np.ravel(regions))
... | <commit_before>import numpy as np
from scipy import ndimage as ndi
from skimage.filters import threshold_otsu
def _extract_roi(image, axis=-1):
max_frame = np.max(image, axis=axis)
initial_mask = max_frame > threshold_otsu(max_frame)
regions = ndi.label(initial_mask)[0]
region_sizes = np.bincount(np.r... | import numpy as np
from scipy import ndimage as ndi
from skimage.filters import threshold_li
def _extract_roi(image, axis=-1):
max_frame = np.max(image, axis=axis)
initial_mask = max_frame > threshold_li(max_frame)
regions = ndi.label(initial_mask)[0]
region_sizes = np.bincount(np.ravel(regions))
... | import numpy as np
from scipy import ndimage as ndi
from skimage.filters import threshold_otsu
def _extract_roi(image, axis=-1):
max_frame = np.max(image, axis=axis)
initial_mask = max_frame > threshold_otsu(max_frame)
regions = ndi.label(initial_mask)[0]
region_sizes = np.bincount(np.ravel(regions))
... | <commit_before>import numpy as np
from scipy import ndimage as ndi
from skimage.filters import threshold_otsu
def _extract_roi(image, axis=-1):
max_frame = np.max(image, axis=axis)
initial_mask = max_frame > threshold_otsu(max_frame)
regions = ndi.label(initial_mask)[0]
region_sizes = np.bincount(np.r... |
637651e572d9bcd4049ad5351f7fde1869c6823a | onadata/libs/authentication.py | onadata/libs/authentication.py | from django.utils.translation import ugettext as _
from django_digest import HttpDigestAuthenticator
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header,
BasicAuthentication)
from rest_framework.exceptions import AuthenticationFailed
class DigestAuthentication(BaseAuthenti... | from django.conf import settings
from django.utils.translation import ugettext as _
from django_digest import HttpDigestAuthenticator
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header,
BasicAuthentication)
from rest_framework.exceptions import AuthenticationFailed
class ... | Allow HTTP auth during tests | Allow HTTP auth during tests
| Python | bsd-2-clause | kobotoolbox/kobocat,kobotoolbox/kobocat,kobotoolbox/kobocat,kobotoolbox/kobocat | from django.utils.translation import ugettext as _
from django_digest import HttpDigestAuthenticator
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header,
BasicAuthentication)
from rest_framework.exceptions import AuthenticationFailed
class DigestAuthentication(BaseAuthenti... | from django.conf import settings
from django.utils.translation import ugettext as _
from django_digest import HttpDigestAuthenticator
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header,
BasicAuthentication)
from rest_framework.exceptions import AuthenticationFailed
class ... | <commit_before>from django.utils.translation import ugettext as _
from django_digest import HttpDigestAuthenticator
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header,
BasicAuthentication)
from rest_framework.exceptions import AuthenticationFailed
class DigestAuthenticati... | from django.conf import settings
from django.utils.translation import ugettext as _
from django_digest import HttpDigestAuthenticator
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header,
BasicAuthentication)
from rest_framework.exceptions import AuthenticationFailed
class ... | from django.utils.translation import ugettext as _
from django_digest import HttpDigestAuthenticator
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header,
BasicAuthentication)
from rest_framework.exceptions import AuthenticationFailed
class DigestAuthentication(BaseAuthenti... | <commit_before>from django.utils.translation import ugettext as _
from django_digest import HttpDigestAuthenticator
from rest_framework.authentication import (
BaseAuthentication, get_authorization_header,
BasicAuthentication)
from rest_framework.exceptions import AuthenticationFailed
class DigestAuthenticati... |
c5096a3370ad9b4fff428580e1b3c0c7de1399ce | scripts/set_ports.py | scripts/set_ports.py | #!/usr/bin/env python -B
from optparse import OptionParser
import inspect
import json
import os
def get_port_mappings(container):
script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
container_id = os.popen('cat %s/../containers/%s/host.id' % (script_dir, container)).read().strip... | #!/usr/bin/env python -B
from optparse import OptionParser
import inspect
import json
import os
container_id=None
def get_port_mappings(container):
global container_id
script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
container_id = os.popen('cat %s/../containers/%s/host.id'... | Set container_id and ext_ip container serf tags. | Set container_id and ext_ip container serf tags.
| Python | apache-2.0 | johanatan/datt-metadatt,johanatan/datt-metadatt,dattlabs/datt-metadatt,johanatan/datt-metadatt,johanatan/datt-metadatt,dattlabs/datt-metadatt,dattlabs/datt-metadatt,dattlabs/datt-metadatt | #!/usr/bin/env python -B
from optparse import OptionParser
import inspect
import json
import os
def get_port_mappings(container):
script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
container_id = os.popen('cat %s/../containers/%s/host.id' % (script_dir, container)).read().strip... | #!/usr/bin/env python -B
from optparse import OptionParser
import inspect
import json
import os
container_id=None
def get_port_mappings(container):
global container_id
script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
container_id = os.popen('cat %s/../containers/%s/host.id'... | <commit_before>#!/usr/bin/env python -B
from optparse import OptionParser
import inspect
import json
import os
def get_port_mappings(container):
script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
container_id = os.popen('cat %s/../containers/%s/host.id' % (script_dir, container... | #!/usr/bin/env python -B
from optparse import OptionParser
import inspect
import json
import os
container_id=None
def get_port_mappings(container):
global container_id
script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
container_id = os.popen('cat %s/../containers/%s/host.id'... | #!/usr/bin/env python -B
from optparse import OptionParser
import inspect
import json
import os
def get_port_mappings(container):
script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
container_id = os.popen('cat %s/../containers/%s/host.id' % (script_dir, container)).read().strip... | <commit_before>#!/usr/bin/env python -B
from optparse import OptionParser
import inspect
import json
import os
def get_port_mappings(container):
script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
container_id = os.popen('cat %s/../containers/%s/host.id' % (script_dir, container... |
aa11d654d59dc604fa71b2e73a56338aff7a23e7 | pymake/setup.py | pymake/setup.py | """cppmake auto-generates a big CMake file from C++ headers
"""
import setuptools
description = "Python Super CMake"
setuptools.setup(
name='generate_cmake',
version='1.8.0',
license='MIT',
long_description=__doc__,
url='https://github.com/jpanikulam/experiments/tree/master/pymake',
author='Ja... | """cppmake auto-generates a big CMake file from C++ headers
"""
import setuptools
description = "Python Super CMake"
setuptools.setup(
name='generate_cmake',
version='1.8.1',
license='MIT',
long_description=__doc__,
url='https://github.com/jpanikulam/experiments/tree/master/pymake',
author='Ja... | Update pymake version and post twine | Update pymake version and post twine
| Python | mit | jpanikulam/experiments,jpanikulam/experiments,jpanikulam/experiments,jpanikulam/experiments | """cppmake auto-generates a big CMake file from C++ headers
"""
import setuptools
description = "Python Super CMake"
setuptools.setup(
name='generate_cmake',
version='1.8.0',
license='MIT',
long_description=__doc__,
url='https://github.com/jpanikulam/experiments/tree/master/pymake',
author='Ja... | """cppmake auto-generates a big CMake file from C++ headers
"""
import setuptools
description = "Python Super CMake"
setuptools.setup(
name='generate_cmake',
version='1.8.1',
license='MIT',
long_description=__doc__,
url='https://github.com/jpanikulam/experiments/tree/master/pymake',
author='Ja... | <commit_before>"""cppmake auto-generates a big CMake file from C++ headers
"""
import setuptools
description = "Python Super CMake"
setuptools.setup(
name='generate_cmake',
version='1.8.0',
license='MIT',
long_description=__doc__,
url='https://github.com/jpanikulam/experiments/tree/master/pymake',... | """cppmake auto-generates a big CMake file from C++ headers
"""
import setuptools
description = "Python Super CMake"
setuptools.setup(
name='generate_cmake',
version='1.8.1',
license='MIT',
long_description=__doc__,
url='https://github.com/jpanikulam/experiments/tree/master/pymake',
author='Ja... | """cppmake auto-generates a big CMake file from C++ headers
"""
import setuptools
description = "Python Super CMake"
setuptools.setup(
name='generate_cmake',
version='1.8.0',
license='MIT',
long_description=__doc__,
url='https://github.com/jpanikulam/experiments/tree/master/pymake',
author='Ja... | <commit_before>"""cppmake auto-generates a big CMake file from C++ headers
"""
import setuptools
description = "Python Super CMake"
setuptools.setup(
name='generate_cmake',
version='1.8.0',
license='MIT',
long_description=__doc__,
url='https://github.com/jpanikulam/experiments/tree/master/pymake',... |
2ab41930077dec805388bef4c5c8f67912240709 | templation/models.py | templation/models.py | # -*- coding: utf-8 -*-
import os.path
from django.db import models
from django.conf import settings
from django.db.models.signals import post_save
from django.utils.translation import ugettext_lazy as _
from .settings import DAV_ROOT, PROVIDER_NAME, RESOURCE_MODEL, RESOURCE_ACCESS_MODEL_INITIALIZER
class AbstractRes... | # -*- coding: utf-8 -*-
import os.path
from django.db import models
from django.conf import settings
from django.db.models.signals import post_save
from django.utils.translation import ugettext_lazy as _
from .settings import DAV_ROOT, PROVIDER_NAME, RESOURCE_MODEL, RESOURCE_ACCESS_MODEL_INITIALIZER
class AbstractRes... | Initialize folder only at creation | Initialize folder only at creation
| Python | bsd-3-clause | qdqmedia/django-templation,qdqmedia/django-templation,qdqmedia/django-templation | # -*- coding: utf-8 -*-
import os.path
from django.db import models
from django.conf import settings
from django.db.models.signals import post_save
from django.utils.translation import ugettext_lazy as _
from .settings import DAV_ROOT, PROVIDER_NAME, RESOURCE_MODEL, RESOURCE_ACCESS_MODEL_INITIALIZER
class AbstractRes... | # -*- coding: utf-8 -*-
import os.path
from django.db import models
from django.conf import settings
from django.db.models.signals import post_save
from django.utils.translation import ugettext_lazy as _
from .settings import DAV_ROOT, PROVIDER_NAME, RESOURCE_MODEL, RESOURCE_ACCESS_MODEL_INITIALIZER
class AbstractRes... | <commit_before># -*- coding: utf-8 -*-
import os.path
from django.db import models
from django.conf import settings
from django.db.models.signals import post_save
from django.utils.translation import ugettext_lazy as _
from .settings import DAV_ROOT, PROVIDER_NAME, RESOURCE_MODEL, RESOURCE_ACCESS_MODEL_INITIALIZER
cl... | # -*- coding: utf-8 -*-
import os.path
from django.db import models
from django.conf import settings
from django.db.models.signals import post_save
from django.utils.translation import ugettext_lazy as _
from .settings import DAV_ROOT, PROVIDER_NAME, RESOURCE_MODEL, RESOURCE_ACCESS_MODEL_INITIALIZER
class AbstractRes... | # -*- coding: utf-8 -*-
import os.path
from django.db import models
from django.conf import settings
from django.db.models.signals import post_save
from django.utils.translation import ugettext_lazy as _
from .settings import DAV_ROOT, PROVIDER_NAME, RESOURCE_MODEL, RESOURCE_ACCESS_MODEL_INITIALIZER
class AbstractRes... | <commit_before># -*- coding: utf-8 -*-
import os.path
from django.db import models
from django.conf import settings
from django.db.models.signals import post_save
from django.utils.translation import ugettext_lazy as _
from .settings import DAV_ROOT, PROVIDER_NAME, RESOURCE_MODEL, RESOURCE_ACCESS_MODEL_INITIALIZER
cl... |
aedabe987e6ce93d61ed7707f0ebdc874b60fa1b | libtmux/__about__.py | libtmux/__about__.py | __title__ = 'libtmux'
__package_name__ = 'libtmux'
__version__ = '0.8.1'
__description__ = 'scripting library / orm for tmux'
__email__ = '[email protected]'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/libtmux'
__pypi__ = 'https://pypi.org/project/libtmux/'
__license__ = 'MIT'
__copyright__... | __title__ = 'libtmux'
__package_name__ = 'libtmux'
__version__ = '0.8.1'
__description__ = 'scripting library / orm for tmux'
__email__ = '[email protected]'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/libtmux'
__docs__ = 'https://libtmux.git-pull.com'
__tracker__ = 'https://github.com/tmux... | Add docs and issue tracker to metadata | Add docs and issue tracker to metadata
| Python | bsd-3-clause | tony/libtmux | __title__ = 'libtmux'
__package_name__ = 'libtmux'
__version__ = '0.8.1'
__description__ = 'scripting library / orm for tmux'
__email__ = '[email protected]'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/libtmux'
__pypi__ = 'https://pypi.org/project/libtmux/'
__license__ = 'MIT'
__copyright__... | __title__ = 'libtmux'
__package_name__ = 'libtmux'
__version__ = '0.8.1'
__description__ = 'scripting library / orm for tmux'
__email__ = '[email protected]'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/libtmux'
__docs__ = 'https://libtmux.git-pull.com'
__tracker__ = 'https://github.com/tmux... | <commit_before>__title__ = 'libtmux'
__package_name__ = 'libtmux'
__version__ = '0.8.1'
__description__ = 'scripting library / orm for tmux'
__email__ = '[email protected]'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/libtmux'
__pypi__ = 'https://pypi.org/project/libtmux/'
__license__ = 'MIT... | __title__ = 'libtmux'
__package_name__ = 'libtmux'
__version__ = '0.8.1'
__description__ = 'scripting library / orm for tmux'
__email__ = '[email protected]'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/libtmux'
__docs__ = 'https://libtmux.git-pull.com'
__tracker__ = 'https://github.com/tmux... | __title__ = 'libtmux'
__package_name__ = 'libtmux'
__version__ = '0.8.1'
__description__ = 'scripting library / orm for tmux'
__email__ = '[email protected]'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/libtmux'
__pypi__ = 'https://pypi.org/project/libtmux/'
__license__ = 'MIT'
__copyright__... | <commit_before>__title__ = 'libtmux'
__package_name__ = 'libtmux'
__version__ = '0.8.1'
__description__ = 'scripting library / orm for tmux'
__email__ = '[email protected]'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/libtmux'
__pypi__ = 'https://pypi.org/project/libtmux/'
__license__ = 'MIT... |
2de494810b73dd69c6b4bb87e87007291309d573 | lightstep/util.py | lightstep/util.py | """ Utility functions
"""
import random
import time
from . import constants
def _service_url_from_hostport(secure, host, port):
"""
Create an appropriate service URL given the parameters.
`secure` should be a bool.
"""
if secure:
protocol = 'https://'
else:
protocol = 'http://'... | """ Utility functions
"""
import random
import time
from . import constants
def _service_url_from_hostport(secure, host, port):
"""
Create an appropriate service URL given the parameters.
`secure` should be a bool.
"""
if secure:
protocol = 'https://'
else:
protocol = 'http://'... | Fix _time_to_micros bug. It was calling time.time() when it should use its own argument. | Fix _time_to_micros bug. It was calling time.time() when it should use its own argument.
| Python | mit | lightstephq/lightstep-tracer-python | """ Utility functions
"""
import random
import time
from . import constants
def _service_url_from_hostport(secure, host, port):
"""
Create an appropriate service URL given the parameters.
`secure` should be a bool.
"""
if secure:
protocol = 'https://'
else:
protocol = 'http://'... | """ Utility functions
"""
import random
import time
from . import constants
def _service_url_from_hostport(secure, host, port):
"""
Create an appropriate service URL given the parameters.
`secure` should be a bool.
"""
if secure:
protocol = 'https://'
else:
protocol = 'http://'... | <commit_before>""" Utility functions
"""
import random
import time
from . import constants
def _service_url_from_hostport(secure, host, port):
"""
Create an appropriate service URL given the parameters.
`secure` should be a bool.
"""
if secure:
protocol = 'https://'
else:
proto... | """ Utility functions
"""
import random
import time
from . import constants
def _service_url_from_hostport(secure, host, port):
"""
Create an appropriate service URL given the parameters.
`secure` should be a bool.
"""
if secure:
protocol = 'https://'
else:
protocol = 'http://'... | """ Utility functions
"""
import random
import time
from . import constants
def _service_url_from_hostport(secure, host, port):
"""
Create an appropriate service URL given the parameters.
`secure` should be a bool.
"""
if secure:
protocol = 'https://'
else:
protocol = 'http://'... | <commit_before>""" Utility functions
"""
import random
import time
from . import constants
def _service_url_from_hostport(secure, host, port):
"""
Create an appropriate service URL given the parameters.
`secure` should be a bool.
"""
if secure:
protocol = 'https://'
else:
proto... |
7278f68b18f8cee3f9a78e1265df0994a23254bc | mamba/__init__.py | mamba/__init__.py | from mamba.loader import describe, context
from mamba.hooks import before, after
from mamba.decorators import skip
__all__ = [describe, context, before, after, skip]
| from mamba.loader import describe, context
from mamba.hooks import before, after
from mamba.decorators import skip
__all__ = ['describe', 'context', 'before', 'after', 'skip']
| Fix the import all mamba error | Fix the import all mamba error
| Python | mit | nestorsalceda/mamba,markng/mamba,alejandrodob/mamba,dex4er/mamba,angelsanz/mamba,jaimegildesagredo/mamba,eferro/mamba | from mamba.loader import describe, context
from mamba.hooks import before, after
from mamba.decorators import skip
__all__ = [describe, context, before, after, skip]
Fix the import all mamba error | from mamba.loader import describe, context
from mamba.hooks import before, after
from mamba.decorators import skip
__all__ = ['describe', 'context', 'before', 'after', 'skip']
| <commit_before>from mamba.loader import describe, context
from mamba.hooks import before, after
from mamba.decorators import skip
__all__ = [describe, context, before, after, skip]
<commit_msg>Fix the import all mamba error<commit_after> | from mamba.loader import describe, context
from mamba.hooks import before, after
from mamba.decorators import skip
__all__ = ['describe', 'context', 'before', 'after', 'skip']
| from mamba.loader import describe, context
from mamba.hooks import before, after
from mamba.decorators import skip
__all__ = [describe, context, before, after, skip]
Fix the import all mamba errorfrom mamba.loader import describe, context
from mamba.hooks import before, after
from mamba.decorators import skip
__all__... | <commit_before>from mamba.loader import describe, context
from mamba.hooks import before, after
from mamba.decorators import skip
__all__ = [describe, context, before, after, skip]
<commit_msg>Fix the import all mamba error<commit_after>from mamba.loader import describe, context
from mamba.hooks import before, after
f... |
ec8d7181be646498717b8efa97dd6770d61f067a | test/viz/test_pca.py | test/viz/test_pca.py |
def test_pca():
from sequana.viz.pca import PCA
from sequana import sequana_data
import pandas as pd
data = sequana_data("test_pca.csv")
df = pd.read_csv(data)
df = df.set_index("Id")
p = PCA(df, colors={
"A1": 'r', "A2": 'r', 'A3': 'r',
"B1": 'b', "B2": 'b', 'B3': 'b'})
... |
import pytest
@pytest.mark.timeout(10)
def test_pca():
from sequana.viz.pca import PCA
from sequana import sequana_data
import pandas as pd
data = sequana_data("test_pca.csv")
df = pd.read_csv(data)
df = df.set_index("Id")
p = PCA(df, colors={
"A1": 'r', "A2": 'r', 'A3': 'r',
... | Set timeout on pca test | Set timeout on pca test
| Python | bsd-3-clause | sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana |
def test_pca():
from sequana.viz.pca import PCA
from sequana import sequana_data
import pandas as pd
data = sequana_data("test_pca.csv")
df = pd.read_csv(data)
df = df.set_index("Id")
p = PCA(df, colors={
"A1": 'r', "A2": 'r', 'A3': 'r',
"B1": 'b', "B2": 'b', 'B3': 'b'})
... |
import pytest
@pytest.mark.timeout(10)
def test_pca():
from sequana.viz.pca import PCA
from sequana import sequana_data
import pandas as pd
data = sequana_data("test_pca.csv")
df = pd.read_csv(data)
df = df.set_index("Id")
p = PCA(df, colors={
"A1": 'r', "A2": 'r', 'A3': 'r',
... | <commit_before>
def test_pca():
from sequana.viz.pca import PCA
from sequana import sequana_data
import pandas as pd
data = sequana_data("test_pca.csv")
df = pd.read_csv(data)
df = df.set_index("Id")
p = PCA(df, colors={
"A1": 'r', "A2": 'r', 'A3': 'r',
"B1": 'b', "B2": 'b'... |
import pytest
@pytest.mark.timeout(10)
def test_pca():
from sequana.viz.pca import PCA
from sequana import sequana_data
import pandas as pd
data = sequana_data("test_pca.csv")
df = pd.read_csv(data)
df = df.set_index("Id")
p = PCA(df, colors={
"A1": 'r', "A2": 'r', 'A3': 'r',
... |
def test_pca():
from sequana.viz.pca import PCA
from sequana import sequana_data
import pandas as pd
data = sequana_data("test_pca.csv")
df = pd.read_csv(data)
df = df.set_index("Id")
p = PCA(df, colors={
"A1": 'r', "A2": 'r', 'A3': 'r',
"B1": 'b', "B2": 'b', 'B3': 'b'})
... | <commit_before>
def test_pca():
from sequana.viz.pca import PCA
from sequana import sequana_data
import pandas as pd
data = sequana_data("test_pca.csv")
df = pd.read_csv(data)
df = df.set_index("Id")
p = PCA(df, colors={
"A1": 'r', "A2": 'r', 'A3': 'r',
"B1": 'b', "B2": 'b'... |
a7ece0bd59b63455d26efbc927df7dc5607ce55b | tests/test_player.py | tests/test_player.py | import unittest
from pypoker import Player
from pypoker import Table
class PlayerTestCase(unittest.TestCase):
'''
Tests for the Player class
'''
def setUp(self):
self.player = Player('usman', 1000, None)
def test_player_initialization(self):
self.assertEqual([self.player.player_name,... | import unittest
from pypoker import Player
from pypoker import Table
class PlayerTestCase(unittest.TestCase):
'''
Tests for the Player class
'''
def setUp(self):
self.player = Player('usman', 1000, None)
self.table = Table(50,100,2,10,100,1000)
self.table.add_player('bob',1000)... | Add unit tests for functions call and check and fold for module player | Add unit tests for functions call and check and fold for module player
| Python | mit | ueg1990/pypoker | import unittest
from pypoker import Player
from pypoker import Table
class PlayerTestCase(unittest.TestCase):
'''
Tests for the Player class
'''
def setUp(self):
self.player = Player('usman', 1000, None)
def test_player_initialization(self):
self.assertEqual([self.player.player_name,... | import unittest
from pypoker import Player
from pypoker import Table
class PlayerTestCase(unittest.TestCase):
'''
Tests for the Player class
'''
def setUp(self):
self.player = Player('usman', 1000, None)
self.table = Table(50,100,2,10,100,1000)
self.table.add_player('bob',1000)... | <commit_before>import unittest
from pypoker import Player
from pypoker import Table
class PlayerTestCase(unittest.TestCase):
'''
Tests for the Player class
'''
def setUp(self):
self.player = Player('usman', 1000, None)
def test_player_initialization(self):
self.assertEqual([self.play... | import unittest
from pypoker import Player
from pypoker import Table
class PlayerTestCase(unittest.TestCase):
'''
Tests for the Player class
'''
def setUp(self):
self.player = Player('usman', 1000, None)
self.table = Table(50,100,2,10,100,1000)
self.table.add_player('bob',1000)... | import unittest
from pypoker import Player
from pypoker import Table
class PlayerTestCase(unittest.TestCase):
'''
Tests for the Player class
'''
def setUp(self):
self.player = Player('usman', 1000, None)
def test_player_initialization(self):
self.assertEqual([self.player.player_name,... | <commit_before>import unittest
from pypoker import Player
from pypoker import Table
class PlayerTestCase(unittest.TestCase):
'''
Tests for the Player class
'''
def setUp(self):
self.player = Player('usman', 1000, None)
def test_player_initialization(self):
self.assertEqual([self.play... |
7bed531fcbc63de25572a6b02fb8b19bd066fa50 | test_pearhash.py | test_pearhash.py | import unittest
from pearhash import PearsonHasher
class TestPearsonHasher(unittest.TestCase):
def test_table_is_a_permutation_of_range_256(self):
hasher = PearsonHasher(2)
self.assertEqual(set(hasher.table), set(range(256)))
| import unittest
from pearhash import PearsonHasher
class TestPearsonHasher(unittest.TestCase):
def test_table_is_a_permutation_of_range_256(self):
hasher = PearsonHasher(2)
self.assertEqual(set(hasher.table), set(range(256)))
def test_two_bytes(self):
hasher = PearsonHasher(2)
self.assertEqual(hasher.ha... | Add a few trivial tests | Add a few trivial tests
| Python | mit | ze-phyr-us/pearhash | import unittest
from pearhash import PearsonHasher
class TestPearsonHasher(unittest.TestCase):
def test_table_is_a_permutation_of_range_256(self):
hasher = PearsonHasher(2)
self.assertEqual(set(hasher.table), set(range(256)))
Add a few trivial tests | import unittest
from pearhash import PearsonHasher
class TestPearsonHasher(unittest.TestCase):
def test_table_is_a_permutation_of_range_256(self):
hasher = PearsonHasher(2)
self.assertEqual(set(hasher.table), set(range(256)))
def test_two_bytes(self):
hasher = PearsonHasher(2)
self.assertEqual(hasher.ha... | <commit_before>import unittest
from pearhash import PearsonHasher
class TestPearsonHasher(unittest.TestCase):
def test_table_is_a_permutation_of_range_256(self):
hasher = PearsonHasher(2)
self.assertEqual(set(hasher.table), set(range(256)))
<commit_msg>Add a few trivial tests<commit_after> | import unittest
from pearhash import PearsonHasher
class TestPearsonHasher(unittest.TestCase):
def test_table_is_a_permutation_of_range_256(self):
hasher = PearsonHasher(2)
self.assertEqual(set(hasher.table), set(range(256)))
def test_two_bytes(self):
hasher = PearsonHasher(2)
self.assertEqual(hasher.ha... | import unittest
from pearhash import PearsonHasher
class TestPearsonHasher(unittest.TestCase):
def test_table_is_a_permutation_of_range_256(self):
hasher = PearsonHasher(2)
self.assertEqual(set(hasher.table), set(range(256)))
Add a few trivial testsimport unittest
from pearhash import PearsonHasher
class Te... | <commit_before>import unittest
from pearhash import PearsonHasher
class TestPearsonHasher(unittest.TestCase):
def test_table_is_a_permutation_of_range_256(self):
hasher = PearsonHasher(2)
self.assertEqual(set(hasher.table), set(range(256)))
<commit_msg>Add a few trivial tests<commit_after>import unittest
from ... |
44de3c76421a2ed4917ac7f2c6798dec631650a8 | spacy/tests/regression/test_issue834.py | spacy/tests/regression/test_issue834.py | # coding: utf-8
from __future__ import unicode_literals
from io import StringIO
import pytest
word2vec_str = """, -0.046107 -0.035951 -0.560418
de -0.648927 -0.400976 -0.527124
. 0.113685 0.439990 -0.634510
-1.499184 -0.184280 -0.598371"""
@pytest.mark.xfail
def test_issue834(en_vocab):
f = StringIO(word2vec_... | # coding: utf-8
from __future__ import unicode_literals
word2vec_str = """, -0.046107 -0.035951 -0.560418
de -0.648927 -0.400976 -0.527124
. 0.113685 0.439990 -0.634510
\u00A0 -1.499184 -0.184280 -0.598371"""
def test_issue834(en_vocab, text_file):
"""Test that no-break space (U+00A0) is detected as space by th... | Reformat test and use text_file fixture | Reformat test and use text_file fixture
| Python | mit | spacy-io/spaCy,raphael0202/spaCy,explosion/spaCy,explosion/spaCy,oroszgy/spaCy.hu,honnibal/spaCy,banglakit/spaCy,spacy-io/spaCy,explosion/spaCy,aikramer2/spaCy,banglakit/spaCy,oroszgy/spaCy.hu,honnibal/spaCy,raphael0202/spaCy,Gregory-Howard/spaCy,banglakit/spaCy,aikramer2/spaCy,recognai/spaCy,spacy-io/spaCy,Gregory-How... | # coding: utf-8
from __future__ import unicode_literals
from io import StringIO
import pytest
word2vec_str = """, -0.046107 -0.035951 -0.560418
de -0.648927 -0.400976 -0.527124
. 0.113685 0.439990 -0.634510
-1.499184 -0.184280 -0.598371"""
@pytest.mark.xfail
def test_issue834(en_vocab):
f = StringIO(word2vec_... | # coding: utf-8
from __future__ import unicode_literals
word2vec_str = """, -0.046107 -0.035951 -0.560418
de -0.648927 -0.400976 -0.527124
. 0.113685 0.439990 -0.634510
\u00A0 -1.499184 -0.184280 -0.598371"""
def test_issue834(en_vocab, text_file):
"""Test that no-break space (U+00A0) is detected as space by th... | <commit_before># coding: utf-8
from __future__ import unicode_literals
from io import StringIO
import pytest
word2vec_str = """, -0.046107 -0.035951 -0.560418
de -0.648927 -0.400976 -0.527124
. 0.113685 0.439990 -0.634510
-1.499184 -0.184280 -0.598371"""
@pytest.mark.xfail
def test_issue834(en_vocab):
f = Str... | # coding: utf-8
from __future__ import unicode_literals
word2vec_str = """, -0.046107 -0.035951 -0.560418
de -0.648927 -0.400976 -0.527124
. 0.113685 0.439990 -0.634510
\u00A0 -1.499184 -0.184280 -0.598371"""
def test_issue834(en_vocab, text_file):
"""Test that no-break space (U+00A0) is detected as space by th... | # coding: utf-8
from __future__ import unicode_literals
from io import StringIO
import pytest
word2vec_str = """, -0.046107 -0.035951 -0.560418
de -0.648927 -0.400976 -0.527124
. 0.113685 0.439990 -0.634510
-1.499184 -0.184280 -0.598371"""
@pytest.mark.xfail
def test_issue834(en_vocab):
f = StringIO(word2vec_... | <commit_before># coding: utf-8
from __future__ import unicode_literals
from io import StringIO
import pytest
word2vec_str = """, -0.046107 -0.035951 -0.560418
de -0.648927 -0.400976 -0.527124
. 0.113685 0.439990 -0.634510
-1.499184 -0.184280 -0.598371"""
@pytest.mark.xfail
def test_issue834(en_vocab):
f = Str... |
042791f62619a4a8694df91dc8d03f0ba4460bc2 | mineserver.py | mineserver.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is the new base initialization layer for Mineserver.
# Always call this instead of server_core.py.
from __future__ import print_function
from server_core.server import *
import sys
main(sys.argv[1:]) | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is the new base initialization layer for Mineserver.
# Always call this instead of server_core/server.py
from __future__ import print_function
from server_core.server import *
import sys
main(sys.argv[1:]) | Fix a misleading and confusing outdated typo in base layer. | Fix a misleading and confusing outdated typo in base layer.
| Python | mit | TiberiumPY/puremine,Armored-Dragon/pymineserver | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is the new base initialization layer for Mineserver.
# Always call this instead of server_core.py.
from __future__ import print_function
from server_core.server import *
import sys
main(sys.argv[1:])Fix a misleading and confusing outdated typo in base layer. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is the new base initialization layer for Mineserver.
# Always call this instead of server_core/server.py
from __future__ import print_function
from server_core.server import *
import sys
main(sys.argv[1:]) | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is the new base initialization layer for Mineserver.
# Always call this instead of server_core.py.
from __future__ import print_function
from server_core.server import *
import sys
main(sys.argv[1:])<commit_msg>Fix a misleading and confusing outdated... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is the new base initialization layer for Mineserver.
# Always call this instead of server_core/server.py
from __future__ import print_function
from server_core.server import *
import sys
main(sys.argv[1:]) | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is the new base initialization layer for Mineserver.
# Always call this instead of server_core.py.
from __future__ import print_function
from server_core.server import *
import sys
main(sys.argv[1:])Fix a misleading and confusing outdated typo in base layer.#!/usr/... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is the new base initialization layer for Mineserver.
# Always call this instead of server_core.py.
from __future__ import print_function
from server_core.server import *
import sys
main(sys.argv[1:])<commit_msg>Fix a misleading and confusing outdated... |
cdbb9e8bcffc4c5ba47791b81782df4a07273b6b | Lib/test/test_file.py | Lib/test/test_file.py | from test_support import TESTFN
from UserList import UserList
# verify writelines with instance sequence
l = UserList(['1', '2'])
f = open(TESTFN, 'wb')
f.writelines(l)
f.close()
f = open(TESTFN, 'rb')
buf = f.read()
f.close()
assert buf == '12'
# verify writelines with integers
f = open(TESTFN, 'wb')
try:
f.writ... | import os
from test_support import TESTFN
from UserList import UserList
# verify writelines with instance sequence
l = UserList(['1', '2'])
f = open(TESTFN, 'wb')
f.writelines(l)
f.close()
f = open(TESTFN, 'rb')
buf = f.read()
f.close()
assert buf == '12'
# verify writelines with integers
f = open(TESTFN, 'wb')
try:... | Clean up the temporary file when done with it. | Clean up the temporary file when done with it.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | from test_support import TESTFN
from UserList import UserList
# verify writelines with instance sequence
l = UserList(['1', '2'])
f = open(TESTFN, 'wb')
f.writelines(l)
f.close()
f = open(TESTFN, 'rb')
buf = f.read()
f.close()
assert buf == '12'
# verify writelines with integers
f = open(TESTFN, 'wb')
try:
f.writ... | import os
from test_support import TESTFN
from UserList import UserList
# verify writelines with instance sequence
l = UserList(['1', '2'])
f = open(TESTFN, 'wb')
f.writelines(l)
f.close()
f = open(TESTFN, 'rb')
buf = f.read()
f.close()
assert buf == '12'
# verify writelines with integers
f = open(TESTFN, 'wb')
try:... | <commit_before>from test_support import TESTFN
from UserList import UserList
# verify writelines with instance sequence
l = UserList(['1', '2'])
f = open(TESTFN, 'wb')
f.writelines(l)
f.close()
f = open(TESTFN, 'rb')
buf = f.read()
f.close()
assert buf == '12'
# verify writelines with integers
f = open(TESTFN, 'wb')
... | import os
from test_support import TESTFN
from UserList import UserList
# verify writelines with instance sequence
l = UserList(['1', '2'])
f = open(TESTFN, 'wb')
f.writelines(l)
f.close()
f = open(TESTFN, 'rb')
buf = f.read()
f.close()
assert buf == '12'
# verify writelines with integers
f = open(TESTFN, 'wb')
try:... | from test_support import TESTFN
from UserList import UserList
# verify writelines with instance sequence
l = UserList(['1', '2'])
f = open(TESTFN, 'wb')
f.writelines(l)
f.close()
f = open(TESTFN, 'rb')
buf = f.read()
f.close()
assert buf == '12'
# verify writelines with integers
f = open(TESTFN, 'wb')
try:
f.writ... | <commit_before>from test_support import TESTFN
from UserList import UserList
# verify writelines with instance sequence
l = UserList(['1', '2'])
f = open(TESTFN, 'wb')
f.writelines(l)
f.close()
f = open(TESTFN, 'rb')
buf = f.read()
f.close()
assert buf == '12'
# verify writelines with integers
f = open(TESTFN, 'wb')
... |
be1904cdbea85fa53b1a324449bd42aab320e185 | config/interface.py | config/interface.py | import importlib
def get_specifications(name):
"""Return a datasource specification file according to the following pattern:\n\
datasource_<name>.py
where <name> is the datasource identifier (e.g. "fmi", "mch", "bom", etc.)
"""
datasoruce_name = ".datasource_%s" % name
return... | import importlib
def get_specifications(name):
"""Return a datasource specification file according to the following pattern:\n\
datasource_<name>.py
where <name> is the datasource identifier (e.g. "fmi", "mch", "bom", etc.)
"""
datasource_name = ".datasource_%s" % name
return... | Correct a typo in variable name | Correct a typo in variable name
| Python | bsd-3-clause | pySTEPS/pysteps | import importlib
def get_specifications(name):
"""Return a datasource specification file according to the following pattern:\n\
datasource_<name>.py
where <name> is the datasource identifier (e.g. "fmi", "mch", "bom", etc.)
"""
datasoruce_name = ".datasource_%s" % name
return... | import importlib
def get_specifications(name):
"""Return a datasource specification file according to the following pattern:\n\
datasource_<name>.py
where <name> is the datasource identifier (e.g. "fmi", "mch", "bom", etc.)
"""
datasource_name = ".datasource_%s" % name
return... | <commit_before>import importlib
def get_specifications(name):
"""Return a datasource specification file according to the following pattern:\n\
datasource_<name>.py
where <name> is the datasource identifier (e.g. "fmi", "mch", "bom", etc.)
"""
datasoruce_name = ".datasource_%s" % ... | import importlib
def get_specifications(name):
"""Return a datasource specification file according to the following pattern:\n\
datasource_<name>.py
where <name> is the datasource identifier (e.g. "fmi", "mch", "bom", etc.)
"""
datasource_name = ".datasource_%s" % name
return... | import importlib
def get_specifications(name):
"""Return a datasource specification file according to the following pattern:\n\
datasource_<name>.py
where <name> is the datasource identifier (e.g. "fmi", "mch", "bom", etc.)
"""
datasoruce_name = ".datasource_%s" % name
return... | <commit_before>import importlib
def get_specifications(name):
"""Return a datasource specification file according to the following pattern:\n\
datasource_<name>.py
where <name> is the datasource identifier (e.g. "fmi", "mch", "bom", etc.)
"""
datasoruce_name = ".datasource_%s" % ... |
f89f24c22d2dd3c1bab59083397501238e2d0ba9 | sputnik/core.py | sputnik/core.py | import requests
import simplejson as json
def getbaseurl(service='search', version='1', method='track',
format='json'):
"""Returns the base URL for a Spotify Web API query"""
baseurl = "http://ws.spotify.com/{0}/{1}/{2}.{3}"
return baseurl.format(service, version, method, format)
def sea... | import requests
try:
import simplejson as json
except ImportError:
import json
def getbaseurl(service='search', version='1', method='track',
format='json'):
"""Returns the base URL for a Spotify Web API query"""
baseurl = "http://ws.spotify.com/{0}/{1}/{2}.{3}"
return baseurl.forma... | Add json module as fallback for simplejson | Add json module as fallback for simplejson
| Python | mit | iconpin/sputnik-python | import requests
import simplejson as json
def getbaseurl(service='search', version='1', method='track',
format='json'):
"""Returns the base URL for a Spotify Web API query"""
baseurl = "http://ws.spotify.com/{0}/{1}/{2}.{3}"
return baseurl.format(service, version, method, format)
def sea... | import requests
try:
import simplejson as json
except ImportError:
import json
def getbaseurl(service='search', version='1', method='track',
format='json'):
"""Returns the base URL for a Spotify Web API query"""
baseurl = "http://ws.spotify.com/{0}/{1}/{2}.{3}"
return baseurl.forma... | <commit_before>import requests
import simplejson as json
def getbaseurl(service='search', version='1', method='track',
format='json'):
"""Returns the base URL for a Spotify Web API query"""
baseurl = "http://ws.spotify.com/{0}/{1}/{2}.{3}"
return baseurl.format(service, version, method, fo... | import requests
try:
import simplejson as json
except ImportError:
import json
def getbaseurl(service='search', version='1', method='track',
format='json'):
"""Returns the base URL for a Spotify Web API query"""
baseurl = "http://ws.spotify.com/{0}/{1}/{2}.{3}"
return baseurl.forma... | import requests
import simplejson as json
def getbaseurl(service='search', version='1', method='track',
format='json'):
"""Returns the base URL for a Spotify Web API query"""
baseurl = "http://ws.spotify.com/{0}/{1}/{2}.{3}"
return baseurl.format(service, version, method, format)
def sea... | <commit_before>import requests
import simplejson as json
def getbaseurl(service='search', version='1', method='track',
format='json'):
"""Returns the base URL for a Spotify Web API query"""
baseurl = "http://ws.spotify.com/{0}/{1}/{2}.{3}"
return baseurl.format(service, version, method, fo... |
2ba8beb54b6de9fbe68501fa71a878da1426e6cd | tests/conftest.py | tests/conftest.py | import os
import pytest
from mothership import create_app, settings
from mothership import db as _db
@pytest.fixture(scope='session')
def app(request):
app = create_app('mothership.settings.TestConfig')
# Establish an application context before running the tests.
ctx = app.app_context()
ctx.push()
... | import os, sys
import pytest
""" So PYTHONPATH enviroment variable doesn't have to
be set for pytest to find mothership module. """
curdir = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(curdir,'..'))
from mothership import create_app, settings
from mothership import db as _db... | Allow tests to find mothership module | Allow tests to find mothership module
| Python | mit | afl-mothership/afl-mothership,afl-mothership/afl-mothership,afl-mothership/afl-mothership,afl-mothership/afl-mothership | import os
import pytest
from mothership import create_app, settings
from mothership import db as _db
@pytest.fixture(scope='session')
def app(request):
app = create_app('mothership.settings.TestConfig')
# Establish an application context before running the tests.
ctx = app.app_context()
ctx.push()
... | import os, sys
import pytest
""" So PYTHONPATH enviroment variable doesn't have to
be set for pytest to find mothership module. """
curdir = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(curdir,'..'))
from mothership import create_app, settings
from mothership import db as _db... | <commit_before>import os
import pytest
from mothership import create_app, settings
from mothership import db as _db
@pytest.fixture(scope='session')
def app(request):
app = create_app('mothership.settings.TestConfig')
# Establish an application context before running the tests.
ctx = app.app_context(... | import os, sys
import pytest
""" So PYTHONPATH enviroment variable doesn't have to
be set for pytest to find mothership module. """
curdir = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(curdir,'..'))
from mothership import create_app, settings
from mothership import db as _db... | import os
import pytest
from mothership import create_app, settings
from mothership import db as _db
@pytest.fixture(scope='session')
def app(request):
app = create_app('mothership.settings.TestConfig')
# Establish an application context before running the tests.
ctx = app.app_context()
ctx.push()
... | <commit_before>import os
import pytest
from mothership import create_app, settings
from mothership import db as _db
@pytest.fixture(scope='session')
def app(request):
app = create_app('mothership.settings.TestConfig')
# Establish an application context before running the tests.
ctx = app.app_context(... |
40ae333ab81ae1f4d93f3937306ddd12718b59a8 | virtool/processes.py | virtool/processes.py | import virtool.db.processes
FIRST_STEPS = {
"delete_reference": "delete_indexes",
"clone_reference": "copy_otus",
"import_reference": "load_file",
"remote_reference": "download",
"update_remote_reference": "download",
"update_software": "",
"install_hmms": ""
}
class ProgressTracker:
... | import virtool.db.processes
FIRST_STEPS = {
"delete_reference": "delete_indexes",
"clone_reference": "copy_otus",
"import_reference": "load_file",
"remote_reference": "download",
"update_remote_reference": "download",
"update_software": "download",
"install_hmms": "download"
}
class Progr... | Make download first step for install_software process type | Make download first step for install_software process type
| Python | mit | virtool/virtool,igboyes/virtool,virtool/virtool,igboyes/virtool | import virtool.db.processes
FIRST_STEPS = {
"delete_reference": "delete_indexes",
"clone_reference": "copy_otus",
"import_reference": "load_file",
"remote_reference": "download",
"update_remote_reference": "download",
"update_software": "",
"install_hmms": ""
}
class ProgressTracker:
... | import virtool.db.processes
FIRST_STEPS = {
"delete_reference": "delete_indexes",
"clone_reference": "copy_otus",
"import_reference": "load_file",
"remote_reference": "download",
"update_remote_reference": "download",
"update_software": "download",
"install_hmms": "download"
}
class Progr... | <commit_before>import virtool.db.processes
FIRST_STEPS = {
"delete_reference": "delete_indexes",
"clone_reference": "copy_otus",
"import_reference": "load_file",
"remote_reference": "download",
"update_remote_reference": "download",
"update_software": "",
"install_hmms": ""
}
class Progre... | import virtool.db.processes
FIRST_STEPS = {
"delete_reference": "delete_indexes",
"clone_reference": "copy_otus",
"import_reference": "load_file",
"remote_reference": "download",
"update_remote_reference": "download",
"update_software": "download",
"install_hmms": "download"
}
class Progr... | import virtool.db.processes
FIRST_STEPS = {
"delete_reference": "delete_indexes",
"clone_reference": "copy_otus",
"import_reference": "load_file",
"remote_reference": "download",
"update_remote_reference": "download",
"update_software": "",
"install_hmms": ""
}
class ProgressTracker:
... | <commit_before>import virtool.db.processes
FIRST_STEPS = {
"delete_reference": "delete_indexes",
"clone_reference": "copy_otus",
"import_reference": "load_file",
"remote_reference": "download",
"update_remote_reference": "download",
"update_software": "",
"install_hmms": ""
}
class Progre... |
6ae84a6e098275cdaac8598695c97403dcb2092e | volttron/__init__.py | volttron/__init__.py | '''
Copyright (c) 2013, Battelle Memorial Institute
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions ... | # This is a namespace package; do not add anything else to this file.
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| Make volttron a namespace package. | Make volttron a namespace package.
| Python | bsd-2-clause | schandrika/volttron,schandrika/volttron,schandrika/volttron,schandrika/volttron | '''
Copyright (c) 2013, Battelle Memorial Institute
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions ... | # This is a namespace package; do not add anything else to this file.
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| <commit_before>'''
Copyright (c) 2013, Battelle Memorial Institute
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list... | # This is a namespace package; do not add anything else to this file.
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| '''
Copyright (c) 2013, Battelle Memorial Institute
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions ... | <commit_before>'''
Copyright (c) 2013, Battelle Memorial Institute
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list... |
7c12d7f8e5fcd4cc328e109e0bdde9e62b4706f7 | parse_tweets.py | parse_tweets.py | # Requires pandas and matplotlib to be installed, e.g.
#
# `sudo apt-get install pandas-python`
import json
import re
import pandas as pd
import matplotlib.pyplot as plt
tweets_data_path = './twitter_data.txt'
tweets_data = []
tweets_file = open(tweets_data_path, "r")
for line in tweets_file:
try:
t... | # Requires pandas and matplotlib to be installed, e.g.
#
# `sudo apt-get install pandas-python`
import json
import re
import pandas as pd
import matplotlib.pyplot as plt
import sys
tweets_data_path = './twitter_data.txt'
tweets_data = []
tweets_file = open(tweets_data_path, "r")
for line in tweets_file:
try... | Add next part of parser, and fix errors in earlier part arising from incomplete data items | Add next part of parser, and fix errors in earlier part arising from incomplete data items
| Python | mit | 0x7df/twitter2pocket | # Requires pandas and matplotlib to be installed, e.g.
#
# `sudo apt-get install pandas-python`
import json
import re
import pandas as pd
import matplotlib.pyplot as plt
tweets_data_path = './twitter_data.txt'
tweets_data = []
tweets_file = open(tweets_data_path, "r")
for line in tweets_file:
try:
t... | # Requires pandas and matplotlib to be installed, e.g.
#
# `sudo apt-get install pandas-python`
import json
import re
import pandas as pd
import matplotlib.pyplot as plt
import sys
tweets_data_path = './twitter_data.txt'
tweets_data = []
tweets_file = open(tweets_data_path, "r")
for line in tweets_file:
try... | <commit_before># Requires pandas and matplotlib to be installed, e.g.
#
# `sudo apt-get install pandas-python`
import json
import re
import pandas as pd
import matplotlib.pyplot as plt
tweets_data_path = './twitter_data.txt'
tweets_data = []
tweets_file = open(tweets_data_path, "r")
for line in tweets_file:
... | # Requires pandas and matplotlib to be installed, e.g.
#
# `sudo apt-get install pandas-python`
import json
import re
import pandas as pd
import matplotlib.pyplot as plt
import sys
tweets_data_path = './twitter_data.txt'
tweets_data = []
tweets_file = open(tweets_data_path, "r")
for line in tweets_file:
try... | # Requires pandas and matplotlib to be installed, e.g.
#
# `sudo apt-get install pandas-python`
import json
import re
import pandas as pd
import matplotlib.pyplot as plt
tweets_data_path = './twitter_data.txt'
tweets_data = []
tweets_file = open(tweets_data_path, "r")
for line in tweets_file:
try:
t... | <commit_before># Requires pandas and matplotlib to be installed, e.g.
#
# `sudo apt-get install pandas-python`
import json
import re
import pandas as pd
import matplotlib.pyplot as plt
tweets_data_path = './twitter_data.txt'
tweets_data = []
tweets_file = open(tweets_data_path, "r")
for line in tweets_file:
... |
9cfdb35fb1f645eda99d28085b093ee36dd14625 | processors/closure_compiler.py | processors/closure_compiler.py |
from collections import OrderedDict
import os
import StringIO
from django.conf import settings
from django.utils.encoding import smart_str
from ..base import Processor
from django.core.exceptions import ImproperlyConfigured
class ClosureCompiler(Processor):
def modify_expected_output_filenames(self, filenames):
... |
from collections import OrderedDict
import os
import StringIO
from django.conf import settings
from django.utils.encoding import smart_str
from ..base import Processor
from django.core.exceptions import ImproperlyConfigured
class ClosureCompiler(Processor):
def modify_expected_output_filenames(self, filenames):
... | Use the ECMASCRIPT5_STRICT flag otherwise AngularJS dies | Use the ECMASCRIPT5_STRICT flag otherwise AngularJS dies
| Python | bsd-2-clause | potatolondon/assetpipe |
from collections import OrderedDict
import os
import StringIO
from django.conf import settings
from django.utils.encoding import smart_str
from ..base import Processor
from django.core.exceptions import ImproperlyConfigured
class ClosureCompiler(Processor):
def modify_expected_output_filenames(self, filenames):
... |
from collections import OrderedDict
import os
import StringIO
from django.conf import settings
from django.utils.encoding import smart_str
from ..base import Processor
from django.core.exceptions import ImproperlyConfigured
class ClosureCompiler(Processor):
def modify_expected_output_filenames(self, filenames):
... | <commit_before>
from collections import OrderedDict
import os
import StringIO
from django.conf import settings
from django.utils.encoding import smart_str
from ..base import Processor
from django.core.exceptions import ImproperlyConfigured
class ClosureCompiler(Processor):
def modify_expected_output_filenames(sel... |
from collections import OrderedDict
import os
import StringIO
from django.conf import settings
from django.utils.encoding import smart_str
from ..base import Processor
from django.core.exceptions import ImproperlyConfigured
class ClosureCompiler(Processor):
def modify_expected_output_filenames(self, filenames):
... |
from collections import OrderedDict
import os
import StringIO
from django.conf import settings
from django.utils.encoding import smart_str
from ..base import Processor
from django.core.exceptions import ImproperlyConfigured
class ClosureCompiler(Processor):
def modify_expected_output_filenames(self, filenames):
... | <commit_before>
from collections import OrderedDict
import os
import StringIO
from django.conf import settings
from django.utils.encoding import smart_str
from ..base import Processor
from django.core.exceptions import ImproperlyConfigured
class ClosureCompiler(Processor):
def modify_expected_output_filenames(sel... |
9452c8d4bebcb8466cda82d272c04bd9abe7f91d | tests/test_app.py | tests/test_app.py | import flask_testing
import logging
import unittest
import urllib
import server
logging.disable(logging.CRITICAL)
class TestIndex(unittest.TestCase):
def test_index_returns_greeting(self):
self.assertEquals(server.index(), 'Hello World')
class TestLiveIndex(flask_testing.LiveServerTestCase):
def c... | import flask_testing
import logging
import unittest
import urllib
import server
logging.disable(logging.CRITICAL)
class TestIndex(unittest.TestCase):
def test_index_returns_greeting(self):
self.assertEqual(server.index(), 'Hello World')
class TestLiveIndex(flask_testing.LiveServerTestCase):
def cr... | Change assertEquals to assertEqual due to deprecation warnings | Change assertEquals to assertEqual due to deprecation warnings
| Python | mit | Laspimon/transact,Laspimon/transact | import flask_testing
import logging
import unittest
import urllib
import server
logging.disable(logging.CRITICAL)
class TestIndex(unittest.TestCase):
def test_index_returns_greeting(self):
self.assertEquals(server.index(), 'Hello World')
class TestLiveIndex(flask_testing.LiveServerTestCase):
def c... | import flask_testing
import logging
import unittest
import urllib
import server
logging.disable(logging.CRITICAL)
class TestIndex(unittest.TestCase):
def test_index_returns_greeting(self):
self.assertEqual(server.index(), 'Hello World')
class TestLiveIndex(flask_testing.LiveServerTestCase):
def cr... | <commit_before>import flask_testing
import logging
import unittest
import urllib
import server
logging.disable(logging.CRITICAL)
class TestIndex(unittest.TestCase):
def test_index_returns_greeting(self):
self.assertEquals(server.index(), 'Hello World')
class TestLiveIndex(flask_testing.LiveServerTestCa... | import flask_testing
import logging
import unittest
import urllib
import server
logging.disable(logging.CRITICAL)
class TestIndex(unittest.TestCase):
def test_index_returns_greeting(self):
self.assertEqual(server.index(), 'Hello World')
class TestLiveIndex(flask_testing.LiveServerTestCase):
def cr... | import flask_testing
import logging
import unittest
import urllib
import server
logging.disable(logging.CRITICAL)
class TestIndex(unittest.TestCase):
def test_index_returns_greeting(self):
self.assertEquals(server.index(), 'Hello World')
class TestLiveIndex(flask_testing.LiveServerTestCase):
def c... | <commit_before>import flask_testing
import logging
import unittest
import urllib
import server
logging.disable(logging.CRITICAL)
class TestIndex(unittest.TestCase):
def test_index_returns_greeting(self):
self.assertEquals(server.index(), 'Hello World')
class TestLiveIndex(flask_testing.LiveServerTestCa... |
84342312ab663b1d7c9a9ac5e09811c2ed636fb4 | site_scons/utils.py | site_scons/utils.py | import os
import os.path
from os.path import join as pjoin
def download_file(source, target):
return 'wget %s -O %s' % (source, target)
def get_file_list(base_path, include_list = None, exclude_list = None):
if not isinstance(include_list, (list, tuple)):
include_list = [ include_list ]
if not exclude_list... | import os
import os.path
import hashlib
from os.path import join as pjoin
def download_file(source, target):
return 'wget %s -O %s' % (source, target)
def get_file_list(base_path, include_list = None, exclude_list = None):
if not isinstance(include_list, (list, tuple)):
include_list = [ include_list ]
if n... | Add some more utility functions. | Add some more utility functions.
| Python | apache-2.0 | cloudkick/cast,cloudkick/cast,cloudkick/cast,cloudkick/cast | import os
import os.path
from os.path import join as pjoin
def download_file(source, target):
return 'wget %s -O %s' % (source, target)
def get_file_list(base_path, include_list = None, exclude_list = None):
if not isinstance(include_list, (list, tuple)):
include_list = [ include_list ]
if not exclude_list... | import os
import os.path
import hashlib
from os.path import join as pjoin
def download_file(source, target):
return 'wget %s -O %s' % (source, target)
def get_file_list(base_path, include_list = None, exclude_list = None):
if not isinstance(include_list, (list, tuple)):
include_list = [ include_list ]
if n... | <commit_before>import os
import os.path
from os.path import join as pjoin
def download_file(source, target):
return 'wget %s -O %s' % (source, target)
def get_file_list(base_path, include_list = None, exclude_list = None):
if not isinstance(include_list, (list, tuple)):
include_list = [ include_list ]
if n... | import os
import os.path
import hashlib
from os.path import join as pjoin
def download_file(source, target):
return 'wget %s -O %s' % (source, target)
def get_file_list(base_path, include_list = None, exclude_list = None):
if not isinstance(include_list, (list, tuple)):
include_list = [ include_list ]
if n... | import os
import os.path
from os.path import join as pjoin
def download_file(source, target):
return 'wget %s -O %s' % (source, target)
def get_file_list(base_path, include_list = None, exclude_list = None):
if not isinstance(include_list, (list, tuple)):
include_list = [ include_list ]
if not exclude_list... | <commit_before>import os
import os.path
from os.path import join as pjoin
def download_file(source, target):
return 'wget %s -O %s' % (source, target)
def get_file_list(base_path, include_list = None, exclude_list = None):
if not isinstance(include_list, (list, tuple)):
include_list = [ include_list ]
if n... |
38d2aceecf485e59af4e66be711d7d0f12086c06 | twinsies/clock.py | twinsies/clock.py | from apscheduler.schedulers.blocking import BlockingScheduler
from twinsies.twitter import (random_trend_query, fetch_tweets, dig_for_twins,
update_status)
from memory_profiler import profile
sched = BlockingScheduler()
@sched.scheduled_job('interval', minutes=16)
@profile
def twinsy_finder(fetch_size=10000):
... | from apscheduler.schedulers.blocking import BlockingScheduler
from twinsies.twitter import (random_trend_query, fetch_tweets, dig_for_twins,
update_status)
from memory_profiler import profile
sched = BlockingScheduler()
@sched.scheduled_job('interval', minutes=16)
@profile
def twinsy_finder(fetch_size=10000):
... | Remove del fetched_tweets (now a generator) | Remove del fetched_tweets (now a generator)
| Python | mit | kkwteh/twinyewest | from apscheduler.schedulers.blocking import BlockingScheduler
from twinsies.twitter import (random_trend_query, fetch_tweets, dig_for_twins,
update_status)
from memory_profiler import profile
sched = BlockingScheduler()
@sched.scheduled_job('interval', minutes=16)
@profile
def twinsy_finder(fetch_size=10000):
... | from apscheduler.schedulers.blocking import BlockingScheduler
from twinsies.twitter import (random_trend_query, fetch_tweets, dig_for_twins,
update_status)
from memory_profiler import profile
sched = BlockingScheduler()
@sched.scheduled_job('interval', minutes=16)
@profile
def twinsy_finder(fetch_size=10000):
... | <commit_before>from apscheduler.schedulers.blocking import BlockingScheduler
from twinsies.twitter import (random_trend_query, fetch_tweets, dig_for_twins,
update_status)
from memory_profiler import profile
sched = BlockingScheduler()
@sched.scheduled_job('interval', minutes=16)
@profile
def twinsy_finder(fetch... | from apscheduler.schedulers.blocking import BlockingScheduler
from twinsies.twitter import (random_trend_query, fetch_tweets, dig_for_twins,
update_status)
from memory_profiler import profile
sched = BlockingScheduler()
@sched.scheduled_job('interval', minutes=16)
@profile
def twinsy_finder(fetch_size=10000):
... | from apscheduler.schedulers.blocking import BlockingScheduler
from twinsies.twitter import (random_trend_query, fetch_tweets, dig_for_twins,
update_status)
from memory_profiler import profile
sched = BlockingScheduler()
@sched.scheduled_job('interval', minutes=16)
@profile
def twinsy_finder(fetch_size=10000):
... | <commit_before>from apscheduler.schedulers.blocking import BlockingScheduler
from twinsies.twitter import (random_trend_query, fetch_tweets, dig_for_twins,
update_status)
from memory_profiler import profile
sched = BlockingScheduler()
@sched.scheduled_job('interval', minutes=16)
@profile
def twinsy_finder(fetch... |
caa96562fb65dfdedc37f6efc463701e8b22d410 | zipview/views.py | zipview/views.py | import zipfile
from django.views.generic import View
from django.http import HttpResponse
from django.core.files.base import ContentFile
from django.utils.six import b
class BaseZipView(View):
"""A base view to zip and stream several files."""
http_method_names = ['get']
zipfile_name = 'download.zip'
... | import zipfile
from django.views.generic import View
from django.http import HttpResponse
from django.core.files.base import ContentFile
class BaseZipView(View):
"""A base view to zip and stream several files."""
http_method_names = ['get']
zipfile_name = 'download.zip'
def get_files(self):
... | Remove obsolete python2 unicode helpers | Remove obsolete python2 unicode helpers
| Python | mit | thibault/django-zipview | import zipfile
from django.views.generic import View
from django.http import HttpResponse
from django.core.files.base import ContentFile
from django.utils.six import b
class BaseZipView(View):
"""A base view to zip and stream several files."""
http_method_names = ['get']
zipfile_name = 'download.zip'
... | import zipfile
from django.views.generic import View
from django.http import HttpResponse
from django.core.files.base import ContentFile
class BaseZipView(View):
"""A base view to zip and stream several files."""
http_method_names = ['get']
zipfile_name = 'download.zip'
def get_files(self):
... | <commit_before>import zipfile
from django.views.generic import View
from django.http import HttpResponse
from django.core.files.base import ContentFile
from django.utils.six import b
class BaseZipView(View):
"""A base view to zip and stream several files."""
http_method_names = ['get']
zipfile_name = 'd... | import zipfile
from django.views.generic import View
from django.http import HttpResponse
from django.core.files.base import ContentFile
class BaseZipView(View):
"""A base view to zip and stream several files."""
http_method_names = ['get']
zipfile_name = 'download.zip'
def get_files(self):
... | import zipfile
from django.views.generic import View
from django.http import HttpResponse
from django.core.files.base import ContentFile
from django.utils.six import b
class BaseZipView(View):
"""A base view to zip and stream several files."""
http_method_names = ['get']
zipfile_name = 'download.zip'
... | <commit_before>import zipfile
from django.views.generic import View
from django.http import HttpResponse
from django.core.files.base import ContentFile
from django.utils.six import b
class BaseZipView(View):
"""A base view to zip and stream several files."""
http_method_names = ['get']
zipfile_name = 'd... |
1e006b5df70303b743cb2fd7d6c2a5ef4234f70b | zazo/__init__.py | zazo/__init__.py | """An Extensible Dependency Resolver written in Python
"""
__version__ = "0.1.0.dev0"
| """An Extensible Dependency Resolver written in Python
"""
__version__ = "0.0.0a2"
| Switch to an alpha version | Switch to an alpha version
| Python | mit | pradyunsg/zazo,pradyunsg/zazo | """An Extensible Dependency Resolver written in Python
"""
__version__ = "0.1.0.dev0"
Switch to an alpha version | """An Extensible Dependency Resolver written in Python
"""
__version__ = "0.0.0a2"
| <commit_before>"""An Extensible Dependency Resolver written in Python
"""
__version__ = "0.1.0.dev0"
<commit_msg>Switch to an alpha version<commit_after> | """An Extensible Dependency Resolver written in Python
"""
__version__ = "0.0.0a2"
| """An Extensible Dependency Resolver written in Python
"""
__version__ = "0.1.0.dev0"
Switch to an alpha version"""An Extensible Dependency Resolver written in Python
"""
__version__ = "0.0.0a2"
| <commit_before>"""An Extensible Dependency Resolver written in Python
"""
__version__ = "0.1.0.dev0"
<commit_msg>Switch to an alpha version<commit_after>"""An Extensible Dependency Resolver written in Python
"""
__version__ = "0.0.0a2"
|
fd819ff0ff1a7d73dd58f152d2c4be8aea18e2d3 | rebulk/processors.py | rebulk/processors.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Processor functions
"""
def conflict_prefer_longer(matches):
"""
Remove shorter matches if they conflicts with longer ones
:param matches:
:type matches: rebulk.match.Matches
:param context:
:type context:
:return:
:rtype: list[rebulk.... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Processor functions
"""
def conflict_prefer_longer(matches):
"""
Remove shorter matches if they conflicts with longer ones
:param matches:
:type matches: rebulk.match.Matches
:param context:
:type context:
:return:
:rtype: list[rebulk.... | Fix issue when a private match is found multiple times | Fix issue when a private match is found multiple times
| Python | mit | Toilal/rebulk | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Processor functions
"""
def conflict_prefer_longer(matches):
"""
Remove shorter matches if they conflicts with longer ones
:param matches:
:type matches: rebulk.match.Matches
:param context:
:type context:
:return:
:rtype: list[rebulk.... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Processor functions
"""
def conflict_prefer_longer(matches):
"""
Remove shorter matches if they conflicts with longer ones
:param matches:
:type matches: rebulk.match.Matches
:param context:
:type context:
:return:
:rtype: list[rebulk.... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Processor functions
"""
def conflict_prefer_longer(matches):
"""
Remove shorter matches if they conflicts with longer ones
:param matches:
:type matches: rebulk.match.Matches
:param context:
:type context:
:return:
:rtyp... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Processor functions
"""
def conflict_prefer_longer(matches):
"""
Remove shorter matches if they conflicts with longer ones
:param matches:
:type matches: rebulk.match.Matches
:param context:
:type context:
:return:
:rtype: list[rebulk.... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Processor functions
"""
def conflict_prefer_longer(matches):
"""
Remove shorter matches if they conflicts with longer ones
:param matches:
:type matches: rebulk.match.Matches
:param context:
:type context:
:return:
:rtype: list[rebulk.... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Processor functions
"""
def conflict_prefer_longer(matches):
"""
Remove shorter matches if they conflicts with longer ones
:param matches:
:type matches: rebulk.match.Matches
:param context:
:type context:
:return:
:rtyp... |
7366e84afdc93b68278b64bc9ddfac08901cb032 | python/peacock/tests/postprocessor_tab/gold/TestPostprocessorPluginManager_test_script.py | python/peacock/tests/postprocessor_tab/gold/TestPostprocessorPluginManager_test_script.py | #* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
"""
python ... | """
python TestPostprocessorPluginManager_test_script.py
"""
import matplotlib.pyplot as plt
import mooseutils
# Create Figure and Axes
figure = plt.figure(facecolor='white')
axes0 = figure.add_subplot(111)
axes1 = axes0.twinx()
# Read Postprocessor Data
data = mooseutils.PostprocessorReader('../input/white_elephant_... | Remove header from gold script file | Remove header from gold script file
| Python | lgpl-2.1 | milljm/moose,YaqiWang/moose,nuclear-wizard/moose,bwspenc/moose,sapitts/moose,idaholab/moose,idaholab/moose,jessecarterMOOSE/moose,permcody/moose,nuclear-wizard/moose,milljm/moose,lindsayad/moose,laagesen/moose,idaholab/moose,andrsd/moose,milljm/moose,SudiptaBiswas/moose,dschwen/moose,permcody/moose,lindsayad/moose,sapi... | #* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
"""
python ... | """
python TestPostprocessorPluginManager_test_script.py
"""
import matplotlib.pyplot as plt
import mooseutils
# Create Figure and Axes
figure = plt.figure(facecolor='white')
axes0 = figure.add_subplot(111)
axes1 = axes0.twinx()
# Read Postprocessor Data
data = mooseutils.PostprocessorReader('../input/white_elephant_... | <commit_before>#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.ht... | """
python TestPostprocessorPluginManager_test_script.py
"""
import matplotlib.pyplot as plt
import mooseutils
# Create Figure and Axes
figure = plt.figure(facecolor='white')
axes0 = figure.add_subplot(111)
axes1 = axes0.twinx()
# Read Postprocessor Data
data = mooseutils.PostprocessorReader('../input/white_elephant_... | #* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
"""
python ... | <commit_before>#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.ht... |
ae5b93c4e12f732a8c56de80b39f227c90ef4809 | polls/models.py | polls/models.py | from django.db import models
class Question(models.Model):
question_text = models.CharField(max_length=140)
published_at = models.DateTimeField(auto_now_add=True)
class Meta:
get_latest_by = 'published_at'
def __str__(self):
return self.question_text
class Choice(models.Model):
... | from django.db import models
class Question(models.Model):
question_text = models.CharField(max_length=140)
published_at = models.DateTimeField(auto_now_add=True)
class Meta:
get_latest_by = 'published_at'
ordering = ('-published_at',)
def __str__(self):
return self.question_... | Order questions by published date | Order questions by published date
Closes #23
| Python | mit | apiaryio/polls-api | from django.db import models
class Question(models.Model):
question_text = models.CharField(max_length=140)
published_at = models.DateTimeField(auto_now_add=True)
class Meta:
get_latest_by = 'published_at'
def __str__(self):
return self.question_text
class Choice(models.Model):
... | from django.db import models
class Question(models.Model):
question_text = models.CharField(max_length=140)
published_at = models.DateTimeField(auto_now_add=True)
class Meta:
get_latest_by = 'published_at'
ordering = ('-published_at',)
def __str__(self):
return self.question_... | <commit_before>from django.db import models
class Question(models.Model):
question_text = models.CharField(max_length=140)
published_at = models.DateTimeField(auto_now_add=True)
class Meta:
get_latest_by = 'published_at'
def __str__(self):
return self.question_text
class Choice(mod... | from django.db import models
class Question(models.Model):
question_text = models.CharField(max_length=140)
published_at = models.DateTimeField(auto_now_add=True)
class Meta:
get_latest_by = 'published_at'
ordering = ('-published_at',)
def __str__(self):
return self.question_... | from django.db import models
class Question(models.Model):
question_text = models.CharField(max_length=140)
published_at = models.DateTimeField(auto_now_add=True)
class Meta:
get_latest_by = 'published_at'
def __str__(self):
return self.question_text
class Choice(models.Model):
... | <commit_before>from django.db import models
class Question(models.Model):
question_text = models.CharField(max_length=140)
published_at = models.DateTimeField(auto_now_add=True)
class Meta:
get_latest_by = 'published_at'
def __str__(self):
return self.question_text
class Choice(mod... |
10e3c7b8dbc4befa2533de1a07f1f7827b961f81 | rejected/__init__.py | rejected/__init__.py | """
Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
"""
import logging
# Add NullHandler to prevent logging warnings
logging.getLogger(__name__).addHandler(logging.NullHandler())
from rejected.consumer import (
Consumer,
ConsumerException,
MessageException,
ProcessingException,... | """
Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
"""
import logging
# Add NullHandler to prevent logging warnings
logging.getLogger(__name__).addHandler(logging.NullHandler())
from rejected.consumer import ( # noqa: E402
Consumer,
ConsumerException,
MessageException,
Proces... | Fix noqa location, bump version | Fix noqa location, bump version
| Python | bsd-3-clause | gmr/rejected,gmr/rejected | """
Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
"""
import logging
# Add NullHandler to prevent logging warnings
logging.getLogger(__name__).addHandler(logging.NullHandler())
from rejected.consumer import (
Consumer,
ConsumerException,
MessageException,
ProcessingException,... | """
Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
"""
import logging
# Add NullHandler to prevent logging warnings
logging.getLogger(__name__).addHandler(logging.NullHandler())
from rejected.consumer import ( # noqa: E402
Consumer,
ConsumerException,
MessageException,
Proces... | <commit_before>"""
Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
"""
import logging
# Add NullHandler to prevent logging warnings
logging.getLogger(__name__).addHandler(logging.NullHandler())
from rejected.consumer import (
Consumer,
ConsumerException,
MessageException,
Proce... | """
Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
"""
import logging
# Add NullHandler to prevent logging warnings
logging.getLogger(__name__).addHandler(logging.NullHandler())
from rejected.consumer import ( # noqa: E402
Consumer,
ConsumerException,
MessageException,
Proces... | """
Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
"""
import logging
# Add NullHandler to prevent logging warnings
logging.getLogger(__name__).addHandler(logging.NullHandler())
from rejected.consumer import (
Consumer,
ConsumerException,
MessageException,
ProcessingException,... | <commit_before>"""
Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
"""
import logging
# Add NullHandler to prevent logging warnings
logging.getLogger(__name__).addHandler(logging.NullHandler())
from rejected.consumer import (
Consumer,
ConsumerException,
MessageException,
Proce... |
c3d20f0f394063abe7e149d9de41aa3ac0ab91f1 | knowit/rules/alternative.py | knowit/rules/alternative.py |
from knowit.rule import Rule
class AlternativeRule(Rule):
"""Alternative rule."""
def __init__(self, name, prop_name: str, **kwargs):
super().__init__(name, **kwargs)
self.prop_name = prop_name
def execute(self, props, pv_props, context):
"""Execute the rule against properties.... |
from knowit.rule import Rule
class AlternativeRule(Rule):
"""Alternative rule."""
def __init__(self, name, prop_name: str, **kwargs):
super().__init__(name, **kwargs)
self.prop_name = prop_name
def execute(self, props, pv_props, context):
"""Execute the rule against properties."... | Fix multiple spaces after ',' | Fix multiple spaces after ','
| Python | mit | ratoaq2/knowit |
from knowit.rule import Rule
class AlternativeRule(Rule):
"""Alternative rule."""
def __init__(self, name, prop_name: str, **kwargs):
super().__init__(name, **kwargs)
self.prop_name = prop_name
def execute(self, props, pv_props, context):
"""Execute the rule against properties.... |
from knowit.rule import Rule
class AlternativeRule(Rule):
"""Alternative rule."""
def __init__(self, name, prop_name: str, **kwargs):
super().__init__(name, **kwargs)
self.prop_name = prop_name
def execute(self, props, pv_props, context):
"""Execute the rule against properties."... | <commit_before>
from knowit.rule import Rule
class AlternativeRule(Rule):
"""Alternative rule."""
def __init__(self, name, prop_name: str, **kwargs):
super().__init__(name, **kwargs)
self.prop_name = prop_name
def execute(self, props, pv_props, context):
"""Execute the rule agai... |
from knowit.rule import Rule
class AlternativeRule(Rule):
"""Alternative rule."""
def __init__(self, name, prop_name: str, **kwargs):
super().__init__(name, **kwargs)
self.prop_name = prop_name
def execute(self, props, pv_props, context):
"""Execute the rule against properties."... |
from knowit.rule import Rule
class AlternativeRule(Rule):
"""Alternative rule."""
def __init__(self, name, prop_name: str, **kwargs):
super().__init__(name, **kwargs)
self.prop_name = prop_name
def execute(self, props, pv_props, context):
"""Execute the rule against properties.... | <commit_before>
from knowit.rule import Rule
class AlternativeRule(Rule):
"""Alternative rule."""
def __init__(self, name, prop_name: str, **kwargs):
super().__init__(name, **kwargs)
self.prop_name = prop_name
def execute(self, props, pv_props, context):
"""Execute the rule agai... |
c9491f47e1fc98e0a6aadf9bf379f21112768332 | platformio/builder/scripts/windows_x86.py | platformio/builder/scripts/windows_x86.py | # Copyright (C) Ivan Kravets <[email protected]>
# See LICENSE for details.
"""
Builder for Windows x86
"""
from SCons.Script import AlwaysBuild, Default, DefaultEnvironment
from platformio.util import get_systype
env = DefaultEnvironment()
env.Replace(
SIZEPRINTCMD="size $SOURCES",
PROGSUFFIX=".exe"
)
... | # Copyright (C) Ivan Kravets <[email protected]>
# See LICENSE for details.
"""
Builder for Windows x86
"""
from SCons.Script import AlwaysBuild, Default, DefaultEnvironment
from platformio.util import get_systype
env = DefaultEnvironment()
env.Replace(
AR="$_MINGWPREFIX-ar",
AS="$_MINGWPREFIX-as",
... | Add support for mingw-linux toolchains | Add support for mingw-linux toolchains
| Python | apache-2.0 | ZachMassia/platformio,platformio/platformio-core,mseroczynski/platformio,eiginn/platformio,valeros/platformio,mcanthony/platformio,platformio/platformio,dkuku/platformio,platformio/platformio-core,atyenoria/platformio,mplewis/platformio | # Copyright (C) Ivan Kravets <[email protected]>
# See LICENSE for details.
"""
Builder for Windows x86
"""
from SCons.Script import AlwaysBuild, Default, DefaultEnvironment
from platformio.util import get_systype
env = DefaultEnvironment()
env.Replace(
SIZEPRINTCMD="size $SOURCES",
PROGSUFFIX=".exe"
)
... | # Copyright (C) Ivan Kravets <[email protected]>
# See LICENSE for details.
"""
Builder for Windows x86
"""
from SCons.Script import AlwaysBuild, Default, DefaultEnvironment
from platformio.util import get_systype
env = DefaultEnvironment()
env.Replace(
AR="$_MINGWPREFIX-ar",
AS="$_MINGWPREFIX-as",
... | <commit_before># Copyright (C) Ivan Kravets <[email protected]>
# See LICENSE for details.
"""
Builder for Windows x86
"""
from SCons.Script import AlwaysBuild, Default, DefaultEnvironment
from platformio.util import get_systype
env = DefaultEnvironment()
env.Replace(
SIZEPRINTCMD="size $SOURCES",
PROGS... | # Copyright (C) Ivan Kravets <[email protected]>
# See LICENSE for details.
"""
Builder for Windows x86
"""
from SCons.Script import AlwaysBuild, Default, DefaultEnvironment
from platformio.util import get_systype
env = DefaultEnvironment()
env.Replace(
AR="$_MINGWPREFIX-ar",
AS="$_MINGWPREFIX-as",
... | # Copyright (C) Ivan Kravets <[email protected]>
# See LICENSE for details.
"""
Builder for Windows x86
"""
from SCons.Script import AlwaysBuild, Default, DefaultEnvironment
from platformio.util import get_systype
env = DefaultEnvironment()
env.Replace(
SIZEPRINTCMD="size $SOURCES",
PROGSUFFIX=".exe"
)
... | <commit_before># Copyright (C) Ivan Kravets <[email protected]>
# See LICENSE for details.
"""
Builder for Windows x86
"""
from SCons.Script import AlwaysBuild, Default, DefaultEnvironment
from platformio.util import get_systype
env = DefaultEnvironment()
env.Replace(
SIZEPRINTCMD="size $SOURCES",
PROGS... |
e4ae1bae94eb2afd5ea851d4ce6528f81c46c32d | pebble/PblCommand.py | pebble/PblCommand.py | import os
class PblCommand:
name = ''
help = ''
def run(args):
pass
def configure_subparser(self, parser):
parser.add_argument('--sdk', help='Path to Pebble SDK (ie: ~/pebble-dev/PebbleSDK-2.X/)')
def sdk_path(self, args):
"""
Tries to guess the location of the Pe... | import os
class PblCommand:
name = ''
help = ''
def run(args):
pass
def configure_subparser(self, parser):
parser.add_argument('--sdk', help='Path to Pebble SDK (ie: ~/pebble-dev/PebbleSDK-2.X/)')
parser.add_argument('--debug', action='store_true',
help = 'Ena... | Allow user to enter pebble <cmd> --debug as well as pebble --debug <cmd> | Allow user to enter pebble <cmd> --debug as well as pebble --debug <cmd>
| Python | mit | pebble/libpebble,pebble/libpebble,pebble/libpebble,pebble/libpebble | import os
class PblCommand:
name = ''
help = ''
def run(args):
pass
def configure_subparser(self, parser):
parser.add_argument('--sdk', help='Path to Pebble SDK (ie: ~/pebble-dev/PebbleSDK-2.X/)')
def sdk_path(self, args):
"""
Tries to guess the location of the Pe... | import os
class PblCommand:
name = ''
help = ''
def run(args):
pass
def configure_subparser(self, parser):
parser.add_argument('--sdk', help='Path to Pebble SDK (ie: ~/pebble-dev/PebbleSDK-2.X/)')
parser.add_argument('--debug', action='store_true',
help = 'Ena... | <commit_before>import os
class PblCommand:
name = ''
help = ''
def run(args):
pass
def configure_subparser(self, parser):
parser.add_argument('--sdk', help='Path to Pebble SDK (ie: ~/pebble-dev/PebbleSDK-2.X/)')
def sdk_path(self, args):
"""
Tries to guess the loc... | import os
class PblCommand:
name = ''
help = ''
def run(args):
pass
def configure_subparser(self, parser):
parser.add_argument('--sdk', help='Path to Pebble SDK (ie: ~/pebble-dev/PebbleSDK-2.X/)')
parser.add_argument('--debug', action='store_true',
help = 'Ena... | import os
class PblCommand:
name = ''
help = ''
def run(args):
pass
def configure_subparser(self, parser):
parser.add_argument('--sdk', help='Path to Pebble SDK (ie: ~/pebble-dev/PebbleSDK-2.X/)')
def sdk_path(self, args):
"""
Tries to guess the location of the Pe... | <commit_before>import os
class PblCommand:
name = ''
help = ''
def run(args):
pass
def configure_subparser(self, parser):
parser.add_argument('--sdk', help='Path to Pebble SDK (ie: ~/pebble-dev/PebbleSDK-2.X/)')
def sdk_path(self, args):
"""
Tries to guess the loc... |
a17933c7806634391137244e2c17327898187146 | djstripe/__init__.py | djstripe/__init__.py | """
.. module:: djstripe.
:synopsis: dj-stripe - Django + Stripe Made Easy
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import pkg_resources
from . import checks # noqa: Register the checks
__version__ = pkg_resources.require("dj-stripe")[0].version
| """
.. module:: djstripe.
:synopsis: dj-stripe - Django + Stripe Made Easy
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import pkg_resources
import stripe
from . import checks # noqa: Register the checks
__version__ = pkg_resources.require("dj-stripe")[0].version
# Se... | Set dj-stripe as stripe app info | Set dj-stripe as stripe app info
https://stripe.com/docs/building-plugins#setappinfo
| Python | mit | pydanny/dj-stripe,pydanny/dj-stripe,jleclanche/dj-stripe,dj-stripe/dj-stripe,kavdev/dj-stripe,jleclanche/dj-stripe,dj-stripe/dj-stripe,kavdev/dj-stripe | """
.. module:: djstripe.
:synopsis: dj-stripe - Django + Stripe Made Easy
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import pkg_resources
from . import checks # noqa: Register the checks
__version__ = pkg_resources.require("dj-stripe")[0].version
Set dj-stripe as strip... | """
.. module:: djstripe.
:synopsis: dj-stripe - Django + Stripe Made Easy
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import pkg_resources
import stripe
from . import checks # noqa: Register the checks
__version__ = pkg_resources.require("dj-stripe")[0].version
# Se... | <commit_before>"""
.. module:: djstripe.
:synopsis: dj-stripe - Django + Stripe Made Easy
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import pkg_resources
from . import checks # noqa: Register the checks
__version__ = pkg_resources.require("dj-stripe")[0].version
<commit... | """
.. module:: djstripe.
:synopsis: dj-stripe - Django + Stripe Made Easy
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import pkg_resources
import stripe
from . import checks # noqa: Register the checks
__version__ = pkg_resources.require("dj-stripe")[0].version
# Se... | """
.. module:: djstripe.
:synopsis: dj-stripe - Django + Stripe Made Easy
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import pkg_resources
from . import checks # noqa: Register the checks
__version__ = pkg_resources.require("dj-stripe")[0].version
Set dj-stripe as strip... | <commit_before>"""
.. module:: djstripe.
:synopsis: dj-stripe - Django + Stripe Made Easy
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import pkg_resources
from . import checks # noqa: Register the checks
__version__ = pkg_resources.require("dj-stripe")[0].version
<commit... |
26d2e13945f4780ff74dfe99695be7045fb9ed39 | piper/prop.py | piper/prop.py | import facter
from collections import MutableMapping
from piper.abc import DynamicItem
class PropBase(DynamicItem):
def __init__(self):
super(PropBase, self).__init__(None)
self._props = None
@property
def properties(self):
"""
Collect system properties and return a dicti... | import facter
from collections import MutableMapping
from piper.abc import DynamicItem
class PropBase(DynamicItem):
def __init__(self):
super(PropBase, self).__init__(None)
self._props = None
@property
def properties(self):
"""
Collect system properties and return a dicti... | Add PropBase.flatten() support for flattening lists | Add PropBase.flatten() support for flattening lists
| Python | mit | thiderman/piper | import facter
from collections import MutableMapping
from piper.abc import DynamicItem
class PropBase(DynamicItem):
def __init__(self):
super(PropBase, self).__init__(None)
self._props = None
@property
def properties(self):
"""
Collect system properties and return a dicti... | import facter
from collections import MutableMapping
from piper.abc import DynamicItem
class PropBase(DynamicItem):
def __init__(self):
super(PropBase, self).__init__(None)
self._props = None
@property
def properties(self):
"""
Collect system properties and return a dicti... | <commit_before>import facter
from collections import MutableMapping
from piper.abc import DynamicItem
class PropBase(DynamicItem):
def __init__(self):
super(PropBase, self).__init__(None)
self._props = None
@property
def properties(self):
"""
Collect system properties and... | import facter
from collections import MutableMapping
from piper.abc import DynamicItem
class PropBase(DynamicItem):
def __init__(self):
super(PropBase, self).__init__(None)
self._props = None
@property
def properties(self):
"""
Collect system properties and return a dicti... | import facter
from collections import MutableMapping
from piper.abc import DynamicItem
class PropBase(DynamicItem):
def __init__(self):
super(PropBase, self).__init__(None)
self._props = None
@property
def properties(self):
"""
Collect system properties and return a dicti... | <commit_before>import facter
from collections import MutableMapping
from piper.abc import DynamicItem
class PropBase(DynamicItem):
def __init__(self):
super(PropBase, self).__init__(None)
self._props = None
@property
def properties(self):
"""
Collect system properties and... |
6c7ca64fbd93ab52dfc1ba792fd314395483d651 | piazza_api/piazza.py | piazza_api/piazza.py | class Piazza(object):
"""Unofficial Client for Piazza's Internal API"""
def __init__(self):
pass
| from .rpc import PiazzaRPC
class Piazza(object):
"""Unofficial Client for Piazza's Internal API"""
def __init__(self):
self._rpc_api = None
def user_login(self, email=None, password=None):
"""Login with email, password and get back a session cookie
:type email: str
:para... | Add login methods to Piazza | feat(user): Add login methods to Piazza
| Python | mit | hfaran/piazza-api,kwangkim/piazza-api | class Piazza(object):
"""Unofficial Client for Piazza's Internal API"""
def __init__(self):
pass
feat(user): Add login methods to Piazza | from .rpc import PiazzaRPC
class Piazza(object):
"""Unofficial Client for Piazza's Internal API"""
def __init__(self):
self._rpc_api = None
def user_login(self, email=None, password=None):
"""Login with email, password and get back a session cookie
:type email: str
:para... | <commit_before>class Piazza(object):
"""Unofficial Client for Piazza's Internal API"""
def __init__(self):
pass
<commit_msg>feat(user): Add login methods to Piazza<commit_after> | from .rpc import PiazzaRPC
class Piazza(object):
"""Unofficial Client for Piazza's Internal API"""
def __init__(self):
self._rpc_api = None
def user_login(self, email=None, password=None):
"""Login with email, password and get back a session cookie
:type email: str
:para... | class Piazza(object):
"""Unofficial Client for Piazza's Internal API"""
def __init__(self):
pass
feat(user): Add login methods to Piazzafrom .rpc import PiazzaRPC
class Piazza(object):
"""Unofficial Client for Piazza's Internal API"""
def __init__(self):
self._rpc_api = None
def u... | <commit_before>class Piazza(object):
"""Unofficial Client for Piazza's Internal API"""
def __init__(self):
pass
<commit_msg>feat(user): Add login methods to Piazza<commit_after>from .rpc import PiazzaRPC
class Piazza(object):
"""Unofficial Client for Piazza's Internal API"""
def __init__(self)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.