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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5f648d6c7f484ae5774d2dbb0a0d3bc7622b3de1 | CodeFights/tryFunctions.py | CodeFights/tryFunctions.py | #!/usr/local/bin/python
# Code Fights Try Functions Problem
import math
def tryFunctions(x, functions):
return [eval(func)(x) for func in functions]
def main():
tests = [
[1, ["math.sin", "math.cos", "lambda x: x * 2", "lambda x: x ** 2"],
[0.84147, 0.5403, 2, 1]],
[-20, ["abs"], [... | Solve Code Fights try functions problem | Solve Code Fights try functions problem
| Python | mit | HKuz/Test_Code | Solve Code Fights try functions problem | #!/usr/local/bin/python
# Code Fights Try Functions Problem
import math
def tryFunctions(x, functions):
return [eval(func)(x) for func in functions]
def main():
tests = [
[1, ["math.sin", "math.cos", "lambda x: x * 2", "lambda x: x ** 2"],
[0.84147, 0.5403, 2, 1]],
[-20, ["abs"], [... | <commit_before><commit_msg>Solve Code Fights try functions problem<commit_after> | #!/usr/local/bin/python
# Code Fights Try Functions Problem
import math
def tryFunctions(x, functions):
return [eval(func)(x) for func in functions]
def main():
tests = [
[1, ["math.sin", "math.cos", "lambda x: x * 2", "lambda x: x ** 2"],
[0.84147, 0.5403, 2, 1]],
[-20, ["abs"], [... | Solve Code Fights try functions problem#!/usr/local/bin/python
# Code Fights Try Functions Problem
import math
def tryFunctions(x, functions):
return [eval(func)(x) for func in functions]
def main():
tests = [
[1, ["math.sin", "math.cos", "lambda x: x * 2", "lambda x: x ** 2"],
[0.84147, 0... | <commit_before><commit_msg>Solve Code Fights try functions problem<commit_after>#!/usr/local/bin/python
# Code Fights Try Functions Problem
import math
def tryFunctions(x, functions):
return [eval(func)(x) for func in functions]
def main():
tests = [
[1, ["math.sin", "math.cos", "lambda x: x * 2", ... | |
701238e19f4eaa6ce1f1c14e6e56d9544e402ed7 | test/test_language.py | test/test_language.py | import unittest
from charset_normalizer.normalizer import CharsetNormalizerMatches as CnM
from glob import glob
from os.path import basename
class TestLanguageDetection(unittest.TestCase):
SHOULD_BE = {
'sample.1.ar.srt': 'Arabic',
'sample.1.fr.srt': 'French',
'sample.1.gr.srt': 'Greek',
... | Add test to verify if language was detected properly | Add test to verify if language was detected properly
| Python | mit | Ousret/charset_normalizer,ousret/charset_normalizer,Ousret/charset_normalizer,ousret/charset_normalizer | Add test to verify if language was detected properly | import unittest
from charset_normalizer.normalizer import CharsetNormalizerMatches as CnM
from glob import glob
from os.path import basename
class TestLanguageDetection(unittest.TestCase):
SHOULD_BE = {
'sample.1.ar.srt': 'Arabic',
'sample.1.fr.srt': 'French',
'sample.1.gr.srt': 'Greek',
... | <commit_before><commit_msg>Add test to verify if language was detected properly<commit_after> | import unittest
from charset_normalizer.normalizer import CharsetNormalizerMatches as CnM
from glob import glob
from os.path import basename
class TestLanguageDetection(unittest.TestCase):
SHOULD_BE = {
'sample.1.ar.srt': 'Arabic',
'sample.1.fr.srt': 'French',
'sample.1.gr.srt': 'Greek',
... | Add test to verify if language was detected properlyimport unittest
from charset_normalizer.normalizer import CharsetNormalizerMatches as CnM
from glob import glob
from os.path import basename
class TestLanguageDetection(unittest.TestCase):
SHOULD_BE = {
'sample.1.ar.srt': 'Arabic',
'sample.1.fr.s... | <commit_before><commit_msg>Add test to verify if language was detected properly<commit_after>import unittest
from charset_normalizer.normalizer import CharsetNormalizerMatches as CnM
from glob import glob
from os.path import basename
class TestLanguageDetection(unittest.TestCase):
SHOULD_BE = {
'sample.1.... | |
b08fd9c9770f524ec63d92c11905ab8b2f6ef35f | src/midonet/api.py | src/midonet/api.py | # Copyright 2012 Midokura Japan KK
class PortType:
MATERIALIZED_BRIDGE = "MaterializedBridge";
MATERIALIZED_ROUTER = "MaterializedRouter";
LOGICAL_BRIDGE = "LogicalBridge";
LOGICAL_ROUTER = "LogicalRouter";
| Add constants for port types | Add constants for port types
| Python | apache-2.0 | midokura/python-midonetclient,midokura/python-midonetclient,midonet/python-midonetclient,midonet/python-midonetclient | Add constants for port types | # Copyright 2012 Midokura Japan KK
class PortType:
MATERIALIZED_BRIDGE = "MaterializedBridge";
MATERIALIZED_ROUTER = "MaterializedRouter";
LOGICAL_BRIDGE = "LogicalBridge";
LOGICAL_ROUTER = "LogicalRouter";
| <commit_before><commit_msg>Add constants for port types<commit_after> | # Copyright 2012 Midokura Japan KK
class PortType:
MATERIALIZED_BRIDGE = "MaterializedBridge";
MATERIALIZED_ROUTER = "MaterializedRouter";
LOGICAL_BRIDGE = "LogicalBridge";
LOGICAL_ROUTER = "LogicalRouter";
| Add constants for port types# Copyright 2012 Midokura Japan KK
class PortType:
MATERIALIZED_BRIDGE = "MaterializedBridge";
MATERIALIZED_ROUTER = "MaterializedRouter";
LOGICAL_BRIDGE = "LogicalBridge";
LOGICAL_ROUTER = "LogicalRouter";
| <commit_before><commit_msg>Add constants for port types<commit_after># Copyright 2012 Midokura Japan KK
class PortType:
MATERIALIZED_BRIDGE = "MaterializedBridge";
MATERIALIZED_ROUTER = "MaterializedRouter";
LOGICAL_BRIDGE = "LogicalBridge";
LOGICAL_ROUTER = "LogicalRouter";
| |
c86f915e324d7e66cb07cbcc9fb827c2dcdeda29 | rst2pdf/utils.py | rst2pdf/utils.py | # -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
import shlex
from reportlab.platypus import Spacer
from flowables import *
def parseRaw(data):
"""Parse and process a simple DSL to handle creation of flowables.
Supported (ca... | # -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
import shlex
from reportlab.platypus import Spacer
from flowables import *
from styles import adjustUnits
def parseRaw(data):
"""Parse and process a simple DSL to handle creation of f... | Add unit support for spacers | Add unit support for spacers
git-svn-id: 305ad3fa995f01f9ce4b4f46c2a806ba00a97020@779 3777fadb-0f44-0410-9e7f-9d8fa6171d72
| Python | mit | aquavitae/rst2pdf,aquavitae/rst2pdf,sychen/rst2pdf,aquavitae/rst2pdf-py3-dev,tonioo/rst2pdf,tonioo/rst2pdf,openpolis/rst2pdf-patched-docutils-0.8,aquavitae/rst2pdf-py3-dev,sychen/rst2pdf,openpolis/rst2pdf-patched-docutils-0.8 | # -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
import shlex
from reportlab.platypus import Spacer
from flowables import *
def parseRaw(data):
"""Parse and process a simple DSL to handle creation of flowables.
Supported (ca... | # -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
import shlex
from reportlab.platypus import Spacer
from flowables import *
from styles import adjustUnits
def parseRaw(data):
"""Parse and process a simple DSL to handle creation of f... | <commit_before># -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
import shlex
from reportlab.platypus import Spacer
from flowables import *
def parseRaw(data):
"""Parse and process a simple DSL to handle creation of flowables.
... | # -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
import shlex
from reportlab.platypus import Spacer
from flowables import *
from styles import adjustUnits
def parseRaw(data):
"""Parse and process a simple DSL to handle creation of f... | # -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
import shlex
from reportlab.platypus import Spacer
from flowables import *
def parseRaw(data):
"""Parse and process a simple DSL to handle creation of flowables.
Supported (ca... | <commit_before># -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
import shlex
from reportlab.platypus import Spacer
from flowables import *
def parseRaw(data):
"""Parse and process a simple DSL to handle creation of flowables.
... |
9dcfd729c9f71794b4a6de649fed92365595034f | tests/gl_test_2.py | tests/gl_test_2.py | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import pyglet.window
from pyglet.window.event import *
import time
from pyglet.GL.VERSION_1_1 import *
from pyglet.GLU.VERSION_1_1 import *
from pyglet import clock
factory = pyglet.window.WindowFactory()
factory.config._attribut... | Test two windows drawing GL with different contexts. | Test two windows drawing GL with different contexts.
| Python | bsd-3-clause | mammadori/pyglet,theblacklion/pyglet,niklaskorz/pyglet,theblacklion/pyglet,adamlwgriffiths/Pyglet,seeminglee/pyglet64,theblacklion/pyglet,adamlwgriffiths/Pyglet,oktayacikalin/pyglet,niklaskorz/pyglet,seeminglee/pyglet64,mammadori/pyglet,mammadori/pyglet,adamlwgriffiths/Pyglet,oktayacikalin/pyglet,niklaskorz/pyglet,okta... | Test two windows drawing GL with different contexts. | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import pyglet.window
from pyglet.window.event import *
import time
from pyglet.GL.VERSION_1_1 import *
from pyglet.GLU.VERSION_1_1 import *
from pyglet import clock
factory = pyglet.window.WindowFactory()
factory.config._attribut... | <commit_before><commit_msg>Test two windows drawing GL with different contexts.<commit_after> | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import pyglet.window
from pyglet.window.event import *
import time
from pyglet.GL.VERSION_1_1 import *
from pyglet.GLU.VERSION_1_1 import *
from pyglet import clock
factory = pyglet.window.WindowFactory()
factory.config._attribut... | Test two windows drawing GL with different contexts.#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import pyglet.window
from pyglet.window.event import *
import time
from pyglet.GL.VERSION_1_1 import *
from pyglet.GLU.VERSION_1_1 import *
from pyglet import clock
factory = py... | <commit_before><commit_msg>Test two windows drawing GL with different contexts.<commit_after>#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import pyglet.window
from pyglet.window.event import *
import time
from pyglet.GL.VERSION_1_1 import *
from pyglet.GLU.VERSION_1_1 import... | |
6c21b012c8ee8f4bb3f989c999f7d85ad99878b4 | compressImg2TrainData.py | compressImg2TrainData.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
Directory structure
TRAIN_DIR:
label0:
img0001.png
img0002.png
img0003.png
label1:
img0001.png
img0002.png
.
.
.
label9:
img0001.png
'''
import cv2, os
import numpy as np
LABEL_MAGIC_NUMBER = 2049
IMAGE_MAGIC_NUMBER = 2051
TR... | Add a utility file to make a train data for MNIST sample. | Add a utility file to make a train data for MNIST sample.
| Python | apache-2.0 | yoneken/train_tf | Add a utility file to make a train data for MNIST sample. | #!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
Directory structure
TRAIN_DIR:
label0:
img0001.png
img0002.png
img0003.png
label1:
img0001.png
img0002.png
.
.
.
label9:
img0001.png
'''
import cv2, os
import numpy as np
LABEL_MAGIC_NUMBER = 2049
IMAGE_MAGIC_NUMBER = 2051
TR... | <commit_before><commit_msg>Add a utility file to make a train data for MNIST sample.<commit_after> | #!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
Directory structure
TRAIN_DIR:
label0:
img0001.png
img0002.png
img0003.png
label1:
img0001.png
img0002.png
.
.
.
label9:
img0001.png
'''
import cv2, os
import numpy as np
LABEL_MAGIC_NUMBER = 2049
IMAGE_MAGIC_NUMBER = 2051
TR... | Add a utility file to make a train data for MNIST sample.#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
Directory structure
TRAIN_DIR:
label0:
img0001.png
img0002.png
img0003.png
label1:
img0001.png
img0002.png
.
.
.
label9:
img0001.png
'''
import cv2, os
import numpy as n... | <commit_before><commit_msg>Add a utility file to make a train data for MNIST sample.<commit_after>#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
Directory structure
TRAIN_DIR:
label0:
img0001.png
img0002.png
img0003.png
label1:
img0001.png
img0002.png
.
.
.
label9:
img0001.... | |
c613bd3995344bbb164a8f64b39c3a94f6b3ce48 | begood_sites/management/commands/fix_root_site_id.py | begood_sites/management/commands/fix_root_site_id.py | # coding=utf-8
from django.db import connection
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
class Command(BaseCommand):
args = '<id_or_name>'
help = 'Fix any broken article urls due to wrong root site id'
def h... | Add a management command to fix broken article urls when changing root site id. | Add a management command to fix broken article urls when changing root site id.
| Python | mit | AGoodId/begood-sites | Add a management command to fix broken article urls when changing root site id. | # coding=utf-8
from django.db import connection
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
class Command(BaseCommand):
args = '<id_or_name>'
help = 'Fix any broken article urls due to wrong root site id'
def h... | <commit_before><commit_msg>Add a management command to fix broken article urls when changing root site id.<commit_after> | # coding=utf-8
from django.db import connection
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
class Command(BaseCommand):
args = '<id_or_name>'
help = 'Fix any broken article urls due to wrong root site id'
def h... | Add a management command to fix broken article urls when changing root site id.# coding=utf-8
from django.db import connection
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
class Command(BaseCommand):
args = '<id_or_n... | <commit_before><commit_msg>Add a management command to fix broken article urls when changing root site id.<commit_after># coding=utf-8
from django.db import connection
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
class... | |
a9d5ac5a3ed0d43dfa3a7f7034d7f33771263f91 | tests/unit/utils/format_call_test.py | tests/unit/utils/format_call_test.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
:copyright: © 2013 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
tests.unit.utils.format_call_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test `salt.utils... | Add unit tests to `salt.utils.format_call()`. | Add unit tests to `salt.utils.format_call()`.
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add unit tests to `salt.utils.format_call()`. | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
:copyright: © 2013 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
tests.unit.utils.format_call_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test `salt.utils... | <commit_before><commit_msg>Add unit tests to `salt.utils.format_call()`.<commit_after> | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
:copyright: © 2013 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
tests.unit.utils.format_call_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test `salt.utils... | Add unit tests to `salt.utils.format_call()`.# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
:copyright: © 2013 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
tests.unit.utils.format_call_test
~~~~~~~~~~... | <commit_before><commit_msg>Add unit tests to `salt.utils.format_call()`.<commit_after># -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
:copyright: © 2013 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
tests.u... | |
67d3a8d5716e9c634c70388361a2fc0edbc80961 | old/request.py | old/request.py | from exchanges import helpers
from exchanges import bitfinex
from exchanges import bitstamp
from exchanges import okcoin
from exchanges import cex
from exchanges import btce
from time import sleep
from datetime import datetime
import csv
# PREPARE OUTPUT FILE
# tell computer where to put CSV
filename = datetime.now(... | Move original to this folder | Move original to this folder
Original was pulling back USD exchanges - now only looking at EUR
exchanges
| Python | mit | Humantrashcan/prices | Move original to this folder
Original was pulling back USD exchanges - now only looking at EUR
exchanges | from exchanges import helpers
from exchanges import bitfinex
from exchanges import bitstamp
from exchanges import okcoin
from exchanges import cex
from exchanges import btce
from time import sleep
from datetime import datetime
import csv
# PREPARE OUTPUT FILE
# tell computer where to put CSV
filename = datetime.now(... | <commit_before><commit_msg>Move original to this folder
Original was pulling back USD exchanges - now only looking at EUR
exchanges<commit_after> | from exchanges import helpers
from exchanges import bitfinex
from exchanges import bitstamp
from exchanges import okcoin
from exchanges import cex
from exchanges import btce
from time import sleep
from datetime import datetime
import csv
# PREPARE OUTPUT FILE
# tell computer where to put CSV
filename = datetime.now(... | Move original to this folder
Original was pulling back USD exchanges - now only looking at EUR
exchangesfrom exchanges import helpers
from exchanges import bitfinex
from exchanges import bitstamp
from exchanges import okcoin
from exchanges import cex
from exchanges import btce
from time import sleep
from datetime impo... | <commit_before><commit_msg>Move original to this folder
Original was pulling back USD exchanges - now only looking at EUR
exchanges<commit_after>from exchanges import helpers
from exchanges import bitfinex
from exchanges import bitstamp
from exchanges import okcoin
from exchanges import cex
from exchanges import btce
... | |
80dd6f7c2b3b16e638ab5d836758d5b60c8a82d5 | distutils/tests/test_ccompiler.py | distutils/tests/test_ccompiler.py |
from distutils import ccompiler
def test_set_include_dirs(tmp_path):
"""
Extensions should build even if set_include_dirs is invoked.
In particular, compiler-specific paths should not be overridden.
"""
c_file = tmp_path / 'foo.c'
c_file.write_text('void PyInit_foo(void) {}\n')
compiler =... | Add test capturing failed expectation. | Add test capturing failed expectation.
| Python | mit | pypa/setuptools,pypa/setuptools,pypa/setuptools | Add test capturing failed expectation. |
from distutils import ccompiler
def test_set_include_dirs(tmp_path):
"""
Extensions should build even if set_include_dirs is invoked.
In particular, compiler-specific paths should not be overridden.
"""
c_file = tmp_path / 'foo.c'
c_file.write_text('void PyInit_foo(void) {}\n')
compiler =... | <commit_before><commit_msg>Add test capturing failed expectation.<commit_after> |
from distutils import ccompiler
def test_set_include_dirs(tmp_path):
"""
Extensions should build even if set_include_dirs is invoked.
In particular, compiler-specific paths should not be overridden.
"""
c_file = tmp_path / 'foo.c'
c_file.write_text('void PyInit_foo(void) {}\n')
compiler =... | Add test capturing failed expectation.
from distutils import ccompiler
def test_set_include_dirs(tmp_path):
"""
Extensions should build even if set_include_dirs is invoked.
In particular, compiler-specific paths should not be overridden.
"""
c_file = tmp_path / 'foo.c'
c_file.write_text('void ... | <commit_before><commit_msg>Add test capturing failed expectation.<commit_after>
from distutils import ccompiler
def test_set_include_dirs(tmp_path):
"""
Extensions should build even if set_include_dirs is invoked.
In particular, compiler-specific paths should not be overridden.
"""
c_file = tmp_pa... | |
8d9f8277e5d346512f1ecc4fd0be0f757c6dfae9 | ariia/weather_module.py | ariia/weather_module.py | # -*- coding: utf-8 -*-
# !/usr/bin/env python
# MIT License
#
# Copyright (c) 2017 Maxime Busy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limit... | Add the weather module class | Add the weather module class
| Python | mit | Pandhariix/ARIIA | Add the weather module class | # -*- coding: utf-8 -*-
# !/usr/bin/env python
# MIT License
#
# Copyright (c) 2017 Maxime Busy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limit... | <commit_before><commit_msg>Add the weather module class<commit_after> | # -*- coding: utf-8 -*-
# !/usr/bin/env python
# MIT License
#
# Copyright (c) 2017 Maxime Busy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limit... | Add the weather module class# -*- coding: utf-8 -*-
# !/usr/bin/env python
# MIT License
#
# Copyright (c) 2017 Maxime Busy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restrict... | <commit_before><commit_msg>Add the weather module class<commit_after># -*- coding: utf-8 -*-
# !/usr/bin/env python
# MIT License
#
# Copyright (c) 2017 Maxime Busy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), t... | |
7d82be33689d5734fd5ec247dafac5c58536e3c9 | tests/actor_test.py | tests/actor_test.py | import unittest
from pykka import Actor
class ActorInterruptTest(unittest.TestCase):
def setUp(self):
class ActorWithInterrupt(Actor):
def run_inside_try(self):
raise KeyboardInterrupt
self.actor = ActorWithInterrupt()
def test_issuing_keyboard_interrupt_stops_proc... | Test clean exit at keyboard interrupt | Test clean exit at keyboard interrupt
| Python | apache-2.0 | jodal/pykka,tempbottle/pykka,tamland/pykka | Test clean exit at keyboard interrupt | import unittest
from pykka import Actor
class ActorInterruptTest(unittest.TestCase):
def setUp(self):
class ActorWithInterrupt(Actor):
def run_inside_try(self):
raise KeyboardInterrupt
self.actor = ActorWithInterrupt()
def test_issuing_keyboard_interrupt_stops_proc... | <commit_before><commit_msg>Test clean exit at keyboard interrupt<commit_after> | import unittest
from pykka import Actor
class ActorInterruptTest(unittest.TestCase):
def setUp(self):
class ActorWithInterrupt(Actor):
def run_inside_try(self):
raise KeyboardInterrupt
self.actor = ActorWithInterrupt()
def test_issuing_keyboard_interrupt_stops_proc... | Test clean exit at keyboard interruptimport unittest
from pykka import Actor
class ActorInterruptTest(unittest.TestCase):
def setUp(self):
class ActorWithInterrupt(Actor):
def run_inside_try(self):
raise KeyboardInterrupt
self.actor = ActorWithInterrupt()
def test_... | <commit_before><commit_msg>Test clean exit at keyboard interrupt<commit_after>import unittest
from pykka import Actor
class ActorInterruptTest(unittest.TestCase):
def setUp(self):
class ActorWithInterrupt(Actor):
def run_inside_try(self):
raise KeyboardInterrupt
self.ac... | |
c212216b98d3323073b0c2f8d71a2d4543abfcc2 | plots/plot-timing-histograms.py | plots/plot-timing-histograms.py | #!/usr/bin/env python
import climate
import joblib
import lmj.cubes
import lmj.plot
import numpy as np
def diffs(t):
t.load()
return 1000 * np.diff(t.index.values)
def main(root, pattern='*'):
trials = lmj.cubes.Experiment(root).trials_matching(pattern)
values = joblib.Parallel(-1)(joblib.delayed(d... | Add script for plotting time interval hists. | Add script for plotting time interval hists.
| Python | mit | lmjohns3/cube-experiment,lmjohns3/cube-experiment,lmjohns3/cube-experiment | Add script for plotting time interval hists. | #!/usr/bin/env python
import climate
import joblib
import lmj.cubes
import lmj.plot
import numpy as np
def diffs(t):
t.load()
return 1000 * np.diff(t.index.values)
def main(root, pattern='*'):
trials = lmj.cubes.Experiment(root).trials_matching(pattern)
values = joblib.Parallel(-1)(joblib.delayed(d... | <commit_before><commit_msg>Add script for plotting time interval hists.<commit_after> | #!/usr/bin/env python
import climate
import joblib
import lmj.cubes
import lmj.plot
import numpy as np
def diffs(t):
t.load()
return 1000 * np.diff(t.index.values)
def main(root, pattern='*'):
trials = lmj.cubes.Experiment(root).trials_matching(pattern)
values = joblib.Parallel(-1)(joblib.delayed(d... | Add script for plotting time interval hists.#!/usr/bin/env python
import climate
import joblib
import lmj.cubes
import lmj.plot
import numpy as np
def diffs(t):
t.load()
return 1000 * np.diff(t.index.values)
def main(root, pattern='*'):
trials = lmj.cubes.Experiment(root).trials_matching(pattern)
v... | <commit_before><commit_msg>Add script for plotting time interval hists.<commit_after>#!/usr/bin/env python
import climate
import joblib
import lmj.cubes
import lmj.plot
import numpy as np
def diffs(t):
t.load()
return 1000 * np.diff(t.index.values)
def main(root, pattern='*'):
trials = lmj.cubes.Experi... | |
f71045f6bef5c8b9f7274ec41a965ccbe1044a01 | examples/test_markers.py | examples/test_markers.py | """ These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 # Runs B, C
... | """ These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 # Runs B, C
... | Update pytest marker test suite | Update pytest marker test suite
| Python | mit | mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase | """ These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 # Runs B, C
... | """ These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 # Runs B, C
... | <commit_before>""" These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 ... | """ These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 # Runs B, C
... | """ These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 # Runs B, C
... | <commit_before>""" These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 ... |
ce5247a01f5ef84336bd81636fb9c04d90de0c12 | ddm.py | ddm.py | from common import *
from urlgrab import Cache
from re import compile, DOTALL, MULTILINE, sub
from urlparse import urljoin
cache = Cache()
titlePattern = compile("<TITLE>(.*?)</TITLE>")
contentPattern = compile("(?:<BR>\s+<BLOCKQUOTE>|<H3 ALIGN=\"CENTER\">)(.+)</BLOCKQUOTE>.+?<A HREF=\"ancilpag.html#DP\">Dramatis per... | Add specialist creation script for Dark Distorted Mirror | Add specialist creation script for Dark Distorted Mirror
| Python | agpl-3.0 | palfrey/book-blog | Add specialist creation script for Dark Distorted Mirror | from common import *
from urlgrab import Cache
from re import compile, DOTALL, MULTILINE, sub
from urlparse import urljoin
cache = Cache()
titlePattern = compile("<TITLE>(.*?)</TITLE>")
contentPattern = compile("(?:<BR>\s+<BLOCKQUOTE>|<H3 ALIGN=\"CENTER\">)(.+)</BLOCKQUOTE>.+?<A HREF=\"ancilpag.html#DP\">Dramatis per... | <commit_before><commit_msg>Add specialist creation script for Dark Distorted Mirror<commit_after> | from common import *
from urlgrab import Cache
from re import compile, DOTALL, MULTILINE, sub
from urlparse import urljoin
cache = Cache()
titlePattern = compile("<TITLE>(.*?)</TITLE>")
contentPattern = compile("(?:<BR>\s+<BLOCKQUOTE>|<H3 ALIGN=\"CENTER\">)(.+)</BLOCKQUOTE>.+?<A HREF=\"ancilpag.html#DP\">Dramatis per... | Add specialist creation script for Dark Distorted Mirrorfrom common import *
from urlgrab import Cache
from re import compile, DOTALL, MULTILINE, sub
from urlparse import urljoin
cache = Cache()
titlePattern = compile("<TITLE>(.*?)</TITLE>")
contentPattern = compile("(?:<BR>\s+<BLOCKQUOTE>|<H3 ALIGN=\"CENTER\">)(.+)<... | <commit_before><commit_msg>Add specialist creation script for Dark Distorted Mirror<commit_after>from common import *
from urlgrab import Cache
from re import compile, DOTALL, MULTILINE, sub
from urlparse import urljoin
cache = Cache()
titlePattern = compile("<TITLE>(.*?)</TITLE>")
contentPattern = compile("(?:<BR>\s... | |
6d6a566d93784022e5b769fc9d26b0f56ac3f18d | bin/2000/shape_msa_tract.py | bin/2000/shape_msa_tract.py | """shape_msa_blockgroup.py
Output one shapefile per MSA containing all the blockgroups it contains
"""
import os
import csv
import fiona
#
# Import MSA to tracts crosswalk
#
msa_to_tract = {}
with open('data/2000/crosswalks/tract.csv', 'r') as source:
reader = csv.reader(source, delimiter='\t')
reader.next(... | Add script to extract the tracts shapes in 2000 MSA | Add script to extract the tracts shapes in 2000 MSA
| Python | bsd-2-clause | scities/2000-us-metro-atlas | Add script to extract the tracts shapes in 2000 MSA | """shape_msa_blockgroup.py
Output one shapefile per MSA containing all the blockgroups it contains
"""
import os
import csv
import fiona
#
# Import MSA to tracts crosswalk
#
msa_to_tract = {}
with open('data/2000/crosswalks/tract.csv', 'r') as source:
reader = csv.reader(source, delimiter='\t')
reader.next(... | <commit_before><commit_msg>Add script to extract the tracts shapes in 2000 MSA<commit_after> | """shape_msa_blockgroup.py
Output one shapefile per MSA containing all the blockgroups it contains
"""
import os
import csv
import fiona
#
# Import MSA to tracts crosswalk
#
msa_to_tract = {}
with open('data/2000/crosswalks/tract.csv', 'r') as source:
reader = csv.reader(source, delimiter='\t')
reader.next(... | Add script to extract the tracts shapes in 2000 MSA"""shape_msa_blockgroup.py
Output one shapefile per MSA containing all the blockgroups it contains
"""
import os
import csv
import fiona
#
# Import MSA to tracts crosswalk
#
msa_to_tract = {}
with open('data/2000/crosswalks/tract.csv', 'r') as source:
reader = ... | <commit_before><commit_msg>Add script to extract the tracts shapes in 2000 MSA<commit_after>"""shape_msa_blockgroup.py
Output one shapefile per MSA containing all the blockgroups it contains
"""
import os
import csv
import fiona
#
# Import MSA to tracts crosswalk
#
msa_to_tract = {}
with open('data/2000/crosswalks/... | |
72437b0ed11bfdc5ff82aeabf69130e683ddeb43 | numba/cuda/tests/cudapy/test_array_methods.py | numba/cuda/tests/cudapy/test_array_methods.py | from __future__ import print_function, absolute_import, division
from numba import unittest_support as unittest
import numpy as np
from numba import cuda
def reinterpret_array_type(byte_arr, start, stop, output):
# Tested with just one thread
val = byte_arr[start:stop].view(np.int32)[0]
output[0] = val
... | Add CUDA GPU test for the .view() array method | Add CUDA GPU test for the .view() array method
| Python | bsd-2-clause | pombredanne/numba,stuartarchibald/numba,GaZ3ll3/numba,pitrou/numba,pombredanne/numba,seibert/numba,cpcloud/numba,gdementen/numba,cpcloud/numba,gmarkall/numba,pitrou/numba,jriehl/numba,IntelLabs/numba,GaZ3ll3/numba,GaZ3ll3/numba,stefanseefeld/numba,stefanseefeld/numba,IntelLabs/numba,IntelLabs/numba,gmarkall/numba,ssara... | Add CUDA GPU test for the .view() array method | from __future__ import print_function, absolute_import, division
from numba import unittest_support as unittest
import numpy as np
from numba import cuda
def reinterpret_array_type(byte_arr, start, stop, output):
# Tested with just one thread
val = byte_arr[start:stop].view(np.int32)[0]
output[0] = val
... | <commit_before><commit_msg>Add CUDA GPU test for the .view() array method<commit_after> | from __future__ import print_function, absolute_import, division
from numba import unittest_support as unittest
import numpy as np
from numba import cuda
def reinterpret_array_type(byte_arr, start, stop, output):
# Tested with just one thread
val = byte_arr[start:stop].view(np.int32)[0]
output[0] = val
... | Add CUDA GPU test for the .view() array methodfrom __future__ import print_function, absolute_import, division
from numba import unittest_support as unittest
import numpy as np
from numba import cuda
def reinterpret_array_type(byte_arr, start, stop, output):
# Tested with just one thread
val = byte_arr[start... | <commit_before><commit_msg>Add CUDA GPU test for the .view() array method<commit_after>from __future__ import print_function, absolute_import, division
from numba import unittest_support as unittest
import numpy as np
from numba import cuda
def reinterpret_array_type(byte_arr, start, stop, output):
# Tested with... | |
0b436265ad984f8750098e56712bb3ac8f917e86 | scripts/make_segue_subsample.py | scripts/make_segue_subsample.py | from astropy.io import fits, ascii
from astropy.table import Table
import numpy as np
sspp = fits.open("/Users/adrian/projects/segue-learn/data/ssppOut-dr9.fits")
all_data = sspp[1].data
best_data = all_data[all_data['FLAG'] == 'nnnnn']
best_data = best_data[(best_data['RV_ADOP'] != -9999) & \
(... | Add script for selecting a segue subsample | Add script for selecting a segue subsample
| Python | bsd-3-clause | adrn/d3po,adrn/d3po,adrn/d3po | Add script for selecting a segue subsample | from astropy.io import fits, ascii
from astropy.table import Table
import numpy as np
sspp = fits.open("/Users/adrian/projects/segue-learn/data/ssppOut-dr9.fits")
all_data = sspp[1].data
best_data = all_data[all_data['FLAG'] == 'nnnnn']
best_data = best_data[(best_data['RV_ADOP'] != -9999) & \
(... | <commit_before><commit_msg>Add script for selecting a segue subsample<commit_after> | from astropy.io import fits, ascii
from astropy.table import Table
import numpy as np
sspp = fits.open("/Users/adrian/projects/segue-learn/data/ssppOut-dr9.fits")
all_data = sspp[1].data
best_data = all_data[all_data['FLAG'] == 'nnnnn']
best_data = best_data[(best_data['RV_ADOP'] != -9999) & \
(... | Add script for selecting a segue subsamplefrom astropy.io import fits, ascii
from astropy.table import Table
import numpy as np
sspp = fits.open("/Users/adrian/projects/segue-learn/data/ssppOut-dr9.fits")
all_data = sspp[1].data
best_data = all_data[all_data['FLAG'] == 'nnnnn']
best_data = best_data[(best_data['RV_AD... | <commit_before><commit_msg>Add script for selecting a segue subsample<commit_after>from astropy.io import fits, ascii
from astropy.table import Table
import numpy as np
sspp = fits.open("/Users/adrian/projects/segue-learn/data/ssppOut-dr9.fits")
all_data = sspp[1].data
best_data = all_data[all_data['FLAG'] == 'nnnnn'... | |
c4ff6052f6e4fd545ea1c7cb0cd2a53a28ed001d | scripts/state_and_transition.py | scripts/state_and_transition.py | #!/usr/bin/env python
#
# Copyright 2017 Robot Garden, Inc.
#
# 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... | Move state and transition enums file for re-use | Move state and transition enums file for re-use | Python | apache-2.0 | ProgrammingRobotsStudyGroup/robo_magellan,ProgrammingRobotsStudyGroup/robo_magellan,ProgrammingRobotsStudyGroup/robo_magellan,ProgrammingRobotsStudyGroup/robo_magellan | Move state and transition enums file for re-use | #!/usr/bin/env python
#
# Copyright 2017 Robot Garden, Inc.
#
# 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... | <commit_before><commit_msg>Move state and transition enums file for re-use<commit_after> | #!/usr/bin/env python
#
# Copyright 2017 Robot Garden, Inc.
#
# 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... | Move state and transition enums file for re-use#!/usr/bin/env python
#
# Copyright 2017 Robot Garden, Inc.
#
# 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/licen... | <commit_before><commit_msg>Move state and transition enums file for re-use<commit_after>#!/usr/bin/env python
#
# Copyright 2017 Robot Garden, Inc.
#
# 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 Licens... | |
2b0c7304c1372997bc226d255ef22cc31f56f6fa | caminae/core/management.py | caminae/core/management.py | # http://djangosnippets.org/snippets/2311/
# Ensure South will update our custom SQL during a call to `migrate`.
from south.signals import post_migrate
def run_initial_sql(sender, **kwargs):
app_label = kwargs.get('app')
import os
from django.db import connection, transaction, models
app_dir = os.pat... | Enable auto-loading of raw SQL during South migration | Enable auto-loading of raw SQL during South migration
| Python | bsd-2-clause | makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,camillemonchicourt/Geotrek,GeotrekCE/Geotrek-admin,johan--/Geotrek,johan--/Geotrek,mabhub/Geotrek,Anaethelion/Geotrek,mabhub/Geotrek,Anaethelion/Geotrek,camillemonchicourt/Geotrek,makinacorpus/Geotrek,Anaethelion/Geotrek,johan--/Geotrek,mabhub/Geotrek... | Enable auto-loading of raw SQL during South migration | # http://djangosnippets.org/snippets/2311/
# Ensure South will update our custom SQL during a call to `migrate`.
from south.signals import post_migrate
def run_initial_sql(sender, **kwargs):
app_label = kwargs.get('app')
import os
from django.db import connection, transaction, models
app_dir = os.pat... | <commit_before><commit_msg>Enable auto-loading of raw SQL during South migration<commit_after> | # http://djangosnippets.org/snippets/2311/
# Ensure South will update our custom SQL during a call to `migrate`.
from south.signals import post_migrate
def run_initial_sql(sender, **kwargs):
app_label = kwargs.get('app')
import os
from django.db import connection, transaction, models
app_dir = os.pat... | Enable auto-loading of raw SQL during South migration# http://djangosnippets.org/snippets/2311/
# Ensure South will update our custom SQL during a call to `migrate`.
from south.signals import post_migrate
def run_initial_sql(sender, **kwargs):
app_label = kwargs.get('app')
import os
from django.db import... | <commit_before><commit_msg>Enable auto-loading of raw SQL during South migration<commit_after># http://djangosnippets.org/snippets/2311/
# Ensure South will update our custom SQL during a call to `migrate`.
from south.signals import post_migrate
def run_initial_sql(sender, **kwargs):
app_label = kwargs.get('app'... | |
eb9bae2803876f93957e6e2bdd00e57c83cff567 | pikos/monitors/focused_monitor_attach.py | pikos/monitors/focused_monitor_attach.py | # -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# Package: Pikos toolkit
# File: monitors/monitor_attach.py
# License: LICENSE.TXT
#
# Copyright (c) 2012, Enthought, Inc.
# All rights reserved.
#----------------------------------------------------------------... | Add a new MonitorAttach class for Focused monitors | Add a new MonitorAttach class for Focused monitors
| Python | bsd-3-clause | enthought/pikos,enthought/pikos,enthought/pikos | Add a new MonitorAttach class for Focused monitors | # -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# Package: Pikos toolkit
# File: monitors/monitor_attach.py
# License: LICENSE.TXT
#
# Copyright (c) 2012, Enthought, Inc.
# All rights reserved.
#----------------------------------------------------------------... | <commit_before><commit_msg>Add a new MonitorAttach class for Focused monitors<commit_after> | # -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# Package: Pikos toolkit
# File: monitors/monitor_attach.py
# License: LICENSE.TXT
#
# Copyright (c) 2012, Enthought, Inc.
# All rights reserved.
#----------------------------------------------------------------... | Add a new MonitorAttach class for Focused monitors# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# Package: Pikos toolkit
# File: monitors/monitor_attach.py
# License: LICENSE.TXT
#
# Copyright (c) 2012, Enthought, Inc.
# All rights reserved.
#--------------... | <commit_before><commit_msg>Add a new MonitorAttach class for Focused monitors<commit_after># -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# Package: Pikos toolkit
# File: monitors/monitor_attach.py
# License: LICENSE.TXT
#
# Copyright (c) 2012, Enthought, Inc... | |
f4e49e2ee6b8ae7b1ab5132b3f900b0002acda54 | docs/source/powerline_autodoc.py | docs/source/powerline_autodoc.py | # vim:fileencoding=utf-8:noet
from sphinx.ext import autodoc
from inspect import formatargspec
from powerline.lint.inspect import getconfigargspec
from powerline.lib.threaded import ThreadedSegment
try:
from __builtin__ import unicode
except ImportError:
unicode = lambda s, enc: s # NOQA
def formatvalue(val):
if... | # vim:fileencoding=utf-8:noet
from sphinx.ext import autodoc
from inspect import formatargspec
from powerline.lint.inspect import getconfigargspec
from powerline.segments import Segment
try:
from __builtin__ import unicode
except ImportError:
unicode = lambda s, enc: s # NOQA
def formatvalue(val):
if type(val) i... | Make powerline autodoc add all Segments | Make powerline autodoc add all Segments
| Python | mit | lukw00/powerline,xfumihiro/powerline,dragon788/powerline,prvnkumar/powerline,magus424/powerline,S0lll0s/powerline,QuLogic/powerline,EricSB/powerline,xxxhycl2010/powerline,lukw00/powerline,firebitsbr/powerline,russellb/powerline,bartvm/powerline,dragon788/powerline,prvnkumar/powerline,S0lll0s/powerline,bartvm/powerline,... | # vim:fileencoding=utf-8:noet
from sphinx.ext import autodoc
from inspect import formatargspec
from powerline.lint.inspect import getconfigargspec
from powerline.lib.threaded import ThreadedSegment
try:
from __builtin__ import unicode
except ImportError:
unicode = lambda s, enc: s # NOQA
def formatvalue(val):
if... | # vim:fileencoding=utf-8:noet
from sphinx.ext import autodoc
from inspect import formatargspec
from powerline.lint.inspect import getconfigargspec
from powerline.segments import Segment
try:
from __builtin__ import unicode
except ImportError:
unicode = lambda s, enc: s # NOQA
def formatvalue(val):
if type(val) i... | <commit_before># vim:fileencoding=utf-8:noet
from sphinx.ext import autodoc
from inspect import formatargspec
from powerline.lint.inspect import getconfigargspec
from powerline.lib.threaded import ThreadedSegment
try:
from __builtin__ import unicode
except ImportError:
unicode = lambda s, enc: s # NOQA
def format... | # vim:fileencoding=utf-8:noet
from sphinx.ext import autodoc
from inspect import formatargspec
from powerline.lint.inspect import getconfigargspec
from powerline.segments import Segment
try:
from __builtin__ import unicode
except ImportError:
unicode = lambda s, enc: s # NOQA
def formatvalue(val):
if type(val) i... | # vim:fileencoding=utf-8:noet
from sphinx.ext import autodoc
from inspect import formatargspec
from powerline.lint.inspect import getconfigargspec
from powerline.lib.threaded import ThreadedSegment
try:
from __builtin__ import unicode
except ImportError:
unicode = lambda s, enc: s # NOQA
def formatvalue(val):
if... | <commit_before># vim:fileencoding=utf-8:noet
from sphinx.ext import autodoc
from inspect import formatargspec
from powerline.lint.inspect import getconfigargspec
from powerline.lib.threaded import ThreadedSegment
try:
from __builtin__ import unicode
except ImportError:
unicode = lambda s, enc: s # NOQA
def format... |
7d7a3a6a71dccec3c44fe8f1dd6576423d2ca278 | formalization/coq2latex.py | formalization/coq2latex.py | #!/usr/bin/python
import sys
import re
from string import Template
def rule2latex(name, premises, conclusion):
return Template(
r"""\newcommand{\rl$name}{\referTo{$name}{rul:$name}}
\newcommand{\show$name}{%
\infer[\rulename{$name}]
{$premises}
{$conclusion}
}""").substitute({"name" : name,
... | Prepare for coq -> latex translation | Prepare for coq -> latex translation
| Python | mit | TheoWinterhalter/formal-type-theory | Prepare for coq -> latex translation | #!/usr/bin/python
import sys
import re
from string import Template
def rule2latex(name, premises, conclusion):
return Template(
r"""\newcommand{\rl$name}{\referTo{$name}{rul:$name}}
\newcommand{\show$name}{%
\infer[\rulename{$name}]
{$premises}
{$conclusion}
}""").substitute({"name" : name,
... | <commit_before><commit_msg>Prepare for coq -> latex translation<commit_after> | #!/usr/bin/python
import sys
import re
from string import Template
def rule2latex(name, premises, conclusion):
return Template(
r"""\newcommand{\rl$name}{\referTo{$name}{rul:$name}}
\newcommand{\show$name}{%
\infer[\rulename{$name}]
{$premises}
{$conclusion}
}""").substitute({"name" : name,
... | Prepare for coq -> latex translation#!/usr/bin/python
import sys
import re
from string import Template
def rule2latex(name, premises, conclusion):
return Template(
r"""\newcommand{\rl$name}{\referTo{$name}{rul:$name}}
\newcommand{\show$name}{%
\infer[\rulename{$name}]
{$premises}
{$conclusion}
}""").su... | <commit_before><commit_msg>Prepare for coq -> latex translation<commit_after>#!/usr/bin/python
import sys
import re
from string import Template
def rule2latex(name, premises, conclusion):
return Template(
r"""\newcommand{\rl$name}{\referTo{$name}{rul:$name}}
\newcommand{\show$name}{%
\infer[\rulename{$name}]
... | |
9b9582a1b7226ceb9cc65657ffb7fd7d51c8ea2a | lib/exp/featx/__init__.py | lib/exp/featx/__init__.py | __all__ = []
from lib.exp.featx.base import Featx
from lib.exp.tools.slider import Slider
class SlideFeatx(Featx, Slider):
def __init__(self, root, name):
Featx.__init__(self, root, name)
Slider.__init__(self, root, name)
def get_feats(self):
imgl = self.get_slides(None, gray=True, r... | __all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.prepare import Prepare
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = Slider(self... | Change to use `featx` in package | Change to use `featx` in package
| Python | agpl-3.0 | speed-of-light/pyslider | __all__ = []
from lib.exp.featx.base import Featx
from lib.exp.tools.slider import Slider
class SlideFeatx(Featx, Slider):
def __init__(self, root, name):
Featx.__init__(self, root, name)
Slider.__init__(self, root, name)
def get_feats(self):
imgl = self.get_slides(None, gray=True, r... | __all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.prepare import Prepare
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = Slider(self... | <commit_before>__all__ = []
from lib.exp.featx.base import Featx
from lib.exp.tools.slider import Slider
class SlideFeatx(Featx, Slider):
def __init__(self, root, name):
Featx.__init__(self, root, name)
Slider.__init__(self, root, name)
def get_feats(self):
imgl = self.get_slides(Non... | __all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.prepare import Prepare
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = Slider(self... | __all__ = []
from lib.exp.featx.base import Featx
from lib.exp.tools.slider import Slider
class SlideFeatx(Featx, Slider):
def __init__(self, root, name):
Featx.__init__(self, root, name)
Slider.__init__(self, root, name)
def get_feats(self):
imgl = self.get_slides(None, gray=True, r... | <commit_before>__all__ = []
from lib.exp.featx.base import Featx
from lib.exp.tools.slider import Slider
class SlideFeatx(Featx, Slider):
def __init__(self, root, name):
Featx.__init__(self, root, name)
Slider.__init__(self, root, name)
def get_feats(self):
imgl = self.get_slides(Non... |
8db49a2336e733479d8f1dd573b20807763c7681 | gem/migrations/0021_commentcountrule.py | gem/migrations/0021_commentcountrule.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-10-19 11:20
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('wagtail_personalisation', '0012_... | Add migration for the segment | Add migration for the segment
| Python | bsd-2-clause | praekelt/molo-gem,praekelt/molo-gem,praekelt/molo-gem | Add migration for the segment | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-10-19 11:20
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('wagtail_personalisation', '0012_... | <commit_before><commit_msg>Add migration for the segment<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-10-19 11:20
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('wagtail_personalisation', '0012_... | Add migration for the segment# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-10-19 11:20
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('wag... | <commit_before><commit_msg>Add migration for the segment<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-10-19 11:20
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migrat... | |
41680da53d5059e3b1e2ce497916f26d4c06cf16 | lowfat/management/commands/fixcw19.py | lowfat/management/commands/fixcw19.py | import datetime
from django.core.management.base import BaseCommand
from lowfat.models import Claimant, Fund, Expense
class Command(BaseCommand):
help = "CW19 funding request"
def handle(self, *args, **options):
for claimant in Claimant.objects.filter(
application_year=2019
)... | Add fix related with CW19 | Add fix related with CW19
| Python | bsd-3-clause | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | Add fix related with CW19 | import datetime
from django.core.management.base import BaseCommand
from lowfat.models import Claimant, Fund, Expense
class Command(BaseCommand):
help = "CW19 funding request"
def handle(self, *args, **options):
for claimant in Claimant.objects.filter(
application_year=2019
)... | <commit_before><commit_msg>Add fix related with CW19<commit_after> | import datetime
from django.core.management.base import BaseCommand
from lowfat.models import Claimant, Fund, Expense
class Command(BaseCommand):
help = "CW19 funding request"
def handle(self, *args, **options):
for claimant in Claimant.objects.filter(
application_year=2019
)... | Add fix related with CW19import datetime
from django.core.management.base import BaseCommand
from lowfat.models import Claimant, Fund, Expense
class Command(BaseCommand):
help = "CW19 funding request"
def handle(self, *args, **options):
for claimant in Claimant.objects.filter(
applic... | <commit_before><commit_msg>Add fix related with CW19<commit_after>import datetime
from django.core.management.base import BaseCommand
from lowfat.models import Claimant, Fund, Expense
class Command(BaseCommand):
help = "CW19 funding request"
def handle(self, *args, **options):
for claimant in Claima... | |
c2109312996fed550ddbfaf3f39c79b709757a8c | alembic/versions/66ecf0b2aed5_add_pages_table.py | alembic/versions/66ecf0b2aed5_add_pages_table.py | """add pages table
Revision ID: 66ecf0b2aed5
Revises: c7476118715f
Create Date: 2019-06-01 16:10:06.519049
"""
# revision identifiers, used by Alembic.
revision = '66ecf0b2aed5'
down_revision = 'c7476118715f'
import datetime
from alembic import op
import sqlalchemy as sa
def make_timestamp():
now = datetime.d... | Create the table via migration. | Create the table via migration.
| Python | agpl-3.0 | Scifabric/pybossa,Scifabric/pybossa | Create the table via migration. | """add pages table
Revision ID: 66ecf0b2aed5
Revises: c7476118715f
Create Date: 2019-06-01 16:10:06.519049
"""
# revision identifiers, used by Alembic.
revision = '66ecf0b2aed5'
down_revision = 'c7476118715f'
import datetime
from alembic import op
import sqlalchemy as sa
def make_timestamp():
now = datetime.d... | <commit_before><commit_msg>Create the table via migration.<commit_after> | """add pages table
Revision ID: 66ecf0b2aed5
Revises: c7476118715f
Create Date: 2019-06-01 16:10:06.519049
"""
# revision identifiers, used by Alembic.
revision = '66ecf0b2aed5'
down_revision = 'c7476118715f'
import datetime
from alembic import op
import sqlalchemy as sa
def make_timestamp():
now = datetime.d... | Create the table via migration."""add pages table
Revision ID: 66ecf0b2aed5
Revises: c7476118715f
Create Date: 2019-06-01 16:10:06.519049
"""
# revision identifiers, used by Alembic.
revision = '66ecf0b2aed5'
down_revision = 'c7476118715f'
import datetime
from alembic import op
import sqlalchemy as sa
def make_ti... | <commit_before><commit_msg>Create the table via migration.<commit_after>"""add pages table
Revision ID: 66ecf0b2aed5
Revises: c7476118715f
Create Date: 2019-06-01 16:10:06.519049
"""
# revision identifiers, used by Alembic.
revision = '66ecf0b2aed5'
down_revision = 'c7476118715f'
import datetime
from alembic import... | |
b5e6cf14d6f6442e1fb855e0aa19368b2ce6db15 | polyaxon_schemas/pod_lifecycle.py | polyaxon_schemas/pod_lifecycle.py | from hestia.unknown import UNKNOWN
class PodLifeCycle(object):
CONTAINER_CREATING = 'ContainerCreating'
PENDING = 'Pending'
RUNNING = 'Running'
SUCCEEDED = 'Succeeded'
FAILED = 'Failed'
UNKNOWN = UNKNOWN
CHOICES = (
(RUNNING, RUNNING),
(PENDING, PENDING),
(CONTAINE... | Move pod lifecycle to schemas | Move pod lifecycle to schemas
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | Move pod lifecycle to schemas | from hestia.unknown import UNKNOWN
class PodLifeCycle(object):
CONTAINER_CREATING = 'ContainerCreating'
PENDING = 'Pending'
RUNNING = 'Running'
SUCCEEDED = 'Succeeded'
FAILED = 'Failed'
UNKNOWN = UNKNOWN
CHOICES = (
(RUNNING, RUNNING),
(PENDING, PENDING),
(CONTAINE... | <commit_before><commit_msg>Move pod lifecycle to schemas<commit_after> | from hestia.unknown import UNKNOWN
class PodLifeCycle(object):
CONTAINER_CREATING = 'ContainerCreating'
PENDING = 'Pending'
RUNNING = 'Running'
SUCCEEDED = 'Succeeded'
FAILED = 'Failed'
UNKNOWN = UNKNOWN
CHOICES = (
(RUNNING, RUNNING),
(PENDING, PENDING),
(CONTAINE... | Move pod lifecycle to schemasfrom hestia.unknown import UNKNOWN
class PodLifeCycle(object):
CONTAINER_CREATING = 'ContainerCreating'
PENDING = 'Pending'
RUNNING = 'Running'
SUCCEEDED = 'Succeeded'
FAILED = 'Failed'
UNKNOWN = UNKNOWN
CHOICES = (
(RUNNING, RUNNING),
(PENDING... | <commit_before><commit_msg>Move pod lifecycle to schemas<commit_after>from hestia.unknown import UNKNOWN
class PodLifeCycle(object):
CONTAINER_CREATING = 'ContainerCreating'
PENDING = 'Pending'
RUNNING = 'Running'
SUCCEEDED = 'Succeeded'
FAILED = 'Failed'
UNKNOWN = UNKNOWN
CHOICES = (
... | |
649679d67f611e10a4d1821dcfacf01abf7ac5b2 | migrations/versions/0157_add_rate_limit_to_service.py | migrations/versions/0157_add_rate_limit_to_service.py | """
Revision ID: 0157_add_rate_limit_to_service
Revises: 0156_set_temp_letter_contact
Create Date: 2018-01-08 16:13:25.733336
"""
from alembic import op
import sqlalchemy as sa
revision = '0157_add_rate_limit_to_service'
down_revision = '0156_set_temp_letter_contact'
def upgrade():
op.add_column('services', s... | Add rate_limit column to service model | Add rate_limit column to service model
The API rate limit will be removed from the config and added to services
so that it is possible to change the rate_limit for individual services
in rare cases.
Pivotal story: https://www.pivotaltracker.com/story/show/153992529
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | Add rate_limit column to service model
The API rate limit will be removed from the config and added to services
so that it is possible to change the rate_limit for individual services
in rare cases.
Pivotal story: https://www.pivotaltracker.com/story/show/153992529 | """
Revision ID: 0157_add_rate_limit_to_service
Revises: 0156_set_temp_letter_contact
Create Date: 2018-01-08 16:13:25.733336
"""
from alembic import op
import sqlalchemy as sa
revision = '0157_add_rate_limit_to_service'
down_revision = '0156_set_temp_letter_contact'
def upgrade():
op.add_column('services', s... | <commit_before><commit_msg>Add rate_limit column to service model
The API rate limit will be removed from the config and added to services
so that it is possible to change the rate_limit for individual services
in rare cases.
Pivotal story: https://www.pivotaltracker.com/story/show/153992529<commit_after> | """
Revision ID: 0157_add_rate_limit_to_service
Revises: 0156_set_temp_letter_contact
Create Date: 2018-01-08 16:13:25.733336
"""
from alembic import op
import sqlalchemy as sa
revision = '0157_add_rate_limit_to_service'
down_revision = '0156_set_temp_letter_contact'
def upgrade():
op.add_column('services', s... | Add rate_limit column to service model
The API rate limit will be removed from the config and added to services
so that it is possible to change the rate_limit for individual services
in rare cases.
Pivotal story: https://www.pivotaltracker.com/story/show/153992529"""
Revision ID: 0157_add_rate_limit_to_service
Revi... | <commit_before><commit_msg>Add rate_limit column to service model
The API rate limit will be removed from the config and added to services
so that it is possible to change the rate_limit for individual services
in rare cases.
Pivotal story: https://www.pivotaltracker.com/story/show/153992529<commit_after>"""
Revisio... | |
02ca253332acacc95e94f0fced2d37c64d804c22 | kqueen_ui/generic_views.py | kqueen_ui/generic_views.py | from flask import flash, session
from flask.views import View
from kqueen_ui.api import get_kqueen_client, get_service_client
import logging
logger = logging.getLogger(__name__)
class KQueenView(View):
"""
KQueen UI base view with methods to handle backend API calls.
"""
def _get_kqueen_client(self)... | Add base class for KQueen UI views | Add base class for KQueen UI views
| Python | mit | atengler/kqueen-ui,atengler/kqueen-ui,atengler/kqueen-ui,atengler/kqueen-ui | Add base class for KQueen UI views | from flask import flash, session
from flask.views import View
from kqueen_ui.api import get_kqueen_client, get_service_client
import logging
logger = logging.getLogger(__name__)
class KQueenView(View):
"""
KQueen UI base view with methods to handle backend API calls.
"""
def _get_kqueen_client(self)... | <commit_before><commit_msg>Add base class for KQueen UI views<commit_after> | from flask import flash, session
from flask.views import View
from kqueen_ui.api import get_kqueen_client, get_service_client
import logging
logger = logging.getLogger(__name__)
class KQueenView(View):
"""
KQueen UI base view with methods to handle backend API calls.
"""
def _get_kqueen_client(self)... | Add base class for KQueen UI viewsfrom flask import flash, session
from flask.views import View
from kqueen_ui.api import get_kqueen_client, get_service_client
import logging
logger = logging.getLogger(__name__)
class KQueenView(View):
"""
KQueen UI base view with methods to handle backend API calls.
""... | <commit_before><commit_msg>Add base class for KQueen UI views<commit_after>from flask import flash, session
from flask.views import View
from kqueen_ui.api import get_kqueen_client, get_service_client
import logging
logger = logging.getLogger(__name__)
class KQueenView(View):
"""
KQueen UI base view with me... | |
b69462f1c671f84c379beca2eaf8b72386f4e2e4 | math/sum_of_digits/python/sum_of_digits.py | math/sum_of_digits/python/sum_of_digits.py | def sum_of_digits(n):
sum = 0;
for i in str(n):
sum += int(i)
return sum
print sum_of_digits(3) #3
print sum_of_digits(3454332) #24
| Implement Sum Of Digits in Python | Implement Sum Of Digits in Python
| Python | cc0-1.0 | ZoranPandovski/al-go-rithms,Deepak345/al-go-rithms,manikTharaka/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,manikTharaka/al-go-rithms,Cnidarias/al-go-rithms,ZoranPandovski/al-go-rithms,Deepak345/al-go-rithms,Cnidarias/al-go-rithms,ZoranPandovski/al-go-rithms,Deepak34... | Implement Sum Of Digits in Python | def sum_of_digits(n):
sum = 0;
for i in str(n):
sum += int(i)
return sum
print sum_of_digits(3) #3
print sum_of_digits(3454332) #24
| <commit_before><commit_msg>Implement Sum Of Digits in Python<commit_after> | def sum_of_digits(n):
sum = 0;
for i in str(n):
sum += int(i)
return sum
print sum_of_digits(3) #3
print sum_of_digits(3454332) #24
| Implement Sum Of Digits in Pythondef sum_of_digits(n):
sum = 0;
for i in str(n):
sum += int(i)
return sum
print sum_of_digits(3) #3
print sum_of_digits(3454332) #24
| <commit_before><commit_msg>Implement Sum Of Digits in Python<commit_after>def sum_of_digits(n):
sum = 0;
for i in str(n):
sum += int(i)
return sum
print sum_of_digits(3) #3
print sum_of_digits(3454332) #24
| |
4146e6cb20197ced3c5c62e9fc2ff7626920d6c0 | POST_TEST.py | POST_TEST.py | from posts.nc import *
import posts.iso
output('POST_TEST.txt')
program_begin(123, 'Test program')
absolute()
metric()
set_plane(0)
feedrate(420)
rapid(100,120)
rapid(z=50)
feed(z=0)
rapid(z=50)
rapid_home()
program_end()
| Test for ISO NC creator | Test for ISO NC creator
| Python | bsd-3-clause | silasb/heekscnc,silasb/heekscnc,silasb/heekscnc | Test for ISO NC creator | from posts.nc import *
import posts.iso
output('POST_TEST.txt')
program_begin(123, 'Test program')
absolute()
metric()
set_plane(0)
feedrate(420)
rapid(100,120)
rapid(z=50)
feed(z=0)
rapid(z=50)
rapid_home()
program_end()
| <commit_before><commit_msg>Test for ISO NC creator<commit_after> | from posts.nc import *
import posts.iso
output('POST_TEST.txt')
program_begin(123, 'Test program')
absolute()
metric()
set_plane(0)
feedrate(420)
rapid(100,120)
rapid(z=50)
feed(z=0)
rapid(z=50)
rapid_home()
program_end()
| Test for ISO NC creatorfrom posts.nc import *
import posts.iso
output('POST_TEST.txt')
program_begin(123, 'Test program')
absolute()
metric()
set_plane(0)
feedrate(420)
rapid(100,120)
rapid(z=50)
feed(z=0)
rapid(z=50)
rapid_home()
program_end()
| <commit_before><commit_msg>Test for ISO NC creator<commit_after>from posts.nc import *
import posts.iso
output('POST_TEST.txt')
program_begin(123, 'Test program')
absolute()
metric()
set_plane(0)
feedrate(420)
rapid(100,120)
rapid(z=50)
feed(z=0)
rapid(z=50)
rapid_home()
program_end()
| |
50b16f7e3996308ae720a3f186a7a3f8031c07a5 | split-hathitrust.py | split-hathitrust.py | import os
# Download up to date filelist
os.system("rsync -azv " +
"data.analytics.hathitrust.org::features/listing/htrc-ef-all-files.txt" +
" .")
# Load the file list
infile = open("htrc-ef-all-files.txt")
i = 0
j = 1
# Write out each set of 10000 files as their own list
curout = open("filelists... | Implement method for splitting files for batch processing | Implement method for splitting files for batch processing
| Python | mit | bacovcin/hathitrust-features-database,bacovcin/hathitrust-features-database,bacovcin/hathitrust-features-database | Implement method for splitting files for batch processing | import os
# Download up to date filelist
os.system("rsync -azv " +
"data.analytics.hathitrust.org::features/listing/htrc-ef-all-files.txt" +
" .")
# Load the file list
infile = open("htrc-ef-all-files.txt")
i = 0
j = 1
# Write out each set of 10000 files as their own list
curout = open("filelists... | <commit_before><commit_msg>Implement method for splitting files for batch processing<commit_after> | import os
# Download up to date filelist
os.system("rsync -azv " +
"data.analytics.hathitrust.org::features/listing/htrc-ef-all-files.txt" +
" .")
# Load the file list
infile = open("htrc-ef-all-files.txt")
i = 0
j = 1
# Write out each set of 10000 files as their own list
curout = open("filelists... | Implement method for splitting files for batch processingimport os
# Download up to date filelist
os.system("rsync -azv " +
"data.analytics.hathitrust.org::features/listing/htrc-ef-all-files.txt" +
" .")
# Load the file list
infile = open("htrc-ef-all-files.txt")
i = 0
j = 1
# Write out each set ... | <commit_before><commit_msg>Implement method for splitting files for batch processing<commit_after>import os
# Download up to date filelist
os.system("rsync -azv " +
"data.analytics.hathitrust.org::features/listing/htrc-ef-all-files.txt" +
" .")
# Load the file list
infile = open("htrc-ef-all-files... | |
344b6d4a9675aaf38d3cce97f18be0c365c4110c | db/goalie_game.py | db/goalie_game.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from .common import Base
class GoalieGame(Base):
__tablename__ = 'goalie_games'
__autoload__ = True
STANDARD_ATTRS = [
"position", "no", "goals", "assists", "primary_assists",
"secondary_assists", "points", "plus_minus", "penalties", "pim",
... | Add initial version of goalie game item | Add initial version of goalie game item
| Python | mit | leaffan/pynhldb | Add initial version of goalie game item | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from .common import Base
class GoalieGame(Base):
__tablename__ = 'goalie_games'
__autoload__ = True
STANDARD_ATTRS = [
"position", "no", "goals", "assists", "primary_assists",
"secondary_assists", "points", "plus_minus", "penalties", "pim",
... | <commit_before><commit_msg>Add initial version of goalie game item<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from .common import Base
class GoalieGame(Base):
__tablename__ = 'goalie_games'
__autoload__ = True
STANDARD_ATTRS = [
"position", "no", "goals", "assists", "primary_assists",
"secondary_assists", "points", "plus_minus", "penalties", "pim",
... | Add initial version of goalie game item#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .common import Base
class GoalieGame(Base):
__tablename__ = 'goalie_games'
__autoload__ = True
STANDARD_ATTRS = [
"position", "no", "goals", "assists", "primary_assists",
"secondary_assists", "point... | <commit_before><commit_msg>Add initial version of goalie game item<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .common import Base
class GoalieGame(Base):
__tablename__ = 'goalie_games'
__autoload__ = True
STANDARD_ATTRS = [
"position", "no", "goals", "assists", "primary_assi... | |
f02ff643e341f92d6e75ef79b42fcd2f15d05e8d | exp/influence2/GensimExp.py | exp/influence2/GensimExp.py | import gensim
import gensim.matutils
import logging
import sys
import numpy
import sklearn.feature_extraction.text as text
import scipy.sparse
from exp.util.PorterTokeniser import PorterTokeniser
from gensim.models.ldamodel import LdaModel
from exp.util.SparseUtils import SparseUtils
from apgl.data.Standardiser im... | Check we are using LDA correctly | Check we are using LDA correctly | Python | bsd-3-clause | charanpald/APGL | Check we are using LDA correctly | import gensim
import gensim.matutils
import logging
import sys
import numpy
import sklearn.feature_extraction.text as text
import scipy.sparse
from exp.util.PorterTokeniser import PorterTokeniser
from gensim.models.ldamodel import LdaModel
from exp.util.SparseUtils import SparseUtils
from apgl.data.Standardiser im... | <commit_before><commit_msg>Check we are using LDA correctly <commit_after> | import gensim
import gensim.matutils
import logging
import sys
import numpy
import sklearn.feature_extraction.text as text
import scipy.sparse
from exp.util.PorterTokeniser import PorterTokeniser
from gensim.models.ldamodel import LdaModel
from exp.util.SparseUtils import SparseUtils
from apgl.data.Standardiser im... | Check we are using LDA correctly import gensim
import gensim.matutils
import logging
import sys
import numpy
import sklearn.feature_extraction.text as text
import scipy.sparse
from exp.util.PorterTokeniser import PorterTokeniser
from gensim.models.ldamodel import LdaModel
from exp.util.SparseUtils import SparseUti... | <commit_before><commit_msg>Check we are using LDA correctly <commit_after>import gensim
import gensim.matutils
import logging
import sys
import numpy
import sklearn.feature_extraction.text as text
import scipy.sparse
from exp.util.PorterTokeniser import PorterTokeniser
from gensim.models.ldamodel import LdaModel
f... | |
97be289976d107f6ef72e797a67489319a980773 | steamweb/steamwebbrowsertk.py | steamweb/steamwebbrowsertk.py | from .steamwebbrowser import SteamWebBrowserCfg
from sys import version_info
from PIL.ImageTk import PhotoImage
if version_info.major >= 3: # Python3
import tkinter as tk
else: # Python 2
import Tkinter as tk
class SteamWebBrowserTk(SteamWebBrowserCfg):
''' SteamWebBrowserCfg with Tkinter UI for displaying... | Add Tkinter UI class from jbzdarkid | Add Tkinter UI class from jbzdarkid
| Python | agpl-3.0 | jayme-github/steamweb,jbzdarkid/steamweb | Add Tkinter UI class from jbzdarkid | from .steamwebbrowser import SteamWebBrowserCfg
from sys import version_info
from PIL.ImageTk import PhotoImage
if version_info.major >= 3: # Python3
import tkinter as tk
else: # Python 2
import Tkinter as tk
class SteamWebBrowserTk(SteamWebBrowserCfg):
''' SteamWebBrowserCfg with Tkinter UI for displaying... | <commit_before><commit_msg>Add Tkinter UI class from jbzdarkid<commit_after> | from .steamwebbrowser import SteamWebBrowserCfg
from sys import version_info
from PIL.ImageTk import PhotoImage
if version_info.major >= 3: # Python3
import tkinter as tk
else: # Python 2
import Tkinter as tk
class SteamWebBrowserTk(SteamWebBrowserCfg):
''' SteamWebBrowserCfg with Tkinter UI for displaying... | Add Tkinter UI class from jbzdarkidfrom .steamwebbrowser import SteamWebBrowserCfg
from sys import version_info
from PIL.ImageTk import PhotoImage
if version_info.major >= 3: # Python3
import tkinter as tk
else: # Python 2
import Tkinter as tk
class SteamWebBrowserTk(SteamWebBrowserCfg):
''' SteamWebBrowse... | <commit_before><commit_msg>Add Tkinter UI class from jbzdarkid<commit_after>from .steamwebbrowser import SteamWebBrowserCfg
from sys import version_info
from PIL.ImageTk import PhotoImage
if version_info.major >= 3: # Python3
import tkinter as tk
else: # Python 2
import Tkinter as tk
class SteamWebBrowserTk(St... | |
99454f1b62f1770e08c29db727d3b790787a6fa0 | pcloudpy/core/filters/DisplayNormals.py | pcloudpy/core/filters/DisplayNormals.py | from vtk import vtkArrowSource, vtkGlyph3D, vtkPolyData
from vtk import vtkRenderer, vtkRenderWindowInteractor, vtkPolyDataMapper, vtkActor, vtkRenderWindow
from .base import FilterBase
class DisplayNormals(FilterBase):
def __init__(self):
super(DisplayNormals, self).__init__()
def set_input(self, ... | Add Filter that display normal vector (it needs the pre-computed normal vectors) | Add Filter that display normal vector (it needs the pre-computed normal vectors)
| Python | bsd-3-clause | mmolero/pcloudpy | Add Filter that display normal vector (it needs the pre-computed normal vectors) | from vtk import vtkArrowSource, vtkGlyph3D, vtkPolyData
from vtk import vtkRenderer, vtkRenderWindowInteractor, vtkPolyDataMapper, vtkActor, vtkRenderWindow
from .base import FilterBase
class DisplayNormals(FilterBase):
def __init__(self):
super(DisplayNormals, self).__init__()
def set_input(self, ... | <commit_before><commit_msg>Add Filter that display normal vector (it needs the pre-computed normal vectors)<commit_after> | from vtk import vtkArrowSource, vtkGlyph3D, vtkPolyData
from vtk import vtkRenderer, vtkRenderWindowInteractor, vtkPolyDataMapper, vtkActor, vtkRenderWindow
from .base import FilterBase
class DisplayNormals(FilterBase):
def __init__(self):
super(DisplayNormals, self).__init__()
def set_input(self, ... | Add Filter that display normal vector (it needs the pre-computed normal vectors)from vtk import vtkArrowSource, vtkGlyph3D, vtkPolyData
from vtk import vtkRenderer, vtkRenderWindowInteractor, vtkPolyDataMapper, vtkActor, vtkRenderWindow
from .base import FilterBase
class DisplayNormals(FilterBase):
def __init__... | <commit_before><commit_msg>Add Filter that display normal vector (it needs the pre-computed normal vectors)<commit_after>from vtk import vtkArrowSource, vtkGlyph3D, vtkPolyData
from vtk import vtkRenderer, vtkRenderWindowInteractor, vtkPolyDataMapper, vtkActor, vtkRenderWindow
from .base import FilterBase
class Disp... | |
b16ac90d152bc4883162df235b837726c60ce94f | dacapo_analyzer.py | dacapo_analyzer.py | import re
BENCHMARKS = set(( 'avrora'
, 'batik'
, 'eclipse'
, 'fop'
, 'h2'
, 'jython'
, 'luindex'
, 'lusearch'
, 'pmd'
, 'sunflow'
... | Add basic dacapo wallclock analyzer. | [client] Add basic dacapo wallclock analyzer.
Signed-off-by: Michael Markert <5eb998b7ac86da375651a4cd767b88c9dad25896@googlemail.com>
| Python | mit | fhirschmann/penchy,fhirschmann/penchy | [client] Add basic dacapo wallclock analyzer.
Signed-off-by: Michael Markert <5eb998b7ac86da375651a4cd767b88c9dad25896@googlemail.com> | import re
BENCHMARKS = set(( 'avrora'
, 'batik'
, 'eclipse'
, 'fop'
, 'h2'
, 'jython'
, 'luindex'
, 'lusearch'
, 'pmd'
, 'sunflow'
... | <commit_before><commit_msg>[client] Add basic dacapo wallclock analyzer.
Signed-off-by: Michael Markert <5eb998b7ac86da375651a4cd767b88c9dad25896@googlemail.com><commit_after> | import re
BENCHMARKS = set(( 'avrora'
, 'batik'
, 'eclipse'
, 'fop'
, 'h2'
, 'jython'
, 'luindex'
, 'lusearch'
, 'pmd'
, 'sunflow'
... | [client] Add basic dacapo wallclock analyzer.
Signed-off-by: Michael Markert <5eb998b7ac86da375651a4cd767b88c9dad25896@googlemail.com>import re
BENCHMARKS = set(( 'avrora'
, 'batik'
, 'eclipse'
, 'fop'
, 'h2'
, 'jython'
... | <commit_before><commit_msg>[client] Add basic dacapo wallclock analyzer.
Signed-off-by: Michael Markert <5eb998b7ac86da375651a4cd767b88c9dad25896@googlemail.com><commit_after>import re
BENCHMARKS = set(( 'avrora'
, 'batik'
, 'eclipse'
, 'fop'
... | |
f0e180387a37437fe7e8d37fa2806e7d47736bfc | pyheufybot/bothandler.py | pyheufybot/bothandler.py | import os
from twisted.internet import reactor
from heufybot import HeufyBot, HeufyBotFactory
from config import Config
class BotHandler(object):
factories = {}
globalConfig = None
def __init__(self):
print "--- Loading configs..."
self.globalConfig = Config("globalconfig.yml")
sel... | import os
from twisted.internet import reactor
from heufybot import HeufyBot, HeufyBotFactory
from config import Config
class BotHandler(object):
factories = {}
globalConfig = None
def __init__(self):
print "--- Loading configs..."
self.globalConfig = Config("globalconfig.yml")
... | Make sure the application doesn't continue without a config | Make sure the application doesn't continue without a config
| Python | mit | Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot | import os
from twisted.internet import reactor
from heufybot import HeufyBot, HeufyBotFactory
from config import Config
class BotHandler(object):
factories = {}
globalConfig = None
def __init__(self):
print "--- Loading configs..."
self.globalConfig = Config("globalconfig.yml")
sel... | import os
from twisted.internet import reactor
from heufybot import HeufyBot, HeufyBotFactory
from config import Config
class BotHandler(object):
factories = {}
globalConfig = None
def __init__(self):
print "--- Loading configs..."
self.globalConfig = Config("globalconfig.yml")
... | <commit_before>import os
from twisted.internet import reactor
from heufybot import HeufyBot, HeufyBotFactory
from config import Config
class BotHandler(object):
factories = {}
globalConfig = None
def __init__(self):
print "--- Loading configs..."
self.globalConfig = Config("globalconfig.ym... | import os
from twisted.internet import reactor
from heufybot import HeufyBot, HeufyBotFactory
from config import Config
class BotHandler(object):
factories = {}
globalConfig = None
def __init__(self):
print "--- Loading configs..."
self.globalConfig = Config("globalconfig.yml")
... | import os
from twisted.internet import reactor
from heufybot import HeufyBot, HeufyBotFactory
from config import Config
class BotHandler(object):
factories = {}
globalConfig = None
def __init__(self):
print "--- Loading configs..."
self.globalConfig = Config("globalconfig.yml")
sel... | <commit_before>import os
from twisted.internet import reactor
from heufybot import HeufyBot, HeufyBotFactory
from config import Config
class BotHandler(object):
factories = {}
globalConfig = None
def __init__(self):
print "--- Loading configs..."
self.globalConfig = Config("globalconfig.ym... |
8fc31b8a5c36467ca44f88fedaf0e9f6b47bade9 | genealogio/migrations/0025_auto_20160316_2247.py | genealogio/migrations/0025_auto_20160316_2247.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('genealogio', '0024_auto_20160316_2039'),
]
operations = [
migrations.AlterModelOptions(
name='event',
... | Sort events by date, add missing migration | Sort events by date, add missing migration
| Python | bsd-3-clause | ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio | Sort events by date, add missing migration | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('genealogio', '0024_auto_20160316_2039'),
]
operations = [
migrations.AlterModelOptions(
name='event',
... | <commit_before><commit_msg>Sort events by date, add missing migration<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('genealogio', '0024_auto_20160316_2039'),
]
operations = [
migrations.AlterModelOptions(
name='event',
... | Sort events by date, add missing migration# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('genealogio', '0024_auto_20160316_2039'),
]
operations = [
migrations.AlterModelOpt... | <commit_before><commit_msg>Sort events by date, add missing migration<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('genealogio', '0024_auto_20160316_2039'),
]
operat... | |
a2708fcbf836c9ecb9efc546606ce6011a08f15a | firs_test_add_group.py | firs_test_add_group.py | # -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class firs_test_add_group(... | Add test by selenium builder | Add test by selenium builder
| Python | apache-2.0 | maximatorrus/automated_testing_python | Add test by selenium builder | # -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class firs_test_add_group(... | <commit_before><commit_msg>Add test by selenium builder<commit_after> | # -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class firs_test_add_group(... | Add test by selenium builder# -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False... | <commit_before><commit_msg>Add test by selenium builder<commit_after># -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
ret... | |
a387c0307f55d635d4a6064a3df2e77ecf9e1157 | st2common/tests/unit/test_util_types.py | st2common/tests/unit/test_util_types.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Add tests for OrderedSet type. | Add tests for OrderedSet type.
| Python | apache-2.0 | Plexxi/st2,StackStorm/st2,nzlosh/st2,nzlosh/st2,StackStorm/st2,Plexxi/st2,nzlosh/st2,StackStorm/st2,Plexxi/st2,StackStorm/st2,Plexxi/st2,nzlosh/st2 | Add tests for OrderedSet type. | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | <commit_before><commit_msg>Add tests for OrderedSet type.<commit_after> | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Add tests for OrderedSet type.# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the ... | <commit_before><commit_msg>Add tests for OrderedSet type.<commit_after># Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You unde... | |
906440692ae179c5ce4ee8211b13121e025c2651 | ideascube/conf/idb_de_dusseldorf.py | ideascube/conf/idb_de_dusseldorf.py | # -*- coding: utf-8 -*-
"""Ideaxbox for Welcome Point, Dusseldorf"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
IDEASCUBE_NAME = u"Welcome Point Dusseldorf"
IDEASCUBE_PLACE_NAME = _("city")
COUNTRIES_FIRST = ['DE']
TIME_ZONE = None
LANGUAGE_CODE = 'de'
LOAN_DURATION = 14
MONITOR... | Add conf file for Welcome Point Dusseldorf, DE | Add conf file for Welcome Point Dusseldorf, DE
| Python | agpl-3.0 | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | Add conf file for Welcome Point Dusseldorf, DE | # -*- coding: utf-8 -*-
"""Ideaxbox for Welcome Point, Dusseldorf"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
IDEASCUBE_NAME = u"Welcome Point Dusseldorf"
IDEASCUBE_PLACE_NAME = _("city")
COUNTRIES_FIRST = ['DE']
TIME_ZONE = None
LANGUAGE_CODE = 'de'
LOAN_DURATION = 14
MONITOR... | <commit_before><commit_msg>Add conf file for Welcome Point Dusseldorf, DE<commit_after> | # -*- coding: utf-8 -*-
"""Ideaxbox for Welcome Point, Dusseldorf"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
IDEASCUBE_NAME = u"Welcome Point Dusseldorf"
IDEASCUBE_PLACE_NAME = _("city")
COUNTRIES_FIRST = ['DE']
TIME_ZONE = None
LANGUAGE_CODE = 'de'
LOAN_DURATION = 14
MONITOR... | Add conf file for Welcome Point Dusseldorf, DE# -*- coding: utf-8 -*-
"""Ideaxbox for Welcome Point, Dusseldorf"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
IDEASCUBE_NAME = u"Welcome Point Dusseldorf"
IDEASCUBE_PLACE_NAME = _("city")
COUNTRIES_FIRST = ['DE']
TIME_ZONE = None
L... | <commit_before><commit_msg>Add conf file for Welcome Point Dusseldorf, DE<commit_after># -*- coding: utf-8 -*-
"""Ideaxbox for Welcome Point, Dusseldorf"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
IDEASCUBE_NAME = u"Welcome Point Dusseldorf"
IDEASCUBE_PLACE_NAME = _("city")
CO... | |
3849b0a5cae5ca7d214c864fa1722a9da98a3ec2 | indra/sources/minerva/id_mapping.py | indra/sources/minerva/id_mapping.py | from indra.databases import chebi_client
from indra.ontology.standardize import standardize_db_refs
minerva_to_indra_map = {
'UNIPROT': 'UP',
'REFSEQ': 'REFSEQ_PROT',
'ENTREZ': 'EGID',
'INTERPRO': 'IP',
}
def fix_id_standards(db_ns, db_id):
if db_ns == 'CHEBI':
if not db_id.startswith('C... | Move relevant parts of ID mapping from covid-19 | Move relevant parts of ID mapping from covid-19
| Python | bsd-2-clause | sorgerlab/belpy,sorgerlab/indra,bgyori/indra,bgyori/indra,johnbachman/indra,sorgerlab/belpy,sorgerlab/indra,sorgerlab/indra,johnbachman/indra,bgyori/indra,johnbachman/indra,sorgerlab/belpy | Move relevant parts of ID mapping from covid-19 | from indra.databases import chebi_client
from indra.ontology.standardize import standardize_db_refs
minerva_to_indra_map = {
'UNIPROT': 'UP',
'REFSEQ': 'REFSEQ_PROT',
'ENTREZ': 'EGID',
'INTERPRO': 'IP',
}
def fix_id_standards(db_ns, db_id):
if db_ns == 'CHEBI':
if not db_id.startswith('C... | <commit_before><commit_msg>Move relevant parts of ID mapping from covid-19<commit_after> | from indra.databases import chebi_client
from indra.ontology.standardize import standardize_db_refs
minerva_to_indra_map = {
'UNIPROT': 'UP',
'REFSEQ': 'REFSEQ_PROT',
'ENTREZ': 'EGID',
'INTERPRO': 'IP',
}
def fix_id_standards(db_ns, db_id):
if db_ns == 'CHEBI':
if not db_id.startswith('C... | Move relevant parts of ID mapping from covid-19from indra.databases import chebi_client
from indra.ontology.standardize import standardize_db_refs
minerva_to_indra_map = {
'UNIPROT': 'UP',
'REFSEQ': 'REFSEQ_PROT',
'ENTREZ': 'EGID',
'INTERPRO': 'IP',
}
def fix_id_standards(db_ns, db_id):
if db_ns... | <commit_before><commit_msg>Move relevant parts of ID mapping from covid-19<commit_after>from indra.databases import chebi_client
from indra.ontology.standardize import standardize_db_refs
minerva_to_indra_map = {
'UNIPROT': 'UP',
'REFSEQ': 'REFSEQ_PROT',
'ENTREZ': 'EGID',
'INTERPRO': 'IP',
}
def fix... | |
fa8099ebbf06fc45e62d8b1ed6a12b5a2405476c | stdnum/imo.py | stdnum/imo.py | # imo.py - functions for handling IMO numbers
# coding: utf-8
#
# Copyright (C) 2015 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, ... | Add int. maritime org. number (IMO) | Add int. maritime org. number (IMO)
This adds checks for the International Maritime Organization number used
to identify ships. However, there seem to be a lot of ships with an IMO
number that does not follow these rules (different check digits or even
length).
| Python | lgpl-2.1 | holvi/python-stdnum,holvi/python-stdnum,arthurdejong/python-stdnum,holvi/python-stdnum,arthurdejong/python-stdnum,arthurdejong/python-stdnum | Add int. maritime org. number (IMO)
This adds checks for the International Maritime Organization number used
to identify ships. However, there seem to be a lot of ships with an IMO
number that does not follow these rules (different check digits or even
length). | # imo.py - functions for handling IMO numbers
# coding: utf-8
#
# Copyright (C) 2015 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, ... | <commit_before><commit_msg>Add int. maritime org. number (IMO)
This adds checks for the International Maritime Organization number used
to identify ships. However, there seem to be a lot of ships with an IMO
number that does not follow these rules (different check digits or even
length).<commit_after> | # imo.py - functions for handling IMO numbers
# coding: utf-8
#
# Copyright (C) 2015 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, ... | Add int. maritime org. number (IMO)
This adds checks for the International Maritime Organization number used
to identify ships. However, there seem to be a lot of ships with an IMO
number that does not follow these rules (different check digits or even
length).# imo.py - functions for handling IMO numbers
# coding: ut... | <commit_before><commit_msg>Add int. maritime org. number (IMO)
This adds checks for the International Maritime Organization number used
to identify ships. However, there seem to be a lot of ships with an IMO
number that does not follow these rules (different check digits or even
length).<commit_after># imo.py - functi... | |
1965291f9e67b1b7923353f1b8892e0fabb543d4 | dyngraph/cycledetect_ui.py | dyngraph/cycledetect_ui.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\cycledetect.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8... | Add compiled cycle detect ui. | Add compiled cycle detect ui.
| Python | isc | jaj42/dyngraph,jaj42/GraPhysio,jaj42/GraPhysio | Add compiled cycle detect ui. | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\cycledetect.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8... | <commit_before><commit_msg>Add compiled cycle detect ui.<commit_after> | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\cycledetect.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8... | Add compiled cycle detect ui.# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\cycledetect.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attr... | <commit_before><commit_msg>Add compiled cycle detect ui.<commit_after># -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\cycledetect.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromU... | |
676fd73fa8c6b5a70e5caef6d6b195e4676a0a18 | tests/test_prefix_q_expression.py | tests/test_prefix_q_expression.py | from unittest import TestCase
from django.db.models import Q
from binder.views import prefix_q_expression
from binder.permissions.views import is_q_child_equal
from .testapp.models import Animal
class TestPrefixQExpression(TestCase):
def test_simple_prefix(self):
self.assertTrue(is_q_child_equal(
prefix_q_e... | Add tests for prefix Q expression | Add tests for prefix Q expression
| Python | mit | CodeYellowBV/django-binder | Add tests for prefix Q expression | from unittest import TestCase
from django.db.models import Q
from binder.views import prefix_q_expression
from binder.permissions.views import is_q_child_equal
from .testapp.models import Animal
class TestPrefixQExpression(TestCase):
def test_simple_prefix(self):
self.assertTrue(is_q_child_equal(
prefix_q_e... | <commit_before><commit_msg>Add tests for prefix Q expression<commit_after> | from unittest import TestCase
from django.db.models import Q
from binder.views import prefix_q_expression
from binder.permissions.views import is_q_child_equal
from .testapp.models import Animal
class TestPrefixQExpression(TestCase):
def test_simple_prefix(self):
self.assertTrue(is_q_child_equal(
prefix_q_e... | Add tests for prefix Q expressionfrom unittest import TestCase
from django.db.models import Q
from binder.views import prefix_q_expression
from binder.permissions.views import is_q_child_equal
from .testapp.models import Animal
class TestPrefixQExpression(TestCase):
def test_simple_prefix(self):
self.assertTru... | <commit_before><commit_msg>Add tests for prefix Q expression<commit_after>from unittest import TestCase
from django.db.models import Q
from binder.views import prefix_q_expression
from binder.permissions.views import is_q_child_equal
from .testapp.models import Animal
class TestPrefixQExpression(TestCase):
def t... | |
7389c85979127a48e0ce9b2f11e611c212a95524 | akhet/__init__.py | akhet/__init__.py | from akhet.static import add_static_route
def includeme(config):
"""Add certain useful methods to a Pyramid ``Configurator`` instance.
Currently this adds the ``.add_static_route()`` method. (See
``pyramid_sqla.static.add_static_route()``.)
"""
config.add_directive('add_static_route', add_static_r... | Add 'includeme' function. (Accidently put in SQLAHelper.) | Add 'includeme' function. (Accidently put in SQLAHelper.)
| Python | mit | Pylons/akhet,hlwsmith/akhet,hlwsmith/akhet,hlwsmith/akhet,Pylons/akhet | Add 'includeme' function. (Accidently put in SQLAHelper.) | from akhet.static import add_static_route
def includeme(config):
"""Add certain useful methods to a Pyramid ``Configurator`` instance.
Currently this adds the ``.add_static_route()`` method. (See
``pyramid_sqla.static.add_static_route()``.)
"""
config.add_directive('add_static_route', add_static_r... | <commit_before><commit_msg>Add 'includeme' function. (Accidently put in SQLAHelper.)<commit_after> | from akhet.static import add_static_route
def includeme(config):
"""Add certain useful methods to a Pyramid ``Configurator`` instance.
Currently this adds the ``.add_static_route()`` method. (See
``pyramid_sqla.static.add_static_route()``.)
"""
config.add_directive('add_static_route', add_static_r... | Add 'includeme' function. (Accidently put in SQLAHelper.)from akhet.static import add_static_route
def includeme(config):
"""Add certain useful methods to a Pyramid ``Configurator`` instance.
Currently this adds the ``.add_static_route()`` method. (See
``pyramid_sqla.static.add_static_route()``.)
"""
... | <commit_before><commit_msg>Add 'includeme' function. (Accidently put in SQLAHelper.)<commit_after>from akhet.static import add_static_route
def includeme(config):
"""Add certain useful methods to a Pyramid ``Configurator`` instance.
Currently this adds the ``.add_static_route()`` method. (See
``pyramid_sq... | |
a53cf07d2b6f246bae866210fef6ad9988bce885 | scripts/ttfaddemptyot.py | scripts/ttfaddemptyot.py | #!/usr/bin/python
from fontTools import ttLib
from fontTools.ttLib.tables import otTables
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('infont', help='Input font file')
parser.add_argument('outfont', help='Output font file')
parser.add_argument('-s','--script',default='DFLT', help... | Add a new fonttools based tool | Add a new fonttools based tool
| Python | mit | moyogo/pysilfont,moyogo/pysilfont | Add a new fonttools based tool | #!/usr/bin/python
from fontTools import ttLib
from fontTools.ttLib.tables import otTables
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('infont', help='Input font file')
parser.add_argument('outfont', help='Output font file')
parser.add_argument('-s','--script',default='DFLT', help... | <commit_before><commit_msg>Add a new fonttools based tool<commit_after> | #!/usr/bin/python
from fontTools import ttLib
from fontTools.ttLib.tables import otTables
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('infont', help='Input font file')
parser.add_argument('outfont', help='Output font file')
parser.add_argument('-s','--script',default='DFLT', help... | Add a new fonttools based tool#!/usr/bin/python
from fontTools import ttLib
from fontTools.ttLib.tables import otTables
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('infont', help='Input font file')
parser.add_argument('outfont', help='Output font file')
parser.add_argument('-s','... | <commit_before><commit_msg>Add a new fonttools based tool<commit_after>#!/usr/bin/python
from fontTools import ttLib
from fontTools.ttLib.tables import otTables
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('infont', help='Input font file')
parser.add_argument('outfont', help='Outp... | |
8718254272de33d77de03536b5fe26ad781b47b5 | astroid/tests/unittest_brain_numpy_core_fromnumeric.py | astroid/tests/unittest_brain_numpy_core_fromnumeric.py | # -*- encoding=utf-8 -*-
# Copyright (c) 2017-2018 hippo91 <guillaume.peillex@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
import unittest
import contextlib
try:
import numpy # pylint: d... | Add a unittest dedicated to the numpy_core_fromnumeric brain | Add a unittest dedicated to the numpy_core_fromnumeric brain
| Python | lgpl-2.1 | PyCQA/astroid | Add a unittest dedicated to the numpy_core_fromnumeric brain | # -*- encoding=utf-8 -*-
# Copyright (c) 2017-2018 hippo91 <guillaume.peillex@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
import unittest
import contextlib
try:
import numpy # pylint: d... | <commit_before><commit_msg>Add a unittest dedicated to the numpy_core_fromnumeric brain<commit_after> | # -*- encoding=utf-8 -*-
# Copyright (c) 2017-2018 hippo91 <guillaume.peillex@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
import unittest
import contextlib
try:
import numpy # pylint: d... | Add a unittest dedicated to the numpy_core_fromnumeric brain# -*- encoding=utf-8 -*-
# Copyright (c) 2017-2018 hippo91 <guillaume.peillex@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
import un... | <commit_before><commit_msg>Add a unittest dedicated to the numpy_core_fromnumeric brain<commit_after># -*- encoding=utf-8 -*-
# Copyright (c) 2017-2018 hippo91 <guillaume.peillex@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/ast... | |
33bc340a84b597ae649c1c394bda3978cae1f789 | tests/test__chrooting.py | tests/test__chrooting.py | import os
import platform
import tempfile
from .test_utils import EnvironmentTestCase
_EXPECTED_FILE_IN_MOUNT_NAME = "{mount_name}_file"
class ChrootingTestCase(EnvironmentTestCase):
def setUp(self):
super(ChrootingTestCase, self).setUp()
if os.getuid() != 0:
self.skipTest("Not root")
... | Add chrooting test (requires vagrant environment) | Add chrooting test (requires vagrant environment)
| Python | bsd-3-clause | vmalloc/dwight,vmalloc/dwight,vmalloc/dwight | Add chrooting test (requires vagrant environment) | import os
import platform
import tempfile
from .test_utils import EnvironmentTestCase
_EXPECTED_FILE_IN_MOUNT_NAME = "{mount_name}_file"
class ChrootingTestCase(EnvironmentTestCase):
def setUp(self):
super(ChrootingTestCase, self).setUp()
if os.getuid() != 0:
self.skipTest("Not root")
... | <commit_before><commit_msg>Add chrooting test (requires vagrant environment)<commit_after> | import os
import platform
import tempfile
from .test_utils import EnvironmentTestCase
_EXPECTED_FILE_IN_MOUNT_NAME = "{mount_name}_file"
class ChrootingTestCase(EnvironmentTestCase):
def setUp(self):
super(ChrootingTestCase, self).setUp()
if os.getuid() != 0:
self.skipTest("Not root")
... | Add chrooting test (requires vagrant environment)import os
import platform
import tempfile
from .test_utils import EnvironmentTestCase
_EXPECTED_FILE_IN_MOUNT_NAME = "{mount_name}_file"
class ChrootingTestCase(EnvironmentTestCase):
def setUp(self):
super(ChrootingTestCase, self).setUp()
if os.getu... | <commit_before><commit_msg>Add chrooting test (requires vagrant environment)<commit_after>import os
import platform
import tempfile
from .test_utils import EnvironmentTestCase
_EXPECTED_FILE_IN_MOUNT_NAME = "{mount_name}_file"
class ChrootingTestCase(EnvironmentTestCase):
def setUp(self):
super(ChrootingT... | |
14148af45fa9b6a0377df866e202edab561df12d | tests/api/tourney/match/comments/test_view_for_match_as_json.py | tests/api/tourney/match/comments/test_view_for_match_as_json.py | """
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import pytest
from byceps.services.tourney import match_comment_service, match_service
def test_view_for_match_as_json(api_client, api_client_authz_header, match, comment):
url = f'/api/tourney/matches/{match.id}... | Test tourney match comments retrieval as JSON | Test tourney match comments retrieval as JSON
| Python | bsd-3-clause | homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps | Test tourney match comments retrieval as JSON | """
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import pytest
from byceps.services.tourney import match_comment_service, match_service
def test_view_for_match_as_json(api_client, api_client_authz_header, match, comment):
url = f'/api/tourney/matches/{match.id}... | <commit_before><commit_msg>Test tourney match comments retrieval as JSON<commit_after> | """
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import pytest
from byceps.services.tourney import match_comment_service, match_service
def test_view_for_match_as_json(api_client, api_client_authz_header, match, comment):
url = f'/api/tourney/matches/{match.id}... | Test tourney match comments retrieval as JSON"""
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import pytest
from byceps.services.tourney import match_comment_service, match_service
def test_view_for_match_as_json(api_client, api_client_authz_header, match, comment)... | <commit_before><commit_msg>Test tourney match comments retrieval as JSON<commit_after>"""
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import pytest
from byceps.services.tourney import match_comment_service, match_service
def test_view_for_match_as_json(api_client,... | |
41b1d7e8d4f719b979cb60db9a4e840cb69ec6d0 | scripts/MammalSuperTree.py | scripts/MammalSuperTree.py | #retriever
from retriever.lib.templates import DownloadOnlyTemplate
SCRIPT = DownloadOnlyTemplate(name="Mammal Super Tree",
shortname='mammsupertree',
ref='http://doi.org/10.1111/j.1461-0248.2009.01307.x',
description="Mammal Sup... | Add a script to download the mammal super tree | Add a script to download the mammal super tree
| Python | mit | davharris/retriever,henrykironde/deletedret,goelakash/retriever,henrykironde/deletedret,bendmorris/retriever,davharris/retriever,bendmorris/retriever,davharris/retriever,bendmorris/retriever,embaldridge/retriever,embaldridge/retriever,embaldridge/retriever,goelakash/retriever | Add a script to download the mammal super tree | #retriever
from retriever.lib.templates import DownloadOnlyTemplate
SCRIPT = DownloadOnlyTemplate(name="Mammal Super Tree",
shortname='mammsupertree',
ref='http://doi.org/10.1111/j.1461-0248.2009.01307.x',
description="Mammal Sup... | <commit_before><commit_msg>Add a script to download the mammal super tree<commit_after> | #retriever
from retriever.lib.templates import DownloadOnlyTemplate
SCRIPT = DownloadOnlyTemplate(name="Mammal Super Tree",
shortname='mammsupertree',
ref='http://doi.org/10.1111/j.1461-0248.2009.01307.x',
description="Mammal Sup... | Add a script to download the mammal super tree#retriever
from retriever.lib.templates import DownloadOnlyTemplate
SCRIPT = DownloadOnlyTemplate(name="Mammal Super Tree",
shortname='mammsupertree',
ref='http://doi.org/10.1111/j.1461-0248.2009.01307.x',
... | <commit_before><commit_msg>Add a script to download the mammal super tree<commit_after>#retriever
from retriever.lib.templates import DownloadOnlyTemplate
SCRIPT = DownloadOnlyTemplate(name="Mammal Super Tree",
shortname='mammsupertree',
ref='http://doi.org/1... | |
c3cb492aed8140e3a58fb09212d236689a677437 | scripts/draw_square.ext.py | scripts/draw_square.ext.py | from nxt.motor import PORT_A, PORT_B, PORT_C
from .helpers.robot import Robot, SERVO_NICE
def main():
robot = Robot(debug=True, verbose=True)
# Motors
robot.init_synchronized_motors(PORT_A, PORT_C)
robot.init_servo(PORT_B)
robot.set_servo(SERVO_NICE)
sides = 4 # Spoiler alert! It's a square... | Add experimental version of 'Draw a square' :fire: | Add experimental version of 'Draw a square' :fire:
| Python | mit | richin13/nxt-scripts | Add experimental version of 'Draw a square' :fire: | from nxt.motor import PORT_A, PORT_B, PORT_C
from .helpers.robot import Robot, SERVO_NICE
def main():
robot = Robot(debug=True, verbose=True)
# Motors
robot.init_synchronized_motors(PORT_A, PORT_C)
robot.init_servo(PORT_B)
robot.set_servo(SERVO_NICE)
sides = 4 # Spoiler alert! It's a square... | <commit_before><commit_msg>Add experimental version of 'Draw a square' :fire:<commit_after> | from nxt.motor import PORT_A, PORT_B, PORT_C
from .helpers.robot import Robot, SERVO_NICE
def main():
robot = Robot(debug=True, verbose=True)
# Motors
robot.init_synchronized_motors(PORT_A, PORT_C)
robot.init_servo(PORT_B)
robot.set_servo(SERVO_NICE)
sides = 4 # Spoiler alert! It's a square... | Add experimental version of 'Draw a square' :fire:from nxt.motor import PORT_A, PORT_B, PORT_C
from .helpers.robot import Robot, SERVO_NICE
def main():
robot = Robot(debug=True, verbose=True)
# Motors
robot.init_synchronized_motors(PORT_A, PORT_C)
robot.init_servo(PORT_B)
robot.set_servo(SERVO_N... | <commit_before><commit_msg>Add experimental version of 'Draw a square' :fire:<commit_after>from nxt.motor import PORT_A, PORT_B, PORT_C
from .helpers.robot import Robot, SERVO_NICE
def main():
robot = Robot(debug=True, verbose=True)
# Motors
robot.init_synchronized_motors(PORT_A, PORT_C)
robot.init_s... | |
95a1c54cc728c11d693e19a70e0691c077251d2f | tests/quick_test.py | tests/quick_test.py | #!/usr/bin/env python3
import dirty_water
rxn = dirty_water.Reaction()
rxn.num_reactions = 10
rxn['Cas9'].std_volume = 1, 'μL'
rxn['Cas9'].std_stock_conc = 20, 'μM'
rxn['Cas9'].master_mix = True
rxn['Cas9'].conc = 4
rxn['buffer'].std_volume = 1, 'μL'
rxn['buffer'].std_stock_conc = '10x'
rxn['buffer'].master_mix = T... | Add a very weak test of the Reaction API. | Add a very weak test of the Reaction API.
| Python | mit | kalekundert/dirty_water | Add a very weak test of the Reaction API. | #!/usr/bin/env python3
import dirty_water
rxn = dirty_water.Reaction()
rxn.num_reactions = 10
rxn['Cas9'].std_volume = 1, 'μL'
rxn['Cas9'].std_stock_conc = 20, 'μM'
rxn['Cas9'].master_mix = True
rxn['Cas9'].conc = 4
rxn['buffer'].std_volume = 1, 'μL'
rxn['buffer'].std_stock_conc = '10x'
rxn['buffer'].master_mix = T... | <commit_before><commit_msg>Add a very weak test of the Reaction API.<commit_after> | #!/usr/bin/env python3
import dirty_water
rxn = dirty_water.Reaction()
rxn.num_reactions = 10
rxn['Cas9'].std_volume = 1, 'μL'
rxn['Cas9'].std_stock_conc = 20, 'μM'
rxn['Cas9'].master_mix = True
rxn['Cas9'].conc = 4
rxn['buffer'].std_volume = 1, 'μL'
rxn['buffer'].std_stock_conc = '10x'
rxn['buffer'].master_mix = T... | Add a very weak test of the Reaction API.#!/usr/bin/env python3
import dirty_water
rxn = dirty_water.Reaction()
rxn.num_reactions = 10
rxn['Cas9'].std_volume = 1, 'μL'
rxn['Cas9'].std_stock_conc = 20, 'μM'
rxn['Cas9'].master_mix = True
rxn['Cas9'].conc = 4
rxn['buffer'].std_volume = 1, 'μL'
rxn['buffer'].std_stock_... | <commit_before><commit_msg>Add a very weak test of the Reaction API.<commit_after>#!/usr/bin/env python3
import dirty_water
rxn = dirty_water.Reaction()
rxn.num_reactions = 10
rxn['Cas9'].std_volume = 1, 'μL'
rxn['Cas9'].std_stock_conc = 20, 'μM'
rxn['Cas9'].master_mix = True
rxn['Cas9'].conc = 4
rxn['buffer'].std_... | |
5d1b7b38b70dfa17bc7c468fb49e3e576c9accc0 | tests/range_test.py | tests/range_test.py | """Tests for the range class."""
from sympy import sympify
from drudge import Range
def test_range_has_basic_operations():
"""Test the basic operations on ranges."""
a_symb = sympify('a')
b_symb = sympify('b')
bound0 = Range('B', 'a', 'b')
bound1 = Range('B', a_symb, b_symb)
symb0 = Range(... | Add tests for the symbolic ranges | Add tests for the symbolic ranges
| Python | mit | tschijnmo/drudge,tschijnmo/drudge,tschijnmo/drudge | Add tests for the symbolic ranges | """Tests for the range class."""
from sympy import sympify
from drudge import Range
def test_range_has_basic_operations():
"""Test the basic operations on ranges."""
a_symb = sympify('a')
b_symb = sympify('b')
bound0 = Range('B', 'a', 'b')
bound1 = Range('B', a_symb, b_symb)
symb0 = Range(... | <commit_before><commit_msg>Add tests for the symbolic ranges<commit_after> | """Tests for the range class."""
from sympy import sympify
from drudge import Range
def test_range_has_basic_operations():
"""Test the basic operations on ranges."""
a_symb = sympify('a')
b_symb = sympify('b')
bound0 = Range('B', 'a', 'b')
bound1 = Range('B', a_symb, b_symb)
symb0 = Range(... | Add tests for the symbolic ranges"""Tests for the range class."""
from sympy import sympify
from drudge import Range
def test_range_has_basic_operations():
"""Test the basic operations on ranges."""
a_symb = sympify('a')
b_symb = sympify('b')
bound0 = Range('B', 'a', 'b')
bound1 = Range('B', a... | <commit_before><commit_msg>Add tests for the symbolic ranges<commit_after>"""Tests for the range class."""
from sympy import sympify
from drudge import Range
def test_range_has_basic_operations():
"""Test the basic operations on ranges."""
a_symb = sympify('a')
b_symb = sympify('b')
bound0 = Range... | |
32f3a42c04a1ae8729e08bf7ce67a1f01f7ac2b3 | lib/receiving_widget.py | lib/receiving_widget.py | from PyQt4.QtGui import *
from PyQt4.QtCore import *
from i18n import _
class ReceivingWidget(QTreeWidget):
def toggle_used(self):
if self.hide_used:
self.hide_used = False
self.setColumnHidden(2, False)
else:
self.hide_used = True
self.setColumnHidd... | Add receiving widget for lite gui | Add receiving widget for lite gui
| Python | mit | molecular/electrum,cryptapus/electrum-uno,pknight007/electrum-vtc,cryptapus/electrum-myr,molecular/electrum,cryptapus/electrum-uno,dashpay/electrum-dash,lbryio/lbryum,dabura667/electrum,procrasti/electrum,digitalbitbox/electrum,wakiyamap/electrum-mona,cryptapus/electrum-myr,kyuupichan/electrum,neocogent/electrum,spesmi... | Add receiving widget for lite gui | from PyQt4.QtGui import *
from PyQt4.QtCore import *
from i18n import _
class ReceivingWidget(QTreeWidget):
def toggle_used(self):
if self.hide_used:
self.hide_used = False
self.setColumnHidden(2, False)
else:
self.hide_used = True
self.setColumnHidd... | <commit_before><commit_msg>Add receiving widget for lite gui<commit_after> | from PyQt4.QtGui import *
from PyQt4.QtCore import *
from i18n import _
class ReceivingWidget(QTreeWidget):
def toggle_used(self):
if self.hide_used:
self.hide_used = False
self.setColumnHidden(2, False)
else:
self.hide_used = True
self.setColumnHidd... | Add receiving widget for lite guifrom PyQt4.QtGui import *
from PyQt4.QtCore import *
from i18n import _
class ReceivingWidget(QTreeWidget):
def toggle_used(self):
if self.hide_used:
self.hide_used = False
self.setColumnHidden(2, False)
else:
self.hide_used = Tr... | <commit_before><commit_msg>Add receiving widget for lite gui<commit_after>from PyQt4.QtGui import *
from PyQt4.QtCore import *
from i18n import _
class ReceivingWidget(QTreeWidget):
def toggle_used(self):
if self.hide_used:
self.hide_used = False
self.setColumnHidden(2, False)
... | |
36efa6e2615bdd600d80cc87ada27984c9806135 | articles/search_indexes.py | articles/search_indexes.py | from haystack.indexes import *
from haystack import site
from models import Article
class ArticleIndex(SearchIndex):
name = CharField(model_attr='title')
text = CharField(document=True, use_template=True)
def get_queryset(self):
"""Used when the entire index for model is updated."""
return... | Add search index file - currently search across Articles, extend to search across Categories? | Add search index file - currently search across Articles, extend to search across Categories?
| Python | bsd-2-clause | incuna/feincms-articles,michaelkuty/feincms-articles,incuna/feincms-articles,michaelkuty/feincms-articles | Add search index file - currently search across Articles, extend to search across Categories? | from haystack.indexes import *
from haystack import site
from models import Article
class ArticleIndex(SearchIndex):
name = CharField(model_attr='title')
text = CharField(document=True, use_template=True)
def get_queryset(self):
"""Used when the entire index for model is updated."""
return... | <commit_before><commit_msg>Add search index file - currently search across Articles, extend to search across Categories?<commit_after> | from haystack.indexes import *
from haystack import site
from models import Article
class ArticleIndex(SearchIndex):
name = CharField(model_attr='title')
text = CharField(document=True, use_template=True)
def get_queryset(self):
"""Used when the entire index for model is updated."""
return... | Add search index file - currently search across Articles, extend to search across Categories?from haystack.indexes import *
from haystack import site
from models import Article
class ArticleIndex(SearchIndex):
name = CharField(model_attr='title')
text = CharField(document=True, use_template=True)
def get_... | <commit_before><commit_msg>Add search index file - currently search across Articles, extend to search across Categories?<commit_after>from haystack.indexes import *
from haystack import site
from models import Article
class ArticleIndex(SearchIndex):
name = CharField(model_attr='title')
text = CharField(docume... | |
b2bc2f08d69ea42f9cecf6f994b1ed3c8e9f8022 | py/minimum-number-of-arrows-to-burst-balloons.py | py/minimum-number-of-arrows-to-burst-balloons.py | from operator import itemgetter
class Solution(object):
def findMinArrowShots(self, points):
"""
:type points: List[List[int]]
:rtype: int
"""
points.sort(key=itemgetter(1))
end = None
ans = 0
for p in points:
if end is None or end < p[0]:
... | Add py solution for 452. Minimum Number of Arrows to Burst Balloons | Add py solution for 452. Minimum Number of Arrows to Burst Balloons
452. Minimum Number of Arrows to Burst Balloons: https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 452. Minimum Number of Arrows to Burst Balloons
452. Minimum Number of Arrows to Burst Balloons: https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/ | from operator import itemgetter
class Solution(object):
def findMinArrowShots(self, points):
"""
:type points: List[List[int]]
:rtype: int
"""
points.sort(key=itemgetter(1))
end = None
ans = 0
for p in points:
if end is None or end < p[0]:
... | <commit_before><commit_msg>Add py solution for 452. Minimum Number of Arrows to Burst Balloons
452. Minimum Number of Arrows to Burst Balloons: https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/<commit_after> | from operator import itemgetter
class Solution(object):
def findMinArrowShots(self, points):
"""
:type points: List[List[int]]
:rtype: int
"""
points.sort(key=itemgetter(1))
end = None
ans = 0
for p in points:
if end is None or end < p[0]:
... | Add py solution for 452. Minimum Number of Arrows to Burst Balloons
452. Minimum Number of Arrows to Burst Balloons: https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/from operator import itemgetter
class Solution(object):
def findMinArrowShots(self, points):
"""
:type points... | <commit_before><commit_msg>Add py solution for 452. Minimum Number of Arrows to Burst Balloons
452. Minimum Number of Arrows to Burst Balloons: https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/<commit_after>from operator import itemgetter
class Solution(object):
def findMinArrowShots(self, ... | |
1360b8c4f6422dc8149ba40bb9a0717e796049e0 | tests/test_posix.py | tests/test_posix.py |
import sys
import nose.tools
from simuvex import SimState
def test_file_create():
# Create a state first
state = SimState(arch="AMD64", mode='symbolic')
# Create a file
fd = state.posix.open("test", "wb")
nose.tools.assert_equal(fd, 3)
def test_file_read():
state = SimState(arch="AMD64", ... | Add a very simple test case for posix file support. | Add a very simple test case for posix file support.
| Python | bsd-2-clause | angr/angr,f-prettyland/angr,axt/angr,schieb/angr,schieb/angr,chubbymaggie/angr,iamahuman/angr,tyb0807/angr,axt/angr,chubbymaggie/simuvex,schieb/angr,angr/angr,chubbymaggie/simuvex,tyb0807/angr,angr/angr,chubbymaggie/simuvex,f-prettyland/angr,f-prettyland/angr,axt/angr,angr/simuvex,chubbymaggie/angr,iamahuman/angr,iamah... | Add a very simple test case for posix file support. |
import sys
import nose.tools
from simuvex import SimState
def test_file_create():
# Create a state first
state = SimState(arch="AMD64", mode='symbolic')
# Create a file
fd = state.posix.open("test", "wb")
nose.tools.assert_equal(fd, 3)
def test_file_read():
state = SimState(arch="AMD64", ... | <commit_before><commit_msg>Add a very simple test case for posix file support.<commit_after> |
import sys
import nose.tools
from simuvex import SimState
def test_file_create():
# Create a state first
state = SimState(arch="AMD64", mode='symbolic')
# Create a file
fd = state.posix.open("test", "wb")
nose.tools.assert_equal(fd, 3)
def test_file_read():
state = SimState(arch="AMD64", ... | Add a very simple test case for posix file support.
import sys
import nose.tools
from simuvex import SimState
def test_file_create():
# Create a state first
state = SimState(arch="AMD64", mode='symbolic')
# Create a file
fd = state.posix.open("test", "wb")
nose.tools.assert_equal(fd, 3)
def te... | <commit_before><commit_msg>Add a very simple test case for posix file support.<commit_after>
import sys
import nose.tools
from simuvex import SimState
def test_file_create():
# Create a state first
state = SimState(arch="AMD64", mode='symbolic')
# Create a file
fd = state.posix.open("test", "wb")
... | |
328c373495e94005a97a907ac023cb52bc47e20c | find_dups.py | find_dups.py | import sys, os, urllib, StringIO, traceback, cgi, binascii, getopt
import store, config
try:
config = config.Config(sys.argv[1], 'webui')
except IndexError:
print "Usage: find_dups.py config.ini"
raise SystemExit
store = store.Store(config)
store.open()
def owner_email(p):
result = set()
for r,u ... | Add script to email users of name-conflicting packages. | Add script to email users of name-conflicting packages.
git-svn-id: 757818eefc3e095bf4f5c16d67ad3f55b5150c3d@532 072f9a9a-8cf7-0310-8ca5-bf92c90cb7c1
| Python | bsd-3-clause | ericholscher/pypi,ericholscher/pypi | Add script to email users of name-conflicting packages.
git-svn-id: 757818eefc3e095bf4f5c16d67ad3f55b5150c3d@532 072f9a9a-8cf7-0310-8ca5-bf92c90cb7c1 | import sys, os, urllib, StringIO, traceback, cgi, binascii, getopt
import store, config
try:
config = config.Config(sys.argv[1], 'webui')
except IndexError:
print "Usage: find_dups.py config.ini"
raise SystemExit
store = store.Store(config)
store.open()
def owner_email(p):
result = set()
for r,u ... | <commit_before><commit_msg>Add script to email users of name-conflicting packages.
git-svn-id: 757818eefc3e095bf4f5c16d67ad3f55b5150c3d@532 072f9a9a-8cf7-0310-8ca5-bf92c90cb7c1<commit_after> | import sys, os, urllib, StringIO, traceback, cgi, binascii, getopt
import store, config
try:
config = config.Config(sys.argv[1], 'webui')
except IndexError:
print "Usage: find_dups.py config.ini"
raise SystemExit
store = store.Store(config)
store.open()
def owner_email(p):
result = set()
for r,u ... | Add script to email users of name-conflicting packages.
git-svn-id: 757818eefc3e095bf4f5c16d67ad3f55b5150c3d@532 072f9a9a-8cf7-0310-8ca5-bf92c90cb7c1import sys, os, urllib, StringIO, traceback, cgi, binascii, getopt
import store, config
try:
config = config.Config(sys.argv[1], 'webui')
except IndexError:
pri... | <commit_before><commit_msg>Add script to email users of name-conflicting packages.
git-svn-id: 757818eefc3e095bf4f5c16d67ad3f55b5150c3d@532 072f9a9a-8cf7-0310-8ca5-bf92c90cb7c1<commit_after>import sys, os, urllib, StringIO, traceback, cgi, binascii, getopt
import store, config
try:
config = config.Config(sys.arg... | |
c6928a6070aaf0fadfb1d9f4071a8440224a247a | tests/printInput.py | tests/printInput.py | #!/usr/bin/env python3
import sys
if len(sys.argv) != 2:
sys.exit("Usage:\n\t%s <testcase>" % (sys.argv[0],))
testcase = sys.argv[1]
exec(open(testcase).read())
for i in ['input']:
if i not in locals():
sys.exit("Testcase %s does not provide variable '%s'" % (testcase, i))
print(input)
| Add script to extract input from testcases. | Add script to extract input from testcases.
| Python | apache-2.0 | alviano/wasp,alviano/wasp,alviano/wasp,Yarrick13/hwasp,gaste/dwasp,gaste/dwasp,Yarrick13/hwasp,gaste/dwasp,Yarrick13/hwasp | Add script to extract input from testcases. | #!/usr/bin/env python3
import sys
if len(sys.argv) != 2:
sys.exit("Usage:\n\t%s <testcase>" % (sys.argv[0],))
testcase = sys.argv[1]
exec(open(testcase).read())
for i in ['input']:
if i not in locals():
sys.exit("Testcase %s does not provide variable '%s'" % (testcase, i))
print(input)
| <commit_before><commit_msg>Add script to extract input from testcases.<commit_after> | #!/usr/bin/env python3
import sys
if len(sys.argv) != 2:
sys.exit("Usage:\n\t%s <testcase>" % (sys.argv[0],))
testcase = sys.argv[1]
exec(open(testcase).read())
for i in ['input']:
if i not in locals():
sys.exit("Testcase %s does not provide variable '%s'" % (testcase, i))
print(input)
| Add script to extract input from testcases.#!/usr/bin/env python3
import sys
if len(sys.argv) != 2:
sys.exit("Usage:\n\t%s <testcase>" % (sys.argv[0],))
testcase = sys.argv[1]
exec(open(testcase).read())
for i in ['input']:
if i not in locals():
sys.exit("Testcase %s does not provide variable '%s'" ... | <commit_before><commit_msg>Add script to extract input from testcases.<commit_after>#!/usr/bin/env python3
import sys
if len(sys.argv) != 2:
sys.exit("Usage:\n\t%s <testcase>" % (sys.argv[0],))
testcase = sys.argv[1]
exec(open(testcase).read())
for i in ['input']:
if i not in locals():
sys.exit("Tes... | |
ff179b6215366676d92d39f255682781fe6b40eb | oscarapi/tests/testvoucher.py | oscarapi/tests/testvoucher.py | from django.utils import timezone
from oscar.core.loading import get_model
from oscarapi.tests.utils import APITest
Basket = get_model('basket', 'Basket')
ConditionalOffer = get_model('offer', 'ConditionalOffer')
Voucher = get_model('voucher', 'Voucher')
class VoucherTest(APITest):
fixtures = [
'produ... | Add a test for the api-basket-add-voucher view | Add a test for the api-basket-add-voucher view
| Python | bsd-3-clause | regulusweb/django-oscar-api,crgwbr/django-oscar-api | Add a test for the api-basket-add-voucher view | from django.utils import timezone
from oscar.core.loading import get_model
from oscarapi.tests.utils import APITest
Basket = get_model('basket', 'Basket')
ConditionalOffer = get_model('offer', 'ConditionalOffer')
Voucher = get_model('voucher', 'Voucher')
class VoucherTest(APITest):
fixtures = [
'produ... | <commit_before><commit_msg>Add a test for the api-basket-add-voucher view<commit_after> | from django.utils import timezone
from oscar.core.loading import get_model
from oscarapi.tests.utils import APITest
Basket = get_model('basket', 'Basket')
ConditionalOffer = get_model('offer', 'ConditionalOffer')
Voucher = get_model('voucher', 'Voucher')
class VoucherTest(APITest):
fixtures = [
'produ... | Add a test for the api-basket-add-voucher viewfrom django.utils import timezone
from oscar.core.loading import get_model
from oscarapi.tests.utils import APITest
Basket = get_model('basket', 'Basket')
ConditionalOffer = get_model('offer', 'ConditionalOffer')
Voucher = get_model('voucher', 'Voucher')
class Voucher... | <commit_before><commit_msg>Add a test for the api-basket-add-voucher view<commit_after>from django.utils import timezone
from oscar.core.loading import get_model
from oscarapi.tests.utils import APITest
Basket = get_model('basket', 'Basket')
ConditionalOffer = get_model('offer', 'ConditionalOffer')
Voucher = get_mo... | |
dbaccbddfe36c32444c61df5ac6ffd238d3d022b | py/longest-word-in-dictionary.py | py/longest-word-in-dictionary.py | class Solution(object):
def longestWord(self, words):
"""
:type words: List[str]
:rtype: str
"""
words = sorted(words, key=lambda w:(len(w), w))
prefix_dict = set()
max_word = ''
for w in words:
if len(w) == 1 or w[:-1] in prefix_dict:
... | Add py solution for 720. Longest Word in Dictionary | Add py solution for 720. Longest Word in Dictionary
720. Longest Word in Dictionary: https://leetcode.com/problems/longest-word-in-dictionary/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 720. Longest Word in Dictionary
720. Longest Word in Dictionary: https://leetcode.com/problems/longest-word-in-dictionary/ | class Solution(object):
def longestWord(self, words):
"""
:type words: List[str]
:rtype: str
"""
words = sorted(words, key=lambda w:(len(w), w))
prefix_dict = set()
max_word = ''
for w in words:
if len(w) == 1 or w[:-1] in prefix_dict:
... | <commit_before><commit_msg>Add py solution for 720. Longest Word in Dictionary
720. Longest Word in Dictionary: https://leetcode.com/problems/longest-word-in-dictionary/<commit_after> | class Solution(object):
def longestWord(self, words):
"""
:type words: List[str]
:rtype: str
"""
words = sorted(words, key=lambda w:(len(w), w))
prefix_dict = set()
max_word = ''
for w in words:
if len(w) == 1 or w[:-1] in prefix_dict:
... | Add py solution for 720. Longest Word in Dictionary
720. Longest Word in Dictionary: https://leetcode.com/problems/longest-word-in-dictionary/class Solution(object):
def longestWord(self, words):
"""
:type words: List[str]
:rtype: str
"""
words = sorted(words, key=lambda w:(... | <commit_before><commit_msg>Add py solution for 720. Longest Word in Dictionary
720. Longest Word in Dictionary: https://leetcode.com/problems/longest-word-in-dictionary/<commit_after>class Solution(object):
def longestWord(self, words):
"""
:type words: List[str]
:rtype: str
"""
... | |
e7be538e04e775ad63d0e7c54d7bea6b902e09fb | elo.py | elo.py | ##
# elo.py
# provides implementation of ELO algorithm to determine
# change in fitness given a malicious act of nature.
##
K_FACTOR = 50 # weighting factor. The larger the more significant a match
# ^ in chess it's usually 15-16 for grandmasters and 32 for weak players
BETA = 400
class ResultType:
WIN = 1
L... | Add ELO algorithm code, with small tests. | Add ELO algorithm code, with small tests.
| Python | mit | anishathalye/evolution-chamber,anishathalye/evolution-chamber,techx/hackmit-evolution-chamber,anishathalye/evolution-chamber,anishathalye/evolution-chamber,techx/hackmit-evolution-chamber,techx/hackmit-evolution-chamber,techx/hackmit-evolution-chamber | Add ELO algorithm code, with small tests. | ##
# elo.py
# provides implementation of ELO algorithm to determine
# change in fitness given a malicious act of nature.
##
K_FACTOR = 50 # weighting factor. The larger the more significant a match
# ^ in chess it's usually 15-16 for grandmasters and 32 for weak players
BETA = 400
class ResultType:
WIN = 1
L... | <commit_before><commit_msg>Add ELO algorithm code, with small tests.<commit_after> | ##
# elo.py
# provides implementation of ELO algorithm to determine
# change in fitness given a malicious act of nature.
##
K_FACTOR = 50 # weighting factor. The larger the more significant a match
# ^ in chess it's usually 15-16 for grandmasters and 32 for weak players
BETA = 400
class ResultType:
WIN = 1
L... | Add ELO algorithm code, with small tests.##
# elo.py
# provides implementation of ELO algorithm to determine
# change in fitness given a malicious act of nature.
##
K_FACTOR = 50 # weighting factor. The larger the more significant a match
# ^ in chess it's usually 15-16 for grandmasters and 32 for weak players
BETA =... | <commit_before><commit_msg>Add ELO algorithm code, with small tests.<commit_after>##
# elo.py
# provides implementation of ELO algorithm to determine
# change in fitness given a malicious act of nature.
##
K_FACTOR = 50 # weighting factor. The larger the more significant a match
# ^ in chess it's usually 15-16 for gr... | |
4c1953e570a15661cffa68c151e00bbc6345ad8d | ipaqe_provision_hosts/backend/loader.py | ipaqe_provision_hosts/backend/loader.py | # Author: Milan Kubik, 2017
import logging
from pkg_resources import iter_entry_points
RESOURCE_GROUP = "ipaqe_provision_hosts.backends"
log = logging.getLogger(__name__)
def load_backends(exclude=()):
log.debug("Loading entry points from %s.", RESOURCE_GROUP)
entry_points = {
ep.name: ep.load() f... | Add basic backend loading function | Add basic backend loading function
| Python | mit | apophys/ipaqe-provision-hosts | Add basic backend loading function | # Author: Milan Kubik, 2017
import logging
from pkg_resources import iter_entry_points
RESOURCE_GROUP = "ipaqe_provision_hosts.backends"
log = logging.getLogger(__name__)
def load_backends(exclude=()):
log.debug("Loading entry points from %s.", RESOURCE_GROUP)
entry_points = {
ep.name: ep.load() f... | <commit_before><commit_msg>Add basic backend loading function<commit_after> | # Author: Milan Kubik, 2017
import logging
from pkg_resources import iter_entry_points
RESOURCE_GROUP = "ipaqe_provision_hosts.backends"
log = logging.getLogger(__name__)
def load_backends(exclude=()):
log.debug("Loading entry points from %s.", RESOURCE_GROUP)
entry_points = {
ep.name: ep.load() f... | Add basic backend loading function# Author: Milan Kubik, 2017
import logging
from pkg_resources import iter_entry_points
RESOURCE_GROUP = "ipaqe_provision_hosts.backends"
log = logging.getLogger(__name__)
def load_backends(exclude=()):
log.debug("Loading entry points from %s.", RESOURCE_GROUP)
entry_point... | <commit_before><commit_msg>Add basic backend loading function<commit_after># Author: Milan Kubik, 2017
import logging
from pkg_resources import iter_entry_points
RESOURCE_GROUP = "ipaqe_provision_hosts.backends"
log = logging.getLogger(__name__)
def load_backends(exclude=()):
log.debug("Loading entry points f... | |
cfc471de36961ff90a2131100fa7a87da69c656b | Motors/motorTest.py | Motors/motorTest.py | #!/usr/bin/env python
# -*- coding: utf8 -*-
#
# Copyright (c) 2013 Nautilabs
#
# Licensed under the MIT License,
# https://github.com/baptistelabat/robokite
# Authors: Baptiste LABAT
import time
import serial
import numpy as np
def computeXORChecksum(chksumdata):
# Inspired from http://doschman.blogspot.fr/2013/01/c... | Add a script to check motor (and communication!) | Add a script to check motor (and communication!)
| Python | mit | baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite | Add a script to check motor (and communication!) | #!/usr/bin/env python
# -*- coding: utf8 -*-
#
# Copyright (c) 2013 Nautilabs
#
# Licensed under the MIT License,
# https://github.com/baptistelabat/robokite
# Authors: Baptiste LABAT
import time
import serial
import numpy as np
def computeXORChecksum(chksumdata):
# Inspired from http://doschman.blogspot.fr/2013/01/c... | <commit_before><commit_msg>Add a script to check motor (and communication!)<commit_after> | #!/usr/bin/env python
# -*- coding: utf8 -*-
#
# Copyright (c) 2013 Nautilabs
#
# Licensed under the MIT License,
# https://github.com/baptistelabat/robokite
# Authors: Baptiste LABAT
import time
import serial
import numpy as np
def computeXORChecksum(chksumdata):
# Inspired from http://doschman.blogspot.fr/2013/01/c... | Add a script to check motor (and communication!)#!/usr/bin/env python
# -*- coding: utf8 -*-
#
# Copyright (c) 2013 Nautilabs
#
# Licensed under the MIT License,
# https://github.com/baptistelabat/robokite
# Authors: Baptiste LABAT
import time
import serial
import numpy as np
def computeXORChecksum(chksumdata):
# Ins... | <commit_before><commit_msg>Add a script to check motor (and communication!)<commit_after>#!/usr/bin/env python
# -*- coding: utf8 -*-
#
# Copyright (c) 2013 Nautilabs
#
# Licensed under the MIT License,
# https://github.com/baptistelabat/robokite
# Authors: Baptiste LABAT
import time
import serial
import numpy as np
d... | |
f3984fd4fdcfa8ddad779fb934362d043a5f8a00 | tests/test_cli.py | tests/test_cli.py | #!/usr/bin/env python
import pytest
from click.testing import CliRunner
from compaction import cli
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
"""
# import requests
# return requests.get('https://github.com/audreyr/cookiecut... | Add a simple test for the command line interface. | Add a simple test for the command line interface.
| Python | mit | mcflugen/compaction | Add a simple test for the command line interface. | #!/usr/bin/env python
import pytest
from click.testing import CliRunner
from compaction import cli
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
"""
# import requests
# return requests.get('https://github.com/audreyr/cookiecut... | <commit_before><commit_msg>Add a simple test for the command line interface.<commit_after> | #!/usr/bin/env python
import pytest
from click.testing import CliRunner
from compaction import cli
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
"""
# import requests
# return requests.get('https://github.com/audreyr/cookiecut... | Add a simple test for the command line interface.#!/usr/bin/env python
import pytest
from click.testing import CliRunner
from compaction import cli
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
"""
# import requests
# return r... | <commit_before><commit_msg>Add a simple test for the command line interface.<commit_after>#!/usr/bin/env python
import pytest
from click.testing import CliRunner
from compaction import cli
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
... | |
9397ebff413e557fff6aa08a3160cdfecb74fc7e | pybo/demos/basic_pes.py | pybo/demos/basic_pes.py | import numpy as np
import benchfunk
import reggie
import mwhutils.plotting as mp
import mwhutils.grid as mg
from pybo import inits
from pybo import policies
from pybo import solvers
from pybo import recommenders
if __name__ == '__main__':
# grab a test function and points at which to plot things
s = 0.001
... | Add a PES basic demo. | Add a PES basic demo.
| Python | bsd-2-clause | mwhoffman/pybo | Add a PES basic demo. | import numpy as np
import benchfunk
import reggie
import mwhutils.plotting as mp
import mwhutils.grid as mg
from pybo import inits
from pybo import policies
from pybo import solvers
from pybo import recommenders
if __name__ == '__main__':
# grab a test function and points at which to plot things
s = 0.001
... | <commit_before><commit_msg>Add a PES basic demo.<commit_after> | import numpy as np
import benchfunk
import reggie
import mwhutils.plotting as mp
import mwhutils.grid as mg
from pybo import inits
from pybo import policies
from pybo import solvers
from pybo import recommenders
if __name__ == '__main__':
# grab a test function and points at which to plot things
s = 0.001
... | Add a PES basic demo.import numpy as np
import benchfunk
import reggie
import mwhutils.plotting as mp
import mwhutils.grid as mg
from pybo import inits
from pybo import policies
from pybo import solvers
from pybo import recommenders
if __name__ == '__main__':
# grab a test function and points at which to plot t... | <commit_before><commit_msg>Add a PES basic demo.<commit_after>import numpy as np
import benchfunk
import reggie
import mwhutils.plotting as mp
import mwhutils.grid as mg
from pybo import inits
from pybo import policies
from pybo import solvers
from pybo import recommenders
if __name__ == '__main__':
# grab a te... | |
5516b9997671d03c06549dcd99611df56d79b779 | cors_webserver.py | cors_webserver.py | #!/usr/bin/env python
# @license
# Copyright 2017 Google Inc.
# 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... | Add simple web server for testing Neuroglancer with local data | feat: Add simple web server for testing Neuroglancer with local data
| Python | apache-2.0 | seung-lab/neuroglancer,seung-lab/neuroglancer,google/neuroglancer,janelia-flyem/neuroglancer,seung-lab/neuroglancer,google/neuroglancer,seung-lab/neuroglancer,seung-lab/neuroglancer,google/neuroglancer,google/neuroglancer,janelia-flyem/neuroglancer,janelia-flyem/neuroglancer,seung-lab/neuroglancer,janelia-flyem/neurogl... | feat: Add simple web server for testing Neuroglancer with local data | #!/usr/bin/env python
# @license
# Copyright 2017 Google Inc.
# 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... | <commit_before><commit_msg>feat: Add simple web server for testing Neuroglancer with local data<commit_after> | #!/usr/bin/env python
# @license
# Copyright 2017 Google Inc.
# 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... | feat: Add simple web server for testing Neuroglancer with local data#!/usr/bin/env python
# @license
# Copyright 2017 Google Inc.
# 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:/... | <commit_before><commit_msg>feat: Add simple web server for testing Neuroglancer with local data<commit_after>#!/usr/bin/env python
# @license
# Copyright 2017 Google Inc.
# 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... | |
9a6c467ef34596c8adccc294f3132fe67c983608 | scripts/copy_overlay.py | scripts/copy_overlay.py | """Copy overlay from one dataset to a derived dataset."""
import click
import dtoolcore
def ensure_uri(path_or_uri):
if ':' in path_or_uri:
return path_or_uri
else:
return "disk:{}".format(path_or_uri)
@click.command()
@click.argument('src_dataset_path')
@click.argument('dst_dataset_path'... | Add script to copy overlay from one dataset to another | Add script to copy overlay from one dataset to another
| Python | mit | JIC-Image-Analysis/senescence-in-field,JIC-Image-Analysis/senescence-in-field,JIC-Image-Analysis/senescence-in-field | Add script to copy overlay from one dataset to another | """Copy overlay from one dataset to a derived dataset."""
import click
import dtoolcore
def ensure_uri(path_or_uri):
if ':' in path_or_uri:
return path_or_uri
else:
return "disk:{}".format(path_or_uri)
@click.command()
@click.argument('src_dataset_path')
@click.argument('dst_dataset_path'... | <commit_before><commit_msg>Add script to copy overlay from one dataset to another<commit_after> | """Copy overlay from one dataset to a derived dataset."""
import click
import dtoolcore
def ensure_uri(path_or_uri):
if ':' in path_or_uri:
return path_or_uri
else:
return "disk:{}".format(path_or_uri)
@click.command()
@click.argument('src_dataset_path')
@click.argument('dst_dataset_path'... | Add script to copy overlay from one dataset to another"""Copy overlay from one dataset to a derived dataset."""
import click
import dtoolcore
def ensure_uri(path_or_uri):
if ':' in path_or_uri:
return path_or_uri
else:
return "disk:{}".format(path_or_uri)
@click.command()
@click.argument(... | <commit_before><commit_msg>Add script to copy overlay from one dataset to another<commit_after>"""Copy overlay from one dataset to a derived dataset."""
import click
import dtoolcore
def ensure_uri(path_or_uri):
if ':' in path_or_uri:
return path_or_uri
else:
return "disk:{}".format(path_or... | |
63203ab1069999f81b9518c11da29eb8ca537077 | openstack_dashboard/api/__init__.py | openstack_dashboard/api/__init__.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | Resolve API import issues (quantum) | Resolve API import issues (quantum)
Restore the imports in the api init file, without including the "from"
to ensure api calls still must specify "api.nova", "api.quantum", etc.
Fixes bug #1125632
Change-Id: I981105ce0ed7f1352de42fe2c0620665ba378823
| Python | apache-2.0 | vladryk/horizon,mrunge/openstack_horizon,redhat-openstack/horizon,citrix-openstack-build/horizon,Hodorable/0602,citrix-openstack-build/horizon,doug-fish/horizon,VaneCloud/horizon,tanglei528/horizon,karthik-suresh/horizon,j4/horizon,NeCTAR-RC/horizon,Solinea/horizon,wangxiangyu/horizon,luhanhan/horizon,newrocknj/horizon... | Resolve API import issues (quantum)
Restore the imports in the api init file, without including the "from"
to ensure api calls still must specify "api.nova", "api.quantum", etc.
Fixes bug #1125632
Change-Id: I981105ce0ed7f1352de42fe2c0620665ba378823 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | <commit_before><commit_msg>Resolve API import issues (quantum)
Restore the imports in the api init file, without including the "from"
to ensure api calls still must specify "api.nova", "api.quantum", etc.
Fixes bug #1125632
Change-Id: I981105ce0ed7f1352de42fe2c0620665ba378823<commit_after> | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | Resolve API import issues (quantum)
Restore the imports in the api init file, without including the "from"
to ensure api calls still must specify "api.nova", "api.quantum", etc.
Fixes bug #1125632
Change-Id: I981105ce0ed7f1352de42fe2c0620665ba378823# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United... | <commit_before><commit_msg>Resolve API import issues (quantum)
Restore the imports in the api init file, without including the "from"
to ensure api calls still must specify "api.nova", "api.quantum", etc.
Fixes bug #1125632
Change-Id: I981105ce0ed7f1352de42fe2c0620665ba378823<commit_after># vim: tabstop=4 shiftwidth... | |
6bf80a7f367593e71fad788a933819c6849c3723 | day-06/p1.py | day-06/p1.py | import re
from numpy import matrix
instructions = []
with open('input.txt', 'r') as f:
regex = re.compile(r'([\w ]+) (\d+),(\d+) .+ (\d+),(\d+)')
for line in f:
match = regex.match(line)
instructions.append((
match.group(1),
(int(match.group(2)), int(match.group(3))),
... | Add currently-incorrect day 6 part 1 | Add currently-incorrect day 6 part 1
| Python | mit | foxscotch/advent-of-code,foxscotch/advent-of-code | Add currently-incorrect day 6 part 1 | import re
from numpy import matrix
instructions = []
with open('input.txt', 'r') as f:
regex = re.compile(r'([\w ]+) (\d+),(\d+) .+ (\d+),(\d+)')
for line in f:
match = regex.match(line)
instructions.append((
match.group(1),
(int(match.group(2)), int(match.group(3))),
... | <commit_before><commit_msg>Add currently-incorrect day 6 part 1<commit_after> | import re
from numpy import matrix
instructions = []
with open('input.txt', 'r') as f:
regex = re.compile(r'([\w ]+) (\d+),(\d+) .+ (\d+),(\d+)')
for line in f:
match = regex.match(line)
instructions.append((
match.group(1),
(int(match.group(2)), int(match.group(3))),
... | Add currently-incorrect day 6 part 1import re
from numpy import matrix
instructions = []
with open('input.txt', 'r') as f:
regex = re.compile(r'([\w ]+) (\d+),(\d+) .+ (\d+),(\d+)')
for line in f:
match = regex.match(line)
instructions.append((
match.group(1),
(int(mat... | <commit_before><commit_msg>Add currently-incorrect day 6 part 1<commit_after>import re
from numpy import matrix
instructions = []
with open('input.txt', 'r') as f:
regex = re.compile(r'([\w ]+) (\d+),(\d+) .+ (\d+),(\d+)')
for line in f:
match = regex.match(line)
instructions.append((
... | |
f9f7493d89aa842fffc085758a1fe5791cd65704 | monitors/migrations/post/0004_migrate_subscriptions.py | monitors/migrations/post/0004_migrate_subscriptions.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.apps import apps
def populate_subscriptions(apps):
print("entering populate_subscriptions")
Certificates = apps.get_model("monitors","CertificateMonitor")
Subscription = apps.get_model("mon... | Add script to migrate data to certificatesubscription table | Add script to migrate data to certificatesubscription table
| Python | mit | gdit-cnd/RAPID,LindaTNguyen/RAPID,LindaTNguyen/RAPID,LindaTNguyen/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,LindaTNguyen/RAPID,gdit-cnd/RAPID,gdit-cnd/RAPID,gdit-cnd/RAPID | Add script to migrate data to certificatesubscription table | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.apps import apps
def populate_subscriptions(apps):
print("entering populate_subscriptions")
Certificates = apps.get_model("monitors","CertificateMonitor")
Subscription = apps.get_model("mon... | <commit_before><commit_msg>Add script to migrate data to certificatesubscription table<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.apps import apps
def populate_subscriptions(apps):
print("entering populate_subscriptions")
Certificates = apps.get_model("monitors","CertificateMonitor")
Subscription = apps.get_model("mon... | Add script to migrate data to certificatesubscription table# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.apps import apps
def populate_subscriptions(apps):
print("entering populate_subscriptions")
Certificates = apps.get_model("monitors","... | <commit_before><commit_msg>Add script to migrate data to certificatesubscription table<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.apps import apps
def populate_subscriptions(apps):
print("entering populate_subscriptions")
C... | |
b614fae93ff965abb45ee26e1a72198b4b4af8ec | saltcloud/clouds/ec2.py | saltcloud/clouds/ec2.py | '''
The generic libcloud template used to create the connections and deploy the
cloud virtual machines
'''
# Import python libs
import os
import tempfile
import shutil
#
# Import libcloud
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
from libcloud.compute.deployment imp... | Add initial testing module for cloud creation | Add initial testing module for cloud creation
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add initial testing module for cloud creation | '''
The generic libcloud template used to create the connections and deploy the
cloud virtual machines
'''
# Import python libs
import os
import tempfile
import shutil
#
# Import libcloud
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
from libcloud.compute.deployment imp... | <commit_before><commit_msg>Add initial testing module for cloud creation<commit_after> | '''
The generic libcloud template used to create the connections and deploy the
cloud virtual machines
'''
# Import python libs
import os
import tempfile
import shutil
#
# Import libcloud
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
from libcloud.compute.deployment imp... | Add initial testing module for cloud creation'''
The generic libcloud template used to create the connections and deploy the
cloud virtual machines
'''
# Import python libs
import os
import tempfile
import shutil
#
# Import libcloud
from libcloud.compute.types import Provider
from libcloud.compute.providers import ge... | <commit_before><commit_msg>Add initial testing module for cloud creation<commit_after>'''
The generic libcloud template used to create the connections and deploy the
cloud virtual machines
'''
# Import python libs
import os
import tempfile
import shutil
#
# Import libcloud
from libcloud.compute.types import Provider
... | |
28460efa5c8add33c36f45ac3bdefbd4c94ac0af | py/desisurvey/test/test_optimize.py | py/desisurvey/test/test_optimize.py | import unittest
import numpy as np
from desisurvey.optimize import *
class TestUtils(unittest.TestCase):
def test_wrap_unwrap(self):
x = np.linspace(0., 350., 97)
for dx in (-60, 0, 60):
w = wrap(x, dx)
assert np.all(w >= dx)
assert np.all(w < dx + 360)
| Add simple unit test for optimize module | Add simple unit test for optimize module
| Python | bsd-3-clause | desihub/desisurvey,desihub/desisurvey | Add simple unit test for optimize module | import unittest
import numpy as np
from desisurvey.optimize import *
class TestUtils(unittest.TestCase):
def test_wrap_unwrap(self):
x = np.linspace(0., 350., 97)
for dx in (-60, 0, 60):
w = wrap(x, dx)
assert np.all(w >= dx)
assert np.all(w < dx + 360)
| <commit_before><commit_msg>Add simple unit test for optimize module<commit_after> | import unittest
import numpy as np
from desisurvey.optimize import *
class TestUtils(unittest.TestCase):
def test_wrap_unwrap(self):
x = np.linspace(0., 350., 97)
for dx in (-60, 0, 60):
w = wrap(x, dx)
assert np.all(w >= dx)
assert np.all(w < dx + 360)
| Add simple unit test for optimize moduleimport unittest
import numpy as np
from desisurvey.optimize import *
class TestUtils(unittest.TestCase):
def test_wrap_unwrap(self):
x = np.linspace(0., 350., 97)
for dx in (-60, 0, 60):
w = wrap(x, dx)
assert np.all(w >= dx)
... | <commit_before><commit_msg>Add simple unit test for optimize module<commit_after>import unittest
import numpy as np
from desisurvey.optimize import *
class TestUtils(unittest.TestCase):
def test_wrap_unwrap(self):
x = np.linspace(0., 350., 97)
for dx in (-60, 0, 60):
w = wrap(x, dx)... | |
f55d01d3b2b96af4394107404a452101c3aa7104 | circle_transform.py | circle_transform.py | # License: Public Domain
# (C) 2014 Toshimitsu Kimura
import sys
import cv2
import numpy as np
import math
def main():
if len(sys.argv) != 3:
print "./circle_transform.py <in_file> <out_file>"
quit()
filename = sys.argv[1]
outfile = sys.argv[2]
image = cv2.imread(filename, cv2.IMREAD... | Add circle transform script that may be useful for OCR | Add circle transform script that may be useful for OCR
| Python | lgpl-2.1 | nazodane/binarization_for_ocr | Add circle transform script that may be useful for OCR | # License: Public Domain
# (C) 2014 Toshimitsu Kimura
import sys
import cv2
import numpy as np
import math
def main():
if len(sys.argv) != 3:
print "./circle_transform.py <in_file> <out_file>"
quit()
filename = sys.argv[1]
outfile = sys.argv[2]
image = cv2.imread(filename, cv2.IMREAD... | <commit_before><commit_msg>Add circle transform script that may be useful for OCR<commit_after> | # License: Public Domain
# (C) 2014 Toshimitsu Kimura
import sys
import cv2
import numpy as np
import math
def main():
if len(sys.argv) != 3:
print "./circle_transform.py <in_file> <out_file>"
quit()
filename = sys.argv[1]
outfile = sys.argv[2]
image = cv2.imread(filename, cv2.IMREAD... | Add circle transform script that may be useful for OCR# License: Public Domain
# (C) 2014 Toshimitsu Kimura
import sys
import cv2
import numpy as np
import math
def main():
if len(sys.argv) != 3:
print "./circle_transform.py <in_file> <out_file>"
quit()
filename = sys.argv[1]
outfile = sy... | <commit_before><commit_msg>Add circle transform script that may be useful for OCR<commit_after># License: Public Domain
# (C) 2014 Toshimitsu Kimura
import sys
import cv2
import numpy as np
import math
def main():
if len(sys.argv) != 3:
print "./circle_transform.py <in_file> <out_file>"
quit()
... | |
794b5297c96529d895705214b1fb2ff9ba1510a9 | into/backends/aws.py | into/backends/aws.py | from __future__ import print_function, division, absolute_import
from into import discover, CSV, resource, convert
import pandas as pd
from ..utils import cls_name
from toolz import memoize
from datashape import var
class S3(object):
"""An object that holds a resource that lives in an S3 bucket
Examples
... | Implement part of the s3 csv into interface | Implement part of the s3 csv into interface
| Python | bsd-3-clause | ywang007/odo,alexmojaki/odo,blaze/odo,blaze/odo,ContinuumIO/odo,cowlicks/odo,alexmojaki/odo,Dannnno/odo,cpcloud/odo,quantopian/odo,cpcloud/odo,cowlicks/odo,ContinuumIO/odo,Dannnno/odo,ywang007/odo,quantopian/odo | Implement part of the s3 csv into interface | from __future__ import print_function, division, absolute_import
from into import discover, CSV, resource, convert
import pandas as pd
from ..utils import cls_name
from toolz import memoize
from datashape import var
class S3(object):
"""An object that holds a resource that lives in an S3 bucket
Examples
... | <commit_before><commit_msg>Implement part of the s3 csv into interface<commit_after> | from __future__ import print_function, division, absolute_import
from into import discover, CSV, resource, convert
import pandas as pd
from ..utils import cls_name
from toolz import memoize
from datashape import var
class S3(object):
"""An object that holds a resource that lives in an S3 bucket
Examples
... | Implement part of the s3 csv into interfacefrom __future__ import print_function, division, absolute_import
from into import discover, CSV, resource, convert
import pandas as pd
from ..utils import cls_name
from toolz import memoize
from datashape import var
class S3(object):
"""An object that holds a resource t... | <commit_before><commit_msg>Implement part of the s3 csv into interface<commit_after>from __future__ import print_function, division, absolute_import
from into import discover, CSV, resource, convert
import pandas as pd
from ..utils import cls_name
from toolz import memoize
from datashape import var
class S3(object):... | |
b7212b9aa393faea3cfaf94c3dfaf17487461d62 | lib/pegasus/python/Pegasus/test/service/test_service.py | lib/pegasus/python/Pegasus/test/service/test_service.py | # Copyright 2007-2014 University Of Southern California
#
# 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 ... | Add unit test to see if pegasus-service imports are succesful | Add unit test to see if pegasus-service imports are succesful
| Python | apache-2.0 | pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus | Add unit test to see if pegasus-service imports are succesful | # Copyright 2007-2014 University Of Southern California
#
# 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 ... | <commit_before><commit_msg>Add unit test to see if pegasus-service imports are succesful<commit_after> | # Copyright 2007-2014 University Of Southern California
#
# 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 ... | Add unit test to see if pegasus-service imports are succesful# Copyright 2007-2014 University Of Southern California
#
# 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... | <commit_before><commit_msg>Add unit test to see if pegasus-service imports are succesful<commit_after># Copyright 2007-2014 University Of Southern California
#
# 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... | |
ee0f949da82f249684c63cefe49ee546aca76299 | programs/utils/fix_json.py | programs/utils/fix_json.py | #!/usr/bin/python
def isfloat(value):
try:
float(value)
return True
except ValueError:
return False
import sys
if len(sys.argv) == 3:
infile = sys.argv[1]
outfile = sys.argv[2]
else:
infile = raw_input("Enter input file:")
outfile = raw_input("Enter output file:")
with open(infile, "r") as g... | Add simple script that changes floating points in genesis.json to ints | Add simple script that changes floating points in genesis.json to ints
| Python | unlicense | camponez/bitshares,jakeporter/Bitshares,jakeporter/Bitshares,frrp/bitshares,bitsuperlab/cpp-play,FollowMyVote/bitshares,frrp/bitshares,bitshares/devshares,frrp/bitshares,bitshares/bitshares,bitsuperlab/cpp-play,FollowMyVote/bitshares,bitsuperlab/cpp-play,Ziftr/bitshares,camponez/bitshares,bitshares/bitshares,bitshares/... | Add simple script that changes floating points in genesis.json to ints | #!/usr/bin/python
def isfloat(value):
try:
float(value)
return True
except ValueError:
return False
import sys
if len(sys.argv) == 3:
infile = sys.argv[1]
outfile = sys.argv[2]
else:
infile = raw_input("Enter input file:")
outfile = raw_input("Enter output file:")
with open(infile, "r") as g... | <commit_before><commit_msg>Add simple script that changes floating points in genesis.json to ints<commit_after> | #!/usr/bin/python
def isfloat(value):
try:
float(value)
return True
except ValueError:
return False
import sys
if len(sys.argv) == 3:
infile = sys.argv[1]
outfile = sys.argv[2]
else:
infile = raw_input("Enter input file:")
outfile = raw_input("Enter output file:")
with open(infile, "r") as g... | Add simple script that changes floating points in genesis.json to ints#!/usr/bin/python
def isfloat(value):
try:
float(value)
return True
except ValueError:
return False
import sys
if len(sys.argv) == 3:
infile = sys.argv[1]
outfile = sys.argv[2]
else:
infile = raw_input("Enter input file:")
... | <commit_before><commit_msg>Add simple script that changes floating points in genesis.json to ints<commit_after>#!/usr/bin/python
def isfloat(value):
try:
float(value)
return True
except ValueError:
return False
import sys
if len(sys.argv) == 3:
infile = sys.argv[1]
outfile = sys.argv[2]
else:
i... | |
436840ee3d41ca06c6a94745144ed3b8453816d8 | geotrek/common/management/commands/clean_attachments.py | geotrek/common/management/commands/clean_attachments.py | from pathlib import Path
from django.core.management.base import BaseCommand
from django.conf import settings
from geotrek.common.models import Attachment
from easy_thumbnails.models import Thumbnail
class Command(BaseCommand):
help = "Remove files for deleted attachments"
def handle(self, *args, **options... | Add a command to clean attachments | Add a command to clean attachments
| Python | bsd-2-clause | GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin | Add a command to clean attachments | from pathlib import Path
from django.core.management.base import BaseCommand
from django.conf import settings
from geotrek.common.models import Attachment
from easy_thumbnails.models import Thumbnail
class Command(BaseCommand):
help = "Remove files for deleted attachments"
def handle(self, *args, **options... | <commit_before><commit_msg>Add a command to clean attachments<commit_after> | from pathlib import Path
from django.core.management.base import BaseCommand
from django.conf import settings
from geotrek.common.models import Attachment
from easy_thumbnails.models import Thumbnail
class Command(BaseCommand):
help = "Remove files for deleted attachments"
def handle(self, *args, **options... | Add a command to clean attachmentsfrom pathlib import Path
from django.core.management.base import BaseCommand
from django.conf import settings
from geotrek.common.models import Attachment
from easy_thumbnails.models import Thumbnail
class Command(BaseCommand):
help = "Remove files for deleted attachments"
... | <commit_before><commit_msg>Add a command to clean attachments<commit_after>from pathlib import Path
from django.core.management.base import BaseCommand
from django.conf import settings
from geotrek.common.models import Attachment
from easy_thumbnails.models import Thumbnail
class Command(BaseCommand):
help = "R... | |
4e1f68f1c033dc76930b2d651fe256dff11970e1 | examples/scripts/weatherValuesNamed.py | examples/scripts/weatherValuesNamed.py | from medea import Tokenizer
from examples.scripts import timeit
def run():
source = open('examples/data/weathermap.json')
tokenizer = Tokenizer(source)
for tok, val in tokenizer.tokenizeValuesNamed("rain"):
print(tok, val)
timeit(run) | Bring in timeit, and implicitly overclock with freq | Bring in timeit, and implicitly overclock with freq
| Python | agpl-3.0 | ShrimpingIt/medea,ShrimpingIt/medea | Bring in timeit, and implicitly overclock with freq | from medea import Tokenizer
from examples.scripts import timeit
def run():
source = open('examples/data/weathermap.json')
tokenizer = Tokenizer(source)
for tok, val in tokenizer.tokenizeValuesNamed("rain"):
print(tok, val)
timeit(run) | <commit_before><commit_msg>Bring in timeit, and implicitly overclock with freq<commit_after> | from medea import Tokenizer
from examples.scripts import timeit
def run():
source = open('examples/data/weathermap.json')
tokenizer = Tokenizer(source)
for tok, val in tokenizer.tokenizeValuesNamed("rain"):
print(tok, val)
timeit(run) | Bring in timeit, and implicitly overclock with freqfrom medea import Tokenizer
from examples.scripts import timeit
def run():
source = open('examples/data/weathermap.json')
tokenizer = Tokenizer(source)
for tok, val in tokenizer.tokenizeValuesNamed("rain"):
print(tok, val)
timeit(run) | <commit_before><commit_msg>Bring in timeit, and implicitly overclock with freq<commit_after>from medea import Tokenizer
from examples.scripts import timeit
def run():
source = open('examples/data/weathermap.json')
tokenizer = Tokenizer(source)
for tok, val in tokenizer.tokenizeValuesNamed("rain"):
... | |
8d4255538203336e6f4d72845723c179c38547e0 | datastore/migrations/0028_auto_20160713_0000.py | datastore/migrations/0028_auto_20160713_0000.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-13 00:00
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('datastore', '0027_auto_20160712_2251'),
]
operations = [
migrations.RemoveField(
... | Add migration for deleted gunk | Add migration for deleted gunk
| Python | mit | impactlab/oeem-energy-datastore,impactlab/oeem-energy-datastore,impactlab/oeem-energy-datastore | Add migration for deleted gunk | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-13 00:00
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('datastore', '0027_auto_20160712_2251'),
]
operations = [
migrations.RemoveField(
... | <commit_before><commit_msg>Add migration for deleted gunk<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-13 00:00
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('datastore', '0027_auto_20160712_2251'),
]
operations = [
migrations.RemoveField(
... | Add migration for deleted gunk# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-13 00:00
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('datastore', '0027_auto_20160712_2251'),
]
operations = [
... | <commit_before><commit_msg>Add migration for deleted gunk<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-13 00:00
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('datastore', '0027_auto_2016071... | |
59882da97dafa0e103550d24795105e4e73f6ff5 | statsmodels/base/tests/test_optimize.py | statsmodels/base/tests/test_optimize.py | from numpy.testing import assert_
from statsmodels.base.model import (_fit_mle_newton, _fit_mle_nm,
_fit_mle_bfgs, _fit_mle_cg,
_fit_mle_ncg, _fit_mle_powell)
fit_funcs = {
'newton': _fit_mle_newton,
'nm': _fit_mle_nm, # Nelder-Mead
'... | Test fit funcs for full_output = False | TST: Test fit funcs for full_output = False
| Python | bsd-3-clause | bsipocz/statsmodels,bavardage/statsmodels,jseabold/statsmodels,DonBeo/statsmodels,waynenilsen/statsmodels,detrout/debian-statsmodels,josef-pkt/statsmodels,kiyoto/statsmodels,cbmoore/statsmodels,Averroes/statsmodels,statsmodels/statsmodels,ChadFulton/statsmodels,adammenges/statsmodels,bashtage/statsmodels,YihaoLu/statsm... | TST: Test fit funcs for full_output = False | from numpy.testing import assert_
from statsmodels.base.model import (_fit_mle_newton, _fit_mle_nm,
_fit_mle_bfgs, _fit_mle_cg,
_fit_mle_ncg, _fit_mle_powell)
fit_funcs = {
'newton': _fit_mle_newton,
'nm': _fit_mle_nm, # Nelder-Mead
'... | <commit_before><commit_msg>TST: Test fit funcs for full_output = False<commit_after> | from numpy.testing import assert_
from statsmodels.base.model import (_fit_mle_newton, _fit_mle_nm,
_fit_mle_bfgs, _fit_mle_cg,
_fit_mle_ncg, _fit_mle_powell)
fit_funcs = {
'newton': _fit_mle_newton,
'nm': _fit_mle_nm, # Nelder-Mead
'... | TST: Test fit funcs for full_output = Falsefrom numpy.testing import assert_
from statsmodels.base.model import (_fit_mle_newton, _fit_mle_nm,
_fit_mle_bfgs, _fit_mle_cg,
_fit_mle_ncg, _fit_mle_powell)
fit_funcs = {
'newton': _fit_mle_newton,
... | <commit_before><commit_msg>TST: Test fit funcs for full_output = False<commit_after>from numpy.testing import assert_
from statsmodels.base.model import (_fit_mle_newton, _fit_mle_nm,
_fit_mle_bfgs, _fit_mle_cg,
_fit_mle_ncg, _fit_mle_powell)
fit_... | |
d2018ec07a79b1d0fd7c0ee3c34faa0c4c5bf723 | src/python/borg/tools/plot_performance.py | src/python/borg/tools/plot_performance.py | """
@author: Bryan Silverthorn <bcs@cargo-cult.org>
"""
if __name__ == "__main__":
from borg.tools.plot_performance import main
raise SystemExit(main())
from cargo.log import get_logger
log = get_logger(__name__, default_level = "INFO")
def plot_trial(session, trial_row):
"""
Plot the specified tri... | Add a simple performance plotting tool. | Add a simple performance plotting tool.
| Python | mit | borg-project/borg | Add a simple performance plotting tool. | """
@author: Bryan Silverthorn <bcs@cargo-cult.org>
"""
if __name__ == "__main__":
from borg.tools.plot_performance import main
raise SystemExit(main())
from cargo.log import get_logger
log = get_logger(__name__, default_level = "INFO")
def plot_trial(session, trial_row):
"""
Plot the specified tri... | <commit_before><commit_msg>Add a simple performance plotting tool.<commit_after> | """
@author: Bryan Silverthorn <bcs@cargo-cult.org>
"""
if __name__ == "__main__":
from borg.tools.plot_performance import main
raise SystemExit(main())
from cargo.log import get_logger
log = get_logger(__name__, default_level = "INFO")
def plot_trial(session, trial_row):
"""
Plot the specified tri... | Add a simple performance plotting tool."""
@author: Bryan Silverthorn <bcs@cargo-cult.org>
"""
if __name__ == "__main__":
from borg.tools.plot_performance import main
raise SystemExit(main())
from cargo.log import get_logger
log = get_logger(__name__, default_level = "INFO")
def plot_trial(session, trial_r... | <commit_before><commit_msg>Add a simple performance plotting tool.<commit_after>"""
@author: Bryan Silverthorn <bcs@cargo-cult.org>
"""
if __name__ == "__main__":
from borg.tools.plot_performance import main
raise SystemExit(main())
from cargo.log import get_logger
log = get_logger(__name__, default_level =... | |
ce9ff3ac42d388d7898ea3e88dce3d2eb4168c30 | hc/accounts/migrations/0042_remove_member_rw.py | hc/accounts/migrations/0042_remove_member_rw.py | # Generated by Django 3.2.4 on 2021-07-22 14:39
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0041_fill_role'),
]
operations = [
migrations.RemoveField(
model_name='member',
name='rw',
),
]
| Add a migration to remove Member.rw | Add a migration to remove Member.rw
| Python | bsd-3-clause | iphoting/healthchecks,healthchecks/healthchecks,iphoting/healthchecks,healthchecks/healthchecks,healthchecks/healthchecks,iphoting/healthchecks,healthchecks/healthchecks,iphoting/healthchecks | Add a migration to remove Member.rw | # Generated by Django 3.2.4 on 2021-07-22 14:39
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0041_fill_role'),
]
operations = [
migrations.RemoveField(
model_name='member',
name='rw',
),
]
| <commit_before><commit_msg>Add a migration to remove Member.rw<commit_after> | # Generated by Django 3.2.4 on 2021-07-22 14:39
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0041_fill_role'),
]
operations = [
migrations.RemoveField(
model_name='member',
name='rw',
),
]
| Add a migration to remove Member.rw# Generated by Django 3.2.4 on 2021-07-22 14:39
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0041_fill_role'),
]
operations = [
migrations.RemoveField(
model_name='member',
... | <commit_before><commit_msg>Add a migration to remove Member.rw<commit_after># Generated by Django 3.2.4 on 2021-07-22 14:39
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0041_fill_role'),
]
operations = [
migrations.RemoveField(
... | |
814974c6736f1a9aef6fec7abf4153f194a231c7 | simpleubjson/exceptions.py | simpleubjson/exceptions.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
class DecodeError(ValueError):
"""UBJSON data decoding error."""
class MarkerError(DecodeError):... | Add missed exception module. Ooops. | Add missed exception module. Ooops.
| Python | bsd-2-clause | samipshah/simpleubjson,brainwater/simpleubjson,498888197/simpleubjson,kxepal/simpleubjson | Add missed exception module. Ooops. | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
class DecodeError(ValueError):
"""UBJSON data decoding error."""
class MarkerError(DecodeError):... | <commit_before><commit_msg>Add missed exception module. Ooops.<commit_after> | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
class DecodeError(ValueError):
"""UBJSON data decoding error."""
class MarkerError(DecodeError):... | Add missed exception module. Ooops.# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
class DecodeError(ValueError):
"""UBJSON data decoding error.""... | <commit_before><commit_msg>Add missed exception module. Ooops.<commit_after># -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
class DecodeError(ValueErr... | |
bb0d7bf6dc36e8d013befc7f13da3cb6c3830c46 | core/admin/migrations/versions/049fed905da7_.py | core/admin/migrations/versions/049fed905da7_.py | """ Enforce the nocase collation on the email table
Revision ID: 049fed905da7
Revises: 49d77a93118e
Create Date: 2018-04-21 13:23:56.571524
"""
# revision identifiers, used by Alembic.
revision = '049fed905da7'
down_revision = '49d77a93118e'
from alembic import op
import sqlalchemy as sa
def upgrade():
with o... | Enforce the nocase collation on the email table | Enforce the nocase collation on the email table
| Python | mit | kaiyou/freeposte.io,kaiyou/freeposte.io,kaiyou/freeposte.io,kaiyou/freeposte.io | Enforce the nocase collation on the email table | """ Enforce the nocase collation on the email table
Revision ID: 049fed905da7
Revises: 49d77a93118e
Create Date: 2018-04-21 13:23:56.571524
"""
# revision identifiers, used by Alembic.
revision = '049fed905da7'
down_revision = '49d77a93118e'
from alembic import op
import sqlalchemy as sa
def upgrade():
with o... | <commit_before><commit_msg>Enforce the nocase collation on the email table<commit_after> | """ Enforce the nocase collation on the email table
Revision ID: 049fed905da7
Revises: 49d77a93118e
Create Date: 2018-04-21 13:23:56.571524
"""
# revision identifiers, used by Alembic.
revision = '049fed905da7'
down_revision = '49d77a93118e'
from alembic import op
import sqlalchemy as sa
def upgrade():
with o... | Enforce the nocase collation on the email table""" Enforce the nocase collation on the email table
Revision ID: 049fed905da7
Revises: 49d77a93118e
Create Date: 2018-04-21 13:23:56.571524
"""
# revision identifiers, used by Alembic.
revision = '049fed905da7'
down_revision = '49d77a93118e'
from alembic import op
impo... | <commit_before><commit_msg>Enforce the nocase collation on the email table<commit_after>""" Enforce the nocase collation on the email table
Revision ID: 049fed905da7
Revises: 49d77a93118e
Create Date: 2018-04-21 13:23:56.571524
"""
# revision identifiers, used by Alembic.
revision = '049fed905da7'
down_revision = '4... | |
cff8e237afb567ba980b8790d9c7416b8be21fdd | solutions/uri/1010/1010.py | solutions/uri/1010/1010.py | import sys
s = 0.0
for line in sys.stdin:
a, b, c = line.split()
a, b, c = int(a), int(b), float(c)
s += c * b
print(f'VALOR A PAGAR: R$ {s:.2f}')
| Solve Simple Calculate in python | Solve Simple Calculate in python
| Python | mit | deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playgr... | Solve Simple Calculate in python | import sys
s = 0.0
for line in sys.stdin:
a, b, c = line.split()
a, b, c = int(a), int(b), float(c)
s += c * b
print(f'VALOR A PAGAR: R$ {s:.2f}')
| <commit_before><commit_msg>Solve Simple Calculate in python<commit_after> | import sys
s = 0.0
for line in sys.stdin:
a, b, c = line.split()
a, b, c = int(a), int(b), float(c)
s += c * b
print(f'VALOR A PAGAR: R$ {s:.2f}')
| Solve Simple Calculate in pythonimport sys
s = 0.0
for line in sys.stdin:
a, b, c = line.split()
a, b, c = int(a), int(b), float(c)
s += c * b
print(f'VALOR A PAGAR: R$ {s:.2f}')
| <commit_before><commit_msg>Solve Simple Calculate in python<commit_after>import sys
s = 0.0
for line in sys.stdin:
a, b, c = line.split()
a, b, c = int(a), int(b), float(c)
s += c * b
print(f'VALOR A PAGAR: R$ {s:.2f}')
| |
12c3d91f3a0ae571300f7729d09766aba12c81ac | CurveAnalysis/fourier_analysis.py | CurveAnalysis/fourier_analysis.py | #!/usr/bin/env python
import csv
import numpy as np
from scipy import signal
from scipy.fftpack import fft, ifft
from scipy import fftpack
import matplotlib.pyplot as plt
note_name = '77726_MS-DAR-00205-00001-000-00096'
base_dir = '/home/ibanez/data/amnh/darwin_notes/'
images_dir = base_dir + 'images/'
curves_dir = ba... | Add python script to compute fast fourier transforms. | Add python script to compute fast fourier transforms.
| Python | apache-2.0 | HackTheStacks/darwin-notes-image-processing,HackTheStacks/darwin-notes-image-processing | Add python script to compute fast fourier transforms. | #!/usr/bin/env python
import csv
import numpy as np
from scipy import signal
from scipy.fftpack import fft, ifft
from scipy import fftpack
import matplotlib.pyplot as plt
note_name = '77726_MS-DAR-00205-00001-000-00096'
base_dir = '/home/ibanez/data/amnh/darwin_notes/'
images_dir = base_dir + 'images/'
curves_dir = ba... | <commit_before><commit_msg>Add python script to compute fast fourier transforms.<commit_after> | #!/usr/bin/env python
import csv
import numpy as np
from scipy import signal
from scipy.fftpack import fft, ifft
from scipy import fftpack
import matplotlib.pyplot as plt
note_name = '77726_MS-DAR-00205-00001-000-00096'
base_dir = '/home/ibanez/data/amnh/darwin_notes/'
images_dir = base_dir + 'images/'
curves_dir = ba... | Add python script to compute fast fourier transforms.#!/usr/bin/env python
import csv
import numpy as np
from scipy import signal
from scipy.fftpack import fft, ifft
from scipy import fftpack
import matplotlib.pyplot as plt
note_name = '77726_MS-DAR-00205-00001-000-00096'
base_dir = '/home/ibanez/data/amnh/darwin_note... | <commit_before><commit_msg>Add python script to compute fast fourier transforms.<commit_after>#!/usr/bin/env python
import csv
import numpy as np
from scipy import signal
from scipy.fftpack import fft, ifft
from scipy import fftpack
import matplotlib.pyplot as plt
note_name = '77726_MS-DAR-00205-00001-000-00096'
base_... | |
fd80e8088c840fb836f00f4d41b0fcfd0a132d0a | calaccess_processed/migrations/0023_auto_20170206_0037.py | calaccess_processed/migrations/0023_auto_20170206_0037.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-06 00:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('calaccess_processed', '0022_ballotmeasurecontestidentifier'),
]
operations = [
migr... | Add migration for Party meta option changes | Add migration for Party meta option changes
| Python | mit | california-civic-data-coalition/django-calaccess-processed-data,california-civic-data-coalition/django-calaccess-processed-data | Add migration for Party meta option changes | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-06 00:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('calaccess_processed', '0022_ballotmeasurecontestidentifier'),
]
operations = [
migr... | <commit_before><commit_msg>Add migration for Party meta option changes<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-06 00:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('calaccess_processed', '0022_ballotmeasurecontestidentifier'),
]
operations = [
migr... | Add migration for Party meta option changes# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-06 00:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('calaccess_processed', '0022_ballotmeasurecontestidentifie... | <commit_before><commit_msg>Add migration for Party meta option changes<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-06 00:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('calaccess_proces... | |
22df7a89020cbbcf80a88bcf3572dea591884861 | avatar/urls.py | avatar/urls.py | from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('avatar.views',
url('^add/$', 'add', name='avatar_add'),
url('^change/$', 'change', name='avatar_change'),
url('^delete/$', 'delete', name='avatar_delete'),
url('^render_primary/(?P<user>[\+\w]+)/(?P<size>[\d]+)/$', 'render_prim... | from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('avatar.views',
url('^add/$', 'add', name='avatar_add'),
url('^change/$', 'change', name='avatar_change'),
url('^delete/$', 'delete', name='avatar_delete'),
url('^render_primary/(?P<user>[\w\d\.\-_]{3,30})/(?P<size>[\d]+)/$', 'r... | Support for username with extra chars. | Support for username with extra chars.
| Python | bsd-3-clause | tbabej/django-avatar,Brendtron5000/django-avatar,Nuevosmedios/django-avatar,stellalie/django-avatar,barbuza/django-avatar,allenling/django-avatar,allenling/django-avatar,tbabej/django-avatar,z4r/django-avatar,imgmix/django-avatar,hexenxp14/django-avatar,MachineandMagic/django-avatar,brajeshvit/avatarmodule,integricho/d... | from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('avatar.views',
url('^add/$', 'add', name='avatar_add'),
url('^change/$', 'change', name='avatar_change'),
url('^delete/$', 'delete', name='avatar_delete'),
url('^render_primary/(?P<user>[\+\w]+)/(?P<size>[\d]+)/$', 'render_prim... | from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('avatar.views',
url('^add/$', 'add', name='avatar_add'),
url('^change/$', 'change', name='avatar_change'),
url('^delete/$', 'delete', name='avatar_delete'),
url('^render_primary/(?P<user>[\w\d\.\-_]{3,30})/(?P<size>[\d]+)/$', 'r... | <commit_before>from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('avatar.views',
url('^add/$', 'add', name='avatar_add'),
url('^change/$', 'change', name='avatar_change'),
url('^delete/$', 'delete', name='avatar_delete'),
url('^render_primary/(?P<user>[\+\w]+)/(?P<size>[\d]+)/$... | from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('avatar.views',
url('^add/$', 'add', name='avatar_add'),
url('^change/$', 'change', name='avatar_change'),
url('^delete/$', 'delete', name='avatar_delete'),
url('^render_primary/(?P<user>[\w\d\.\-_]{3,30})/(?P<size>[\d]+)/$', 'r... | from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('avatar.views',
url('^add/$', 'add', name='avatar_add'),
url('^change/$', 'change', name='avatar_change'),
url('^delete/$', 'delete', name='avatar_delete'),
url('^render_primary/(?P<user>[\+\w]+)/(?P<size>[\d]+)/$', 'render_prim... | <commit_before>from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('avatar.views',
url('^add/$', 'add', name='avatar_add'),
url('^change/$', 'change', name='avatar_change'),
url('^delete/$', 'delete', name='avatar_delete'),
url('^render_primary/(?P<user>[\+\w]+)/(?P<size>[\d]+)/$... |
f7008616465267906dd7ca75e0339812549e2988 | tests/unit_tests/test_deplete_operator.py | tests/unit_tests/test_deplete_operator.py | """Basic unit tests for openmc.deplete.Operator instantiation
Modifies and resets environment variable OPENMC_CROSS_SECTIONS
to a custom file with new depletion_chain node
"""
from os import remove
from os import environ
from unittest import mock
from pathlib import Path
import pytest
from openmc.deplete.abc import ... | Add test for the instantiation of deplete.Operator | Add test for the instantiation of deplete.Operator
Construct a minimal cross sections xml file that only
contains the depletion_chain node required by
the Operator. The path to this file is set to the
OPENMC_CROSS_SECTIONS file, and reverted after the test.
The depletion_chain points towards the chain_simple.xml
file... | Python | mit | paulromano/openmc,smharper/openmc,paulromano/openmc,liangjg/openmc,mit-crpg/openmc,shikhar413/openmc,liangjg/openmc,amandalund/openmc,smharper/openmc,amandalund/openmc,walshjon/openmc,liangjg/openmc,paulromano/openmc,mit-crpg/openmc,walshjon/openmc,mit-crpg/openmc,amandalund/openmc,shikhar413/openmc,shikhar413/openmc,w... | Add test for the instantiation of deplete.Operator
Construct a minimal cross sections xml file that only
contains the depletion_chain node required by
the Operator. The path to this file is set to the
OPENMC_CROSS_SECTIONS file, and reverted after the test.
The depletion_chain points towards the chain_simple.xml
file... | """Basic unit tests for openmc.deplete.Operator instantiation
Modifies and resets environment variable OPENMC_CROSS_SECTIONS
to a custom file with new depletion_chain node
"""
from os import remove
from os import environ
from unittest import mock
from pathlib import Path
import pytest
from openmc.deplete.abc import ... | <commit_before><commit_msg>Add test for the instantiation of deplete.Operator
Construct a minimal cross sections xml file that only
contains the depletion_chain node required by
the Operator. The path to this file is set to the
OPENMC_CROSS_SECTIONS file, and reverted after the test.
The depletion_chain points toward... | """Basic unit tests for openmc.deplete.Operator instantiation
Modifies and resets environment variable OPENMC_CROSS_SECTIONS
to a custom file with new depletion_chain node
"""
from os import remove
from os import environ
from unittest import mock
from pathlib import Path
import pytest
from openmc.deplete.abc import ... | Add test for the instantiation of deplete.Operator
Construct a minimal cross sections xml file that only
contains the depletion_chain node required by
the Operator. The path to this file is set to the
OPENMC_CROSS_SECTIONS file, and reverted after the test.
The depletion_chain points towards the chain_simple.xml
file... | <commit_before><commit_msg>Add test for the instantiation of deplete.Operator
Construct a minimal cross sections xml file that only
contains the depletion_chain node required by
the Operator. The path to this file is set to the
OPENMC_CROSS_SECTIONS file, and reverted after the test.
The depletion_chain points toward... | |
657e74878179b505c12cdf8e607cd9b3ae549420 | towel/templatetags/verbose_name_tags.py | towel/templatetags/verbose_name_tags.py | import itertools
from django import template
register = template.Library()
PATHS = [
'_meta', # model
'queryset.model._meta',
'instance._meta',
'model._meta',
]
def _resolve(instance, last_part):
for path in PATHS:
o = instance
found = True
for part in itertools.chain(p... | Add helpers to determine verbose_name(_plural)? of arbitrary objects | Add helpers to determine verbose_name(_plural)? of arbitrary objects
| Python | bsd-3-clause | matthiask/towel,matthiask/towel,matthiask/towel,matthiask/towel | Add helpers to determine verbose_name(_plural)? of arbitrary objects | import itertools
from django import template
register = template.Library()
PATHS = [
'_meta', # model
'queryset.model._meta',
'instance._meta',
'model._meta',
]
def _resolve(instance, last_part):
for path in PATHS:
o = instance
found = True
for part in itertools.chain(p... | <commit_before><commit_msg>Add helpers to determine verbose_name(_plural)? of arbitrary objects<commit_after> | import itertools
from django import template
register = template.Library()
PATHS = [
'_meta', # model
'queryset.model._meta',
'instance._meta',
'model._meta',
]
def _resolve(instance, last_part):
for path in PATHS:
o = instance
found = True
for part in itertools.chain(p... | Add helpers to determine verbose_name(_plural)? of arbitrary objectsimport itertools
from django import template
register = template.Library()
PATHS = [
'_meta', # model
'queryset.model._meta',
'instance._meta',
'model._meta',
]
def _resolve(instance, last_part):
for path in PATHS:
o =... | <commit_before><commit_msg>Add helpers to determine verbose_name(_plural)? of arbitrary objects<commit_after>import itertools
from django import template
register = template.Library()
PATHS = [
'_meta', # model
'queryset.model._meta',
'instance._meta',
'model._meta',
]
def _resolve(instance, last_... | |
beef7ad662e67a39e9ca387f7643129f88cda7df | tools/supervisor/rotate_supervisor_logs.py | tools/supervisor/rotate_supervisor_logs.py | #!/usr/bin/env python3
#
# Rotates and (optionally) compresses Supervisor logs using `logrotate`
#
# See:
#
# * https://www.rounds.com/blog/easy-logging-with-logrotate-and-supervisord/
# * https://gist.github.com/glarrain/6165987
#
import os
import subprocess
import tempfile
from mediawords.util.config import get_con... | Add script to rotate Supervisor log files | Add script to rotate Supervisor log files
| Python | agpl-3.0 | berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud | Add script to rotate Supervisor log files | #!/usr/bin/env python3
#
# Rotates and (optionally) compresses Supervisor logs using `logrotate`
#
# See:
#
# * https://www.rounds.com/blog/easy-logging-with-logrotate-and-supervisord/
# * https://gist.github.com/glarrain/6165987
#
import os
import subprocess
import tempfile
from mediawords.util.config import get_con... | <commit_before><commit_msg>Add script to rotate Supervisor log files<commit_after> | #!/usr/bin/env python3
#
# Rotates and (optionally) compresses Supervisor logs using `logrotate`
#
# See:
#
# * https://www.rounds.com/blog/easy-logging-with-logrotate-and-supervisord/
# * https://gist.github.com/glarrain/6165987
#
import os
import subprocess
import tempfile
from mediawords.util.config import get_con... | Add script to rotate Supervisor log files#!/usr/bin/env python3
#
# Rotates and (optionally) compresses Supervisor logs using `logrotate`
#
# See:
#
# * https://www.rounds.com/blog/easy-logging-with-logrotate-and-supervisord/
# * https://gist.github.com/glarrain/6165987
#
import os
import subprocess
import tempfile
f... | <commit_before><commit_msg>Add script to rotate Supervisor log files<commit_after>#!/usr/bin/env python3
#
# Rotates and (optionally) compresses Supervisor logs using `logrotate`
#
# See:
#
# * https://www.rounds.com/blog/easy-logging-with-logrotate-and-supervisord/
# * https://gist.github.com/glarrain/6165987
#
impor... | |
38499870ade3e96e003373d599bb94f089e57768 | cptm/tabular2cpt_input.py | cptm/tabular2cpt_input.py | """Script that converts a field in a tabular data file to cptm input files
Used for the CAP vragenuurtje data.
Uses frog to pos-tag and lemmatize the data.
Usage: python tabular2cpt_input.py <csv of excel file> <full text field name>
<dir out>
"""
import pandas as pd
import logging
import sys
import argparse
import... | Add script that converts a field in a tabular data file to cptm input | Add script that converts a field in a tabular data file to cptm input
| Python | apache-2.0 | NLeSC/cptm,NLeSC/cptm | Add script that converts a field in a tabular data file to cptm input | """Script that converts a field in a tabular data file to cptm input files
Used for the CAP vragenuurtje data.
Uses frog to pos-tag and lemmatize the data.
Usage: python tabular2cpt_input.py <csv of excel file> <full text field name>
<dir out>
"""
import pandas as pd
import logging
import sys
import argparse
import... | <commit_before><commit_msg>Add script that converts a field in a tabular data file to cptm input<commit_after> | """Script that converts a field in a tabular data file to cptm input files
Used for the CAP vragenuurtje data.
Uses frog to pos-tag and lemmatize the data.
Usage: python tabular2cpt_input.py <csv of excel file> <full text field name>
<dir out>
"""
import pandas as pd
import logging
import sys
import argparse
import... | Add script that converts a field in a tabular data file to cptm input"""Script that converts a field in a tabular data file to cptm input files
Used for the CAP vragenuurtje data.
Uses frog to pos-tag and lemmatize the data.
Usage: python tabular2cpt_input.py <csv of excel file> <full text field name>
<dir out>
"""
... | <commit_before><commit_msg>Add script that converts a field in a tabular data file to cptm input<commit_after>"""Script that converts a field in a tabular data file to cptm input files
Used for the CAP vragenuurtje data.
Uses frog to pos-tag and lemmatize the data.
Usage: python tabular2cpt_input.py <csv of excel fi... | |
c32514d224704cdd247a3b1da3519af277065d8e | nettests/experimental/dns_injection.py | nettests/experimental/dns_injection.py | # -*- encoding: utf-8 -*-
from twisted.python import usage
from twisted.internet import defer
from ooni.templates import dnst
from ooni import nettest
from ooni.utils import log
class UsageOptions(usage.Options):
optParameters = [
['resolver', 'r', '8.8.8.1', 'an invalid DNS resolver'],
['... | Add DNS injection test for detecting censorship when DNS inject happens | Add DNS injection test for detecting censorship when DNS inject happens
| Python | bsd-2-clause | lordappsec/ooni-probe,kdmurray91/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,lordappsec/ooni-probe,lordappsec/ooni-probe,kdmurray91/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,juga0/ooni-probe,lordappsec/ooni-probe,0xPoly/ooni-probe,kdmurray91/o... | Add DNS injection test for detecting censorship when DNS inject happens | # -*- encoding: utf-8 -*-
from twisted.python import usage
from twisted.internet import defer
from ooni.templates import dnst
from ooni import nettest
from ooni.utils import log
class UsageOptions(usage.Options):
optParameters = [
['resolver', 'r', '8.8.8.1', 'an invalid DNS resolver'],
['... | <commit_before><commit_msg>Add DNS injection test for detecting censorship when DNS inject happens<commit_after> | # -*- encoding: utf-8 -*-
from twisted.python import usage
from twisted.internet import defer
from ooni.templates import dnst
from ooni import nettest
from ooni.utils import log
class UsageOptions(usage.Options):
optParameters = [
['resolver', 'r', '8.8.8.1', 'an invalid DNS resolver'],
['... | Add DNS injection test for detecting censorship when DNS inject happens# -*- encoding: utf-8 -*-
from twisted.python import usage
from twisted.internet import defer
from ooni.templates import dnst
from ooni import nettest
from ooni.utils import log
class UsageOptions(usage.Options):
optParameters = [
... | <commit_before><commit_msg>Add DNS injection test for detecting censorship when DNS inject happens<commit_after># -*- encoding: utf-8 -*-
from twisted.python import usage
from twisted.internet import defer
from ooni.templates import dnst
from ooni import nettest
from ooni.utils import log
class UsageOptions(usage.Opt... | |
ebc4f60368a1ca3216621c74733059125b565940 | src/lexus/kucera_francis.py | src/lexus/kucera_francis.py | __author__ = 's7a'
# The Kucera Francis class
class KuceraFrancis:
# Constructor for the Kucera Francis class
def __init__(self, dict_file):
dict = open(dict_file, 'r')
# Construct the Kucera Francis frequency dictionary
self.kucera_francis_frequency = {}
for line in dict.re... | Add the Kucera Francis library | Add the Kucera Francis library
| Python | mit | Somsubhra/Simplify,Somsubhra/Simplify,Somsubhra/Simplify | Add the Kucera Francis library | __author__ = 's7a'
# The Kucera Francis class
class KuceraFrancis:
# Constructor for the Kucera Francis class
def __init__(self, dict_file):
dict = open(dict_file, 'r')
# Construct the Kucera Francis frequency dictionary
self.kucera_francis_frequency = {}
for line in dict.re... | <commit_before><commit_msg>Add the Kucera Francis library<commit_after> | __author__ = 's7a'
# The Kucera Francis class
class KuceraFrancis:
# Constructor for the Kucera Francis class
def __init__(self, dict_file):
dict = open(dict_file, 'r')
# Construct the Kucera Francis frequency dictionary
self.kucera_francis_frequency = {}
for line in dict.re... | Add the Kucera Francis library__author__ = 's7a'
# The Kucera Francis class
class KuceraFrancis:
# Constructor for the Kucera Francis class
def __init__(self, dict_file):
dict = open(dict_file, 'r')
# Construct the Kucera Francis frequency dictionary
self.kucera_francis_frequency = {... | <commit_before><commit_msg>Add the Kucera Francis library<commit_after>__author__ = 's7a'
# The Kucera Francis class
class KuceraFrancis:
# Constructor for the Kucera Francis class
def __init__(self, dict_file):
dict = open(dict_file, 'r')
# Construct the Kucera Francis frequency dictionary
... | |
f144f3a36c6011203a6b1d396233e64e7a8dc089 | examples/speed_test.py | examples/speed_test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import initExample
from lase.core import KClient
from lase.drivers import Oscillo
import numpy as np
import matplotlib.pyplot as plt
import time
def speed_test(host, n_pts=200):
time_array = np.zeros(n_pts)
client = KClient(host)
driver = Oscillo(client)
... | Add speed test in examples | Add speed test in examples
| Python | mit | Koheron/lase | Add speed test in examples | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import initExample
from lase.core import KClient
from lase.drivers import Oscillo
import numpy as np
import matplotlib.pyplot as plt
import time
def speed_test(host, n_pts=200):
time_array = np.zeros(n_pts)
client = KClient(host)
driver = Oscillo(client)
... | <commit_before><commit_msg>Add speed test in examples<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import initExample
from lase.core import KClient
from lase.drivers import Oscillo
import numpy as np
import matplotlib.pyplot as plt
import time
def speed_test(host, n_pts=200):
time_array = np.zeros(n_pts)
client = KClient(host)
driver = Oscillo(client)
... | Add speed test in examples#!/usr/bin/env python
# -*- coding: utf-8 -*-
import initExample
from lase.core import KClient
from lase.drivers import Oscillo
import numpy as np
import matplotlib.pyplot as plt
import time
def speed_test(host, n_pts=200):
time_array = np.zeros(n_pts)
client = KClient(host)
dri... | <commit_before><commit_msg>Add speed test in examples<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import initExample
from lase.core import KClient
from lase.drivers import Oscillo
import numpy as np
import matplotlib.pyplot as plt
import time
def speed_test(host, n_pts=200):
time_array = np.zeros(... | |
8661b02ca1bcfb3fab9c41c9ec6d620d4d62355b | src/rgb.py | src/rgb.py | #!/usr/bin/env python
### Class to control the RGB LED Indicator ###
import Adafruit_BBIO.GPIO as GPIO
import time
class RGBController(object):
def __init__(self, red_pin = "P8_10", green_pin = "P8_12", blue_pin = "P8_14"):
self.red_pin = red_pin
self.green_pin = green_pin
self.blue_pin... | Add RGBController class for LED indicator control | Add RGBController class for LED indicator control | Python | mit | swbooking/RobotMaria | Add RGBController class for LED indicator control | #!/usr/bin/env python
### Class to control the RGB LED Indicator ###
import Adafruit_BBIO.GPIO as GPIO
import time
class RGBController(object):
def __init__(self, red_pin = "P8_10", green_pin = "P8_12", blue_pin = "P8_14"):
self.red_pin = red_pin
self.green_pin = green_pin
self.blue_pin... | <commit_before><commit_msg>Add RGBController class for LED indicator control<commit_after> | #!/usr/bin/env python
### Class to control the RGB LED Indicator ###
import Adafruit_BBIO.GPIO as GPIO
import time
class RGBController(object):
def __init__(self, red_pin = "P8_10", green_pin = "P8_12", blue_pin = "P8_14"):
self.red_pin = red_pin
self.green_pin = green_pin
self.blue_pin... | Add RGBController class for LED indicator control#!/usr/bin/env python
### Class to control the RGB LED Indicator ###
import Adafruit_BBIO.GPIO as GPIO
import time
class RGBController(object):
def __init__(self, red_pin = "P8_10", green_pin = "P8_12", blue_pin = "P8_14"):
self.red_pin = red_pin
... | <commit_before><commit_msg>Add RGBController class for LED indicator control<commit_after>#!/usr/bin/env python
### Class to control the RGB LED Indicator ###
import Adafruit_BBIO.GPIO as GPIO
import time
class RGBController(object):
def __init__(self, red_pin = "P8_10", green_pin = "P8_12", blue_pin = "P8_14")... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.