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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bb25e2d989f208b803830349748900f687473b12 | scripts/lie_docking.py | scripts/lie_docking.py | import sys
from autobahn.twisted.wamp import ApplicationRunner
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet import reactor
from lie_system import LieApplicationSession
class LIEWorkflow(LieApplicationSession):
_isauthenticated = False
... | Add scripts directory with lie_workflow script | Add scripts directory with lie_workflow script
| Python | apache-2.0 | MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio | Add scripts directory with lie_workflow script | import sys
from autobahn.twisted.wamp import ApplicationRunner
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet import reactor
from lie_system import LieApplicationSession
class LIEWorkflow(LieApplicationSession):
_isauthenticated = False
... | <commit_before><commit_msg>Add scripts directory with lie_workflow script<commit_after> | import sys
from autobahn.twisted.wamp import ApplicationRunner
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet import reactor
from lie_system import LieApplicationSession
class LIEWorkflow(LieApplicationSession):
_isauthenticated = False
... | Add scripts directory with lie_workflow scriptimport sys
from autobahn.twisted.wamp import ApplicationRunner
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet import reactor
from lie_system import LieApplicationSession
class LIEWorkflow(LieApplicationSes... | <commit_before><commit_msg>Add scripts directory with lie_workflow script<commit_after>import sys
from autobahn.twisted.wamp import ApplicationRunner
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet import reactor
from lie_system import LieApplicationSes... | |
171c46d0698a53d38f332aa681c2e5ea3a09fd00 | db/migrations/backfill_github_repo_id.py | db/migrations/backfill_github_repo_id.py | """Backfills tables to populate GitHub's repo ID."""
import rethinkdb as r
import db.plugins
import db.util
r_conn = db.util.r_conn
def backfill_github_plugin_repos():
"""Adds the 'repo_id' field from the repo_data field if available."""
r.table('plugin_github_repos').update({
'repo_id': r.row['rep... | Add migration script to add the 'github_repo_id' field | Add migration script to add the 'github_repo_id' field
| Python | mit | jonafato/vim-awesome,shaialon/vim-awesome,divad12/vim-awesome,divad12/vim-awesome,divad12/vim-awesome,vim-awesome/vim-awesome,vim-awesome/vim-awesome,jonafato/vim-awesome,vim-awesome/vim-awesome,divad12/vim-awesome,vim-awesome/vim-awesome,vim-awesome/vim-awesome,shaialon/vim-awesome,starcraftman/vim-awesome,jonafato/vi... | Add migration script to add the 'github_repo_id' field | """Backfills tables to populate GitHub's repo ID."""
import rethinkdb as r
import db.plugins
import db.util
r_conn = db.util.r_conn
def backfill_github_plugin_repos():
"""Adds the 'repo_id' field from the repo_data field if available."""
r.table('plugin_github_repos').update({
'repo_id': r.row['rep... | <commit_before><commit_msg>Add migration script to add the 'github_repo_id' field<commit_after> | """Backfills tables to populate GitHub's repo ID."""
import rethinkdb as r
import db.plugins
import db.util
r_conn = db.util.r_conn
def backfill_github_plugin_repos():
"""Adds the 'repo_id' field from the repo_data field if available."""
r.table('plugin_github_repos').update({
'repo_id': r.row['rep... | Add migration script to add the 'github_repo_id' field"""Backfills tables to populate GitHub's repo ID."""
import rethinkdb as r
import db.plugins
import db.util
r_conn = db.util.r_conn
def backfill_github_plugin_repos():
"""Adds the 'repo_id' field from the repo_data field if available."""
r.table('plugin... | <commit_before><commit_msg>Add migration script to add the 'github_repo_id' field<commit_after>"""Backfills tables to populate GitHub's repo ID."""
import rethinkdb as r
import db.plugins
import db.util
r_conn = db.util.r_conn
def backfill_github_plugin_repos():
"""Adds the 'repo_id' field from the repo_data f... | |
5a48dc3c389ad42b761b40d6e3ba838a8c3adad0 | opal/migrations/0029_auto_20170707_1337.py | opal/migrations/0029_auto_20170707_1337.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('opal', '0028_auto_20170210_1146'),
]
operations = [
migrations.AlterField(
model_name='macro',
name=... | Fix typo in Macro help text | Fix typo in Macro help text
| Python | agpl-3.0 | khchine5/opal,khchine5/opal,khchine5/opal | Fix typo in Macro help text | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('opal', '0028_auto_20170210_1146'),
]
operations = [
migrations.AlterField(
model_name='macro',
name=... | <commit_before><commit_msg>Fix typo in Macro help text<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('opal', '0028_auto_20170210_1146'),
]
operations = [
migrations.AlterField(
model_name='macro',
name=... | Fix typo in Macro help text# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('opal', '0028_auto_20170210_1146'),
]
operations = [
migrations.AlterField(
model_name... | <commit_before><commit_msg>Fix typo in Macro help text<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('opal', '0028_auto_20170210_1146'),
]
operations = [
migr... | |
1773e9084964b3c44e0ab46ea64da0ac3d1ba671 | final/problem6.py | final/problem6.py | # Problem 6-1
# 10.0 points possible (graded)
class Person(object):
def __init__(self, name):
self.name = name
def say(self, stuff):
return self.name + ' says: ' + stuff
def __str__(self):
return self.name
class Lecturer(Person):
def lecture(self, stuff):
return 'I bel... | Implement lecture & say methods in the ArrogantProfessor class using inheritance | Implement lecture & say methods in the ArrogantProfessor class using inheritance
| Python | mit | Kunal57/MIT_6.00.1x | Implement lecture & say methods in the ArrogantProfessor class using inheritance | # Problem 6-1
# 10.0 points possible (graded)
class Person(object):
def __init__(self, name):
self.name = name
def say(self, stuff):
return self.name + ' says: ' + stuff
def __str__(self):
return self.name
class Lecturer(Person):
def lecture(self, stuff):
return 'I bel... | <commit_before><commit_msg>Implement lecture & say methods in the ArrogantProfessor class using inheritance<commit_after> | # Problem 6-1
# 10.0 points possible (graded)
class Person(object):
def __init__(self, name):
self.name = name
def say(self, stuff):
return self.name + ' says: ' + stuff
def __str__(self):
return self.name
class Lecturer(Person):
def lecture(self, stuff):
return 'I bel... | Implement lecture & say methods in the ArrogantProfessor class using inheritance# Problem 6-1
# 10.0 points possible (graded)
class Person(object):
def __init__(self, name):
self.name = name
def say(self, stuff):
return self.name + ' says: ' + stuff
def __str__(self):
return self.n... | <commit_before><commit_msg>Implement lecture & say methods in the ArrogantProfessor class using inheritance<commit_after># Problem 6-1
# 10.0 points possible (graded)
class Person(object):
def __init__(self, name):
self.name = name
def say(self, stuff):
return self.name + ' says: ' + stuff
... | |
c297f803a30989d3f3593d98b5af861a839d4e0a | fuse_module/registry-fs.py | fuse_module/registry-fs.py | #!/usr/bin/env python
from __future__ import with_statement
import logging
import os
import sys
import stat
import yaml
from fuse import FUSE, FuseOSError, Operations, LoggingMixIn
from docker_registry.drivers.elliptics import Storage
logging.basicConfig()
log = logging.getLogger("")
log.setLevel(logging.DEBUG)
D... | Introduce fuse module to mount Registry Ellipticsbased FS | Introduce fuse module to mount Registry Ellipticsbased FS
| Python | apache-2.0 | noxiouz/docker-registry-driver-elliptics,noxiouz/docker-registry-driver-elliptics | Introduce fuse module to mount Registry Ellipticsbased FS | #!/usr/bin/env python
from __future__ import with_statement
import logging
import os
import sys
import stat
import yaml
from fuse import FUSE, FuseOSError, Operations, LoggingMixIn
from docker_registry.drivers.elliptics import Storage
logging.basicConfig()
log = logging.getLogger("")
log.setLevel(logging.DEBUG)
D... | <commit_before><commit_msg>Introduce fuse module to mount Registry Ellipticsbased FS<commit_after> | #!/usr/bin/env python
from __future__ import with_statement
import logging
import os
import sys
import stat
import yaml
from fuse import FUSE, FuseOSError, Operations, LoggingMixIn
from docker_registry.drivers.elliptics import Storage
logging.basicConfig()
log = logging.getLogger("")
log.setLevel(logging.DEBUG)
D... | Introduce fuse module to mount Registry Ellipticsbased FS#!/usr/bin/env python
from __future__ import with_statement
import logging
import os
import sys
import stat
import yaml
from fuse import FUSE, FuseOSError, Operations, LoggingMixIn
from docker_registry.drivers.elliptics import Storage
logging.basicConfig()
l... | <commit_before><commit_msg>Introduce fuse module to mount Registry Ellipticsbased FS<commit_after>#!/usr/bin/env python
from __future__ import with_statement
import logging
import os
import sys
import stat
import yaml
from fuse import FUSE, FuseOSError, Operations, LoggingMixIn
from docker_registry.drivers.elliptics... | |
57fc7ec4630174315b0a453073009783757ba3f6 | tests/test_themes.py | tests/test_themes.py | import os
import textwrap
import shutil
import pytest
@pytest.fixture(scope='function')
def theme_project_tmpdir(tmpdir):
# Copy themes-project to a temp dir, and copy demo-project content to it
themes_dir = os.path.join(os.path.dirname(__file__), 'themes-project')
content_dir = os.path.join(os.path.dirn... | Add basic test and fixtures for themes. | Add basic test and fixtures for themes.
| Python | bsd-3-clause | lektor/lektor,lektor/lektor,lektor/lektor,lektor/lektor | Add basic test and fixtures for themes. | import os
import textwrap
import shutil
import pytest
@pytest.fixture(scope='function')
def theme_project_tmpdir(tmpdir):
# Copy themes-project to a temp dir, and copy demo-project content to it
themes_dir = os.path.join(os.path.dirname(__file__), 'themes-project')
content_dir = os.path.join(os.path.dirn... | <commit_before><commit_msg>Add basic test and fixtures for themes.<commit_after> | import os
import textwrap
import shutil
import pytest
@pytest.fixture(scope='function')
def theme_project_tmpdir(tmpdir):
# Copy themes-project to a temp dir, and copy demo-project content to it
themes_dir = os.path.join(os.path.dirname(__file__), 'themes-project')
content_dir = os.path.join(os.path.dirn... | Add basic test and fixtures for themes.import os
import textwrap
import shutil
import pytest
@pytest.fixture(scope='function')
def theme_project_tmpdir(tmpdir):
# Copy themes-project to a temp dir, and copy demo-project content to it
themes_dir = os.path.join(os.path.dirname(__file__), 'themes-project')
... | <commit_before><commit_msg>Add basic test and fixtures for themes.<commit_after>import os
import textwrap
import shutil
import pytest
@pytest.fixture(scope='function')
def theme_project_tmpdir(tmpdir):
# Copy themes-project to a temp dir, and copy demo-project content to it
themes_dir = os.path.join(os.path.... | |
6aea126e743b8a2b6808f4d9cc329b4955e796ae | tests/test_config.py | tests/test_config.py | import os
import unittest
from config import get_config
class ConfigTest(unittest.TestCase):
def setUp(self):
os.environ['DESTALINATOR_STRING_VARIABLE'] = 'test'
os.environ['DESTALINATOR_LIST_VARIABLE'] = 'test,'
def test_environment_variable_configs(self):
self.assertEqual(get_confi... | Add config environment variables test | Add config environment variables test
| Python | apache-2.0 | royrapoport/destalinator,randsleadershipslack/destalinator,TheConnMan/destalinator,TheConnMan/destalinator,royrapoport/destalinator,randsleadershipslack/destalinator | Add config environment variables test | import os
import unittest
from config import get_config
class ConfigTest(unittest.TestCase):
def setUp(self):
os.environ['DESTALINATOR_STRING_VARIABLE'] = 'test'
os.environ['DESTALINATOR_LIST_VARIABLE'] = 'test,'
def test_environment_variable_configs(self):
self.assertEqual(get_confi... | <commit_before><commit_msg>Add config environment variables test<commit_after> | import os
import unittest
from config import get_config
class ConfigTest(unittest.TestCase):
def setUp(self):
os.environ['DESTALINATOR_STRING_VARIABLE'] = 'test'
os.environ['DESTALINATOR_LIST_VARIABLE'] = 'test,'
def test_environment_variable_configs(self):
self.assertEqual(get_confi... | Add config environment variables testimport os
import unittest
from config import get_config
class ConfigTest(unittest.TestCase):
def setUp(self):
os.environ['DESTALINATOR_STRING_VARIABLE'] = 'test'
os.environ['DESTALINATOR_LIST_VARIABLE'] = 'test,'
def test_environment_variable_configs(self... | <commit_before><commit_msg>Add config environment variables test<commit_after>import os
import unittest
from config import get_config
class ConfigTest(unittest.TestCase):
def setUp(self):
os.environ['DESTALINATOR_STRING_VARIABLE'] = 'test'
os.environ['DESTALINATOR_LIST_VARIABLE'] = 'test,'
d... | |
05ebb3eb9e28e738145cd81fc256c7b83ba32e7b | scripts/make_patch_fit_queue.py | scripts/make_patch_fit_queue.py | #!/usr/bin/env python
# encoding: utf-8
"""
Make a CANFAR queue for patch fitting.
>>> from canque import Submission
>>> sub = Submission(user_name, script_path)
>>> sub.add_job('my args', "job.log")
>>> sub.write("jobs.sub")
2015-06-10 - Created by Jonathan Sick
"""
import argparse
import json
from canque import ... | Create script to make PHAT patch fitting queue | Create script to make PHAT patch fitting queue
| Python | mit | jonathansick/androcmd,jonathansick/androcmd | Create script to make PHAT patch fitting queue | #!/usr/bin/env python
# encoding: utf-8
"""
Make a CANFAR queue for patch fitting.
>>> from canque import Submission
>>> sub = Submission(user_name, script_path)
>>> sub.add_job('my args', "job.log")
>>> sub.write("jobs.sub")
2015-06-10 - Created by Jonathan Sick
"""
import argparse
import json
from canque import ... | <commit_before><commit_msg>Create script to make PHAT patch fitting queue<commit_after> | #!/usr/bin/env python
# encoding: utf-8
"""
Make a CANFAR queue for patch fitting.
>>> from canque import Submission
>>> sub = Submission(user_name, script_path)
>>> sub.add_job('my args', "job.log")
>>> sub.write("jobs.sub")
2015-06-10 - Created by Jonathan Sick
"""
import argparse
import json
from canque import ... | Create script to make PHAT patch fitting queue#!/usr/bin/env python
# encoding: utf-8
"""
Make a CANFAR queue for patch fitting.
>>> from canque import Submission
>>> sub = Submission(user_name, script_path)
>>> sub.add_job('my args', "job.log")
>>> sub.write("jobs.sub")
2015-06-10 - Created by Jonathan Sick
"""
im... | <commit_before><commit_msg>Create script to make PHAT patch fitting queue<commit_after>#!/usr/bin/env python
# encoding: utf-8
"""
Make a CANFAR queue for patch fitting.
>>> from canque import Submission
>>> sub = Submission(user_name, script_path)
>>> sub.add_job('my args', "job.log")
>>> sub.write("jobs.sub")
2015-... | |
22e80f1fccb120f90774195d1592750f6d39a8a2 | testbot.py | testbot.py | from bot import Tofbot
class TestTofbot(Tofbot):
def __init__(self, nick, name, chan, origin):
chans = [chan]
Tofbot.__init__(self, nick, name, chans, debug=False)
self.chan = chan
self.origin = origin
def msg(self, chan, msg):
print (" -> %s" % msg)
def send(self... | Add mock object for easier testing | Add mock object for easier testing
| Python | bsd-2-clause | p0nce/tofbot,p0nce/tofbot,chmduquesne/tofbot,martinkirch/tofbot,soulaklabs/tofbot,soulaklabs/tofbot,tofbot/tofbot,martinkirch/tofbot,tofbot/tofbot | Add mock object for easier testing | from bot import Tofbot
class TestTofbot(Tofbot):
def __init__(self, nick, name, chan, origin):
chans = [chan]
Tofbot.__init__(self, nick, name, chans, debug=False)
self.chan = chan
self.origin = origin
def msg(self, chan, msg):
print (" -> %s" % msg)
def send(self... | <commit_before><commit_msg>Add mock object for easier testing<commit_after> | from bot import Tofbot
class TestTofbot(Tofbot):
def __init__(self, nick, name, chan, origin):
chans = [chan]
Tofbot.__init__(self, nick, name, chans, debug=False)
self.chan = chan
self.origin = origin
def msg(self, chan, msg):
print (" -> %s" % msg)
def send(self... | Add mock object for easier testingfrom bot import Tofbot
class TestTofbot(Tofbot):
def __init__(self, nick, name, chan, origin):
chans = [chan]
Tofbot.__init__(self, nick, name, chans, debug=False)
self.chan = chan
self.origin = origin
def msg(self, chan, msg):
print (... | <commit_before><commit_msg>Add mock object for easier testing<commit_after>from bot import Tofbot
class TestTofbot(Tofbot):
def __init__(self, nick, name, chan, origin):
chans = [chan]
Tofbot.__init__(self, nick, name, chans, debug=False)
self.chan = chan
self.origin = origin
... | |
47956133433425c3e0c1f33ff6596c9ead3f6558 | dosagelib/plugins/projectfuture.py | dosagelib/plugins/projectfuture.py | # -*- coding: utf-8 -*-
# Copyright (C) 2019-2020 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
from .common import _ParserScraper
class ProjectFuture(_ParserScraper):
imageSearch = '//td[@class="tamid"]/img'
prevSearch = '//a[./img[@alt="Previous"]]'
def __init__... | Add site engine for ProjectFuture | Add site engine for ProjectFuture
| Python | mit | webcomics/dosage,webcomics/dosage,peterjanes/dosage,peterjanes/dosage | Add site engine for ProjectFuture | # -*- coding: utf-8 -*-
# Copyright (C) 2019-2020 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
from .common import _ParserScraper
class ProjectFuture(_ParserScraper):
imageSearch = '//td[@class="tamid"]/img'
prevSearch = '//a[./img[@alt="Previous"]]'
def __init__... | <commit_before><commit_msg>Add site engine for ProjectFuture<commit_after> | # -*- coding: utf-8 -*-
# Copyright (C) 2019-2020 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
from .common import _ParserScraper
class ProjectFuture(_ParserScraper):
imageSearch = '//td[@class="tamid"]/img'
prevSearch = '//a[./img[@alt="Previous"]]'
def __init__... | Add site engine for ProjectFuture# -*- coding: utf-8 -*-
# Copyright (C) 2019-2020 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
from .common import _ParserScraper
class ProjectFuture(_ParserScraper):
imageSearch = '//td[@class="tamid"]/img'
prevSearch = '//a[./img[@al... | <commit_before><commit_msg>Add site engine for ProjectFuture<commit_after># -*- coding: utf-8 -*-
# Copyright (C) 2019-2020 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
from .common import _ParserScraper
class ProjectFuture(_ParserScraper):
imageSearch = '//td[@class="tam... | |
46733c983a90d6dbfd32aed8f41ff4ed377b86d2 | src/windowsAnkiRestart.py | src/windowsAnkiRestart.py | import os, time, sys, time
from shutil import copy
watched_file = sys.argv[1]
addon_path = sys.argv[2]
os.startfile(r'C:\Program Files (x86)\Anki\anki.exe')
new_t = old_t = 0
while 1:
old_t = new_t
new_t = os.stat(watched_file)[8]
if old_t != new_t:
copy(watched_file, addon_path)
os.system("TASKKILL /F /IM an... | Add script to automate plugin testing on Windows | Add script to automate plugin testing on Windows
* Opens Anki for you
* Polls every second for a change to the watched file (uses time last modified)
* Restarts Anki automatically
| Python | apache-2.0 | CSE-437/AnkiPlugin,CSE-437/AnkiPlugin | Add script to automate plugin testing on Windows
* Opens Anki for you
* Polls every second for a change to the watched file (uses time last modified)
* Restarts Anki automatically | import os, time, sys, time
from shutil import copy
watched_file = sys.argv[1]
addon_path = sys.argv[2]
os.startfile(r'C:\Program Files (x86)\Anki\anki.exe')
new_t = old_t = 0
while 1:
old_t = new_t
new_t = os.stat(watched_file)[8]
if old_t != new_t:
copy(watched_file, addon_path)
os.system("TASKKILL /F /IM an... | <commit_before><commit_msg>Add script to automate plugin testing on Windows
* Opens Anki for you
* Polls every second for a change to the watched file (uses time last modified)
* Restarts Anki automatically<commit_after> | import os, time, sys, time
from shutil import copy
watched_file = sys.argv[1]
addon_path = sys.argv[2]
os.startfile(r'C:\Program Files (x86)\Anki\anki.exe')
new_t = old_t = 0
while 1:
old_t = new_t
new_t = os.stat(watched_file)[8]
if old_t != new_t:
copy(watched_file, addon_path)
os.system("TASKKILL /F /IM an... | Add script to automate plugin testing on Windows
* Opens Anki for you
* Polls every second for a change to the watched file (uses time last modified)
* Restarts Anki automaticallyimport os, time, sys, time
from shutil import copy
watched_file = sys.argv[1]
addon_path = sys.argv[2]
os.startfile(r'C:\Program Files (x8... | <commit_before><commit_msg>Add script to automate plugin testing on Windows
* Opens Anki for you
* Polls every second for a change to the watched file (uses time last modified)
* Restarts Anki automatically<commit_after>import os, time, sys, time
from shutil import copy
watched_file = sys.argv[1]
addon_path = sys.arg... | |
e57c94dc1692447581e25f1385514785c4d03018 | axe_selenium_python/tests/test_axe.py | axe_selenium_python/tests/test_axe.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from os import path
import pytest
@pytest.mark.nondestructive
def test_execute(axe):
"""Run axe against base_url a... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from os import path
import pytest
@pytest.mark.nondestructive
def test_execute(axe):
"""Run axe against base_url ... | Add blank line to fix flake8-isort | Add blank line to fix flake8-isort | Python | mpl-2.0 | kimberlythegeek/axe-selenium-python,kimberlythegeek/axe-selenium-python | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from os import path
import pytest
@pytest.mark.nondestructive
def test_execute(axe):
"""Run axe against base_url a... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from os import path
import pytest
@pytest.mark.nondestructive
def test_execute(axe):
"""Run axe against base_url ... | <commit_before># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from os import path
import pytest
@pytest.mark.nondestructive
def test_execute(axe):
"""Run axe aga... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from os import path
import pytest
@pytest.mark.nondestructive
def test_execute(axe):
"""Run axe against base_url ... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from os import path
import pytest
@pytest.mark.nondestructive
def test_execute(axe):
"""Run axe against base_url a... | <commit_before># This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from os import path
import pytest
@pytest.mark.nondestructive
def test_execute(axe):
"""Run axe aga... |
bd3c47780ac0c1629e8657bb03188bf6af27ebb1 | scripts/robot_control/actuator_feedback.py | scripts/robot_control/actuator_feedback.py | """Helps eye-ball rpc-based motor control"""
import time
from ev3control.rpc import Robot
# for convenience set the time to one second
duration = 1000
speed = 50
with Robot(None) as robot:
for _ in range(1):
t0 = time.time()
print('starting position ', robot.left_track.position)
print(ti... | Add small script to test motor feedback | Add small script to test motor feedback
| Python | mit | TheCamusean/DLRCev3,TheCamusean/DLRCev3 | Add small script to test motor feedback | """Helps eye-ball rpc-based motor control"""
import time
from ev3control.rpc import Robot
# for convenience set the time to one second
duration = 1000
speed = 50
with Robot(None) as robot:
for _ in range(1):
t0 = time.time()
print('starting position ', robot.left_track.position)
print(ti... | <commit_before><commit_msg>Add small script to test motor feedback<commit_after> | """Helps eye-ball rpc-based motor control"""
import time
from ev3control.rpc import Robot
# for convenience set the time to one second
duration = 1000
speed = 50
with Robot(None) as robot:
for _ in range(1):
t0 = time.time()
print('starting position ', robot.left_track.position)
print(ti... | Add small script to test motor feedback"""Helps eye-ball rpc-based motor control"""
import time
from ev3control.rpc import Robot
# for convenience set the time to one second
duration = 1000
speed = 50
with Robot(None) as robot:
for _ in range(1):
t0 = time.time()
print('starting position ', robo... | <commit_before><commit_msg>Add small script to test motor feedback<commit_after>"""Helps eye-ball rpc-based motor control"""
import time
from ev3control.rpc import Robot
# for convenience set the time to one second
duration = 1000
speed = 50
with Robot(None) as robot:
for _ in range(1):
t0 = time.time()... | |
720a011b59ea1fbe38e2ae940133cb4485d12d8d | api/migrations/0009_merge_20161031_1057.py | api/migrations/0009_merge_20161031_1057.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-31 12:57
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0007_media_tags'),
('api', '0008_media_description'),
]
operations = [
]... | Build Fix - Merged db migrations | Build Fix - Merged db migrations
| Python | bsd-3-clause | falcaopetri/enqueuer-api | Build Fix - Merged db migrations | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-31 12:57
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0007_media_tags'),
('api', '0008_media_description'),
]
operations = [
]... | <commit_before><commit_msg>Build Fix - Merged db migrations<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-31 12:57
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0007_media_tags'),
('api', '0008_media_description'),
]
operations = [
]... | Build Fix - Merged db migrations# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-31 12:57
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0007_media_tags'),
('api', '0008_media_description'),... | <commit_before><commit_msg>Build Fix - Merged db migrations<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-31 12:57
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0007_media_tags'),
... | |
c63a5e46e6e3a5e0106c20a3217b53e17147aaf8 | test/test_core_dataset.py | test/test_core_dataset.py | import os
import shutil
import tempfile
import unittest
from lobster.cmssw import dataset
from lobster import fs, se
class TestDataset(unittest.TestCase):
@classmethod
def setUpClass(cls):
path = os.path.expandvars(
os.environ.get('LOBSTER_STORAGE', '/hadoop/store/user/') +
... | Add test for file-based datasets. | Add test for file-based datasets.
| Python | mit | matz-e/lobster,matz-e/lobster,matz-e/lobster | Add test for file-based datasets. | import os
import shutil
import tempfile
import unittest
from lobster.cmssw import dataset
from lobster import fs, se
class TestDataset(unittest.TestCase):
@classmethod
def setUpClass(cls):
path = os.path.expandvars(
os.environ.get('LOBSTER_STORAGE', '/hadoop/store/user/') +
... | <commit_before><commit_msg>Add test for file-based datasets.<commit_after> | import os
import shutil
import tempfile
import unittest
from lobster.cmssw import dataset
from lobster import fs, se
class TestDataset(unittest.TestCase):
@classmethod
def setUpClass(cls):
path = os.path.expandvars(
os.environ.get('LOBSTER_STORAGE', '/hadoop/store/user/') +
... | Add test for file-based datasets.import os
import shutil
import tempfile
import unittest
from lobster.cmssw import dataset
from lobster import fs, se
class TestDataset(unittest.TestCase):
@classmethod
def setUpClass(cls):
path = os.path.expandvars(
os.environ.get('LOBSTER_STORAGE', '/h... | <commit_before><commit_msg>Add test for file-based datasets.<commit_after>import os
import shutil
import tempfile
import unittest
from lobster.cmssw import dataset
from lobster import fs, se
class TestDataset(unittest.TestCase):
@classmethod
def setUpClass(cls):
path = os.path.expandvars(
... | |
49d6984f2c57cf2169304de8fd3956e2f21aba19 | tests/test_comments.py | tests/test_comments.py | import collections
import logging
import pytest
from mappyfile.pprint import PrettyPrinter
def test_comment():
d = collections.Order/edDict()
d["name"] = "Test"
d["__type__"] = "layer"
d["__comments__"] = {"name": "Test comment"}
pp = PrettyPrinter(indent=0, quote="'", newlinechar="\n")
s = p... | Add a test suite for comments in the dict structure | Add a test suite for comments in the dict structure
| Python | mit | geographika/mappyfile,geographika/mappyfile | Add a test suite for comments in the dict structure | import collections
import logging
import pytest
from mappyfile.pprint import PrettyPrinter
def test_comment():
d = collections.Order/edDict()
d["name"] = "Test"
d["__type__"] = "layer"
d["__comments__"] = {"name": "Test comment"}
pp = PrettyPrinter(indent=0, quote="'", newlinechar="\n")
s = p... | <commit_before><commit_msg>Add a test suite for comments in the dict structure<commit_after> | import collections
import logging
import pytest
from mappyfile.pprint import PrettyPrinter
def test_comment():
d = collections.Order/edDict()
d["name"] = "Test"
d["__type__"] = "layer"
d["__comments__"] = {"name": "Test comment"}
pp = PrettyPrinter(indent=0, quote="'", newlinechar="\n")
s = p... | Add a test suite for comments in the dict structureimport collections
import logging
import pytest
from mappyfile.pprint import PrettyPrinter
def test_comment():
d = collections.Order/edDict()
d["name"] = "Test"
d["__type__"] = "layer"
d["__comments__"] = {"name": "Test comment"}
pp = PrettyPrint... | <commit_before><commit_msg>Add a test suite for comments in the dict structure<commit_after>import collections
import logging
import pytest
from mappyfile.pprint import PrettyPrinter
def test_comment():
d = collections.Order/edDict()
d["name"] = "Test"
d["__type__"] = "layer"
d["__comments__"] = {"nam... | |
d2b4965f43d5fd853584b0abee666573a184c260 | tilepack/tile_cover.py | tilepack/tile_cover.py | from tilepack.builder import cover_bbox
import argparse
import os
import requests
def main():
parser = argparse.ArgumentParser()
parser.add_argument('min_zoom',
type=int,
help='The minimum zoom level to include')
parser.add_argument('max_zoom',
type=int,
help='The maximum z... | Add a script to compute tile coverage for city bounding boxes | Add a script to compute tile coverage for city bounding boxes
| Python | mit | tilezen/tilepacks | Add a script to compute tile coverage for city bounding boxes | from tilepack.builder import cover_bbox
import argparse
import os
import requests
def main():
parser = argparse.ArgumentParser()
parser.add_argument('min_zoom',
type=int,
help='The minimum zoom level to include')
parser.add_argument('max_zoom',
type=int,
help='The maximum z... | <commit_before><commit_msg>Add a script to compute tile coverage for city bounding boxes<commit_after> | from tilepack.builder import cover_bbox
import argparse
import os
import requests
def main():
parser = argparse.ArgumentParser()
parser.add_argument('min_zoom',
type=int,
help='The minimum zoom level to include')
parser.add_argument('max_zoom',
type=int,
help='The maximum z... | Add a script to compute tile coverage for city bounding boxesfrom tilepack.builder import cover_bbox
import argparse
import os
import requests
def main():
parser = argparse.ArgumentParser()
parser.add_argument('min_zoom',
type=int,
help='The minimum zoom level to include')
parser.add_argum... | <commit_before><commit_msg>Add a script to compute tile coverage for city bounding boxes<commit_after>from tilepack.builder import cover_bbox
import argparse
import os
import requests
def main():
parser = argparse.ArgumentParser()
parser.add_argument('min_zoom',
type=int,
help='The minimum zoo... | |
641d4a0fc8c226b7a1e8e62c8c8e9fd3892a9ed7 | tests/method_call_test.py | tests/method_call_test.py | import unittest
from pykka import Actor
class MethodCallTest(unittest.TestCase):
def setUp(self):
class ActorWithMethods(Actor):
foo = 'bar'
def functional_hello(self, s):
return 'Hello, %s!' % s
def set_foo(self, s):
self.foo = s
... | Test method calls, with return value or side effect | Test method calls, with return value or side effect
| Python | apache-2.0 | tamland/pykka,jodal/pykka,tempbottle/pykka | Test method calls, with return value or side effect | import unittest
from pykka import Actor
class MethodCallTest(unittest.TestCase):
def setUp(self):
class ActorWithMethods(Actor):
foo = 'bar'
def functional_hello(self, s):
return 'Hello, %s!' % s
def set_foo(self, s):
self.foo = s
... | <commit_before><commit_msg>Test method calls, with return value or side effect<commit_after> | import unittest
from pykka import Actor
class MethodCallTest(unittest.TestCase):
def setUp(self):
class ActorWithMethods(Actor):
foo = 'bar'
def functional_hello(self, s):
return 'Hello, %s!' % s
def set_foo(self, s):
self.foo = s
... | Test method calls, with return value or side effectimport unittest
from pykka import Actor
class MethodCallTest(unittest.TestCase):
def setUp(self):
class ActorWithMethods(Actor):
foo = 'bar'
def functional_hello(self, s):
return 'Hello, %s!' % s
def set... | <commit_before><commit_msg>Test method calls, with return value or side effect<commit_after>import unittest
from pykka import Actor
class MethodCallTest(unittest.TestCase):
def setUp(self):
class ActorWithMethods(Actor):
foo = 'bar'
def functional_hello(self, s):
re... | |
d487881f0a4483ddc489a47843e8fa5afb0b97bc | test/test_command.py | test/test_command.py | import io
import subprocess
import unittest
import yaml
class Command(unittest.TestCase):
stdin = u''
expected = {}
def runTest(self):
stdout = io.StringIO
prc = subprocess.Popen(
['bin/yamlicious'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
env={
'PYTHONPATH': '.... | Add smoke test of the yamlicious command. | Add smoke test of the yamlicious command.
| Python | bsd-2-clause | derrley/yamlicious,derrley/yamlicious | Add smoke test of the yamlicious command. | import io
import subprocess
import unittest
import yaml
class Command(unittest.TestCase):
stdin = u''
expected = {}
def runTest(self):
stdout = io.StringIO
prc = subprocess.Popen(
['bin/yamlicious'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
env={
'PYTHONPATH': '.... | <commit_before><commit_msg>Add smoke test of the yamlicious command.<commit_after> | import io
import subprocess
import unittest
import yaml
class Command(unittest.TestCase):
stdin = u''
expected = {}
def runTest(self):
stdout = io.StringIO
prc = subprocess.Popen(
['bin/yamlicious'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
env={
'PYTHONPATH': '.... | Add smoke test of the yamlicious command.import io
import subprocess
import unittest
import yaml
class Command(unittest.TestCase):
stdin = u''
expected = {}
def runTest(self):
stdout = io.StringIO
prc = subprocess.Popen(
['bin/yamlicious'],
stdin=subprocess.PIPE,
stdout=subprocess.P... | <commit_before><commit_msg>Add smoke test of the yamlicious command.<commit_after>import io
import subprocess
import unittest
import yaml
class Command(unittest.TestCase):
stdin = u''
expected = {}
def runTest(self):
stdout = io.StringIO
prc = subprocess.Popen(
['bin/yamlicious'],
stdin=s... | |
a88ec15ba8c738c9f672373a3ca59b92ac2594ba | db/shot_attempt.py | db/shot_attempt.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
from db.common import Base
from db.specific_event import SpecificEvent
class ShotAttempt(Base, SpecificEvent):
__tablename__ = 'shot_attempts'
__autoload__ = True
STANDARD_ATTRS = [
"game_id", "team_id", "event_id", "player_id", "shot_at... | Add shot attempt item class definition | Add shot attempt item class definition
| Python | mit | leaffan/pynhldb | Add shot attempt item class definition | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
from db.common import Base
from db.specific_event import SpecificEvent
class ShotAttempt(Base, SpecificEvent):
__tablename__ = 'shot_attempts'
__autoload__ = True
STANDARD_ATTRS = [
"game_id", "team_id", "event_id", "player_id", "shot_at... | <commit_before><commit_msg>Add shot attempt item class definition<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
from db.common import Base
from db.specific_event import SpecificEvent
class ShotAttempt(Base, SpecificEvent):
__tablename__ = 'shot_attempts'
__autoload__ = True
STANDARD_ATTRS = [
"game_id", "team_id", "event_id", "player_id", "shot_at... | Add shot attempt item class definition#!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
from db.common import Base
from db.specific_event import SpecificEvent
class ShotAttempt(Base, SpecificEvent):
__tablename__ = 'shot_attempts'
__autoload__ = True
STANDARD_ATTRS = [
"game_id", "team_... | <commit_before><commit_msg>Add shot attempt item class definition<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
from db.common import Base
from db.specific_event import SpecificEvent
class ShotAttempt(Base, SpecificEvent):
__tablename__ = 'shot_attempts'
__autoload__ = True
STA... | |
b2dfa7ea44a0b9e061ffbb346fe9196ba96c2a44 | nanshe_workflow/_reg_joblib.py | nanshe_workflow/_reg_joblib.py | import dask
import dask.distributed
import distributed
try:
import dask.distributed.joblib
except ImportError:
pass
try:
import distributed.joblib
except ImportError:
pass
import sklearn
import sklearn.externals
import sklearn.externals.joblib
| Add backwards compatible Distributed Joblib hook | Add backwards compatible Distributed Joblib hook
Depending on the versions of Distributed, Joblib, and scikit-learn,
there are different strategies for registering the Joblib backend. Try
going with the standard Distributed technique first, which may fail for
Distributed 1.24.0+. In other cases, import `joblib` and
`s... | Python | apache-2.0 | nanshe-org/nanshe_workflow,DudLab/nanshe_workflow | Add backwards compatible Distributed Joblib hook
Depending on the versions of Distributed, Joblib, and scikit-learn,
there are different strategies for registering the Joblib backend. Try
going with the standard Distributed technique first, which may fail for
Distributed 1.24.0+. In other cases, import `joblib` and
`s... | import dask
import dask.distributed
import distributed
try:
import dask.distributed.joblib
except ImportError:
pass
try:
import distributed.joblib
except ImportError:
pass
import sklearn
import sklearn.externals
import sklearn.externals.joblib
| <commit_before><commit_msg>Add backwards compatible Distributed Joblib hook
Depending on the versions of Distributed, Joblib, and scikit-learn,
there are different strategies for registering the Joblib backend. Try
going with the standard Distributed technique first, which may fail for
Distributed 1.24.0+. In other ca... | import dask
import dask.distributed
import distributed
try:
import dask.distributed.joblib
except ImportError:
pass
try:
import distributed.joblib
except ImportError:
pass
import sklearn
import sklearn.externals
import sklearn.externals.joblib
| Add backwards compatible Distributed Joblib hook
Depending on the versions of Distributed, Joblib, and scikit-learn,
there are different strategies for registering the Joblib backend. Try
going with the standard Distributed technique first, which may fail for
Distributed 1.24.0+. In other cases, import `joblib` and
`s... | <commit_before><commit_msg>Add backwards compatible Distributed Joblib hook
Depending on the versions of Distributed, Joblib, and scikit-learn,
there are different strategies for registering the Joblib backend. Try
going with the standard Distributed technique first, which may fail for
Distributed 1.24.0+. In other ca... | |
e7299524720b4c30cfe4e8ebbc27eaed18d885b4 | tests/test_upsert.py | tests/test_upsert.py | from django.db import models
from psqlextra import HStoreField
from psqlextra.query import ConflictAction
from .fake_model import get_fake_model
def test_upsert():
"""Tests whether simple upserts works correctly."""
model = get_fake_model({
'title': HStoreField(uniqueness=['key1']),
'cookie... | Add test for old upsert syntax | Add test for old upsert syntax
| Python | mit | SectorLabs/django-postgres-extra | Add test for old upsert syntax | from django.db import models
from psqlextra import HStoreField
from psqlextra.query import ConflictAction
from .fake_model import get_fake_model
def test_upsert():
"""Tests whether simple upserts works correctly."""
model = get_fake_model({
'title': HStoreField(uniqueness=['key1']),
'cookie... | <commit_before><commit_msg>Add test for old upsert syntax<commit_after> | from django.db import models
from psqlextra import HStoreField
from psqlextra.query import ConflictAction
from .fake_model import get_fake_model
def test_upsert():
"""Tests whether simple upserts works correctly."""
model = get_fake_model({
'title': HStoreField(uniqueness=['key1']),
'cookie... | Add test for old upsert syntaxfrom django.db import models
from psqlextra import HStoreField
from psqlextra.query import ConflictAction
from .fake_model import get_fake_model
def test_upsert():
"""Tests whether simple upserts works correctly."""
model = get_fake_model({
'title': HStoreField(uniquen... | <commit_before><commit_msg>Add test for old upsert syntax<commit_after>from django.db import models
from psqlextra import HStoreField
from psqlextra.query import ConflictAction
from .fake_model import get_fake_model
def test_upsert():
"""Tests whether simple upserts works correctly."""
model = get_fake_mod... | |
58cd27f4daa921a63d0a80c31f5ff1bf73cb1992 | lintcode/Medium/040_Implement_Queue_by_Two_Stacks.py | lintcode/Medium/040_Implement_Queue_by_Two_Stacks.py | class MyQueue:
def __init__(self):
self.stack1 = []
self.stack2 = []
def push(self, element):
# write your code here
self.stack1.append(element)
def top(self):
# write your code here
# return the top element
return self.stack1[0]
def pop(self):... | Add solution to lintcode question 40 | Add solution to lintcode question 40
| Python | mit | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | Add solution to lintcode question 40 | class MyQueue:
def __init__(self):
self.stack1 = []
self.stack2 = []
def push(self, element):
# write your code here
self.stack1.append(element)
def top(self):
# write your code here
# return the top element
return self.stack1[0]
def pop(self):... | <commit_before><commit_msg>Add solution to lintcode question 40<commit_after> | class MyQueue:
def __init__(self):
self.stack1 = []
self.stack2 = []
def push(self, element):
# write your code here
self.stack1.append(element)
def top(self):
# write your code here
# return the top element
return self.stack1[0]
def pop(self):... | Add solution to lintcode question 40class MyQueue:
def __init__(self):
self.stack1 = []
self.stack2 = []
def push(self, element):
# write your code here
self.stack1.append(element)
def top(self):
# write your code here
# return the top element
retur... | <commit_before><commit_msg>Add solution to lintcode question 40<commit_after>class MyQueue:
def __init__(self):
self.stack1 = []
self.stack2 = []
def push(self, element):
# write your code here
self.stack1.append(element)
def top(self):
# write your code here
... | |
893c11200043d0775e38ef065359806e8162e30c | zou/app/services/custom_actions_service.py | zou/app/services/custom_actions_service.py | from zou.app.models.custom_action import CustomAction
from zou.app.utils import cache, fields
def clear_custom_action_cache():
cache.cache.delete_memoized(get_custom_actions)
@cache.memoize_function(120)
def get_custom_actions():
return fields.serialize_models(CustomAction.get_all())
| Add service module for custom actions | Add service module for custom actions
| Python | agpl-3.0 | cgwire/zou | Add service module for custom actions | from zou.app.models.custom_action import CustomAction
from zou.app.utils import cache, fields
def clear_custom_action_cache():
cache.cache.delete_memoized(get_custom_actions)
@cache.memoize_function(120)
def get_custom_actions():
return fields.serialize_models(CustomAction.get_all())
| <commit_before><commit_msg>Add service module for custom actions<commit_after> | from zou.app.models.custom_action import CustomAction
from zou.app.utils import cache, fields
def clear_custom_action_cache():
cache.cache.delete_memoized(get_custom_actions)
@cache.memoize_function(120)
def get_custom_actions():
return fields.serialize_models(CustomAction.get_all())
| Add service module for custom actionsfrom zou.app.models.custom_action import CustomAction
from zou.app.utils import cache, fields
def clear_custom_action_cache():
cache.cache.delete_memoized(get_custom_actions)
@cache.memoize_function(120)
def get_custom_actions():
return fields.serialize_models(CustomActi... | <commit_before><commit_msg>Add service module for custom actions<commit_after>from zou.app.models.custom_action import CustomAction
from zou.app.utils import cache, fields
def clear_custom_action_cache():
cache.cache.delete_memoized(get_custom_actions)
@cache.memoize_function(120)
def get_custom_actions():
... | |
b5de0f73962d770ef9325619ae724768da581014 | test/test_frontend/test_modes/test_zoom.py | test/test_frontend/test_modes/test_zoom.py | from PyQt4 import QtCore
from PyQt4 import QtGui
from PyQt4.QtTest import QTest
from pyqode.core import frontend, style
from pyqode.core.frontend import modes
editor = None
mode = None
def setup_module():
global editor, mode
editor = frontend.CodeEdit()
mode = modes.ZoomMode()
frontend.install_mode(... | Add tests for zoom mode | Add tests for zoom mode
| Python | mit | pyQode/pyqode.core,pyQode/pyqode.core,zwadar/pyqode.core | Add tests for zoom mode | from PyQt4 import QtCore
from PyQt4 import QtGui
from PyQt4.QtTest import QTest
from pyqode.core import frontend, style
from pyqode.core.frontend import modes
editor = None
mode = None
def setup_module():
global editor, mode
editor = frontend.CodeEdit()
mode = modes.ZoomMode()
frontend.install_mode(... | <commit_before><commit_msg>Add tests for zoom mode<commit_after> | from PyQt4 import QtCore
from PyQt4 import QtGui
from PyQt4.QtTest import QTest
from pyqode.core import frontend, style
from pyqode.core.frontend import modes
editor = None
mode = None
def setup_module():
global editor, mode
editor = frontend.CodeEdit()
mode = modes.ZoomMode()
frontend.install_mode(... | Add tests for zoom modefrom PyQt4 import QtCore
from PyQt4 import QtGui
from PyQt4.QtTest import QTest
from pyqode.core import frontend, style
from pyqode.core.frontend import modes
editor = None
mode = None
def setup_module():
global editor, mode
editor = frontend.CodeEdit()
mode = modes.ZoomMode()
... | <commit_before><commit_msg>Add tests for zoom mode<commit_after>from PyQt4 import QtCore
from PyQt4 import QtGui
from PyQt4.QtTest import QTest
from pyqode.core import frontend, style
from pyqode.core.frontend import modes
editor = None
mode = None
def setup_module():
global editor, mode
editor = frontend.C... | |
4918c909a23479be344eb52c40e1461fa94bd330 | two_factor/migrations/0006_phonedevice_key_default.py | two_factor/migrations/0006_phonedevice_key_default.py | from django.db import migrations, models
import two_factor.models
class Migration(migrations.Migration):
dependencies = [
('two_factor', '0005_auto_20160224_0450'),
]
operations = [
migrations.AlterField(
model_name='phonedevice',
name='key',
field=mo... | Add migration for byte string fix | Add migration for byte string fix
Changing the `PhoneDevice.key` default requires a model state migration.
See: 268c0d6 (Merge pull request #281 from Ameriks/byte_string_fix)
| Python | mit | Bouke/django-two-factor-auth,Bouke/django-two-factor-auth | Add migration for byte string fix
Changing the `PhoneDevice.key` default requires a model state migration.
See: 268c0d6 (Merge pull request #281 from Ameriks/byte_string_fix) | from django.db import migrations, models
import two_factor.models
class Migration(migrations.Migration):
dependencies = [
('two_factor', '0005_auto_20160224_0450'),
]
operations = [
migrations.AlterField(
model_name='phonedevice',
name='key',
field=mo... | <commit_before><commit_msg>Add migration for byte string fix
Changing the `PhoneDevice.key` default requires a model state migration.
See: 268c0d6 (Merge pull request #281 from Ameriks/byte_string_fix)<commit_after> | from django.db import migrations, models
import two_factor.models
class Migration(migrations.Migration):
dependencies = [
('two_factor', '0005_auto_20160224_0450'),
]
operations = [
migrations.AlterField(
model_name='phonedevice',
name='key',
field=mo... | Add migration for byte string fix
Changing the `PhoneDevice.key` default requires a model state migration.
See: 268c0d6 (Merge pull request #281 from Ameriks/byte_string_fix)from django.db import migrations, models
import two_factor.models
class Migration(migrations.Migration):
dependencies = [
('two_... | <commit_before><commit_msg>Add migration for byte string fix
Changing the `PhoneDevice.key` default requires a model state migration.
See: 268c0d6 (Merge pull request #281 from Ameriks/byte_string_fix)<commit_after>from django.db import migrations, models
import two_factor.models
class Migration(migrations.Migrati... | |
a22355b129538cf7a7e5184c02f392952cd0b623 | radio/sqlviews.py | radio/sqlviews.py | from django.db import connection
def create_repeater_tx_view():
"""
"""
from django.db import connection
cursor = connection.cursor()
cursor.execute('''
DROP VIEW IF EXISTS radio_repeater_tx_v;
CREATE OR REPLACE VIEW radio_repeater_tx_v AS
SELECT a.site_name,
a.last_inspected,
a... | Create view for repeater tx and repater rx | Create view for repeater tx and repater rx
| Python | bsd-3-clause | ropable/resource_tracking,ropable/resource_tracking,ropable/resource_tracking | Create view for repeater tx and repater rx | from django.db import connection
def create_repeater_tx_view():
"""
"""
from django.db import connection
cursor = connection.cursor()
cursor.execute('''
DROP VIEW IF EXISTS radio_repeater_tx_v;
CREATE OR REPLACE VIEW radio_repeater_tx_v AS
SELECT a.site_name,
a.last_inspected,
a... | <commit_before><commit_msg>Create view for repeater tx and repater rx<commit_after> | from django.db import connection
def create_repeater_tx_view():
"""
"""
from django.db import connection
cursor = connection.cursor()
cursor.execute('''
DROP VIEW IF EXISTS radio_repeater_tx_v;
CREATE OR REPLACE VIEW radio_repeater_tx_v AS
SELECT a.site_name,
a.last_inspected,
a... | Create view for repeater tx and repater rxfrom django.db import connection
def create_repeater_tx_view():
"""
"""
from django.db import connection
cursor = connection.cursor()
cursor.execute('''
DROP VIEW IF EXISTS radio_repeater_tx_v;
CREATE OR REPLACE VIEW radio_repeater_tx_v AS
SELEC... | <commit_before><commit_msg>Create view for repeater tx and repater rx<commit_after>from django.db import connection
def create_repeater_tx_view():
"""
"""
from django.db import connection
cursor = connection.cursor()
cursor.execute('''
DROP VIEW IF EXISTS radio_repeater_tx_v;
CREATE OR REPL... | |
68eea54f3147decd466be16cccc03ab5ec8504bb | leetcode/116-Populating-Next-Right-Pointers-in-Each-Node/PopulNxtRhtPnterinEachNode_001_rec.py | leetcode/116-Populating-Next-Right-Pointers-in-Each-Node/PopulNxtRhtPnterinEachNode_001_rec.py | # Definition for binary tree with next pointer.
# class TreeLinkNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
# self.next = None
class Solution(object):
def connect(self, root):
"""
:type root: TreeLinkNode
:... | Create Populate Nxt Ptr in each node REC | Create Populate Nxt Ptr in each node REC
| Python | mit | Chasego/codirit,cc13ny/Allin,cc13ny/Allin,cc13ny/algo,Chasego/codi,cc13ny/algo,Chasego/codirit,cc13ny/algo,cc13ny/Allin,Chasego/codirit,Chasego/codirit,Chasego/codi,cc13ny/algo,cc13ny/Allin,Chasego/cod,Chasego/cod,Chasego/codi,Chasego/codi,Chasego/cod,cc13ny/Allin,Chasego/codi,Chasego/cod,cc13ny/algo,Chasego/cod,Chaseg... | Create Populate Nxt Ptr in each node REC | # Definition for binary tree with next pointer.
# class TreeLinkNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
# self.next = None
class Solution(object):
def connect(self, root):
"""
:type root: TreeLinkNode
:... | <commit_before><commit_msg>Create Populate Nxt Ptr in each node REC<commit_after> | # Definition for binary tree with next pointer.
# class TreeLinkNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
# self.next = None
class Solution(object):
def connect(self, root):
"""
:type root: TreeLinkNode
:... | Create Populate Nxt Ptr in each node REC# Definition for binary tree with next pointer.
# class TreeLinkNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
# self.next = None
class Solution(object):
def connect(self, root):
"""
... | <commit_before><commit_msg>Create Populate Nxt Ptr in each node REC<commit_after># Definition for binary tree with next pointer.
# class TreeLinkNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
# self.next = None
class Solution(object):
... | |
6f975b364301349bb19ea254b66f5d67008f4fdd | csunplugged/utils/errors/QueryParameterMultipleValuesError.py | csunplugged/utils/errors/QueryParameterMultipleValuesError.py | """Exception for missing query parameter."""
class QueryParameterMultipleValuesError(Exception):
"""Exception for missing parameter in a GET query."""
def __init__(self, parameter, values):
"""Initialise exception.
Args:
parameter: The query parameter for the exception (str).
... | Add new exception for >1 value provided for a single valued parameter | Add new exception for >1 value provided for a single valued parameter
| Python | mit | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | Add new exception for >1 value provided for a single valued parameter | """Exception for missing query parameter."""
class QueryParameterMultipleValuesError(Exception):
"""Exception for missing parameter in a GET query."""
def __init__(self, parameter, values):
"""Initialise exception.
Args:
parameter: The query parameter for the exception (str).
... | <commit_before><commit_msg>Add new exception for >1 value provided for a single valued parameter<commit_after> | """Exception for missing query parameter."""
class QueryParameterMultipleValuesError(Exception):
"""Exception for missing parameter in a GET query."""
def __init__(self, parameter, values):
"""Initialise exception.
Args:
parameter: The query parameter for the exception (str).
... | Add new exception for >1 value provided for a single valued parameter"""Exception for missing query parameter."""
class QueryParameterMultipleValuesError(Exception):
"""Exception for missing parameter in a GET query."""
def __init__(self, parameter, values):
"""Initialise exception.
Args:
... | <commit_before><commit_msg>Add new exception for >1 value provided for a single valued parameter<commit_after>"""Exception for missing query parameter."""
class QueryParameterMultipleValuesError(Exception):
"""Exception for missing parameter in a GET query."""
def __init__(self, parameter, values):
"... | |
cee38843bcf4c628b1c1adc6014dbae7ad2e60c0 | acq4/devices/Scanner/scan_program/tests/test_spiral.py | acq4/devices/Scanner/scan_program/tests/test_spiral.py | from __future__ import division
import numpy as np
from acq4.devices.Scanner.scan_program.spiral import SpiralScan
def test_spiral():
r1 = 10e-6
r2 = 20e-6
a1 = 1.
a2 = 30.
ss = SpiralScan((r1, r2), (a1, a2))
# check that analytically computed path length matches numerically computed
... | Add unit tests for spiral scan | Add unit tests for spiral scan
| Python | mit | acq4/acq4,mgraupe/acq4,campagnola/acq4,meganbkratz/acq4,meganbkratz/acq4,acq4/acq4,acq4/acq4,mgraupe/acq4,tropp/acq4,mgraupe/acq4,meganbkratz/acq4,pbmanis/acq4,pbmanis/acq4,acq4/acq4,pbmanis/acq4,mgraupe/acq4,campagnola/acq4,tropp/acq4,campagnola/acq4,pbmanis/acq4,tropp/acq4,campagnola/acq4,meganbkratz/acq4,tropp/acq4,... | Add unit tests for spiral scan | from __future__ import division
import numpy as np
from acq4.devices.Scanner.scan_program.spiral import SpiralScan
def test_spiral():
r1 = 10e-6
r2 = 20e-6
a1 = 1.
a2 = 30.
ss = SpiralScan((r1, r2), (a1, a2))
# check that analytically computed path length matches numerically computed
... | <commit_before><commit_msg>Add unit tests for spiral scan<commit_after> | from __future__ import division
import numpy as np
from acq4.devices.Scanner.scan_program.spiral import SpiralScan
def test_spiral():
r1 = 10e-6
r2 = 20e-6
a1 = 1.
a2 = 30.
ss = SpiralScan((r1, r2), (a1, a2))
# check that analytically computed path length matches numerically computed
... | Add unit tests for spiral scanfrom __future__ import division
import numpy as np
from acq4.devices.Scanner.scan_program.spiral import SpiralScan
def test_spiral():
r1 = 10e-6
r2 = 20e-6
a1 = 1.
a2 = 30.
ss = SpiralScan((r1, r2), (a1, a2))
# check that analytically computed path length mat... | <commit_before><commit_msg>Add unit tests for spiral scan<commit_after>from __future__ import division
import numpy as np
from acq4.devices.Scanner.scan_program.spiral import SpiralScan
def test_spiral():
r1 = 10e-6
r2 = 20e-6
a1 = 1.
a2 = 30.
ss = SpiralScan((r1, r2), (a1, a2))
# check t... | |
6524be7830e1db3b7accbc95fb70318a66101c8e | cpro/migrations/0016_auto_20171216_1606.py | cpro/migrations/0016_auto_20171216_1606.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cpro', '0015_auto_20170217_0801'),
]
operations = [
migrations.AlterField(
model_name='card',
name='... | Add 2 skill types: Skill Boost and Cute/Cool/Passion Focus | Add 2 skill types: Skill Boost and Cute/Cool/Passion Focus
| Python | apache-2.0 | SchoolIdolTomodachi/CinderellaProducers,SchoolIdolTomodachi/CinderellaProducers | Add 2 skill types: Skill Boost and Cute/Cool/Passion Focus | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cpro', '0015_auto_20170217_0801'),
]
operations = [
migrations.AlterField(
model_name='card',
name='... | <commit_before><commit_msg>Add 2 skill types: Skill Boost and Cute/Cool/Passion Focus<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cpro', '0015_auto_20170217_0801'),
]
operations = [
migrations.AlterField(
model_name='card',
name='... | Add 2 skill types: Skill Boost and Cute/Cool/Passion Focus# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cpro', '0015_auto_20170217_0801'),
]
operations = [
migrations.Alt... | <commit_before><commit_msg>Add 2 skill types: Skill Boost and Cute/Cool/Passion Focus<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cpro', '0015_auto_20170217_0801'),
]
... | |
f772eb5b606ade1d1ec9b8e16c554b715634aba8 | traits/util/tests/test_deprecated.py | traits/util/tests/test_deprecated.py | #------------------------------------------------------------------------------
# Copyright (c) 2005-2014, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in /LICENSE.txt and may be redistributed only
# under the conditions described in... | Add tests for 'deprecated' decorator with functions and methods. | Add tests for 'deprecated' decorator with functions and methods.
| Python | bsd-3-clause | burnpanck/traits,burnpanck/traits | Add tests for 'deprecated' decorator with functions and methods. | #------------------------------------------------------------------------------
# Copyright (c) 2005-2014, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in /LICENSE.txt and may be redistributed only
# under the conditions described in... | <commit_before><commit_msg>Add tests for 'deprecated' decorator with functions and methods.<commit_after> | #------------------------------------------------------------------------------
# Copyright (c) 2005-2014, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in /LICENSE.txt and may be redistributed only
# under the conditions described in... | Add tests for 'deprecated' decorator with functions and methods.#------------------------------------------------------------------------------
# Copyright (c) 2005-2014, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in /LICENSE.txt a... | <commit_before><commit_msg>Add tests for 'deprecated' decorator with functions and methods.<commit_after>#------------------------------------------------------------------------------
# Copyright (c) 2005-2014, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the... | |
ca9654586c03dc746219b4e9dd6742ed9eca989d | source/bark/logger.py | source/bark/logger.py | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import copy
import bark
from .log import Log
class Logger(Log):
'''Helper for emitting logs.
A logger can be used to preset common information (such as a name) and then
emit :py:class:`~bark.log.Log`... | Add Logger class that acts as a convenient holder of common log information. | Add Logger class that acts as a convenient holder of common log information.
Also deals with emitting logs by calling global handle.
| Python | apache-2.0 | 4degrees/mill,4degrees/sawmill | Add Logger class that acts as a convenient holder of common log information.
Also deals with emitting logs by calling global handle. | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import copy
import bark
from .log import Log
class Logger(Log):
'''Helper for emitting logs.
A logger can be used to preset common information (such as a name) and then
emit :py:class:`~bark.log.Log`... | <commit_before><commit_msg>Add Logger class that acts as a convenient holder of common log information.
Also deals with emitting logs by calling global handle.<commit_after> | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import copy
import bark
from .log import Log
class Logger(Log):
'''Helper for emitting logs.
A logger can be used to preset common information (such as a name) and then
emit :py:class:`~bark.log.Log`... | Add Logger class that acts as a convenient holder of common log information.
Also deals with emitting logs by calling global handle.# :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import copy
import bark
from .log import Log
class Logger(Log):
'''Helper f... | <commit_before><commit_msg>Add Logger class that acts as a convenient holder of common log information.
Also deals with emitting logs by calling global handle.<commit_after># :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import copy
import bark
from .log import... | |
112a661139dfb85b4b3de346f569b3eb28a76e48 | tests/test_memory.py | tests/test_memory.py | 'Test of memory allocation'
import numpy as np
from nose.tools import assert_raises
from videocore.assembler import qpu, assemble
from videocore.driver import Driver, DriverError, \
DEFAULT_DATA_AREA_SIZE, DEFAULT_CODE_AREA_SIZE
def test_maximum_alloc():
with Driver() as drv:
... | Add a test for memory allocation | Add a test for memory allocation
| Python | mit | nineties/py-videocore | Add a test for memory allocation | 'Test of memory allocation'
import numpy as np
from nose.tools import assert_raises
from videocore.assembler import qpu, assemble
from videocore.driver import Driver, DriverError, \
DEFAULT_DATA_AREA_SIZE, DEFAULT_CODE_AREA_SIZE
def test_maximum_alloc():
with Driver() as drv:
... | <commit_before><commit_msg>Add a test for memory allocation<commit_after> | 'Test of memory allocation'
import numpy as np
from nose.tools import assert_raises
from videocore.assembler import qpu, assemble
from videocore.driver import Driver, DriverError, \
DEFAULT_DATA_AREA_SIZE, DEFAULT_CODE_AREA_SIZE
def test_maximum_alloc():
with Driver() as drv:
... | Add a test for memory allocation'Test of memory allocation'
import numpy as np
from nose.tools import assert_raises
from videocore.assembler import qpu, assemble
from videocore.driver import Driver, DriverError, \
DEFAULT_DATA_AREA_SIZE, DEFAULT_CODE_AREA_SIZE
def test_maximum_alloc():
... | <commit_before><commit_msg>Add a test for memory allocation<commit_after>'Test of memory allocation'
import numpy as np
from nose.tools import assert_raises
from videocore.assembler import qpu, assemble
from videocore.driver import Driver, DriverError, \
DEFAULT_DATA_AREA_SIZE, DEFAULT_COD... | |
8945ecc79c0233147a9c516b2530be958503841c | tests/test_typing.py | tests/test_typing.py | """tests/test_typing.py.
Tests to ensure hugs interacts as expected with the Python3.5+ typing module
Copyright (C) 2016 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software wi... | Add test for typing module | Add test for typing module
| Python | mit | timothycrosley/hug,timothycrosley/hug,MuhammadAlkarouri/hug,MuhammadAlkarouri/hug,timothycrosley/hug,MuhammadAlkarouri/hug | Add test for typing module | """tests/test_typing.py.
Tests to ensure hugs interacts as expected with the Python3.5+ typing module
Copyright (C) 2016 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software wi... | <commit_before><commit_msg>Add test for typing module<commit_after> | """tests/test_typing.py.
Tests to ensure hugs interacts as expected with the Python3.5+ typing module
Copyright (C) 2016 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software wi... | Add test for typing module"""tests/test_typing.py.
Tests to ensure hugs interacts as expected with the Python3.5+ typing module
Copyright (C) 2016 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), ... | <commit_before><commit_msg>Add test for typing module<commit_after>"""tests/test_typing.py.
Tests to ensure hugs interacts as expected with the Python3.5+ typing module
Copyright (C) 2016 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associat... | |
418e948a3ac3708f96d2137553e81480e8d01d1b | spdx/tv_to_rdf.py | spdx/tv_to_rdf.py | #!/usr/bin/env python
# Copyright (C) 2017 BMW AG
# Author: Thomas Hafner
#
# 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/LICE... | Add convenience function to convert from tag/value format to RDF. | Add convenience function to convert from tag/value format to RDF.
Signed-off-by: Philippe Ombredanne <ca95c4a6a4931f366cbdaf5878c5016609417d37@nexb.com> | Python | apache-2.0 | spdx/tools-python | Add convenience function to convert from tag/value format to RDF.
Signed-off-by: Philippe Ombredanne <ca95c4a6a4931f366cbdaf5878c5016609417d37@nexb.com> | #!/usr/bin/env python
# Copyright (C) 2017 BMW AG
# Author: Thomas Hafner
#
# 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/LICE... | <commit_before><commit_msg>Add convenience function to convert from tag/value format to RDF.
Signed-off-by: Philippe Ombredanne <ca95c4a6a4931f366cbdaf5878c5016609417d37@nexb.com><commit_after> | #!/usr/bin/env python
# Copyright (C) 2017 BMW AG
# Author: Thomas Hafner
#
# 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/LICE... | Add convenience function to convert from tag/value format to RDF.
Signed-off-by: Philippe Ombredanne <ca95c4a6a4931f366cbdaf5878c5016609417d37@nexb.com>#!/usr/bin/env python
# Copyright (C) 2017 BMW AG
# Author: Thomas Hafner
#
# Licensed under the Apache License, Version 2.0 (the "License");
# yo... | <commit_before><commit_msg>Add convenience function to convert from tag/value format to RDF.
Signed-off-by: Philippe Ombredanne <ca95c4a6a4931f366cbdaf5878c5016609417d37@nexb.com><commit_after>#!/usr/bin/env python
# Copyright (C) 2017 BMW AG
# Author: Thomas Hafner
#
# Licensed under the Apache Lice... | |
4f82eae6efab831f6a6bd1e6c4a2ee28b452a2cd | tests/test_local_sync_client.py | tests/test_local_sync_client.py | # -*- coding: utf-8 -*-
import os
import tempfile
from s3backup.local_sync_client import LocalSyncClient
class TestLocalSyncClient(object):
def test_keys(self):
local_dir = tempfile.mkdtemp()
for object_name in ('foo', 'bar'):
file_name = '{}/{}'.format(local_dir, object_name)
... | Add basic test for LocalSyncClient | Add basic test for LocalSyncClient
| Python | mit | MichaelAquilina/s3backup,MichaelAquilina/s3backup | Add basic test for LocalSyncClient | # -*- coding: utf-8 -*-
import os
import tempfile
from s3backup.local_sync_client import LocalSyncClient
class TestLocalSyncClient(object):
def test_keys(self):
local_dir = tempfile.mkdtemp()
for object_name in ('foo', 'bar'):
file_name = '{}/{}'.format(local_dir, object_name)
... | <commit_before><commit_msg>Add basic test for LocalSyncClient<commit_after> | # -*- coding: utf-8 -*-
import os
import tempfile
from s3backup.local_sync_client import LocalSyncClient
class TestLocalSyncClient(object):
def test_keys(self):
local_dir = tempfile.mkdtemp()
for object_name in ('foo', 'bar'):
file_name = '{}/{}'.format(local_dir, object_name)
... | Add basic test for LocalSyncClient# -*- coding: utf-8 -*-
import os
import tempfile
from s3backup.local_sync_client import LocalSyncClient
class TestLocalSyncClient(object):
def test_keys(self):
local_dir = tempfile.mkdtemp()
for object_name in ('foo', 'bar'):
file_name = '{}/{}'.fo... | <commit_before><commit_msg>Add basic test for LocalSyncClient<commit_after># -*- coding: utf-8 -*-
import os
import tempfile
from s3backup.local_sync_client import LocalSyncClient
class TestLocalSyncClient(object):
def test_keys(self):
local_dir = tempfile.mkdtemp()
for object_name in ('foo', '... | |
80d410dc40250ef9da1f733551bd04cca84f3723 | sri21_vs_vmx.py | sri21_vs_vmx.py | import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Load the machine
ap.machines.load('SRI21')
sri21_pvs = set()
# Find unique pv names for SRI21
BPMS = ap.getElements('BPM')
for BPM in range(len(BPMS)):
pv_name = BPMS[BPM].pv()[0].split(':')[0]
sri21_pvs.add(pv_name)
# Load the mac... | Modify caget method to convert to values using a list | Modify caget method to convert to values using a list
Also refactoring some of the variables names.
| Python | apache-2.0 | razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects | Modify caget method to convert to values using a list
Also refactoring some of the variables names. | import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Load the machine
ap.machines.load('SRI21')
sri21_pvs = set()
# Find unique pv names for SRI21
BPMS = ap.getElements('BPM')
for BPM in range(len(BPMS)):
pv_name = BPMS[BPM].pv()[0].split(':')[0]
sri21_pvs.add(pv_name)
# Load the mac... | <commit_before><commit_msg>Modify caget method to convert to values using a list
Also refactoring some of the variables names.<commit_after> | import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Load the machine
ap.machines.load('SRI21')
sri21_pvs = set()
# Find unique pv names for SRI21
BPMS = ap.getElements('BPM')
for BPM in range(len(BPMS)):
pv_name = BPMS[BPM].pv()[0].split(':')[0]
sri21_pvs.add(pv_name)
# Load the mac... | Modify caget method to convert to values using a list
Also refactoring some of the variables names.import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Load the machine
ap.machines.load('SRI21')
sri21_pvs = set()
# Find unique pv names for SRI21
BPMS = ap.getElements('BPM')
for BPM in range(len(... | <commit_before><commit_msg>Modify caget method to convert to values using a list
Also refactoring some of the variables names.<commit_after>import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Load the machine
ap.machines.load('SRI21')
sri21_pvs = set()
# Find unique pv names for SRI21
BPMS = ap.... | |
8307c3f1e580393ffe433ce10d84a09273be11f5 | tests/correlations/test_utils.py | tests/correlations/test_utils.py | # -*- coding: utf-8 -*-
import datetime
import pytest
from components.correlations.utils import call_attributes
FIELDS = ['started']
def test_successful_attribute_call():
class ProperlyAttributed(object):
started = datetime.datetime.now()
obj = ProperlyAttributed()
assert call_attributes(obj, F... | Test the call_attribute utility method. | Test the call_attribute utility method.
| Python | apache-2.0 | hello-base/web,hello-base/web,hello-base/web,hello-base/web | Test the call_attribute utility method. | # -*- coding: utf-8 -*-
import datetime
import pytest
from components.correlations.utils import call_attributes
FIELDS = ['started']
def test_successful_attribute_call():
class ProperlyAttributed(object):
started = datetime.datetime.now()
obj = ProperlyAttributed()
assert call_attributes(obj, F... | <commit_before><commit_msg>Test the call_attribute utility method.<commit_after> | # -*- coding: utf-8 -*-
import datetime
import pytest
from components.correlations.utils import call_attributes
FIELDS = ['started']
def test_successful_attribute_call():
class ProperlyAttributed(object):
started = datetime.datetime.now()
obj = ProperlyAttributed()
assert call_attributes(obj, F... | Test the call_attribute utility method.# -*- coding: utf-8 -*-
import datetime
import pytest
from components.correlations.utils import call_attributes
FIELDS = ['started']
def test_successful_attribute_call():
class ProperlyAttributed(object):
started = datetime.datetime.now()
obj = ProperlyAttribu... | <commit_before><commit_msg>Test the call_attribute utility method.<commit_after># -*- coding: utf-8 -*-
import datetime
import pytest
from components.correlations.utils import call_attributes
FIELDS = ['started']
def test_successful_attribute_call():
class ProperlyAttributed(object):
started = datetime.... | |
e40b9fb2ffaf91c11e167f6691738cc523eb9717 | samples/com/icallinterceptor.py | samples/com/icallinterceptor.py | import windows
import windows.generated_def as gdef
from windows import winproxy
# POC of ICallInterceptor
# Based on works by Pavel Yosifovich
# http://blogs.microsoft.co.il/pavely/2018/02/28/intercepting-com-objects-with-cogetinterceptor/
# TODO: clean / comment
windows.com.init()
target = gdef.INetFwPolicy2
fak... | Add quick POC of ICallInterceptor to COM samples | Add quick POC of ICallInterceptor to COM samples
| Python | bsd-3-clause | hakril/PythonForWindows | Add quick POC of ICallInterceptor to COM samples | import windows
import windows.generated_def as gdef
from windows import winproxy
# POC of ICallInterceptor
# Based on works by Pavel Yosifovich
# http://blogs.microsoft.co.il/pavely/2018/02/28/intercepting-com-objects-with-cogetinterceptor/
# TODO: clean / comment
windows.com.init()
target = gdef.INetFwPolicy2
fak... | <commit_before><commit_msg>Add quick POC of ICallInterceptor to COM samples<commit_after> | import windows
import windows.generated_def as gdef
from windows import winproxy
# POC of ICallInterceptor
# Based on works by Pavel Yosifovich
# http://blogs.microsoft.co.il/pavely/2018/02/28/intercepting-com-objects-with-cogetinterceptor/
# TODO: clean / comment
windows.com.init()
target = gdef.INetFwPolicy2
fak... | Add quick POC of ICallInterceptor to COM samplesimport windows
import windows.generated_def as gdef
from windows import winproxy
# POC of ICallInterceptor
# Based on works by Pavel Yosifovich
# http://blogs.microsoft.co.il/pavely/2018/02/28/intercepting-com-objects-with-cogetinterceptor/
# TODO: clean / comment
wind... | <commit_before><commit_msg>Add quick POC of ICallInterceptor to COM samples<commit_after>import windows
import windows.generated_def as gdef
from windows import winproxy
# POC of ICallInterceptor
# Based on works by Pavel Yosifovich
# http://blogs.microsoft.co.il/pavely/2018/02/28/intercepting-com-objects-with-cogetin... | |
23e2fa314ca6e912ad74e7c1bad6005da15d8186 | scripts/print_view_hierarchy.py | scripts/print_view_hierarchy.py | """Prints the current view hierarchy.
Usage: pv
"""
def print_view_hierarchy(debugger, command, result, internal_dict):
debugger.HandleCommand('po [[UIWindow keyWindow] recursiveDescription]')
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('command script add -f print_view_hierarchy.prin... | Add print view hierarchy command. | Add print view hierarchy command.
| Python | mit | mrhappyasthma/HappyDebugging,mrhappyasthma/happydebugging | Add print view hierarchy command. | """Prints the current view hierarchy.
Usage: pv
"""
def print_view_hierarchy(debugger, command, result, internal_dict):
debugger.HandleCommand('po [[UIWindow keyWindow] recursiveDescription]')
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('command script add -f print_view_hierarchy.prin... | <commit_before><commit_msg>Add print view hierarchy command.<commit_after> | """Prints the current view hierarchy.
Usage: pv
"""
def print_view_hierarchy(debugger, command, result, internal_dict):
debugger.HandleCommand('po [[UIWindow keyWindow] recursiveDescription]')
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('command script add -f print_view_hierarchy.prin... | Add print view hierarchy command."""Prints the current view hierarchy.
Usage: pv
"""
def print_view_hierarchy(debugger, command, result, internal_dict):
debugger.HandleCommand('po [[UIWindow keyWindow] recursiveDescription]')
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('command script... | <commit_before><commit_msg>Add print view hierarchy command.<commit_after>"""Prints the current view hierarchy.
Usage: pv
"""
def print_view_hierarchy(debugger, command, result, internal_dict):
debugger.HandleCommand('po [[UIWindow keyWindow] recursiveDescription]')
def __lldb_init_module(debugger, internal_dict):... | |
22821de77f2c9ca16ed95b7042f8e2e266c6afcb | astrobin/management/commands/message_all.py | astrobin/management/commands/message_all.py | from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
import persistent_messages
class Command(BaseCommand):
help = "Sends a message to all users."
def handle(self, *args, **options):
if len(args) < 2:
print "Need two arbuments: subject and body."... | Add command to message everybody. | Add command to message everybody.
| Python | agpl-3.0 | astrobin/astrobin,astrobin/astrobin,astrobin/astrobin,astrobin/astrobin | Add command to message everybody. | from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
import persistent_messages
class Command(BaseCommand):
help = "Sends a message to all users."
def handle(self, *args, **options):
if len(args) < 2:
print "Need two arbuments: subject and body."... | <commit_before><commit_msg>Add command to message everybody.<commit_after> | from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
import persistent_messages
class Command(BaseCommand):
help = "Sends a message to all users."
def handle(self, *args, **options):
if len(args) < 2:
print "Need two arbuments: subject and body."... | Add command to message everybody.from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
import persistent_messages
class Command(BaseCommand):
help = "Sends a message to all users."
def handle(self, *args, **options):
if len(args) < 2:
print "Need ... | <commit_before><commit_msg>Add command to message everybody.<commit_after>from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
import persistent_messages
class Command(BaseCommand):
help = "Sends a message to all users."
def handle(self, *args, **options):
i... | |
df5572a6780fca1d657b622f231edd4e5948613e | bot/storage/api.py | bot/storage/api.py | from bot.storage.async.scheduler import StorageScheduler
from bot.storage.data_source.data_source import StorageDataSource
class StorageApi:
def __init__(self, data_source: StorageDataSource, scheduler: StorageScheduler):
self.data_source = data_source
self.scheduler = scheduler
scheduler.... | Create StorageApi inspired by clock-bot one | Create StorageApi inspired by clock-bot one
| Python | agpl-3.0 | alvarogzp/telegram-bot,alvarogzp/telegram-bot | Create StorageApi inspired by clock-bot one | from bot.storage.async.scheduler import StorageScheduler
from bot.storage.data_source.data_source import StorageDataSource
class StorageApi:
def __init__(self, data_source: StorageDataSource, scheduler: StorageScheduler):
self.data_source = data_source
self.scheduler = scheduler
scheduler.... | <commit_before><commit_msg>Create StorageApi inspired by clock-bot one<commit_after> | from bot.storage.async.scheduler import StorageScheduler
from bot.storage.data_source.data_source import StorageDataSource
class StorageApi:
def __init__(self, data_source: StorageDataSource, scheduler: StorageScheduler):
self.data_source = data_source
self.scheduler = scheduler
scheduler.... | Create StorageApi inspired by clock-bot onefrom bot.storage.async.scheduler import StorageScheduler
from bot.storage.data_source.data_source import StorageDataSource
class StorageApi:
def __init__(self, data_source: StorageDataSource, scheduler: StorageScheduler):
self.data_source = data_source
se... | <commit_before><commit_msg>Create StorageApi inspired by clock-bot one<commit_after>from bot.storage.async.scheduler import StorageScheduler
from bot.storage.data_source.data_source import StorageDataSource
class StorageApi:
def __init__(self, data_source: StorageDataSource, scheduler: StorageScheduler):
... | |
233290d578aad1fde80999e75ccc29353ddaf834 | zerver/management/commands/purge_queue.py | zerver/management/commands/purge_queue.py | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.core.management import CommandError
from zerver.lib.queue import SimpleQueueClient
import logging
class Command(BaseCommand):
args = "<queue name>"
help = "Discards all messages from the given queue"
def... | Add a management command to purge a rabbitmq queue | Add a management command to purge a rabbitmq queue
This is useful in debugging when you just want to discard all the
messages in a queue because they have the wrong structure.
(imported from commit 8559ac74f11841430b4d0c801d5506ebcb74c3eb)
| Python | apache-2.0 | kokoar/zulip,codeKonami/zulip,developerfm/zulip,zwily/zulip,dattatreya303/zulip,aliceriot/zulip,glovebx/zulip,blaze225/zulip,dawran6/zulip,littledogboy/zulip,JPJPJPOPOP/zulip,bastianh/zulip,littledogboy/zulip,wdaher/zulip,glovebx/zulip,grave-w-grave/zulip,brockwhittaker/zulip,souravbadami/zulip,akuseru/zulip,RobotCaleb... | Add a management command to purge a rabbitmq queue
This is useful in debugging when you just want to discard all the
messages in a queue because they have the wrong structure.
(imported from commit 8559ac74f11841430b4d0c801d5506ebcb74c3eb) | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.core.management import CommandError
from zerver.lib.queue import SimpleQueueClient
import logging
class Command(BaseCommand):
args = "<queue name>"
help = "Discards all messages from the given queue"
def... | <commit_before><commit_msg>Add a management command to purge a rabbitmq queue
This is useful in debugging when you just want to discard all the
messages in a queue because they have the wrong structure.
(imported from commit 8559ac74f11841430b4d0c801d5506ebcb74c3eb)<commit_after> | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.core.management import CommandError
from zerver.lib.queue import SimpleQueueClient
import logging
class Command(BaseCommand):
args = "<queue name>"
help = "Discards all messages from the given queue"
def... | Add a management command to purge a rabbitmq queue
This is useful in debugging when you just want to discard all the
messages in a queue because they have the wrong structure.
(imported from commit 8559ac74f11841430b4d0c801d5506ebcb74c3eb)from __future__ import absolute_import
from django.core.management.base import... | <commit_before><commit_msg>Add a management command to purge a rabbitmq queue
This is useful in debugging when you just want to discard all the
messages in a queue because they have the wrong structure.
(imported from commit 8559ac74f11841430b4d0c801d5506ebcb74c3eb)<commit_after>from __future__ import absolute_import... | |
86f60a2acb592a6ac6260867f8c9d423fc25d9d8 | stdnum/us/rtn.py | stdnum/us/rtn.py | # rtn.py - functions for handling banking routing transit numbers
#
# Copyright (C) 2014 Lifealike Ltd
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Licens... | Add US bank routing transit numbers | Add US bank routing transit numbers
| Python | lgpl-2.1 | tonyseek/python-stdnum,arthurdejong/python-stdnum,dchoruzy/python-stdnum,arthurdejong/python-stdnum,holvi/python-stdnum,holvi/python-stdnum,arthurdejong/python-stdnum,holvi/python-stdnum,t0mk/python-stdnum | Add US bank routing transit numbers | # rtn.py - functions for handling banking routing transit numbers
#
# Copyright (C) 2014 Lifealike Ltd
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Licens... | <commit_before><commit_msg>Add US bank routing transit numbers<commit_after> | # rtn.py - functions for handling banking routing transit numbers
#
# Copyright (C) 2014 Lifealike Ltd
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Licens... | Add US bank routing transit numbers# rtn.py - functions for handling banking routing transit numbers
#
# Copyright (C) 2014 Lifealike Ltd
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation;... | <commit_before><commit_msg>Add US bank routing transit numbers<commit_after># rtn.py - functions for handling banking routing transit numbers
#
# Copyright (C) 2014 Lifealike Ltd
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as p... | |
78ff64e41c7378200e99d26ea030ec12b70f0625 | tests/test_io.py | tests/test_io.py | from __future__ import with_statement
from nose.tools import eq_
from fabric.io import OutputLooper
from fabric.context_managers import settings
def test_request_prompts():
"""
Test valid responses from prompts
"""
def run(txt, prompts):
with settings(prompts=prompts):
# try to f... | # -*- coding: utf-8 -*-
from __future__ import with_statement
import sys
from io import BytesIO
from nose.tools import eq_
from fabric.io import OutputLooper
from fabric.context_managers import hide, settings
from utils import mock_streams
def test_request_prompts():
"""
Test valid responses from prompts
... | Add test which detects the UnicodeDecodeError from pip | Add test which detects the UnicodeDecodeError from pip
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 4095: unexpected end of data
https://github.com/mathiasertl/fabric/issues/5
| Python | bsd-2-clause | ploxiln/fabric,mathiasertl/fabric,rodrigc/fabric | from __future__ import with_statement
from nose.tools import eq_
from fabric.io import OutputLooper
from fabric.context_managers import settings
def test_request_prompts():
"""
Test valid responses from prompts
"""
def run(txt, prompts):
with settings(prompts=prompts):
# try to f... | # -*- coding: utf-8 -*-
from __future__ import with_statement
import sys
from io import BytesIO
from nose.tools import eq_
from fabric.io import OutputLooper
from fabric.context_managers import hide, settings
from utils import mock_streams
def test_request_prompts():
"""
Test valid responses from prompts
... | <commit_before>from __future__ import with_statement
from nose.tools import eq_
from fabric.io import OutputLooper
from fabric.context_managers import settings
def test_request_prompts():
"""
Test valid responses from prompts
"""
def run(txt, prompts):
with settings(prompts=prompts):
... | # -*- coding: utf-8 -*-
from __future__ import with_statement
import sys
from io import BytesIO
from nose.tools import eq_
from fabric.io import OutputLooper
from fabric.context_managers import hide, settings
from utils import mock_streams
def test_request_prompts():
"""
Test valid responses from prompts
... | from __future__ import with_statement
from nose.tools import eq_
from fabric.io import OutputLooper
from fabric.context_managers import settings
def test_request_prompts():
"""
Test valid responses from prompts
"""
def run(txt, prompts):
with settings(prompts=prompts):
# try to f... | <commit_before>from __future__ import with_statement
from nose.tools import eq_
from fabric.io import OutputLooper
from fabric.context_managers import settings
def test_request_prompts():
"""
Test valid responses from prompts
"""
def run(txt, prompts):
with settings(prompts=prompts):
... |
60bf87a9cf20d053c10ded99f2f3d39be785e8b8 | make_obs_mask.py | make_obs_mask.py | import numpy as np
import aplpy
import matplotlib.pyplot as plt
from astropy.io import fits
from config import plottingDictionary
def mask_obs_area(rms_data):
rms_data[np.isfinite(rms_data)] = 1.
rms_data[np.isnan(rms_data)] = 0.
return rms_data
def make_obs_mask(region_list,file_ext):
for region in r... | Create mask file outlining map extents | Create mask file outlining map extents
| Python | mit | GBTAmmoniaSurvey/DR1_analysis,rfriesen/DR1_analysis | Create mask file outlining map extents | import numpy as np
import aplpy
import matplotlib.pyplot as plt
from astropy.io import fits
from config import plottingDictionary
def mask_obs_area(rms_data):
rms_data[np.isfinite(rms_data)] = 1.
rms_data[np.isnan(rms_data)] = 0.
return rms_data
def make_obs_mask(region_list,file_ext):
for region in r... | <commit_before><commit_msg>Create mask file outlining map extents<commit_after> | import numpy as np
import aplpy
import matplotlib.pyplot as plt
from astropy.io import fits
from config import plottingDictionary
def mask_obs_area(rms_data):
rms_data[np.isfinite(rms_data)] = 1.
rms_data[np.isnan(rms_data)] = 0.
return rms_data
def make_obs_mask(region_list,file_ext):
for region in r... | Create mask file outlining map extentsimport numpy as np
import aplpy
import matplotlib.pyplot as plt
from astropy.io import fits
from config import plottingDictionary
def mask_obs_area(rms_data):
rms_data[np.isfinite(rms_data)] = 1.
rms_data[np.isnan(rms_data)] = 0.
return rms_data
def make_obs_mask(regi... | <commit_before><commit_msg>Create mask file outlining map extents<commit_after>import numpy as np
import aplpy
import matplotlib.pyplot as plt
from astropy.io import fits
from config import plottingDictionary
def mask_obs_area(rms_data):
rms_data[np.isfinite(rms_data)] = 1.
rms_data[np.isnan(rms_data)] = 0.
... | |
4b198dd9b4109888692cd95881a6e5ebe64bccee | conf/init_mongodb.py | conf/init_mongodb.py | import getpass
import hashlib
from pymongo import MongoClient
spider_db = MongoClient().spider
admin_present = False
for user in spider_db.auth.find():
if user["username"] == "admin":
admin_present = True
break
if not admin_present:
password1 = getpass.getpass("Give a password for the admin u... | Add initialisation script to add the admin user. | Add initialisation script to add the admin user.
| Python | apache-2.0 | asteroide/immo_spider,asteroide/immo_spider,asteroide/immo_spider,asteroide/immo_spider | Add initialisation script to add the admin user. | import getpass
import hashlib
from pymongo import MongoClient
spider_db = MongoClient().spider
admin_present = False
for user in spider_db.auth.find():
if user["username"] == "admin":
admin_present = True
break
if not admin_present:
password1 = getpass.getpass("Give a password for the admin u... | <commit_before><commit_msg>Add initialisation script to add the admin user.<commit_after> | import getpass
import hashlib
from pymongo import MongoClient
spider_db = MongoClient().spider
admin_present = False
for user in spider_db.auth.find():
if user["username"] == "admin":
admin_present = True
break
if not admin_present:
password1 = getpass.getpass("Give a password for the admin u... | Add initialisation script to add the admin user.import getpass
import hashlib
from pymongo import MongoClient
spider_db = MongoClient().spider
admin_present = False
for user in spider_db.auth.find():
if user["username"] == "admin":
admin_present = True
break
if not admin_present:
password1 = ... | <commit_before><commit_msg>Add initialisation script to add the admin user.<commit_after>import getpass
import hashlib
from pymongo import MongoClient
spider_db = MongoClient().spider
admin_present = False
for user in spider_db.auth.find():
if user["username"] == "admin":
admin_present = True
brea... | |
1018589a17484c5ed337b80a5887aef68df7adbb | util/hgfilesize.py | util/hgfilesize.py | from mercurial import context
from mercurial.i18n import _
'''
[extensions]
hgfilesize=~/m5/incoming/util/hgfilesize.py
[hooks]
pretxncommit = python:hgfilesize.limit_file_size
pretxnchangegroup = python:hgfilesize.limit_file_size
[limit_file_size]
maximum_file_size = 200000
'''
def limit_file_size(ui, repo, node=N... | Add a hook to limit the size of any individual file | hooks: Add a hook to limit the size of any individual file
| Python | bsd-3-clause | pombredanne/http-repo.gem5.org-gem5-,pombredanne/http-repo.gem5.org-gem5-,hoangt/tpzsimul.gem5,pombredanne/http-repo.gem5.org-gem5-,pombredanne/http-repo.gem5.org-gem5-,vovojh/gem5,pombredanne/http-repo.gem5.org-gem5-,vovojh/gem5,vovojh/gem5,hoangt/tpzsimul.gem5,hoangt/tpzsimul.gem5,hoangt/tpzsimul.gem5,hoangt/tpzsimul... | hooks: Add a hook to limit the size of any individual file | from mercurial import context
from mercurial.i18n import _
'''
[extensions]
hgfilesize=~/m5/incoming/util/hgfilesize.py
[hooks]
pretxncommit = python:hgfilesize.limit_file_size
pretxnchangegroup = python:hgfilesize.limit_file_size
[limit_file_size]
maximum_file_size = 200000
'''
def limit_file_size(ui, repo, node=N... | <commit_before><commit_msg>hooks: Add a hook to limit the size of any individual file<commit_after> | from mercurial import context
from mercurial.i18n import _
'''
[extensions]
hgfilesize=~/m5/incoming/util/hgfilesize.py
[hooks]
pretxncommit = python:hgfilesize.limit_file_size
pretxnchangegroup = python:hgfilesize.limit_file_size
[limit_file_size]
maximum_file_size = 200000
'''
def limit_file_size(ui, repo, node=N... | hooks: Add a hook to limit the size of any individual filefrom mercurial import context
from mercurial.i18n import _
'''
[extensions]
hgfilesize=~/m5/incoming/util/hgfilesize.py
[hooks]
pretxncommit = python:hgfilesize.limit_file_size
pretxnchangegroup = python:hgfilesize.limit_file_size
[limit_file_size]
maximum_fi... | <commit_before><commit_msg>hooks: Add a hook to limit the size of any individual file<commit_after>from mercurial import context
from mercurial.i18n import _
'''
[extensions]
hgfilesize=~/m5/incoming/util/hgfilesize.py
[hooks]
pretxncommit = python:hgfilesize.limit_file_size
pretxnchangegroup = python:hgfilesize.limi... | |
eebe2343ebcd10adfe5b5dc4b413c477e759bed8 | algorithms/recursion/towersofhanoi.py | algorithms/recursion/towersofhanoi.py | def hanoi(disks, source, helper, target):
if disks >= 1:
# Move n-1 disks from source to helper
hanoi(disks - 1, source, target, helper)
# Move 1 disk from source to target
print source, "->", target
# Move previously moved disks from helper to target
hanoi(disks - ... | Add towers of hanoi implementation | Add towers of hanoi implementation
Solves the tower of hanoi game for 3 disks. | Python | mit | chinhtle/python_fun | Add towers of hanoi implementation
Solves the tower of hanoi game for 3 disks. | def hanoi(disks, source, helper, target):
if disks >= 1:
# Move n-1 disks from source to helper
hanoi(disks - 1, source, target, helper)
# Move 1 disk from source to target
print source, "->", target
# Move previously moved disks from helper to target
hanoi(disks - ... | <commit_before><commit_msg>Add towers of hanoi implementation
Solves the tower of hanoi game for 3 disks.<commit_after> | def hanoi(disks, source, helper, target):
if disks >= 1:
# Move n-1 disks from source to helper
hanoi(disks - 1, source, target, helper)
# Move 1 disk from source to target
print source, "->", target
# Move previously moved disks from helper to target
hanoi(disks - ... | Add towers of hanoi implementation
Solves the tower of hanoi game for 3 disks.def hanoi(disks, source, helper, target):
if disks >= 1:
# Move n-1 disks from source to helper
hanoi(disks - 1, source, target, helper)
# Move 1 disk from source to target
print source, "->", target
... | <commit_before><commit_msg>Add towers of hanoi implementation
Solves the tower of hanoi game for 3 disks.<commit_after>def hanoi(disks, source, helper, target):
if disks >= 1:
# Move n-1 disks from source to helper
hanoi(disks - 1, source, target, helper)
# Move 1 disk from source to targe... | |
554f7eb48fea7af7d857e145ce1d36a25c73e6e3 | app/modules/parse_input.py | app/modules/parse_input.py |
import re
from app.module.shogi import Koma
class ParseInput:
self.koma_names = [
"歩",
"と",
"香",
"香車",
"桂",
"桂馬",
"銀",
"銀将",
"金",
"金将",
"角",
"角行",
"馬",
"飛",
"飛車",
"龍",
"王",
... | Add script for parse. Not completed, but commit for move branch. | Add script for parse. Not completed, but commit for move branch.
| Python | mit | setokinto/slack-shogi | Add script for parse. Not completed, but commit for move branch. |
import re
from app.module.shogi import Koma
class ParseInput:
self.koma_names = [
"歩",
"と",
"香",
"香車",
"桂",
"桂馬",
"銀",
"銀将",
"金",
"金将",
"角",
"角行",
"馬",
"飛",
"飛車",
"龍",
"王",
... | <commit_before><commit_msg>Add script for parse. Not completed, but commit for move branch.<commit_after> |
import re
from app.module.shogi import Koma
class ParseInput:
self.koma_names = [
"歩",
"と",
"香",
"香車",
"桂",
"桂馬",
"銀",
"銀将",
"金",
"金将",
"角",
"角行",
"馬",
"飛",
"飛車",
"龍",
"王",
... | Add script for parse. Not completed, but commit for move branch.
import re
from app.module.shogi import Koma
class ParseInput:
self.koma_names = [
"歩",
"と",
"香",
"香車",
"桂",
"桂馬",
"銀",
"銀将",
"金",
"金将",
"角",
"角行",
... | <commit_before><commit_msg>Add script for parse. Not completed, but commit for move branch.<commit_after>
import re
from app.module.shogi import Koma
class ParseInput:
self.koma_names = [
"歩",
"と",
"香",
"香車",
"桂",
"桂馬",
"銀",
"銀将",
"金",
... | |
5a0b08e8eaa7cf0be947cda5f7f7e639bb38a689 | components/session.py | components/session.py | """A class for SQLGitHub sessions.
Sample Usage:
g = Github(token)
s = SgSession(g, ["name", "description"], "abseil.repos")
print(s.Execute())
"""
import table as tb
import table_fetcher
import expression_evaluator
class SgSession:
"""A class for SQLGitHub sessions."""
def __init__(self, githu... | Add SgSession - a meta class for a query instance | Add SgSession - a meta class for a query instance
| Python | mit | lnishan/SQLGitHub | Add SgSession - a meta class for a query instance | """A class for SQLGitHub sessions.
Sample Usage:
g = Github(token)
s = SgSession(g, ["name", "description"], "abseil.repos")
print(s.Execute())
"""
import table as tb
import table_fetcher
import expression_evaluator
class SgSession:
"""A class for SQLGitHub sessions."""
def __init__(self, githu... | <commit_before><commit_msg>Add SgSession - a meta class for a query instance<commit_after> | """A class for SQLGitHub sessions.
Sample Usage:
g = Github(token)
s = SgSession(g, ["name", "description"], "abseil.repos")
print(s.Execute())
"""
import table as tb
import table_fetcher
import expression_evaluator
class SgSession:
"""A class for SQLGitHub sessions."""
def __init__(self, githu... | Add SgSession - a meta class for a query instance"""A class for SQLGitHub sessions.
Sample Usage:
g = Github(token)
s = SgSession(g, ["name", "description"], "abseil.repos")
print(s.Execute())
"""
import table as tb
import table_fetcher
import expression_evaluator
class SgSession:
"""A class for SQL... | <commit_before><commit_msg>Add SgSession - a meta class for a query instance<commit_after>"""A class for SQLGitHub sessions.
Sample Usage:
g = Github(token)
s = SgSession(g, ["name", "description"], "abseil.repos")
print(s.Execute())
"""
import table as tb
import table_fetcher
import expression_evaluator
... | |
c42a9633d9b4bbd0d2dec33b1e343e76d167bf6a | fix_name.py | fix_name.py | import os
import shutil
import sys
def fullpath_names(root_dir, file_list):
"""Create a list of fullpath file-name
"""
fullpath_list = []
for i in file_list:
fullpath_list.append(os.path.join(root_dir, i))
return fullpath_list
def get_files_and_subdirs(root_dir):
"""Return a tuple with... | Add program to rename files automatically | Add program to rename files automatically
| Python | mit | escorciav/linux-utils,escorciav/linux-utils | Add program to rename files automatically | import os
import shutil
import sys
def fullpath_names(root_dir, file_list):
"""Create a list of fullpath file-name
"""
fullpath_list = []
for i in file_list:
fullpath_list.append(os.path.join(root_dir, i))
return fullpath_list
def get_files_and_subdirs(root_dir):
"""Return a tuple with... | <commit_before><commit_msg>Add program to rename files automatically<commit_after> | import os
import shutil
import sys
def fullpath_names(root_dir, file_list):
"""Create a list of fullpath file-name
"""
fullpath_list = []
for i in file_list:
fullpath_list.append(os.path.join(root_dir, i))
return fullpath_list
def get_files_and_subdirs(root_dir):
"""Return a tuple with... | Add program to rename files automaticallyimport os
import shutil
import sys
def fullpath_names(root_dir, file_list):
"""Create a list of fullpath file-name
"""
fullpath_list = []
for i in file_list:
fullpath_list.append(os.path.join(root_dir, i))
return fullpath_list
def get_files_and_subd... | <commit_before><commit_msg>Add program to rename files automatically<commit_after>import os
import shutil
import sys
def fullpath_names(root_dir, file_list):
"""Create a list of fullpath file-name
"""
fullpath_list = []
for i in file_list:
fullpath_list.append(os.path.join(root_dir, i))
ret... | |
921d4544c2f2a78aeb36addcfa9f01720de2acb2 | plugins/limit.py | plugins/limit.py | from parser import parse_prefix
class Limit_Plugin:
""" Plugin to control which users can use which commands.
"""
def __init__(self, mib, params=None):
self.mib = mib
self.mib.register_privmsg_cmd('allow', self.allow)
self.mib.register_privmsg_cmd('deny', self.deny)
self.lo... | Add plugin for handling command permissions | Add plugin for handling command permissions
| Python | mit | aalien/mib | Add plugin for handling command permissions | from parser import parse_prefix
class Limit_Plugin:
""" Plugin to control which users can use which commands.
"""
def __init__(self, mib, params=None):
self.mib = mib
self.mib.register_privmsg_cmd('allow', self.allow)
self.mib.register_privmsg_cmd('deny', self.deny)
self.lo... | <commit_before><commit_msg>Add plugin for handling command permissions<commit_after> | from parser import parse_prefix
class Limit_Plugin:
""" Plugin to control which users can use which commands.
"""
def __init__(self, mib, params=None):
self.mib = mib
self.mib.register_privmsg_cmd('allow', self.allow)
self.mib.register_privmsg_cmd('deny', self.deny)
self.lo... | Add plugin for handling command permissionsfrom parser import parse_prefix
class Limit_Plugin:
""" Plugin to control which users can use which commands.
"""
def __init__(self, mib, params=None):
self.mib = mib
self.mib.register_privmsg_cmd('allow', self.allow)
self.mib.register_pri... | <commit_before><commit_msg>Add plugin for handling command permissions<commit_after>from parser import parse_prefix
class Limit_Plugin:
""" Plugin to control which users can use which commands.
"""
def __init__(self, mib, params=None):
self.mib = mib
self.mib.register_privmsg_cmd('allow', ... | |
8c6559a442b2ca4a934aecd755b4643d2e234c84 | bin/pympit_multiprocess.py | bin/pympit_multiprocess.py | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals, with_statement
from mpi4py import MPI
import sys
import os
import numpy as np
import multiprocessing
#- Default number of processes to use for multiprocessing
if 'SLURM_CPUS_PER_TASK' in os.environ.keys():
... | Add new test script that calls multiprocessing. | Add new test script that calls multiprocessing.
| Python | bsd-2-clause | tskisner/pympit,tskisner/pympit | Add new test script that calls multiprocessing. | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals, with_statement
from mpi4py import MPI
import sys
import os
import numpy as np
import multiprocessing
#- Default number of processes to use for multiprocessing
if 'SLURM_CPUS_PER_TASK' in os.environ.keys():
... | <commit_before><commit_msg>Add new test script that calls multiprocessing.<commit_after> | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals, with_statement
from mpi4py import MPI
import sys
import os
import numpy as np
import multiprocessing
#- Default number of processes to use for multiprocessing
if 'SLURM_CPUS_PER_TASK' in os.environ.keys():
... | Add new test script that calls multiprocessing.#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals, with_statement
from mpi4py import MPI
import sys
import os
import numpy as np
import multiprocessing
#- Default number of processes to use for multiprocessing
if... | <commit_before><commit_msg>Add new test script that calls multiprocessing.<commit_after>#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals, with_statement
from mpi4py import MPI
import sys
import os
import numpy as np
import multiprocessing
#- Default number o... | |
f84ba2d213636482951553cc453b33a4bac8541f | pytest_doctest_custom.py | pytest_doctest_custom.py | """Py.test doctest custom plugin"""
# By Danilo J. S. Bellini
import sys, functools
def printer(value):
"""Prints the object representation using the given custom formatter."""
if value is not None:
print(printer.repr(value)) # This attribute has to be set elsewhere
def temp_replace(obj, attr_name, va... | Create the plugin based on PyScanPrev conftest.py | Create the plugin based on PyScanPrev conftest.py
| Python | mit | danilobellini/pytest-doctest-custom | Create the plugin based on PyScanPrev conftest.py | """Py.test doctest custom plugin"""
# By Danilo J. S. Bellini
import sys, functools
def printer(value):
"""Prints the object representation using the given custom formatter."""
if value is not None:
print(printer.repr(value)) # This attribute has to be set elsewhere
def temp_replace(obj, attr_name, va... | <commit_before><commit_msg>Create the plugin based on PyScanPrev conftest.py<commit_after> | """Py.test doctest custom plugin"""
# By Danilo J. S. Bellini
import sys, functools
def printer(value):
"""Prints the object representation using the given custom formatter."""
if value is not None:
print(printer.repr(value)) # This attribute has to be set elsewhere
def temp_replace(obj, attr_name, va... | Create the plugin based on PyScanPrev conftest.py"""Py.test doctest custom plugin"""
# By Danilo J. S. Bellini
import sys, functools
def printer(value):
"""Prints the object representation using the given custom formatter."""
if value is not None:
print(printer.repr(value)) # This attribute has to be s... | <commit_before><commit_msg>Create the plugin based on PyScanPrev conftest.py<commit_after>"""Py.test doctest custom plugin"""
# By Danilo J. S. Bellini
import sys, functools
def printer(value):
"""Prints the object representation using the given custom formatter."""
if value is not None:
print(printer.... | |
de2496c1cd6ba7c9e59110f6e7efa0d1e01304ba | eval_hand.py | eval_hand.py | from collections import defaultdict
#ranks. Add (rank of cards involved / 13) to these values
#for straights and flushes, (highest card / 13) is added
###########
hand_str_dict = {
'high card': 0,
'pair' = 1,
'two_pair' = 2,
'three_kind' = 3,
'straight' = 4,
'flush' = 5,
'full_house' = 6,
... | Add code for evaluating a hand. Incomplete. | Add code for evaluating a hand. Incomplete.
| Python | mit | jason-rossmaier/poker-player-pokerface | Add code for evaluating a hand. Incomplete. | from collections import defaultdict
#ranks. Add (rank of cards involved / 13) to these values
#for straights and flushes, (highest card / 13) is added
###########
hand_str_dict = {
'high card': 0,
'pair' = 1,
'two_pair' = 2,
'three_kind' = 3,
'straight' = 4,
'flush' = 5,
'full_house' = 6,
... | <commit_before><commit_msg>Add code for evaluating a hand. Incomplete.<commit_after> | from collections import defaultdict
#ranks. Add (rank of cards involved / 13) to these values
#for straights and flushes, (highest card / 13) is added
###########
hand_str_dict = {
'high card': 0,
'pair' = 1,
'two_pair' = 2,
'three_kind' = 3,
'straight' = 4,
'flush' = 5,
'full_house' = 6,
... | Add code for evaluating a hand. Incomplete.from collections import defaultdict
#ranks. Add (rank of cards involved / 13) to these values
#for straights and flushes, (highest card / 13) is added
###########
hand_str_dict = {
'high card': 0,
'pair' = 1,
'two_pair' = 2,
'three_kind' = 3,
'straight' = ... | <commit_before><commit_msg>Add code for evaluating a hand. Incomplete.<commit_after>from collections import defaultdict
#ranks. Add (rank of cards involved / 13) to these values
#for straights and flushes, (highest card / 13) is added
###########
hand_str_dict = {
'high card': 0,
'pair' = 1,
'two_pair' = 2... | |
a3927ac00117c1a9dd6896bc013a7c087cb1edcf | test/test_interaction_model.py | test/test_interaction_model.py | from _ebcf_alexa import interaction_model as im
from _ebcf_alexa.incoming_types import Intent
import pytest
@pytest.fixture
def intent_with_bad_slots():
return Intent({
'name': 'DefaultQuery',
'slots': {
'RelativeTo': {
'name': 'RelativeTo',
'value': 'tod... | Add failing unit test for query_intent to test RequestType reprompt | Add failing unit test for query_intent to test RequestType reprompt
| Python | mit | dmotles/ebcf-alexa | Add failing unit test for query_intent to test RequestType reprompt | from _ebcf_alexa import interaction_model as im
from _ebcf_alexa.incoming_types import Intent
import pytest
@pytest.fixture
def intent_with_bad_slots():
return Intent({
'name': 'DefaultQuery',
'slots': {
'RelativeTo': {
'name': 'RelativeTo',
'value': 'tod... | <commit_before><commit_msg>Add failing unit test for query_intent to test RequestType reprompt<commit_after> | from _ebcf_alexa import interaction_model as im
from _ebcf_alexa.incoming_types import Intent
import pytest
@pytest.fixture
def intent_with_bad_slots():
return Intent({
'name': 'DefaultQuery',
'slots': {
'RelativeTo': {
'name': 'RelativeTo',
'value': 'tod... | Add failing unit test for query_intent to test RequestType repromptfrom _ebcf_alexa import interaction_model as im
from _ebcf_alexa.incoming_types import Intent
import pytest
@pytest.fixture
def intent_with_bad_slots():
return Intent({
'name': 'DefaultQuery',
'slots': {
'RelativeTo': {
... | <commit_before><commit_msg>Add failing unit test for query_intent to test RequestType reprompt<commit_after>from _ebcf_alexa import interaction_model as im
from _ebcf_alexa.incoming_types import Intent
import pytest
@pytest.fixture
def intent_with_bad_slots():
return Intent({
'name': 'DefaultQuery',
... | |
bd37f8c88e1f999160fcec2c4ce4370a8d189d71 | tests/test_request.py | tests/test_request.py | import datetime
from borica import Request
class FakeSignature:
def sign(self, content):
return 'G' * 128
def test_general_request_base64_formatting():
request = Request(
transaction_type=10,
transaction_amount='99.99',
transaction_timestamp=datetime.datetime.fromtimestamp(0)... | Add general base64 formatting test | Add general base64 formatting test
| Python | mit | IOEra/borica | Add general base64 formatting test | import datetime
from borica import Request
class FakeSignature:
def sign(self, content):
return 'G' * 128
def test_general_request_base64_formatting():
request = Request(
transaction_type=10,
transaction_amount='99.99',
transaction_timestamp=datetime.datetime.fromtimestamp(0)... | <commit_before><commit_msg>Add general base64 formatting test<commit_after> | import datetime
from borica import Request
class FakeSignature:
def sign(self, content):
return 'G' * 128
def test_general_request_base64_formatting():
request = Request(
transaction_type=10,
transaction_amount='99.99',
transaction_timestamp=datetime.datetime.fromtimestamp(0)... | Add general base64 formatting testimport datetime
from borica import Request
class FakeSignature:
def sign(self, content):
return 'G' * 128
def test_general_request_base64_formatting():
request = Request(
transaction_type=10,
transaction_amount='99.99',
transaction_timestamp=... | <commit_before><commit_msg>Add general base64 formatting test<commit_after>import datetime
from borica import Request
class FakeSignature:
def sign(self, content):
return 'G' * 128
def test_general_request_base64_formatting():
request = Request(
transaction_type=10,
transaction_amoun... | |
21ddfc1802495f965524b163258c36231d8ee898 | bluebottle/orders/migrations/0005_auto_20171003_1112.py | bluebottle/orders/migrations/0005_auto_20171003_1112.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-10-03 09:12
from __future__ import unicode_literals
import datetime
from django.db import migrations
from bluebottle.utils.utils import FSMTransition, StatusDefinition
def mark_as_failed(apps, schema_editor):
Order = apps.get_model('orders', 'Order')
... | Mark orders older then 5 days that are still 'new' as 'failed'. This fixed rewards that are showed as "claimed", because old order were not failed automatically. | Mark orders older then 5 days that are still 'new' as 'failed'. This
fixed rewards that are showed as "claimed", because old order were not
failed automatically.
BB-10849 #resolve
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | Mark orders older then 5 days that are still 'new' as 'failed'. This
fixed rewards that are showed as "claimed", because old order were not
failed automatically.
BB-10849 #resolve | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-10-03 09:12
from __future__ import unicode_literals
import datetime
from django.db import migrations
from bluebottle.utils.utils import FSMTransition, StatusDefinition
def mark_as_failed(apps, schema_editor):
Order = apps.get_model('orders', 'Order')
... | <commit_before><commit_msg>Mark orders older then 5 days that are still 'new' as 'failed'. This
fixed rewards that are showed as "claimed", because old order were not
failed automatically.
BB-10849 #resolve<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-10-03 09:12
from __future__ import unicode_literals
import datetime
from django.db import migrations
from bluebottle.utils.utils import FSMTransition, StatusDefinition
def mark_as_failed(apps, schema_editor):
Order = apps.get_model('orders', 'Order')
... | Mark orders older then 5 days that are still 'new' as 'failed'. This
fixed rewards that are showed as "claimed", because old order were not
failed automatically.
BB-10849 #resolve# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-10-03 09:12
from __future__ import unicode_literals
import datetime
from djang... | <commit_before><commit_msg>Mark orders older then 5 days that are still 'new' as 'failed'. This
fixed rewards that are showed as "claimed", because old order were not
failed automatically.
BB-10849 #resolve<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-10-03 09:12
from __future__ import uni... | |
6ac87bf5f6b86f507caa7764ed949d5b27d18517 | tools/jinja_pylint.py | tools/jinja_pylint.py | #!/usr/bin/env python
'''
Run pylint on a Jinja 2 template.
'''
import jinja2, os, subprocess, sys, tempfile
# Clagged pieces from the runner.
START_BLOCK = '/*-'
END_BLOCK = '-*/'
START_VARIABLE = '/*?'
END_VARIABLE = '?*/'
START_COMMENT = '/*#'
END_COMMENT = '#*/'
def main(argv, out, err):
if len(argv) < 2 or... | Add a tool for running pylint on Jinja templates. | Add a tool for running pylint on Jinja templates.
Closes JIRA CAMKES-315
| Python | bsd-2-clause | agacek/camkes-tool,agacek/camkes-tool,smaccm/camkes-tool,agacek/camkes-tool,smaccm/camkes-tool,smaccm/camkes-tool,smaccm/camkes-tool | Add a tool for running pylint on Jinja templates.
Closes JIRA CAMKES-315 | #!/usr/bin/env python
'''
Run pylint on a Jinja 2 template.
'''
import jinja2, os, subprocess, sys, tempfile
# Clagged pieces from the runner.
START_BLOCK = '/*-'
END_BLOCK = '-*/'
START_VARIABLE = '/*?'
END_VARIABLE = '?*/'
START_COMMENT = '/*#'
END_COMMENT = '#*/'
def main(argv, out, err):
if len(argv) < 2 or... | <commit_before><commit_msg>Add a tool for running pylint on Jinja templates.
Closes JIRA CAMKES-315<commit_after> | #!/usr/bin/env python
'''
Run pylint on a Jinja 2 template.
'''
import jinja2, os, subprocess, sys, tempfile
# Clagged pieces from the runner.
START_BLOCK = '/*-'
END_BLOCK = '-*/'
START_VARIABLE = '/*?'
END_VARIABLE = '?*/'
START_COMMENT = '/*#'
END_COMMENT = '#*/'
def main(argv, out, err):
if len(argv) < 2 or... | Add a tool for running pylint on Jinja templates.
Closes JIRA CAMKES-315#!/usr/bin/env python
'''
Run pylint on a Jinja 2 template.
'''
import jinja2, os, subprocess, sys, tempfile
# Clagged pieces from the runner.
START_BLOCK = '/*-'
END_BLOCK = '-*/'
START_VARIABLE = '/*?'
END_VARIABLE = '?*/'
START_COMMENT = '/*... | <commit_before><commit_msg>Add a tool for running pylint on Jinja templates.
Closes JIRA CAMKES-315<commit_after>#!/usr/bin/env python
'''
Run pylint on a Jinja 2 template.
'''
import jinja2, os, subprocess, sys, tempfile
# Clagged pieces from the runner.
START_BLOCK = '/*-'
END_BLOCK = '-*/'
START_VARIABLE = '/*?'... | |
289e5856e15d06b15136a9003d7a3754c0a773f8 | utils/import_srweb.py | utils/import_srweb.py | import argparse
import yaml
import sys
import re
parser = argparse.ArgumentParser()
parser.add_argument('source', help='Path to source file',
type=argparse.FileType('r'))
parser.add_argument('-o', '--output', type=argparse.FileType('w'),
default=sys.stdout, help='Outpu... | Add a tool to import Markdown from srweb | Add a tool to import Markdown from srweb
| Python | mit | prophile/srweb-jekyll,prophile/srweb-jekyll,PeterJCLaw/srweb-jekyll,prophile/srweb-jekyll,PeterJCLaw/srweb-jekyll,prophile/srweb-jekyll,PeterJCLaw/srweb-jekyll,prophile/srweb-jekyll,PeterJCLaw/srweb-jekyll,PeterJCLaw/srweb-jekyll,PeterJCLaw/srweb-jekyll,prophile/srweb-jekyll | Add a tool to import Markdown from srweb | import argparse
import yaml
import sys
import re
parser = argparse.ArgumentParser()
parser.add_argument('source', help='Path to source file',
type=argparse.FileType('r'))
parser.add_argument('-o', '--output', type=argparse.FileType('w'),
default=sys.stdout, help='Outpu... | <commit_before><commit_msg>Add a tool to import Markdown from srweb<commit_after> | import argparse
import yaml
import sys
import re
parser = argparse.ArgumentParser()
parser.add_argument('source', help='Path to source file',
type=argparse.FileType('r'))
parser.add_argument('-o', '--output', type=argparse.FileType('w'),
default=sys.stdout, help='Outpu... | Add a tool to import Markdown from srwebimport argparse
import yaml
import sys
import re
parser = argparse.ArgumentParser()
parser.add_argument('source', help='Path to source file',
type=argparse.FileType('r'))
parser.add_argument('-o', '--output', type=argparse.FileType('w'),
... | <commit_before><commit_msg>Add a tool to import Markdown from srweb<commit_after>import argparse
import yaml
import sys
import re
parser = argparse.ArgumentParser()
parser.add_argument('source', help='Path to source file',
type=argparse.FileType('r'))
parser.add_argument('-o', '--output',... | |
0388e7323452f7b2a94ac9593ffce07e35012e09 | tests/aws_disk_integration_test.py | tests/aws_disk_integration_test.py | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | Add AWS disk integration tests | Add AWS disk integration tests
| Python | apache-2.0 | GoogleCloudPlatform/PerfKitBenchmarker,meteorfox/PerfKitBenchmarker,AdamIsrael/PerfKitBenchmarker,mateusz-blaszkowski/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,kivio/PerfKitBenchmarker,syed/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,kivio/PerfKitBenchmarker,AdamIsrael/PerfKitBenchmarker,s... | Add AWS disk integration tests | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | <commit_before><commit_msg>Add AWS disk integration tests<commit_after> | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | Add AWS disk integration tests# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | <commit_before><commit_msg>Add AWS disk integration tests<commit_after># Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | |
bce877c7264a5bfad9de9d64d1871c5a86239d59 | examples/listradio.py | examples/listradio.py | import gobject
import gtk
from kiwi.ui.widgets.list import Column, List
class Object:
def __init__(self, name, value):
self.name, self.value = name, value
columns = [Column('name'),
Column('value', data_type=bool, radio=True, editable=True)]
win = gtk.Window()
win.set_size_request(300, 120)
w... | Test for radio buttons in lists | Test for radio buttons in lists
| Python | lgpl-2.1 | Schevo/kiwi,Schevo/kiwi,Schevo/kiwi | Test for radio buttons in lists | import gobject
import gtk
from kiwi.ui.widgets.list import Column, List
class Object:
def __init__(self, name, value):
self.name, self.value = name, value
columns = [Column('name'),
Column('value', data_type=bool, radio=True, editable=True)]
win = gtk.Window()
win.set_size_request(300, 120)
w... | <commit_before><commit_msg>Test for radio buttons in lists<commit_after> | import gobject
import gtk
from kiwi.ui.widgets.list import Column, List
class Object:
def __init__(self, name, value):
self.name, self.value = name, value
columns = [Column('name'),
Column('value', data_type=bool, radio=True, editable=True)]
win = gtk.Window()
win.set_size_request(300, 120)
w... | Test for radio buttons in listsimport gobject
import gtk
from kiwi.ui.widgets.list import Column, List
class Object:
def __init__(self, name, value):
self.name, self.value = name, value
columns = [Column('name'),
Column('value', data_type=bool, radio=True, editable=True)]
win = gtk.Window()
w... | <commit_before><commit_msg>Test for radio buttons in lists<commit_after>import gobject
import gtk
from kiwi.ui.widgets.list import Column, List
class Object:
def __init__(self, name, value):
self.name, self.value = name, value
columns = [Column('name'),
Column('value', data_type=bool, radio=Tr... | |
98b7c4444b80abb4cf63cbe389df80b938b6c1fd | examples/proxy_rax.py | examples/proxy_rax.py | import random
import sc2
from sc2 import Race, Difficulty, ActionResult
from sc2.constants import *
from sc2.player import Bot, Computer
class ProxyRaxBot(sc2.BotAI):
async def on_step(self, state, iteration):
cc = self.units(COMMANDCENTER)
if not cc.exists:
target = self.known_enemy_s... | Add proxy rax example for terran | Add proxy rax example for terran
| Python | mit | Dentosal/python-sc2 | Add proxy rax example for terran | import random
import sc2
from sc2 import Race, Difficulty, ActionResult
from sc2.constants import *
from sc2.player import Bot, Computer
class ProxyRaxBot(sc2.BotAI):
async def on_step(self, state, iteration):
cc = self.units(COMMANDCENTER)
if not cc.exists:
target = self.known_enemy_s... | <commit_before><commit_msg>Add proxy rax example for terran<commit_after> | import random
import sc2
from sc2 import Race, Difficulty, ActionResult
from sc2.constants import *
from sc2.player import Bot, Computer
class ProxyRaxBot(sc2.BotAI):
async def on_step(self, state, iteration):
cc = self.units(COMMANDCENTER)
if not cc.exists:
target = self.known_enemy_s... | Add proxy rax example for terranimport random
import sc2
from sc2 import Race, Difficulty, ActionResult
from sc2.constants import *
from sc2.player import Bot, Computer
class ProxyRaxBot(sc2.BotAI):
async def on_step(self, state, iteration):
cc = self.units(COMMANDCENTER)
if not cc.exists:
... | <commit_before><commit_msg>Add proxy rax example for terran<commit_after>import random
import sc2
from sc2 import Race, Difficulty, ActionResult
from sc2.constants import *
from sc2.player import Bot, Computer
class ProxyRaxBot(sc2.BotAI):
async def on_step(self, state, iteration):
cc = self.units(COMMAND... | |
eaff4daa02a22a8d1dc233dd96a0848df195e6ea | setup.py | setup.py | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-onmydesk',
v... | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-onmydesk',
v... | Improve classifiers, version and url | Improve classifiers, version and url
| Python | mit | knowledge4life/django-onmydesk,knowledge4life/django-onmydesk,alissonperez/django-onmydesk,knowledge4life/django-onmydesk,alissonperez/django-onmydesk,alissonperez/django-onmydesk | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-onmydesk',
v... | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-onmydesk',
v... | <commit_before>import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-o... | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-onmydesk',
v... | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-onmydesk',
v... | <commit_before>import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-o... |
3481f958cb396be11a565bbb0213dc2d973d25b1 | ceph_deploy/tests/parser/test_install.py | ceph_deploy/tests/parser/test_install.py | import pytest
from ceph_deploy.cli import get_parser
class TestParserInstall(object):
def setup(self):
self.parser = get_parser()
def test_install_help(self, capsys):
with pytest.raises(SystemExit):
self.parser.parse_args('install --help'.split())
out, err = capsys.reado... | Add initial argparse tests for install | [RM-11742] Add initial argparse tests for install
Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com>
| Python | mit | Vicente-Cheng/ceph-deploy,trhoden/ceph-deploy,imzhulei/ceph-deploy,osynge/ceph-deploy,SUSE/ceph-deploy,codenrhoden/ceph-deploy,zhouyuan/ceph-deploy,branto1/ceph-deploy,osynge/ceph-deploy,ceph/ceph-deploy,isyippee/ceph-deploy,SUSE/ceph-deploy,isyippee/ceph-deploy,SUSE/ceph-deploy-to-be-deleted,SUSE/ceph-deploy-to-be-del... | [RM-11742] Add initial argparse tests for install
Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com> | import pytest
from ceph_deploy.cli import get_parser
class TestParserInstall(object):
def setup(self):
self.parser = get_parser()
def test_install_help(self, capsys):
with pytest.raises(SystemExit):
self.parser.parse_args('install --help'.split())
out, err = capsys.reado... | <commit_before><commit_msg>[RM-11742] Add initial argparse tests for install
Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com><commit_after> | import pytest
from ceph_deploy.cli import get_parser
class TestParserInstall(object):
def setup(self):
self.parser = get_parser()
def test_install_help(self, capsys):
with pytest.raises(SystemExit):
self.parser.parse_args('install --help'.split())
out, err = capsys.reado... | [RM-11742] Add initial argparse tests for install
Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com>import pytest
from ceph_deploy.cli import get_parser
class TestParserInstall(object):
def setup(self):
self.parser = get_parser()
def test_install_help(self, capsys):... | <commit_before><commit_msg>[RM-11742] Add initial argparse tests for install
Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com><commit_after>import pytest
from ceph_deploy.cli import get_parser
class TestParserInstall(object):
def setup(self):
self.parser = get_parser()
... | |
05dbf3473d320934ff306b673af7b72abc572375 | scripts/list-packages.py | scripts/list-packages.py | #!/usr/bin/env python3
"""
Lists R packages in one docker image but not the other
"""
import docker
import argparse
import json
from urllib.request import urlopen
from urllib.error import HTTPError
argparser = argparse.ArgumentParser()
argparser.add_argument(
'src_image',
)
argparser.add_argument(
'dest_image... | Add script to diff installed R packages | Add script to diff installed R packages
Used to check if all the R packages in the current
R hub image are present in the new R hub image.
| Python | bsd-3-clause | ryanlovett/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,berkeley-dsep-infra/datahub | Add script to diff installed R packages
Used to check if all the R packages in the current
R hub image are present in the new R hub image. | #!/usr/bin/env python3
"""
Lists R packages in one docker image but not the other
"""
import docker
import argparse
import json
from urllib.request import urlopen
from urllib.error import HTTPError
argparser = argparse.ArgumentParser()
argparser.add_argument(
'src_image',
)
argparser.add_argument(
'dest_image... | <commit_before><commit_msg>Add script to diff installed R packages
Used to check if all the R packages in the current
R hub image are present in the new R hub image.<commit_after> | #!/usr/bin/env python3
"""
Lists R packages in one docker image but not the other
"""
import docker
import argparse
import json
from urllib.request import urlopen
from urllib.error import HTTPError
argparser = argparse.ArgumentParser()
argparser.add_argument(
'src_image',
)
argparser.add_argument(
'dest_image... | Add script to diff installed R packages
Used to check if all the R packages in the current
R hub image are present in the new R hub image.#!/usr/bin/env python3
"""
Lists R packages in one docker image but not the other
"""
import docker
import argparse
import json
from urllib.request import urlopen
from urllib.error ... | <commit_before><commit_msg>Add script to diff installed R packages
Used to check if all the R packages in the current
R hub image are present in the new R hub image.<commit_after>#!/usr/bin/env python3
"""
Lists R packages in one docker image but not the other
"""
import docker
import argparse
import json
from urllib.... | |
8073f768c37129860def05797e6152de01e44267 | scripts/remove-all-annotations.py | scripts/remove-all-annotations.py | #!/usr/bin/python
# This is a small helper script to remove all annotations from a
# project.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
import sys
import psycopg2
import os
from common import db_connection, conf
if len(sys.argv) != 1:
print >> sys.stderr, "Usage:", ... | Add a brutal (but fast) script for clearing *all* annotations from all projects | Add a brutal (but fast) script for clearing *all* annotations from all projects
| Python | agpl-3.0 | htem/CATMAID,htem/CATMAID,fzadow/CATMAID,fzadow/CATMAID,htem/CATMAID,fzadow/CATMAID,fzadow/CATMAID,htem/CATMAID | Add a brutal (but fast) script for clearing *all* annotations from all projects | #!/usr/bin/python
# This is a small helper script to remove all annotations from a
# project.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
import sys
import psycopg2
import os
from common import db_connection, conf
if len(sys.argv) != 1:
print >> sys.stderr, "Usage:", ... | <commit_before><commit_msg>Add a brutal (but fast) script for clearing *all* annotations from all projects<commit_after> | #!/usr/bin/python
# This is a small helper script to remove all annotations from a
# project.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
import sys
import psycopg2
import os
from common import db_connection, conf
if len(sys.argv) != 1:
print >> sys.stderr, "Usage:", ... | Add a brutal (but fast) script for clearing *all* annotations from all projects#!/usr/bin/python
# This is a small helper script to remove all annotations from a
# project.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
import sys
import psycopg2
import os
from common import ... | <commit_before><commit_msg>Add a brutal (but fast) script for clearing *all* annotations from all projects<commit_after>#!/usr/bin/python
# This is a small helper script to remove all annotations from a
# project.
# You may need to install psycopg2, e.g. with:
# sudo apt-get install python-psycopg2
import sys
impo... | |
3f543f9e3a328441ae477ca3fb299fbc86ffc40f | oneflow/base/tasks.py | oneflow/base/tasks.py | # -*- coding: utf-8 -*-
import logging
#import datetime
from celery import task
from django.contrib.auth import get_user_model
LOGGER = logging.getLogger(__name__)
User = get_user_model()
#ftstamp = datetime.datetime.fromtimestamp
#now = datetime.datetime.now
@task
def celery_beat_test():
LOGGER.info(u... | # -*- coding: utf-8 -*-
import logging
#import datetime
from celery import task
from django.contrib.auth import get_user_model
LOGGER = logging.getLogger(__name__)
User = get_user_model()
#ftstamp = datetime.datetime.fromtimestamp
#now = datetime.datetime.now
@task
def celery_beat_test():
LOGGER.info(u... | Fix for missing username and clear the social_auth to force re-authentication at next login. | Fix for missing username and clear the social_auth to force re-authentication at next login. | Python | agpl-3.0 | WillianPaiva/1flow,WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow,1flow/1flow,1flow/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow,1flow/1flow | # -*- coding: utf-8 -*-
import logging
#import datetime
from celery import task
from django.contrib.auth import get_user_model
LOGGER = logging.getLogger(__name__)
User = get_user_model()
#ftstamp = datetime.datetime.fromtimestamp
#now = datetime.datetime.now
@task
def celery_beat_test():
LOGGER.info(u... | # -*- coding: utf-8 -*-
import logging
#import datetime
from celery import task
from django.contrib.auth import get_user_model
LOGGER = logging.getLogger(__name__)
User = get_user_model()
#ftstamp = datetime.datetime.fromtimestamp
#now = datetime.datetime.now
@task
def celery_beat_test():
LOGGER.info(u... | <commit_before># -*- coding: utf-8 -*-
import logging
#import datetime
from celery import task
from django.contrib.auth import get_user_model
LOGGER = logging.getLogger(__name__)
User = get_user_model()
#ftstamp = datetime.datetime.fromtimestamp
#now = datetime.datetime.now
@task
def celery_beat_test():
... | # -*- coding: utf-8 -*-
import logging
#import datetime
from celery import task
from django.contrib.auth import get_user_model
LOGGER = logging.getLogger(__name__)
User = get_user_model()
#ftstamp = datetime.datetime.fromtimestamp
#now = datetime.datetime.now
@task
def celery_beat_test():
LOGGER.info(u... | # -*- coding: utf-8 -*-
import logging
#import datetime
from celery import task
from django.contrib.auth import get_user_model
LOGGER = logging.getLogger(__name__)
User = get_user_model()
#ftstamp = datetime.datetime.fromtimestamp
#now = datetime.datetime.now
@task
def celery_beat_test():
LOGGER.info(u... | <commit_before># -*- coding: utf-8 -*-
import logging
#import datetime
from celery import task
from django.contrib.auth import get_user_model
LOGGER = logging.getLogger(__name__)
User = get_user_model()
#ftstamp = datetime.datetime.fromtimestamp
#now = datetime.datetime.now
@task
def celery_beat_test():
... |
979101349fc35efaba5f23ecf2e8a09af0f52a7b | runtests.py | runtests.py | # runtests for django reusable apps
# see http://stackoverflow.com/questions/3841725/how-to-launch-tests-for-django-reusable-app
import glob
import os
import sys
import django
from django.conf import settings
from django.core.management import execute_from_command_line
BASE_DIR = os.path.abspath(os.path.dirname(__fi... | Add settings file for launching tests | Add settings file for launching tests
| Python | bsd-3-clause | amrael/django-dynamodb2-sessions | Add settings file for launching tests | # runtests for django reusable apps
# see http://stackoverflow.com/questions/3841725/how-to-launch-tests-for-django-reusable-app
import glob
import os
import sys
import django
from django.conf import settings
from django.core.management import execute_from_command_line
BASE_DIR = os.path.abspath(os.path.dirname(__fi... | <commit_before><commit_msg>Add settings file for launching tests<commit_after> | # runtests for django reusable apps
# see http://stackoverflow.com/questions/3841725/how-to-launch-tests-for-django-reusable-app
import glob
import os
import sys
import django
from django.conf import settings
from django.core.management import execute_from_command_line
BASE_DIR = os.path.abspath(os.path.dirname(__fi... | Add settings file for launching tests# runtests for django reusable apps
# see http://stackoverflow.com/questions/3841725/how-to-launch-tests-for-django-reusable-app
import glob
import os
import sys
import django
from django.conf import settings
from django.core.management import execute_from_command_line
BASE_DIR =... | <commit_before><commit_msg>Add settings file for launching tests<commit_after># runtests for django reusable apps
# see http://stackoverflow.com/questions/3841725/how-to-launch-tests-for-django-reusable-app
import glob
import os
import sys
import django
from django.conf import settings
from django.core.management imp... | |
ee621978cf6a218f71046afb0c1afeb9dd738677 | doc/book/book-dist.py | doc/book/book-dist.py | #!/usr/bin/env python2
import sys
import os
import shutil
def die(msg):
sys.stderr.write('ERROR: ' + msg)
sys.exit(1)
cwd = os.getcwd()
if not os.path.exists('book') \
or not os.path.exists('Makefile'):
die('Please run this from the Subversion book source directory\n')
if not os.getenv('JAVA_HOME'):
die(... | Add a little package-em-up script for the Subversion book. | Add a little package-em-up script for the Subversion book.
| Python | apache-2.0 | jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion | Add a little package-em-up script for the Subversion book. | #!/usr/bin/env python2
import sys
import os
import shutil
def die(msg):
sys.stderr.write('ERROR: ' + msg)
sys.exit(1)
cwd = os.getcwd()
if not os.path.exists('book') \
or not os.path.exists('Makefile'):
die('Please run this from the Subversion book source directory\n')
if not os.getenv('JAVA_HOME'):
die(... | <commit_before><commit_msg>Add a little package-em-up script for the Subversion book.<commit_after> | #!/usr/bin/env python2
import sys
import os
import shutil
def die(msg):
sys.stderr.write('ERROR: ' + msg)
sys.exit(1)
cwd = os.getcwd()
if not os.path.exists('book') \
or not os.path.exists('Makefile'):
die('Please run this from the Subversion book source directory\n')
if not os.getenv('JAVA_HOME'):
die(... | Add a little package-em-up script for the Subversion book.#!/usr/bin/env python2
import sys
import os
import shutil
def die(msg):
sys.stderr.write('ERROR: ' + msg)
sys.exit(1)
cwd = os.getcwd()
if not os.path.exists('book') \
or not os.path.exists('Makefile'):
die('Please run this from the Subversion book s... | <commit_before><commit_msg>Add a little package-em-up script for the Subversion book.<commit_after>#!/usr/bin/env python2
import sys
import os
import shutil
def die(msg):
sys.stderr.write('ERROR: ' + msg)
sys.exit(1)
cwd = os.getcwd()
if not os.path.exists('book') \
or not os.path.exists('Makefile'):
die('P... | |
487c9fdd87c7435087d4b7260146d2f6f470ae7e | Main.py | Main.py | #!/usr/bin/python
#Geoff Spielman
#April 22, 2016
import sys
import time
import serial
ser = serial.Serial('/dev/ttyACM0', 9600)
#stings and ints for storing left and right motor power
mLint = 0
mRint = 0
mL = ''
mR = ''
#prepare for stop
Stp = '0,0!'
BAS=bytearray()
BAS.extend(map(ord, Stp))
def IsAnInt(recString):
... | Move python code to Pi | Move python code to Pi
Not complete, just moving to Pi
| Python | mit | GeoffSpielman/SimonSays,GeoffSpielman/SimonSays,GeoffSpielman/SimonSays,GeoffSpielman/SimonSays | Move python code to Pi
Not complete, just moving to Pi | #!/usr/bin/python
#Geoff Spielman
#April 22, 2016
import sys
import time
import serial
ser = serial.Serial('/dev/ttyACM0', 9600)
#stings and ints for storing left and right motor power
mLint = 0
mRint = 0
mL = ''
mR = ''
#prepare for stop
Stp = '0,0!'
BAS=bytearray()
BAS.extend(map(ord, Stp))
def IsAnInt(recString):
... | <commit_before><commit_msg>Move python code to Pi
Not complete, just moving to Pi<commit_after> | #!/usr/bin/python
#Geoff Spielman
#April 22, 2016
import sys
import time
import serial
ser = serial.Serial('/dev/ttyACM0', 9600)
#stings and ints for storing left and right motor power
mLint = 0
mRint = 0
mL = ''
mR = ''
#prepare for stop
Stp = '0,0!'
BAS=bytearray()
BAS.extend(map(ord, Stp))
def IsAnInt(recString):
... | Move python code to Pi
Not complete, just moving to Pi#!/usr/bin/python
#Geoff Spielman
#April 22, 2016
import sys
import time
import serial
ser = serial.Serial('/dev/ttyACM0', 9600)
#stings and ints for storing left and right motor power
mLint = 0
mRint = 0
mL = ''
mR = ''
#prepare for stop
Stp = '0,0!'
BAS=bytearra... | <commit_before><commit_msg>Move python code to Pi
Not complete, just moving to Pi<commit_after>#!/usr/bin/python
#Geoff Spielman
#April 22, 2016
import sys
import time
import serial
ser = serial.Serial('/dev/ttyACM0', 9600)
#stings and ints for storing left and right motor power
mLint = 0
mRint = 0
mL = ''
mR = ''
#p... | |
89363fb720d259b60f9ec6d9872f59db1a28e14c | examples/Gauss_example.py | examples/Gauss_example.py | import sys
import time
import numpy as np
from abcpy.core import *
from abcpy.distributions import *
from distributed import Client
from dask.dot import dot_graph
from functools import partial
import matplotlib
import matplotlib.pyplot as plt
def normal_simu(n, mu, prng=None, latents=None):
if latents is None:
... | Add script variant of the Gauss example | Add script variant of the Gauss example
| Python | bsd-3-clause | lintusj1/elfi,elfi-dev/elfi,elfi-dev/elfi,HIIT/elfi,lintusj1/elfi | Add script variant of the Gauss example | import sys
import time
import numpy as np
from abcpy.core import *
from abcpy.distributions import *
from distributed import Client
from dask.dot import dot_graph
from functools import partial
import matplotlib
import matplotlib.pyplot as plt
def normal_simu(n, mu, prng=None, latents=None):
if latents is None:
... | <commit_before><commit_msg>Add script variant of the Gauss example<commit_after> | import sys
import time
import numpy as np
from abcpy.core import *
from abcpy.distributions import *
from distributed import Client
from dask.dot import dot_graph
from functools import partial
import matplotlib
import matplotlib.pyplot as plt
def normal_simu(n, mu, prng=None, latents=None):
if latents is None:
... | Add script variant of the Gauss exampleimport sys
import time
import numpy as np
from abcpy.core import *
from abcpy.distributions import *
from distributed import Client
from dask.dot import dot_graph
from functools import partial
import matplotlib
import matplotlib.pyplot as plt
def normal_simu(n, mu, prng=None, la... | <commit_before><commit_msg>Add script variant of the Gauss example<commit_after>import sys
import time
import numpy as np
from abcpy.core import *
from abcpy.distributions import *
from distributed import Client
from dask.dot import dot_graph
from functools import partial
import matplotlib
import matplotlib.pyplot as ... | |
a738a4b5a9d5dbb56b79ca85ce325e8bfcd4a0cf | genjsonfiletree.py | genjsonfiletree.py | #!/usr/bin/env python
"""Scans a directory tree for .js files and builds a JSON representation.
Scans a directory tree for .js files, and puts the contents into a single JSON
object map of path to content.
Ouput is written to stdout.
Usage:
$ genjsonfiletree.py
Scans the current directory.
$ genjsonfiletree.py ... | Add a script that scans a directory tree for .js files, reads them, and builds an map -- path from root to file contents. This is outputted as a JSON string to standard out. | Add a script that scans a directory tree for .js files, reads them,
and builds an map -- path from root to file contents.
This is outputted as a JSON string to standard out.
| Python | apache-2.0 | Prachigarg1/Prachi,Prachigarg1/Prachi,nanaze/jsdoctor,nanaze/jsdoctor,Prachigarg1/Prachi,nanaze/jsdoctor | Add a script that scans a directory tree for .js files, reads them,
and builds an map -- path from root to file contents.
This is outputted as a JSON string to standard out. | #!/usr/bin/env python
"""Scans a directory tree for .js files and builds a JSON representation.
Scans a directory tree for .js files, and puts the contents into a single JSON
object map of path to content.
Ouput is written to stdout.
Usage:
$ genjsonfiletree.py
Scans the current directory.
$ genjsonfiletree.py ... | <commit_before><commit_msg>Add a script that scans a directory tree for .js files, reads them,
and builds an map -- path from root to file contents.
This is outputted as a JSON string to standard out.<commit_after> | #!/usr/bin/env python
"""Scans a directory tree for .js files and builds a JSON representation.
Scans a directory tree for .js files, and puts the contents into a single JSON
object map of path to content.
Ouput is written to stdout.
Usage:
$ genjsonfiletree.py
Scans the current directory.
$ genjsonfiletree.py ... | Add a script that scans a directory tree for .js files, reads them,
and builds an map -- path from root to file contents.
This is outputted as a JSON string to standard out.#!/usr/bin/env python
"""Scans a directory tree for .js files and builds a JSON representation.
Scans a directory tree for .js files, and puts th... | <commit_before><commit_msg>Add a script that scans a directory tree for .js files, reads them,
and builds an map -- path from root to file contents.
This is outputted as a JSON string to standard out.<commit_after>#!/usr/bin/env python
"""Scans a directory tree for .js files and builds a JSON representation.
Scans a ... | |
58501ff914c34b2cc81ac99e6fdf384c8b677608 | molly/apps/transport/importers/naptan.py | molly/apps/transport/importers/naptan.py | import httplib
from tempfile import TemporaryFile
from zipfile import ZipFile
from tch.parsers.naptan import NaptanParser
class NaptanImporter(object):
HTTP_HOST = "www.dft.gov.uk"
REMOTE_PATH = "/NaPTAN/snapshot/NaPTANxml.zip"
def __init__(self, stop_service):
self._http_connection = httplib.HTT... | Add importer wrapper for NaPTAN | Add importer wrapper for NaPTAN
| Python | apache-2.0 | ManchesterIO/mollyproject-next,ManchesterIO/mollyproject-next,ManchesterIO/mollyproject-next | Add importer wrapper for NaPTAN | import httplib
from tempfile import TemporaryFile
from zipfile import ZipFile
from tch.parsers.naptan import NaptanParser
class NaptanImporter(object):
HTTP_HOST = "www.dft.gov.uk"
REMOTE_PATH = "/NaPTAN/snapshot/NaPTANxml.zip"
def __init__(self, stop_service):
self._http_connection = httplib.HTT... | <commit_before><commit_msg>Add importer wrapper for NaPTAN<commit_after> | import httplib
from tempfile import TemporaryFile
from zipfile import ZipFile
from tch.parsers.naptan import NaptanParser
class NaptanImporter(object):
HTTP_HOST = "www.dft.gov.uk"
REMOTE_PATH = "/NaPTAN/snapshot/NaPTANxml.zip"
def __init__(self, stop_service):
self._http_connection = httplib.HTT... | Add importer wrapper for NaPTANimport httplib
from tempfile import TemporaryFile
from zipfile import ZipFile
from tch.parsers.naptan import NaptanParser
class NaptanImporter(object):
HTTP_HOST = "www.dft.gov.uk"
REMOTE_PATH = "/NaPTAN/snapshot/NaPTANxml.zip"
def __init__(self, stop_service):
self... | <commit_before><commit_msg>Add importer wrapper for NaPTAN<commit_after>import httplib
from tempfile import TemporaryFile
from zipfile import ZipFile
from tch.parsers.naptan import NaptanParser
class NaptanImporter(object):
HTTP_HOST = "www.dft.gov.uk"
REMOTE_PATH = "/NaPTAN/snapshot/NaPTANxml.zip"
def _... | |
3ce6f9d4e1cdd282ba6747aab80c18d2e9106168 | greenfan/management/commands/turn-off-non-build-nodes.py | greenfan/management/commands/turn-off-non-build-nodes.py | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | Add script to turn off all non-build nodes | Add script to turn off all non-build nodes
| Python | apache-2.0 | sorenh/python-django-greenfan,sorenh/python-django-greenfan | Add script to turn off all non-build nodes | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | <commit_before><commit_msg>Add script to turn off all non-build nodes<commit_after> | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | Add script to turn off all non-build nodes#
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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
#
# ... | <commit_before><commit_msg>Add script to turn off all non-build nodes<commit_after>#
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You m... | |
3220af50dd6c4642ac668b2c6dc89e9d76d0e732 | apps/submission/tests/test_flows.py | apps/submission/tests/test_flows.py | from unittest import mock
from django.test import TestCase
from viewflow import lock
from viewflow.activation import STATUS
from viewflow.base import this
from ..flows import AsyncActivationHandler, AsyncHandler
class ProcessStub(object):
_default_manager = mock.Mock()
def __init__(self, flow_class=None):
... | Add tests for the AsyncActivationHandler | [draft] Add tests for the AsyncActivationHandler
| Python | bsd-3-clause | Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel | [draft] Add tests for the AsyncActivationHandler | from unittest import mock
from django.test import TestCase
from viewflow import lock
from viewflow.activation import STATUS
from viewflow.base import this
from ..flows import AsyncActivationHandler, AsyncHandler
class ProcessStub(object):
_default_manager = mock.Mock()
def __init__(self, flow_class=None):
... | <commit_before><commit_msg>[draft] Add tests for the AsyncActivationHandler<commit_after> | from unittest import mock
from django.test import TestCase
from viewflow import lock
from viewflow.activation import STATUS
from viewflow.base import this
from ..flows import AsyncActivationHandler, AsyncHandler
class ProcessStub(object):
_default_manager = mock.Mock()
def __init__(self, flow_class=None):
... | [draft] Add tests for the AsyncActivationHandlerfrom unittest import mock
from django.test import TestCase
from viewflow import lock
from viewflow.activation import STATUS
from viewflow.base import this
from ..flows import AsyncActivationHandler, AsyncHandler
class ProcessStub(object):
_default_manager = mock.M... | <commit_before><commit_msg>[draft] Add tests for the AsyncActivationHandler<commit_after>from unittest import mock
from django.test import TestCase
from viewflow import lock
from viewflow.activation import STATUS
from viewflow.base import this
from ..flows import AsyncActivationHandler, AsyncHandler
class ProcessSt... | |
0efa0da2313ae4fffca1a17e820262185d60a402 | nova/db/sqlalchemy/migrate_repo/versions/103_instance_indexes.py | nova/db/sqlalchemy/migrate_repo/versions/103_instance_indexes.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# Copyright 2012 Michael Still and Canonical Inc
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of ... | Add indexes to new instance_uuid columns. | Add indexes to new instance_uuid columns.
Resolves bug 1009738 as well as several other bugs that haven't been
reported yet.
Change-Id: I09b456df70aaaba1bc4ac00514e63bda804d7f92
| Python | apache-2.0 | angdraug/nova,usc-isi/nova,belmiromoreira/nova,ewindisch/nova,maelnor/nova,thomasem/nova,gooddata/openstack-nova,akash1808/nova,akash1808/nova,Stavitsky/nova,rrader/nova-docker-plugin,bclau/nova,JianyuWang/nova,openstack/nova,sebrandon1/nova,CEG-FYP-OpenStack/scheduler,OpenAcademy-OpenStack/nova-scheduler,projectcalico... | Add indexes to new instance_uuid columns.
Resolves bug 1009738 as well as several other bugs that haven't been
reported yet.
Change-Id: I09b456df70aaaba1bc4ac00514e63bda804d7f92 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# Copyright 2012 Michael Still and Canonical Inc
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of ... | <commit_before><commit_msg>Add indexes to new instance_uuid columns.
Resolves bug 1009738 as well as several other bugs that haven't been
reported yet.
Change-Id: I09b456df70aaaba1bc4ac00514e63bda804d7f92<commit_after> | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# Copyright 2012 Michael Still and Canonical Inc
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of ... | Add indexes to new instance_uuid columns.
Resolves bug 1009738 as well as several other bugs that haven't been
reported yet.
Change-Id: I09b456df70aaaba1bc4ac00514e63bda804d7f92# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# Copyright 2012 Michael Still and Canonical Inc
# All Rights Re... | <commit_before><commit_msg>Add indexes to new instance_uuid columns.
Resolves bug 1009738 as well as several other bugs that haven't been
reported yet.
Change-Id: I09b456df70aaaba1bc4ac00514e63bda804d7f92<commit_after># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# Copyright 2012 Michae... | |
5dddba694e3bd06afbd7d68c1d8e895b8b6b947f | examples/LineAnimator_examples.py | examples/LineAnimator_examples.py | """
=============
LineAnimator
=============
This example shows off some ways in which you can use the
LineAnimator object to animate line plots.
"""
import numpy as np
import matplotlib.pyplot as plt
from sunpy.visualization.imageanimator import LineAnimator
# Example 1: Animate a 2D cube of random data as a line p... | Add LineAnimator example with variable x-axis values. | Add LineAnimator example with variable x-axis values.
| Python | bsd-2-clause | dpshelio/sunpy,dpshelio/sunpy,dpshelio/sunpy | Add LineAnimator example with variable x-axis values. | """
=============
LineAnimator
=============
This example shows off some ways in which you can use the
LineAnimator object to animate line plots.
"""
import numpy as np
import matplotlib.pyplot as plt
from sunpy.visualization.imageanimator import LineAnimator
# Example 1: Animate a 2D cube of random data as a line p... | <commit_before><commit_msg>Add LineAnimator example with variable x-axis values.<commit_after> | """
=============
LineAnimator
=============
This example shows off some ways in which you can use the
LineAnimator object to animate line plots.
"""
import numpy as np
import matplotlib.pyplot as plt
from sunpy.visualization.imageanimator import LineAnimator
# Example 1: Animate a 2D cube of random data as a line p... | Add LineAnimator example with variable x-axis values."""
=============
LineAnimator
=============
This example shows off some ways in which you can use the
LineAnimator object to animate line plots.
"""
import numpy as np
import matplotlib.pyplot as plt
from sunpy.visualization.imageanimator import LineAnimator
# Ex... | <commit_before><commit_msg>Add LineAnimator example with variable x-axis values.<commit_after>"""
=============
LineAnimator
=============
This example shows off some ways in which you can use the
LineAnimator object to animate line plots.
"""
import numpy as np
import matplotlib.pyplot as plt
from sunpy.visualizatio... | |
ddb8d2f3078af9ded041b9eaacdfd3b8d69099bc | resolwe/flow/migrations/0025_entity_type.py | resolwe/flow/migrations/0025_entity_type.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-11-07 08:44
from __future__ import unicode_literals
from django.db import migrations
def populate_entity_type(apps, schema_editor):
"""Populate entity type from attached descriptor schema."""
Entity = apps.get_model('flow', 'Entity')
for enti... | Add migration to populate Entity type | Add migration to populate Entity type
| Python | apache-2.0 | jberci/resolwe,genialis/resolwe,jberci/resolwe,genialis/resolwe | Add migration to populate Entity type | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-11-07 08:44
from __future__ import unicode_literals
from django.db import migrations
def populate_entity_type(apps, schema_editor):
"""Populate entity type from attached descriptor schema."""
Entity = apps.get_model('flow', 'Entity')
for enti... | <commit_before><commit_msg>Add migration to populate Entity type<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-11-07 08:44
from __future__ import unicode_literals
from django.db import migrations
def populate_entity_type(apps, schema_editor):
"""Populate entity type from attached descriptor schema."""
Entity = apps.get_model('flow', 'Entity')
for enti... | Add migration to populate Entity type# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-11-07 08:44
from __future__ import unicode_literals
from django.db import migrations
def populate_entity_type(apps, schema_editor):
"""Populate entity type from attached descriptor schema."""
Entity = apps.get_... | <commit_before><commit_msg>Add migration to populate Entity type<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-11-07 08:44
from __future__ import unicode_literals
from django.db import migrations
def populate_entity_type(apps, schema_editor):
"""Populate entity type from attached des... | |
69d80b136a1d3d3e59bfc9a1a156e9a555e6682e | renderchan/contrib/ffmpeg.py | renderchan/contrib/ffmpeg.py |
__author__ = 'Konstantin Dmitriev'
from renderchan.module import RenderChanModule
from renderchan.utils import which
import subprocess
import os
import random
class RenderChanFfmpegModule(RenderChanModule):
def __init__(self):
RenderChanModule.__init__(self)
if os.name == 'nt':
self.... | Add FFmpeg module for converting video files into image sequences | Add FFmpeg module for converting video files into image sequences
| Python | bsd-3-clause | morevnaproject/RenderChan,scribblemaniac/RenderChan,morevnaproject/RenderChan,scribblemaniac/RenderChan | Add FFmpeg module for converting video files into image sequences |
__author__ = 'Konstantin Dmitriev'
from renderchan.module import RenderChanModule
from renderchan.utils import which
import subprocess
import os
import random
class RenderChanFfmpegModule(RenderChanModule):
def __init__(self):
RenderChanModule.__init__(self)
if os.name == 'nt':
self.... | <commit_before><commit_msg>Add FFmpeg module for converting video files into image sequences<commit_after> |
__author__ = 'Konstantin Dmitriev'
from renderchan.module import RenderChanModule
from renderchan.utils import which
import subprocess
import os
import random
class RenderChanFfmpegModule(RenderChanModule):
def __init__(self):
RenderChanModule.__init__(self)
if os.name == 'nt':
self.... | Add FFmpeg module for converting video files into image sequences
__author__ = 'Konstantin Dmitriev'
from renderchan.module import RenderChanModule
from renderchan.utils import which
import subprocess
import os
import random
class RenderChanFfmpegModule(RenderChanModule):
def __init__(self):
RenderChanMo... | <commit_before><commit_msg>Add FFmpeg module for converting video files into image sequences<commit_after>
__author__ = 'Konstantin Dmitriev'
from renderchan.module import RenderChanModule
from renderchan.utils import which
import subprocess
import os
import random
class RenderChanFfmpegModule(RenderChanModule):
... | |
04d2998215b94c7f857a96ba40cb479209677b09 | udemy-dl.py | udemy-dl.py | #!/usr/bin/python
print('''udemy-dl can now be installed using pip
pip install udemy-dl
If you are looking for the old script, it is now located here:
src/udemy_dl/udemy_dl.py
''')
| Add a helpful message for people looking for old script | Add a helpful message for people looking for old script
| Python | unlicense | rinodung/udemy-dl | Add a helpful message for people looking for old script | #!/usr/bin/python
print('''udemy-dl can now be installed using pip
pip install udemy-dl
If you are looking for the old script, it is now located here:
src/udemy_dl/udemy_dl.py
''')
| <commit_before><commit_msg>Add a helpful message for people looking for old script<commit_after> | #!/usr/bin/python
print('''udemy-dl can now be installed using pip
pip install udemy-dl
If you are looking for the old script, it is now located here:
src/udemy_dl/udemy_dl.py
''')
| Add a helpful message for people looking for old script#!/usr/bin/python
print('''udemy-dl can now be installed using pip
pip install udemy-dl
If you are looking for the old script, it is now located here:
src/udemy_dl/udemy_dl.py
''')
| <commit_before><commit_msg>Add a helpful message for people looking for old script<commit_after>#!/usr/bin/python
print('''udemy-dl can now be installed using pip
pip install udemy-dl
If you are looking for the old script, it is now located here:
src/udemy_dl/udemy_dl.py
''')
| |
1d39f6bdbd27ba2d655dd74f62de46fe96628671 | test_multiply.py | test_multiply.py | import multiply as mp
def test_multiply():
"""
Tests that the multiply function works
"""
assert mp.multiply(5,5) == 25
assert mp.multiply(3,0) == 0
| Test for the multiply.py function | Test for the multiply.py function
| Python | mit | ericmjl/github-tutorial | Test for the multiply.py function | import multiply as mp
def test_multiply():
"""
Tests that the multiply function works
"""
assert mp.multiply(5,5) == 25
assert mp.multiply(3,0) == 0
| <commit_before><commit_msg>Test for the multiply.py function<commit_after> | import multiply as mp
def test_multiply():
"""
Tests that the multiply function works
"""
assert mp.multiply(5,5) == 25
assert mp.multiply(3,0) == 0
| Test for the multiply.py functionimport multiply as mp
def test_multiply():
"""
Tests that the multiply function works
"""
assert mp.multiply(5,5) == 25
assert mp.multiply(3,0) == 0
| <commit_before><commit_msg>Test for the multiply.py function<commit_after>import multiply as mp
def test_multiply():
"""
Tests that the multiply function works
"""
assert mp.multiply(5,5) == 25
assert mp.multiply(3,0) == 0
| |
9aec0558e4174c16c44a8a5598c14a1fbcee55a9 | stock_updater.py | stock_updater.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
class StockUpdater:
def __init__(self, db_connection):
self.db_connection = db_connection
def set_items(self, items):
self.items = items
def set_table(self, table):
self.table = table
def set_destination_colums(self, product_code... | Add class for updating stock | Add class for updating stock
| Python | mit | stormaaja/csvconverter,stormaaja/csvconverter,stormaaja/csvconverter | Add class for updating stock | #!/usr/bin/env python
# -*- coding: utf-8 -*-
class StockUpdater:
def __init__(self, db_connection):
self.db_connection = db_connection
def set_items(self, items):
self.items = items
def set_table(self, table):
self.table = table
def set_destination_colums(self, product_code... | <commit_before><commit_msg>Add class for updating stock<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
class StockUpdater:
def __init__(self, db_connection):
self.db_connection = db_connection
def set_items(self, items):
self.items = items
def set_table(self, table):
self.table = table
def set_destination_colums(self, product_code... | Add class for updating stock#!/usr/bin/env python
# -*- coding: utf-8 -*-
class StockUpdater:
def __init__(self, db_connection):
self.db_connection = db_connection
def set_items(self, items):
self.items = items
def set_table(self, table):
self.table = table
def set_destinati... | <commit_before><commit_msg>Add class for updating stock<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
class StockUpdater:
def __init__(self, db_connection):
self.db_connection = db_connection
def set_items(self, items):
self.items = items
def set_table(self, table):
... | |
ea75b737ff6e2b3c54bc5e6417d64bd16f446dc3 | test/test_bot.py | test/test_bot.py | import re
import unittest
from gather.bot import ListenerBot
class TestGatherBot(unittest.TestCase):
def test_register(self):
bot = ListenerBot()
self.assertEqual({}, bot.actions)
regex = r'^test'
action = unittest.mock.Mock()
bot.register_action(regex, action)
self... | Add a test for bot action registration | Add a test for bot action registration
| Python | mit | veryhappythings/discord-gather | Add a test for bot action registration | import re
import unittest
from gather.bot import ListenerBot
class TestGatherBot(unittest.TestCase):
def test_register(self):
bot = ListenerBot()
self.assertEqual({}, bot.actions)
regex = r'^test'
action = unittest.mock.Mock()
bot.register_action(regex, action)
self... | <commit_before><commit_msg>Add a test for bot action registration<commit_after> | import re
import unittest
from gather.bot import ListenerBot
class TestGatherBot(unittest.TestCase):
def test_register(self):
bot = ListenerBot()
self.assertEqual({}, bot.actions)
regex = r'^test'
action = unittest.mock.Mock()
bot.register_action(regex, action)
self... | Add a test for bot action registrationimport re
import unittest
from gather.bot import ListenerBot
class TestGatherBot(unittest.TestCase):
def test_register(self):
bot = ListenerBot()
self.assertEqual({}, bot.actions)
regex = r'^test'
action = unittest.mock.Mock()
bot.regis... | <commit_before><commit_msg>Add a test for bot action registration<commit_after>import re
import unittest
from gather.bot import ListenerBot
class TestGatherBot(unittest.TestCase):
def test_register(self):
bot = ListenerBot()
self.assertEqual({}, bot.actions)
regex = r'^test'
action... | |
75feb1bf2f7adec9a3c35fdd1c566922a24f44f4 | test_analyzer.py | test_analyzer.py | #!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Figure out which tests ran, and which had any failures.
import sys
import re
testOkPatt = re.com... | Add mochitest failure test analyzer | Add mochitest failure test analyzer
| Python | mpl-2.0 | amccreight/mochitest-logs | Add mochitest failure test analyzer | #!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Figure out which tests ran, and which had any failures.
import sys
import re
testOkPatt = re.com... | <commit_before><commit_msg>Add mochitest failure test analyzer<commit_after> | #!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Figure out which tests ran, and which had any failures.
import sys
import re
testOkPatt = re.com... | Add mochitest failure test analyzer#!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Figure out which tests ran, and which had any failures.
import ... | <commit_before><commit_msg>Add mochitest failure test analyzer<commit_after>#!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Figure out which tests ... | |
feef32714b8be10c7b5fd8a536c0dee8b872a6ac | extract_binaries.py | extract_binaries.py | from argparse import ArgumentParser
import errno
import os.path
import urllib
import shutil
from subprocess import (
check_call,
check_output,
)
def get_args():
parser = ArgumentParser()
parser.add_argument('version', help='The version number of this juju.')
parser.add_argument('branch', help='... | Add python version of extract_binary. | Add python version of extract_binary. | Python | agpl-3.0 | mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju | Add python version of extract_binary. | from argparse import ArgumentParser
import errno
import os.path
import urllib
import shutil
from subprocess import (
check_call,
check_output,
)
def get_args():
parser = ArgumentParser()
parser.add_argument('version', help='The version number of this juju.')
parser.add_argument('branch', help='... | <commit_before><commit_msg>Add python version of extract_binary.<commit_after> | from argparse import ArgumentParser
import errno
import os.path
import urllib
import shutil
from subprocess import (
check_call,
check_output,
)
def get_args():
parser = ArgumentParser()
parser.add_argument('version', help='The version number of this juju.')
parser.add_argument('branch', help='... | Add python version of extract_binary.from argparse import ArgumentParser
import errno
import os.path
import urllib
import shutil
from subprocess import (
check_call,
check_output,
)
def get_args():
parser = ArgumentParser()
parser.add_argument('version', help='The version number of this juju.')
... | <commit_before><commit_msg>Add python version of extract_binary.<commit_after>from argparse import ArgumentParser
import errno
import os.path
import urllib
import shutil
from subprocess import (
check_call,
check_output,
)
def get_args():
parser = ArgumentParser()
parser.add_argument('version', hel... | |
53a4d9525439456de3d0f13d92c5671a4c39b69f | ndlib_test/ndlibTest.py | ndlib_test/ndlibTest.py | import unittest
import networkx as nx
import sys
sys.path.append("..")
import ndlib.VoterModel as vm
import ndlib.SznajdModel as sm
import ndlib.MajorityRuleModel as mrm
__author__ = 'rossetti'
__license__ = "GPL"
__email__ = "giulio.rossetti@gmail.com"
class NdlibTest(unittest.TestCase):
def test_voter_model(s... | Test suite for the ndlib | Test suite for the ndlib
| Python | bsd-2-clause | GiulioRossetti/ndlib | Test suite for the ndlib | import unittest
import networkx as nx
import sys
sys.path.append("..")
import ndlib.VoterModel as vm
import ndlib.SznajdModel as sm
import ndlib.MajorityRuleModel as mrm
__author__ = 'rossetti'
__license__ = "GPL"
__email__ = "giulio.rossetti@gmail.com"
class NdlibTest(unittest.TestCase):
def test_voter_model(s... | <commit_before><commit_msg>Test suite for the ndlib<commit_after> | import unittest
import networkx as nx
import sys
sys.path.append("..")
import ndlib.VoterModel as vm
import ndlib.SznajdModel as sm
import ndlib.MajorityRuleModel as mrm
__author__ = 'rossetti'
__license__ = "GPL"
__email__ = "giulio.rossetti@gmail.com"
class NdlibTest(unittest.TestCase):
def test_voter_model(s... | Test suite for the ndlibimport unittest
import networkx as nx
import sys
sys.path.append("..")
import ndlib.VoterModel as vm
import ndlib.SznajdModel as sm
import ndlib.MajorityRuleModel as mrm
__author__ = 'rossetti'
__license__ = "GPL"
__email__ = "giulio.rossetti@gmail.com"
class NdlibTest(unittest.TestCase):
... | <commit_before><commit_msg>Test suite for the ndlib<commit_after>import unittest
import networkx as nx
import sys
sys.path.append("..")
import ndlib.VoterModel as vm
import ndlib.SznajdModel as sm
import ndlib.MajorityRuleModel as mrm
__author__ = 'rossetti'
__license__ = "GPL"
__email__ = "giulio.rossetti@gmail.com"
... | |
e6397785d5d17d1214c1d8fbf7cd503f4484c5d9 | olympiad/square.py | olympiad/square.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2014 Fabian M.
#
# 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... | Add solution for problem A2 | Add solution for problem A2
| Python | apache-2.0 | fabianm/olympiad,fabianm/olympiad,fabianm/olympiad | Add solution for problem A2 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2014 Fabian M.
#
# 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... | <commit_before><commit_msg>Add solution for problem A2<commit_after> | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2014 Fabian M.
#
# 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... | Add solution for problem A2#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2014 Fabian M.
#
# 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/LICE... | <commit_before><commit_msg>Add solution for problem A2<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2014 Fabian M.
#
# 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... | |
a743e0293c3ca04e7b5e4cdb7059085e2b4fdb6c | test/test_document.py | test/test_document.py | from __future__ import division, absolute_import, print_function
import unittest
from svgpathtools import *
from io import StringIO
from os.path import join, dirname
class TestDocument(unittest.TestCase):
def test_from_file_path(self):
""" Test reading svg from file provided as path """
doc = Docum... | Add tests for creating from file location, file, StringIO, and string | Add tests for creating from file location, file, StringIO, and string
| Python | mit | mathandy/svgpathtools | Add tests for creating from file location, file, StringIO, and string | from __future__ import division, absolute_import, print_function
import unittest
from svgpathtools import *
from io import StringIO
from os.path import join, dirname
class TestDocument(unittest.TestCase):
def test_from_file_path(self):
""" Test reading svg from file provided as path """
doc = Docum... | <commit_before><commit_msg>Add tests for creating from file location, file, StringIO, and string<commit_after> | from __future__ import division, absolute_import, print_function
import unittest
from svgpathtools import *
from io import StringIO
from os.path import join, dirname
class TestDocument(unittest.TestCase):
def test_from_file_path(self):
""" Test reading svg from file provided as path """
doc = Docum... | Add tests for creating from file location, file, StringIO, and stringfrom __future__ import division, absolute_import, print_function
import unittest
from svgpathtools import *
from io import StringIO
from os.path import join, dirname
class TestDocument(unittest.TestCase):
def test_from_file_path(self):
"... | <commit_before><commit_msg>Add tests for creating from file location, file, StringIO, and string<commit_after>from __future__ import division, absolute_import, print_function
import unittest
from svgpathtools import *
from io import StringIO
from os.path import join, dirname
class TestDocument(unittest.TestCase):
... | |
807d589d941418a763b4ebfdd3c117df08de2df4 | PositionalList.py | PositionalList.py | class _DoubleLinkedBase:
class _Node:
__slots__ = '_element', '_prev', '_next'
def __init__(self, element, prev, next):
self._element = element
self._prev = prev
self._next = next
def __init__(self):
self._header = self._Node(None, None, None)
... | Add positional list skeleton ??? | Add positional list skeleton ???
| Python | mit | xiao0720/leetcode,xliiauo/leetcode,xliiauo/leetcode,xiao0720/leetcode,xliiauo/leetcode | Add positional list skeleton ??? | class _DoubleLinkedBase:
class _Node:
__slots__ = '_element', '_prev', '_next'
def __init__(self, element, prev, next):
self._element = element
self._prev = prev
self._next = next
def __init__(self):
self._header = self._Node(None, None, None)
... | <commit_before><commit_msg>Add positional list skeleton ???<commit_after> | class _DoubleLinkedBase:
class _Node:
__slots__ = '_element', '_prev', '_next'
def __init__(self, element, prev, next):
self._element = element
self._prev = prev
self._next = next
def __init__(self):
self._header = self._Node(None, None, None)
... | Add positional list skeleton ???class _DoubleLinkedBase:
class _Node:
__slots__ = '_element', '_prev', '_next'
def __init__(self, element, prev, next):
self._element = element
self._prev = prev
self._next = next
def __init__(self):
self._header = sel... | <commit_before><commit_msg>Add positional list skeleton ???<commit_after>class _DoubleLinkedBase:
class _Node:
__slots__ = '_element', '_prev', '_next'
def __init__(self, element, prev, next):
self._element = element
self._prev = prev
self._next = next
def _... | |
f5eeda75d9cc58c6552ab573f6866a144704c962 | pyim/main/split.py | pyim/main/split.py | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import (ascii, bytes, chr, dict, filter, hex, input,
int, map, next, oct, open, pow, range, round,
str, super, zip)
from argparse import ArgumentParser
... | Split bam files based on barcodes. | Split bam files based on barcodes.
| Python | mit | jrderuiter/pyim,jrderuiter/pyim | Split bam files based on barcodes. | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import (ascii, bytes, chr, dict, filter, hex, input,
int, map, next, oct, open, pow, range, round,
str, super, zip)
from argparse import ArgumentParser
... | <commit_before><commit_msg>Split bam files based on barcodes.<commit_after> | from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import (ascii, bytes, chr, dict, filter, hex, input,
int, map, next, oct, open, pow, range, round,
str, super, zip)
from argparse import ArgumentParser
... | Split bam files based on barcodes.from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import (ascii, bytes, chr, dict, filter, hex, input,
int, map, next, oct, open, pow, range, round,
str, super, zip)
fr... | <commit_before><commit_msg>Split bam files based on barcodes.<commit_after>from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import (ascii, bytes, chr, dict, filter, hex, input,
int, map, next, oct, open, pow, range, round,
... | |
bc2d986478465c261e2a01a591c956b65364cd90 | ldap-helper.py | ldap-helper.py | # Handles queries to the LDAP backend
# Reads the LDAP server configuration from a JSON file
import json
import ldap
first_connect = True
# The default config filename
config_file = 'config.json'
def load_config():
with open(config_file, 'r') as f:
config = json.load(f)
ldap_server = config['ldap_ser... | Add initial helper functions for connecting to LDAP | Add initial helper functions for connecting to LDAP
| Python | mit | motorolja/ldap-updater | Add initial helper functions for connecting to LDAP | # Handles queries to the LDAP backend
# Reads the LDAP server configuration from a JSON file
import json
import ldap
first_connect = True
# The default config filename
config_file = 'config.json'
def load_config():
with open(config_file, 'r') as f:
config = json.load(f)
ldap_server = config['ldap_ser... | <commit_before><commit_msg>Add initial helper functions for connecting to LDAP<commit_after> | # Handles queries to the LDAP backend
# Reads the LDAP server configuration from a JSON file
import json
import ldap
first_connect = True
# The default config filename
config_file = 'config.json'
def load_config():
with open(config_file, 'r') as f:
config = json.load(f)
ldap_server = config['ldap_ser... | Add initial helper functions for connecting to LDAP# Handles queries to the LDAP backend
# Reads the LDAP server configuration from a JSON file
import json
import ldap
first_connect = True
# The default config filename
config_file = 'config.json'
def load_config():
with open(config_file, 'r') as f:
confi... | <commit_before><commit_msg>Add initial helper functions for connecting to LDAP<commit_after># Handles queries to the LDAP backend
# Reads the LDAP server configuration from a JSON file
import json
import ldap
first_connect = True
# The default config filename
config_file = 'config.json'
def load_config():
with o... | |
64e5bf4187cd9a5e584901583a8ccd60a92314df | preshed/tests/test_pop.py | preshed/tests/test_pop.py | from ..maps import PreshMap
def test_pop1():
table = PreshMap()
table[10] = 20
table[30] = 25
assert table[10] == 20
assert table[30] == 25
table.pop(30)
assert table[10] == 20
| Add some tests for pop method | Add some tests for pop method
| Python | mit | syllog1sm/preshed,explosion/preshed,explosion/preshed,spacy-io/preshed,spacy-io/preshed,explosion/preshed | Add some tests for pop method | from ..maps import PreshMap
def test_pop1():
table = PreshMap()
table[10] = 20
table[30] = 25
assert table[10] == 20
assert table[30] == 25
table.pop(30)
assert table[10] == 20
| <commit_before><commit_msg>Add some tests for pop method<commit_after> | from ..maps import PreshMap
def test_pop1():
table = PreshMap()
table[10] = 20
table[30] = 25
assert table[10] == 20
assert table[30] == 25
table.pop(30)
assert table[10] == 20
| Add some tests for pop methodfrom ..maps import PreshMap
def test_pop1():
table = PreshMap()
table[10] = 20
table[30] = 25
assert table[10] == 20
assert table[30] == 25
table.pop(30)
assert table[10] == 20
| <commit_before><commit_msg>Add some tests for pop method<commit_after>from ..maps import PreshMap
def test_pop1():
table = PreshMap()
table[10] = 20
table[30] = 25
assert table[10] == 20
assert table[30] == 25
table.pop(30)
assert table[10] == 20
| |
e9e56b7ab243bf06721fac369e05db19dbfc8ee6 | db/base/management/commands/update_all_sats.py | db/base/management/commands/update_all_sats.py | from orbit import satellite
from django.core.management.base import BaseCommand
from db.base.models import Satellite
class Command(BaseCommand):
help = 'Update existing Satellites'
def handle(self, *args, **options):
satellites = Satellite.objects.all()
for obj in satellites:
... | Add command to update Satellites names | Add command to update Satellites names
| Python | agpl-3.0 | Roboneet/satnogs-db,Roboneet/satnogs-db,Roboneet/satnogs-db,Roboneet/satnogs-db | Add command to update Satellites names | from orbit import satellite
from django.core.management.base import BaseCommand
from db.base.models import Satellite
class Command(BaseCommand):
help = 'Update existing Satellites'
def handle(self, *args, **options):
satellites = Satellite.objects.all()
for obj in satellites:
... | <commit_before><commit_msg>Add command to update Satellites names<commit_after> | from orbit import satellite
from django.core.management.base import BaseCommand
from db.base.models import Satellite
class Command(BaseCommand):
help = 'Update existing Satellites'
def handle(self, *args, **options):
satellites = Satellite.objects.all()
for obj in satellites:
... | Add command to update Satellites namesfrom orbit import satellite
from django.core.management.base import BaseCommand
from db.base.models import Satellite
class Command(BaseCommand):
help = 'Update existing Satellites'
def handle(self, *args, **options):
satellites = Satellite.objects.all()
... | <commit_before><commit_msg>Add command to update Satellites names<commit_after>from orbit import satellite
from django.core.management.base import BaseCommand
from db.base.models import Satellite
class Command(BaseCommand):
help = 'Update existing Satellites'
def handle(self, *args, **options):
sa... | |
6572f323a7cf5121789d510391371051d3014d1b | corgi/visualization.py | corgi/visualization.py | import numpy as np
def hist(data, width=20):
counts, values = np.histogram(data)
max_count = counts.max()
for (count, value) in zip(counts, values):
scaled = int(round((count / max_count) * width))
print('%5.2f' % value, ':', 'X'*scaled)
| Add a function for simple command line stdout histogram over an array | Add a function for simple command line stdout histogram over an array
| Python | mit | log0ymxm/corgi | Add a function for simple command line stdout histogram over an array | import numpy as np
def hist(data, width=20):
counts, values = np.histogram(data)
max_count = counts.max()
for (count, value) in zip(counts, values):
scaled = int(round((count / max_count) * width))
print('%5.2f' % value, ':', 'X'*scaled)
| <commit_before><commit_msg>Add a function for simple command line stdout histogram over an array<commit_after> | import numpy as np
def hist(data, width=20):
counts, values = np.histogram(data)
max_count = counts.max()
for (count, value) in zip(counts, values):
scaled = int(round((count / max_count) * width))
print('%5.2f' % value, ':', 'X'*scaled)
| Add a function for simple command line stdout histogram over an arrayimport numpy as np
def hist(data, width=20):
counts, values = np.histogram(data)
max_count = counts.max()
for (count, value) in zip(counts, values):
scaled = int(round((count / max_count) * width))
print('%5.2f' % value,... | <commit_before><commit_msg>Add a function for simple command line stdout histogram over an array<commit_after>import numpy as np
def hist(data, width=20):
counts, values = np.histogram(data)
max_count = counts.max()
for (count, value) in zip(counts, values):
scaled = int(round((count / max_count)... | |
eb09ba7be7f1eab48ee7e0cd1a6b7d7753907ff8 | raiden/tests/unit/test_logging.py | raiden/tests/unit/test_logging.py | import structlog
import logging
import traceback
from raiden.log_config import configure_logging
def test_basic_logging(capsys):
configure_logging({'': 'DEBUG'})
log = structlog.get_logger('test').bind(foo='bar')
log.info('test event', key='value')
captured = capsys.readouterr()
assert 'test ev... | Add logging and redaction tests | Add logging and redaction tests
| Python | mit | hackaugusto/raiden,hackaugusto/raiden | Add logging and redaction tests | import structlog
import logging
import traceback
from raiden.log_config import configure_logging
def test_basic_logging(capsys):
configure_logging({'': 'DEBUG'})
log = structlog.get_logger('test').bind(foo='bar')
log.info('test event', key='value')
captured = capsys.readouterr()
assert 'test ev... | <commit_before><commit_msg>Add logging and redaction tests<commit_after> | import structlog
import logging
import traceback
from raiden.log_config import configure_logging
def test_basic_logging(capsys):
configure_logging({'': 'DEBUG'})
log = structlog.get_logger('test').bind(foo='bar')
log.info('test event', key='value')
captured = capsys.readouterr()
assert 'test ev... | Add logging and redaction testsimport structlog
import logging
import traceback
from raiden.log_config import configure_logging
def test_basic_logging(capsys):
configure_logging({'': 'DEBUG'})
log = structlog.get_logger('test').bind(foo='bar')
log.info('test event', key='value')
captured = capsys.re... | <commit_before><commit_msg>Add logging and redaction tests<commit_after>import structlog
import logging
import traceback
from raiden.log_config import configure_logging
def test_basic_logging(capsys):
configure_logging({'': 'DEBUG'})
log = structlog.get_logger('test').bind(foo='bar')
log.info('test event... | |
7cd4bf8bc72e3340daa70fff451760778a832e62 | muspelheim/src/test/python/newlinejson.py | muspelheim/src/test/python/newlinejson.py | #!/usr/bin/env python
import json
import sys
def newline_json(in_file, out_file):
for line in json.load(in_file):
json.dump(line, out_file)
out_file.write('\n')
if __name__ == '__main__':
if len(sys.argv) < 2:
print "Usage: python newlinejson.py [path to ordinary json file]"
sy... | Add script to convert JSON arrays to newline separated JSON | Add script to convert JSON arrays to newline separated JSON
[Finished #37633897]
| Python | apache-2.0 | quasar-analytics/quasar,quasar-analytics/quasar,jedesah/Quasar,slamdata/slamengine,drostron/quasar,drostron/quasar,drostron/quasar,jedesah/Quasar,slamdata/slamengine,jedesah/Quasar,slamdata/quasar,djspiewak/quasar,quasar-analytics/quasar,slamdata/slamengine,jedesah/Quasar,drostron/quasar,quasar-analytics/quasar | Add script to convert JSON arrays to newline separated JSON
[Finished #37633897] | #!/usr/bin/env python
import json
import sys
def newline_json(in_file, out_file):
for line in json.load(in_file):
json.dump(line, out_file)
out_file.write('\n')
if __name__ == '__main__':
if len(sys.argv) < 2:
print "Usage: python newlinejson.py [path to ordinary json file]"
sy... | <commit_before><commit_msg>Add script to convert JSON arrays to newline separated JSON
[Finished #37633897]<commit_after> | #!/usr/bin/env python
import json
import sys
def newline_json(in_file, out_file):
for line in json.load(in_file):
json.dump(line, out_file)
out_file.write('\n')
if __name__ == '__main__':
if len(sys.argv) < 2:
print "Usage: python newlinejson.py [path to ordinary json file]"
sy... | Add script to convert JSON arrays to newline separated JSON
[Finished #37633897]#!/usr/bin/env python
import json
import sys
def newline_json(in_file, out_file):
for line in json.load(in_file):
json.dump(line, out_file)
out_file.write('\n')
if __name__ == '__main__':
if len(sys.argv) < 2:
... | <commit_before><commit_msg>Add script to convert JSON arrays to newline separated JSON
[Finished #37633897]<commit_after>#!/usr/bin/env python
import json
import sys
def newline_json(in_file, out_file):
for line in json.load(in_file):
json.dump(line, out_file)
out_file.write('\n')
if __name__ == ... | |
6758e02cddf18d93e26ac23750980397089e869c | dragonfire/tests/test_arithmetic.py | dragonfire/tests/test_arithmetic.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. module:: text_dragonfire
:platform: Unix
:synopsis: tests for the arithmetic submodule.
.. moduleauthor:: Mehmet Mert Yıldıran <mert.yildiran@bil.omu.edu.tr>
"""
from dragonfire.arithmetic import arithmetic_parse, text2int
import pytest
def test_text2int()... | Add the tests for the arithmetic submodule | Add the tests for the arithmetic submodule
| Python | mit | mertyildiran/Dragonfire,DragonComputer/Dragonfire,DragonComputer/Dragonfire,DragonComputer/Dragonfire,mertyildiran/Dragonfire | Add the tests for the arithmetic submodule | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. module:: text_dragonfire
:platform: Unix
:synopsis: tests for the arithmetic submodule.
.. moduleauthor:: Mehmet Mert Yıldıran <mert.yildiran@bil.omu.edu.tr>
"""
from dragonfire.arithmetic import arithmetic_parse, text2int
import pytest
def test_text2int()... | <commit_before><commit_msg>Add the tests for the arithmetic submodule<commit_after> | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. module:: text_dragonfire
:platform: Unix
:synopsis: tests for the arithmetic submodule.
.. moduleauthor:: Mehmet Mert Yıldıran <mert.yildiran@bil.omu.edu.tr>
"""
from dragonfire.arithmetic import arithmetic_parse, text2int
import pytest
def test_text2int()... | Add the tests for the arithmetic submodule#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. module:: text_dragonfire
:platform: Unix
:synopsis: tests for the arithmetic submodule.
.. moduleauthor:: Mehmet Mert Yıldıran <mert.yildiran@bil.omu.edu.tr>
"""
from dragonfire.arithmetic import arithmetic_parse, tex... | <commit_before><commit_msg>Add the tests for the arithmetic submodule<commit_after>#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. module:: text_dragonfire
:platform: Unix
:synopsis: tests for the arithmetic submodule.
.. moduleauthor:: Mehmet Mert Yıldıran <mert.yildiran@bil.omu.edu.tr>
"""
from dragonfir... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.