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
480852bb1dd6796b7fb12e40edc924b9a4dbee60
test/test_misc.py
test/test_misc.py
import unittest from .helpers import run_module class MiscTests(unittest.TestCase): def setUp(self): self.name = "benchmarker" def test_no_framework(self): with self.assertRaises(Exception): run_module(self.name) def test_no_problem(self): with self.assertRaises(Exce...
Add tests to cover no framework, no problem
Add tests to cover no framework, no problem
Python
mpl-2.0
undertherain/benchmarker,undertherain/benchmarker,undertherain/benchmarker,undertherain/benchmarker
Add tests to cover no framework, no problem
import unittest from .helpers import run_module class MiscTests(unittest.TestCase): def setUp(self): self.name = "benchmarker" def test_no_framework(self): with self.assertRaises(Exception): run_module(self.name) def test_no_problem(self): with self.assertRaises(Exce...
<commit_before><commit_msg>Add tests to cover no framework, no problem<commit_after>
import unittest from .helpers import run_module class MiscTests(unittest.TestCase): def setUp(self): self.name = "benchmarker" def test_no_framework(self): with self.assertRaises(Exception): run_module(self.name) def test_no_problem(self): with self.assertRaises(Exce...
Add tests to cover no framework, no problemimport unittest from .helpers import run_module class MiscTests(unittest.TestCase): def setUp(self): self.name = "benchmarker" def test_no_framework(self): with self.assertRaises(Exception): run_module(self.name) def test_no_problem...
<commit_before><commit_msg>Add tests to cover no framework, no problem<commit_after>import unittest from .helpers import run_module class MiscTests(unittest.TestCase): def setUp(self): self.name = "benchmarker" def test_no_framework(self): with self.assertRaises(Exception): run_m...
3b66fbc844b023003420db7a9986811110f55489
tests/test_run.py
tests/test_run.py
import sys import tempfile import unittest try: from StringIO import StringIO except ImportError: from io import StringIO import icon_font_to_png class TestRun(unittest.TestCase): def create_css_file(self, contents): css_file = tempfile.NamedTemporaryFile() css_file.write(contents.encode(...
Add tests for the run() function
Add tests for the run() function
Python
mit
Pythonity/icon-font-to-png
Add tests for the run() function
import sys import tempfile import unittest try: from StringIO import StringIO except ImportError: from io import StringIO import icon_font_to_png class TestRun(unittest.TestCase): def create_css_file(self, contents): css_file = tempfile.NamedTemporaryFile() css_file.write(contents.encode(...
<commit_before><commit_msg>Add tests for the run() function<commit_after>
import sys import tempfile import unittest try: from StringIO import StringIO except ImportError: from io import StringIO import icon_font_to_png class TestRun(unittest.TestCase): def create_css_file(self, contents): css_file = tempfile.NamedTemporaryFile() css_file.write(contents.encode(...
Add tests for the run() functionimport sys import tempfile import unittest try: from StringIO import StringIO except ImportError: from io import StringIO import icon_font_to_png class TestRun(unittest.TestCase): def create_css_file(self, contents): css_file = tempfile.NamedTemporaryFile() ...
<commit_before><commit_msg>Add tests for the run() function<commit_after>import sys import tempfile import unittest try: from StringIO import StringIO except ImportError: from io import StringIO import icon_font_to_png class TestRun(unittest.TestCase): def create_css_file(self, contents): css_fil...
578de6c57f9698c7e273af06d1e815f71269bb18
tests/to_debug.py
tests/to_debug.py
import sys import os import time import threading import ikpdb TEST_MULTI_THREADING = False TEST_EXCEPTION_PROPAGATION = False TEST_POSTMORTEM = True TEST_SYS_EXIT = 0 TEST_STEPPING = False # Note that ikpdb.set_trace() will reset/mess breakpoints set using GUI TEST_SET_TRACE = False TCB = TEST_CONDITIONAL_BREAKPO...
Add a sample python file interesting to debug
Add a sample python file interesting to debug
Python
mit
audaxis/ikpdb,audaxis/ikpdb
Add a sample python file interesting to debug
import sys import os import time import threading import ikpdb TEST_MULTI_THREADING = False TEST_EXCEPTION_PROPAGATION = False TEST_POSTMORTEM = True TEST_SYS_EXIT = 0 TEST_STEPPING = False # Note that ikpdb.set_trace() will reset/mess breakpoints set using GUI TEST_SET_TRACE = False TCB = TEST_CONDITIONAL_BREAKPO...
<commit_before><commit_msg>Add a sample python file interesting to debug<commit_after>
import sys import os import time import threading import ikpdb TEST_MULTI_THREADING = False TEST_EXCEPTION_PROPAGATION = False TEST_POSTMORTEM = True TEST_SYS_EXIT = 0 TEST_STEPPING = False # Note that ikpdb.set_trace() will reset/mess breakpoints set using GUI TEST_SET_TRACE = False TCB = TEST_CONDITIONAL_BREAKPO...
Add a sample python file interesting to debugimport sys import os import time import threading import ikpdb TEST_MULTI_THREADING = False TEST_EXCEPTION_PROPAGATION = False TEST_POSTMORTEM = True TEST_SYS_EXIT = 0 TEST_STEPPING = False # Note that ikpdb.set_trace() will reset/mess breakpoints set using GUI TEST_SET_TR...
<commit_before><commit_msg>Add a sample python file interesting to debug<commit_after>import sys import os import time import threading import ikpdb TEST_MULTI_THREADING = False TEST_EXCEPTION_PROPAGATION = False TEST_POSTMORTEM = True TEST_SYS_EXIT = 0 TEST_STEPPING = False # Note that ikpdb.set_trace() will reset/m...
f6f2c6fc2a51bb3243d9b99ab1093809a2d1a5bb
test_players.py
test_players.py
from AI import * import random def RandomPlayer(game): return 0, random.choice(game.get_available_moves()) def ABPlayer(game): return alpha_beta_search(game, 8, -np.inf, np.inf, True, evaluate_base) def ABChainPlayer1(game): return alpha_beta_search(game, 7, -np.inf, np.inf, True, evaluate_chain_len) de...
Add script that tests AI players
Add script that tests AI players
Python
mit
giovannipcarvalho/dots-and-boxes
Add script that tests AI players
from AI import * import random def RandomPlayer(game): return 0, random.choice(game.get_available_moves()) def ABPlayer(game): return alpha_beta_search(game, 8, -np.inf, np.inf, True, evaluate_base) def ABChainPlayer1(game): return alpha_beta_search(game, 7, -np.inf, np.inf, True, evaluate_chain_len) de...
<commit_before><commit_msg>Add script that tests AI players<commit_after>
from AI import * import random def RandomPlayer(game): return 0, random.choice(game.get_available_moves()) def ABPlayer(game): return alpha_beta_search(game, 8, -np.inf, np.inf, True, evaluate_base) def ABChainPlayer1(game): return alpha_beta_search(game, 7, -np.inf, np.inf, True, evaluate_chain_len) de...
Add script that tests AI playersfrom AI import * import random def RandomPlayer(game): return 0, random.choice(game.get_available_moves()) def ABPlayer(game): return alpha_beta_search(game, 8, -np.inf, np.inf, True, evaluate_base) def ABChainPlayer1(game): return alpha_beta_search(game, 7, -np.inf, np.in...
<commit_before><commit_msg>Add script that tests AI players<commit_after>from AI import * import random def RandomPlayer(game): return 0, random.choice(game.get_available_moves()) def ABPlayer(game): return alpha_beta_search(game, 8, -np.inf, np.inf, True, evaluate_base) def ABChainPlayer1(game): return ...
da2b773bf6e669b3ec50bbd6af73e1d80bb0b5a5
tsstats/events.py
tsstats/events.py
from collections import namedtuple Event = namedtuple( 'Event', ['timestamp', 'identifier', 'action', 'arg', 'arg_is_client'] ) def nick(timestamp, identifier, nick): return Event(timestamp, identifier, 'set_nick', nick, arg_is_client=False) def connect(timestamp, identifier): return Event( tim...
Add tsstats/event.py for easy event-initialization
Add tsstats/event.py for easy event-initialization
Python
mit
Thor77/TeamspeakStats,Thor77/TeamspeakStats
Add tsstats/event.py for easy event-initialization
from collections import namedtuple Event = namedtuple( 'Event', ['timestamp', 'identifier', 'action', 'arg', 'arg_is_client'] ) def nick(timestamp, identifier, nick): return Event(timestamp, identifier, 'set_nick', nick, arg_is_client=False) def connect(timestamp, identifier): return Event( tim...
<commit_before><commit_msg>Add tsstats/event.py for easy event-initialization<commit_after>
from collections import namedtuple Event = namedtuple( 'Event', ['timestamp', 'identifier', 'action', 'arg', 'arg_is_client'] ) def nick(timestamp, identifier, nick): return Event(timestamp, identifier, 'set_nick', nick, arg_is_client=False) def connect(timestamp, identifier): return Event( tim...
Add tsstats/event.py for easy event-initializationfrom collections import namedtuple Event = namedtuple( 'Event', ['timestamp', 'identifier', 'action', 'arg', 'arg_is_client'] ) def nick(timestamp, identifier, nick): return Event(timestamp, identifier, 'set_nick', nick, arg_is_client=False) def connect(tim...
<commit_before><commit_msg>Add tsstats/event.py for easy event-initialization<commit_after>from collections import namedtuple Event = namedtuple( 'Event', ['timestamp', 'identifier', 'action', 'arg', 'arg_is_client'] ) def nick(timestamp, identifier, nick): return Event(timestamp, identifier, 'set_nick', nic...
c0b05a43e10693f8aab87a7f86726d512b7494fc
bluebottle/clients/management/commands/export_tenants.py
bluebottle/clients/management/commands/export_tenants.py
import json from rest_framework.authtoken.models import Token from django.contrib.contenttypes.models import ContentType from django.core.management.base import BaseCommand from bluebottle.clients import properties from bluebottle.clients.models import Client from bluebottle.clients.utils import LocalTenant class C...
Add tenant exporter for accounting
Add tenant exporter for accounting
Python
bsd-3-clause
onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle
Add tenant exporter for accounting
import json from rest_framework.authtoken.models import Token from django.contrib.contenttypes.models import ContentType from django.core.management.base import BaseCommand from bluebottle.clients import properties from bluebottle.clients.models import Client from bluebottle.clients.utils import LocalTenant class C...
<commit_before><commit_msg>Add tenant exporter for accounting<commit_after>
import json from rest_framework.authtoken.models import Token from django.contrib.contenttypes.models import ContentType from django.core.management.base import BaseCommand from bluebottle.clients import properties from bluebottle.clients.models import Client from bluebottle.clients.utils import LocalTenant class C...
Add tenant exporter for accountingimport json from rest_framework.authtoken.models import Token from django.contrib.contenttypes.models import ContentType from django.core.management.base import BaseCommand from bluebottle.clients import properties from bluebottle.clients.models import Client from bluebottle.clients....
<commit_before><commit_msg>Add tenant exporter for accounting<commit_after>import json from rest_framework.authtoken.models import Token from django.contrib.contenttypes.models import ContentType from django.core.management.base import BaseCommand from bluebottle.clients import properties from bluebottle.clients.mode...
dfbf888ca0b56448a4f211900b16e3c85648b241
editorsnotes/main/migrations/0025_auto_20160628_0913.py
editorsnotes/main/migrations/0025_auto_20160628_0913.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-06-28 09:13 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0024_topic_ld'), ] operations = [ migrations.AlterField( ...
Add migration for changing docstring of Note.is_private to unicode
Add migration for changing docstring of Note.is_private to unicode (instead of a bytes)
Python
agpl-3.0
editorsnotes/editorsnotes,editorsnotes/editorsnotes
Add migration for changing docstring of Note.is_private to unicode (instead of a bytes)
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-06-28 09:13 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0024_topic_ld'), ] operations = [ migrations.AlterField( ...
<commit_before><commit_msg>Add migration for changing docstring of Note.is_private to unicode (instead of a bytes)<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-06-28 09:13 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0024_topic_ld'), ] operations = [ migrations.AlterField( ...
Add migration for changing docstring of Note.is_private to unicode (instead of a bytes)# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-06-28 09:13 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main'...
<commit_before><commit_msg>Add migration for changing docstring of Note.is_private to unicode (instead of a bytes)<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-06-28 09:13 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migratio...
25ff8c6f8bc9d70886d004f8b64f08facb8c12cf
leetcode/277-Find-the-Celebrity/FindtheCelebrity_sol.py
leetcode/277-Find-the-Celebrity/FindtheCelebrity_sol.py
# The knows API is already defined for you. # @param a, person a # @param b, person b # @return a boolean, whether a knows b # def knows(a, b): class Solution(object): def findCelebrity(self, n): """ :type n: int :rtype: int """ if n < 2: return -1 candi...
Create Find the Celebrity sol for Leetcode
Create Find the Celebrity sol for Leetcode
Python
mit
Chasego/cod,cc13ny/algo,cc13ny/Allin,Chasego/cod,cc13ny/Allin,cc13ny/algo,Chasego/codirit,Chasego/codirit,cc13ny/algo,cc13ny/Allin,cc13ny/algo,Chasego/codirit,cc13ny/algo,Chasego/codi,Chasego/codi,Chasego/codi,cc13ny/Allin,Chasego/codirit,Chasego/codi,Chasego/cod,Chasego/codi,Chasego/codirit,Chasego/cod,cc13ny/Allin,Ch...
Create Find the Celebrity sol for Leetcode
# The knows API is already defined for you. # @param a, person a # @param b, person b # @return a boolean, whether a knows b # def knows(a, b): class Solution(object): def findCelebrity(self, n): """ :type n: int :rtype: int """ if n < 2: return -1 candi...
<commit_before><commit_msg>Create Find the Celebrity sol for Leetcode<commit_after>
# The knows API is already defined for you. # @param a, person a # @param b, person b # @return a boolean, whether a knows b # def knows(a, b): class Solution(object): def findCelebrity(self, n): """ :type n: int :rtype: int """ if n < 2: return -1 candi...
Create Find the Celebrity sol for Leetcode# The knows API is already defined for you. # @param a, person a # @param b, person b # @return a boolean, whether a knows b # def knows(a, b): class Solution(object): def findCelebrity(self, n): """ :type n: int :rtype: int """ if n...
<commit_before><commit_msg>Create Find the Celebrity sol for Leetcode<commit_after># The knows API is already defined for you. # @param a, person a # @param b, person b # @return a boolean, whether a knows b # def knows(a, b): class Solution(object): def findCelebrity(self, n): """ :type n: int ...
1a4052deb8e0ab2deb7038220ae23d7bb9311ce9
ovf_to_facter.py
ovf_to_facter.py
#!/usr/bin/python #stdlib import json import os import subprocess from xml.dom.minidom import parseString def which(cmd): """Python implementation of `which` command.""" for path in os.environ["PATH"].split(os.pathsep): file = os.path.join(path, cmd) if os.path.exists(file) and os.access(file,...
Add initial version of the script
Add initial version of the script
Python
mit
agarstang/vmware-ofv-to-facter
Add initial version of the script
#!/usr/bin/python #stdlib import json import os import subprocess from xml.dom.minidom import parseString def which(cmd): """Python implementation of `which` command.""" for path in os.environ["PATH"].split(os.pathsep): file = os.path.join(path, cmd) if os.path.exists(file) and os.access(file,...
<commit_before><commit_msg>Add initial version of the script<commit_after>
#!/usr/bin/python #stdlib import json import os import subprocess from xml.dom.minidom import parseString def which(cmd): """Python implementation of `which` command.""" for path in os.environ["PATH"].split(os.pathsep): file = os.path.join(path, cmd) if os.path.exists(file) and os.access(file,...
Add initial version of the script#!/usr/bin/python #stdlib import json import os import subprocess from xml.dom.minidom import parseString def which(cmd): """Python implementation of `which` command.""" for path in os.environ["PATH"].split(os.pathsep): file = os.path.join(path, cmd) if os.path...
<commit_before><commit_msg>Add initial version of the script<commit_after>#!/usr/bin/python #stdlib import json import os import subprocess from xml.dom.minidom import parseString def which(cmd): """Python implementation of `which` command.""" for path in os.environ["PATH"].split(os.pathsep): file = o...
1396ff4ab4e6664c265f97958951815a525f7823
reddit_donate/pages.py
reddit_donate/pages.py
from r2.lib.pages import Reddit from r2.lib.wrapped import Templated class DonatePage(Reddit): extra_stylesheets = Reddit.extra_stylesheets + ["donate.less"] def __init__(self, title, content, **kwargs): Reddit.__init__( self, title=title, content=content, ...
from r2.lib.pages import Reddit from r2.lib.wrapped import Templated class DonatePage(Reddit): extra_stylesheets = Reddit.extra_stylesheets + ["donate.less"] def __init__(self, title, content, **kwargs): Reddit.__init__( self, title=title, content=content, ...
Remove confusing navigation tabs from header.
Remove confusing navigation tabs from header.
Python
bsd-3-clause
reddit/reddit-plugin-donate,madbook/reddit-plugin-donate,reddit/reddit-plugin-donate,madbook/reddit-plugin-donate,madbook/reddit-plugin-donate,reddit/reddit-plugin-donate
from r2.lib.pages import Reddit from r2.lib.wrapped import Templated class DonatePage(Reddit): extra_stylesheets = Reddit.extra_stylesheets + ["donate.less"] def __init__(self, title, content, **kwargs): Reddit.__init__( self, title=title, content=content, ...
from r2.lib.pages import Reddit from r2.lib.wrapped import Templated class DonatePage(Reddit): extra_stylesheets = Reddit.extra_stylesheets + ["donate.less"] def __init__(self, title, content, **kwargs): Reddit.__init__( self, title=title, content=content, ...
<commit_before>from r2.lib.pages import Reddit from r2.lib.wrapped import Templated class DonatePage(Reddit): extra_stylesheets = Reddit.extra_stylesheets + ["donate.less"] def __init__(self, title, content, **kwargs): Reddit.__init__( self, title=title, content=co...
from r2.lib.pages import Reddit from r2.lib.wrapped import Templated class DonatePage(Reddit): extra_stylesheets = Reddit.extra_stylesheets + ["donate.less"] def __init__(self, title, content, **kwargs): Reddit.__init__( self, title=title, content=content, ...
from r2.lib.pages import Reddit from r2.lib.wrapped import Templated class DonatePage(Reddit): extra_stylesheets = Reddit.extra_stylesheets + ["donate.less"] def __init__(self, title, content, **kwargs): Reddit.__init__( self, title=title, content=content, ...
<commit_before>from r2.lib.pages import Reddit from r2.lib.wrapped import Templated class DonatePage(Reddit): extra_stylesheets = Reddit.extra_stylesheets + ["donate.less"] def __init__(self, title, content, **kwargs): Reddit.__init__( self, title=title, content=co...
4db13bdab18934bebcfe5b102044f936e0eab892
etc/component_list.py
etc/component_list.py
COMPONENTS = [ "AdaBoost", "AutoInvert", "AutoMlpClassifier", "BiggestCcExtractor", "BinarizeByHT", "BinarizeByOtsu", "BinarizeByRange", "BinarizeBySauvola", "BitDataset", "BitNN", "BookStore", "CascadedMLP", "CenterFeatureMap", "ConnectedComponentSegmenter", "CurvedCutSegmenter", "CurvedCutWithCcSe...
Add a place to put random stuff and a list of components as a python module.
Add a place to put random stuff and a list of components as a python module.
Python
apache-2.0
vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium
Add a place to put random stuff and a list of components as a python module.
COMPONENTS = [ "AdaBoost", "AutoInvert", "AutoMlpClassifier", "BiggestCcExtractor", "BinarizeByHT", "BinarizeByOtsu", "BinarizeByRange", "BinarizeBySauvola", "BitDataset", "BitNN", "BookStore", "CascadedMLP", "CenterFeatureMap", "ConnectedComponentSegmenter", "CurvedCutSegmenter", "CurvedCutWithCcSe...
<commit_before><commit_msg>Add a place to put random stuff and a list of components as a python module.<commit_after>
COMPONENTS = [ "AdaBoost", "AutoInvert", "AutoMlpClassifier", "BiggestCcExtractor", "BinarizeByHT", "BinarizeByOtsu", "BinarizeByRange", "BinarizeBySauvola", "BitDataset", "BitNN", "BookStore", "CascadedMLP", "CenterFeatureMap", "ConnectedComponentSegmenter", "CurvedCutSegmenter", "CurvedCutWithCcSe...
Add a place to put random stuff and a list of components as a python module.COMPONENTS = [ "AdaBoost", "AutoInvert", "AutoMlpClassifier", "BiggestCcExtractor", "BinarizeByHT", "BinarizeByOtsu", "BinarizeByRange", "BinarizeBySauvola", "BitDataset", "BitNN", "BookStore", "CascadedMLP", "CenterFeatureMap"...
<commit_before><commit_msg>Add a place to put random stuff and a list of components as a python module.<commit_after>COMPONENTS = [ "AdaBoost", "AutoInvert", "AutoMlpClassifier", "BiggestCcExtractor", "BinarizeByHT", "BinarizeByOtsu", "BinarizeByRange", "BinarizeBySauvola", "BitDataset", "BitNN", "BookSt...
0ede4e22370a3f8217fee8ff995a9c7057d8b00b
vumi_http_retry/tests/test_redis.py
vumi_http_retry/tests/test_redis.py
import json from twisted.trial.unittest import TestCase from twisted.internet.defer import inlineCallbacks from vumi_http_retry.tests.redis import create_client, zitems class TestRedis(TestCase): @inlineCallbacks def setUp(self): self.redis = yield create_client() @inlineCallbacks def tearD...
Add test for redis test helper
Add test for redis test helper
Python
bsd-3-clause
praekelt/vumi-http-retry-api,praekelt/vumi-http-retry-api
Add test for redis test helper
import json from twisted.trial.unittest import TestCase from twisted.internet.defer import inlineCallbacks from vumi_http_retry.tests.redis import create_client, zitems class TestRedis(TestCase): @inlineCallbacks def setUp(self): self.redis = yield create_client() @inlineCallbacks def tearD...
<commit_before><commit_msg>Add test for redis test helper<commit_after>
import json from twisted.trial.unittest import TestCase from twisted.internet.defer import inlineCallbacks from vumi_http_retry.tests.redis import create_client, zitems class TestRedis(TestCase): @inlineCallbacks def setUp(self): self.redis = yield create_client() @inlineCallbacks def tearD...
Add test for redis test helperimport json from twisted.trial.unittest import TestCase from twisted.internet.defer import inlineCallbacks from vumi_http_retry.tests.redis import create_client, zitems class TestRedis(TestCase): @inlineCallbacks def setUp(self): self.redis = yield create_client() ...
<commit_before><commit_msg>Add test for redis test helper<commit_after>import json from twisted.trial.unittest import TestCase from twisted.internet.defer import inlineCallbacks from vumi_http_retry.tests.redis import create_client, zitems class TestRedis(TestCase): @inlineCallbacks def setUp(self): ...
fa55ceb71ff254f8ed3413a35acfe20da7c03a91
rxbtcomm.py
rxbtcomm.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2016 F Dou<programmingrobotsstudygroup@gmail.com> # See LICENSE for details. import bluetooth import logging class RxBtComm(object): """BT communication wrapper: Attributes: addy: A string representing the device address. name: A stri...
Create BT Comm wrapper class
Create BT Comm wrapper class
Python
apache-2.0
javatechs/RxCmd,javatechs/RxCmd,javatechs/RxCmd
Create BT Comm wrapper class
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2016 F Dou<programmingrobotsstudygroup@gmail.com> # See LICENSE for details. import bluetooth import logging class RxBtComm(object): """BT communication wrapper: Attributes: addy: A string representing the device address. name: A stri...
<commit_before><commit_msg>Create BT Comm wrapper class<commit_after>
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2016 F Dou<programmingrobotsstudygroup@gmail.com> # See LICENSE for details. import bluetooth import logging class RxBtComm(object): """BT communication wrapper: Attributes: addy: A string representing the device address. name: A stri...
Create BT Comm wrapper class#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2016 F Dou<programmingrobotsstudygroup@gmail.com> # See LICENSE for details. import bluetooth import logging class RxBtComm(object): """BT communication wrapper: Attributes: addy: A string representing the device a...
<commit_before><commit_msg>Create BT Comm wrapper class<commit_after>#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2016 F Dou<programmingrobotsstudygroup@gmail.com> # See LICENSE for details. import bluetooth import logging class RxBtComm(object): """BT communication wrapper: Attributes: ...
3de2e625af9047b64cc2718e6e79be0c428b6ae7
CodeFights/extractEachKth.py
CodeFights/extractEachKth.py
#!/usr/local/bin/python # Code Fights Extract Each Kth Problem def extractEachKth(inputArray, k): return [e for i, e in enumerate(inputArray) if (i + 1) % k != 0] def main(): tests = [ [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 3, [1, 2, 4, 5, 7, 8, 10]], [[1, 1, 1, 1, 1], 1, []], [[1, 2, 1, ...
Solve Code Fights extract each kth problem
Solve Code Fights extract each kth problem
Python
mit
HKuz/Test_Code
Solve Code Fights extract each kth problem
#!/usr/local/bin/python # Code Fights Extract Each Kth Problem def extractEachKth(inputArray, k): return [e for i, e in enumerate(inputArray) if (i + 1) % k != 0] def main(): tests = [ [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 3, [1, 2, 4, 5, 7, 8, 10]], [[1, 1, 1, 1, 1], 1, []], [[1, 2, 1, ...
<commit_before><commit_msg>Solve Code Fights extract each kth problem<commit_after>
#!/usr/local/bin/python # Code Fights Extract Each Kth Problem def extractEachKth(inputArray, k): return [e for i, e in enumerate(inputArray) if (i + 1) % k != 0] def main(): tests = [ [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 3, [1, 2, 4, 5, 7, 8, 10]], [[1, 1, 1, 1, 1], 1, []], [[1, 2, 1, ...
Solve Code Fights extract each kth problem#!/usr/local/bin/python # Code Fights Extract Each Kth Problem def extractEachKth(inputArray, k): return [e for i, e in enumerate(inputArray) if (i + 1) % k != 0] def main(): tests = [ [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 3, [1, 2, 4, 5, 7, 8, 10]], [[1...
<commit_before><commit_msg>Solve Code Fights extract each kth problem<commit_after>#!/usr/local/bin/python # Code Fights Extract Each Kth Problem def extractEachKth(inputArray, k): return [e for i, e in enumerate(inputArray) if (i + 1) % k != 0] def main(): tests = [ [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]...
60b5948508a67cb213ca04b5faacb77e27d8f84c
samples/forms.py
samples/forms.py
import datetime #for checking renewal date range. from django import forms from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from .models import (Patient, AdmissionNote, FluVaccine, CollectionType, CollectedSample, Symptom, ObservedSymptom, ) from fioc...
import datetime #for checking renewal date range. from django import forms from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from .models import (Patient, AdmissionNote, FluVaccine, CollectionType, CollectedSample, Symptom, ObservedSymptom, ) from fioc...
Add fields expicitly declared in form
:art: Add fields expicitly declared in form
Python
mit
gems-uff/labsys,gems-uff/labsys,gems-uff/labsys,gcrsaldanha/fiocruz,gcrsaldanha/fiocruz
import datetime #for checking renewal date range. from django import forms from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from .models import (Patient, AdmissionNote, FluVaccine, CollectionType, CollectedSample, Symptom, ObservedSymptom, ) from fioc...
import datetime #for checking renewal date range. from django import forms from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from .models import (Patient, AdmissionNote, FluVaccine, CollectionType, CollectedSample, Symptom, ObservedSymptom, ) from fioc...
<commit_before>import datetime #for checking renewal date range. from django import forms from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from .models import (Patient, AdmissionNote, FluVaccine, CollectionType, CollectedSample, Symptom, ObservedSympto...
import datetime #for checking renewal date range. from django import forms from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from .models import (Patient, AdmissionNote, FluVaccine, CollectionType, CollectedSample, Symptom, ObservedSymptom, ) from fioc...
import datetime #for checking renewal date range. from django import forms from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from .models import (Patient, AdmissionNote, FluVaccine, CollectionType, CollectedSample, Symptom, ObservedSymptom, ) from fioc...
<commit_before>import datetime #for checking renewal date range. from django import forms from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from .models import (Patient, AdmissionNote, FluVaccine, CollectionType, CollectedSample, Symptom, ObservedSympto...
877a7b7449a1d88c14633376a2dfaca8c619c26a
exercises/chapter_03/exercise_03_06/exercise_03_06.py
exercises/chapter_03/exercise_03_06/exercise_03_06.py
# 3-6 Guest List guest_list = ["Albert Einstein", "Isac Newton", "Marie Curie", "Galileo Galilei"] message = "Hi " + guest_list[0] + " you are invited to dinner at 7 on saturday." print(message) message = "Hi " + guest_list[1] + " you are invited to dinner at 7 on saturday." print(message) message = "Hi " + guest_l...
Add solution to exercis 3.6.
Add solution to exercis 3.6.
Python
mit
HenrikSamuelsson/python-crash-course
Add solution to exercis 3.6.
# 3-6 Guest List guest_list = ["Albert Einstein", "Isac Newton", "Marie Curie", "Galileo Galilei"] message = "Hi " + guest_list[0] + " you are invited to dinner at 7 on saturday." print(message) message = "Hi " + guest_list[1] + " you are invited to dinner at 7 on saturday." print(message) message = "Hi " + guest_l...
<commit_before><commit_msg>Add solution to exercis 3.6.<commit_after>
# 3-6 Guest List guest_list = ["Albert Einstein", "Isac Newton", "Marie Curie", "Galileo Galilei"] message = "Hi " + guest_list[0] + " you are invited to dinner at 7 on saturday." print(message) message = "Hi " + guest_list[1] + " you are invited to dinner at 7 on saturday." print(message) message = "Hi " + guest_l...
Add solution to exercis 3.6.# 3-6 Guest List guest_list = ["Albert Einstein", "Isac Newton", "Marie Curie", "Galileo Galilei"] message = "Hi " + guest_list[0] + " you are invited to dinner at 7 on saturday." print(message) message = "Hi " + guest_list[1] + " you are invited to dinner at 7 on saturday." print(message...
<commit_before><commit_msg>Add solution to exercis 3.6.<commit_after># 3-6 Guest List guest_list = ["Albert Einstein", "Isac Newton", "Marie Curie", "Galileo Galilei"] message = "Hi " + guest_list[0] + " you are invited to dinner at 7 on saturday." print(message) message = "Hi " + guest_list[1] + " you are invited t...
a8db8c0448d98e2de0e662581542bd644e673c7c
geotrek/core/migrations/0018_remove_other_objects_from_factories.py
geotrek/core/migrations/0018_remove_other_objects_from_factories.py
# Generated by Django 2.0.13 on 2020-04-06 13:40 from django.conf import settings from django.contrib.gis.geos import Point, LineString from django.db import migrations def remove_generated_objects_factories(apps, schema_editor): ComfortModel = apps.get_model('core', 'Comfort') PathSourceModel = apps.get_mod...
Add migration removing generated objects with factories
Add migration removing generated objects with factories
Python
bsd-2-clause
makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin
Add migration removing generated objects with factories
# Generated by Django 2.0.13 on 2020-04-06 13:40 from django.conf import settings from django.contrib.gis.geos import Point, LineString from django.db import migrations def remove_generated_objects_factories(apps, schema_editor): ComfortModel = apps.get_model('core', 'Comfort') PathSourceModel = apps.get_mod...
<commit_before><commit_msg>Add migration removing generated objects with factories<commit_after>
# Generated by Django 2.0.13 on 2020-04-06 13:40 from django.conf import settings from django.contrib.gis.geos import Point, LineString from django.db import migrations def remove_generated_objects_factories(apps, schema_editor): ComfortModel = apps.get_model('core', 'Comfort') PathSourceModel = apps.get_mod...
Add migration removing generated objects with factories# Generated by Django 2.0.13 on 2020-04-06 13:40 from django.conf import settings from django.contrib.gis.geos import Point, LineString from django.db import migrations def remove_generated_objects_factories(apps, schema_editor): ComfortModel = apps.get_mode...
<commit_before><commit_msg>Add migration removing generated objects with factories<commit_after># Generated by Django 2.0.13 on 2020-04-06 13:40 from django.conf import settings from django.contrib.gis.geos import Point, LineString from django.db import migrations def remove_generated_objects_factories(apps, schema_...
49c673c5c8374867fc9bf026717fe137bdba84bc
greengraph/test/test_graph.py
greengraph/test/test_graph.py
from greengraph.map import Map from greengraph.graph import Greengraph from mock import patch import geopy from nose.tools import assert_equal start = "London" end = "Durham" def test_Greengraph_init(): with patch.object(geopy.geocoders,'GoogleV3') as mock_GoogleV3: test_Greengraph = Greengraph(start,end)...
Add test file for graph.py and add test of Greengraph class constructor
Add test file for graph.py and add test of Greengraph class constructor
Python
mit
MikeVasmer/GreenGraphCoursework
Add test file for graph.py and add test of Greengraph class constructor
from greengraph.map import Map from greengraph.graph import Greengraph from mock import patch import geopy from nose.tools import assert_equal start = "London" end = "Durham" def test_Greengraph_init(): with patch.object(geopy.geocoders,'GoogleV3') as mock_GoogleV3: test_Greengraph = Greengraph(start,end)...
<commit_before><commit_msg>Add test file for graph.py and add test of Greengraph class constructor<commit_after>
from greengraph.map import Map from greengraph.graph import Greengraph from mock import patch import geopy from nose.tools import assert_equal start = "London" end = "Durham" def test_Greengraph_init(): with patch.object(geopy.geocoders,'GoogleV3') as mock_GoogleV3: test_Greengraph = Greengraph(start,end)...
Add test file for graph.py and add test of Greengraph class constructorfrom greengraph.map import Map from greengraph.graph import Greengraph from mock import patch import geopy from nose.tools import assert_equal start = "London" end = "Durham" def test_Greengraph_init(): with patch.object(geopy.geocoders,'Googl...
<commit_before><commit_msg>Add test file for graph.py and add test of Greengraph class constructor<commit_after>from greengraph.map import Map from greengraph.graph import Greengraph from mock import patch import geopy from nose.tools import assert_equal start = "London" end = "Durham" def test_Greengraph_init(): ...
82e4c67bd7643eed06e7cd170ca1d0de41c70912
core/data/DataAnalyzer.py
core/data/DataAnalyzer.py
""" DataAnalyzer :Authors: Berend Klein Haneveld """ class DataAnalyzer(object): """ DataAnalyzer """ def __init__(self): super(DataAnalyzer, self).__init__() @classmethod def histogramForData(cls, data, nrBins): """ Samples the image data in order to create bins for making a histogram of the data. ...
Add a data analyzer class.
Add a data analyzer class. Might come in handy to get statistical data of image datasets.
Python
mit
berendkleinhaneveld/Registrationshop,berendkleinhaneveld/Registrationshop
Add a data analyzer class. Might come in handy to get statistical data of image datasets.
""" DataAnalyzer :Authors: Berend Klein Haneveld """ class DataAnalyzer(object): """ DataAnalyzer """ def __init__(self): super(DataAnalyzer, self).__init__() @classmethod def histogramForData(cls, data, nrBins): """ Samples the image data in order to create bins for making a histogram of the data. ...
<commit_before><commit_msg>Add a data analyzer class. Might come in handy to get statistical data of image datasets.<commit_after>
""" DataAnalyzer :Authors: Berend Klein Haneveld """ class DataAnalyzer(object): """ DataAnalyzer """ def __init__(self): super(DataAnalyzer, self).__init__() @classmethod def histogramForData(cls, data, nrBins): """ Samples the image data in order to create bins for making a histogram of the data. ...
Add a data analyzer class. Might come in handy to get statistical data of image datasets.""" DataAnalyzer :Authors: Berend Klein Haneveld """ class DataAnalyzer(object): """ DataAnalyzer """ def __init__(self): super(DataAnalyzer, self).__init__() @classmethod def histogramForData(cls, data, nrBins): "...
<commit_before><commit_msg>Add a data analyzer class. Might come in handy to get statistical data of image datasets.<commit_after>""" DataAnalyzer :Authors: Berend Klein Haneveld """ class DataAnalyzer(object): """ DataAnalyzer """ def __init__(self): super(DataAnalyzer, self).__init__() @classmethod def...
3f85610873d88592970c64661e526b2a576e300f
sms_generator.py
sms_generator.py
def generate_new_procedure_message(procedure, ward, timeframe, doctor): unique_reference = str(1) message = str.format("{0} is available on {1}. Attend the ward in {2} and meet {3} in the junior doctors' office. " "To accept this opportunity reply with {4}", pro...
Add new sms message generator
Add new sms message generator
Python
mit
bsharif/SLOT,nhshd-slot/SLOT,bsharif/SLOT,nhshd-slot/SLOT,nhshd-slot/SLOT,bsharif/SLOT
Add new sms message generator
def generate_new_procedure_message(procedure, ward, timeframe, doctor): unique_reference = str(1) message = str.format("{0} is available on {1}. Attend the ward in {2} and meet {3} in the junior doctors' office. " "To accept this opportunity reply with {4}", pro...
<commit_before><commit_msg>Add new sms message generator<commit_after>
def generate_new_procedure_message(procedure, ward, timeframe, doctor): unique_reference = str(1) message = str.format("{0} is available on {1}. Attend the ward in {2} and meet {3} in the junior doctors' office. " "To accept this opportunity reply with {4}", pro...
Add new sms message generatordef generate_new_procedure_message(procedure, ward, timeframe, doctor): unique_reference = str(1) message = str.format("{0} is available on {1}. Attend the ward in {2} and meet {3} in the junior doctors' office. " "To accept this opportunity reply with {4}",...
<commit_before><commit_msg>Add new sms message generator<commit_after>def generate_new_procedure_message(procedure, ward, timeframe, doctor): unique_reference = str(1) message = str.format("{0} is available on {1}. Attend the ward in {2} and meet {3} in the junior doctors' office. " "To...
8e8e11990e430302eca24d32ba0b88dcc66233d6
clburlison_scripts/connect2_wifi_pyobjc/connect2_wifi_pyobjc.py
clburlison_scripts/connect2_wifi_pyobjc/connect2_wifi_pyobjc.py
#!/usr/bin/python """ I didn't create this but I'm storing it so I can reuse it. http://stackoverflow.com/a/34967364/4811765 """ import objc SSID = "MyWifiNetwork" PASSWORD = "MyWifiPassword" objc.loadBundle('CoreWLAN', bundle_path='/System/Library/Frameworks/CoreWLAN.framework', modul...
Add connect2 wifi via pyobjc
Add connect2 wifi via pyobjc
Python
mit
clburlison/scripts,clburlison/scripts,clburlison/scripts
Add connect2 wifi via pyobjc
#!/usr/bin/python """ I didn't create this but I'm storing it so I can reuse it. http://stackoverflow.com/a/34967364/4811765 """ import objc SSID = "MyWifiNetwork" PASSWORD = "MyWifiPassword" objc.loadBundle('CoreWLAN', bundle_path='/System/Library/Frameworks/CoreWLAN.framework', modul...
<commit_before><commit_msg>Add connect2 wifi via pyobjc<commit_after>
#!/usr/bin/python """ I didn't create this but I'm storing it so I can reuse it. http://stackoverflow.com/a/34967364/4811765 """ import objc SSID = "MyWifiNetwork" PASSWORD = "MyWifiPassword" objc.loadBundle('CoreWLAN', bundle_path='/System/Library/Frameworks/CoreWLAN.framework', modul...
Add connect2 wifi via pyobjc#!/usr/bin/python """ I didn't create this but I'm storing it so I can reuse it. http://stackoverflow.com/a/34967364/4811765 """ import objc SSID = "MyWifiNetwork" PASSWORD = "MyWifiPassword" objc.loadBundle('CoreWLAN', bundle_path='/System/Library/Frameworks/CoreWLAN.frame...
<commit_before><commit_msg>Add connect2 wifi via pyobjc<commit_after>#!/usr/bin/python """ I didn't create this but I'm storing it so I can reuse it. http://stackoverflow.com/a/34967364/4811765 """ import objc SSID = "MyWifiNetwork" PASSWORD = "MyWifiPassword" objc.loadBundle('CoreWLAN', bundle_path='...
a6d6b833e33dc465b0fa828018e2cbba748f8282
pygraphc/evaluation/EvaluationUtility.py
pygraphc/evaluation/EvaluationUtility.py
class EvaluationUtility(object): @staticmethod def convert_to_text(graph, clusters): # convert clustering result from graph to text new_clusters = {} for cluster_id, nodes in clusters.iteritems(): for node in nodes: members = graph.node[node]['member'] ...
Add utility class for evaluation
Add utility class for evaluation
Python
mit
studiawan/pygraphc
Add utility class for evaluation
class EvaluationUtility(object): @staticmethod def convert_to_text(graph, clusters): # convert clustering result from graph to text new_clusters = {} for cluster_id, nodes in clusters.iteritems(): for node in nodes: members = graph.node[node]['member'] ...
<commit_before><commit_msg>Add utility class for evaluation<commit_after>
class EvaluationUtility(object): @staticmethod def convert_to_text(graph, clusters): # convert clustering result from graph to text new_clusters = {} for cluster_id, nodes in clusters.iteritems(): for node in nodes: members = graph.node[node]['member'] ...
Add utility class for evaluation class EvaluationUtility(object): @staticmethod def convert_to_text(graph, clusters): # convert clustering result from graph to text new_clusters = {} for cluster_id, nodes in clusters.iteritems(): for node in nodes: members = g...
<commit_before><commit_msg>Add utility class for evaluation<commit_after> class EvaluationUtility(object): @staticmethod def convert_to_text(graph, clusters): # convert clustering result from graph to text new_clusters = {} for cluster_id, nodes in clusters.iteritems(): for n...
6a6abadc2395810076b89fb38c759f85426a0304
supportVectorMachine/howItWorksSupportVectorMachine.py
supportVectorMachine/howItWorksSupportVectorMachine.py
# -*- coding: utf-8 -*- """Support Vector Machine (SVM) classification for machine learning. SVM is a binary classifier. The objective of the SVM is to find the best separating hyperplane in vector space which is also referred to as the decision boundary. And it decides what separating hyperplane is the 'best' because...
Add framework for own SVM from scratch
Add framework for own SVM from scratch
Python
mit
a-holm/MachinelearningAlgorithms,a-holm/MachinelearningAlgorithms
Add framework for own SVM from scratch
# -*- coding: utf-8 -*- """Support Vector Machine (SVM) classification for machine learning. SVM is a binary classifier. The objective of the SVM is to find the best separating hyperplane in vector space which is also referred to as the decision boundary. And it decides what separating hyperplane is the 'best' because...
<commit_before><commit_msg>Add framework for own SVM from scratch<commit_after>
# -*- coding: utf-8 -*- """Support Vector Machine (SVM) classification for machine learning. SVM is a binary classifier. The objective of the SVM is to find the best separating hyperplane in vector space which is also referred to as the decision boundary. And it decides what separating hyperplane is the 'best' because...
Add framework for own SVM from scratch# -*- coding: utf-8 -*- """Support Vector Machine (SVM) classification for machine learning. SVM is a binary classifier. The objective of the SVM is to find the best separating hyperplane in vector space which is also referred to as the decision boundary. And it decides what separ...
<commit_before><commit_msg>Add framework for own SVM from scratch<commit_after># -*- coding: utf-8 -*- """Support Vector Machine (SVM) classification for machine learning. SVM is a binary classifier. The objective of the SVM is to find the best separating hyperplane in vector space which is also referred to as the dec...
92ec849fc18d7cb610839abe2213ce30ceced46b
InvenTree/InvenTree/ci_postgresql.py
InvenTree/InvenTree/ci_postgresql.py
""" Configuration file for running tests against a MySQL database. """ from InvenTree.settings import * # Override the 'test' database if 'test' in sys.argv: eprint('InvenTree: Running tests - Using MySQL test database') DATABASES['default'] = { # Ensure postgresql backend is being used '...
Add ci settings file for postgresql database
Add ci settings file for postgresql database
Python
mit
inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree
Add ci settings file for postgresql database
""" Configuration file for running tests against a MySQL database. """ from InvenTree.settings import * # Override the 'test' database if 'test' in sys.argv: eprint('InvenTree: Running tests - Using MySQL test database') DATABASES['default'] = { # Ensure postgresql backend is being used '...
<commit_before><commit_msg>Add ci settings file for postgresql database<commit_after>
""" Configuration file for running tests against a MySQL database. """ from InvenTree.settings import * # Override the 'test' database if 'test' in sys.argv: eprint('InvenTree: Running tests - Using MySQL test database') DATABASES['default'] = { # Ensure postgresql backend is being used '...
Add ci settings file for postgresql database""" Configuration file for running tests against a MySQL database. """ from InvenTree.settings import * # Override the 'test' database if 'test' in sys.argv: eprint('InvenTree: Running tests - Using MySQL test database') DATABASES['default'] = { # Ensur...
<commit_before><commit_msg>Add ci settings file for postgresql database<commit_after>""" Configuration file for running tests against a MySQL database. """ from InvenTree.settings import * # Override the 'test' database if 'test' in sys.argv: eprint('InvenTree: Running tests - Using MySQL test database') ...
c84ce4b2494771c48890c122420e4665828ac4f8
CodeFights/differentRightmostBit.py
CodeFights/differentRightmostBit.py
#!/usr/local/bin/python # Code Different Right-most Bit (Core) Problem def differentRightmostBit(n, m): return (n ^ m) & -(n ^ m) def main(): tests = [ [11, 13, 2], [7, 23, 16], [1, 0, 1], [64, 65, 1], [1073741823, 1071513599, 131072], [42, 22, 4] ] f...
Solve Code Fights different rightmost bit problem
Solve Code Fights different rightmost bit problem
Python
mit
HKuz/Test_Code
Solve Code Fights different rightmost bit problem
#!/usr/local/bin/python # Code Different Right-most Bit (Core) Problem def differentRightmostBit(n, m): return (n ^ m) & -(n ^ m) def main(): tests = [ [11, 13, 2], [7, 23, 16], [1, 0, 1], [64, 65, 1], [1073741823, 1071513599, 131072], [42, 22, 4] ] f...
<commit_before><commit_msg>Solve Code Fights different rightmost bit problem<commit_after>
#!/usr/local/bin/python # Code Different Right-most Bit (Core) Problem def differentRightmostBit(n, m): return (n ^ m) & -(n ^ m) def main(): tests = [ [11, 13, 2], [7, 23, 16], [1, 0, 1], [64, 65, 1], [1073741823, 1071513599, 131072], [42, 22, 4] ] f...
Solve Code Fights different rightmost bit problem#!/usr/local/bin/python # Code Different Right-most Bit (Core) Problem def differentRightmostBit(n, m): return (n ^ m) & -(n ^ m) def main(): tests = [ [11, 13, 2], [7, 23, 16], [1, 0, 1], [64, 65, 1], [1073741823, 1071...
<commit_before><commit_msg>Solve Code Fights different rightmost bit problem<commit_after>#!/usr/local/bin/python # Code Different Right-most Bit (Core) Problem def differentRightmostBit(n, m): return (n ^ m) & -(n ^ m) def main(): tests = [ [11, 13, 2], [7, 23, 16], [1, 0, 1], ...
3345dc2f1ac15f06d3e95b5ead894ee9d3a27d9e
piwrite.py
piwrite.py
#!/bin/env python import argparse import sys import os parser = argparse.ArgumentParser(description="Write multiple svgs from stdin to files") parser.add_argument('-o', '--outfile', metavar='OUTFILE', default='output.svg') args = parser.parse_args() base, extension = os.path.splitext(args.outfile) def write_files...
Add file writer utility script
Add file writer utility script
Python
epl-1.0
rbuchmann/pivicl
Add file writer utility script
#!/bin/env python import argparse import sys import os parser = argparse.ArgumentParser(description="Write multiple svgs from stdin to files") parser.add_argument('-o', '--outfile', metavar='OUTFILE', default='output.svg') args = parser.parse_args() base, extension = os.path.splitext(args.outfile) def write_files...
<commit_before><commit_msg>Add file writer utility script<commit_after>
#!/bin/env python import argparse import sys import os parser = argparse.ArgumentParser(description="Write multiple svgs from stdin to files") parser.add_argument('-o', '--outfile', metavar='OUTFILE', default='output.svg') args = parser.parse_args() base, extension = os.path.splitext(args.outfile) def write_files...
Add file writer utility script#!/bin/env python import argparse import sys import os parser = argparse.ArgumentParser(description="Write multiple svgs from stdin to files") parser.add_argument('-o', '--outfile', metavar='OUTFILE', default='output.svg') args = parser.parse_args() base, extension = os.path.splitext(a...
<commit_before><commit_msg>Add file writer utility script<commit_after>#!/bin/env python import argparse import sys import os parser = argparse.ArgumentParser(description="Write multiple svgs from stdin to files") parser.add_argument('-o', '--outfile', metavar='OUTFILE', default='output.svg') args = parser.parse_arg...
a3df0567c295f0b2879c9a4f095a31108359d531
nodeconductor/billing/migrations/0003_invoice_status.py
nodeconductor/billing/migrations/0003_invoice_status.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('billing', '0002_pricelist'), ] operations = [ migrations.AddField( model_name='invoice', name='statu...
Add missing migration for invoice status
Add missing migration for invoice status - ITACLOUD-4886
Python
mit
opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor
Add missing migration for invoice status - ITACLOUD-4886
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('billing', '0002_pricelist'), ] operations = [ migrations.AddField( model_name='invoice', name='statu...
<commit_before><commit_msg>Add missing migration for invoice status - ITACLOUD-4886<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('billing', '0002_pricelist'), ] operations = [ migrations.AddField( model_name='invoice', name='statu...
Add missing migration for invoice status - ITACLOUD-4886# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('billing', '0002_pricelist'), ] operations = [ migrations.AddField( ...
<commit_before><commit_msg>Add missing migration for invoice status - ITACLOUD-4886<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('billing', '0002_pricelist'), ] ope...
7b40a4902d1dc43c73a7858fc9286a641b3a9666
assess_isoform_quantification/options.py
assess_isoform_quantification/options.py
from schema import Schema def validate_file_option(file_option, msg): msg = "{msg} '{file}'.".format(msg=msg, file=file_option) return Schema(open, error=msg).validate(file_option)
Add validation function removed from main script.
Add validation function removed from main script.
Python
mit
COMBINE-lab/piquant,lweasel/piquant,lweasel/piquant
Add validation function removed from main script.
from schema import Schema def validate_file_option(file_option, msg): msg = "{msg} '{file}'.".format(msg=msg, file=file_option) return Schema(open, error=msg).validate(file_option)
<commit_before><commit_msg>Add validation function removed from main script.<commit_after>
from schema import Schema def validate_file_option(file_option, msg): msg = "{msg} '{file}'.".format(msg=msg, file=file_option) return Schema(open, error=msg).validate(file_option)
Add validation function removed from main script.from schema import Schema def validate_file_option(file_option, msg): msg = "{msg} '{file}'.".format(msg=msg, file=file_option) return Schema(open, error=msg).validate(file_option)
<commit_before><commit_msg>Add validation function removed from main script.<commit_after>from schema import Schema def validate_file_option(file_option, msg): msg = "{msg} '{file}'.".format(msg=msg, file=file_option) return Schema(open, error=msg).validate(file_option)
e304aae71617cdba0ffcb720a24406375fb866a1
Sketches/MH/audio/ToWAV.py
Sketches/MH/audio/ToWAV.py
from Axon.Component import component import string import struct from Axon.Ipc import producerFinished, shutdown class PCMToWave(component): def __init__(self, bytespersample, samplingfrequency): super(PCMToWave, self).__init__() self.bytespersample = bytespersample self.samplingfrequency =...
Copy of Ryan's PCMToWave component.
Copy of Ryan's PCMToWave component. Matt
Python
apache-2.0
sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia
Copy of Ryan's PCMToWave component. Matt
from Axon.Component import component import string import struct from Axon.Ipc import producerFinished, shutdown class PCMToWave(component): def __init__(self, bytespersample, samplingfrequency): super(PCMToWave, self).__init__() self.bytespersample = bytespersample self.samplingfrequency =...
<commit_before><commit_msg>Copy of Ryan's PCMToWave component. Matt<commit_after>
from Axon.Component import component import string import struct from Axon.Ipc import producerFinished, shutdown class PCMToWave(component): def __init__(self, bytespersample, samplingfrequency): super(PCMToWave, self).__init__() self.bytespersample = bytespersample self.samplingfrequency =...
Copy of Ryan's PCMToWave component. Mattfrom Axon.Component import component import string import struct from Axon.Ipc import producerFinished, shutdown class PCMToWave(component): def __init__(self, bytespersample, samplingfrequency): super(PCMToWave, self).__init__() self.bytespersample = bytesp...
<commit_before><commit_msg>Copy of Ryan's PCMToWave component. Matt<commit_after>from Axon.Component import component import string import struct from Axon.Ipc import producerFinished, shutdown class PCMToWave(component): def __init__(self, bytespersample, samplingfrequency): super(PCMToWave, self).__init...
16275938769c16c79b89349612e8e7b2891de815
kolibri/auth/migrations/0008_auto_20180222_1244.py
kolibri/auth/migrations/0008_auto_20180222_1244.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.13 on 2018-02-22 20:44 from __future__ import unicode_literals import kolibri.auth.models from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('kolibriauth', '0007_auto_20171226_1125'), ] operations = [ ...
Add migration for user manager
Add migration for user manager
Python
mit
benjaoming/kolibri,jonboiser/kolibri,christianmemije/kolibri,lyw07/kolibri,mrpau/kolibri,mrpau/kolibri,DXCanas/kolibri,mrpau/kolibri,benjaoming/kolibri,lyw07/kolibri,mrpau/kolibri,christianmemije/kolibri,learningequality/kolibri,jonboiser/kolibri,learningequality/kolibri,lyw07/kolibri,indirectlylit/kolibri,DXCanas/koli...
Add migration for user manager
# -*- coding: utf-8 -*- # Generated by Django 1.9.13 on 2018-02-22 20:44 from __future__ import unicode_literals import kolibri.auth.models from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('kolibriauth', '0007_auto_20171226_1125'), ] operations = [ ...
<commit_before><commit_msg>Add migration for user manager<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.9.13 on 2018-02-22 20:44 from __future__ import unicode_literals import kolibri.auth.models from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('kolibriauth', '0007_auto_20171226_1125'), ] operations = [ ...
Add migration for user manager# -*- coding: utf-8 -*- # Generated by Django 1.9.13 on 2018-02-22 20:44 from __future__ import unicode_literals import kolibri.auth.models from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('kolibriauth', '0007_auto_20171226_1125'), ...
<commit_before><commit_msg>Add migration for user manager<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.9.13 on 2018-02-22 20:44 from __future__ import unicode_literals import kolibri.auth.models from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('ko...
883aac8a282d4525e82d3eb151ea293c5577424c
core/migrations/0002_auto_20141008_0853.py
core/migrations/0002_auto_20141008_0853.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def create_extra_users(apps, schema_editor): user = apps.get_model("auth.User").objects.create(username='GesInv-ULL') apps.get_model("core", "UserProfile").objects.create(user=user, ...
Add data migration to create gesinv
Add data migration to create gesinv
Python
agpl-3.0
tic-ull/portal-del-investigador,tic-ull/portal-del-investigador,tic-ull/portal-del-investigador,tic-ull/portal-del-investigador
Add data migration to create gesinv
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def create_extra_users(apps, schema_editor): user = apps.get_model("auth.User").objects.create(username='GesInv-ULL') apps.get_model("core", "UserProfile").objects.create(user=user, ...
<commit_before><commit_msg>Add data migration to create gesinv<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def create_extra_users(apps, schema_editor): user = apps.get_model("auth.User").objects.create(username='GesInv-ULL') apps.get_model("core", "UserProfile").objects.create(user=user, ...
Add data migration to create gesinv# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def create_extra_users(apps, schema_editor): user = apps.get_model("auth.User").objects.create(username='GesInv-ULL') apps.get_model("core", "UserProfile").objects.creat...
<commit_before><commit_msg>Add data migration to create gesinv<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def create_extra_users(apps, schema_editor): user = apps.get_model("auth.User").objects.create(username='GesInv-ULL') apps.get_m...
e6181c5d7c95af23ee6d51d125642104782f5cf1
Python/136_SingleNumber.py
Python/136_SingleNumber.py
class Solution(object): def singleNumber(self, nums): """ :type nums: List[int] :rtype: int """ #Using XOR to find the single number. #Because every number appears twice, while N^N=0, 0^N=N, #XOR is cummutative, so the order of elements does not matter. ...
Add solution for 136_Single Number with XOR operation.
Add solution for 136_Single Number with XOR operation.
Python
mit
comicxmz001/LeetCode,comicxmz001/LeetCode
Add solution for 136_Single Number with XOR operation.
class Solution(object): def singleNumber(self, nums): """ :type nums: List[int] :rtype: int """ #Using XOR to find the single number. #Because every number appears twice, while N^N=0, 0^N=N, #XOR is cummutative, so the order of elements does not matter. ...
<commit_before><commit_msg>Add solution for 136_Single Number with XOR operation.<commit_after>
class Solution(object): def singleNumber(self, nums): """ :type nums: List[int] :rtype: int """ #Using XOR to find the single number. #Because every number appears twice, while N^N=0, 0^N=N, #XOR is cummutative, so the order of elements does not matter. ...
Add solution for 136_Single Number with XOR operation.class Solution(object): def singleNumber(self, nums): """ :type nums: List[int] :rtype: int """ #Using XOR to find the single number. #Because every number appears twice, while N^N=0, 0^N=N, #XOR is cummut...
<commit_before><commit_msg>Add solution for 136_Single Number with XOR operation.<commit_after>class Solution(object): def singleNumber(self, nums): """ :type nums: List[int] :rtype: int """ #Using XOR to find the single number. #Because every number appears twice, w...
95edeaa711e8c33e1b431f792e0f2638126ed461
pymtl/tools/translation/dynamic_ast_test.py
pymtl/tools/translation/dynamic_ast_test.py
#======================================================================= # verilog_from_ast_test.py #======================================================================= # This is the test case that verifies the dynamic AST support of PyMTL. # This test is contributed by Zhuanhao Wu through #169, #170 of PyMTL v2. #...
Add test case for dynamic ast
[dynamic-ast] Add test case for dynamic ast
Python
bsd-3-clause
cornell-brg/pymtl,cornell-brg/pymtl,cornell-brg/pymtl
[dynamic-ast] Add test case for dynamic ast
#======================================================================= # verilog_from_ast_test.py #======================================================================= # This is the test case that verifies the dynamic AST support of PyMTL. # This test is contributed by Zhuanhao Wu through #169, #170 of PyMTL v2. #...
<commit_before><commit_msg>[dynamic-ast] Add test case for dynamic ast<commit_after>
#======================================================================= # verilog_from_ast_test.py #======================================================================= # This is the test case that verifies the dynamic AST support of PyMTL. # This test is contributed by Zhuanhao Wu through #169, #170 of PyMTL v2. #...
[dynamic-ast] Add test case for dynamic ast#======================================================================= # verilog_from_ast_test.py #======================================================================= # This is the test case that verifies the dynamic AST support of PyMTL. # This test is contributed by Zh...
<commit_before><commit_msg>[dynamic-ast] Add test case for dynamic ast<commit_after>#======================================================================= # verilog_from_ast_test.py #======================================================================= # This is the test case that verifies the dynamic AST support o...
1b6fecb5819fbead0aadcc1a8669e915542c5ea0
other/testing-game.py
other/testing-game.py
#!/usr/bin/python # -*- coding: utf-8 -*- import argparse import os import subprocess import re parser = argparse.ArgumentParser() parser.add_argument('-d', '--directory', help='The directory to search for files in', required=False, default=os.getcwd()) args = parser.parse_args() names = {} for root, dirs, files in...
Add script for gameifying testing
Tools: Add script for gameifying testing
Python
apache-2.0
spotify/testing-game,spotify/testing-game,spotify/testing-game,spotify/testing-game
Tools: Add script for gameifying testing
#!/usr/bin/python # -*- coding: utf-8 -*- import argparse import os import subprocess import re parser = argparse.ArgumentParser() parser.add_argument('-d', '--directory', help='The directory to search for files in', required=False, default=os.getcwd()) args = parser.parse_args() names = {} for root, dirs, files in...
<commit_before><commit_msg>Tools: Add script for gameifying testing<commit_after>
#!/usr/bin/python # -*- coding: utf-8 -*- import argparse import os import subprocess import re parser = argparse.ArgumentParser() parser.add_argument('-d', '--directory', help='The directory to search for files in', required=False, default=os.getcwd()) args = parser.parse_args() names = {} for root, dirs, files in...
Tools: Add script for gameifying testing#!/usr/bin/python # -*- coding: utf-8 -*- import argparse import os import subprocess import re parser = argparse.ArgumentParser() parser.add_argument('-d', '--directory', help='The directory to search for files in', required=False, default=os.getcwd()) args = parser.parse_args...
<commit_before><commit_msg>Tools: Add script for gameifying testing<commit_after>#!/usr/bin/python # -*- coding: utf-8 -*- import argparse import os import subprocess import re parser = argparse.ArgumentParser() parser.add_argument('-d', '--directory', help='The directory to search for files in', required=False, defa...
940299a7bfd967653899b176ce76e6f1cf02ca83
liwcpairs2es.py
liwcpairs2es.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from elasticsearch import Elasticsearch, helpers from collections import Counter from datetime import datetime def find_pairs(list1, list2): pairs = [] if list1 and list2: for item1 in list1: for item2 in list2: pairs.append(u'{...
Add script to generate pairs of LIWC categories
Add script to generate pairs of LIWC categories Added a script that generates pairs of LIWC categories for Body and Posemo words. The pairs are added to the index. And data about the pairs is written to std out. The LIWC categories for which pairs are generated are hardcoded. This should be changed. Also adding the pa...
Python
apache-2.0
NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts
Add script to generate pairs of LIWC categories Added a script that generates pairs of LIWC categories for Body and Posemo words. The pairs are added to the index. And data about the pairs is written to std out. The LIWC categories for which pairs are generated are hardcoded. This should be changed. Also adding the pa...
#!/usr/bin/env python # -*- coding: utf-8 -*- from elasticsearch import Elasticsearch, helpers from collections import Counter from datetime import datetime def find_pairs(list1, list2): pairs = [] if list1 and list2: for item1 in list1: for item2 in list2: pairs.append(u'{...
<commit_before><commit_msg>Add script to generate pairs of LIWC categories Added a script that generates pairs of LIWC categories for Body and Posemo words. The pairs are added to the index. And data about the pairs is written to std out. The LIWC categories for which pairs are generated are hardcoded. This should be ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from elasticsearch import Elasticsearch, helpers from collections import Counter from datetime import datetime def find_pairs(list1, list2): pairs = [] if list1 and list2: for item1 in list1: for item2 in list2: pairs.append(u'{...
Add script to generate pairs of LIWC categories Added a script that generates pairs of LIWC categories for Body and Posemo words. The pairs are added to the index. And data about the pairs is written to std out. The LIWC categories for which pairs are generated are hardcoded. This should be changed. Also adding the pa...
<commit_before><commit_msg>Add script to generate pairs of LIWC categories Added a script that generates pairs of LIWC categories for Body and Posemo words. The pairs are added to the index. And data about the pairs is written to std out. The LIWC categories for which pairs are generated are hardcoded. This should be ...
95f5b7cd2325a61f537bffb783e950b30c97da5f
bayespy/demos/gamma_shape.py
bayespy/demos/gamma_shape.py
from bayespy import nodes from bayespy.inference import VB def run(): a = nodes.GammaShape(name='a') b = nodes.Gamma(1e-5, 1e-5, name='b') tau = nodes.Gamma(a, b, plates=(1000,), name='tau') tau.observe(nodes.Gamma(10, 20, plates=(1000,)).random()) Q = VB(tau, a, b) Q.update(repeat=1000)...
Add a demo about learning the shape parameter of gamma dist
DEMO: Add a demo about learning the shape parameter of gamma dist
Python
mit
bayespy/bayespy,fivejjs/bayespy,jluttine/bayespy,SalemAmeen/bayespy
DEMO: Add a demo about learning the shape parameter of gamma dist
from bayespy import nodes from bayespy.inference import VB def run(): a = nodes.GammaShape(name='a') b = nodes.Gamma(1e-5, 1e-5, name='b') tau = nodes.Gamma(a, b, plates=(1000,), name='tau') tau.observe(nodes.Gamma(10, 20, plates=(1000,)).random()) Q = VB(tau, a, b) Q.update(repeat=1000)...
<commit_before><commit_msg>DEMO: Add a demo about learning the shape parameter of gamma dist<commit_after>
from bayespy import nodes from bayespy.inference import VB def run(): a = nodes.GammaShape(name='a') b = nodes.Gamma(1e-5, 1e-5, name='b') tau = nodes.Gamma(a, b, plates=(1000,), name='tau') tau.observe(nodes.Gamma(10, 20, plates=(1000,)).random()) Q = VB(tau, a, b) Q.update(repeat=1000)...
DEMO: Add a demo about learning the shape parameter of gamma dist from bayespy import nodes from bayespy.inference import VB def run(): a = nodes.GammaShape(name='a') b = nodes.Gamma(1e-5, 1e-5, name='b') tau = nodes.Gamma(a, b, plates=(1000,), name='tau') tau.observe(nodes.Gamma(10, 20, plates=(10...
<commit_before><commit_msg>DEMO: Add a demo about learning the shape parameter of gamma dist<commit_after> from bayespy import nodes from bayespy.inference import VB def run(): a = nodes.GammaShape(name='a') b = nodes.Gamma(1e-5, 1e-5, name='b') tau = nodes.Gamma(a, b, plates=(1000,), name='tau') t...
d8fff759f2bff24f20cdbe98370ede9e5f3b7b13
convergence_tests/2D_helmholtz.py
convergence_tests/2D_helmholtz.py
from __future__ import absolute_import, division from firedrake import * import numpy as np def helmholtz_mixed(x, V1, V2): # Create mesh and define function space mesh = UnitSquareMesh(2**x, 2**x) V1 = FunctionSpace(mesh, *V1, name="V") V2 = FunctionSpace(mesh, *V2, name="P") W = V1 * V2 # D...
Add 2D helmholtz convergence test
Add 2D helmholtz convergence test
Python
mit
thomasgibson/firedrake-hybridization
Add 2D helmholtz convergence test
from __future__ import absolute_import, division from firedrake import * import numpy as np def helmholtz_mixed(x, V1, V2): # Create mesh and define function space mesh = UnitSquareMesh(2**x, 2**x) V1 = FunctionSpace(mesh, *V1, name="V") V2 = FunctionSpace(mesh, *V2, name="P") W = V1 * V2 # D...
<commit_before><commit_msg>Add 2D helmholtz convergence test<commit_after>
from __future__ import absolute_import, division from firedrake import * import numpy as np def helmholtz_mixed(x, V1, V2): # Create mesh and define function space mesh = UnitSquareMesh(2**x, 2**x) V1 = FunctionSpace(mesh, *V1, name="V") V2 = FunctionSpace(mesh, *V2, name="P") W = V1 * V2 # D...
Add 2D helmholtz convergence testfrom __future__ import absolute_import, division from firedrake import * import numpy as np def helmholtz_mixed(x, V1, V2): # Create mesh and define function space mesh = UnitSquareMesh(2**x, 2**x) V1 = FunctionSpace(mesh, *V1, name="V") V2 = FunctionSpace(mesh, *V2, n...
<commit_before><commit_msg>Add 2D helmholtz convergence test<commit_after>from __future__ import absolute_import, division from firedrake import * import numpy as np def helmholtz_mixed(x, V1, V2): # Create mesh and define function space mesh = UnitSquareMesh(2**x, 2**x) V1 = FunctionSpace(mesh, *V1, name...
1cc15f3ae9a0b7fa5b2dae4bcdd9f0f3c061ce4d
reclama/sprints/migrations/0002_auto_20150130_1751.py
reclama/sprints/migrations/0002_auto_20150130_1751.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('sprints', '0001_initial'), ] operations = [ migrations.AlterField( model_name='bug', name='event', ...
Fix relate_name on Bug model
Fix relate_name on Bug model
Python
mpl-2.0
mozilla/reclama,mozilla/reclama,mozilla/reclama,mozilla/reclama
Fix relate_name on Bug model
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('sprints', '0001_initial'), ] operations = [ migrations.AlterField( model_name='bug', name='event', ...
<commit_before><commit_msg>Fix relate_name on Bug model<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('sprints', '0001_initial'), ] operations = [ migrations.AlterField( model_name='bug', name='event', ...
Fix relate_name on Bug model# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('sprints', '0001_initial'), ] operations = [ migrations.AlterField( model_name='bug',...
<commit_before><commit_msg>Fix relate_name on Bug model<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('sprints', '0001_initial'), ] operations = [ migrations....
dc0ecffd6c4115019cfcbcc13b17a20511888c9b
python/paddle/fluid/tests/unittests/test_fused_emb_seq_pool_op.py
python/paddle/fluid/tests/unittests/test_fused_emb_seq_pool_op.py
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
Add ut for fused ops
Add ut for fused ops
Python
apache-2.0
chengduoZH/Paddle,baidu/Paddle,tensor-tang/Paddle,chengduoZH/Paddle,baidu/Paddle,baidu/Paddle,luotao1/Paddle,baidu/Paddle,luotao1/Paddle,baidu/Paddle,luotao1/Paddle,luotao1/Paddle,PaddlePaddle/Paddle,PaddlePaddle/Paddle,luotao1/Paddle,PaddlePaddle/Paddle,chengduoZH/Paddle,PaddlePaddle/Paddle,tensor-tang/Paddle,luotao1/...
Add ut for fused ops
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
<commit_before><commit_msg>Add ut for fused ops<commit_after>
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
Add ut for fused ops# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
<commit_before><commit_msg>Add ut for fused ops<commit_after># Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
a852de81afdf8426cb243115a87856e2767a8d40
tests/benchmarks/constructs/InplaceOperationStringAdd.py
tests/benchmarks/constructs/InplaceOperationStringAdd.py
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com # # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Softwar where # it's copied from other people. In these cases, that will normally be # indicated. # # Li...
Add construct test for known bad inplace string operations.
Tests: Add construct test for known bad inplace string operations.
Python
apache-2.0
kayhayen/Nuitka,tempbottle/Nuitka,tempbottle/Nuitka,tempbottle/Nuitka,tempbottle/Nuitka,kayhayen/Nuitka,kayhayen/Nuitka,wfxiang08/Nuitka,wfxiang08/Nuitka,wfxiang08/Nuitka,kayhayen/Nuitka,wfxiang08/Nuitka
Tests: Add construct test for known bad inplace string operations.
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com # # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Softwar where # it's copied from other people. In these cases, that will normally be # indicated. # # Li...
<commit_before><commit_msg>Tests: Add construct test for known bad inplace string operations.<commit_after>
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com # # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Softwar where # it's copied from other people. In these cases, that will normally be # indicated. # # Li...
Tests: Add construct test for known bad inplace string operations.# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com # # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Softwar where # it's copied from other people....
<commit_before><commit_msg>Tests: Add construct test for known bad inplace string operations.<commit_after># Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com # # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Softwar w...
b260040bc3ca48b4e76d73c6efe60b964fa5c108
tests/UnreachableSymbolsRemove/RemovingTerminalsTest.py
tests/UnreachableSymbolsRemove/RemovingTerminalsTest.py
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 17.08.2017 14:23 :Licence GNUv3 Part of grammpy-transforms """ from unittest import main, TestCase from grammpy import * from grammpy_transforms import * class A(Nonterminal): pass class B(Nonterminal): pass class C(Nonterminal): pass class D(Nonterminal):...
Add test of removing unreachable terminals
Add test of removing unreachable terminals
Python
mit
PatrikValkovic/grammpy
Add test of removing unreachable terminals
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 17.08.2017 14:23 :Licence GNUv3 Part of grammpy-transforms """ from unittest import main, TestCase from grammpy import * from grammpy_transforms import * class A(Nonterminal): pass class B(Nonterminal): pass class C(Nonterminal): pass class D(Nonterminal):...
<commit_before><commit_msg>Add test of removing unreachable terminals<commit_after>
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 17.08.2017 14:23 :Licence GNUv3 Part of grammpy-transforms """ from unittest import main, TestCase from grammpy import * from grammpy_transforms import * class A(Nonterminal): pass class B(Nonterminal): pass class C(Nonterminal): pass class D(Nonterminal):...
Add test of removing unreachable terminals#!/usr/bin/env python """ :Author Patrik Valkovic :Created 17.08.2017 14:23 :Licence GNUv3 Part of grammpy-transforms """ from unittest import main, TestCase from grammpy import * from grammpy_transforms import * class A(Nonterminal): pass class B(Nonterminal): pass class ...
<commit_before><commit_msg>Add test of removing unreachable terminals<commit_after>#!/usr/bin/env python """ :Author Patrik Valkovic :Created 17.08.2017 14:23 :Licence GNUv3 Part of grammpy-transforms """ from unittest import main, TestCase from grammpy import * from grammpy_transforms import * class A(Nonterminal...
0ac0c81a3427f35447f52c1643229f5dbe607002
osf/migrations/0099_merge_20180426_0930.py
osf/migrations/0099_merge_20180426_0930.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-04-26 14:30 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('osf', '0098_merge_20180416_1807'), ('osf', '0096_add_provider_doi_prefixes'), ] op...
Add a merge migration and bring up to date
Add a merge migration and bring up to date
Python
apache-2.0
mfraezz/osf.io,erinspace/osf.io,aaxelb/osf.io,CenterForOpenScience/osf.io,HalcyonChimera/osf.io,adlius/osf.io,erinspace/osf.io,cslzchen/osf.io,mattclark/osf.io,CenterForOpenScience/osf.io,Johnetordoff/osf.io,icereval/osf.io,mfraezz/osf.io,icereval/osf.io,caseyrollins/osf.io,caseyrollins/osf.io,baylee-d/osf.io,HalcyonCh...
Add a merge migration and bring up to date
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-04-26 14:30 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('osf', '0098_merge_20180416_1807'), ('osf', '0096_add_provider_doi_prefixes'), ] op...
<commit_before><commit_msg>Add a merge migration and bring up to date<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-04-26 14:30 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('osf', '0098_merge_20180416_1807'), ('osf', '0096_add_provider_doi_prefixes'), ] op...
Add a merge migration and bring up to date# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-04-26 14:30 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('osf', '0098_merge_20180416_1807'), ('osf', '0096_...
<commit_before><commit_msg>Add a merge migration and bring up to date<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-04-26 14:30 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('osf', '0098_merg...
28696b671a5f80f781c67f35ae5abb30efd6379c
solutions/uri/1019/1019.py
solutions/uri/1019/1019.py
import sys h = 0 m = 0 for t in sys.stdin: t = int(t) if t >= 60 * 60: h = t // (60 * 60) t %= 60 * 60 if t >= 60: m = t // 60 t %= 60 print(f"{h}:{m}:{t}") h = 0 m = 0
Solve Time Conversion in python
Solve Time Conversion 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 Time Conversion in python
import sys h = 0 m = 0 for t in sys.stdin: t = int(t) if t >= 60 * 60: h = t // (60 * 60) t %= 60 * 60 if t >= 60: m = t // 60 t %= 60 print(f"{h}:{m}:{t}") h = 0 m = 0
<commit_before><commit_msg>Solve Time Conversion in python<commit_after>
import sys h = 0 m = 0 for t in sys.stdin: t = int(t) if t >= 60 * 60: h = t // (60 * 60) t %= 60 * 60 if t >= 60: m = t // 60 t %= 60 print(f"{h}:{m}:{t}") h = 0 m = 0
Solve Time Conversion in pythonimport sys h = 0 m = 0 for t in sys.stdin: t = int(t) if t >= 60 * 60: h = t // (60 * 60) t %= 60 * 60 if t >= 60: m = t // 60 t %= 60 print(f"{h}:{m}:{t}") h = 0 m = 0
<commit_before><commit_msg>Solve Time Conversion in python<commit_after>import sys h = 0 m = 0 for t in sys.stdin: t = int(t) if t >= 60 * 60: h = t // (60 * 60) t %= 60 * 60 if t >= 60: m = t // 60 t %= 60 print(f"{h}:{m}:{t}") h = 0 m = 0
69005d995aa0e6d291216101253197c6b2d8260a
husc/main.py
husc/main.py
import argparse parser = argparse.ArgumentParser(description="Run the HUSC functions.") subpar = parser.add_subparsers() stitch = subpar.add_parser('stitch', help="Stitch four quadrants into one image.") stitch.add_argument('quadrant_image', nargs=4, help="The images ...
Add module for command-line interface
Add module for command-line interface
Python
bsd-3-clause
starcalibre/microscopium,jni/microscopium,microscopium/microscopium,microscopium/microscopium,Don86/microscopium,jni/microscopium,Don86/microscopium
Add module for command-line interface
import argparse parser = argparse.ArgumentParser(description="Run the HUSC functions.") subpar = parser.add_subparsers() stitch = subpar.add_parser('stitch', help="Stitch four quadrants into one image.") stitch.add_argument('quadrant_image', nargs=4, help="The images ...
<commit_before><commit_msg>Add module for command-line interface<commit_after>
import argparse parser = argparse.ArgumentParser(description="Run the HUSC functions.") subpar = parser.add_subparsers() stitch = subpar.add_parser('stitch', help="Stitch four quadrants into one image.") stitch.add_argument('quadrant_image', nargs=4, help="The images ...
Add module for command-line interfaceimport argparse parser = argparse.ArgumentParser(description="Run the HUSC functions.") subpar = parser.add_subparsers() stitch = subpar.add_parser('stitch', help="Stitch four quadrants into one image.") stitch.add_argument('quadrant_image', nargs=4, ...
<commit_before><commit_msg>Add module for command-line interface<commit_after>import argparse parser = argparse.ArgumentParser(description="Run the HUSC functions.") subpar = parser.add_subparsers() stitch = subpar.add_parser('stitch', help="Stitch four quadrants into one image.") stitch....
ea0087970b0c0adfd8942123899ff0ec231afa03
test/selenium/src/lib/page/extended_info.py
test/selenium/src/lib/page/extended_info.py
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com """A module for extended info page models (visible in LHN on hover over obje...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com """A module for extended info page models (visible in LHN on hover over obje...
Handle stealable element with utils
Handle stealable element with utils
Python
apache-2.0
AleksNeStu/ggrc-core,edofic/ggrc-core,josthkko/ggrc-core,kr41/ggrc-core,prasannav7/ggrc-core,j0gurt/ggrc-core,j0gurt/ggrc-core,VinnieJohns/ggrc-core,NejcZupec/ggrc-core,plamut/ggrc-core,NejcZupec/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,NejcZupec/ggrc-core,edofic/ggrc-core,selahsse...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com """A module for extended info page models (visible in LHN on hover over obje...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com """A module for extended info page models (visible in LHN on hover over obje...
<commit_before># Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com """A module for extended info page models (visible in LHN on ...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com """A module for extended info page models (visible in LHN on hover over obje...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com """A module for extended info page models (visible in LHN on hover over obje...
<commit_before># Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com """A module for extended info page models (visible in LHN on ...
7922b24882894cbc83bd4247c11d8c4a66b4b218
_setup_database.py
_setup_database.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from setup.create_teams import migrate_teams from setup.create_divisions import create_divisions if __name__ == '__main__': # migrating teams from json file to database migrate_teams(simulation=True) # creating divisions from division configuration file c...
Add utility script for database setup
Add utility script for database setup
Python
mit
leaffan/pynhldb
Add utility script for database setup
#!/usr/bin/env python # -*- coding: utf-8 -*- from setup.create_teams import migrate_teams from setup.create_divisions import create_divisions if __name__ == '__main__': # migrating teams from json file to database migrate_teams(simulation=True) # creating divisions from division configuration file c...
<commit_before><commit_msg>Add utility script for database setup<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- from setup.create_teams import migrate_teams from setup.create_divisions import create_divisions if __name__ == '__main__': # migrating teams from json file to database migrate_teams(simulation=True) # creating divisions from division configuration file c...
Add utility script for database setup#!/usr/bin/env python # -*- coding: utf-8 -*- from setup.create_teams import migrate_teams from setup.create_divisions import create_divisions if __name__ == '__main__': # migrating teams from json file to database migrate_teams(simulation=True) # creating divisions f...
<commit_before><commit_msg>Add utility script for database setup<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- from setup.create_teams import migrate_teams from setup.create_divisions import create_divisions if __name__ == '__main__': # migrating teams from json file to database migrate_teams(si...
93621f9441af4df77c8364050d7cc3dc2b1b43b2
tests/functional/registration/test_check.py
tests/functional/registration/test_check.py
""" Test check/validation command. """ import os import subprocess this_folder = os.path.abspath(os.path.dirname(__file__)) def test_check_metamodel(): """ Meta-model is also a model """ metamodel_file = os.path.join(this_folder, 'projects', 'flow_dsl', 'flow_dsl', ...
Add tests for `check` command
Add tests for `check` command
Python
mit
igordejanovic/textX,igordejanovic/textX,igordejanovic/textX
Add tests for `check` command
""" Test check/validation command. """ import os import subprocess this_folder = os.path.abspath(os.path.dirname(__file__)) def test_check_metamodel(): """ Meta-model is also a model """ metamodel_file = os.path.join(this_folder, 'projects', 'flow_dsl', 'flow_dsl', ...
<commit_before><commit_msg>Add tests for `check` command<commit_after>
""" Test check/validation command. """ import os import subprocess this_folder = os.path.abspath(os.path.dirname(__file__)) def test_check_metamodel(): """ Meta-model is also a model """ metamodel_file = os.path.join(this_folder, 'projects', 'flow_dsl', 'flow_dsl', ...
Add tests for `check` command""" Test check/validation command. """ import os import subprocess this_folder = os.path.abspath(os.path.dirname(__file__)) def test_check_metamodel(): """ Meta-model is also a model """ metamodel_file = os.path.join(this_folder, 'projec...
<commit_before><commit_msg>Add tests for `check` command<commit_after>""" Test check/validation command. """ import os import subprocess this_folder = os.path.abspath(os.path.dirname(__file__)) def test_check_metamodel(): """ Meta-model is also a model """ metamodel_file = os.path.join(this_folder, ...
474c5f977ab5b035567f0107c457622c51189ac6
csunplugged/topics/migrations/0086_auto_20171108_0840.py
csunplugged/topics/migrations/0086_auto_20171108_0840.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-11-08 08:40 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('topics', '0085_auto_20171030_0035'), ] operations = [ migrations.AddField( ...
Add new topics migration file
Add new topics migration file
Python
mit
uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged
Add new topics migration file
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-11-08 08:40 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('topics', '0085_auto_20171030_0035'), ] operations = [ migrations.AddField( ...
<commit_before><commit_msg>Add new topics migration file<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-11-08 08:40 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('topics', '0085_auto_20171030_0035'), ] operations = [ migrations.AddField( ...
Add new topics migration file# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-11-08 08:40 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('topics', '0085_auto_20171030_0035'), ] operations = [ ...
<commit_before><commit_msg>Add new topics migration file<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-11-08 08:40 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('topics', '0085_auto_20...
71afe426a84789b65953ccd057014d17a11de859
mzalendo/core/management/commands/core_extend_areas_to_generation_2.py
mzalendo/core/management/commands/core_extend_areas_to_generation_2.py
# The import of data into Kenyan MapIt had the constituencies in # generation 2, while all the other area types were in generation 1. # This is unfortunate since it makes it appear to later import scripts # that the district type disappeared between generation 1 and 3. # # This script just extends the generation_high t...
Add a command to extend the generation_high from generation 1 to 2
Add a command to extend the generation_high from generation 1 to 2
Python
agpl-3.0
mysociety/pombola,geoffkilpin/pombola,ken-muturi/pombola,geoffkilpin/pombola,geoffkilpin/pombola,hzj123/56th,geoffkilpin/pombola,hzj123/56th,mysociety/pombola,hzj123/56th,ken-muturi/pombola,patricmutwiri/pombola,patricmutwiri/pombola,hzj123/56th,mysociety/pombola,hzj123/56th,mysociety/pombola,mysociety/pombola,ken-mutu...
Add a command to extend the generation_high from generation 1 to 2
# The import of data into Kenyan MapIt had the constituencies in # generation 2, while all the other area types were in generation 1. # This is unfortunate since it makes it appear to later import scripts # that the district type disappeared between generation 1 and 3. # # This script just extends the generation_high t...
<commit_before><commit_msg>Add a command to extend the generation_high from generation 1 to 2<commit_after>
# The import of data into Kenyan MapIt had the constituencies in # generation 2, while all the other area types were in generation 1. # This is unfortunate since it makes it appear to later import scripts # that the district type disappeared between generation 1 and 3. # # This script just extends the generation_high t...
Add a command to extend the generation_high from generation 1 to 2# The import of data into Kenyan MapIt had the constituencies in # generation 2, while all the other area types were in generation 1. # This is unfortunate since it makes it appear to later import scripts # that the district type disappeared between gene...
<commit_before><commit_msg>Add a command to extend the generation_high from generation 1 to 2<commit_after># The import of data into Kenyan MapIt had the constituencies in # generation 2, while all the other area types were in generation 1. # This is unfortunate since it makes it appear to later import scripts # that t...
b88b97c7d56506804fc9eb93ce7074454fc492f3
base/apps/people/migrations/0002_auto_20141223_0316.py
base/apps/people/migrations/0002_auto_20141223_0316.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('people', '0001_initial'), ] operations = [ migrations.CreateModel( name='Designation', fields=[ ...
Add the migration for designations.
Add the migration for designations.
Python
apache-2.0
hello-base/web,hello-base/web,hello-base/web,hello-base/web
Add the migration for designations.
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('people', '0001_initial'), ] operations = [ migrations.CreateModel( name='Designation', fields=[ ...
<commit_before><commit_msg>Add the migration for designations.<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('people', '0001_initial'), ] operations = [ migrations.CreateModel( name='Designation', fields=[ ...
Add the migration for designations.# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('people', '0001_initial'), ] operations = [ migrations.CreateModel( name='Desi...
<commit_before><commit_msg>Add the migration for designations.<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('people', '0001_initial'), ] operations = [ migra...
0cabf3c4dae3599e2d1627ff41707cf36b4d2ddd
acoustics/__init__.py
acoustics/__init__.py
""" Acoustics ========= The acoustics module... """ import acoustics.ambisonics import acoustics.utils import acoustics.octave import acoustics.doppler import acoustics.signal import acoustics.directivity import acoustics.building import acoustics.room import acoustics.standards import acoustics.cepstrum from acoust...
""" Acoustics ========= The acoustics module... """ import acoustics.aio import acoustics.ambisonics import acoustics.atmosphere import acoustics.bands import acoustics.building import acoustics.cepstrum import acoustics.criterion import acoustics.decibel import acoustics.descriptors import acoustics.directivity impo...
Load all modules by default
Load all modules by default
Python
bsd-3-clause
python-acoustics/python-acoustics,antiface/python-acoustics,FRidh/python-acoustics,felipeacsi/python-acoustics,giumas/python-acoustics
""" Acoustics ========= The acoustics module... """ import acoustics.ambisonics import acoustics.utils import acoustics.octave import acoustics.doppler import acoustics.signal import acoustics.directivity import acoustics.building import acoustics.room import acoustics.standards import acoustics.cepstrum from acoust...
""" Acoustics ========= The acoustics module... """ import acoustics.aio import acoustics.ambisonics import acoustics.atmosphere import acoustics.bands import acoustics.building import acoustics.cepstrum import acoustics.criterion import acoustics.decibel import acoustics.descriptors import acoustics.directivity impo...
<commit_before>""" Acoustics ========= The acoustics module... """ import acoustics.ambisonics import acoustics.utils import acoustics.octave import acoustics.doppler import acoustics.signal import acoustics.directivity import acoustics.building import acoustics.room import acoustics.standards import acoustics.cepstr...
""" Acoustics ========= The acoustics module... """ import acoustics.aio import acoustics.ambisonics import acoustics.atmosphere import acoustics.bands import acoustics.building import acoustics.cepstrum import acoustics.criterion import acoustics.decibel import acoustics.descriptors import acoustics.directivity impo...
""" Acoustics ========= The acoustics module... """ import acoustics.ambisonics import acoustics.utils import acoustics.octave import acoustics.doppler import acoustics.signal import acoustics.directivity import acoustics.building import acoustics.room import acoustics.standards import acoustics.cepstrum from acoust...
<commit_before>""" Acoustics ========= The acoustics module... """ import acoustics.ambisonics import acoustics.utils import acoustics.octave import acoustics.doppler import acoustics.signal import acoustics.directivity import acoustics.building import acoustics.room import acoustics.standards import acoustics.cepstr...
513af3716c596bb67c0f6552824b854b3735858c
corehq/apps/domain/tests/test_password_strength.py
corehq/apps/domain/tests/test_password_strength.py
from django import forms from django.test import SimpleTestCase, override_settings from corehq.apps.domain.forms import clean_password class PasswordStrengthTest(SimpleTestCase): @override_settings(MINIMUM_ZXCVBN_SCORE=2) def test_score_0_password(self): self.assert_bad_password(PASSWORDS_BY_STRENGT...
Add simple tests for password strength and sensitivity to MINIMUM_ZXCVBN_SCORE setting
Add simple tests for password strength and sensitivity to MINIMUM_ZXCVBN_SCORE setting
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
Add simple tests for password strength and sensitivity to MINIMUM_ZXCVBN_SCORE setting
from django import forms from django.test import SimpleTestCase, override_settings from corehq.apps.domain.forms import clean_password class PasswordStrengthTest(SimpleTestCase): @override_settings(MINIMUM_ZXCVBN_SCORE=2) def test_score_0_password(self): self.assert_bad_password(PASSWORDS_BY_STRENGT...
<commit_before><commit_msg>Add simple tests for password strength and sensitivity to MINIMUM_ZXCVBN_SCORE setting<commit_after>
from django import forms from django.test import SimpleTestCase, override_settings from corehq.apps.domain.forms import clean_password class PasswordStrengthTest(SimpleTestCase): @override_settings(MINIMUM_ZXCVBN_SCORE=2) def test_score_0_password(self): self.assert_bad_password(PASSWORDS_BY_STRENGT...
Add simple tests for password strength and sensitivity to MINIMUM_ZXCVBN_SCORE settingfrom django import forms from django.test import SimpleTestCase, override_settings from corehq.apps.domain.forms import clean_password class PasswordStrengthTest(SimpleTestCase): @override_settings(MINIMUM_ZXCVBN_SCORE=2) ...
<commit_before><commit_msg>Add simple tests for password strength and sensitivity to MINIMUM_ZXCVBN_SCORE setting<commit_after>from django import forms from django.test import SimpleTestCase, override_settings from corehq.apps.domain.forms import clean_password class PasswordStrengthTest(SimpleTestCase): @overr...
97d6cce2a5c0c905f0c33c41316c8e65eaed0e08
update-bikestations.py
update-bikestations.py
#!/usr/bin/env python from multiprocessing.pool import ThreadPool import requests import json baseurl = 'http://api.citybik.es/v2/networks/' networkids = [ 'bixi-montreal', 'bixi-toronto', 'capital-bixi', 'hubway', 'capital-bikeshare', 'citi-bike-nyc', 'barclays-cycle-hire' ] def process_network(netwo...
Update way we synchronize from citybik.es
Update way we synchronize from citybik.es Now we only download the information we actually need. We also download and generate network information dynamically, which should enable some cool stuff
Python
mit
wlach/nixi,wlach/nixi
Update way we synchronize from citybik.es Now we only download the information we actually need. We also download and generate network information dynamically, which should enable some cool stuff
#!/usr/bin/env python from multiprocessing.pool import ThreadPool import requests import json baseurl = 'http://api.citybik.es/v2/networks/' networkids = [ 'bixi-montreal', 'bixi-toronto', 'capital-bixi', 'hubway', 'capital-bikeshare', 'citi-bike-nyc', 'barclays-cycle-hire' ] def process_network(netwo...
<commit_before><commit_msg>Update way we synchronize from citybik.es Now we only download the information we actually need. We also download and generate network information dynamically, which should enable some cool stuff<commit_after>
#!/usr/bin/env python from multiprocessing.pool import ThreadPool import requests import json baseurl = 'http://api.citybik.es/v2/networks/' networkids = [ 'bixi-montreal', 'bixi-toronto', 'capital-bixi', 'hubway', 'capital-bikeshare', 'citi-bike-nyc', 'barclays-cycle-hire' ] def process_network(netwo...
Update way we synchronize from citybik.es Now we only download the information we actually need. We also download and generate network information dynamically, which should enable some cool stuff#!/usr/bin/env python from multiprocessing.pool import ThreadPool import requests import json baseurl = 'http://api.citybi...
<commit_before><commit_msg>Update way we synchronize from citybik.es Now we only download the information we actually need. We also download and generate network information dynamically, which should enable some cool stuff<commit_after>#!/usr/bin/env python from multiprocessing.pool import ThreadPool import requests ...
665b3372e089fda3dde104b0754efa65a87a9bd2
Sketches/MPS/Bookmarks/TestHTTPResponseHandler.py
Sketches/MPS/Bookmarks/TestHTTPResponseHandler.py
#!/usr/bin/python import base64 from Kamaelia.File.ReadFileAdaptor import ReadFileAdaptor from Kamaelia.File.Writing import SimpleFileWriter from Kamaelia.Chassis.Pipeline import Pipeline from TwitterStream import HTTPClientResponseHandler from Kamaelia.Util.PureTransformer import PureTransformer from Kamaelia.Util.C...
Test harness for checking wtf the HTTPClientResponseHandler is actually doing with data from the network
Test harness for checking wtf the HTTPClientResponseHandler is actually doing with data from the network
Python
apache-2.0
sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia
Test harness for checking wtf the HTTPClientResponseHandler is actually doing with data from the network
#!/usr/bin/python import base64 from Kamaelia.File.ReadFileAdaptor import ReadFileAdaptor from Kamaelia.File.Writing import SimpleFileWriter from Kamaelia.Chassis.Pipeline import Pipeline from TwitterStream import HTTPClientResponseHandler from Kamaelia.Util.PureTransformer import PureTransformer from Kamaelia.Util.C...
<commit_before><commit_msg>Test harness for checking wtf the HTTPClientResponseHandler is actually doing with data from the network<commit_after>
#!/usr/bin/python import base64 from Kamaelia.File.ReadFileAdaptor import ReadFileAdaptor from Kamaelia.File.Writing import SimpleFileWriter from Kamaelia.Chassis.Pipeline import Pipeline from TwitterStream import HTTPClientResponseHandler from Kamaelia.Util.PureTransformer import PureTransformer from Kamaelia.Util.C...
Test harness for checking wtf the HTTPClientResponseHandler is actually doing with data from the network#!/usr/bin/python import base64 from Kamaelia.File.ReadFileAdaptor import ReadFileAdaptor from Kamaelia.File.Writing import SimpleFileWriter from Kamaelia.Chassis.Pipeline import Pipeline from TwitterStream import ...
<commit_before><commit_msg>Test harness for checking wtf the HTTPClientResponseHandler is actually doing with data from the network<commit_after>#!/usr/bin/python import base64 from Kamaelia.File.ReadFileAdaptor import ReadFileAdaptor from Kamaelia.File.Writing import SimpleFileWriter from Kamaelia.Chassis.Pipeline i...
53467bd7d4c9c12b73c66244a91f31f0dbadeeec
hc/front/tests/test_add_pagerteam.py
hc/front/tests/test_add_pagerteam.py
from hc.api.models import Channel from hc.test import BaseTestCase class AddPagerTeamTestCase(BaseTestCase): url = "/integrations/add_pagerteam/" def test_instructions_work(self): self.client.login(username="alice@example.org", password="password") r = self.client.get(self.url) self.a...
Add pagerteam tests file which had been missed despite its existence
Add pagerteam tests file which had been missed despite its existence
Python
bsd-3-clause
healthchecks/healthchecks,iphoting/healthchecks,iphoting/healthchecks,iphoting/healthchecks,healthchecks/healthchecks,healthchecks/healthchecks,iphoting/healthchecks,healthchecks/healthchecks
Add pagerteam tests file which had been missed despite its existence
from hc.api.models import Channel from hc.test import BaseTestCase class AddPagerTeamTestCase(BaseTestCase): url = "/integrations/add_pagerteam/" def test_instructions_work(self): self.client.login(username="alice@example.org", password="password") r = self.client.get(self.url) self.a...
<commit_before><commit_msg>Add pagerteam tests file which had been missed despite its existence<commit_after>
from hc.api.models import Channel from hc.test import BaseTestCase class AddPagerTeamTestCase(BaseTestCase): url = "/integrations/add_pagerteam/" def test_instructions_work(self): self.client.login(username="alice@example.org", password="password") r = self.client.get(self.url) self.a...
Add pagerteam tests file which had been missed despite its existencefrom hc.api.models import Channel from hc.test import BaseTestCase class AddPagerTeamTestCase(BaseTestCase): url = "/integrations/add_pagerteam/" def test_instructions_work(self): self.client.login(username="alice@example.org", passw...
<commit_before><commit_msg>Add pagerteam tests file which had been missed despite its existence<commit_after>from hc.api.models import Channel from hc.test import BaseTestCase class AddPagerTeamTestCase(BaseTestCase): url = "/integrations/add_pagerteam/" def test_instructions_work(self): self.client....
9f9916d662d1ab130c9685c415c25b19a14733d7
examples/svm_objectives.py
examples/svm_objectives.py
# showing the relation between cutting plane and primal objectives import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import load_digits from sklearn.cross_validation import train_test_split from pystruct.problems import CrammerSingerSVMProblem from pystruct.learners import (StructuredSVM, OneS...
Add example to illustrate different optimization procedures
Add example to illustrate different optimization procedures
Python
bsd-2-clause
d-mittal/pystruct,massmutual/pystruct,wattlebird/pystruct,massmutual/pystruct,wattlebird/pystruct,pystruct/pystruct,amueller/pystruct,d-mittal/pystruct,pystruct/pystruct,amueller/pystruct
Add example to illustrate different optimization procedures
# showing the relation between cutting plane and primal objectives import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import load_digits from sklearn.cross_validation import train_test_split from pystruct.problems import CrammerSingerSVMProblem from pystruct.learners import (StructuredSVM, OneS...
<commit_before><commit_msg>Add example to illustrate different optimization procedures<commit_after>
# showing the relation between cutting plane and primal objectives import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import load_digits from sklearn.cross_validation import train_test_split from pystruct.problems import CrammerSingerSVMProblem from pystruct.learners import (StructuredSVM, OneS...
Add example to illustrate different optimization procedures# showing the relation between cutting plane and primal objectives import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import load_digits from sklearn.cross_validation import train_test_split from pystruct.problems import CrammerSingerSV...
<commit_before><commit_msg>Add example to illustrate different optimization procedures<commit_after># showing the relation between cutting plane and primal objectives import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import load_digits from sklearn.cross_validation import train_test_split from...
3a2e9a19feab0c882a9821b7ff555bd1e2693190
exp/sandbox/DeltaLaplacianExp.py
exp/sandbox/DeltaLaplacianExp.py
import numpy import scipy.sparse from apgl.graph import GraphUtils from apgl.util.Util import Util numpy.set_printoptions(suppress=True, precision=3) n = 10 W1 = scipy.sparse.rand(n, n, 0.5).todense() W1 = W1.T.dot(W1) W2 = W1.copy() W2[1, 2] = 1 W2[2, 1] = 1 print("W1="+str(W1)) print("W2="+str(W2)) L1 = Gr...
Test effect of change in Laplacian.
Test effect of change in Laplacian.
Python
bsd-3-clause
charanpald/APGL
Test effect of change in Laplacian.
import numpy import scipy.sparse from apgl.graph import GraphUtils from apgl.util.Util import Util numpy.set_printoptions(suppress=True, precision=3) n = 10 W1 = scipy.sparse.rand(n, n, 0.5).todense() W1 = W1.T.dot(W1) W2 = W1.copy() W2[1, 2] = 1 W2[2, 1] = 1 print("W1="+str(W1)) print("W2="+str(W2)) L1 = Gr...
<commit_before><commit_msg>Test effect of change in Laplacian. <commit_after>
import numpy import scipy.sparse from apgl.graph import GraphUtils from apgl.util.Util import Util numpy.set_printoptions(suppress=True, precision=3) n = 10 W1 = scipy.sparse.rand(n, n, 0.5).todense() W1 = W1.T.dot(W1) W2 = W1.copy() W2[1, 2] = 1 W2[2, 1] = 1 print("W1="+str(W1)) print("W2="+str(W2)) L1 = Gr...
Test effect of change in Laplacian. import numpy import scipy.sparse from apgl.graph import GraphUtils from apgl.util.Util import Util numpy.set_printoptions(suppress=True, precision=3) n = 10 W1 = scipy.sparse.rand(n, n, 0.5).todense() W1 = W1.T.dot(W1) W2 = W1.copy() W2[1, 2] = 1 W2[2, 1] = 1 print("W1="+st...
<commit_before><commit_msg>Test effect of change in Laplacian. <commit_after>import numpy import scipy.sparse from apgl.graph import GraphUtils from apgl.util.Util import Util numpy.set_printoptions(suppress=True, precision=3) n = 10 W1 = scipy.sparse.rand(n, n, 0.5).todense() W1 = W1.T.dot(W1) W2 = W1.copy() W2[...
9a22cf7452723686a5065658ce5c9d31333c8a33
examples/download_random_leader_avatar.py
examples/download_random_leader_avatar.py
# Run with Python 3 import json import requests from random import randint import shutil import math # 1. Get your keys at https://stepic.org/oauth2/applications/ (client type = confidential, # authorization grant type = client credentials) client_id = "..." client_secret = "..." # 2. Get a token auth = requests.auth...
Add download random leader avatar to examples
Add download random leader avatar to examples
Python
mit
StepicOrg/Stepic-API
Add download random leader avatar to examples
# Run with Python 3 import json import requests from random import randint import shutil import math # 1. Get your keys at https://stepic.org/oauth2/applications/ (client type = confidential, # authorization grant type = client credentials) client_id = "..." client_secret = "..." # 2. Get a token auth = requests.auth...
<commit_before><commit_msg>Add download random leader avatar to examples<commit_after>
# Run with Python 3 import json import requests from random import randint import shutil import math # 1. Get your keys at https://stepic.org/oauth2/applications/ (client type = confidential, # authorization grant type = client credentials) client_id = "..." client_secret = "..." # 2. Get a token auth = requests.auth...
Add download random leader avatar to examples# Run with Python 3 import json import requests from random import randint import shutil import math # 1. Get your keys at https://stepic.org/oauth2/applications/ (client type = confidential, # authorization grant type = client credentials) client_id = "..." client_secret =...
<commit_before><commit_msg>Add download random leader avatar to examples<commit_after># Run with Python 3 import json import requests from random import randint import shutil import math # 1. Get your keys at https://stepic.org/oauth2/applications/ (client type = confidential, # authorization grant type = client crede...
0507a47f1c15bac5f6eddbeb9c712f5c2b2a9358
intake_bluesky/tests/test_msgpack.py
intake_bluesky/tests/test_msgpack.py
import intake_bluesky.msgpack # noqa import intake from suitcase.msgpack import Serializer import os import pytest import shutil import tempfile import time import types from .generic import * # noqa TMP_DIR = tempfile.mkdtemp() TEST_CATALOG_PATH = [TMP_DIR] YAML_FILENAME = 'intake_msgpack_test_catalog.yml' def ...
Add tests for msgpack reader.
TST: Add tests for msgpack reader.
Python
bsd-3-clause
ericdill/databroker,ericdill/databroker
TST: Add tests for msgpack reader.
import intake_bluesky.msgpack # noqa import intake from suitcase.msgpack import Serializer import os import pytest import shutil import tempfile import time import types from .generic import * # noqa TMP_DIR = tempfile.mkdtemp() TEST_CATALOG_PATH = [TMP_DIR] YAML_FILENAME = 'intake_msgpack_test_catalog.yml' def ...
<commit_before><commit_msg>TST: Add tests for msgpack reader.<commit_after>
import intake_bluesky.msgpack # noqa import intake from suitcase.msgpack import Serializer import os import pytest import shutil import tempfile import time import types from .generic import * # noqa TMP_DIR = tempfile.mkdtemp() TEST_CATALOG_PATH = [TMP_DIR] YAML_FILENAME = 'intake_msgpack_test_catalog.yml' def ...
TST: Add tests for msgpack reader.import intake_bluesky.msgpack # noqa import intake from suitcase.msgpack import Serializer import os import pytest import shutil import tempfile import time import types from .generic import * # noqa TMP_DIR = tempfile.mkdtemp() TEST_CATALOG_PATH = [TMP_DIR] YAML_FILENAME = 'intak...
<commit_before><commit_msg>TST: Add tests for msgpack reader.<commit_after>import intake_bluesky.msgpack # noqa import intake from suitcase.msgpack import Serializer import os import pytest import shutil import tempfile import time import types from .generic import * # noqa TMP_DIR = tempfile.mkdtemp() TEST_CATALOG...
a42a6a54f732ca7eba700b867a3025739ad6a271
list_all_users_in_group.py
list_all_users_in_group.py
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import grp import pwd import inspect import argparse def list_all_users_in_group(groupname): """Get list of all users of group. Get sorted list of all users of group GROUP, including users with main group GROUP. Ori...
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import grp import pwd import inspect import argparse def list_all_users_in_group(groupname): """Get list of all users of group. Get sorted list of all users of group GROUP, including users with main group GROUP. Ori...
Move main code to function because of pylint warning 'Invalid constant name'
Move main code to function because of pylint warning 'Invalid constant name'
Python
cc0-1.0
vazhnov/list_all_users_in_group
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import grp import pwd import inspect import argparse def list_all_users_in_group(groupname): """Get list of all users of group. Get sorted list of all users of group GROUP, including users with main group GROUP. Ori...
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import grp import pwd import inspect import argparse def list_all_users_in_group(groupname): """Get list of all users of group. Get sorted list of all users of group GROUP, including users with main group GROUP. Ori...
<commit_before>#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import grp import pwd import inspect import argparse def list_all_users_in_group(groupname): """Get list of all users of group. Get sorted list of all users of group GROUP, including users with main group...
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import grp import pwd import inspect import argparse def list_all_users_in_group(groupname): """Get list of all users of group. Get sorted list of all users of group GROUP, including users with main group GROUP. Ori...
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import grp import pwd import inspect import argparse def list_all_users_in_group(groupname): """Get list of all users of group. Get sorted list of all users of group GROUP, including users with main group GROUP. Ori...
<commit_before>#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import grp import pwd import inspect import argparse def list_all_users_in_group(groupname): """Get list of all users of group. Get sorted list of all users of group GROUP, including users with main group...
d067d9937ff34787e6f632d86075af29c27d98f8
py/best-time-to-buy-and-sell-stock-with-transaction-fee.py
py/best-time-to-buy-and-sell-stock-with-transaction-fee.py
class Solution(object): def maxProfit(self, prices, fee): """ :type prices: List[int] :type fee: int :rtype: int """ hold, not_hold = None, 0 for p in prices: hold, not_hold = max(hold, not_hold - p - fee), max(not_hold, None if hold is None else h...
Add py solution for 714. Best Time to Buy and Sell Stock with Transaction Fee
Add py solution for 714. Best Time to Buy and Sell Stock with Transaction Fee 714. Best Time to Buy and Sell Stock with Transaction Fee: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 714. Best Time to Buy and Sell Stock with Transaction Fee 714. Best Time to Buy and Sell Stock with Transaction Fee: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/
class Solution(object): def maxProfit(self, prices, fee): """ :type prices: List[int] :type fee: int :rtype: int """ hold, not_hold = None, 0 for p in prices: hold, not_hold = max(hold, not_hold - p - fee), max(not_hold, None if hold is None else h...
<commit_before><commit_msg>Add py solution for 714. Best Time to Buy and Sell Stock with Transaction Fee 714. Best Time to Buy and Sell Stock with Transaction Fee: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/<commit_after>
class Solution(object): def maxProfit(self, prices, fee): """ :type prices: List[int] :type fee: int :rtype: int """ hold, not_hold = None, 0 for p in prices: hold, not_hold = max(hold, not_hold - p - fee), max(not_hold, None if hold is None else h...
Add py solution for 714. Best Time to Buy and Sell Stock with Transaction Fee 714. Best Time to Buy and Sell Stock with Transaction Fee: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/class Solution(object): def maxProfit(self, prices, fee): """ :type prices: Lis...
<commit_before><commit_msg>Add py solution for 714. Best Time to Buy and Sell Stock with Transaction Fee 714. Best Time to Buy and Sell Stock with Transaction Fee: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/<commit_after>class Solution(object): def maxProfit(self, prices, fe...
4c2c80e0004a758787beb555fbbe789cce5e82fc
nova/tests/test_vmwareapi_vm_util.py
nova/tests/test_vmwareapi_vm_util.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 Canonical Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.or...
Fix variable referenced before assginment in vmwareapi code.
Fix variable referenced before assginment in vmwareapi code. Add unitests for VMwareapi vm_util. fix bug #1177689 Change-Id: If16109ee626c197227affba122c2e4986d92d2df
Python
apache-2.0
n0ano/gantt,n0ano/gantt
Fix variable referenced before assginment in vmwareapi code. Add unitests for VMwareapi vm_util. fix bug #1177689 Change-Id: If16109ee626c197227affba122c2e4986d92d2df
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 Canonical Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.or...
<commit_before><commit_msg>Fix variable referenced before assginment in vmwareapi code. Add unitests for VMwareapi vm_util. fix bug #1177689 Change-Id: If16109ee626c197227affba122c2e4986d92d2df<commit_after>
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 Canonical Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.or...
Fix variable referenced before assginment in vmwareapi code. Add unitests for VMwareapi vm_util. fix bug #1177689 Change-Id: If16109ee626c197227affba122c2e4986d92d2df# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 Canonical Corp. # All Rights Reserved. # # Licensed under the Apache License, Version ...
<commit_before><commit_msg>Fix variable referenced before assginment in vmwareapi code. Add unitests for VMwareapi vm_util. fix bug #1177689 Change-Id: If16109ee626c197227affba122c2e4986d92d2df<commit_after># vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 Canonical Corp. # All Rights Reserved. # # Li...
1dc439fcf7a823270156708208339a8bf420703c
opps/sitemaps/sitemaps.py
opps/sitemaps/sitemaps.py
# -*- coding: utf-8 -*- from django.contrib.sitemaps import GenericSitemap as DjangoGenericSitemap from django.contrib.sitemaps import Sitemap as DjangoSitemap from django.utils import timezone from opps.articles.models import Article def InfoDisct(googlenews=False): article = Article.objects.filter(date_availab...
Create Generic Sitemap abstract django
Create Generic Sitemap abstract django
Python
mit
opps/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,opps/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps
Create Generic Sitemap abstract django
# -*- coding: utf-8 -*- from django.contrib.sitemaps import GenericSitemap as DjangoGenericSitemap from django.contrib.sitemaps import Sitemap as DjangoSitemap from django.utils import timezone from opps.articles.models import Article def InfoDisct(googlenews=False): article = Article.objects.filter(date_availab...
<commit_before><commit_msg>Create Generic Sitemap abstract django<commit_after>
# -*- coding: utf-8 -*- from django.contrib.sitemaps import GenericSitemap as DjangoGenericSitemap from django.contrib.sitemaps import Sitemap as DjangoSitemap from django.utils import timezone from opps.articles.models import Article def InfoDisct(googlenews=False): article = Article.objects.filter(date_availab...
Create Generic Sitemap abstract django# -*- coding: utf-8 -*- from django.contrib.sitemaps import GenericSitemap as DjangoGenericSitemap from django.contrib.sitemaps import Sitemap as DjangoSitemap from django.utils import timezone from opps.articles.models import Article def InfoDisct(googlenews=False): article...
<commit_before><commit_msg>Create Generic Sitemap abstract django<commit_after># -*- coding: utf-8 -*- from django.contrib.sitemaps import GenericSitemap as DjangoGenericSitemap from django.contrib.sitemaps import Sitemap as DjangoSitemap from django.utils import timezone from opps.articles.models import Article def...
7707e65ed591b890d91bcb7bf22923b8c17a113a
readthedocs/rtd_tests/tests/test_api_permissions.py
readthedocs/rtd_tests/tests/test_api_permissions.py
from functools import partial from mock import Mock from unittest import TestCase from readthedocs.restapi.permissions import APIRestrictedPermission class APIRestrictedPermissionTests(TestCase): def get_request(self, method, is_admin): request = Mock() request.method = method request.use...
Add tests from Gregor's PR
Add tests from Gregor's PR
Python
mit
davidfischer/readthedocs.org,wijerasa/readthedocs.org,rtfd/readthedocs.org,davidfischer/readthedocs.org,safwanrahman/readthedocs.org,pombredanne/readthedocs.org,rtfd/readthedocs.org,SteveViss/readthedocs.org,stevepiercy/readthedocs.org,rtfd/readthedocs.org,stevepiercy/readthedocs.org,safwanrahman/readthedocs.org,clarkp...
Add tests from Gregor's PR
from functools import partial from mock import Mock from unittest import TestCase from readthedocs.restapi.permissions import APIRestrictedPermission class APIRestrictedPermissionTests(TestCase): def get_request(self, method, is_admin): request = Mock() request.method = method request.use...
<commit_before><commit_msg>Add tests from Gregor's PR<commit_after>
from functools import partial from mock import Mock from unittest import TestCase from readthedocs.restapi.permissions import APIRestrictedPermission class APIRestrictedPermissionTests(TestCase): def get_request(self, method, is_admin): request = Mock() request.method = method request.use...
Add tests from Gregor's PRfrom functools import partial from mock import Mock from unittest import TestCase from readthedocs.restapi.permissions import APIRestrictedPermission class APIRestrictedPermissionTests(TestCase): def get_request(self, method, is_admin): request = Mock() request.method = ...
<commit_before><commit_msg>Add tests from Gregor's PR<commit_after>from functools import partial from mock import Mock from unittest import TestCase from readthedocs.restapi.permissions import APIRestrictedPermission class APIRestrictedPermissionTests(TestCase): def get_request(self, method, is_admin): r...
30567284410b9bb7154b8d39e5dfe7bc4bb1b269
herald/migrations/0006_auto_20170825_1813.py
herald/migrations/0006_auto_20170825_1813.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2017-08-25 23:13 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('herald', '0005_merge_201704...
Add migration for on_delete SET_NULL
Add migration for on_delete SET_NULL
Python
mit
worthwhile/django-herald,jproffitt/django-herald,jproffitt/django-herald,worthwhile/django-herald
Add migration for on_delete SET_NULL
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2017-08-25 23:13 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('herald', '0005_merge_201704...
<commit_before><commit_msg>Add migration for on_delete SET_NULL<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2017-08-25 23:13 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('herald', '0005_merge_201704...
Add migration for on_delete SET_NULL# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2017-08-25 23:13 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ...
<commit_before><commit_msg>Add migration for on_delete SET_NULL<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2017-08-25 23:13 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migra...
f3c4bac262c6d09730b3f0c4a24639fde8b4d923
gunicorn-app.py
gunicorn-app.py
from __future__ import unicode_literals import multiprocessing import gunicorn.app.base from gunicorn.six import iteritems def number_of_workers(): return (multiprocessing.cpu_count() * 2) + 1 def handler_app(environ, start_response): response_body = b'Works fine' status = '200 OK' response_head...
Add wsgi compatible example gunicorn application
Add wsgi compatible example gunicorn application
Python
mit
voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts
Add wsgi compatible example gunicorn application
from __future__ import unicode_literals import multiprocessing import gunicorn.app.base from gunicorn.six import iteritems def number_of_workers(): return (multiprocessing.cpu_count() * 2) + 1 def handler_app(environ, start_response): response_body = b'Works fine' status = '200 OK' response_head...
<commit_before><commit_msg>Add wsgi compatible example gunicorn application<commit_after>
from __future__ import unicode_literals import multiprocessing import gunicorn.app.base from gunicorn.six import iteritems def number_of_workers(): return (multiprocessing.cpu_count() * 2) + 1 def handler_app(environ, start_response): response_body = b'Works fine' status = '200 OK' response_head...
Add wsgi compatible example gunicorn applicationfrom __future__ import unicode_literals import multiprocessing import gunicorn.app.base from gunicorn.six import iteritems def number_of_workers(): return (multiprocessing.cpu_count() * 2) + 1 def handler_app(environ, start_response): response_body = b'Work...
<commit_before><commit_msg>Add wsgi compatible example gunicorn application<commit_after>from __future__ import unicode_literals import multiprocessing import gunicorn.app.base from gunicorn.six import iteritems def number_of_workers(): return (multiprocessing.cpu_count() * 2) + 1 def handler_app(environ, st...
ae948c95ea0087f33f13ef3463dc022eda0301a2
python/labs/make-a-short-story/mystory.py
python/labs/make-a-short-story/mystory.py
# Create a function for adjectives so I don't repeat myself in prompts. def get_adjective(): return raw_input("Give me an adjective: ") def get_noun(): return raw_input("Give me a noun: ") def get_verb(): return raw_input("Give me a verb: ") adjective1 = get_adjective() noun1 = get_noun() verb1 = get_ver...
Add a solution for the MadLibs lab
Add a solution for the MadLibs lab
Python
apache-2.0
google/cssi-labs,google/cssi-labs
Add a solution for the MadLibs lab
# Create a function for adjectives so I don't repeat myself in prompts. def get_adjective(): return raw_input("Give me an adjective: ") def get_noun(): return raw_input("Give me a noun: ") def get_verb(): return raw_input("Give me a verb: ") adjective1 = get_adjective() noun1 = get_noun() verb1 = get_ver...
<commit_before><commit_msg>Add a solution for the MadLibs lab<commit_after>
# Create a function for adjectives so I don't repeat myself in prompts. def get_adjective(): return raw_input("Give me an adjective: ") def get_noun(): return raw_input("Give me a noun: ") def get_verb(): return raw_input("Give me a verb: ") adjective1 = get_adjective() noun1 = get_noun() verb1 = get_ver...
Add a solution for the MadLibs lab# Create a function for adjectives so I don't repeat myself in prompts. def get_adjective(): return raw_input("Give me an adjective: ") def get_noun(): return raw_input("Give me a noun: ") def get_verb(): return raw_input("Give me a verb: ") adjective1 = get_adjective() ...
<commit_before><commit_msg>Add a solution for the MadLibs lab<commit_after># Create a function for adjectives so I don't repeat myself in prompts. def get_adjective(): return raw_input("Give me an adjective: ") def get_noun(): return raw_input("Give me a noun: ") def get_verb(): return raw_input("Give me ...
77b34390345208a6e0bc5ad30cdce62e42ca0c56
wafer/management/commands/pycon_speaker_tickets.py
wafer/management/commands/pycon_speaker_tickets.py
import sys import csv from optparse import make_option from django.core.management.base import BaseCommand from django.contrib.auth.models import User from wafer.talks.models import ACCEPTED class Command(BaseCommand): help = "List speakers and associated tickets." option_list = BaseCommand.option_list + t...
Add simple command to list speakers and tickets
Add simple command to list speakers and tickets
Python
isc
CTPUG/wafer,CTPUG/wafer,CarlFK/wafer,CTPUG/wafer,CTPUG/wafer,CarlFK/wafer,CarlFK/wafer,CarlFK/wafer
Add simple command to list speakers and tickets
import sys import csv from optparse import make_option from django.core.management.base import BaseCommand from django.contrib.auth.models import User from wafer.talks.models import ACCEPTED class Command(BaseCommand): help = "List speakers and associated tickets." option_list = BaseCommand.option_list + t...
<commit_before><commit_msg>Add simple command to list speakers and tickets<commit_after>
import sys import csv from optparse import make_option from django.core.management.base import BaseCommand from django.contrib.auth.models import User from wafer.talks.models import ACCEPTED class Command(BaseCommand): help = "List speakers and associated tickets." option_list = BaseCommand.option_list + t...
Add simple command to list speakers and ticketsimport sys import csv from optparse import make_option from django.core.management.base import BaseCommand from django.contrib.auth.models import User from wafer.talks.models import ACCEPTED class Command(BaseCommand): help = "List speakers and associated tickets."...
<commit_before><commit_msg>Add simple command to list speakers and tickets<commit_after>import sys import csv from optparse import make_option from django.core.management.base import BaseCommand from django.contrib.auth.models import User from wafer.talks.models import ACCEPTED class Command(BaseCommand): help ...
3bbf06964452683d986db401556183f575d15a55
insert-project.py
insert-project.py
#!/usr/bin/env python3 import pymongo import subprocess import re from datetime import datetime import argparse from json import load as load_json import sys def _info(msg): sys.stdout.write(msg + '\n') sys.stdout.flush() cl_parser = argparse.ArgumentParser(description='Insert a project into Meteor\'s local...
Add script for inserting project into DB
Add script for inserting project into DB
Python
mit
muzhack/muzhack,muzhack/muzhack,praneybehl/muzhack,muzhack/musitechhub,praneybehl/muzhack,praneybehl/muzhack,muzhack/musitechhub,praneybehl/muzhack,muzhack/muzhack,muzhack/muzhack,muzhack/musitechhub,muzhack/musitechhub
Add script for inserting project into DB
#!/usr/bin/env python3 import pymongo import subprocess import re from datetime import datetime import argparse from json import load as load_json import sys def _info(msg): sys.stdout.write(msg + '\n') sys.stdout.flush() cl_parser = argparse.ArgumentParser(description='Insert a project into Meteor\'s local...
<commit_before><commit_msg>Add script for inserting project into DB<commit_after>
#!/usr/bin/env python3 import pymongo import subprocess import re from datetime import datetime import argparse from json import load as load_json import sys def _info(msg): sys.stdout.write(msg + '\n') sys.stdout.flush() cl_parser = argparse.ArgumentParser(description='Insert a project into Meteor\'s local...
Add script for inserting project into DB#!/usr/bin/env python3 import pymongo import subprocess import re from datetime import datetime import argparse from json import load as load_json import sys def _info(msg): sys.stdout.write(msg + '\n') sys.stdout.flush() cl_parser = argparse.ArgumentParser(descriptio...
<commit_before><commit_msg>Add script for inserting project into DB<commit_after>#!/usr/bin/env python3 import pymongo import subprocess import re from datetime import datetime import argparse from json import load as load_json import sys def _info(msg): sys.stdout.write(msg + '\n') sys.stdout.flush() cl_pa...
8fe73523b7141f93d8523e56a7c6a5cc2ed82051
src/collectors/iodrivesnmp/test/testiodrivesnmp.py
src/collectors/iodrivesnmp/test/testiodrivesnmp.py
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from iodrivesnmp import IODriveSNMPCollector class TestIODriveSNMPCollector(CollectorTestCase): def setUp(self, allowed_names...
Test case for ioddrivesnmp class
Test case for ioddrivesnmp class
Python
mit
datafiniti/Diamond,stuartbfox/Diamond,joel-airspring/Diamond,disqus/Diamond,Netuitive/Diamond,metamx/Diamond,cannium/Diamond,hvnsweeting/Diamond,MichaelDoyle/Diamond,MediaMath/Diamond,Precis/Diamond,anandbhoraskar/Diamond,socialwareinc/Diamond,joel-airspring/Diamond,h00dy/Diamond,mfriedenhagen/Diamond,socialwareinc/Dia...
Test case for ioddrivesnmp class
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from iodrivesnmp import IODriveSNMPCollector class TestIODriveSNMPCollector(CollectorTestCase): def setUp(self, allowed_names...
<commit_before><commit_msg>Test case for ioddrivesnmp class<commit_after>
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from iodrivesnmp import IODriveSNMPCollector class TestIODriveSNMPCollector(CollectorTestCase): def setUp(self, allowed_names...
Test case for ioddrivesnmp class#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from iodrivesnmp import IODriveSNMPCollector class TestIODriveSNMPCollector(CollectorTestCase): ...
<commit_before><commit_msg>Test case for ioddrivesnmp class<commit_after>#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from iodrivesnmp import IODriveSNMPCollector class TestI...
7ec15caf8f2c9d0a21581261a356f6decc548061
test/ui_test.py
test/ui_test.py
from app import app import unittest class UiTestCase(unittest.TestCase): def setUp(self): self.app = app.test_client() def test_index(self): self.assertEqual(self.app.get('/').status_code, 200) def test_no_page(self): self.assertEqual(self.app.get('/missing-page').status_code, 200...
Add some basic UI tests
Add some basic UI tests
Python
agpl-3.0
spacewiki/spacewiki,tdfischer/spacewiki,spacewiki/spacewiki,spacewiki/spacewiki,tdfischer/spacewiki,tdfischer/spacewiki,tdfischer/spacewiki,spacewiki/spacewiki
Add some basic UI tests
from app import app import unittest class UiTestCase(unittest.TestCase): def setUp(self): self.app = app.test_client() def test_index(self): self.assertEqual(self.app.get('/').status_code, 200) def test_no_page(self): self.assertEqual(self.app.get('/missing-page').status_code, 200...
<commit_before><commit_msg>Add some basic UI tests<commit_after>
from app import app import unittest class UiTestCase(unittest.TestCase): def setUp(self): self.app = app.test_client() def test_index(self): self.assertEqual(self.app.get('/').status_code, 200) def test_no_page(self): self.assertEqual(self.app.get('/missing-page').status_code, 200...
Add some basic UI testsfrom app import app import unittest class UiTestCase(unittest.TestCase): def setUp(self): self.app = app.test_client() def test_index(self): self.assertEqual(self.app.get('/').status_code, 200) def test_no_page(self): self.assertEqual(self.app.get('/missing-...
<commit_before><commit_msg>Add some basic UI tests<commit_after>from app import app import unittest class UiTestCase(unittest.TestCase): def setUp(self): self.app = app.test_client() def test_index(self): self.assertEqual(self.app.get('/').status_code, 200) def test_no_page(self): ...
7ddfb39256229aa8c985ed8d70a29479187c76ad
lily/management/commands/generate_beta_invites.py
lily/management/commands/generate_beta_invites.py
import csv import gc import logging from datetime import date from hashlib import sha256 from django.conf import settings from django.core.files.storage import default_storage from django.core.management import call_command from django.core.management.base import BaseCommand from django.core.urlresolvers import revers...
Create script for beta invites
LILY-2366: Create script for beta invites
Python
agpl-3.0
HelloLily/hellolily,HelloLily/hellolily,HelloLily/hellolily,HelloLily/hellolily
LILY-2366: Create script for beta invites
import csv import gc import logging from datetime import date from hashlib import sha256 from django.conf import settings from django.core.files.storage import default_storage from django.core.management import call_command from django.core.management.base import BaseCommand from django.core.urlresolvers import revers...
<commit_before><commit_msg>LILY-2366: Create script for beta invites<commit_after>
import csv import gc import logging from datetime import date from hashlib import sha256 from django.conf import settings from django.core.files.storage import default_storage from django.core.management import call_command from django.core.management.base import BaseCommand from django.core.urlresolvers import revers...
LILY-2366: Create script for beta invitesimport csv import gc import logging from datetime import date from hashlib import sha256 from django.conf import settings from django.core.files.storage import default_storage from django.core.management import call_command from django.core.management.base import BaseCommand fr...
<commit_before><commit_msg>LILY-2366: Create script for beta invites<commit_after>import csv import gc import logging from datetime import date from hashlib import sha256 from django.conf import settings from django.core.files.storage import default_storage from django.core.management import call_command from django.c...
5bc089a98bf578fd0c56e3e50cf76888ee74aba2
py/complex-number-multiplication.py
py/complex-number-multiplication.py
import re class Solution(object): def complexNumberMultiply(self, a, b): """ :type a: str :type b: str :rtype: str """ pat = re.compile(r'(-?\d+)\+(-?\d+)i') mata = pat.match(a) matb = pat.match(b) a = int(mata.group(1)), int(mata.group(2)) ...
Add py solution for 537. Complex Number Multiplication
Add py solution for 537. Complex Number Multiplication 537. Complex Number Multiplication: https://leetcode.com/problems/complex-number-multiplication/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 537. Complex Number Multiplication 537. Complex Number Multiplication: https://leetcode.com/problems/complex-number-multiplication/
import re class Solution(object): def complexNumberMultiply(self, a, b): """ :type a: str :type b: str :rtype: str """ pat = re.compile(r'(-?\d+)\+(-?\d+)i') mata = pat.match(a) matb = pat.match(b) a = int(mata.group(1)), int(mata.group(2)) ...
<commit_before><commit_msg>Add py solution for 537. Complex Number Multiplication 537. Complex Number Multiplication: https://leetcode.com/problems/complex-number-multiplication/<commit_after>
import re class Solution(object): def complexNumberMultiply(self, a, b): """ :type a: str :type b: str :rtype: str """ pat = re.compile(r'(-?\d+)\+(-?\d+)i') mata = pat.match(a) matb = pat.match(b) a = int(mata.group(1)), int(mata.group(2)) ...
Add py solution for 537. Complex Number Multiplication 537. Complex Number Multiplication: https://leetcode.com/problems/complex-number-multiplication/import re class Solution(object): def complexNumberMultiply(self, a, b): """ :type a: str :type b: str :rtype: str """ ...
<commit_before><commit_msg>Add py solution for 537. Complex Number Multiplication 537. Complex Number Multiplication: https://leetcode.com/problems/complex-number-multiplication/<commit_after>import re class Solution(object): def complexNumberMultiply(self, a, b): """ :type a: str :type b: ...
06e82c471afa83bf0f08f0779b32dd8a09b8d1ba
py/intersection-of-two-arrays-ii.py
py/intersection-of-two-arrays-ii.py
from collections import Counter class Solution(object): def intersect(self, nums1, nums2): """ :type nums1: List[int] :type nums2: List[int] :rtype: List[int] """ c1, c2 = Counter(nums1), Counter(nums2) return list((c1 & c2).elements())
Add py solution for 350. Intersection of Two Arrays II
Add py solution for 350. Intersection of Two Arrays II 350. Intersection of Two Arrays II: https://leetcode.com/problems/intersection-of-two-arrays-ii/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 350. Intersection of Two Arrays II 350. Intersection of Two Arrays II: https://leetcode.com/problems/intersection-of-two-arrays-ii/
from collections import Counter class Solution(object): def intersect(self, nums1, nums2): """ :type nums1: List[int] :type nums2: List[int] :rtype: List[int] """ c1, c2 = Counter(nums1), Counter(nums2) return list((c1 & c2).elements())
<commit_before><commit_msg>Add py solution for 350. Intersection of Two Arrays II 350. Intersection of Two Arrays II: https://leetcode.com/problems/intersection-of-two-arrays-ii/<commit_after>
from collections import Counter class Solution(object): def intersect(self, nums1, nums2): """ :type nums1: List[int] :type nums2: List[int] :rtype: List[int] """ c1, c2 = Counter(nums1), Counter(nums2) return list((c1 & c2).elements())
Add py solution for 350. Intersection of Two Arrays II 350. Intersection of Two Arrays II: https://leetcode.com/problems/intersection-of-two-arrays-ii/from collections import Counter class Solution(object): def intersect(self, nums1, nums2): """ :type nums1: List[int] :type nums2: List[int]...
<commit_before><commit_msg>Add py solution for 350. Intersection of Two Arrays II 350. Intersection of Two Arrays II: https://leetcode.com/problems/intersection-of-two-arrays-ii/<commit_after>from collections import Counter class Solution(object): def intersect(self, nums1, nums2): """ :type nums1:...
9d7c348170fc0f9d339a2ef57a9e64b1ceaa7516
web/whim/core/scrapers/mnh.py
web/whim/core/scrapers/mnh.py
from datetime import datetime, timezone, time import requests from bs4 import BeautifulSoup from django.db import transaction from .base import BaseScraper from .exceptions import ScraperException from whim.core.models import Event, Source, Category from whim.core.utils import get_object_or_none from whim.core.time...
Add demo MNH event scraper
Add demo MNH event scraper
Python
mit
andrewgleave/whim,andrewgleave/whim,andrewgleave/whim
Add demo MNH event scraper
from datetime import datetime, timezone, time import requests from bs4 import BeautifulSoup from django.db import transaction from .base import BaseScraper from .exceptions import ScraperException from whim.core.models import Event, Source, Category from whim.core.utils import get_object_or_none from whim.core.time...
<commit_before><commit_msg>Add demo MNH event scraper<commit_after>
from datetime import datetime, timezone, time import requests from bs4 import BeautifulSoup from django.db import transaction from .base import BaseScraper from .exceptions import ScraperException from whim.core.models import Event, Source, Category from whim.core.utils import get_object_or_none from whim.core.time...
Add demo MNH event scraperfrom datetime import datetime, timezone, time import requests from bs4 import BeautifulSoup from django.db import transaction from .base import BaseScraper from .exceptions import ScraperException from whim.core.models import Event, Source, Category from whim.core.utils import get_object_o...
<commit_before><commit_msg>Add demo MNH event scraper<commit_after>from datetime import datetime, timezone, time import requests from bs4 import BeautifulSoup from django.db import transaction from .base import BaseScraper from .exceptions import ScraperException from whim.core.models import Event, Source, Category...
84990a4ef20c2e0f42133ed06ade5ce2d4e98ae3
chmvh_website/team/models.py
chmvh_website/team/models.py
from django.db import models def team_member_image_name(instance, filename): return 'team/{0}'.format(instance.name) class TeamMember(models.Model): bio = models.TextField( verbose_name='biography') name = models.CharField( max_length=50, unique=True, verbose_name='name')...
import os from django.db import models def team_member_image_name(instance, filename): _, ext = os.path.splitext(filename) return 'team/{0}{1}'.format(instance.name, ext) class TeamMember(models.Model): bio = models.TextField( verbose_name='biography') name = models.CharField( max_...
Save team member picture with extension.
Save team member picture with extension.
Python
mit
cdriehuys/chmvh-website,cdriehuys/chmvh-website,cdriehuys/chmvh-website
from django.db import models def team_member_image_name(instance, filename): return 'team/{0}'.format(instance.name) class TeamMember(models.Model): bio = models.TextField( verbose_name='biography') name = models.CharField( max_length=50, unique=True, verbose_name='name')...
import os from django.db import models def team_member_image_name(instance, filename): _, ext = os.path.splitext(filename) return 'team/{0}{1}'.format(instance.name, ext) class TeamMember(models.Model): bio = models.TextField( verbose_name='biography') name = models.CharField( max_...
<commit_before>from django.db import models def team_member_image_name(instance, filename): return 'team/{0}'.format(instance.name) class TeamMember(models.Model): bio = models.TextField( verbose_name='biography') name = models.CharField( max_length=50, unique=True, verbo...
import os from django.db import models def team_member_image_name(instance, filename): _, ext = os.path.splitext(filename) return 'team/{0}{1}'.format(instance.name, ext) class TeamMember(models.Model): bio = models.TextField( verbose_name='biography') name = models.CharField( max_...
from django.db import models def team_member_image_name(instance, filename): return 'team/{0}'.format(instance.name) class TeamMember(models.Model): bio = models.TextField( verbose_name='biography') name = models.CharField( max_length=50, unique=True, verbose_name='name')...
<commit_before>from django.db import models def team_member_image_name(instance, filename): return 'team/{0}'.format(instance.name) class TeamMember(models.Model): bio = models.TextField( verbose_name='biography') name = models.CharField( max_length=50, unique=True, verbo...
257134bdaea7c250d5956c4095adf0b917b65aa6
database/dict_converters/event_details_converter.py
database/dict_converters/event_details_converter.py
from database.dict_converters.converter_base import ConverterBase class EventDetailsConverter(ConverterBase): SUBVERSIONS = { # Increment every time a change to the dict is made 3: 0, } @classmethod def convert(cls, event_details, dict_version): CONVERTERS = { 3: cls.even...
from database.dict_converters.converter_base import ConverterBase class EventDetailsConverter(ConverterBase): SUBVERSIONS = { # Increment every time a change to the dict is made 3: 0, } @classmethod def convert(cls, event_details, dict_version): CONVERTERS = { 3: cls.even...
Fix null case for event details
Fix null case for event details
Python
mit
verycumbersome/the-blue-alliance,the-blue-alliance/the-blue-alliance,nwalters512/the-blue-alliance,nwalters512/the-blue-alliance,the-blue-alliance/the-blue-alliance,tsteward/the-blue-alliance,nwalters512/the-blue-alliance,phil-lopreiato/the-blue-alliance,nwalters512/the-blue-alliance,tsteward/the-blue-alliance,jaredhas...
from database.dict_converters.converter_base import ConverterBase class EventDetailsConverter(ConverterBase): SUBVERSIONS = { # Increment every time a change to the dict is made 3: 0, } @classmethod def convert(cls, event_details, dict_version): CONVERTERS = { 3: cls.even...
from database.dict_converters.converter_base import ConverterBase class EventDetailsConverter(ConverterBase): SUBVERSIONS = { # Increment every time a change to the dict is made 3: 0, } @classmethod def convert(cls, event_details, dict_version): CONVERTERS = { 3: cls.even...
<commit_before>from database.dict_converters.converter_base import ConverterBase class EventDetailsConverter(ConverterBase): SUBVERSIONS = { # Increment every time a change to the dict is made 3: 0, } @classmethod def convert(cls, event_details, dict_version): CONVERTERS = { ...
from database.dict_converters.converter_base import ConverterBase class EventDetailsConverter(ConverterBase): SUBVERSIONS = { # Increment every time a change to the dict is made 3: 0, } @classmethod def convert(cls, event_details, dict_version): CONVERTERS = { 3: cls.even...
from database.dict_converters.converter_base import ConverterBase class EventDetailsConverter(ConverterBase): SUBVERSIONS = { # Increment every time a change to the dict is made 3: 0, } @classmethod def convert(cls, event_details, dict_version): CONVERTERS = { 3: cls.even...
<commit_before>from database.dict_converters.converter_base import ConverterBase class EventDetailsConverter(ConverterBase): SUBVERSIONS = { # Increment every time a change to the dict is made 3: 0, } @classmethod def convert(cls, event_details, dict_version): CONVERTERS = { ...
03279bbc6193d3944dcd2542daa65701a1e0eded
euler026.py
euler026.py
#!/usr/bin/python """ For resolve this, we have to find the maximum Full Reptend Prime int he given limit. To do that, we need to check if the 10 is a primitive root of p. See http://mathworld.wolfram.com/FullReptendPrime.html for details """ from sys import exit for p in range(999, 7, -2): for k in range(1, p)...
Add solution for problem 26
Add solution for problem 26
Python
mit
cifvts/PyEuler
Add solution for problem 26
#!/usr/bin/python """ For resolve this, we have to find the maximum Full Reptend Prime int he given limit. To do that, we need to check if the 10 is a primitive root of p. See http://mathworld.wolfram.com/FullReptendPrime.html for details """ from sys import exit for p in range(999, 7, -2): for k in range(1, p)...
<commit_before><commit_msg>Add solution for problem 26<commit_after>
#!/usr/bin/python """ For resolve this, we have to find the maximum Full Reptend Prime int he given limit. To do that, we need to check if the 10 is a primitive root of p. See http://mathworld.wolfram.com/FullReptendPrime.html for details """ from sys import exit for p in range(999, 7, -2): for k in range(1, p)...
Add solution for problem 26#!/usr/bin/python """ For resolve this, we have to find the maximum Full Reptend Prime int he given limit. To do that, we need to check if the 10 is a primitive root of p. See http://mathworld.wolfram.com/FullReptendPrime.html for details """ from sys import exit for p in range(999, 7, -2...
<commit_before><commit_msg>Add solution for problem 26<commit_after>#!/usr/bin/python """ For resolve this, we have to find the maximum Full Reptend Prime int he given limit. To do that, we need to check if the 10 is a primitive root of p. See http://mathworld.wolfram.com/FullReptendPrime.html for details """ from s...
930a8b1a7c980183df5469627a734033ca39a444
shade/tests/functional/test_image.py
shade/tests/functional/test_image.py
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
Add functional tests for create_image
Add functional tests for create_image Change-Id: Iadb70ca764fbc2c8102a988d6e03cf623b6df48d
Python
apache-2.0
openstack-infra/shade,jsmartin/shade,dtroyer/python-openstacksdk,openstack/python-openstacksdk,stackforge/python-openstacksdk,openstack-infra/shade,dtroyer/python-openstacksdk,stackforge/python-openstacksdk,jsmartin/shade,openstack/python-openstacksdk
Add functional tests for create_image Change-Id: Iadb70ca764fbc2c8102a988d6e03cf623b6df48d
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
<commit_before><commit_msg>Add functional tests for create_image Change-Id: Iadb70ca764fbc2c8102a988d6e03cf623b6df48d<commit_after>
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
Add functional tests for create_image Change-Id: Iadb70ca764fbc2c8102a988d6e03cf623b6df48d# -*- coding: utf-8 -*- # 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.or...
<commit_before><commit_msg>Add functional tests for create_image Change-Id: Iadb70ca764fbc2c8102a988d6e03cf623b6df48d<commit_after># -*- coding: utf-8 -*- # 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...
9c045f7667e1bdc6c9137c3877292907f4623774
make_a_plea/management/commands/check_urns_in_db.py
make_a_plea/management/commands/check_urns_in_db.py
import csv from django.core.management.base import BaseCommand from apps.plea.models import DataValidation, Case from apps.plea.standardisers import standardise_urn, format_for_region class Command(BaseCommand): help = "Build weekly aggregate stats" def add_arguments(self, parser): parser.add_argum...
Add a management command to check if URNs are present in the database
Add a management command to check if URNs are present in the database
Python
mit
ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas,ministryofjustice/manchester_traffic_offences_pleas
Add a management command to check if URNs are present in the database
import csv from django.core.management.base import BaseCommand from apps.plea.models import DataValidation, Case from apps.plea.standardisers import standardise_urn, format_for_region class Command(BaseCommand): help = "Build weekly aggregate stats" def add_arguments(self, parser): parser.add_argum...
<commit_before><commit_msg>Add a management command to check if URNs are present in the database<commit_after>
import csv from django.core.management.base import BaseCommand from apps.plea.models import DataValidation, Case from apps.plea.standardisers import standardise_urn, format_for_region class Command(BaseCommand): help = "Build weekly aggregate stats" def add_arguments(self, parser): parser.add_argum...
Add a management command to check if URNs are present in the databaseimport csv from django.core.management.base import BaseCommand from apps.plea.models import DataValidation, Case from apps.plea.standardisers import standardise_urn, format_for_region class Command(BaseCommand): help = "Build weekly aggregate ...
<commit_before><commit_msg>Add a management command to check if URNs are present in the database<commit_after>import csv from django.core.management.base import BaseCommand from apps.plea.models import DataValidation, Case from apps.plea.standardisers import standardise_urn, format_for_region class Command(BaseComm...
d6e9971ceefc69f0eefc7440cc5e7035e7dcc05d
contentcuration/contentcuration/middleware/ErrorReportingMiddleware.py
contentcuration/contentcuration/middleware/ErrorReportingMiddleware.py
from google.cloud import error_reporting class ErrorReportingMiddleware(object): def __init__(self, *args, **kwargs): self.client = error_reporting.Client() def process_exception(self, request, exception): self.client.report_exception()
Add the middleware for reporting errors to gcloud.
Add the middleware for reporting errors to gcloud.
Python
mit
fle-internal/content-curation,jonboiser/content-curation,jonboiser/content-curation,jayoshih/content-curation,aronasorman/content-curation,jayoshih/content-curation,fle-internal/content-curation,aronasorman/content-curation,jayoshih/content-curation,DXCanas/content-curation,jonboiser/content-curation,fle-internal/conte...
Add the middleware for reporting errors to gcloud.
from google.cloud import error_reporting class ErrorReportingMiddleware(object): def __init__(self, *args, **kwargs): self.client = error_reporting.Client() def process_exception(self, request, exception): self.client.report_exception()
<commit_before><commit_msg>Add the middleware for reporting errors to gcloud.<commit_after>
from google.cloud import error_reporting class ErrorReportingMiddleware(object): def __init__(self, *args, **kwargs): self.client = error_reporting.Client() def process_exception(self, request, exception): self.client.report_exception()
Add the middleware for reporting errors to gcloud.from google.cloud import error_reporting class ErrorReportingMiddleware(object): def __init__(self, *args, **kwargs): self.client = error_reporting.Client() def process_exception(self, request, exception): self.client.report_exception()
<commit_before><commit_msg>Add the middleware for reporting errors to gcloud.<commit_after>from google.cloud import error_reporting class ErrorReportingMiddleware(object): def __init__(self, *args, **kwargs): self.client = error_reporting.Client() def process_exception(self, request, exception): ...
40f92e6293bb13ee1462b932be15f5f11ceeee74
compiler/infer.py
compiler/infer.py
""" # ---------------------------------------------------------------------- # infer.py # # Type inference for Llama # http://courses.softlab.ntua.gr/compilers/2012a/llama2012.pdf # # Authors: Nick Korasidis <renelvon@gmail.com> # Dimitris Koutsoukos <dim.kou.shmmy@gmail.com> # --------------------------------...
Add initial implementation of TempType.
Infer: Add initial implementation of TempType. * This will be used to supply types to all type-bearing nodes during type inference.
Python
mit
Renelvon/llama,Renelvon/llama
Infer: Add initial implementation of TempType. * This will be used to supply types to all type-bearing nodes during type inference.
""" # ---------------------------------------------------------------------- # infer.py # # Type inference for Llama # http://courses.softlab.ntua.gr/compilers/2012a/llama2012.pdf # # Authors: Nick Korasidis <renelvon@gmail.com> # Dimitris Koutsoukos <dim.kou.shmmy@gmail.com> # --------------------------------...
<commit_before><commit_msg>Infer: Add initial implementation of TempType. * This will be used to supply types to all type-bearing nodes during type inference.<commit_after>
""" # ---------------------------------------------------------------------- # infer.py # # Type inference for Llama # http://courses.softlab.ntua.gr/compilers/2012a/llama2012.pdf # # Authors: Nick Korasidis <renelvon@gmail.com> # Dimitris Koutsoukos <dim.kou.shmmy@gmail.com> # --------------------------------...
Infer: Add initial implementation of TempType. * This will be used to supply types to all type-bearing nodes during type inference.""" # ---------------------------------------------------------------------- # infer.py # # Type inference for Llama # http://courses.softlab.ntua.gr/compilers/2012a/llama2012.pdf # # Au...
<commit_before><commit_msg>Infer: Add initial implementation of TempType. * This will be used to supply types to all type-bearing nodes during type inference.<commit_after>""" # ---------------------------------------------------------------------- # infer.py # # Type inference for Llama # http://courses.softlab.ntu...
133da92ed69aafc6c0a8d4466cf3b0266c5edc68
userprofile/migrations/0006_auto_20180309_2215.py
userprofile/migrations/0006_auto_20180309_2215.py
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-03-09 22:15 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('userprofile', '0005_auto_20171121_1923'), ] operations = [ migrations.AlterFi...
Add migration for change in profile model.
Add migration for change in profile model.
Python
mit
hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website
Add migration for change in profile model.
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-03-09 22:15 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('userprofile', '0005_auto_20171121_1923'), ] operations = [ migrations.AlterFi...
<commit_before><commit_msg>Add migration for change in profile model.<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-03-09 22:15 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('userprofile', '0005_auto_20171121_1923'), ] operations = [ migrations.AlterFi...
Add migration for change in profile model.# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-03-09 22:15 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('userprofile', '0005_auto_20171121_1923'), ] ...
<commit_before><commit_msg>Add migration for change in profile model.<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-03-09 22:15 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('userprofile...
f3db6608c2b4afeb214c3f1b94e0175609ad0b88
cs4teachers/events/migrations/0018_auto_20170706_0803.py
cs4teachers/events/migrations/0018_auto_20170706_0803.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-07-06 08:03 from __future__ import unicode_literals import autoslug.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('events', '0017_auto_20170705_0952'), ] operations = [ migrat...
Add migration file for event slug changes
Add migration file for event slug changes
Python
mit
uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers
Add migration file for event slug changes
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-07-06 08:03 from __future__ import unicode_literals import autoslug.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('events', '0017_auto_20170705_0952'), ] operations = [ migrat...
<commit_before><commit_msg>Add migration file for event slug changes<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-07-06 08:03 from __future__ import unicode_literals import autoslug.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('events', '0017_auto_20170705_0952'), ] operations = [ migrat...
Add migration file for event slug changes# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-07-06 08:03 from __future__ import unicode_literals import autoslug.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('events', '0017_auto_20170705_0952'),...
<commit_before><commit_msg>Add migration file for event slug changes<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-07-06 08:03 from __future__ import unicode_literals import autoslug.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ...
8cf5b328d7596a9b74490b7dfd4a1b8aa1577b55
accelerator/migrations/0110_remove_bucket_list_program_role_20220707_1001.py
accelerator/migrations/0110_remove_bucket_list_program_role_20220707_1001.py
from django.db import migrations def remove_bucket_list_program_roles(apps, schema_editor): BucketState = apps.get_model('accelerator', 'BucketState') ProgramRole = apps.get_model('accelerator', 'ProgramRole') ProgramRoleGrant = apps.get_model('accelerator', 'ProgramRoleGrant') NodePublishedFor = apps...
Merge remote-tracking branch 'origin' into AC-9512
[AC-9512] Merge remote-tracking branch 'origin' into AC-9512
Python
mit
masschallenge/django-accelerator,masschallenge/django-accelerator
[AC-9512] Merge remote-tracking branch 'origin' into AC-9512
from django.db import migrations def remove_bucket_list_program_roles(apps, schema_editor): BucketState = apps.get_model('accelerator', 'BucketState') ProgramRole = apps.get_model('accelerator', 'ProgramRole') ProgramRoleGrant = apps.get_model('accelerator', 'ProgramRoleGrant') NodePublishedFor = apps...
<commit_before><commit_msg>[AC-9512] Merge remote-tracking branch 'origin' into AC-9512<commit_after>
from django.db import migrations def remove_bucket_list_program_roles(apps, schema_editor): BucketState = apps.get_model('accelerator', 'BucketState') ProgramRole = apps.get_model('accelerator', 'ProgramRole') ProgramRoleGrant = apps.get_model('accelerator', 'ProgramRoleGrant') NodePublishedFor = apps...
[AC-9512] Merge remote-tracking branch 'origin' into AC-9512from django.db import migrations def remove_bucket_list_program_roles(apps, schema_editor): BucketState = apps.get_model('accelerator', 'BucketState') ProgramRole = apps.get_model('accelerator', 'ProgramRole') ProgramRoleGrant = apps.get_model('a...
<commit_before><commit_msg>[AC-9512] Merge remote-tracking branch 'origin' into AC-9512<commit_after>from django.db import migrations def remove_bucket_list_program_roles(apps, schema_editor): BucketState = apps.get_model('accelerator', 'BucketState') ProgramRole = apps.get_model('accelerator', 'ProgramRole')...
98295608a2ba4519d12212532380253bba4372ed
scripts/frequency_analysis.py
scripts/frequency_analysis.py
import asyncio import attr import pprint import dateutil.parser from datetime import timedelta from bobsled.core import bobsled from bobsled.base import Status def recommend_frequency_for_task(runs): total_duration = timedelta(seconds=0) longest_duration = timedelta(seconds=0) for run in runs: sta...
Add script that recommends scrape task schedule based on recent run timings
Add script that recommends scrape task schedule based on recent run timings
Python
mit
openstates/bobsled,openstates/bobsled,openstates/bobsled,openstates/bobsled
Add script that recommends scrape task schedule based on recent run timings
import asyncio import attr import pprint import dateutil.parser from datetime import timedelta from bobsled.core import bobsled from bobsled.base import Status def recommend_frequency_for_task(runs): total_duration = timedelta(seconds=0) longest_duration = timedelta(seconds=0) for run in runs: sta...
<commit_before><commit_msg>Add script that recommends scrape task schedule based on recent run timings<commit_after>
import asyncio import attr import pprint import dateutil.parser from datetime import timedelta from bobsled.core import bobsled from bobsled.base import Status def recommend_frequency_for_task(runs): total_duration = timedelta(seconds=0) longest_duration = timedelta(seconds=0) for run in runs: sta...
Add script that recommends scrape task schedule based on recent run timingsimport asyncio import attr import pprint import dateutil.parser from datetime import timedelta from bobsled.core import bobsled from bobsled.base import Status def recommend_frequency_for_task(runs): total_duration = timedelta(seconds=0) ...
<commit_before><commit_msg>Add script that recommends scrape task schedule based on recent run timings<commit_after>import asyncio import attr import pprint import dateutil.parser from datetime import timedelta from bobsled.core import bobsled from bobsled.base import Status def recommend_frequency_for_task(runs): ...
6aef9ab419b09822b2255141349144ac8978e862
kolibri/core/content/migrations/0025_add_h5p_kind.py
kolibri/core/content/migrations/0025_add_h5p_kind.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.23 on 2019-12-19 02:29 from __future__ import unicode_literals from django.db import migrations from django.db import models class Migration(migrations.Migration): dependencies = [ ("content", "0024_channelmetadata_public"), ] operations = [ ...
Add migration for h5p kind.
Add migration for h5p kind.
Python
mit
mrpau/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,mrpau/kolibri,learningequality/kolibri,indirectlylit/kolibri,learningequality/kolibri,learningequality/kolibri,mrpau/kolibri,mrpau/kolibri,indirectlylit/kolibri,learningequality/kolibri
Add migration for h5p kind.
# -*- coding: utf-8 -*- # Generated by Django 1.11.23 on 2019-12-19 02:29 from __future__ import unicode_literals from django.db import migrations from django.db import models class Migration(migrations.Migration): dependencies = [ ("content", "0024_channelmetadata_public"), ] operations = [ ...
<commit_before><commit_msg>Add migration for h5p kind.<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.11.23 on 2019-12-19 02:29 from __future__ import unicode_literals from django.db import migrations from django.db import models class Migration(migrations.Migration): dependencies = [ ("content", "0024_channelmetadata_public"), ] operations = [ ...
Add migration for h5p kind.# -*- coding: utf-8 -*- # Generated by Django 1.11.23 on 2019-12-19 02:29 from __future__ import unicode_literals from django.db import migrations from django.db import models class Migration(migrations.Migration): dependencies = [ ("content", "0024_channelmetadata_public"), ...
<commit_before><commit_msg>Add migration for h5p kind.<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.11.23 on 2019-12-19 02:29 from __future__ import unicode_literals from django.db import migrations from django.db import models class Migration(migrations.Migration): dependencies = [ ("co...
ecfadf8478b8775d8579812a7bd835f6ebb1ffd4
util/rclone-list-files.py
util/rclone-list-files.py
#!/usr/bin/env python3 import glob # For use with --files-from argument for Rclone # This suits Edgar's structure with is # SPECIESNAME/{occurrences|projected-distributions}/[2nd-to-latest-file-is-the-latest].zip for folder in glob.glob('*'): occurrences = glob.glob(folder + '/occurrences/*') projected_distrib...
Add file lister for rclone export
Add file lister for rclone export
Python
bsd-3-clause
jcu-eresearch/Edgar,jcu-eresearch/Edgar,jcu-eresearch/Edgar,jcu-eresearch/Edgar,jcu-eresearch/Edgar,jcu-eresearch/Edgar
Add file lister for rclone export
#!/usr/bin/env python3 import glob # For use with --files-from argument for Rclone # This suits Edgar's structure with is # SPECIESNAME/{occurrences|projected-distributions}/[2nd-to-latest-file-is-the-latest].zip for folder in glob.glob('*'): occurrences = glob.glob(folder + '/occurrences/*') projected_distrib...
<commit_before><commit_msg>Add file lister for rclone export<commit_after>
#!/usr/bin/env python3 import glob # For use with --files-from argument for Rclone # This suits Edgar's structure with is # SPECIESNAME/{occurrences|projected-distributions}/[2nd-to-latest-file-is-the-latest].zip for folder in glob.glob('*'): occurrences = glob.glob(folder + '/occurrences/*') projected_distrib...
Add file lister for rclone export#!/usr/bin/env python3 import glob # For use with --files-from argument for Rclone # This suits Edgar's structure with is # SPECIESNAME/{occurrences|projected-distributions}/[2nd-to-latest-file-is-the-latest].zip for folder in glob.glob('*'): occurrences = glob.glob(folder + '/occu...
<commit_before><commit_msg>Add file lister for rclone export<commit_after>#!/usr/bin/env python3 import glob # For use with --files-from argument for Rclone # This suits Edgar's structure with is # SPECIESNAME/{occurrences|projected-distributions}/[2nd-to-latest-file-is-the-latest].zip for folder in glob.glob('*'): ...
499adce8b5c23d60073d4c92259e611609ee0c61
states/common/maven/artifacts/check_dependencies.py
states/common/maven/artifacts/check_dependencies.py
#!/usr/bin/env python import subprocess as sub import yaml import re distrib_pom_path = '/home/uvsmtid/Works/maritime-singapore.git/clearsea-distribution/pom.xml' # Resolve (download) all dependencies locally so that next command # can work offline. sub.check_call( [ 'mvn', '-f', distrib_...
Add initial draft script to analyse Maven deps
Add initial draft script to analyse Maven deps
Python
apache-2.0
uvsmtid/common-salt-states,uvsmtid/common-salt-states,uvsmtid/common-salt-states,uvsmtid/common-salt-states
Add initial draft script to analyse Maven deps
#!/usr/bin/env python import subprocess as sub import yaml import re distrib_pom_path = '/home/uvsmtid/Works/maritime-singapore.git/clearsea-distribution/pom.xml' # Resolve (download) all dependencies locally so that next command # can work offline. sub.check_call( [ 'mvn', '-f', distrib_...
<commit_before><commit_msg>Add initial draft script to analyse Maven deps<commit_after>
#!/usr/bin/env python import subprocess as sub import yaml import re distrib_pom_path = '/home/uvsmtid/Works/maritime-singapore.git/clearsea-distribution/pom.xml' # Resolve (download) all dependencies locally so that next command # can work offline. sub.check_call( [ 'mvn', '-f', distrib_...
Add initial draft script to analyse Maven deps#!/usr/bin/env python import subprocess as sub import yaml import re distrib_pom_path = '/home/uvsmtid/Works/maritime-singapore.git/clearsea-distribution/pom.xml' # Resolve (download) all dependencies locally so that next command # can work offline. sub.check_call( [...
<commit_before><commit_msg>Add initial draft script to analyse Maven deps<commit_after>#!/usr/bin/env python import subprocess as sub import yaml import re distrib_pom_path = '/home/uvsmtid/Works/maritime-singapore.git/clearsea-distribution/pom.xml' # Resolve (download) all dependencies locally so that next command ...
6fd75772efac321517a1d8c01addfa5cbbf7caf0
tests/db/user_test.py
tests/db/user_test.py
from okcupyd.db import user def test_have_messaged_before(T): message_thread_model = T.factory.message_thread() assert user.have_messaged_by_username( message_thread_model.initiator.handle, message_thread_model.respondent.handle ) assert user.have_messaged_by_username( message_t...
Add test file for user functions.
Add test file for user functions.
Python
mit
IvanMalison/okcupyd,okuser/okcupyd,IvanMalison/okcupyd,okuser/okcupyd
Add test file for user functions.
from okcupyd.db import user def test_have_messaged_before(T): message_thread_model = T.factory.message_thread() assert user.have_messaged_by_username( message_thread_model.initiator.handle, message_thread_model.respondent.handle ) assert user.have_messaged_by_username( message_t...
<commit_before><commit_msg>Add test file for user functions.<commit_after>
from okcupyd.db import user def test_have_messaged_before(T): message_thread_model = T.factory.message_thread() assert user.have_messaged_by_username( message_thread_model.initiator.handle, message_thread_model.respondent.handle ) assert user.have_messaged_by_username( message_t...
Add test file for user functions.from okcupyd.db import user def test_have_messaged_before(T): message_thread_model = T.factory.message_thread() assert user.have_messaged_by_username( message_thread_model.initiator.handle, message_thread_model.respondent.handle ) assert user.have_messag...
<commit_before><commit_msg>Add test file for user functions.<commit_after>from okcupyd.db import user def test_have_messaged_before(T): message_thread_model = T.factory.message_thread() assert user.have_messaged_by_username( message_thread_model.initiator.handle, message_thread_model.respondent...
f8a0aa92c8e19bc11f8a609733644afe0efed5c8
decompose_test.py
decompose_test.py
from util.decompose_graph import decompose_graph from core.himesis_utils import expand_graph, set_do_pickle, set_compression set_do_pickle(True) set_compression(6) file_name = "226482067288742734644994685633991185819" graph = expand_graph(file_name) print(graph.name) from core.himesis_utils import load_directory ...
Update test script to do match testing.
Update test script to do match testing.
Python
mit
levilucio/SyVOLT,levilucio/SyVOLT
Update test script to do match testing.
from util.decompose_graph import decompose_graph from core.himesis_utils import expand_graph, set_do_pickle, set_compression set_do_pickle(True) set_compression(6) file_name = "226482067288742734644994685633991185819" graph = expand_graph(file_name) print(graph.name) from core.himesis_utils import load_directory ...
<commit_before><commit_msg>Update test script to do match testing.<commit_after>
from util.decompose_graph import decompose_graph from core.himesis_utils import expand_graph, set_do_pickle, set_compression set_do_pickle(True) set_compression(6) file_name = "226482067288742734644994685633991185819" graph = expand_graph(file_name) print(graph.name) from core.himesis_utils import load_directory ...
Update test script to do match testing.from util.decompose_graph import decompose_graph from core.himesis_utils import expand_graph, set_do_pickle, set_compression set_do_pickle(True) set_compression(6) file_name = "226482067288742734644994685633991185819" graph = expand_graph(file_name) print(graph.name) from co...
<commit_before><commit_msg>Update test script to do match testing.<commit_after>from util.decompose_graph import decompose_graph from core.himesis_utils import expand_graph, set_do_pickle, set_compression set_do_pickle(True) set_compression(6) file_name = "226482067288742734644994685633991185819" graph = expand_gra...
7e96013f21bbb5003b30da1e04833dcf58650602
freenoted/tasks/tornado_thrift.py
freenoted/tasks/tornado_thrift.py
from __future__ import absolute_import import tornado.web from thrift.transport.TTransport import TMemoryBuffer from thrift.protocol.TBinaryProtocol import TBinaryProtocol class TornadoThriftHandler(tornado.web.RequestHandler): def initialize(self, processor): self.processor = processor def post...
Implement a ThriftHandler for tornado
Implement a ThriftHandler for tornado This Handler requires a processor=... kwarg (e.g., self.service) for the third value in the handler description (e.g.,: ('/thrift', TornadoThriftHandler, dict(processor=self.service)) ).
Python
bsd-3-clause
fmoo/sparts,bboozzoo/sparts,facebook/sparts,pshuff/sparts,fmoo/sparts,djipko/sparts,bboozzoo/sparts,djipko/sparts,facebook/sparts,pshuff/sparts
Implement a ThriftHandler for tornado This Handler requires a processor=... kwarg (e.g., self.service) for the third value in the handler description (e.g.,: ('/thrift', TornadoThriftHandler, dict(processor=self.service)) ).
from __future__ import absolute_import import tornado.web from thrift.transport.TTransport import TMemoryBuffer from thrift.protocol.TBinaryProtocol import TBinaryProtocol class TornadoThriftHandler(tornado.web.RequestHandler): def initialize(self, processor): self.processor = processor def post...
<commit_before><commit_msg>Implement a ThriftHandler for tornado This Handler requires a processor=... kwarg (e.g., self.service) for the third value in the handler description (e.g.,: ('/thrift', TornadoThriftHandler, dict(processor=self.service)) ).<commit_after>
from __future__ import absolute_import import tornado.web from thrift.transport.TTransport import TMemoryBuffer from thrift.protocol.TBinaryProtocol import TBinaryProtocol class TornadoThriftHandler(tornado.web.RequestHandler): def initialize(self, processor): self.processor = processor def post...
Implement a ThriftHandler for tornado This Handler requires a processor=... kwarg (e.g., self.service) for the third value in the handler description (e.g.,: ('/thrift', TornadoThriftHandler, dict(processor=self.service)) ).from __future__ import absolute_import import tornado.web from thrift.transport.TTransport i...
<commit_before><commit_msg>Implement a ThriftHandler for tornado This Handler requires a processor=... kwarg (e.g., self.service) for the third value in the handler description (e.g.,: ('/thrift', TornadoThriftHandler, dict(processor=self.service)) ).<commit_after>from __future__ import absolute_import import torna...
d60c1f9a6e56472611a96779462b42e8505e7905
python/pdf_to_img.py
python/pdf_to_img.py
import requests import json # Convert a PDF document to JPEG/PNG image via /pdftoimg endpoint - https://pixlab.io/cmd?id=pdftoimg req = requests.get('https://api.pixlab.io/pdftoimg',params={ 'src':'https://www.getharvest.com/downloads/Invoice_Template.pdf', 'export': 'jpeg', 'key':'My_PixLab_Key' }) reply = req.j...
Convert a PDF document to JPEG/PNG image via /pdftoimg endpoint
Convert a PDF document to JPEG/PNG image via /pdftoimg endpoint
Python
bsd-2-clause
symisc/pixlab,symisc/pixlab,symisc/pixlab
Convert a PDF document to JPEG/PNG image via /pdftoimg endpoint
import requests import json # Convert a PDF document to JPEG/PNG image via /pdftoimg endpoint - https://pixlab.io/cmd?id=pdftoimg req = requests.get('https://api.pixlab.io/pdftoimg',params={ 'src':'https://www.getharvest.com/downloads/Invoice_Template.pdf', 'export': 'jpeg', 'key':'My_PixLab_Key' }) reply = req.j...
<commit_before><commit_msg>Convert a PDF document to JPEG/PNG image via /pdftoimg endpoint<commit_after>
import requests import json # Convert a PDF document to JPEG/PNG image via /pdftoimg endpoint - https://pixlab.io/cmd?id=pdftoimg req = requests.get('https://api.pixlab.io/pdftoimg',params={ 'src':'https://www.getharvest.com/downloads/Invoice_Template.pdf', 'export': 'jpeg', 'key':'My_PixLab_Key' }) reply = req.j...
Convert a PDF document to JPEG/PNG image via /pdftoimg endpointimport requests import json # Convert a PDF document to JPEG/PNG image via /pdftoimg endpoint - https://pixlab.io/cmd?id=pdftoimg req = requests.get('https://api.pixlab.io/pdftoimg',params={ 'src':'https://www.getharvest.com/downloads/Invoice_Template.pdf...
<commit_before><commit_msg>Convert a PDF document to JPEG/PNG image via /pdftoimg endpoint<commit_after>import requests import json # Convert a PDF document to JPEG/PNG image via /pdftoimg endpoint - https://pixlab.io/cmd?id=pdftoimg req = requests.get('https://api.pixlab.io/pdftoimg',params={ 'src':'https://www.geth...
b47369d43a0a85ac2bc32bfa77c6a4d9074ce700
test/test_retrieve_dns.py
test/test_retrieve_dns.py
import logging import os import tempfile import unittest import mock import bin.retrieve_dns logging.basicConfig(level=logging.INFO) class RetrieveDnsTestCase(unittest.TestCase): def setUp(self): # Mock out logging mock.patch('bin.retrieve_dns.set_up_logging', autospec=True).start() ...
Add basic test case for retrieve_dns module
Add basic test case for retrieve_dns module
Python
apache-2.0
apel/apel,stfc/apel,tofu-rocketry/apel,apel/apel,tofu-rocketry/apel,stfc/apel
Add basic test case for retrieve_dns module
import logging import os import tempfile import unittest import mock import bin.retrieve_dns logging.basicConfig(level=logging.INFO) class RetrieveDnsTestCase(unittest.TestCase): def setUp(self): # Mock out logging mock.patch('bin.retrieve_dns.set_up_logging', autospec=True).start() ...
<commit_before><commit_msg>Add basic test case for retrieve_dns module<commit_after>
import logging import os import tempfile import unittest import mock import bin.retrieve_dns logging.basicConfig(level=logging.INFO) class RetrieveDnsTestCase(unittest.TestCase): def setUp(self): # Mock out logging mock.patch('bin.retrieve_dns.set_up_logging', autospec=True).start() ...
Add basic test case for retrieve_dns moduleimport logging import os import tempfile import unittest import mock import bin.retrieve_dns logging.basicConfig(level=logging.INFO) class RetrieveDnsTestCase(unittest.TestCase): def setUp(self): # Mock out logging mock.patch('bin.retrieve_dns.set_up...
<commit_before><commit_msg>Add basic test case for retrieve_dns module<commit_after>import logging import os import tempfile import unittest import mock import bin.retrieve_dns logging.basicConfig(level=logging.INFO) class RetrieveDnsTestCase(unittest.TestCase): def setUp(self): # Mock out logging ...
9dab373023fa6b7767cd7555a533161752205eda
scripts/0-weighted-affine.py
scripts/0-weighted-affine.py
#!/usr/bin/python import sys sys.path.append('../lib') import transformations v0 = [[0, 1031, 1031, 0], [0, 0, 1600, 1600]] v1 = [[675, 826, 826, 677], [55, 52, 281, 277]] #weights = [1.0, 1.0, 1.0, 1.0] weights = [0.1, 0.01, 0.1, 0.2] print "original" print transformations.affine_matrix_from_points(v0, v1, shear=Fa...
Test a weighted affine solver.
Test a weighted affine solver. Former-commit-id: b8876ed995f7c2ec029697ccd815957bc4a6cc93
Python
mit
UASLab/ImageAnalysis
Test a weighted affine solver. Former-commit-id: b8876ed995f7c2ec029697ccd815957bc4a6cc93
#!/usr/bin/python import sys sys.path.append('../lib') import transformations v0 = [[0, 1031, 1031, 0], [0, 0, 1600, 1600]] v1 = [[675, 826, 826, 677], [55, 52, 281, 277]] #weights = [1.0, 1.0, 1.0, 1.0] weights = [0.1, 0.01, 0.1, 0.2] print "original" print transformations.affine_matrix_from_points(v0, v1, shear=Fa...
<commit_before><commit_msg>Test a weighted affine solver. Former-commit-id: b8876ed995f7c2ec029697ccd815957bc4a6cc93<commit_after>
#!/usr/bin/python import sys sys.path.append('../lib') import transformations v0 = [[0, 1031, 1031, 0], [0, 0, 1600, 1600]] v1 = [[675, 826, 826, 677], [55, 52, 281, 277]] #weights = [1.0, 1.0, 1.0, 1.0] weights = [0.1, 0.01, 0.1, 0.2] print "original" print transformations.affine_matrix_from_points(v0, v1, shear=Fa...
Test a weighted affine solver. Former-commit-id: b8876ed995f7c2ec029697ccd815957bc4a6cc93#!/usr/bin/python import sys sys.path.append('../lib') import transformations v0 = [[0, 1031, 1031, 0], [0, 0, 1600, 1600]] v1 = [[675, 826, 826, 677], [55, 52, 281, 277]] #weights = [1.0, 1.0, 1.0, 1.0] weights = [0.1, 0.01, ...
<commit_before><commit_msg>Test a weighted affine solver. Former-commit-id: b8876ed995f7c2ec029697ccd815957bc4a6cc93<commit_after>#!/usr/bin/python import sys sys.path.append('../lib') import transformations v0 = [[0, 1031, 1031, 0], [0, 0, 1600, 1600]] v1 = [[675, 826, 826, 677], [55, 52, 281, 277]] #weights = [1...
260e0ef2bc37750dccea47d30110221c272e757a
run_all_corpora.py
run_all_corpora.py
import os import argparse import subprocess parser = argparse.ArgumentParser() parser.add_argument("corpusdir", help = "Path to the directory containing corpus directories") parser.add_argument("script", help = "name of the script to be run") args = parser.parse_args() ## lists of corpora to skip ## and failed to run...
Add script for automating analysis for all corpora
Add script for automating analysis for all corpora
Python
mit
MontrealCorpusTools/SPADE,MontrealCorpusTools/SPADE
Add script for automating analysis for all corpora
import os import argparse import subprocess parser = argparse.ArgumentParser() parser.add_argument("corpusdir", help = "Path to the directory containing corpus directories") parser.add_argument("script", help = "name of the script to be run") args = parser.parse_args() ## lists of corpora to skip ## and failed to run...
<commit_before><commit_msg>Add script for automating analysis for all corpora<commit_after>
import os import argparse import subprocess parser = argparse.ArgumentParser() parser.add_argument("corpusdir", help = "Path to the directory containing corpus directories") parser.add_argument("script", help = "name of the script to be run") args = parser.parse_args() ## lists of corpora to skip ## and failed to run...
Add script for automating analysis for all corporaimport os import argparse import subprocess parser = argparse.ArgumentParser() parser.add_argument("corpusdir", help = "Path to the directory containing corpus directories") parser.add_argument("script", help = "name of the script to be run") args = parser.parse_args()...
<commit_before><commit_msg>Add script for automating analysis for all corpora<commit_after>import os import argparse import subprocess parser = argparse.ArgumentParser() parser.add_argument("corpusdir", help = "Path to the directory containing corpus directories") parser.add_argument("script", help = "name of the scri...
d17c14df00c31af49080ff2f9fea8597a8861461
starthinker_ui/recipe/management/commands/recipe_usage.py
starthinker_ui/recipe/management/commands/recipe_usage.py
########################################################################### # # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/l...
Add recipe usage command for quick diagnostics.
Add recipe usage command for quick diagnostics. PiperOrigin-RevId: 432485870
Python
apache-2.0
google/starthinker,google/starthinker,google/starthinker
Add recipe usage command for quick diagnostics. PiperOrigin-RevId: 432485870
########################################################################### # # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/l...
<commit_before><commit_msg>Add recipe usage command for quick diagnostics. PiperOrigin-RevId: 432485870<commit_after>
########################################################################### # # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/l...
Add recipe usage command for quick diagnostics. PiperOrigin-RevId: 432485870########################################################################### # # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License....
<commit_before><commit_msg>Add recipe usage command for quick diagnostics. PiperOrigin-RevId: 432485870<commit_after>########################################################################### # # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this fi...
e53a951ed98f460b603f43f6364d5d0a0f17a1ba
src/streamer.py
src/streamer.py
class pStream: ###PRIVATE FUNCTIONS def _builder(self, expression): self.STR = expression return self ###OVERRIDES def next(self): return next(self.STR) def __init__(self, iterable_thing): self.STR = iterable_thing def __iter__(self): return iter(self.STR) #...
Add basic class structure, map functionality, and a set of consumer functions.
Add basic class structure, map functionality, and a set of consumer functions.
Python
mit
caffeine-potent/Streamer-Datastructure
Add basic class structure, map functionality, and a set of consumer functions.
class pStream: ###PRIVATE FUNCTIONS def _builder(self, expression): self.STR = expression return self ###OVERRIDES def next(self): return next(self.STR) def __init__(self, iterable_thing): self.STR = iterable_thing def __iter__(self): return iter(self.STR) #...
<commit_before><commit_msg>Add basic class structure, map functionality, and a set of consumer functions.<commit_after>
class pStream: ###PRIVATE FUNCTIONS def _builder(self, expression): self.STR = expression return self ###OVERRIDES def next(self): return next(self.STR) def __init__(self, iterable_thing): self.STR = iterable_thing def __iter__(self): return iter(self.STR) #...
Add basic class structure, map functionality, and a set of consumer functions.class pStream: ###PRIVATE FUNCTIONS def _builder(self, expression): self.STR = expression return self ###OVERRIDES def next(self): return next(self.STR) def __init__(self, iterable_thing): self....
<commit_before><commit_msg>Add basic class structure, map functionality, and a set of consumer functions.<commit_after>class pStream: ###PRIVATE FUNCTIONS def _builder(self, expression): self.STR = expression return self ###OVERRIDES def next(self): return next(self.STR) def __in...
0b6709670179c0721b4f113d13bf34d9ac7715dd
test/indices.py
test/indices.py
import matplotlib.pyplot as plt import numpy from math import factorial def binom(a,b): return factorial(a) / (factorial(b)*factorial(a-b)) def stirling(n,k): if n<=0 or n!=0 and n==k: return 1 elif k<=0 or n<k: return 0 elif n==0 and k==0: return -1 else: s = sum(...
Add a python plotter that compares the results of with Stirling numbers
Add a python plotter that compares the results of with Stirling numbers
Python
lgpl-2.1
Anaphory/parameterclone,Anaphory/parameterclone
Add a python plotter that compares the results of with Stirling numbers
import matplotlib.pyplot as plt import numpy from math import factorial def binom(a,b): return factorial(a) / (factorial(b)*factorial(a-b)) def stirling(n,k): if n<=0 or n!=0 and n==k: return 1 elif k<=0 or n<k: return 0 elif n==0 and k==0: return -1 else: s = sum(...
<commit_before><commit_msg>Add a python plotter that compares the results of with Stirling numbers<commit_after>
import matplotlib.pyplot as plt import numpy from math import factorial def binom(a,b): return factorial(a) / (factorial(b)*factorial(a-b)) def stirling(n,k): if n<=0 or n!=0 and n==k: return 1 elif k<=0 or n<k: return 0 elif n==0 and k==0: return -1 else: s = sum(...
Add a python plotter that compares the results of with Stirling numbersimport matplotlib.pyplot as plt import numpy from math import factorial def binom(a,b): return factorial(a) / (factorial(b)*factorial(a-b)) def stirling(n,k): if n<=0 or n!=0 and n==k: return 1 elif k<=0 or n<k: retur...
<commit_before><commit_msg>Add a python plotter that compares the results of with Stirling numbers<commit_after>import matplotlib.pyplot as plt import numpy from math import factorial def binom(a,b): return factorial(a) / (factorial(b)*factorial(a-b)) def stirling(n,k): if n<=0 or n!=0 and n==k: ret...
7b179e4a420a3cd7a27f0f438a6eac462048bb93
py/brick-wall.py
py/brick-wall.py
import heapq class Solution(object): def leastBricks(self, wall): """ :type wall: List[List[int]] :rtype: int """ n_row = len(wall) heap = [(wall[i][0], i, 0) for i in xrange(n_row)] heapq.heapify(heap) max_noncross = 0 while True: ...
Add py solution for 554. Brick Wall
Add py solution for 554. Brick Wall 554. Brick Wall: https://leetcode.com/problems/brick-wall/ Approach1: O(n_brick * log(n_row)) Use heap to find the least length of accumulated row and find how many rows can match such length
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 554. Brick Wall 554. Brick Wall: https://leetcode.com/problems/brick-wall/ Approach1: O(n_brick * log(n_row)) Use heap to find the least length of accumulated row and find how many rows can match such length
import heapq class Solution(object): def leastBricks(self, wall): """ :type wall: List[List[int]] :rtype: int """ n_row = len(wall) heap = [(wall[i][0], i, 0) for i in xrange(n_row)] heapq.heapify(heap) max_noncross = 0 while True: ...
<commit_before><commit_msg>Add py solution for 554. Brick Wall 554. Brick Wall: https://leetcode.com/problems/brick-wall/ Approach1: O(n_brick * log(n_row)) Use heap to find the least length of accumulated row and find how many rows can match such length<commit_after>
import heapq class Solution(object): def leastBricks(self, wall): """ :type wall: List[List[int]] :rtype: int """ n_row = len(wall) heap = [(wall[i][0], i, 0) for i in xrange(n_row)] heapq.heapify(heap) max_noncross = 0 while True: ...
Add py solution for 554. Brick Wall 554. Brick Wall: https://leetcode.com/problems/brick-wall/ Approach1: O(n_brick * log(n_row)) Use heap to find the least length of accumulated row and find how many rows can match such lengthimport heapq class Solution(object): def leastBricks(self, wall): """ ...
<commit_before><commit_msg>Add py solution for 554. Brick Wall 554. Brick Wall: https://leetcode.com/problems/brick-wall/ Approach1: O(n_brick * log(n_row)) Use heap to find the least length of accumulated row and find how many rows can match such length<commit_after>import heapq class Solution(object): d...