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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
364731a5986a629f934ae8f82743385c5e4b7226 | main.py | main.py | import argparse
from microproxy import proxy
from microproxy.viewer import log as log_viewer
def proxy_handler(args):
proxy.start_proxy_server(args.host, args.port, args.proxy_mode)
def viewer_handler(args):
if args.viewer_type == "log":
log_viewer.start()
def main():
parser = argparse.Arg... | import argparse
from microproxy import proxy
from microproxy.viewer import log as log_viewer
def proxy_handler(args):
proxy.start_proxy_server(args.host, args.port, args.proxy_mode)
def viewer_handler(args):
if args.viewer_mode == "log":
log_viewer.start()
def main():
parser = argparse.Arg... | Change command option format. - proxy_mode into proxy-mode - viewer_type into viewer-mode | Change command option format.
- proxy_mode into proxy-mode
- viewer_type into viewer-mode
| Python | mit | mike820324/microProxy,mike820324/microProxy | import argparse
from microproxy import proxy
from microproxy.viewer import log as log_viewer
def proxy_handler(args):
proxy.start_proxy_server(args.host, args.port, args.proxy_mode)
def viewer_handler(args):
if args.viewer_type == "log":
log_viewer.start()
def main():
parser = argparse.Arg... | import argparse
from microproxy import proxy
from microproxy.viewer import log as log_viewer
def proxy_handler(args):
proxy.start_proxy_server(args.host, args.port, args.proxy_mode)
def viewer_handler(args):
if args.viewer_mode == "log":
log_viewer.start()
def main():
parser = argparse.Arg... | <commit_before>import argparse
from microproxy import proxy
from microproxy.viewer import log as log_viewer
def proxy_handler(args):
proxy.start_proxy_server(args.host, args.port, args.proxy_mode)
def viewer_handler(args):
if args.viewer_type == "log":
log_viewer.start()
def main():
parser... | import argparse
from microproxy import proxy
from microproxy.viewer import log as log_viewer
def proxy_handler(args):
proxy.start_proxy_server(args.host, args.port, args.proxy_mode)
def viewer_handler(args):
if args.viewer_mode == "log":
log_viewer.start()
def main():
parser = argparse.Arg... | import argparse
from microproxy import proxy
from microproxy.viewer import log as log_viewer
def proxy_handler(args):
proxy.start_proxy_server(args.host, args.port, args.proxy_mode)
def viewer_handler(args):
if args.viewer_type == "log":
log_viewer.start()
def main():
parser = argparse.Arg... | <commit_before>import argparse
from microproxy import proxy
from microproxy.viewer import log as log_viewer
def proxy_handler(args):
proxy.start_proxy_server(args.host, args.port, args.proxy_mode)
def viewer_handler(args):
if args.viewer_type == "log":
log_viewer.start()
def main():
parser... |
aa34f571e93d298884f08014865a86a4c92dfcbd | main.py | main.py | __author__ = 'Chad Peterson'
__email__ = 'chapeter@cisco.com'
from CHROnIC_Portal import app
app.secret_key = '1234'
app.run(host='0.0.0.0', port=5001, debug=True)
| __author__ = 'Chad Peterson'
__email__ = 'chapeter@cisco.com'
from CHROnIC_Portal import app
app.secret_key = '1234'
app.run(host='0.0.0.0', port=5000, debug=True)
| Put port back to 5000. Missed change from integration testing... | Put port back to 5000. Missed change from integration testing...
| Python | mit | chapeter/CHROnIC_Portal,chapeter/CHROnIC_Portal | __author__ = 'Chad Peterson'
__email__ = 'chapeter@cisco.com'
from CHROnIC_Portal import app
app.secret_key = '1234'
app.run(host='0.0.0.0', port=5001, debug=True)
Put port back to 5000. Missed change from integration testing... | __author__ = 'Chad Peterson'
__email__ = 'chapeter@cisco.com'
from CHROnIC_Portal import app
app.secret_key = '1234'
app.run(host='0.0.0.0', port=5000, debug=True)
| <commit_before>__author__ = 'Chad Peterson'
__email__ = 'chapeter@cisco.com'
from CHROnIC_Portal import app
app.secret_key = '1234'
app.run(host='0.0.0.0', port=5001, debug=True)
<commit_msg>Put port back to 5000. Missed change from integration testing...<commit_after> | __author__ = 'Chad Peterson'
__email__ = 'chapeter@cisco.com'
from CHROnIC_Portal import app
app.secret_key = '1234'
app.run(host='0.0.0.0', port=5000, debug=True)
| __author__ = 'Chad Peterson'
__email__ = 'chapeter@cisco.com'
from CHROnIC_Portal import app
app.secret_key = '1234'
app.run(host='0.0.0.0', port=5001, debug=True)
Put port back to 5000. Missed change from integration testing...__author__ = 'Chad Peterson'
__email__ = 'chapeter@cisco.com'
from CHROnIC_Portal import... | <commit_before>__author__ = 'Chad Peterson'
__email__ = 'chapeter@cisco.com'
from CHROnIC_Portal import app
app.secret_key = '1234'
app.run(host='0.0.0.0', port=5001, debug=True)
<commit_msg>Put port back to 5000. Missed change from integration testing...<commit_after>__author__ = 'Chad Peterson'
__email__ = 'chapet... |
a4f010ed53615dcbe48c08a445e7d64045001133 | base_comment_template/tests/test_base_comment_template.py | base_comment_template/tests/test_base_comment_template.py | # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestResPartner(TransactionCase):
def setUp(self):
self.template_id = self.env['base.comment.template'].create({
'name': 'Comment before lines',
'position': 'before_... | # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestResPartner(TransactionCase):
def setUp(self):
super(TestResPartner, self).setUp()
self.template_id = self.env['base.comment.template'].create({
'name': 'Comment bef... | Move comment_template_id field to the Invoicing tab | [IMP] account_invoice_comment_template: Move comment_template_id field to the Invoicing tab
[IMP] account_invoice_comment_template: rename partner field name from comment_template_id to invoice_comment_template_id
[IMP] account_invoice_comment_template: Make partner field company_dependant and move domain definition ... | Python | agpl-3.0 | OCA/reporting-engine,OCA/reporting-engine,OCA/reporting-engine,OCA/reporting-engine | # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestResPartner(TransactionCase):
def setUp(self):
self.template_id = self.env['base.comment.template'].create({
'name': 'Comment before lines',
'position': 'before_... | # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestResPartner(TransactionCase):
def setUp(self):
super(TestResPartner, self).setUp()
self.template_id = self.env['base.comment.template'].create({
'name': 'Comment bef... | <commit_before># License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestResPartner(TransactionCase):
def setUp(self):
self.template_id = self.env['base.comment.template'].create({
'name': 'Comment before lines',
'posi... | # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestResPartner(TransactionCase):
def setUp(self):
super(TestResPartner, self).setUp()
self.template_id = self.env['base.comment.template'].create({
'name': 'Comment bef... | # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestResPartner(TransactionCase):
def setUp(self):
self.template_id = self.env['base.comment.template'].create({
'name': 'Comment before lines',
'position': 'before_... | <commit_before># License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestResPartner(TransactionCase):
def setUp(self):
self.template_id = self.env['base.comment.template'].create({
'name': 'Comment before lines',
'posi... |
0fd4ba14a16c6bfc100856dec0af6b17eb6917f2 | codewars/valid_braces.py | codewars/valid_braces.py | # Valid Braces
# http://www.codewars.com/kata/5277c8a221e209d3f6000b56/train/python
import unittest
def valid_braces(string: str) -> bool:
stack = []
braces = {')': '(', '}': '{', ']': '['}
for l in string:
if l in braces.values():
stack.append(l)
elif stack:
if... | Add solution for `Valid Braces` | Add solution for `Valid Braces`
| Python | mit | davidlukac/codekata-python | Add solution for `Valid Braces` | # Valid Braces
# http://www.codewars.com/kata/5277c8a221e209d3f6000b56/train/python
import unittest
def valid_braces(string: str) -> bool:
stack = []
braces = {')': '(', '}': '{', ']': '['}
for l in string:
if l in braces.values():
stack.append(l)
elif stack:
if... | <commit_before><commit_msg>Add solution for `Valid Braces`<commit_after> | # Valid Braces
# http://www.codewars.com/kata/5277c8a221e209d3f6000b56/train/python
import unittest
def valid_braces(string: str) -> bool:
stack = []
braces = {')': '(', '}': '{', ']': '['}
for l in string:
if l in braces.values():
stack.append(l)
elif stack:
if... | Add solution for `Valid Braces`# Valid Braces
# http://www.codewars.com/kata/5277c8a221e209d3f6000b56/train/python
import unittest
def valid_braces(string: str) -> bool:
stack = []
braces = {')': '(', '}': '{', ']': '['}
for l in string:
if l in braces.values():
stack.append(l)
... | <commit_before><commit_msg>Add solution for `Valid Braces`<commit_after># Valid Braces
# http://www.codewars.com/kata/5277c8a221e209d3f6000b56/train/python
import unittest
def valid_braces(string: str) -> bool:
stack = []
braces = {')': '(', '}': '{', ']': '['}
for l in string:
if l in braces.... | |
886d6e56e53742ec6cd2c59440459b17b093f4e0 | blockbuster/__init__.py | blockbuster/__init__.py | __author__ = 'Matt Stibbs'
__version__ = '1.26.04'
target_schema_version = '1.25.00'
from flask import Flask
app = Flask(__name__)
def startup():
import blockbuster.bb_dbconnector_factory
import blockbuster.bb_logging as log
import blockbuster.bb_auditlogger as audit
blockbuster.app.debug = blockbus... | __author__ = 'Matt Stibbs'
__version__ = '1.26.04'
target_schema_version = '1.25.00'
from flask import Flask
app = Flask(__name__)
def startup():
import blockbuster.bb_dbconnector_factory
import blockbuster.bb_logging as log
import blockbuster.bb_auditlogger as audit
blockbuster.app.debug = blockbus... | Tweak console output on startup | Tweak console output on startup
| Python | mit | mattstibbs/blockbuster-server,mattstibbs/blockbuster-server | __author__ = 'Matt Stibbs'
__version__ = '1.26.04'
target_schema_version = '1.25.00'
from flask import Flask
app = Flask(__name__)
def startup():
import blockbuster.bb_dbconnector_factory
import blockbuster.bb_logging as log
import blockbuster.bb_auditlogger as audit
blockbuster.app.debug = blockbus... | __author__ = 'Matt Stibbs'
__version__ = '1.26.04'
target_schema_version = '1.25.00'
from flask import Flask
app = Flask(__name__)
def startup():
import blockbuster.bb_dbconnector_factory
import blockbuster.bb_logging as log
import blockbuster.bb_auditlogger as audit
blockbuster.app.debug = blockbus... | <commit_before>__author__ = 'Matt Stibbs'
__version__ = '1.26.04'
target_schema_version = '1.25.00'
from flask import Flask
app = Flask(__name__)
def startup():
import blockbuster.bb_dbconnector_factory
import blockbuster.bb_logging as log
import blockbuster.bb_auditlogger as audit
blockbuster.app.d... | __author__ = 'Matt Stibbs'
__version__ = '1.26.04'
target_schema_version = '1.25.00'
from flask import Flask
app = Flask(__name__)
def startup():
import blockbuster.bb_dbconnector_factory
import blockbuster.bb_logging as log
import blockbuster.bb_auditlogger as audit
blockbuster.app.debug = blockbus... | __author__ = 'Matt Stibbs'
__version__ = '1.26.04'
target_schema_version = '1.25.00'
from flask import Flask
app = Flask(__name__)
def startup():
import blockbuster.bb_dbconnector_factory
import blockbuster.bb_logging as log
import blockbuster.bb_auditlogger as audit
blockbuster.app.debug = blockbus... | <commit_before>__author__ = 'Matt Stibbs'
__version__ = '1.26.04'
target_schema_version = '1.25.00'
from flask import Flask
app = Flask(__name__)
def startup():
import blockbuster.bb_dbconnector_factory
import blockbuster.bb_logging as log
import blockbuster.bb_auditlogger as audit
blockbuster.app.d... |
40095b001ab95fda4cc80bcc807508e9580ebf2d | fireplace/cards/gvg/neutral_legendary.py | fireplace/cards/gvg/neutral_legendary.py | from ..utils import *
##
# Minions
# Dr. Boom
class GVG_110:
action = [Summon(CONTROLLER, "GVG_110t") * 2]
# Boom Bot
class GVG_110t:
def deathrattle(self):
return [Hit(RANDOM_ENEMY_CHARACTER, random.randint(1, 4))]
# Sneed's Old Shredder
class GVG_114:
def deathrattle(self):
legendary = randomCollectible(... | from ..utils import *
##
# Minions
# Dr. Boom
class GVG_110:
action = [Summon(CONTROLLER, "GVG_110t") * 2]
# Boom Bot
class GVG_110t:
def deathrattle(self):
return [Hit(RANDOM_ENEMY_CHARACTER, random.randint(1, 4))]
# Sneed's Old Shredder
class GVG_114:
def deathrattle(self):
legendary = randomCollectible(... | Implement Toshley, Mekgineer Thermaplugg and Gazlowe | Implement Toshley, Mekgineer Thermaplugg and Gazlowe
| Python | agpl-3.0 | amw2104/fireplace,oftc-ftw/fireplace,smallnamespace/fireplace,smallnamespace/fireplace,liujimj/fireplace,oftc-ftw/fireplace,amw2104/fireplace,butozerca/fireplace,Ragowit/fireplace,liujimj/fireplace,jleclanche/fireplace,butozerca/fireplace,Ragowit/fireplace,NightKev/fireplace,beheh/fireplace,Meerkov/fireplace,Meerkov/fi... | from ..utils import *
##
# Minions
# Dr. Boom
class GVG_110:
action = [Summon(CONTROLLER, "GVG_110t") * 2]
# Boom Bot
class GVG_110t:
def deathrattle(self):
return [Hit(RANDOM_ENEMY_CHARACTER, random.randint(1, 4))]
# Sneed's Old Shredder
class GVG_114:
def deathrattle(self):
legendary = randomCollectible(... | from ..utils import *
##
# Minions
# Dr. Boom
class GVG_110:
action = [Summon(CONTROLLER, "GVG_110t") * 2]
# Boom Bot
class GVG_110t:
def deathrattle(self):
return [Hit(RANDOM_ENEMY_CHARACTER, random.randint(1, 4))]
# Sneed's Old Shredder
class GVG_114:
def deathrattle(self):
legendary = randomCollectible(... | <commit_before>from ..utils import *
##
# Minions
# Dr. Boom
class GVG_110:
action = [Summon(CONTROLLER, "GVG_110t") * 2]
# Boom Bot
class GVG_110t:
def deathrattle(self):
return [Hit(RANDOM_ENEMY_CHARACTER, random.randint(1, 4))]
# Sneed's Old Shredder
class GVG_114:
def deathrattle(self):
legendary = ran... | from ..utils import *
##
# Minions
# Dr. Boom
class GVG_110:
action = [Summon(CONTROLLER, "GVG_110t") * 2]
# Boom Bot
class GVG_110t:
def deathrattle(self):
return [Hit(RANDOM_ENEMY_CHARACTER, random.randint(1, 4))]
# Sneed's Old Shredder
class GVG_114:
def deathrattle(self):
legendary = randomCollectible(... | from ..utils import *
##
# Minions
# Dr. Boom
class GVG_110:
action = [Summon(CONTROLLER, "GVG_110t") * 2]
# Boom Bot
class GVG_110t:
def deathrattle(self):
return [Hit(RANDOM_ENEMY_CHARACTER, random.randint(1, 4))]
# Sneed's Old Shredder
class GVG_114:
def deathrattle(self):
legendary = randomCollectible(... | <commit_before>from ..utils import *
##
# Minions
# Dr. Boom
class GVG_110:
action = [Summon(CONTROLLER, "GVG_110t") * 2]
# Boom Bot
class GVG_110t:
def deathrattle(self):
return [Hit(RANDOM_ENEMY_CHARACTER, random.randint(1, 4))]
# Sneed's Old Shredder
class GVG_114:
def deathrattle(self):
legendary = ran... |
dd445cbf33268ece3a6b006d3d31d6169fec03b8 | acoustid/scripts/backfill_meta_created.py | acoustid/scripts/backfill_meta_created.py | #!/usr/bin/env python
# Copyright (C) 2019 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import logging
logger = logging.getLogger(__name__)
def run_backfill_meta_created(script, opts, args):
if script.config.cluster.role != 'master':
logger.info('Not running bac... | #!/usr/bin/env python
# Copyright (C) 2019 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import logging
logger = logging.getLogger(__name__)
def run_backfill_meta_created(script, opts, args):
if script.config.cluster.role != 'master':
logger.info('Not running bac... | Increase the number of backill_meta_created iterations | Increase the number of backill_meta_created iterations
| Python | mit | lalinsky/acoustid-server,lalinsky/acoustid-server,lalinsky/acoustid-server,lalinsky/acoustid-server | #!/usr/bin/env python
# Copyright (C) 2019 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import logging
logger = logging.getLogger(__name__)
def run_backfill_meta_created(script, opts, args):
if script.config.cluster.role != 'master':
logger.info('Not running bac... | #!/usr/bin/env python
# Copyright (C) 2019 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import logging
logger = logging.getLogger(__name__)
def run_backfill_meta_created(script, opts, args):
if script.config.cluster.role != 'master':
logger.info('Not running bac... | <commit_before>#!/usr/bin/env python
# Copyright (C) 2019 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import logging
logger = logging.getLogger(__name__)
def run_backfill_meta_created(script, opts, args):
if script.config.cluster.role != 'master':
logger.info('... | #!/usr/bin/env python
# Copyright (C) 2019 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import logging
logger = logging.getLogger(__name__)
def run_backfill_meta_created(script, opts, args):
if script.config.cluster.role != 'master':
logger.info('Not running bac... | #!/usr/bin/env python
# Copyright (C) 2019 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import logging
logger = logging.getLogger(__name__)
def run_backfill_meta_created(script, opts, args):
if script.config.cluster.role != 'master':
logger.info('Not running bac... | <commit_before>#!/usr/bin/env python
# Copyright (C) 2019 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import logging
logger = logging.getLogger(__name__)
def run_backfill_meta_created(script, opts, args):
if script.config.cluster.role != 'master':
logger.info('... |
1ad03769569d86d1eda45f7c6582234ed455ea88 | src/main.py | src/main.py | """Where player runs the game"""
import random
import time
import board
import conversion
import games
if __name__ == '__main__':
NUMBER_OF_TRIALS = 1
for i in range(NUMBER_OF_TRIALS):
X_LOC_CHESS, Y_LOC_CHESS = board.identify_random_square()
LOCATION = conversion.coordinate_to_alg(X_LOC_CHES... | """Where player runs the game"""
import random
import time
import board
import conversion
import games
from settings import RECORD_FILE
def write_record_to_file(a_string, file_name):
with open(file_name, 'w') as f:
f.write(a_string)
def get_record_from_file(file_name):
with open(file_name, 'r') as f... | Add functions to read/write to a record file | Add functions to read/write to a record file
| Python | mit | blairck/chess_notation | """Where player runs the game"""
import random
import time
import board
import conversion
import games
if __name__ == '__main__':
NUMBER_OF_TRIALS = 1
for i in range(NUMBER_OF_TRIALS):
X_LOC_CHESS, Y_LOC_CHESS = board.identify_random_square()
LOCATION = conversion.coordinate_to_alg(X_LOC_CHES... | """Where player runs the game"""
import random
import time
import board
import conversion
import games
from settings import RECORD_FILE
def write_record_to_file(a_string, file_name):
with open(file_name, 'w') as f:
f.write(a_string)
def get_record_from_file(file_name):
with open(file_name, 'r') as f... | <commit_before>"""Where player runs the game"""
import random
import time
import board
import conversion
import games
if __name__ == '__main__':
NUMBER_OF_TRIALS = 1
for i in range(NUMBER_OF_TRIALS):
X_LOC_CHESS, Y_LOC_CHESS = board.identify_random_square()
LOCATION = conversion.coordinate_to... | """Where player runs the game"""
import random
import time
import board
import conversion
import games
from settings import RECORD_FILE
def write_record_to_file(a_string, file_name):
with open(file_name, 'w') as f:
f.write(a_string)
def get_record_from_file(file_name):
with open(file_name, 'r') as f... | """Where player runs the game"""
import random
import time
import board
import conversion
import games
if __name__ == '__main__':
NUMBER_OF_TRIALS = 1
for i in range(NUMBER_OF_TRIALS):
X_LOC_CHESS, Y_LOC_CHESS = board.identify_random_square()
LOCATION = conversion.coordinate_to_alg(X_LOC_CHES... | <commit_before>"""Where player runs the game"""
import random
import time
import board
import conversion
import games
if __name__ == '__main__':
NUMBER_OF_TRIALS = 1
for i in range(NUMBER_OF_TRIALS):
X_LOC_CHESS, Y_LOC_CHESS = board.identify_random_square()
LOCATION = conversion.coordinate_to... |
96d12496e425806a635ba345a534c0ca2790754d | satchmo/apps/payment/modules/giftcertificate/processor.py | satchmo/apps/payment/modules/giftcertificate/processor.py | """
GiftCertificate processor
"""
from django.utils.translation import ugettext as _
from l10n.utils import moneyfmt
from models import GiftCertificate
from payment.modules.base import BasePaymentProcessor, ProcessorResult, NOTSET
class PaymentProcessor(BasePaymentProcessor):
def __init__(self, settings):
... | """
GiftCertificate processor
"""
from django.utils.translation import ugettext as _
from l10n.utils import moneyfmt
from models import GiftCertificate
from payment.modules.base import BasePaymentProcessor, ProcessorResult, NOTSET
class PaymentProcessor(BasePaymentProcessor):
def __init__(self, settings):
... | Fix the gift certificate module so that an invalid code won't throw an exception. | Fix the gift certificate module so that an invalid code won't throw an exception.
| Python | bsd-3-clause | twidi/satchmo,ringemup/satchmo,ringemup/satchmo,dokterbob/satchmo,twidi/satchmo,dokterbob/satchmo,Ryati/satchmo,Ryati/satchmo | """
GiftCertificate processor
"""
from django.utils.translation import ugettext as _
from l10n.utils import moneyfmt
from models import GiftCertificate
from payment.modules.base import BasePaymentProcessor, ProcessorResult, NOTSET
class PaymentProcessor(BasePaymentProcessor):
def __init__(self, settings):
... | """
GiftCertificate processor
"""
from django.utils.translation import ugettext as _
from l10n.utils import moneyfmt
from models import GiftCertificate
from payment.modules.base import BasePaymentProcessor, ProcessorResult, NOTSET
class PaymentProcessor(BasePaymentProcessor):
def __init__(self, settings):
... | <commit_before>"""
GiftCertificate processor
"""
from django.utils.translation import ugettext as _
from l10n.utils import moneyfmt
from models import GiftCertificate
from payment.modules.base import BasePaymentProcessor, ProcessorResult, NOTSET
class PaymentProcessor(BasePaymentProcessor):
def __init__(self, set... | """
GiftCertificate processor
"""
from django.utils.translation import ugettext as _
from l10n.utils import moneyfmt
from models import GiftCertificate
from payment.modules.base import BasePaymentProcessor, ProcessorResult, NOTSET
class PaymentProcessor(BasePaymentProcessor):
def __init__(self, settings):
... | """
GiftCertificate processor
"""
from django.utils.translation import ugettext as _
from l10n.utils import moneyfmt
from models import GiftCertificate
from payment.modules.base import BasePaymentProcessor, ProcessorResult, NOTSET
class PaymentProcessor(BasePaymentProcessor):
def __init__(self, settings):
... | <commit_before>"""
GiftCertificate processor
"""
from django.utils.translation import ugettext as _
from l10n.utils import moneyfmt
from models import GiftCertificate
from payment.modules.base import BasePaymentProcessor, ProcessorResult, NOTSET
class PaymentProcessor(BasePaymentProcessor):
def __init__(self, set... |
056d82002c133736a800b08bd071b71c9f5615f8 | ci/generate_pipeline_yml.py | ci/generate_pipeline_yml.py | #!/usr/bin/env python
import os
from jinja2 import Template
clusters = ['2_7_lts', '2_9', '2_10', '2_11_lts2']
# Commenting out this as we only have one example and it breaks
tiles = [] # [d for d in os.listdir('../examples') if os.path.isdir(os.path.join('../examples', d))]
with open('pipeline.yml.jinja2', 'r') as ... | #!/usr/bin/env python
import os
from jinja2 import Template
clusters = ['2_7_lts', '2_11_lts2', '2_12', '2_13']
# Commenting out this as we only have one example and it breaks
tiles = [] # [d for d in os.listdir('../examples') if os.path.isdir(os.path.join('../examples', d))]
with open('pipeline.yml.jinja2', 'r') as... | Update TAS versions we test against | Update TAS versions we test against
| Python | apache-2.0 | cf-platform-eng/tile-generator,cf-platform-eng/tile-generator,cf-platform-eng/tile-generator,cf-platform-eng/tile-generator | #!/usr/bin/env python
import os
from jinja2 import Template
clusters = ['2_7_lts', '2_9', '2_10', '2_11_lts2']
# Commenting out this as we only have one example and it breaks
tiles = [] # [d for d in os.listdir('../examples') if os.path.isdir(os.path.join('../examples', d))]
with open('pipeline.yml.jinja2', 'r') as ... | #!/usr/bin/env python
import os
from jinja2 import Template
clusters = ['2_7_lts', '2_11_lts2', '2_12', '2_13']
# Commenting out this as we only have one example and it breaks
tiles = [] # [d for d in os.listdir('../examples') if os.path.isdir(os.path.join('../examples', d))]
with open('pipeline.yml.jinja2', 'r') as... | <commit_before>#!/usr/bin/env python
import os
from jinja2 import Template
clusters = ['2_7_lts', '2_9', '2_10', '2_11_lts2']
# Commenting out this as we only have one example and it breaks
tiles = [] # [d for d in os.listdir('../examples') if os.path.isdir(os.path.join('../examples', d))]
with open('pipeline.yml.ji... | #!/usr/bin/env python
import os
from jinja2 import Template
clusters = ['2_7_lts', '2_11_lts2', '2_12', '2_13']
# Commenting out this as we only have one example and it breaks
tiles = [] # [d for d in os.listdir('../examples') if os.path.isdir(os.path.join('../examples', d))]
with open('pipeline.yml.jinja2', 'r') as... | #!/usr/bin/env python
import os
from jinja2 import Template
clusters = ['2_7_lts', '2_9', '2_10', '2_11_lts2']
# Commenting out this as we only have one example and it breaks
tiles = [] # [d for d in os.listdir('../examples') if os.path.isdir(os.path.join('../examples', d))]
with open('pipeline.yml.jinja2', 'r') as ... | <commit_before>#!/usr/bin/env python
import os
from jinja2 import Template
clusters = ['2_7_lts', '2_9', '2_10', '2_11_lts2']
# Commenting out this as we only have one example and it breaks
tiles = [] # [d for d in os.listdir('../examples') if os.path.isdir(os.path.join('../examples', d))]
with open('pipeline.yml.ji... |
bc8d7a7572fcde45ae95176301522979fa54aa87 | carnifex/test/unit/mocks.py | carnifex/test/unit/mocks.py | from twisted.internet._baseprocess import BaseProcess
from carnifex.inductor import ProcessInductor
from twisted.internet.error import ProcessTerminated, ProcessDone
class MockProcess(BaseProcess):
def run(self, fauxProcessData):
for childFd, data in fauxProcessData:
self.proto.childDataReceiv... | from twisted.internet._baseprocess import BaseProcess
from carnifex.inductor import ProcessInductor
from twisted.internet.error import ProcessTerminated, ProcessDone
class MockProcess(BaseProcess):
def run(self, fauxProcessData):
for childFd, data in fauxProcessData:
self.proto.childDataReceiv... | Allow specifying what exit code to use when emulating process exit | Allow specifying what exit code to use when emulating process exit
| Python | mit | sporsh/carnifex | from twisted.internet._baseprocess import BaseProcess
from carnifex.inductor import ProcessInductor
from twisted.internet.error import ProcessTerminated, ProcessDone
class MockProcess(BaseProcess):
def run(self, fauxProcessData):
for childFd, data in fauxProcessData:
self.proto.childDataReceiv... | from twisted.internet._baseprocess import BaseProcess
from carnifex.inductor import ProcessInductor
from twisted.internet.error import ProcessTerminated, ProcessDone
class MockProcess(BaseProcess):
def run(self, fauxProcessData):
for childFd, data in fauxProcessData:
self.proto.childDataReceiv... | <commit_before>from twisted.internet._baseprocess import BaseProcess
from carnifex.inductor import ProcessInductor
from twisted.internet.error import ProcessTerminated, ProcessDone
class MockProcess(BaseProcess):
def run(self, fauxProcessData):
for childFd, data in fauxProcessData:
self.proto.... | from twisted.internet._baseprocess import BaseProcess
from carnifex.inductor import ProcessInductor
from twisted.internet.error import ProcessTerminated, ProcessDone
class MockProcess(BaseProcess):
def run(self, fauxProcessData):
for childFd, data in fauxProcessData:
self.proto.childDataReceiv... | from twisted.internet._baseprocess import BaseProcess
from carnifex.inductor import ProcessInductor
from twisted.internet.error import ProcessTerminated, ProcessDone
class MockProcess(BaseProcess):
def run(self, fauxProcessData):
for childFd, data in fauxProcessData:
self.proto.childDataReceiv... | <commit_before>from twisted.internet._baseprocess import BaseProcess
from carnifex.inductor import ProcessInductor
from twisted.internet.error import ProcessTerminated, ProcessDone
class MockProcess(BaseProcess):
def run(self, fauxProcessData):
for childFd, data in fauxProcessData:
self.proto.... |
fdaabeaa3694103153c81a18971e6b55597cd66e | Sketches/JT/Jam/library/trunk/Kamaelia/Apps/Jam/Audio/Synth.py | Sketches/JT/Jam/library/trunk/Kamaelia/Apps/Jam/Audio/Synth.py | import Axon
from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser
from Kamaelia.Apps.Jam.Audio.Mixer import MonoMixer
class Synth(Axon.Component.component):
polyphony = 8
polyphoniser = Polyphoniser
def __init__(self, voiceGenerator, **argd):
super(Synth, self).__init__(**argd)
polyph... | import Axon
from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser
class Synth(Axon.Component.component):
polyphony = 8
polyphoniser = Polyphoniser
def __init__(self, voiceGenerator, **argd):
super(Synth, self).__init__(**argd)
polyphoniser = self.polyphoniser(**argd).activate()
... | Remove mixer section from synth code to reflect the components directly calling pygame mixer methods. | Remove mixer section from synth code to reflect the components directly calling pygame mixer methods.
| Python | apache-2.0 | sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia | import Axon
from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser
from Kamaelia.Apps.Jam.Audio.Mixer import MonoMixer
class Synth(Axon.Component.component):
polyphony = 8
polyphoniser = Polyphoniser
def __init__(self, voiceGenerator, **argd):
super(Synth, self).__init__(**argd)
polyph... | import Axon
from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser
class Synth(Axon.Component.component):
polyphony = 8
polyphoniser = Polyphoniser
def __init__(self, voiceGenerator, **argd):
super(Synth, self).__init__(**argd)
polyphoniser = self.polyphoniser(**argd).activate()
... | <commit_before>import Axon
from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser
from Kamaelia.Apps.Jam.Audio.Mixer import MonoMixer
class Synth(Axon.Component.component):
polyphony = 8
polyphoniser = Polyphoniser
def __init__(self, voiceGenerator, **argd):
super(Synth, self).__init__(**argd)... | import Axon
from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser
class Synth(Axon.Component.component):
polyphony = 8
polyphoniser = Polyphoniser
def __init__(self, voiceGenerator, **argd):
super(Synth, self).__init__(**argd)
polyphoniser = self.polyphoniser(**argd).activate()
... | import Axon
from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser
from Kamaelia.Apps.Jam.Audio.Mixer import MonoMixer
class Synth(Axon.Component.component):
polyphony = 8
polyphoniser = Polyphoniser
def __init__(self, voiceGenerator, **argd):
super(Synth, self).__init__(**argd)
polyph... | <commit_before>import Axon
from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser
from Kamaelia.Apps.Jam.Audio.Mixer import MonoMixer
class Synth(Axon.Component.component):
polyphony = 8
polyphoniser = Polyphoniser
def __init__(self, voiceGenerator, **argd):
super(Synth, self).__init__(**argd)... |
75e14847fe2c0f0c40897e449bab093f4be1b17c | cineapp/jinja_filters.py | cineapp/jinja_filters.py | # -*- coding: utf-8 -*-
from cineapp import app
@app.template_filter()
def minutes_to_human_duration(minutes_duration):
"""
Convert a duration in minutes into a duration in a cool format human readable
"""
try:
hours,minutes = divmod(minutes_duration,60)
return "%sh %smin" %(hours,minutes)
except TypeError:
... | # -*- coding: utf-8 -*-
from cineapp import app
import datetime
@app.template_filter()
def minutes_to_human_duration(minutes_duration):
"""
Convert a duration in minutes into a duration in a cool format human readable
"""
try:
hours,minutes = divmod(minutes_duration,60)
return "%sh %smin" %(hours,minutes)
ex... | Improve jinja filter date converter | Improve jinja filter date converter
The filter now can convert date which are strings and not datetime objects.
| Python | mit | ptitoliv/cineapp,ptitoliv/cineapp,ptitoliv/cineapp | # -*- coding: utf-8 -*-
from cineapp import app
@app.template_filter()
def minutes_to_human_duration(minutes_duration):
"""
Convert a duration in minutes into a duration in a cool format human readable
"""
try:
hours,minutes = divmod(minutes_duration,60)
return "%sh %smin" %(hours,minutes)
except TypeError:
... | # -*- coding: utf-8 -*-
from cineapp import app
import datetime
@app.template_filter()
def minutes_to_human_duration(minutes_duration):
"""
Convert a duration in minutes into a duration in a cool format human readable
"""
try:
hours,minutes = divmod(minutes_duration,60)
return "%sh %smin" %(hours,minutes)
ex... | <commit_before># -*- coding: utf-8 -*-
from cineapp import app
@app.template_filter()
def minutes_to_human_duration(minutes_duration):
"""
Convert a duration in minutes into a duration in a cool format human readable
"""
try:
hours,minutes = divmod(minutes_duration,60)
return "%sh %smin" %(hours,minutes)
exc... | # -*- coding: utf-8 -*-
from cineapp import app
import datetime
@app.template_filter()
def minutes_to_human_duration(minutes_duration):
"""
Convert a duration in minutes into a duration in a cool format human readable
"""
try:
hours,minutes = divmod(minutes_duration,60)
return "%sh %smin" %(hours,minutes)
ex... | # -*- coding: utf-8 -*-
from cineapp import app
@app.template_filter()
def minutes_to_human_duration(minutes_duration):
"""
Convert a duration in minutes into a duration in a cool format human readable
"""
try:
hours,minutes = divmod(minutes_duration,60)
return "%sh %smin" %(hours,minutes)
except TypeError:
... | <commit_before># -*- coding: utf-8 -*-
from cineapp import app
@app.template_filter()
def minutes_to_human_duration(minutes_duration):
"""
Convert a duration in minutes into a duration in a cool format human readable
"""
try:
hours,minutes = divmod(minutes_duration,60)
return "%sh %smin" %(hours,minutes)
exc... |
4974f83d9ed1e085ef2daaeba4db56a4001055cf | comics/comics/ctrlaltdel.py | comics/comics/ctrlaltdel.py | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Ctrl+Alt+Del"
language = "en"
url = "http://www.cad-comic.com/cad/"
start_date = "2002-10-23"
rights = "Tim Buckley"
class Crawler(CrawlerBase)... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Ctrl+Alt+Del"
language = "en"
url = "https://cad-comic.com/category/ctrl-alt-del/"
start_date = "2002-10-23"
rights = "Tim Buckley"
class Crawl... | Update "Ctrl+Alt+Del" after site change | Update "Ctrl+Alt+Del" after site change
| Python | agpl-3.0 | datagutten/comics,jodal/comics,datagutten/comics,datagutten/comics,datagutten/comics,jodal/comics,jodal/comics,jodal/comics | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Ctrl+Alt+Del"
language = "en"
url = "http://www.cad-comic.com/cad/"
start_date = "2002-10-23"
rights = "Tim Buckley"
class Crawler(CrawlerBase)... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Ctrl+Alt+Del"
language = "en"
url = "https://cad-comic.com/category/ctrl-alt-del/"
start_date = "2002-10-23"
rights = "Tim Buckley"
class Crawl... | <commit_before>from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Ctrl+Alt+Del"
language = "en"
url = "http://www.cad-comic.com/cad/"
start_date = "2002-10-23"
rights = "Tim Buckley"
class Crawl... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Ctrl+Alt+Del"
language = "en"
url = "https://cad-comic.com/category/ctrl-alt-del/"
start_date = "2002-10-23"
rights = "Tim Buckley"
class Crawl... | from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Ctrl+Alt+Del"
language = "en"
url = "http://www.cad-comic.com/cad/"
start_date = "2002-10-23"
rights = "Tim Buckley"
class Crawler(CrawlerBase)... | <commit_before>from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Ctrl+Alt+Del"
language = "en"
url = "http://www.cad-comic.com/cad/"
start_date = "2002-10-23"
rights = "Tim Buckley"
class Crawl... |
4007ecdc66e361bcb81bb5b661e682eeef0a6ea5 | remo/profiles/migrations/0011_groups_new_onboarding_group.py | remo/profiles/migrations/0011_groups_new_onboarding_group.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def forwards(apps, schema_editor):
"""Create Onboarding group."""
Group = apps.get_model('auth', 'Group')
Group.objects.create(name='Onboarding')
def backwards(apps, schema_editor):
"""Delete On... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def forwards(apps, schema_editor):
"""Create Onboarding group."""
Group = apps.get_model('auth', 'Group')
if not Group.objects.filter(name='Onboarding').exists():
Group.objects.create(name='On... | Check if Onboarding exists before creating. | Check if Onboarding exists before creating.
| Python | bsd-3-clause | mozilla/remo,akatsoulas/remo,Mte90/remo,mozilla/remo,Mte90/remo,akatsoulas/remo,mozilla/remo,Mte90/remo,mozilla/remo,akatsoulas/remo,akatsoulas/remo,Mte90/remo | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def forwards(apps, schema_editor):
"""Create Onboarding group."""
Group = apps.get_model('auth', 'Group')
Group.objects.create(name='Onboarding')
def backwards(apps, schema_editor):
"""Delete On... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def forwards(apps, schema_editor):
"""Create Onboarding group."""
Group = apps.get_model('auth', 'Group')
if not Group.objects.filter(name='Onboarding').exists():
Group.objects.create(name='On... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def forwards(apps, schema_editor):
"""Create Onboarding group."""
Group = apps.get_model('auth', 'Group')
Group.objects.create(name='Onboarding')
def backwards(apps, schema_editor):
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def forwards(apps, schema_editor):
"""Create Onboarding group."""
Group = apps.get_model('auth', 'Group')
if not Group.objects.filter(name='Onboarding').exists():
Group.objects.create(name='On... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def forwards(apps, schema_editor):
"""Create Onboarding group."""
Group = apps.get_model('auth', 'Group')
Group.objects.create(name='Onboarding')
def backwards(apps, schema_editor):
"""Delete On... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def forwards(apps, schema_editor):
"""Create Onboarding group."""
Group = apps.get_model('auth', 'Group')
Group.objects.create(name='Onboarding')
def backwards(apps, schema_editor):
... |
5e3be1d123063495f21d0c0068c7132d43fd9724 | account/models.py | account/models.py | from django.db import models
from django.db.models import signals
from django.contrib.auth.models import User
from course.models import Term
class Profile(models.Model):
user = models.OneToOneField(User)
student_id = models.CharField(max_length=10, null=True)
default_term = models.ForeignKey(Term, null=Tru... | from django.db import models
from django.db.models import signals
from django.contrib.auth.models import User
from course.models import Term
class Profile(models.Model):
user = models.OneToOneField(User)
student_id = models.CharField(max_length=10, null=True)
default_term = models.ForeignKey(Term, null=Tru... | Fix login error for new accounts where a profile doesn't exist | Fix login error for new accounts where a profile doesn't exist
| Python | apache-2.0 | OpenCourseProject/OpenCourse,gravitylow/OpenCourse,gravitylow/OpenCourse,gravitylow/OpenCourse,OpenCourseProject/OpenCourse,OpenCourseProject/OpenCourse | from django.db import models
from django.db.models import signals
from django.contrib.auth.models import User
from course.models import Term
class Profile(models.Model):
user = models.OneToOneField(User)
student_id = models.CharField(max_length=10, null=True)
default_term = models.ForeignKey(Term, null=Tru... | from django.db import models
from django.db.models import signals
from django.contrib.auth.models import User
from course.models import Term
class Profile(models.Model):
user = models.OneToOneField(User)
student_id = models.CharField(max_length=10, null=True)
default_term = models.ForeignKey(Term, null=Tru... | <commit_before>from django.db import models
from django.db.models import signals
from django.contrib.auth.models import User
from course.models import Term
class Profile(models.Model):
user = models.OneToOneField(User)
student_id = models.CharField(max_length=10, null=True)
default_term = models.ForeignKey... | from django.db import models
from django.db.models import signals
from django.contrib.auth.models import User
from course.models import Term
class Profile(models.Model):
user = models.OneToOneField(User)
student_id = models.CharField(max_length=10, null=True)
default_term = models.ForeignKey(Term, null=Tru... | from django.db import models
from django.db.models import signals
from django.contrib.auth.models import User
from course.models import Term
class Profile(models.Model):
user = models.OneToOneField(User)
student_id = models.CharField(max_length=10, null=True)
default_term = models.ForeignKey(Term, null=Tru... | <commit_before>from django.db import models
from django.db.models import signals
from django.contrib.auth.models import User
from course.models import Term
class Profile(models.Model):
user = models.OneToOneField(User)
student_id = models.CharField(max_length=10, null=True)
default_term = models.ForeignKey... |
7a07a89d59250127fce21b5f1b68492046b3eb60 | pyshelf/search/metadata.py | pyshelf/search/metadata.py | from elasticsearch_dsl import String, Nested, Boolean, DocType, tokenizer, analyzer
# Required for case sensitivity
metadata_analyzer = analyzer("metadata_analyzer", tokenizer=tokenizer("keyword"))
class Metadata(DocType):
property_list = Nested(
properties={
"name": String(),
"v... | from elasticsearch_dsl import String, Nested, Boolean, DocType, tokenizer, analyzer
# Required for case sensitivity
# To add an analyzer to an existing mapping requires mapping to be "closed"
case_sensitive_analyzer = analyzer("case_sensitive_analyzer", tokenizer=tokenizer("keyword"))
class Metadata(DocType):
p... | Add case sensitivity to field and clarify analyzer. | Add case sensitivity to field and clarify analyzer.
| Python | mit | not-nexus/shelf,kyle-long/pyshelf,kyle-long/pyshelf,not-nexus/shelf | from elasticsearch_dsl import String, Nested, Boolean, DocType, tokenizer, analyzer
# Required for case sensitivity
metadata_analyzer = analyzer("metadata_analyzer", tokenizer=tokenizer("keyword"))
class Metadata(DocType):
property_list = Nested(
properties={
"name": String(),
"v... | from elasticsearch_dsl import String, Nested, Boolean, DocType, tokenizer, analyzer
# Required for case sensitivity
# To add an analyzer to an existing mapping requires mapping to be "closed"
case_sensitive_analyzer = analyzer("case_sensitive_analyzer", tokenizer=tokenizer("keyword"))
class Metadata(DocType):
p... | <commit_before>from elasticsearch_dsl import String, Nested, Boolean, DocType, tokenizer, analyzer
# Required for case sensitivity
metadata_analyzer = analyzer("metadata_analyzer", tokenizer=tokenizer("keyword"))
class Metadata(DocType):
property_list = Nested(
properties={
"name": String(),... | from elasticsearch_dsl import String, Nested, Boolean, DocType, tokenizer, analyzer
# Required for case sensitivity
# To add an analyzer to an existing mapping requires mapping to be "closed"
case_sensitive_analyzer = analyzer("case_sensitive_analyzer", tokenizer=tokenizer("keyword"))
class Metadata(DocType):
p... | from elasticsearch_dsl import String, Nested, Boolean, DocType, tokenizer, analyzer
# Required for case sensitivity
metadata_analyzer = analyzer("metadata_analyzer", tokenizer=tokenizer("keyword"))
class Metadata(DocType):
property_list = Nested(
properties={
"name": String(),
"v... | <commit_before>from elasticsearch_dsl import String, Nested, Boolean, DocType, tokenizer, analyzer
# Required for case sensitivity
metadata_analyzer = analyzer("metadata_analyzer", tokenizer=tokenizer("keyword"))
class Metadata(DocType):
property_list = Nested(
properties={
"name": String(),... |
7bc777a5e9fb15720dd6b41aa5e1fbcfd7d3141b | tests/test_postgres_processor.py | tests/test_postgres_processor.py | import pytest
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
from . import utils
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi.processing.postgres import PostgresProcessor, Document
test_db = PostgresProcessor()
NORMALIZED = NormalizedDocument(utils.RE... | import pytest
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
from . import utils
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi.processing.postgres import PostgresProcessor, Document
test_db = PostgresProcessor()
NORMALIZED = NormalizedDocument(utils.RE... | Add django pytest mark to process raw test | Add django pytest mark to process raw test
| Python | apache-2.0 | CenterForOpenScience/scrapi,felliott/scrapi,mehanig/scrapi,CenterForOpenScience/scrapi,fabianvf/scrapi,erinspace/scrapi,erinspace/scrapi,felliott/scrapi,mehanig/scrapi,fabianvf/scrapi | import pytest
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
from . import utils
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi.processing.postgres import PostgresProcessor, Document
test_db = PostgresProcessor()
NORMALIZED = NormalizedDocument(utils.RE... | import pytest
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
from . import utils
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi.processing.postgres import PostgresProcessor, Document
test_db = PostgresProcessor()
NORMALIZED = NormalizedDocument(utils.RE... | <commit_before>import pytest
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
from . import utils
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi.processing.postgres import PostgresProcessor, Document
test_db = PostgresProcessor()
NORMALIZED = NormalizedDo... | import pytest
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
from . import utils
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi.processing.postgres import PostgresProcessor, Document
test_db = PostgresProcessor()
NORMALIZED = NormalizedDocument(utils.RE... | import pytest
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
from . import utils
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi.processing.postgres import PostgresProcessor, Document
test_db = PostgresProcessor()
NORMALIZED = NormalizedDocument(utils.RE... | <commit_before>import pytest
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings")
from . import utils
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi.processing.postgres import PostgresProcessor, Document
test_db = PostgresProcessor()
NORMALIZED = NormalizedDo... |
53646da453a4aa6d0e559ee3069626458f2fef78 | common/urls.py | common/urls.py | import json
import os
import re
from django.urls import re_path
from civictechprojects import views
def url_generator_from_pattern(pattern):
return re.sub("\\(.+\\)", "{id}", pattern)
def generate_url_patterns(spec_path, set_url_generators=False):
# Read json file
base_dir = os.path.dirname(__file__)
... | import json
import os
import re
from django.urls import re_path
from civictechprojects import views
def url_generator_from_pattern(pattern):
_pattern = pattern.replace('^', '').replace('$', '')
return re.sub("\\(.+\\)", "{id}", _pattern)
def generate_url_patterns(spec_path, set_url_generators=False):
# ... | Fix backend home page url generator | Fix backend home page url generator
| Python | mit | DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange | import json
import os
import re
from django.urls import re_path
from civictechprojects import views
def url_generator_from_pattern(pattern):
return re.sub("\\(.+\\)", "{id}", pattern)
def generate_url_patterns(spec_path, set_url_generators=False):
# Read json file
base_dir = os.path.dirname(__file__)
... | import json
import os
import re
from django.urls import re_path
from civictechprojects import views
def url_generator_from_pattern(pattern):
_pattern = pattern.replace('^', '').replace('$', '')
return re.sub("\\(.+\\)", "{id}", _pattern)
def generate_url_patterns(spec_path, set_url_generators=False):
# ... | <commit_before>import json
import os
import re
from django.urls import re_path
from civictechprojects import views
def url_generator_from_pattern(pattern):
return re.sub("\\(.+\\)", "{id}", pattern)
def generate_url_patterns(spec_path, set_url_generators=False):
# Read json file
base_dir = os.path.dirna... | import json
import os
import re
from django.urls import re_path
from civictechprojects import views
def url_generator_from_pattern(pattern):
_pattern = pattern.replace('^', '').replace('$', '')
return re.sub("\\(.+\\)", "{id}", _pattern)
def generate_url_patterns(spec_path, set_url_generators=False):
# ... | import json
import os
import re
from django.urls import re_path
from civictechprojects import views
def url_generator_from_pattern(pattern):
return re.sub("\\(.+\\)", "{id}", pattern)
def generate_url_patterns(spec_path, set_url_generators=False):
# Read json file
base_dir = os.path.dirname(__file__)
... | <commit_before>import json
import os
import re
from django.urls import re_path
from civictechprojects import views
def url_generator_from_pattern(pattern):
return re.sub("\\(.+\\)", "{id}", pattern)
def generate_url_patterns(spec_path, set_url_generators=False):
# Read json file
base_dir = os.path.dirna... |
0f8e2313d6f0ec06806ea05e861d1fc47d3c3016 | utils/internal/zz_parse.py | utils/internal/zz_parse.py | import sys
sys.path.insert(0, '../..')
from pycparser import c_parser, c_ast, parse_file
if __name__ == "__main__":
#ast = parse_file('zc_pp.c', use_cpp=True, cpp_path="../cpp.exe")
parser = c_parser.CParser()
#code = r'''int ar[30];'''
code = r'''
char ***arr3d[40];
'''
#code = r'''
... | from __future__ import print_function
import sys
from pycparser import c_parser, c_generator, c_ast, parse_file
if __name__ == "__main__":
parser = c_parser.CParser()
code = r'''
void* ptr = (int[ ]){0};
'''
print(code)
ast = parser.parse(code)
ast.show(attrnames=True, nodenames=True)
... | Clean up internal hacking util | Clean up internal hacking util
| Python | bsd-3-clause | CtheSky/pycparser,CtheSky/pycparser,CtheSky/pycparser | import sys
sys.path.insert(0, '../..')
from pycparser import c_parser, c_ast, parse_file
if __name__ == "__main__":
#ast = parse_file('zc_pp.c', use_cpp=True, cpp_path="../cpp.exe")
parser = c_parser.CParser()
#code = r'''int ar[30];'''
code = r'''
char ***arr3d[40];
'''
#code = r'''
... | from __future__ import print_function
import sys
from pycparser import c_parser, c_generator, c_ast, parse_file
if __name__ == "__main__":
parser = c_parser.CParser()
code = r'''
void* ptr = (int[ ]){0};
'''
print(code)
ast = parser.parse(code)
ast.show(attrnames=True, nodenames=True)
... | <commit_before>import sys
sys.path.insert(0, '../..')
from pycparser import c_parser, c_ast, parse_file
if __name__ == "__main__":
#ast = parse_file('zc_pp.c', use_cpp=True, cpp_path="../cpp.exe")
parser = c_parser.CParser()
#code = r'''int ar[30];'''
code = r'''
char ***arr3d[40];
'''
... | from __future__ import print_function
import sys
from pycparser import c_parser, c_generator, c_ast, parse_file
if __name__ == "__main__":
parser = c_parser.CParser()
code = r'''
void* ptr = (int[ ]){0};
'''
print(code)
ast = parser.parse(code)
ast.show(attrnames=True, nodenames=True)
... | import sys
sys.path.insert(0, '../..')
from pycparser import c_parser, c_ast, parse_file
if __name__ == "__main__":
#ast = parse_file('zc_pp.c', use_cpp=True, cpp_path="../cpp.exe")
parser = c_parser.CParser()
#code = r'''int ar[30];'''
code = r'''
char ***arr3d[40];
'''
#code = r'''
... | <commit_before>import sys
sys.path.insert(0, '../..')
from pycparser import c_parser, c_ast, parse_file
if __name__ == "__main__":
#ast = parse_file('zc_pp.c', use_cpp=True, cpp_path="../cpp.exe")
parser = c_parser.CParser()
#code = r'''int ar[30];'''
code = r'''
char ***arr3d[40];
'''
... |
044a051c637f256613ff307caf3ae0126d09b049 | backend/unichat/views.py | backend/unichat/views.py | from django.http import JsonResponse, HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
import json
from helpers import get_school_list, check_signup_email
def get_schools(request):
resp = JsonResponse({'schools': get_school_list()})
resp['Access-Control-Allow-Origin'] ... | from django.http import JsonResponse, HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
import json
from helpers import get_school_list, check_signup_email
def get_schools(request):
resp = JsonResponse({'schools': get_school_list()})
resp['Access-Control-Allow-Origin'] ... | Add error message to BadRequest signup response for invalid method | Add error message to BadRequest signup response for invalid method
| Python | mit | dimkarakostas/unimeet,dimkarakostas/unimeet,dimkarakostas/unimeet,dimkarakostas/unimeet | from django.http import JsonResponse, HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
import json
from helpers import get_school_list, check_signup_email
def get_schools(request):
resp = JsonResponse({'schools': get_school_list()})
resp['Access-Control-Allow-Origin'] ... | from django.http import JsonResponse, HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
import json
from helpers import get_school_list, check_signup_email
def get_schools(request):
resp = JsonResponse({'schools': get_school_list()})
resp['Access-Control-Allow-Origin'] ... | <commit_before>from django.http import JsonResponse, HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
import json
from helpers import get_school_list, check_signup_email
def get_schools(request):
resp = JsonResponse({'schools': get_school_list()})
resp['Access-Control-... | from django.http import JsonResponse, HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
import json
from helpers import get_school_list, check_signup_email
def get_schools(request):
resp = JsonResponse({'schools': get_school_list()})
resp['Access-Control-Allow-Origin'] ... | from django.http import JsonResponse, HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
import json
from helpers import get_school_list, check_signup_email
def get_schools(request):
resp = JsonResponse({'schools': get_school_list()})
resp['Access-Control-Allow-Origin'] ... | <commit_before>from django.http import JsonResponse, HttpResponse, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
import json
from helpers import get_school_list, check_signup_email
def get_schools(request):
resp = JsonResponse({'schools': get_school_list()})
resp['Access-Control-... |
4c1c902010096d6d87d93b865d9c68794da51414 | trex/parsers.py | trex/parsers.py | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from io import TextIOWrapper
from rest_framework.parsers import BaseParser
class PlainTextParser(BaseParser):
media_type = "text/plain"
def parse(self, stream, media_... | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from io import TextIOWrapper, BytesIO
from django.core.handlers.wsgi import WSGIRequest
from rest_framework.parsers import BaseParser
class PlainTextParser(BaseParser):
m... | Fix parsing data from request | Fix parsing data from request
The object passed to the parser method is not a real IOBase stream. It may only
be a Request object which has read, etc. methods. Therefore the real data must
be encapsulated in a BytesIO stream before changing the content type.
| Python | mit | bjoernricks/trex,bjoernricks/trex | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from io import TextIOWrapper
from rest_framework.parsers import BaseParser
class PlainTextParser(BaseParser):
media_type = "text/plain"
def parse(self, stream, media_... | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from io import TextIOWrapper, BytesIO
from django.core.handlers.wsgi import WSGIRequest
from rest_framework.parsers import BaseParser
class PlainTextParser(BaseParser):
m... | <commit_before># -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from io import TextIOWrapper
from rest_framework.parsers import BaseParser
class PlainTextParser(BaseParser):
media_type = "text/plain"
def parse(self,... | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from io import TextIOWrapper, BytesIO
from django.core.handlers.wsgi import WSGIRequest
from rest_framework.parsers import BaseParser
class PlainTextParser(BaseParser):
m... | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from io import TextIOWrapper
from rest_framework.parsers import BaseParser
class PlainTextParser(BaseParser):
media_type = "text/plain"
def parse(self, stream, media_... | <commit_before># -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from io import TextIOWrapper
from rest_framework.parsers import BaseParser
class PlainTextParser(BaseParser):
media_type = "text/plain"
def parse(self,... |
b86c53c388c39baee1ddfe3a615cdad20d272055 | antcolony/util.py | antcolony/util.py | import json
def avg(iterable):
return sum(iterable) / len(iterable)
def nice_json_dump(data, filepath):
with open(filepath, 'w') as f:
json.dump(data, f, sort_keys=True, indent=4, separators=(',', ': '))
| import json
def avg(iterable):
sum_ = 0
element_count = 0
for element in iterable:
sum_ += element
element_count += 1
return sum_ / element_count
def nice_json_dump(data, filepath):
with open(filepath, 'w') as f:
json.dump(data, f, sort_keys=True, indent=4, separators=(',',... | Make avg() work with iterators | Make avg() work with iterators
| Python | bsd-3-clause | ppolewicz/ant-colony,ppolewicz/ant-colony | import json
def avg(iterable):
return sum(iterable) / len(iterable)
def nice_json_dump(data, filepath):
with open(filepath, 'w') as f:
json.dump(data, f, sort_keys=True, indent=4, separators=(',', ': '))
Make avg() work with iterators | import json
def avg(iterable):
sum_ = 0
element_count = 0
for element in iterable:
sum_ += element
element_count += 1
return sum_ / element_count
def nice_json_dump(data, filepath):
with open(filepath, 'w') as f:
json.dump(data, f, sort_keys=True, indent=4, separators=(',',... | <commit_before>import json
def avg(iterable):
return sum(iterable) / len(iterable)
def nice_json_dump(data, filepath):
with open(filepath, 'w') as f:
json.dump(data, f, sort_keys=True, indent=4, separators=(',', ': '))
<commit_msg>Make avg() work with iterators<commit_after> | import json
def avg(iterable):
sum_ = 0
element_count = 0
for element in iterable:
sum_ += element
element_count += 1
return sum_ / element_count
def nice_json_dump(data, filepath):
with open(filepath, 'w') as f:
json.dump(data, f, sort_keys=True, indent=4, separators=(',',... | import json
def avg(iterable):
return sum(iterable) / len(iterable)
def nice_json_dump(data, filepath):
with open(filepath, 'w') as f:
json.dump(data, f, sort_keys=True, indent=4, separators=(',', ': '))
Make avg() work with iteratorsimport json
def avg(iterable):
sum_ = 0
element_count = 0
... | <commit_before>import json
def avg(iterable):
return sum(iterable) / len(iterable)
def nice_json_dump(data, filepath):
with open(filepath, 'w') as f:
json.dump(data, f, sort_keys=True, indent=4, separators=(',', ': '))
<commit_msg>Make avg() work with iterators<commit_after>import json
def avg(itera... |
50a30ded8705b343478f85ea1c6c60e827982d37 | auwsssp/urls.py | auwsssp/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'auwsssp.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
| from django.conf.urls import patterns, include, url
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'signups.views.home', name='home'),
# url(r'^blog/', include('blog.urls')... | Modify index url and static folders | Modify index url and static folders
| Python | mit | eyassug/au-water-sanitation-template,eyassug/au-water-sanitation-template,eyassug/au-water-sanitation-template | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'auwsssp.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
Modify index url and ... | from django.conf.urls import patterns, include, url
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'signups.views.home', name='home'),
# url(r'^blog/', include('blog.urls')... | <commit_before>from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'auwsssp.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
<commit... | from django.conf.urls import patterns, include, url
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'signups.views.home', name='home'),
# url(r'^blog/', include('blog.urls')... | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'auwsssp.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
Modify index url and ... | <commit_before>from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'auwsssp.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
<commit... |
b43c6604163e18ae03c6ef206c4892e0beb873f7 | django_cradmin/demo/uimock_demo/urls.py | django_cradmin/demo/uimock_demo/urls.py | from django.urls import path
from django_cradmin import viewhelpers
from .views import overview
urlpatterns = [
path('simple/<str:mockname>',
viewhelpers.uimock.UiMock.as_view(template_directory='uimock_demo/simple/'),
name='cradmin_uimock_demo_simple'),
path('',
overview.Overview.... | from django.urls import path, re_path
from django_cradmin import viewhelpers
from .views import overview
urlpatterns = [
re_path(r'^simple/(?P<mockname>.+)?$',
viewhelpers.uimock.UiMock.as_view(template_directory='uimock_demo/simple/'),
name='cradmin_uimock_demo_simple'),
path('',
... | Fix url that was wrongly converted to django3. | Fix url that was wrongly converted to django3.
| Python | bsd-3-clause | appressoas/django_cradmin,appressoas/django_cradmin,appressoas/django_cradmin | from django.urls import path
from django_cradmin import viewhelpers
from .views import overview
urlpatterns = [
path('simple/<str:mockname>',
viewhelpers.uimock.UiMock.as_view(template_directory='uimock_demo/simple/'),
name='cradmin_uimock_demo_simple'),
path('',
overview.Overview.... | from django.urls import path, re_path
from django_cradmin import viewhelpers
from .views import overview
urlpatterns = [
re_path(r'^simple/(?P<mockname>.+)?$',
viewhelpers.uimock.UiMock.as_view(template_directory='uimock_demo/simple/'),
name='cradmin_uimock_demo_simple'),
path('',
... | <commit_before>from django.urls import path
from django_cradmin import viewhelpers
from .views import overview
urlpatterns = [
path('simple/<str:mockname>',
viewhelpers.uimock.UiMock.as_view(template_directory='uimock_demo/simple/'),
name='cradmin_uimock_demo_simple'),
path('',
ove... | from django.urls import path, re_path
from django_cradmin import viewhelpers
from .views import overview
urlpatterns = [
re_path(r'^simple/(?P<mockname>.+)?$',
viewhelpers.uimock.UiMock.as_view(template_directory='uimock_demo/simple/'),
name='cradmin_uimock_demo_simple'),
path('',
... | from django.urls import path
from django_cradmin import viewhelpers
from .views import overview
urlpatterns = [
path('simple/<str:mockname>',
viewhelpers.uimock.UiMock.as_view(template_directory='uimock_demo/simple/'),
name='cradmin_uimock_demo_simple'),
path('',
overview.Overview.... | <commit_before>from django.urls import path
from django_cradmin import viewhelpers
from .views import overview
urlpatterns = [
path('simple/<str:mockname>',
viewhelpers.uimock.UiMock.as_view(template_directory='uimock_demo/simple/'),
name='cradmin_uimock_demo_simple'),
path('',
ove... |
ac3c8155abae010fb79866addd1e9cd50f5cae78 | tests/test_impersonation.py | tests/test_impersonation.py | from django.core.urlresolvers import reverse
import pytest
from saleor.userprofile.impersonate import can_impersonate
from saleor.userprofile.models import User
def test_staff_with_permission_can_impersonate(
staff_client, customer_user, staff_user, permission_impersonate_user,
staff_group):
staff... | from django.core.urlresolvers import reverse
import pytest
from saleor.userprofile.impersonate import can_impersonate
from saleor.userprofile.models import User
def test_staff_with_permission_can_impersonate(
staff_client, customer_user, staff_user, permission_impersonate_user,
staff_group):
staff... | Use reverse function in tests | Use reverse function in tests
| Python | bsd-3-clause | UITools/saleor,maferelo/saleor,mociepka/saleor,UITools/saleor,mociepka/saleor,maferelo/saleor,UITools/saleor,UITools/saleor,maferelo/saleor,UITools/saleor,mociepka/saleor | from django.core.urlresolvers import reverse
import pytest
from saleor.userprofile.impersonate import can_impersonate
from saleor.userprofile.models import User
def test_staff_with_permission_can_impersonate(
staff_client, customer_user, staff_user, permission_impersonate_user,
staff_group):
staff... | from django.core.urlresolvers import reverse
import pytest
from saleor.userprofile.impersonate import can_impersonate
from saleor.userprofile.models import User
def test_staff_with_permission_can_impersonate(
staff_client, customer_user, staff_user, permission_impersonate_user,
staff_group):
staff... | <commit_before>from django.core.urlresolvers import reverse
import pytest
from saleor.userprofile.impersonate import can_impersonate
from saleor.userprofile.models import User
def test_staff_with_permission_can_impersonate(
staff_client, customer_user, staff_user, permission_impersonate_user,
staff_gr... | from django.core.urlresolvers import reverse
import pytest
from saleor.userprofile.impersonate import can_impersonate
from saleor.userprofile.models import User
def test_staff_with_permission_can_impersonate(
staff_client, customer_user, staff_user, permission_impersonate_user,
staff_group):
staff... | from django.core.urlresolvers import reverse
import pytest
from saleor.userprofile.impersonate import can_impersonate
from saleor.userprofile.models import User
def test_staff_with_permission_can_impersonate(
staff_client, customer_user, staff_user, permission_impersonate_user,
staff_group):
staff... | <commit_before>from django.core.urlresolvers import reverse
import pytest
from saleor.userprofile.impersonate import can_impersonate
from saleor.userprofile.models import User
def test_staff_with_permission_can_impersonate(
staff_client, customer_user, staff_user, permission_impersonate_user,
staff_gr... |
8b545ee63ec695a77ba08fa5ff45b7d6dd3d94f8 | cuteshop/downloaders/git.py | cuteshop/downloaders/git.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
from ..utils import DEVNULL, change_working_directory
from .base import DOWNLOAD_CONTAINER
def download(source_info):
url = source_info['git']
subprocess.call(
('git', 'clone', url, DOWNLOAD_CONTAINER),
stdout=DEVNULL, stderr=sub... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
from ..utils import DEVNULL, change_working_directory
from .base import DOWNLOAD_CONTAINER
def _checkout(name):
with change_working_directory(DOWNLOAD_CONTAINER):
subprocess.call(
('git', 'checkout', name),
stdout=DEV... | Add auto branch checkout functionality | Add auto branch checkout functionality
| Python | mit | uranusjr/cuteshop | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
from ..utils import DEVNULL, change_working_directory
from .base import DOWNLOAD_CONTAINER
def download(source_info):
url = source_info['git']
subprocess.call(
('git', 'clone', url, DOWNLOAD_CONTAINER),
stdout=DEVNULL, stderr=sub... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
from ..utils import DEVNULL, change_working_directory
from .base import DOWNLOAD_CONTAINER
def _checkout(name):
with change_working_directory(DOWNLOAD_CONTAINER):
subprocess.call(
('git', 'checkout', name),
stdout=DEV... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
from ..utils import DEVNULL, change_working_directory
from .base import DOWNLOAD_CONTAINER
def download(source_info):
url = source_info['git']
subprocess.call(
('git', 'clone', url, DOWNLOAD_CONTAINER),
stdout=DEVN... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
from ..utils import DEVNULL, change_working_directory
from .base import DOWNLOAD_CONTAINER
def _checkout(name):
with change_working_directory(DOWNLOAD_CONTAINER):
subprocess.call(
('git', 'checkout', name),
stdout=DEV... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
from ..utils import DEVNULL, change_working_directory
from .base import DOWNLOAD_CONTAINER
def download(source_info):
url = source_info['git']
subprocess.call(
('git', 'clone', url, DOWNLOAD_CONTAINER),
stdout=DEVNULL, stderr=sub... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
from ..utils import DEVNULL, change_working_directory
from .base import DOWNLOAD_CONTAINER
def download(source_info):
url = source_info['git']
subprocess.call(
('git', 'clone', url, DOWNLOAD_CONTAINER),
stdout=DEVN... |
687f48ca94b67321a1576a1dbb1d7ae89fe6f0b7 | tests/test_pubannotation.py | tests/test_pubannotation.py |
import kindred
def test_pubannotation_groST():
corpus = kindred.pubannotation.load('bionlp-st-gro-2013-development')
assert isinstance(corpus,kindred.Corpus)
fileCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) for d in corpus... |
import kindred
def test_pubannotation():
corpus = kindred.pubannotation.load('bionlp-st-gro-2013-development')
assert isinstance(corpus,kindred.Corpus)
fileCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) for d in corpus.docum... | Remove one of the pubannotation tests as their data seems to change | Remove one of the pubannotation tests as their data seems to change
| Python | mit | jakelever/kindred,jakelever/kindred |
import kindred
def test_pubannotation_groST():
corpus = kindred.pubannotation.load('bionlp-st-gro-2013-development')
assert isinstance(corpus,kindred.Corpus)
fileCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) for d in corpus... |
import kindred
def test_pubannotation():
corpus = kindred.pubannotation.load('bionlp-st-gro-2013-development')
assert isinstance(corpus,kindred.Corpus)
fileCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) for d in corpus.docum... | <commit_before>
import kindred
def test_pubannotation_groST():
corpus = kindred.pubannotation.load('bionlp-st-gro-2013-development')
assert isinstance(corpus,kindred.Corpus)
fileCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) ... |
import kindred
def test_pubannotation():
corpus = kindred.pubannotation.load('bionlp-st-gro-2013-development')
assert isinstance(corpus,kindred.Corpus)
fileCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) for d in corpus.docum... |
import kindred
def test_pubannotation_groST():
corpus = kindred.pubannotation.load('bionlp-st-gro-2013-development')
assert isinstance(corpus,kindred.Corpus)
fileCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) for d in corpus... | <commit_before>
import kindred
def test_pubannotation_groST():
corpus = kindred.pubannotation.load('bionlp-st-gro-2013-development')
assert isinstance(corpus,kindred.Corpus)
fileCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) ... |
462700e3b1158fef187732007125a0930841dafd | bugsy/errors.py | bugsy/errors.py | class BugsyException(Exception):
"""
If while interacting with Bugzilla and we try do something that is not
supported this error will be raised.
"""
def __init__(self, msg, error_code=None):
self.msg = msg
self.code = error_code
def __str__(self):
return "Message... | class BugsyException(Exception):
"""
If while interacting with Bugzilla and we try do something that is not
supported this error will be raised.
"""
def __init__(self, msg, error_code=None):
self.msg = msg
self.code = error_code
def __str__(self):
return "Message... | Add exception handler for attachment related operations | Add exception handler for attachment related operations
| Python | apache-2.0 | AutomatedTester/Bugsy | class BugsyException(Exception):
"""
If while interacting with Bugzilla and we try do something that is not
supported this error will be raised.
"""
def __init__(self, msg, error_code=None):
self.msg = msg
self.code = error_code
def __str__(self):
return "Message... | class BugsyException(Exception):
"""
If while interacting with Bugzilla and we try do something that is not
supported this error will be raised.
"""
def __init__(self, msg, error_code=None):
self.msg = msg
self.code = error_code
def __str__(self):
return "Message... | <commit_before>class BugsyException(Exception):
"""
If while interacting with Bugzilla and we try do something that is not
supported this error will be raised.
"""
def __init__(self, msg, error_code=None):
self.msg = msg
self.code = error_code
def __str__(self):
... | class BugsyException(Exception):
"""
If while interacting with Bugzilla and we try do something that is not
supported this error will be raised.
"""
def __init__(self, msg, error_code=None):
self.msg = msg
self.code = error_code
def __str__(self):
return "Message... | class BugsyException(Exception):
"""
If while interacting with Bugzilla and we try do something that is not
supported this error will be raised.
"""
def __init__(self, msg, error_code=None):
self.msg = msg
self.code = error_code
def __str__(self):
return "Message... | <commit_before>class BugsyException(Exception):
"""
If while interacting with Bugzilla and we try do something that is not
supported this error will be raised.
"""
def __init__(self, msg, error_code=None):
self.msg = msg
self.code = error_code
def __str__(self):
... |
31c921f0f88df5bc532db0f326ba9ef53318feb9 | codejail/django_integration.py | codejail/django_integration.py | """Django integration for codejail"""
from django.core.exceptions import MiddlewareNotUsed
from django.conf import settings
import codejail.jail_code
class ConfigureCodeJailMiddleware(object):
"""Middleware to configure codejail on startup."""
def __init__(self):
python_bin = settings.CODE_JAIL.get... | """Django integration for codejail.
Code to glue codejail into a Django environment.
"""
from django.core.exceptions import MiddlewareNotUsed
from django.conf import settings
import codejail.jail_code
class ConfigureCodeJailMiddleware(object):
"""
Middleware to configure codejail on startup.
This is ... | Add more detail in docstring | Add more detail in docstring
| Python | agpl-3.0 | StepicOrg/codejail,edx/codejail | """Django integration for codejail"""
from django.core.exceptions import MiddlewareNotUsed
from django.conf import settings
import codejail.jail_code
class ConfigureCodeJailMiddleware(object):
"""Middleware to configure codejail on startup."""
def __init__(self):
python_bin = settings.CODE_JAIL.get... | """Django integration for codejail.
Code to glue codejail into a Django environment.
"""
from django.core.exceptions import MiddlewareNotUsed
from django.conf import settings
import codejail.jail_code
class ConfigureCodeJailMiddleware(object):
"""
Middleware to configure codejail on startup.
This is ... | <commit_before>"""Django integration for codejail"""
from django.core.exceptions import MiddlewareNotUsed
from django.conf import settings
import codejail.jail_code
class ConfigureCodeJailMiddleware(object):
"""Middleware to configure codejail on startup."""
def __init__(self):
python_bin = setting... | """Django integration for codejail.
Code to glue codejail into a Django environment.
"""
from django.core.exceptions import MiddlewareNotUsed
from django.conf import settings
import codejail.jail_code
class ConfigureCodeJailMiddleware(object):
"""
Middleware to configure codejail on startup.
This is ... | """Django integration for codejail"""
from django.core.exceptions import MiddlewareNotUsed
from django.conf import settings
import codejail.jail_code
class ConfigureCodeJailMiddleware(object):
"""Middleware to configure codejail on startup."""
def __init__(self):
python_bin = settings.CODE_JAIL.get... | <commit_before>"""Django integration for codejail"""
from django.core.exceptions import MiddlewareNotUsed
from django.conf import settings
import codejail.jail_code
class ConfigureCodeJailMiddleware(object):
"""Middleware to configure codejail on startup."""
def __init__(self):
python_bin = setting... |
55ba2c2310a0f3a4a413801ce8edf52e001c9ffd | tornado_srv.py | tornado_srv.py | import tornado.web
import tornado.wsgi
import tornado.httpserver
import tornado.ioloop
from mojibake.main import app
from mojibake.settings import PORT
container = tornado.wsgi.WSGIContainer(app)
http_server = tornado.httpserver.HTTPServer(container)
http_server.listen(PORT)
tornado.ioloop.IOLoop.instance().start()
| import tornado.web
import tornado.wsgi
import tornado.httpserver
import tornado.ioloop
import os
from mojibake.main import app
from mojibake.settings import PORT
if os.name == 'posix':
import setproctitle
setproctitle.setproctitle('mojibake') # Set the process title to mojibake
print('Starting Mojibake...')... | Set the process title on posix systems | Set the process title on posix systems
| Python | mit | ardinor/mojibake,ardinor/mojibake,ardinor/mojibake | import tornado.web
import tornado.wsgi
import tornado.httpserver
import tornado.ioloop
from mojibake.main import app
from mojibake.settings import PORT
container = tornado.wsgi.WSGIContainer(app)
http_server = tornado.httpserver.HTTPServer(container)
http_server.listen(PORT)
tornado.ioloop.IOLoop.instance().start()
S... | import tornado.web
import tornado.wsgi
import tornado.httpserver
import tornado.ioloop
import os
from mojibake.main import app
from mojibake.settings import PORT
if os.name == 'posix':
import setproctitle
setproctitle.setproctitle('mojibake') # Set the process title to mojibake
print('Starting Mojibake...')... | <commit_before>import tornado.web
import tornado.wsgi
import tornado.httpserver
import tornado.ioloop
from mojibake.main import app
from mojibake.settings import PORT
container = tornado.wsgi.WSGIContainer(app)
http_server = tornado.httpserver.HTTPServer(container)
http_server.listen(PORT)
tornado.ioloop.IOLoop.insta... | import tornado.web
import tornado.wsgi
import tornado.httpserver
import tornado.ioloop
import os
from mojibake.main import app
from mojibake.settings import PORT
if os.name == 'posix':
import setproctitle
setproctitle.setproctitle('mojibake') # Set the process title to mojibake
print('Starting Mojibake...')... | import tornado.web
import tornado.wsgi
import tornado.httpserver
import tornado.ioloop
from mojibake.main import app
from mojibake.settings import PORT
container = tornado.wsgi.WSGIContainer(app)
http_server = tornado.httpserver.HTTPServer(container)
http_server.listen(PORT)
tornado.ioloop.IOLoop.instance().start()
S... | <commit_before>import tornado.web
import tornado.wsgi
import tornado.httpserver
import tornado.ioloop
from mojibake.main import app
from mojibake.settings import PORT
container = tornado.wsgi.WSGIContainer(app)
http_server = tornado.httpserver.HTTPServer(container)
http_server.listen(PORT)
tornado.ioloop.IOLoop.insta... |
2e9e14980d87239f861377d1dac45bb04d3f9712 | tests/basics/array_intbig.py | tests/basics/array_intbig.py | # test array('q') and array('Q')
try:
from array import array
except ImportError:
import sys
print("SKIP")
sys.exit()
print(array('q'))
print(array('Q'))
print(array('q', [0]))
print(array('Q', [0]))
print(array('q', [-2**63, -1, 0, 1, 2, 2**63-1]))
print(array('Q', [0, 1, 2, 2**64-1]))
print(bytes... | # test array types QqLl that require big-ints
try:
from array import array
except ImportError:
import sys
print("SKIP")
sys.exit()
print(array('L', [0, 2**32-1]))
print(array('l', [-2**31, 0, 2**31-1]))
print(array('q'))
print(array('Q'))
print(array('q', [0]))
print(array('Q', [0]))
print(array('q... | Update array test for big-int with lL typecodes. | tests/basics: Update array test for big-int with lL typecodes.
| Python | mit | TDAbboud/micropython,tralamazza/micropython,hiway/micropython,AriZuu/micropython,puuu/micropython,lowRISC/micropython,torwag/micropython,ryannathans/micropython,bvernoux/micropython,pozetroninc/micropython,pramasoul/micropython,deshipu/micropython,tralamazza/micropython,trezor/micropython,pramasoul/micropython,swegener... | # test array('q') and array('Q')
try:
from array import array
except ImportError:
import sys
print("SKIP")
sys.exit()
print(array('q'))
print(array('Q'))
print(array('q', [0]))
print(array('Q', [0]))
print(array('q', [-2**63, -1, 0, 1, 2, 2**63-1]))
print(array('Q', [0, 1, 2, 2**64-1]))
print(bytes... | # test array types QqLl that require big-ints
try:
from array import array
except ImportError:
import sys
print("SKIP")
sys.exit()
print(array('L', [0, 2**32-1]))
print(array('l', [-2**31, 0, 2**31-1]))
print(array('q'))
print(array('Q'))
print(array('q', [0]))
print(array('Q', [0]))
print(array('q... | <commit_before># test array('q') and array('Q')
try:
from array import array
except ImportError:
import sys
print("SKIP")
sys.exit()
print(array('q'))
print(array('Q'))
print(array('q', [0]))
print(array('Q', [0]))
print(array('q', [-2**63, -1, 0, 1, 2, 2**63-1]))
print(array('Q', [0, 1, 2, 2**64-1]... | # test array types QqLl that require big-ints
try:
from array import array
except ImportError:
import sys
print("SKIP")
sys.exit()
print(array('L', [0, 2**32-1]))
print(array('l', [-2**31, 0, 2**31-1]))
print(array('q'))
print(array('Q'))
print(array('q', [0]))
print(array('Q', [0]))
print(array('q... | # test array('q') and array('Q')
try:
from array import array
except ImportError:
import sys
print("SKIP")
sys.exit()
print(array('q'))
print(array('Q'))
print(array('q', [0]))
print(array('Q', [0]))
print(array('q', [-2**63, -1, 0, 1, 2, 2**63-1]))
print(array('Q', [0, 1, 2, 2**64-1]))
print(bytes... | <commit_before># test array('q') and array('Q')
try:
from array import array
except ImportError:
import sys
print("SKIP")
sys.exit()
print(array('q'))
print(array('Q'))
print(array('q', [0]))
print(array('Q', [0]))
print(array('q', [-2**63, -1, 0, 1, 2, 2**63-1]))
print(array('Q', [0, 1, 2, 2**64-1]... |
b9ef72138c5312fe8eb7cfa48abe48a8c477afdc | test/test_type_checker_creator.py | test/test_type_checker_creator.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import pytest
from dataproperty._type_checker_creator import IntegerTypeCheckerCreator
from dataproperty._type_checker_creator import FloatTypeCheckerCreator
from dataproperty._type_checker_creat... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import pytest
import dataproperty._type_checker_creator as tcc
import dataproperty._type_checker as tc
class Test_TypeCheckerCreator(object):
@pytest.mark.parametrize(["value", "is_convert... | Add tests for NoneTypeCheckerCreator class | Add tests for NoneTypeCheckerCreator class
| Python | mit | thombashi/DataProperty | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import pytest
from dataproperty._type_checker_creator import IntegerTypeCheckerCreator
from dataproperty._type_checker_creator import FloatTypeCheckerCreator
from dataproperty._type_checker_creat... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import pytest
import dataproperty._type_checker_creator as tcc
import dataproperty._type_checker as tc
class Test_TypeCheckerCreator(object):
@pytest.mark.parametrize(["value", "is_convert... | <commit_before># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import pytest
from dataproperty._type_checker_creator import IntegerTypeCheckerCreator
from dataproperty._type_checker_creator import FloatTypeCheckerCreator
from dataproperty._typ... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import pytest
import dataproperty._type_checker_creator as tcc
import dataproperty._type_checker as tc
class Test_TypeCheckerCreator(object):
@pytest.mark.parametrize(["value", "is_convert... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import pytest
from dataproperty._type_checker_creator import IntegerTypeCheckerCreator
from dataproperty._type_checker_creator import FloatTypeCheckerCreator
from dataproperty._type_checker_creat... | <commit_before># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
import pytest
from dataproperty._type_checker_creator import IntegerTypeCheckerCreator
from dataproperty._type_checker_creator import FloatTypeCheckerCreator
from dataproperty._typ... |
927915f11ce536074920c515fab6e6ec3134d390 | tests/test_huckle_install.py | tests/test_huckle_install.py | from __future__ import absolute_import, division, print_function
from subprocess import check_output
import os
def test_function():
setup = """
#!/bin/bash
huckle install https://hcli.io/hcli/cli/jsonf?command=jsonf
echo '{"hello":"world"}' | jsonf go
"""
out = check_output(['bash', '-c', se... | from __future__ import absolute_import, division, print_function
import subprocess
import os
def test_function():
setup = """
#!/bin/bash
huckle install https://hcli.io/hcli/cli/jsonf?command=jsonf
echo '{"hello":"world"}' | jsonf go
"""
p1 = subprocess.Popen(['bash', '-c', setup], stdin=sub... | Revert "fix test by switching to check_output" | Revert "fix test by switching to check_output"
This reverts commit 6cfd9d01d68c2f7ff4a8bba3351ee618e770d315.
| Python | mit | cometaj2/huckle | from __future__ import absolute_import, division, print_function
from subprocess import check_output
import os
def test_function():
setup = """
#!/bin/bash
huckle install https://hcli.io/hcli/cli/jsonf?command=jsonf
echo '{"hello":"world"}' | jsonf go
"""
out = check_output(['bash', '-c', se... | from __future__ import absolute_import, division, print_function
import subprocess
import os
def test_function():
setup = """
#!/bin/bash
huckle install https://hcli.io/hcli/cli/jsonf?command=jsonf
echo '{"hello":"world"}' | jsonf go
"""
p1 = subprocess.Popen(['bash', '-c', setup], stdin=sub... | <commit_before>from __future__ import absolute_import, division, print_function
from subprocess import check_output
import os
def test_function():
setup = """
#!/bin/bash
huckle install https://hcli.io/hcli/cli/jsonf?command=jsonf
echo '{"hello":"world"}' | jsonf go
"""
out = check_output(['... | from __future__ import absolute_import, division, print_function
import subprocess
import os
def test_function():
setup = """
#!/bin/bash
huckle install https://hcli.io/hcli/cli/jsonf?command=jsonf
echo '{"hello":"world"}' | jsonf go
"""
p1 = subprocess.Popen(['bash', '-c', setup], stdin=sub... | from __future__ import absolute_import, division, print_function
from subprocess import check_output
import os
def test_function():
setup = """
#!/bin/bash
huckle install https://hcli.io/hcli/cli/jsonf?command=jsonf
echo '{"hello":"world"}' | jsonf go
"""
out = check_output(['bash', '-c', se... | <commit_before>from __future__ import absolute_import, division, print_function
from subprocess import check_output
import os
def test_function():
setup = """
#!/bin/bash
huckle install https://hcli.io/hcli/cli/jsonf?command=jsonf
echo '{"hello":"world"}' | jsonf go
"""
out = check_output(['... |
1c0f0decd5bdcea3174cee650ba08fb427b67016 | tests/test_rover_instance.py | tests/test_rover_instance.py |
from unittest import TestCase
from rover import Rover
class TestRover(TestCase):
def setUp(self):
self.rover = Rover()
def test_rover_compass(self):
assert self.rover.compass == ['N', 'E', 'S', 'W']
def test_rover_position(self):
assert self.rover.position == (self.rover.x, self... |
from unittest import TestCase
from rover import Rover
class TestRover(TestCase):
def setUp(self):
self.rover = Rover()
def test_rover_compass(self):
assert self.rover.compass == ['N', 'E', 'S', 'W']
def test_rover_position(self):
assert self.rover.position == (self.rover.x, self... | Add failing tests for rover forward movement | Add failing tests for rover forward movement
| Python | mit | authentik8/rover |
from unittest import TestCase
from rover import Rover
class TestRover(TestCase):
def setUp(self):
self.rover = Rover()
def test_rover_compass(self):
assert self.rover.compass == ['N', 'E', 'S', 'W']
def test_rover_position(self):
assert self.rover.position == (self.rover.x, self... |
from unittest import TestCase
from rover import Rover
class TestRover(TestCase):
def setUp(self):
self.rover = Rover()
def test_rover_compass(self):
assert self.rover.compass == ['N', 'E', 'S', 'W']
def test_rover_position(self):
assert self.rover.position == (self.rover.x, self... | <commit_before>
from unittest import TestCase
from rover import Rover
class TestRover(TestCase):
def setUp(self):
self.rover = Rover()
def test_rover_compass(self):
assert self.rover.compass == ['N', 'E', 'S', 'W']
def test_rover_position(self):
assert self.rover.position == (sel... |
from unittest import TestCase
from rover import Rover
class TestRover(TestCase):
def setUp(self):
self.rover = Rover()
def test_rover_compass(self):
assert self.rover.compass == ['N', 'E', 'S', 'W']
def test_rover_position(self):
assert self.rover.position == (self.rover.x, self... |
from unittest import TestCase
from rover import Rover
class TestRover(TestCase):
def setUp(self):
self.rover = Rover()
def test_rover_compass(self):
assert self.rover.compass == ['N', 'E', 'S', 'W']
def test_rover_position(self):
assert self.rover.position == (self.rover.x, self... | <commit_before>
from unittest import TestCase
from rover import Rover
class TestRover(TestCase):
def setUp(self):
self.rover = Rover()
def test_rover_compass(self):
assert self.rover.compass == ['N', 'E', 'S', 'W']
def test_rover_position(self):
assert self.rover.position == (sel... |
05e61f1be4005edf2ff439ca2613bce8af217ff7 | pubsubpull/models.py | pubsubpull/models.py | """
Models.
"""
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from pubsubpull.fields import JSONB
class Request(models.Model):
"""A web request.
"""
user = models.ForeignKey(User, null=True, blank=True, related_name='reques... | """
Models.
"""
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from pubsubpull.fields import JSONB
class Request(models.Model):
"""A web request.
"""
user = models.ForeignKey(User, null=True, blank=True, related_name='reques... | Add more useful display of the request data. | Add more useful display of the request data.
| Python | mit | KayEss/django-pubsubpull,KayEss/django-pubsubpull,KayEss/django-pubsubpull | """
Models.
"""
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from pubsubpull.fields import JSONB
class Request(models.Model):
"""A web request.
"""
user = models.ForeignKey(User, null=True, blank=True, related_name='reques... | """
Models.
"""
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from pubsubpull.fields import JSONB
class Request(models.Model):
"""A web request.
"""
user = models.ForeignKey(User, null=True, blank=True, related_name='reques... | <commit_before>"""
Models.
"""
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from pubsubpull.fields import JSONB
class Request(models.Model):
"""A web request.
"""
user = models.ForeignKey(User, null=True, blank=True, relat... | """
Models.
"""
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from pubsubpull.fields import JSONB
class Request(models.Model):
"""A web request.
"""
user = models.ForeignKey(User, null=True, blank=True, related_name='reques... | """
Models.
"""
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from pubsubpull.fields import JSONB
class Request(models.Model):
"""A web request.
"""
user = models.ForeignKey(User, null=True, blank=True, related_name='reques... | <commit_before>"""
Models.
"""
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from pubsubpull.fields import JSONB
class Request(models.Model):
"""A web request.
"""
user = models.ForeignKey(User, null=True, blank=True, relat... |
5b8241ad808bd11971d0d684bafd6f9019e58397 | tests/contrib/flask/tests.py | tests/contrib/flask/tests.py | import logging
from flask import Flask
from raven.base import Client
from raven.contrib.flask import Sentry
from unittest2 import TestCase
class TempStoreClient(Client):
def __init__(self, *args, **kwargs):
self.events = []
super(TempStoreClient, self).__init__(*args, **kwargs)
def send(self, ... | import logging
from flask import Flask
from raven.base import Client
from raven.contrib.flask import Sentry
from unittest2 import TestCase
class TempStoreClient(Client):
def __init__(self, *args, **kwargs):
self.events = []
super(TempStoreClient, self).__init__(*args, **kwargs)
def send(self, ... | Add url test for Flask | Add url test for Flask
| Python | bsd-3-clause | nikolas/raven-python,Photonomie/raven-python,jmagnusson/raven-python,inspirehep/raven-python,danriti/raven-python,lopter/raven-python-old,nikolas/raven-python,johansteffner/raven-python,johansteffner/raven-python,daikeren/opbeat_python,daikeren/opbeat_python,someonehan/raven-python,inspirehep/raven-python,jmagnusson/ra... | import logging
from flask import Flask
from raven.base import Client
from raven.contrib.flask import Sentry
from unittest2 import TestCase
class TempStoreClient(Client):
def __init__(self, *args, **kwargs):
self.events = []
super(TempStoreClient, self).__init__(*args, **kwargs)
def send(self, ... | import logging
from flask import Flask
from raven.base import Client
from raven.contrib.flask import Sentry
from unittest2 import TestCase
class TempStoreClient(Client):
def __init__(self, *args, **kwargs):
self.events = []
super(TempStoreClient, self).__init__(*args, **kwargs)
def send(self, ... | <commit_before>import logging
from flask import Flask
from raven.base import Client
from raven.contrib.flask import Sentry
from unittest2 import TestCase
class TempStoreClient(Client):
def __init__(self, *args, **kwargs):
self.events = []
super(TempStoreClient, self).__init__(*args, **kwargs)
... | import logging
from flask import Flask
from raven.base import Client
from raven.contrib.flask import Sentry
from unittest2 import TestCase
class TempStoreClient(Client):
def __init__(self, *args, **kwargs):
self.events = []
super(TempStoreClient, self).__init__(*args, **kwargs)
def send(self, ... | import logging
from flask import Flask
from raven.base import Client
from raven.contrib.flask import Sentry
from unittest2 import TestCase
class TempStoreClient(Client):
def __init__(self, *args, **kwargs):
self.events = []
super(TempStoreClient, self).__init__(*args, **kwargs)
def send(self, ... | <commit_before>import logging
from flask import Flask
from raven.base import Client
from raven.contrib.flask import Sentry
from unittest2 import TestCase
class TempStoreClient(Client):
def __init__(self, *args, **kwargs):
self.events = []
super(TempStoreClient, self).__init__(*args, **kwargs)
... |
4ccc5ea6cf25adb029f5e08cc0675e2b8415abdf | LayerView.py | LayerView.py | from UM.View.View import View
from UM.View.Renderer import Renderer
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from UM.Resources import Resources
class LayerView(View):
def __init__(self):
super().__init__()
self._material = None
def beginRendering(self):
scene... | from UM.View.View import View
from UM.View.Renderer import Renderer
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from UM.Resources import Resources
class LayerView(View):
def __init__(self):
super().__init__()
self._material = None
def beginRendering(self):
scene... | Support colours for rendering the layer view | Support colours for rendering the layer view
| Python | agpl-3.0 | markwal/Cura,DeskboxBrazil/Cura,ad1217/Cura,Curahelper/Cura,senttech/Cura,derekhe/Cura,fxtentacle/Cura,ynotstartups/Wanhao,ad1217/Cura,markwal/Cura,fxtentacle/Cura,Curahelper/Cura,quillford/Cura,hmflash/Cura,ynotstartups/Wanhao,fieldOfView/Cura,hmflash/Cura,totalretribution/Cura,quillford/Cura,lo0ol/Ultimaker-Cura,lo0o... | from UM.View.View import View
from UM.View.Renderer import Renderer
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from UM.Resources import Resources
class LayerView(View):
def __init__(self):
super().__init__()
self._material = None
def beginRendering(self):
scene... | from UM.View.View import View
from UM.View.Renderer import Renderer
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from UM.Resources import Resources
class LayerView(View):
def __init__(self):
super().__init__()
self._material = None
def beginRendering(self):
scene... | <commit_before>from UM.View.View import View
from UM.View.Renderer import Renderer
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from UM.Resources import Resources
class LayerView(View):
def __init__(self):
super().__init__()
self._material = None
def beginRendering(self)... | from UM.View.View import View
from UM.View.Renderer import Renderer
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from UM.Resources import Resources
class LayerView(View):
def __init__(self):
super().__init__()
self._material = None
def beginRendering(self):
scene... | from UM.View.View import View
from UM.View.Renderer import Renderer
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from UM.Resources import Resources
class LayerView(View):
def __init__(self):
super().__init__()
self._material = None
def beginRendering(self):
scene... | <commit_before>from UM.View.View import View
from UM.View.Renderer import Renderer
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from UM.Resources import Resources
class LayerView(View):
def __init__(self):
super().__init__()
self._material = None
def beginRendering(self)... |
a3a5d2d6b76a4e903fea232b746b2df8b208ec9e | km3pipe/tests/test_plot.py | km3pipe/tests/test_plot.py | # Filename: test_plot.py
# pylint: disable=locally-disabled,C0111,R0904,C0103
import numpy as np
from km3pipe.testing import TestCase
from km3pipe.plot import bincenters
__author__ = "Moritz Lotze"
__copyright__ = "Copyright 2016, Tamas Gal and the KM3NeT collaboration."
__credits__ = []
__license__ = "MIT"
__mainta... | # Filename: test_plot.py
# pylint: disable=locally-disabled,C0111,R0904,C0103
import numpy as np
from km3pipe.testing import TestCase, patch
from km3pipe.plot import bincenters, meshgrid, automeshgrid, diag
__author__ = "Moritz Lotze"
__copyright__ = "Copyright 2016, Tamas Gal and the KM3NeT collaboration."
__credit... | Add tests for plot functions | Add tests for plot functions
| Python | mit | tamasgal/km3pipe,tamasgal/km3pipe | # Filename: test_plot.py
# pylint: disable=locally-disabled,C0111,R0904,C0103
import numpy as np
from km3pipe.testing import TestCase
from km3pipe.plot import bincenters
__author__ = "Moritz Lotze"
__copyright__ = "Copyright 2016, Tamas Gal and the KM3NeT collaboration."
__credits__ = []
__license__ = "MIT"
__mainta... | # Filename: test_plot.py
# pylint: disable=locally-disabled,C0111,R0904,C0103
import numpy as np
from km3pipe.testing import TestCase, patch
from km3pipe.plot import bincenters, meshgrid, automeshgrid, diag
__author__ = "Moritz Lotze"
__copyright__ = "Copyright 2016, Tamas Gal and the KM3NeT collaboration."
__credit... | <commit_before># Filename: test_plot.py
# pylint: disable=locally-disabled,C0111,R0904,C0103
import numpy as np
from km3pipe.testing import TestCase
from km3pipe.plot import bincenters
__author__ = "Moritz Lotze"
__copyright__ = "Copyright 2016, Tamas Gal and the KM3NeT collaboration."
__credits__ = []
__license__ =... | # Filename: test_plot.py
# pylint: disable=locally-disabled,C0111,R0904,C0103
import numpy as np
from km3pipe.testing import TestCase, patch
from km3pipe.plot import bincenters, meshgrid, automeshgrid, diag
__author__ = "Moritz Lotze"
__copyright__ = "Copyright 2016, Tamas Gal and the KM3NeT collaboration."
__credit... | # Filename: test_plot.py
# pylint: disable=locally-disabled,C0111,R0904,C0103
import numpy as np
from km3pipe.testing import TestCase
from km3pipe.plot import bincenters
__author__ = "Moritz Lotze"
__copyright__ = "Copyright 2016, Tamas Gal and the KM3NeT collaboration."
__credits__ = []
__license__ = "MIT"
__mainta... | <commit_before># Filename: test_plot.py
# pylint: disable=locally-disabled,C0111,R0904,C0103
import numpy as np
from km3pipe.testing import TestCase
from km3pipe.plot import bincenters
__author__ = "Moritz Lotze"
__copyright__ = "Copyright 2016, Tamas Gal and the KM3NeT collaboration."
__credits__ = []
__license__ =... |
ef4c9f6a2e6fc1db01d93d937d24e444b0bb0ede | tests/memory_profiling.py | tests/memory_profiling.py | """
Script to try do detect any memory leaks that may be lurking in the C implementation of the PVector.
"""
import inspect
import sys
import time
import memory_profiler
import vector_test
try:
from pvectorc import pvector
except ImportError:
print("No C implementation of PVector available, terminating")
s... | """
Script to try do detect any memory leaks that may be lurking in the C implementation of the PVector.
"""
import inspect
import sys
import time
import memory_profiler
import vector_test
try:
from pvectorc import pvector
except ImportError:
print("No C implementation of PVector available, terminating")
s... | Improve memory error detection for less false positives | Improve memory error detection for less false positives
| Python | mit | tobgu/pyrsistent,jkbjh/pyrsistent,Futrell/pyrsistent,tobgu/pyrsistent,jml/pyrsistent,jml/pyrsistent,tobgu/pyrsistent,jkbjh/pyrsistent,Futrell/pyrsistent,jkbjh/pyrsistent,Futrell/pyrsistent,jml/pyrsistent | """
Script to try do detect any memory leaks that may be lurking in the C implementation of the PVector.
"""
import inspect
import sys
import time
import memory_profiler
import vector_test
try:
from pvectorc import pvector
except ImportError:
print("No C implementation of PVector available, terminating")
s... | """
Script to try do detect any memory leaks that may be lurking in the C implementation of the PVector.
"""
import inspect
import sys
import time
import memory_profiler
import vector_test
try:
from pvectorc import pvector
except ImportError:
print("No C implementation of PVector available, terminating")
s... | <commit_before>"""
Script to try do detect any memory leaks that may be lurking in the C implementation of the PVector.
"""
import inspect
import sys
import time
import memory_profiler
import vector_test
try:
from pvectorc import pvector
except ImportError:
print("No C implementation of PVector available, term... | """
Script to try do detect any memory leaks that may be lurking in the C implementation of the PVector.
"""
import inspect
import sys
import time
import memory_profiler
import vector_test
try:
from pvectorc import pvector
except ImportError:
print("No C implementation of PVector available, terminating")
s... | """
Script to try do detect any memory leaks that may be lurking in the C implementation of the PVector.
"""
import inspect
import sys
import time
import memory_profiler
import vector_test
try:
from pvectorc import pvector
except ImportError:
print("No C implementation of PVector available, terminating")
s... | <commit_before>"""
Script to try do detect any memory leaks that may be lurking in the C implementation of the PVector.
"""
import inspect
import sys
import time
import memory_profiler
import vector_test
try:
from pvectorc import pvector
except ImportError:
print("No C implementation of PVector available, term... |
ee2db892b4dafa33115779166773e248c17a1b43 | kyoto/tests/test_client.py | kyoto/tests/test_client.py | import unittest
import kyoto.server
import kyoto.tests.dummy
import kyoto.client
class ServiceTestCase(unittest.TestCase):
def setUp(self):
self.address = ('localhost', 1337)
self.server = kyoto.server.BertRPCServer([kyoto.tests.dummy])
self.server.start()
self.service = kyoto.cli... | import unittest
import kyoto.server
import kyoto.tests.dummy
import kyoto.client
class ServiceTestCase(unittest.TestCase):
def setUp(self):
self.address = ('localhost', 1337)
self.server = kyoto.server.BertRPCServer([kyoto.tests.dummy])
self.server.start()
self.service = kyoto.cli... | Add valid module name test case | Add valid module name test case
| Python | mit | kyoto-project/kyoto | import unittest
import kyoto.server
import kyoto.tests.dummy
import kyoto.client
class ServiceTestCase(unittest.TestCase):
def setUp(self):
self.address = ('localhost', 1337)
self.server = kyoto.server.BertRPCServer([kyoto.tests.dummy])
self.server.start()
self.service = kyoto.cli... | import unittest
import kyoto.server
import kyoto.tests.dummy
import kyoto.client
class ServiceTestCase(unittest.TestCase):
def setUp(self):
self.address = ('localhost', 1337)
self.server = kyoto.server.BertRPCServer([kyoto.tests.dummy])
self.server.start()
self.service = kyoto.cli... | <commit_before>import unittest
import kyoto.server
import kyoto.tests.dummy
import kyoto.client
class ServiceTestCase(unittest.TestCase):
def setUp(self):
self.address = ('localhost', 1337)
self.server = kyoto.server.BertRPCServer([kyoto.tests.dummy])
self.server.start()
self.serv... | import unittest
import kyoto.server
import kyoto.tests.dummy
import kyoto.client
class ServiceTestCase(unittest.TestCase):
def setUp(self):
self.address = ('localhost', 1337)
self.server = kyoto.server.BertRPCServer([kyoto.tests.dummy])
self.server.start()
self.service = kyoto.cli... | import unittest
import kyoto.server
import kyoto.tests.dummy
import kyoto.client
class ServiceTestCase(unittest.TestCase):
def setUp(self):
self.address = ('localhost', 1337)
self.server = kyoto.server.BertRPCServer([kyoto.tests.dummy])
self.server.start()
self.service = kyoto.cli... | <commit_before>import unittest
import kyoto.server
import kyoto.tests.dummy
import kyoto.client
class ServiceTestCase(unittest.TestCase):
def setUp(self):
self.address = ('localhost', 1337)
self.server = kyoto.server.BertRPCServer([kyoto.tests.dummy])
self.server.start()
self.serv... |
84304d8c04f59421a76b7c070eb9bdcf58a72567 | callbackLoader.py | callbackLoader.py | # -*- coding: latin-1 -*-
'''
Created on 16.10.2012
@author: Teemu Pkknen
'''
import imp
import sys
import os
from qsdl.simulator.errors.ConfigurationInvalidError import ConfigurationInvalidError
def get_callback_module( name ):
scriptDir = os.path.dirname(os.path.realpath(__file__))
# Already loaded?
... | # -*- coding: latin-1 -*-
'''
Created on 16.10.2012
@author: Teemu Pkknen
'''
import imp
import sys
import os
import ntpath
from qsdl.simulator.errors.ConfigurationInvalidError import ConfigurationInvalidError
def path_leaf(path):
head, tail = ntpath.split(path)
return tail or ntpath.basename(head)
def g... | Make callback loader take into account directory names in loadable module name | Make callback loader take into account directory names in loadable module name
| Python | mit | fire-uta/ir-simulation,fire-uta/ir-simulation | # -*- coding: latin-1 -*-
'''
Created on 16.10.2012
@author: Teemu Pkknen
'''
import imp
import sys
import os
from qsdl.simulator.errors.ConfigurationInvalidError import ConfigurationInvalidError
def get_callback_module( name ):
scriptDir = os.path.dirname(os.path.realpath(__file__))
# Already loaded?
... | # -*- coding: latin-1 -*-
'''
Created on 16.10.2012
@author: Teemu Pkknen
'''
import imp
import sys
import os
import ntpath
from qsdl.simulator.errors.ConfigurationInvalidError import ConfigurationInvalidError
def path_leaf(path):
head, tail = ntpath.split(path)
return tail or ntpath.basename(head)
def g... | <commit_before># -*- coding: latin-1 -*-
'''
Created on 16.10.2012
@author: Teemu Pkknen
'''
import imp
import sys
import os
from qsdl.simulator.errors.ConfigurationInvalidError import ConfigurationInvalidError
def get_callback_module( name ):
scriptDir = os.path.dirname(os.path.realpath(__file__))
# Alre... | # -*- coding: latin-1 -*-
'''
Created on 16.10.2012
@author: Teemu Pkknen
'''
import imp
import sys
import os
import ntpath
from qsdl.simulator.errors.ConfigurationInvalidError import ConfigurationInvalidError
def path_leaf(path):
head, tail = ntpath.split(path)
return tail or ntpath.basename(head)
def g... | # -*- coding: latin-1 -*-
'''
Created on 16.10.2012
@author: Teemu Pkknen
'''
import imp
import sys
import os
from qsdl.simulator.errors.ConfigurationInvalidError import ConfigurationInvalidError
def get_callback_module( name ):
scriptDir = os.path.dirname(os.path.realpath(__file__))
# Already loaded?
... | <commit_before># -*- coding: latin-1 -*-
'''
Created on 16.10.2012
@author: Teemu Pkknen
'''
import imp
import sys
import os
from qsdl.simulator.errors.ConfigurationInvalidError import ConfigurationInvalidError
def get_callback_module( name ):
scriptDir = os.path.dirname(os.path.realpath(__file__))
# Alre... |
4a509970cb48b64046f88193efc141344437b151 | tests/test_list_struct.py | tests/test_list_struct.py | import pytest
from hypothesis import given
from hypothesis.strategies import lists, integers, floats, one_of, composite
from datatyping.datatyping import validate
def test_empty():
assert validate([], []) is None
@given(li=lists(integers()))
def test_plain(li):
assert validate([int], li) is None
@given(l... | import pytest
from hypothesis import given
from hypothesis.strategies import lists, integers, floats, one_of, composite
from datatyping.datatyping import validate
def test_empty():
assert validate([], []) is None
@given(li=lists(integers()))
def test_plain(li):
assert validate([int], li) is None
@given(l... | Fix up mistakes in tests | Fix up mistakes in tests
| Python | mit | Zaab1t/datatyping | import pytest
from hypothesis import given
from hypothesis.strategies import lists, integers, floats, one_of, composite
from datatyping.datatyping import validate
def test_empty():
assert validate([], []) is None
@given(li=lists(integers()))
def test_plain(li):
assert validate([int], li) is None
@given(l... | import pytest
from hypothesis import given
from hypothesis.strategies import lists, integers, floats, one_of, composite
from datatyping.datatyping import validate
def test_empty():
assert validate([], []) is None
@given(li=lists(integers()))
def test_plain(li):
assert validate([int], li) is None
@given(l... | <commit_before>import pytest
from hypothesis import given
from hypothesis.strategies import lists, integers, floats, one_of, composite
from datatyping.datatyping import validate
def test_empty():
assert validate([], []) is None
@given(li=lists(integers()))
def test_plain(li):
assert validate([int], li) is ... | import pytest
from hypothesis import given
from hypothesis.strategies import lists, integers, floats, one_of, composite
from datatyping.datatyping import validate
def test_empty():
assert validate([], []) is None
@given(li=lists(integers()))
def test_plain(li):
assert validate([int], li) is None
@given(l... | import pytest
from hypothesis import given
from hypothesis.strategies import lists, integers, floats, one_of, composite
from datatyping.datatyping import validate
def test_empty():
assert validate([], []) is None
@given(li=lists(integers()))
def test_plain(li):
assert validate([int], li) is None
@given(l... | <commit_before>import pytest
from hypothesis import given
from hypothesis.strategies import lists, integers, floats, one_of, composite
from datatyping.datatyping import validate
def test_empty():
assert validate([], []) is None
@given(li=lists(integers()))
def test_plain(li):
assert validate([int], li) is ... |
3ce9f6d8537c6b6d0ec5a5e09c5f1f6b7b34699c | troposphere/eventschemas.py | troposphere/eventschemas.py | # Copyright (c) 2012-2019, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 14.1.0
from troposphere import Tags
from . import AWSObject
class Discoverer(AWSObject):
resource_type = "A... | # Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 41.0.0
from troposphere import Tags
from . import AWSObject
from .validators import boolean
class Discoverer(AW... | Update EventSchemas per 2021-09-02 changes | Update EventSchemas per 2021-09-02 changes
| Python | bsd-2-clause | cloudtools/troposphere,cloudtools/troposphere | # Copyright (c) 2012-2019, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 14.1.0
from troposphere import Tags
from . import AWSObject
class Discoverer(AWSObject):
resource_type = "A... | # Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 41.0.0
from troposphere import Tags
from . import AWSObject
from .validators import boolean
class Discoverer(AW... | <commit_before># Copyright (c) 2012-2019, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 14.1.0
from troposphere import Tags
from . import AWSObject
class Discoverer(AWSObject):
res... | # Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 41.0.0
from troposphere import Tags
from . import AWSObject
from .validators import boolean
class Discoverer(AW... | # Copyright (c) 2012-2019, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 14.1.0
from troposphere import Tags
from . import AWSObject
class Discoverer(AWSObject):
resource_type = "A... | <commit_before># Copyright (c) 2012-2019, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 14.1.0
from troposphere import Tags
from . import AWSObject
class Discoverer(AWSObject):
res... |
76ed79593a832c1cf85615d21b31f18f2c7adebf | yanico/session/__init__.py | yanico/session/__init__.py | # Copyright 2015-2016 Masayuki Yamamoto
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | # Copyright 2015-2016 Masayuki Yamamoto
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | Add docstring into load function | Add docstring into load function
Follow to Google style.
| Python | apache-2.0 | ma8ma/yanico | # Copyright 2015-2016 Masayuki Yamamoto
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | # Copyright 2015-2016 Masayuki Yamamoto
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | <commit_before># Copyright 2015-2016 Masayuki Yamamoto
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | # Copyright 2015-2016 Masayuki Yamamoto
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | # Copyright 2015-2016 Masayuki Yamamoto
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | <commit_before># Copyright 2015-2016 Masayuki Yamamoto
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
086e2bb85d0076c55dff886154664dc7179561fa | utils/summary_downloader.py | utils/summary_downloader.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
class SummaryDownloader():
# base url for official schedule json page
SCHEDULE_URL_BASE = "http://statsapi.web.nhl.com/api/v1/schedule"
# url template for official json gamefeed page
JSON_GAME_FEED_URL_TEMPLATE = (
"http://statsapi.web.nhl.com/ap... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from dateutil.parser import parse
from dateutil.relativedelta import DAILY
from dateutil.rrule import rrule
class SummaryDownloader():
# base url for official schedule json page
SCHEDULE_URL_BASE = "http://statsapi.web.nhl.com/api/v1/schedule"
# url template... | Add constructor to summary downloader | Add constructor to summary downloader
| Python | mit | leaffan/pynhldb | #!/usr/bin/env python
# -*- coding: utf-8 -*-
class SummaryDownloader():
# base url for official schedule json page
SCHEDULE_URL_BASE = "http://statsapi.web.nhl.com/api/v1/schedule"
# url template for official json gamefeed page
JSON_GAME_FEED_URL_TEMPLATE = (
"http://statsapi.web.nhl.com/ap... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from dateutil.parser import parse
from dateutil.relativedelta import DAILY
from dateutil.rrule import rrule
class SummaryDownloader():
# base url for official schedule json page
SCHEDULE_URL_BASE = "http://statsapi.web.nhl.com/api/v1/schedule"
# url template... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
class SummaryDownloader():
# base url for official schedule json page
SCHEDULE_URL_BASE = "http://statsapi.web.nhl.com/api/v1/schedule"
# url template for official json gamefeed page
JSON_GAME_FEED_URL_TEMPLATE = (
"http://statsapi... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from dateutil.parser import parse
from dateutil.relativedelta import DAILY
from dateutil.rrule import rrule
class SummaryDownloader():
# base url for official schedule json page
SCHEDULE_URL_BASE = "http://statsapi.web.nhl.com/api/v1/schedule"
# url template... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
class SummaryDownloader():
# base url for official schedule json page
SCHEDULE_URL_BASE = "http://statsapi.web.nhl.com/api/v1/schedule"
# url template for official json gamefeed page
JSON_GAME_FEED_URL_TEMPLATE = (
"http://statsapi.web.nhl.com/ap... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
class SummaryDownloader():
# base url for official schedule json page
SCHEDULE_URL_BASE = "http://statsapi.web.nhl.com/api/v1/schedule"
# url template for official json gamefeed page
JSON_GAME_FEED_URL_TEMPLATE = (
"http://statsapi... |
10a241938d5469f9da3d7d8a695963ac7cff87b2 | website/mosaic/settings_gondor.py | website/mosaic/settings_gondor.py | import os
import urlparse
from .settings import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
if "GONDOR_DATABASE_URL" in os.environ:
urlparse.uses_netloc.append("postgres")
url = urlparse.urlparse(os.environ["GONDOR_DATABASE_URL"])
DATA... | import os
import urlparse
from .settings import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
if "GONDOR_DATABASE_URL" in os.environ:
urlparse.uses_netloc.append("postgres")
url = urlparse.urlparse(os.environ["GONDOR_DATABASE_URL"])
DATA... | Remove secret key from the gondor settings file | Remove secret key from the gondor settings file
| Python | mit | sema/django-2012,sema/django-2012 | import os
import urlparse
from .settings import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
if "GONDOR_DATABASE_URL" in os.environ:
urlparse.uses_netloc.append("postgres")
url = urlparse.urlparse(os.environ["GONDOR_DATABASE_URL"])
DATA... | import os
import urlparse
from .settings import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
if "GONDOR_DATABASE_URL" in os.environ:
urlparse.uses_netloc.append("postgres")
url = urlparse.urlparse(os.environ["GONDOR_DATABASE_URL"])
DATA... | <commit_before>import os
import urlparse
from .settings import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
if "GONDOR_DATABASE_URL" in os.environ:
urlparse.uses_netloc.append("postgres")
url = urlparse.urlparse(os.environ["GONDOR_DATABASE_... | import os
import urlparse
from .settings import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
if "GONDOR_DATABASE_URL" in os.environ:
urlparse.uses_netloc.append("postgres")
url = urlparse.urlparse(os.environ["GONDOR_DATABASE_URL"])
DATA... | import os
import urlparse
from .settings import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
if "GONDOR_DATABASE_URL" in os.environ:
urlparse.uses_netloc.append("postgres")
url = urlparse.urlparse(os.environ["GONDOR_DATABASE_URL"])
DATA... | <commit_before>import os
import urlparse
from .settings import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
if "GONDOR_DATABASE_URL" in os.environ:
urlparse.uses_netloc.append("postgres")
url = urlparse.urlparse(os.environ["GONDOR_DATABASE_... |
e8e7bb5b7f063cc48b761fc17ef8f2264a17a2ce | dthm4kaiako/config/__init__.py | dthm4kaiako/config/__init__.py | """Configuration for Django system."""
__version__ = "0.17.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| """Configuration for Django system."""
__version__ = "0.17.3"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| Increment version number to 0.17.3 | Increment version number to 0.17.3
| Python | mit | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | """Configuration for Django system."""
__version__ = "0.17.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
Increment version number to 0.17.3 | """Configuration for Django system."""
__version__ = "0.17.3"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| <commit_before>"""Configuration for Django system."""
__version__ = "0.17.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
<commit_msg>Increment version number to 0.17.3<commit_after> | """Configuration for Django system."""
__version__ = "0.17.3"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
| """Configuration for Django system."""
__version__ = "0.17.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
Increment version number to 0.17.3"""Configuration for Django system."""
__version__ = "0.17.3"
__version_info... | <commit_before>"""Configuration for Django system."""
__version__ = "0.17.2"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
<commit_msg>Increment version number to 0.17.3<commit_after>"""Configuration for Django system."... |
50992031229ea903418935613cd5e1e561b04c91 | Control/PID.py | Control/PID.py | class PID:
def __init__(self, Kp=1, Ki=0.1, Kd=1, maxIntegralCorrection=0, minIntegralCorrection=-0):
self.Kp = Kp # Proporiional gain
self.Ki = Ki # Integral gain
self.Kd = Kd # Derivative gain
self.integral = 0
def incrementTime(self, error, dt):
self.integral = self.integral + error*self.Ki*dt
... | class PID:
def __init__(self, Kp=1, Ki=0.1, Kd=1, maxIntegralCorrection=0, minIntegralCorrection=-0):
self.Kp = Kp # Proportional gain
self.Ki = Ki # Integral gain
self.Kd = Kd # Derivative gain
self.integral = 0
def incrementTime(self, error, dt):
self.integral = self.integral + error*self.Ki*dt
d... | Correct typing error and arrange indentation | Correct typing error and arrange indentation
| Python | mit | baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite | class PID:
def __init__(self, Kp=1, Ki=0.1, Kd=1, maxIntegralCorrection=0, minIntegralCorrection=-0):
self.Kp = Kp # Proporiional gain
self.Ki = Ki # Integral gain
self.Kd = Kd # Derivative gain
self.integral = 0
def incrementTime(self, error, dt):
self.integral = self.integral + error*self.Ki*dt
... | class PID:
def __init__(self, Kp=1, Ki=0.1, Kd=1, maxIntegralCorrection=0, minIntegralCorrection=-0):
self.Kp = Kp # Proportional gain
self.Ki = Ki # Integral gain
self.Kd = Kd # Derivative gain
self.integral = 0
def incrementTime(self, error, dt):
self.integral = self.integral + error*self.Ki*dt
d... | <commit_before>class PID:
def __init__(self, Kp=1, Ki=0.1, Kd=1, maxIntegralCorrection=0, minIntegralCorrection=-0):
self.Kp = Kp # Proporiional gain
self.Ki = Ki # Integral gain
self.Kd = Kd # Derivative gain
self.integral = 0
def incrementTime(self, error, dt):
self.integral = self.integral + error*s... | class PID:
def __init__(self, Kp=1, Ki=0.1, Kd=1, maxIntegralCorrection=0, minIntegralCorrection=-0):
self.Kp = Kp # Proportional gain
self.Ki = Ki # Integral gain
self.Kd = Kd # Derivative gain
self.integral = 0
def incrementTime(self, error, dt):
self.integral = self.integral + error*self.Ki*dt
d... | class PID:
def __init__(self, Kp=1, Ki=0.1, Kd=1, maxIntegralCorrection=0, minIntegralCorrection=-0):
self.Kp = Kp # Proporiional gain
self.Ki = Ki # Integral gain
self.Kd = Kd # Derivative gain
self.integral = 0
def incrementTime(self, error, dt):
self.integral = self.integral + error*self.Ki*dt
... | <commit_before>class PID:
def __init__(self, Kp=1, Ki=0.1, Kd=1, maxIntegralCorrection=0, minIntegralCorrection=-0):
self.Kp = Kp # Proporiional gain
self.Ki = Ki # Integral gain
self.Kd = Kd # Derivative gain
self.integral = 0
def incrementTime(self, error, dt):
self.integral = self.integral + error*s... |
7d5a259460b4e8b8325fa55793ed4456425bda78 | xd/tool/log.py | xd/tool/log.py | import logging
class ConsoleFormatter(logging.Formatter):
"""A logging formatter for use when logging to console.
Log message above logging.INFO will be prefixed with the levelname, fx.:
ERROR: this is wrong
And logging.DEBUG messages will be prefixed with name of the logger, which
should norma... | import logging
class ConsoleFormatter(logging.Formatter):
"""A logging formatter for use when logging to console.
Log message above logging.INFO will be prefixed with the levelname, fx.:
ERROR: this is wrong
And logging.DEBUG messages will be prefixed with name of the logger, which
should norma... | Refactor ConsoleFormatter.format() method to formatMessage() | Refactor ConsoleFormatter.format() method to formatMessage()
Re-use the standard Formatter.format() method, and only override the
Formatter.formatMessage() method.
Signed-off-by: Esben Haabendal <da90c138e4a9573086862393cde34fa33d74f6e5@haabendal.dk>
| Python | mit | esben/xd-tool,XD-embedded/xd-tool,esben/xd-tool,XD-embedded/xd-tool | import logging
class ConsoleFormatter(logging.Formatter):
"""A logging formatter for use when logging to console.
Log message above logging.INFO will be prefixed with the levelname, fx.:
ERROR: this is wrong
And logging.DEBUG messages will be prefixed with name of the logger, which
should norma... | import logging
class ConsoleFormatter(logging.Formatter):
"""A logging formatter for use when logging to console.
Log message above logging.INFO will be prefixed with the levelname, fx.:
ERROR: this is wrong
And logging.DEBUG messages will be prefixed with name of the logger, which
should norma... | <commit_before>import logging
class ConsoleFormatter(logging.Formatter):
"""A logging formatter for use when logging to console.
Log message above logging.INFO will be prefixed with the levelname, fx.:
ERROR: this is wrong
And logging.DEBUG messages will be prefixed with name of the logger, which
... | import logging
class ConsoleFormatter(logging.Formatter):
"""A logging formatter for use when logging to console.
Log message above logging.INFO will be prefixed with the levelname, fx.:
ERROR: this is wrong
And logging.DEBUG messages will be prefixed with name of the logger, which
should norma... | import logging
class ConsoleFormatter(logging.Formatter):
"""A logging formatter for use when logging to console.
Log message above logging.INFO will be prefixed with the levelname, fx.:
ERROR: this is wrong
And logging.DEBUG messages will be prefixed with name of the logger, which
should norma... | <commit_before>import logging
class ConsoleFormatter(logging.Formatter):
"""A logging formatter for use when logging to console.
Log message above logging.INFO will be prefixed with the levelname, fx.:
ERROR: this is wrong
And logging.DEBUG messages will be prefixed with name of the logger, which
... |
5162275b9b6136f2b97d195384bb9979a0d79bfc | script/lib/config.py | script/lib/config.py | #!/usr/bin/env python
import platform
import sys
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '9f5271d31e0f32eac5a20ef6f543e3f1d43ad645'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[0],
'win32': '32bit',
... | #!/usr/bin/env python
import platform
import sys
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '56984fa0e4c3c745652510f342c0fb2724d846c2'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[0],
'win32': '32bit',
... | Upgrade libchromiumcontent for dbus headers | Upgrade libchromiumcontent for dbus headers
| Python | mit | ianscrivener/electron,chriskdon/electron,yalexx/electron,subblue/electron,nekuz0r/electron,systembugtj/electron,trankmichael/electron,posix4e/electron,bitemyapp/electron,beni55/electron,mrwizard82d1/electron,Faiz7412/electron,rajatsingla28/electron,tomashanacek/electron,kokdemo/electron,darwin/electron,vipulroxx/electr... | #!/usr/bin/env python
import platform
import sys
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '9f5271d31e0f32eac5a20ef6f543e3f1d43ad645'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[0],
'win32': '32bit',
... | #!/usr/bin/env python
import platform
import sys
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '56984fa0e4c3c745652510f342c0fb2724d846c2'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[0],
'win32': '32bit',
... | <commit_before>#!/usr/bin/env python
import platform
import sys
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '9f5271d31e0f32eac5a20ef6f543e3f1d43ad645'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[0],
'wi... | #!/usr/bin/env python
import platform
import sys
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '56984fa0e4c3c745652510f342c0fb2724d846c2'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[0],
'win32': '32bit',
... | #!/usr/bin/env python
import platform
import sys
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '9f5271d31e0f32eac5a20ef6f543e3f1d43ad645'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[0],
'win32': '32bit',
... | <commit_before>#!/usr/bin/env python
import platform
import sys
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '9f5271d31e0f32eac5a20ef6f543e3f1d43ad645'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[0],
'wi... |
5a2c03b9369ccd00cc8c5c7bca4b2fc40bb18a7f | passpie/credential.py | passpie/credential.py | import re
def split_fullname(fullname):
rgx = re.compile(r"(?P<login>.*)@(?P<name>.*)")
try:
name = rgx.match(fullname).group("name")
login = rgx.match(fullname).group("login")
except AttributeError:
raise ValueError("Not a valid name")
return login if login else "_", name
de... | import re
def split_fullname(fullname):
rgx = re.compile(r"(?P<login>.*)?@(?P<name>.*)")
try:
name = rgx.match(fullname).group("name")
login = rgx.match(fullname).group("login")
except AttributeError:
raise ValueError("Not a valid name")
return login if login else "_", name
d... | Fix regex for spliting fullnames | Fix regex for spliting fullnames
| Python | mit | marcwebbie/passpie,scorphus/passpie,marcwebbie/passpie,eiginn/passpie,scorphus/passpie,eiginn/passpie | import re
def split_fullname(fullname):
rgx = re.compile(r"(?P<login>.*)@(?P<name>.*)")
try:
name = rgx.match(fullname).group("name")
login = rgx.match(fullname).group("login")
except AttributeError:
raise ValueError("Not a valid name")
return login if login else "_", name
de... | import re
def split_fullname(fullname):
rgx = re.compile(r"(?P<login>.*)?@(?P<name>.*)")
try:
name = rgx.match(fullname).group("name")
login = rgx.match(fullname).group("login")
except AttributeError:
raise ValueError("Not a valid name")
return login if login else "_", name
d... | <commit_before>import re
def split_fullname(fullname):
rgx = re.compile(r"(?P<login>.*)@(?P<name>.*)")
try:
name = rgx.match(fullname).group("name")
login = rgx.match(fullname).group("login")
except AttributeError:
raise ValueError("Not a valid name")
return login if login else... | import re
def split_fullname(fullname):
rgx = re.compile(r"(?P<login>.*)?@(?P<name>.*)")
try:
name = rgx.match(fullname).group("name")
login = rgx.match(fullname).group("login")
except AttributeError:
raise ValueError("Not a valid name")
return login if login else "_", name
d... | import re
def split_fullname(fullname):
rgx = re.compile(r"(?P<login>.*)@(?P<name>.*)")
try:
name = rgx.match(fullname).group("name")
login = rgx.match(fullname).group("login")
except AttributeError:
raise ValueError("Not a valid name")
return login if login else "_", name
de... | <commit_before>import re
def split_fullname(fullname):
rgx = re.compile(r"(?P<login>.*)@(?P<name>.*)")
try:
name = rgx.match(fullname).group("name")
login = rgx.match(fullname).group("login")
except AttributeError:
raise ValueError("Not a valid name")
return login if login else... |
335abda444cbd5651af0d9a298570144627c7022 | passwordless/utils.py | passwordless/utils.py | import os
import random
import uuid
from django.contrib.auth.hashers import make_password,is_password_usable
from django.utils import timezone
from datetime import timedelta
WORDLIST_FILE = os.path.join(os.path.dirname(__file__), 'wordlist.txt')
def make_token():
"""
Generate a random token suitable for a... | import os
import random
import uuid
from django.utils import timezone
from datetime import timedelta
WORDLIST_FILE = os.path.join(os.path.dirname(__file__), 'wordlist.txt')
def make_token():
"""
Generate a random token suitable for activation/confirmation via email
A hex-encoded random UUID has plent... | Return app passwords as string | Return app passwords as string
| Python | mit | Kromey/fbxnano,Kromey/akwriters,Kromey/fbxnano,Kromey/fbxnano,Kromey/akwriters,Kromey/fbxnano,Kromey/akwriters,Kromey/akwriters | import os
import random
import uuid
from django.contrib.auth.hashers import make_password,is_password_usable
from django.utils import timezone
from datetime import timedelta
WORDLIST_FILE = os.path.join(os.path.dirname(__file__), 'wordlist.txt')
def make_token():
"""
Generate a random token suitable for a... | import os
import random
import uuid
from django.utils import timezone
from datetime import timedelta
WORDLIST_FILE = os.path.join(os.path.dirname(__file__), 'wordlist.txt')
def make_token():
"""
Generate a random token suitable for activation/confirmation via email
A hex-encoded random UUID has plent... | <commit_before>import os
import random
import uuid
from django.contrib.auth.hashers import make_password,is_password_usable
from django.utils import timezone
from datetime import timedelta
WORDLIST_FILE = os.path.join(os.path.dirname(__file__), 'wordlist.txt')
def make_token():
"""
Generate a random token... | import os
import random
import uuid
from django.utils import timezone
from datetime import timedelta
WORDLIST_FILE = os.path.join(os.path.dirname(__file__), 'wordlist.txt')
def make_token():
"""
Generate a random token suitable for activation/confirmation via email
A hex-encoded random UUID has plent... | import os
import random
import uuid
from django.contrib.auth.hashers import make_password,is_password_usable
from django.utils import timezone
from datetime import timedelta
WORDLIST_FILE = os.path.join(os.path.dirname(__file__), 'wordlist.txt')
def make_token():
"""
Generate a random token suitable for a... | <commit_before>import os
import random
import uuid
from django.contrib.auth.hashers import make_password,is_password_usable
from django.utils import timezone
from datetime import timedelta
WORDLIST_FILE = os.path.join(os.path.dirname(__file__), 'wordlist.txt')
def make_token():
"""
Generate a random token... |
551d86f64e1dadf54a4c63b633af6523dd5cdc05 | urbansim/utils/logutil.py | urbansim/utils/logutil.py | import contextlib
import logging
@contextlib.contextmanager
def log_start_finish(msg, logger, level=logging.DEBUG):
"""
A context manager to log messages with "start: " and "finish: "
prefixes before and after a block.
Parameters
----------
msg : str
Will be prefixed with "start: " an... | import contextlib
import logging
US_LOG_FMT = ('%(asctime)s|%(levelname)s|%(name)s|'
'%(funcName)s|%(filename)s|%(lineno)s|%(message)s')
US_LOG_DATE_FMT = '%Y-%m-%d %H:%M:%S'
US_FMT = logging.Formatter(fmt=US_LOG_FMT, datefmt=US_LOG_DATE_FMT)
@contextlib.contextmanager
def log_start_finish(msg, logger,... | Add utilities for controlling urbansim logging. | Add utilities for controlling urbansim logging.
| Python | bsd-3-clause | UDST/urbansim,waddell/urbansim,waddell/urbansim,ual/urbansim,UDST/urbansim,VladimirTyrin/urbansim,waddell/urbansim,ual/urbansim,AZMAG/urbansim,SANDAG/urbansim,synthicity/urbansim,SANDAG/urbansim,bricegnichols/urbansim,synthicity/urbansim,SANDAG/urbansim,AZMAG/urbansim,synthicity/urbansim,apdjustino/urbansim,ual/urbansi... | import contextlib
import logging
@contextlib.contextmanager
def log_start_finish(msg, logger, level=logging.DEBUG):
"""
A context manager to log messages with "start: " and "finish: "
prefixes before and after a block.
Parameters
----------
msg : str
Will be prefixed with "start: " an... | import contextlib
import logging
US_LOG_FMT = ('%(asctime)s|%(levelname)s|%(name)s|'
'%(funcName)s|%(filename)s|%(lineno)s|%(message)s')
US_LOG_DATE_FMT = '%Y-%m-%d %H:%M:%S'
US_FMT = logging.Formatter(fmt=US_LOG_FMT, datefmt=US_LOG_DATE_FMT)
@contextlib.contextmanager
def log_start_finish(msg, logger,... | <commit_before>import contextlib
import logging
@contextlib.contextmanager
def log_start_finish(msg, logger, level=logging.DEBUG):
"""
A context manager to log messages with "start: " and "finish: "
prefixes before and after a block.
Parameters
----------
msg : str
Will be prefixed wi... | import contextlib
import logging
US_LOG_FMT = ('%(asctime)s|%(levelname)s|%(name)s|'
'%(funcName)s|%(filename)s|%(lineno)s|%(message)s')
US_LOG_DATE_FMT = '%Y-%m-%d %H:%M:%S'
US_FMT = logging.Formatter(fmt=US_LOG_FMT, datefmt=US_LOG_DATE_FMT)
@contextlib.contextmanager
def log_start_finish(msg, logger,... | import contextlib
import logging
@contextlib.contextmanager
def log_start_finish(msg, logger, level=logging.DEBUG):
"""
A context manager to log messages with "start: " and "finish: "
prefixes before and after a block.
Parameters
----------
msg : str
Will be prefixed with "start: " an... | <commit_before>import contextlib
import logging
@contextlib.contextmanager
def log_start_finish(msg, logger, level=logging.DEBUG):
"""
A context manager to log messages with "start: " and "finish: "
prefixes before and after a block.
Parameters
----------
msg : str
Will be prefixed wi... |
57b375d7bab3b88137b2ef5d6b0c38056b758a48 | Mscthesis/IO/municipios_parser.py | Mscthesis/IO/municipios_parser.py |
"""
municipios_parser
-----------------
Module which contains the process of parsing data of municipios.
TODO
----
"""
import pandas as pd
from pythonUtils.ProcessTools import Processer
class Municipios_Parser(Processer):
"""This class is the one which controls the parsing process of municipios
informat... |
"""
municipios_parser
-----------------
Module which contains the process of parsing data of municipios.
TODO
----
"""
import pandas as pd
from pythonUtils.ProcessTools import Processer
class Municipios_Parser(Processer):
"""This class is the one which controls the parsing process of municipios
informat... | Change in the typ output. | Change in the typ output.
| Python | mit | tgquintela/Mscthesis |
"""
municipios_parser
-----------------
Module which contains the process of parsing data of municipios.
TODO
----
"""
import pandas as pd
from pythonUtils.ProcessTools import Processer
class Municipios_Parser(Processer):
"""This class is the one which controls the parsing process of municipios
informat... |
"""
municipios_parser
-----------------
Module which contains the process of parsing data of municipios.
TODO
----
"""
import pandas as pd
from pythonUtils.ProcessTools import Processer
class Municipios_Parser(Processer):
"""This class is the one which controls the parsing process of municipios
informat... | <commit_before>
"""
municipios_parser
-----------------
Module which contains the process of parsing data of municipios.
TODO
----
"""
import pandas as pd
from pythonUtils.ProcessTools import Processer
class Municipios_Parser(Processer):
"""This class is the one which controls the parsing process of municipi... |
"""
municipios_parser
-----------------
Module which contains the process of parsing data of municipios.
TODO
----
"""
import pandas as pd
from pythonUtils.ProcessTools import Processer
class Municipios_Parser(Processer):
"""This class is the one which controls the parsing process of municipios
informat... |
"""
municipios_parser
-----------------
Module which contains the process of parsing data of municipios.
TODO
----
"""
import pandas as pd
from pythonUtils.ProcessTools import Processer
class Municipios_Parser(Processer):
"""This class is the one which controls the parsing process of municipios
informat... | <commit_before>
"""
municipios_parser
-----------------
Module which contains the process of parsing data of municipios.
TODO
----
"""
import pandas as pd
from pythonUtils.ProcessTools import Processer
class Municipios_Parser(Processer):
"""This class is the one which controls the parsing process of municipi... |
4854015a61f0b582065b0d5561df231314abcce1 | django_redux_generator/management/commands/redux_generator.py | django_redux_generator/management/commands/redux_generator.py | from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
class Command(BaseCommand):
help = 'Generate redux boilerplate'
def add_arguments(self, parser):
parser.add_argument('action_name', type=str)
parser.add_argument('--thunk',
acti... | from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
class Command(BaseCommand):
help = 'Generate redux boilerplate'
def add_arguments(self, parser):
parser.add_argument('action_name', type=str)
parser.add_argument('--thunk',
acti... | Return the output rather than print | Return the output rather than print
| Python | mit | rapilabs/django-redux-generator,rapilabs/django-redux-generator | from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
class Command(BaseCommand):
help = 'Generate redux boilerplate'
def add_arguments(self, parser):
parser.add_argument('action_name', type=str)
parser.add_argument('--thunk',
acti... | from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
class Command(BaseCommand):
help = 'Generate redux boilerplate'
def add_arguments(self, parser):
parser.add_argument('action_name', type=str)
parser.add_argument('--thunk',
acti... | <commit_before>from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
class Command(BaseCommand):
help = 'Generate redux boilerplate'
def add_arguments(self, parser):
parser.add_argument('action_name', type=str)
parser.add_argument('--thunk',
... | from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
class Command(BaseCommand):
help = 'Generate redux boilerplate'
def add_arguments(self, parser):
parser.add_argument('action_name', type=str)
parser.add_argument('--thunk',
acti... | from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
class Command(BaseCommand):
help = 'Generate redux boilerplate'
def add_arguments(self, parser):
parser.add_argument('action_name', type=str)
parser.add_argument('--thunk',
acti... | <commit_before>from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
class Command(BaseCommand):
help = 'Generate redux boilerplate'
def add_arguments(self, parser):
parser.add_argument('action_name', type=str)
parser.add_argument('--thunk',
... |
d8ba1531b2e0faa71c57e8970af471ec2caa4a18 | en-2014-06-21-unit-testing-with-unittest-mock-patch/chdir2.py | en-2014-06-21-unit-testing-with-unittest-mock-patch/chdir2.py | """
chdir2
~~~~~~
An alternative implementation of :func:`chdir.chdir`.
:copyright: © 2014 by Petr Zemek <s3rvac@gmail.com>
:license: BSD, see LICENSE for more details
"""
import os
class chdir2():
"""An alternative implementation of :func:`chdir.chdir`."""
def __init__(self, dir):
... | """
chdir2
~~~~~~
An alternative implementation of :func:`chdir.chdir()`.
:copyright: © 2014 by Petr Zemek <s3rvac@gmail.com>
:license: BSD, see LICENSE for more details
"""
import os
class chdir2():
"""An alternative implementation of :func:`chdir.chdir()`."""
def __init__(self, dir):... | Add missing parentheses after 'chdir'. | blog/en-2014-06-21: Add missing parentheses after 'chdir'.
It is a function, so we better add parentheses to make this clearer.
| Python | bsd-3-clause | s3rvac/blog,s3rvac/blog,s3rvac/blog,s3rvac/blog | """
chdir2
~~~~~~
An alternative implementation of :func:`chdir.chdir`.
:copyright: © 2014 by Petr Zemek <s3rvac@gmail.com>
:license: BSD, see LICENSE for more details
"""
import os
class chdir2():
"""An alternative implementation of :func:`chdir.chdir`."""
def __init__(self, dir):
... | """
chdir2
~~~~~~
An alternative implementation of :func:`chdir.chdir()`.
:copyright: © 2014 by Petr Zemek <s3rvac@gmail.com>
:license: BSD, see LICENSE for more details
"""
import os
class chdir2():
"""An alternative implementation of :func:`chdir.chdir()`."""
def __init__(self, dir):... | <commit_before>"""
chdir2
~~~~~~
An alternative implementation of :func:`chdir.chdir`.
:copyright: © 2014 by Petr Zemek <s3rvac@gmail.com>
:license: BSD, see LICENSE for more details
"""
import os
class chdir2():
"""An alternative implementation of :func:`chdir.chdir`."""
def __init__(... | """
chdir2
~~~~~~
An alternative implementation of :func:`chdir.chdir()`.
:copyright: © 2014 by Petr Zemek <s3rvac@gmail.com>
:license: BSD, see LICENSE for more details
"""
import os
class chdir2():
"""An alternative implementation of :func:`chdir.chdir()`."""
def __init__(self, dir):... | """
chdir2
~~~~~~
An alternative implementation of :func:`chdir.chdir`.
:copyright: © 2014 by Petr Zemek <s3rvac@gmail.com>
:license: BSD, see LICENSE for more details
"""
import os
class chdir2():
"""An alternative implementation of :func:`chdir.chdir`."""
def __init__(self, dir):
... | <commit_before>"""
chdir2
~~~~~~
An alternative implementation of :func:`chdir.chdir`.
:copyright: © 2014 by Petr Zemek <s3rvac@gmail.com>
:license: BSD, see LICENSE for more details
"""
import os
class chdir2():
"""An alternative implementation of :func:`chdir.chdir`."""
def __init__(... |
f59919efefb78fffff564ec17c55f6df644e8d7e | server/lib/python/cartodb_services/cartodb_services/here/__init__.py | server/lib/python/cartodb_services/cartodb_services/here/__init__.py | from cartodb_services.here.geocoder import HereMapsGeocoder
from cartodb_services.here.bulk_geocoder import HereMapsBulkGeocoder
from cartodb_services.here.routing import HereMapsRoutingIsoline
| from cartodb_services.here.geocoder import HereMapsGeocoder, HereMapsGeocoderV7
from cartodb_services.here.bulk_geocoder import HereMapsBulkGeocoder, HereMapsBulkGeocoderV7
from cartodb_services.here.service_factory import get_geocoder, get_bulk_geocoder, get_routing_isoline
from cartodb_services.here.routing import He... | Add new imports for apikey parameter support | Add new imports for apikey parameter support
| Python | bsd-3-clause | CartoDB/dataservices-api,CartoDB/dataservices-api,CartoDB/dataservices-api,CartoDB/dataservices-api,CartoDB/geocoder-api,CartoDB/geocoder-api,CartoDB/geocoder-api,CartoDB/geocoder-api | from cartodb_services.here.geocoder import HereMapsGeocoder
from cartodb_services.here.bulk_geocoder import HereMapsBulkGeocoder
from cartodb_services.here.routing import HereMapsRoutingIsoline
Add new imports for apikey parameter support | from cartodb_services.here.geocoder import HereMapsGeocoder, HereMapsGeocoderV7
from cartodb_services.here.bulk_geocoder import HereMapsBulkGeocoder, HereMapsBulkGeocoderV7
from cartodb_services.here.service_factory import get_geocoder, get_bulk_geocoder, get_routing_isoline
from cartodb_services.here.routing import He... | <commit_before>from cartodb_services.here.geocoder import HereMapsGeocoder
from cartodb_services.here.bulk_geocoder import HereMapsBulkGeocoder
from cartodb_services.here.routing import HereMapsRoutingIsoline
<commit_msg>Add new imports for apikey parameter support<commit_after> | from cartodb_services.here.geocoder import HereMapsGeocoder, HereMapsGeocoderV7
from cartodb_services.here.bulk_geocoder import HereMapsBulkGeocoder, HereMapsBulkGeocoderV7
from cartodb_services.here.service_factory import get_geocoder, get_bulk_geocoder, get_routing_isoline
from cartodb_services.here.routing import He... | from cartodb_services.here.geocoder import HereMapsGeocoder
from cartodb_services.here.bulk_geocoder import HereMapsBulkGeocoder
from cartodb_services.here.routing import HereMapsRoutingIsoline
Add new imports for apikey parameter supportfrom cartodb_services.here.geocoder import HereMapsGeocoder, HereMapsGeocoderV7
fr... | <commit_before>from cartodb_services.here.geocoder import HereMapsGeocoder
from cartodb_services.here.bulk_geocoder import HereMapsBulkGeocoder
from cartodb_services.here.routing import HereMapsRoutingIsoline
<commit_msg>Add new imports for apikey parameter support<commit_after>from cartodb_services.here.geocoder impor... |
a6405ccfc7f53f601088206c216c5167fd86359f | symposion/teams/backends.py | symposion/teams/backends.py | from django.db.models import Q
from .models import Team
class TeamPermissionsBackend(object):
def authenticate(self, username=None, password=None):
return None
def get_team_permissions(self, user_obj, obj=None):
"""
Returns a set of permission strings that this user has through his/... | from django.db.models import Q
from .models import Team
class TeamPermissionsBackend(object):
def authenticate(self, username=None, password=None):
return None
def get_team_permissions(self, user_obj, obj=None):
"""
Returns a set of permission strings that this user has through his/... | Fix team permissions backend not pulling out manager_permissions | Fix team permissions backend not pulling out manager_permissions
Something like
request.user.has_perm('reviews.can_manage_%s' % proposal.kind.section.slug)
Will aways return false as the backend does a lookup of team membership
(member or manager) but only grabs the 'permissions' and not the
'manager_permissions' fie... | Python | bsd-3-clause | pyconau2017/symposion,pyconau2017/symposion | from django.db.models import Q
from .models import Team
class TeamPermissionsBackend(object):
def authenticate(self, username=None, password=None):
return None
def get_team_permissions(self, user_obj, obj=None):
"""
Returns a set of permission strings that this user has through his/... | from django.db.models import Q
from .models import Team
class TeamPermissionsBackend(object):
def authenticate(self, username=None, password=None):
return None
def get_team_permissions(self, user_obj, obj=None):
"""
Returns a set of permission strings that this user has through his/... | <commit_before>from django.db.models import Q
from .models import Team
class TeamPermissionsBackend(object):
def authenticate(self, username=None, password=None):
return None
def get_team_permissions(self, user_obj, obj=None):
"""
Returns a set of permission strings that this user h... | from django.db.models import Q
from .models import Team
class TeamPermissionsBackend(object):
def authenticate(self, username=None, password=None):
return None
def get_team_permissions(self, user_obj, obj=None):
"""
Returns a set of permission strings that this user has through his/... | from django.db.models import Q
from .models import Team
class TeamPermissionsBackend(object):
def authenticate(self, username=None, password=None):
return None
def get_team_permissions(self, user_obj, obj=None):
"""
Returns a set of permission strings that this user has through his/... | <commit_before>from django.db.models import Q
from .models import Team
class TeamPermissionsBackend(object):
def authenticate(self, username=None, password=None):
return None
def get_team_permissions(self, user_obj, obj=None):
"""
Returns a set of permission strings that this user h... |
23072e882edb6da55cb12ef0591a786235249670 | ome/__main__.py | ome/__main__.py | # ome - Object Message Expressions
# Copyright (c) 2015-2016 Luke McCarthy <luke@iogopro.co.uk>. All rights reserved.
import sys
from .command import command_args
from .error import OmeError
from .terminal import stderr
def main():
stderr.reset()
try:
from . import compiler
target = compiler.g... | # ome - Object Message Expressions
# Copyright (c) 2015-2016 Luke McCarthy <luke@iogopro.co.uk>. All rights reserved.
import sys
from .command import command_args
from .error import OmeError
from .terminal import stderr
def print_verbose(*args, **kwargs):
if command_args.verbose:
print(*args, **kwargs)
d... | Use print_verbose for conditional printing. | Use print_verbose for conditional printing.
| Python | mit | shaurz/ome,shaurz/ome | # ome - Object Message Expressions
# Copyright (c) 2015-2016 Luke McCarthy <luke@iogopro.co.uk>. All rights reserved.
import sys
from .command import command_args
from .error import OmeError
from .terminal import stderr
def main():
stderr.reset()
try:
from . import compiler
target = compiler.g... | # ome - Object Message Expressions
# Copyright (c) 2015-2016 Luke McCarthy <luke@iogopro.co.uk>. All rights reserved.
import sys
from .command import command_args
from .error import OmeError
from .terminal import stderr
def print_verbose(*args, **kwargs):
if command_args.verbose:
print(*args, **kwargs)
d... | <commit_before># ome - Object Message Expressions
# Copyright (c) 2015-2016 Luke McCarthy <luke@iogopro.co.uk>. All rights reserved.
import sys
from .command import command_args
from .error import OmeError
from .terminal import stderr
def main():
stderr.reset()
try:
from . import compiler
targ... | # ome - Object Message Expressions
# Copyright (c) 2015-2016 Luke McCarthy <luke@iogopro.co.uk>. All rights reserved.
import sys
from .command import command_args
from .error import OmeError
from .terminal import stderr
def print_verbose(*args, **kwargs):
if command_args.verbose:
print(*args, **kwargs)
d... | # ome - Object Message Expressions
# Copyright (c) 2015-2016 Luke McCarthy <luke@iogopro.co.uk>. All rights reserved.
import sys
from .command import command_args
from .error import OmeError
from .terminal import stderr
def main():
stderr.reset()
try:
from . import compiler
target = compiler.g... | <commit_before># ome - Object Message Expressions
# Copyright (c) 2015-2016 Luke McCarthy <luke@iogopro.co.uk>. All rights reserved.
import sys
from .command import command_args
from .error import OmeError
from .terminal import stderr
def main():
stderr.reset()
try:
from . import compiler
targ... |
36d2b9843160d9c3d439bc36c0188840fcdfa8b5 | examples/rmg/minimal_sensitivity/input.py | examples/rmg/minimal_sensitivity/input.py | # Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'],
kineticsEstimator = 'rate rules',
)
# Constraints on generated species
gener... | # Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'],
kineticsEstimator = 'rate rules',
)
# Constraints on generated species
gener... | Change saveSimulationProfiles to False in minimal_sensitivity | Change saveSimulationProfiles to False in minimal_sensitivity
just to test a diff parameter in this job
| Python | mit | chatelak/RMG-Py,nyee/RMG-Py,chatelak/RMG-Py,pierrelb/RMG-Py,nickvandewiele/RMG-Py,pierrelb/RMG-Py,nyee/RMG-Py,nickvandewiele/RMG-Py | # Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'],
kineticsEstimator = 'rate rules',
)
# Constraints on generated species
gener... | # Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'],
kineticsEstimator = 'rate rules',
)
# Constraints on generated species
gener... | <commit_before># Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'],
kineticsEstimator = 'rate rules',
)
# Constraints on generate... | # Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'],
kineticsEstimator = 'rate rules',
)
# Constraints on generated species
gener... | # Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'],
kineticsEstimator = 'rate rules',
)
# Constraints on generated species
gener... | <commit_before># Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'],
kineticsEstimator = 'rate rules',
)
# Constraints on generate... |
1bf4116bbd449769d209c4ff98b609b72bd312aa | api/views.py | api/views.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import User
from rest_framework import viewsets
from core.models import Timesheet, Task, Entry
from .serializers import (UserSerializer, TimesheetSerializer, TaskSerializer,
EntrySerializer)
cl... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import User
from rest_framework import viewsets
import django_filters
from core.models import Timesheet, Task, Entry
from .serializers import (UserSerializer, TimesheetSerializer, TaskSerializer,
... | Add date min-max filtering to API | Add date min-max filtering to API
| Python | bsd-2-clause | Leahelisabeth/timestrap,muhleder/timestrap,cdubz/timestrap,Leahelisabeth/timestrap,muhleder/timestrap,overshard/timestrap,overshard/timestrap,Leahelisabeth/timestrap,muhleder/timestrap,cdubz/timestrap,Leahelisabeth/timestrap,overshard/timestrap,cdubz/timestrap | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import User
from rest_framework import viewsets
from core.models import Timesheet, Task, Entry
from .serializers import (UserSerializer, TimesheetSerializer, TaskSerializer,
EntrySerializer)
cl... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import User
from rest_framework import viewsets
import django_filters
from core.models import Timesheet, Task, Entry
from .serializers import (UserSerializer, TimesheetSerializer, TaskSerializer,
... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import User
from rest_framework import viewsets
from core.models import Timesheet, Task, Entry
from .serializers import (UserSerializer, TimesheetSerializer, TaskSerializer,
EntryS... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import User
from rest_framework import viewsets
import django_filters
from core.models import Timesheet, Task, Entry
from .serializers import (UserSerializer, TimesheetSerializer, TaskSerializer,
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import User
from rest_framework import viewsets
from core.models import Timesheet, Task, Entry
from .serializers import (UserSerializer, TimesheetSerializer, TaskSerializer,
EntrySerializer)
cl... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import User
from rest_framework import viewsets
from core.models import Timesheet, Task, Entry
from .serializers import (UserSerializer, TimesheetSerializer, TaskSerializer,
EntryS... |
b5e11827929f37da8d18616f1fb3fc2d62591515 | djangocms_spa/decorators.py | djangocms_spa/decorators.py | from functools import wraps
from django.conf import settings
from django.core.cache import cache
from django.template.response import ContentNotRenderedError
from django.utils.decorators import available_attrs
def cache_view(view_func):
@wraps(view_func, assigned=available_attrs(view_func))
def _wrapped_view... | from functools import wraps
from django.conf import settings
from django.core.cache import cache
from django.template.response import ContentNotRenderedError
from django.utils.decorators import available_attrs
def cache_view(view_func):
@wraps(view_func, assigned=available_attrs(view_func))
def _wrapped_view... | Add language code to cache key explicitly | [language_activation] Add language code to cache key explicitly
| Python | mit | dreipol/djangocms-spa,dreipol/djangocms-spa | from functools import wraps
from django.conf import settings
from django.core.cache import cache
from django.template.response import ContentNotRenderedError
from django.utils.decorators import available_attrs
def cache_view(view_func):
@wraps(view_func, assigned=available_attrs(view_func))
def _wrapped_view... | from functools import wraps
from django.conf import settings
from django.core.cache import cache
from django.template.response import ContentNotRenderedError
from django.utils.decorators import available_attrs
def cache_view(view_func):
@wraps(view_func, assigned=available_attrs(view_func))
def _wrapped_view... | <commit_before>from functools import wraps
from django.conf import settings
from django.core.cache import cache
from django.template.response import ContentNotRenderedError
from django.utils.decorators import available_attrs
def cache_view(view_func):
@wraps(view_func, assigned=available_attrs(view_func))
de... | from functools import wraps
from django.conf import settings
from django.core.cache import cache
from django.template.response import ContentNotRenderedError
from django.utils.decorators import available_attrs
def cache_view(view_func):
@wraps(view_func, assigned=available_attrs(view_func))
def _wrapped_view... | from functools import wraps
from django.conf import settings
from django.core.cache import cache
from django.template.response import ContentNotRenderedError
from django.utils.decorators import available_attrs
def cache_view(view_func):
@wraps(view_func, assigned=available_attrs(view_func))
def _wrapped_view... | <commit_before>from functools import wraps
from django.conf import settings
from django.core.cache import cache
from django.template.response import ContentNotRenderedError
from django.utils.decorators import available_attrs
def cache_view(view_func):
@wraps(view_func, assigned=available_attrs(view_func))
de... |
e0aab62f2a693ca20a81c9e55c4220f379ac9eb1 | socialregistration/templatetags/socialregistration_tags.py | socialregistration/templatetags/socialregistration_tags.py | from django import template
register = template.Library()
@register.tag
def social_csrf_token():
"""
Wrapper around the ``{% csrf_token %}`` template tag to make socialregistration
work with both Django v1.2 and Django < v1.2
"""
return CsrfNode()
class CsrfNode(template.Node):
def render... | from django import template
register = template.Library()
@register.tag
def social_csrf_token(parser, token):
"""
Wrapper around the ``{% csrf_token %}`` template tag to make socialregistration
work with both Django v1.2 and Django < v1.2
"""
return CsrfNode()
class CsrfNode(template.Node):
... | Add necessary arguments to the social_csrf_token tag. | Add necessary arguments to the social_csrf_token tag.
| Python | mit | praekelt/django-socialregistration,aditweb/django-socialregistration,minlex/django-socialregistration,kapt/django-socialregistration,coxmediagroup/django-socialregistration,aditweb/django-socialregistration,flashingpumpkin/django-socialregistration,mark-adams/django-socialregistration,mark-adams/django-socialregistrati... | from django import template
register = template.Library()
@register.tag
def social_csrf_token():
"""
Wrapper around the ``{% csrf_token %}`` template tag to make socialregistration
work with both Django v1.2 and Django < v1.2
"""
return CsrfNode()
class CsrfNode(template.Node):
def render... | from django import template
register = template.Library()
@register.tag
def social_csrf_token(parser, token):
"""
Wrapper around the ``{% csrf_token %}`` template tag to make socialregistration
work with both Django v1.2 and Django < v1.2
"""
return CsrfNode()
class CsrfNode(template.Node):
... | <commit_before>from django import template
register = template.Library()
@register.tag
def social_csrf_token():
"""
Wrapper around the ``{% csrf_token %}`` template tag to make socialregistration
work with both Django v1.2 and Django < v1.2
"""
return CsrfNode()
class CsrfNode(template.Node):... | from django import template
register = template.Library()
@register.tag
def social_csrf_token(parser, token):
"""
Wrapper around the ``{% csrf_token %}`` template tag to make socialregistration
work with both Django v1.2 and Django < v1.2
"""
return CsrfNode()
class CsrfNode(template.Node):
... | from django import template
register = template.Library()
@register.tag
def social_csrf_token():
"""
Wrapper around the ``{% csrf_token %}`` template tag to make socialregistration
work with both Django v1.2 and Django < v1.2
"""
return CsrfNode()
class CsrfNode(template.Node):
def render... | <commit_before>from django import template
register = template.Library()
@register.tag
def social_csrf_token():
"""
Wrapper around the ``{% csrf_token %}`` template tag to make socialregistration
work with both Django v1.2 and Django < v1.2
"""
return CsrfNode()
class CsrfNode(template.Node):... |
7ea8420e9653765d960938340124b8c2274c69fc | Site/Settings.py | Site/Settings.py | import os
settings = {}
domain = 'localhost:8080'
framework = 'flask'
debug = False
clearOnLoad = False
emailOnRegister = False
registrationDisabled = False
cacheDirectory = "./Site/Cache"
siteDown = False
database = 'osf20120530' # Mongo
cookieDomain = '.openscienceframework.org' # Beaker
static = '%s/static' % os.pa... | import os
settings = {}
domain = 'localhost:8080'
framework = 'flask'
debug = False
clearOnLoad = False
emailOnRegister = False
registrationDisabled = False
cacheDirectory = "./Site/Cache"
siteDown = False
database = 'osf20120530' # Mongo
cookieDomain = '.openscienceframework.org' # Beaker
static = os.path.join(os.pat... | Improve OS compatibility for settings | Improve OS compatibility for settings
| Python | apache-2.0 | cslzchen/osf.io,mattclark/osf.io,kwierman/osf.io,SSJohns/osf.io,caseyrollins/osf.io,HarryRybacki/osf.io,monikagrabowska/osf.io,HarryRybacki/osf.io,Nesiehr/osf.io,himanshuo/osf.io,SSJohns/osf.io,jnayak1/osf.io,billyhunt/osf.io,fabianvf/osf.io,CenterForOpenScience/osf.io,TomHeatwole/osf.io,chennan47/osf.io,HarryRybacki/o... | import os
settings = {}
domain = 'localhost:8080'
framework = 'flask'
debug = False
clearOnLoad = False
emailOnRegister = False
registrationDisabled = False
cacheDirectory = "./Site/Cache"
siteDown = False
database = 'osf20120530' # Mongo
cookieDomain = '.openscienceframework.org' # Beaker
static = '%s/static' % os.pa... | import os
settings = {}
domain = 'localhost:8080'
framework = 'flask'
debug = False
clearOnLoad = False
emailOnRegister = False
registrationDisabled = False
cacheDirectory = "./Site/Cache"
siteDown = False
database = 'osf20120530' # Mongo
cookieDomain = '.openscienceframework.org' # Beaker
static = os.path.join(os.pat... | <commit_before>import os
settings = {}
domain = 'localhost:8080'
framework = 'flask'
debug = False
clearOnLoad = False
emailOnRegister = False
registrationDisabled = False
cacheDirectory = "./Site/Cache"
siteDown = False
database = 'osf20120530' # Mongo
cookieDomain = '.openscienceframework.org' # Beaker
static = '%s/... | import os
settings = {}
domain = 'localhost:8080'
framework = 'flask'
debug = False
clearOnLoad = False
emailOnRegister = False
registrationDisabled = False
cacheDirectory = "./Site/Cache"
siteDown = False
database = 'osf20120530' # Mongo
cookieDomain = '.openscienceframework.org' # Beaker
static = os.path.join(os.pat... | import os
settings = {}
domain = 'localhost:8080'
framework = 'flask'
debug = False
clearOnLoad = False
emailOnRegister = False
registrationDisabled = False
cacheDirectory = "./Site/Cache"
siteDown = False
database = 'osf20120530' # Mongo
cookieDomain = '.openscienceframework.org' # Beaker
static = '%s/static' % os.pa... | <commit_before>import os
settings = {}
domain = 'localhost:8080'
framework = 'flask'
debug = False
clearOnLoad = False
emailOnRegister = False
registrationDisabled = False
cacheDirectory = "./Site/Cache"
siteDown = False
database = 'osf20120530' # Mongo
cookieDomain = '.openscienceframework.org' # Beaker
static = '%s/... |
09ec6e4611a763e823a5e3d15fb233a0132fd06b | imagersite/imagersite/tests.py | imagersite/imagersite/tests.py | from django.test import Client, TestCase
from django.contrib.auth.models import User
HOME = '/'
REGISTER = '/accounts/register/'
LOGIN = '/login'
LOGOUT = '/logout'
class UnauthenticatedUser(TestCase):
"""Create unauth user for testing."""
def setUp(self):
"""Setup unauth user."""
client = C... | """Tests for project level urls and views."""
from __future__ import unicode_literals
from django.contrib.staticfiles import finders
from django.test import Client, TestCase
from django.contrib.auth.models import User
HOME = '/'
REGISTER = '/accounts/register/'
LOGIN = '/login'
LOGOUT = '/logout'
DEFAULT_IMAGE = finde... | Add passing test for default image | Add passing test for default image
| Python | mit | SeleniumK/django-imager,SeleniumK/django-imager,SeleniumK/django-imager | from django.test import Client, TestCase
from django.contrib.auth.models import User
HOME = '/'
REGISTER = '/accounts/register/'
LOGIN = '/login'
LOGOUT = '/logout'
class UnauthenticatedUser(TestCase):
"""Create unauth user for testing."""
def setUp(self):
"""Setup unauth user."""
client = C... | """Tests for project level urls and views."""
from __future__ import unicode_literals
from django.contrib.staticfiles import finders
from django.test import Client, TestCase
from django.contrib.auth.models import User
HOME = '/'
REGISTER = '/accounts/register/'
LOGIN = '/login'
LOGOUT = '/logout'
DEFAULT_IMAGE = finde... | <commit_before>from django.test import Client, TestCase
from django.contrib.auth.models import User
HOME = '/'
REGISTER = '/accounts/register/'
LOGIN = '/login'
LOGOUT = '/logout'
class UnauthenticatedUser(TestCase):
"""Create unauth user for testing."""
def setUp(self):
"""Setup unauth user."""
... | """Tests for project level urls and views."""
from __future__ import unicode_literals
from django.contrib.staticfiles import finders
from django.test import Client, TestCase
from django.contrib.auth.models import User
HOME = '/'
REGISTER = '/accounts/register/'
LOGIN = '/login'
LOGOUT = '/logout'
DEFAULT_IMAGE = finde... | from django.test import Client, TestCase
from django.contrib.auth.models import User
HOME = '/'
REGISTER = '/accounts/register/'
LOGIN = '/login'
LOGOUT = '/logout'
class UnauthenticatedUser(TestCase):
"""Create unauth user for testing."""
def setUp(self):
"""Setup unauth user."""
client = C... | <commit_before>from django.test import Client, TestCase
from django.contrib.auth.models import User
HOME = '/'
REGISTER = '/accounts/register/'
LOGIN = '/login'
LOGOUT = '/logout'
class UnauthenticatedUser(TestCase):
"""Create unauth user for testing."""
def setUp(self):
"""Setup unauth user."""
... |
24c24ab8a6c662079c397a8d91228b3b8d45f033 | testing/test_integration.py | testing/test_integration.py | import sys
from setuptools_scm.utils import do
def test_pyproject_support(tmpdir, monkeypatch):
monkeypatch.delenv("SETUPTOOLS_SCM_DEBUG")
pkg = tmpdir.ensure("package", dir=42)
pkg.join("pyproject.toml").write(
"""[tool.setuptools_scm]
fallback_version = "12.34"
"""
)
pkg.join("setup.py"... | import sys
import pytest
from setuptools_scm.utils import do
@pytest.fixture
def wd(wd):
wd("git init")
wd("git config user.email test@example.com")
wd('git config user.name "a test"')
wd.add_command = "git add ."
wd.commit_command = "git commit -m test-{reason}"
return wd
def test_pyproje... | Test pyproject.toml integration using git | Test pyproject.toml integration using git
See #374.
| Python | mit | pypa/setuptools_scm,pypa/setuptools_scm,RonnyPfannschmidt/setuptools_scm,RonnyPfannschmidt/setuptools_scm | import sys
from setuptools_scm.utils import do
def test_pyproject_support(tmpdir, monkeypatch):
monkeypatch.delenv("SETUPTOOLS_SCM_DEBUG")
pkg = tmpdir.ensure("package", dir=42)
pkg.join("pyproject.toml").write(
"""[tool.setuptools_scm]
fallback_version = "12.34"
"""
)
pkg.join("setup.py"... | import sys
import pytest
from setuptools_scm.utils import do
@pytest.fixture
def wd(wd):
wd("git init")
wd("git config user.email test@example.com")
wd('git config user.name "a test"')
wd.add_command = "git add ."
wd.commit_command = "git commit -m test-{reason}"
return wd
def test_pyproje... | <commit_before>import sys
from setuptools_scm.utils import do
def test_pyproject_support(tmpdir, monkeypatch):
monkeypatch.delenv("SETUPTOOLS_SCM_DEBUG")
pkg = tmpdir.ensure("package", dir=42)
pkg.join("pyproject.toml").write(
"""[tool.setuptools_scm]
fallback_version = "12.34"
"""
)
pkg.... | import sys
import pytest
from setuptools_scm.utils import do
@pytest.fixture
def wd(wd):
wd("git init")
wd("git config user.email test@example.com")
wd('git config user.name "a test"')
wd.add_command = "git add ."
wd.commit_command = "git commit -m test-{reason}"
return wd
def test_pyproje... | import sys
from setuptools_scm.utils import do
def test_pyproject_support(tmpdir, monkeypatch):
monkeypatch.delenv("SETUPTOOLS_SCM_DEBUG")
pkg = tmpdir.ensure("package", dir=42)
pkg.join("pyproject.toml").write(
"""[tool.setuptools_scm]
fallback_version = "12.34"
"""
)
pkg.join("setup.py"... | <commit_before>import sys
from setuptools_scm.utils import do
def test_pyproject_support(tmpdir, monkeypatch):
monkeypatch.delenv("SETUPTOOLS_SCM_DEBUG")
pkg = tmpdir.ensure("package", dir=42)
pkg.join("pyproject.toml").write(
"""[tool.setuptools_scm]
fallback_version = "12.34"
"""
)
pkg.... |
81936bfbac9254fcd90d294c299ad635504cd93c | police_api/service.py | police_api/service.py | import logging
import requests
from .exceptions import APIError
from .version import __version__
logger = logging.getLogger(__name__)
class BaseService(object):
def __init__(self, api, **config):
self.api = api
self.config = {
'base_url': 'http://data.police.uk/api/',
'u... | import logging
import requests
from .exceptions import APIError
from .version import __version__
logger = logging.getLogger(__name__)
class BaseService(object):
def __init__(self, api, **config):
self.api = api
self.config = {
'base_url': 'http://data.police.uk/api/',
'u... | Refactor request mechanics into an internal method on BaseService | Refactor request mechanics into an internal method on BaseService
| Python | mit | rkhleics/police-api-client-python | import logging
import requests
from .exceptions import APIError
from .version import __version__
logger = logging.getLogger(__name__)
class BaseService(object):
def __init__(self, api, **config):
self.api = api
self.config = {
'base_url': 'http://data.police.uk/api/',
'u... | import logging
import requests
from .exceptions import APIError
from .version import __version__
logger = logging.getLogger(__name__)
class BaseService(object):
def __init__(self, api, **config):
self.api = api
self.config = {
'base_url': 'http://data.police.uk/api/',
'u... | <commit_before>import logging
import requests
from .exceptions import APIError
from .version import __version__
logger = logging.getLogger(__name__)
class BaseService(object):
def __init__(self, api, **config):
self.api = api
self.config = {
'base_url': 'http://data.police.uk/api/',... | import logging
import requests
from .exceptions import APIError
from .version import __version__
logger = logging.getLogger(__name__)
class BaseService(object):
def __init__(self, api, **config):
self.api = api
self.config = {
'base_url': 'http://data.police.uk/api/',
'u... | import logging
import requests
from .exceptions import APIError
from .version import __version__
logger = logging.getLogger(__name__)
class BaseService(object):
def __init__(self, api, **config):
self.api = api
self.config = {
'base_url': 'http://data.police.uk/api/',
'u... | <commit_before>import logging
import requests
from .exceptions import APIError
from .version import __version__
logger = logging.getLogger(__name__)
class BaseService(object):
def __init__(self, api, **config):
self.api = api
self.config = {
'base_url': 'http://data.police.uk/api/',... |
178c25714aaae056c115f1580f19d833486a54ac | datapipe/targets/objects.py | datapipe/targets/objects.py | from ..target import Target
import hashlib
import dill
import joblib
class PyTarget(Target):
def __init__(self, name, obj=None):
self._name = name
self._obj = obj
super(PyTarget, self).__init__()
if not obj is None:
self.set(obj)
def identifier(self):
return... | from ..target import Target
import hashlib
import dill
import joblib
class PyTarget(Target):
def __init__(self, name, obj=None):
self._name = name
self._obj = obj
super(PyTarget, self).__init__()
if not obj is None:
self.set(obj)
def identifier(self):
return... | Make PyTarget object work again | Make PyTarget object work again
We now save a base64 encoded pickled version of the object.
| Python | mit | ibab/datapipe | from ..target import Target
import hashlib
import dill
import joblib
class PyTarget(Target):
def __init__(self, name, obj=None):
self._name = name
self._obj = obj
super(PyTarget, self).__init__()
if not obj is None:
self.set(obj)
def identifier(self):
return... | from ..target import Target
import hashlib
import dill
import joblib
class PyTarget(Target):
def __init__(self, name, obj=None):
self._name = name
self._obj = obj
super(PyTarget, self).__init__()
if not obj is None:
self.set(obj)
def identifier(self):
return... | <commit_before>from ..target import Target
import hashlib
import dill
import joblib
class PyTarget(Target):
def __init__(self, name, obj=None):
self._name = name
self._obj = obj
super(PyTarget, self).__init__()
if not obj is None:
self.set(obj)
def identifier(self):... | from ..target import Target
import hashlib
import dill
import joblib
class PyTarget(Target):
def __init__(self, name, obj=None):
self._name = name
self._obj = obj
super(PyTarget, self).__init__()
if not obj is None:
self.set(obj)
def identifier(self):
return... | from ..target import Target
import hashlib
import dill
import joblib
class PyTarget(Target):
def __init__(self, name, obj=None):
self._name = name
self._obj = obj
super(PyTarget, self).__init__()
if not obj is None:
self.set(obj)
def identifier(self):
return... | <commit_before>from ..target import Target
import hashlib
import dill
import joblib
class PyTarget(Target):
def __init__(self, name, obj=None):
self._name = name
self._obj = obj
super(PyTarget, self).__init__()
if not obj is None:
self.set(obj)
def identifier(self):... |
4d3f809ba5e1b5109e6f2e73d9c9630371660210 | Bookie/bookie/lib/access.py | Bookie/bookie/lib/access.py | """Handle auth and authz activities in bookie"""
from pyramid.httpexceptions import HTTPForbidden
class Authorize(object):
"""Context manager to check if the user is authorized
use:
with Authorize(some_key):
# do work
Will return NotAuthorized if it fails
"""
def __init__(s... | """Handle auth and authz activities in bookie"""
import logging
from pyramid.httpexceptions import HTTPForbidden
LOG = logging.getLogger(__name__)
class Authorize(object):
"""Context manager to check if the user is authorized
use:
with Authorize(some_key):
# do work
Will return Not... | Update to make sure we log an error with an invalid key | Update to make sure we log an error with an invalid key
| Python | agpl-3.0 | GreenLunar/Bookie,adamlincoln/Bookie,wangjun/Bookie,bookieio/Bookie,GreenLunar/Bookie,teodesson/Bookie,adamlincoln/Bookie,pombredanne/Bookie,bookieio/Bookie,teodesson/Bookie,adamlincoln/Bookie,GreenLunar/Bookie,wangjun/Bookie,wangjun/Bookie,skmezanul/Bookie,wangjun/Bookie,GreenLunar/Bookie,skmezanul/Bookie,adamlincoln/... | """Handle auth and authz activities in bookie"""
from pyramid.httpexceptions import HTTPForbidden
class Authorize(object):
"""Context manager to check if the user is authorized
use:
with Authorize(some_key):
# do work
Will return NotAuthorized if it fails
"""
def __init__(s... | """Handle auth and authz activities in bookie"""
import logging
from pyramid.httpexceptions import HTTPForbidden
LOG = logging.getLogger(__name__)
class Authorize(object):
"""Context manager to check if the user is authorized
use:
with Authorize(some_key):
# do work
Will return Not... | <commit_before>"""Handle auth and authz activities in bookie"""
from pyramid.httpexceptions import HTTPForbidden
class Authorize(object):
"""Context manager to check if the user is authorized
use:
with Authorize(some_key):
# do work
Will return NotAuthorized if it fails
"""
... | """Handle auth and authz activities in bookie"""
import logging
from pyramid.httpexceptions import HTTPForbidden
LOG = logging.getLogger(__name__)
class Authorize(object):
"""Context manager to check if the user is authorized
use:
with Authorize(some_key):
# do work
Will return Not... | """Handle auth and authz activities in bookie"""
from pyramid.httpexceptions import HTTPForbidden
class Authorize(object):
"""Context manager to check if the user is authorized
use:
with Authorize(some_key):
# do work
Will return NotAuthorized if it fails
"""
def __init__(s... | <commit_before>"""Handle auth and authz activities in bookie"""
from pyramid.httpexceptions import HTTPForbidden
class Authorize(object):
"""Context manager to check if the user is authorized
use:
with Authorize(some_key):
# do work
Will return NotAuthorized if it fails
"""
... |
8b4ea06ae8c61f0745a13e4c0118d6f499a31738 | app.py | app.py | from flask import Flask, jsonify, request
from dotenv import load_dotenv, find_dotenv
from twilio import twiml
from Queue import Queue
from threading import Thread
from time import sleep
load_dotenv(find_dotenv())
directions = ['forward', 'backward']
task_q = Queue()
def send_rasp(task_q):
while True:
sleep(2)... | from flask import Flask, jsonify, request
from dotenv import load_dotenv, find_dotenv
from twilio import twiml
from Queue import Queue
from threading import Thread
from time import sleep
load_dotenv(find_dotenv())
directions = ['forward', 'backward']
task_q = Queue()
def send_rasp(task_q):
while True:
sleep(2)... | Use continue in task loop | Use continue in task loop
| Python | mit | tforrest/twilio-plays-roomba-flask | from flask import Flask, jsonify, request
from dotenv import load_dotenv, find_dotenv
from twilio import twiml
from Queue import Queue
from threading import Thread
from time import sleep
load_dotenv(find_dotenv())
directions = ['forward', 'backward']
task_q = Queue()
def send_rasp(task_q):
while True:
sleep(2)... | from flask import Flask, jsonify, request
from dotenv import load_dotenv, find_dotenv
from twilio import twiml
from Queue import Queue
from threading import Thread
from time import sleep
load_dotenv(find_dotenv())
directions = ['forward', 'backward']
task_q = Queue()
def send_rasp(task_q):
while True:
sleep(2)... | <commit_before>from flask import Flask, jsonify, request
from dotenv import load_dotenv, find_dotenv
from twilio import twiml
from Queue import Queue
from threading import Thread
from time import sleep
load_dotenv(find_dotenv())
directions = ['forward', 'backward']
task_q = Queue()
def send_rasp(task_q):
while T... | from flask import Flask, jsonify, request
from dotenv import load_dotenv, find_dotenv
from twilio import twiml
from Queue import Queue
from threading import Thread
from time import sleep
load_dotenv(find_dotenv())
directions = ['forward', 'backward']
task_q = Queue()
def send_rasp(task_q):
while True:
sleep(2)... | from flask import Flask, jsonify, request
from dotenv import load_dotenv, find_dotenv
from twilio import twiml
from Queue import Queue
from threading import Thread
from time import sleep
load_dotenv(find_dotenv())
directions = ['forward', 'backward']
task_q = Queue()
def send_rasp(task_q):
while True:
sleep(2)... | <commit_before>from flask import Flask, jsonify, request
from dotenv import load_dotenv, find_dotenv
from twilio import twiml
from Queue import Queue
from threading import Thread
from time import sleep
load_dotenv(find_dotenv())
directions = ['forward', 'backward']
task_q = Queue()
def send_rasp(task_q):
while T... |
0389fabdb0343b189b153cc909b05e88d3830b94 | downstream_node/lib/node.py | downstream_node/lib/node.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from downstream_node.config import config
from downstream_node.models import Challenges
from heartbeat import Heartbeat
from downstream_node.startup import db
__all__ = ['create_token', 'delete_token', 'add_file', 'remove_file',
'gen_challenges', 'update_chall... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from downstream_node.config import config
from downstream_node.models import Challenges, Files
from heartbeat import Heartbeat
from downstream_node.startup import db
__all__ = ['create_token', 'delete_token', 'add_file', 'remove_file',
'gen_challenges', 'updat... | Fix for new column names | Fix for new column names
| Python | mit | Storj/downstream-node,Storj/downstream-node | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from downstream_node.config import config
from downstream_node.models import Challenges
from heartbeat import Heartbeat
from downstream_node.startup import db
__all__ = ['create_token', 'delete_token', 'add_file', 'remove_file',
'gen_challenges', 'update_chall... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from downstream_node.config import config
from downstream_node.models import Challenges, Files
from heartbeat import Heartbeat
from downstream_node.startup import db
__all__ = ['create_token', 'delete_token', 'add_file', 'remove_file',
'gen_challenges', 'updat... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from downstream_node.config import config
from downstream_node.models import Challenges
from heartbeat import Heartbeat
from downstream_node.startup import db
__all__ = ['create_token', 'delete_token', 'add_file', 'remove_file',
'gen_challenges'... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from downstream_node.config import config
from downstream_node.models import Challenges, Files
from heartbeat import Heartbeat
from downstream_node.startup import db
__all__ = ['create_token', 'delete_token', 'add_file', 'remove_file',
'gen_challenges', 'updat... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from downstream_node.config import config
from downstream_node.models import Challenges
from heartbeat import Heartbeat
from downstream_node.startup import db
__all__ = ['create_token', 'delete_token', 'add_file', 'remove_file',
'gen_challenges', 'update_chall... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from downstream_node.config import config
from downstream_node.models import Challenges
from heartbeat import Heartbeat
from downstream_node.startup import db
__all__ = ['create_token', 'delete_token', 'add_file', 'remove_file',
'gen_challenges'... |
efc1988d704a7a1231046dea8af65dcdba7897fd | py/fbx_write.py | py/fbx_write.py | # !/usr/bin/env python
# Blender has moved to Python 3!
import sys
import os
import bpy
for sysarg in sys.argv:
print(sysarg)
py_args = sys.argv[sys.argv.index('--') + 1]
py_args = py_args.split(' ')
for arg in py_args:
if (arg.startswith('basedir:')):
basedir = arg.split('basedir:')[1]
else:
... | # !/usr/bin/env python
# Blender has moved to Python 3!
import sys
import os
import bpy
for sysarg in sys.argv:
print(sysarg)
py_args = sys.argv[sys.argv.index('--') + 1]
py_args = py_args.split(' ')
for arg in py_args:
if (arg.startswith('basedir:')):
basedir = arg.split('basedir:')[1]
else:
... | Quit Blender after writing FBX | Quit Blender after writing FBX
| Python | mit | hackmcr15-code-a-la-mode/mol-vis-hack,hackmcr15-code-a-la-mode/mol-vis-hack | # !/usr/bin/env python
# Blender has moved to Python 3!
import sys
import os
import bpy
for sysarg in sys.argv:
print(sysarg)
py_args = sys.argv[sys.argv.index('--') + 1]
py_args = py_args.split(' ')
for arg in py_args:
if (arg.startswith('basedir:')):
basedir = arg.split('basedir:')[1]
else:
... | # !/usr/bin/env python
# Blender has moved to Python 3!
import sys
import os
import bpy
for sysarg in sys.argv:
print(sysarg)
py_args = sys.argv[sys.argv.index('--') + 1]
py_args = py_args.split(' ')
for arg in py_args:
if (arg.startswith('basedir:')):
basedir = arg.split('basedir:')[1]
else:
... | <commit_before># !/usr/bin/env python
# Blender has moved to Python 3!
import sys
import os
import bpy
for sysarg in sys.argv:
print(sysarg)
py_args = sys.argv[sys.argv.index('--') + 1]
py_args = py_args.split(' ')
for arg in py_args:
if (arg.startswith('basedir:')):
basedir = arg.split('basedir:')... | # !/usr/bin/env python
# Blender has moved to Python 3!
import sys
import os
import bpy
for sysarg in sys.argv:
print(sysarg)
py_args = sys.argv[sys.argv.index('--') + 1]
py_args = py_args.split(' ')
for arg in py_args:
if (arg.startswith('basedir:')):
basedir = arg.split('basedir:')[1]
else:
... | # !/usr/bin/env python
# Blender has moved to Python 3!
import sys
import os
import bpy
for sysarg in sys.argv:
print(sysarg)
py_args = sys.argv[sys.argv.index('--') + 1]
py_args = py_args.split(' ')
for arg in py_args:
if (arg.startswith('basedir:')):
basedir = arg.split('basedir:')[1]
else:
... | <commit_before># !/usr/bin/env python
# Blender has moved to Python 3!
import sys
import os
import bpy
for sysarg in sys.argv:
print(sysarg)
py_args = sys.argv[sys.argv.index('--') + 1]
py_args = py_args.split(' ')
for arg in py_args:
if (arg.startswith('basedir:')):
basedir = arg.split('basedir:')... |
1f3fce7cb415e739bdb745295807cceaf853d176 | easy_thumbnails/__init__.py | easy_thumbnails/__init__.py | VERSION = (1, 0, 'alpha', 11)
def get_version(join=' ', short=False):
"""
Return the version of this package as a string.
The version number is built from a ``VERSION`` tuple, which should consist
of integers, or trailing version information (such as 'alpha', 'beta' or
'final'). For example:
... | VERSION = (1, 0, 'alpha', 12)
def get_version(join=' ', short=False):
"""
Return the version of this package as a string.
The version number is built from a ``VERSION`` tuple, which should consist
of integers, or trailing version information (such as 'alpha', 'beta' or
'final'). For example:
... | Bump version number for another release with ducktyping in it | Bump version number for another release with ducktyping in it
| Python | bsd-3-clause | sandow-digital/easy-thumbnails-cropman,jrief/easy-thumbnails,Mactory/easy-thumbnails,emschorsch/easy-thumbnails,sandow-digital/easy-thumbnails-cropman,siovene/easy-thumbnails,jrief/easy-thumbnails,emschorsch/easy-thumbnails,SmileyChris/easy-thumbnails,jaddison/easy-thumbnails | VERSION = (1, 0, 'alpha', 11)
def get_version(join=' ', short=False):
"""
Return the version of this package as a string.
The version number is built from a ``VERSION`` tuple, which should consist
of integers, or trailing version information (such as 'alpha', 'beta' or
'final'). For example:
... | VERSION = (1, 0, 'alpha', 12)
def get_version(join=' ', short=False):
"""
Return the version of this package as a string.
The version number is built from a ``VERSION`` tuple, which should consist
of integers, or trailing version information (such as 'alpha', 'beta' or
'final'). For example:
... | <commit_before>VERSION = (1, 0, 'alpha', 11)
def get_version(join=' ', short=False):
"""
Return the version of this package as a string.
The version number is built from a ``VERSION`` tuple, which should consist
of integers, or trailing version information (such as 'alpha', 'beta' or
'final'). Fo... | VERSION = (1, 0, 'alpha', 12)
def get_version(join=' ', short=False):
"""
Return the version of this package as a string.
The version number is built from a ``VERSION`` tuple, which should consist
of integers, or trailing version information (such as 'alpha', 'beta' or
'final'). For example:
... | VERSION = (1, 0, 'alpha', 11)
def get_version(join=' ', short=False):
"""
Return the version of this package as a string.
The version number is built from a ``VERSION`` tuple, which should consist
of integers, or trailing version information (such as 'alpha', 'beta' or
'final'). For example:
... | <commit_before>VERSION = (1, 0, 'alpha', 11)
def get_version(join=' ', short=False):
"""
Return the version of this package as a string.
The version number is built from a ``VERSION`` tuple, which should consist
of integers, or trailing version information (such as 'alpha', 'beta' or
'final'). Fo... |
aca031267748358c49eac96fe158ba0a2ec3a2e8 | tota/drawers/json_replay.py | tota/drawers/json_replay.py | import json
from os import path
from tota.game import Drawer
class JsonReplayDrawer(Drawer):
def __init__(self, replay_dir):
self.replay_dir = replay_dir
def draw(self, game):
"""Draw the world with 'ascii'-art ."""
things_data = []
tick_data = {
't': game.world.t... | import json
from os import path
from tota.game import Drawer
class JsonReplayDrawer(Drawer):
def __init__(self, replay_dir):
self.replay_dir = replay_dir
def draw(self, game):
"""Draw the world with 'ascii'-art ."""
things_data = []
tick_data = {
't': game.world.t... | Add done result to replay | Add done result to replay
| Python | mit | dmoisset/tota,matuu/tota,fisadev/tota | import json
from os import path
from tota.game import Drawer
class JsonReplayDrawer(Drawer):
def __init__(self, replay_dir):
self.replay_dir = replay_dir
def draw(self, game):
"""Draw the world with 'ascii'-art ."""
things_data = []
tick_data = {
't': game.world.t... | import json
from os import path
from tota.game import Drawer
class JsonReplayDrawer(Drawer):
def __init__(self, replay_dir):
self.replay_dir = replay_dir
def draw(self, game):
"""Draw the world with 'ascii'-art ."""
things_data = []
tick_data = {
't': game.world.t... | <commit_before>import json
from os import path
from tota.game import Drawer
class JsonReplayDrawer(Drawer):
def __init__(self, replay_dir):
self.replay_dir = replay_dir
def draw(self, game):
"""Draw the world with 'ascii'-art ."""
things_data = []
tick_data = {
't... | import json
from os import path
from tota.game import Drawer
class JsonReplayDrawer(Drawer):
def __init__(self, replay_dir):
self.replay_dir = replay_dir
def draw(self, game):
"""Draw the world with 'ascii'-art ."""
things_data = []
tick_data = {
't': game.world.t... | import json
from os import path
from tota.game import Drawer
class JsonReplayDrawer(Drawer):
def __init__(self, replay_dir):
self.replay_dir = replay_dir
def draw(self, game):
"""Draw the world with 'ascii'-art ."""
things_data = []
tick_data = {
't': game.world.t... | <commit_before>import json
from os import path
from tota.game import Drawer
class JsonReplayDrawer(Drawer):
def __init__(self, replay_dir):
self.replay_dir = replay_dir
def draw(self, game):
"""Draw the world with 'ascii'-art ."""
things_data = []
tick_data = {
't... |
c3c703b411d05e6f2d52a0b3695b9dc22bc907d8 | test/test_main.py | test/test_main.py | from mpf.main import main
def test_main():
main()
| import matplotlib
matplotlib.use('Agg') # Not to use X server. For TravisCI.
from mpf.main import main
def test_main():
main()
| Make matplotlib work with TravisCI | Make matplotlib work with TravisCI
| Python | mit | Vayel/MPF,tartopum/MPF | from mpf.main import main
def test_main():
main()
Make matplotlib work with TravisCI | import matplotlib
matplotlib.use('Agg') # Not to use X server. For TravisCI.
from mpf.main import main
def test_main():
main()
| <commit_before>from mpf.main import main
def test_main():
main()
<commit_msg>Make matplotlib work with TravisCI<commit_after> | import matplotlib
matplotlib.use('Agg') # Not to use X server. For TravisCI.
from mpf.main import main
def test_main():
main()
| from mpf.main import main
def test_main():
main()
Make matplotlib work with TravisCIimport matplotlib
matplotlib.use('Agg') # Not to use X server. For TravisCI.
from mpf.main import main
def test_main():
main()
| <commit_before>from mpf.main import main
def test_main():
main()
<commit_msg>Make matplotlib work with TravisCI<commit_after>import matplotlib
matplotlib.use('Agg') # Not to use X server. For TravisCI.
from mpf.main import main
def test_main():
main()
|
1a5aeabcdfae02125e167e8a221de4151819f5b5 | test.py | test.py | import unittest
from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen
class RotorTestCase(unittest.TestCase):
def test_rotor_encoding(self):
rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q')
self.assertEqual('E', rotor.encode('A'))
def run_tests():
runner = unittest.Text... | import unittest
from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen
class RotorTestCase(unittest.TestCase):
def test_rotor_encoding(self):
rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q')
self.assertEqual('E', rotor.encode('A'))
def test_rotor_reverse_encoding(self):
... | Test if default rotor encodes backwards properly | Test if default rotor encodes backwards properly
| Python | mit | ranisalt/enigma | import unittest
from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen
class RotorTestCase(unittest.TestCase):
def test_rotor_encoding(self):
rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q')
self.assertEqual('E', rotor.encode('A'))
def run_tests():
runner = unittest.Text... | import unittest
from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen
class RotorTestCase(unittest.TestCase):
def test_rotor_encoding(self):
rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q')
self.assertEqual('E', rotor.encode('A'))
def test_rotor_reverse_encoding(self):
... | <commit_before>import unittest
from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen
class RotorTestCase(unittest.TestCase):
def test_rotor_encoding(self):
rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q')
self.assertEqual('E', rotor.encode('A'))
def run_tests():
runner ... | import unittest
from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen
class RotorTestCase(unittest.TestCase):
def test_rotor_encoding(self):
rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q')
self.assertEqual('E', rotor.encode('A'))
def test_rotor_reverse_encoding(self):
... | import unittest
from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen
class RotorTestCase(unittest.TestCase):
def test_rotor_encoding(self):
rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q')
self.assertEqual('E', rotor.encode('A'))
def run_tests():
runner = unittest.Text... | <commit_before>import unittest
from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen
class RotorTestCase(unittest.TestCase):
def test_rotor_encoding(self):
rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q')
self.assertEqual('E', rotor.encode('A'))
def run_tests():
runner ... |
1a5cc5b69811db2ac63987ab329bd117e61f3f03 | tests/__init__.py | tests/__init__.py | import os
from functools import partial
TESTS_DIR = os.path.dirname(os.path.abspath(__file__))
TEST_DATA_DIR = os.path.join(TESTS_DIR, 'test_data')
AppEventTestXml = partial(open, os.path.join(TEST_DATA_DIR, 'app_event.xml'))
| Make the test data accessible to the tests. | Make the test data accessible to the tests.
| Python | bsd-3-clause | unt-libraries/django-premis-event-service,unt-libraries/django-premis-event-service,unt-libraries/django-premis-event-service | Make the test data accessible to the tests. | import os
from functools import partial
TESTS_DIR = os.path.dirname(os.path.abspath(__file__))
TEST_DATA_DIR = os.path.join(TESTS_DIR, 'test_data')
AppEventTestXml = partial(open, os.path.join(TEST_DATA_DIR, 'app_event.xml'))
| <commit_before><commit_msg>Make the test data accessible to the tests.<commit_after> | import os
from functools import partial
TESTS_DIR = os.path.dirname(os.path.abspath(__file__))
TEST_DATA_DIR = os.path.join(TESTS_DIR, 'test_data')
AppEventTestXml = partial(open, os.path.join(TEST_DATA_DIR, 'app_event.xml'))
| Make the test data accessible to the tests.import os
from functools import partial
TESTS_DIR = os.path.dirname(os.path.abspath(__file__))
TEST_DATA_DIR = os.path.join(TESTS_DIR, 'test_data')
AppEventTestXml = partial(open, os.path.join(TEST_DATA_DIR, 'app_event.xml'))
| <commit_before><commit_msg>Make the test data accessible to the tests.<commit_after>import os
from functools import partial
TESTS_DIR = os.path.dirname(os.path.abspath(__file__))
TEST_DATA_DIR = os.path.join(TESTS_DIR, 'test_data')
AppEventTestXml = partial(open, os.path.join(TEST_DATA_DIR, 'app_event.xml'))
| |
6160da958f4b8ecb1553c7bcca0b32bc1a5a1649 | tests/conftest.py | tests/conftest.py | import os
import shutil
import tempfile
import builtins
import subprocess
import pytest
from rever import environ
@pytest.fixture
def gitrepo(request):
"""A test fixutre that creates and destroys a git repo in a temporary
directory.
This will yield the path to the repo.
"""
cwd = os.getcwd()
... | import os
import shutil
import tempfile
import builtins
import subprocess
import pytest
import sys
from rever import environ
@pytest.fixture
def gitrepo(request):
"""A test fixutre that creates and destroys a git repo in a temporary
directory.
This will yield the path to the repo.
"""
cwd = os.g... | Make sure .git test directory is removed on Windows | Make sure .git test directory is removed on Windows
| Python | bsd-3-clause | scopatz/rever,ergs/rever | import os
import shutil
import tempfile
import builtins
import subprocess
import pytest
from rever import environ
@pytest.fixture
def gitrepo(request):
"""A test fixutre that creates and destroys a git repo in a temporary
directory.
This will yield the path to the repo.
"""
cwd = os.getcwd()
... | import os
import shutil
import tempfile
import builtins
import subprocess
import pytest
import sys
from rever import environ
@pytest.fixture
def gitrepo(request):
"""A test fixutre that creates and destroys a git repo in a temporary
directory.
This will yield the path to the repo.
"""
cwd = os.g... | <commit_before>import os
import shutil
import tempfile
import builtins
import subprocess
import pytest
from rever import environ
@pytest.fixture
def gitrepo(request):
"""A test fixutre that creates and destroys a git repo in a temporary
directory.
This will yield the path to the repo.
"""
cwd = ... | import os
import shutil
import tempfile
import builtins
import subprocess
import pytest
import sys
from rever import environ
@pytest.fixture
def gitrepo(request):
"""A test fixutre that creates and destroys a git repo in a temporary
directory.
This will yield the path to the repo.
"""
cwd = os.g... | import os
import shutil
import tempfile
import builtins
import subprocess
import pytest
from rever import environ
@pytest.fixture
def gitrepo(request):
"""A test fixutre that creates and destroys a git repo in a temporary
directory.
This will yield the path to the repo.
"""
cwd = os.getcwd()
... | <commit_before>import os
import shutil
import tempfile
import builtins
import subprocess
import pytest
from rever import environ
@pytest.fixture
def gitrepo(request):
"""A test fixutre that creates and destroys a git repo in a temporary
directory.
This will yield the path to the repo.
"""
cwd = ... |
c4e71b56e74ab8b81a670c690fef6942d4a412b4 | ocds/storage/backends/fs.py | ocds/storage/backends/fs.py | import os
import os.path
import logging
import datetime
from .base import Storage
from ocds.storage.errors import InvalidPath
logger = logging.getLogger(__name__)
class FSStorage(Storage):
def __init__(self, base_path):
self.base_path = base_path
if not os.path.exists(self.base_path):
... | import os
import os.path
import logging
import datetime
import simplejson as json
from .base import Storage
from ocds.export.helpers import encoder
from ocds.storage.errors import InvalidPath
join = os.path.join
logger = logging.getLogger(__name__)
class FSStorage(Storage):
def __init__(self, base_path):
... | Add basic file system storage | Add basic file system storage
| Python | apache-2.0 | yshalenyk/openprocurement.ocds.export,yshalenyk/ocds.storage,yshalenyk/ocds.export,yshalenyk/openprocurement.ocds.export | import os
import os.path
import logging
import datetime
from .base import Storage
from ocds.storage.errors import InvalidPath
logger = logging.getLogger(__name__)
class FSStorage(Storage):
def __init__(self, base_path):
self.base_path = base_path
if not os.path.exists(self.base_path):
... | import os
import os.path
import logging
import datetime
import simplejson as json
from .base import Storage
from ocds.export.helpers import encoder
from ocds.storage.errors import InvalidPath
join = os.path.join
logger = logging.getLogger(__name__)
class FSStorage(Storage):
def __init__(self, base_path):
... | <commit_before>import os
import os.path
import logging
import datetime
from .base import Storage
from ocds.storage.errors import InvalidPath
logger = logging.getLogger(__name__)
class FSStorage(Storage):
def __init__(self, base_path):
self.base_path = base_path
if not os.path.exists(self.base_p... | import os
import os.path
import logging
import datetime
import simplejson as json
from .base import Storage
from ocds.export.helpers import encoder
from ocds.storage.errors import InvalidPath
join = os.path.join
logger = logging.getLogger(__name__)
class FSStorage(Storage):
def __init__(self, base_path):
... | import os
import os.path
import logging
import datetime
from .base import Storage
from ocds.storage.errors import InvalidPath
logger = logging.getLogger(__name__)
class FSStorage(Storage):
def __init__(self, base_path):
self.base_path = base_path
if not os.path.exists(self.base_path):
... | <commit_before>import os
import os.path
import logging
import datetime
from .base import Storage
from ocds.storage.errors import InvalidPath
logger = logging.getLogger(__name__)
class FSStorage(Storage):
def __init__(self, base_path):
self.base_path = base_path
if not os.path.exists(self.base_p... |
2ccfb54f493bf0ffa07db910514a8429a2c51d73 | changes/api/node_job_index.py | changes/api/node_job_index.py | from __future__ import absolute_import
from sqlalchemy.orm import joinedload
from changes.api.base import APIView
from changes.api.serializer.models.job import JobWithBuildSerializer
from changes.models import Job, JobStep, Node
class NodeJobIndexAPIView(APIView):
def get(self, node_id):
node = Node.que... | from __future__ import absolute_import
from sqlalchemy.orm import joinedload
from changes.api.base import APIView
from changes.models import Build, Job, JobStep, Node
class NodeJobIndexAPIView(APIView):
def get(self, node_id):
node = Node.query.get(node_id)
if node is None:
return ''... | Improve query patterns on node job list | Improve query patterns on node job list
| Python | apache-2.0 | wfxiang08/changes,wfxiang08/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,dropbox/changes,dropbox/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes | from __future__ import absolute_import
from sqlalchemy.orm import joinedload
from changes.api.base import APIView
from changes.api.serializer.models.job import JobWithBuildSerializer
from changes.models import Job, JobStep, Node
class NodeJobIndexAPIView(APIView):
def get(self, node_id):
node = Node.que... | from __future__ import absolute_import
from sqlalchemy.orm import joinedload
from changes.api.base import APIView
from changes.models import Build, Job, JobStep, Node
class NodeJobIndexAPIView(APIView):
def get(self, node_id):
node = Node.query.get(node_id)
if node is None:
return ''... | <commit_before>from __future__ import absolute_import
from sqlalchemy.orm import joinedload
from changes.api.base import APIView
from changes.api.serializer.models.job import JobWithBuildSerializer
from changes.models import Job, JobStep, Node
class NodeJobIndexAPIView(APIView):
def get(self, node_id):
... | from __future__ import absolute_import
from sqlalchemy.orm import joinedload
from changes.api.base import APIView
from changes.models import Build, Job, JobStep, Node
class NodeJobIndexAPIView(APIView):
def get(self, node_id):
node = Node.query.get(node_id)
if node is None:
return ''... | from __future__ import absolute_import
from sqlalchemy.orm import joinedload
from changes.api.base import APIView
from changes.api.serializer.models.job import JobWithBuildSerializer
from changes.models import Job, JobStep, Node
class NodeJobIndexAPIView(APIView):
def get(self, node_id):
node = Node.que... | <commit_before>from __future__ import absolute_import
from sqlalchemy.orm import joinedload
from changes.api.base import APIView
from changes.api.serializer.models.job import JobWithBuildSerializer
from changes.models import Job, JobStep, Node
class NodeJobIndexAPIView(APIView):
def get(self, node_id):
... |
c12f3e516eb28d306a103582495216253dd98e7e | feedreader/tasks/core.py | feedreader/tasks/core.py | from celery import Celery
class Tasks(object):
def __init__(self, debug=False):
self.app = Celery()
self.app.conf.update(
CELERY_ACCEPT_CONTENT=['json'],
CELERY_ALWAYS_EAGER=True,
CELERY_ENABLE_UTC=True,
CELERY_TASK_SERIALIZER='json',
CE... | from celery import Celery
class Tasks(object):
def __init__(self, debug=False):
self.app = Celery()
self.app.conf.update(
CELERY_ACCEPT_CONTENT=['json'],
CELERY_ALWAYS_EAGER=True,
CELERY_ENABLE_UTC=True,
CELERY_TASK_SERIALIZER='json',
CE... | Add a stub task for fetch_feed | Add a stub task for fetch_feed
| Python | mit | tdryer/feeder,tdryer/feeder | from celery import Celery
class Tasks(object):
def __init__(self, debug=False):
self.app = Celery()
self.app.conf.update(
CELERY_ACCEPT_CONTENT=['json'],
CELERY_ALWAYS_EAGER=True,
CELERY_ENABLE_UTC=True,
CELERY_TASK_SERIALIZER='json',
CE... | from celery import Celery
class Tasks(object):
def __init__(self, debug=False):
self.app = Celery()
self.app.conf.update(
CELERY_ACCEPT_CONTENT=['json'],
CELERY_ALWAYS_EAGER=True,
CELERY_ENABLE_UTC=True,
CELERY_TASK_SERIALIZER='json',
CE... | <commit_before>from celery import Celery
class Tasks(object):
def __init__(self, debug=False):
self.app = Celery()
self.app.conf.update(
CELERY_ACCEPT_CONTENT=['json'],
CELERY_ALWAYS_EAGER=True,
CELERY_ENABLE_UTC=True,
CELERY_TASK_SERIALIZER='json',... | from celery import Celery
class Tasks(object):
def __init__(self, debug=False):
self.app = Celery()
self.app.conf.update(
CELERY_ACCEPT_CONTENT=['json'],
CELERY_ALWAYS_EAGER=True,
CELERY_ENABLE_UTC=True,
CELERY_TASK_SERIALIZER='json',
CE... | from celery import Celery
class Tasks(object):
def __init__(self, debug=False):
self.app = Celery()
self.app.conf.update(
CELERY_ACCEPT_CONTENT=['json'],
CELERY_ALWAYS_EAGER=True,
CELERY_ENABLE_UTC=True,
CELERY_TASK_SERIALIZER='json',
CE... | <commit_before>from celery import Celery
class Tasks(object):
def __init__(self, debug=False):
self.app = Celery()
self.app.conf.update(
CELERY_ACCEPT_CONTENT=['json'],
CELERY_ALWAYS_EAGER=True,
CELERY_ENABLE_UTC=True,
CELERY_TASK_SERIALIZER='json',... |
8beaab317d5da25edd093be42f57e35ac12408b8 | feincms3/plugins/html.py | feincms3/plugins/html.py | """
Plugin providing a simple textarea where raw HTML, CSS and JS code can be
entered.
Most useful for people wanting to shoot themselves in the foot.
"""
from django.db import models
from django.utils.html import mark_safe
from django.utils.translation import ugettext_lazy as _
from content_editor.admin import Cont... | """
Plugin providing a simple textarea where raw HTML, CSS and JS code can be
entered.
Most useful for people wanting to shoot themselves in the foot.
"""
from django import forms
from django.db import models
from django.utils.html import mark_safe
from django.utils.translation import ugettext_lazy as _
from content... | Make the default HTML textarea smaller | Make the default HTML textarea smaller
| Python | bsd-3-clause | matthiask/feincms3,matthiask/feincms3,matthiask/feincms3 | """
Plugin providing a simple textarea where raw HTML, CSS and JS code can be
entered.
Most useful for people wanting to shoot themselves in the foot.
"""
from django.db import models
from django.utils.html import mark_safe
from django.utils.translation import ugettext_lazy as _
from content_editor.admin import Cont... | """
Plugin providing a simple textarea where raw HTML, CSS and JS code can be
entered.
Most useful for people wanting to shoot themselves in the foot.
"""
from django import forms
from django.db import models
from django.utils.html import mark_safe
from django.utils.translation import ugettext_lazy as _
from content... | <commit_before>"""
Plugin providing a simple textarea where raw HTML, CSS and JS code can be
entered.
Most useful for people wanting to shoot themselves in the foot.
"""
from django.db import models
from django.utils.html import mark_safe
from django.utils.translation import ugettext_lazy as _
from content_editor.ad... | """
Plugin providing a simple textarea where raw HTML, CSS and JS code can be
entered.
Most useful for people wanting to shoot themselves in the foot.
"""
from django import forms
from django.db import models
from django.utils.html import mark_safe
from django.utils.translation import ugettext_lazy as _
from content... | """
Plugin providing a simple textarea where raw HTML, CSS and JS code can be
entered.
Most useful for people wanting to shoot themselves in the foot.
"""
from django.db import models
from django.utils.html import mark_safe
from django.utils.translation import ugettext_lazy as _
from content_editor.admin import Cont... | <commit_before>"""
Plugin providing a simple textarea where raw HTML, CSS and JS code can be
entered.
Most useful for people wanting to shoot themselves in the foot.
"""
from django.db import models
from django.utils.html import mark_safe
from django.utils.translation import ugettext_lazy as _
from content_editor.ad... |
720833e96e24ffe73822a3a1280e3dc901e52829 | anchorhub/lib/filetolist.py | anchorhub/lib/filetolist.py | """
Class for FileToList
"""
class FileToList(object):
"""
FileToList is a helper class used to import text files and turn them into
lists, with each index in the list representing a single line from the
text file.
"""
@staticmethod
def to_list(file_path):
"""
Static method... | """
Class for FileToList
"""
class FileToList(object):
"""
FileToList is a helper class used to import text files and turn them into
lists, with each index in the list representing a single line from the
text file.
"""
@staticmethod
def to_list(file_path):
"""
Static method... | Remove 'b' classifer on FileToList's read() usage | Remove 'b' classifer on FileToList's read() usage
| Python | apache-2.0 | samjabrahams/anchorhub | """
Class for FileToList
"""
class FileToList(object):
"""
FileToList is a helper class used to import text files and turn them into
lists, with each index in the list representing a single line from the
text file.
"""
@staticmethod
def to_list(file_path):
"""
Static method... | """
Class for FileToList
"""
class FileToList(object):
"""
FileToList is a helper class used to import text files and turn them into
lists, with each index in the list representing a single line from the
text file.
"""
@staticmethod
def to_list(file_path):
"""
Static method... | <commit_before>"""
Class for FileToList
"""
class FileToList(object):
"""
FileToList is a helper class used to import text files and turn them into
lists, with each index in the list representing a single line from the
text file.
"""
@staticmethod
def to_list(file_path):
"""
... | """
Class for FileToList
"""
class FileToList(object):
"""
FileToList is a helper class used to import text files and turn them into
lists, with each index in the list representing a single line from the
text file.
"""
@staticmethod
def to_list(file_path):
"""
Static method... | """
Class for FileToList
"""
class FileToList(object):
"""
FileToList is a helper class used to import text files and turn them into
lists, with each index in the list representing a single line from the
text file.
"""
@staticmethod
def to_list(file_path):
"""
Static method... | <commit_before>"""
Class for FileToList
"""
class FileToList(object):
"""
FileToList is a helper class used to import text files and turn them into
lists, with each index in the list representing a single line from the
text file.
"""
@staticmethod
def to_list(file_path):
"""
... |
614f83d826c51a51ebb4feb01371a441473af423 | featureflow/__init__.py | featureflow/__init__.py | __version__ = '1.16.14'
from model import BaseModel
from feature import Feature, JSONFeature, TextFeature, CompressedFeature, \
PickleFeature
from extractor import Node, Graph, Aggregator, NotEnoughData
from bytestream import ByteStream, ByteStreamFeature, ZipWrapper, iter_zip
from data import \
IdProvider... | __version__ = '1.16.14'
from model import BaseModel
from feature import Feature, JSONFeature, TextFeature, CompressedFeature, \
PickleFeature
from extractor import Node, Graph, Aggregator, NotEnoughData
from bytestream import ByteStream, ByteStreamFeature, ZipWrapper, iter_zip
from data import \
IdProvider... | Add PickleEncoder to the public API | Add PickleEncoder to the public API
| Python | mit | JohnVinyard/featureflow,JohnVinyard/featureflow | __version__ = '1.16.14'
from model import BaseModel
from feature import Feature, JSONFeature, TextFeature, CompressedFeature, \
PickleFeature
from extractor import Node, Graph, Aggregator, NotEnoughData
from bytestream import ByteStream, ByteStreamFeature, ZipWrapper, iter_zip
from data import \
IdProvider... | __version__ = '1.16.14'
from model import BaseModel
from feature import Feature, JSONFeature, TextFeature, CompressedFeature, \
PickleFeature
from extractor import Node, Graph, Aggregator, NotEnoughData
from bytestream import ByteStream, ByteStreamFeature, ZipWrapper, iter_zip
from data import \
IdProvider... | <commit_before>__version__ = '1.16.14'
from model import BaseModel
from feature import Feature, JSONFeature, TextFeature, CompressedFeature, \
PickleFeature
from extractor import Node, Graph, Aggregator, NotEnoughData
from bytestream import ByteStream, ByteStreamFeature, ZipWrapper, iter_zip
from data import \... | __version__ = '1.16.14'
from model import BaseModel
from feature import Feature, JSONFeature, TextFeature, CompressedFeature, \
PickleFeature
from extractor import Node, Graph, Aggregator, NotEnoughData
from bytestream import ByteStream, ByteStreamFeature, ZipWrapper, iter_zip
from data import \
IdProvider... | __version__ = '1.16.14'
from model import BaseModel
from feature import Feature, JSONFeature, TextFeature, CompressedFeature, \
PickleFeature
from extractor import Node, Graph, Aggregator, NotEnoughData
from bytestream import ByteStream, ByteStreamFeature, ZipWrapper, iter_zip
from data import \
IdProvider... | <commit_before>__version__ = '1.16.14'
from model import BaseModel
from feature import Feature, JSONFeature, TextFeature, CompressedFeature, \
PickleFeature
from extractor import Node, Graph, Aggregator, NotEnoughData
from bytestream import ByteStream, ByteStreamFeature, ZipWrapper, iter_zip
from data import \... |
d087e0cc47697e6b7f222de90a4143e3bb612a66 | radar/models/forms.py | radar/models/forms.py | from sqlalchemy import Column, Integer, ForeignKey, String
from sqlalchemy.orm import relationship
from sqlalchemy.dialects import postgresql
from radar.database import db
from radar.models.common import uuid_pk_column, MetaModelMixin, patient_id_column, patient_relationship
from radar.models.logs import log_cha... | from sqlalchemy import Column, Integer, ForeignKey, String
from sqlalchemy.orm import relationship
from sqlalchemy.dialects import postgresql
from radar.database import db
from radar.models.common import uuid_pk_column, MetaModelMixin, patient_id_column, patient_relationship
from radar.models.logs import log_cha... | Add index on patient id | Add index on patient id
| Python | agpl-3.0 | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | from sqlalchemy import Column, Integer, ForeignKey, String
from sqlalchemy.orm import relationship
from sqlalchemy.dialects import postgresql
from radar.database import db
from radar.models.common import uuid_pk_column, MetaModelMixin, patient_id_column, patient_relationship
from radar.models.logs import log_cha... | from sqlalchemy import Column, Integer, ForeignKey, String
from sqlalchemy.orm import relationship
from sqlalchemy.dialects import postgresql
from radar.database import db
from radar.models.common import uuid_pk_column, MetaModelMixin, patient_id_column, patient_relationship
from radar.models.logs import log_cha... | <commit_before>from sqlalchemy import Column, Integer, ForeignKey, String
from sqlalchemy.orm import relationship
from sqlalchemy.dialects import postgresql
from radar.database import db
from radar.models.common import uuid_pk_column, MetaModelMixin, patient_id_column, patient_relationship
from radar.models.logs... | from sqlalchemy import Column, Integer, ForeignKey, String
from sqlalchemy.orm import relationship
from sqlalchemy.dialects import postgresql
from radar.database import db
from radar.models.common import uuid_pk_column, MetaModelMixin, patient_id_column, patient_relationship
from radar.models.logs import log_cha... | from sqlalchemy import Column, Integer, ForeignKey, String
from sqlalchemy.orm import relationship
from sqlalchemy.dialects import postgresql
from radar.database import db
from radar.models.common import uuid_pk_column, MetaModelMixin, patient_id_column, patient_relationship
from radar.models.logs import log_cha... | <commit_before>from sqlalchemy import Column, Integer, ForeignKey, String
from sqlalchemy.orm import relationship
from sqlalchemy.dialects import postgresql
from radar.database import db
from radar.models.common import uuid_pk_column, MetaModelMixin, patient_id_column, patient_relationship
from radar.models.logs... |
e00fb0d87b60a982c2d932864a67a70e7d5b4312 | src/apps/rDSN.monitor/rDSN.Monitor.py | src/apps/rDSN.monitor/rDSN.Monitor.py | import sys
import os
import threading
import time
sys.path.append(os.getcwd() + '/app_package')
from MonitorApp import *
def start_dsn():
service_app = ServiceApp()
app_dict['monitor'] = MonitorService
service_app.register_app('monitor')
if len(sys.argv) < 2:
#rDSN.Monitor run as an embedded s... | import sys
import os
import threading
sys.path.append(os.getcwd() + '/app_package')
from MonitorApp import *
def start_dsn():
service_app = ServiceApp()
app_dict['monitor'] = MonitorService
service_app.register_app('monitor')
if len(sys.argv) < 2:
#rDSN.Monitor run as an embedded service
... | Replace sleep() with wait() forever after monitor registers, this ensures the python interpreter alive before app starts | Replace sleep() with wait() forever after monitor registers, this ensures the python interpreter alive before app starts
| Python | mit | mcfatealan/rDSN.Python,rDSN-Projects/rDSN.Python,mcfatealan/rDSN.Python,mcfatealan/rDSN.Python,rDSN-Projects/rDSN.Python,mcfatealan/rDSN.Python,rDSN-Projects/rDSN.Python,rDSN-Projects/rDSN.Python,rDSN-Projects/rDSN.Python,mcfatealan/rDSN.Python | import sys
import os
import threading
import time
sys.path.append(os.getcwd() + '/app_package')
from MonitorApp import *
def start_dsn():
service_app = ServiceApp()
app_dict['monitor'] = MonitorService
service_app.register_app('monitor')
if len(sys.argv) < 2:
#rDSN.Monitor run as an embedded s... | import sys
import os
import threading
sys.path.append(os.getcwd() + '/app_package')
from MonitorApp import *
def start_dsn():
service_app = ServiceApp()
app_dict['monitor'] = MonitorService
service_app.register_app('monitor')
if len(sys.argv) < 2:
#rDSN.Monitor run as an embedded service
... | <commit_before>import sys
import os
import threading
import time
sys.path.append(os.getcwd() + '/app_package')
from MonitorApp import *
def start_dsn():
service_app = ServiceApp()
app_dict['monitor'] = MonitorService
service_app.register_app('monitor')
if len(sys.argv) < 2:
#rDSN.Monitor run a... | import sys
import os
import threading
sys.path.append(os.getcwd() + '/app_package')
from MonitorApp import *
def start_dsn():
service_app = ServiceApp()
app_dict['monitor'] = MonitorService
service_app.register_app('monitor')
if len(sys.argv) < 2:
#rDSN.Monitor run as an embedded service
... | import sys
import os
import threading
import time
sys.path.append(os.getcwd() + '/app_package')
from MonitorApp import *
def start_dsn():
service_app = ServiceApp()
app_dict['monitor'] = MonitorService
service_app.register_app('monitor')
if len(sys.argv) < 2:
#rDSN.Monitor run as an embedded s... | <commit_before>import sys
import os
import threading
import time
sys.path.append(os.getcwd() + '/app_package')
from MonitorApp import *
def start_dsn():
service_app = ServiceApp()
app_dict['monitor'] = MonitorService
service_app.register_app('monitor')
if len(sys.argv) < 2:
#rDSN.Monitor run a... |
65daee8f169e8bb6e721ce016c7bcf6cb9893016 | froide/problem/utils.py | froide/problem/utils.py | from django.core.mail import mail_managers
from django.conf import settings
from django.urls import reverse
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
def inform_managers(report):
admin_url = settings.SITE_URL + reverse(
'admin:problem_probl... | from django.core.mail import mail_managers
from django.conf import settings
from django.urls import reverse
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
def inform_managers(report):
admin_url = settings.SITE_URL + reverse(
'admin:problem_probl... | Add problem admin URL to problem report email | Add problem admin URL to problem report email | Python | mit | stefanw/froide,stefanw/froide,stefanw/froide,fin/froide,fin/froide,stefanw/froide,fin/froide,stefanw/froide,fin/froide | from django.core.mail import mail_managers
from django.conf import settings
from django.urls import reverse
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
def inform_managers(report):
admin_url = settings.SITE_URL + reverse(
'admin:problem_probl... | from django.core.mail import mail_managers
from django.conf import settings
from django.urls import reverse
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
def inform_managers(report):
admin_url = settings.SITE_URL + reverse(
'admin:problem_probl... | <commit_before>from django.core.mail import mail_managers
from django.conf import settings
from django.urls import reverse
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
def inform_managers(report):
admin_url = settings.SITE_URL + reverse(
'admi... | from django.core.mail import mail_managers
from django.conf import settings
from django.urls import reverse
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
def inform_managers(report):
admin_url = settings.SITE_URL + reverse(
'admin:problem_probl... | from django.core.mail import mail_managers
from django.conf import settings
from django.urls import reverse
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
def inform_managers(report):
admin_url = settings.SITE_URL + reverse(
'admin:problem_probl... | <commit_before>from django.core.mail import mail_managers
from django.conf import settings
from django.urls import reverse
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
def inform_managers(report):
admin_url = settings.SITE_URL + reverse(
'admi... |
6a4e16f9afa373233c03cc8f1ede7076e9a44058 | basics/utils.py | basics/utils.py |
import numpy as np
def arctan_transform(array, thresh):
return np.arctan(array/thresh)
|
import numpy as np
from functools import partial
def arctan_transform(array, thresh):
return np.arctan(array/thresh)
def dist_uppertri(cond_arr, shape):
dist_arr = np.zeros((shape, ) * 2, dtype=cond_arr.dtype)
def unrav_ind(i, j, n):
return n*j - j*(j+1)/2 + i - 1 - j
arr_ind = partial(un... | Convert a condensed distance matrix (pdist) into an upper triangular matrix | Convert a condensed distance matrix (pdist) into an upper triangular matrix
| Python | mit | e-koch/BaSiCs |
import numpy as np
def arctan_transform(array, thresh):
return np.arctan(array/thresh)
Convert a condensed distance matrix (pdist) into an upper triangular matrix |
import numpy as np
from functools import partial
def arctan_transform(array, thresh):
return np.arctan(array/thresh)
def dist_uppertri(cond_arr, shape):
dist_arr = np.zeros((shape, ) * 2, dtype=cond_arr.dtype)
def unrav_ind(i, j, n):
return n*j - j*(j+1)/2 + i - 1 - j
arr_ind = partial(un... | <commit_before>
import numpy as np
def arctan_transform(array, thresh):
return np.arctan(array/thresh)
<commit_msg>Convert a condensed distance matrix (pdist) into an upper triangular matrix<commit_after> |
import numpy as np
from functools import partial
def arctan_transform(array, thresh):
return np.arctan(array/thresh)
def dist_uppertri(cond_arr, shape):
dist_arr = np.zeros((shape, ) * 2, dtype=cond_arr.dtype)
def unrav_ind(i, j, n):
return n*j - j*(j+1)/2 + i - 1 - j
arr_ind = partial(un... |
import numpy as np
def arctan_transform(array, thresh):
return np.arctan(array/thresh)
Convert a condensed distance matrix (pdist) into an upper triangular matrix
import numpy as np
from functools import partial
def arctan_transform(array, thresh):
return np.arctan(array/thresh)
def dist_uppertri(cond_ar... | <commit_before>
import numpy as np
def arctan_transform(array, thresh):
return np.arctan(array/thresh)
<commit_msg>Convert a condensed distance matrix (pdist) into an upper triangular matrix<commit_after>
import numpy as np
from functools import partial
def arctan_transform(array, thresh):
return np.arctan(... |
e97dee6ec7c49cf3d33803504c7269a41c4d0a0f | authentication_app/views.py | authentication_app/views.py | from django.shortcuts import render
from django.http import HttpResponse
from .models import Greeting
# Create your views here.
def index(request):
return HttpResponse('Hello from Python!')
def db(request):
greeting = Greeting()
greeting.save()
greetings = Greeting.objects.all()
return render... | from rest_framework import permissions, viewsets
from authentication_app.models import Account
from authentication_app.permissions import IsAccountOwner
from authentication_app.serializers import AccountSerializer
'''
@name : AccountViewSerializer
@desc : Defines the serializer for the account view.
'''
class... | Add the view serializer for the account model. | Add the view serializer for the account model.
| Python | mit | mvpgomes/shopit-app,mvpgomes/shopit-app,mvpgomes/shopit-app,mvpgomes/shopit-app | from django.shortcuts import render
from django.http import HttpResponse
from .models import Greeting
# Create your views here.
def index(request):
return HttpResponse('Hello from Python!')
def db(request):
greeting = Greeting()
greeting.save()
greetings = Greeting.objects.all()
return render... | from rest_framework import permissions, viewsets
from authentication_app.models import Account
from authentication_app.permissions import IsAccountOwner
from authentication_app.serializers import AccountSerializer
'''
@name : AccountViewSerializer
@desc : Defines the serializer for the account view.
'''
class... | <commit_before>from django.shortcuts import render
from django.http import HttpResponse
from .models import Greeting
# Create your views here.
def index(request):
return HttpResponse('Hello from Python!')
def db(request):
greeting = Greeting()
greeting.save()
greetings = Greeting.objects.all()
... | from rest_framework import permissions, viewsets
from authentication_app.models import Account
from authentication_app.permissions import IsAccountOwner
from authentication_app.serializers import AccountSerializer
'''
@name : AccountViewSerializer
@desc : Defines the serializer for the account view.
'''
class... | from django.shortcuts import render
from django.http import HttpResponse
from .models import Greeting
# Create your views here.
def index(request):
return HttpResponse('Hello from Python!')
def db(request):
greeting = Greeting()
greeting.save()
greetings = Greeting.objects.all()
return render... | <commit_before>from django.shortcuts import render
from django.http import HttpResponse
from .models import Greeting
# Create your views here.
def index(request):
return HttpResponse('Hello from Python!')
def db(request):
greeting = Greeting()
greeting.save()
greetings = Greeting.objects.all()
... |
f8304bb26151fdb999a77da9afbea8ff653a37f8 | artists/views.py | artists/views.py | from django.shortcuts import get_object_or_404
from rest_framework import permissions, viewsets
from similarities.utils import get_similar
from .models import Artist
from similarities.models import UserSimilarity, Similarity, update_similarities
from .serializers import ArtistSerializer, SimilaritySerializer
class A... | from django.shortcuts import get_object_or_404
from rest_framework import permissions, viewsets
from similarities.utils import get_similar
from .models import Artist
from similarities.models import UserSimilarity, Similarity, update_similarities
from .serializers import ArtistSerializer, SimilaritySerializer
class A... | Add note to update old similarities | Add note to update old similarities
| Python | bsd-3-clause | FreeMusicNinja/api.freemusic.ninja | from django.shortcuts import get_object_or_404
from rest_framework import permissions, viewsets
from similarities.utils import get_similar
from .models import Artist
from similarities.models import UserSimilarity, Similarity, update_similarities
from .serializers import ArtistSerializer, SimilaritySerializer
class A... | from django.shortcuts import get_object_or_404
from rest_framework import permissions, viewsets
from similarities.utils import get_similar
from .models import Artist
from similarities.models import UserSimilarity, Similarity, update_similarities
from .serializers import ArtistSerializer, SimilaritySerializer
class A... | <commit_before>from django.shortcuts import get_object_or_404
from rest_framework import permissions, viewsets
from similarities.utils import get_similar
from .models import Artist
from similarities.models import UserSimilarity, Similarity, update_similarities
from .serializers import ArtistSerializer, SimilaritySeria... | from django.shortcuts import get_object_or_404
from rest_framework import permissions, viewsets
from similarities.utils import get_similar
from .models import Artist
from similarities.models import UserSimilarity, Similarity, update_similarities
from .serializers import ArtistSerializer, SimilaritySerializer
class A... | from django.shortcuts import get_object_or_404
from rest_framework import permissions, viewsets
from similarities.utils import get_similar
from .models import Artist
from similarities.models import UserSimilarity, Similarity, update_similarities
from .serializers import ArtistSerializer, SimilaritySerializer
class A... | <commit_before>from django.shortcuts import get_object_or_404
from rest_framework import permissions, viewsets
from similarities.utils import get_similar
from .models import Artist
from similarities.models import UserSimilarity, Similarity, update_similarities
from .serializers import ArtistSerializer, SimilaritySeria... |
261fb861015ee96771e4c387bcd2b2c7d5c369db | hellopython/__init__.py | hellopython/__init__.py | __version__ = '1.0.0'
from story.story import BaseStory
from . import print_method
class Story(BaseStory):
name = 'hellopython'
adventures = [
print_method
]
| __version__ = '1.0.0'
from story.story import BaseStory
from . import print_method
class Story(BaseStory):
name = 'hellopython'
title = 'Introuction to python'
adventures = [
print_method
]
| Add a title to the story the story | Add a title to the story the story
| Python | mit | pyschool/hipyschool | __version__ = '1.0.0'
from story.story import BaseStory
from . import print_method
class Story(BaseStory):
name = 'hellopython'
adventures = [
print_method
]
Add a title to the story the story | __version__ = '1.0.0'
from story.story import BaseStory
from . import print_method
class Story(BaseStory):
name = 'hellopython'
title = 'Introuction to python'
adventures = [
print_method
]
| <commit_before>__version__ = '1.0.0'
from story.story import BaseStory
from . import print_method
class Story(BaseStory):
name = 'hellopython'
adventures = [
print_method
]
<commit_msg>Add a title to the story the story<commit_after> | __version__ = '1.0.0'
from story.story import BaseStory
from . import print_method
class Story(BaseStory):
name = 'hellopython'
title = 'Introuction to python'
adventures = [
print_method
]
| __version__ = '1.0.0'
from story.story import BaseStory
from . import print_method
class Story(BaseStory):
name = 'hellopython'
adventures = [
print_method
]
Add a title to the story the story__version__ = '1.0.0'
from story.story import BaseStory
from . import print_method
class Story(BaseSt... | <commit_before>__version__ = '1.0.0'
from story.story import BaseStory
from . import print_method
class Story(BaseStory):
name = 'hellopython'
adventures = [
print_method
]
<commit_msg>Add a title to the story the story<commit_after>__version__ = '1.0.0'
from story.story import BaseStory
from .... |
8d11c6854e9c2309abb74a2e4b960a5206a27a0c | funbox/iterators_ordered.py | funbox/iterators_ordered.py | #! /usr/bin/env python
"""Functions on iterators, optimised for case when iterators are sorted.
Note sift_o is hidden as _sift_o at the moment because it is broken.
Please don't use it.
Once fixed, I'll remove the leading underscore again.
"""
import itertools
import iterators
def partition_o(left_function, items):... | #! /usr/bin/env python
"""Functions on iterators, optimised for case when iterators are sorted.
"""
import itertools
import iterators
def partition_o(left_function, items):
"""Return a pair of iterators: left and right
Items for which left_function returns a true value go into left.
Items for which left... | Remove reference in docs to removed function. | Remove reference in docs to removed function.
| Python | mit | nmbooker/python-funbox,nmbooker/python-funbox | #! /usr/bin/env python
"""Functions on iterators, optimised for case when iterators are sorted.
Note sift_o is hidden as _sift_o at the moment because it is broken.
Please don't use it.
Once fixed, I'll remove the leading underscore again.
"""
import itertools
import iterators
def partition_o(left_function, items):... | #! /usr/bin/env python
"""Functions on iterators, optimised for case when iterators are sorted.
"""
import itertools
import iterators
def partition_o(left_function, items):
"""Return a pair of iterators: left and right
Items for which left_function returns a true value go into left.
Items for which left... | <commit_before>#! /usr/bin/env python
"""Functions on iterators, optimised for case when iterators are sorted.
Note sift_o is hidden as _sift_o at the moment because it is broken.
Please don't use it.
Once fixed, I'll remove the leading underscore again.
"""
import itertools
import iterators
def partition_o(left_fu... | #! /usr/bin/env python
"""Functions on iterators, optimised for case when iterators are sorted.
"""
import itertools
import iterators
def partition_o(left_function, items):
"""Return a pair of iterators: left and right
Items for which left_function returns a true value go into left.
Items for which left... | #! /usr/bin/env python
"""Functions on iterators, optimised for case when iterators are sorted.
Note sift_o is hidden as _sift_o at the moment because it is broken.
Please don't use it.
Once fixed, I'll remove the leading underscore again.
"""
import itertools
import iterators
def partition_o(left_function, items):... | <commit_before>#! /usr/bin/env python
"""Functions on iterators, optimised for case when iterators are sorted.
Note sift_o is hidden as _sift_o at the moment because it is broken.
Please don't use it.
Once fixed, I'll remove the leading underscore again.
"""
import itertools
import iterators
def partition_o(left_fu... |
276df9f8fbb5ad15fd768db6a13040a37037e7d6 | service/urls.py | service/urls.py | from django.conf.urls import url, include
from rest_framework import routers
import service.authors.views
import service.friendrequest.views
import service.users.views
import service.posts.views
router = routers.DefaultRouter()
router.register(r'users', service.users.views.UserViewSet)
router.register(r'nodes', servi... | from django.conf.urls import url, include
from rest_framework import routers
import service.authors.views
import service.friendrequest.views
import service.users.views
import service.nodes.views
import service.posts.views
router = routers.DefaultRouter()
router.register(r'users', service.users.views.UserViewSet)
rout... | Add missing Node view import | Add missing Node view import
| Python | apache-2.0 | TeamAADGT/CMPUT404-project-socialdistribution,TeamAADGT/CMPUT404-project-socialdistribution,TeamAADGT/CMPUT404-project-socialdistribution | from django.conf.urls import url, include
from rest_framework import routers
import service.authors.views
import service.friendrequest.views
import service.users.views
import service.posts.views
router = routers.DefaultRouter()
router.register(r'users', service.users.views.UserViewSet)
router.register(r'nodes', servi... | from django.conf.urls import url, include
from rest_framework import routers
import service.authors.views
import service.friendrequest.views
import service.users.views
import service.nodes.views
import service.posts.views
router = routers.DefaultRouter()
router.register(r'users', service.users.views.UserViewSet)
rout... | <commit_before>from django.conf.urls import url, include
from rest_framework import routers
import service.authors.views
import service.friendrequest.views
import service.users.views
import service.posts.views
router = routers.DefaultRouter()
router.register(r'users', service.users.views.UserViewSet)
router.register(... | from django.conf.urls import url, include
from rest_framework import routers
import service.authors.views
import service.friendrequest.views
import service.users.views
import service.nodes.views
import service.posts.views
router = routers.DefaultRouter()
router.register(r'users', service.users.views.UserViewSet)
rout... | from django.conf.urls import url, include
from rest_framework import routers
import service.authors.views
import service.friendrequest.views
import service.users.views
import service.posts.views
router = routers.DefaultRouter()
router.register(r'users', service.users.views.UserViewSet)
router.register(r'nodes', servi... | <commit_before>from django.conf.urls import url, include
from rest_framework import routers
import service.authors.views
import service.friendrequest.views
import service.users.views
import service.posts.views
router = routers.DefaultRouter()
router.register(r'users', service.users.views.UserViewSet)
router.register(... |
73d22cc63a2a37bd3c99774bf098ca12c81d54ae | funnels.py | funnels.py | import pyglet
from levels import GameOver, IntroScreen, TheGame
from levels.levels import Levels
window = pyglet.window.Window()#fullscreen=True)
levels = Levels([IntroScreen(window), TheGame(window), GameOver(window)])
pyglet.clock.schedule(levels.clock)
@window.event
def on_key_press(symbol, modifiers):
levels.... | import pyglet
import argparse
from levels import GameOver, IntroScreen, TheGame
from levels.levels import Levels
def main(fullscreen):
window = pyglet.window.Window(fullscreen=fullscreen)
levels = Levels([IntroScreen(window), TheGame(window), GameOver(window)])
pyglet.clock.schedule(levels.clock)
@window.eve... | Add argparse to turn on/off fullscreen behavior | Add argparse to turn on/off fullscreen behavior
| Python | mit | simeonf/claire | import pyglet
from levels import GameOver, IntroScreen, TheGame
from levels.levels import Levels
window = pyglet.window.Window()#fullscreen=True)
levels = Levels([IntroScreen(window), TheGame(window), GameOver(window)])
pyglet.clock.schedule(levels.clock)
@window.event
def on_key_press(symbol, modifiers):
levels.... | import pyglet
import argparse
from levels import GameOver, IntroScreen, TheGame
from levels.levels import Levels
def main(fullscreen):
window = pyglet.window.Window(fullscreen=fullscreen)
levels = Levels([IntroScreen(window), TheGame(window), GameOver(window)])
pyglet.clock.schedule(levels.clock)
@window.eve... | <commit_before>import pyglet
from levels import GameOver, IntroScreen, TheGame
from levels.levels import Levels
window = pyglet.window.Window()#fullscreen=True)
levels = Levels([IntroScreen(window), TheGame(window), GameOver(window)])
pyglet.clock.schedule(levels.clock)
@window.event
def on_key_press(symbol, modifi... | import pyglet
import argparse
from levels import GameOver, IntroScreen, TheGame
from levels.levels import Levels
def main(fullscreen):
window = pyglet.window.Window(fullscreen=fullscreen)
levels = Levels([IntroScreen(window), TheGame(window), GameOver(window)])
pyglet.clock.schedule(levels.clock)
@window.eve... | import pyglet
from levels import GameOver, IntroScreen, TheGame
from levels.levels import Levels
window = pyglet.window.Window()#fullscreen=True)
levels = Levels([IntroScreen(window), TheGame(window), GameOver(window)])
pyglet.clock.schedule(levels.clock)
@window.event
def on_key_press(symbol, modifiers):
levels.... | <commit_before>import pyglet
from levels import GameOver, IntroScreen, TheGame
from levels.levels import Levels
window = pyglet.window.Window()#fullscreen=True)
levels = Levels([IntroScreen(window), TheGame(window), GameOver(window)])
pyglet.clock.schedule(levels.clock)
@window.event
def on_key_press(symbol, modifi... |
86edd9a5d060d88b011d280b72e208716e001c3a | phy/__init__.py | phy/__init__.py | # -*- coding: utf-8 -*-
# flake8: noqa
"""
phy is an open source electrophysiological data analysis package in Python
for neuronal recordings made with high-density multielectrode arrays
containing up to thousands of channels.
"""
#------------------------------------------------------------------------------
# Impo... | # -*- coding: utf-8 -*-
# flake8: noqa
"""
phy is an open source electrophysiological data analysis package in Python
for neuronal recordings made with high-density multielectrode arrays
containing up to thousands of channels.
"""
#------------------------------------------------------------------------------
# Impo... | Define mock @profile decorator in builtins. | Define mock @profile decorator in builtins.
| Python | bsd-3-clause | nippoo/phy,kwikteam/phy,nsteinme/phy,rossant/phy,kwikteam/phy,rossant/phy,nsteinme/phy,rossant/phy,nippoo/phy,kwikteam/phy | # -*- coding: utf-8 -*-
# flake8: noqa
"""
phy is an open source electrophysiological data analysis package in Python
for neuronal recordings made with high-density multielectrode arrays
containing up to thousands of channels.
"""
#------------------------------------------------------------------------------
# Impo... | # -*- coding: utf-8 -*-
# flake8: noqa
"""
phy is an open source electrophysiological data analysis package in Python
for neuronal recordings made with high-density multielectrode arrays
containing up to thousands of channels.
"""
#------------------------------------------------------------------------------
# Impo... | <commit_before># -*- coding: utf-8 -*-
# flake8: noqa
"""
phy is an open source electrophysiological data analysis package in Python
for neuronal recordings made with high-density multielectrode arrays
containing up to thousands of channels.
"""
#----------------------------------------------------------------------... | # -*- coding: utf-8 -*-
# flake8: noqa
"""
phy is an open source electrophysiological data analysis package in Python
for neuronal recordings made with high-density multielectrode arrays
containing up to thousands of channels.
"""
#------------------------------------------------------------------------------
# Impo... | # -*- coding: utf-8 -*-
# flake8: noqa
"""
phy is an open source electrophysiological data analysis package in Python
for neuronal recordings made with high-density multielectrode arrays
containing up to thousands of channels.
"""
#------------------------------------------------------------------------------
# Impo... | <commit_before># -*- coding: utf-8 -*-
# flake8: noqa
"""
phy is an open source electrophysiological data analysis package in Python
for neuronal recordings made with high-density multielectrode arrays
containing up to thousands of channels.
"""
#----------------------------------------------------------------------... |
1b23e939a40652f8ef870e3ee7146f62fd131933 | getlost.py | getlost.py | from os import environ
from urllib2 import urlopen
from math import log
from flask import Flask, json, jsonify
app = Flask(__name__)
from hip import get_ranking_array
from utils import jsonp
url = 'http://open.mapquestapi.com/directions/v2/route'
params = '?key={apikey}&ambiguities=ignore&routeType=pedestrian'
rel =... | from os import environ
from urllib2 import urlopen
from math import log, sqrt
from flask import Flask, json, jsonify
app = Flask(__name__)
from hip import get_ranking_array
from utils import jsonp
url = 'http://open.mapquestapi.com/directions/v2/route'
params = '?key={apikey}&ambiguities=ignore&routeType=pedestrian'... | Normalize total rank by distance between start and end | Normalize total rank by distance between start and end
| Python | apache-2.0 | kynan/GetLost | from os import environ
from urllib2 import urlopen
from math import log
from flask import Flask, json, jsonify
app = Flask(__name__)
from hip import get_ranking_array
from utils import jsonp
url = 'http://open.mapquestapi.com/directions/v2/route'
params = '?key={apikey}&ambiguities=ignore&routeType=pedestrian'
rel =... | from os import environ
from urllib2 import urlopen
from math import log, sqrt
from flask import Flask, json, jsonify
app = Flask(__name__)
from hip import get_ranking_array
from utils import jsonp
url = 'http://open.mapquestapi.com/directions/v2/route'
params = '?key={apikey}&ambiguities=ignore&routeType=pedestrian'... | <commit_before>from os import environ
from urllib2 import urlopen
from math import log
from flask import Flask, json, jsonify
app = Flask(__name__)
from hip import get_ranking_array
from utils import jsonp
url = 'http://open.mapquestapi.com/directions/v2/route'
params = '?key={apikey}&ambiguities=ignore&routeType=pe... | from os import environ
from urllib2 import urlopen
from math import log, sqrt
from flask import Flask, json, jsonify
app = Flask(__name__)
from hip import get_ranking_array
from utils import jsonp
url = 'http://open.mapquestapi.com/directions/v2/route'
params = '?key={apikey}&ambiguities=ignore&routeType=pedestrian'... | from os import environ
from urllib2 import urlopen
from math import log
from flask import Flask, json, jsonify
app = Flask(__name__)
from hip import get_ranking_array
from utils import jsonp
url = 'http://open.mapquestapi.com/directions/v2/route'
params = '?key={apikey}&ambiguities=ignore&routeType=pedestrian'
rel =... | <commit_before>from os import environ
from urllib2 import urlopen
from math import log
from flask import Flask, json, jsonify
app = Flask(__name__)
from hip import get_ranking_array
from utils import jsonp
url = 'http://open.mapquestapi.com/directions/v2/route'
params = '?key={apikey}&ambiguities=ignore&routeType=pe... |
96bcf7f55a50895dead660add9fc949af197f550 | networking_sfc/tests/functional/services/sfc/agent/extensions/test_ovs_agent_sfc_extension.py | networking_sfc/tests/functional/services/sfc/agent/extensions/test_ovs_agent_sfc_extension.py | # Copyright (c) 2016 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | # Copyright (c) 2016 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | Fix extension loading functional test | Fix extension loading functional test
Call the agent _report_state() before checking the report state itself
Change-Id: Idbf552d5ca5968bc95b0a3c395499c3f2d215729
Closes-Bug: 1658089
| Python | apache-2.0 | openstack/networking-sfc,openstack/networking-sfc | # Copyright (c) 2016 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | # Copyright (c) 2016 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | <commit_before># Copyright (c) 2016 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | # Copyright (c) 2016 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | # Copyright (c) 2016 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | <commit_before># Copyright (c) 2016 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... |
907298a325e966f6e03c766c90f22e1b03c25c1e | data/propaganda2mongo.py | data/propaganda2mongo.py | import bson.json_util
from bson.objectid import ObjectId
import json
import sys
def main():
node_table = {}
while True:
line = sys.stdin.readline()
if not line:
break
record = json.loads(line)
ident = str(record["twitter_id"])
aoid = node_table.get(ident)... | import bson.json_util
from bson.objectid import ObjectId
import json
import sys
def main():
node_table = {}
while True:
line = sys.stdin.readline()
if not line:
break
record = json.loads(line)
ident = str(record["twitter_id"])
aoid = node_table.get(ident)... | Fix bug in data collection | Fix bug in data collection
| Python | apache-2.0 | XDATA-Year-3/clique-propaganda,XDATA-Year-3/clique-propaganda,XDATA-Year-3/clique-propaganda | import bson.json_util
from bson.objectid import ObjectId
import json
import sys
def main():
node_table = {}
while True:
line = sys.stdin.readline()
if not line:
break
record = json.loads(line)
ident = str(record["twitter_id"])
aoid = node_table.get(ident)... | import bson.json_util
from bson.objectid import ObjectId
import json
import sys
def main():
node_table = {}
while True:
line = sys.stdin.readline()
if not line:
break
record = json.loads(line)
ident = str(record["twitter_id"])
aoid = node_table.get(ident)... | <commit_before>import bson.json_util
from bson.objectid import ObjectId
import json
import sys
def main():
node_table = {}
while True:
line = sys.stdin.readline()
if not line:
break
record = json.loads(line)
ident = str(record["twitter_id"])
aoid = node_t... | import bson.json_util
from bson.objectid import ObjectId
import json
import sys
def main():
node_table = {}
while True:
line = sys.stdin.readline()
if not line:
break
record = json.loads(line)
ident = str(record["twitter_id"])
aoid = node_table.get(ident)... | import bson.json_util
from bson.objectid import ObjectId
import json
import sys
def main():
node_table = {}
while True:
line = sys.stdin.readline()
if not line:
break
record = json.loads(line)
ident = str(record["twitter_id"])
aoid = node_table.get(ident)... | <commit_before>import bson.json_util
from bson.objectid import ObjectId
import json
import sys
def main():
node_table = {}
while True:
line = sys.stdin.readline()
if not line:
break
record = json.loads(line)
ident = str(record["twitter_id"])
aoid = node_t... |
2e5a8adb47491be58d3cdc48a4984812538f55a6 | golang/main.py | golang/main.py | from evolution_master.runners import pkg, download
# Install for Arch
with pkg.pacman() as pkg_man:
pkg_man.install('go')
# Install for Debian & Ubuntu
with pkg.apt() as pkg_man:
pkg_man.install('golang')
# TODO: make this a runner and require a switch to enable this
pkg_man.install('golang-go-darwin-... | from genes import apt, brew, pacman, http_downloader, checksum, msiexec
import platform
opsys = platform.system()
dist = platform.linux_distribution()
if platform == 'Linux' and dist == 'Arch':
pacman.update()
pacman.sync('go')
if platform == 'Linux' and (dist == 'Debian' or dist == 'Ubuntu'):
apt.upd... | Format go to the new design | Format go to the new design
| Python | mit | hatchery/Genepool2,hatchery/genepool | from evolution_master.runners import pkg, download
# Install for Arch
with pkg.pacman() as pkg_man:
pkg_man.install('go')
# Install for Debian & Ubuntu
with pkg.apt() as pkg_man:
pkg_man.install('golang')
# TODO: make this a runner and require a switch to enable this
pkg_man.install('golang-go-darwin-... | from genes import apt, brew, pacman, http_downloader, checksum, msiexec
import platform
opsys = platform.system()
dist = platform.linux_distribution()
if platform == 'Linux' and dist == 'Arch':
pacman.update()
pacman.sync('go')
if platform == 'Linux' and (dist == 'Debian' or dist == 'Ubuntu'):
apt.upd... | <commit_before>from evolution_master.runners import pkg, download
# Install for Arch
with pkg.pacman() as pkg_man:
pkg_man.install('go')
# Install for Debian & Ubuntu
with pkg.apt() as pkg_man:
pkg_man.install('golang')
# TODO: make this a runner and require a switch to enable this
pkg_man.install('go... | from genes import apt, brew, pacman, http_downloader, checksum, msiexec
import platform
opsys = platform.system()
dist = platform.linux_distribution()
if platform == 'Linux' and dist == 'Arch':
pacman.update()
pacman.sync('go')
if platform == 'Linux' and (dist == 'Debian' or dist == 'Ubuntu'):
apt.upd... | from evolution_master.runners import pkg, download
# Install for Arch
with pkg.pacman() as pkg_man:
pkg_man.install('go')
# Install for Debian & Ubuntu
with pkg.apt() as pkg_man:
pkg_man.install('golang')
# TODO: make this a runner and require a switch to enable this
pkg_man.install('golang-go-darwin-... | <commit_before>from evolution_master.runners import pkg, download
# Install for Arch
with pkg.pacman() as pkg_man:
pkg_man.install('go')
# Install for Debian & Ubuntu
with pkg.apt() as pkg_man:
pkg_man.install('golang')
# TODO: make this a runner and require a switch to enable this
pkg_man.install('go... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.