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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
20f7b0296f0e7139a69f94ca8c80c9ad1b73c011 | tests/test_package.py | tests/test_package.py | import argparse
import mock
import os
import tempfile
import unittest
import shutil
import re
import sys
from dogen.plugins.repo import Repo
from dogen.generator import Generator
class TestPackage(unittest.TestCase):
def setUp(self):
self.workdir = tempfile.mkdtemp(prefix='test_repo_plugin')
self.... | Add a test for package generation | Add a test for package generation
| Python | mit | jboss-dockerfiles/dogen,goldmann/dogen,jboss-container-images/concreate,jboss-container-images/concreate,goldmann/dogen,goldmann/dogen,jboss-container-images/concreate,jboss-dockerfiles/dogen,jboss-dockerfiles/dogen | Add a test for package generation | import argparse
import mock
import os
import tempfile
import unittest
import shutil
import re
import sys
from dogen.plugins.repo import Repo
from dogen.generator import Generator
class TestPackage(unittest.TestCase):
def setUp(self):
self.workdir = tempfile.mkdtemp(prefix='test_repo_plugin')
self.... | <commit_before><commit_msg>Add a test for package generation<commit_after> | import argparse
import mock
import os
import tempfile
import unittest
import shutil
import re
import sys
from dogen.plugins.repo import Repo
from dogen.generator import Generator
class TestPackage(unittest.TestCase):
def setUp(self):
self.workdir = tempfile.mkdtemp(prefix='test_repo_plugin')
self.... | Add a test for package generationimport argparse
import mock
import os
import tempfile
import unittest
import shutil
import re
import sys
from dogen.plugins.repo import Repo
from dogen.generator import Generator
class TestPackage(unittest.TestCase):
def setUp(self):
self.workdir = tempfile.mkdtemp(prefix=... | <commit_before><commit_msg>Add a test for package generation<commit_after>import argparse
import mock
import os
import tempfile
import unittest
import shutil
import re
import sys
from dogen.plugins.repo import Repo
from dogen.generator import Generator
class TestPackage(unittest.TestCase):
def setUp(self):
... | |
2567596cdc1a3dc0a00aee122793a5733f8f9abb | import_data.py | import_data.py | from __future__ import print_function
import os
import re
#http://stackoverflow.com/questions/3964681/find-all-files-in-directory-with-extension-txt-with-python
create_table_file = open('create_table.sql', 'r')
output_file = open('import_data.sql', 'w')
print('drop table districts;', file=output_file)
for line in crea... | Create .sql file to automatically import data into database | Create .sql file to automatically import data into database
| Python | bsd-3-clause | rkawauchi/IHK,rkawauchi/IHK | Create .sql file to automatically import data into database | from __future__ import print_function
import os
import re
#http://stackoverflow.com/questions/3964681/find-all-files-in-directory-with-extension-txt-with-python
create_table_file = open('create_table.sql', 'r')
output_file = open('import_data.sql', 'w')
print('drop table districts;', file=output_file)
for line in crea... | <commit_before><commit_msg>Create .sql file to automatically import data into database<commit_after> | from __future__ import print_function
import os
import re
#http://stackoverflow.com/questions/3964681/find-all-files-in-directory-with-extension-txt-with-python
create_table_file = open('create_table.sql', 'r')
output_file = open('import_data.sql', 'w')
print('drop table districts;', file=output_file)
for line in crea... | Create .sql file to automatically import data into databasefrom __future__ import print_function
import os
import re
#http://stackoverflow.com/questions/3964681/find-all-files-in-directory-with-extension-txt-with-python
create_table_file = open('create_table.sql', 'r')
output_file = open('import_data.sql', 'w')
print(... | <commit_before><commit_msg>Create .sql file to automatically import data into database<commit_after>from __future__ import print_function
import os
import re
#http://stackoverflow.com/questions/3964681/find-all-files-in-directory-with-extension-txt-with-python
create_table_file = open('create_table.sql', 'r')
output_f... | |
6c607c2d8c903febe9e787f627a6be41544b629e | lintcode/Easy/112_Delete_Duplicates.py | lintcode/Easy/112_Delete_Duplicates.py | """
Definition of ListNode
class ListNode(object):
def __init__(self, val, next=None):
self.val = val
self.next = next
"""
class Solution:
"""
@param head: A ListNode
@return: A ListNode
"""
def deleteDuplicates(self, head):
# write your code here
tmp = head
... | Add solution to lintcode question 112 | Add solution to lintcode question 112
| Python | mit | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | Add solution to lintcode question 112 | """
Definition of ListNode
class ListNode(object):
def __init__(self, val, next=None):
self.val = val
self.next = next
"""
class Solution:
"""
@param head: A ListNode
@return: A ListNode
"""
def deleteDuplicates(self, head):
# write your code here
tmp = head
... | <commit_before><commit_msg>Add solution to lintcode question 112<commit_after> | """
Definition of ListNode
class ListNode(object):
def __init__(self, val, next=None):
self.val = val
self.next = next
"""
class Solution:
"""
@param head: A ListNode
@return: A ListNode
"""
def deleteDuplicates(self, head):
# write your code here
tmp = head
... | Add solution to lintcode question 112"""
Definition of ListNode
class ListNode(object):
def __init__(self, val, next=None):
self.val = val
self.next = next
"""
class Solution:
"""
@param head: A ListNode
@return: A ListNode
"""
def deleteDuplicates(self, head):
# write yo... | <commit_before><commit_msg>Add solution to lintcode question 112<commit_after>"""
Definition of ListNode
class ListNode(object):
def __init__(self, val, next=None):
self.val = val
self.next = next
"""
class Solution:
"""
@param head: A ListNode
@return: A ListNode
"""
def deleteD... | |
9a10aa2406def7df654710c5b3244218efad95c8 | examples/cc/14-ccsd_diis.py | examples/cc/14-ccsd_diis.py | #!/usr/bin/env python
#
# Author: Qiming Sun <[email protected]>
#
'''
Adjust CCSD DIIS
'''
from pyscf import gto, scf, cc
mol = gto.M(
atom = 'H 0 0 0; F 0 0 1.1',
basis = 'ccpvdz')
mf = scf.RHF(mol).run()
#
# Increase the DIIS space to improve convergence
#
mycc = cc.CCSD(mf)
mycc.diis_space = 10
mycc... | Add example of CCSD DIIS | Add example of CCSD DIIS
| Python | apache-2.0 | gkc1000/pyscf,gkc1000/pyscf,sunqm/pyscf,sunqm/pyscf,sunqm/pyscf,sunqm/pyscf,gkc1000/pyscf,gkc1000/pyscf,gkc1000/pyscf | Add example of CCSD DIIS | #!/usr/bin/env python
#
# Author: Qiming Sun <[email protected]>
#
'''
Adjust CCSD DIIS
'''
from pyscf import gto, scf, cc
mol = gto.M(
atom = 'H 0 0 0; F 0 0 1.1',
basis = 'ccpvdz')
mf = scf.RHF(mol).run()
#
# Increase the DIIS space to improve convergence
#
mycc = cc.CCSD(mf)
mycc.diis_space = 10
mycc... | <commit_before><commit_msg>Add example of CCSD DIIS<commit_after> | #!/usr/bin/env python
#
# Author: Qiming Sun <[email protected]>
#
'''
Adjust CCSD DIIS
'''
from pyscf import gto, scf, cc
mol = gto.M(
atom = 'H 0 0 0; F 0 0 1.1',
basis = 'ccpvdz')
mf = scf.RHF(mol).run()
#
# Increase the DIIS space to improve convergence
#
mycc = cc.CCSD(mf)
mycc.diis_space = 10
mycc... | Add example of CCSD DIIS#!/usr/bin/env python
#
# Author: Qiming Sun <[email protected]>
#
'''
Adjust CCSD DIIS
'''
from pyscf import gto, scf, cc
mol = gto.M(
atom = 'H 0 0 0; F 0 0 1.1',
basis = 'ccpvdz')
mf = scf.RHF(mol).run()
#
# Increase the DIIS space to improve convergence
#
mycc = cc.CCSD(mf)
m... | <commit_before><commit_msg>Add example of CCSD DIIS<commit_after>#!/usr/bin/env python
#
# Author: Qiming Sun <[email protected]>
#
'''
Adjust CCSD DIIS
'''
from pyscf import gto, scf, cc
mol = gto.M(
atom = 'H 0 0 0; F 0 0 1.1',
basis = 'ccpvdz')
mf = scf.RHF(mol).run()
#
# Increase the DIIS space to i... | |
05427969fea7f5d2d528d368f4455dfeabb71b9c | test_rulefit.py | test_rulefit.py | from rulefit import RuleCondition, Rule, RuleEnsemble, RuleFit
import numpy as np
rule_condition_smaller = RuleCondition(1, 5, "<=", 0.4)
rule_condition_greater = RuleCondition(0, 1, ">", 0.1)
X = np.array([[1,2,3], [4,5,6], [7,8,9]])
## Testing RuleCondition
def test_rule_condition_hashing_equal1():
assert (R... | Add tests for RuleCondition and Rule | Add tests for RuleCondition and Rule
| Python | mit | christophM/rulefit | Add tests for RuleCondition and Rule | from rulefit import RuleCondition, Rule, RuleEnsemble, RuleFit
import numpy as np
rule_condition_smaller = RuleCondition(1, 5, "<=", 0.4)
rule_condition_greater = RuleCondition(0, 1, ">", 0.1)
X = np.array([[1,2,3], [4,5,6], [7,8,9]])
## Testing RuleCondition
def test_rule_condition_hashing_equal1():
assert (R... | <commit_before><commit_msg>Add tests for RuleCondition and Rule<commit_after> | from rulefit import RuleCondition, Rule, RuleEnsemble, RuleFit
import numpy as np
rule_condition_smaller = RuleCondition(1, 5, "<=", 0.4)
rule_condition_greater = RuleCondition(0, 1, ">", 0.1)
X = np.array([[1,2,3], [4,5,6], [7,8,9]])
## Testing RuleCondition
def test_rule_condition_hashing_equal1():
assert (R... | Add tests for RuleCondition and Rulefrom rulefit import RuleCondition, Rule, RuleEnsemble, RuleFit
import numpy as np
rule_condition_smaller = RuleCondition(1, 5, "<=", 0.4)
rule_condition_greater = RuleCondition(0, 1, ">", 0.1)
X = np.array([[1,2,3], [4,5,6], [7,8,9]])
## Testing RuleCondition
def test_rule_condi... | <commit_before><commit_msg>Add tests for RuleCondition and Rule<commit_after>from rulefit import RuleCondition, Rule, RuleEnsemble, RuleFit
import numpy as np
rule_condition_smaller = RuleCondition(1, 5, "<=", 0.4)
rule_condition_greater = RuleCondition(0, 1, ">", 0.1)
X = np.array([[1,2,3], [4,5,6], [7,8,9]])
## ... | |
8a120852938247f53f0eb793932ef7b13db9f577 | tools/primes.py | tools/primes.py | primes = [2, 3, 5, 7]
safe = True
muliplier = 1
for p in primes:
muliplier *= p
offsets = []
for x in range(3, muliplier + 3, 2):
prime = True
for p in primes:
if not x % p or (safe and not ((x - 1) / 2) % p):
prime = False
break
if prime:
offsets.append(x)
pr... | Add python script to generate the bits needed for the prime generator. | Add python script to generate the bits needed for the prime generator.
| Python | apache-2.0 | openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl | Add python script to generate the bits needed for the prime generator. | primes = [2, 3, 5, 7]
safe = True
muliplier = 1
for p in primes:
muliplier *= p
offsets = []
for x in range(3, muliplier + 3, 2):
prime = True
for p in primes:
if not x % p or (safe and not ((x - 1) / 2) % p):
prime = False
break
if prime:
offsets.append(x)
pr... | <commit_before><commit_msg>Add python script to generate the bits needed for the prime generator.<commit_after> | primes = [2, 3, 5, 7]
safe = True
muliplier = 1
for p in primes:
muliplier *= p
offsets = []
for x in range(3, muliplier + 3, 2):
prime = True
for p in primes:
if not x % p or (safe and not ((x - 1) / 2) % p):
prime = False
break
if prime:
offsets.append(x)
pr... | Add python script to generate the bits needed for the prime generator.primes = [2, 3, 5, 7]
safe = True
muliplier = 1
for p in primes:
muliplier *= p
offsets = []
for x in range(3, muliplier + 3, 2):
prime = True
for p in primes:
if not x % p or (safe and not ((x - 1) / 2) % p):
prime ... | <commit_before><commit_msg>Add python script to generate the bits needed for the prime generator.<commit_after>primes = [2, 3, 5, 7]
safe = True
muliplier = 1
for p in primes:
muliplier *= p
offsets = []
for x in range(3, muliplier + 3, 2):
prime = True
for p in primes:
if not x % p or (safe and n... | |
2594a273d4248289ac839b0c436ca3c1d115008d | tests/test_exceptions.py | tests/test_exceptions.py | from scrapyd_api.exceptions import ScrapydError
def test_scrapyd_error():
err = ScrapydError()
assert repr(err) == 'ScrapydError("Scrapyd Error")'
err_with_detail = ScrapydError(detail='Something went wrong')
assert repr(err_with_detail) == 'ScrapydError("Something went wrong")'
| Add a test to check the ScrapydError's repr(). | Add a test to check the ScrapydError's repr().
Takes us to 100% coverage.
| Python | bsd-2-clause | djm/python-scrapyd-api | Add a test to check the ScrapydError's repr().
Takes us to 100% coverage. | from scrapyd_api.exceptions import ScrapydError
def test_scrapyd_error():
err = ScrapydError()
assert repr(err) == 'ScrapydError("Scrapyd Error")'
err_with_detail = ScrapydError(detail='Something went wrong')
assert repr(err_with_detail) == 'ScrapydError("Something went wrong")'
| <commit_before><commit_msg>Add a test to check the ScrapydError's repr().
Takes us to 100% coverage.<commit_after> | from scrapyd_api.exceptions import ScrapydError
def test_scrapyd_error():
err = ScrapydError()
assert repr(err) == 'ScrapydError("Scrapyd Error")'
err_with_detail = ScrapydError(detail='Something went wrong')
assert repr(err_with_detail) == 'ScrapydError("Something went wrong")'
| Add a test to check the ScrapydError's repr().
Takes us to 100% coverage.from scrapyd_api.exceptions import ScrapydError
def test_scrapyd_error():
err = ScrapydError()
assert repr(err) == 'ScrapydError("Scrapyd Error")'
err_with_detail = ScrapydError(detail='Something went wrong')
assert repr(err_wit... | <commit_before><commit_msg>Add a test to check the ScrapydError's repr().
Takes us to 100% coverage.<commit_after>from scrapyd_api.exceptions import ScrapydError
def test_scrapyd_error():
err = ScrapydError()
assert repr(err) == 'ScrapydError("Scrapyd Error")'
err_with_detail = ScrapydError(detail='Somet... | |
e12b8b81b012bf2a459e2df2faa64057164cf968 | py/is-subsequence.py | py/is-subsequence.py | class Solution(object):
def isSubsequence(self, s, t):
"""
:type s: str
:type t: str
:rtype: bool
"""
x = 0
for i, c in enumerate(t):
if x == len(s):
return True
if c == s[x]:
x += 1
return x == l... | Add py solution for 392. Is Subsequence | Add py solution for 392. Is Subsequence
392. Is Subsequence: https://leetcode.com/problems/is-subsequence/
Approach:
Observe the first item remaining in each step. The value will be added
1 << step either the remaining count is odd or it's a left-to-right
step. Hence the n | 0x55555.. is the key.
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 392. Is Subsequence
392. Is Subsequence: https://leetcode.com/problems/is-subsequence/
Approach:
Observe the first item remaining in each step. The value will be added
1 << step either the remaining count is odd or it's a left-to-right
step. Hence the n | 0x55555.. is the key. | class Solution(object):
def isSubsequence(self, s, t):
"""
:type s: str
:type t: str
:rtype: bool
"""
x = 0
for i, c in enumerate(t):
if x == len(s):
return True
if c == s[x]:
x += 1
return x == l... | <commit_before><commit_msg>Add py solution for 392. Is Subsequence
392. Is Subsequence: https://leetcode.com/problems/is-subsequence/
Approach:
Observe the first item remaining in each step. The value will be added
1 << step either the remaining count is odd or it's a left-to-right
step. Hence the n | 0x5... | class Solution(object):
def isSubsequence(self, s, t):
"""
:type s: str
:type t: str
:rtype: bool
"""
x = 0
for i, c in enumerate(t):
if x == len(s):
return True
if c == s[x]:
x += 1
return x == l... | Add py solution for 392. Is Subsequence
392. Is Subsequence: https://leetcode.com/problems/is-subsequence/
Approach:
Observe the first item remaining in each step. The value will be added
1 << step either the remaining count is odd or it's a left-to-right
step. Hence the n | 0x55555.. is the key.class Sol... | <commit_before><commit_msg>Add py solution for 392. Is Subsequence
392. Is Subsequence: https://leetcode.com/problems/is-subsequence/
Approach:
Observe the first item remaining in each step. The value will be added
1 << step either the remaining count is odd or it's a left-to-right
step. Hence the n | 0x5... | |
a8200dbb889281efe9d39cca446bcd62fcb26a67 | py/construct-string-from-binary-tree.py | py/construct-string-from-binary-tree.py | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def tree2str(self, t):
"""
:type t: TreeNode
:rtype: str
"""
if not t:
... | Add py solution for 606. Construct String from Binary Tree | Add py solution for 606. Construct String from Binary Tree
606. Construct String from Binary Tree: https://leetcode.com/problems/construct-string-from-binary-tree/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 606. Construct String from Binary Tree
606. Construct String from Binary Tree: https://leetcode.com/problems/construct-string-from-binary-tree/ | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def tree2str(self, t):
"""
:type t: TreeNode
:rtype: str
"""
if not t:
... | <commit_before><commit_msg>Add py solution for 606. Construct String from Binary Tree
606. Construct String from Binary Tree: https://leetcode.com/problems/construct-string-from-binary-tree/<commit_after> | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def tree2str(self, t):
"""
:type t: TreeNode
:rtype: str
"""
if not t:
... | Add py solution for 606. Construct String from Binary Tree
606. Construct String from Binary Tree: https://leetcode.com/problems/construct-string-from-binary-tree/# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self... | <commit_before><commit_msg>Add py solution for 606. Construct String from Binary Tree
606. Construct String from Binary Tree: https://leetcode.com/problems/construct-string-from-binary-tree/<commit_after># Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
... | |
234f55355e26f9a549cca75051ad369f557184ae | migrations/versions/5_add_oai_table.py | migrations/versions/5_add_oai_table.py | """ Add table for OAI repositories
Revision ID: 71874271208e
Revises: a80b4f777c12
Create Date: 2017-01-15 21:47:58.946488
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '71874271208e'
down_revision = 'a80b4f777c12'
branch_labels = None
depends_on = None
def... | Add table for OAI repositories | Add table for OAI repositories
| Python | agpl-3.0 | jbaiter/demetsiiify,jbaiter/demetsiiify,jbaiter/demetsiiify | Add table for OAI repositories | """ Add table for OAI repositories
Revision ID: 71874271208e
Revises: a80b4f777c12
Create Date: 2017-01-15 21:47:58.946488
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '71874271208e'
down_revision = 'a80b4f777c12'
branch_labels = None
depends_on = None
def... | <commit_before><commit_msg>Add table for OAI repositories<commit_after> | """ Add table for OAI repositories
Revision ID: 71874271208e
Revises: a80b4f777c12
Create Date: 2017-01-15 21:47:58.946488
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '71874271208e'
down_revision = 'a80b4f777c12'
branch_labels = None
depends_on = None
def... | Add table for OAI repositories""" Add table for OAI repositories
Revision ID: 71874271208e
Revises: a80b4f777c12
Create Date: 2017-01-15 21:47:58.946488
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '71874271208e'
down_revision = 'a80b4f777c12'
branch_labels ... | <commit_before><commit_msg>Add table for OAI repositories<commit_after>""" Add table for OAI repositories
Revision ID: 71874271208e
Revises: a80b4f777c12
Create Date: 2017-01-15 21:47:58.946488
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '71874271208e'
down... | |
1a776b7fd58f7936cf37ee5e0e4e1b2a4bf5ff3e | src/tempel/utils.py | src/tempel/utils.py | from django.conf import settings
languages = dict([(item['name'], item) for item in settings.TEMPEL_LANGUAGES])
def get_languages():
return sorted([(item['name'], item['label']) for item in languages.values()])
def get_language(name):
return languages[name]['label']
def get_mimetype(name):
return langua... | Add utility functions to query the languages | Add utility functions to query the languages
| Python | agpl-3.0 | fajran/tempel | Add utility functions to query the languages | from django.conf import settings
languages = dict([(item['name'], item) for item in settings.TEMPEL_LANGUAGES])
def get_languages():
return sorted([(item['name'], item['label']) for item in languages.values()])
def get_language(name):
return languages[name]['label']
def get_mimetype(name):
return langua... | <commit_before><commit_msg>Add utility functions to query the languages<commit_after> | from django.conf import settings
languages = dict([(item['name'], item) for item in settings.TEMPEL_LANGUAGES])
def get_languages():
return sorted([(item['name'], item['label']) for item in languages.values()])
def get_language(name):
return languages[name]['label']
def get_mimetype(name):
return langua... | Add utility functions to query the languagesfrom django.conf import settings
languages = dict([(item['name'], item) for item in settings.TEMPEL_LANGUAGES])
def get_languages():
return sorted([(item['name'], item['label']) for item in languages.values()])
def get_language(name):
return languages[name]['label'... | <commit_before><commit_msg>Add utility functions to query the languages<commit_after>from django.conf import settings
languages = dict([(item['name'], item) for item in settings.TEMPEL_LANGUAGES])
def get_languages():
return sorted([(item['name'], item['label']) for item in languages.values()])
def get_language(... | |
d88fde11ed648da8af7ee0bf81a635f72d26fe9c | tests/test_search.py | tests/test_search.py | from . import TestCase
from memopol.search.templatetags.search_tags import simple_search_shortcut
class TestSearchTemplateTags(TestCase):
def test_simple_search_shortcut(self):
url = simple_search_shortcut('country:FR or country:BR')
self.assertEqual(url, "/search/?q=country%3AFR%20or%20country%3... | Add a basic test for simple_search_shortcut templatetag | [enh] Add a basic test for simple_search_shortcut templatetag
| Python | agpl-3.0 | yohanboniface/memopol-core,yohanboniface/memopol-core,yohanboniface/memopol-core | [enh] Add a basic test for simple_search_shortcut templatetag | from . import TestCase
from memopol.search.templatetags.search_tags import simple_search_shortcut
class TestSearchTemplateTags(TestCase):
def test_simple_search_shortcut(self):
url = simple_search_shortcut('country:FR or country:BR')
self.assertEqual(url, "/search/?q=country%3AFR%20or%20country%3... | <commit_before><commit_msg>[enh] Add a basic test for simple_search_shortcut templatetag<commit_after> | from . import TestCase
from memopol.search.templatetags.search_tags import simple_search_shortcut
class TestSearchTemplateTags(TestCase):
def test_simple_search_shortcut(self):
url = simple_search_shortcut('country:FR or country:BR')
self.assertEqual(url, "/search/?q=country%3AFR%20or%20country%3... | [enh] Add a basic test for simple_search_shortcut templatetagfrom . import TestCase
from memopol.search.templatetags.search_tags import simple_search_shortcut
class TestSearchTemplateTags(TestCase):
def test_simple_search_shortcut(self):
url = simple_search_shortcut('country:FR or country:BR')
se... | <commit_before><commit_msg>[enh] Add a basic test for simple_search_shortcut templatetag<commit_after>from . import TestCase
from memopol.search.templatetags.search_tags import simple_search_shortcut
class TestSearchTemplateTags(TestCase):
def test_simple_search_shortcut(self):
url = simple_search_shortc... | |
e3248ba4bca04b434414570dc438547d8770adc9 | tools/ocd_restore.py | tools/ocd_restore.py | #!/usr/bin/env python
from pupa.utils import JSONEncoderPlus
from contextlib import contextmanager
from pymongo import Connection
import argparse
import json
import os
parser = argparse.ArgumentParser(description='Re-convert a jurisdiction.')
parser.add_argument('--server', type=str, help='Mongo Server',
... | Add basics for a restore script | Add basics for a restore script
(Yes, sadly, still debugging, need the prod db)
| Python | bsd-3-clause | rshorey/pupa,mileswwatkins/pupa,datamade/pupa,rshorey/pupa,opencivicdata/pupa,influence-usa/pupa,mileswwatkins/pupa,influence-usa/pupa,opencivicdata/pupa,datamade/pupa | Add basics for a restore script
(Yes, sadly, still debugging, need the prod db) | #!/usr/bin/env python
from pupa.utils import JSONEncoderPlus
from contextlib import contextmanager
from pymongo import Connection
import argparse
import json
import os
parser = argparse.ArgumentParser(description='Re-convert a jurisdiction.')
parser.add_argument('--server', type=str, help='Mongo Server',
... | <commit_before><commit_msg>Add basics for a restore script
(Yes, sadly, still debugging, need the prod db)<commit_after> | #!/usr/bin/env python
from pupa.utils import JSONEncoderPlus
from contextlib import contextmanager
from pymongo import Connection
import argparse
import json
import os
parser = argparse.ArgumentParser(description='Re-convert a jurisdiction.')
parser.add_argument('--server', type=str, help='Mongo Server',
... | Add basics for a restore script
(Yes, sadly, still debugging, need the prod db)#!/usr/bin/env python
from pupa.utils import JSONEncoderPlus
from contextlib import contextmanager
from pymongo import Connection
import argparse
import json
import os
parser = argparse.ArgumentParser(description='Re-convert a jurisdictio... | <commit_before><commit_msg>Add basics for a restore script
(Yes, sadly, still debugging, need the prod db)<commit_after>#!/usr/bin/env python
from pupa.utils import JSONEncoderPlus
from contextlib import contextmanager
from pymongo import Connection
import argparse
import json
import os
parser = argparse.ArgumentPar... | |
1ed54b7b799430f9aac67759b1e3d5bed2b59d8b | tests/test_context.py | tests/test_context.py | from dmaws.context import Context
class TestContext(object):
def test_empty_context(self):
ctx = Context()
assert ctx.stage is None
assert ctx.environment is None
def test_add_apps(self):
ctx = Context()
ctx.add_apps(['api', 'aws'])
assert ctx.apps == ['api',... | Add some tests for Context | Add some tests for Context
| Python | mit | alphagov/digitalmarketplace-aws,alphagov/digitalmarketplace-aws,alphagov/digitalmarketplace-aws | Add some tests for Context | from dmaws.context import Context
class TestContext(object):
def test_empty_context(self):
ctx = Context()
assert ctx.stage is None
assert ctx.environment is None
def test_add_apps(self):
ctx = Context()
ctx.add_apps(['api', 'aws'])
assert ctx.apps == ['api',... | <commit_before><commit_msg>Add some tests for Context<commit_after> | from dmaws.context import Context
class TestContext(object):
def test_empty_context(self):
ctx = Context()
assert ctx.stage is None
assert ctx.environment is None
def test_add_apps(self):
ctx = Context()
ctx.add_apps(['api', 'aws'])
assert ctx.apps == ['api',... | Add some tests for Contextfrom dmaws.context import Context
class TestContext(object):
def test_empty_context(self):
ctx = Context()
assert ctx.stage is None
assert ctx.environment is None
def test_add_apps(self):
ctx = Context()
ctx.add_apps(['api', 'aws'])
... | <commit_before><commit_msg>Add some tests for Context<commit_after>from dmaws.context import Context
class TestContext(object):
def test_empty_context(self):
ctx = Context()
assert ctx.stage is None
assert ctx.environment is None
def test_add_apps(self):
ctx = Context()
... | |
4f66208343c29226bdb549c2b1d6d15cd2ab985e | tests/twisted/presence/initial-presence.py | tests/twisted/presence/initial-presence.py | """
Tests setting your own presence before calling Connect(), allowing the user to
sign in as Busy/Invisible/whatever rather than available.
"""
from twisted.words.xish import domish
from gabbletest import exec_test
from servicetest import EventPattern, assertEquals, assertNotEquals
import ns
import constants as cs
f... | """
Tests setting your own presence before calling Connect(), allowing the user to
sign in as Busy/Invisible/whatever rather than available.
"""
from twisted.words.xish import domish
from gabbletest import exec_test
from servicetest import EventPattern, assertEquals, assertNotEquals
import ns
import constants as cs
f... | Add hybrid (XEP-0126 & XEP-0186) service to initial presence test. | Add hybrid (XEP-0126 & XEP-0186) service to initial presence test.
| Python | lgpl-2.1 | Ziemin/telepathy-gabble,jku/telepathy-gabble,mlundblad/telepathy-gabble,Ziemin/telepathy-gabble,mlundblad/telepathy-gabble,Ziemin/telepathy-gabble,Ziemin/telepathy-gabble,jku/telepathy-gabble,mlundblad/telepathy-gabble,jku/telepathy-gabble | """
Tests setting your own presence before calling Connect(), allowing the user to
sign in as Busy/Invisible/whatever rather than available.
"""
from twisted.words.xish import domish
from gabbletest import exec_test
from servicetest import EventPattern, assertEquals, assertNotEquals
import ns
import constants as cs
f... | """
Tests setting your own presence before calling Connect(), allowing the user to
sign in as Busy/Invisible/whatever rather than available.
"""
from twisted.words.xish import domish
from gabbletest import exec_test
from servicetest import EventPattern, assertEquals, assertNotEquals
import ns
import constants as cs
f... | <commit_before>"""
Tests setting your own presence before calling Connect(), allowing the user to
sign in as Busy/Invisible/whatever rather than available.
"""
from twisted.words.xish import domish
from gabbletest import exec_test
from servicetest import EventPattern, assertEquals, assertNotEquals
import ns
import co... | """
Tests setting your own presence before calling Connect(), allowing the user to
sign in as Busy/Invisible/whatever rather than available.
"""
from twisted.words.xish import domish
from gabbletest import exec_test
from servicetest import EventPattern, assertEquals, assertNotEquals
import ns
import constants as cs
f... | """
Tests setting your own presence before calling Connect(), allowing the user to
sign in as Busy/Invisible/whatever rather than available.
"""
from twisted.words.xish import domish
from gabbletest import exec_test
from servicetest import EventPattern, assertEquals, assertNotEquals
import ns
import constants as cs
f... | <commit_before>"""
Tests setting your own presence before calling Connect(), allowing the user to
sign in as Busy/Invisible/whatever rather than available.
"""
from twisted.words.xish import domish
from gabbletest import exec_test
from servicetest import EventPattern, assertEquals, assertNotEquals
import ns
import co... |
6b7b67f2233df86ac583952302baabf491ee0f8d | create-graph.py | create-graph.py | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
data = {'date': ['2014-05-01 18:47:05.069722', '2014-05-01 18:47:05.119994', '2014-05-02 18:47:05.178768', '2014-05-02 18:47:05.230071', '2014-05-02 18:47:05.230071', '2014-05-02 18:47:05.280592', '2014-05-03 18:47:05.332662', '2014-05-03 18:47:05.... | Add example of creating a pandas graph | Add example of creating a pandas graph
| Python | mit | RobBollons/utilities | Add example of creating a pandas graph | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
data = {'date': ['2014-05-01 18:47:05.069722', '2014-05-01 18:47:05.119994', '2014-05-02 18:47:05.178768', '2014-05-02 18:47:05.230071', '2014-05-02 18:47:05.230071', '2014-05-02 18:47:05.280592', '2014-05-03 18:47:05.332662', '2014-05-03 18:47:05.... | <commit_before><commit_msg>Add example of creating a pandas graph<commit_after> | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
data = {'date': ['2014-05-01 18:47:05.069722', '2014-05-01 18:47:05.119994', '2014-05-02 18:47:05.178768', '2014-05-02 18:47:05.230071', '2014-05-02 18:47:05.230071', '2014-05-02 18:47:05.280592', '2014-05-03 18:47:05.332662', '2014-05-03 18:47:05.... | Add example of creating a pandas graphimport pandas as pd
import numpy as np
import matplotlib.pyplot as plt
data = {'date': ['2014-05-01 18:47:05.069722', '2014-05-01 18:47:05.119994', '2014-05-02 18:47:05.178768', '2014-05-02 18:47:05.230071', '2014-05-02 18:47:05.230071', '2014-05-02 18:47:05.280592', '2014-05-03 1... | <commit_before><commit_msg>Add example of creating a pandas graph<commit_after>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
data = {'date': ['2014-05-01 18:47:05.069722', '2014-05-01 18:47:05.119994', '2014-05-02 18:47:05.178768', '2014-05-02 18:47:05.230071', '2014-05-02 18:47:05.230071', '2... | |
3bba7a50dbb42f7a89975396081291cf8bf2ae55 | nipype/algorithms/tests/test_auto_Overlap.py | nipype/algorithms/tests/test_auto_Overlap.py | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.algorithms.misc import Overlap
def test_Overlap_inputs():
input_map = dict(bg_overlap=dict(mandatory=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
mas... | Test overlap not included before | Test overlap not included before
| Python | bsd-3-clause | wanderine/nipype,mick-d/nipype,sgiavasis/nipype,gerddie/nipype,pearsonlab/nipype,iglpdc/nipype,carolFrohlich/nipype,dgellis90/nipype,mick-d/nipype,wanderine/nipype,wanderine/nipype,wanderine/nipype,Leoniela/nipype,grlee77/nipype,pearsonlab/nipype,pearsonlab/nipype,sgiavasis/nipype,carolFrohlich/nipype,dgellis90/nipype,... | Test overlap not included before | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.algorithms.misc import Overlap
def test_Overlap_inputs():
input_map = dict(bg_overlap=dict(mandatory=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
mas... | <commit_before><commit_msg>Test overlap not included before<commit_after> | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.algorithms.misc import Overlap
def test_Overlap_inputs():
input_map = dict(bg_overlap=dict(mandatory=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
mas... | Test overlap not included before# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.algorithms.misc import Overlap
def test_Overlap_inputs():
input_map = dict(bg_overlap=dict(mandatory=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
... | <commit_before><commit_msg>Test overlap not included before<commit_after># AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.algorithms.misc import Overlap
def test_Overlap_inputs():
input_map = dict(bg_overlap=dict(mandatory=True,
usedefault=True,
),
... | |
a9eecbd7f8ed29811cc4bb7021af49a75104db52 | heat/engine/clients/microversion_mixin.py | heat/engine/clients/microversion_mixin.py | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | Add MicroversionMixin for microversion support | Add MicroversionMixin for microversion support
This generic mixin overloads plugin client() method to return
a client with max microversion unless a specific version is requested.
This provides two abstract methods
- get_max_microversion()
- is_version_supported()
for client plugins to override when supporting micro... | Python | apache-2.0 | noironetworks/heat,openstack/heat,openstack/heat,noironetworks/heat | Add MicroversionMixin for microversion support
This generic mixin overloads plugin client() method to return
a client with max microversion unless a specific version is requested.
This provides two abstract methods
- get_max_microversion()
- is_version_supported()
for client plugins to override when supporting micro... | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | <commit_before><commit_msg>Add MicroversionMixin for microversion support
This generic mixin overloads plugin client() method to return
a client with max microversion unless a specific version is requested.
This provides two abstract methods
- get_max_microversion()
- is_version_supported()
for client plugins to ove... | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | Add MicroversionMixin for microversion support
This generic mixin overloads plugin client() method to return
a client with max microversion unless a specific version is requested.
This provides two abstract methods
- get_max_microversion()
- is_version_supported()
for client plugins to override when supporting micro... | <commit_before><commit_msg>Add MicroversionMixin for microversion support
This generic mixin overloads plugin client() method to return
a client with max microversion unless a specific version is requested.
This provides two abstract methods
- get_max_microversion()
- is_version_supported()
for client plugins to ove... | |
ec935144dd60e6201686720f3d658a1ba5f26d83 | python/ct/client/tools/dump_sctlist.py | python/ct/client/tools/dump_sctlist.py | #!/usr/bin/env python
""" This is a util to dump the SCTs contained within a
SignedCertificateTimestampList structure.
This structure is used to represent a collection of SCTs being passed over
a TLS handshake. See RFC6962 section 3.3 for more details. """
import sys
from ct.proto import client_pb2
from ct... | Add a tool to dump the contents of SignedCertificateTransparencyList structures. | Add a tool to dump the contents of SignedCertificateTransparencyList structures.
| Python | apache-2.0 | eranmes/certificate-transparency,eranmes/certificate-transparency,eranmes/certificate-transparency,AlCutter/certificate-transparency,AlCutter/certificate-transparency,eranmes/certificate-transparency,kyprizel/certificate-transparency,grandamp/certificate-transparency,RJPercival/certificate-transparency,benlaurie/certif... | Add a tool to dump the contents of SignedCertificateTransparencyList structures. | #!/usr/bin/env python
""" This is a util to dump the SCTs contained within a
SignedCertificateTimestampList structure.
This structure is used to represent a collection of SCTs being passed over
a TLS handshake. See RFC6962 section 3.3 for more details. """
import sys
from ct.proto import client_pb2
from ct... | <commit_before><commit_msg>Add a tool to dump the contents of SignedCertificateTransparencyList structures.<commit_after> | #!/usr/bin/env python
""" This is a util to dump the SCTs contained within a
SignedCertificateTimestampList structure.
This structure is used to represent a collection of SCTs being passed over
a TLS handshake. See RFC6962 section 3.3 for more details. """
import sys
from ct.proto import client_pb2
from ct... | Add a tool to dump the contents of SignedCertificateTransparencyList structures.#!/usr/bin/env python
""" This is a util to dump the SCTs contained within a
SignedCertificateTimestampList structure.
This structure is used to represent a collection of SCTs being passed over
a TLS handshake. See RFC6962 sect... | <commit_before><commit_msg>Add a tool to dump the contents of SignedCertificateTransparencyList structures.<commit_after>#!/usr/bin/env python
""" This is a util to dump the SCTs contained within a
SignedCertificateTimestampList structure.
This structure is used to represent a collection of SCTs being passed ov... | |
03b7c02cacce93dca6f95edd91a6b3f8307c34ec | neuroimaging/utils/tests/data/__init__.py | neuroimaging/utils/tests/data/__init__.py | """Information used for locating nipy test data.
Nipy uses a set of test data that is installed separately. The test
data should be located in the directory ``~/.nipy/tests/data``.
Install the data in your home directory from the data repository::
$ mkdir -p .nipy/tests/data
$ svn co http://neuroimaging.scipy.or... | Add data repository package. Link to externally installed nipy data. | Add data repository package. Link to externally installed nipy data. | Python | bsd-3-clause | nipy/nipy-labs,alexis-roche/niseg,arokem/nipy,alexis-roche/nipy,alexis-roche/register,nipy/nipy-labs,alexis-roche/nireg,alexis-roche/register,alexis-roche/nipy,alexis-roche/nipy,bthirion/nipy,alexis-roche/nireg,bthirion/nipy,alexis-roche/niseg,arokem/nipy,nipy/nireg,bthirion/nipy,bthirion/nipy,arokem/nipy,arokem/nipy,n... | Add data repository package. Link to externally installed nipy data. | """Information used for locating nipy test data.
Nipy uses a set of test data that is installed separately. The test
data should be located in the directory ``~/.nipy/tests/data``.
Install the data in your home directory from the data repository::
$ mkdir -p .nipy/tests/data
$ svn co http://neuroimaging.scipy.or... | <commit_before><commit_msg>Add data repository package. Link to externally installed nipy data.<commit_after> | """Information used for locating nipy test data.
Nipy uses a set of test data that is installed separately. The test
data should be located in the directory ``~/.nipy/tests/data``.
Install the data in your home directory from the data repository::
$ mkdir -p .nipy/tests/data
$ svn co http://neuroimaging.scipy.or... | Add data repository package. Link to externally installed nipy data."""Information used for locating nipy test data.
Nipy uses a set of test data that is installed separately. The test
data should be located in the directory ``~/.nipy/tests/data``.
Install the data in your home directory from the data repository::
... | <commit_before><commit_msg>Add data repository package. Link to externally installed nipy data.<commit_after>"""Information used for locating nipy test data.
Nipy uses a set of test data that is installed separately. The test
data should be located in the directory ``~/.nipy/tests/data``.
Install the data in your h... | |
3e9156b98a1ab665fa02677dd247860d13a15443 | tests/unit/test_dual.py | tests/unit/test_dual.py | # Import libnacl libs
import libnacl.public
import libnacl.dual
# Import python libs
import unittest
class TestPublic(unittest.TestCase):
'''
'''
def test_secretkey(self):
'''
'''
msg = b'You\'ve got two empty halves of coconut and you\'re bangin\' \'em together.'
bob = lib... | Add tests for dual secret keys | Add tests for dual secret keys
| Python | apache-2.0 | cachedout/libnacl,mindw/libnacl,johnttan/libnacl,RaetProtocol/libnacl,saltstack/libnacl,coinkite/libnacl | Add tests for dual secret keys | # Import libnacl libs
import libnacl.public
import libnacl.dual
# Import python libs
import unittest
class TestPublic(unittest.TestCase):
'''
'''
def test_secretkey(self):
'''
'''
msg = b'You\'ve got two empty halves of coconut and you\'re bangin\' \'em together.'
bob = lib... | <commit_before><commit_msg>Add tests for dual secret keys<commit_after> | # Import libnacl libs
import libnacl.public
import libnacl.dual
# Import python libs
import unittest
class TestPublic(unittest.TestCase):
'''
'''
def test_secretkey(self):
'''
'''
msg = b'You\'ve got two empty halves of coconut and you\'re bangin\' \'em together.'
bob = lib... | Add tests for dual secret keys# Import libnacl libs
import libnacl.public
import libnacl.dual
# Import python libs
import unittest
class TestPublic(unittest.TestCase):
'''
'''
def test_secretkey(self):
'''
'''
msg = b'You\'ve got two empty halves of coconut and you\'re bangin\' \'e... | <commit_before><commit_msg>Add tests for dual secret keys<commit_after># Import libnacl libs
import libnacl.public
import libnacl.dual
# Import python libs
import unittest
class TestPublic(unittest.TestCase):
'''
'''
def test_secretkey(self):
'''
'''
msg = b'You\'ve got two empty h... | |
872367f51c89f622e61cccfd051f041aa69002f6 | l10n_ar_account/migrations/9.0.1.17.0/post-migration.py | l10n_ar_account/migrations/9.0.1.17.0/post-migration.py | # -*- coding: utf-8 -*-
from openupgradelib import openupgrade
@openupgrade.migrate(use_env=True)
def migrate(env, version):
# now that we have account_fix as depend we fix previous invoices
env['account.invoice'].search(
[('type', 'in', ['in_refund', 'out_refund'])]).compute_taxes()
| ADD mig script to fix refunds taxes | ADD mig script to fix refunds taxes
| Python | agpl-3.0 | jobiols/odoo-argentina,jobiols/odoo-argentina,bmya/odoo-argentina,bmya/odoo-argentina,adhoc-dev/odoo-argentina,ingadhoc/odoo-argentina,adhoc-dev/odoo-argentina | ADD mig script to fix refunds taxes | # -*- coding: utf-8 -*-
from openupgradelib import openupgrade
@openupgrade.migrate(use_env=True)
def migrate(env, version):
# now that we have account_fix as depend we fix previous invoices
env['account.invoice'].search(
[('type', 'in', ['in_refund', 'out_refund'])]).compute_taxes()
| <commit_before><commit_msg>ADD mig script to fix refunds taxes<commit_after> | # -*- coding: utf-8 -*-
from openupgradelib import openupgrade
@openupgrade.migrate(use_env=True)
def migrate(env, version):
# now that we have account_fix as depend we fix previous invoices
env['account.invoice'].search(
[('type', 'in', ['in_refund', 'out_refund'])]).compute_taxes()
| ADD mig script to fix refunds taxes# -*- coding: utf-8 -*-
from openupgradelib import openupgrade
@openupgrade.migrate(use_env=True)
def migrate(env, version):
# now that we have account_fix as depend we fix previous invoices
env['account.invoice'].search(
[('type', 'in', ['in_refund', 'out_refund'])]... | <commit_before><commit_msg>ADD mig script to fix refunds taxes<commit_after># -*- coding: utf-8 -*-
from openupgradelib import openupgrade
@openupgrade.migrate(use_env=True)
def migrate(env, version):
# now that we have account_fix as depend we fix previous invoices
env['account.invoice'].search(
[('t... | |
c55e31c040e4a1eae5ad6ec79d479eaab4d4a178 | microcosm_flask/tests/conventions/test_logging_level.py | microcosm_flask/tests/conventions/test_logging_level.py | """
Logging level test convention.
"""
from json import loads
from hamcrest import (
assert_that,
equal_to,
has_entries,
has_items,
is_,
)
from microcosm.api import create_object_graph
def test_logging_level_convention():
"""
Default health check returns OK.
"""
graph = create_o... | Add unit test for logging level convention | Add unit test for logging level convention
| Python | apache-2.0 | globality-corp/microcosm-flask,globality-corp/microcosm-flask | Add unit test for logging level convention | """
Logging level test convention.
"""
from json import loads
from hamcrest import (
assert_that,
equal_to,
has_entries,
has_items,
is_,
)
from microcosm.api import create_object_graph
def test_logging_level_convention():
"""
Default health check returns OK.
"""
graph = create_o... | <commit_before><commit_msg>Add unit test for logging level convention<commit_after> | """
Logging level test convention.
"""
from json import loads
from hamcrest import (
assert_that,
equal_to,
has_entries,
has_items,
is_,
)
from microcosm.api import create_object_graph
def test_logging_level_convention():
"""
Default health check returns OK.
"""
graph = create_o... | Add unit test for logging level convention"""
Logging level test convention.
"""
from json import loads
from hamcrest import (
assert_that,
equal_to,
has_entries,
has_items,
is_,
)
from microcosm.api import create_object_graph
def test_logging_level_convention():
"""
Default health check... | <commit_before><commit_msg>Add unit test for logging level convention<commit_after>"""
Logging level test convention.
"""
from json import loads
from hamcrest import (
assert_that,
equal_to,
has_entries,
has_items,
is_,
)
from microcosm.api import create_object_graph
def test_logging_level_conve... | |
7805ee9f5257ed0711bf2e18960030a8d66e7243 | melon/melon_server.py | melon/melon_server.py | from flask import Flask
from flask import jsonify
import json
from bson.json_util import dumps as bson_dumps
# from flask_cors import CORS
import sacred_mongo
app = Flask(__name__)
# enable CORS since the back-end is on a different place than th front-end
# CORS(app)
app.debug = True
@app.route("/experiments", met... | Create very rudimentary Flask JSON API to list the experiments. | Create very rudimentary Flask JSON API to list the experiments.
| Python | mit | bzamecnik/sanctuary | Create very rudimentary Flask JSON API to list the experiments. | from flask import Flask
from flask import jsonify
import json
from bson.json_util import dumps as bson_dumps
# from flask_cors import CORS
import sacred_mongo
app = Flask(__name__)
# enable CORS since the back-end is on a different place than th front-end
# CORS(app)
app.debug = True
@app.route("/experiments", met... | <commit_before><commit_msg>Create very rudimentary Flask JSON API to list the experiments.<commit_after> | from flask import Flask
from flask import jsonify
import json
from bson.json_util import dumps as bson_dumps
# from flask_cors import CORS
import sacred_mongo
app = Flask(__name__)
# enable CORS since the back-end is on a different place than th front-end
# CORS(app)
app.debug = True
@app.route("/experiments", met... | Create very rudimentary Flask JSON API to list the experiments.from flask import Flask
from flask import jsonify
import json
from bson.json_util import dumps as bson_dumps
# from flask_cors import CORS
import sacred_mongo
app = Flask(__name__)
# enable CORS since the back-end is on a different place than th front-en... | <commit_before><commit_msg>Create very rudimentary Flask JSON API to list the experiments.<commit_after>from flask import Flask
from flask import jsonify
import json
from bson.json_util import dumps as bson_dumps
# from flask_cors import CORS
import sacred_mongo
app = Flask(__name__)
# enable CORS since the back-end... | |
2e72c7cb3e6dbd8797e537a58c6eef6350b2dd4d | plugins/logger/loggertype/test/test_logger_registrar.py | plugins/logger/loggertype/test/test_logger_registrar.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif... | Add test for happy path of validate_metadata | Add test for happy path of validate_metadata
A good test for our parametrised decorator, too.
| Python | cc0-1.0 | Ghostkeeper/Luna | Add test for happy path of validate_metadata
A good test for our parametrised decorator, too. | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif... | <commit_before><commit_msg>Add test for happy path of validate_metadata
A good test for our parametrised decorator, too.<commit_after> | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif... | Add test for happy path of validate_metadata
A good test for our parametrised decorator, too.#!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be... | <commit_before><commit_msg>Add test for happy path of validate_metadata
A good test for our parametrised decorator, too.<commit_after>#!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed wit... | |
30d70f30b24454affaf56299a014e577089dc885 | tools/telemetry/catapult_base/__init__.py | tools/telemetry/catapult_base/__init__.py | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# All files in this directory should be moved to catapult/base/ after moving
# to the new repo.
| Add catapult_base folder to tools/telemetry to make the refactor easier. | Add catapult_base folder to tools/telemetry to make the refactor easier.
This will make some of the refactoring more obvious and easy to review, as
well as making the needed reafctoring after moving to the catapult repo easier.
BUG=473414
Review URL: https://codereview.chromium.org/1168263002
Cr-Commit-Position: 97... | Python | bsd-3-clause | axinging/chromium-crosswalk,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hgl888/chromium... | Add catapult_base folder to tools/telemetry to make the refactor easier.
This will make some of the refactoring more obvious and easy to review, as
well as making the needed reafctoring after moving to the catapult repo easier.
BUG=473414
Review URL: https://codereview.chromium.org/1168263002
Cr-Commit-Position: 97... | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# All files in this directory should be moved to catapult/base/ after moving
# to the new repo.
| <commit_before><commit_msg>Add catapult_base folder to tools/telemetry to make the refactor easier.
This will make some of the refactoring more obvious and easy to review, as
well as making the needed reafctoring after moving to the catapult repo easier.
BUG=473414
Review URL: https://codereview.chromium.org/1168263... | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# All files in this directory should be moved to catapult/base/ after moving
# to the new repo.
| Add catapult_base folder to tools/telemetry to make the refactor easier.
This will make some of the refactoring more obvious and easy to review, as
well as making the needed reafctoring after moving to the catapult repo easier.
BUG=473414
Review URL: https://codereview.chromium.org/1168263002
Cr-Commit-Position: 97... | <commit_before><commit_msg>Add catapult_base folder to tools/telemetry to make the refactor easier.
This will make some of the refactoring more obvious and easy to review, as
well as making the needed reafctoring after moving to the catapult repo easier.
BUG=473414
Review URL: https://codereview.chromium.org/1168263... | |
67cab1af0fcca0634d52cfd369564b3a896cc2e5 | CheckIO/First_Island/5_Unlucky_days.py | CheckIO/First_Island/5_Unlucky_days.py | #!/usr/bin/env python
from datetime import date
def checkio(year):
day_count = 0
for month in range(1, 13):
day = date(year, month, 13)
# Day = ISO8601 1..7 for Mon -> Sun
if day.isoweekday() == 5:
day_count += 1
return day_count
def test_function():
# These "ass... | Add 1 check, unlucky days | Add 1 check, unlucky days
| Python | mit | marshallhumble/Coding_Challenges,marshallhumble/Coding_Challenges,marshallhumble/Euler_Groovy | Add 1 check, unlucky days | #!/usr/bin/env python
from datetime import date
def checkio(year):
day_count = 0
for month in range(1, 13):
day = date(year, month, 13)
# Day = ISO8601 1..7 for Mon -> Sun
if day.isoweekday() == 5:
day_count += 1
return day_count
def test_function():
# These "ass... | <commit_before><commit_msg>Add 1 check, unlucky days<commit_after> | #!/usr/bin/env python
from datetime import date
def checkio(year):
day_count = 0
for month in range(1, 13):
day = date(year, month, 13)
# Day = ISO8601 1..7 for Mon -> Sun
if day.isoweekday() == 5:
day_count += 1
return day_count
def test_function():
# These "ass... | Add 1 check, unlucky days#!/usr/bin/env python
from datetime import date
def checkio(year):
day_count = 0
for month in range(1, 13):
day = date(year, month, 13)
# Day = ISO8601 1..7 for Mon -> Sun
if day.isoweekday() == 5:
day_count += 1
return day_count
def test_fun... | <commit_before><commit_msg>Add 1 check, unlucky days<commit_after>#!/usr/bin/env python
from datetime import date
def checkio(year):
day_count = 0
for month in range(1, 13):
day = date(year, month, 13)
# Day = ISO8601 1..7 for Mon -> Sun
if day.isoweekday() == 5:
day_count... | |
0c46531fd8eb4b492f4f1645a444eb3914dec3af | recurring_contract/migrations/9.0.1.0.0/pre-migration.py | recurring_contract/migrations/9.0.1.0.0/pre-migration.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2017 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <[email protected]>
#
# The licence is in the file __openerp__.p... | Add migration script for recurring_contract | Add migration script for recurring_contract
| Python | agpl-3.0 | ecino/compassion-accounting,ecino/compassion-accounting,CompassionCH/compassion-accounting,CompassionCH/compassion-accounting | Add migration script for recurring_contract | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2017 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <[email protected]>
#
# The licence is in the file __openerp__.p... | <commit_before><commit_msg>Add migration script for recurring_contract<commit_after> | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2017 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <[email protected]>
#
# The licence is in the file __openerp__.p... | Add migration script for recurring_contract# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2017 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <[email protected]>
#
# ... | <commit_before><commit_msg>Add migration script for recurring_contract<commit_after># -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2017 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author... | |
2d244668103e0a732e618ba6de60f9d1b75dd329 | salt_observer/management/commands/checkdomainvalidity.py | salt_observer/management/commands/checkdomainvalidity.py | from django.core.management.base import BaseCommand
from salt_observer.models import Domain
class Command(BaseCommand):
help = 'Check all domains if they are valid'
def handle(self, *args, **kwargs):
''' Check every domain '''
for domain in Domain.objects.all():
domain.check_if_... | Add new command to check if domains are valid | Add new command to check if domains are valid
| Python | mit | hs-hannover/salt-observer,hs-hannover/salt-observer,hs-hannover/salt-observer | Add new command to check if domains are valid | from django.core.management.base import BaseCommand
from salt_observer.models import Domain
class Command(BaseCommand):
help = 'Check all domains if they are valid'
def handle(self, *args, **kwargs):
''' Check every domain '''
for domain in Domain.objects.all():
domain.check_if_... | <commit_before><commit_msg>Add new command to check if domains are valid<commit_after> | from django.core.management.base import BaseCommand
from salt_observer.models import Domain
class Command(BaseCommand):
help = 'Check all domains if they are valid'
def handle(self, *args, **kwargs):
''' Check every domain '''
for domain in Domain.objects.all():
domain.check_if_... | Add new command to check if domains are validfrom django.core.management.base import BaseCommand
from salt_observer.models import Domain
class Command(BaseCommand):
help = 'Check all domains if they are valid'
def handle(self, *args, **kwargs):
''' Check every domain '''
for domain in Domai... | <commit_before><commit_msg>Add new command to check if domains are valid<commit_after>from django.core.management.base import BaseCommand
from salt_observer.models import Domain
class Command(BaseCommand):
help = 'Check all domains if they are valid'
def handle(self, *args, **kwargs):
''' Check ever... | |
da01f6f1a230cb2889099357828ab750c8ee9eac | kboard/board/tests/test_templatetags.py | kboard/board/tests/test_templatetags.py | from django.core.urlresolvers import reverse
from .base import BoardAppTest
from board.templatetags.url_parameter import url_parameter
class UrlParameterTest(BoardAppTest):
def test_contains_correct_string(self):
parameter = {
'a': 13,
'query': 'hello',
'b': 'This is a... | Add unittest of 'url_parameter' template tag | Add unittest of 'url_parameter' template tag
| Python | mit | guswnsxodlf/k-board,guswnsxodlf/k-board,hyesun03/k-board,cjh5414/kboard,darjeeling/k-board,hyesun03/k-board,kboard/kboard,cjh5414/kboard,guswnsxodlf/k-board,kboard/kboard,kboard/kboard,cjh5414/kboard,hyesun03/k-board | Add unittest of 'url_parameter' template tag | from django.core.urlresolvers import reverse
from .base import BoardAppTest
from board.templatetags.url_parameter import url_parameter
class UrlParameterTest(BoardAppTest):
def test_contains_correct_string(self):
parameter = {
'a': 13,
'query': 'hello',
'b': 'This is a... | <commit_before><commit_msg>Add unittest of 'url_parameter' template tag<commit_after> | from django.core.urlresolvers import reverse
from .base import BoardAppTest
from board.templatetags.url_parameter import url_parameter
class UrlParameterTest(BoardAppTest):
def test_contains_correct_string(self):
parameter = {
'a': 13,
'query': 'hello',
'b': 'This is a... | Add unittest of 'url_parameter' template tagfrom django.core.urlresolvers import reverse
from .base import BoardAppTest
from board.templatetags.url_parameter import url_parameter
class UrlParameterTest(BoardAppTest):
def test_contains_correct_string(self):
parameter = {
'a': 13,
'... | <commit_before><commit_msg>Add unittest of 'url_parameter' template tag<commit_after>from django.core.urlresolvers import reverse
from .base import BoardAppTest
from board.templatetags.url_parameter import url_parameter
class UrlParameterTest(BoardAppTest):
def test_contains_correct_string(self):
paramet... | |
b1ca267f6aa27e151a2b7f75f948794291dd7d44 | kpi/management/commands/copy_kc_profile.py | kpi/management/commands/copy_kc_profile.py | from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from hub.models import ExtraUserDetail
from kpi.deployment_backends.kc_reader.utils import get_kc_profile_data
class Command(BaseCommand):
option_list = BaseCommand.option... | Include management command missing from a080693 | Include management command missing from a080693
| Python | agpl-3.0 | onaio/kpi,kobotoolbox/kpi,onaio/kpi,onaio/kpi,kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi,onaio/kpi | Include management command missing from a080693 | from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from hub.models import ExtraUserDetail
from kpi.deployment_backends.kc_reader.utils import get_kc_profile_data
class Command(BaseCommand):
option_list = BaseCommand.option... | <commit_before><commit_msg>Include management command missing from a080693<commit_after> | from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from hub.models import ExtraUserDetail
from kpi.deployment_backends.kc_reader.utils import get_kc_profile_data
class Command(BaseCommand):
option_list = BaseCommand.option... | Include management command missing from a080693from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from hub.models import ExtraUserDetail
from kpi.deployment_backends.kc_reader.utils import get_kc_profile_data
class Command(Bas... | <commit_before><commit_msg>Include management command missing from a080693<commit_after>from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from hub.models import ExtraUserDetail
from kpi.deployment_backends.kc_reader.utils impo... | |
1114f538fb19ac6e2d21849554bd0f1985420c60 | whitenoise/django.py | whitenoise/django.py | raise ImportError(
'\n\n'
'Your WhiteNoise configuration is incompatible with WhiteNoise v4.0\n'
'This can be fixed by following the upgrade instructions at:\n'
'http://whitenoise.evans.io/en/stable/changelog.html#v4-0\n')
| Raise with upgrade instructions on old import path | Raise with upgrade instructions on old import path
| Python | mit | evansd/whitenoise,evansd/whitenoise,evansd/whitenoise | Raise with upgrade instructions on old import path | raise ImportError(
'\n\n'
'Your WhiteNoise configuration is incompatible with WhiteNoise v4.0\n'
'This can be fixed by following the upgrade instructions at:\n'
'http://whitenoise.evans.io/en/stable/changelog.html#v4-0\n')
| <commit_before><commit_msg>Raise with upgrade instructions on old import path<commit_after> | raise ImportError(
'\n\n'
'Your WhiteNoise configuration is incompatible with WhiteNoise v4.0\n'
'This can be fixed by following the upgrade instructions at:\n'
'http://whitenoise.evans.io/en/stable/changelog.html#v4-0\n')
| Raise with upgrade instructions on old import pathraise ImportError(
'\n\n'
'Your WhiteNoise configuration is incompatible with WhiteNoise v4.0\n'
'This can be fixed by following the upgrade instructions at:\n'
'http://whitenoise.evans.io/en/stable/changelog.html#v4-0\n')
| <commit_before><commit_msg>Raise with upgrade instructions on old import path<commit_after>raise ImportError(
'\n\n'
'Your WhiteNoise configuration is incompatible with WhiteNoise v4.0\n'
'This can be fixed by following the upgrade instructions at:\n'
'http://whitenoise.evans.io/en/stabl... | |
af95d8fc8355b9762af1001f2313d64fe837a4dc | run_story.py | run_story.py | #!/usr/bin/env python
import sys
import os.path
from zvm import zmachine
def usage():
print """Usage: %s <story file>
Run a Z-Machine story under ZVM.
""" % sys.argv[0]
sys.exit(1)
def main():
if len(sys.argv) != 2:
usage()
story_file = sys.argv[1]
if not os.path.isfile(story_file):
... | Implement a simple launcher for ZVM, to help test the machine. | Implement a simple launcher for ZVM, to help test the machine.
| Python | bsd-3-clause | BGCX262/zvm-hg-to-git,BGCX262/zvm-hg-to-git | Implement a simple launcher for ZVM, to help test the machine. | #!/usr/bin/env python
import sys
import os.path
from zvm import zmachine
def usage():
print """Usage: %s <story file>
Run a Z-Machine story under ZVM.
""" % sys.argv[0]
sys.exit(1)
def main():
if len(sys.argv) != 2:
usage()
story_file = sys.argv[1]
if not os.path.isfile(story_file):
... | <commit_before><commit_msg>Implement a simple launcher for ZVM, to help test the machine.<commit_after> | #!/usr/bin/env python
import sys
import os.path
from zvm import zmachine
def usage():
print """Usage: %s <story file>
Run a Z-Machine story under ZVM.
""" % sys.argv[0]
sys.exit(1)
def main():
if len(sys.argv) != 2:
usage()
story_file = sys.argv[1]
if not os.path.isfile(story_file):
... | Implement a simple launcher for ZVM, to help test the machine.#!/usr/bin/env python
import sys
import os.path
from zvm import zmachine
def usage():
print """Usage: %s <story file>
Run a Z-Machine story under ZVM.
""" % sys.argv[0]
sys.exit(1)
def main():
if len(sys.argv) != 2:
usage()
story_... | <commit_before><commit_msg>Implement a simple launcher for ZVM, to help test the machine.<commit_after>#!/usr/bin/env python
import sys
import os.path
from zvm import zmachine
def usage():
print """Usage: %s <story file>
Run a Z-Machine story under ZVM.
""" % sys.argv[0]
sys.exit(1)
def main():
if len(s... | |
a6839580266deadb4a8b5c1f92f2cd2b58a7b42b | DataTag/management/commands/appendtag.py | DataTag/management/commands/appendtag.py | # -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2017 Rémi Duraffort
# This file is part of DataTag.
#
# DataTag 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
#... | Add a command to append tags quickly | Add a command to append tags quickly
| Python | agpl-3.0 | ivoire/DataTag,ivoire/DataTag,ivoire/DataTag | Add a command to append tags quickly | # -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2017 Rémi Duraffort
# This file is part of DataTag.
#
# DataTag 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
#... | <commit_before><commit_msg>Add a command to append tags quickly<commit_after> | # -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2017 Rémi Duraffort
# This file is part of DataTag.
#
# DataTag 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
#... | Add a command to append tags quickly# -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2017 Rémi Duraffort
# This file is part of DataTag.
#
# DataTag 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, e... | <commit_before><commit_msg>Add a command to append tags quickly<commit_after># -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2017 Rémi Duraffort
# This file is part of DataTag.
#
# DataTag is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publi... | |
7f5ebaa18bb6c0634ab1135a5915cd8ee593760d | tests/unit/test_hashes.py | tests/unit/test_hashes.py | # -*- coding: utf-8 -*-
# Import sorbic libs
import sorbic.db
# Import python libs
import os
import shutil
import unittest
import tempfile
try:
import libnacl.blake
HAS_BLAKE = True
except ImportError:
HAS_BLAKE = False
class TestDB(unittest.TestCase):
'''
'''
def _run_test(self, key_hash):
... | Add tests for multiple hashes | Add tests for multiple hashes
| Python | apache-2.0 | s0undt3ch/sorbic,thatch45/sorbic | Add tests for multiple hashes | # -*- coding: utf-8 -*-
# Import sorbic libs
import sorbic.db
# Import python libs
import os
import shutil
import unittest
import tempfile
try:
import libnacl.blake
HAS_BLAKE = True
except ImportError:
HAS_BLAKE = False
class TestDB(unittest.TestCase):
'''
'''
def _run_test(self, key_hash):
... | <commit_before><commit_msg>Add tests for multiple hashes<commit_after> | # -*- coding: utf-8 -*-
# Import sorbic libs
import sorbic.db
# Import python libs
import os
import shutil
import unittest
import tempfile
try:
import libnacl.blake
HAS_BLAKE = True
except ImportError:
HAS_BLAKE = False
class TestDB(unittest.TestCase):
'''
'''
def _run_test(self, key_hash):
... | Add tests for multiple hashes# -*- coding: utf-8 -*-
# Import sorbic libs
import sorbic.db
# Import python libs
import os
import shutil
import unittest
import tempfile
try:
import libnacl.blake
HAS_BLAKE = True
except ImportError:
HAS_BLAKE = False
class TestDB(unittest.TestCase):
'''
'''
de... | <commit_before><commit_msg>Add tests for multiple hashes<commit_after># -*- coding: utf-8 -*-
# Import sorbic libs
import sorbic.db
# Import python libs
import os
import shutil
import unittest
import tempfile
try:
import libnacl.blake
HAS_BLAKE = True
except ImportError:
HAS_BLAKE = False
class TestDB(u... | |
b8655fb75c2ab7487086422a61cb9bba818be298 | bin/converter.py | bin/converter.py | #!/usr/bin/env python
import argparse
import os.path
import pandas as pd
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Convert HDF5 to other '
'format')
parser.add_argument('filename', type=str, help='HDF5 filename')
parser.add_... | Write script to convert HDF5 to other format | Write script to convert HDF5 to other format
| Python | mit | kemskems/otdet | Write script to convert HDF5 to other format | #!/usr/bin/env python
import argparse
import os.path
import pandas as pd
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Convert HDF5 to other '
'format')
parser.add_argument('filename', type=str, help='HDF5 filename')
parser.add_... | <commit_before><commit_msg>Write script to convert HDF5 to other format<commit_after> | #!/usr/bin/env python
import argparse
import os.path
import pandas as pd
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Convert HDF5 to other '
'format')
parser.add_argument('filename', type=str, help='HDF5 filename')
parser.add_... | Write script to convert HDF5 to other format#!/usr/bin/env python
import argparse
import os.path
import pandas as pd
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Convert HDF5 to other '
'format')
parser.add_argument('filename', typ... | <commit_before><commit_msg>Write script to convert HDF5 to other format<commit_after>#!/usr/bin/env python
import argparse
import os.path
import pandas as pd
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Convert HDF5 to other '
'format'... | |
30843e3295d8a387b8fc61dea79ea47156266dad | build/transform-sql.py | build/transform-sql.py | #!/usr/bin/env python
#
# transform-sql.py -- create a header file with the appropriate SQL variables
# from an SQL file
#
import os
import re
import sys
def usage_and_exit(msg):
if msg:
sys.stderr.write("%s\n\n" % msg)
sys.stderr.write("usage: %s [sqlite_file]\n" % \
os.path.basename(sys.argv[0]))
sy... | Add a helper script which will transform a file full of SQL commands into a header file suitable for inclusion in a standard C file and use with the Subversion SQLite APIs. The goal here is that we can maintain our SQL schema directly as such, and let this script do the appropriate transformation as part of autogen.sh. | Add a helper script which will transform a file full of SQL commands into a
header file suitable for inclusion in a standard C file and use with the
Subversion SQLite APIs. The goal here is that we can maintain our SQL schema
directly as such, and let this script do the appropriate transformation as
part of autogen.sh... | Python | apache-2.0 | YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,wbond/subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion | Add a helper script which will transform a file full of SQL commands into a
header file suitable for inclusion in a standard C file and use with the
Subversion SQLite APIs. The goal here is that we can maintain our SQL schema
directly as such, and let this script do the appropriate transformation as
part of autogen.sh... | #!/usr/bin/env python
#
# transform-sql.py -- create a header file with the appropriate SQL variables
# from an SQL file
#
import os
import re
import sys
def usage_and_exit(msg):
if msg:
sys.stderr.write("%s\n\n" % msg)
sys.stderr.write("usage: %s [sqlite_file]\n" % \
os.path.basename(sys.argv[0]))
sy... | <commit_before><commit_msg>Add a helper script which will transform a file full of SQL commands into a
header file suitable for inclusion in a standard C file and use with the
Subversion SQLite APIs. The goal here is that we can maintain our SQL schema
directly as such, and let this script do the appropriate transform... | #!/usr/bin/env python
#
# transform-sql.py -- create a header file with the appropriate SQL variables
# from an SQL file
#
import os
import re
import sys
def usage_and_exit(msg):
if msg:
sys.stderr.write("%s\n\n" % msg)
sys.stderr.write("usage: %s [sqlite_file]\n" % \
os.path.basename(sys.argv[0]))
sy... | Add a helper script which will transform a file full of SQL commands into a
header file suitable for inclusion in a standard C file and use with the
Subversion SQLite APIs. The goal here is that we can maintain our SQL schema
directly as such, and let this script do the appropriate transformation as
part of autogen.sh... | <commit_before><commit_msg>Add a helper script which will transform a file full of SQL commands into a
header file suitable for inclusion in a standard C file and use with the
Subversion SQLite APIs. The goal here is that we can maintain our SQL schema
directly as such, and let this script do the appropriate transform... | |
69d2611a153733a7ff8f7e77df334469ecf56b01 | src/utils/remove_uncessessary_rules.py | src/utils/remove_uncessessary_rules.py | import glob
import os
import re
def process(text, start=None):
# Full Definition
# ((.*) =\s+([\s\S]*?)\s*;\n)
# Group1 is the full rule definition
# Group2 is only the name of the rule
# Group3 is the definition of the rule
# Definitions within this definition
# (?<!')\b\w+\b(?!')
# ... | Add utility to remove un-needed rules | Add utility to remove un-needed rules
| Python | mit | vmuriart/sqldef | Add utility to remove un-needed rules | import glob
import os
import re
def process(text, start=None):
# Full Definition
# ((.*) =\s+([\s\S]*?)\s*;\n)
# Group1 is the full rule definition
# Group2 is only the name of the rule
# Group3 is the definition of the rule
# Definitions within this definition
# (?<!')\b\w+\b(?!')
# ... | <commit_before><commit_msg>Add utility to remove un-needed rules<commit_after> | import glob
import os
import re
def process(text, start=None):
# Full Definition
# ((.*) =\s+([\s\S]*?)\s*;\n)
# Group1 is the full rule definition
# Group2 is only the name of the rule
# Group3 is the definition of the rule
# Definitions within this definition
# (?<!')\b\w+\b(?!')
# ... | Add utility to remove un-needed rulesimport glob
import os
import re
def process(text, start=None):
# Full Definition
# ((.*) =\s+([\s\S]*?)\s*;\n)
# Group1 is the full rule definition
# Group2 is only the name of the rule
# Group3 is the definition of the rule
# Definitions within this defin... | <commit_before><commit_msg>Add utility to remove un-needed rules<commit_after>import glob
import os
import re
def process(text, start=None):
# Full Definition
# ((.*) =\s+([\s\S]*?)\s*;\n)
# Group1 is the full rule definition
# Group2 is only the name of the rule
# Group3 is the definition of the ... | |
88d9ac54125aafe7a7551d6d23e4e2f2e77f8d33 | Spacewalk/listKernelAPI.py | Spacewalk/listKernelAPI.py | '''
# ..######.
# .##....##
# .##......
# ..######.
# .......##
# .##....##
# ..######.
################################################################################
#
# Script: List of running kernel of spacewalk client
#
################################################################################
'''
from _... | Add report kernel with API for Spacewalk | Add report kernel with API for Spacewalk
| Python | mit | seb2020/toolbox,seb2020/toolbox,seb2020/toolbox,seb2020/toolbox,seb2020/toolbox | Add report kernel with API for Spacewalk | '''
# ..######.
# .##....##
# .##......
# ..######.
# .......##
# .##....##
# ..######.
################################################################################
#
# Script: List of running kernel of spacewalk client
#
################################################################################
'''
from _... | <commit_before><commit_msg>Add report kernel with API for Spacewalk<commit_after> | '''
# ..######.
# .##....##
# .##......
# ..######.
# .......##
# .##....##
# ..######.
################################################################################
#
# Script: List of running kernel of spacewalk client
#
################################################################################
'''
from _... | Add report kernel with API for Spacewalk'''
# ..######.
# .##....##
# .##......
# ..######.
# .......##
# .##....##
# ..######.
################################################################################
#
# Script: List of running kernel of spacewalk client
#
#####################################################... | <commit_before><commit_msg>Add report kernel with API for Spacewalk<commit_after>'''
# ..######.
# .##....##
# .##......
# ..######.
# .......##
# .##....##
# ..######.
################################################################################
#
# Script: List of running kernel of spacewalk client
#
############... | |
db86c21577e50b30ee222c47aae43e49a574c007 | test/requests/run-integration-tests.py | test/requests/run-integration-tests.py | import sys
from test_login_local import TestLoginLocal
from test_registration import TestRegistration
from unittest import TestSuite, TextTestRunner, TestLoader
test_cases = [
TestLoginLocal,
TestRegistration
]
def suite(gn2_url, es_url):
the_suite = TestSuite()
for case in test_cases:
the_sui... | Add a runner for all integration tests. | Add a runner for all integration tests.
| Python | agpl-3.0 | DannyArends/genenetwork2,zsloan/genenetwork2,genenetwork/genenetwork2,zsloan/genenetwork2,genenetwork/genenetwork2,pjotrp/genenetwork2,genenetwork/genenetwork2,zsloan/genenetwork2,genenetwork/genenetwork2,pjotrp/genenetwork2,pjotrp/genenetwork2,zsloan/genenetwork2,DannyArends/genenetwork2,DannyArends/genenetwork2,Danny... | Add a runner for all integration tests. | import sys
from test_login_local import TestLoginLocal
from test_registration import TestRegistration
from unittest import TestSuite, TextTestRunner, TestLoader
test_cases = [
TestLoginLocal,
TestRegistration
]
def suite(gn2_url, es_url):
the_suite = TestSuite()
for case in test_cases:
the_sui... | <commit_before><commit_msg>Add a runner for all integration tests.<commit_after> | import sys
from test_login_local import TestLoginLocal
from test_registration import TestRegistration
from unittest import TestSuite, TextTestRunner, TestLoader
test_cases = [
TestLoginLocal,
TestRegistration
]
def suite(gn2_url, es_url):
the_suite = TestSuite()
for case in test_cases:
the_sui... | Add a runner for all integration tests.import sys
from test_login_local import TestLoginLocal
from test_registration import TestRegistration
from unittest import TestSuite, TextTestRunner, TestLoader
test_cases = [
TestLoginLocal,
TestRegistration
]
def suite(gn2_url, es_url):
the_suite = TestSuite()
... | <commit_before><commit_msg>Add a runner for all integration tests.<commit_after>import sys
from test_login_local import TestLoginLocal
from test_registration import TestRegistration
from unittest import TestSuite, TextTestRunner, TestLoader
test_cases = [
TestLoginLocal,
TestRegistration
]
def suite(gn2_url, ... | |
ce79a9fbbfcd26c7e6dee49643b10ef2ba8c953d | distutilazy/command/clean_jython_class.py | distutilazy/command/clean_jython_class.py | """
distutilazy.command.clean_jython_class
--------------------------------------
Command to clean compiled .class files created
by Jython.
:license: MIT, see LICENSE for more details.
"""
from os.path import abspath, dirname
import sys
base_dir = abspath(dirname(dirname(dirname(__file__))))
if base_dir not in sys.... | Add clean jython class command module | Add clean jython class command module
So it's possible to use this command when users add
distutilazy to their setup.cfg instead of
using command classes in their setup.py cmdclass.
| Python | mit | farzadghanei/distutilazy | Add clean jython class command module
So it's possible to use this command when users add
distutilazy to their setup.cfg instead of
using command classes in their setup.py cmdclass. | """
distutilazy.command.clean_jython_class
--------------------------------------
Command to clean compiled .class files created
by Jython.
:license: MIT, see LICENSE for more details.
"""
from os.path import abspath, dirname
import sys
base_dir = abspath(dirname(dirname(dirname(__file__))))
if base_dir not in sys.... | <commit_before><commit_msg>Add clean jython class command module
So it's possible to use this command when users add
distutilazy to their setup.cfg instead of
using command classes in their setup.py cmdclass.<commit_after> | """
distutilazy.command.clean_jython_class
--------------------------------------
Command to clean compiled .class files created
by Jython.
:license: MIT, see LICENSE for more details.
"""
from os.path import abspath, dirname
import sys
base_dir = abspath(dirname(dirname(dirname(__file__))))
if base_dir not in sys.... | Add clean jython class command module
So it's possible to use this command when users add
distutilazy to their setup.cfg instead of
using command classes in their setup.py cmdclass."""
distutilazy.command.clean_jython_class
--------------------------------------
Command to clean compiled .class files created
by Jytho... | <commit_before><commit_msg>Add clean jython class command module
So it's possible to use this command when users add
distutilazy to their setup.cfg instead of
using command classes in their setup.py cmdclass.<commit_after>"""
distutilazy.command.clean_jython_class
--------------------------------------
Command to cle... | |
97c1991b9d44863fadec1464ab47eca9b9f28d4b | mne/tests/test_line_endings.py | mne/tests/test_line_endings.py | # Adapted from vispy
#
# License: BSD (3-clause)
import os
from nose.plugins.skip import SkipTest
from os import path as op
import sys
import mne
from mne.utils import run_tests_if_main
known_crlf = (
'FreeSurferColorLUT.txt',
'test_edf_stim_channel.txt',
'FieldTrip.py',
)
def test_line_endings():
... | Add check for line endings | FIX: Add check for line endings
| Python | bsd-3-clause | jniediek/mne-python,Teekuningas/mne-python,Teekuningas/mne-python,alexandrebarachant/mne-python,alexandrebarachant/mne-python,cmoutard/mne-python,kingjr/mne-python,rkmaddox/mne-python,Eric89GXL/mne-python,kambysese/mne-python,wmvanvliet/mne-python,Eric89GXL/mne-python,ARudiuk/mne-python,Teekuningas/mne-python,adykstra/... | FIX: Add check for line endings | # Adapted from vispy
#
# License: BSD (3-clause)
import os
from nose.plugins.skip import SkipTest
from os import path as op
import sys
import mne
from mne.utils import run_tests_if_main
known_crlf = (
'FreeSurferColorLUT.txt',
'test_edf_stim_channel.txt',
'FieldTrip.py',
)
def test_line_endings():
... | <commit_before><commit_msg>FIX: Add check for line endings<commit_after> | # Adapted from vispy
#
# License: BSD (3-clause)
import os
from nose.plugins.skip import SkipTest
from os import path as op
import sys
import mne
from mne.utils import run_tests_if_main
known_crlf = (
'FreeSurferColorLUT.txt',
'test_edf_stim_channel.txt',
'FieldTrip.py',
)
def test_line_endings():
... | FIX: Add check for line endings# Adapted from vispy
#
# License: BSD (3-clause)
import os
from nose.plugins.skip import SkipTest
from os import path as op
import sys
import mne
from mne.utils import run_tests_if_main
known_crlf = (
'FreeSurferColorLUT.txt',
'test_edf_stim_channel.txt',
'FieldTrip.py',
)... | <commit_before><commit_msg>FIX: Add check for line endings<commit_after># Adapted from vispy
#
# License: BSD (3-clause)
import os
from nose.plugins.skip import SkipTest
from os import path as op
import sys
import mne
from mne.utils import run_tests_if_main
known_crlf = (
'FreeSurferColorLUT.txt',
'test_edf... | |
aa9e3ae13e7d4a7ca8e72be8ab6d5ec7ea49f8e8 | monasca_setup/detection/plugins/ironic.py | monasca_setup/detection/plugins/ironic.py | import logging
import monasca_setup.detection
log = logging.getLogger(__name__)
class Ironic(monasca_setup.detection.ServicePlugin):
"""Detect Ironic daemons and setup configuration to monitor them."""
def __init__(self, template_dir, overwrite=True, args=None):
service_api_url = "http://localhost:... | Add Ironic Service detection plugin | Add Ironic Service detection plugin
Change-Id: I829988eeeb53ffa2f8a21f25fcce83f7ff92143b
| Python | bsd-3-clause | sapcc/monasca-agent,sapcc/monasca-agent,sapcc/monasca-agent | Add Ironic Service detection plugin
Change-Id: I829988eeeb53ffa2f8a21f25fcce83f7ff92143b | import logging
import monasca_setup.detection
log = logging.getLogger(__name__)
class Ironic(monasca_setup.detection.ServicePlugin):
"""Detect Ironic daemons and setup configuration to monitor them."""
def __init__(self, template_dir, overwrite=True, args=None):
service_api_url = "http://localhost:... | <commit_before><commit_msg>Add Ironic Service detection plugin
Change-Id: I829988eeeb53ffa2f8a21f25fcce83f7ff92143b<commit_after> | import logging
import monasca_setup.detection
log = logging.getLogger(__name__)
class Ironic(monasca_setup.detection.ServicePlugin):
"""Detect Ironic daemons and setup configuration to monitor them."""
def __init__(self, template_dir, overwrite=True, args=None):
service_api_url = "http://localhost:... | Add Ironic Service detection plugin
Change-Id: I829988eeeb53ffa2f8a21f25fcce83f7ff92143bimport logging
import monasca_setup.detection
log = logging.getLogger(__name__)
class Ironic(monasca_setup.detection.ServicePlugin):
"""Detect Ironic daemons and setup configuration to monitor them."""
def __init__(sel... | <commit_before><commit_msg>Add Ironic Service detection plugin
Change-Id: I829988eeeb53ffa2f8a21f25fcce83f7ff92143b<commit_after>import logging
import monasca_setup.detection
log = logging.getLogger(__name__)
class Ironic(monasca_setup.detection.ServicePlugin):
"""Detect Ironic daemons and setup configuration ... | |
11853bead5a47d0b15877eb5e5968b91708bb223 | API/chat/models.py | API/chat/models.py | from django.db import models
class Channel(models.Model):
def __str__(self):
return self.name
name = models.CharField(max_length=20, unique=True)
class Message(models.Model):
def __str__(self):
return self.text
def to_dict(self):
return {
'text': self.text,
... | from django.db import models
class Channel(models.Model):
def __str__(self):
return self.name
name = models.CharField(max_length=20, unique=True)
class Message(models.Model):
def __str__(self):
return self.text
def to_dict(self):
serializable_fields = ('text', 'datetime_sta... | Refactor to_dict method on the Message model | Refactor to_dict method on the Message model
| Python | mit | odyvarv/ting-1,VitSalis/ting,odyvarv/ting-1,VitSalis/ting,mbalamat/ting,dionyziz/ting,gtklocker/ting,sirodoht/ting,mbalamat/ting,dionyziz/ting,VitSalis/ting,odyvarv/ting-1,mbalamat/ting,mbalamat/ting,VitSalis/ting,gtklocker/ting,odyvarv/ting-1,dionyziz/ting,sirodoht/ting,gtklocker/ting,gtklocker/ting,sirodoht/ting,siro... | from django.db import models
class Channel(models.Model):
def __str__(self):
return self.name
name = models.CharField(max_length=20, unique=True)
class Message(models.Model):
def __str__(self):
return self.text
def to_dict(self):
return {
'text': self.text,
... | from django.db import models
class Channel(models.Model):
def __str__(self):
return self.name
name = models.CharField(max_length=20, unique=True)
class Message(models.Model):
def __str__(self):
return self.text
def to_dict(self):
serializable_fields = ('text', 'datetime_sta... | <commit_before>from django.db import models
class Channel(models.Model):
def __str__(self):
return self.name
name = models.CharField(max_length=20, unique=True)
class Message(models.Model):
def __str__(self):
return self.text
def to_dict(self):
return {
'text': ... | from django.db import models
class Channel(models.Model):
def __str__(self):
return self.name
name = models.CharField(max_length=20, unique=True)
class Message(models.Model):
def __str__(self):
return self.text
def to_dict(self):
serializable_fields = ('text', 'datetime_sta... | from django.db import models
class Channel(models.Model):
def __str__(self):
return self.name
name = models.CharField(max_length=20, unique=True)
class Message(models.Model):
def __str__(self):
return self.text
def to_dict(self):
return {
'text': self.text,
... | <commit_before>from django.db import models
class Channel(models.Model):
def __str__(self):
return self.name
name = models.CharField(max_length=20, unique=True)
class Message(models.Model):
def __str__(self):
return self.text
def to_dict(self):
return {
'text': ... |
975fc40b7055db0834713ffd91033bc8fac5d007 | emotools/heem_utils.py | emotools/heem_utils.py | heem_concept_type_labels = ['Emotie', 'Lichaamswerking', 'Lichaamsdeel',
'EmotioneleHandeling']
heem_emotion_labels = ['Achterdocht', 'Angst', 'Bedruktheid',
'Beledigd', 'Berusting', 'Bezorgdheid', 'Blijdschap',
'Eergevoel', 'Geluk', 'Gemis', 'H... | Add heem label sets as importable variables | Add heem label sets as importable variables
Lists of HEEM labels have been added as variables that can be imported
by other modules and used to print the labels in fixed orders.
| Python | apache-2.0 | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | Add heem label sets as importable variables
Lists of HEEM labels have been added as variables that can be imported
by other modules and used to print the labels in fixed orders. | heem_concept_type_labels = ['Emotie', 'Lichaamswerking', 'Lichaamsdeel',
'EmotioneleHandeling']
heem_emotion_labels = ['Achterdocht', 'Angst', 'Bedruktheid',
'Beledigd', 'Berusting', 'Bezorgdheid', 'Blijdschap',
'Eergevoel', 'Geluk', 'Gemis', 'H... | <commit_before><commit_msg>Add heem label sets as importable variables
Lists of HEEM labels have been added as variables that can be imported
by other modules and used to print the labels in fixed orders.<commit_after> | heem_concept_type_labels = ['Emotie', 'Lichaamswerking', 'Lichaamsdeel',
'EmotioneleHandeling']
heem_emotion_labels = ['Achterdocht', 'Angst', 'Bedruktheid',
'Beledigd', 'Berusting', 'Bezorgdheid', 'Blijdschap',
'Eergevoel', 'Geluk', 'Gemis', 'H... | Add heem label sets as importable variables
Lists of HEEM labels have been added as variables that can be imported
by other modules and used to print the labels in fixed orders.heem_concept_type_labels = ['Emotie', 'Lichaamswerking', 'Lichaamsdeel',
'EmotioneleHandeling']
heem_emotion_labe... | <commit_before><commit_msg>Add heem label sets as importable variables
Lists of HEEM labels have been added as variables that can be imported
by other modules and used to print the labels in fixed orders.<commit_after>heem_concept_type_labels = ['Emotie', 'Lichaamswerking', 'Lichaamsdeel',
... | |
dfadbe61ae26fd5d89fdcc599277e3df1d573b07 | examples/basic_auth/app.py | examples/basic_auth/app.py | from flask import Flask, g, request, session, redirect, url_for
from flask.ext.simpleldap import LDAP
app = Flask(__name__)
app.secret_key = 'dev key'
app.debug = True
app.config['LDAP_HOST'] = 'ldap.example.org'
app.config['LDAP_BASE_DN'] = 'OU=users,dc=example,dc=org'
app.config['LDAP_USERNAME'] = 'CN=user,OU=Users... | Add an example of using .basic_auth_required() | Add an example of using .basic_auth_required()
| Python | mit | admiralobvious/flask-simpleldap | Add an example of using .basic_auth_required() | from flask import Flask, g, request, session, redirect, url_for
from flask.ext.simpleldap import LDAP
app = Flask(__name__)
app.secret_key = 'dev key'
app.debug = True
app.config['LDAP_HOST'] = 'ldap.example.org'
app.config['LDAP_BASE_DN'] = 'OU=users,dc=example,dc=org'
app.config['LDAP_USERNAME'] = 'CN=user,OU=Users... | <commit_before><commit_msg>Add an example of using .basic_auth_required()<commit_after> | from flask import Flask, g, request, session, redirect, url_for
from flask.ext.simpleldap import LDAP
app = Flask(__name__)
app.secret_key = 'dev key'
app.debug = True
app.config['LDAP_HOST'] = 'ldap.example.org'
app.config['LDAP_BASE_DN'] = 'OU=users,dc=example,dc=org'
app.config['LDAP_USERNAME'] = 'CN=user,OU=Users... | Add an example of using .basic_auth_required()from flask import Flask, g, request, session, redirect, url_for
from flask.ext.simpleldap import LDAP
app = Flask(__name__)
app.secret_key = 'dev key'
app.debug = True
app.config['LDAP_HOST'] = 'ldap.example.org'
app.config['LDAP_BASE_DN'] = 'OU=users,dc=example,dc=org'
a... | <commit_before><commit_msg>Add an example of using .basic_auth_required()<commit_after>from flask import Flask, g, request, session, redirect, url_for
from flask.ext.simpleldap import LDAP
app = Flask(__name__)
app.secret_key = 'dev key'
app.debug = True
app.config['LDAP_HOST'] = 'ldap.example.org'
app.config['LDAP_B... | |
d3c4c17b5f999ab68401c954d30077c8b48b9b36 | data/nh2010/extract_sparse_matrix.py | data/nh2010/extract_sparse_matrix.py | from __future__ import print_function
import sys
# Given a matrix in Matrix Market format, converts it into the following format:
# Line 1: # of rows
# Line 2..n: Row# col1_# col1_weight col2_# col2_weight ... coln_# coln_weight
input_file = sys.argv[1]
output_file = sys.argv[2]
f = open(input_file)
f_out = open(outp... | Add extract sparse matrix script | Add extract sparse matrix script
| Python | apache-2.0 | agnusmaximus/cyclades,agnusmaximus/cyclades,agnusmaximus/cyclades,agnusmaximus/cyclades | Add extract sparse matrix script | from __future__ import print_function
import sys
# Given a matrix in Matrix Market format, converts it into the following format:
# Line 1: # of rows
# Line 2..n: Row# col1_# col1_weight col2_# col2_weight ... coln_# coln_weight
input_file = sys.argv[1]
output_file = sys.argv[2]
f = open(input_file)
f_out = open(outp... | <commit_before><commit_msg>Add extract sparse matrix script<commit_after> | from __future__ import print_function
import sys
# Given a matrix in Matrix Market format, converts it into the following format:
# Line 1: # of rows
# Line 2..n: Row# col1_# col1_weight col2_# col2_weight ... coln_# coln_weight
input_file = sys.argv[1]
output_file = sys.argv[2]
f = open(input_file)
f_out = open(outp... | Add extract sparse matrix scriptfrom __future__ import print_function
import sys
# Given a matrix in Matrix Market format, converts it into the following format:
# Line 1: # of rows
# Line 2..n: Row# col1_# col1_weight col2_# col2_weight ... coln_# coln_weight
input_file = sys.argv[1]
output_file = sys.argv[2]
f = op... | <commit_before><commit_msg>Add extract sparse matrix script<commit_after>from __future__ import print_function
import sys
# Given a matrix in Matrix Market format, converts it into the following format:
# Line 1: # of rows
# Line 2..n: Row# col1_# col1_weight col2_# col2_weight ... coln_# coln_weight
input_file = sys... | |
4755e3d5160589c1e7a6d28f949f6977e06b6e5c | djstripe/migrations/0013_remove_card_stripe_id_default.py | djstripe/migrations/0013_remove_card_stripe_id_default.py | # Generated by Django 2.0 on 2017-12-03 01:21
from django.db import migrations
import djstripe.fields
class Migration(migrations.Migration):
dependencies = [
('djstripe', '0012_card_customer_from_source'),
]
operations = [
migrations.AlterField(
model_name='card',
... | Add missing migrations for removing default from Card.source_id | Add missing migrations for removing default from Card.source_id
| Python | mit | pydanny/dj-stripe,pydanny/dj-stripe,kavdev/dj-stripe,jleclanche/dj-stripe,dj-stripe/dj-stripe,jleclanche/dj-stripe,dj-stripe/dj-stripe,kavdev/dj-stripe | Add missing migrations for removing default from Card.source_id | # Generated by Django 2.0 on 2017-12-03 01:21
from django.db import migrations
import djstripe.fields
class Migration(migrations.Migration):
dependencies = [
('djstripe', '0012_card_customer_from_source'),
]
operations = [
migrations.AlterField(
model_name='card',
... | <commit_before><commit_msg>Add missing migrations for removing default from Card.source_id<commit_after> | # Generated by Django 2.0 on 2017-12-03 01:21
from django.db import migrations
import djstripe.fields
class Migration(migrations.Migration):
dependencies = [
('djstripe', '0012_card_customer_from_source'),
]
operations = [
migrations.AlterField(
model_name='card',
... | Add missing migrations for removing default from Card.source_id# Generated by Django 2.0 on 2017-12-03 01:21
from django.db import migrations
import djstripe.fields
class Migration(migrations.Migration):
dependencies = [
('djstripe', '0012_card_customer_from_source'),
]
operations = [
m... | <commit_before><commit_msg>Add missing migrations for removing default from Card.source_id<commit_after># Generated by Django 2.0 on 2017-12-03 01:21
from django.db import migrations
import djstripe.fields
class Migration(migrations.Migration):
dependencies = [
('djstripe', '0012_card_customer_from_sour... | |
a43aa19c982d46c8290d0501f5616a96ed2b0d05 | tests/test_package.py | tests/test_package.py | import yaml
def test_master_shipped_with_sha256():
"""
Test the Master is *shipped* with hash type set to SHA256.
"""
with open('/etc/salt/master', 'rb') as master_config:
content = yaml.load(master_config)
assert content['hash_type'] == 'sha256'
def test_minion_shipped_with_sha256()... | Test master and minion shipped with sha256 | Test master and minion shipped with sha256
| Python | mit | dincamihai/salt-toaster,dincamihai/salt-toaster | Test master and minion shipped with sha256 | import yaml
def test_master_shipped_with_sha256():
"""
Test the Master is *shipped* with hash type set to SHA256.
"""
with open('/etc/salt/master', 'rb') as master_config:
content = yaml.load(master_config)
assert content['hash_type'] == 'sha256'
def test_minion_shipped_with_sha256()... | <commit_before><commit_msg>Test master and minion shipped with sha256<commit_after> | import yaml
def test_master_shipped_with_sha256():
"""
Test the Master is *shipped* with hash type set to SHA256.
"""
with open('/etc/salt/master', 'rb') as master_config:
content = yaml.load(master_config)
assert content['hash_type'] == 'sha256'
def test_minion_shipped_with_sha256()... | Test master and minion shipped with sha256import yaml
def test_master_shipped_with_sha256():
"""
Test the Master is *shipped* with hash type set to SHA256.
"""
with open('/etc/salt/master', 'rb') as master_config:
content = yaml.load(master_config)
assert content['hash_type'] == 'sha25... | <commit_before><commit_msg>Test master and minion shipped with sha256<commit_after>import yaml
def test_master_shipped_with_sha256():
"""
Test the Master is *shipped* with hash type set to SHA256.
"""
with open('/etc/salt/master', 'rb') as master_config:
content = yaml.load(master_config)
... | |
5c11e882496782eea18a1d0e7369eab71408e3c4 | datatools/jsontr.py | datatools/jsontr.py | # -*- coding: utf-8 -*-
import re
from collections import OrderedDict
import json
def camelize(data, source, dest=None):
dest = dest or source
for o in data.values():
if source not in o: continue
v = o[source]
o[dest] = v[0].lower() + re.sub(r"\W", "", v.title()[1:])
return data
d... | Make a simple json transformer tool | Make a simple json transformer tool
| Python | apache-2.0 | libris/librisxl,libris/librisxl,libris/librisxl | Make a simple json transformer tool | # -*- coding: utf-8 -*-
import re
from collections import OrderedDict
import json
def camelize(data, source, dest=None):
dest = dest or source
for o in data.values():
if source not in o: continue
v = o[source]
o[dest] = v[0].lower() + re.sub(r"\W", "", v.title()[1:])
return data
d... | <commit_before><commit_msg>Make a simple json transformer tool<commit_after> | # -*- coding: utf-8 -*-
import re
from collections import OrderedDict
import json
def camelize(data, source, dest=None):
dest = dest or source
for o in data.values():
if source not in o: continue
v = o[source]
o[dest] = v[0].lower() + re.sub(r"\W", "", v.title()[1:])
return data
d... | Make a simple json transformer tool# -*- coding: utf-8 -*-
import re
from collections import OrderedDict
import json
def camelize(data, source, dest=None):
dest = dest or source
for o in data.values():
if source not in o: continue
v = o[source]
o[dest] = v[0].lower() + re.sub(r"\W", ""... | <commit_before><commit_msg>Make a simple json transformer tool<commit_after># -*- coding: utf-8 -*-
import re
from collections import OrderedDict
import json
def camelize(data, source, dest=None):
dest = dest or source
for o in data.values():
if source not in o: continue
v = o[source]
... | |
b05529297d388e175ff83c1080e6127f3141dc55 | billjobs/tests/tests_user_admin_api.py | billjobs/tests/tests_user_admin_api.py | from django.test import TestCase
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APIClient, APIRequestFactory, \
force_authenticate
from billjobs.views import UserAdmin
class UserAdminAPI(TestCase):
""" Test User Admin API REST endpoint """
... | Add test for user admin api | Add test for user admin api
| Python | mit | ioO/billjobs | Add test for user admin api | from django.test import TestCase
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APIClient, APIRequestFactory, \
force_authenticate
from billjobs.views import UserAdmin
class UserAdminAPI(TestCase):
""" Test User Admin API REST endpoint """
... | <commit_before><commit_msg>Add test for user admin api<commit_after> | from django.test import TestCase
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APIClient, APIRequestFactory, \
force_authenticate
from billjobs.views import UserAdmin
class UserAdminAPI(TestCase):
""" Test User Admin API REST endpoint """
... | Add test for user admin apifrom django.test import TestCase
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APIClient, APIRequestFactory, \
force_authenticate
from billjobs.views import UserAdmin
class UserAdminAPI(TestCase):
""" Test User Admin... | <commit_before><commit_msg>Add test for user admin api<commit_after>from django.test import TestCase
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APIClient, APIRequestFactory, \
force_authenticate
from billjobs.views import UserAdmin
class UserAd... | |
161a02ae054c9783eeeed97a680c28d184d63cd5 | scripts/queue_speed.py | scripts/queue_speed.py | # -*- coding: utf-8 -*-
from __future__ import print_function
try:
from insight.insight_settings import DEFAULT_REDIS_QUEUE_KEY
except ImportError:
DEFAULT_REDIS_QUEUE_KEY = 'insight-reloaded'
import requests
import time
import sys
API_URL = 'http://localhost:8888/'
QUEUE = 'insight-reloaded'
def main():
... | Add a script to watch the queue speed | Add a script to watch the queue speed
| Python | bsd-3-clause | novapost/insight-reloaded | Add a script to watch the queue speed | # -*- coding: utf-8 -*-
from __future__ import print_function
try:
from insight.insight_settings import DEFAULT_REDIS_QUEUE_KEY
except ImportError:
DEFAULT_REDIS_QUEUE_KEY = 'insight-reloaded'
import requests
import time
import sys
API_URL = 'http://localhost:8888/'
QUEUE = 'insight-reloaded'
def main():
... | <commit_before><commit_msg>Add a script to watch the queue speed<commit_after> | # -*- coding: utf-8 -*-
from __future__ import print_function
try:
from insight.insight_settings import DEFAULT_REDIS_QUEUE_KEY
except ImportError:
DEFAULT_REDIS_QUEUE_KEY = 'insight-reloaded'
import requests
import time
import sys
API_URL = 'http://localhost:8888/'
QUEUE = 'insight-reloaded'
def main():
... | Add a script to watch the queue speed# -*- coding: utf-8 -*-
from __future__ import print_function
try:
from insight.insight_settings import DEFAULT_REDIS_QUEUE_KEY
except ImportError:
DEFAULT_REDIS_QUEUE_KEY = 'insight-reloaded'
import requests
import time
import sys
API_URL = 'http://localhost:8888/'
QUEUE ... | <commit_before><commit_msg>Add a script to watch the queue speed<commit_after># -*- coding: utf-8 -*-
from __future__ import print_function
try:
from insight.insight_settings import DEFAULT_REDIS_QUEUE_KEY
except ImportError:
DEFAULT_REDIS_QUEUE_KEY = 'insight-reloaded'
import requests
import time
import sys
... | |
b72fa34e703f8083e9df8811151bd6d0b1a8343b | utilities/__init__.py | utilities/__init__.py | #! /usr/bin/env python
from subprocess import Popen, PIPE
def _popen(cmd):
"""
Fork the specified command, returning a tuple of (stdout, stderr)
"""
return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
| Add a commonly used subprocess command of mine | Add a commonly used subprocess command of mine
| Python | mit | IanLee1521/utilities | Add a commonly used subprocess command of mine | #! /usr/bin/env python
from subprocess import Popen, PIPE
def _popen(cmd):
"""
Fork the specified command, returning a tuple of (stdout, stderr)
"""
return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
| <commit_before><commit_msg>Add a commonly used subprocess command of mine<commit_after> | #! /usr/bin/env python
from subprocess import Popen, PIPE
def _popen(cmd):
"""
Fork the specified command, returning a tuple of (stdout, stderr)
"""
return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
| Add a commonly used subprocess command of mine#! /usr/bin/env python
from subprocess import Popen, PIPE
def _popen(cmd):
"""
Fork the specified command, returning a tuple of (stdout, stderr)
"""
return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
| <commit_before><commit_msg>Add a commonly used subprocess command of mine<commit_after>#! /usr/bin/env python
from subprocess import Popen, PIPE
def _popen(cmd):
"""
Fork the specified command, returning a tuple of (stdout, stderr)
"""
return Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communica... | |
ab9184243df13fb1ab130a334a3c66283cc79fda | src/twitter_bot/service/url_shortener.py | src/twitter_bot/service/url_shortener.py | import json
import requests
from twitter_bot.config.api_keys import GOOGLE_API_KEYS
def get_short_url(long_url):
"""Call Google URL Shortener API to return shortened URL"""
api_key = GOOGLE_API_KEYS['URL_SHORTENER_API_KEY']
base_url = 'https://www.googleapis.com/urlshortener/v1/url'
headers = {'Conte... | Add support for Google URL Shortener API | Add support for Google URL Shortener API
| Python | mit | econne01/twitter-news-bot | Add support for Google URL Shortener API | import json
import requests
from twitter_bot.config.api_keys import GOOGLE_API_KEYS
def get_short_url(long_url):
"""Call Google URL Shortener API to return shortened URL"""
api_key = GOOGLE_API_KEYS['URL_SHORTENER_API_KEY']
base_url = 'https://www.googleapis.com/urlshortener/v1/url'
headers = {'Conte... | <commit_before><commit_msg>Add support for Google URL Shortener API<commit_after> | import json
import requests
from twitter_bot.config.api_keys import GOOGLE_API_KEYS
def get_short_url(long_url):
"""Call Google URL Shortener API to return shortened URL"""
api_key = GOOGLE_API_KEYS['URL_SHORTENER_API_KEY']
base_url = 'https://www.googleapis.com/urlshortener/v1/url'
headers = {'Conte... | Add support for Google URL Shortener APIimport json
import requests
from twitter_bot.config.api_keys import GOOGLE_API_KEYS
def get_short_url(long_url):
"""Call Google URL Shortener API to return shortened URL"""
api_key = GOOGLE_API_KEYS['URL_SHORTENER_API_KEY']
base_url = 'https://www.googleapis.com/ur... | <commit_before><commit_msg>Add support for Google URL Shortener API<commit_after>import json
import requests
from twitter_bot.config.api_keys import GOOGLE_API_KEYS
def get_short_url(long_url):
"""Call Google URL Shortener API to return shortened URL"""
api_key = GOOGLE_API_KEYS['URL_SHORTENER_API_KEY']
... | |
74f4b46ab44016f9e7ad56cde5916ffbc45723d3 | ppapi/generators/idl_visitor.py | ppapi/generators/idl_visitor.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Visitor Object for traversing AST """
#
# IDLVisitor
#
# The IDLVisitor class will traverse an AST truncating portions of the tr... | Add missing IDL Visistor class | Add missing IDL Visistor class
This class provides a simple mechanism for recursively traversing the AST
for both simple and version aware traversal.
TBR= [email protected]
BUG= http://code.google.com/p/chromium/issues/detail?id=87684
TEST= python idl_c_header.py
Review URL: http://codereview.chromium.org/7448001
git-... | Python | bsd-3-clause | nacl-webkit/chrome_deps,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,zcbenz/cefode-chromium,Pluto-tv/chromium-crosswalk,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,axinging/chromium-crosswalk,patrickm/c... | Add missing IDL Visistor class
This class provides a simple mechanism for recursively traversing the AST
for both simple and version aware traversal.
TBR= [email protected]
BUG= http://code.google.com/p/chromium/issues/detail?id=87684
TEST= python idl_c_header.py
Review URL: http://codereview.chromium.org/7448001
git-... | #!/usr/bin/python
#
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Visitor Object for traversing AST """
#
# IDLVisitor
#
# The IDLVisitor class will traverse an AST truncating portions of the tr... | <commit_before><commit_msg>Add missing IDL Visistor class
This class provides a simple mechanism for recursively traversing the AST
for both simple and version aware traversal.
TBR= [email protected]
BUG= http://code.google.com/p/chromium/issues/detail?id=87684
TEST= python idl_c_header.py
Review URL: http://codereview... | #!/usr/bin/python
#
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Visitor Object for traversing AST """
#
# IDLVisitor
#
# The IDLVisitor class will traverse an AST truncating portions of the tr... | Add missing IDL Visistor class
This class provides a simple mechanism for recursively traversing the AST
for both simple and version aware traversal.
TBR= [email protected]
BUG= http://code.google.com/p/chromium/issues/detail?id=87684
TEST= python idl_c_header.py
Review URL: http://codereview.chromium.org/7448001
git-... | <commit_before><commit_msg>Add missing IDL Visistor class
This class provides a simple mechanism for recursively traversing the AST
for both simple and version aware traversal.
TBR= [email protected]
BUG= http://code.google.com/p/chromium/issues/detail?id=87684
TEST= python idl_c_header.py
Review URL: http://codereview... | |
baf32512ad87cf9cf51877aaaa44396aca777cce | alembic/versions/4c4b79f8c4a_adding_geom_gix_to_markers.py | alembic/versions/4c4b79f8c4a_adding_geom_gix_to_markers.py | """Adding geom geographical index to markers and discussions
Revision ID: 4c4b79f8c4a
Revises: 10ffa15c5d24
Create Date: 2018-03-07 13:49:06.780319
"""
# revision identifiers, used by Alembic.
revision = '4c4b79f8c4a'
down_revision = '10ffa15c5d24'
branch_labels = None
depends_on = None
from alembic import op
import... | Add geon gix idx to markers and discussions | Add geon gix idx to markers and discussions
| Python | mit | hasadna/anyway,hasadna/anyway,hasadna/anyway,hasadna/anyway | Add geon gix idx to markers and discussions | """Adding geom geographical index to markers and discussions
Revision ID: 4c4b79f8c4a
Revises: 10ffa15c5d24
Create Date: 2018-03-07 13:49:06.780319
"""
# revision identifiers, used by Alembic.
revision = '4c4b79f8c4a'
down_revision = '10ffa15c5d24'
branch_labels = None
depends_on = None
from alembic import op
import... | <commit_before><commit_msg>Add geon gix idx to markers and discussions<commit_after> | """Adding geom geographical index to markers and discussions
Revision ID: 4c4b79f8c4a
Revises: 10ffa15c5d24
Create Date: 2018-03-07 13:49:06.780319
"""
# revision identifiers, used by Alembic.
revision = '4c4b79f8c4a'
down_revision = '10ffa15c5d24'
branch_labels = None
depends_on = None
from alembic import op
import... | Add geon gix idx to markers and discussions"""Adding geom geographical index to markers and discussions
Revision ID: 4c4b79f8c4a
Revises: 10ffa15c5d24
Create Date: 2018-03-07 13:49:06.780319
"""
# revision identifiers, used by Alembic.
revision = '4c4b79f8c4a'
down_revision = '10ffa15c5d24'
branch_labels = None
depen... | <commit_before><commit_msg>Add geon gix idx to markers and discussions<commit_after>"""Adding geom geographical index to markers and discussions
Revision ID: 4c4b79f8c4a
Revises: 10ffa15c5d24
Create Date: 2018-03-07 13:49:06.780319
"""
# revision identifiers, used by Alembic.
revision = '4c4b79f8c4a'
down_revision = ... | |
4b9d0550702093b3dcd49be257de8874c2464bb5 | mysite/settings/tests.py | mysite/settings/tests.py | from .base import * # noqa
DATABASES['default']['CONN_MAX_AGE'] = 0
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.MD5PasswordHasher',
]
RUNNING_TESTS = True
SECRET_KEY = "just here for testing"
| Refactor settings to be pure python | Refactor settings to be pure python
This starts to bring the settings in to line with a) all the other DC
projects and b) a pure python way of settings everything up
| Python | agpl-3.0 | DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative | Refactor settings to be pure python
This starts to bring the settings in to line with a) all the other DC
projects and b) a pure python way of settings everything up | from .base import * # noqa
DATABASES['default']['CONN_MAX_AGE'] = 0
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.MD5PasswordHasher',
]
RUNNING_TESTS = True
SECRET_KEY = "just here for testing"
| <commit_before><commit_msg>Refactor settings to be pure python
This starts to bring the settings in to line with a) all the other DC
projects and b) a pure python way of settings everything up<commit_after> | from .base import * # noqa
DATABASES['default']['CONN_MAX_AGE'] = 0
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.MD5PasswordHasher',
]
RUNNING_TESTS = True
SECRET_KEY = "just here for testing"
| Refactor settings to be pure python
This starts to bring the settings in to line with a) all the other DC
projects and b) a pure python way of settings everything upfrom .base import * # noqa
DATABASES['default']['CONN_MAX_AGE'] = 0
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.D... | <commit_before><commit_msg>Refactor settings to be pure python
This starts to bring the settings in to line with a) all the other DC
projects and b) a pure python way of settings everything up<commit_after>from .base import * # noqa
DATABASES['default']['CONN_MAX_AGE'] = 0
CACHES = {
'default': {
'BACK... | |
d8390d1111dcd4fd4af0b195dc0f36d352d25f4e | astropy/coordinates/tests/test_utils.py | astropy/coordinates/tests/test_utils.py | from astropy.time import Time
from astropy.coordinates.builtin_frames.utils import get_polar_motion
from astropy.utils.exceptions import AstropyWarning
import pytest
def test_polar_motion_unsupported_dates():
msg = r'Tried to get polar motions for times {} IERS.*'
with pytest.warns(AstropyWarning, match=msg.... | Add test for polar motion warnings | Add test for polar motion warnings
| Python | bsd-3-clause | saimn/astropy,larrybradley/astropy,saimn/astropy,pllim/astropy,dhomeier/astropy,lpsinger/astropy,astropy/astropy,lpsinger/astropy,saimn/astropy,mhvk/astropy,larrybradley/astropy,astropy/astropy,astropy/astropy,StuartLittlefair/astropy,mhvk/astropy,larrybradley/astropy,dhomeier/astropy,dhomeier/astropy,pllim/astropy,sai... | Add test for polar motion warnings | from astropy.time import Time
from astropy.coordinates.builtin_frames.utils import get_polar_motion
from astropy.utils.exceptions import AstropyWarning
import pytest
def test_polar_motion_unsupported_dates():
msg = r'Tried to get polar motions for times {} IERS.*'
with pytest.warns(AstropyWarning, match=msg.... | <commit_before><commit_msg>Add test for polar motion warnings<commit_after> | from astropy.time import Time
from astropy.coordinates.builtin_frames.utils import get_polar_motion
from astropy.utils.exceptions import AstropyWarning
import pytest
def test_polar_motion_unsupported_dates():
msg = r'Tried to get polar motions for times {} IERS.*'
with pytest.warns(AstropyWarning, match=msg.... | Add test for polar motion warningsfrom astropy.time import Time
from astropy.coordinates.builtin_frames.utils import get_polar_motion
from astropy.utils.exceptions import AstropyWarning
import pytest
def test_polar_motion_unsupported_dates():
msg = r'Tried to get polar motions for times {} IERS.*'
with pytes... | <commit_before><commit_msg>Add test for polar motion warnings<commit_after>from astropy.time import Time
from astropy.coordinates.builtin_frames.utils import get_polar_motion
from astropy.utils.exceptions import AstropyWarning
import pytest
def test_polar_motion_unsupported_dates():
msg = r'Tried to get polar mot... | |
c536a3f11230ecbb7db3fd1adc3dab585e083d0a | OPEN/macros/bls_gls.py | OPEN/macros/bls_gls.py | # In order to plot the GLS and BLS together 'run -i' this script:
magic = get_ipython().magic
magic('per obs') # to calculate GLS
from OPEN.periodograms import bls
default.per2 = bls(default) # calculate BLS and store it in the system
# for normalization
a1 = default.per2.power.max()
a2 = default.per.power.max()
... | Add 1st macro script; ability to run macros is here already. | Add 1st macro script; ability to run macros is here already.
The 'run' command from IPython already has the ability to work like
a macro reader/executer, with only simple changes to the script
files to allow for the OPEN magics. Don't forget the -i option to
expose the current namespace.
| Python | mit | j-faria/OPEN,j-faria/OPEN | Add 1st macro script; ability to run macros is here already.
The 'run' command from IPython already has the ability to work like
a macro reader/executer, with only simple changes to the script
files to allow for the OPEN magics. Don't forget the -i option to
expose the current namespace. | # In order to plot the GLS and BLS together 'run -i' this script:
magic = get_ipython().magic
magic('per obs') # to calculate GLS
from OPEN.periodograms import bls
default.per2 = bls(default) # calculate BLS and store it in the system
# for normalization
a1 = default.per2.power.max()
a2 = default.per.power.max()
... | <commit_before><commit_msg>Add 1st macro script; ability to run macros is here already.
The 'run' command from IPython already has the ability to work like
a macro reader/executer, with only simple changes to the script
files to allow for the OPEN magics. Don't forget the -i option to
expose the current namespace.<com... | # In order to plot the GLS and BLS together 'run -i' this script:
magic = get_ipython().magic
magic('per obs') # to calculate GLS
from OPEN.periodograms import bls
default.per2 = bls(default) # calculate BLS and store it in the system
# for normalization
a1 = default.per2.power.max()
a2 = default.per.power.max()
... | Add 1st macro script; ability to run macros is here already.
The 'run' command from IPython already has the ability to work like
a macro reader/executer, with only simple changes to the script
files to allow for the OPEN magics. Don't forget the -i option to
expose the current namespace.# In order to plot the GLS and ... | <commit_before><commit_msg>Add 1st macro script; ability to run macros is here already.
The 'run' command from IPython already has the ability to work like
a macro reader/executer, with only simple changes to the script
files to allow for the OPEN magics. Don't forget the -i option to
expose the current namespace.<com... | |
38e3cc382f2f626b82515f1d7b4e00a51462d4a3 | conf_site/api/test/test_presentation.py | conf_site/api/test/test_presentation.py | import datetime
from django.core.urlresolvers import reverse
from rest_framework import status
from symposion.schedule.models import (
Presentation,
Slot,
SlotKind,
Section,
Schedule,
Day,
)
from symposion.proposals.models import ProposalKind
from symposion.speakers.models import Speaker, User... | Add tests for Presentation viewset. | Add tests for Presentation viewset.
| Python | mit | pydata/conf_site,pydata/conf_site,pydata/conf_site | Add tests for Presentation viewset. | import datetime
from django.core.urlresolvers import reverse
from rest_framework import status
from symposion.schedule.models import (
Presentation,
Slot,
SlotKind,
Section,
Schedule,
Day,
)
from symposion.proposals.models import ProposalKind
from symposion.speakers.models import Speaker, User... | <commit_before><commit_msg>Add tests for Presentation viewset.<commit_after> | import datetime
from django.core.urlresolvers import reverse
from rest_framework import status
from symposion.schedule.models import (
Presentation,
Slot,
SlotKind,
Section,
Schedule,
Day,
)
from symposion.proposals.models import ProposalKind
from symposion.speakers.models import Speaker, User... | Add tests for Presentation viewset.import datetime
from django.core.urlresolvers import reverse
from rest_framework import status
from symposion.schedule.models import (
Presentation,
Slot,
SlotKind,
Section,
Schedule,
Day,
)
from symposion.proposals.models import ProposalKind
from symposion.s... | <commit_before><commit_msg>Add tests for Presentation viewset.<commit_after>import datetime
from django.core.urlresolvers import reverse
from rest_framework import status
from symposion.schedule.models import (
Presentation,
Slot,
SlotKind,
Section,
Schedule,
Day,
)
from symposion.proposals.mo... | |
b992a2a8f9b8dd029319c2b037eee7ad529d06c1 | contrib/firmware_packager/add_dfu_header.py | contrib/firmware_packager/add_dfu_header.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Richard Hughes <[email protected]>
#
# SPDX-License-Identifier: LGPL-2.1+
import struct
import zlib
import argparse
def main(bin_fn, dfu_fn, pad, vid, pid, rev):
# read binary file
with open(bin_fn, 'rb') as f:
blob = f.read()
#... | Add a helper script to add a DFU header | Add a helper script to add a DFU header
This is so simple we can do it in 10 lines of Python. It matches the format of
the `add_capsule_header.py` utility.
| Python | lgpl-2.1 | fwupd/fwupd,fwupd/fwupd,hughsie/fwupd,fwupd/fwupd,hughsie/fwupd,fwupd/fwupd,hughsie/fwupd,hughsie/fwupd | Add a helper script to add a DFU header
This is so simple we can do it in 10 lines of Python. It matches the format of
the `add_capsule_header.py` utility. | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Richard Hughes <[email protected]>
#
# SPDX-License-Identifier: LGPL-2.1+
import struct
import zlib
import argparse
def main(bin_fn, dfu_fn, pad, vid, pid, rev):
# read binary file
with open(bin_fn, 'rb') as f:
blob = f.read()
#... | <commit_before><commit_msg>Add a helper script to add a DFU header
This is so simple we can do it in 10 lines of Python. It matches the format of
the `add_capsule_header.py` utility.<commit_after> | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Richard Hughes <[email protected]>
#
# SPDX-License-Identifier: LGPL-2.1+
import struct
import zlib
import argparse
def main(bin_fn, dfu_fn, pad, vid, pid, rev):
# read binary file
with open(bin_fn, 'rb') as f:
blob = f.read()
#... | Add a helper script to add a DFU header
This is so simple we can do it in 10 lines of Python. It matches the format of
the `add_capsule_header.py` utility.#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Richard Hughes <[email protected]>
#
# SPDX-License-Identifier: LGPL-2.1+
import struct
import ... | <commit_before><commit_msg>Add a helper script to add a DFU header
This is so simple we can do it in 10 lines of Python. It matches the format of
the `add_capsule_header.py` utility.<commit_after>#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Richard Hughes <[email protected]>
#
# SPDX-License-Ide... | |
1d4f747844ed62550c7a1ee22699845ef8dfa925 | problem_32.py | problem_32.py | from time import time
DIGITS = 9
def calculate_pandigitals():
pandigitals = set()
for multiplicand in range(2, 99):
for multiplier in range(123, 9876/multiplicand):
product = multiplicand*multiplier
identity = str(multiplicand) + str(multiplier) + str(product)
if '... | Add problem 32, pandigital products | Add problem 32, pandigital products
| Python | mit | dimkarakostas/project-euler | Add problem 32, pandigital products | from time import time
DIGITS = 9
def calculate_pandigitals():
pandigitals = set()
for multiplicand in range(2, 99):
for multiplier in range(123, 9876/multiplicand):
product = multiplicand*multiplier
identity = str(multiplicand) + str(multiplier) + str(product)
if '... | <commit_before><commit_msg>Add problem 32, pandigital products<commit_after> | from time import time
DIGITS = 9
def calculate_pandigitals():
pandigitals = set()
for multiplicand in range(2, 99):
for multiplier in range(123, 9876/multiplicand):
product = multiplicand*multiplier
identity = str(multiplicand) + str(multiplier) + str(product)
if '... | Add problem 32, pandigital productsfrom time import time
DIGITS = 9
def calculate_pandigitals():
pandigitals = set()
for multiplicand in range(2, 99):
for multiplier in range(123, 9876/multiplicand):
product = multiplicand*multiplier
identity = str(multiplicand) + str(multipli... | <commit_before><commit_msg>Add problem 32, pandigital products<commit_after>from time import time
DIGITS = 9
def calculate_pandigitals():
pandigitals = set()
for multiplicand in range(2, 99):
for multiplier in range(123, 9876/multiplicand):
product = multiplicand*multiplier
id... | |
8265d7f3dc9c6243ba338e7fc4c52117fd7340fd | qllbotnew.py | qllbotnew.py | import select
import socket
import time
HOST, PORT = 'localhost', 5000
class Bot(object):
timeout = 1
watchdog_threshold = 120
def __init__(self, host, port, max_retries=5):
self.host = host
self.port = port
self.max_retries = max_retries
self.socket = None
def conn... | Add temporary testing script for qllbot v2. | Add temporary testing script for qllbot v2.
| Python | bsd-2-clause | sqall01/qllbot,Javex/qllbot,qll/qllbot | Add temporary testing script for qllbot v2. | import select
import socket
import time
HOST, PORT = 'localhost', 5000
class Bot(object):
timeout = 1
watchdog_threshold = 120
def __init__(self, host, port, max_retries=5):
self.host = host
self.port = port
self.max_retries = max_retries
self.socket = None
def conn... | <commit_before><commit_msg>Add temporary testing script for qllbot v2.<commit_after> | import select
import socket
import time
HOST, PORT = 'localhost', 5000
class Bot(object):
timeout = 1
watchdog_threshold = 120
def __init__(self, host, port, max_retries=5):
self.host = host
self.port = port
self.max_retries = max_retries
self.socket = None
def conn... | Add temporary testing script for qllbot v2.import select
import socket
import time
HOST, PORT = 'localhost', 5000
class Bot(object):
timeout = 1
watchdog_threshold = 120
def __init__(self, host, port, max_retries=5):
self.host = host
self.port = port
self.max_retries = max_retri... | <commit_before><commit_msg>Add temporary testing script for qllbot v2.<commit_after>import select
import socket
import time
HOST, PORT = 'localhost', 5000
class Bot(object):
timeout = 1
watchdog_threshold = 120
def __init__(self, host, port, max_retries=5):
self.host = host
self.port = ... | |
4b7f008c691d14894ea17c3263c7c68fab66f246 | blackjack/__init__.py | blackjack/__init__.py | """The init file for the blackjack package."""
__author__ = 'Christopher Randall Wells'
__copyright__ = 'Copyright 2015 Christopher Randall Wells'
__license__ = 'MIT'
__title__ = 'blackjack'
__version__ = '0.1'
| Add basic package directory and init file | Add basic package directory and init file
Add a basic package directory containing a simple __init__.py file to define the elements of the package.
| Python | mit | ExcaliburZero/blackjack | Add basic package directory and init file
Add a basic package directory containing a simple __init__.py file to define the elements of the package. | """The init file for the blackjack package."""
__author__ = 'Christopher Randall Wells'
__copyright__ = 'Copyright 2015 Christopher Randall Wells'
__license__ = 'MIT'
__title__ = 'blackjack'
__version__ = '0.1'
| <commit_before><commit_msg>Add basic package directory and init file
Add a basic package directory containing a simple __init__.py file to define the elements of the package.<commit_after> | """The init file for the blackjack package."""
__author__ = 'Christopher Randall Wells'
__copyright__ = 'Copyright 2015 Christopher Randall Wells'
__license__ = 'MIT'
__title__ = 'blackjack'
__version__ = '0.1'
| Add basic package directory and init file
Add a basic package directory containing a simple __init__.py file to define the elements of the package."""The init file for the blackjack package."""
__author__ = 'Christopher Randall Wells'
__copyright__ = 'Copyright 2015 Christopher Randall Wells'
__license__ = 'MIT'
__ti... | <commit_before><commit_msg>Add basic package directory and init file
Add a basic package directory containing a simple __init__.py file to define the elements of the package.<commit_after>"""The init file for the blackjack package."""
__author__ = 'Christopher Randall Wells'
__copyright__ = 'Copyright 2015 Christophe... | |
25c6fc731be491aa144867995b7b9d5f646414f2 | tests/basics/builtin_delattr.py | tests/basics/builtin_delattr.py | # test builtin delattr
class A: pass
a = A()
a.x = 1
print(a.x)
delattr(a, 'x')
try:
a.x
except AttributeError:
print('AttributeError')
try:
delattr(a, 'x')
except AttributeError:
print('AttributeError')
| Add test for builtin "delattr". | tests/basics: Add test for builtin "delattr".
| Python | mit | swegener/micropython,ryannathans/micropython,PappaPeppar/micropython,MrSurly/micropython,MrSurly/micropython,hosaka/micropython,tobbad/micropython,matthewelse/micropython,cwyark/micropython,Peetz0r/micropython-esp32,mhoffma/micropython,puuu/micropython,selste/micropython,puuu/micropython,deshipu/micropython,blazewicz/m... | tests/basics: Add test for builtin "delattr". | # test builtin delattr
class A: pass
a = A()
a.x = 1
print(a.x)
delattr(a, 'x')
try:
a.x
except AttributeError:
print('AttributeError')
try:
delattr(a, 'x')
except AttributeError:
print('AttributeError')
| <commit_before><commit_msg>tests/basics: Add test for builtin "delattr".<commit_after> | # test builtin delattr
class A: pass
a = A()
a.x = 1
print(a.x)
delattr(a, 'x')
try:
a.x
except AttributeError:
print('AttributeError')
try:
delattr(a, 'x')
except AttributeError:
print('AttributeError')
| tests/basics: Add test for builtin "delattr".# test builtin delattr
class A: pass
a = A()
a.x = 1
print(a.x)
delattr(a, 'x')
try:
a.x
except AttributeError:
print('AttributeError')
try:
delattr(a, 'x')
except AttributeError:
print('AttributeError')
| <commit_before><commit_msg>tests/basics: Add test for builtin "delattr".<commit_after># test builtin delattr
class A: pass
a = A()
a.x = 1
print(a.x)
delattr(a, 'x')
try:
a.x
except AttributeError:
print('AttributeError')
try:
delattr(a, 'x')
except AttributeError:
print('AttributeError')
| |
bafa7a030192549f19de886dc9bc251f59668f5e | tests/formats_test/swap_test.py | tests/formats_test/swap_test.py | import test_compat # pylint: disable=unused-import
import six
import unittest
from blivet.devices.storage import StorageDevice
from blivet.errors import DeviceError
from blivet.formats import get_format
from blivet.size import Size
class SwapNodevTestCase(unittest.TestCase):
def test_swap_max_size(self):
... | Add test for SwapSpace max size | Add test for SwapSpace max size
| Python | lgpl-2.1 | vojtechtrefny/blivet,rvykydal/blivet,jkonecny12/blivet,rvykydal/blivet,vojtechtrefny/blivet,jkonecny12/blivet | Add test for SwapSpace max size | import test_compat # pylint: disable=unused-import
import six
import unittest
from blivet.devices.storage import StorageDevice
from blivet.errors import DeviceError
from blivet.formats import get_format
from blivet.size import Size
class SwapNodevTestCase(unittest.TestCase):
def test_swap_max_size(self):
... | <commit_before><commit_msg>Add test for SwapSpace max size<commit_after> | import test_compat # pylint: disable=unused-import
import six
import unittest
from blivet.devices.storage import StorageDevice
from blivet.errors import DeviceError
from blivet.formats import get_format
from blivet.size import Size
class SwapNodevTestCase(unittest.TestCase):
def test_swap_max_size(self):
... | Add test for SwapSpace max sizeimport test_compat # pylint: disable=unused-import
import six
import unittest
from blivet.devices.storage import StorageDevice
from blivet.errors import DeviceError
from blivet.formats import get_format
from blivet.size import Size
class SwapNodevTestCase(unittest.TestCase):
de... | <commit_before><commit_msg>Add test for SwapSpace max size<commit_after>import test_compat # pylint: disable=unused-import
import six
import unittest
from blivet.devices.storage import StorageDevice
from blivet.errors import DeviceError
from blivet.formats import get_format
from blivet.size import Size
class Swap... | |
2575a39d29b904fe32dcf45333c8429bc92085ea | tastypie_search/signals.py | tastypie_search/signals.py | """ Additional Haystack Signal Processors
This module provides additional HAYSTACK_SIGNAL_PROCESSOR classes to reindex more effeciently.
They may be tied to various other haystack-related libraries.
They are not tied to `tastypie_search` in any way! Use them anywhere Haystack is installed.
"""
import sys
from django.... | Add a signal processor that only records Models that have indexes. | Add a signal processor that only records Models that have indexes.
| Python | mit | adroffner/tastypie-searchable | Add a signal processor that only records Models that have indexes. | """ Additional Haystack Signal Processors
This module provides additional HAYSTACK_SIGNAL_PROCESSOR classes to reindex more effeciently.
They may be tied to various other haystack-related libraries.
They are not tied to `tastypie_search` in any way! Use them anywhere Haystack is installed.
"""
import sys
from django.... | <commit_before><commit_msg>Add a signal processor that only records Models that have indexes.<commit_after> | """ Additional Haystack Signal Processors
This module provides additional HAYSTACK_SIGNAL_PROCESSOR classes to reindex more effeciently.
They may be tied to various other haystack-related libraries.
They are not tied to `tastypie_search` in any way! Use them anywhere Haystack is installed.
"""
import sys
from django.... | Add a signal processor that only records Models that have indexes.""" Additional Haystack Signal Processors
This module provides additional HAYSTACK_SIGNAL_PROCESSOR classes to reindex more effeciently.
They may be tied to various other haystack-related libraries.
They are not tied to `tastypie_search` in any way! Us... | <commit_before><commit_msg>Add a signal processor that only records Models that have indexes.<commit_after>""" Additional Haystack Signal Processors
This module provides additional HAYSTACK_SIGNAL_PROCESSOR classes to reindex more effeciently.
They may be tied to various other haystack-related libraries.
They are not... | |
7b6fe1d3dfe6c4397729e085773dda73d4791716 | remove-notes.py | remove-notes.py | #!/usr/bin/env python3
from bs4 import BeautifulSoup
import sys
with open(sys.argv[1], "r") as f:
tree = BeautifulSoup(f, 'html.parser')
for note in tree.find_all("div", class_ = "notes"):
note.decompose()
print(tree)
| Add script to remove notes | Add script to remove notes
The script can be used to remove the notes in a compiled presentation.
This is useful when publishing slides so the notes intended for the
presenter only are not published as well.
| Python | mit | frederikmoellers/hovercraft-template | Add script to remove notes
The script can be used to remove the notes in a compiled presentation.
This is useful when publishing slides so the notes intended for the
presenter only are not published as well. | #!/usr/bin/env python3
from bs4 import BeautifulSoup
import sys
with open(sys.argv[1], "r") as f:
tree = BeautifulSoup(f, 'html.parser')
for note in tree.find_all("div", class_ = "notes"):
note.decompose()
print(tree)
| <commit_before><commit_msg>Add script to remove notes
The script can be used to remove the notes in a compiled presentation.
This is useful when publishing slides so the notes intended for the
presenter only are not published as well.<commit_after> | #!/usr/bin/env python3
from bs4 import BeautifulSoup
import sys
with open(sys.argv[1], "r") as f:
tree = BeautifulSoup(f, 'html.parser')
for note in tree.find_all("div", class_ = "notes"):
note.decompose()
print(tree)
| Add script to remove notes
The script can be used to remove the notes in a compiled presentation.
This is useful when publishing slides so the notes intended for the
presenter only are not published as well.#!/usr/bin/env python3
from bs4 import BeautifulSoup
import sys
with open(sys.argv[1], "r") as f:
tree = B... | <commit_before><commit_msg>Add script to remove notes
The script can be used to remove the notes in a compiled presentation.
This is useful when publishing slides so the notes intended for the
presenter only are not published as well.<commit_after>#!/usr/bin/env python3
from bs4 import BeautifulSoup
import sys
with ... | |
d7bce6c1e48ba1f5a0e50909e21ec2a8db86bca7 | instance/epio_config.py | instance/epio_config.py | """\
Epio Config
The recommended usage of this file is to rename it to <servername>_config.py.
This can be loaded by setting the SETTINGS_MODULE environment variable to here.
See 'default_config.py' for a complete list of overridable settings.
"""
# Security settings
SECRET_KEY = '<REMOVED>'
# Logging settings
ERR... | Add ep.io config for historical purposes. | Add ep.io config for historical purposes.
| Python | mit | joeyespo/tabhouse,joeyespo/tabhouse.org,joeyespo/tabhouse.org,joeyespo/tabhouse | Add ep.io config for historical purposes. | """\
Epio Config
The recommended usage of this file is to rename it to <servername>_config.py.
This can be loaded by setting the SETTINGS_MODULE environment variable to here.
See 'default_config.py' for a complete list of overridable settings.
"""
# Security settings
SECRET_KEY = '<REMOVED>'
# Logging settings
ERR... | <commit_before><commit_msg>Add ep.io config for historical purposes.<commit_after> | """\
Epio Config
The recommended usage of this file is to rename it to <servername>_config.py.
This can be loaded by setting the SETTINGS_MODULE environment variable to here.
See 'default_config.py' for a complete list of overridable settings.
"""
# Security settings
SECRET_KEY = '<REMOVED>'
# Logging settings
ERR... | Add ep.io config for historical purposes."""\
Epio Config
The recommended usage of this file is to rename it to <servername>_config.py.
This can be loaded by setting the SETTINGS_MODULE environment variable to here.
See 'default_config.py' for a complete list of overridable settings.
"""
# Security settings
SECRET_... | <commit_before><commit_msg>Add ep.io config for historical purposes.<commit_after>"""\
Epio Config
The recommended usage of this file is to rename it to <servername>_config.py.
This can be loaded by setting the SETTINGS_MODULE environment variable to here.
See 'default_config.py' for a complete list of overridable se... | |
d38392998869319677cc884836c5952441f6ac62 | pokemongo_bot/base_task.py | pokemongo_bot/base_task.py | import logging
class BaseTask(object):
TASK_API_VERSION = 1
def __init__(self, bot, config):
"""
:param bot:
:type bot: pokemongo_bot.PokemonGoBot
:param config:
:return:
"""
self.bot = bot
self.config = config
self._validate_work_exists()
self.logger = logging.getLogger(... | import logging
import time
class BaseTask(object):
TASK_API_VERSION = 1
def __init__(self, bot, config):
"""
:param bot:
:type bot: pokemongo_bot.PokemonGoBot
:param config:
:return:
"""
self.bot = bot
self.config = config
self._validate_work_exists()
self.logger = loggi... | Support for log_delay for all tasks | Support for log_delay for all tasks
| Python | mit | lythien/pokemongo,heihachi/PokemonGo-Bot,pengzhangdev/PokemonGo-Bot,lythien/pokemongo,goedzo/PokemonGo-Bot,goedzo/PokemonGo-Bot,dtee/PokemonGo-Bot,DBa2016/PokemonGo-Bot,DBa2016/PokemonGo-Bot,DBa2016/PokemonGo-Bot,halsafar/PokemonGo-Bot,goshan/PokemonGo-Bot,Gobberwart/PokemonGo-Bot,cmezh/PokemonGo-Bot,Gobberwart/Pokemon... | import logging
class BaseTask(object):
TASK_API_VERSION = 1
def __init__(self, bot, config):
"""
:param bot:
:type bot: pokemongo_bot.PokemonGoBot
:param config:
:return:
"""
self.bot = bot
self.config = config
self._validate_work_exists()
self.logger = logging.getLogger(... | import logging
import time
class BaseTask(object):
TASK_API_VERSION = 1
def __init__(self, bot, config):
"""
:param bot:
:type bot: pokemongo_bot.PokemonGoBot
:param config:
:return:
"""
self.bot = bot
self.config = config
self._validate_work_exists()
self.logger = loggi... | <commit_before>import logging
class BaseTask(object):
TASK_API_VERSION = 1
def __init__(self, bot, config):
"""
:param bot:
:type bot: pokemongo_bot.PokemonGoBot
:param config:
:return:
"""
self.bot = bot
self.config = config
self._validate_work_exists()
self.logger = log... | import logging
import time
class BaseTask(object):
TASK_API_VERSION = 1
def __init__(self, bot, config):
"""
:param bot:
:type bot: pokemongo_bot.PokemonGoBot
:param config:
:return:
"""
self.bot = bot
self.config = config
self._validate_work_exists()
self.logger = loggi... | import logging
class BaseTask(object):
TASK_API_VERSION = 1
def __init__(self, bot, config):
"""
:param bot:
:type bot: pokemongo_bot.PokemonGoBot
:param config:
:return:
"""
self.bot = bot
self.config = config
self._validate_work_exists()
self.logger = logging.getLogger(... | <commit_before>import logging
class BaseTask(object):
TASK_API_VERSION = 1
def __init__(self, bot, config):
"""
:param bot:
:type bot: pokemongo_bot.PokemonGoBot
:param config:
:return:
"""
self.bot = bot
self.config = config
self._validate_work_exists()
self.logger = log... |
e574919647565d046b40f31de765e111ffee9268 | tests/example_tests/test_custom_struct.py | tests/example_tests/test_custom_struct.py | import re
import unittest
from example_tests import example_test
class TestCustomStruct(unittest.TestCase):
def test_builtin_vectors(self):
output = example_test.run_example('custom_struct/builtin_vectors.py')
assert re.match(
r"Kernel output matches expected value.",
out... | Add a test for custom struct examples. | Add a test for custom struct examples.
| Python | mit | cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy | Add a test for custom struct examples. | import re
import unittest
from example_tests import example_test
class TestCustomStruct(unittest.TestCase):
def test_builtin_vectors(self):
output = example_test.run_example('custom_struct/builtin_vectors.py')
assert re.match(
r"Kernel output matches expected value.",
out... | <commit_before><commit_msg>Add a test for custom struct examples.<commit_after> | import re
import unittest
from example_tests import example_test
class TestCustomStruct(unittest.TestCase):
def test_builtin_vectors(self):
output = example_test.run_example('custom_struct/builtin_vectors.py')
assert re.match(
r"Kernel output matches expected value.",
out... | Add a test for custom struct examples.import re
import unittest
from example_tests import example_test
class TestCustomStruct(unittest.TestCase):
def test_builtin_vectors(self):
output = example_test.run_example('custom_struct/builtin_vectors.py')
assert re.match(
r"Kernel output mat... | <commit_before><commit_msg>Add a test for custom struct examples.<commit_after>import re
import unittest
from example_tests import example_test
class TestCustomStruct(unittest.TestCase):
def test_builtin_vectors(self):
output = example_test.run_example('custom_struct/builtin_vectors.py')
assert ... | |
6881c6cdc8003f649fb9957850a789b66d92d707 | pypi_alerts/__init__.py | pypi_alerts/__init__.py | # *-8 coding: utf-8 -*-
"""
Parse requirements file, and work out whether there are any updates.
"""
import requests
from semantic_version import Version
def package_url(package):
"""Return fully-qualified URL to package on PyPI (JSON endpoint)."""
return u"http://pypi.python.org/pypi/%s/json" % package
def... | Add first pass at a PackageVersion class | Add first pass at a PackageVersion class
| Python | mit | yunojuno/pypi-alerts | Add first pass at a PackageVersion class | # *-8 coding: utf-8 -*-
"""
Parse requirements file, and work out whether there are any updates.
"""
import requests
from semantic_version import Version
def package_url(package):
"""Return fully-qualified URL to package on PyPI (JSON endpoint)."""
return u"http://pypi.python.org/pypi/%s/json" % package
def... | <commit_before><commit_msg>Add first pass at a PackageVersion class<commit_after> | # *-8 coding: utf-8 -*-
"""
Parse requirements file, and work out whether there are any updates.
"""
import requests
from semantic_version import Version
def package_url(package):
"""Return fully-qualified URL to package on PyPI (JSON endpoint)."""
return u"http://pypi.python.org/pypi/%s/json" % package
def... | Add first pass at a PackageVersion class# *-8 coding: utf-8 -*-
"""
Parse requirements file, and work out whether there are any updates.
"""
import requests
from semantic_version import Version
def package_url(package):
"""Return fully-qualified URL to package on PyPI (JSON endpoint)."""
return u"http://pypi.... | <commit_before><commit_msg>Add first pass at a PackageVersion class<commit_after># *-8 coding: utf-8 -*-
"""
Parse requirements file, and work out whether there are any updates.
"""
import requests
from semantic_version import Version
def package_url(package):
"""Return fully-qualified URL to package on PyPI (JSO... | |
05fb9d24c01c40312ba1f0930e7754ae84419bc9 | scripts/pin_deps.py | scripts/pin_deps.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import subprocess as sp
from tempfile import mkstemp
def skip(g, *ks):
for k, x in enumerate(g):
if k not in ks:
yield x
if __name__ == '__main__':
tmp_req_f, tmp_req_path = mkstemp()
os.close(tmp_req_f)
sp.check_call(['p... | Add a script to pin deps | Add a script to pin deps
| Python | mit | idmit/midware | Add a script to pin deps | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import subprocess as sp
from tempfile import mkstemp
def skip(g, *ks):
for k, x in enumerate(g):
if k not in ks:
yield x
if __name__ == '__main__':
tmp_req_f, tmp_req_path = mkstemp()
os.close(tmp_req_f)
sp.check_call(['p... | <commit_before><commit_msg>Add a script to pin deps<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import subprocess as sp
from tempfile import mkstemp
def skip(g, *ks):
for k, x in enumerate(g):
if k not in ks:
yield x
if __name__ == '__main__':
tmp_req_f, tmp_req_path = mkstemp()
os.close(tmp_req_f)
sp.check_call(['p... | Add a script to pin deps#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import subprocess as sp
from tempfile import mkstemp
def skip(g, *ks):
for k, x in enumerate(g):
if k not in ks:
yield x
if __name__ == '__main__':
tmp_req_f, tmp_req_path = mkstemp()
os.close(tmp_req_f... | <commit_before><commit_msg>Add a script to pin deps<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import subprocess as sp
from tempfile import mkstemp
def skip(g, *ks):
for k, x in enumerate(g):
if k not in ks:
yield x
if __name__ == '__main__':
tmp_req_f, tmp_re... | |
6f0ab721e50cf432abb1fa0c3f315ee7b36276f5 | future/fciqmcscf/test/test_he2_state_averaged.py | future/fciqmcscf/test/test_he2_state_averaged.py | #!/usr/bin/env python
import unittest
import numpy
from pyscf import gto
from pyscf import scf
from pyscf import mcscf
from pyscf import fciqmcscf
b = 1.4
mol = gto.Mole()
mol.build(
verbose = 0,
output = None,
atom = [['He',( 0.000000, 0.000000, -b/2)],
['He',( 0.000000, 0.000000, b)]],
basis =... | Add state-averaged test (benchmarks not yet added), for testing. | Add state-averaged test (benchmarks not yet added), for testing.
| Python | apache-2.0 | sunqm/pyscf,gkc1000/pyscf,sunqm/pyscf,gkc1000/pyscf,gkc1000/pyscf,gkc1000/pyscf,gkc1000/pyscf,sunqm/pyscf,sunqm/pyscf | Add state-averaged test (benchmarks not yet added), for testing. | #!/usr/bin/env python
import unittest
import numpy
from pyscf import gto
from pyscf import scf
from pyscf import mcscf
from pyscf import fciqmcscf
b = 1.4
mol = gto.Mole()
mol.build(
verbose = 0,
output = None,
atom = [['He',( 0.000000, 0.000000, -b/2)],
['He',( 0.000000, 0.000000, b)]],
basis =... | <commit_before><commit_msg>Add state-averaged test (benchmarks not yet added), for testing.<commit_after> | #!/usr/bin/env python
import unittest
import numpy
from pyscf import gto
from pyscf import scf
from pyscf import mcscf
from pyscf import fciqmcscf
b = 1.4
mol = gto.Mole()
mol.build(
verbose = 0,
output = None,
atom = [['He',( 0.000000, 0.000000, -b/2)],
['He',( 0.000000, 0.000000, b)]],
basis =... | Add state-averaged test (benchmarks not yet added), for testing.#!/usr/bin/env python
import unittest
import numpy
from pyscf import gto
from pyscf import scf
from pyscf import mcscf
from pyscf import fciqmcscf
b = 1.4
mol = gto.Mole()
mol.build(
verbose = 0,
output = None,
atom = [['He',( 0.000000, 0.0000... | <commit_before><commit_msg>Add state-averaged test (benchmarks not yet added), for testing.<commit_after>#!/usr/bin/env python
import unittest
import numpy
from pyscf import gto
from pyscf import scf
from pyscf import mcscf
from pyscf import fciqmcscf
b = 1.4
mol = gto.Mole()
mol.build(
verbose = 0,
output =... | |
28da05d860147b5e0df37d998f437af6a5d4d178 | airflow/hooks/postgres_hook.py | airflow/hooks/postgres_hook.py | import psycopg2
from airflow.hooks.dbapi_hook import DbApiHook
class PostgresHook(DbApiHook):
'''
Interact with Postgres.
You can specify ssl parameters in the extra field of your connection
as ``{"sslmode": "require", "sslcert": "/path/to/cert.pem", etc}``.
'''
conn_name_attr = 'postgres_con... | import psycopg2
from airflow.hooks.dbapi_hook import DbApiHook
class PostgresHook(DbApiHook):
'''
Interact with Postgres.
You can specify ssl parameters in the extra field of your connection
as ``{"sslmode": "require", "sslcert": "/path/to/cert.pem", etc}``.
'''
conn_name_attr = 'postgres_con... | Set Postgres autocommit as supported only if server version is < 7.4 | Set Postgres autocommit as supported only if server version is < 7.4
The server-side autocommit setting was removed here http://www.postgresql.org/docs/7.4/static/release-7-4.html
Resolves: #690
| Python | apache-2.0 | vijaysbhat/incubator-airflow,dgies/incubator-airflow,owlabs/incubator-airflow,Acehaidrey/incubator-airflow,gtoonstra/airflow,hamedhsn/incubator-airflow,apache/airflow,N3da/incubator-airflow,mrkm4ntr/incubator-airflow,RealImpactAnalytics/airflow,r39132/airflow,janczak10/incubator-airflow,cfei18/incubator-airflow,CloverH... | import psycopg2
from airflow.hooks.dbapi_hook import DbApiHook
class PostgresHook(DbApiHook):
'''
Interact with Postgres.
You can specify ssl parameters in the extra field of your connection
as ``{"sslmode": "require", "sslcert": "/path/to/cert.pem", etc}``.
'''
conn_name_attr = 'postgres_con... | import psycopg2
from airflow.hooks.dbapi_hook import DbApiHook
class PostgresHook(DbApiHook):
'''
Interact with Postgres.
You can specify ssl parameters in the extra field of your connection
as ``{"sslmode": "require", "sslcert": "/path/to/cert.pem", etc}``.
'''
conn_name_attr = 'postgres_con... | <commit_before>import psycopg2
from airflow.hooks.dbapi_hook import DbApiHook
class PostgresHook(DbApiHook):
'''
Interact with Postgres.
You can specify ssl parameters in the extra field of your connection
as ``{"sslmode": "require", "sslcert": "/path/to/cert.pem", etc}``.
'''
conn_name_attr ... | import psycopg2
from airflow.hooks.dbapi_hook import DbApiHook
class PostgresHook(DbApiHook):
'''
Interact with Postgres.
You can specify ssl parameters in the extra field of your connection
as ``{"sslmode": "require", "sslcert": "/path/to/cert.pem", etc}``.
'''
conn_name_attr = 'postgres_con... | import psycopg2
from airflow.hooks.dbapi_hook import DbApiHook
class PostgresHook(DbApiHook):
'''
Interact with Postgres.
You can specify ssl parameters in the extra field of your connection
as ``{"sslmode": "require", "sslcert": "/path/to/cert.pem", etc}``.
'''
conn_name_attr = 'postgres_con... | <commit_before>import psycopg2
from airflow.hooks.dbapi_hook import DbApiHook
class PostgresHook(DbApiHook):
'''
Interact with Postgres.
You can specify ssl parameters in the extra field of your connection
as ``{"sslmode": "require", "sslcert": "/path/to/cert.pem", etc}``.
'''
conn_name_attr ... |
9139a2efc445887f59b99052f1ffd05c98ee2c72 | tests/test_reporter.py | tests/test_reporter.py | """Test the Reporter base class."""
import pytest
@pytest.fixture
def klass():
"""Return the CUT."""
from agile_analytics.reporters import Reporter
return Reporter
def test_klass(klass):
"""Ensure the CUT exists."""
assert klass
@pytest.fixture
def instance(klass, days_ago):
"""Return a p... | Add tests for base class. | Add tests for base class.
| Python | mit | cmheisel/agile-analytics | Add tests for base class. | """Test the Reporter base class."""
import pytest
@pytest.fixture
def klass():
"""Return the CUT."""
from agile_analytics.reporters import Reporter
return Reporter
def test_klass(klass):
"""Ensure the CUT exists."""
assert klass
@pytest.fixture
def instance(klass, days_ago):
"""Return a p... | <commit_before><commit_msg>Add tests for base class.<commit_after> | """Test the Reporter base class."""
import pytest
@pytest.fixture
def klass():
"""Return the CUT."""
from agile_analytics.reporters import Reporter
return Reporter
def test_klass(klass):
"""Ensure the CUT exists."""
assert klass
@pytest.fixture
def instance(klass, days_ago):
"""Return a p... | Add tests for base class."""Test the Reporter base class."""
import pytest
@pytest.fixture
def klass():
"""Return the CUT."""
from agile_analytics.reporters import Reporter
return Reporter
def test_klass(klass):
"""Ensure the CUT exists."""
assert klass
@pytest.fixture
def instance(klass, day... | <commit_before><commit_msg>Add tests for base class.<commit_after>"""Test the Reporter base class."""
import pytest
@pytest.fixture
def klass():
"""Return the CUT."""
from agile_analytics.reporters import Reporter
return Reporter
def test_klass(klass):
"""Ensure the CUT exists."""
assert klass
... | |
907b626743e0a0a48bc47580f269618efdb4b399 | skidl/logger.py | skidl/logger.py | # -*- coding: utf-8 -*-
# MIT license
#
# Copyright (C) 2019 by XESS Corp.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to... | Split logging functions from utilities.py into its own file. | Split logging functions from utilities.py into its own file.
| Python | mit | xesscorp/skidl,xesscorp/skidl | Split logging functions from utilities.py into its own file. | # -*- coding: utf-8 -*-
# MIT license
#
# Copyright (C) 2019 by XESS Corp.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to... | <commit_before><commit_msg>Split logging functions from utilities.py into its own file.<commit_after> | # -*- coding: utf-8 -*-
# MIT license
#
# Copyright (C) 2019 by XESS Corp.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to... | Split logging functions from utilities.py into its own file.# -*- coding: utf-8 -*-
# MIT license
#
# Copyright (C) 2019 by XESS Corp.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software witho... | <commit_before><commit_msg>Split logging functions from utilities.py into its own file.<commit_after># -*- coding: utf-8 -*-
# MIT license
#
# Copyright (C) 2019 by XESS Corp.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "So... | |
d7dc4142957cb81fa864677aa0a5b9d37b615778 | download.py | download.py | import csv
import json
import sys
import tqdm
from cordis_scraper import get_project
dataset_path = sys.argv[1]
output_path = sys.argv[2]
with open(dataset_path, 'r') as dataset_file:
record_count = sum(1 for line in dataset_file)
dataset_file = open(dataset_path, 'r')
output_path = open(output_path, 'w')
data... | Write a script to get the details for all records in the H2020 dump | Write a script to get the details for all records in the H2020 dump
| Python | mit | oersted/cordis-scraper | Write a script to get the details for all records in the H2020 dump | import csv
import json
import sys
import tqdm
from cordis_scraper import get_project
dataset_path = sys.argv[1]
output_path = sys.argv[2]
with open(dataset_path, 'r') as dataset_file:
record_count = sum(1 for line in dataset_file)
dataset_file = open(dataset_path, 'r')
output_path = open(output_path, 'w')
data... | <commit_before><commit_msg>Write a script to get the details for all records in the H2020 dump<commit_after> | import csv
import json
import sys
import tqdm
from cordis_scraper import get_project
dataset_path = sys.argv[1]
output_path = sys.argv[2]
with open(dataset_path, 'r') as dataset_file:
record_count = sum(1 for line in dataset_file)
dataset_file = open(dataset_path, 'r')
output_path = open(output_path, 'w')
data... | Write a script to get the details for all records in the H2020 dumpimport csv
import json
import sys
import tqdm
from cordis_scraper import get_project
dataset_path = sys.argv[1]
output_path = sys.argv[2]
with open(dataset_path, 'r') as dataset_file:
record_count = sum(1 for line in dataset_file)
dataset_file =... | <commit_before><commit_msg>Write a script to get the details for all records in the H2020 dump<commit_after>import csv
import json
import sys
import tqdm
from cordis_scraper import get_project
dataset_path = sys.argv[1]
output_path = sys.argv[2]
with open(dataset_path, 'r') as dataset_file:
record_count = sum(1 ... | |
df89f96113d73017a9e18964bfd456b06a2e2a6d | jsk_apc2015_common/scripts/create_mask_applied_dataset.py | jsk_apc2015_common/scripts/create_mask_applied_dataset.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
import re
import cv2
from jsk_recognition_utils import bounding_rect_of_mask
parser = argparse.ArgumentParser()
parser.add_argument('container_path')
args = parser.parse_args()
container_path = args.container_path
output_dir = os.path.abspath(... | Add script to create mask applied dataset | Add script to create mask applied dataset
| Python | bsd-3-clause | pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc | Add script to create mask applied dataset | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
import re
import cv2
from jsk_recognition_utils import bounding_rect_of_mask
parser = argparse.ArgumentParser()
parser.add_argument('container_path')
args = parser.parse_args()
container_path = args.container_path
output_dir = os.path.abspath(... | <commit_before><commit_msg>Add script to create mask applied dataset<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
import re
import cv2
from jsk_recognition_utils import bounding_rect_of_mask
parser = argparse.ArgumentParser()
parser.add_argument('container_path')
args = parser.parse_args()
container_path = args.container_path
output_dir = os.path.abspath(... | Add script to create mask applied dataset#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
import re
import cv2
from jsk_recognition_utils import bounding_rect_of_mask
parser = argparse.ArgumentParser()
parser.add_argument('container_path')
args = parser.parse_args()
container_path = args.con... | <commit_before><commit_msg>Add script to create mask applied dataset<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
import re
import cv2
from jsk_recognition_utils import bounding_rect_of_mask
parser = argparse.ArgumentParser()
parser.add_argument('container_path')
args = parse... | |
aecb39860f8fcc20471c4b1b1b959e9be7e42d70 | euler030.py | euler030.py | #!/usr/bin/python
power_sum = 0
# Upper limit is a 6 digits number
for i in range(2, (9 ** 5) * 6):
# I'm loving Python sugar
if sum(int(j) ** 5 for j in str(i)) == i:
# If you want to see the numbers
# print(i)
power_sum += i
print(power_sum)
| Add solution for problem 30 | Add solution for problem 30
| Python | mit | cifvts/PyEuler | Add solution for problem 30 | #!/usr/bin/python
power_sum = 0
# Upper limit is a 6 digits number
for i in range(2, (9 ** 5) * 6):
# I'm loving Python sugar
if sum(int(j) ** 5 for j in str(i)) == i:
# If you want to see the numbers
# print(i)
power_sum += i
print(power_sum)
| <commit_before><commit_msg>Add solution for problem 30<commit_after> | #!/usr/bin/python
power_sum = 0
# Upper limit is a 6 digits number
for i in range(2, (9 ** 5) * 6):
# I'm loving Python sugar
if sum(int(j) ** 5 for j in str(i)) == i:
# If you want to see the numbers
# print(i)
power_sum += i
print(power_sum)
| Add solution for problem 30#!/usr/bin/python
power_sum = 0
# Upper limit is a 6 digits number
for i in range(2, (9 ** 5) * 6):
# I'm loving Python sugar
if sum(int(j) ** 5 for j in str(i)) == i:
# If you want to see the numbers
# print(i)
power_sum += i
print(power_sum)
| <commit_before><commit_msg>Add solution for problem 30<commit_after>#!/usr/bin/python
power_sum = 0
# Upper limit is a 6 digits number
for i in range(2, (9 ** 5) * 6):
# I'm loving Python sugar
if sum(int(j) ** 5 for j in str(i)) == i:
# If you want to see the numbers
# print(i)
power_s... | |
f5253c7f458a5ce4390b5e967f45bd2f0b9a1de2 | dosagelib/__init__.py | dosagelib/__init__.py | # -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2019 Tobias Gruetzmacher
"""
Automated comic downloader. Dosage traverses comic websites in
order to download each strip of the comic. The intended use is for
mirrori... | # -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2019 Tobias Gruetzmacher
"""
Automated comic downloader. Dosage traverses comic websites in
order to download each strip of the comic. The intended use is for
mirrori... | Return a fallback "version" if dosage is not installed | Return a fallback "version" if dosage is not installed
Additionally, inform the user on how to fix the problem. Thanks to twb
for noticing this.
| Python | mit | webcomics/dosage,peterjanes/dosage,peterjanes/dosage,webcomics/dosage | # -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2019 Tobias Gruetzmacher
"""
Automated comic downloader. Dosage traverses comic websites in
order to download each strip of the comic. The intended use is for
mirrori... | # -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2019 Tobias Gruetzmacher
"""
Automated comic downloader. Dosage traverses comic websites in
order to download each strip of the comic. The intended use is for
mirrori... | <commit_before># -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2019 Tobias Gruetzmacher
"""
Automated comic downloader. Dosage traverses comic websites in
order to download each strip of the comic. The intended use... | # -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2019 Tobias Gruetzmacher
"""
Automated comic downloader. Dosage traverses comic websites in
order to download each strip of the comic. The intended use is for
mirrori... | # -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2019 Tobias Gruetzmacher
"""
Automated comic downloader. Dosage traverses comic websites in
order to download each strip of the comic. The intended use is for
mirrori... | <commit_before># -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2019 Tobias Gruetzmacher
"""
Automated comic downloader. Dosage traverses comic websites in
order to download each strip of the comic. The intended use... |
aad797bd6ad195c45920f615b898793ce6655e37 | python/ember/examples/example_extinction.py | python/ember/examples/example_extinction.py | #!/usr/bin/python
"""
A steady flame is established at a starting strain rate far from exctinction.
Then the strain rate parameter (a) is systematically increased until a steady
flame can no longer be attained. The progression to extinction is summarized
in a plot of maximum temperature vs strain rate. Twin disc flame ... | Add extinction strain rate example | Add extinction strain rate example
| Python | mit | speth/ember,speth/ember,speth/ember | Add extinction strain rate example | #!/usr/bin/python
"""
A steady flame is established at a starting strain rate far from exctinction.
Then the strain rate parameter (a) is systematically increased until a steady
flame can no longer be attained. The progression to extinction is summarized
in a plot of maximum temperature vs strain rate. Twin disc flame ... | <commit_before><commit_msg>Add extinction strain rate example<commit_after> | #!/usr/bin/python
"""
A steady flame is established at a starting strain rate far from exctinction.
Then the strain rate parameter (a) is systematically increased until a steady
flame can no longer be attained. The progression to extinction is summarized
in a plot of maximum temperature vs strain rate. Twin disc flame ... | Add extinction strain rate example#!/usr/bin/python
"""
A steady flame is established at a starting strain rate far from exctinction.
Then the strain rate parameter (a) is systematically increased until a steady
flame can no longer be attained. The progression to extinction is summarized
in a plot of maximum temperatur... | <commit_before><commit_msg>Add extinction strain rate example<commit_after>#!/usr/bin/python
"""
A steady flame is established at a starting strain rate far from exctinction.
Then the strain rate parameter (a) is systematically increased until a steady
flame can no longer be attained. The progression to extinction is s... | |
33a758710fb2949475c735e3d92f85237219bf1d | tests/qctests/test_qc_anomaly_detection.py | tests/qctests/test_qc_anomaly_detection.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Check anomaly detection QC test
"""
import numpy as np
from cotede.utils.supportdata import download_testdata
from cotede.qc import fProfileQC
def test():
""" Only test if run. Must improve this.
"""
datafile = download_testdata("dPIRX010.cnv")
pqc =... | Test to apply anomaly detection Q.C. | Test to apply anomaly detection Q.C.
| Python | bsd-3-clause | castelao/CoTeDe | Test to apply anomaly detection Q.C. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Check anomaly detection QC test
"""
import numpy as np
from cotede.utils.supportdata import download_testdata
from cotede.qc import fProfileQC
def test():
""" Only test if run. Must improve this.
"""
datafile = download_testdata("dPIRX010.cnv")
pqc =... | <commit_before><commit_msg>Test to apply anomaly detection Q.C.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Check anomaly detection QC test
"""
import numpy as np
from cotede.utils.supportdata import download_testdata
from cotede.qc import fProfileQC
def test():
""" Only test if run. Must improve this.
"""
datafile = download_testdata("dPIRX010.cnv")
pqc =... | Test to apply anomaly detection Q.C.#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Check anomaly detection QC test
"""
import numpy as np
from cotede.utils.supportdata import download_testdata
from cotede.qc import fProfileQC
def test():
""" Only test if run. Must improve this.
"""
datafile = downloa... | <commit_before><commit_msg>Test to apply anomaly detection Q.C.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Check anomaly detection QC test
"""
import numpy as np
from cotede.utils.supportdata import download_testdata
from cotede.qc import fProfileQC
def test():
""" Only test if run. Must imp... | |
a2e0d92eeb7e07cbad06368ccce22cc5d360ae55 | examples/accel_i2c.py | examples/accel_i2c.py | # This is an example on how to access accelerometer on
# PyBoard directly using I2C bus. As such, it's more
# intended to be an I2C example, rather than accelerometer
# example. For the latter, using pyb.Accel class is
# much easier.
import pyb
import time
# Accelerometer needs to be powered on first. Even
# though s... | Add example of I2C usage, taking PyBoard accelerometer as subject. | examples: Add example of I2C usage, taking PyBoard accelerometer as subject.
| Python | mit | lowRISC/micropython,turbinenreiter/micropython,jmarcelino/pycom-micropython,drrk/micropython,mpalomer/micropython,puuu/micropython,puuu/micropython,dhylands/micropython,turbinenreiter/micropython,chrisdearman/micropython,AriZuu/micropython,deshipu/micropython,pfalcon/micropython,ChuckM/micropython,AriZuu/micropython,Ec... | examples: Add example of I2C usage, taking PyBoard accelerometer as subject. | # This is an example on how to access accelerometer on
# PyBoard directly using I2C bus. As such, it's more
# intended to be an I2C example, rather than accelerometer
# example. For the latter, using pyb.Accel class is
# much easier.
import pyb
import time
# Accelerometer needs to be powered on first. Even
# though s... | <commit_before><commit_msg>examples: Add example of I2C usage, taking PyBoard accelerometer as subject.<commit_after> | # This is an example on how to access accelerometer on
# PyBoard directly using I2C bus. As such, it's more
# intended to be an I2C example, rather than accelerometer
# example. For the latter, using pyb.Accel class is
# much easier.
import pyb
import time
# Accelerometer needs to be powered on first. Even
# though s... | examples: Add example of I2C usage, taking PyBoard accelerometer as subject.# This is an example on how to access accelerometer on
# PyBoard directly using I2C bus. As such, it's more
# intended to be an I2C example, rather than accelerometer
# example. For the latter, using pyb.Accel class is
# much easier.
import py... | <commit_before><commit_msg>examples: Add example of I2C usage, taking PyBoard accelerometer as subject.<commit_after># This is an example on how to access accelerometer on
# PyBoard directly using I2C bus. As such, it's more
# intended to be an I2C example, rather than accelerometer
# example. For the latter, using pyb... | |
045751341cb75819907f21eb6ce75791482b6875 | tests/test_mutate.py | tests/test_mutate.py | import unittest
from ooni.kit import daphn3
class TestDaphn3(unittest.TestCase):
def test_mutate_string(self):
original_string = '\x00\x00\x00'
mutated = daphn3.daphn3MutateString(original_string, 1)
self.assertEqual(mutated, '\x00\x01\x00')
def test_mutate_daphn3(self):
origina... | Add unittest for daphn3 mutator. | Add unittest for daphn3 mutator.
| Python | bsd-2-clause | Karthikeyan-kkk/ooni-probe,Karthikeyan-kkk/ooni-probe,kdmurray91/ooni-probe,0xPoly/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,0xPoly/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,kdmurray91/ooni-probe,lordappsec/ooni-probe,kdmurray91/ooni-probe,juga0/ooni-probe,juga0/ooni-probe,juga0/ooni-probe,lordappsec/... | Add unittest for daphn3 mutator. | import unittest
from ooni.kit import daphn3
class TestDaphn3(unittest.TestCase):
def test_mutate_string(self):
original_string = '\x00\x00\x00'
mutated = daphn3.daphn3MutateString(original_string, 1)
self.assertEqual(mutated, '\x00\x01\x00')
def test_mutate_daphn3(self):
origina... | <commit_before><commit_msg>Add unittest for daphn3 mutator.<commit_after> | import unittest
from ooni.kit import daphn3
class TestDaphn3(unittest.TestCase):
def test_mutate_string(self):
original_string = '\x00\x00\x00'
mutated = daphn3.daphn3MutateString(original_string, 1)
self.assertEqual(mutated, '\x00\x01\x00')
def test_mutate_daphn3(self):
origina... | Add unittest for daphn3 mutator.import unittest
from ooni.kit import daphn3
class TestDaphn3(unittest.TestCase):
def test_mutate_string(self):
original_string = '\x00\x00\x00'
mutated = daphn3.daphn3MutateString(original_string, 1)
self.assertEqual(mutated, '\x00\x01\x00')
def test_muta... | <commit_before><commit_msg>Add unittest for daphn3 mutator.<commit_after>import unittest
from ooni.kit import daphn3
class TestDaphn3(unittest.TestCase):
def test_mutate_string(self):
original_string = '\x00\x00\x00'
mutated = daphn3.daphn3MutateString(original_string, 1)
self.assertEqual(m... | |
c2a9c270643c0f4f0dc84979681b45f3721d5cae | test/functional/rpc_part_signmessage.py | test/functional/rpc_part_signmessage.py | #!/usr/bin/env python3
# Copyright (c) 2016-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC commands for signing and verifying messages."""
from test_framework.test_particl import Parti... | Add test for 256bit address signing and verification | Add test for 256bit address signing and verification
| Python | mit | tecnovert/particl-core,tecnovert/particl-core,tecnovert/particl-core,particl/particl-core,particl/particl-core,particl/particl-core,particl/particl-core,particl/particl-core,tecnovert/particl-core,tecnovert/particl-core,tecnovert/particl-core,particl/particl-core | Add test for 256bit address signing and verification | #!/usr/bin/env python3
# Copyright (c) 2016-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC commands for signing and verifying messages."""
from test_framework.test_particl import Parti... | <commit_before><commit_msg>Add test for 256bit address signing and verification<commit_after> | #!/usr/bin/env python3
# Copyright (c) 2016-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC commands for signing and verifying messages."""
from test_framework.test_particl import Parti... | Add test for 256bit address signing and verification#!/usr/bin/env python3
# Copyright (c) 2016-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC commands for signing and verifying message... | <commit_before><commit_msg>Add test for 256bit address signing and verification<commit_after>#!/usr/bin/env python3
# Copyright (c) 2016-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC c... | |
0a914b87f143782d5c927740acc9de251ec7a2fc | specter/tests/__main__.py | specter/tests/__main__.py | import unittest
# Import test modules.
from .test_events import *
from .test_forms import *
from .test_frames import *
from .test_navigation import *
from .test_open import *
from .test_qtmessage import *
from .test_redirection import *
from .test_registry import *
from .test_selectors import *
from .test_signals impo... | Make tests trivially runnable without py.test | Make tests trivially runnable without py.test
| Python | mit | andrew-d/Specter.py,andrew-d/Specter.py,andrew-d/Specter.py | Make tests trivially runnable without py.test | import unittest
# Import test modules.
from .test_events import *
from .test_forms import *
from .test_frames import *
from .test_navigation import *
from .test_open import *
from .test_qtmessage import *
from .test_redirection import *
from .test_registry import *
from .test_selectors import *
from .test_signals impo... | <commit_before><commit_msg>Make tests trivially runnable without py.test<commit_after> | import unittest
# Import test modules.
from .test_events import *
from .test_forms import *
from .test_frames import *
from .test_navigation import *
from .test_open import *
from .test_qtmessage import *
from .test_redirection import *
from .test_registry import *
from .test_selectors import *
from .test_signals impo... | Make tests trivially runnable without py.testimport unittest
# Import test modules.
from .test_events import *
from .test_forms import *
from .test_frames import *
from .test_navigation import *
from .test_open import *
from .test_qtmessage import *
from .test_redirection import *
from .test_registry import *
from .te... | <commit_before><commit_msg>Make tests trivially runnable without py.test<commit_after>import unittest
# Import test modules.
from .test_events import *
from .test_forms import *
from .test_frames import *
from .test_navigation import *
from .test_open import *
from .test_qtmessage import *
from .test_redirection impor... | |
3e75a66e7f90e04a7d2c53bc619ecebd706f7ca2 | st2common/tests/unit/test_db_pack.py | st2common/tests/unit/test_db_pack.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the 'License'); you may not use th... | Add unit tests for pack db models | Add unit tests for pack db models
| Python | apache-2.0 | Plexxi/st2,nzlosh/st2,Plexxi/st2,Plexxi/st2,nzlosh/st2,StackStorm/st2,StackStorm/st2,nzlosh/st2,StackStorm/st2,StackStorm/st2,nzlosh/st2,Plexxi/st2 | Add unit tests for pack db models | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the 'License'); you may not use th... | <commit_before><commit_msg>Add unit tests for pack db models<commit_after> | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the 'License'); you may not use th... | Add unit tests for pack db models# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (t... | <commit_before><commit_msg>Add unit tests for pack db models<commit_after># Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You u... | |
c3ae360e506e9cb411db830d7faf1bdb0288c0a4 | arim/models.py | arim/models.py | from django.db import models
class Autoreg(models.Model):
class Meta:
db_table = 'autoreg'
mac = models.CharField(max_length=17, db_index=True)
ip = models.IntegerField(primary_key=True)
date = models.IntegerField()
| Add model for 'autoreg' table | Add model for 'autoreg' table
| Python | bsd-3-clause | drkitty/arim,drkitty/arim,OSU-Net/arim,drkitty/arim,OSU-Net/arim,OSU-Net/arim | Add model for 'autoreg' table | from django.db import models
class Autoreg(models.Model):
class Meta:
db_table = 'autoreg'
mac = models.CharField(max_length=17, db_index=True)
ip = models.IntegerField(primary_key=True)
date = models.IntegerField()
| <commit_before><commit_msg>Add model for 'autoreg' table<commit_after> | from django.db import models
class Autoreg(models.Model):
class Meta:
db_table = 'autoreg'
mac = models.CharField(max_length=17, db_index=True)
ip = models.IntegerField(primary_key=True)
date = models.IntegerField()
| Add model for 'autoreg' tablefrom django.db import models
class Autoreg(models.Model):
class Meta:
db_table = 'autoreg'
mac = models.CharField(max_length=17, db_index=True)
ip = models.IntegerField(primary_key=True)
date = models.IntegerField()
| <commit_before><commit_msg>Add model for 'autoreg' table<commit_after>from django.db import models
class Autoreg(models.Model):
class Meta:
db_table = 'autoreg'
mac = models.CharField(max_length=17, db_index=True)
ip = models.IntegerField(primary_key=True)
date = models.IntegerField()
| |
a3d13b11d148738c6203c986461832d9d154577c | scripts/tne_campaign_ranking.py | scripts/tne_campaign_ranking.py | from datetime import date
import xlsxwriter
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.funding.models import Funding, Donor
from bluebottle.geo.models import Location
OFFICE_NAME = 'Segou'
TARGET = 328000
DEADLINE = date(2022, 8, 13)
def run(*args)... | Add script to rank tne activities on when they reached a specific target | Add script to rank tne activities on when they reached a specific target
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | Add script to rank tne activities on when they reached a specific target | from datetime import date
import xlsxwriter
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.funding.models import Funding, Donor
from bluebottle.geo.models import Location
OFFICE_NAME = 'Segou'
TARGET = 328000
DEADLINE = date(2022, 8, 13)
def run(*args)... | <commit_before><commit_msg>Add script to rank tne activities on when they reached a specific target<commit_after> | from datetime import date
import xlsxwriter
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.funding.models import Funding, Donor
from bluebottle.geo.models import Location
OFFICE_NAME = 'Segou'
TARGET = 328000
DEADLINE = date(2022, 8, 13)
def run(*args)... | Add script to rank tne activities on when they reached a specific targetfrom datetime import date
import xlsxwriter
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.funding.models import Funding, Donor
from bluebottle.geo.models import Location
OFFICE_NAM... | <commit_before><commit_msg>Add script to rank tne activities on when they reached a specific target<commit_after>from datetime import date
import xlsxwriter
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.funding.models import Funding, Donor
from bluebottl... | |
87ad66ec3a44cbe1256b05881a7e0e04b1b030ea | 17B-162/HI/imaging/HI_convolve_to_14B.py | 17B-162/HI/imaging/HI_convolve_to_14B.py |
'''
For comparison, smooth and regrid to the 14B data.
'''
import os
from cube_analysis.reprojection import reproject_cube
from paths import (data_path, fourteenB_wGBT_HI_file_dict,
seventeenB_02kms_wGBT_HI_file_dict,
seventeenB_HI_data_02kms_wGBT_path)
out_folder = seventeen... | Make a B+C config HI cube matched to the C-only | Make a B+C config HI cube matched to the C-only
| Python | mit | e-koch/VLA_Lband,e-koch/VLA_Lband | Make a B+C config HI cube matched to the C-only |
'''
For comparison, smooth and regrid to the 14B data.
'''
import os
from cube_analysis.reprojection import reproject_cube
from paths import (data_path, fourteenB_wGBT_HI_file_dict,
seventeenB_02kms_wGBT_HI_file_dict,
seventeenB_HI_data_02kms_wGBT_path)
out_folder = seventeen... | <commit_before><commit_msg>Make a B+C config HI cube matched to the C-only<commit_after> |
'''
For comparison, smooth and regrid to the 14B data.
'''
import os
from cube_analysis.reprojection import reproject_cube
from paths import (data_path, fourteenB_wGBT_HI_file_dict,
seventeenB_02kms_wGBT_HI_file_dict,
seventeenB_HI_data_02kms_wGBT_path)
out_folder = seventeen... | Make a B+C config HI cube matched to the C-only
'''
For comparison, smooth and regrid to the 14B data.
'''
import os
from cube_analysis.reprojection import reproject_cube
from paths import (data_path, fourteenB_wGBT_HI_file_dict,
seventeenB_02kms_wGBT_HI_file_dict,
seventeenB_HI... | <commit_before><commit_msg>Make a B+C config HI cube matched to the C-only<commit_after>
'''
For comparison, smooth and regrid to the 14B data.
'''
import os
from cube_analysis.reprojection import reproject_cube
from paths import (data_path, fourteenB_wGBT_HI_file_dict,
seventeenB_02kms_wGBT_HI_fi... | |
ab4d6ee78e6702b80947a88f925857a2134886ee | convertv2v1.py | convertv2v1.py | #!/usr/bin/env python3
import json
import argparse
import os
import sys
parser = argparse.ArgumentParser()
parser.add_argument('-o', '--oldnodes', action='store',
help='v2 nodes file you want to convert',required=True)
parser.add_argume... | Add script to convert nodes.json version 2 to version 1 | Add script to convert nodes.json version 2 to version 1
| Python | bsd-3-clause | freifunk-mwu/ffmap-backend,freifunk-mwu/ffmap-backend | Add script to convert nodes.json version 2 to version 1 | #!/usr/bin/env python3
import json
import argparse
import os
import sys
parser = argparse.ArgumentParser()
parser.add_argument('-o', '--oldnodes', action='store',
help='v2 nodes file you want to convert',required=True)
parser.add_argume... | <commit_before><commit_msg>Add script to convert nodes.json version 2 to version 1<commit_after> | #!/usr/bin/env python3
import json
import argparse
import os
import sys
parser = argparse.ArgumentParser()
parser.add_argument('-o', '--oldnodes', action='store',
help='v2 nodes file you want to convert',required=True)
parser.add_argume... | Add script to convert nodes.json version 2 to version 1#!/usr/bin/env python3
import json
import argparse
import os
import sys
parser = argparse.ArgumentParser()
parser.add_argument('-o', '--oldnodes', action='store',
help='v2 nodes file... | <commit_before><commit_msg>Add script to convert nodes.json version 2 to version 1<commit_after>#!/usr/bin/env python3
import json
import argparse
import os
import sys
parser = argparse.ArgumentParser()
parser.add_argument('-o', '--oldnodes', action='stor... | |
d5315907c25a42b6275b43b49f6e24ae72308c5b | utils/image_to_calc.py | utils/image_to_calc.py | #!/usr/bin/env python
import sys, os
import serial
from PIL import Image
if not len(sys.argv) == 2:
print sys.argv[0], "/path/to/image"
sys.exit(1)
filepath = sys.argv[1]
im = Image.open(filepath)
rgb_im = im.convert('RGB')
width, height = im.size
if not width == 96 or not height == 64:
print "Image wr... | Send images to calculator over serial. | Send images to calculator over serial.
| Python | mit | jmptable/deshellator,jmptable/deshellator,jmptable/deshellator,jmptable/deshellator,jmptable/deshellator | Send images to calculator over serial. | #!/usr/bin/env python
import sys, os
import serial
from PIL import Image
if not len(sys.argv) == 2:
print sys.argv[0], "/path/to/image"
sys.exit(1)
filepath = sys.argv[1]
im = Image.open(filepath)
rgb_im = im.convert('RGB')
width, height = im.size
if not width == 96 or not height == 64:
print "Image wr... | <commit_before><commit_msg>Send images to calculator over serial.<commit_after> | #!/usr/bin/env python
import sys, os
import serial
from PIL import Image
if not len(sys.argv) == 2:
print sys.argv[0], "/path/to/image"
sys.exit(1)
filepath = sys.argv[1]
im = Image.open(filepath)
rgb_im = im.convert('RGB')
width, height = im.size
if not width == 96 or not height == 64:
print "Image wr... | Send images to calculator over serial.#!/usr/bin/env python
import sys, os
import serial
from PIL import Image
if not len(sys.argv) == 2:
print sys.argv[0], "/path/to/image"
sys.exit(1)
filepath = sys.argv[1]
im = Image.open(filepath)
rgb_im = im.convert('RGB')
width, height = im.size
if not width == 96 or... | <commit_before><commit_msg>Send images to calculator over serial.<commit_after>#!/usr/bin/env python
import sys, os
import serial
from PIL import Image
if not len(sys.argv) == 2:
print sys.argv[0], "/path/to/image"
sys.exit(1)
filepath = sys.argv[1]
im = Image.open(filepath)
rgb_im = im.convert('RGB')
width... | |
a37d2784ef0081fc744fe49b096f0667a4eee2d0 | tests/test_listings.py | tests/test_listings.py | # -*- coding: utf-8 -*-
import pytest
import iso3166
def test_country_list():
country_list = iso3166.countries
assert len(country_list) > 100
assert all(isinstance(c, iso3166.Country) for c in country_list)
def test_by_name():
table = iso3166.countries_by_name
assert len(table) >= len(iso3166.c... | Add tests for the fields updated in ee3cd62 | Add tests for the fields updated in ee3cd62
| Python | mit | deactivated/python-iso3166 | Add tests for the fields updated in ee3cd62 | # -*- coding: utf-8 -*-
import pytest
import iso3166
def test_country_list():
country_list = iso3166.countries
assert len(country_list) > 100
assert all(isinstance(c, iso3166.Country) for c in country_list)
def test_by_name():
table = iso3166.countries_by_name
assert len(table) >= len(iso3166.c... | <commit_before><commit_msg>Add tests for the fields updated in ee3cd62<commit_after> | # -*- coding: utf-8 -*-
import pytest
import iso3166
def test_country_list():
country_list = iso3166.countries
assert len(country_list) > 100
assert all(isinstance(c, iso3166.Country) for c in country_list)
def test_by_name():
table = iso3166.countries_by_name
assert len(table) >= len(iso3166.c... | Add tests for the fields updated in ee3cd62# -*- coding: utf-8 -*-
import pytest
import iso3166
def test_country_list():
country_list = iso3166.countries
assert len(country_list) > 100
assert all(isinstance(c, iso3166.Country) for c in country_list)
def test_by_name():
table = iso3166.countries_by_... | <commit_before><commit_msg>Add tests for the fields updated in ee3cd62<commit_after># -*- coding: utf-8 -*-
import pytest
import iso3166
def test_country_list():
country_list = iso3166.countries
assert len(country_list) > 100
assert all(isinstance(c, iso3166.Country) for c in country_list)
def test_by_... | |
876a2934086f05514a66f97fbebed2e0bd62c7f6 | examples/gi_example.py | examples/gi_example.py | # Copyright 2012 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
from ctypes import byref, POINTER, cast
import sys
sys.path.insert(0, '..')
from pgi.gitypes impor... | Add back the old gir example | Add back the old gir example
| Python | lgpl-2.1 | lazka/pgi,lazka/pgi | Add back the old gir example | # Copyright 2012 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
from ctypes import byref, POINTER, cast
import sys
sys.path.insert(0, '..')
from pgi.gitypes impor... | <commit_before><commit_msg>Add back the old gir example<commit_after> | # Copyright 2012 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
from ctypes import byref, POINTER, cast
import sys
sys.path.insert(0, '..')
from pgi.gitypes impor... | Add back the old gir example# Copyright 2012 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
from ctypes import byref, POINTER, cast
import sys
sys.path.insert(0, '... | <commit_before><commit_msg>Add back the old gir example<commit_after># Copyright 2012 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
from ctypes import byref, POIN... | |
0842aeca5372b3c4c14ad3719f0d53f29671a283 | museum_site/migrations/0050_remove_article_preview.py | museum_site/migrations/0050_remove_article_preview.py | # Generated by Django 3.1.7 on 2021-04-27 18:26
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0049_auto_20210324_1957'),
]
operations = [
migrations.RemoveField(
model_name='article',
name='preview',
... | Remove preview field from DB | Remove preview field from DB
| Python | mit | DrDos0016/z2,DrDos0016/z2,DrDos0016/z2 | Remove preview field from DB | # Generated by Django 3.1.7 on 2021-04-27 18:26
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0049_auto_20210324_1957'),
]
operations = [
migrations.RemoveField(
model_name='article',
name='preview',
... | <commit_before><commit_msg>Remove preview field from DB<commit_after> | # Generated by Django 3.1.7 on 2021-04-27 18:26
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0049_auto_20210324_1957'),
]
operations = [
migrations.RemoveField(
model_name='article',
name='preview',
... | Remove preview field from DB# Generated by Django 3.1.7 on 2021-04-27 18:26
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0049_auto_20210324_1957'),
]
operations = [
migrations.RemoveField(
model_name='article',
... | <commit_before><commit_msg>Remove preview field from DB<commit_after># Generated by Django 3.1.7 on 2021-04-27 18:26
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0049_auto_20210324_1957'),
]
operations = [
migrations.RemoveFie... | |
a0987218331fa7abe11a69226f54545c6198596a | test/workers/test_plan.py | test/workers/test_plan.py | import random
import syft as sy
import torch
import torch as th
import torch.nn as nn
import torch.nn.functional as F
def test_plan_remote_function(hook):
plan_worker = sy.Plan(hook, id=str(int(10e10 * random.random())))
x = torch.tensor([1, -1, 3, 4])
x_ptr = x.send(plan_worker)
res_ptr = F.relu(x... | Add some tests on Plan Worker | Add some tests on Plan Worker
| Python | apache-2.0 | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | Add some tests on Plan Worker | import random
import syft as sy
import torch
import torch as th
import torch.nn as nn
import torch.nn.functional as F
def test_plan_remote_function(hook):
plan_worker = sy.Plan(hook, id=str(int(10e10 * random.random())))
x = torch.tensor([1, -1, 3, 4])
x_ptr = x.send(plan_worker)
res_ptr = F.relu(x... | <commit_before><commit_msg>Add some tests on Plan Worker<commit_after> | import random
import syft as sy
import torch
import torch as th
import torch.nn as nn
import torch.nn.functional as F
def test_plan_remote_function(hook):
plan_worker = sy.Plan(hook, id=str(int(10e10 * random.random())))
x = torch.tensor([1, -1, 3, 4])
x_ptr = x.send(plan_worker)
res_ptr = F.relu(x... | Add some tests on Plan Workerimport random
import syft as sy
import torch
import torch as th
import torch.nn as nn
import torch.nn.functional as F
def test_plan_remote_function(hook):
plan_worker = sy.Plan(hook, id=str(int(10e10 * random.random())))
x = torch.tensor([1, -1, 3, 4])
x_ptr = x.send(plan_w... | <commit_before><commit_msg>Add some tests on Plan Worker<commit_after>import random
import syft as sy
import torch
import torch as th
import torch.nn as nn
import torch.nn.functional as F
def test_plan_remote_function(hook):
plan_worker = sy.Plan(hook, id=str(int(10e10 * random.random())))
x = torch.tensor... | |
41609c100fb23821f64457774d8bc7fc9e578225 | tests/test_computer.py | tests/test_computer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from os import path
import mock
import pytest
from wonderful_bing.wonderful_bing import Computer
@pytest.fixture
def computer():
computer = Computer()
return computer
def test_computer(computer):
gnome_based = ("DIS... | Add test fro Computer class | Add test fro Computer class
| Python | mit | lord63/wonderful_bing | Add test fro Computer class | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from os import path
import mock
import pytest
from wonderful_bing.wonderful_bing import Computer
@pytest.fixture
def computer():
computer = Computer()
return computer
def test_computer(computer):
gnome_based = ("DIS... | <commit_before><commit_msg>Add test fro Computer class<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from os import path
import mock
import pytest
from wonderful_bing.wonderful_bing import Computer
@pytest.fixture
def computer():
computer = Computer()
return computer
def test_computer(computer):
gnome_based = ("DIS... | Add test fro Computer class#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from os import path
import mock
import pytest
from wonderful_bing.wonderful_bing import Computer
@pytest.fixture
def computer():
computer = Computer()
return computer
def test_computer(compute... | <commit_before><commit_msg>Add test fro Computer class<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from os import path
import mock
import pytest
from wonderful_bing.wonderful_bing import Computer
@pytest.fixture
def computer():
computer = Computer()
re... | |
ad5f8440a4907f669a94470423dd937aa606412a | filter_to_join_part.py | filter_to_join_part.py | #!/usr/bin/env python3
import io
import os
# Usage: run as `filter_to_join_part.py`
# Put inputs in the directory 'input_logs' with '.txt' extension
# Outputs will be created in 'output_logs', overwriting contents
# Edit important_text to find different entries in logs
important_text = ["has joined", "has left"]
def... | Add a simple, static log filtering utility | Add a simple, static log filtering utility
| Python | unlicense | thomasrussellmurphy/trm-snippets,thomasrussellmurphy/trm-snippets | Add a simple, static log filtering utility | #!/usr/bin/env python3
import io
import os
# Usage: run as `filter_to_join_part.py`
# Put inputs in the directory 'input_logs' with '.txt' extension
# Outputs will be created in 'output_logs', overwriting contents
# Edit important_text to find different entries in logs
important_text = ["has joined", "has left"]
def... | <commit_before><commit_msg>Add a simple, static log filtering utility<commit_after> | #!/usr/bin/env python3
import io
import os
# Usage: run as `filter_to_join_part.py`
# Put inputs in the directory 'input_logs' with '.txt' extension
# Outputs will be created in 'output_logs', overwriting contents
# Edit important_text to find different entries in logs
important_text = ["has joined", "has left"]
def... | Add a simple, static log filtering utility#!/usr/bin/env python3
import io
import os
# Usage: run as `filter_to_join_part.py`
# Put inputs in the directory 'input_logs' with '.txt' extension
# Outputs will be created in 'output_logs', overwriting contents
# Edit important_text to find different entries in logs
import... | <commit_before><commit_msg>Add a simple, static log filtering utility<commit_after>#!/usr/bin/env python3
import io
import os
# Usage: run as `filter_to_join_part.py`
# Put inputs in the directory 'input_logs' with '.txt' extension
# Outputs will be created in 'output_logs', overwriting contents
# Edit important_text... | |
46a2bcda270b76b62a7f125836fa0a374258ead4 | examples/translations/chinese_test_1.py | examples/translations/chinese_test_1.py | from seleniumbase.translate.chinese import 硒测试用例
class 测试类(硒测试用例):
def test_例子1(self):
self.开启网址("https://xkcd.in/comic?lg=cn&id=353")
self.断言标题("Python - XKCD中文站")
self.断言元素("#content div.comic-body")
self.断言文本("上漫画")
self.单击("div.nextLink")
self.断言文本("老妈的逆袭", "#c... | Add a Chinese language example test | Add a Chinese language example test
| Python | mit | mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase | Add a Chinese language example test | from seleniumbase.translate.chinese import 硒测试用例
class 测试类(硒测试用例):
def test_例子1(self):
self.开启网址("https://xkcd.in/comic?lg=cn&id=353")
self.断言标题("Python - XKCD中文站")
self.断言元素("#content div.comic-body")
self.断言文本("上漫画")
self.单击("div.nextLink")
self.断言文本("老妈的逆袭", "#c... | <commit_before><commit_msg>Add a Chinese language example test<commit_after> | from seleniumbase.translate.chinese import 硒测试用例
class 测试类(硒测试用例):
def test_例子1(self):
self.开启网址("https://xkcd.in/comic?lg=cn&id=353")
self.断言标题("Python - XKCD中文站")
self.断言元素("#content div.comic-body")
self.断言文本("上漫画")
self.单击("div.nextLink")
self.断言文本("老妈的逆袭", "#c... | Add a Chinese language example testfrom seleniumbase.translate.chinese import 硒测试用例
class 测试类(硒测试用例):
def test_例子1(self):
self.开启网址("https://xkcd.in/comic?lg=cn&id=353")
self.断言标题("Python - XKCD中文站")
self.断言元素("#content div.comic-body")
self.断言文本("上漫画")
self.单击("div.nextLi... | <commit_before><commit_msg>Add a Chinese language example test<commit_after>from seleniumbase.translate.chinese import 硒测试用例
class 测试类(硒测试用例):
def test_例子1(self):
self.开启网址("https://xkcd.in/comic?lg=cn&id=353")
self.断言标题("Python - XKCD中文站")
self.断言元素("#content div.comic-body")
sel... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.