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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fb5f6bf999b2cd8b674bc2c89f74f1413fc8ee1e | command_line_tic_tac_toe.py | command_line_tic_tac_toe.py | #!/usr/bin/env python3
import cmd
from tictactoe.ai_player import AIPlayer
from tictactoe.human_player import HumanPlayer
from tictactoe.game_controller import GameController
from tictactoe.board_stringification import BoardStringification
class CommandLineTicTacToe(cmd.Cmd):
def __init__(self,
i... | Add command line interface to play | Add command line interface to play
| Python | mit | rickerbh/tictactoe_py | Add command line interface to play | #!/usr/bin/env python3
import cmd
from tictactoe.ai_player import AIPlayer
from tictactoe.human_player import HumanPlayer
from tictactoe.game_controller import GameController
from tictactoe.board_stringification import BoardStringification
class CommandLineTicTacToe(cmd.Cmd):
def __init__(self,
i... | <commit_before><commit_msg>Add command line interface to play<commit_after> | #!/usr/bin/env python3
import cmd
from tictactoe.ai_player import AIPlayer
from tictactoe.human_player import HumanPlayer
from tictactoe.game_controller import GameController
from tictactoe.board_stringification import BoardStringification
class CommandLineTicTacToe(cmd.Cmd):
def __init__(self,
i... | Add command line interface to play#!/usr/bin/env python3
import cmd
from tictactoe.ai_player import AIPlayer
from tictactoe.human_player import HumanPlayer
from tictactoe.game_controller import GameController
from tictactoe.board_stringification import BoardStringification
class CommandLineTicTacToe(cmd.Cmd):
def... | <commit_before><commit_msg>Add command line interface to play<commit_after>#!/usr/bin/env python3
import cmd
from tictactoe.ai_player import AIPlayer
from tictactoe.human_player import HumanPlayer
from tictactoe.game_controller import GameController
from tictactoe.board_stringification import BoardStringification
cla... | |
b1ef133904540b7f49e22ac52a0f844963be829e | nose2/tests/functional/test_discovery_loader.py | nose2/tests/functional/test_discovery_loader.py | from nose2.tests._common import FunctionalTestCase, support_file
from nose2 import events, loader, session
from nose2.plugins.loader.discovery import DiscoveryLoader
class Watcher(events.Plugin):
def __init__(self):
self.called = []
def loadTestsFromModule(self, event):
self.called.append(eve... | Add basic test for discovery loader | Add basic test for discovery loader
| Python | bsd-2-clause | ojengwa/nose2,ezigman/nose2,little-dude/nose2,ojengwa/nose2,leth/nose2,ptthiem/nose2,ptthiem/nose2,little-dude/nose2,leth/nose2,ezigman/nose2 | Add basic test for discovery loader | from nose2.tests._common import FunctionalTestCase, support_file
from nose2 import events, loader, session
from nose2.plugins.loader.discovery import DiscoveryLoader
class Watcher(events.Plugin):
def __init__(self):
self.called = []
def loadTestsFromModule(self, event):
self.called.append(eve... | <commit_before><commit_msg>Add basic test for discovery loader<commit_after> | from nose2.tests._common import FunctionalTestCase, support_file
from nose2 import events, loader, session
from nose2.plugins.loader.discovery import DiscoveryLoader
class Watcher(events.Plugin):
def __init__(self):
self.called = []
def loadTestsFromModule(self, event):
self.called.append(eve... | Add basic test for discovery loaderfrom nose2.tests._common import FunctionalTestCase, support_file
from nose2 import events, loader, session
from nose2.plugins.loader.discovery import DiscoveryLoader
class Watcher(events.Plugin):
def __init__(self):
self.called = []
def loadTestsFromModule(self, eve... | <commit_before><commit_msg>Add basic test for discovery loader<commit_after>from nose2.tests._common import FunctionalTestCase, support_file
from nose2 import events, loader, session
from nose2.plugins.loader.discovery import DiscoveryLoader
class Watcher(events.Plugin):
def __init__(self):
self.called = ... | |
681cc0a4160373fe82de59946b52e0e21611af84 | linkLister.py | linkLister.py | import requests
import re
url = raw_input("Enter URL with http or https prefix : " )
print url
website= requests.get(url)
html = website.text
print html
linklist = re.findall('"((http|ftp)s?://.*?)"',html)
print linklist
for link in linklist:
print link[0]
| Print out all links on a page | Print out all links on a page
| Python | mit | NilanjanaLodh/PyScripts,NilanjanaLodh/PyScripts | Print out all links on a page | import requests
import re
url = raw_input("Enter URL with http or https prefix : " )
print url
website= requests.get(url)
html = website.text
print html
linklist = re.findall('"((http|ftp)s?://.*?)"',html)
print linklist
for link in linklist:
print link[0]
| <commit_before><commit_msg>Print out all links on a page<commit_after> | import requests
import re
url = raw_input("Enter URL with http or https prefix : " )
print url
website= requests.get(url)
html = website.text
print html
linklist = re.findall('"((http|ftp)s?://.*?)"',html)
print linklist
for link in linklist:
print link[0]
| Print out all links on a pageimport requests
import re
url = raw_input("Enter URL with http or https prefix : " )
print url
website= requests.get(url)
html = website.text
print html
linklist = re.findall('"((http|ftp)s?://.*?)"',html)
print linklist
for link in linklist:
print link[0]
| <commit_before><commit_msg>Print out all links on a page<commit_after>import requests
import re
url = raw_input("Enter URL with http or https prefix : " )
print url
website= requests.get(url)
html = website.text
print html
linklist = re.findall('"((http|ftp)s?://.*?)"',html)
print linklist
for link in linklist:
p... | |
27622185e04bb652284597783287262e23bafa7d | plenum/test/node_request/test_apply_stashed_partially_ordered.py | plenum/test/node_request/test_apply_stashed_partially_ordered.py | import pytest
from plenum.common.constants import DOMAIN_LEDGER_ID
from plenum.common.startable import Mode
from plenum.common.txn_util import reqToTxn
from plenum.test.delayers import cDelay
from plenum.test.helper import sdk_get_and_check_replies, sdk_send_random_requests, logger
from plenum.test.node_catchup.helper... | Add minimal test case (failing) | INDY-1405: Add minimal test case (failing)
Signed-off-by: Sergey Khoroshavin <b770466c7a06c5fe47531d5f0e31684f1131354d@dsr-corporation.com>
| Python | apache-2.0 | evernym/zeno,evernym/plenum | INDY-1405: Add minimal test case (failing)
Signed-off-by: Sergey Khoroshavin <b770466c7a06c5fe47531d5f0e31684f1131354d@dsr-corporation.com> | import pytest
from plenum.common.constants import DOMAIN_LEDGER_ID
from plenum.common.startable import Mode
from plenum.common.txn_util import reqToTxn
from plenum.test.delayers import cDelay
from plenum.test.helper import sdk_get_and_check_replies, sdk_send_random_requests, logger
from plenum.test.node_catchup.helper... | <commit_before><commit_msg>INDY-1405: Add minimal test case (failing)
Signed-off-by: Sergey Khoroshavin <b770466c7a06c5fe47531d5f0e31684f1131354d@dsr-corporation.com><commit_after> | import pytest
from plenum.common.constants import DOMAIN_LEDGER_ID
from plenum.common.startable import Mode
from plenum.common.txn_util import reqToTxn
from plenum.test.delayers import cDelay
from plenum.test.helper import sdk_get_and_check_replies, sdk_send_random_requests, logger
from plenum.test.node_catchup.helper... | INDY-1405: Add minimal test case (failing)
Signed-off-by: Sergey Khoroshavin <b770466c7a06c5fe47531d5f0e31684f1131354d@dsr-corporation.com>import pytest
from plenum.common.constants import DOMAIN_LEDGER_ID
from plenum.common.startable import Mode
from plenum.common.txn_util import reqToTxn
from plenum.test.delayers i... | <commit_before><commit_msg>INDY-1405: Add minimal test case (failing)
Signed-off-by: Sergey Khoroshavin <b770466c7a06c5fe47531d5f0e31684f1131354d@dsr-corporation.com><commit_after>import pytest
from plenum.common.constants import DOMAIN_LEDGER_ID
from plenum.common.startable import Mode
from plenum.common.txn_util im... | |
e8a6c0adc3aa77f8e0b1399fe076b43720acb823 | tests/test_api.py | tests/test_api.py | # -*- coding: utf-8 -*-
import subprocess
import requests
from unittest import TestCase
from nose.tools import assert_equal
class Test(TestCase):
def setUp(self):
self.process = subprocess.Popen("openfisca-serve")
def tearDown(self):
self.process.terminate()
def test_response(self):
... | Test the API can run | Test the API can run
| Python | agpl-3.0 | antoinearnoud/openfisca-france,antoinearnoud/openfisca-france,sgmap/openfisca-france,sgmap/openfisca-france | Test the API can run | # -*- coding: utf-8 -*-
import subprocess
import requests
from unittest import TestCase
from nose.tools import assert_equal
class Test(TestCase):
def setUp(self):
self.process = subprocess.Popen("openfisca-serve")
def tearDown(self):
self.process.terminate()
def test_response(self):
... | <commit_before><commit_msg>Test the API can run<commit_after> | # -*- coding: utf-8 -*-
import subprocess
import requests
from unittest import TestCase
from nose.tools import assert_equal
class Test(TestCase):
def setUp(self):
self.process = subprocess.Popen("openfisca-serve")
def tearDown(self):
self.process.terminate()
def test_response(self):
... | Test the API can run# -*- coding: utf-8 -*-
import subprocess
import requests
from unittest import TestCase
from nose.tools import assert_equal
class Test(TestCase):
def setUp(self):
self.process = subprocess.Popen("openfisca-serve")
def tearDown(self):
self.process.terminate()
def tes... | <commit_before><commit_msg>Test the API can run<commit_after># -*- coding: utf-8 -*-
import subprocess
import requests
from unittest import TestCase
from nose.tools import assert_equal
class Test(TestCase):
def setUp(self):
self.process = subprocess.Popen("openfisca-serve")
def tearDown(self):
... | |
690c08b2b35df2d81dc0977d8bd593c45806e1c2 | tests/test_log.py | tests/test_log.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from flask import url_for
def test_view_build_log(test_client):
test_client.get(url_for('log.build_log', sha='123456'))
def test_view_lint_log(test_client):
test_client.get(url_for('log.lint_log', sha='123456'))
| Add dumb log view test cases | Add dumb log view test cases
| Python | mit | bosondata/badwolf,bosondata/badwolf,bosondata/badwolf | Add dumb log view test cases | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from flask import url_for
def test_view_build_log(test_client):
test_client.get(url_for('log.build_log', sha='123456'))
def test_view_lint_log(test_client):
test_client.get(url_for('log.lint_log', sha='123456'))
| <commit_before><commit_msg>Add dumb log view test cases<commit_after> | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from flask import url_for
def test_view_build_log(test_client):
test_client.get(url_for('log.build_log', sha='123456'))
def test_view_lint_log(test_client):
test_client.get(url_for('log.lint_log', sha='123456'))
| Add dumb log view test cases# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from flask import url_for
def test_view_build_log(test_client):
test_client.get(url_for('log.build_log', sha='123456'))
def test_view_lint_log(test_client):
test_client.get(url_for('log.lint_log', sh... | <commit_before><commit_msg>Add dumb log view test cases<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from flask import url_for
def test_view_build_log(test_client):
test_client.get(url_for('log.build_log', sha='123456'))
def test_view_lint_log(test_client):
t... | |
4d500d9abe2da28cdd9bd95019048de445aac265 | docs/source/tutorial/v5/history_demo.py | docs/source/tutorial/v5/history_demo.py | # coding: utf-8
from deprecated.history import deprecated
from deprecated.history import versionadded
from deprecated.history import versionchanged
@deprecated(
reason="""
This is deprecated, really. So you need to use another function.
But I don\'t know which one.
- The first,
- The se... | Add a history demo in documentation. | Add a history demo in documentation.
| Python | mit | tantale/deprecated | Add a history demo in documentation. | # coding: utf-8
from deprecated.history import deprecated
from deprecated.history import versionadded
from deprecated.history import versionchanged
@deprecated(
reason="""
This is deprecated, really. So you need to use another function.
But I don\'t know which one.
- The first,
- The se... | <commit_before><commit_msg>Add a history demo in documentation.<commit_after> | # coding: utf-8
from deprecated.history import deprecated
from deprecated.history import versionadded
from deprecated.history import versionchanged
@deprecated(
reason="""
This is deprecated, really. So you need to use another function.
But I don\'t know which one.
- The first,
- The se... | Add a history demo in documentation.# coding: utf-8
from deprecated.history import deprecated
from deprecated.history import versionadded
from deprecated.history import versionchanged
@deprecated(
reason="""
This is deprecated, really. So you need to use another function.
But I don\'t know which one.
... | <commit_before><commit_msg>Add a history demo in documentation.<commit_after># coding: utf-8
from deprecated.history import deprecated
from deprecated.history import versionadded
from deprecated.history import versionchanged
@deprecated(
reason="""
This is deprecated, really. So you need to use another functi... | |
c39c086f51963678769c1066637ca573c721e827 | static_gallery.py | static_gallery.py | from . import flag
#from go import html
from go import os
from go import path/filepath
def ReadAlbumDirs(input_dir):
f = os.Open(input_dir)
with defer f.Close():
names = f.Readdirnames(-1)
for name in names:
stat = os.Stat(filepath.Join(input_dir, name))
if stat.IsDir():
yield name
def... | Create a simple static gallery script. | Create a simple static gallery script.
| Python | mit | strickyak/aphid,strickyak/aphid,strickyak/aphid,strickyak/aphid,strickyak/aphid,strickyak/aphid,strickyak/aphid | Create a simple static gallery script. | from . import flag
#from go import html
from go import os
from go import path/filepath
def ReadAlbumDirs(input_dir):
f = os.Open(input_dir)
with defer f.Close():
names = f.Readdirnames(-1)
for name in names:
stat = os.Stat(filepath.Join(input_dir, name))
if stat.IsDir():
yield name
def... | <commit_before><commit_msg>Create a simple static gallery script.<commit_after> | from . import flag
#from go import html
from go import os
from go import path/filepath
def ReadAlbumDirs(input_dir):
f = os.Open(input_dir)
with defer f.Close():
names = f.Readdirnames(-1)
for name in names:
stat = os.Stat(filepath.Join(input_dir, name))
if stat.IsDir():
yield name
def... | Create a simple static gallery script.from . import flag
#from go import html
from go import os
from go import path/filepath
def ReadAlbumDirs(input_dir):
f = os.Open(input_dir)
with defer f.Close():
names = f.Readdirnames(-1)
for name in names:
stat = os.Stat(filepath.Join(input_dir, name))
if... | <commit_before><commit_msg>Create a simple static gallery script.<commit_after>from . import flag
#from go import html
from go import os
from go import path/filepath
def ReadAlbumDirs(input_dir):
f = os.Open(input_dir)
with defer f.Close():
names = f.Readdirnames(-1)
for name in names:
stat = os.Stat... | |
8139dc9e04025da001323122521951f5ed2c391b | users/migrations/0010_users-profile-encoding.py | users/migrations/0010_users-profile-encoding.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-25 01:43
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0009_remove_profile_active'),
]
operations = [
migrations.RunSQL("ALTER DAT... | Fix mysql encoding for users.profile.reason | Fix mysql encoding for users.profile.reason
| Python | mit | sbuss/voteswap,sbuss/voteswap,sbuss/voteswap,sbuss/voteswap | Fix mysql encoding for users.profile.reason | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-25 01:43
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0009_remove_profile_active'),
]
operations = [
migrations.RunSQL("ALTER DAT... | <commit_before><commit_msg>Fix mysql encoding for users.profile.reason<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-25 01:43
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0009_remove_profile_active'),
]
operations = [
migrations.RunSQL("ALTER DAT... | Fix mysql encoding for users.profile.reason# -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-25 01:43
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0009_remove_profile_active'),
]
operatio... | <commit_before><commit_msg>Fix mysql encoding for users.profile.reason<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-25 01:43
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0009_rem... | |
328901c74d1ee103a1ee5b2f26aa391ddeda465b | tests/test_web.py | tests/test_web.py | """Test the AutoCMS web reporting functionality."""
import os
import shutil
import unittest
import re
from autocms.core import load_configuration
from autocms.web import (
produce_default_webpage
)
class TestWebPageCreation(unittest.TestCase):
"""Test the accurate creation of test webpages."""
def setU... | Add unit test for webpage creation and description | Add unit test for webpage creation and description
| Python | mit | appeltel/AutoCMS,appeltel/AutoCMS,appeltel/AutoCMS | Add unit test for webpage creation and description | """Test the AutoCMS web reporting functionality."""
import os
import shutil
import unittest
import re
from autocms.core import load_configuration
from autocms.web import (
produce_default_webpage
)
class TestWebPageCreation(unittest.TestCase):
"""Test the accurate creation of test webpages."""
def setU... | <commit_before><commit_msg>Add unit test for webpage creation and description<commit_after> | """Test the AutoCMS web reporting functionality."""
import os
import shutil
import unittest
import re
from autocms.core import load_configuration
from autocms.web import (
produce_default_webpage
)
class TestWebPageCreation(unittest.TestCase):
"""Test the accurate creation of test webpages."""
def setU... | Add unit test for webpage creation and description"""Test the AutoCMS web reporting functionality."""
import os
import shutil
import unittest
import re
from autocms.core import load_configuration
from autocms.web import (
produce_default_webpage
)
class TestWebPageCreation(unittest.TestCase):
"""Test the ac... | <commit_before><commit_msg>Add unit test for webpage creation and description<commit_after>"""Test the AutoCMS web reporting functionality."""
import os
import shutil
import unittest
import re
from autocms.core import load_configuration
from autocms.web import (
produce_default_webpage
)
class TestWebPageCreati... | |
3133bbfcb5ee56c88ea20be21778519bffe77299 | literotica.py | literotica.py | from common import *
from sys import argv
from urlgrab import Cache
from re import compile, DOTALL, MULTILINE
cache = Cache()
url = argv[1]
titlePattern = compile("<h1>([^<]+)</h1>")
contentPattern = compile("<div class=\"b-story-body-x x-r15\">(.+?)</div><div class=\"b-story-stats-block\">" , DOTALL|MULTILINE)
nextP... | Add another different type of book | Add another different type of book
| Python | agpl-3.0 | palfrey/book-blog | Add another different type of book | from common import *
from sys import argv
from urlgrab import Cache
from re import compile, DOTALL, MULTILINE
cache = Cache()
url = argv[1]
titlePattern = compile("<h1>([^<]+)</h1>")
contentPattern = compile("<div class=\"b-story-body-x x-r15\">(.+?)</div><div class=\"b-story-stats-block\">" , DOTALL|MULTILINE)
nextP... | <commit_before><commit_msg>Add another different type of book<commit_after> | from common import *
from sys import argv
from urlgrab import Cache
from re import compile, DOTALL, MULTILINE
cache = Cache()
url = argv[1]
titlePattern = compile("<h1>([^<]+)</h1>")
contentPattern = compile("<div class=\"b-story-body-x x-r15\">(.+?)</div><div class=\"b-story-stats-block\">" , DOTALL|MULTILINE)
nextP... | Add another different type of bookfrom common import *
from sys import argv
from urlgrab import Cache
from re import compile, DOTALL, MULTILINE
cache = Cache()
url = argv[1]
titlePattern = compile("<h1>([^<]+)</h1>")
contentPattern = compile("<div class=\"b-story-body-x x-r15\">(.+?)</div><div class=\"b-story-stats-b... | <commit_before><commit_msg>Add another different type of book<commit_after>from common import *
from sys import argv
from urlgrab import Cache
from re import compile, DOTALL, MULTILINE
cache = Cache()
url = argv[1]
titlePattern = compile("<h1>([^<]+)</h1>")
contentPattern = compile("<div class=\"b-story-body-x x-r15\... | |
893679baff0367538bdf3b52b04f8bae72732be8 | zerver/migrations/0031_remove_system_avatar_source.py | zerver/migrations/0031_remove_system_avatar_source.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0030_realm_org_type'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
n... | Add migration to remove system avatar source. | Add migration to remove system avatar source.
Fixes the last commit having broken master.
| Python | apache-2.0 | sharmaeklavya2/zulip,isht3/zulip,joyhchen/zulip,susansls/zulip,zulip/zulip,punchagan/zulip,blaze225/zulip,PhilSk/zulip,samatdav/zulip,hackerkid/zulip,christi3k/zulip,brainwane/zulip,mahim97/zulip,kou/zulip,jackrzhang/zulip,amyliu345/zulip,paxapy/zulip,niftynei/zulip,samatdav/zulip,vikas-parashar/zulip,shubhamdhama/zuli... | Add migration to remove system avatar source.
Fixes the last commit having broken master. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0030_realm_org_type'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
n... | <commit_before><commit_msg>Add migration to remove system avatar source.
Fixes the last commit having broken master.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0030_realm_org_type'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
n... | Add migration to remove system avatar source.
Fixes the last commit having broken master.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0030_realm_org_type'),
]
operati... | <commit_before><commit_msg>Add migration to remove system avatar source.
Fixes the last commit having broken master.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '... | |
b51398d602a157ce55fd7e08eedd953051f716a1 | backend/scripts/updatedf.py | backend/scripts/updatedf.py | #!/usr/bin/env python
#import hashlib
import os
def main():
for root, dirs, files in os.walk("/mcfs/data/materialscommons"):
for f in files:
print f
if __name__ == "__main__":
main()
| Add script to update uploaded files. | Add script to update uploaded files.
| Python | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | Add script to update uploaded files. | #!/usr/bin/env python
#import hashlib
import os
def main():
for root, dirs, files in os.walk("/mcfs/data/materialscommons"):
for f in files:
print f
if __name__ == "__main__":
main()
| <commit_before><commit_msg>Add script to update uploaded files.<commit_after> | #!/usr/bin/env python
#import hashlib
import os
def main():
for root, dirs, files in os.walk("/mcfs/data/materialscommons"):
for f in files:
print f
if __name__ == "__main__":
main()
| Add script to update uploaded files.#!/usr/bin/env python
#import hashlib
import os
def main():
for root, dirs, files in os.walk("/mcfs/data/materialscommons"):
for f in files:
print f
if __name__ == "__main__":
main()
| <commit_before><commit_msg>Add script to update uploaded files.<commit_after>#!/usr/bin/env python
#import hashlib
import os
def main():
for root, dirs, files in os.walk("/mcfs/data/materialscommons"):
for f in files:
print f
if __name__ == "__main__":
main()
| |
fbf36a2fb52b5ed1aceaec4c1d1075448584a97d | tests/test_imports.py | tests/test_imports.py | """Test that all modules/packages in the lektor tree are importable in any order
Here we import each module by itself, one at a time, each in a new
python interpreter.
"""
import pkgutil
import sys
from subprocess import run
import pytest
import lektor
def iter_lektor_modules():
for module in pkgutil.walk_pac... | Test that modules can be imported in any order | Test that modules can be imported in any order
This excercises an tricky import cycle introduced in:
7c68f3f78 more imports at top level
| Python | bsd-3-clause | lektor/lektor,lektor/lektor,lektor/lektor,lektor/lektor | Test that modules can be imported in any order
This excercises an tricky import cycle introduced in:
7c68f3f78 more imports at top level | """Test that all modules/packages in the lektor tree are importable in any order
Here we import each module by itself, one at a time, each in a new
python interpreter.
"""
import pkgutil
import sys
from subprocess import run
import pytest
import lektor
def iter_lektor_modules():
for module in pkgutil.walk_pac... | <commit_before><commit_msg>Test that modules can be imported in any order
This excercises an tricky import cycle introduced in:
7c68f3f78 more imports at top level<commit_after> | """Test that all modules/packages in the lektor tree are importable in any order
Here we import each module by itself, one at a time, each in a new
python interpreter.
"""
import pkgutil
import sys
from subprocess import run
import pytest
import lektor
def iter_lektor_modules():
for module in pkgutil.walk_pac... | Test that modules can be imported in any order
This excercises an tricky import cycle introduced in:
7c68f3f78 more imports at top level"""Test that all modules/packages in the lektor tree are importable in any order
Here we import each module by itself, one at a time, each in a new
python interpreter.
"""
import... | <commit_before><commit_msg>Test that modules can be imported in any order
This excercises an tricky import cycle introduced in:
7c68f3f78 more imports at top level<commit_after>"""Test that all modules/packages in the lektor tree are importable in any order
Here we import each module by itself, one at a time, each... | |
85202173cf120caad603315cd57fa66857a88b0b | feder/institutions/migrations/0013_auto_20170810_2118.py | feder/institutions/migrations/0013_auto_20170810_2118.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-10 21:18
from __future__ import unicode_literals
from django.db import migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('institutions', '0012_auto_20170808_0309'),
]
operations = [
... | Add missing migrations for institutions | Add missing migrations for institutions
| Python | mit | watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder | Add missing migrations for institutions | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-10 21:18
from __future__ import unicode_literals
from django.db import migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('institutions', '0012_auto_20170808_0309'),
]
operations = [
... | <commit_before><commit_msg>Add missing migrations for institutions<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-10 21:18
from __future__ import unicode_literals
from django.db import migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('institutions', '0012_auto_20170808_0309'),
]
operations = [
... | Add missing migrations for institutions# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-10 21:18
from __future__ import unicode_literals
from django.db import migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('institutions', '0012_auto_20170808_03... | <commit_before><commit_msg>Add missing migrations for institutions<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-10 21:18
from __future__ import unicode_literals
from django.db import migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
... | |
c95234c130435ddd116784ad1829f7bdaa9182c5 | 100_to_199/euler_138.py | 100_to_199/euler_138.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Problem 138
Consider the isosceles triangle with base length, b = 16, and legs, L = 17.
By using the Pythagorean theorem it can be seen that the height of the triangle, h = √(172 − 82) = 15, which is one less than the base length.
With b = 272 and L = 305, we get h ... | ADD 138 solutions with A195615(OEIS) | ADD 138 solutions with A195615(OEIS)
| Python | mit | byung-u/ProjectEuler | ADD 138 solutions with A195615(OEIS) | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Problem 138
Consider the isosceles triangle with base length, b = 16, and legs, L = 17.
By using the Pythagorean theorem it can be seen that the height of the triangle, h = √(172 − 82) = 15, which is one less than the base length.
With b = 272 and L = 305, we get h ... | <commit_before><commit_msg>ADD 138 solutions with A195615(OEIS)<commit_after> | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Problem 138
Consider the isosceles triangle with base length, b = 16, and legs, L = 17.
By using the Pythagorean theorem it can be seen that the height of the triangle, h = √(172 − 82) = 15, which is one less than the base length.
With b = 272 and L = 305, we get h ... | ADD 138 solutions with A195615(OEIS)#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Problem 138
Consider the isosceles triangle with base length, b = 16, and legs, L = 17.
By using the Pythagorean theorem it can be seen that the height of the triangle, h = √(172 − 82) = 15, which is one less than the base length.... | <commit_before><commit_msg>ADD 138 solutions with A195615(OEIS)<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Problem 138
Consider the isosceles triangle with base length, b = 16, and legs, L = 17.
By using the Pythagorean theorem it can be seen that the height of the triangle, h = √(172 − 82) = 15... | |
b01bd1b21f1b12c9120845ec8a85355b038d6b20 | inventory_control/storage.py | inventory_control/storage.py | """
This is the Storage engine. It's how everything should talk to the database
layer that sits on the inside of the inventory-control system.
"""
import MySQLdb
class StorageEngine(object):
"""
Instantiate a DB access object, create all the necessary hooks and
then the accessors to a SQL database.
... | Add a basic Storage engine to talk to the DB | Add a basic Storage engine to talk to the DB
| Python | mit | codeforsanjose/inventory-control,worldcomputerxchange/inventory-control | Add a basic Storage engine to talk to the DB | """
This is the Storage engine. It's how everything should talk to the database
layer that sits on the inside of the inventory-control system.
"""
import MySQLdb
class StorageEngine(object):
"""
Instantiate a DB access object, create all the necessary hooks and
then the accessors to a SQL database.
... | <commit_before><commit_msg>Add a basic Storage engine to talk to the DB<commit_after> | """
This is the Storage engine. It's how everything should talk to the database
layer that sits on the inside of the inventory-control system.
"""
import MySQLdb
class StorageEngine(object):
"""
Instantiate a DB access object, create all the necessary hooks and
then the accessors to a SQL database.
... | Add a basic Storage engine to talk to the DB"""
This is the Storage engine. It's how everything should talk to the database
layer that sits on the inside of the inventory-control system.
"""
import MySQLdb
class StorageEngine(object):
"""
Instantiate a DB access object, create all the necessary hooks and
... | <commit_before><commit_msg>Add a basic Storage engine to talk to the DB<commit_after>"""
This is the Storage engine. It's how everything should talk to the database
layer that sits on the inside of the inventory-control system.
"""
import MySQLdb
class StorageEngine(object):
"""
Instantiate a DB access objec... | |
399daa8ebec14bc4d7ee6c08135e525190e1eb6f | collections/show-test/print-divs.py | collections/show-test/print-divs.py | # print-divs.py
def printDivs(num):
for i in range(num):
print('<div class="item">Item ' + str(i+1) + '</div>')
printDivs(20) | Add short Python script that prints as many dummy divs as needed. | Add short Python script that prints as many dummy divs as needed.
Used for idea testing; tracking rather than deleting b/c may still need to populate a layout with dozens of test divs, since many collections have 50+ items.
| Python | apache-2.0 | scholarslab/takeback,scholarslab/takeback,scholarslab/takeback,scholarslab/takeback,scholarslab/takeback | Add short Python script that prints as many dummy divs as needed.
Used for idea testing; tracking rather than deleting b/c may still need to populate a layout with dozens of test divs, since many collections have 50+ items. | # print-divs.py
def printDivs(num):
for i in range(num):
print('<div class="item">Item ' + str(i+1) + '</div>')
printDivs(20) | <commit_before><commit_msg>Add short Python script that prints as many dummy divs as needed.
Used for idea testing; tracking rather than deleting b/c may still need to populate a layout with dozens of test divs, since many collections have 50+ items.<commit_after> | # print-divs.py
def printDivs(num):
for i in range(num):
print('<div class="item">Item ' + str(i+1) + '</div>')
printDivs(20) | Add short Python script that prints as many dummy divs as needed.
Used for idea testing; tracking rather than deleting b/c may still need to populate a layout with dozens of test divs, since many collections have 50+ items.# print-divs.py
def printDivs(num):
for i in range(num):
print('<div class="item">Item ' + s... | <commit_before><commit_msg>Add short Python script that prints as many dummy divs as needed.
Used for idea testing; tracking rather than deleting b/c may still need to populate a layout with dozens of test divs, since many collections have 50+ items.<commit_after># print-divs.py
def printDivs(num):
for i in range(nu... | |
2b80b358edd5bcf914d0c709369dbbcfd748772b | common/djangoapps/mitxmako/tests.py | common/djangoapps/mitxmako/tests.py | from django.test import TestCase
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from django.conf import settings
from mitxmako.shortcuts import marketing_link
from mock import patch
class ShortcutsTests(TestCase):
"""
Test the mitxmako shortcuts file
"""
... | Add in a test for the marketing_link function in mitxmako | Add in a test for the marketing_link function in mitxmako
| Python | agpl-3.0 | polimediaupv/edx-platform,praveen-pal/edx-platform,pdehaye/theming-edx-platform,raccoongang/edx-platform,defance/edx-platform,atsolakid/edx-platform,Softmotions/edx-platform,IONISx/edx-platform,ampax/edx-platform,LICEF/edx-platform,IndonesiaX/edx-platform,abdoosh00/edraak,chudaol/edx-platform,morpheby/levelup-by,raccoo... | Add in a test for the marketing_link function in mitxmako | from django.test import TestCase
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from django.conf import settings
from mitxmako.shortcuts import marketing_link
from mock import patch
class ShortcutsTests(TestCase):
"""
Test the mitxmako shortcuts file
"""
... | <commit_before><commit_msg>Add in a test for the marketing_link function in mitxmako<commit_after> | from django.test import TestCase
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from django.conf import settings
from mitxmako.shortcuts import marketing_link
from mock import patch
class ShortcutsTests(TestCase):
"""
Test the mitxmako shortcuts file
"""
... | Add in a test for the marketing_link function in mitxmakofrom django.test import TestCase
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from django.conf import settings
from mitxmako.shortcuts import marketing_link
from mock import patch
class ShortcutsTests(TestCase):
... | <commit_before><commit_msg>Add in a test for the marketing_link function in mitxmako<commit_after>from django.test import TestCase
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from django.conf import settings
from mitxmako.shortcuts import marketing_link
from mock import ... | |
e9f2e966361d8a23c83fbbbb4a4b3d4046203a16 | CERR_core/Contouring/models/heart/test/test.py | CERR_core/Contouring/models/heart/test/test.py | #Test script for heart container testing if all the imports are successful
import sys
import os
import numpy as np
import h5py
import fnmatch
from modeling.sync_batchnorm.replicate import patch_replication_callback
from modeling.deeplab import *
from torchvision.utils import make_grid
from dataloaders.utils import dec... | Test script for the heart container | Test script for the heart container
| Python | lgpl-2.1 | cerr/CERR,cerr/CERR,cerr/CERR,aditiiyer/CERR,aditiiyer/CERR,aditiiyer/CERR,aditiiyer/CERR,cerr/CERR,cerr/CERR,cerr/CERR,aditiiyer/CERR,cerr/CERR,aditiiyer/CERR,cerr/CERR,aditiiyer/CERR,cerr/CERR,aditiiyer/CERR | Test script for the heart container | #Test script for heart container testing if all the imports are successful
import sys
import os
import numpy as np
import h5py
import fnmatch
from modeling.sync_batchnorm.replicate import patch_replication_callback
from modeling.deeplab import *
from torchvision.utils import make_grid
from dataloaders.utils import dec... | <commit_before><commit_msg>Test script for the heart container<commit_after> | #Test script for heart container testing if all the imports are successful
import sys
import os
import numpy as np
import h5py
import fnmatch
from modeling.sync_batchnorm.replicate import patch_replication_callback
from modeling.deeplab import *
from torchvision.utils import make_grid
from dataloaders.utils import dec... | Test script for the heart container#Test script for heart container testing if all the imports are successful
import sys
import os
import numpy as np
import h5py
import fnmatch
from modeling.sync_batchnorm.replicate import patch_replication_callback
from modeling.deeplab import *
from torchvision.utils import make_gri... | <commit_before><commit_msg>Test script for the heart container<commit_after>#Test script for heart container testing if all the imports are successful
import sys
import os
import numpy as np
import h5py
import fnmatch
from modeling.sync_batchnorm.replicate import patch_replication_callback
from modeling.deeplab import... | |
b223c8be2bcb11d529a07997c05a9c5ab2b183b2 | csunplugged/tests/resources/generators/test_run_length_encoding.py | csunplugged/tests/resources/generators/test_run_length_encoding.py | from unittest import mock
from django.http import QueryDict
from django.test import tag
from resources.generators.RunLengthEncodingResourceGenerator import RunLengthEncodingResourceGenerator
from tests.resources.generators.utils import BaseGeneratorTest
@tag("resource")
class RunLengthEncodingResourceGeneratorTest(Ba... | Add basic tests for run length encoding printable | Add basic tests for run length encoding printable
| Python | mit | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | Add basic tests for run length encoding printable | from unittest import mock
from django.http import QueryDict
from django.test import tag
from resources.generators.RunLengthEncodingResourceGenerator import RunLengthEncodingResourceGenerator
from tests.resources.generators.utils import BaseGeneratorTest
@tag("resource")
class RunLengthEncodingResourceGeneratorTest(Ba... | <commit_before><commit_msg>Add basic tests for run length encoding printable<commit_after> | from unittest import mock
from django.http import QueryDict
from django.test import tag
from resources.generators.RunLengthEncodingResourceGenerator import RunLengthEncodingResourceGenerator
from tests.resources.generators.utils import BaseGeneratorTest
@tag("resource")
class RunLengthEncodingResourceGeneratorTest(Ba... | Add basic tests for run length encoding printablefrom unittest import mock
from django.http import QueryDict
from django.test import tag
from resources.generators.RunLengthEncodingResourceGenerator import RunLengthEncodingResourceGenerator
from tests.resources.generators.utils import BaseGeneratorTest
@tag("resource"... | <commit_before><commit_msg>Add basic tests for run length encoding printable<commit_after>from unittest import mock
from django.http import QueryDict
from django.test import tag
from resources.generators.RunLengthEncodingResourceGenerator import RunLengthEncodingResourceGenerator
from tests.resources.generators.utils i... | |
4569c22d2d0245641e0c2696f798f273405c6bee | test_add_group.py | test_add_group.py | # -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class test_add_group(unitt... | Test recorded and exported to the project | Test recorded and exported to the project
| Python | mit | spcartman/python_qa | Test recorded and exported to the project | # -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class test_add_group(unitt... | <commit_before><commit_msg>Test recorded and exported to the project<commit_after> | # -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class test_add_group(unitt... | Test recorded and exported to the project# -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
... | <commit_before><commit_msg>Test recorded and exported to the project<commit_after># -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().tex... | |
c16620dffd2cd6396eb6b7db76a9c29849a16500 | components/lie_structures/lie_structures/cheminfo_descriptors.py | components/lie_structures/lie_structures/cheminfo_descriptors.py | # -*- coding: utf-8 -*-
"""
file: cheminfo_molhandle.py
Cinfony driven cheminformatics fingerprint functions
"""
import logging
from twisted.logger import Logger
from . import toolkits
logging = Logger()
def available_descriptors():
"""
List available molecular descriptors for all active cheminformatics... | Add support for cheminformatics descriptors | Add support for cheminformatics descriptors
| Python | apache-2.0 | MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio,MD-Studio/MDStudio | Add support for cheminformatics descriptors | # -*- coding: utf-8 -*-
"""
file: cheminfo_molhandle.py
Cinfony driven cheminformatics fingerprint functions
"""
import logging
from twisted.logger import Logger
from . import toolkits
logging = Logger()
def available_descriptors():
"""
List available molecular descriptors for all active cheminformatics... | <commit_before><commit_msg>Add support for cheminformatics descriptors<commit_after> | # -*- coding: utf-8 -*-
"""
file: cheminfo_molhandle.py
Cinfony driven cheminformatics fingerprint functions
"""
import logging
from twisted.logger import Logger
from . import toolkits
logging = Logger()
def available_descriptors():
"""
List available molecular descriptors for all active cheminformatics... | Add support for cheminformatics descriptors# -*- coding: utf-8 -*-
"""
file: cheminfo_molhandle.py
Cinfony driven cheminformatics fingerprint functions
"""
import logging
from twisted.logger import Logger
from . import toolkits
logging = Logger()
def available_descriptors():
"""
List available molecular... | <commit_before><commit_msg>Add support for cheminformatics descriptors<commit_after># -*- coding: utf-8 -*-
"""
file: cheminfo_molhandle.py
Cinfony driven cheminformatics fingerprint functions
"""
import logging
from twisted.logger import Logger
from . import toolkits
logging = Logger()
def available_descriptor... | |
ee3e04d32e39d6ac7ef4ac7abc2363a1ac9b8917 | example_music.py | example_music.py | from screenfactory import create_screen
from modules.music import Music
import config
import time
import pygame
screen = create_screen()
music = Music(screen)
music.start()
while True:
if config.virtual_hardware:
pygame.time.wait(10)
for event in pygame.event.get():
pass
else:
time.sleep(0.01) | Add an example for the music module | Add an example for the music module
| Python | mit | derblub/pixelpi,marian42/pixelpi,derblub/pixelpi,derblub/pixelpi,marian42/pixelpi | Add an example for the music module | from screenfactory import create_screen
from modules.music import Music
import config
import time
import pygame
screen = create_screen()
music = Music(screen)
music.start()
while True:
if config.virtual_hardware:
pygame.time.wait(10)
for event in pygame.event.get():
pass
else:
time.sleep(0.01) | <commit_before><commit_msg>Add an example for the music module<commit_after> | from screenfactory import create_screen
from modules.music import Music
import config
import time
import pygame
screen = create_screen()
music = Music(screen)
music.start()
while True:
if config.virtual_hardware:
pygame.time.wait(10)
for event in pygame.event.get():
pass
else:
time.sleep(0.01) | Add an example for the music modulefrom screenfactory import create_screen
from modules.music import Music
import config
import time
import pygame
screen = create_screen()
music = Music(screen)
music.start()
while True:
if config.virtual_hardware:
pygame.time.wait(10)
for event in pygame.event.get():
pass
e... | <commit_before><commit_msg>Add an example for the music module<commit_after>from screenfactory import create_screen
from modules.music import Music
import config
import time
import pygame
screen = create_screen()
music = Music(screen)
music.start()
while True:
if config.virtual_hardware:
pygame.time.wait(10)
fo... | |
05c7d62e0e26000440e72d0700c9806d7a409744 | games/migrations/0023_auto_20171104_2246.py | games/migrations/0023_auto_20171104_2246.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-11-04 21:46
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('games', '0022_installer_reason'),
]
operations = [... | Add migrations for game change suggestions | Add migrations for game change suggestions
| Python | agpl-3.0 | lutris/website,lutris/website,lutris/website,lutris/website | Add migrations for game change suggestions | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-11-04 21:46
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('games', '0022_installer_reason'),
]
operations = [... | <commit_before><commit_msg>Add migrations for game change suggestions<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-11-04 21:46
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('games', '0022_installer_reason'),
]
operations = [... | Add migrations for game change suggestions# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-11-04 21:46
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('games', '0022_ins... | <commit_before><commit_msg>Add migrations for game change suggestions<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-11-04 21:46
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dep... | |
db41bce3d90cfada9916baa8f9267cd9e6160a94 | examples/open_file.py | examples/open_file.py | import numpy as np
import pyh5md
f = pyh5md.H5MD_File('poc.h5', 'r')
at = f.trajectory('atoms')
at_pos = at.data('position')
r = at_pos.v.value
print r
f.f.close()
| Add an example for opening a file. | Add an example for opening a file.
| Python | bsd-3-clause | MrTheodor/pyh5md,khinsen/pyh5md | Add an example for opening a file. | import numpy as np
import pyh5md
f = pyh5md.H5MD_File('poc.h5', 'r')
at = f.trajectory('atoms')
at_pos = at.data('position')
r = at_pos.v.value
print r
f.f.close()
| <commit_before><commit_msg>Add an example for opening a file.<commit_after> | import numpy as np
import pyh5md
f = pyh5md.H5MD_File('poc.h5', 'r')
at = f.trajectory('atoms')
at_pos = at.data('position')
r = at_pos.v.value
print r
f.f.close()
| Add an example for opening a file.import numpy as np
import pyh5md
f = pyh5md.H5MD_File('poc.h5', 'r')
at = f.trajectory('atoms')
at_pos = at.data('position')
r = at_pos.v.value
print r
f.f.close()
| <commit_before><commit_msg>Add an example for opening a file.<commit_after>import numpy as np
import pyh5md
f = pyh5md.H5MD_File('poc.h5', 'r')
at = f.trajectory('atoms')
at_pos = at.data('position')
r = at_pos.v.value
print r
f.f.close()
| |
10eb703867fd10df543a141837c2a57d1052ba2c | ideascube/conf/kb_civ_babylab.py | ideascube/conf/kb_civ_babylab.py | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
from django.utils.translation import ugettext_lazy as _
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'BabyLab'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'bsfcampus',
... | Rename file with correct pattern | Rename file with correct pattern
| Python | agpl-3.0 | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | Rename file with correct pattern | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
from django.utils.translation import ugettext_lazy as _
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'BabyLab'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'bsfcampus',
... | <commit_before><commit_msg>Rename file with correct pattern<commit_after> | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
from django.utils.translation import ugettext_lazy as _
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'BabyLab'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'bsfcampus',
... | Rename file with correct pattern# -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
from django.utils.translation import ugettext_lazy as _
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'BabyLab'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
... | <commit_before><commit_msg>Rename file with correct pattern<commit_after># -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
from django.utils.translation import ugettext_lazy as _
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'BabyLab'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
... | |
35317e778b2fe1d238e21954df1eac0c5380b00b | generate_horoscope.py | generate_horoscope.py | #!/usr/bin/env python3
# encoding: utf-8
import argparse
import sqlite3
import sys
"""generate_horoscope.py: Generates horoscopes based provided corpuses"""
__author__ = "Project Zodiacy"
__copyright__ = "Copyright 2015, Project Zodiacy"
_parser = argparse.ArgumentParser(description="Awesome SQLite importer")
_pars... | Add corpus fetch from database | Add corpus fetch from database
Former-commit-id: 2241247b60e2829003059f8c9d7d7c72b3e49951 | Python | mit | greenify/zodiacy,greenify/zodiacy | Add corpus fetch from database
Former-commit-id: 2241247b60e2829003059f8c9d7d7c72b3e49951 | #!/usr/bin/env python3
# encoding: utf-8
import argparse
import sqlite3
import sys
"""generate_horoscope.py: Generates horoscopes based provided corpuses"""
__author__ = "Project Zodiacy"
__copyright__ = "Copyright 2015, Project Zodiacy"
_parser = argparse.ArgumentParser(description="Awesome SQLite importer")
_pars... | <commit_before><commit_msg>Add corpus fetch from database
Former-commit-id: 2241247b60e2829003059f8c9d7d7c72b3e49951<commit_after> | #!/usr/bin/env python3
# encoding: utf-8
import argparse
import sqlite3
import sys
"""generate_horoscope.py: Generates horoscopes based provided corpuses"""
__author__ = "Project Zodiacy"
__copyright__ = "Copyright 2015, Project Zodiacy"
_parser = argparse.ArgumentParser(description="Awesome SQLite importer")
_pars... | Add corpus fetch from database
Former-commit-id: 2241247b60e2829003059f8c9d7d7c72b3e49951#!/usr/bin/env python3
# encoding: utf-8
import argparse
import sqlite3
import sys
"""generate_horoscope.py: Generates horoscopes based provided corpuses"""
__author__ = "Project Zodiacy"
__copyright__ = "Copyright 2015, Proje... | <commit_before><commit_msg>Add corpus fetch from database
Former-commit-id: 2241247b60e2829003059f8c9d7d7c72b3e49951<commit_after>#!/usr/bin/env python3
# encoding: utf-8
import argparse
import sqlite3
import sys
"""generate_horoscope.py: Generates horoscopes based provided corpuses"""
__author__ = "Project Zodiac... | |
c0ab9b755b4906129988348b2247452b6dfc157f | plugins/modules/dedicated_server_display_name.py | plugins/modules/dedicated_server_display_name.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
from ansible.module_utils.basic import AnsibleModule
__metaclass__ = type
DOCUMENTATION = '''
---
module: dedicated_server_display_name
short_description: Modify the server display name in ovh manager
descri... | Add a module to set the "display name" of a dedicated server | INFRA-6896: Add a module to set the "display name" of a dedicated server
- Change the "display name" in ovh manager, so you can use your internal
naming for example
- No need to set internal names in reverse dns anymore
- Change is only visible in OVH manager (and API, of course)
| Python | mit | synthesio/infra-ovh-ansible-module | INFRA-6896: Add a module to set the "display name" of a dedicated server
- Change the "display name" in ovh manager, so you can use your internal
naming for example
- No need to set internal names in reverse dns anymore
- Change is only visible in OVH manager (and API, of course) | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
from ansible.module_utils.basic import AnsibleModule
__metaclass__ = type
DOCUMENTATION = '''
---
module: dedicated_server_display_name
short_description: Modify the server display name in ovh manager
descri... | <commit_before><commit_msg>INFRA-6896: Add a module to set the "display name" of a dedicated server
- Change the "display name" in ovh manager, so you can use your internal
naming for example
- No need to set internal names in reverse dns anymore
- Change is only visible in OVH manager (and API, of course)<commit_afte... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
from ansible.module_utils.basic import AnsibleModule
__metaclass__ = type
DOCUMENTATION = '''
---
module: dedicated_server_display_name
short_description: Modify the server display name in ovh manager
descri... | INFRA-6896: Add a module to set the "display name" of a dedicated server
- Change the "display name" in ovh manager, so you can use your internal
naming for example
- No need to set internal names in reverse dns anymore
- Change is only visible in OVH manager (and API, of course)#!/usr/bin/python
# -*- coding: utf-8 -... | <commit_before><commit_msg>INFRA-6896: Add a module to set the "display name" of a dedicated server
- Change the "display name" in ovh manager, so you can use your internal
naming for example
- No need to set internal names in reverse dns anymore
- Change is only visible in OVH manager (and API, of course)<commit_afte... | |
8fbc5877fa97b6b8df621ff7afe7515b501660fc | LeetCode/ConvertStringToCamelCase.py | LeetCode/ConvertStringToCamelCase.py | def to_camel_case(text):
if len(text) < 2:
return text
capped_camel = "".join([word.title() for word in text.replace('-','_').split('_')])
return capped_camel if text[0].isupper() else capped_camel[0].lower()+capped_camel[1:]
| Convert string to camel case | Codewars: Convert string to camel case
| Python | unlicense | SelvorWhim/competitive,SelvorWhim/competitive,SelvorWhim/competitive,SelvorWhim/competitive | Codewars: Convert string to camel case | def to_camel_case(text):
if len(text) < 2:
return text
capped_camel = "".join([word.title() for word in text.replace('-','_').split('_')])
return capped_camel if text[0].isupper() else capped_camel[0].lower()+capped_camel[1:]
| <commit_before><commit_msg>Codewars: Convert string to camel case<commit_after> | def to_camel_case(text):
if len(text) < 2:
return text
capped_camel = "".join([word.title() for word in text.replace('-','_').split('_')])
return capped_camel if text[0].isupper() else capped_camel[0].lower()+capped_camel[1:]
| Codewars: Convert string to camel casedef to_camel_case(text):
if len(text) < 2:
return text
capped_camel = "".join([word.title() for word in text.replace('-','_').split('_')])
return capped_camel if text[0].isupper() else capped_camel[0].lower()+capped_camel[1:]
| <commit_before><commit_msg>Codewars: Convert string to camel case<commit_after>def to_camel_case(text):
if len(text) < 2:
return text
capped_camel = "".join([word.title() for word in text.replace('-','_').split('_')])
return capped_camel if text[0].isupper() else capped_camel[0].lower()+capped_camel... | |
4fbb9ca1b055b040214c82dc307f69793947b800 | api/sync_wallet.py | api/sync_wallet.py | import urlparse
import os, sys
import json
tools_dir = os.environ.get('TOOLSDIR')
lib_path = os.path.abspath(tools_dir)
sys.path.append(lib_path)
from msc_apps import *
data_dir_root = os.environ.get('DATADIR')
def sync_wallet_response(request_dict):
if not request_dict.has_key('type'):
return (None, 'No field ... | Add handler for syncing wallets to server | Add handler for syncing wallets to server
| Python | agpl-3.0 | habibmasuro/omniwallet,VukDukic/omniwallet,dexX7/omniwallet,FuzzyBearBTC/omniwallet,Nevtep/omniwallet,OmniLayer/omniwallet,arowser/omniwallet,FuzzyBearBTC/omniwallet,ripper234/omniwallet,achamely/omniwallet,FuzzyBearBTC/omniwallet,arowser/omniwallet,OmniLayer/omniwallet,OmniLayer/omniwallet,maran/omniwallet,maran/omniw... | Add handler for syncing wallets to server | import urlparse
import os, sys
import json
tools_dir = os.environ.get('TOOLSDIR')
lib_path = os.path.abspath(tools_dir)
sys.path.append(lib_path)
from msc_apps import *
data_dir_root = os.environ.get('DATADIR')
def sync_wallet_response(request_dict):
if not request_dict.has_key('type'):
return (None, 'No field ... | <commit_before><commit_msg>Add handler for syncing wallets to server<commit_after> | import urlparse
import os, sys
import json
tools_dir = os.environ.get('TOOLSDIR')
lib_path = os.path.abspath(tools_dir)
sys.path.append(lib_path)
from msc_apps import *
data_dir_root = os.environ.get('DATADIR')
def sync_wallet_response(request_dict):
if not request_dict.has_key('type'):
return (None, 'No field ... | Add handler for syncing wallets to serverimport urlparse
import os, sys
import json
tools_dir = os.environ.get('TOOLSDIR')
lib_path = os.path.abspath(tools_dir)
sys.path.append(lib_path)
from msc_apps import *
data_dir_root = os.environ.get('DATADIR')
def sync_wallet_response(request_dict):
if not request_dict.has_... | <commit_before><commit_msg>Add handler for syncing wallets to server<commit_after>import urlparse
import os, sys
import json
tools_dir = os.environ.get('TOOLSDIR')
lib_path = os.path.abspath(tools_dir)
sys.path.append(lib_path)
from msc_apps import *
data_dir_root = os.environ.get('DATADIR')
def sync_wallet_response(... | |
613a0056e12a28232542aaf561831d276868e413 | programs/kinbody-creator/openraveMapGenerator.py | programs/kinbody-creator/openraveMapGenerator.py | #!/usr/bin/python
#import lxml.etree
#import lxml.builder
from lxml import etree
#E = lxml.builder.ElementMaker()
#KINBODY=E.KinBody
#BODY=E.Body
#GEOM=E.Geom
#EXTENTS=E.Extents
#TRANSLATION=E.Translation
#DIFUSSECOLOR=E.diffuseColor
# User variables
nX = 3
nY = 2
boxHeight = 1.0
resolution = 2.0 # Just to make s... | Add parametric map generator, good for wrinkles | Add parametric map generator, good for wrinkles | Python | lgpl-2.1 | roboticslab-uc3m/xgnitive,roboticslab-uc3m/xgnitive,roboticslab-uc3m/xgnitive | Add parametric map generator, good for wrinkles | #!/usr/bin/python
#import lxml.etree
#import lxml.builder
from lxml import etree
#E = lxml.builder.ElementMaker()
#KINBODY=E.KinBody
#BODY=E.Body
#GEOM=E.Geom
#EXTENTS=E.Extents
#TRANSLATION=E.Translation
#DIFUSSECOLOR=E.diffuseColor
# User variables
nX = 3
nY = 2
boxHeight = 1.0
resolution = 2.0 # Just to make s... | <commit_before><commit_msg>Add parametric map generator, good for wrinkles<commit_after> | #!/usr/bin/python
#import lxml.etree
#import lxml.builder
from lxml import etree
#E = lxml.builder.ElementMaker()
#KINBODY=E.KinBody
#BODY=E.Body
#GEOM=E.Geom
#EXTENTS=E.Extents
#TRANSLATION=E.Translation
#DIFUSSECOLOR=E.diffuseColor
# User variables
nX = 3
nY = 2
boxHeight = 1.0
resolution = 2.0 # Just to make s... | Add parametric map generator, good for wrinkles#!/usr/bin/python
#import lxml.etree
#import lxml.builder
from lxml import etree
#E = lxml.builder.ElementMaker()
#KINBODY=E.KinBody
#BODY=E.Body
#GEOM=E.Geom
#EXTENTS=E.Extents
#TRANSLATION=E.Translation
#DIFUSSECOLOR=E.diffuseColor
# User variables
nX = 3
nY = 2
boxH... | <commit_before><commit_msg>Add parametric map generator, good for wrinkles<commit_after>#!/usr/bin/python
#import lxml.etree
#import lxml.builder
from lxml import etree
#E = lxml.builder.ElementMaker()
#KINBODY=E.KinBody
#BODY=E.Body
#GEOM=E.Geom
#EXTENTS=E.Extents
#TRANSLATION=E.Translation
#DIFUSSECOLOR=E.diffuseC... | |
e262d176ecd7d8871a9e06ebc542cf473acf0925 | reports/migrations/0004_transnational_weights.py | reports/migrations/0004_transnational_weights.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from django_countries import countries
def populate_weights(apps, schema_editor):
Weights = apps.get_model("reports", "Weights")
db_alias = schema_editor.connection.alias
for item in COUNTRY_WEIGHTS:
... | Add migration for transnational weights | Add migration for transnational weights
| Python | apache-2.0 | Code4SA/gmmp,Code4SA/gmmp,Code4SA/gmmp | Add migration for transnational weights | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from django_countries import countries
def populate_weights(apps, schema_editor):
Weights = apps.get_model("reports", "Weights")
db_alias = schema_editor.connection.alias
for item in COUNTRY_WEIGHTS:
... | <commit_before><commit_msg>Add migration for transnational weights<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from django_countries import countries
def populate_weights(apps, schema_editor):
Weights = apps.get_model("reports", "Weights")
db_alias = schema_editor.connection.alias
for item in COUNTRY_WEIGHTS:
... | Add migration for transnational weights# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from django_countries import countries
def populate_weights(apps, schema_editor):
Weights = apps.get_model("reports", "Weights")
db_alias = schema_editor.connection.alias
... | <commit_before><commit_msg>Add migration for transnational weights<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from django_countries import countries
def populate_weights(apps, schema_editor):
Weights = apps.get_model("reports", "Weights")
db_a... | |
b0577ce3b8b162ce3702430b189905f9beaae8d5 | firecares/firestation/management/commands/cleanup_phonenumbers.py | firecares/firestation/management/commands/cleanup_phonenumbers.py | from django.core.management.base import BaseCommand
from firecares.firestation.models import FireDepartment
from phonenumber_field.modelfields import PhoneNumber
import re
"""
This command is for cleaning up every phone and fax number in the
database. It removes all non-numeric characters, such as parenthesis,
hyphens... | Add script to clean up all FD phone and fax numbers. | Add script to clean up all FD phone and fax numbers.
| Python | mit | FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares | Add script to clean up all FD phone and fax numbers. | from django.core.management.base import BaseCommand
from firecares.firestation.models import FireDepartment
from phonenumber_field.modelfields import PhoneNumber
import re
"""
This command is for cleaning up every phone and fax number in the
database. It removes all non-numeric characters, such as parenthesis,
hyphens... | <commit_before><commit_msg>Add script to clean up all FD phone and fax numbers.<commit_after> | from django.core.management.base import BaseCommand
from firecares.firestation.models import FireDepartment
from phonenumber_field.modelfields import PhoneNumber
import re
"""
This command is for cleaning up every phone and fax number in the
database. It removes all non-numeric characters, such as parenthesis,
hyphens... | Add script to clean up all FD phone and fax numbers.from django.core.management.base import BaseCommand
from firecares.firestation.models import FireDepartment
from phonenumber_field.modelfields import PhoneNumber
import re
"""
This command is for cleaning up every phone and fax number in the
database. It removes all ... | <commit_before><commit_msg>Add script to clean up all FD phone and fax numbers.<commit_after>from django.core.management.base import BaseCommand
from firecares.firestation.models import FireDepartment
from phonenumber_field.modelfields import PhoneNumber
import re
"""
This command is for cleaning up every phone and fa... | |
d5d3fcfb331c1486acbfb004705b94b1923a0db8 | Codes/SuperEdge/SuperEdge/dump_libsvm.py | Codes/SuperEdge/SuperEdge/dump_libsvm.py | import numpy as np
from datetime import datetime
from sklearn.datasets import dump_svmlight_file
import os.path as path
def main():
cache_path = 'largecache/'
feat_name = 'feat.dat'
lbl_name = 'lbl.dat'
feat_len = 4224 #1088
now = datetime.now()
lbl_memmap = np.memmap(path.join(cache_path, lbl_... | Add code to dump features into libsvm file format | [Code] Add code to dump features into libsvm file format
| Python | mit | erfannoury/SuperEdge,erfannoury/SuperEdge,erfannoury/SuperEdge,erfannoury/SuperEdge,erfannoury/SuperEdge | [Code] Add code to dump features into libsvm file format | import numpy as np
from datetime import datetime
from sklearn.datasets import dump_svmlight_file
import os.path as path
def main():
cache_path = 'largecache/'
feat_name = 'feat.dat'
lbl_name = 'lbl.dat'
feat_len = 4224 #1088
now = datetime.now()
lbl_memmap = np.memmap(path.join(cache_path, lbl_... | <commit_before><commit_msg>[Code] Add code to dump features into libsvm file format<commit_after> | import numpy as np
from datetime import datetime
from sklearn.datasets import dump_svmlight_file
import os.path as path
def main():
cache_path = 'largecache/'
feat_name = 'feat.dat'
lbl_name = 'lbl.dat'
feat_len = 4224 #1088
now = datetime.now()
lbl_memmap = np.memmap(path.join(cache_path, lbl_... | [Code] Add code to dump features into libsvm file formatimport numpy as np
from datetime import datetime
from sklearn.datasets import dump_svmlight_file
import os.path as path
def main():
cache_path = 'largecache/'
feat_name = 'feat.dat'
lbl_name = 'lbl.dat'
feat_len = 4224 #1088
now = datetime.now... | <commit_before><commit_msg>[Code] Add code to dump features into libsvm file format<commit_after>import numpy as np
from datetime import datetime
from sklearn.datasets import dump_svmlight_file
import os.path as path
def main():
cache_path = 'largecache/'
feat_name = 'feat.dat'
lbl_name = 'lbl.dat'
fea... | |
a2516d28c86fd23efcb893e59de42b33526bfe6f | swig/tkgui.py | swig/tkgui.py | #!/usr/bin/env python
import Tkinter
import sys
import mapper
def on_gui_change(x):
# print 'on_gui_change',x,x.__class__
sig_out.update_scalar(int(x))
def on_mapper_change(sig, x):
# print 'on_mapper_change', x, x.__class__
w.set(int(x))
dev = mapper.device("tkgui", 9000)
sig_in = mapper.signal(1, "... | Add a Python Tkinter example showing how to map a scale widget. | swig: Add a Python Tkinter example showing how to map a scale widget.
| Python | lgpl-2.1 | davidhernon/libmapper,johnty/libmapper,davidhernon/libmapper,radarsat1/libmapper,malloch/libmapper,malloch/libmapper,radarsat1/libmapper,libmapper/libmapper,radarsat1/libmapper,davidhernon/libmapper-admin2,johnty/libmapper,johnty/libmapper,malloch/libmapper,johnty/libmapper,radarsat1/libmapper,radarsat1/libmapper,libma... | swig: Add a Python Tkinter example showing how to map a scale widget. | #!/usr/bin/env python
import Tkinter
import sys
import mapper
def on_gui_change(x):
# print 'on_gui_change',x,x.__class__
sig_out.update_scalar(int(x))
def on_mapper_change(sig, x):
# print 'on_mapper_change', x, x.__class__
w.set(int(x))
dev = mapper.device("tkgui", 9000)
sig_in = mapper.signal(1, "... | <commit_before><commit_msg>swig: Add a Python Tkinter example showing how to map a scale widget.<commit_after> | #!/usr/bin/env python
import Tkinter
import sys
import mapper
def on_gui_change(x):
# print 'on_gui_change',x,x.__class__
sig_out.update_scalar(int(x))
def on_mapper_change(sig, x):
# print 'on_mapper_change', x, x.__class__
w.set(int(x))
dev = mapper.device("tkgui", 9000)
sig_in = mapper.signal(1, "... | swig: Add a Python Tkinter example showing how to map a scale widget.#!/usr/bin/env python
import Tkinter
import sys
import mapper
def on_gui_change(x):
# print 'on_gui_change',x,x.__class__
sig_out.update_scalar(int(x))
def on_mapper_change(sig, x):
# print 'on_mapper_change', x, x.__class__
w.set(int... | <commit_before><commit_msg>swig: Add a Python Tkinter example showing how to map a scale widget.<commit_after>#!/usr/bin/env python
import Tkinter
import sys
import mapper
def on_gui_change(x):
# print 'on_gui_change',x,x.__class__
sig_out.update_scalar(int(x))
def on_mapper_change(sig, x):
# print 'on_map... | |
4c3c9c6929ebc3f439ccf3bb7d3696f484b154bc | karspexet/ticket/migrations/0017_positive_integers_20180322_2056.py | karspexet/ticket/migrations/0017_positive_integers_20180322_2056.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2018-03-22 19:56
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ticket', '0016_add_voucher_note_20180213_2307'),
]
op... | Add missing noop-migrations for PositiveIntegerField | Add missing noop-migrations for PositiveIntegerField
| Python | mit | Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet | Add missing noop-migrations for PositiveIntegerField | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2018-03-22 19:56
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ticket', '0016_add_voucher_note_20180213_2307'),
]
op... | <commit_before><commit_msg>Add missing noop-migrations for PositiveIntegerField<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2018-03-22 19:56
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ticket', '0016_add_voucher_note_20180213_2307'),
]
op... | Add missing noop-migrations for PositiveIntegerField# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2018-03-22 19:56
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ticket', '... | <commit_before><commit_msg>Add missing noop-migrations for PositiveIntegerField<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2018-03-22 19:56
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
... | |
af508daaf016b824c7518a36f9b92f571f0f65af | nodeconductor/structure/management/commands/init_balance_history.py | nodeconductor/structure/management/commands/init_balance_history.py | from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from nodeconductor.structure.models import BalanceHistory
from nodeconductor.structure.models import Customer
class Command(BaseCommand):
help = """ Initialize demo records of balance history """... | Implement management command for creating demo records of balance history (NC-842) | Implement management command for creating demo records of balance history (NC-842)
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | Implement management command for creating demo records of balance history (NC-842) | from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from nodeconductor.structure.models import BalanceHistory
from nodeconductor.structure.models import Customer
class Command(BaseCommand):
help = """ Initialize demo records of balance history """... | <commit_before><commit_msg>Implement management command for creating demo records of balance history (NC-842)<commit_after> | from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from nodeconductor.structure.models import BalanceHistory
from nodeconductor.structure.models import Customer
class Command(BaseCommand):
help = """ Initialize demo records of balance history """... | Implement management command for creating demo records of balance history (NC-842)from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from nodeconductor.structure.models import BalanceHistory
from nodeconductor.structure.models import Customer
class C... | <commit_before><commit_msg>Implement management command for creating demo records of balance history (NC-842)<commit_after>from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from nodeconductor.structure.models import BalanceHistory
from nodeconductor.s... | |
1765ac3a12ea2a56b4e25e05cf1f1b531de5b2cf | pyexternal.py | pyexternal.py | #!/usr/bin/env python
# Get External Temperature from OpenWeatherMap
# External informations are :
# - temperature
# - humidity
# - pressure
# - precipitation volume (each 3h)
import urllib.request
import json
import pyowm
from datetime import datetime
from pyserial import pySerial
from imports.pyTemperature import p... | Add External Temperature Probe from OpenWeather | Add External Temperature Probe from OpenWeather
| Python | mit | mattcongy/piprobe | Add External Temperature Probe from OpenWeather | #!/usr/bin/env python
# Get External Temperature from OpenWeatherMap
# External informations are :
# - temperature
# - humidity
# - pressure
# - precipitation volume (each 3h)
import urllib.request
import json
import pyowm
from datetime import datetime
from pyserial import pySerial
from imports.pyTemperature import p... | <commit_before><commit_msg>Add External Temperature Probe from OpenWeather<commit_after> | #!/usr/bin/env python
# Get External Temperature from OpenWeatherMap
# External informations are :
# - temperature
# - humidity
# - pressure
# - precipitation volume (each 3h)
import urllib.request
import json
import pyowm
from datetime import datetime
from pyserial import pySerial
from imports.pyTemperature import p... | Add External Temperature Probe from OpenWeather#!/usr/bin/env python
# Get External Temperature from OpenWeatherMap
# External informations are :
# - temperature
# - humidity
# - pressure
# - precipitation volume (each 3h)
import urllib.request
import json
import pyowm
from datetime import datetime
from pyserial impo... | <commit_before><commit_msg>Add External Temperature Probe from OpenWeather<commit_after>#!/usr/bin/env python
# Get External Temperature from OpenWeatherMap
# External informations are :
# - temperature
# - humidity
# - pressure
# - precipitation volume (each 3h)
import urllib.request
import json
import pyowm
from dat... | |
decf4b1916a421fe996a31feb131b7ed9e4e3c36 | numpy-benchmark-one.py | numpy-benchmark-one.py | import timeit
normal_py_sec = timeit.timeit('sum (x*x for x in xrange(1000))',number = 10000)
naive_np_sec = timeit.timeit('sum(na*na)',setup='import numpy as np; na=np.arange(1000)', number = 10000)
good_np_sec = timeit.timeit('na.dot(na)',setup='import numpy as np; na=np.arange(1000)', number = 10000)
print("Normal... | Add a simple benchmark script | Add a simple benchmark script
| Python | unlicense | abhimanyuma/ml-with-py | Add a simple benchmark script | import timeit
normal_py_sec = timeit.timeit('sum (x*x for x in xrange(1000))',number = 10000)
naive_np_sec = timeit.timeit('sum(na*na)',setup='import numpy as np; na=np.arange(1000)', number = 10000)
good_np_sec = timeit.timeit('na.dot(na)',setup='import numpy as np; na=np.arange(1000)', number = 10000)
print("Normal... | <commit_before><commit_msg>Add a simple benchmark script<commit_after> | import timeit
normal_py_sec = timeit.timeit('sum (x*x for x in xrange(1000))',number = 10000)
naive_np_sec = timeit.timeit('sum(na*na)',setup='import numpy as np; na=np.arange(1000)', number = 10000)
good_np_sec = timeit.timeit('na.dot(na)',setup='import numpy as np; na=np.arange(1000)', number = 10000)
print("Normal... | Add a simple benchmark scriptimport timeit
normal_py_sec = timeit.timeit('sum (x*x for x in xrange(1000))',number = 10000)
naive_np_sec = timeit.timeit('sum(na*na)',setup='import numpy as np; na=np.arange(1000)', number = 10000)
good_np_sec = timeit.timeit('na.dot(na)',setup='import numpy as np; na=np.arange(1000)', n... | <commit_before><commit_msg>Add a simple benchmark script<commit_after>import timeit
normal_py_sec = timeit.timeit('sum (x*x for x in xrange(1000))',number = 10000)
naive_np_sec = timeit.timeit('sum(na*na)',setup='import numpy as np; na=np.arange(1000)', number = 10000)
good_np_sec = timeit.timeit('na.dot(na)',setup='i... | |
98aee2af9aa3f7dcc75969f1ec3118c40539793e | pandoc-include-code.py | pandoc-include-code.py | #! /usr/bin/env python3
from sys import stdout, stderr, exit
import json
def walktransform(tree):
if isinstance(tree, list):
return [walktransform(subtree)
for subtree
in tree]
elif not isinstance(tree, dict):
exit('Unsupported AST node', type(tree))
elif i... | Add clone of Haskell version | pandoc-include-clone.py: Add clone of Haskell version
This at least doesn't require linking against anything, waiting for a
long compilation and installation with `cabal`, complaining about the
Pandoc API version in the latest GitHub release as of this writing, or
using up a gigabyte more disk space.
| Python | isc | pilona/Utils,pilona/Utils,pilona/Utils | pandoc-include-clone.py: Add clone of Haskell version
This at least doesn't require linking against anything, waiting for a
long compilation and installation with `cabal`, complaining about the
Pandoc API version in the latest GitHub release as of this writing, or
using up a gigabyte more disk space. | #! /usr/bin/env python3
from sys import stdout, stderr, exit
import json
def walktransform(tree):
if isinstance(tree, list):
return [walktransform(subtree)
for subtree
in tree]
elif not isinstance(tree, dict):
exit('Unsupported AST node', type(tree))
elif i... | <commit_before><commit_msg>pandoc-include-clone.py: Add clone of Haskell version
This at least doesn't require linking against anything, waiting for a
long compilation and installation with `cabal`, complaining about the
Pandoc API version in the latest GitHub release as of this writing, or
using up a gigabyte more di... | #! /usr/bin/env python3
from sys import stdout, stderr, exit
import json
def walktransform(tree):
if isinstance(tree, list):
return [walktransform(subtree)
for subtree
in tree]
elif not isinstance(tree, dict):
exit('Unsupported AST node', type(tree))
elif i... | pandoc-include-clone.py: Add clone of Haskell version
This at least doesn't require linking against anything, waiting for a
long compilation and installation with `cabal`, complaining about the
Pandoc API version in the latest GitHub release as of this writing, or
using up a gigabyte more disk space.#! /usr/bin/env py... | <commit_before><commit_msg>pandoc-include-clone.py: Add clone of Haskell version
This at least doesn't require linking against anything, waiting for a
long compilation and installation with `cabal`, complaining about the
Pandoc API version in the latest GitHub release as of this writing, or
using up a gigabyte more di... | |
70a6553d9323b3522e492c414b67e76111519368 | scripts/data_download/school_census/create_all_files.py | scripts/data_download/school_census/create_all_files.py | import os
import commands
import time
import logging
import sys
if len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']):
print "ERROR! Use:\n python scripts/data_download/school_census/create_files.py en/pt output_path\n"
exit()
logging.basicConfig(filename=os.path.abspath(os.path.join(sys.argv[2],str(... | Add file to create all files to school census. | Add file to create all files to school census.
| Python | mit | DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site | Add file to create all files to school census. | import os
import commands
import time
import logging
import sys
if len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']):
print "ERROR! Use:\n python scripts/data_download/school_census/create_files.py en/pt output_path\n"
exit()
logging.basicConfig(filename=os.path.abspath(os.path.join(sys.argv[2],str(... | <commit_before><commit_msg>Add file to create all files to school census.<commit_after> | import os
import commands
import time
import logging
import sys
if len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']):
print "ERROR! Use:\n python scripts/data_download/school_census/create_files.py en/pt output_path\n"
exit()
logging.basicConfig(filename=os.path.abspath(os.path.join(sys.argv[2],str(... | Add file to create all files to school census.import os
import commands
import time
import logging
import sys
if len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']):
print "ERROR! Use:\n python scripts/data_download/school_census/create_files.py en/pt output_path\n"
exit()
logging.basicConfig(filename... | <commit_before><commit_msg>Add file to create all files to school census.<commit_after>import os
import commands
import time
import logging
import sys
if len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']):
print "ERROR! Use:\n python scripts/data_download/school_census/create_files.py en/pt output_path\n"... | |
638ee09f0f2958a955fbad42368ffc6bb2a2688a | pipeline/scripts/bb_pipeline_api.py | pipeline/scripts/bb_pipeline_api.py | #!/usr/bin/env python3
from tempfile import NamedTemporaryFile
import json
from threading import Lock
import numpy as np
from flask import Flask, request
from scipy.misc import imread
from pipeline import Pipeline
from pipeline.objects import Image, Candidates, Saliencies, IDs
from pipeline.pipeline import get_auto_c... | Add minimal REST API script based on flask | Add minimal REST API script based on flask
| Python | apache-2.0 | BioroboticsLab/deeppipeline,BioroboticsLab/bb_pipeline,BioroboticsLab/deeppipeline | Add minimal REST API script based on flask | #!/usr/bin/env python3
from tempfile import NamedTemporaryFile
import json
from threading import Lock
import numpy as np
from flask import Flask, request
from scipy.misc import imread
from pipeline import Pipeline
from pipeline.objects import Image, Candidates, Saliencies, IDs
from pipeline.pipeline import get_auto_c... | <commit_before><commit_msg>Add minimal REST API script based on flask<commit_after> | #!/usr/bin/env python3
from tempfile import NamedTemporaryFile
import json
from threading import Lock
import numpy as np
from flask import Flask, request
from scipy.misc import imread
from pipeline import Pipeline
from pipeline.objects import Image, Candidates, Saliencies, IDs
from pipeline.pipeline import get_auto_c... | Add minimal REST API script based on flask#!/usr/bin/env python3
from tempfile import NamedTemporaryFile
import json
from threading import Lock
import numpy as np
from flask import Flask, request
from scipy.misc import imread
from pipeline import Pipeline
from pipeline.objects import Image, Candidates, Saliencies, ID... | <commit_before><commit_msg>Add minimal REST API script based on flask<commit_after>#!/usr/bin/env python3
from tempfile import NamedTemporaryFile
import json
from threading import Lock
import numpy as np
from flask import Flask, request
from scipy.misc import imread
from pipeline import Pipeline
from pipeline.objects... | |
70e14187ecd2567894e5e8183341a63835d6839c | data/pldm_variables.py | data/pldm_variables.py | #!/usr/bin/python
r"""
Contains PLDM-related constants.
"""
PLDM_TYPE_BASE = '00'
PLDM_TYPE_PLATFORM = '02'
PLDM_TYPE_BIOS = '03'
PLDM_TYPE_OEM = '3F'
PLDM_BASE_CMD = {
'GET_TID': '2',
'GET_PLDM_VERSION': '3',
'GET_PLDM_TYPES': '4',
'GET_PLDM_COMMANDS': '5'}
PLDM_SUCCESS = '00'
PLDM_ERROR = '01'
PL... | Create pldm related specific constants file. | Create pldm related specific constants file.
Change-Id: I3eda08d7ec1c0113931511f2d3539f2c658f7ad0
Signed-off-by: Sridevi Ramesh <cb5e1f81dd390dfc3a9afc08ab7298b7ab4296f5@in.ibm.com>
| Python | apache-2.0 | openbmc/openbmc-test-automation,openbmc/openbmc-test-automation | Create pldm related specific constants file.
Change-Id: I3eda08d7ec1c0113931511f2d3539f2c658f7ad0
Signed-off-by: Sridevi Ramesh <cb5e1f81dd390dfc3a9afc08ab7298b7ab4296f5@in.ibm.com> | #!/usr/bin/python
r"""
Contains PLDM-related constants.
"""
PLDM_TYPE_BASE = '00'
PLDM_TYPE_PLATFORM = '02'
PLDM_TYPE_BIOS = '03'
PLDM_TYPE_OEM = '3F'
PLDM_BASE_CMD = {
'GET_TID': '2',
'GET_PLDM_VERSION': '3',
'GET_PLDM_TYPES': '4',
'GET_PLDM_COMMANDS': '5'}
PLDM_SUCCESS = '00'
PLDM_ERROR = '01'
PL... | <commit_before><commit_msg>Create pldm related specific constants file.
Change-Id: I3eda08d7ec1c0113931511f2d3539f2c658f7ad0
Signed-off-by: Sridevi Ramesh <cb5e1f81dd390dfc3a9afc08ab7298b7ab4296f5@in.ibm.com><commit_after> | #!/usr/bin/python
r"""
Contains PLDM-related constants.
"""
PLDM_TYPE_BASE = '00'
PLDM_TYPE_PLATFORM = '02'
PLDM_TYPE_BIOS = '03'
PLDM_TYPE_OEM = '3F'
PLDM_BASE_CMD = {
'GET_TID': '2',
'GET_PLDM_VERSION': '3',
'GET_PLDM_TYPES': '4',
'GET_PLDM_COMMANDS': '5'}
PLDM_SUCCESS = '00'
PLDM_ERROR = '01'
PL... | Create pldm related specific constants file.
Change-Id: I3eda08d7ec1c0113931511f2d3539f2c658f7ad0
Signed-off-by: Sridevi Ramesh <cb5e1f81dd390dfc3a9afc08ab7298b7ab4296f5@in.ibm.com>#!/usr/bin/python
r"""
Contains PLDM-related constants.
"""
PLDM_TYPE_BASE = '00'
PLDM_TYPE_PLATFORM = '02'
PLDM_TYPE_BIOS = '03'
PLDM_... | <commit_before><commit_msg>Create pldm related specific constants file.
Change-Id: I3eda08d7ec1c0113931511f2d3539f2c658f7ad0
Signed-off-by: Sridevi Ramesh <cb5e1f81dd390dfc3a9afc08ab7298b7ab4296f5@in.ibm.com><commit_after>#!/usr/bin/python
r"""
Contains PLDM-related constants.
"""
PLDM_TYPE_BASE = '00'
PLDM_TYPE_PL... | |
8b42b0825d5cbb6becef9669b43a2c8229ea8642 | remove_unpaired_fasta_entries.py | remove_unpaired_fasta_entries.py | #!/usr/bin/env python
"""
Remove unpaired reads from a fasta file.
This script can be used for the case that unpaired reads (e.g. as
reads were removed during quality trimming) in a pair of fasta files
from paired-end sequencing need to be removed.
"""
import argparse
from Bio import SeqIO
from Bio.SeqIO.FastaIO im... | Add script to remove unpaired fasta entries. | Add script to remove unpaired fasta entries.
| Python | isc | konrad/kuf_bio_scripts | Add script to remove unpaired fasta entries. | #!/usr/bin/env python
"""
Remove unpaired reads from a fasta file.
This script can be used for the case that unpaired reads (e.g. as
reads were removed during quality trimming) in a pair of fasta files
from paired-end sequencing need to be removed.
"""
import argparse
from Bio import SeqIO
from Bio.SeqIO.FastaIO im... | <commit_before><commit_msg>Add script to remove unpaired fasta entries.<commit_after> | #!/usr/bin/env python
"""
Remove unpaired reads from a fasta file.
This script can be used for the case that unpaired reads (e.g. as
reads were removed during quality trimming) in a pair of fasta files
from paired-end sequencing need to be removed.
"""
import argparse
from Bio import SeqIO
from Bio.SeqIO.FastaIO im... | Add script to remove unpaired fasta entries.#!/usr/bin/env python
"""
Remove unpaired reads from a fasta file.
This script can be used for the case that unpaired reads (e.g. as
reads were removed during quality trimming) in a pair of fasta files
from paired-end sequencing need to be removed.
"""
import argparse
fro... | <commit_before><commit_msg>Add script to remove unpaired fasta entries.<commit_after>#!/usr/bin/env python
"""
Remove unpaired reads from a fasta file.
This script can be used for the case that unpaired reads (e.g. as
reads were removed during quality trimming) in a pair of fasta files
from paired-end sequencing need... | |
ccbb7e11edc63a128b7006e015539fdabd8f3a7f | bitHopper/LongPoll.py | bitHopper/LongPoll.py | from gevent.event import AsyncResult
_event = AsyncResult()
def wait():
"""
Gets the New Block work unit to send to clients
"""
return _event.get()
def trigger(work):
"""
Call to trigger a LP
"""
old = self._event
self._event = event.AsyncResult()
old.set(work)
| Set up frontend for longpolling | Set up frontend for longpolling
| Python | mit | c00w/bitHopper,c00w/bitHopper | Set up frontend for longpolling | from gevent.event import AsyncResult
_event = AsyncResult()
def wait():
"""
Gets the New Block work unit to send to clients
"""
return _event.get()
def trigger(work):
"""
Call to trigger a LP
"""
old = self._event
self._event = event.AsyncResult()
old.set(work)
| <commit_before><commit_msg>Set up frontend for longpolling<commit_after> | from gevent.event import AsyncResult
_event = AsyncResult()
def wait():
"""
Gets the New Block work unit to send to clients
"""
return _event.get()
def trigger(work):
"""
Call to trigger a LP
"""
old = self._event
self._event = event.AsyncResult()
old.set(work)
| Set up frontend for longpollingfrom gevent.event import AsyncResult
_event = AsyncResult()
def wait():
"""
Gets the New Block work unit to send to clients
"""
return _event.get()
def trigger(work):
"""
Call to trigger a LP
"""
old = self._event
self._event = event.AsyncResult()
... | <commit_before><commit_msg>Set up frontend for longpolling<commit_after>from gevent.event import AsyncResult
_event = AsyncResult()
def wait():
"""
Gets the New Block work unit to send to clients
"""
return _event.get()
def trigger(work):
"""
Call to trigger a LP
"""
old = self._even... | |
324243dfd61afd8ce244a9a02ffc800c5c73ce55 | charts/daniels_designing_great_beers/appendix_two_course_grind_potential_extract_modified.py | charts/daniels_designing_great_beers/appendix_two_course_grind_potential_extract_modified.py |
from brew.utilities import sg_from_dry_basis
"""
Ray Daniels
Designing Great Beers
Appendix 2: Course Grind Potential Extract (modified)
Notes:
The chart appears to have been developed with the moisture content set
to zero (0.0) and the Brew House Efficiency set to 100% (1.0). This
is not typical and ... | Add modified chart with better values | Add modified chart with better values
| Python | mit | chrisgilmerproj/brewday,chrisgilmerproj/brewday | Add modified chart with better values |
from brew.utilities import sg_from_dry_basis
"""
Ray Daniels
Designing Great Beers
Appendix 2: Course Grind Potential Extract (modified)
Notes:
The chart appears to have been developed with the moisture content set
to zero (0.0) and the Brew House Efficiency set to 100% (1.0). This
is not typical and ... | <commit_before><commit_msg>Add modified chart with better values<commit_after> |
from brew.utilities import sg_from_dry_basis
"""
Ray Daniels
Designing Great Beers
Appendix 2: Course Grind Potential Extract (modified)
Notes:
The chart appears to have been developed with the moisture content set
to zero (0.0) and the Brew House Efficiency set to 100% (1.0). This
is not typical and ... | Add modified chart with better values
from brew.utilities import sg_from_dry_basis
"""
Ray Daniels
Designing Great Beers
Appendix 2: Course Grind Potential Extract (modified)
Notes:
The chart appears to have been developed with the moisture content set
to zero (0.0) and the Brew House Efficiency set to 100%... | <commit_before><commit_msg>Add modified chart with better values<commit_after>
from brew.utilities import sg_from_dry_basis
"""
Ray Daniels
Designing Great Beers
Appendix 2: Course Grind Potential Extract (modified)
Notes:
The chart appears to have been developed with the moisture content set
to zero (0.0) ... | |
cb454d310431700e5ac9883a32f0b36e2e50e0fe | sensu/plugins/check-keystone-expired-tokens.py | sensu/plugins/check-keystone-expired-tokens.py | #!/opt/openstack/current/keystone/bin/python
#
# Copyright 2015, Jesse Keating <jlk@bluebox.net>
#
# 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 a check for keystone expired tokens buildup. | Add a check for keystone expired tokens buildup.
More than 1K is too many when cleaning every 5 minutes, so warn about
it. The admin may have to go in and more aggressively clean or figure
out why the cleaning isn't completing as expected.
This uses a lot of keystone-manage code to interact with the database,
and mon... | Python | apache-2.0 | aacole/ursula-monitoring,sivakom/ursula-monitoring,sivakom/ursula-monitoring,blueboxgroup/ursula-monitoring,blueboxgroup/ursula-monitoring,sivakom/ursula-monitoring,aacole/ursula-monitoring,aacole/ursula-monitoring,aacole/ursula-monitoring,sivakom/ursula-monitoring,blueboxgroup/ursula-monitoring,blueboxgroup/ursula-mon... | Add a check for keystone expired tokens buildup.
More than 1K is too many when cleaning every 5 minutes, so warn about
it. The admin may have to go in and more aggressively clean or figure
out why the cleaning isn't completing as expected.
This uses a lot of keystone-manage code to interact with the database,
and mon... | #!/opt/openstack/current/keystone/bin/python
#
# Copyright 2015, Jesse Keating <jlk@bluebox.net>
#
# 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 a check for keystone expired tokens buildup.
More than 1K is too many when cleaning every 5 minutes, so warn about
it. The admin may have to go in and more aggressively clean or figure
out why the cleaning isn't completing as expected.
This uses a lot of keystone-manage code to interact... | #!/opt/openstack/current/keystone/bin/python
#
# Copyright 2015, Jesse Keating <jlk@bluebox.net>
#
# 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 a check for keystone expired tokens buildup.
More than 1K is too many when cleaning every 5 minutes, so warn about
it. The admin may have to go in and more aggressively clean or figure
out why the cleaning isn't completing as expected.
This uses a lot of keystone-manage code to interact with the database,
and mon... | <commit_before><commit_msg>Add a check for keystone expired tokens buildup.
More than 1K is too many when cleaning every 5 minutes, so warn about
it. The admin may have to go in and more aggressively clean or figure
out why the cleaning isn't completing as expected.
This uses a lot of keystone-manage code to interact... | |
ac40e54d22717fbf1a2444a67198cdba66506df8 | cea/tests/test_inputs_setup_workflow.py | cea/tests/test_inputs_setup_workflow.py | import os
import unittest
import cea.config
from cea.utilities import create_polygon
from cea.datamanagement import zone_helper, surroundings_helper, terrain_helper, streets_helper, data_initializer, \
archetypes_mapper
# Zug site coordinates
POLYGON_COORDINATES = [(8.513465734818856, 47.178027239429234), (8.5154... | Add test for input setup workflow | Add test for input setup workflow
| Python | mit | architecture-building-systems/CityEnergyAnalyst,architecture-building-systems/CityEnergyAnalyst,architecture-building-systems/CityEnergyAnalyst | Add test for input setup workflow | import os
import unittest
import cea.config
from cea.utilities import create_polygon
from cea.datamanagement import zone_helper, surroundings_helper, terrain_helper, streets_helper, data_initializer, \
archetypes_mapper
# Zug site coordinates
POLYGON_COORDINATES = [(8.513465734818856, 47.178027239429234), (8.5154... | <commit_before><commit_msg>Add test for input setup workflow<commit_after> | import os
import unittest
import cea.config
from cea.utilities import create_polygon
from cea.datamanagement import zone_helper, surroundings_helper, terrain_helper, streets_helper, data_initializer, \
archetypes_mapper
# Zug site coordinates
POLYGON_COORDINATES = [(8.513465734818856, 47.178027239429234), (8.5154... | Add test for input setup workflowimport os
import unittest
import cea.config
from cea.utilities import create_polygon
from cea.datamanagement import zone_helper, surroundings_helper, terrain_helper, streets_helper, data_initializer, \
archetypes_mapper
# Zug site coordinates
POLYGON_COORDINATES = [(8.513465734818... | <commit_before><commit_msg>Add test for input setup workflow<commit_after>import os
import unittest
import cea.config
from cea.utilities import create_polygon
from cea.datamanagement import zone_helper, surroundings_helper, terrain_helper, streets_helper, data_initializer, \
archetypes_mapper
# Zug site coordinat... | |
582b5c598da5b35032447f0eb7888051b84f844c | alembic/versions/20860ffde766_add_datetime_to_fastcache.py | alembic/versions/20860ffde766_add_datetime_to_fastcache.py | """Add datetime to fastcache
Revision ID: 20860ffde766
Revises: 471e6f7722a7
Create Date: 2015-04-14 07:44:36.507406
"""
# revision identifiers, used by Alembic.
revision = '20860ffde766'
down_revision = '471e6f7722a7'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated b... | Add datetime to fast cache | Add datetime to fast cache
| Python | bsd-2-clause | porduna/appcomposer,morelab/appcomposer,porduna/appcomposer,morelab/appcomposer,morelab/appcomposer,go-lab/appcomposer,go-lab/appcomposer,porduna/appcomposer,morelab/appcomposer,porduna/appcomposer,go-lab/appcomposer,go-lab/appcomposer | Add datetime to fast cache | """Add datetime to fastcache
Revision ID: 20860ffde766
Revises: 471e6f7722a7
Create Date: 2015-04-14 07:44:36.507406
"""
# revision identifiers, used by Alembic.
revision = '20860ffde766'
down_revision = '471e6f7722a7'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated b... | <commit_before><commit_msg>Add datetime to fast cache<commit_after> | """Add datetime to fastcache
Revision ID: 20860ffde766
Revises: 471e6f7722a7
Create Date: 2015-04-14 07:44:36.507406
"""
# revision identifiers, used by Alembic.
revision = '20860ffde766'
down_revision = '471e6f7722a7'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated b... | Add datetime to fast cache"""Add datetime to fastcache
Revision ID: 20860ffde766
Revises: 471e6f7722a7
Create Date: 2015-04-14 07:44:36.507406
"""
# revision identifiers, used by Alembic.
revision = '20860ffde766'
down_revision = '471e6f7722a7'
from alembic import op
import sqlalchemy as sa
def upgrade():
###... | <commit_before><commit_msg>Add datetime to fast cache<commit_after>"""Add datetime to fastcache
Revision ID: 20860ffde766
Revises: 471e6f7722a7
Create Date: 2015-04-14 07:44:36.507406
"""
# revision identifiers, used by Alembic.
revision = '20860ffde766'
down_revision = '471e6f7722a7'
from alembic import op
import ... | |
65b362985d502440b12efc8a6a49ab0603354fd2 | liwc_emotional_sentences.py | liwc_emotional_sentences.py | """Count the numbers of annotated entities and emotional sentences in the
corpus that was manually annotated.
Usage: python annotation_statistics.py <dir containing the folia files with
EmbodiedEmotions annotations>
"""
from lxml import etree
from bs4 import BeautifulSoup
from emotools.bs4_helpers import sentence, not... | Add script to count emotional sentences according to LIWC | Add script to count emotional sentences according to LIWC
Added a script that counts the number of emotional sentences in titles
in the corpus. A sentence is considered emotional if it contains at
least one Posemo or Negemo term. The statistical results are written to
standard out.
| Python | apache-2.0 | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | Add script to count emotional sentences according to LIWC
Added a script that counts the number of emotional sentences in titles
in the corpus. A sentence is considered emotional if it contains at
least one Posemo or Negemo term. The statistical results are written to
standard out. | """Count the numbers of annotated entities and emotional sentences in the
corpus that was manually annotated.
Usage: python annotation_statistics.py <dir containing the folia files with
EmbodiedEmotions annotations>
"""
from lxml import etree
from bs4 import BeautifulSoup
from emotools.bs4_helpers import sentence, not... | <commit_before><commit_msg>Add script to count emotional sentences according to LIWC
Added a script that counts the number of emotional sentences in titles
in the corpus. A sentence is considered emotional if it contains at
least one Posemo or Negemo term. The statistical results are written to
standard out.<commit_af... | """Count the numbers of annotated entities and emotional sentences in the
corpus that was manually annotated.
Usage: python annotation_statistics.py <dir containing the folia files with
EmbodiedEmotions annotations>
"""
from lxml import etree
from bs4 import BeautifulSoup
from emotools.bs4_helpers import sentence, not... | Add script to count emotional sentences according to LIWC
Added a script that counts the number of emotional sentences in titles
in the corpus. A sentence is considered emotional if it contains at
least one Posemo or Negemo term. The statistical results are written to
standard out."""Count the numbers of annotated ent... | <commit_before><commit_msg>Add script to count emotional sentences according to LIWC
Added a script that counts the number of emotional sentences in titles
in the corpus. A sentence is considered emotional if it contains at
least one Posemo or Negemo term. The statistical results are written to
standard out.<commit_af... | |
cc89c5222ec7f6d6f95b5efdce3958b3ca33814e | mica/archive/tests/test_aca_dark_cal.py | mica/archive/tests/test_aca_dark_cal.py | """
Basic functionality and regression tests for ACA dark cal module.
"""
import numpy as np
from ..aca_dark import dark_cal
def test_date_to_dark_id():
assert dark_cal.date_to_dark_id('2011-01-15T12:00:00') == '2011015'
def test_dark_id_to_date():
assert dark_cal.dark_id_to_date('2011015') == '2011:015'
... | Add basic functionality and regression tests for ACA dark cal module | Add basic functionality and regression tests for ACA dark cal module
| Python | bsd-3-clause | sot/mica,sot/mica | Add basic functionality and regression tests for ACA dark cal module | """
Basic functionality and regression tests for ACA dark cal module.
"""
import numpy as np
from ..aca_dark import dark_cal
def test_date_to_dark_id():
assert dark_cal.date_to_dark_id('2011-01-15T12:00:00') == '2011015'
def test_dark_id_to_date():
assert dark_cal.dark_id_to_date('2011015') == '2011:015'
... | <commit_before><commit_msg>Add basic functionality and regression tests for ACA dark cal module<commit_after> | """
Basic functionality and regression tests for ACA dark cal module.
"""
import numpy as np
from ..aca_dark import dark_cal
def test_date_to_dark_id():
assert dark_cal.date_to_dark_id('2011-01-15T12:00:00') == '2011015'
def test_dark_id_to_date():
assert dark_cal.dark_id_to_date('2011015') == '2011:015'
... | Add basic functionality and regression tests for ACA dark cal module"""
Basic functionality and regression tests for ACA dark cal module.
"""
import numpy as np
from ..aca_dark import dark_cal
def test_date_to_dark_id():
assert dark_cal.date_to_dark_id('2011-01-15T12:00:00') == '2011015'
def test_dark_id_to_d... | <commit_before><commit_msg>Add basic functionality and regression tests for ACA dark cal module<commit_after>"""
Basic functionality and regression tests for ACA dark cal module.
"""
import numpy as np
from ..aca_dark import dark_cal
def test_date_to_dark_id():
assert dark_cal.date_to_dark_id('2011-01-15T12:00:... | |
5eefc407b8f51c017a3f4193c88f6dc188a88601 | src/CLAHE_dir.py | src/CLAHE_dir.py | from PIL import Image
import numpy as np
import h5py
import os
import sys
import cv2
# Maybe consider implemeting more involved auto-balancing
# http://wiki.cmci.info/documents/120206pyip_cooking/python_imagej_cookbook#automatic_brightnesscontrast_button
def apply_clahe_to_H5(fn, clahe):
f = h5py.File(fn, "r+")
img... | Include OpenCV based Python CLAHE script | Include OpenCV based Python CLAHE script
| Python | mit | seung-lab/Julimaps,seung-lab/Julimaps | Include OpenCV based Python CLAHE script | from PIL import Image
import numpy as np
import h5py
import os
import sys
import cv2
# Maybe consider implemeting more involved auto-balancing
# http://wiki.cmci.info/documents/120206pyip_cooking/python_imagej_cookbook#automatic_brightnesscontrast_button
def apply_clahe_to_H5(fn, clahe):
f = h5py.File(fn, "r+")
img... | <commit_before><commit_msg>Include OpenCV based Python CLAHE script<commit_after> | from PIL import Image
import numpy as np
import h5py
import os
import sys
import cv2
# Maybe consider implemeting more involved auto-balancing
# http://wiki.cmci.info/documents/120206pyip_cooking/python_imagej_cookbook#automatic_brightnesscontrast_button
def apply_clahe_to_H5(fn, clahe):
f = h5py.File(fn, "r+")
img... | Include OpenCV based Python CLAHE scriptfrom PIL import Image
import numpy as np
import h5py
import os
import sys
import cv2
# Maybe consider implemeting more involved auto-balancing
# http://wiki.cmci.info/documents/120206pyip_cooking/python_imagej_cookbook#automatic_brightnesscontrast_button
def apply_clahe_to_H5(f... | <commit_before><commit_msg>Include OpenCV based Python CLAHE script<commit_after>from PIL import Image
import numpy as np
import h5py
import os
import sys
import cv2
# Maybe consider implemeting more involved auto-balancing
# http://wiki.cmci.info/documents/120206pyip_cooking/python_imagej_cookbook#automatic_brightnes... | |
f0af14b8fcd420b63a47e18938664e14cf9ea968 | subiquity/utils.py | subiquity/utils.py | # Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | Add generic asynchronous/synchronous run command | Add generic asynchronous/synchronous run command
Signed-off-by: Adam Stokes <0a364f4bf549cc82d725fa7fd7ed34404be64079@ubuntu.com>
| Python | agpl-3.0 | CanonicalLtd/subiquity,CanonicalLtd/subiquity | Add generic asynchronous/synchronous run command
Signed-off-by: Adam Stokes <0a364f4bf549cc82d725fa7fd7ed34404be64079@ubuntu.com> | # Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | <commit_before><commit_msg>Add generic asynchronous/synchronous run command
Signed-off-by: Adam Stokes <0a364f4bf549cc82d725fa7fd7ed34404be64079@ubuntu.com><commit_after> | # Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | Add generic asynchronous/synchronous run command
Signed-off-by: Adam Stokes <0a364f4bf549cc82d725fa7fd7ed34404be64079@ubuntu.com># Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the ... | <commit_before><commit_msg>Add generic asynchronous/synchronous run command
Signed-off-by: Adam Stokes <0a364f4bf549cc82d725fa7fd7ed34404be64079@ubuntu.com><commit_after># Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... | |
5a21b66f7ab77f419245d8c07d7473a6e1600fc4 | comics/crawler/crawlers/harkavagrant.py | comics/crawler/crawlers/harkavagrant.py | from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Hark, A Vagrant!'
language = 'en'
url = 'http://www.harkavagrant.com/'
start_date = '2008-05-01'
history_capable_days = 120
schedule = 'Mo,Tu,We,Th,Fr,Sa,Su'
... | Add crawler for 'Hark, A Vagrant' | Add crawler for 'Hark, A Vagrant'
| Python | agpl-3.0 | jodal/comics,jodal/comics,klette/comics,datagutten/comics,datagutten/comics,datagutten/comics,klette/comics,klette/comics,jodal/comics,jodal/comics,datagutten/comics | Add crawler for 'Hark, A Vagrant' | from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Hark, A Vagrant!'
language = 'en'
url = 'http://www.harkavagrant.com/'
start_date = '2008-05-01'
history_capable_days = 120
schedule = 'Mo,Tu,We,Th,Fr,Sa,Su'
... | <commit_before><commit_msg>Add crawler for 'Hark, A Vagrant'<commit_after> | from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Hark, A Vagrant!'
language = 'en'
url = 'http://www.harkavagrant.com/'
start_date = '2008-05-01'
history_capable_days = 120
schedule = 'Mo,Tu,We,Th,Fr,Sa,Su'
... | Add crawler for 'Hark, A Vagrant'from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Hark, A Vagrant!'
language = 'en'
url = 'http://www.harkavagrant.com/'
start_date = '2008-05-01'
history_capable_days = 120
sch... | <commit_before><commit_msg>Add crawler for 'Hark, A Vagrant'<commit_after>from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = 'Hark, A Vagrant!'
language = 'en'
url = 'http://www.harkavagrant.com/'
start_date = '2008-05-0... | |
63143c94cef353d7bae13f7b13650801bb901c94 | tests/unicode/unicode_pos.py | tests/unicode/unicode_pos.py | # str methods with explicit start/end pos
print("Привет".startswith("П"))
print("Привет".startswith("р", 1))
print("абвба".find("а", 1))
print("абвба".find("а", 1, -1))
| Test for explicit start/end args to str methods for unicode. | tests: Test for explicit start/end args to str methods for unicode.
| Python | mit | hiway/micropython,martinribelotta/micropython,tdautc19841202/micropython,supergis/micropython,torwag/micropython,pfalcon/micropython,galenhz/micropython,TDAbboud/micropython,kerneltask/micropython,heisewangluo/micropython,kerneltask/micropython,pozetroninc/micropython,ericsnowcurrently/micropython,ernesto-g/micropython... | tests: Test for explicit start/end args to str methods for unicode. | # str methods with explicit start/end pos
print("Привет".startswith("П"))
print("Привет".startswith("р", 1))
print("абвба".find("а", 1))
print("абвба".find("а", 1, -1))
| <commit_before><commit_msg>tests: Test for explicit start/end args to str methods for unicode.<commit_after> | # str methods with explicit start/end pos
print("Привет".startswith("П"))
print("Привет".startswith("р", 1))
print("абвба".find("а", 1))
print("абвба".find("а", 1, -1))
| tests: Test for explicit start/end args to str methods for unicode.# str methods with explicit start/end pos
print("Привет".startswith("П"))
print("Привет".startswith("р", 1))
print("абвба".find("а", 1))
print("абвба".find("а", 1, -1))
| <commit_before><commit_msg>tests: Test for explicit start/end args to str methods for unicode.<commit_after># str methods with explicit start/end pos
print("Привет".startswith("П"))
print("Привет".startswith("р", 1))
print("абвба".find("а", 1))
print("абвба".find("а", 1, -1))
| |
f6f75172b1b8a41fc5ae025416ea665258d4ff4c | favicon-update.py | favicon-update.py | from PIL import Image
import requests
from io import BytesIO
# This whole script was done using Google and StackOverflow
# How to generate ico files
# https://stackoverflow.com/a/36168447/1697953
# How to get GitHub avatar location from username
# https://stackoverflow.com/a/36380674/1697953
# How to read image data f... | Add script for updating favicon from gh avatar | Add script for updating favicon from gh avatar
| Python | mit | Sorashi/sorashi.github.io | Add script for updating favicon from gh avatar | from PIL import Image
import requests
from io import BytesIO
# This whole script was done using Google and StackOverflow
# How to generate ico files
# https://stackoverflow.com/a/36168447/1697953
# How to get GitHub avatar location from username
# https://stackoverflow.com/a/36380674/1697953
# How to read image data f... | <commit_before><commit_msg>Add script for updating favicon from gh avatar<commit_after> | from PIL import Image
import requests
from io import BytesIO
# This whole script was done using Google and StackOverflow
# How to generate ico files
# https://stackoverflow.com/a/36168447/1697953
# How to get GitHub avatar location from username
# https://stackoverflow.com/a/36380674/1697953
# How to read image data f... | Add script for updating favicon from gh avatarfrom PIL import Image
import requests
from io import BytesIO
# This whole script was done using Google and StackOverflow
# How to generate ico files
# https://stackoverflow.com/a/36168447/1697953
# How to get GitHub avatar location from username
# https://stackoverflow.com... | <commit_before><commit_msg>Add script for updating favicon from gh avatar<commit_after>from PIL import Image
import requests
from io import BytesIO
# This whole script was done using Google and StackOverflow
# How to generate ico files
# https://stackoverflow.com/a/36168447/1697953
# How to get GitHub avatar location ... | |
70d912bfb1ccec03edfe92b9b2c87610346c8f42 | corehq/doctypemigrations/migrations/0006_domain_migration_20151118.py | corehq/doctypemigrations/migrations/0006_domain_migration_20151118.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from corehq.doctypemigrations.djangomigrations import assert_initial_complete
from corehq.doctypemigrations.migrator_instances import domains_migration
class Migration(migrations.Migration):
dependencies = [
... | Add blocking migration for new domain db | Add blocking migration for new domain db
| Python | bsd-3-clause | dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq | Add blocking migration for new domain db | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from corehq.doctypemigrations.djangomigrations import assert_initial_complete
from corehq.doctypemigrations.migrator_instances import domains_migration
class Migration(migrations.Migration):
dependencies = [
... | <commit_before><commit_msg>Add blocking migration for new domain db<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from corehq.doctypemigrations.djangomigrations import assert_initial_complete
from corehq.doctypemigrations.migrator_instances import domains_migration
class Migration(migrations.Migration):
dependencies = [
... | Add blocking migration for new domain db# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from corehq.doctypemigrations.djangomigrations import assert_initial_complete
from corehq.doctypemigrations.migrator_instances import domains_migration
class Migration(migrations.M... | <commit_before><commit_msg>Add blocking migration for new domain db<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from corehq.doctypemigrations.djangomigrations import assert_initial_complete
from corehq.doctypemigrations.migrator_instances import domains... | |
d0e5ea752912b10e473b2a05da9196800eb6ca86 | examples/redis_lock.py | examples/redis_lock.py | import random
from diesel import fork, quickstop, quickstart, sleep
from diesel.protocols.redis import RedisClient, RedisTransactionError, RedisLock, LockNotAcquired
"""Implement the Redis INCR command using a lock. Obviously this is inefficient, but it's a good
example of how to use the RedisLock class"""
key = 't... | Add an example for the RedisLock | Add an example for the RedisLock
| Python | bsd-3-clause | dieseldev/diesel | Add an example for the RedisLock | import random
from diesel import fork, quickstop, quickstart, sleep
from diesel.protocols.redis import RedisClient, RedisTransactionError, RedisLock, LockNotAcquired
"""Implement the Redis INCR command using a lock. Obviously this is inefficient, but it's a good
example of how to use the RedisLock class"""
key = 't... | <commit_before><commit_msg>Add an example for the RedisLock<commit_after> | import random
from diesel import fork, quickstop, quickstart, sleep
from diesel.protocols.redis import RedisClient, RedisTransactionError, RedisLock, LockNotAcquired
"""Implement the Redis INCR command using a lock. Obviously this is inefficient, but it's a good
example of how to use the RedisLock class"""
key = 't... | Add an example for the RedisLockimport random
from diesel import fork, quickstop, quickstart, sleep
from diesel.protocols.redis import RedisClient, RedisTransactionError, RedisLock, LockNotAcquired
"""Implement the Redis INCR command using a lock. Obviously this is inefficient, but it's a good
example of how to use ... | <commit_before><commit_msg>Add an example for the RedisLock<commit_after>import random
from diesel import fork, quickstop, quickstart, sleep
from diesel.protocols.redis import RedisClient, RedisTransactionError, RedisLock, LockNotAcquired
"""Implement the Redis INCR command using a lock. Obviously this is inefficien... | |
d0b8c68ae3c8acbc3d5dfe13842e3c41a198b978 | fix_notions_db.py | fix_notions_db.py | from alignements_backend.db import DB
from alignements_backend.notion import Notion
for notion in DB.scan_iter(match='notion:*'):
n = Notion(list(DB.sscan_iter(notion)))
| Add script to fix all notions | Add script to fix all notions
| Python | mit | l-vincent-l/alignements_backend | Add script to fix all notions | from alignements_backend.db import DB
from alignements_backend.notion import Notion
for notion in DB.scan_iter(match='notion:*'):
n = Notion(list(DB.sscan_iter(notion)))
| <commit_before><commit_msg>Add script to fix all notions<commit_after> | from alignements_backend.db import DB
from alignements_backend.notion import Notion
for notion in DB.scan_iter(match='notion:*'):
n = Notion(list(DB.sscan_iter(notion)))
| Add script to fix all notionsfrom alignements_backend.db import DB
from alignements_backend.notion import Notion
for notion in DB.scan_iter(match='notion:*'):
n = Notion(list(DB.sscan_iter(notion)))
| <commit_before><commit_msg>Add script to fix all notions<commit_after>from alignements_backend.db import DB
from alignements_backend.notion import Notion
for notion in DB.scan_iter(match='notion:*'):
n = Notion(list(DB.sscan_iter(notion)))
| |
550469032843eb2af3b4a9faaed34d9754f00700 | geotrek/common/management/commands/test_managers_emails.py | geotrek/common/management/commands/test_managers_emails.py | from django.core.mail import mail_managers
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Test if email settings are OK by sending mail to site managers"
def execute(self, *args, **options):
subject = u'Test email for managers'
message = u'If you rece... | Add command to test managers emails | Add command to test managers emails
| Python | bsd-2-clause | mabhub/Geotrek,camillemonchicourt/Geotrek,mabhub/Geotrek,Anaethelion/Geotrek,makinacorpus/Geotrek,mabhub/Geotrek,Anaethelion/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,Anaethelion/Geotrek,Anaethelion/Geotrek,camillemonchicourt/Geotrek,johan--/Geotrek,GeotrekCE/Geot... | Add command to test managers emails | from django.core.mail import mail_managers
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Test if email settings are OK by sending mail to site managers"
def execute(self, *args, **options):
subject = u'Test email for managers'
message = u'If you rece... | <commit_before><commit_msg>Add command to test managers emails<commit_after> | from django.core.mail import mail_managers
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Test if email settings are OK by sending mail to site managers"
def execute(self, *args, **options):
subject = u'Test email for managers'
message = u'If you rece... | Add command to test managers emailsfrom django.core.mail import mail_managers
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Test if email settings are OK by sending mail to site managers"
def execute(self, *args, **options):
subject = u'Test email for manage... | <commit_before><commit_msg>Add command to test managers emails<commit_after>from django.core.mail import mail_managers
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Test if email settings are OK by sending mail to site managers"
def execute(self, *args, **options):
... | |
edb9500824faffd9f1d0d1b59ca29966e3b18282 | modules/formatter_record.py | modules/formatter_record.py | from behave.formatter.json import PrettyJSONFormatter
from pprint import pprint
class RecordFormatter(PrettyJSONFormatter):
name = "super"
description = "Formatter for adding REST calls to JSON output."
jsteps = {} # Contains an array of features, that contains array of steps in each feature
# Overrid... | Customize behave formatter to output json | Customize behave formatter to output json
| Python | mit | avidas/reliability-demo | Customize behave formatter to output json | from behave.formatter.json import PrettyJSONFormatter
from pprint import pprint
class RecordFormatter(PrettyJSONFormatter):
name = "super"
description = "Formatter for adding REST calls to JSON output."
jsteps = {} # Contains an array of features, that contains array of steps in each feature
# Overrid... | <commit_before><commit_msg>Customize behave formatter to output json<commit_after> | from behave.formatter.json import PrettyJSONFormatter
from pprint import pprint
class RecordFormatter(PrettyJSONFormatter):
name = "super"
description = "Formatter for adding REST calls to JSON output."
jsteps = {} # Contains an array of features, that contains array of steps in each feature
# Overrid... | Customize behave formatter to output jsonfrom behave.formatter.json import PrettyJSONFormatter
from pprint import pprint
class RecordFormatter(PrettyJSONFormatter):
name = "super"
description = "Formatter for adding REST calls to JSON output."
jsteps = {} # Contains an array of features, that contains arra... | <commit_before><commit_msg>Customize behave formatter to output json<commit_after>from behave.formatter.json import PrettyJSONFormatter
from pprint import pprint
class RecordFormatter(PrettyJSONFormatter):
name = "super"
description = "Formatter for adding REST calls to JSON output."
jsteps = {} # Contains... | |
1f48fee7ffcef3eefa6aaedb5ca963c10bb7c58c | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/test_forms.py | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/test_forms.py | from django.test import TestCase
from users.forms import ZionsUserCreationForm
from users.models import User
class {{cookiecutter.project_camel_name}}UserCreationTestCase(TestCase):
def setUp(self):
self.test_user = User.objects.create(
username='testuser',
email='test@test.com',
... | Add test case for user creation form | Add test case for user creation form
| Python | bsd-3-clause | wldcordeiro/cookiecutter-django-essentials,wldcordeiro/cookiecutter-django-essentials,wldcordeiro/cookiecutter-django-essentials | Add test case for user creation form | from django.test import TestCase
from users.forms import ZionsUserCreationForm
from users.models import User
class {{cookiecutter.project_camel_name}}UserCreationTestCase(TestCase):
def setUp(self):
self.test_user = User.objects.create(
username='testuser',
email='test@test.com',
... | <commit_before><commit_msg>Add test case for user creation form<commit_after> | from django.test import TestCase
from users.forms import ZionsUserCreationForm
from users.models import User
class {{cookiecutter.project_camel_name}}UserCreationTestCase(TestCase):
def setUp(self):
self.test_user = User.objects.create(
username='testuser',
email='test@test.com',
... | Add test case for user creation formfrom django.test import TestCase
from users.forms import ZionsUserCreationForm
from users.models import User
class {{cookiecutter.project_camel_name}}UserCreationTestCase(TestCase):
def setUp(self):
self.test_user = User.objects.create(
username='testuser',... | <commit_before><commit_msg>Add test case for user creation form<commit_after>from django.test import TestCase
from users.forms import ZionsUserCreationForm
from users.models import User
class {{cookiecutter.project_camel_name}}UserCreationTestCase(TestCase):
def setUp(self):
self.test_user = User.objects... | |
4d85702561c000824083544de98693e244c8aab7 | tests/test_decoding_stack.py | tests/test_decoding_stack.py | #! /usr/bin/env python
from __future__ import division
from timeside.decoder import FileDecoder
from timeside.analyzer import AubioPitch
from timeside.core import ProcessPipe
import numpy as np
from unit_timeside import *
import os.path
#from glib import GError as GST_IOError
# HINT : to use later with Gnonlin only... | Add test for decoder stack | Add test for decoder stack
| Python | agpl-3.0 | Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide | Add test for decoder stack | #! /usr/bin/env python
from __future__ import division
from timeside.decoder import FileDecoder
from timeside.analyzer import AubioPitch
from timeside.core import ProcessPipe
import numpy as np
from unit_timeside import *
import os.path
#from glib import GError as GST_IOError
# HINT : to use later with Gnonlin only... | <commit_before><commit_msg>Add test for decoder stack<commit_after> | #! /usr/bin/env python
from __future__ import division
from timeside.decoder import FileDecoder
from timeside.analyzer import AubioPitch
from timeside.core import ProcessPipe
import numpy as np
from unit_timeside import *
import os.path
#from glib import GError as GST_IOError
# HINT : to use later with Gnonlin only... | Add test for decoder stack#! /usr/bin/env python
from __future__ import division
from timeside.decoder import FileDecoder
from timeside.analyzer import AubioPitch
from timeside.core import ProcessPipe
import numpy as np
from unit_timeside import *
import os.path
#from glib import GError as GST_IOError
# HINT : to u... | <commit_before><commit_msg>Add test for decoder stack<commit_after>#! /usr/bin/env python
from __future__ import division
from timeside.decoder import FileDecoder
from timeside.analyzer import AubioPitch
from timeside.core import ProcessPipe
import numpy as np
from unit_timeside import *
import os.path
#from glib i... | |
84153b0be78998ab8ec6914df8623c99255457b5 | locust/test/mock_locustfile.py | locust/test/mock_locustfile.py | import os
import random
import time
from contextlib import contextmanager
MOCK_LOUCSTFILE_CONTENT = '''
"""This is a mock locust file for unit testing"""
from locust import HttpLocust, TaskSet, task, between
def index(l):
l.client.get("/")
def stats(l):
l.client.get("/stats/requests")
class UserTasks(T... | Improve code for creating temporary locustfiles that can be used in tests | Improve code for creating temporary locustfiles that can be used in tests | Python | mit | mbeacom/locust,locustio/locust,locustio/locust,mbeacom/locust,mbeacom/locust,locustio/locust,mbeacom/locust,locustio/locust | Improve code for creating temporary locustfiles that can be used in tests | import os
import random
import time
from contextlib import contextmanager
MOCK_LOUCSTFILE_CONTENT = '''
"""This is a mock locust file for unit testing"""
from locust import HttpLocust, TaskSet, task, between
def index(l):
l.client.get("/")
def stats(l):
l.client.get("/stats/requests")
class UserTasks(T... | <commit_before><commit_msg>Improve code for creating temporary locustfiles that can be used in tests<commit_after> | import os
import random
import time
from contextlib import contextmanager
MOCK_LOUCSTFILE_CONTENT = '''
"""This is a mock locust file for unit testing"""
from locust import HttpLocust, TaskSet, task, between
def index(l):
l.client.get("/")
def stats(l):
l.client.get("/stats/requests")
class UserTasks(T... | Improve code for creating temporary locustfiles that can be used in testsimport os
import random
import time
from contextlib import contextmanager
MOCK_LOUCSTFILE_CONTENT = '''
"""This is a mock locust file for unit testing"""
from locust import HttpLocust, TaskSet, task, between
def index(l):
l.client.get("/... | <commit_before><commit_msg>Improve code for creating temporary locustfiles that can be used in tests<commit_after>import os
import random
import time
from contextlib import contextmanager
MOCK_LOUCSTFILE_CONTENT = '''
"""This is a mock locust file for unit testing"""
from locust import HttpLocust, TaskSet, task, be... | |
595c8fad76696240f96e61d9a2299de3d6cda16a | skcode/utility/walketree.py | skcode/utility/walketree.py | """
SkCode utility for walking across a document tree.
"""
def walk_tree_for_cls(tree_node, opts_cls):
"""
Walk the tree and yield any tree node matching the given options class.
:param tree_node: The current tree node instance.
:param opts_cls: The options class to search for.
"""
# Check th... | Add utility for walking etree and yielding nodes if options class type match. | Add utility for walking etree and yielding nodes if options class type match.
| Python | agpl-3.0 | TamiaLab/PySkCode | Add utility for walking etree and yielding nodes if options class type match. | """
SkCode utility for walking across a document tree.
"""
def walk_tree_for_cls(tree_node, opts_cls):
"""
Walk the tree and yield any tree node matching the given options class.
:param tree_node: The current tree node instance.
:param opts_cls: The options class to search for.
"""
# Check th... | <commit_before><commit_msg>Add utility for walking etree and yielding nodes if options class type match.<commit_after> | """
SkCode utility for walking across a document tree.
"""
def walk_tree_for_cls(tree_node, opts_cls):
"""
Walk the tree and yield any tree node matching the given options class.
:param tree_node: The current tree node instance.
:param opts_cls: The options class to search for.
"""
# Check th... | Add utility for walking etree and yielding nodes if options class type match."""
SkCode utility for walking across a document tree.
"""
def walk_tree_for_cls(tree_node, opts_cls):
"""
Walk the tree and yield any tree node matching the given options class.
:param tree_node: The current tree node instance.
... | <commit_before><commit_msg>Add utility for walking etree and yielding nodes if options class type match.<commit_after>"""
SkCode utility for walking across a document tree.
"""
def walk_tree_for_cls(tree_node, opts_cls):
"""
Walk the tree and yield any tree node matching the given options class.
:param tr... | |
427a95f0c56facc138448cde7e7b9da1bcdc8ea4 | add_example.py | add_example.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Unit Tests
def test_add_zero():
assert 0 + 1 == 1 + 0
def test_add_single_digits():
assert 1 + 2 == 2 + 1
def test_add_double_digits():
assert 10 + 12 == 12 + 10
# Property-based Test
from hypothesis import given
import hypothesis.strategies as st
@giv... | Add super basic Hypothesis example | Add super basic Hypothesis example
| Python | mit | dkua/pyconca16-talk | Add super basic Hypothesis example | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Unit Tests
def test_add_zero():
assert 0 + 1 == 1 + 0
def test_add_single_digits():
assert 1 + 2 == 2 + 1
def test_add_double_digits():
assert 10 + 12 == 12 + 10
# Property-based Test
from hypothesis import given
import hypothesis.strategies as st
@giv... | <commit_before><commit_msg>Add super basic Hypothesis example<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Unit Tests
def test_add_zero():
assert 0 + 1 == 1 + 0
def test_add_single_digits():
assert 1 + 2 == 2 + 1
def test_add_double_digits():
assert 10 + 12 == 12 + 10
# Property-based Test
from hypothesis import given
import hypothesis.strategies as st
@giv... | Add super basic Hypothesis example#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Unit Tests
def test_add_zero():
assert 0 + 1 == 1 + 0
def test_add_single_digits():
assert 1 + 2 == 2 + 1
def test_add_double_digits():
assert 10 + 12 == 12 + 10
# Property-based Test
from hypothesis import given
import... | <commit_before><commit_msg>Add super basic Hypothesis example<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Unit Tests
def test_add_zero():
assert 0 + 1 == 1 + 0
def test_add_single_digits():
assert 1 + 2 == 2 + 1
def test_add_double_digits():
assert 10 + 12 == 12 + 10
# Property-based ... | |
21a504dce25a1b22bda27cd74a443af98b24ad14 | filters/extract_urls.py | filters/extract_urls.py | import io
import pypandoc
import panflute
def prepare(doc):
doc.images = []
doc.links = []
def action(elem, doc):
if isinstance(elem, panflute.Image):
doc.images.append(elem)
elif isinstance(elem, panflute.Link):
doc.links.append(elem)
if __name__ == '__main__':
data = pyp... | Add pseudo filter combining pypandoc and panflute | Add pseudo filter combining pypandoc and panflute
This is a prototype (filename is hardcoded) but should be easy to extend | Python | bsd-3-clause | sergiocorreia/panflute-filters | Add pseudo filter combining pypandoc and panflute
This is a prototype (filename is hardcoded) but should be easy to extend | import io
import pypandoc
import panflute
def prepare(doc):
doc.images = []
doc.links = []
def action(elem, doc):
if isinstance(elem, panflute.Image):
doc.images.append(elem)
elif isinstance(elem, panflute.Link):
doc.links.append(elem)
if __name__ == '__main__':
data = pyp... | <commit_before><commit_msg>Add pseudo filter combining pypandoc and panflute
This is a prototype (filename is hardcoded) but should be easy to extend<commit_after> | import io
import pypandoc
import panflute
def prepare(doc):
doc.images = []
doc.links = []
def action(elem, doc):
if isinstance(elem, panflute.Image):
doc.images.append(elem)
elif isinstance(elem, panflute.Link):
doc.links.append(elem)
if __name__ == '__main__':
data = pyp... | Add pseudo filter combining pypandoc and panflute
This is a prototype (filename is hardcoded) but should be easy to extendimport io
import pypandoc
import panflute
def prepare(doc):
doc.images = []
doc.links = []
def action(elem, doc):
if isinstance(elem, panflute.Image):
doc.images.append... | <commit_before><commit_msg>Add pseudo filter combining pypandoc and panflute
This is a prototype (filename is hardcoded) but should be easy to extend<commit_after>import io
import pypandoc
import panflute
def prepare(doc):
doc.images = []
doc.links = []
def action(elem, doc):
if isinstance(elem,... | |
04287120372a6fdb906ed9f27ead4c5f91d5690e | tota/heroes/lenovo.py | tota/heroes/lenovo.py | from tota.utils import closest, distance, sort_by_distance, possible_moves
from tota import settings
__author__ = "angvp"
def create():
def lenovo_hero_logic(self, things, t):
# some useful data about the enemies I can see in the map
enemy_team = settings.ENEMY_TEAMS[self.team]
enemies =... | Add a modified version of simple bot | Add a modified version of simple bot
| Python | mit | fisadev/tota | Add a modified version of simple bot | from tota.utils import closest, distance, sort_by_distance, possible_moves
from tota import settings
__author__ = "angvp"
def create():
def lenovo_hero_logic(self, things, t):
# some useful data about the enemies I can see in the map
enemy_team = settings.ENEMY_TEAMS[self.team]
enemies =... | <commit_before><commit_msg>Add a modified version of simple bot<commit_after> | from tota.utils import closest, distance, sort_by_distance, possible_moves
from tota import settings
__author__ = "angvp"
def create():
def lenovo_hero_logic(self, things, t):
# some useful data about the enemies I can see in the map
enemy_team = settings.ENEMY_TEAMS[self.team]
enemies =... | Add a modified version of simple botfrom tota.utils import closest, distance, sort_by_distance, possible_moves
from tota import settings
__author__ = "angvp"
def create():
def lenovo_hero_logic(self, things, t):
# some useful data about the enemies I can see in the map
enemy_team = settings.ENEM... | <commit_before><commit_msg>Add a modified version of simple bot<commit_after>from tota.utils import closest, distance, sort_by_distance, possible_moves
from tota import settings
__author__ = "angvp"
def create():
def lenovo_hero_logic(self, things, t):
# some useful data about the enemies I can see in t... | |
6b4733c213046c7a16bf255cfbc92408e2f01423 | tests/models/test_authenticated_registry_model.py | tests/models/test_authenticated_registry_model.py | import pytest
from dockci.models.auth import AuthenticatedRegistry
BASE_AUTHENTICATED_REGISTRY = dict(
id=1,
display_name='Display name',
base_name='Base name',
username='Username',
password='Password',
email='Email',
insecure=False,
)
class TestHash(object):
""" Test ``Authenticate... | Add test for registry model hash | Add test for registry model hash
| Python | isc | RickyCook/DockCI,sprucedev/DockCI-Agent,RickyCook/DockCI,sprucedev/DockCI,sprucedev/DockCI,sprucedev/DockCI,sprucedev/DockCI,sprucedev/DockCI-Agent,RickyCook/DockCI,RickyCook/DockCI | Add test for registry model hash | import pytest
from dockci.models.auth import AuthenticatedRegistry
BASE_AUTHENTICATED_REGISTRY = dict(
id=1,
display_name='Display name',
base_name='Base name',
username='Username',
password='Password',
email='Email',
insecure=False,
)
class TestHash(object):
""" Test ``Authenticate... | <commit_before><commit_msg>Add test for registry model hash<commit_after> | import pytest
from dockci.models.auth import AuthenticatedRegistry
BASE_AUTHENTICATED_REGISTRY = dict(
id=1,
display_name='Display name',
base_name='Base name',
username='Username',
password='Password',
email='Email',
insecure=False,
)
class TestHash(object):
""" Test ``Authenticate... | Add test for registry model hashimport pytest
from dockci.models.auth import AuthenticatedRegistry
BASE_AUTHENTICATED_REGISTRY = dict(
id=1,
display_name='Display name',
base_name='Base name',
username='Username',
password='Password',
email='Email',
insecure=False,
)
class TestHash(obje... | <commit_before><commit_msg>Add test for registry model hash<commit_after>import pytest
from dockci.models.auth import AuthenticatedRegistry
BASE_AUTHENTICATED_REGISTRY = dict(
id=1,
display_name='Display name',
base_name='Base name',
username='Username',
password='Password',
email='Email',
... | |
d3d6a6018d55581bf081c93386f6676c8bb105ce | simulate.py | simulate.py | import genetic
import sys
output = sys.stdout
def setOutput(out):
output = out
genetic.setOutput(output)
# Test data for a XOR gate
testData = (
(0.1, 0.1, 0.9),
(0.1, 0.9, 0.9),
(0.9, 0.1, 0.9),
(0.9, 0.9, 0.1)
)
def simulate():
sim = genetic.Simulation(2, 1, testData, 100)
sim.simu... | Add module for running the main simulation | Add module for running the main simulation
| Python | mit | JoshuaBrockschmidt/ideal_ANN | Add module for running the main simulation | import genetic
import sys
output = sys.stdout
def setOutput(out):
output = out
genetic.setOutput(output)
# Test data for a XOR gate
testData = (
(0.1, 0.1, 0.9),
(0.1, 0.9, 0.9),
(0.9, 0.1, 0.9),
(0.9, 0.9, 0.1)
)
def simulate():
sim = genetic.Simulation(2, 1, testData, 100)
sim.simu... | <commit_before><commit_msg>Add module for running the main simulation<commit_after> | import genetic
import sys
output = sys.stdout
def setOutput(out):
output = out
genetic.setOutput(output)
# Test data for a XOR gate
testData = (
(0.1, 0.1, 0.9),
(0.1, 0.9, 0.9),
(0.9, 0.1, 0.9),
(0.9, 0.9, 0.1)
)
def simulate():
sim = genetic.Simulation(2, 1, testData, 100)
sim.simu... | Add module for running the main simulationimport genetic
import sys
output = sys.stdout
def setOutput(out):
output = out
genetic.setOutput(output)
# Test data for a XOR gate
testData = (
(0.1, 0.1, 0.9),
(0.1, 0.9, 0.9),
(0.9, 0.1, 0.9),
(0.9, 0.9, 0.1)
)
def simulate():
sim = genetic.Si... | <commit_before><commit_msg>Add module for running the main simulation<commit_after>import genetic
import sys
output = sys.stdout
def setOutput(out):
output = out
genetic.setOutput(output)
# Test data for a XOR gate
testData = (
(0.1, 0.1, 0.9),
(0.1, 0.9, 0.9),
(0.9, 0.1, 0.9),
(0.9, 0.9, 0.1... | |
2cd1e7fcdf53c312c3db8e6f1d257084a87cccbb | recipe-server/normandy/recipes/migrations/0045_update_action_hashes.py | recipe-server/normandy/recipes/migrations/0045_update_action_hashes.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import hashlib
from base64 import b64encode, urlsafe_b64encode
from django.db import migrations
def make_hashes_urlsafe_sri(apps, schema_editor):
Action = apps.get_model('recipes', 'Action')
for action in Action.objects.all():
data = a... | Add migration to update action implementation hashes. | Add migration to update action implementation hashes.
| Python | mpl-2.0 | mozilla/normandy,mozilla/normandy,mozilla/normandy,mozilla/normandy | Add migration to update action implementation hashes. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import hashlib
from base64 import b64encode, urlsafe_b64encode
from django.db import migrations
def make_hashes_urlsafe_sri(apps, schema_editor):
Action = apps.get_model('recipes', 'Action')
for action in Action.objects.all():
data = a... | <commit_before><commit_msg>Add migration to update action implementation hashes.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import hashlib
from base64 import b64encode, urlsafe_b64encode
from django.db import migrations
def make_hashes_urlsafe_sri(apps, schema_editor):
Action = apps.get_model('recipes', 'Action')
for action in Action.objects.all():
data = a... | Add migration to update action implementation hashes.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import hashlib
from base64 import b64encode, urlsafe_b64encode
from django.db import migrations
def make_hashes_urlsafe_sri(apps, schema_editor):
Action = apps.get_model('recipes', 'Action')
... | <commit_before><commit_msg>Add migration to update action implementation hashes.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import hashlib
from base64 import b64encode, urlsafe_b64encode
from django.db import migrations
def make_hashes_urlsafe_sri(apps, schema_editor):
Action =... | |
8fa7120606e206d08acbad198e253ea428eef584 | tests/compiler/test_inline_list_compilation.py | tests/compiler/test_inline_list_compilation.py | import pytest
from tests.compiler import compile_snippet, internal_call, STATIC_START, LOCAL_START
from thinglang.compiler.errors import NoMatchingOverload, InvalidReference
from thinglang.compiler.opcodes import OpcodePopLocal, OpcodePushStatic
def test_inline_list_compilation():
assert compile_snippet('list<... | Add tests for inline list compilation | Add tests for inline list compilation
| Python | mit | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | Add tests for inline list compilation | import pytest
from tests.compiler import compile_snippet, internal_call, STATIC_START, LOCAL_START
from thinglang.compiler.errors import NoMatchingOverload, InvalidReference
from thinglang.compiler.opcodes import OpcodePopLocal, OpcodePushStatic
def test_inline_list_compilation():
assert compile_snippet('list<... | <commit_before><commit_msg>Add tests for inline list compilation<commit_after> | import pytest
from tests.compiler import compile_snippet, internal_call, STATIC_START, LOCAL_START
from thinglang.compiler.errors import NoMatchingOverload, InvalidReference
from thinglang.compiler.opcodes import OpcodePopLocal, OpcodePushStatic
def test_inline_list_compilation():
assert compile_snippet('list<... | Add tests for inline list compilationimport pytest
from tests.compiler import compile_snippet, internal_call, STATIC_START, LOCAL_START
from thinglang.compiler.errors import NoMatchingOverload, InvalidReference
from thinglang.compiler.opcodes import OpcodePopLocal, OpcodePushStatic
def test_inline_list_compilation(... | <commit_before><commit_msg>Add tests for inline list compilation<commit_after>import pytest
from tests.compiler import compile_snippet, internal_call, STATIC_START, LOCAL_START
from thinglang.compiler.errors import NoMatchingOverload, InvalidReference
from thinglang.compiler.opcodes import OpcodePopLocal, OpcodePushS... | |
3ddf0f0fead6018b5c313253a0df2165452cfb6e | src/eduid_common/api/translation.py | src/eduid_common/api/translation.py | # -*- coding: utf-8 -*-
from flask import request
from flask_babel import Babel
__author__ = 'lundberg'
def init_babel(app):
babel = Babel(app)
app.babel = babel
@babel.localeselector
def get_locale():
# if a user is logged in, use the locale from the user settings
# XXX: TODO
... | Add shared babel init code | Add shared babel init code
| Python | bsd-3-clause | SUNET/eduid-common | Add shared babel init code | # -*- coding: utf-8 -*-
from flask import request
from flask_babel import Babel
__author__ = 'lundberg'
def init_babel(app):
babel = Babel(app)
app.babel = babel
@babel.localeselector
def get_locale():
# if a user is logged in, use the locale from the user settings
# XXX: TODO
... | <commit_before><commit_msg>Add shared babel init code<commit_after> | # -*- coding: utf-8 -*-
from flask import request
from flask_babel import Babel
__author__ = 'lundberg'
def init_babel(app):
babel = Babel(app)
app.babel = babel
@babel.localeselector
def get_locale():
# if a user is logged in, use the locale from the user settings
# XXX: TODO
... | Add shared babel init code# -*- coding: utf-8 -*-
from flask import request
from flask_babel import Babel
__author__ = 'lundberg'
def init_babel(app):
babel = Babel(app)
app.babel = babel
@babel.localeselector
def get_locale():
# if a user is logged in, use the locale from the user settings... | <commit_before><commit_msg>Add shared babel init code<commit_after># -*- coding: utf-8 -*-
from flask import request
from flask_babel import Babel
__author__ = 'lundberg'
def init_babel(app):
babel = Babel(app)
app.babel = babel
@babel.localeselector
def get_locale():
# if a user is logged ... | |
30bca45e1ac9fc6953728950695135b491403215 | tests/basics/logic_constfolding.py | tests/basics/logic_constfolding.py | # tests logical constant folding in parser
def f_true():
print('f_true')
return True
def f_false():
print('f_false')
return False
print(0 or False)
print(1 or foo)
print(f_false() or 1 or foo)
print(f_false() or 1 or f_true())
print(0 and foo)
print(1 and True)
print(f_true() and 0 and foo)
print(f_... | Add test for logical constant folding. | tests/basics: Add test for logical constant folding.
| Python | mit | mhoffma/micropython,blazewicz/micropython,tobbad/micropython,oopy/micropython,pozetroninc/micropython,swegener/micropython,tralamazza/micropython,tobbad/micropython,mhoffma/micropython,kerneltask/micropython,MrSurly/micropython,Peetz0r/micropython-esp32,tobbad/micropython,dmazzella/micropython,HenrikSolver/micropython,... | tests/basics: Add test for logical constant folding. | # tests logical constant folding in parser
def f_true():
print('f_true')
return True
def f_false():
print('f_false')
return False
print(0 or False)
print(1 or foo)
print(f_false() or 1 or foo)
print(f_false() or 1 or f_true())
print(0 and foo)
print(1 and True)
print(f_true() and 0 and foo)
print(f_... | <commit_before><commit_msg>tests/basics: Add test for logical constant folding.<commit_after> | # tests logical constant folding in parser
def f_true():
print('f_true')
return True
def f_false():
print('f_false')
return False
print(0 or False)
print(1 or foo)
print(f_false() or 1 or foo)
print(f_false() or 1 or f_true())
print(0 and foo)
print(1 and True)
print(f_true() and 0 and foo)
print(f_... | tests/basics: Add test for logical constant folding.# tests logical constant folding in parser
def f_true():
print('f_true')
return True
def f_false():
print('f_false')
return False
print(0 or False)
print(1 or foo)
print(f_false() or 1 or foo)
print(f_false() or 1 or f_true())
print(0 and foo)
prin... | <commit_before><commit_msg>tests/basics: Add test for logical constant folding.<commit_after># tests logical constant folding in parser
def f_true():
print('f_true')
return True
def f_false():
print('f_false')
return False
print(0 or False)
print(1 or foo)
print(f_false() or 1 or foo)
print(f_false()... | |
be17cf90b06a118d579c0211dd3bc2d45433fb2d | tests/test_handle_long_response.py | tests/test_handle_long_response.py | import context
class TestHandleLongResponse(context.slouch.testing.CommandTestCase):
bot_class = context.TimerBot
config = {'start_fmt': '{:%Y}', 'stop_fmt': '{.days}'}
normal_text = "@genericmention: this is generic mention message contains a URL <http://foo.com/>\n@genericmention: this generic mention me... | Write unit tests for _handle_long_response | Write unit tests for _handle_long_response
| Python | mit | venmo/slouch | Write unit tests for _handle_long_response | import context
class TestHandleLongResponse(context.slouch.testing.CommandTestCase):
bot_class = context.TimerBot
config = {'start_fmt': '{:%Y}', 'stop_fmt': '{.days}'}
normal_text = "@genericmention: this is generic mention message contains a URL <http://foo.com/>\n@genericmention: this generic mention me... | <commit_before><commit_msg>Write unit tests for _handle_long_response<commit_after> | import context
class TestHandleLongResponse(context.slouch.testing.CommandTestCase):
bot_class = context.TimerBot
config = {'start_fmt': '{:%Y}', 'stop_fmt': '{.days}'}
normal_text = "@genericmention: this is generic mention message contains a URL <http://foo.com/>\n@genericmention: this generic mention me... | Write unit tests for _handle_long_responseimport context
class TestHandleLongResponse(context.slouch.testing.CommandTestCase):
bot_class = context.TimerBot
config = {'start_fmt': '{:%Y}', 'stop_fmt': '{.days}'}
normal_text = "@genericmention: this is generic mention message contains a URL <http://foo.com/>... | <commit_before><commit_msg>Write unit tests for _handle_long_response<commit_after>import context
class TestHandleLongResponse(context.slouch.testing.CommandTestCase):
bot_class = context.TimerBot
config = {'start_fmt': '{:%Y}', 'stop_fmt': '{.days}'}
normal_text = "@genericmention: this is generic mention... | |
063899021158fe872745b335595b3094db9834d8 | pycket/test/test_version.py | pycket/test/test_version.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Test the version here.
#
import pytest
from pycket.test.testhelper import check_equal
EXPECTED_VERSION='6.1.1.8'
def test_version():
check_equal('(version)', '"%s"' % EXPECTED_VERSION)
# EOF
| Add a test for 'version. | Add a test for 'version.
! needs updating with every nightly, currentl
| Python | mit | samth/pycket,krono/pycket,vishesh/pycket,magnusmorton/pycket,vishesh/pycket,vishesh/pycket,magnusmorton/pycket,cderici/pycket,pycket/pycket,pycket/pycket,cderici/pycket,krono/pycket,magnusmorton/pycket,krono/pycket,pycket/pycket,cderici/pycket,samth/pycket,samth/pycket | Add a test for 'version.
! needs updating with every nightly, currentl | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Test the version here.
#
import pytest
from pycket.test.testhelper import check_equal
EXPECTED_VERSION='6.1.1.8'
def test_version():
check_equal('(version)', '"%s"' % EXPECTED_VERSION)
# EOF
| <commit_before><commit_msg>Add a test for 'version.
! needs updating with every nightly, currentl<commit_after> | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Test the version here.
#
import pytest
from pycket.test.testhelper import check_equal
EXPECTED_VERSION='6.1.1.8'
def test_version():
check_equal('(version)', '"%s"' % EXPECTED_VERSION)
# EOF
| Add a test for 'version.
! needs updating with every nightly, currentl#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Test the version here.
#
import pytest
from pycket.test.testhelper import check_equal
EXPECTED_VERSION='6.1.1.8'
def test_version():
check_equal('(version)', '"%s"' % EXPECTED_VERSION)
# EO... | <commit_before><commit_msg>Add a test for 'version.
! needs updating with every nightly, currentl<commit_after>#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Test the version here.
#
import pytest
from pycket.test.testhelper import check_equal
EXPECTED_VERSION='6.1.1.8'
def test_version():
check_equal('(ve... | |
fe37335645993ad10c9902aaaaf0ca2c53912d49 | movies_avg_etl.py | movies_avg_etl.py | import pyspark
spark = (
pyspark.sql.SparkSession.builder.appName("FromDatabase")
.config("spark.driver.extraClassPath", "<driver_location>/postgresql-42.2.18.jar")
.getOrCreate()
)
# Read table from db using Spark JDBC
def extract_movies_to_df():
movies_df = (
spark.read.format("jdbc")
... | Create Average Movies rating etl | Feat: Create Average Movies rating etl
Extracts data from 2 tables in the database, transforms the data and writes the result into another table in the same database | Python | mit | searchs/bigdatabox,searchs/bigdatabox | Feat: Create Average Movies rating etl
Extracts data from 2 tables in the database, transforms the data and writes the result into another table in the same database | import pyspark
spark = (
pyspark.sql.SparkSession.builder.appName("FromDatabase")
.config("spark.driver.extraClassPath", "<driver_location>/postgresql-42.2.18.jar")
.getOrCreate()
)
# Read table from db using Spark JDBC
def extract_movies_to_df():
movies_df = (
spark.read.format("jdbc")
... | <commit_before><commit_msg>Feat: Create Average Movies rating etl
Extracts data from 2 tables in the database, transforms the data and writes the result into another table in the same database<commit_after> | import pyspark
spark = (
pyspark.sql.SparkSession.builder.appName("FromDatabase")
.config("spark.driver.extraClassPath", "<driver_location>/postgresql-42.2.18.jar")
.getOrCreate()
)
# Read table from db using Spark JDBC
def extract_movies_to_df():
movies_df = (
spark.read.format("jdbc")
... | Feat: Create Average Movies rating etl
Extracts data from 2 tables in the database, transforms the data and writes the result into another table in the same databaseimport pyspark
spark = (
pyspark.sql.SparkSession.builder.appName("FromDatabase")
.config("spark.driver.extraClassPath", "<driver_location>/postg... | <commit_before><commit_msg>Feat: Create Average Movies rating etl
Extracts data from 2 tables in the database, transforms the data and writes the result into another table in the same database<commit_after>import pyspark
spark = (
pyspark.sql.SparkSession.builder.appName("FromDatabase")
.config("spark.driver.... | |
7d198f3eaca6a91b731b3e25c0285cd46e72935a | swh/web/common/migrations/0005_remove_duplicated_authorized_origins.py | swh/web/common/migrations/0005_remove_duplicated_authorized_origins.py | # Copyright (C) 2019 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information
from __future__ import unicode_literals
from django.db import mig... | Remove duplicates in authorized origins table | common/migrations: Remove duplicates in authorized origins table
| Python | agpl-3.0 | SoftwareHeritage/swh-web-ui,SoftwareHeritage/swh-web-ui,SoftwareHeritage/swh-web-ui | common/migrations: Remove duplicates in authorized origins table | # Copyright (C) 2019 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information
from __future__ import unicode_literals
from django.db import mig... | <commit_before><commit_msg>common/migrations: Remove duplicates in authorized origins table<commit_after> | # Copyright (C) 2019 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information
from __future__ import unicode_literals
from django.db import mig... | common/migrations: Remove duplicates in authorized origins table# Copyright (C) 2019 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information
fr... | <commit_before><commit_msg>common/migrations: Remove duplicates in authorized origins table<commit_after># Copyright (C) 2019 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-le... | |
91541cf82f435cb261d9debc85a2a8ae6dd74ab1 | xutils/init_logging.py | xutils/init_logging.py | # encoding: utf-8
from __future__ import print_function, absolute_import, unicode_literals, division
import logging
def init_logging(logger=None, level="DEBUG", log_file="", file_config=None, dict_config=None):
# Initialize the argument logger with the arguments, level and log_file.
if logger:
fmt = "... | Add a function to initialize the logging. | Add a function to initialize the logging.
| Python | mit | xgfone/xutils,xgfone/pycom | Add a function to initialize the logging. | # encoding: utf-8
from __future__ import print_function, absolute_import, unicode_literals, division
import logging
def init_logging(logger=None, level="DEBUG", log_file="", file_config=None, dict_config=None):
# Initialize the argument logger with the arguments, level and log_file.
if logger:
fmt = "... | <commit_before><commit_msg>Add a function to initialize the logging.<commit_after> | # encoding: utf-8
from __future__ import print_function, absolute_import, unicode_literals, division
import logging
def init_logging(logger=None, level="DEBUG", log_file="", file_config=None, dict_config=None):
# Initialize the argument logger with the arguments, level and log_file.
if logger:
fmt = "... | Add a function to initialize the logging.# encoding: utf-8
from __future__ import print_function, absolute_import, unicode_literals, division
import logging
def init_logging(logger=None, level="DEBUG", log_file="", file_config=None, dict_config=None):
# Initialize the argument logger with the arguments, level and... | <commit_before><commit_msg>Add a function to initialize the logging.<commit_after># encoding: utf-8
from __future__ import print_function, absolute_import, unicode_literals, division
import logging
def init_logging(logger=None, level="DEBUG", log_file="", file_config=None, dict_config=None):
# Initialize the argu... | |
507e3bad4e877330eea29675dafb8210ab6bada5 | tests/test_agent.py | tests/test_agent.py | """
Tests for a agent.
"""
import io
import os
import pytest
from onirim import action
from onirim import agent
from onirim import component
def file_agent(in_str):
return agent.File(io.StringIO(in_str), open(os.devnull, "w"))
def content():
return component.Content([])
@pytest.mark.parametrize(
"in_... | Add tests for file agent | Add tests for file agent
| Python | mit | cwahbong/onirim-py | Add tests for file agent | """
Tests for a agent.
"""
import io
import os
import pytest
from onirim import action
from onirim import agent
from onirim import component
def file_agent(in_str):
return agent.File(io.StringIO(in_str), open(os.devnull, "w"))
def content():
return component.Content([])
@pytest.mark.parametrize(
"in_... | <commit_before><commit_msg>Add tests for file agent<commit_after> | """
Tests for a agent.
"""
import io
import os
import pytest
from onirim import action
from onirim import agent
from onirim import component
def file_agent(in_str):
return agent.File(io.StringIO(in_str), open(os.devnull, "w"))
def content():
return component.Content([])
@pytest.mark.parametrize(
"in_... | Add tests for file agent"""
Tests for a agent.
"""
import io
import os
import pytest
from onirim import action
from onirim import agent
from onirim import component
def file_agent(in_str):
return agent.File(io.StringIO(in_str), open(os.devnull, "w"))
def content():
return component.Content([])
@pytest.ma... | <commit_before><commit_msg>Add tests for file agent<commit_after>"""
Tests for a agent.
"""
import io
import os
import pytest
from onirim import action
from onirim import agent
from onirim import component
def file_agent(in_str):
return agent.File(io.StringIO(in_str), open(os.devnull, "w"))
def content():
... | |
c67e1af4f765f143cb1b8420e053c1a9f00edd05 | course_discovery/apps/course_metadata/migrations/0168_auto_20190404_1733.py | course_discovery/apps/course_metadata/migrations/0168_auto_20190404_1733.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-04-04 17:33
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.manager
import djchoices.choices
class Migration(migrations.Migration):
dependencies = [
('course_metadata', '0167_auto_20190... | Add migrations for new statuses. | Add migrations for new statuses.
| Python | agpl-3.0 | edx/course-discovery,edx/course-discovery,edx/course-discovery,edx/course-discovery | Add migrations for new statuses. | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-04-04 17:33
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.manager
import djchoices.choices
class Migration(migrations.Migration):
dependencies = [
('course_metadata', '0167_auto_20190... | <commit_before><commit_msg>Add migrations for new statuses.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-04-04 17:33
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.manager
import djchoices.choices
class Migration(migrations.Migration):
dependencies = [
('course_metadata', '0167_auto_20190... | Add migrations for new statuses.# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-04-04 17:33
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.manager
import djchoices.choices
class Migration(migrations.Migration):
dependencies = [
('co... | <commit_before><commit_msg>Add migrations for new statuses.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-04-04 17:33
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.manager
import djchoices.choices
class Migration(migrations.Migra... | |
d308874989667f36da1638f22d6b2d7e823b5ebd | extract-barcode.py | extract-barcode.py | """
code to extract a single cell from a set of alignments or reads marked via Valentine's umis
repository:
https://github.com/vals/umis
"""
import regex as re
import sys
from argparse import ArgumentParser
from pysam import AlignmentFile
def extract_barcode(sam, barcode):
parser_re = re.compile('.*:CELL_(?P<CB>... | Add script to extract reads or alignments matching a barcode. | Add script to extract reads or alignments matching a barcode.
| Python | mit | roryk/junkdrawer,roryk/junkdrawer | Add script to extract reads or alignments matching a barcode. | """
code to extract a single cell from a set of alignments or reads marked via Valentine's umis
repository:
https://github.com/vals/umis
"""
import regex as re
import sys
from argparse import ArgumentParser
from pysam import AlignmentFile
def extract_barcode(sam, barcode):
parser_re = re.compile('.*:CELL_(?P<CB>... | <commit_before><commit_msg>Add script to extract reads or alignments matching a barcode.<commit_after> | """
code to extract a single cell from a set of alignments or reads marked via Valentine's umis
repository:
https://github.com/vals/umis
"""
import regex as re
import sys
from argparse import ArgumentParser
from pysam import AlignmentFile
def extract_barcode(sam, barcode):
parser_re = re.compile('.*:CELL_(?P<CB>... | Add script to extract reads or alignments matching a barcode."""
code to extract a single cell from a set of alignments or reads marked via Valentine's umis
repository:
https://github.com/vals/umis
"""
import regex as re
import sys
from argparse import ArgumentParser
from pysam import AlignmentFile
def extract_barcod... | <commit_before><commit_msg>Add script to extract reads or alignments matching a barcode.<commit_after>"""
code to extract a single cell from a set of alignments or reads marked via Valentine's umis
repository:
https://github.com/vals/umis
"""
import regex as re
import sys
from argparse import ArgumentParser
from pysam... | |
048d0d7ce30b66af8bf48bcb0cb7f8bfb90fff0c | tests/test_iters.py | tests/test_iters.py | import pytest
from skidl import *
from .setup_teardown import *
def test_iters_1():
"""Test bus iterator."""
b_size = 4
b = Bus('chplx', b_size)
for hi in b:
for lo in b:
if hi != lo:
led = Part('device','LED')
hi += led['A']
lo += led... | Add tests for Part, Pin, Bus and Net iterators. | Add tests for Part, Pin, Bus and Net iterators.
| Python | mit | xesscorp/skidl,xesscorp/skidl | Add tests for Part, Pin, Bus and Net iterators. | import pytest
from skidl import *
from .setup_teardown import *
def test_iters_1():
"""Test bus iterator."""
b_size = 4
b = Bus('chplx', b_size)
for hi in b:
for lo in b:
if hi != lo:
led = Part('device','LED')
hi += led['A']
lo += led... | <commit_before><commit_msg>Add tests for Part, Pin, Bus and Net iterators.<commit_after> | import pytest
from skidl import *
from .setup_teardown import *
def test_iters_1():
"""Test bus iterator."""
b_size = 4
b = Bus('chplx', b_size)
for hi in b:
for lo in b:
if hi != lo:
led = Part('device','LED')
hi += led['A']
lo += led... | Add tests for Part, Pin, Bus and Net iterators.import pytest
from skidl import *
from .setup_teardown import *
def test_iters_1():
"""Test bus iterator."""
b_size = 4
b = Bus('chplx', b_size)
for hi in b:
for lo in b:
if hi != lo:
led = Part('device','LED')
... | <commit_before><commit_msg>Add tests for Part, Pin, Bus and Net iterators.<commit_after>import pytest
from skidl import *
from .setup_teardown import *
def test_iters_1():
"""Test bus iterator."""
b_size = 4
b = Bus('chplx', b_size)
for hi in b:
for lo in b:
if hi != lo:
... | |
3d027df005725cbc5dfbba0262b0c52c5392d7f0 | app/resources/check_token.py | app/resources/check_token.py | from flask import make_response, jsonify
from flask_restful import Resource, reqparse, marshal, fields
from app.models import User
from app.common.auth.token import JWT
user_fields = {
"id": fields.Integer,
"username": fields.String,
"created_at": fields.DateTime
}
class WhoAmIResource(Resource):
"""... | Add whoami resource which decodes token and returns user info from token | [CHORE] Add whoami resource which decodes token and returns user info from token
| Python | mit | brayoh/bucket-list-api | [CHORE] Add whoami resource which decodes token and returns user info from token | from flask import make_response, jsonify
from flask_restful import Resource, reqparse, marshal, fields
from app.models import User
from app.common.auth.token import JWT
user_fields = {
"id": fields.Integer,
"username": fields.String,
"created_at": fields.DateTime
}
class WhoAmIResource(Resource):
"""... | <commit_before><commit_msg>[CHORE] Add whoami resource which decodes token and returns user info from token<commit_after> | from flask import make_response, jsonify
from flask_restful import Resource, reqparse, marshal, fields
from app.models import User
from app.common.auth.token import JWT
user_fields = {
"id": fields.Integer,
"username": fields.String,
"created_at": fields.DateTime
}
class WhoAmIResource(Resource):
"""... | [CHORE] Add whoami resource which decodes token and returns user info from tokenfrom flask import make_response, jsonify
from flask_restful import Resource, reqparse, marshal, fields
from app.models import User
from app.common.auth.token import JWT
user_fields = {
"id": fields.Integer,
"username": fields.Stri... | <commit_before><commit_msg>[CHORE] Add whoami resource which decodes token and returns user info from token<commit_after>from flask import make_response, jsonify
from flask_restful import Resource, reqparse, marshal, fields
from app.models import User
from app.common.auth.token import JWT
user_fields = {
"id": fi... | |
f34dabd23faa7d50e507b829e576c1968bdc2d52 | src/iterations/exercise3.py | src/iterations/exercise3.py | # Print The Message "Happy new Year" followed by the name of a person
# taken from a list for all people mentioned in the list.
def print_Happy_New_Year_to( listOfPeople ):
for user in listOfPeople:
print 'Happy New Year, ', user
print 'Done!'
def main( ):
listOfPeople=['John', 'Mary', 'Luke']
print_Happy_N... | Print The Message Happy New Year | Print The Message Happy New Year
#Print The Message "Happy new Year" followed by the name of a person taken from a list for all people mentioned in the list.
| Python | mit | let42/python-course | Print The Message Happy New Year
#Print The Message "Happy new Year" followed by the name of a person taken from a list for all people mentioned in the list. | # Print The Message "Happy new Year" followed by the name of a person
# taken from a list for all people mentioned in the list.
def print_Happy_New_Year_to( listOfPeople ):
for user in listOfPeople:
print 'Happy New Year, ', user
print 'Done!'
def main( ):
listOfPeople=['John', 'Mary', 'Luke']
print_Happy_N... | <commit_before><commit_msg>Print The Message Happy New Year
#Print The Message "Happy new Year" followed by the name of a person taken from a list for all people mentioned in the list.<commit_after> | # Print The Message "Happy new Year" followed by the name of a person
# taken from a list for all people mentioned in the list.
def print_Happy_New_Year_to( listOfPeople ):
for user in listOfPeople:
print 'Happy New Year, ', user
print 'Done!'
def main( ):
listOfPeople=['John', 'Mary', 'Luke']
print_Happy_N... | Print The Message Happy New Year
#Print The Message "Happy new Year" followed by the name of a person taken from a list for all people mentioned in the list.# Print The Message "Happy new Year" followed by the name of a person
# taken from a list for all people mentioned in the list.
def print_Happy_New_Year_to( list... | <commit_before><commit_msg>Print The Message Happy New Year
#Print The Message "Happy new Year" followed by the name of a person taken from a list for all people mentioned in the list.<commit_after># Print The Message "Happy new Year" followed by the name of a person
# taken from a list for all people mentioned in the... | |
ce28c5642c3ab543fc48e2f4f1f0b2f2a62890a2 | src/misc/parse_tool_playbook_yaml.py | src/misc/parse_tool_playbook_yaml.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import argparse
import re
import yaml
def get_revision_number(yaml_content, tool_name):
for tool in yaml_content['tools']:
if tool["name"] == tool_name:
if tool.has_key("revision"):
print tool["revision"][0]
de... | Add script to extract information for playbook files | Add script to extract information for playbook files
| Python | apache-2.0 | ASaiM/framework,ASaiM/framework | Add script to extract information for playbook files | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import argparse
import re
import yaml
def get_revision_number(yaml_content, tool_name):
for tool in yaml_content['tools']:
if tool["name"] == tool_name:
if tool.has_key("revision"):
print tool["revision"][0]
de... | <commit_before><commit_msg>Add script to extract information for playbook files<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import argparse
import re
import yaml
def get_revision_number(yaml_content, tool_name):
for tool in yaml_content['tools']:
if tool["name"] == tool_name:
if tool.has_key("revision"):
print tool["revision"][0]
de... | Add script to extract information for playbook files#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import argparse
import re
import yaml
def get_revision_number(yaml_content, tool_name):
for tool in yaml_content['tools']:
if tool["name"] == tool_name:
if tool.has_key("revis... | <commit_before><commit_msg>Add script to extract information for playbook files<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import argparse
import re
import yaml
def get_revision_number(yaml_content, tool_name):
for tool in yaml_content['tools']:
if tool["name"] == tool... | |
24c763ead7af8a669ff1055b3f352f513274a47f | all-domains/data-structures/linked-lists/insert-a-node-at-a-specific-positin-in-a-linked-list/solution.py | all-domains/data-structures/linked-lists/insert-a-node-at-a-specific-positin-in-a-linked-list/solution.py | # https://www.hackerrank.com/challenges/insert-a-node-at-a-specific-position-in-a-linked-list
# Python 2
"""
Insert Node at a specific position in a linked list
head input could be None as well for empty list
Node is defined as
class Node(object):
def __init__(self, data=None, next_node=None):
self.dat... | Insert a note at a specific position in a linked list | Insert a note at a specific position in a linked list
| Python | mit | arvinsim/hackerrank-solutions | Insert a note at a specific position in a linked list | # https://www.hackerrank.com/challenges/insert-a-node-at-a-specific-position-in-a-linked-list
# Python 2
"""
Insert Node at a specific position in a linked list
head input could be None as well for empty list
Node is defined as
class Node(object):
def __init__(self, data=None, next_node=None):
self.dat... | <commit_before><commit_msg>Insert a note at a specific position in a linked list<commit_after> | # https://www.hackerrank.com/challenges/insert-a-node-at-a-specific-position-in-a-linked-list
# Python 2
"""
Insert Node at a specific position in a linked list
head input could be None as well for empty list
Node is defined as
class Node(object):
def __init__(self, data=None, next_node=None):
self.dat... | Insert a note at a specific position in a linked list# https://www.hackerrank.com/challenges/insert-a-node-at-a-specific-position-in-a-linked-list
# Python 2
"""
Insert Node at a specific position in a linked list
head input could be None as well for empty list
Node is defined as
class Node(object):
def __ini... | <commit_before><commit_msg>Insert a note at a specific position in a linked list<commit_after># https://www.hackerrank.com/challenges/insert-a-node-at-a-specific-position-in-a-linked-list
# Python 2
"""
Insert Node at a specific position in a linked list
head input could be None as well for empty list
Node is defin... | |
c9e90ef5413bd560422e915d213df73ad88dffd7 | tests/integration/test_apigateway.py | tests/integration/test_apigateway.py | # Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | Add apigateway integration test for PutIntegration | Add apigateway integration test for PutIntegration
| Python | apache-2.0 | boto/botocore,pplu/botocore | Add apigateway integration test for PutIntegration | # Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | <commit_before><commit_msg>Add apigateway integration test for PutIntegration<commit_after> | # Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | Add apigateway integration test for PutIntegration# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.c... | <commit_before><commit_msg>Add apigateway integration test for PutIntegration<commit_after># Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the Lice... | |
98c1ff71d57749168f0ca35d97dbe77a8a67e082 | mltils/xgboost/utils.py | mltils/xgboost/utils.py |
xgb_to_sklearn = {
'eta': 'learning_rate',
'num_boost_round': 'n_estimators',
'alpha': 'reg_alpha',
'lambda': 'reg_lambda',
'seed': 'random_state',
}
def to_sklearn_api(params):
return {
xgb_to_sklearn.get(key, key): value
for key, value in params.items()
}
| Add module for utilities related to xgboost | Add module for utilities related to xgboost
| Python | mit | rladeira/mltils | Add module for utilities related to xgboost |
xgb_to_sklearn = {
'eta': 'learning_rate',
'num_boost_round': 'n_estimators',
'alpha': 'reg_alpha',
'lambda': 'reg_lambda',
'seed': 'random_state',
}
def to_sklearn_api(params):
return {
xgb_to_sklearn.get(key, key): value
for key, value in params.items()
}
| <commit_before><commit_msg>Add module for utilities related to xgboost<commit_after> |
xgb_to_sklearn = {
'eta': 'learning_rate',
'num_boost_round': 'n_estimators',
'alpha': 'reg_alpha',
'lambda': 'reg_lambda',
'seed': 'random_state',
}
def to_sklearn_api(params):
return {
xgb_to_sklearn.get(key, key): value
for key, value in params.items()
}
| Add module for utilities related to xgboost
xgb_to_sklearn = {
'eta': 'learning_rate',
'num_boost_round': 'n_estimators',
'alpha': 'reg_alpha',
'lambda': 'reg_lambda',
'seed': 'random_state',
}
def to_sklearn_api(params):
return {
xgb_to_sklearn.get(key, key): value
for key, val... | <commit_before><commit_msg>Add module for utilities related to xgboost<commit_after>
xgb_to_sklearn = {
'eta': 'learning_rate',
'num_boost_round': 'n_estimators',
'alpha': 'reg_alpha',
'lambda': 'reg_lambda',
'seed': 'random_state',
}
def to_sklearn_api(params):
return {
xgb_to_sklearn.... | |
ecc8a93ddda784102311ebfd4c3c93624f356778 | cnxarchive/sql/migrations/20160723123620_add_sql_function_strip_html.py | cnxarchive/sql/migrations/20160723123620_add_sql_function_strip_html.py | # -*- coding: utf-8 -*-
def up(cursor):
cursor.execute("""\
CREATE OR REPLACE FUNCTION strip_html(html_text TEXT)
RETURNS text
AS $$
import re
return re.sub('<[^>]*?>', '', html_text, re.MULTILINE)
$$ LANGUAGE plpythonu IMMUTABLE;
""")
def down(cursor):
cursor.execute("DROP FUNCTION IF EXISTS stri... | Add migration to add strip_html sql function | Add migration to add strip_html sql function
Used for stripping html from modules.name (title)
| Python | agpl-3.0 | Connexions/cnx-archive,Connexions/cnx-archive | Add migration to add strip_html sql function
Used for stripping html from modules.name (title) | # -*- coding: utf-8 -*-
def up(cursor):
cursor.execute("""\
CREATE OR REPLACE FUNCTION strip_html(html_text TEXT)
RETURNS text
AS $$
import re
return re.sub('<[^>]*?>', '', html_text, re.MULTILINE)
$$ LANGUAGE plpythonu IMMUTABLE;
""")
def down(cursor):
cursor.execute("DROP FUNCTION IF EXISTS stri... | <commit_before><commit_msg>Add migration to add strip_html sql function
Used for stripping html from modules.name (title)<commit_after> | # -*- coding: utf-8 -*-
def up(cursor):
cursor.execute("""\
CREATE OR REPLACE FUNCTION strip_html(html_text TEXT)
RETURNS text
AS $$
import re
return re.sub('<[^>]*?>', '', html_text, re.MULTILINE)
$$ LANGUAGE plpythonu IMMUTABLE;
""")
def down(cursor):
cursor.execute("DROP FUNCTION IF EXISTS stri... | Add migration to add strip_html sql function
Used for stripping html from modules.name (title)# -*- coding: utf-8 -*-
def up(cursor):
cursor.execute("""\
CREATE OR REPLACE FUNCTION strip_html(html_text TEXT)
RETURNS text
AS $$
import re
return re.sub('<[^>]*?>', '', html_text, re.MULTILINE)
$$ LANGUAGE plp... | <commit_before><commit_msg>Add migration to add strip_html sql function
Used for stripping html from modules.name (title)<commit_after># -*- coding: utf-8 -*-
def up(cursor):
cursor.execute("""\
CREATE OR REPLACE FUNCTION strip_html(html_text TEXT)
RETURNS text
AS $$
import re
return re.sub('<[^>]*?>', '',... | |
62c70b301ffc1e178c3bd54bd81291876b3883ea | analysis/03-fill-dropouts-linear.py | analysis/03-fill-dropouts-linear.py | #!/usr/bin/env python
from __future__ import division
import climate
import lmj.cubes
import lmj.cubes.fill
import numpy as np
import pandas as pd
logging = climate.get_logger('fill')
def fill(dfs, window):
'''Complete missing marker data using linear interpolation.
This method alters the given `dfs` in-pl... | Add simple linear interpolation filling. | Add simple linear interpolation filling.
| Python | mit | lmjohns3/cube-experiment,lmjohns3/cube-experiment,lmjohns3/cube-experiment | Add simple linear interpolation filling. | #!/usr/bin/env python
from __future__ import division
import climate
import lmj.cubes
import lmj.cubes.fill
import numpy as np
import pandas as pd
logging = climate.get_logger('fill')
def fill(dfs, window):
'''Complete missing marker data using linear interpolation.
This method alters the given `dfs` in-pl... | <commit_before><commit_msg>Add simple linear interpolation filling.<commit_after> | #!/usr/bin/env python
from __future__ import division
import climate
import lmj.cubes
import lmj.cubes.fill
import numpy as np
import pandas as pd
logging = climate.get_logger('fill')
def fill(dfs, window):
'''Complete missing marker data using linear interpolation.
This method alters the given `dfs` in-pl... | Add simple linear interpolation filling.#!/usr/bin/env python
from __future__ import division
import climate
import lmj.cubes
import lmj.cubes.fill
import numpy as np
import pandas as pd
logging = climate.get_logger('fill')
def fill(dfs, window):
'''Complete missing marker data using linear interpolation.
... | <commit_before><commit_msg>Add simple linear interpolation filling.<commit_after>#!/usr/bin/env python
from __future__ import division
import climate
import lmj.cubes
import lmj.cubes.fill
import numpy as np
import pandas as pd
logging = climate.get_logger('fill')
def fill(dfs, window):
'''Complete missing mark... | |
55f2325354724cfe8b90324038daf2c1acaa916a | teuthology/openstack/test/test_config.py | teuthology/openstack/test/test_config.py | from teuthology.config import config
class TestOpenStack(object):
def setup(self):
self.openstack_config = config['openstack']
def test_config_clone(self):
assert 'clone' in self.openstack_config
def test_config_user_data(self):
os_type = 'rhel'
os_version = '7.0'
... | Add unit tests for OpenStack config defaults | Add unit tests for OpenStack config defaults
Signed-off-by: Zack Cerza <d7cdf09fc0f0426e98c9978ee42da5d61fa54986@redhat.com>
| Python | mit | SUSE/teuthology,dmick/teuthology,ceph/teuthology,SUSE/teuthology,dmick/teuthology,robbat2/teuthology,ktdreyer/teuthology,dmick/teuthology,caibo2014/teuthology,robbat2/teuthology,ktdreyer/teuthology,dreamhost/teuthology,SUSE/teuthology,caibo2014/teuthology,ceph/teuthology,dreamhost/teuthology | Add unit tests for OpenStack config defaults
Signed-off-by: Zack Cerza <d7cdf09fc0f0426e98c9978ee42da5d61fa54986@redhat.com> | from teuthology.config import config
class TestOpenStack(object):
def setup(self):
self.openstack_config = config['openstack']
def test_config_clone(self):
assert 'clone' in self.openstack_config
def test_config_user_data(self):
os_type = 'rhel'
os_version = '7.0'
... | <commit_before><commit_msg>Add unit tests for OpenStack config defaults
Signed-off-by: Zack Cerza <d7cdf09fc0f0426e98c9978ee42da5d61fa54986@redhat.com><commit_after> | from teuthology.config import config
class TestOpenStack(object):
def setup(self):
self.openstack_config = config['openstack']
def test_config_clone(self):
assert 'clone' in self.openstack_config
def test_config_user_data(self):
os_type = 'rhel'
os_version = '7.0'
... | Add unit tests for OpenStack config defaults
Signed-off-by: Zack Cerza <d7cdf09fc0f0426e98c9978ee42da5d61fa54986@redhat.com>from teuthology.config import config
class TestOpenStack(object):
def setup(self):
self.openstack_config = config['openstack']
def test_config_clone(self):
assert 'clo... | <commit_before><commit_msg>Add unit tests for OpenStack config defaults
Signed-off-by: Zack Cerza <d7cdf09fc0f0426e98c9978ee42da5d61fa54986@redhat.com><commit_after>from teuthology.config import config
class TestOpenStack(object):
def setup(self):
self.openstack_config = config['openstack']
def tes... | |
67f5e754a5f90903e09a6a876d858d002c513f8a | abcpy/posteriors.py | abcpy/posteriors.py | import scipy as sp
from .utils import stochastic_optimization
class BolfiPosterior():
def __init__(self, model, threshold, priors=None):
self.threshold = threshold
self.model = model
self.priors = [None] * model.n_var
self.ML, ML_val = stochastic_optimization(self._neg_unnormalize... | Add initial draft of posterior models | Add initial draft of posterior models
| Python | bsd-3-clause | lintusj1/elfi,lintusj1/elfi,elfi-dev/elfi,HIIT/elfi,elfi-dev/elfi | Add initial draft of posterior models | import scipy as sp
from .utils import stochastic_optimization
class BolfiPosterior():
def __init__(self, model, threshold, priors=None):
self.threshold = threshold
self.model = model
self.priors = [None] * model.n_var
self.ML, ML_val = stochastic_optimization(self._neg_unnormalize... | <commit_before><commit_msg>Add initial draft of posterior models<commit_after> | import scipy as sp
from .utils import stochastic_optimization
class BolfiPosterior():
def __init__(self, model, threshold, priors=None):
self.threshold = threshold
self.model = model
self.priors = [None] * model.n_var
self.ML, ML_val = stochastic_optimization(self._neg_unnormalize... | Add initial draft of posterior modelsimport scipy as sp
from .utils import stochastic_optimization
class BolfiPosterior():
def __init__(self, model, threshold, priors=None):
self.threshold = threshold
self.model = model
self.priors = [None] * model.n_var
self.ML, ML_val = stochast... | <commit_before><commit_msg>Add initial draft of posterior models<commit_after>import scipy as sp
from .utils import stochastic_optimization
class BolfiPosterior():
def __init__(self, model, threshold, priors=None):
self.threshold = threshold
self.model = model
self.priors = [None] * model... | |
b7dd7f75f655f4fbcb34d8f9ec260a6f18e8f617 | backend/scripts/adminuser.py | backend/scripts/adminuser.py | #!/usr/bin/env python
import rethinkdb as r
from optparse import OptionParser
import sys
def create_group(conn):
group = {}
group['name'] = "Admin Group"
group['description'] = "Administration Group for Materials Commons"
group['id'] = 'admin'
group['owner'] = 'admin@materialscommons.org'
grou... | Add utility to create administrative users. | Add utility to create administrative users.
| Python | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | Add utility to create administrative users. | #!/usr/bin/env python
import rethinkdb as r
from optparse import OptionParser
import sys
def create_group(conn):
group = {}
group['name'] = "Admin Group"
group['description'] = "Administration Group for Materials Commons"
group['id'] = 'admin'
group['owner'] = 'admin@materialscommons.org'
grou... | <commit_before><commit_msg>Add utility to create administrative users.<commit_after> | #!/usr/bin/env python
import rethinkdb as r
from optparse import OptionParser
import sys
def create_group(conn):
group = {}
group['name'] = "Admin Group"
group['description'] = "Administration Group for Materials Commons"
group['id'] = 'admin'
group['owner'] = 'admin@materialscommons.org'
grou... | Add utility to create administrative users.#!/usr/bin/env python
import rethinkdb as r
from optparse import OptionParser
import sys
def create_group(conn):
group = {}
group['name'] = "Admin Group"
group['description'] = "Administration Group for Materials Commons"
group['id'] = 'admin'
group['owne... | <commit_before><commit_msg>Add utility to create administrative users.<commit_after>#!/usr/bin/env python
import rethinkdb as r
from optparse import OptionParser
import sys
def create_group(conn):
group = {}
group['name'] = "Admin Group"
group['description'] = "Administration Group for Materials Commons"
... | |
0c17398f68597eae175ad6a37945cf37e95e1809 | nodeconductor/structure/migrations/0050_reset_cloud_spl_quota_limits.py | nodeconductor/structure/migrations/0050_reset_cloud_spl_quota_limits.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.contenttypes import models as ct_models
from django.db import migrations, models
from nodeconductor.quotas.models import Quota
from nodeconductor.structure.models import CloudServiceProjectLink
def reset_cloud_spl_quota_limits(apps,... | Reset invalid default quotas for CloudServiceProjectLink | Reset invalid default quotas for CloudServiceProjectLink [WAL-814]
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | Reset invalid default quotas for CloudServiceProjectLink [WAL-814] | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.contenttypes import models as ct_models
from django.db import migrations, models
from nodeconductor.quotas.models import Quota
from nodeconductor.structure.models import CloudServiceProjectLink
def reset_cloud_spl_quota_limits(apps,... | <commit_before><commit_msg>Reset invalid default quotas for CloudServiceProjectLink [WAL-814]<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.contenttypes import models as ct_models
from django.db import migrations, models
from nodeconductor.quotas.models import Quota
from nodeconductor.structure.models import CloudServiceProjectLink
def reset_cloud_spl_quota_limits(apps,... | Reset invalid default quotas for CloudServiceProjectLink [WAL-814]# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.contenttypes import models as ct_models
from django.db import migrations, models
from nodeconductor.quotas.models import Quota
from nodeconductor.structure.models impor... | <commit_before><commit_msg>Reset invalid default quotas for CloudServiceProjectLink [WAL-814]<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.contenttypes import models as ct_models
from django.db import migrations, models
from nodeconductor.quotas.models import Quota
... | |
15d3692aee84432b6b7f8306505b3f59649fd6f9 | cnxarchive/sql/migrations/20160128111115_mimetype_removal_from_module_files.py | cnxarchive/sql/migrations/20160128111115_mimetype_removal_from_module_files.py | # -*- coding: utf-8 -*-
"""\
- Move the mimetype value from ``module_files`` to ``files``.
- Remove the ``mimetype`` column from the ``module_files`` table.
"""
from __future__ import print_function
import sys
def up(cursor):
# Move the mimetype value from ``module_files`` to ``files``.
cursor.execute("UPDAT... | Remove mimetype from the module_files table | Remove mimetype from the module_files table
| Python | agpl-3.0 | Connexions/cnx-archive,Connexions/cnx-archive | Remove mimetype from the module_files table | # -*- coding: utf-8 -*-
"""\
- Move the mimetype value from ``module_files`` to ``files``.
- Remove the ``mimetype`` column from the ``module_files`` table.
"""
from __future__ import print_function
import sys
def up(cursor):
# Move the mimetype value from ``module_files`` to ``files``.
cursor.execute("UPDAT... | <commit_before><commit_msg>Remove mimetype from the module_files table<commit_after> | # -*- coding: utf-8 -*-
"""\
- Move the mimetype value from ``module_files`` to ``files``.
- Remove the ``mimetype`` column from the ``module_files`` table.
"""
from __future__ import print_function
import sys
def up(cursor):
# Move the mimetype value from ``module_files`` to ``files``.
cursor.execute("UPDAT... | Remove mimetype from the module_files table# -*- coding: utf-8 -*-
"""\
- Move the mimetype value from ``module_files`` to ``files``.
- Remove the ``mimetype`` column from the ``module_files`` table.
"""
from __future__ import print_function
import sys
def up(cursor):
# Move the mimetype value from ``module_file... | <commit_before><commit_msg>Remove mimetype from the module_files table<commit_after># -*- coding: utf-8 -*-
"""\
- Move the mimetype value from ``module_files`` to ``files``.
- Remove the ``mimetype`` column from the ``module_files`` table.
"""
from __future__ import print_function
import sys
def up(cursor):
# M... | |
abe40e3c82ef1f351275a59b2e537f43530caa0c | app/cleanup_stories.py | app/cleanup_stories.py | from pymongo import MongoClient
from fetch_stories import get_mongo_client, close_mongo_client
from bson import ObjectId
from datetime import datetime, timedelta
def remove_old_stories():
client = get_mongo_client()
db = client.get_default_database()
article_collection = db['articles']
two_days_ag... | Clean up db script (remove articles older than two days). | Clean up db script (remove articles older than two days).
| Python | mit | hw3jung/Gucci,hw3jung/Gucci | Clean up db script (remove articles older than two days). | from pymongo import MongoClient
from fetch_stories import get_mongo_client, close_mongo_client
from bson import ObjectId
from datetime import datetime, timedelta
def remove_old_stories():
client = get_mongo_client()
db = client.get_default_database()
article_collection = db['articles']
two_days_ag... | <commit_before><commit_msg>Clean up db script (remove articles older than two days).<commit_after> | from pymongo import MongoClient
from fetch_stories import get_mongo_client, close_mongo_client
from bson import ObjectId
from datetime import datetime, timedelta
def remove_old_stories():
client = get_mongo_client()
db = client.get_default_database()
article_collection = db['articles']
two_days_ag... | Clean up db script (remove articles older than two days).from pymongo import MongoClient
from fetch_stories import get_mongo_client, close_mongo_client
from bson import ObjectId
from datetime import datetime, timedelta
def remove_old_stories():
client = get_mongo_client()
db = client.get_default_database()... | <commit_before><commit_msg>Clean up db script (remove articles older than two days).<commit_after>from pymongo import MongoClient
from fetch_stories import get_mongo_client, close_mongo_client
from bson import ObjectId
from datetime import datetime, timedelta
def remove_old_stories():
client = get_mongo_client()
... | |
372f4a988411e48a0c50cdc74fb2a7f4e5abf052 | tests/server-identity.py | tests/server-identity.py | import nose
import requests
import fixture
@nose.with_setup(fixture.start_tangelo, fixture.stop_tangelo)
def test_server_identity():
response = requests.get(fixture.url("/"))
assert response.headers["server"] == "Tangelo"
| Add a server identity test | Add a server identity test
| Python | apache-2.0 | Kitware/tangelo,Kitware/tangelo,Kitware/tangelo | Add a server identity test | import nose
import requests
import fixture
@nose.with_setup(fixture.start_tangelo, fixture.stop_tangelo)
def test_server_identity():
response = requests.get(fixture.url("/"))
assert response.headers["server"] == "Tangelo"
| <commit_before><commit_msg>Add a server identity test<commit_after> | import nose
import requests
import fixture
@nose.with_setup(fixture.start_tangelo, fixture.stop_tangelo)
def test_server_identity():
response = requests.get(fixture.url("/"))
assert response.headers["server"] == "Tangelo"
| Add a server identity testimport nose
import requests
import fixture
@nose.with_setup(fixture.start_tangelo, fixture.stop_tangelo)
def test_server_identity():
response = requests.get(fixture.url("/"))
assert response.headers["server"] == "Tangelo"
| <commit_before><commit_msg>Add a server identity test<commit_after>import nose
import requests
import fixture
@nose.with_setup(fixture.start_tangelo, fixture.stop_tangelo)
def test_server_identity():
response = requests.get(fixture.url("/"))
assert response.headers["server"] == "Tangelo"
| |
19db4647257617992e9b195828baf39907cc5db1 | tests/test_exit_codes.py | tests/test_exit_codes.py | """Check that the CLI returns the appropriate exit code."""
import subprocess
def test_exit_code_demo():
"""Ensure that linting the demo returns an exit code of 1."""
try:
subprocess.check_output("proselint --demo", shell=True)
except subprocess.CalledProcessError as grepexc:
assert(grep... | Add tests for exit codes | Add tests for exit codes
| Python | bsd-3-clause | amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint | Add tests for exit codes | """Check that the CLI returns the appropriate exit code."""
import subprocess
def test_exit_code_demo():
"""Ensure that linting the demo returns an exit code of 1."""
try:
subprocess.check_output("proselint --demo", shell=True)
except subprocess.CalledProcessError as grepexc:
assert(grep... | <commit_before><commit_msg>Add tests for exit codes<commit_after> | """Check that the CLI returns the appropriate exit code."""
import subprocess
def test_exit_code_demo():
"""Ensure that linting the demo returns an exit code of 1."""
try:
subprocess.check_output("proselint --demo", shell=True)
except subprocess.CalledProcessError as grepexc:
assert(grep... | Add tests for exit codes"""Check that the CLI returns the appropriate exit code."""
import subprocess
def test_exit_code_demo():
"""Ensure that linting the demo returns an exit code of 1."""
try:
subprocess.check_output("proselint --demo", shell=True)
except subprocess.CalledProcessError as grep... | <commit_before><commit_msg>Add tests for exit codes<commit_after>"""Check that the CLI returns the appropriate exit code."""
import subprocess
def test_exit_code_demo():
"""Ensure that linting the demo returns an exit code of 1."""
try:
subprocess.check_output("proselint --demo", shell=True)
exc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.