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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
426f90ba500aa5d213a8b130e1841806e2dae388 | solver/operators.py | solver/operators.py | import random
import bisect
def select(population):
"""Roulette wheel selection.
Each individual is selected to reproduce, with probability directly
proportional to its fitness score.
:params population: Collection of the individuals for selecting.
Usage::
>>> from operators import sele... | Implement roulette wheel selection algorithm | Implement roulette wheel selection algorithm
| Python | mit | nemanja-m/gaps,nemanja-m/genetic-jigsaw-solver | Implement roulette wheel selection algorithm | import random
import bisect
def select(population):
"""Roulette wheel selection.
Each individual is selected to reproduce, with probability directly
proportional to its fitness score.
:params population: Collection of the individuals for selecting.
Usage::
>>> from operators import sele... | <commit_before><commit_msg>Implement roulette wheel selection algorithm<commit_after> | import random
import bisect
def select(population):
"""Roulette wheel selection.
Each individual is selected to reproduce, with probability directly
proportional to its fitness score.
:params population: Collection of the individuals for selecting.
Usage::
>>> from operators import sele... | Implement roulette wheel selection algorithmimport random
import bisect
def select(population):
"""Roulette wheel selection.
Each individual is selected to reproduce, with probability directly
proportional to its fitness score.
:params population: Collection of the individuals for selecting.
Usa... | <commit_before><commit_msg>Implement roulette wheel selection algorithm<commit_after>import random
import bisect
def select(population):
"""Roulette wheel selection.
Each individual is selected to reproduce, with probability directly
proportional to its fitness score.
:params population: Collection o... | |
31fe72931d29d81088f23c7609aa612d4735814b | python3-py/examples/new_features.py | python3-py/examples/new_features.py | def ls(self, msg, match):
"""
A sample function to test the parsing of ** resolution
"""
langs = list(map(lambda x: x.lower(), match.group(1).split()))
bears = client.list.bears.get().json()
bears = [{**{'name': bear}, **content}
for bear, content in bears.items()]
# Asyncio examp... | Add new sample files for Python3-py grammar | Add new sample files for Python3-py grammar
| Python | mit | antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4,antlr/grammars-v4 | Add new sample files for Python3-py grammar | def ls(self, msg, match):
"""
A sample function to test the parsing of ** resolution
"""
langs = list(map(lambda x: x.lower(), match.group(1).split()))
bears = client.list.bears.get().json()
bears = [{**{'name': bear}, **content}
for bear, content in bears.items()]
# Asyncio examp... | <commit_before><commit_msg>Add new sample files for Python3-py grammar<commit_after> | def ls(self, msg, match):
"""
A sample function to test the parsing of ** resolution
"""
langs = list(map(lambda x: x.lower(), match.group(1).split()))
bears = client.list.bears.get().json()
bears = [{**{'name': bear}, **content}
for bear, content in bears.items()]
# Asyncio examp... | Add new sample files for Python3-py grammardef ls(self, msg, match):
"""
A sample function to test the parsing of ** resolution
"""
langs = list(map(lambda x: x.lower(), match.group(1).split()))
bears = client.list.bears.get().json()
bears = [{**{'name': bear}, **content}
for bear,... | <commit_before><commit_msg>Add new sample files for Python3-py grammar<commit_after>def ls(self, msg, match):
"""
A sample function to test the parsing of ** resolution
"""
langs = list(map(lambda x: x.lower(), match.group(1).split()))
bears = client.list.bears.get().json()
bears = [{**{'name':... | |
fac97130396057802f1ebf21928667a971395ba9 | examples/ex_tabler.py | examples/ex_tabler.py | from tabler import Tabler
table = """<table>
<thead>
<tr>
<th>Number</th>
<th>First Name</th>
<th>Last Name</th>
<th>Phone Number</th>
</tr>
<tr>
<td>1</td>
<td>Bob</td>
<td>Evans</td>
<td>(847) 332-0461</td>
</tr>
<tr>
<td>2</td>
<td>Mary</td>
<td>Newell</td>
... | Add a basic example of the Tabler API. | Add a basic example of the Tabler API.
| Python | bsd-3-clause | bschmeck/tabler | Add a basic example of the Tabler API. | from tabler import Tabler
table = """<table>
<thead>
<tr>
<th>Number</th>
<th>First Name</th>
<th>Last Name</th>
<th>Phone Number</th>
</tr>
<tr>
<td>1</td>
<td>Bob</td>
<td>Evans</td>
<td>(847) 332-0461</td>
</tr>
<tr>
<td>2</td>
<td>Mary</td>
<td>Newell</td>
... | <commit_before><commit_msg>Add a basic example of the Tabler API.<commit_after> | from tabler import Tabler
table = """<table>
<thead>
<tr>
<th>Number</th>
<th>First Name</th>
<th>Last Name</th>
<th>Phone Number</th>
</tr>
<tr>
<td>1</td>
<td>Bob</td>
<td>Evans</td>
<td>(847) 332-0461</td>
</tr>
<tr>
<td>2</td>
<td>Mary</td>
<td>Newell</td>
... | Add a basic example of the Tabler API.from tabler import Tabler
table = """<table>
<thead>
<tr>
<th>Number</th>
<th>First Name</th>
<th>Last Name</th>
<th>Phone Number</th>
</tr>
<tr>
<td>1</td>
<td>Bob</td>
<td>Evans</td>
<td>(847) 332-0461</td>
</tr>
<tr>
<td>2</td>
... | <commit_before><commit_msg>Add a basic example of the Tabler API.<commit_after>from tabler import Tabler
table = """<table>
<thead>
<tr>
<th>Number</th>
<th>First Name</th>
<th>Last Name</th>
<th>Phone Number</th>
</tr>
<tr>
<td>1</td>
<td>Bob</td>
<td>Evans</td>
<td>(847) 332-046... | |
e279f8a046d2d9b985df2b01abe23dbe154da188 | cinspect/tests/test_version.py | cinspect/tests/test_version.py | from __future__ import absolute_import, print_function
# Standard library
import unittest
# Local library
from cinspect.index.serialize import _get_most_similar
class TestVersions(unittest.TestCase):
def test_most_similar(self):
# Given
names = ['index-2.7.3.json', 'index-3.4.json']
ver... | Add a simple test for version finder. | Add a simple test for version finder.
| Python | bsd-3-clause | punchagan/cinspect,punchagan/cinspect | Add a simple test for version finder. | from __future__ import absolute_import, print_function
# Standard library
import unittest
# Local library
from cinspect.index.serialize import _get_most_similar
class TestVersions(unittest.TestCase):
def test_most_similar(self):
# Given
names = ['index-2.7.3.json', 'index-3.4.json']
ver... | <commit_before><commit_msg>Add a simple test for version finder.<commit_after> | from __future__ import absolute_import, print_function
# Standard library
import unittest
# Local library
from cinspect.index.serialize import _get_most_similar
class TestVersions(unittest.TestCase):
def test_most_similar(self):
# Given
names = ['index-2.7.3.json', 'index-3.4.json']
ver... | Add a simple test for version finder.from __future__ import absolute_import, print_function
# Standard library
import unittest
# Local library
from cinspect.index.serialize import _get_most_similar
class TestVersions(unittest.TestCase):
def test_most_similar(self):
# Given
names = ['index-2.7.3... | <commit_before><commit_msg>Add a simple test for version finder.<commit_after>from __future__ import absolute_import, print_function
# Standard library
import unittest
# Local library
from cinspect.index.serialize import _get_most_similar
class TestVersions(unittest.TestCase):
def test_most_similar(self):
... | |
fcbfaded67747984899dbbabb2cdcdefe00002df | examples/download1.py | examples/download1.py | import subprocess
from simpleflow.download import with_binaries
@with_binaries({
"how-is-simpleflow": "s3://botify-labs-simpleflow/binaries/latest/how_is_simpleflow",
})
def a_task():
print "command: which how-is-simpleflow"
print subprocess.check_output(["which", "how-is-simpleflow"])
print "comman... | Add example script for 'simpleflow.download.with_binaries' decorator | Add example script for 'simpleflow.download.with_binaries' decorator
| Python | mit | botify-labs/simpleflow,botify-labs/simpleflow | Add example script for 'simpleflow.download.with_binaries' decorator | import subprocess
from simpleflow.download import with_binaries
@with_binaries({
"how-is-simpleflow": "s3://botify-labs-simpleflow/binaries/latest/how_is_simpleflow",
})
def a_task():
print "command: which how-is-simpleflow"
print subprocess.check_output(["which", "how-is-simpleflow"])
print "comman... | <commit_before><commit_msg>Add example script for 'simpleflow.download.with_binaries' decorator<commit_after> | import subprocess
from simpleflow.download import with_binaries
@with_binaries({
"how-is-simpleflow": "s3://botify-labs-simpleflow/binaries/latest/how_is_simpleflow",
})
def a_task():
print "command: which how-is-simpleflow"
print subprocess.check_output(["which", "how-is-simpleflow"])
print "comman... | Add example script for 'simpleflow.download.with_binaries' decoratorimport subprocess
from simpleflow.download import with_binaries
@with_binaries({
"how-is-simpleflow": "s3://botify-labs-simpleflow/binaries/latest/how_is_simpleflow",
})
def a_task():
print "command: which how-is-simpleflow"
print subpro... | <commit_before><commit_msg>Add example script for 'simpleflow.download.with_binaries' decorator<commit_after>import subprocess
from simpleflow.download import with_binaries
@with_binaries({
"how-is-simpleflow": "s3://botify-labs-simpleflow/binaries/latest/how_is_simpleflow",
})
def a_task():
print "command: ... | |
639143e3145682d776251f39f0a791f0c77e5169 | apps/domain/tests/test_routes/test_association_requests.py | apps/domain/tests/test_routes/test_association_requests.py |
def test_send_association_request(client):
result = client.post("/association-requests/request", data={"id": "54623156", "address": "159.15.223.162"})
assert result.status_code == 200
assert result.get_json() == {"msg": "Association request sent!"}
def test_receive_association_request(client):
result ... | ADD Domain association_requests unit tests | ADD Domain association_requests unit tests
| Python | apache-2.0 | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | ADD Domain association_requests unit tests |
def test_send_association_request(client):
result = client.post("/association-requests/request", data={"id": "54623156", "address": "159.15.223.162"})
assert result.status_code == 200
assert result.get_json() == {"msg": "Association request sent!"}
def test_receive_association_request(client):
result ... | <commit_before><commit_msg>ADD Domain association_requests unit tests<commit_after> |
def test_send_association_request(client):
result = client.post("/association-requests/request", data={"id": "54623156", "address": "159.15.223.162"})
assert result.status_code == 200
assert result.get_json() == {"msg": "Association request sent!"}
def test_receive_association_request(client):
result ... | ADD Domain association_requests unit tests
def test_send_association_request(client):
result = client.post("/association-requests/request", data={"id": "54623156", "address": "159.15.223.162"})
assert result.status_code == 200
assert result.get_json() == {"msg": "Association request sent!"}
def test_receiv... | <commit_before><commit_msg>ADD Domain association_requests unit tests<commit_after>
def test_send_association_request(client):
result = client.post("/association-requests/request", data={"id": "54623156", "address": "159.15.223.162"})
assert result.status_code == 200
assert result.get_json() == {"msg": "Ass... | |
1d7d86ba12fd00d388b939206abf305a6db569db | reid/train_siamese.py | reid/train_siamese.py | from __future__ import print_function
import time
from torch.autograd import Variable
from .evaluation import accuracy
from .utils.meters import AverageMeter
class Trainer(object):
def __init__(self, model, criterion, args):
super(Trainer, self).__init__()
self.model = model
self.criteri... | Add trainer for siamese models | Add trainer for siamese models
| Python | mit | Flowerfan524/TriClustering,Flowerfan524/TriClustering,zydou/open-reid,Cysu/open-reid | Add trainer for siamese models | from __future__ import print_function
import time
from torch.autograd import Variable
from .evaluation import accuracy
from .utils.meters import AverageMeter
class Trainer(object):
def __init__(self, model, criterion, args):
super(Trainer, self).__init__()
self.model = model
self.criteri... | <commit_before><commit_msg>Add trainer for siamese models<commit_after> | from __future__ import print_function
import time
from torch.autograd import Variable
from .evaluation import accuracy
from .utils.meters import AverageMeter
class Trainer(object):
def __init__(self, model, criterion, args):
super(Trainer, self).__init__()
self.model = model
self.criteri... | Add trainer for siamese modelsfrom __future__ import print_function
import time
from torch.autograd import Variable
from .evaluation import accuracy
from .utils.meters import AverageMeter
class Trainer(object):
def __init__(self, model, criterion, args):
super(Trainer, self).__init__()
self.mode... | <commit_before><commit_msg>Add trainer for siamese models<commit_after>from __future__ import print_function
import time
from torch.autograd import Variable
from .evaluation import accuracy
from .utils.meters import AverageMeter
class Trainer(object):
def __init__(self, model, criterion, args):
super(Tr... | |
528afdc0f00b958f6920bd6e66c3bac841b3a8b8 | server/kcaa/kcsapi/mission_test.py | server/kcaa/kcsapi/mission_test.py | #!/usr/bin/env python
import pytest
import mission
class TestMissionList(object):
def pytest_funcarg__mission_list(self):
mission_list = mission.MissionList()
mission_list.missions.extend([
mission.Mission(
id=1,
name=u'Mission1',
mapa... | Add a test for mission. | Add a test for mission.
| Python | apache-2.0 | kcaa/kcaa,kcaa/kcaa,kcaa/kcaa,kcaa/kcaa | Add a test for mission. | #!/usr/bin/env python
import pytest
import mission
class TestMissionList(object):
def pytest_funcarg__mission_list(self):
mission_list = mission.MissionList()
mission_list.missions.extend([
mission.Mission(
id=1,
name=u'Mission1',
mapa... | <commit_before><commit_msg>Add a test for mission.<commit_after> | #!/usr/bin/env python
import pytest
import mission
class TestMissionList(object):
def pytest_funcarg__mission_list(self):
mission_list = mission.MissionList()
mission_list.missions.extend([
mission.Mission(
id=1,
name=u'Mission1',
mapa... | Add a test for mission.#!/usr/bin/env python
import pytest
import mission
class TestMissionList(object):
def pytest_funcarg__mission_list(self):
mission_list = mission.MissionList()
mission_list.missions.extend([
mission.Mission(
id=1,
name=u'Mission1... | <commit_before><commit_msg>Add a test for mission.<commit_after>#!/usr/bin/env python
import pytest
import mission
class TestMissionList(object):
def pytest_funcarg__mission_list(self):
mission_list = mission.MissionList()
mission_list.missions.extend([
mission.Mission(
... | |
38e294e7d8e8053ac604fdbcdcaeed59fecae1e9 | tests/test_ewf.py | tests/test_ewf.py | from os import path
from digestive.ewf import EWFSource, format_supported, list_ewf_files
here = path.dirname(path.abspath(__file__))
def test_format_supported():
supported = ['file.S01', 'file.E01', 'file.e01', 'file.L01', 'file.Ex01', 'file.Lx01', 'file.tar.E01']
not_supported = ['file.dd', 'file.raw', '... | Test libewf-less calls in ewf module | Test libewf-less calls in ewf module
| Python | isc | akaIDIOT/Digestive | Test libewf-less calls in ewf module | from os import path
from digestive.ewf import EWFSource, format_supported, list_ewf_files
here = path.dirname(path.abspath(__file__))
def test_format_supported():
supported = ['file.S01', 'file.E01', 'file.e01', 'file.L01', 'file.Ex01', 'file.Lx01', 'file.tar.E01']
not_supported = ['file.dd', 'file.raw', '... | <commit_before><commit_msg>Test libewf-less calls in ewf module<commit_after> | from os import path
from digestive.ewf import EWFSource, format_supported, list_ewf_files
here = path.dirname(path.abspath(__file__))
def test_format_supported():
supported = ['file.S01', 'file.E01', 'file.e01', 'file.L01', 'file.Ex01', 'file.Lx01', 'file.tar.E01']
not_supported = ['file.dd', 'file.raw', '... | Test libewf-less calls in ewf modulefrom os import path
from digestive.ewf import EWFSource, format_supported, list_ewf_files
here = path.dirname(path.abspath(__file__))
def test_format_supported():
supported = ['file.S01', 'file.E01', 'file.e01', 'file.L01', 'file.Ex01', 'file.Lx01', 'file.tar.E01']
not_s... | <commit_before><commit_msg>Test libewf-less calls in ewf module<commit_after>from os import path
from digestive.ewf import EWFSource, format_supported, list_ewf_files
here = path.dirname(path.abspath(__file__))
def test_format_supported():
supported = ['file.S01', 'file.E01', 'file.e01', 'file.L01', 'file.Ex01... | |
fbc375a51aca560554f3dd28fa212d6d877449f2 | source/tests/core/test_observer.py | source/tests/core/test_observer.py | from copy import copy
from pytest import fixture
from vistas.core.observers.interface import *
@fixture(scope='session')
def observer():
class TestObserver(Observer):
def __init__(self):
self.x = 5
def update(self, observable):
self.x **= 2
obs = TestObserver()
yi... | Add tests for observers and observable. | Add tests for observers and observable.
| Python | bsd-3-clause | VISTAS-IVES/pyvistas | Add tests for observers and observable. | from copy import copy
from pytest import fixture
from vistas.core.observers.interface import *
@fixture(scope='session')
def observer():
class TestObserver(Observer):
def __init__(self):
self.x = 5
def update(self, observable):
self.x **= 2
obs = TestObserver()
yi... | <commit_before><commit_msg>Add tests for observers and observable.<commit_after> | from copy import copy
from pytest import fixture
from vistas.core.observers.interface import *
@fixture(scope='session')
def observer():
class TestObserver(Observer):
def __init__(self):
self.x = 5
def update(self, observable):
self.x **= 2
obs = TestObserver()
yi... | Add tests for observers and observable.from copy import copy
from pytest import fixture
from vistas.core.observers.interface import *
@fixture(scope='session')
def observer():
class TestObserver(Observer):
def __init__(self):
self.x = 5
def update(self, observable):
self.... | <commit_before><commit_msg>Add tests for observers and observable.<commit_after>from copy import copy
from pytest import fixture
from vistas.core.observers.interface import *
@fixture(scope='session')
def observer():
class TestObserver(Observer):
def __init__(self):
self.x = 5
def up... | |
3c5116f3a26fb93ab85fd973462a582a0fa5d877 | bin/validate-presets.py | bin/validate-presets.py | #!/usr/bin/python
import json
import sys
def validate_presets(presets_file):
with open(presets_file) as jsonfile:
presets_dict = json.load(jsonfile)
for handler in presets_dict.iterkeys():
for entry in presets_dict.get(handler).get("presets"):
value = entry.get("value")
... | Add script to validate web/db/handlerpresets.json file | Add script to validate web/db/handlerpresets.json file
Simple validation for `web/db/handlerpresets.json` file. It prints
error if handler's name is not same as beginning of value's string.
Catches problems like this in handlerpresets.json:
```json
"slack:": {
"presets": [
{
"description": "O... | Python | mit | nkapu/handlers,ouspg/urlhandlers,ouspg/urlhandlers,nkapu/handlers,nkapu/handlers,nkapu/handlers,ouspg/urlhandlers,ouspg/urlhandlers | Add script to validate web/db/handlerpresets.json file
Simple validation for `web/db/handlerpresets.json` file. It prints
error if handler's name is not same as beginning of value's string.
Catches problems like this in handlerpresets.json:
```json
"slack:": {
"presets": [
{
"description": "O... | #!/usr/bin/python
import json
import sys
def validate_presets(presets_file):
with open(presets_file) as jsonfile:
presets_dict = json.load(jsonfile)
for handler in presets_dict.iterkeys():
for entry in presets_dict.get(handler).get("presets"):
value = entry.get("value")
... | <commit_before><commit_msg>Add script to validate web/db/handlerpresets.json file
Simple validation for `web/db/handlerpresets.json` file. It prints
error if handler's name is not same as beginning of value's string.
Catches problems like this in handlerpresets.json:
```json
"slack:": {
"presets": [
{
... | #!/usr/bin/python
import json
import sys
def validate_presets(presets_file):
with open(presets_file) as jsonfile:
presets_dict = json.load(jsonfile)
for handler in presets_dict.iterkeys():
for entry in presets_dict.get(handler).get("presets"):
value = entry.get("value")
... | Add script to validate web/db/handlerpresets.json file
Simple validation for `web/db/handlerpresets.json` file. It prints
error if handler's name is not same as beginning of value's string.
Catches problems like this in handlerpresets.json:
```json
"slack:": {
"presets": [
{
"description": "O... | <commit_before><commit_msg>Add script to validate web/db/handlerpresets.json file
Simple validation for `web/db/handlerpresets.json` file. It prints
error if handler's name is not same as beginning of value's string.
Catches problems like this in handlerpresets.json:
```json
"slack:": {
"presets": [
{
... | |
24b6126871a5378faa2e8f9848c279999e50cb96 | ooo.py | ooo.py | #!/usr/bin/python
import os
import sys
import re
from collections import defaultdict
COMIC_RE = re.compile(r'^\d+ +([^#]+)#(\d+)')
def lines(todofile):
with open(todofile) as todolines:
for line in todolines:
title_match = COMIC_RE.match(line)
if title_match:
# (title, issue)
yield ... | Check issue numbers to find out of order listings | Check issue numbers to find out of order listings
| Python | mit | xchewtoyx/comicmgt,xchewtoyx/comicmgt | Check issue numbers to find out of order listings | #!/usr/bin/python
import os
import sys
import re
from collections import defaultdict
COMIC_RE = re.compile(r'^\d+ +([^#]+)#(\d+)')
def lines(todofile):
with open(todofile) as todolines:
for line in todolines:
title_match = COMIC_RE.match(line)
if title_match:
# (title, issue)
yield ... | <commit_before><commit_msg>Check issue numbers to find out of order listings<commit_after> | #!/usr/bin/python
import os
import sys
import re
from collections import defaultdict
COMIC_RE = re.compile(r'^\d+ +([^#]+)#(\d+)')
def lines(todofile):
with open(todofile) as todolines:
for line in todolines:
title_match = COMIC_RE.match(line)
if title_match:
# (title, issue)
yield ... | Check issue numbers to find out of order listings#!/usr/bin/python
import os
import sys
import re
from collections import defaultdict
COMIC_RE = re.compile(r'^\d+ +([^#]+)#(\d+)')
def lines(todofile):
with open(todofile) as todolines:
for line in todolines:
title_match = COMIC_RE.match(line)
if tit... | <commit_before><commit_msg>Check issue numbers to find out of order listings<commit_after>#!/usr/bin/python
import os
import sys
import re
from collections import defaultdict
COMIC_RE = re.compile(r'^\d+ +([^#]+)#(\d+)')
def lines(todofile):
with open(todofile) as todolines:
for line in todolines:
title_... | |
94d7a3b01b7360001817ef3ed3ad2003f0722b14 | tests/script_parser/test_parsing_complex.py | tests/script_parser/test_parsing_complex.py | from script_parser import parser
import os
def test_environ_init():
""" Set up variables in environment and check parser uses them to init properly. """
os.environ['client_id'] = 'x'
os.environ['client_secret'] = 'y'
os.environ['refresh_token'] = 'z'
p = parser.Parser(['chrome.init ${env.client_... | Add complex parse scenario - environment variables and init | Add complex parse scenario - environment variables and init
| Python | mit | melkamar/webstore-manager,melkamar/webstore-manager | Add complex parse scenario - environment variables and init | from script_parser import parser
import os
def test_environ_init():
""" Set up variables in environment and check parser uses them to init properly. """
os.environ['client_id'] = 'x'
os.environ['client_secret'] = 'y'
os.environ['refresh_token'] = 'z'
p = parser.Parser(['chrome.init ${env.client_... | <commit_before><commit_msg>Add complex parse scenario - environment variables and init<commit_after> | from script_parser import parser
import os
def test_environ_init():
""" Set up variables in environment and check parser uses them to init properly. """
os.environ['client_id'] = 'x'
os.environ['client_secret'] = 'y'
os.environ['refresh_token'] = 'z'
p = parser.Parser(['chrome.init ${env.client_... | Add complex parse scenario - environment variables and initfrom script_parser import parser
import os
def test_environ_init():
""" Set up variables in environment and check parser uses them to init properly. """
os.environ['client_id'] = 'x'
os.environ['client_secret'] = 'y'
os.environ['refresh_token... | <commit_before><commit_msg>Add complex parse scenario - environment variables and init<commit_after>from script_parser import parser
import os
def test_environ_init():
""" Set up variables in environment and check parser uses them to init properly. """
os.environ['client_id'] = 'x'
os.environ['client_sec... | |
d9720f1fcc3013324c9ea58620df9c458a2e314e | test/test_awc.py | test/test_awc.py | import pytest
import FIAT
import finat
import numpy as np
from gem.interpreter import evaluate
from fiat_mapping import MyMapping
def test_morley():
ref_cell = FIAT.ufc_simplex(2)
ref_element = finat.ArnoldWinther(ref_cell, 3)
ref_pts = finat.point_set.PointSet(ref_cell.make_points(2, 0, 3))
phys_cel... | Add (broken) AWc test for debugging purposes | Add (broken) AWc test for debugging purposes
| Python | mit | FInAT/FInAT | Add (broken) AWc test for debugging purposes | import pytest
import FIAT
import finat
import numpy as np
from gem.interpreter import evaluate
from fiat_mapping import MyMapping
def test_morley():
ref_cell = FIAT.ufc_simplex(2)
ref_element = finat.ArnoldWinther(ref_cell, 3)
ref_pts = finat.point_set.PointSet(ref_cell.make_points(2, 0, 3))
phys_cel... | <commit_before><commit_msg>Add (broken) AWc test for debugging purposes<commit_after> | import pytest
import FIAT
import finat
import numpy as np
from gem.interpreter import evaluate
from fiat_mapping import MyMapping
def test_morley():
ref_cell = FIAT.ufc_simplex(2)
ref_element = finat.ArnoldWinther(ref_cell, 3)
ref_pts = finat.point_set.PointSet(ref_cell.make_points(2, 0, 3))
phys_cel... | Add (broken) AWc test for debugging purposesimport pytest
import FIAT
import finat
import numpy as np
from gem.interpreter import evaluate
from fiat_mapping import MyMapping
def test_morley():
ref_cell = FIAT.ufc_simplex(2)
ref_element = finat.ArnoldWinther(ref_cell, 3)
ref_pts = finat.point_set.PointSet(... | <commit_before><commit_msg>Add (broken) AWc test for debugging purposes<commit_after>import pytest
import FIAT
import finat
import numpy as np
from gem.interpreter import evaluate
from fiat_mapping import MyMapping
def test_morley():
ref_cell = FIAT.ufc_simplex(2)
ref_element = finat.ArnoldWinther(ref_cell, 3... | |
18c93f4c70a2247bcce8a853c30038097cb9f7b2 | cms/apps/pages/tests/test_admin_destructive.py | cms/apps/pages/tests/test_admin_destructive.py | from django.conf import settings
from django.contrib import admin
from django.test import TestCase
from ..models import Country, CountryGroup, Page
import sys
class TestArticleAdminBase(TestCase):
def test_article_admin(self):
NEW_MIDDLEWARE_CLASSES = settings.MIDDLEWARE_CLASSES + (
'cms.mi... | Add test for optional page admin registrations for Country and CountryGroup. | Add test for optional page admin registrations for Country and CountryGroup.
| Python | bsd-3-clause | jamesfoley/cms,jamesfoley/cms,danielsamuels/cms,lewiscollard/cms,jamesfoley/cms,dan-gamble/cms,lewiscollard/cms,danielsamuels/cms,danielsamuels/cms,lewiscollard/cms,dan-gamble/cms,jamesfoley/cms,dan-gamble/cms | Add test for optional page admin registrations for Country and CountryGroup. | from django.conf import settings
from django.contrib import admin
from django.test import TestCase
from ..models import Country, CountryGroup, Page
import sys
class TestArticleAdminBase(TestCase):
def test_article_admin(self):
NEW_MIDDLEWARE_CLASSES = settings.MIDDLEWARE_CLASSES + (
'cms.mi... | <commit_before><commit_msg>Add test for optional page admin registrations for Country and CountryGroup.<commit_after> | from django.conf import settings
from django.contrib import admin
from django.test import TestCase
from ..models import Country, CountryGroup, Page
import sys
class TestArticleAdminBase(TestCase):
def test_article_admin(self):
NEW_MIDDLEWARE_CLASSES = settings.MIDDLEWARE_CLASSES + (
'cms.mi... | Add test for optional page admin registrations for Country and CountryGroup.from django.conf import settings
from django.contrib import admin
from django.test import TestCase
from ..models import Country, CountryGroup, Page
import sys
class TestArticleAdminBase(TestCase):
def test_article_admin(self):
... | <commit_before><commit_msg>Add test for optional page admin registrations for Country and CountryGroup.<commit_after>from django.conf import settings
from django.contrib import admin
from django.test import TestCase
from ..models import Country, CountryGroup, Page
import sys
class TestArticleAdminBase(TestCase):
... | |
d34ad4b0b969dd6c10fc7c1646f934016ba8ddd7 | tools/distrib/c-ish/check_documentation.py | tools/distrib/c-ish/check_documentation.py | #!/usr/bin/env python2.7
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this li... | Add a script to list undocumented files and directories | Add a script to list undocumented files and directories
| Python | apache-2.0 | makdharma/grpc,yugui/grpc,simonkuang/grpc,dklempner/grpc,matt-kwong/grpc,apolcyn/grpc,kumaralokgithub/grpc,geffzhang/grpc,ctiller/grpc,thinkerou/grpc,chrisdunelm/grpc,ejona86/grpc,donnadionne/grpc,yugui/grpc,nicolasnoble/grpc,dgquintas/grpc,adelez/grpc,PeterFaiman/ruby-grpc-minimal,kpayson64/grpc,grani/grpc,makdharma/g... | Add a script to list undocumented files and directories | #!/usr/bin/env python2.7
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this li... | <commit_before><commit_msg>Add a script to list undocumented files and directories<commit_after> | #!/usr/bin/env python2.7
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this li... | Add a script to list undocumented files and directories#!/usr/bin/env python2.7
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source... | <commit_before><commit_msg>Add a script to list undocumented files and directories<commit_after>#!/usr/bin/env python2.7
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
#... | |
b363b20440e564b2909736c64cb543cd632b4ae4 | custom/covid/management/commands/fetch_form_case_counts.py | custom/covid/management/commands/fetch_form_case_counts.py | import itertools
from datetime import date, datetime, timedelta
from django.core.management.base import BaseCommand
from corehq.apps.enterprise.models import EnterprisePermissions
from corehq.apps.es import CaseES, FormES
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(... | Print daily form submission counts | Print daily form submission counts
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | Print daily form submission counts | import itertools
from datetime import date, datetime, timedelta
from django.core.management.base import BaseCommand
from corehq.apps.enterprise.models import EnterprisePermissions
from corehq.apps.es import CaseES, FormES
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(... | <commit_before><commit_msg>Print daily form submission counts<commit_after> | import itertools
from datetime import date, datetime, timedelta
from django.core.management.base import BaseCommand
from corehq.apps.enterprise.models import EnterprisePermissions
from corehq.apps.es import CaseES, FormES
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(... | Print daily form submission countsimport itertools
from datetime import date, datetime, timedelta
from django.core.management.base import BaseCommand
from corehq.apps.enterprise.models import EnterprisePermissions
from corehq.apps.es import CaseES, FormES
class Command(BaseCommand):
def add_arguments(self, par... | <commit_before><commit_msg>Print daily form submission counts<commit_after>import itertools
from datetime import date, datetime, timedelta
from django.core.management.base import BaseCommand
from corehq.apps.enterprise.models import EnterprisePermissions
from corehq.apps.es import CaseES, FormES
class Command(BaseC... | |
d3e90e4dca1cce2f27ccf9c24c1bb944f9d708b9 | test/test_message_directory.py | test/test_message_directory.py | """
Created on 18 May 2018.
@author: Greg Corbett
"""
import shutil
import tempfile
import unittest
from ssm.message_directory import MessageDirectory
class TestMessageDirectory(unittest.TestCase):
"""Class used for testing the MessageDirectory class."""
def setUp(self):
"""Create a MessageDirecto... | Add a unit test file for MessageDirectory | Add a unit test file for MessageDirectory
| Python | apache-2.0 | tofu-rocketry/ssm,apel/ssm,tofu-rocketry/ssm,stfc/ssm,apel/ssm,stfc/ssm | Add a unit test file for MessageDirectory | """
Created on 18 May 2018.
@author: Greg Corbett
"""
import shutil
import tempfile
import unittest
from ssm.message_directory import MessageDirectory
class TestMessageDirectory(unittest.TestCase):
"""Class used for testing the MessageDirectory class."""
def setUp(self):
"""Create a MessageDirecto... | <commit_before><commit_msg>Add a unit test file for MessageDirectory<commit_after> | """
Created on 18 May 2018.
@author: Greg Corbett
"""
import shutil
import tempfile
import unittest
from ssm.message_directory import MessageDirectory
class TestMessageDirectory(unittest.TestCase):
"""Class used for testing the MessageDirectory class."""
def setUp(self):
"""Create a MessageDirecto... | Add a unit test file for MessageDirectory"""
Created on 18 May 2018.
@author: Greg Corbett
"""
import shutil
import tempfile
import unittest
from ssm.message_directory import MessageDirectory
class TestMessageDirectory(unittest.TestCase):
"""Class used for testing the MessageDirectory class."""
def setUp(... | <commit_before><commit_msg>Add a unit test file for MessageDirectory<commit_after>"""
Created on 18 May 2018.
@author: Greg Corbett
"""
import shutil
import tempfile
import unittest
from ssm.message_directory import MessageDirectory
class TestMessageDirectory(unittest.TestCase):
"""Class used for testing the M... | |
7fd09bd791661ab0b12921dfd977591690d9c01a | accounts/tests/test_forms.py | accounts/tests/test_forms.py | """accounts app unittests for views
"""
from django.test import TestCase
from accounts.forms import LoginForm
class LoginFormTest(TestCase):
"""Tests the form which validates the email used for login.
"""
def test_valid_email_accepted(self):
form = LoginForm({'email': 'newvisitor@example.com'})... | Add form tests for LoginForm | Add form tests for LoginForm
| Python | mit | randomic/aniauth-tdd,randomic/aniauth-tdd | Add form tests for LoginForm | """accounts app unittests for views
"""
from django.test import TestCase
from accounts.forms import LoginForm
class LoginFormTest(TestCase):
"""Tests the form which validates the email used for login.
"""
def test_valid_email_accepted(self):
form = LoginForm({'email': 'newvisitor@example.com'})... | <commit_before><commit_msg>Add form tests for LoginForm<commit_after> | """accounts app unittests for views
"""
from django.test import TestCase
from accounts.forms import LoginForm
class LoginFormTest(TestCase):
"""Tests the form which validates the email used for login.
"""
def test_valid_email_accepted(self):
form = LoginForm({'email': 'newvisitor@example.com'})... | Add form tests for LoginForm"""accounts app unittests for views
"""
from django.test import TestCase
from accounts.forms import LoginForm
class LoginFormTest(TestCase):
"""Tests the form which validates the email used for login.
"""
def test_valid_email_accepted(self):
form = LoginForm({'email'... | <commit_before><commit_msg>Add form tests for LoginForm<commit_after>"""accounts app unittests for views
"""
from django.test import TestCase
from accounts.forms import LoginForm
class LoginFormTest(TestCase):
"""Tests the form which validates the email used for login.
"""
def test_valid_email_accepted... | |
28a7077b7f05f52d0bff7a849f8b50f82f73dbdb | idx2md5.py | idx2md5.py | #! /usr/bin/python
from __future__ import print_function
import sys
import photo.index
idx = photo.index.Index(idxfile=sys.argv[1])
for i in idx:
print("%s %s" % (i.md5, i.filename))
| Add a script to convert an index to a md5 file. | Add a script to convert an index to a md5 file.
| Python | apache-2.0 | RKrahl/photo-tools | Add a script to convert an index to a md5 file. | #! /usr/bin/python
from __future__ import print_function
import sys
import photo.index
idx = photo.index.Index(idxfile=sys.argv[1])
for i in idx:
print("%s %s" % (i.md5, i.filename))
| <commit_before><commit_msg>Add a script to convert an index to a md5 file.<commit_after> | #! /usr/bin/python
from __future__ import print_function
import sys
import photo.index
idx = photo.index.Index(idxfile=sys.argv[1])
for i in idx:
print("%s %s" % (i.md5, i.filename))
| Add a script to convert an index to a md5 file.#! /usr/bin/python
from __future__ import print_function
import sys
import photo.index
idx = photo.index.Index(idxfile=sys.argv[1])
for i in idx:
print("%s %s" % (i.md5, i.filename))
| <commit_before><commit_msg>Add a script to convert an index to a md5 file.<commit_after>#! /usr/bin/python
from __future__ import print_function
import sys
import photo.index
idx = photo.index.Index(idxfile=sys.argv[1])
for i in idx:
print("%s %s" % (i.md5, i.filename))
| |
05e2b100512a9c9b06c5d7d2701867f155c5e3f0 | senlin/tests/tempest/api/profiles/test_profile_validate.py | senlin/tests/tempest/api/profiles/test_profile_validate.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
# distributed under t... | Add API tests for profile validation | Add API tests for profile validation
Add positive API tests for profile validation, add missing tests.
Change-Id: I3bed44af9b90e317a0d1d76b883182db9338d40d
| Python | apache-2.0 | openstack/senlin,openstack/senlin,stackforge/senlin,openstack/senlin,stackforge/senlin | Add API tests for profile validation
Add positive API tests for profile validation, add missing tests.
Change-Id: I3bed44af9b90e317a0d1d76b883182db9338d40d | # 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
# distributed under t... | <commit_before><commit_msg>Add API tests for profile validation
Add positive API tests for profile validation, add missing tests.
Change-Id: I3bed44af9b90e317a0d1d76b883182db9338d40d<commit_after> | # 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
# distributed under t... | Add API tests for profile validation
Add positive API tests for profile validation, add missing tests.
Change-Id: I3bed44af9b90e317a0d1d76b883182db9338d40d# 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... | <commit_before><commit_msg>Add API tests for profile validation
Add positive API tests for profile validation, add missing tests.
Change-Id: I3bed44af9b90e317a0d1d76b883182db9338d40d<commit_after># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with th... | |
861a5fcda82fefbe10c844fda4075688dc6baf8e | mzalendo/votematch/views.py | mzalendo/votematch/views.py | import models
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template import RequestContext
def quiz_detail (request, slug):
quiz = get_object_or_404(
models.Quiz,
slug=slug
)
return render_to_response(
'votematch/quiz_detail.html',... | import models
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template import RequestContext
def quiz_detail (request, slug):
quiz = get_object_or_404(
models.Quiz,
slug=slug
)
# If this is a POST then extract all the answers
if reques... | Save submissions, and redirect user to the submission detail page after completing form. | Save submissions, and redirect user to the submission detail page after completing form.
| Python | agpl-3.0 | patricmutwiri/pombola,hzj123/56th,mysociety/pombola,ken-muturi/pombola,mysociety/pombola,mysociety/pombola,ken-muturi/pombola,patricmutwiri/pombola,hzj123/56th,geoffkilpin/pombola,geoffkilpin/pombola,mysociety/pombola,patricmutwiri/pombola,patricmutwiri/pombola,ken-muturi/pombola,patricmutwiri/pombola,geoffkilpin/pombo... | import models
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template import RequestContext
def quiz_detail (request, slug):
quiz = get_object_or_404(
models.Quiz,
slug=slug
)
return render_to_response(
'votematch/quiz_detail.html',... | import models
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template import RequestContext
def quiz_detail (request, slug):
quiz = get_object_or_404(
models.Quiz,
slug=slug
)
# If this is a POST then extract all the answers
if reques... | <commit_before>import models
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template import RequestContext
def quiz_detail (request, slug):
quiz = get_object_or_404(
models.Quiz,
slug=slug
)
return render_to_response(
'votematch/qui... | import models
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template import RequestContext
def quiz_detail (request, slug):
quiz = get_object_or_404(
models.Quiz,
slug=slug
)
# If this is a POST then extract all the answers
if reques... | import models
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template import RequestContext
def quiz_detail (request, slug):
quiz = get_object_or_404(
models.Quiz,
slug=slug
)
return render_to_response(
'votematch/quiz_detail.html',... | <commit_before>import models
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template import RequestContext
def quiz_detail (request, slug):
quiz = get_object_or_404(
models.Quiz,
slug=slug
)
return render_to_response(
'votematch/qui... |
c4e6b2b68e6acd8f83091fc055897628b8df05bb | lowfat/migrations/0105_auto_20170615_1400.py | lowfat/migrations/0105_auto_20170615_1400.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-15 14:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lowfat', '0104_auto_20170607_1428'),
]
operations = [
migrations.AddField(
... | Add migration for django-simple-history == 1.9.0 | Add migration for django-simple-history == 1.9.0
| Python | bsd-3-clause | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | Add migration for django-simple-history == 1.9.0 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-15 14:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lowfat', '0104_auto_20170607_1428'),
]
operations = [
migrations.AddField(
... | <commit_before><commit_msg>Add migration for django-simple-history == 1.9.0<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-15 14:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lowfat', '0104_auto_20170607_1428'),
]
operations = [
migrations.AddField(
... | Add migration for django-simple-history == 1.9.0# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-15 14:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lowfat', '0104_auto_20170607_1428'),
]
... | <commit_before><commit_msg>Add migration for django-simple-history == 1.9.0<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-15 14:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('low... | |
22946180e9e5e660be14d453ddf5bb37564ddf33 | build-tile-map.py | build-tile-map.py | #!/usr/bin/env python
from osgeo import ogr
from osgeo import osr
from glob import glob
import os
driver = ogr.GetDriverByName("ESRI Shapefile")
ds = driver.CreateDataSource("tile-map.shp")
srs = osr.SpatialReference()
srs.ImportFromEPSG(26915)
layer = ds.CreateLayer("tiles", srs, ogr.wkbPolygon)
field_name = ogr.F... | Add a script to build a map of all the tiles | Add a script to build a map of all the tiles
| Python | mit | simonsonc/mn-glo-mosaic,simonsonc/mn-glo-mosaic,simonsonc/mn-glo-mosaic | Add a script to build a map of all the tiles | #!/usr/bin/env python
from osgeo import ogr
from osgeo import osr
from glob import glob
import os
driver = ogr.GetDriverByName("ESRI Shapefile")
ds = driver.CreateDataSource("tile-map.shp")
srs = osr.SpatialReference()
srs.ImportFromEPSG(26915)
layer = ds.CreateLayer("tiles", srs, ogr.wkbPolygon)
field_name = ogr.F... | <commit_before><commit_msg>Add a script to build a map of all the tiles<commit_after> | #!/usr/bin/env python
from osgeo import ogr
from osgeo import osr
from glob import glob
import os
driver = ogr.GetDriverByName("ESRI Shapefile")
ds = driver.CreateDataSource("tile-map.shp")
srs = osr.SpatialReference()
srs.ImportFromEPSG(26915)
layer = ds.CreateLayer("tiles", srs, ogr.wkbPolygon)
field_name = ogr.F... | Add a script to build a map of all the tiles#!/usr/bin/env python
from osgeo import ogr
from osgeo import osr
from glob import glob
import os
driver = ogr.GetDriverByName("ESRI Shapefile")
ds = driver.CreateDataSource("tile-map.shp")
srs = osr.SpatialReference()
srs.ImportFromEPSG(26915)
layer = ds.CreateLayer("tile... | <commit_before><commit_msg>Add a script to build a map of all the tiles<commit_after>#!/usr/bin/env python
from osgeo import ogr
from osgeo import osr
from glob import glob
import os
driver = ogr.GetDriverByName("ESRI Shapefile")
ds = driver.CreateDataSource("tile-map.shp")
srs = osr.SpatialReference()
srs.ImportFrom... | |
c0b37b879b2e20ee71663e64be76ad11c1e1794c | async/3.7/basic/compsleep.py | async/3.7/basic/compsleep.py | #!/usr/bin/env python
"""https://docs.python.org/3.7/library/asyncio-task.html 変奏版
Features:
- asyncio.gather()
- asyncio.sleep()
- asyncio.run()
"""
import asyncio
import logging
import time
concurrent = 3
delay = 5
# PYTHONASYNCIODEBUG=1
logging.basicConfig(level=logging.DEBUG)
async def async_pause():
awai... | Add a script that can be used to compare asyncio.sleep to time.sleep | Add a script that can be used to compare asyncio.sleep to time.sleep
| Python | mit | showa-yojyo/bin,showa-yojyo/bin | Add a script that can be used to compare asyncio.sleep to time.sleep | #!/usr/bin/env python
"""https://docs.python.org/3.7/library/asyncio-task.html 変奏版
Features:
- asyncio.gather()
- asyncio.sleep()
- asyncio.run()
"""
import asyncio
import logging
import time
concurrent = 3
delay = 5
# PYTHONASYNCIODEBUG=1
logging.basicConfig(level=logging.DEBUG)
async def async_pause():
awai... | <commit_before><commit_msg>Add a script that can be used to compare asyncio.sleep to time.sleep<commit_after> | #!/usr/bin/env python
"""https://docs.python.org/3.7/library/asyncio-task.html 変奏版
Features:
- asyncio.gather()
- asyncio.sleep()
- asyncio.run()
"""
import asyncio
import logging
import time
concurrent = 3
delay = 5
# PYTHONASYNCIODEBUG=1
logging.basicConfig(level=logging.DEBUG)
async def async_pause():
awai... | Add a script that can be used to compare asyncio.sleep to time.sleep#!/usr/bin/env python
"""https://docs.python.org/3.7/library/asyncio-task.html 変奏版
Features:
- asyncio.gather()
- asyncio.sleep()
- asyncio.run()
"""
import asyncio
import logging
import time
concurrent = 3
delay = 5
# PYTHONASYNCIODEBUG=1
logging... | <commit_before><commit_msg>Add a script that can be used to compare asyncio.sleep to time.sleep<commit_after>#!/usr/bin/env python
"""https://docs.python.org/3.7/library/asyncio-task.html 変奏版
Features:
- asyncio.gather()
- asyncio.sleep()
- asyncio.run()
"""
import asyncio
import logging
import time
concurrent = 3
... | |
ee1df360979ec24fd8233210372eedd3071cee87 | tests/test_argspec.py | tests/test_argspec.py | """Make sure that arguments of open/read/write don't diverge"""
import pysoundfile as sf
from inspect import getargspec
open = getargspec(sf.open)
init = getargspec(sf.SoundFile.__init__)
read_function = getargspec(sf.read)
read_method = getargspec(sf.SoundFile.read)
write_function = getargspec(sf.write)
def defau... | Add test file to check consistent use of default arguments | Add test file to check consistent use of default arguments
| Python | bsd-3-clause | mgeier/PySoundFile | Add test file to check consistent use of default arguments | """Make sure that arguments of open/read/write don't diverge"""
import pysoundfile as sf
from inspect import getargspec
open = getargspec(sf.open)
init = getargspec(sf.SoundFile.__init__)
read_function = getargspec(sf.read)
read_method = getargspec(sf.SoundFile.read)
write_function = getargspec(sf.write)
def defau... | <commit_before><commit_msg>Add test file to check consistent use of default arguments<commit_after> | """Make sure that arguments of open/read/write don't diverge"""
import pysoundfile as sf
from inspect import getargspec
open = getargspec(sf.open)
init = getargspec(sf.SoundFile.__init__)
read_function = getargspec(sf.read)
read_method = getargspec(sf.SoundFile.read)
write_function = getargspec(sf.write)
def defau... | Add test file to check consistent use of default arguments"""Make sure that arguments of open/read/write don't diverge"""
import pysoundfile as sf
from inspect import getargspec
open = getargspec(sf.open)
init = getargspec(sf.SoundFile.__init__)
read_function = getargspec(sf.read)
read_method = getargspec(sf.SoundFi... | <commit_before><commit_msg>Add test file to check consistent use of default arguments<commit_after>"""Make sure that arguments of open/read/write don't diverge"""
import pysoundfile as sf
from inspect import getargspec
open = getargspec(sf.open)
init = getargspec(sf.SoundFile.__init__)
read_function = getargspec(sf.... | |
2b99781e67e1e2e0bb3863c08e81b3cf57a5e296 | tests/test_bouncer.py | tests/test_bouncer.py | from rest_framework import status
from rest_framework.test import APITestCase
from django.contrib.auth import get_user_model
from api_bouncer.models import Api
User = get_user_model()
class BouncerTests(APITestCase):
def setUp(self):
self.superuser = User.objects.create_superuser(
'john',
... | Add request bouncer test cases | Add request bouncer test cases
| Python | apache-2.0 | menecio/django-api-bouncer | Add request bouncer test cases | from rest_framework import status
from rest_framework.test import APITestCase
from django.contrib.auth import get_user_model
from api_bouncer.models import Api
User = get_user_model()
class BouncerTests(APITestCase):
def setUp(self):
self.superuser = User.objects.create_superuser(
'john',
... | <commit_before><commit_msg>Add request bouncer test cases<commit_after> | from rest_framework import status
from rest_framework.test import APITestCase
from django.contrib.auth import get_user_model
from api_bouncer.models import Api
User = get_user_model()
class BouncerTests(APITestCase):
def setUp(self):
self.superuser = User.objects.create_superuser(
'john',
... | Add request bouncer test casesfrom rest_framework import status
from rest_framework.test import APITestCase
from django.contrib.auth import get_user_model
from api_bouncer.models import Api
User = get_user_model()
class BouncerTests(APITestCase):
def setUp(self):
self.superuser = User.objects.create_sup... | <commit_before><commit_msg>Add request bouncer test cases<commit_after>from rest_framework import status
from rest_framework.test import APITestCase
from django.contrib.auth import get_user_model
from api_bouncer.models import Api
User = get_user_model()
class BouncerTests(APITestCase):
def setUp(self):
... | |
ab1bc996d477c84187df381ec77e7aaab299783b | tests/test_utils.py | tests/test_utils.py | from mws.mws import calc_md5
def test_calc_md5():
assert calc_md5(b'mws') == b'mA5nPbh1CSx9M3dbkr3Cyg=='
| Add test for calc_md5() function | Add test for calc_md5() function
| Python | unlicense | bpipat/mws,jameshiew/mws,Bobspadger/python-amazon-mws,GriceTurrble/python-amazon-mws | Add test for calc_md5() function | from mws.mws import calc_md5
def test_calc_md5():
assert calc_md5(b'mws') == b'mA5nPbh1CSx9M3dbkr3Cyg=='
| <commit_before><commit_msg>Add test for calc_md5() function<commit_after> | from mws.mws import calc_md5
def test_calc_md5():
assert calc_md5(b'mws') == b'mA5nPbh1CSx9M3dbkr3Cyg=='
| Add test for calc_md5() functionfrom mws.mws import calc_md5
def test_calc_md5():
assert calc_md5(b'mws') == b'mA5nPbh1CSx9M3dbkr3Cyg=='
| <commit_before><commit_msg>Add test for calc_md5() function<commit_after>from mws.mws import calc_md5
def test_calc_md5():
assert calc_md5(b'mws') == b'mA5nPbh1CSx9M3dbkr3Cyg=='
| |
13b3320399e51bbbb4018ea5fb3ff6d63c8864c7 | celexRunScript.py | celexRunScript.py | from celex import Celex
'''
- Allows for a quick run of a desired size pulled from any evolution file.
- Automatically loads the best chromosome from the evolution to test.
- Useful for running large-scale tests of a chromosome that appears
to be performing well.
- For small tests to ensure system functionality, run th... | Add quick run script for celex fullscale tests | Add quick run script for celex fullscale tests
| Python | mit | jacobkrantz/ProbSyllabifier | Add quick run script for celex fullscale tests | from celex import Celex
'''
- Allows for a quick run of a desired size pulled from any evolution file.
- Automatically loads the best chromosome from the evolution to test.
- Useful for running large-scale tests of a chromosome that appears
to be performing well.
- For small tests to ensure system functionality, run th... | <commit_before><commit_msg>Add quick run script for celex fullscale tests<commit_after> | from celex import Celex
'''
- Allows for a quick run of a desired size pulled from any evolution file.
- Automatically loads the best chromosome from the evolution to test.
- Useful for running large-scale tests of a chromosome that appears
to be performing well.
- For small tests to ensure system functionality, run th... | Add quick run script for celex fullscale testsfrom celex import Celex
'''
- Allows for a quick run of a desired size pulled from any evolution file.
- Automatically loads the best chromosome from the evolution to test.
- Useful for running large-scale tests of a chromosome that appears
to be performing well.
- For smal... | <commit_before><commit_msg>Add quick run script for celex fullscale tests<commit_after>from celex import Celex
'''
- Allows for a quick run of a desired size pulled from any evolution file.
- Automatically loads the best chromosome from the evolution to test.
- Useful for running large-scale tests of a chromosome that ... | |
25a4c9ba978aef7f648904c654fcc044f429acd4 | custom/openclinica/models.py | custom/openclinica/models.py | from collections import defaultdict
from corehq.apps.users.models import CouchUser
from custom.openclinica.const import AUDIT_LOGS
from custom.openclinica.utils import (
OpenClinicaIntegrationError,
is_item_group_repeating,
is_study_event_repeating,
get_item_measurement_unit,
get_question_item,
... | Add Subjects model, methods for report and export | Add Subjects model, methods for report and export
| Python | bsd-3-clause | qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq | Add Subjects model, methods for report and export | from collections import defaultdict
from corehq.apps.users.models import CouchUser
from custom.openclinica.const import AUDIT_LOGS
from custom.openclinica.utils import (
OpenClinicaIntegrationError,
is_item_group_repeating,
is_study_event_repeating,
get_item_measurement_unit,
get_question_item,
... | <commit_before><commit_msg>Add Subjects model, methods for report and export<commit_after> | from collections import defaultdict
from corehq.apps.users.models import CouchUser
from custom.openclinica.const import AUDIT_LOGS
from custom.openclinica.utils import (
OpenClinicaIntegrationError,
is_item_group_repeating,
is_study_event_repeating,
get_item_measurement_unit,
get_question_item,
... | Add Subjects model, methods for report and exportfrom collections import defaultdict
from corehq.apps.users.models import CouchUser
from custom.openclinica.const import AUDIT_LOGS
from custom.openclinica.utils import (
OpenClinicaIntegrationError,
is_item_group_repeating,
is_study_event_repeating,
get_i... | <commit_before><commit_msg>Add Subjects model, methods for report and export<commit_after>from collections import defaultdict
from corehq.apps.users.models import CouchUser
from custom.openclinica.const import AUDIT_LOGS
from custom.openclinica.utils import (
OpenClinicaIntegrationError,
is_item_group_repeating... | |
9d2a2b0e1f066b2606e62ec019b56d4659ed86b1 | pygraphc/clustering/ClusterEvaluation.py | pygraphc/clustering/ClusterEvaluation.py | from sklearn import metrics
class ClusterEvaluation(object):
@staticmethod
def get_evaluated(evaluated_file):
with open(evaluated_file, 'r') as ef:
evaluations = ef.readlines()
evaluation_labels = [evaluation.split(';')[0] for evaluation in evaluations]
return evaluation_l... | Add cluster evaluation: adjusted rand index | Add cluster evaluation: adjusted rand index
| Python | mit | studiawan/pygraphc | Add cluster evaluation: adjusted rand index | from sklearn import metrics
class ClusterEvaluation(object):
@staticmethod
def get_evaluated(evaluated_file):
with open(evaluated_file, 'r') as ef:
evaluations = ef.readlines()
evaluation_labels = [evaluation.split(';')[0] for evaluation in evaluations]
return evaluation_l... | <commit_before><commit_msg>Add cluster evaluation: adjusted rand index<commit_after> | from sklearn import metrics
class ClusterEvaluation(object):
@staticmethod
def get_evaluated(evaluated_file):
with open(evaluated_file, 'r') as ef:
evaluations = ef.readlines()
evaluation_labels = [evaluation.split(';')[0] for evaluation in evaluations]
return evaluation_l... | Add cluster evaluation: adjusted rand indexfrom sklearn import metrics
class ClusterEvaluation(object):
@staticmethod
def get_evaluated(evaluated_file):
with open(evaluated_file, 'r') as ef:
evaluations = ef.readlines()
evaluation_labels = [evaluation.split(';')[0] for evaluation ... | <commit_before><commit_msg>Add cluster evaluation: adjusted rand index<commit_after>from sklearn import metrics
class ClusterEvaluation(object):
@staticmethod
def get_evaluated(evaluated_file):
with open(evaluated_file, 'r') as ef:
evaluations = ef.readlines()
evaluation_labels = ... | |
f06e5a8c701f06d40597cd268a6739988c2fff56 | corehq/apps/cleanup/tasks.py | corehq/apps/cleanup/tasks.py | import os
from collections import defaultdict
from django.conf import settings
from django.core.management import call_command
from celery.schedules import crontab
from celery.task import periodic_task
from datetime import datetime
from corehq.apps.cleanup.management.commands.fix_xforms_with_undefined_xmlns import \... | Add functions for parsing log file | Add functions for parsing log file
| Python | bsd-3-clause | dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq | Add functions for parsing log file | import os
from collections import defaultdict
from django.conf import settings
from django.core.management import call_command
from celery.schedules import crontab
from celery.task import periodic_task
from datetime import datetime
from corehq.apps.cleanup.management.commands.fix_xforms_with_undefined_xmlns import \... | <commit_before><commit_msg>Add functions for parsing log file<commit_after> | import os
from collections import defaultdict
from django.conf import settings
from django.core.management import call_command
from celery.schedules import crontab
from celery.task import periodic_task
from datetime import datetime
from corehq.apps.cleanup.management.commands.fix_xforms_with_undefined_xmlns import \... | Add functions for parsing log fileimport os
from collections import defaultdict
from django.conf import settings
from django.core.management import call_command
from celery.schedules import crontab
from celery.task import periodic_task
from datetime import datetime
from corehq.apps.cleanup.management.commands.fix_xf... | <commit_before><commit_msg>Add functions for parsing log file<commit_after>import os
from collections import defaultdict
from django.conf import settings
from django.core.management import call_command
from celery.schedules import crontab
from celery.task import periodic_task
from datetime import datetime
from coreh... | |
095b9cc5f2e9a87220e6f40f88bf6ecd598ca681 | vistrails/packages/componentSearch/init.py | vistrails/packages/componentSearch/init.py | #Copied imports from HTTP package init.py file
from PyQt4 import QtGui
from core.modules.vistrails_module import ModuleError
from core.configuration import get_vistrails_persistent_configuration
from gui.utils import show_warning
import core.modules.vistrails_module
import core.modules
import core.modules.basic_modules... | Add abstract box for ComponentSearch so users can drag it into their workflows. | Add abstract box for ComponentSearch so users can drag it into their workflows.
| Python | bsd-3-clause | CMUSV-VisTrails/WorkflowRecommendation,CMUSV-VisTrails/WorkflowRecommendation,CMUSV-VisTrails/WorkflowRecommendation | Add abstract box for ComponentSearch so users can drag it into their workflows. | #Copied imports from HTTP package init.py file
from PyQt4 import QtGui
from core.modules.vistrails_module import ModuleError
from core.configuration import get_vistrails_persistent_configuration
from gui.utils import show_warning
import core.modules.vistrails_module
import core.modules
import core.modules.basic_modules... | <commit_before><commit_msg>Add abstract box for ComponentSearch so users can drag it into their workflows.<commit_after> | #Copied imports from HTTP package init.py file
from PyQt4 import QtGui
from core.modules.vistrails_module import ModuleError
from core.configuration import get_vistrails_persistent_configuration
from gui.utils import show_warning
import core.modules.vistrails_module
import core.modules
import core.modules.basic_modules... | Add abstract box for ComponentSearch so users can drag it into their workflows.#Copied imports from HTTP package init.py file
from PyQt4 import QtGui
from core.modules.vistrails_module import ModuleError
from core.configuration import get_vistrails_persistent_configuration
from gui.utils import show_warning
import core... | <commit_before><commit_msg>Add abstract box for ComponentSearch so users can drag it into their workflows.<commit_after>#Copied imports from HTTP package init.py file
from PyQt4 import QtGui
from core.modules.vistrails_module import ModuleError
from core.configuration import get_vistrails_persistent_configuration
from ... | |
c3a9d78ca3ffbad0e11192e896db8cd0c2758154 | vote/migrations/0002_auto_20160315_0006.py | vote/migrations/0002_auto_20160315_0006.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vote', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='multiquestion',
name='gr... | UPDATE - add migration file | UPDATE - add migration file
| Python | mit | mingkim/QuesCheetah,mingkim/QuesCheetah,mingkim/QuesCheetah,mingkim/QuesCheetah | UPDATE - add migration file | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vote', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='multiquestion',
name='gr... | <commit_before><commit_msg>UPDATE - add migration file<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vote', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='multiquestion',
name='gr... | UPDATE - add migration file# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vote', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='multiques... | <commit_before><commit_msg>UPDATE - add migration file<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vote', '0001_initial'),
]
operations = [
migrations.Alte... | |
9a9ee99129cee92c93fbc9e2cc24b7b933d51aac | confirmation/migrations/0001_initial.py | confirmation/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Confirmation',
fields... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='... | Add on_delete in foreign keys. | confirmation: Add on_delete in foreign keys.
on_delete will be a required arg for ForeignKey in Django 2.0. Set it
to models.CASCADE on models and in existing migrations if you want to
maintain the current default behavior.
See https://docs.djangoproject.com/en/1.11/ref/models/fields/#django.db.models.ForeignKey.on_de... | Python | apache-2.0 | hackerkid/zulip,dhcrzf/zulip,Galexrt/zulip,showell/zulip,amanharitsh123/zulip,zulip/zulip,vabs22/zulip,vaidap/zulip,jackrzhang/zulip,jrowan/zulip,hackerkid/zulip,zulip/zulip,tommyip/zulip,kou/zulip,jackrzhang/zulip,brockwhittaker/zulip,brockwhittaker/zulip,tommyip/zulip,shubhamdhama/zulip,eeshangarg/zulip,shubhamdhama/... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Confirmation',
fields... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Confirmation',
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Confirmation',
fields... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Confirmation',
... |
7ab0cc93703abf6716b353f38a009897ab154ce4 | nova/tests/test_plugin_api_extensions.py | nova/tests/test_plugin_api_extensions.py | # Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | Add the plugin framework from common; use and test. | Add the plugin framework from common; use and test.
For blueprint novaplugins.
Change-Id: Id4a5ae3ebb91f941956e2f73ecfd9ea1d290a235
| Python | apache-2.0 | n0ano/ganttclient | Add the plugin framework from common; use and test.
For blueprint novaplugins.
Change-Id: Id4a5ae3ebb91f941956e2f73ecfd9ea1d290a235 | # Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | <commit_before><commit_msg>Add the plugin framework from common; use and test.
For blueprint novaplugins.
Change-Id: Id4a5ae3ebb91f941956e2f73ecfd9ea1d290a235<commit_after> | # Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | Add the plugin framework from common; use and test.
For blueprint novaplugins.
Change-Id: Id4a5ae3ebb91f941956e2f73ecfd9ea1d290a235# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the ... | <commit_before><commit_msg>Add the plugin framework from common; use and test.
For blueprint novaplugins.
Change-Id: Id4a5ae3ebb91f941956e2f73ecfd9ea1d290a235<commit_after># Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use... | |
285236e1045915706b0cf2c6137273be7f9eb5d6 | modules/module.py | modules/module.py | # module.py
# Author: Sébastien Combéfis
# Version: May 25, 2016
from abc import *
class Module(metaclass=ABCMeta):
'''Abstract class representing a generic module.'''
def __init__(self, name):
self.__name = name
@property
def name(self):
return self.__name
@abstractmetho... | Add generic abstract Module class | Modules: Add generic abstract Module class
| Python | agpl-3.0 | ECAM-Brussels/ECAMTV,ECAM-Brussels/ECAMTV,ECAM-Brussels/ECAMTV | Modules: Add generic abstract Module class | # module.py
# Author: Sébastien Combéfis
# Version: May 25, 2016
from abc import *
class Module(metaclass=ABCMeta):
'''Abstract class representing a generic module.'''
def __init__(self, name):
self.__name = name
@property
def name(self):
return self.__name
@abstractmetho... | <commit_before><commit_msg>Modules: Add generic abstract Module class<commit_after> | # module.py
# Author: Sébastien Combéfis
# Version: May 25, 2016
from abc import *
class Module(metaclass=ABCMeta):
'''Abstract class representing a generic module.'''
def __init__(self, name):
self.__name = name
@property
def name(self):
return self.__name
@abstractmetho... | Modules: Add generic abstract Module class# module.py
# Author: Sébastien Combéfis
# Version: May 25, 2016
from abc import *
class Module(metaclass=ABCMeta):
'''Abstract class representing a generic module.'''
def __init__(self, name):
self.__name = name
@property
def name(self):
... | <commit_before><commit_msg>Modules: Add generic abstract Module class<commit_after># module.py
# Author: Sébastien Combéfis
# Version: May 25, 2016
from abc import *
class Module(metaclass=ABCMeta):
'''Abstract class representing a generic module.'''
def __init__(self, name):
self.__name = name
... | |
e110c968ece35e41c467aeb5fceb9274023e7e82 | pyplaybulb/rainbow.py | pyplaybulb/rainbow.py | from pyplaybulb.playbulb import Playbulb
EFFECT_FLASH = '00'
EFFECT_PULSE = '01'
EFFECT_RAINBOW = '02'
EFFECT_RAINBOW_FADE = '03'
class Rainbow(Playbulb):
hexa_set_colour = '0x001b'
hexa_effect = '0x0019'
hexa_get_colour = '0x0019'
def set_colour(self, colour):
self.connection.char_write(self... | Create child class for Rainbow bulb | Create child class for Rainbow bulb
| Python | mit | litobro/PyPlaybulb | Create child class for Rainbow bulb | from pyplaybulb.playbulb import Playbulb
EFFECT_FLASH = '00'
EFFECT_PULSE = '01'
EFFECT_RAINBOW = '02'
EFFECT_RAINBOW_FADE = '03'
class Rainbow(Playbulb):
hexa_set_colour = '0x001b'
hexa_effect = '0x0019'
hexa_get_colour = '0x0019'
def set_colour(self, colour):
self.connection.char_write(self... | <commit_before><commit_msg>Create child class for Rainbow bulb<commit_after> | from pyplaybulb.playbulb import Playbulb
EFFECT_FLASH = '00'
EFFECT_PULSE = '01'
EFFECT_RAINBOW = '02'
EFFECT_RAINBOW_FADE = '03'
class Rainbow(Playbulb):
hexa_set_colour = '0x001b'
hexa_effect = '0x0019'
hexa_get_colour = '0x0019'
def set_colour(self, colour):
self.connection.char_write(self... | Create child class for Rainbow bulbfrom pyplaybulb.playbulb import Playbulb
EFFECT_FLASH = '00'
EFFECT_PULSE = '01'
EFFECT_RAINBOW = '02'
EFFECT_RAINBOW_FADE = '03'
class Rainbow(Playbulb):
hexa_set_colour = '0x001b'
hexa_effect = '0x0019'
hexa_get_colour = '0x0019'
def set_colour(self, colour):
... | <commit_before><commit_msg>Create child class for Rainbow bulb<commit_after>from pyplaybulb.playbulb import Playbulb
EFFECT_FLASH = '00'
EFFECT_PULSE = '01'
EFFECT_RAINBOW = '02'
EFFECT_RAINBOW_FADE = '03'
class Rainbow(Playbulb):
hexa_set_colour = '0x001b'
hexa_effect = '0x0019'
hexa_get_colour = '0x0019... | |
e233352d5016c2b57ec4edbc4366ca4347bc1d98 | demo/start_servers.py | demo/start_servers.py | """
start_servers.py
<Purpose>
A simple script to start the three cloud-side Uptane servers:
the Director (including its per-vehicle repositories)
the Image Repository
the Timeserver
To run the demo services in non-interactive mode, run:
python start_servers.py
To run the demo services in inter... | Create a single script to run the three demo services | DEMO: Create a single script to run the three demo services
(image repo, director, and timeserver)
| Python | mit | uptane/uptane,awwad/uptane,awwad/uptane,uptane/uptane | DEMO: Create a single script to run the three demo services
(image repo, director, and timeserver) | """
start_servers.py
<Purpose>
A simple script to start the three cloud-side Uptane servers:
the Director (including its per-vehicle repositories)
the Image Repository
the Timeserver
To run the demo services in non-interactive mode, run:
python start_servers.py
To run the demo services in inter... | <commit_before><commit_msg>DEMO: Create a single script to run the three demo services
(image repo, director, and timeserver)<commit_after> | """
start_servers.py
<Purpose>
A simple script to start the three cloud-side Uptane servers:
the Director (including its per-vehicle repositories)
the Image Repository
the Timeserver
To run the demo services in non-interactive mode, run:
python start_servers.py
To run the demo services in inter... | DEMO: Create a single script to run the three demo services
(image repo, director, and timeserver)"""
start_servers.py
<Purpose>
A simple script to start the three cloud-side Uptane servers:
the Director (including its per-vehicle repositories)
the Image Repository
the Timeserver
To run the demo serv... | <commit_before><commit_msg>DEMO: Create a single script to run the three demo services
(image repo, director, and timeserver)<commit_after>"""
start_servers.py
<Purpose>
A simple script to start the three cloud-side Uptane servers:
the Director (including its per-vehicle repositories)
the Image Repository
... | |
1058ed0847d151246299f73b325004fc04946fa0 | Basics/challenge_2.py | Basics/challenge_2.py | #!/usr/bin/env python
if __name__ == '__main__':
s1 = 0x1c0111001f010100061a024b53535009181c
s2 = 0x686974207468652062756c6c277320657965
print(hex(s1 ^ s2))
| Set 1 - Challenge 2 | Set 1 - Challenge 2
| Python | apache-2.0 | Scythe14/Crypto | Set 1 - Challenge 2 | #!/usr/bin/env python
if __name__ == '__main__':
s1 = 0x1c0111001f010100061a024b53535009181c
s2 = 0x686974207468652062756c6c277320657965
print(hex(s1 ^ s2))
| <commit_before><commit_msg>Set 1 - Challenge 2<commit_after> | #!/usr/bin/env python
if __name__ == '__main__':
s1 = 0x1c0111001f010100061a024b53535009181c
s2 = 0x686974207468652062756c6c277320657965
print(hex(s1 ^ s2))
| Set 1 - Challenge 2#!/usr/bin/env python
if __name__ == '__main__':
s1 = 0x1c0111001f010100061a024b53535009181c
s2 = 0x686974207468652062756c6c277320657965
print(hex(s1 ^ s2))
| <commit_before><commit_msg>Set 1 - Challenge 2<commit_after>#!/usr/bin/env python
if __name__ == '__main__':
s1 = 0x1c0111001f010100061a024b53535009181c
s2 = 0x686974207468652062756c6c277320657965
print(hex(s1 ^ s2))
| |
37704a2e905342bf867225fb5a8a3fec0c55a9fd | Problems/stringDiff.py | Problems/stringDiff.py | #!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
tests = [
[None, None, None], # Should throw a TypeError
['abcd', 'abcde', 'e'],
['aaabbcdd', 'abdbacade', 'e'],
['abdbacade', 'aaabbcdd', 'e']
]
for item in tests:
try:
temp_result ... | Add strDiff problem and tests. Minor tweak to setup.py | Add strDiff problem and tests. Minor tweak to setup.py
| Python | mit | HKuz/Test_Code | Add strDiff problem and tests. Minor tweak to setup.py | #!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
tests = [
[None, None, None], # Should throw a TypeError
['abcd', 'abcde', 'e'],
['aaabbcdd', 'abdbacade', 'e'],
['abdbacade', 'aaabbcdd', 'e']
]
for item in tests:
try:
temp_result ... | <commit_before><commit_msg>Add strDiff problem and tests. Minor tweak to setup.py<commit_after> | #!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
tests = [
[None, None, None], # Should throw a TypeError
['abcd', 'abcde', 'e'],
['aaabbcdd', 'abdbacade', 'e'],
['abdbacade', 'aaabbcdd', 'e']
]
for item in tests:
try:
temp_result ... | Add strDiff problem and tests. Minor tweak to setup.py#!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
tests = [
[None, None, None], # Should throw a TypeError
['abcd', 'abcde', 'e'],
['aaabbcdd', 'abdbacade', 'e'],
['abdbacade', 'aaabbcdd', 'e']
]
fo... | <commit_before><commit_msg>Add strDiff problem and tests. Minor tweak to setup.py<commit_after>#!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
tests = [
[None, None, None], # Should throw a TypeError
['abcd', 'abcde', 'e'],
['aaabbcdd', 'abdbacade', 'e'],
['a... | |
e120f5fac68e2daf7cdf6e9d7b17b1f63a330595 | djangoappengine/db/expressions.py | djangoappengine/db/expressions.py | from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.expressions import ExpressionNode
OPERATION_MAP = {
ExpressionNode.ADD: lambda x, y: x + y,
ExpressionNode.SUB: lambda x, y: x - y,
ExpressionNode.MUL: lambda x, y: x * y,
ExpressionNode.DIV: lambda x, y: x / y,
Expres... | from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.expressions import ExpressionNode
OPERATION_MAP = {
ExpressionNode.ADD: lambda x, y: x + y,
ExpressionNode.SUB: lambda x, y: x - y,
ExpressionNode.MUL: lambda x, y: x * y,
ExpressionNode.DIV: lambda x, y: x / y,
Expres... | Fix ExpressionNode names that changed in django 1.5 | Fix ExpressionNode names that changed in django 1.5
| Python | bsd-3-clause | django-nonrel/djangoappengine,Implisit/djangoappengine,dwdraju/djangoappengine | from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.expressions import ExpressionNode
OPERATION_MAP = {
ExpressionNode.ADD: lambda x, y: x + y,
ExpressionNode.SUB: lambda x, y: x - y,
ExpressionNode.MUL: lambda x, y: x * y,
ExpressionNode.DIV: lambda x, y: x / y,
Expres... | from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.expressions import ExpressionNode
OPERATION_MAP = {
ExpressionNode.ADD: lambda x, y: x + y,
ExpressionNode.SUB: lambda x, y: x - y,
ExpressionNode.MUL: lambda x, y: x * y,
ExpressionNode.DIV: lambda x, y: x / y,
Expres... | <commit_before>from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.expressions import ExpressionNode
OPERATION_MAP = {
ExpressionNode.ADD: lambda x, y: x + y,
ExpressionNode.SUB: lambda x, y: x - y,
ExpressionNode.MUL: lambda x, y: x * y,
ExpressionNode.DIV: lambda x, y: x ... | from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.expressions import ExpressionNode
OPERATION_MAP = {
ExpressionNode.ADD: lambda x, y: x + y,
ExpressionNode.SUB: lambda x, y: x - y,
ExpressionNode.MUL: lambda x, y: x * y,
ExpressionNode.DIV: lambda x, y: x / y,
Expres... | from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.expressions import ExpressionNode
OPERATION_MAP = {
ExpressionNode.ADD: lambda x, y: x + y,
ExpressionNode.SUB: lambda x, y: x - y,
ExpressionNode.MUL: lambda x, y: x * y,
ExpressionNode.DIV: lambda x, y: x / y,
Expres... | <commit_before>from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.expressions import ExpressionNode
OPERATION_MAP = {
ExpressionNode.ADD: lambda x, y: x + y,
ExpressionNode.SUB: lambda x, y: x - y,
ExpressionNode.MUL: lambda x, y: x * y,
ExpressionNode.DIV: lambda x, y: x ... |
31f16844dd98516b1f57e3913d0fdba3e5715aa8 | logicaldelete/models.py | logicaldelete/models.py | import datetime
from django.db import models
from logicaldelete import managers
class Model(models.Model):
"""
This base model provides date fields and functionality to enable logical
delete functionality in derived models.
"""
date_created = models.DateTimeField(default=datetime.datetime.... | import datetime
from django.db import models
from logicaldelete import managers
class Model(models.Model):
"""
This base model provides date fields and functionality to enable logical
delete functionality in derived models.
"""
date_created = models.DateTimeField(default=datetime.datetime.now)
... | Delete method now softdeletep's all FK related objects | Delete method now softdeletep's all FK related objects
| Python | mit | pinax/pinax-models,angvp/django-logical-delete,Ubiwhere/pinax-models,angvp/django-logical-delete,naringas/pinax-models | import datetime
from django.db import models
from logicaldelete import managers
class Model(models.Model):
"""
This base model provides date fields and functionality to enable logical
delete functionality in derived models.
"""
date_created = models.DateTimeField(default=datetime.datetime.... | import datetime
from django.db import models
from logicaldelete import managers
class Model(models.Model):
"""
This base model provides date fields and functionality to enable logical
delete functionality in derived models.
"""
date_created = models.DateTimeField(default=datetime.datetime.now)
... | <commit_before>import datetime
from django.db import models
from logicaldelete import managers
class Model(models.Model):
"""
This base model provides date fields and functionality to enable logical
delete functionality in derived models.
"""
date_created = models.DateTimeField(default=dat... | import datetime
from django.db import models
from logicaldelete import managers
class Model(models.Model):
"""
This base model provides date fields and functionality to enable logical
delete functionality in derived models.
"""
date_created = models.DateTimeField(default=datetime.datetime.now)
... | import datetime
from django.db import models
from logicaldelete import managers
class Model(models.Model):
"""
This base model provides date fields and functionality to enable logical
delete functionality in derived models.
"""
date_created = models.DateTimeField(default=datetime.datetime.... | <commit_before>import datetime
from django.db import models
from logicaldelete import managers
class Model(models.Model):
"""
This base model provides date fields and functionality to enable logical
delete functionality in derived models.
"""
date_created = models.DateTimeField(default=dat... |
3dfc4bfbb71d1e97a6b8213f338df487fbae5fcc | topics/migrations/0016_auto_20151221_0923.py | topics/migrations/0016_auto_20151221_0923.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('topics', '0015_auto_20151218_1823'),
]
operations = [
migrations.AlterField(
model_... | Add auto migration for minor model changes | Add auto migration for minor model changes
| Python | mit | andychase/codebook,andychase/codebook | Add auto migration for minor model changes | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('topics', '0015_auto_20151218_1823'),
]
operations = [
migrations.AlterField(
model_... | <commit_before><commit_msg>Add auto migration for minor model changes<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('topics', '0015_auto_20151218_1823'),
]
operations = [
migrations.AlterField(
model_... | Add auto migration for minor model changes# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('topics', '0015_auto_20151218_1823'),
]
operations = [
... | <commit_before><commit_msg>Add auto migration for minor model changes<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('topics', '0015_auto_20151218_... | |
2207351e805f11c39f843ca0e0eff261a7a5bde8 | python/010_summation_of_primes/primes.py | python/010_summation_of_primes/primes.py | from math import sqrt
from typing import Generator
def prime_generator(limit: int) -> Generator[int, None, int]:
if limit < 2:
return
else:
yield 2
primes = [2]
for x in range(3, limit + 1, 2):
if any(map(lambda divisor: x % divisor == 0, primes[: int(sqrt(x))])):
c... | Add half-naive solution to problem 10 | Add half-naive solution to problem 10
| Python | bsd-3-clause | gidj/euler,gidj/euler | Add half-naive solution to problem 10 | from math import sqrt
from typing import Generator
def prime_generator(limit: int) -> Generator[int, None, int]:
if limit < 2:
return
else:
yield 2
primes = [2]
for x in range(3, limit + 1, 2):
if any(map(lambda divisor: x % divisor == 0, primes[: int(sqrt(x))])):
c... | <commit_before><commit_msg>Add half-naive solution to problem 10<commit_after> | from math import sqrt
from typing import Generator
def prime_generator(limit: int) -> Generator[int, None, int]:
if limit < 2:
return
else:
yield 2
primes = [2]
for x in range(3, limit + 1, 2):
if any(map(lambda divisor: x % divisor == 0, primes[: int(sqrt(x))])):
c... | Add half-naive solution to problem 10from math import sqrt
from typing import Generator
def prime_generator(limit: int) -> Generator[int, None, int]:
if limit < 2:
return
else:
yield 2
primes = [2]
for x in range(3, limit + 1, 2):
if any(map(lambda divisor: x % divisor == 0, pr... | <commit_before><commit_msg>Add half-naive solution to problem 10<commit_after>from math import sqrt
from typing import Generator
def prime_generator(limit: int) -> Generator[int, None, int]:
if limit < 2:
return
else:
yield 2
primes = [2]
for x in range(3, limit + 1, 2):
if any... | |
747ff2fbaf9e6216ba932f446418819723611174 | euler/solutions/solution_12.py | euler/solutions/solution_12.py | """Highly divisible triangular number
The sequence of triangle numbers is generated by adding the natural numbers.
The 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28.
The first ten terms would be:
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
Let us list the factors of the first seven triangle numbers:
1:... | Add solution for problem 12 | Add solution for problem 12
Highly divisible triangular number
| Python | mit | rlucioni/project-euler | Add solution for problem 12
Highly divisible triangular number | """Highly divisible triangular number
The sequence of triangle numbers is generated by adding the natural numbers.
The 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28.
The first ten terms would be:
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
Let us list the factors of the first seven triangle numbers:
1:... | <commit_before><commit_msg>Add solution for problem 12
Highly divisible triangular number<commit_after> | """Highly divisible triangular number
The sequence of triangle numbers is generated by adding the natural numbers.
The 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28.
The first ten terms would be:
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
Let us list the factors of the first seven triangle numbers:
1:... | Add solution for problem 12
Highly divisible triangular number"""Highly divisible triangular number
The sequence of triangle numbers is generated by adding the natural numbers.
The 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28.
The first ten terms would be:
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
L... | <commit_before><commit_msg>Add solution for problem 12
Highly divisible triangular number<commit_after>"""Highly divisible triangular number
The sequence of triangle numbers is generated by adding the natural numbers.
The 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28.
The first ten terms would be:
1,... | |
65aee742ea0e95b200152f8a90d9ad5ee86b2512 | scripts/locustfile.py | scripts/locustfile.py | from locust import HttpLocust, TaskSet, task
import urllib
from faker import Faker
fake = Faker()
class SPARQLQueryTasks(TaskSet):
@task
def query_simple(self):
self.client.get("/sparql/?query=select+%2A+where+%7B+%3Fs+%3Fp+%3Fo+%7D+limit+0")
@task
def query_realistic(self):
self.clie... | Add a Locust load testing script | Add a Locust load testing script
This isn't quite doing everything I want but it's a nice way to check some performance characteristics
| Python | apache-2.0 | ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod | Add a Locust load testing script
This isn't quite doing everything I want but it's a nice way to check some performance characteristics | from locust import HttpLocust, TaskSet, task
import urllib
from faker import Faker
fake = Faker()
class SPARQLQueryTasks(TaskSet):
@task
def query_simple(self):
self.client.get("/sparql/?query=select+%2A+where+%7B+%3Fs+%3Fp+%3Fo+%7D+limit+0")
@task
def query_realistic(self):
self.clie... | <commit_before><commit_msg>Add a Locust load testing script
This isn't quite doing everything I want but it's a nice way to check some performance characteristics<commit_after> | from locust import HttpLocust, TaskSet, task
import urllib
from faker import Faker
fake = Faker()
class SPARQLQueryTasks(TaskSet):
@task
def query_simple(self):
self.client.get("/sparql/?query=select+%2A+where+%7B+%3Fs+%3Fp+%3Fo+%7D+limit+0")
@task
def query_realistic(self):
self.clie... | Add a Locust load testing script
This isn't quite doing everything I want but it's a nice way to check some performance characteristicsfrom locust import HttpLocust, TaskSet, task
import urllib
from faker import Faker
fake = Faker()
class SPARQLQueryTasks(TaskSet):
@task
def query_simple(self):
self.... | <commit_before><commit_msg>Add a Locust load testing script
This isn't quite doing everything I want but it's a nice way to check some performance characteristics<commit_after>from locust import HttpLocust, TaskSet, task
import urllib
from faker import Faker
fake = Faker()
class SPARQLQueryTasks(TaskSet):
@task
... | |
e84d811f13347da3625e3a30d200e836f6393e9d | scripts/obo_to_sql.py | scripts/obo_to_sql.py | # Note: based on - http://blog.adimian.com/2014/10/cte-and-closure-tables/
import sqlite3
conn = sqlite3.connect('test.db')
cursor = conn.cursor()
def create_tables():
'''
Creates the two tables used to store the ontology concepts and terms.
- 'nodes' stores the .obo content.
- 'closure' stor... | Store OBO data into a suitable queryable format | Store OBO data into a suitable queryable format
Achieved using transitive closures, which allows a hierarchy structure
(OBO ontology) to be stored in a SQL format.
| Python | mit | jawrainey/healthchat,jawrainey/healthchat | Store OBO data into a suitable queryable format
Achieved using transitive closures, which allows a hierarchy structure
(OBO ontology) to be stored in a SQL format. | # Note: based on - http://blog.adimian.com/2014/10/cte-and-closure-tables/
import sqlite3
conn = sqlite3.connect('test.db')
cursor = conn.cursor()
def create_tables():
'''
Creates the two tables used to store the ontology concepts and terms.
- 'nodes' stores the .obo content.
- 'closure' stor... | <commit_before><commit_msg>Store OBO data into a suitable queryable format
Achieved using transitive closures, which allows a hierarchy structure
(OBO ontology) to be stored in a SQL format.<commit_after> | # Note: based on - http://blog.adimian.com/2014/10/cte-and-closure-tables/
import sqlite3
conn = sqlite3.connect('test.db')
cursor = conn.cursor()
def create_tables():
'''
Creates the two tables used to store the ontology concepts and terms.
- 'nodes' stores the .obo content.
- 'closure' stor... | Store OBO data into a suitable queryable format
Achieved using transitive closures, which allows a hierarchy structure
(OBO ontology) to be stored in a SQL format.# Note: based on - http://blog.adimian.com/2014/10/cte-and-closure-tables/
import sqlite3
conn = sqlite3.connect('test.db')
cursor = conn.cursor()
def cr... | <commit_before><commit_msg>Store OBO data into a suitable queryable format
Achieved using transitive closures, which allows a hierarchy structure
(OBO ontology) to be stored in a SQL format.<commit_after># Note: based on - http://blog.adimian.com/2014/10/cte-and-closure-tables/
import sqlite3
conn = sqlite3.connect('... | |
9b48cb18980ae2e55ce02a84576f65f0bd8a27bb | FacebookPlugins.py | FacebookPlugins.py | """
@note: enable X
"""
from trac.core import Component
from trac.wiki.macros import WikiMacroBase
class FacebookPlugins(Component):
"""
Support for Facebook plugins.
"""
revision = "$Rev$"
url = "$URL$"
class LikeButton(WikiMacroBase):
"""
The [http://developers.facebook.com/docs/... | Add wiki macro for the Like button. | Add wiki macro for the Like button.
| Python | mit | thijstriemstra/trac-facebook-plugins | Add wiki macro for the Like button. | """
@note: enable X
"""
from trac.core import Component
from trac.wiki.macros import WikiMacroBase
class FacebookPlugins(Component):
"""
Support for Facebook plugins.
"""
revision = "$Rev$"
url = "$URL$"
class LikeButton(WikiMacroBase):
"""
The [http://developers.facebook.com/docs/... | <commit_before><commit_msg>Add wiki macro for the Like button.<commit_after> | """
@note: enable X
"""
from trac.core import Component
from trac.wiki.macros import WikiMacroBase
class FacebookPlugins(Component):
"""
Support for Facebook plugins.
"""
revision = "$Rev$"
url = "$URL$"
class LikeButton(WikiMacroBase):
"""
The [http://developers.facebook.com/docs/... | Add wiki macro for the Like button."""
@note: enable X
"""
from trac.core import Component
from trac.wiki.macros import WikiMacroBase
class FacebookPlugins(Component):
"""
Support for Facebook plugins.
"""
revision = "$Rev$"
url = "$URL$"
class LikeButton(WikiMacroBase):
"""
The [h... | <commit_before><commit_msg>Add wiki macro for the Like button.<commit_after>"""
@note: enable X
"""
from trac.core import Component
from trac.wiki.macros import WikiMacroBase
class FacebookPlugins(Component):
"""
Support for Facebook plugins.
"""
revision = "$Rev$"
url = "$URL$"
class Like... | |
fc72ca537e6eaf5f4bf04ed4511ec1acdd9eae11 | checks/check_deprecation_warning.py | checks/check_deprecation_warning.py | from __future__ import print_function, absolute_import, division
import imgaug as ia
class Dummy1(object):
@ia.deprecated(alt_func="Foo")
def __init__(self):
pass
class Dummy2(object):
@ia.deprecated(alt_func="Foo", comment="Some example comment.")
def __init__(self):
pass
class D... | Add check script to test 'deprecated' decorator | Add check script to test 'deprecated' decorator
| Python | mit | aleju/imgaug,aleju/imgaug,aleju/ImageAugmenter | Add check script to test 'deprecated' decorator | from __future__ import print_function, absolute_import, division
import imgaug as ia
class Dummy1(object):
@ia.deprecated(alt_func="Foo")
def __init__(self):
pass
class Dummy2(object):
@ia.deprecated(alt_func="Foo", comment="Some example comment.")
def __init__(self):
pass
class D... | <commit_before><commit_msg>Add check script to test 'deprecated' decorator<commit_after> | from __future__ import print_function, absolute_import, division
import imgaug as ia
class Dummy1(object):
@ia.deprecated(alt_func="Foo")
def __init__(self):
pass
class Dummy2(object):
@ia.deprecated(alt_func="Foo", comment="Some example comment.")
def __init__(self):
pass
class D... | Add check script to test 'deprecated' decoratorfrom __future__ import print_function, absolute_import, division
import imgaug as ia
class Dummy1(object):
@ia.deprecated(alt_func="Foo")
def __init__(self):
pass
class Dummy2(object):
@ia.deprecated(alt_func="Foo", comment="Some example comment.")... | <commit_before><commit_msg>Add check script to test 'deprecated' decorator<commit_after>from __future__ import print_function, absolute_import, division
import imgaug as ia
class Dummy1(object):
@ia.deprecated(alt_func="Foo")
def __init__(self):
pass
class Dummy2(object):
@ia.deprecated(alt_fun... | |
c97ab456f22dca6a69e3775cc1353dbf3957389a | homeassistant/components/light/limitlessled.py | homeassistant/components/light/limitlessled.py | """
homeassistant.components.light.limitlessled
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for LimitlessLED bulbs, also known as...
EasyBulb
AppLight
AppLamp
MiLight
LEDme
dekolight
iLight
"""
import random
import logging
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.const import STATE_O... | Add basic support for LimitlessLED | Add basic support for LimitlessLED
| Python | apache-2.0 | sfam/home-assistant,ErykB2000/home-assistant,open-homeautomation/home-assistant,Danielhiversen/home-assistant,toddeye/home-assistant,nugget/home-assistant,open-homeautomation/home-assistant,deisi/home-assistant,EricRho/home-assistant,tboyce021/home-assistant,theolind/home-assistant,mKeRix/home-assistant,Duoxilian/home-... | Add basic support for LimitlessLED | """
homeassistant.components.light.limitlessled
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for LimitlessLED bulbs, also known as...
EasyBulb
AppLight
AppLamp
MiLight
LEDme
dekolight
iLight
"""
import random
import logging
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.const import STATE_O... | <commit_before><commit_msg>Add basic support for LimitlessLED<commit_after> | """
homeassistant.components.light.limitlessled
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for LimitlessLED bulbs, also known as...
EasyBulb
AppLight
AppLamp
MiLight
LEDme
dekolight
iLight
"""
import random
import logging
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.const import STATE_O... | Add basic support for LimitlessLED"""
homeassistant.components.light.limitlessled
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for LimitlessLED bulbs, also known as...
EasyBulb
AppLight
AppLamp
MiLight
LEDme
dekolight
iLight
"""
import random
import logging
from homeassistant.helpers.entity import ToggleEntity
from ... | <commit_before><commit_msg>Add basic support for LimitlessLED<commit_after>"""
homeassistant.components.light.limitlessled
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for LimitlessLED bulbs, also known as...
EasyBulb
AppLight
AppLamp
MiLight
LEDme
dekolight
iLight
"""
import random
import logging
from homeassistant... | |
10318a11dded5e69c3d9c98325613700c9b3db63 | lib/spack/spack/cmd/dependents.py | lib/spack/spack/cmd/dependents.py | ##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
... | Fix for dependent package detection. | Fix for dependent package detection.
| Python | lgpl-2.1 | lgarren/spack,lgarren/spack,iulian787/spack,mfherbst/spack,skosukhin/spack,LLNL/spack,LLNL/spack,EmreAtes/spack,iulian787/spack,tmerrick1/spack,TheTimmy/spack,mfherbst/spack,mfherbst/spack,tmerrick1/spack,lgarren/spack,krafczyk/spack,iulian787/spack,krafczyk/spack,skosukhin/spack,matthiasdiener/spack,lgarren/spack,Emre... | Fix for dependent package detection. | ##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
... | <commit_before><commit_msg>Fix for dependent package detection.<commit_after> | ##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
... | Fix for dependent package detection.##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Todd Gamblin, tgamblin@llnl.gov, All ... | <commit_before><commit_msg>Fix for dependent package detection.<commit_after>##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written... | |
8d1016437e87794fb39b447b51427bae98a51bc2 | classes/jsonip.py | classes/jsonip.py | from json import load
from urllib2 import urlopen
class JsonIp:
def __init__(self):
url = 'https://jsonip.com/'
uri = urlopen(url)
response = load(uri)
self.ip = response["ip"]
# self.ip = '1.1.1.1'
| Add one public IP provider | Add one public IP provider
| Python | mit | Saphyel/ipteller,Saphyel/ipteller | Add one public IP provider | from json import load
from urllib2 import urlopen
class JsonIp:
def __init__(self):
url = 'https://jsonip.com/'
uri = urlopen(url)
response = load(uri)
self.ip = response["ip"]
# self.ip = '1.1.1.1'
| <commit_before><commit_msg>Add one public IP provider<commit_after> | from json import load
from urllib2 import urlopen
class JsonIp:
def __init__(self):
url = 'https://jsonip.com/'
uri = urlopen(url)
response = load(uri)
self.ip = response["ip"]
# self.ip = '1.1.1.1'
| Add one public IP providerfrom json import load
from urllib2 import urlopen
class JsonIp:
def __init__(self):
url = 'https://jsonip.com/'
uri = urlopen(url)
response = load(uri)
self.ip = response["ip"]
# self.ip = '1.1.1.1'
| <commit_before><commit_msg>Add one public IP provider<commit_after>from json import load
from urllib2 import urlopen
class JsonIp:
def __init__(self):
url = 'https://jsonip.com/'
uri = urlopen(url)
response = load(uri)
self.ip = response["ip"]
# self.ip = '1.1.1.1'
| |
ef1fa03d753f5d8a0b32831320a1b3e076ace363 | moksha/apps/demo/MokshaJQPlotDemo/run_tests.py | moksha/apps/demo/MokshaJQPlotDemo/run_tests.py | #!/usr/bin/env python
"""
nose runner script.
"""
__requires__ = 'moksha'
import pkg_resources
import nose
if __name__ == '__main__':
nose.main()
| Add a test runner for our jqplot demo too | Add a test runner for our jqplot demo too
| Python | apache-2.0 | ralphbean/moksha,mokshaproject/moksha,lmacken/moksha,mokshaproject/moksha,pombredanne/moksha,mokshaproject/moksha,pombredanne/moksha,ralphbean/moksha,lmacken/moksha,lmacken/moksha,ralphbean/moksha,pombredanne/moksha,pombredanne/moksha,mokshaproject/moksha | Add a test runner for our jqplot demo too | #!/usr/bin/env python
"""
nose runner script.
"""
__requires__ = 'moksha'
import pkg_resources
import nose
if __name__ == '__main__':
nose.main()
| <commit_before><commit_msg>Add a test runner for our jqplot demo too<commit_after> | #!/usr/bin/env python
"""
nose runner script.
"""
__requires__ = 'moksha'
import pkg_resources
import nose
if __name__ == '__main__':
nose.main()
| Add a test runner for our jqplot demo too#!/usr/bin/env python
"""
nose runner script.
"""
__requires__ = 'moksha'
import pkg_resources
import nose
if __name__ == '__main__':
nose.main()
| <commit_before><commit_msg>Add a test runner for our jqplot demo too<commit_after>#!/usr/bin/env python
"""
nose runner script.
"""
__requires__ = 'moksha'
import pkg_resources
import nose
if __name__ == '__main__':
nose.main()
| |
c8ec0689950a5fea0aff98afe54b172bd84e2ce9 | examples/coregister.py | examples/coregister.py | """Example using Tom's registration code from scipy.
"""
from os import path
from glob import glob
import scipy.ndimage._registration as reg
# Data files
basedir = '/Users/cburns/data/twaite'
anatfile = path.join(basedir, 'ANAT1_V0001.img')
funcdir = path.join(basedir, 'fMRIData')
fileglob = path.join(funcdir, 'FUN... | Add example using Tom's registration code in scipy. | Add example using Tom's registration code in scipy. | Python | bsd-3-clause | yarikoptic/NiPy-OLD,yarikoptic/NiPy-OLD | Add example using Tom's registration code in scipy. | """Example using Tom's registration code from scipy.
"""
from os import path
from glob import glob
import scipy.ndimage._registration as reg
# Data files
basedir = '/Users/cburns/data/twaite'
anatfile = path.join(basedir, 'ANAT1_V0001.img')
funcdir = path.join(basedir, 'fMRIData')
fileglob = path.join(funcdir, 'FUN... | <commit_before><commit_msg>Add example using Tom's registration code in scipy.<commit_after> | """Example using Tom's registration code from scipy.
"""
from os import path
from glob import glob
import scipy.ndimage._registration as reg
# Data files
basedir = '/Users/cburns/data/twaite'
anatfile = path.join(basedir, 'ANAT1_V0001.img')
funcdir = path.join(basedir, 'fMRIData')
fileglob = path.join(funcdir, 'FUN... | Add example using Tom's registration code in scipy."""Example using Tom's registration code from scipy.
"""
from os import path
from glob import glob
import scipy.ndimage._registration as reg
# Data files
basedir = '/Users/cburns/data/twaite'
anatfile = path.join(basedir, 'ANAT1_V0001.img')
funcdir = path.join(base... | <commit_before><commit_msg>Add example using Tom's registration code in scipy.<commit_after>"""Example using Tom's registration code from scipy.
"""
from os import path
from glob import glob
import scipy.ndimage._registration as reg
# Data files
basedir = '/Users/cburns/data/twaite'
anatfile = path.join(basedir, 'A... | |
62b01c3c1614d5719cc69be951b2f6c660e40faa | pyldap/libldap/tools.py | pyldap/libldap/tools.py | def iterate_array(arr, f=None):
i = 0
while True:
if not arr[i]:
break
yield arr[i] if f is None else f(arr[i])
i += 1 | Add generic function for iterating arrays. | Add generic function for iterating arrays.
| Python | bsd-3-clause | matusvalo/python-easyldap | Add generic function for iterating arrays. | def iterate_array(arr, f=None):
i = 0
while True:
if not arr[i]:
break
yield arr[i] if f is None else f(arr[i])
i += 1 | <commit_before><commit_msg>Add generic function for iterating arrays.<commit_after> | def iterate_array(arr, f=None):
i = 0
while True:
if not arr[i]:
break
yield arr[i] if f is None else f(arr[i])
i += 1 | Add generic function for iterating arrays.def iterate_array(arr, f=None):
i = 0
while True:
if not arr[i]:
break
yield arr[i] if f is None else f(arr[i])
i += 1 | <commit_before><commit_msg>Add generic function for iterating arrays.<commit_after>def iterate_array(arr, f=None):
i = 0
while True:
if not arr[i]:
break
yield arr[i] if f is None else f(arr[i])
i += 1 | |
b9759f60c9f107c3d2c319f53ed2985ee58dc319 | src/tests/test_mock_pose.py | src/tests/test_mock_pose.py | try:
from unittest.mock import patch, MagicMock
except ImportError:
from mock import patch, MagicMock
import pytest
import rospy
MockTf2 = MagicMock()
modules = {"tf2_ros": MockTf2}
patcher = patch.dict("sys.modules", modules)
patcher.start()
try:
rospy.init_node("pytest", anonymous=True)
except rospy.... | Write test for mock_pose generator. | Write test for mock_pose generator.
| Python | mit | masasin/spirit,masasin/spirit | Write test for mock_pose generator. | try:
from unittest.mock import patch, MagicMock
except ImportError:
from mock import patch, MagicMock
import pytest
import rospy
MockTf2 = MagicMock()
modules = {"tf2_ros": MockTf2}
patcher = patch.dict("sys.modules", modules)
patcher.start()
try:
rospy.init_node("pytest", anonymous=True)
except rospy.... | <commit_before><commit_msg>Write test for mock_pose generator.<commit_after> | try:
from unittest.mock import patch, MagicMock
except ImportError:
from mock import patch, MagicMock
import pytest
import rospy
MockTf2 = MagicMock()
modules = {"tf2_ros": MockTf2}
patcher = patch.dict("sys.modules", modules)
patcher.start()
try:
rospy.init_node("pytest", anonymous=True)
except rospy.... | Write test for mock_pose generator.try:
from unittest.mock import patch, MagicMock
except ImportError:
from mock import patch, MagicMock
import pytest
import rospy
MockTf2 = MagicMock()
modules = {"tf2_ros": MockTf2}
patcher = patch.dict("sys.modules", modules)
patcher.start()
try:
rospy.init_node("pyt... | <commit_before><commit_msg>Write test for mock_pose generator.<commit_after>try:
from unittest.mock import patch, MagicMock
except ImportError:
from mock import patch, MagicMock
import pytest
import rospy
MockTf2 = MagicMock()
modules = {"tf2_ros": MockTf2}
patcher = patch.dict("sys.modules", modules)
patche... | |
b3dcbe95d766d902d22a0c4c171cbbe5ce207571 | python/tests/stress_test.py | python/tests/stress_test.py | #!/usr/bin/env python
import time
import sys
import os
from random import randint
# Hack to import from a parent dir
# http://stackoverflow.com/a/11158224/401554
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, parentdir)
from octo import Octo
octo = Octo('/dev/ttyACM0')
oct... | Add test for longitivity-testing: both LED-s ON at the same time for extended periods of time | Add test for longitivity-testing: both LED-s ON at the same time for extended periods of time
| Python | mit | anroots/teensy-moonica | Add test for longitivity-testing: both LED-s ON at the same time for extended periods of time | #!/usr/bin/env python
import time
import sys
import os
from random import randint
# Hack to import from a parent dir
# http://stackoverflow.com/a/11158224/401554
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, parentdir)
from octo import Octo
octo = Octo('/dev/ttyACM0')
oct... | <commit_before><commit_msg>Add test for longitivity-testing: both LED-s ON at the same time for extended periods of time<commit_after> | #!/usr/bin/env python
import time
import sys
import os
from random import randint
# Hack to import from a parent dir
# http://stackoverflow.com/a/11158224/401554
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, parentdir)
from octo import Octo
octo = Octo('/dev/ttyACM0')
oct... | Add test for longitivity-testing: both LED-s ON at the same time for extended periods of time#!/usr/bin/env python
import time
import sys
import os
from random import randint
# Hack to import from a parent dir
# http://stackoverflow.com/a/11158224/401554
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__fi... | <commit_before><commit_msg>Add test for longitivity-testing: both LED-s ON at the same time for extended periods of time<commit_after>#!/usr/bin/env python
import time
import sys
import os
from random import randint
# Hack to import from a parent dir
# http://stackoverflow.com/a/11158224/401554
parentdir = os.path.dir... | |
407c08899eccea60a2ae534ab0c1b000c58708ab | tests/test_agent_api.py | tests/test_agent_api.py | # No shebang line, this module is meant to be imported
#
# Copyright 2013 Oliver Palmer
# Copyright 2013 Ambient Entertainment GmbH & Co. KG
#
# 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
#
... | Implement some tests for AgentAPI | Implement some tests for AgentAPI
| Python | apache-2.0 | pyfarm/pyfarm-master,pyfarm/pyfarm-master,pyfarm/pyfarm-master | Implement some tests for AgentAPI | # No shebang line, this module is meant to be imported
#
# Copyright 2013 Oliver Palmer
# Copyright 2013 Ambient Entertainment GmbH & Co. KG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
... | <commit_before><commit_msg>Implement some tests for AgentAPI<commit_after> | # No shebang line, this module is meant to be imported
#
# Copyright 2013 Oliver Palmer
# Copyright 2013 Ambient Entertainment GmbH & Co. KG
#
# 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
#
... | Implement some tests for AgentAPI# No shebang line, this module is meant to be imported
#
# Copyright 2013 Oliver Palmer
# Copyright 2013 Ambient Entertainment GmbH & Co. KG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may o... | <commit_before><commit_msg>Implement some tests for AgentAPI<commit_after># No shebang line, this module is meant to be imported
#
# Copyright 2013 Oliver Palmer
# Copyright 2013 Ambient Entertainment GmbH & Co. KG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in... | |
33448340d278da7e0653701d78cbab317893279d | AG/datasets/analyze.py | AG/datasets/analyze.py | #!/usr/bin/python
import os
import sys
import lxml
from lxml import etree
import math
class StatsCounter(object):
prefixes = {}
cur_tag = None
def start( self, tag, attrib ):
self.cur_tag = tag
def end( self, tag ):
pass
#self.cur_tag = None
def data( self, _data ):
... | Add a simple analysis tool to get some structural properties about an AG's specfile. | Add a simple analysis tool to get some structural properties about an
AG's specfile.
| Python | apache-2.0 | jcnelson/syndicate,iychoi/syndicate,iychoi/syndicate,jcnelson/syndicate,iychoi/syndicate,iychoi/syndicate,iychoi/syndicate,iychoi/syndicate,iychoi/syndicate,jcnelson/syndicate,jcnelson/syndicate,jcnelson/syndicate,jcnelson/syndicate,iychoi/syndicate,jcnelson/syndicate,jcnelson/syndicate | Add a simple analysis tool to get some structural properties about an
AG's specfile. | #!/usr/bin/python
import os
import sys
import lxml
from lxml import etree
import math
class StatsCounter(object):
prefixes = {}
cur_tag = None
def start( self, tag, attrib ):
self.cur_tag = tag
def end( self, tag ):
pass
#self.cur_tag = None
def data( self, _data ):
... | <commit_before><commit_msg>Add a simple analysis tool to get some structural properties about an
AG's specfile.<commit_after> | #!/usr/bin/python
import os
import sys
import lxml
from lxml import etree
import math
class StatsCounter(object):
prefixes = {}
cur_tag = None
def start( self, tag, attrib ):
self.cur_tag = tag
def end( self, tag ):
pass
#self.cur_tag = None
def data( self, _data ):
... | Add a simple analysis tool to get some structural properties about an
AG's specfile.#!/usr/bin/python
import os
import sys
import lxml
from lxml import etree
import math
class StatsCounter(object):
prefixes = {}
cur_tag = None
def start( self, tag, attrib ):
self.cur_tag = tag
def end( se... | <commit_before><commit_msg>Add a simple analysis tool to get some structural properties about an
AG's specfile.<commit_after>#!/usr/bin/python
import os
import sys
import lxml
from lxml import etree
import math
class StatsCounter(object):
prefixes = {}
cur_tag = None
def start( self, tag, attrib ):
... | |
a9ca7f2f22551256213ecd32047022048c72db5c | scripts/convert_svgs.py | scripts/convert_svgs.py | import cairosvg
import os
# MUST RUN IN PYTHON 3 and pip install cairosvg
file_dir = '../data/hough_test/Test_Set_1/'
svgs = os.listdir(os.path.join(file_dir, 'SVGs'))
for svg in svgs:
name = svg.split('.svg')[0]
cairosvg.svg2png(url=os.path.join(file_dir, 'SVGs', svg),
write_to=os.path... | Add Python 3 Script for Converting Image Types | Add Python 3 Script for Converting Image Types
| Python | mit | Molecular-Image-Recognition/Molecular-Image-Recognition | Add Python 3 Script for Converting Image Types | import cairosvg
import os
# MUST RUN IN PYTHON 3 and pip install cairosvg
file_dir = '../data/hough_test/Test_Set_1/'
svgs = os.listdir(os.path.join(file_dir, 'SVGs'))
for svg in svgs:
name = svg.split('.svg')[0]
cairosvg.svg2png(url=os.path.join(file_dir, 'SVGs', svg),
write_to=os.path... | <commit_before><commit_msg>Add Python 3 Script for Converting Image Types<commit_after> | import cairosvg
import os
# MUST RUN IN PYTHON 3 and pip install cairosvg
file_dir = '../data/hough_test/Test_Set_1/'
svgs = os.listdir(os.path.join(file_dir, 'SVGs'))
for svg in svgs:
name = svg.split('.svg')[0]
cairosvg.svg2png(url=os.path.join(file_dir, 'SVGs', svg),
write_to=os.path... | Add Python 3 Script for Converting Image Typesimport cairosvg
import os
# MUST RUN IN PYTHON 3 and pip install cairosvg
file_dir = '../data/hough_test/Test_Set_1/'
svgs = os.listdir(os.path.join(file_dir, 'SVGs'))
for svg in svgs:
name = svg.split('.svg')[0]
cairosvg.svg2png(url=os.path.join(file_dir, 'SVGs... | <commit_before><commit_msg>Add Python 3 Script for Converting Image Types<commit_after>import cairosvg
import os
# MUST RUN IN PYTHON 3 and pip install cairosvg
file_dir = '../data/hough_test/Test_Set_1/'
svgs = os.listdir(os.path.join(file_dir, 'SVGs'))
for svg in svgs:
name = svg.split('.svg')[0]
cairosvg... | |
30a0b17d028f279a9877150ac4eb60b1ce135fa2 | checks/check_multiply_hue_and_saturation.py | checks/check_multiply_hue_and_saturation.py | from __future__ import print_function, division
import numpy as np
import imgaug as ia
from imgaug import augmenters as iaa
def main():
image = ia.quokka_square((128, 128))
images_aug = []
for mul in np.linspace(0.0, 2.0, 10):
aug = iaa.MultiplyHueAndSaturation(mul)
image_aug = aug.augm... | Add check script for MultiplyHueAndSaturation | Add check script for MultiplyHueAndSaturation
| Python | mit | aleju/imgaug,aleju/imgaug,aleju/ImageAugmenter | Add check script for MultiplyHueAndSaturation | from __future__ import print_function, division
import numpy as np
import imgaug as ia
from imgaug import augmenters as iaa
def main():
image = ia.quokka_square((128, 128))
images_aug = []
for mul in np.linspace(0.0, 2.0, 10):
aug = iaa.MultiplyHueAndSaturation(mul)
image_aug = aug.augm... | <commit_before><commit_msg>Add check script for MultiplyHueAndSaturation<commit_after> | from __future__ import print_function, division
import numpy as np
import imgaug as ia
from imgaug import augmenters as iaa
def main():
image = ia.quokka_square((128, 128))
images_aug = []
for mul in np.linspace(0.0, 2.0, 10):
aug = iaa.MultiplyHueAndSaturation(mul)
image_aug = aug.augm... | Add check script for MultiplyHueAndSaturationfrom __future__ import print_function, division
import numpy as np
import imgaug as ia
from imgaug import augmenters as iaa
def main():
image = ia.quokka_square((128, 128))
images_aug = []
for mul in np.linspace(0.0, 2.0, 10):
aug = iaa.MultiplyHueAn... | <commit_before><commit_msg>Add check script for MultiplyHueAndSaturation<commit_after>from __future__ import print_function, division
import numpy as np
import imgaug as ia
from imgaug import augmenters as iaa
def main():
image = ia.quokka_square((128, 128))
images_aug = []
for mul in np.linspace(0.0, ... | |
242479ace03928b20dc86806f7592ec1148b615b | service/test/integration/test_draft_service.py | service/test/integration/test_draft_service.py | #
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pixelated is distrib... | Add integration test for DraftService. | Add integration test for DraftService.
| Python | agpl-3.0 | pixelated-project/pixelated-user-agent,torquemad/pixelated-user-agent,torquemad/pixelated-user-agent,PuZZleDucK/pixelated-user-agent,PuZZleDucK/pixelated-user-agent,kaeff/pixelated-user-agent,SamuelToh/pixelated-user-agent,pixelated-project/pixelated-user-agent,PuZZleDucK/pixelated-user-agent,torquemad/pixelated-user-a... | Add integration test for DraftService. | #
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pixelated is distrib... | <commit_before><commit_msg>Add integration test for DraftService.<commit_after> | #
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pixelated is distrib... | Add integration test for DraftService.#
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | <commit_before><commit_msg>Add integration test for DraftService.<commit_after>#
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated 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... | |
d85442d5961602ae91c385a65e9503c409316b3f | bin/scrub_stale_lists.py | bin/scrub_stale_lists.py | #!/usr/bin/env python
import sys
import os
import time
import redis
import requests
import logging
from urlparse import urlparse
from datetime import timedelta
def main(rds):
pf = "coalesce.v1."
tasks_removed = 0
lists_removed = 0
list_keys = rds.smembers(pf + "list_keys")
for key in list_keys:... | Scrub stale data from redis | Scrub stale data from redis
| Python | mpl-2.0 | mozilla/tc-coalesce,dividehex/tc-coalesce | Scrub stale data from redis | #!/usr/bin/env python
import sys
import os
import time
import redis
import requests
import logging
from urlparse import urlparse
from datetime import timedelta
def main(rds):
pf = "coalesce.v1."
tasks_removed = 0
lists_removed = 0
list_keys = rds.smembers(pf + "list_keys")
for key in list_keys:... | <commit_before><commit_msg>Scrub stale data from redis<commit_after> | #!/usr/bin/env python
import sys
import os
import time
import redis
import requests
import logging
from urlparse import urlparse
from datetime import timedelta
def main(rds):
pf = "coalesce.v1."
tasks_removed = 0
lists_removed = 0
list_keys = rds.smembers(pf + "list_keys")
for key in list_keys:... | Scrub stale data from redis#!/usr/bin/env python
import sys
import os
import time
import redis
import requests
import logging
from urlparse import urlparse
from datetime import timedelta
def main(rds):
pf = "coalesce.v1."
tasks_removed = 0
lists_removed = 0
list_keys = rds.smembers(pf + "list_keys"... | <commit_before><commit_msg>Scrub stale data from redis<commit_after>#!/usr/bin/env python
import sys
import os
import time
import redis
import requests
import logging
from urlparse import urlparse
from datetime import timedelta
def main(rds):
pf = "coalesce.v1."
tasks_removed = 0
lists_removed = 0
... | |
9870fdd4b0996254216ff85a4dc0f9706843ca50 | tests/basics/while_nest_exc.py | tests/basics/while_nest_exc.py | # test nested whiles within a try-except
while 1:
print(1)
try:
print(2)
while 1:
print(3)
break
except:
print(4)
print(5)
break
| Add test for nested while with exc and break. | tests: Add test for nested while with exc and break.
| Python | mit | ruffy91/micropython,jmarcelino/pycom-micropython,henriknelson/micropython,puuu/micropython,neilh10/micropython,xuxiaoxin/micropython,utopiaprince/micropython,cwyark/micropython,aethaniel/micropython,tuc-osg/micropython,vitiral/micropython,orionrobots/micropython,noahchense/micropython,paul-xxx/micropython,ganshun666/mi... | tests: Add test for nested while with exc and break. | # test nested whiles within a try-except
while 1:
print(1)
try:
print(2)
while 1:
print(3)
break
except:
print(4)
print(5)
break
| <commit_before><commit_msg>tests: Add test for nested while with exc and break.<commit_after> | # test nested whiles within a try-except
while 1:
print(1)
try:
print(2)
while 1:
print(3)
break
except:
print(4)
print(5)
break
| tests: Add test for nested while with exc and break.# test nested whiles within a try-except
while 1:
print(1)
try:
print(2)
while 1:
print(3)
break
except:
print(4)
print(5)
break
| <commit_before><commit_msg>tests: Add test for nested while with exc and break.<commit_after># test nested whiles within a try-except
while 1:
print(1)
try:
print(2)
while 1:
print(3)
break
except:
print(4)
print(5)
break
| |
e61dcb055fb4767e6e662648c89cbdfda4422c97 | docs/source/examples/test_no_depends_fails.py | docs/source/examples/test_no_depends_fails.py | from pych.extern import Chapel
@Chapel(sfile="users.onlyonce.chpl")
def useTwoModules(x=int, y=int):
return int
if __name__ == "__main__":
print(useTwoModules(2, 4))
import testcase
# contains the general testing method, which allows us to gather output
import os.path
def test_using_multiple_modules():
... | from pych.extern import Chapel
@Chapel(sfile="users.onlyonce.chpl")
def useTwoModules(x=int, y=int):
return int
if __name__ == "__main__":
print(useTwoModules(2, 4))
import testcase
# contains the general testing method, which allows us to gather output
import os.path
def test_using_multiple_modules():
... | Update expected error message in this test | Update expected error message in this test
With the new ability to "use" enums, the error message for failing to find a
module had been updated to indicate that we didn't find a module or an enum,
making this test's expected output fail to match. Update the expected error
message to reflect this new functionality.
| Python | apache-2.0 | chapel-lang/pychapel,russel/pychapel,chapel-lang/pychapel,russel/pychapel,russel/pychapel,chapel-lang/pychapel | from pych.extern import Chapel
@Chapel(sfile="users.onlyonce.chpl")
def useTwoModules(x=int, y=int):
return int
if __name__ == "__main__":
print(useTwoModules(2, 4))
import testcase
# contains the general testing method, which allows us to gather output
import os.path
def test_using_multiple_modules():
... | from pych.extern import Chapel
@Chapel(sfile="users.onlyonce.chpl")
def useTwoModules(x=int, y=int):
return int
if __name__ == "__main__":
print(useTwoModules(2, 4))
import testcase
# contains the general testing method, which allows us to gather output
import os.path
def test_using_multiple_modules():
... | <commit_before>from pych.extern import Chapel
@Chapel(sfile="users.onlyonce.chpl")
def useTwoModules(x=int, y=int):
return int
if __name__ == "__main__":
print(useTwoModules(2, 4))
import testcase
# contains the general testing method, which allows us to gather output
import os.path
def test_using_multiple_... | from pych.extern import Chapel
@Chapel(sfile="users.onlyonce.chpl")
def useTwoModules(x=int, y=int):
return int
if __name__ == "__main__":
print(useTwoModules(2, 4))
import testcase
# contains the general testing method, which allows us to gather output
import os.path
def test_using_multiple_modules():
... | from pych.extern import Chapel
@Chapel(sfile="users.onlyonce.chpl")
def useTwoModules(x=int, y=int):
return int
if __name__ == "__main__":
print(useTwoModules(2, 4))
import testcase
# contains the general testing method, which allows us to gather output
import os.path
def test_using_multiple_modules():
... | <commit_before>from pych.extern import Chapel
@Chapel(sfile="users.onlyonce.chpl")
def useTwoModules(x=int, y=int):
return int
if __name__ == "__main__":
print(useTwoModules(2, 4))
import testcase
# contains the general testing method, which allows us to gather output
import os.path
def test_using_multiple_... |
77f812f76966b90c27131fd65968f548afcdcace | svir/dialogs/load_basic_csv_as_layer_dialog.py | svir/dialogs/load_basic_csv_as_layer_dialog.py | # -*- coding: utf-8 -*-
# /***************************************************************************
# Irmt
# A QGIS plugin
# OpenQuake Integrated Risk Modelling Toolkit
# -------------------
# begin : 2013-10-24
# copyright ... | Add loader for basic csv layers without geoms | Add loader for basic csv layers without geoms
| Python | agpl-3.0 | gem/oq-svir-qgis,gem/oq-svir-qgis,gem/oq-svir-qgis,gem/oq-svir-qgis | Add loader for basic csv layers without geoms | # -*- coding: utf-8 -*-
# /***************************************************************************
# Irmt
# A QGIS plugin
# OpenQuake Integrated Risk Modelling Toolkit
# -------------------
# begin : 2013-10-24
# copyright ... | <commit_before><commit_msg>Add loader for basic csv layers without geoms<commit_after> | # -*- coding: utf-8 -*-
# /***************************************************************************
# Irmt
# A QGIS plugin
# OpenQuake Integrated Risk Modelling Toolkit
# -------------------
# begin : 2013-10-24
# copyright ... | Add loader for basic csv layers without geoms# -*- coding: utf-8 -*-
# /***************************************************************************
# Irmt
# A QGIS plugin
# OpenQuake Integrated Risk Modelling Toolkit
# -------------------
# begin ... | <commit_before><commit_msg>Add loader for basic csv layers without geoms<commit_after># -*- coding: utf-8 -*-
# /***************************************************************************
# Irmt
# A QGIS plugin
# OpenQuake Integrated Risk Modelling Toolkit
# ... | |
8c7fa4e16805dc9e8adbd5615c610be8ba92c444 | ceph_deploy/tests/parser/test_gatherkeys.py | ceph_deploy/tests/parser/test_gatherkeys.py | import pytest
from ceph_deploy.cli import get_parser
class TestParserGatherKeys(object):
def setup(self):
self.parser = get_parser()
def test_gather_help(self, capsys):
with pytest.raises(SystemExit):
self.parser.parse_args('gatherkeys --help'.split())
out, err = capsys.... | Add argparse tests for gatherkeys | [RM-11742] Add argparse tests for gatherkeys
Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com>
| Python | mit | SUSE/ceph-deploy,zhouyuan/ceph-deploy,shenhequnying/ceph-deploy,ghxandsky/ceph-deploy,zhouyuan/ceph-deploy,ceph/ceph-deploy,SUSE/ceph-deploy,branto1/ceph-deploy,isyippee/ceph-deploy,osynge/ceph-deploy,Vicente-Cheng/ceph-deploy,isyippee/ceph-deploy,ceph/ceph-deploy,trhoden/ceph-deploy,SUSE/ceph-deploy-to-be-deleted,SUSE... | [RM-11742] Add argparse tests for gatherkeys
Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com> | import pytest
from ceph_deploy.cli import get_parser
class TestParserGatherKeys(object):
def setup(self):
self.parser = get_parser()
def test_gather_help(self, capsys):
with pytest.raises(SystemExit):
self.parser.parse_args('gatherkeys --help'.split())
out, err = capsys.... | <commit_before><commit_msg>[RM-11742] Add argparse tests for gatherkeys
Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com><commit_after> | import pytest
from ceph_deploy.cli import get_parser
class TestParserGatherKeys(object):
def setup(self):
self.parser = get_parser()
def test_gather_help(self, capsys):
with pytest.raises(SystemExit):
self.parser.parse_args('gatherkeys --help'.split())
out, err = capsys.... | [RM-11742] Add argparse tests for gatherkeys
Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com>import pytest
from ceph_deploy.cli import get_parser
class TestParserGatherKeys(object):
def setup(self):
self.parser = get_parser()
def test_gather_help(self, capsys):
... | <commit_before><commit_msg>[RM-11742] Add argparse tests for gatherkeys
Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com><commit_after>import pytest
from ceph_deploy.cli import get_parser
class TestParserGatherKeys(object):
def setup(self):
self.parser = get_parser()
... | |
f24fe32329625ec037a9afc8d3bdeed5f41e69a0 | scripts/diff_incar.py | scripts/diff_incar.py | #!/usr/bin/env python
'''
Created on Nov 12, 2011
'''
__author__="Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyue@mit.edu"
__date__ = "Nov 12, 2011"
import sys
import itertools
from pymatgen.io.vaspio import Incar
from p... | Add a script for easy diffing of two Incars. | Add a script for easy diffing of two Incars.
Former-commit-id: 998a47c0b96b3024abd82b196f431926cc50847d [formerly 927396038d147b633bee31988cf1e016258c5320]
Former-commit-id: 4a8c6bb9cfef4a3a3f6cc211b7ef558a06f523c3 | Python | mit | gpetretto/pymatgen,aykol/pymatgen,Bismarrck/pymatgen,czhengsci/pymatgen,johnson1228/pymatgen,Bismarrck/pymatgen,gVallverdu/pymatgen,richardtran415/pymatgen,blondegeek/pymatgen,czhengsci/pymatgen,dongsenfo/pymatgen,montoyjh/pymatgen,czhengsci/pymatgen,fraricci/pymatgen,nisse3000/pymatgen,nisse3000/pymatgen,blondegeek/py... | Add a script for easy diffing of two Incars.
Former-commit-id: 998a47c0b96b3024abd82b196f431926cc50847d [formerly 927396038d147b633bee31988cf1e016258c5320]
Former-commit-id: 4a8c6bb9cfef4a3a3f6cc211b7ef558a06f523c3 | #!/usr/bin/env python
'''
Created on Nov 12, 2011
'''
__author__="Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyue@mit.edu"
__date__ = "Nov 12, 2011"
import sys
import itertools
from pymatgen.io.vaspio import Incar
from p... | <commit_before><commit_msg>Add a script for easy diffing of two Incars.
Former-commit-id: 998a47c0b96b3024abd82b196f431926cc50847d [formerly 927396038d147b633bee31988cf1e016258c5320]
Former-commit-id: 4a8c6bb9cfef4a3a3f6cc211b7ef558a06f523c3<commit_after> | #!/usr/bin/env python
'''
Created on Nov 12, 2011
'''
__author__="Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyue@mit.edu"
__date__ = "Nov 12, 2011"
import sys
import itertools
from pymatgen.io.vaspio import Incar
from p... | Add a script for easy diffing of two Incars.
Former-commit-id: 998a47c0b96b3024abd82b196f431926cc50847d [formerly 927396038d147b633bee31988cf1e016258c5320]
Former-commit-id: 4a8c6bb9cfef4a3a3f6cc211b7ef558a06f523c3#!/usr/bin/env python
'''
Created on Nov 12, 2011
'''
__author__="Shyue Ping Ong"
__copyright__ = "Cop... | <commit_before><commit_msg>Add a script for easy diffing of two Incars.
Former-commit-id: 998a47c0b96b3024abd82b196f431926cc50847d [formerly 927396038d147b633bee31988cf1e016258c5320]
Former-commit-id: 4a8c6bb9cfef4a3a3f6cc211b7ef558a06f523c3<commit_after>#!/usr/bin/env python
'''
Created on Nov 12, 2011
'''
__autho... | |
bb940826d78e44a4098023e83d788b3d915b9b1f | grip/constants.py | grip/constants.py | # The supported extensions, as defined by https://github.com/github/markup
supported_extensions = [
'.markdown', '.mdown', '.mkdn', '.md',
'.textile',
'.rdoc',
'.org',
'.creole',
'.mediawiki', '.wiki',
'.rst',
'.asciidoc', '.adoc', '.asc',
'.pod',
]
# The default filenames when no ... | # The supported extensions, as defined by https://github.com/github/markup
supported_extensions = ['.md', '.markdown']
# The default filenames when no file is provided
default_filenames = map(lambda ext: 'README' + ext, supported_extensions)
| Revert "Add the GitHub-supported format extensions." | Revert "Add the GitHub-supported format extensions."
This reverts commit 4f67141cfabe99af99434364e13fec91bef291a7.
| Python | mit | jbarreras/grip,joeyespo/grip,mgoddard-pivotal/grip,joeyespo/grip,mgoddard-pivotal/grip,ssundarraj/grip,jbarreras/grip,ssundarraj/grip | # The supported extensions, as defined by https://github.com/github/markup
supported_extensions = [
'.markdown', '.mdown', '.mkdn', '.md',
'.textile',
'.rdoc',
'.org',
'.creole',
'.mediawiki', '.wiki',
'.rst',
'.asciidoc', '.adoc', '.asc',
'.pod',
]
# The default filenames when no ... | # The supported extensions, as defined by https://github.com/github/markup
supported_extensions = ['.md', '.markdown']
# The default filenames when no file is provided
default_filenames = map(lambda ext: 'README' + ext, supported_extensions)
| <commit_before># The supported extensions, as defined by https://github.com/github/markup
supported_extensions = [
'.markdown', '.mdown', '.mkdn', '.md',
'.textile',
'.rdoc',
'.org',
'.creole',
'.mediawiki', '.wiki',
'.rst',
'.asciidoc', '.adoc', '.asc',
'.pod',
]
# The default fil... | # The supported extensions, as defined by https://github.com/github/markup
supported_extensions = ['.md', '.markdown']
# The default filenames when no file is provided
default_filenames = map(lambda ext: 'README' + ext, supported_extensions)
| # The supported extensions, as defined by https://github.com/github/markup
supported_extensions = [
'.markdown', '.mdown', '.mkdn', '.md',
'.textile',
'.rdoc',
'.org',
'.creole',
'.mediawiki', '.wiki',
'.rst',
'.asciidoc', '.adoc', '.asc',
'.pod',
]
# The default filenames when no ... | <commit_before># The supported extensions, as defined by https://github.com/github/markup
supported_extensions = [
'.markdown', '.mdown', '.mkdn', '.md',
'.textile',
'.rdoc',
'.org',
'.creole',
'.mediawiki', '.wiki',
'.rst',
'.asciidoc', '.adoc', '.asc',
'.pod',
]
# The default fil... |
b333d95f3f4187b9d9b480ba8ff4985a62d65f41 | tests/pytests/unit/modules/test_nginx.py | tests/pytests/unit/modules/test_nginx.py | import pytest
import salt.modules.nginx as nginx
from tests.support.mock import patch
@pytest.fixture
def configure_loader_modules():
return {nginx: {}}
@pytest.mark.parametrize(
"expected_version,nginx_output",
[
("1.2.3", "nginx version: nginx/1.2.3"),
("1", "nginx version: nginx/1"),
... | Add tests for nginx version | Add tests for nginx version
I had considered doing something with regex like `\d+(\.\d+)*`, then I
realized that there are other valid version strings that perhaps do not
contain numerics separated by `.`, so this option is a bit more flexible
as far as what versions nginx can return.
The major weakness here is that ... | Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add tests for nginx version
I had considered doing something with regex like `\d+(\.\d+)*`, then I
realized that there are other valid version strings that perhaps do not
contain numerics separated by `.`, so this option is a bit more flexible
as far as what versions nginx can return.
The major weakness here is that ... | import pytest
import salt.modules.nginx as nginx
from tests.support.mock import patch
@pytest.fixture
def configure_loader_modules():
return {nginx: {}}
@pytest.mark.parametrize(
"expected_version,nginx_output",
[
("1.2.3", "nginx version: nginx/1.2.3"),
("1", "nginx version: nginx/1"),
... | <commit_before><commit_msg>Add tests for nginx version
I had considered doing something with regex like `\d+(\.\d+)*`, then I
realized that there are other valid version strings that perhaps do not
contain numerics separated by `.`, so this option is a bit more flexible
as far as what versions nginx can return.
The m... | import pytest
import salt.modules.nginx as nginx
from tests.support.mock import patch
@pytest.fixture
def configure_loader_modules():
return {nginx: {}}
@pytest.mark.parametrize(
"expected_version,nginx_output",
[
("1.2.3", "nginx version: nginx/1.2.3"),
("1", "nginx version: nginx/1"),
... | Add tests for nginx version
I had considered doing something with regex like `\d+(\.\d+)*`, then I
realized that there are other valid version strings that perhaps do not
contain numerics separated by `.`, so this option is a bit more flexible
as far as what versions nginx can return.
The major weakness here is that ... | <commit_before><commit_msg>Add tests for nginx version
I had considered doing something with regex like `\d+(\.\d+)*`, then I
realized that there are other valid version strings that perhaps do not
contain numerics separated by `.`, so this option is a bit more flexible
as far as what versions nginx can return.
The m... | |
f9b38f675df9752a4b5309df059c6d15a1e1b3c2 | ex_range.py | ex_range.py | from collections import namedtuple
from vintage_ex import EX_RANGE_REGEXP
import location
EX_RANGE = namedtuple('ex_range', 'left left_offset separator right right_offset')
def get_range_parts(range):
parts = EX_RANGE_REGEXP.search(range).groups()
return EX_RANGE(
left=parts[1],
... | Add module for range support. | Add module for range support.
| Python | mit | SublimeText/VintageEx | Add module for range support. | from collections import namedtuple
from vintage_ex import EX_RANGE_REGEXP
import location
EX_RANGE = namedtuple('ex_range', 'left left_offset separator right right_offset')
def get_range_parts(range):
parts = EX_RANGE_REGEXP.search(range).groups()
return EX_RANGE(
left=parts[1],
... | <commit_before><commit_msg>Add module for range support.<commit_after> | from collections import namedtuple
from vintage_ex import EX_RANGE_REGEXP
import location
EX_RANGE = namedtuple('ex_range', 'left left_offset separator right right_offset')
def get_range_parts(range):
parts = EX_RANGE_REGEXP.search(range).groups()
return EX_RANGE(
left=parts[1],
... | Add module for range support.from collections import namedtuple
from vintage_ex import EX_RANGE_REGEXP
import location
EX_RANGE = namedtuple('ex_range', 'left left_offset separator right right_offset')
def get_range_parts(range):
parts = EX_RANGE_REGEXP.search(range).groups()
return EX_RANGE(
... | <commit_before><commit_msg>Add module for range support.<commit_after>from collections import namedtuple
from vintage_ex import EX_RANGE_REGEXP
import location
EX_RANGE = namedtuple('ex_range', 'left left_offset separator right right_offset')
def get_range_parts(range):
parts = EX_RANGE_REGEXP.search(range).gr... | |
58ac46511964ca1dd3de25d2b6053eb785e3e281 | util/detect-outliers.py | util/detect-outliers.py | #!/usr/bin/env python2
#
# Detect outlier faces (not of the same person) in a directory
# of aligned images.
# Brandon Amos
# 2016/02/14
#
# Copyright 2015-2016 Carnegie Mellon University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | Add outlier detection util script. | Add outlier detection util script.
| Python | apache-2.0 | Alexx-G/openface,nmabhi/Webface,Alexx-G/openface,nmabhi/Webface,xinfang/face-recognize,francisleunggie/openface,cmusatyalab/openface,nmabhi/Webface,Alexx-G/openface,francisleunggie/openface,nhzandi/openface,xinfang/face-recognize,Alexx-G/openface,nmabhi/Webface,xinfang/face-recognize,cmusatyalab/openface,francisleunggi... | Add outlier detection util script. | #!/usr/bin/env python2
#
# Detect outlier faces (not of the same person) in a directory
# of aligned images.
# Brandon Amos
# 2016/02/14
#
# Copyright 2015-2016 Carnegie Mellon University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | <commit_before><commit_msg>Add outlier detection util script.<commit_after> | #!/usr/bin/env python2
#
# Detect outlier faces (not of the same person) in a directory
# of aligned images.
# Brandon Amos
# 2016/02/14
#
# Copyright 2015-2016 Carnegie Mellon University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | Add outlier detection util script.#!/usr/bin/env python2
#
# Detect outlier faces (not of the same person) in a directory
# of aligned images.
# Brandon Amos
# 2016/02/14
#
# Copyright 2015-2016 Carnegie Mellon University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file ex... | <commit_before><commit_msg>Add outlier detection util script.<commit_after>#!/usr/bin/env python2
#
# Detect outlier faces (not of the same person) in a directory
# of aligned images.
# Brandon Amos
# 2016/02/14
#
# Copyright 2015-2016 Carnegie Mellon University
#
# Licensed under the Apache License, Version 2.0 (the "... | |
964d1f97df600308b23b6a91b9de8811795509a4 | sympy/core/tests/test_cache.py | sympy/core/tests/test_cache.py | from sympy.core.cache import cacheit
def test_cacheit_doc():
@cacheit
def testfn():
"test docstring"
pass
assert testfn.__doc__ == "test docstring"
assert testfn.__name__ == "testfn"
| Add a test for the @cachit decorator. | Add a test for the @cachit decorator.
Make sure that the caching decorator correctly
copies over the function docstring and function name.
This fixes issue #744 from the issue tracker.
Signed-off-by: Jochen Voss <1dcd5c846f3eb4984f0655fb5407be7c9e0c9079@seehuhn.de>
Signed-off-by: Ondrej Certik <b816faa87b7d35274d2e5... | Python | bsd-3-clause | cccfran/sympy,shipci/sympy,wyom/sympy,Titan-C/sympy,ahhda/sympy,meghana1995/sympy,wanglongqi/sympy,pandeyadarsh/sympy,vipulroxx/sympy,jbbskinny/sympy,jaimahajan1997/sympy,Arafatk/sympy,grevutiu-gabriel/sympy,Gadal/sympy,jerli/sympy,mcdaniel67/sympy,Mitchkoens/sympy,wyom/sympy,oliverlee/sympy,ga7g08/sympy,tovrstra/sympy... | Add a test for the @cachit decorator.
Make sure that the caching decorator correctly
copies over the function docstring and function name.
This fixes issue #744 from the issue tracker.
Signed-off-by: Jochen Voss <1dcd5c846f3eb4984f0655fb5407be7c9e0c9079@seehuhn.de>
Signed-off-by: Ondrej Certik <b816faa87b7d35274d2e5... | from sympy.core.cache import cacheit
def test_cacheit_doc():
@cacheit
def testfn():
"test docstring"
pass
assert testfn.__doc__ == "test docstring"
assert testfn.__name__ == "testfn"
| <commit_before><commit_msg>Add a test for the @cachit decorator.
Make sure that the caching decorator correctly
copies over the function docstring and function name.
This fixes issue #744 from the issue tracker.
Signed-off-by: Jochen Voss <1dcd5c846f3eb4984f0655fb5407be7c9e0c9079@seehuhn.de>
Signed-off-by: Ondrej Ce... | from sympy.core.cache import cacheit
def test_cacheit_doc():
@cacheit
def testfn():
"test docstring"
pass
assert testfn.__doc__ == "test docstring"
assert testfn.__name__ == "testfn"
| Add a test for the @cachit decorator.
Make sure that the caching decorator correctly
copies over the function docstring and function name.
This fixes issue #744 from the issue tracker.
Signed-off-by: Jochen Voss <1dcd5c846f3eb4984f0655fb5407be7c9e0c9079@seehuhn.de>
Signed-off-by: Ondrej Certik <b816faa87b7d35274d2e5... | <commit_before><commit_msg>Add a test for the @cachit decorator.
Make sure that the caching decorator correctly
copies over the function docstring and function name.
This fixes issue #744 from the issue tracker.
Signed-off-by: Jochen Voss <1dcd5c846f3eb4984f0655fb5407be7c9e0c9079@seehuhn.de>
Signed-off-by: Ondrej Ce... | |
0f1cf524c2b90d77e17d516a30d62632ebb5ed2f | datathon/datathon_etl_pipelines/generic_imagining/untar_gcs.py | datathon/datathon_etl_pipelines/generic_imagining/untar_gcs.py | r"""Untar .tar and .tar.gz GCS files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.options.pipeline_options import SetupOption... | Add pipeline for untar'ing GCS blobs. | Add pipeline for untar'ing GCS blobs.
PiperOrigin-RevId: 247210932
| Python | apache-2.0 | GoogleCloudPlatform/healthcare,GoogleCloudPlatform/healthcare,GoogleCloudPlatform/healthcare,GoogleCloudPlatform/healthcare,GoogleCloudPlatform/healthcare,GoogleCloudPlatform/healthcare,GoogleCloudPlatform/healthcare,GoogleCloudPlatform/healthcare | Add pipeline for untar'ing GCS blobs.
PiperOrigin-RevId: 247210932 | r"""Untar .tar and .tar.gz GCS files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.options.pipeline_options import SetupOption... | <commit_before><commit_msg>Add pipeline for untar'ing GCS blobs.
PiperOrigin-RevId: 247210932<commit_after> | r"""Untar .tar and .tar.gz GCS files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.options.pipeline_options import SetupOption... | Add pipeline for untar'ing GCS blobs.
PiperOrigin-RevId: 247210932r"""Untar .tar and .tar.gz GCS files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineO... | <commit_before><commit_msg>Add pipeline for untar'ing GCS blobs.
PiperOrigin-RevId: 247210932<commit_after>r"""Untar .tar and .tar.gz GCS files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import apache_beam as beam
from apache_beam.... | |
80ccffb269b04af02224c1121c41d4e7c503bc30 | tests/util/test_intersperse.py | tests/util/test_intersperse.py | # This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
from rinoh.util import intersperse
def test_interspers... | Add unit test for intersperse | Add unit test for intersperse
| Python | agpl-3.0 | brechtm/rinohtype,brechtm/rinohtype,brechtm/rinohtype | Add unit test for intersperse | # This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
from rinoh.util import intersperse
def test_interspers... | <commit_before><commit_msg>Add unit test for intersperse<commit_after> | # This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
from rinoh.util import intersperse
def test_interspers... | Add unit test for intersperse# This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
from rinoh.util import inte... | <commit_before><commit_msg>Add unit test for intersperse<commit_after># This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org... | |
1e9980aff2370b96171011f7fa50d4517957fa86 | tilepack/check_toi.py | tilepack/check_toi.py | import mercantile
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('min_lon',
type=float,
help='Bounding box minimum longitude/left')
parser.add_argument('min_lat',
type=float,
help='Bounding box minimum latitude/bottom')
parser.add_argu... | Add a script to check TOI coverage for a bbox and zoom range | Add a script to check TOI coverage for a bbox and zoom range
| Python | mit | tilezen/tilepacks | Add a script to check TOI coverage for a bbox and zoom range | import mercantile
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('min_lon',
type=float,
help='Bounding box minimum longitude/left')
parser.add_argument('min_lat',
type=float,
help='Bounding box minimum latitude/bottom')
parser.add_argu... | <commit_before><commit_msg>Add a script to check TOI coverage for a bbox and zoom range<commit_after> | import mercantile
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('min_lon',
type=float,
help='Bounding box minimum longitude/left')
parser.add_argument('min_lat',
type=float,
help='Bounding box minimum latitude/bottom')
parser.add_argu... | Add a script to check TOI coverage for a bbox and zoom rangeimport mercantile
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('min_lon',
type=float,
help='Bounding box minimum longitude/left')
parser.add_argument('min_lat',
type=float,
help... | <commit_before><commit_msg>Add a script to check TOI coverage for a bbox and zoom range<commit_after>import mercantile
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('min_lon',
type=float,
help='Bounding box minimum longitude/left')
parser.add_argument('m... | |
3ae0ea21cc6b1afadb0dd72e29016385d18167ab | DebianDevelChangesBot/utils/fiforeader.py | DebianDevelChangesBot/utils/fiforeader.py | # -*- coding: utf-8 -*-
#
# Debian Changes Bot
# Copyright (C) 2008 Chris Lamb <chris@chris-lamb.co.uk>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... | Add FifoReader class to utils | Add FifoReader class to utils
Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-lamb.co.uk>
| Python | agpl-3.0 | xtaran/debian-devel-changes-bot,lamby/debian-devel-changes-bot,lamby/debian-devel-changes-bot,xtaran/debian-devel-changes-bot,sebastinas/debian-devel-changes-bot,lamby/debian-devel-changes-bot | Add FifoReader class to utils
Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-lamb.co.uk> | # -*- coding: utf-8 -*-
#
# Debian Changes Bot
# Copyright (C) 2008 Chris Lamb <chris@chris-lamb.co.uk>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... | <commit_before><commit_msg>Add FifoReader class to utils
Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-lamb.co.uk><commit_after> | # -*- coding: utf-8 -*-
#
# Debian Changes Bot
# Copyright (C) 2008 Chris Lamb <chris@chris-lamb.co.uk>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... | Add FifoReader class to utils
Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-lamb.co.uk># -*- coding: utf-8 -*-
#
# Debian Changes Bot
# Copyright (C) 2008 Chris Lamb <chris@chris-lamb.co.uk>
#
# This program is free software: you can redistribute it and/or modify
# it under the term... | <commit_before><commit_msg>Add FifoReader class to utils
Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-lamb.co.uk><commit_after># -*- coding: utf-8 -*-
#
# Debian Changes Bot
# Copyright (C) 2008 Chris Lamb <chris@chris-lamb.co.uk>
#
# This program is free software: you can redistribu... | |
7e600a791bec2f8639aae417a1ea052ca94cf7b9 | testgen/mc-bundling-x86-gen.py | testgen/mc-bundling-x86-gen.py | #!/usr/bin/python
# Auto-generates an exhaustive and repetitive test for correct bundle-locked
# alignment on x86.
# For every possible offset in an aligned bundle, a bundle-locked group of every
# size in the inclusive range [1, bundle_size] is inserted. An appropriate CHECK
# is added to verify that NOP padding occu... | Add a largish auto-generated test for the aligned bundling feature, along with the script generating it. The test should never be modified manually. If anyone needs to change it, please change the script and re-run it. | Add a largish auto-generated test for the aligned bundling feature, along with
the script generating it. The test should never be modified manually. If anyone
needs to change it, please change the script and re-run it.
The script is placed into utils/testgen - I couldn't think of a better place,
and after some discuss... | Python | bsd-3-clause | lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx | Add a largish auto-generated test for the aligned bundling feature, along with
the script generating it. The test should never be modified manually. If anyone
needs to change it, please change the script and re-run it.
The script is placed into utils/testgen - I couldn't think of a better place,
and after some discuss... | #!/usr/bin/python
# Auto-generates an exhaustive and repetitive test for correct bundle-locked
# alignment on x86.
# For every possible offset in an aligned bundle, a bundle-locked group of every
# size in the inclusive range [1, bundle_size] is inserted. An appropriate CHECK
# is added to verify that NOP padding occu... | <commit_before><commit_msg>Add a largish auto-generated test for the aligned bundling feature, along with
the script generating it. The test should never be modified manually. If anyone
needs to change it, please change the script and re-run it.
The script is placed into utils/testgen - I couldn't think of a better pl... | #!/usr/bin/python
# Auto-generates an exhaustive and repetitive test for correct bundle-locked
# alignment on x86.
# For every possible offset in an aligned bundle, a bundle-locked group of every
# size in the inclusive range [1, bundle_size] is inserted. An appropriate CHECK
# is added to verify that NOP padding occu... | Add a largish auto-generated test for the aligned bundling feature, along with
the script generating it. The test should never be modified manually. If anyone
needs to change it, please change the script and re-run it.
The script is placed into utils/testgen - I couldn't think of a better place,
and after some discuss... | <commit_before><commit_msg>Add a largish auto-generated test for the aligned bundling feature, along with
the script generating it. The test should never be modified manually. If anyone
needs to change it, please change the script and re-run it.
The script is placed into utils/testgen - I couldn't think of a better pl... | |
3a19187e8116e8dc20166786fb1ca4d14b527950 | 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= sehr@google.com
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 | yitian134/chromium,adobe/chromium,gavinp/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,adobe/chromium,adobe/chromium... | Add missing IDL Visistor class
This class provides a simple mechanism for recursively traversing the AST
for both simple and version aware traversal.
TBR= sehr@google.com
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= sehr@google.com
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= sehr@google.com
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= sehr@google.com
BUG= http://code.google.com/p/chromium/issues/detail?id=87684
TEST= python idl_c_header.py
Review URL: http://codereview... | |
bbed7b813b6c809ee9615eabf2fcf4d3156b1c36 | tools/convert_release_notes.py | tools/convert_release_notes.py | import sys
import mistune
print(sys.argv[1])
with open(sys.argv[1], "r") as source_file:
source = source_file.read()
html = mistune.Markdown()
print()
print("HTML")
print("=====================================")
print("From the <a href=\"\">GitHub release page</a>:\n<blockquote>")
print(html(source))
print("</b... | Add script to convert release notes from Markdown | Add script to convert release notes from Markdown
| Python | mit | adafruit/micropython,adafruit/circuitpython,adafruit/micropython,adafruit/circuitpython,adafruit/circuitpython,adafruit/micropython,adafruit/circuitpython,adafruit/micropython,adafruit/circuitpython,adafruit/micropython,adafruit/circuitpython | Add script to convert release notes from Markdown | import sys
import mistune
print(sys.argv[1])
with open(sys.argv[1], "r") as source_file:
source = source_file.read()
html = mistune.Markdown()
print()
print("HTML")
print("=====================================")
print("From the <a href=\"\">GitHub release page</a>:\n<blockquote>")
print(html(source))
print("</b... | <commit_before><commit_msg>Add script to convert release notes from Markdown<commit_after> | import sys
import mistune
print(sys.argv[1])
with open(sys.argv[1], "r") as source_file:
source = source_file.read()
html = mistune.Markdown()
print()
print("HTML")
print("=====================================")
print("From the <a href=\"\">GitHub release page</a>:\n<blockquote>")
print(html(source))
print("</b... | Add script to convert release notes from Markdownimport sys
import mistune
print(sys.argv[1])
with open(sys.argv[1], "r") as source_file:
source = source_file.read()
html = mistune.Markdown()
print()
print("HTML")
print("=====================================")
print("From the <a href=\"\">GitHub release page</a... | <commit_before><commit_msg>Add script to convert release notes from Markdown<commit_after>import sys
import mistune
print(sys.argv[1])
with open(sys.argv[1], "r") as source_file:
source = source_file.read()
html = mistune.Markdown()
print()
print("HTML")
print("=====================================")
print("Fro... | |
80580b8667558e3a4034b31ac08773de70ef3b39 | display_control_consumer/run.py | display_control_consumer/run.py | from setproctitle import setproctitle
import json
import redis
import subprocess
import time
class DisplayControlConsumer(object):
STEP = 0.05
def __init__(self):
self.redis_instance = redis.StrictRedis()
self.env = {"DISPLAY": ":0"}
def get_brightness(self):
p = subprocess.Popen... | Implement consumer for adjusting screen brightness. | Implement consumer for adjusting screen brightness.
This script polls "display-control-destination-brightness" redis key and
slowly adjusts screen brightness towards the value. Key is automatically
deleted when destination is reached.
| Python | bsd-3-clause | ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display,ojarva/home-info-display | Implement consumer for adjusting screen brightness.
This script polls "display-control-destination-brightness" redis key and
slowly adjusts screen brightness towards the value. Key is automatically
deleted when destination is reached. | from setproctitle import setproctitle
import json
import redis
import subprocess
import time
class DisplayControlConsumer(object):
STEP = 0.05
def __init__(self):
self.redis_instance = redis.StrictRedis()
self.env = {"DISPLAY": ":0"}
def get_brightness(self):
p = subprocess.Popen... | <commit_before><commit_msg>Implement consumer for adjusting screen brightness.
This script polls "display-control-destination-brightness" redis key and
slowly adjusts screen brightness towards the value. Key is automatically
deleted when destination is reached.<commit_after> | from setproctitle import setproctitle
import json
import redis
import subprocess
import time
class DisplayControlConsumer(object):
STEP = 0.05
def __init__(self):
self.redis_instance = redis.StrictRedis()
self.env = {"DISPLAY": ":0"}
def get_brightness(self):
p = subprocess.Popen... | Implement consumer for adjusting screen brightness.
This script polls "display-control-destination-brightness" redis key and
slowly adjusts screen brightness towards the value. Key is automatically
deleted when destination is reached.from setproctitle import setproctitle
import json
import redis
import subprocess
impo... | <commit_before><commit_msg>Implement consumer for adjusting screen brightness.
This script polls "display-control-destination-brightness" redis key and
slowly adjusts screen brightness towards the value. Key is automatically
deleted when destination is reached.<commit_after>from setproctitle import setproctitle
import... | |
3fbf2c29a54225e7d4dd882637e68cfe3a4d0101 | src/cobwebs/tests/test_mq.py | src/cobwebs/tests/test_mq.py | from cobwebs.mq.core import RPCLink, TopicsLink
from cobwebs.mq.backends.rabbitmq import driver
import pytest
import spider
import json
from unittest import mock
HOST = "127.0.0.1"
def test_driver_instance():
assert isinstance(driver.rpc, RPCLink)
assert isinstance(driver.topics, TopicsLink)
@mock.patch("c... | Add some tests for Message Queue | Add some tests for Message Queue
| Python | apache-2.0 | asteroide/immo_spider,asteroide/immo_spider,asteroide/immo_spider,asteroide/immo_spider | Add some tests for Message Queue | from cobwebs.mq.core import RPCLink, TopicsLink
from cobwebs.mq.backends.rabbitmq import driver
import pytest
import spider
import json
from unittest import mock
HOST = "127.0.0.1"
def test_driver_instance():
assert isinstance(driver.rpc, RPCLink)
assert isinstance(driver.topics, TopicsLink)
@mock.patch("c... | <commit_before><commit_msg>Add some tests for Message Queue<commit_after> | from cobwebs.mq.core import RPCLink, TopicsLink
from cobwebs.mq.backends.rabbitmq import driver
import pytest
import spider
import json
from unittest import mock
HOST = "127.0.0.1"
def test_driver_instance():
assert isinstance(driver.rpc, RPCLink)
assert isinstance(driver.topics, TopicsLink)
@mock.patch("c... | Add some tests for Message Queuefrom cobwebs.mq.core import RPCLink, TopicsLink
from cobwebs.mq.backends.rabbitmq import driver
import pytest
import spider
import json
from unittest import mock
HOST = "127.0.0.1"
def test_driver_instance():
assert isinstance(driver.rpc, RPCLink)
assert isinstance(driver.topi... | <commit_before><commit_msg>Add some tests for Message Queue<commit_after>from cobwebs.mq.core import RPCLink, TopicsLink
from cobwebs.mq.backends.rabbitmq import driver
import pytest
import spider
import json
from unittest import mock
HOST = "127.0.0.1"
def test_driver_instance():
assert isinstance(driver.rpc, R... | |
081b5aabae205ad7c23c512be15ee26276dc8a29 | perfkitbenchmarker/providers/azure/util.py | perfkitbenchmarker/providers/azure/util.py | # Copyright 2016 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Check whether Azure CLI is in ARM mode | Check whether Azure CLI is in ARM mode
This can prevent some hard-to-debug error messages later on.
| Python | apache-2.0 | GoogleCloudPlatform/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,meteorfox/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,GoogleCloudPlatform/PerfKitBenchmarker,meteorfox/PerfKitBenchmarker | Check whether Azure CLI is in ARM mode
This can prevent some hard-to-debug error messages later on. | # Copyright 2016 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | <commit_before><commit_msg>Check whether Azure CLI is in ARM mode
This can prevent some hard-to-debug error messages later on.<commit_after> | # Copyright 2016 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Check whether Azure CLI is in ARM mode
This can prevent some hard-to-debug error messages later on.# Copyright 2016 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a ... | <commit_before><commit_msg>Check whether Azure CLI is in ARM mode
This can prevent some hard-to-debug error messages later on.<commit_after># Copyright 2016 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complia... | |
6705e0e23d13a94726556714e11dfbb7a916877d | zinnia_wymeditor/admin.py | zinnia_wymeditor/admin.py | """EntryAdmin for zinnia-wymeditor"""
from django.contrib import admin
from zinnia.models import Entry
from zinnia.admin.entry import EntryAdmin
class EntryAdminWYMEditorMixin(object):
"""
Mixin adding WYMeditor for editing Entry.content field.
"""
pass
class EntryAdminWYMEditor(EntryAdminWYMEditor... | Add basic mechanism to override the default EntryAdmin | Add basic mechanism to override the default EntryAdmin
| Python | bsd-3-clause | django-blog-zinnia/zinnia-wysiwyg-wymeditor,layar/zinnia-wysiwyg-wymeditor,django-blog-zinnia/zinnia-wysiwyg-wymeditor,layar/zinnia-wysiwyg-wymeditor,layar/zinnia-wysiwyg-wymeditor,django-blog-zinnia/zinnia-wysiwyg-wymeditor,layar/zinnia-wysiwyg-wymeditor,django-blog-zinnia/zinnia-wysiwyg-wymeditor | Add basic mechanism to override the default EntryAdmin | """EntryAdmin for zinnia-wymeditor"""
from django.contrib import admin
from zinnia.models import Entry
from zinnia.admin.entry import EntryAdmin
class EntryAdminWYMEditorMixin(object):
"""
Mixin adding WYMeditor for editing Entry.content field.
"""
pass
class EntryAdminWYMEditor(EntryAdminWYMEditor... | <commit_before><commit_msg>Add basic mechanism to override the default EntryAdmin<commit_after> | """EntryAdmin for zinnia-wymeditor"""
from django.contrib import admin
from zinnia.models import Entry
from zinnia.admin.entry import EntryAdmin
class EntryAdminWYMEditorMixin(object):
"""
Mixin adding WYMeditor for editing Entry.content field.
"""
pass
class EntryAdminWYMEditor(EntryAdminWYMEditor... | Add basic mechanism to override the default EntryAdmin"""EntryAdmin for zinnia-wymeditor"""
from django.contrib import admin
from zinnia.models import Entry
from zinnia.admin.entry import EntryAdmin
class EntryAdminWYMEditorMixin(object):
"""
Mixin adding WYMeditor for editing Entry.content field.
"""
... | <commit_before><commit_msg>Add basic mechanism to override the default EntryAdmin<commit_after>"""EntryAdmin for zinnia-wymeditor"""
from django.contrib import admin
from zinnia.models import Entry
from zinnia.admin.entry import EntryAdmin
class EntryAdminWYMEditorMixin(object):
"""
Mixin adding WYMeditor fo... | |
389adca1fd52747814f370de2d066a1743544469 | solutions/beecrowd/1046/1046.py | solutions/beecrowd/1046/1046.py | start, end = map(int, input().split())
if start == end:
result = 24
elif end - start >= 0:
result = end - start
else:
result = 24 + end - start
print(f'O JOGO DUROU {result} HORA(S)')
| Solve Game Time in python | Solve Game Time in python
| Python | mit | deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playgr... | Solve Game Time in python | start, end = map(int, input().split())
if start == end:
result = 24
elif end - start >= 0:
result = end - start
else:
result = 24 + end - start
print(f'O JOGO DUROU {result} HORA(S)')
| <commit_before><commit_msg>Solve Game Time in python<commit_after> | start, end = map(int, input().split())
if start == end:
result = 24
elif end - start >= 0:
result = end - start
else:
result = 24 + end - start
print(f'O JOGO DUROU {result} HORA(S)')
| Solve Game Time in pythonstart, end = map(int, input().split())
if start == end:
result = 24
elif end - start >= 0:
result = end - start
else:
result = 24 + end - start
print(f'O JOGO DUROU {result} HORA(S)')
| <commit_before><commit_msg>Solve Game Time in python<commit_after>start, end = map(int, input().split())
if start == end:
result = 24
elif end - start >= 0:
result = end - start
else:
result = 24 + end - start
print(f'O JOGO DUROU {result} HORA(S)')
| |
2199f4c5ed563200d555315b9a8575e00486e667 | script/confirmed-fixed-monthly-breakdown.py | script/confirmed-fixed-monthly-breakdown.py | #!/usr/bin/python
# A script to draw graphs showing the number of confirmed reports
# created each month, and those of which that have been fixed. This
# script expects to find a file called 'problems.csv' in the current
# directory which should be generated by:
#
# DIR=`pwd` rake data:create_problem_spreadshee... | Add a simple script to generate monthly confirmed / fixed counts | Add a simple script to generate monthly confirmed / fixed counts
This is a simple dumbing-down of graph-reports-by-transport-mode.py
so there's some repeated code which should be factored out.
| Python | agpl-3.0 | mysociety/fixmytransport,mysociety/fixmytransport,mysociety/fixmytransport,mysociety/fixmytransport,mysociety/fixmytransport,mysociety/fixmytransport | Add a simple script to generate monthly confirmed / fixed counts
This is a simple dumbing-down of graph-reports-by-transport-mode.py
so there's some repeated code which should be factored out. | #!/usr/bin/python
# A script to draw graphs showing the number of confirmed reports
# created each month, and those of which that have been fixed. This
# script expects to find a file called 'problems.csv' in the current
# directory which should be generated by:
#
# DIR=`pwd` rake data:create_problem_spreadshee... | <commit_before><commit_msg>Add a simple script to generate monthly confirmed / fixed counts
This is a simple dumbing-down of graph-reports-by-transport-mode.py
so there's some repeated code which should be factored out.<commit_after> | #!/usr/bin/python
# A script to draw graphs showing the number of confirmed reports
# created each month, and those of which that have been fixed. This
# script expects to find a file called 'problems.csv' in the current
# directory which should be generated by:
#
# DIR=`pwd` rake data:create_problem_spreadshee... | Add a simple script to generate monthly confirmed / fixed counts
This is a simple dumbing-down of graph-reports-by-transport-mode.py
so there's some repeated code which should be factored out.#!/usr/bin/python
# A script to draw graphs showing the number of confirmed reports
# created each month, and those of which t... | <commit_before><commit_msg>Add a simple script to generate monthly confirmed / fixed counts
This is a simple dumbing-down of graph-reports-by-transport-mode.py
so there's some repeated code which should be factored out.<commit_after>#!/usr/bin/python
# A script to draw graphs showing the number of confirmed reports
#... | |
6454548da01dbc2b9f772a5c0ffb11a03dc933e7 | draw_shape.py | draw_shape.py | import pygame
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
#-- RENDER SCREEN ---------------------------------->>>
screen = pygame.display.set_mode((width, height))
screen.fill(background_color)
#pygame.draw.circle(canvas, color... | Add module capable of rendering a circle when ran | Add module capable of rendering a circle when ran
| Python | mit | withtwoemms/pygame-explorations | Add module capable of rendering a circle when ran | import pygame
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
#-- RENDER SCREEN ---------------------------------->>>
screen = pygame.display.set_mode((width, height))
screen.fill(background_color)
#pygame.draw.circle(canvas, color... | <commit_before><commit_msg>Add module capable of rendering a circle when ran<commit_after> | import pygame
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
#-- RENDER SCREEN ---------------------------------->>>
screen = pygame.display.set_mode((width, height))
screen.fill(background_color)
#pygame.draw.circle(canvas, color... | Add module capable of rendering a circle when ranimport pygame
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
#-- RENDER SCREEN ---------------------------------->>>
screen = pygame.display.set_mode((width, height))
screen.fill(bac... | <commit_before><commit_msg>Add module capable of rendering a circle when ran<commit_after>import pygame
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
#-- RENDER SCREEN ---------------------------------->>>
screen = pygame.display.... | |
5a857703de5fc1e67e958afb41a10db07b98bfa1 | scripts/migrate_unconfirmed_valid_users.py | scripts/migrate_unconfirmed_valid_users.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to migrate users with a valid date_last_login but no date_confirmed."""
import sys
import logging
from website.app import init_app
from website.models import User
from scripts import utils as script_utils
from tests.base import OsfTestCase
from tests.factories i... | Add migration script to fix valid users with date_confirmed==None | Add migration script
to fix valid users with date_confirmed==None
| Python | apache-2.0 | laurenrevere/osf.io,doublebits/osf.io,kch8qx/osf.io,mluo613/osf.io,petermalcolm/osf.io,GageGaskins/osf.io,ZobairAlijan/osf.io,caneruguz/osf.io,njantrania/osf.io,asanfilippo7/osf.io,zkraime/osf.io,petermalcolm/osf.io,himanshuo/osf.io,hmoco/osf.io,GaryKriebel/osf.io,jmcarp/osf.io,rdhyee/osf.io,monikagrabowska/osf.io,haoy... | Add migration script
to fix valid users with date_confirmed==None | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to migrate users with a valid date_last_login but no date_confirmed."""
import sys
import logging
from website.app import init_app
from website.models import User
from scripts import utils as script_utils
from tests.base import OsfTestCase
from tests.factories i... | <commit_before><commit_msg> Add migration script
to fix valid users with date_confirmed==None<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to migrate users with a valid date_last_login but no date_confirmed."""
import sys
import logging
from website.app import init_app
from website.models import User
from scripts import utils as script_utils
from tests.base import OsfTestCase
from tests.factories i... | Add migration script
to fix valid users with date_confirmed==None#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to migrate users with a valid date_last_login but no date_confirmed."""
import sys
import logging
from website.app import init_app
from website.models import User
from scripts import utils as scri... | <commit_before><commit_msg> Add migration script
to fix valid users with date_confirmed==None<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to migrate users with a valid date_last_login but no date_confirmed."""
import sys
import logging
from website.app import init_app
from website.models impo... | |
edeffbcbe8fb239553c73fa37e73c0188ffc2479 | tests/test_cli.py | tests/test_cli.py | import sys
import fixtures
import imgurpython
import testtools
import imgur_cli.cli as cli
FAKE_ENV = {'IMGUR_CLIENT_ID': 'client_id',
'IMGUR_CLIENT_SECRET': 'client_secret',
'IMGUR_ACCESS_TOKEN': 'access_token',
'IMGUR_REFRESH_TOKEN': 'refresh_token',
'IMGUR_MASHAPE_K... | Add unit test for retrieving credentials from environment variables | Add unit test for retrieving credentials from environment variables
| Python | mit | ueg1990/imgur-cli | Add unit test for retrieving credentials from environment variables | import sys
import fixtures
import imgurpython
import testtools
import imgur_cli.cli as cli
FAKE_ENV = {'IMGUR_CLIENT_ID': 'client_id',
'IMGUR_CLIENT_SECRET': 'client_secret',
'IMGUR_ACCESS_TOKEN': 'access_token',
'IMGUR_REFRESH_TOKEN': 'refresh_token',
'IMGUR_MASHAPE_K... | <commit_before><commit_msg>Add unit test for retrieving credentials from environment variables<commit_after> | import sys
import fixtures
import imgurpython
import testtools
import imgur_cli.cli as cli
FAKE_ENV = {'IMGUR_CLIENT_ID': 'client_id',
'IMGUR_CLIENT_SECRET': 'client_secret',
'IMGUR_ACCESS_TOKEN': 'access_token',
'IMGUR_REFRESH_TOKEN': 'refresh_token',
'IMGUR_MASHAPE_K... | Add unit test for retrieving credentials from environment variablesimport sys
import fixtures
import imgurpython
import testtools
import imgur_cli.cli as cli
FAKE_ENV = {'IMGUR_CLIENT_ID': 'client_id',
'IMGUR_CLIENT_SECRET': 'client_secret',
'IMGUR_ACCESS_TOKEN': 'access_token',
'... | <commit_before><commit_msg>Add unit test for retrieving credentials from environment variables<commit_after>import sys
import fixtures
import imgurpython
import testtools
import imgur_cli.cli as cli
FAKE_ENV = {'IMGUR_CLIENT_ID': 'client_id',
'IMGUR_CLIENT_SECRET': 'client_secret',
'IMGUR_ACC... | |
aa4f1df448c6d01875ed667e37afe68c114892ed | api/mastercoin_verify.py | api/mastercoin_verify.py | import os
import glob
from flask import Flask, request, jsonify, abort, json
data_dir_root = os.environ.get('DATADIR')
app = Flask(__name__)
app.debug = True
@app.route('/addresses')
def addresses():
currency_id = request.args.get('currency_id')
print currency_id
response = []
addr_glob = glob.glob(data_dir... | Add initial verification endpoint. Add all balance endpoint | Add initial verification endpoint. Add all balance endpoint
| Python | agpl-3.0 | Nevtep/omniwallet,VukDukic/omniwallet,Nevtep/omniwallet,habibmasuro/omniwallet,habibmasuro/omniwallet,OmniLayer/omniwallet,OmniLayer/omniwallet,OmniLayer/omniwallet,Nevtep/omniwallet,VukDukic/omniwallet,habibmasuro/omniwallet,Nevtep/omniwallet,achamely/omniwallet,achamely/omniwallet,achamely/omniwallet,OmniLayer/omniwa... | Add initial verification endpoint. Add all balance endpoint | import os
import glob
from flask import Flask, request, jsonify, abort, json
data_dir_root = os.environ.get('DATADIR')
app = Flask(__name__)
app.debug = True
@app.route('/addresses')
def addresses():
currency_id = request.args.get('currency_id')
print currency_id
response = []
addr_glob = glob.glob(data_dir... | <commit_before><commit_msg>Add initial verification endpoint. Add all balance endpoint<commit_after> | import os
import glob
from flask import Flask, request, jsonify, abort, json
data_dir_root = os.environ.get('DATADIR')
app = Flask(__name__)
app.debug = True
@app.route('/addresses')
def addresses():
currency_id = request.args.get('currency_id')
print currency_id
response = []
addr_glob = glob.glob(data_dir... | Add initial verification endpoint. Add all balance endpointimport os
import glob
from flask import Flask, request, jsonify, abort, json
data_dir_root = os.environ.get('DATADIR')
app = Flask(__name__)
app.debug = True
@app.route('/addresses')
def addresses():
currency_id = request.args.get('currency_id')
print c... | <commit_before><commit_msg>Add initial verification endpoint. Add all balance endpoint<commit_after>import os
import glob
from flask import Flask, request, jsonify, abort, json
data_dir_root = os.environ.get('DATADIR')
app = Flask(__name__)
app.debug = True
@app.route('/addresses')
def addresses():
currency_id = ... | |
26bc11340590b0b863527fa12da03cea528feb46 | pygerrit/client.py | pygerrit/client.py | """ Gerrit client interface. """
from Queue import Queue, Empty, Full
from pygerrit.error import GerritError
from pygerrit.events import GerritEventFactory
class GerritClient(object):
""" Gerrit client interface. """
def __init__(self, host):
self._factory = GerritEventFactory()
self._host... | Add initial stub of GerritClient class | Add initial stub of GerritClient class
The Gerrit client class will be used as an interface to the
Gerrit events stream and query functionality.
This is the intial stub. More functionality will be added,
and existing stream functionality refactored, in later
commits.
Change-Id: If4ef838c2d3f3e5afaad2a553af49b1c66ad... | Python | mit | morucci/pygerrit,sonyxperiadev/pygerrit,dpursehouse/pygerrit,benjiii/pygerrit,gferon/pygerrit2,markon/pygerrit2,dpursehouse/pygerrit2 | Add initial stub of GerritClient class
The Gerrit client class will be used as an interface to the
Gerrit events stream and query functionality.
This is the intial stub. More functionality will be added,
and existing stream functionality refactored, in later
commits.
Change-Id: If4ef838c2d3f3e5afaad2a553af49b1c66ad... | """ Gerrit client interface. """
from Queue import Queue, Empty, Full
from pygerrit.error import GerritError
from pygerrit.events import GerritEventFactory
class GerritClient(object):
""" Gerrit client interface. """
def __init__(self, host):
self._factory = GerritEventFactory()
self._host... | <commit_before><commit_msg>Add initial stub of GerritClient class
The Gerrit client class will be used as an interface to the
Gerrit events stream and query functionality.
This is the intial stub. More functionality will be added,
and existing stream functionality refactored, in later
commits.
Change-Id: If4ef838c2... | """ Gerrit client interface. """
from Queue import Queue, Empty, Full
from pygerrit.error import GerritError
from pygerrit.events import GerritEventFactory
class GerritClient(object):
""" Gerrit client interface. """
def __init__(self, host):
self._factory = GerritEventFactory()
self._host... | Add initial stub of GerritClient class
The Gerrit client class will be used as an interface to the
Gerrit events stream and query functionality.
This is the intial stub. More functionality will be added,
and existing stream functionality refactored, in later
commits.
Change-Id: If4ef838c2d3f3e5afaad2a553af49b1c66ad... | <commit_before><commit_msg>Add initial stub of GerritClient class
The Gerrit client class will be used as an interface to the
Gerrit events stream and query functionality.
This is the intial stub. More functionality will be added,
and existing stream functionality refactored, in later
commits.
Change-Id: If4ef838c2... | |
10f99acc11051b37595751b9b9b84e11dd133a64 | kolibri/core/content/utils/file_availability.py | kolibri/core/content/utils/file_availability.py | import json
import os
import re
import requests
from django.core.cache import cache
from kolibri.core.content.models import LocalFile
from kolibri.core.content.utils.paths import get_content_storage_dir_path
from kolibri.core.content.utils.paths import get_file_checksums_url
checksum_regex = re.compile("^([a-f0-9]{... | Add functions for getting available checksums for a channel from remote and disk. | Add functions for getting available checksums for a channel from remote and disk.
| Python | mit | mrpau/kolibri,mrpau/kolibri,learningequality/kolibri,indirectlylit/kolibri,learningequality/kolibri,indirectlylit/kolibri,mrpau/kolibri,indirectlylit/kolibri,mrpau/kolibri,indirectlylit/kolibri,learningequality/kolibri,learningequality/kolibri | Add functions for getting available checksums for a channel from remote and disk. | import json
import os
import re
import requests
from django.core.cache import cache
from kolibri.core.content.models import LocalFile
from kolibri.core.content.utils.paths import get_content_storage_dir_path
from kolibri.core.content.utils.paths import get_file_checksums_url
checksum_regex = re.compile("^([a-f0-9]{... | <commit_before><commit_msg>Add functions for getting available checksums for a channel from remote and disk.<commit_after> | import json
import os
import re
import requests
from django.core.cache import cache
from kolibri.core.content.models import LocalFile
from kolibri.core.content.utils.paths import get_content_storage_dir_path
from kolibri.core.content.utils.paths import get_file_checksums_url
checksum_regex = re.compile("^([a-f0-9]{... | Add functions for getting available checksums for a channel from remote and disk.import json
import os
import re
import requests
from django.core.cache import cache
from kolibri.core.content.models import LocalFile
from kolibri.core.content.utils.paths import get_content_storage_dir_path
from kolibri.core.content.uti... | <commit_before><commit_msg>Add functions for getting available checksums for a channel from remote and disk.<commit_after>import json
import os
import re
import requests
from django.core.cache import cache
from kolibri.core.content.models import LocalFile
from kolibri.core.content.utils.paths import get_content_stora... | |
27d37833663842405f159127f30c6351958fcb10 | bench_examples/bench_dec_insert.py | bench_examples/bench_dec_insert.py | from csv import DictWriter
from ktbs_bench.utils.decorators import bench
@bench
def batch_insert(graph, file):
"""Insert triples in batch."""
print(graph, file)
if __name__ == '__main__':
# Define some graph/store to use
graph_list = ['g1', 'g2']
# Define some files to get the triples from
... | Add draft of example using the new @bench | Add draft of example using the new @bench
| Python | mit | ktbs/ktbs-bench,ktbs/ktbs-bench | Add draft of example using the new @bench | from csv import DictWriter
from ktbs_bench.utils.decorators import bench
@bench
def batch_insert(graph, file):
"""Insert triples in batch."""
print(graph, file)
if __name__ == '__main__':
# Define some graph/store to use
graph_list = ['g1', 'g2']
# Define some files to get the triples from
... | <commit_before><commit_msg>Add draft of example using the new @bench<commit_after> | from csv import DictWriter
from ktbs_bench.utils.decorators import bench
@bench
def batch_insert(graph, file):
"""Insert triples in batch."""
print(graph, file)
if __name__ == '__main__':
# Define some graph/store to use
graph_list = ['g1', 'g2']
# Define some files to get the triples from
... | Add draft of example using the new @benchfrom csv import DictWriter
from ktbs_bench.utils.decorators import bench
@bench
def batch_insert(graph, file):
"""Insert triples in batch."""
print(graph, file)
if __name__ == '__main__':
# Define some graph/store to use
graph_list = ['g1', 'g2']
# Defi... | <commit_before><commit_msg>Add draft of example using the new @bench<commit_after>from csv import DictWriter
from ktbs_bench.utils.decorators import bench
@bench
def batch_insert(graph, file):
"""Insert triples in batch."""
print(graph, file)
if __name__ == '__main__':
# Define some graph/store to use
... | |
d4a7bbe27b285e455a3beafefd22fc493edeb161 | test/test_config_eventlogger.py | test/test_config_eventlogger.py | #!/usr/bin/env python2
import unittest
import subprocess
import threading
import tempfile
import os
from testdc import *
DAEMON_PATH = './astrond'
TERMINATED = -15
EXITED = 1
class ConfigTest(object):
def __init__(self, config):
self.config = config
self.process = None
def run(self, timeout)... | Add unittest for eventlogger config validation. | Tests: Add unittest for eventlogger config validation.
| Python | bsd-3-clause | ketoo/Astron,pizcogirl/Astron,ketoo/Astron,blindsighttf2/Astron,blindsighttf2/Astron,ketoo/Astron,pizcogirl/Astron,pizcogirl/Astron,ketoo/Astron,blindsighttf2/Astron,pizcogirl/Astron,blindsighttf2/Astron | Tests: Add unittest for eventlogger config validation. | #!/usr/bin/env python2
import unittest
import subprocess
import threading
import tempfile
import os
from testdc import *
DAEMON_PATH = './astrond'
TERMINATED = -15
EXITED = 1
class ConfigTest(object):
def __init__(self, config):
self.config = config
self.process = None
def run(self, timeout)... | <commit_before><commit_msg>Tests: Add unittest for eventlogger config validation.<commit_after> | #!/usr/bin/env python2
import unittest
import subprocess
import threading
import tempfile
import os
from testdc import *
DAEMON_PATH = './astrond'
TERMINATED = -15
EXITED = 1
class ConfigTest(object):
def __init__(self, config):
self.config = config
self.process = None
def run(self, timeout)... | Tests: Add unittest for eventlogger config validation.#!/usr/bin/env python2
import unittest
import subprocess
import threading
import tempfile
import os
from testdc import *
DAEMON_PATH = './astrond'
TERMINATED = -15
EXITED = 1
class ConfigTest(object):
def __init__(self, config):
self.config = config
... | <commit_before><commit_msg>Tests: Add unittest for eventlogger config validation.<commit_after>#!/usr/bin/env python2
import unittest
import subprocess
import threading
import tempfile
import os
from testdc import *
DAEMON_PATH = './astrond'
TERMINATED = -15
EXITED = 1
class ConfigTest(object):
def __init__(self... | |
2c0ce3c64720122bf2fdd80aeb2ff8359873ac83 | municipal_finance/tests/test_analytics.py | municipal_finance/tests/test_analytics.py | from django.test import TestCase
from django.conf import settings
class TestAnalytics(TestCase):
def test_noindex_flag(self):
response = self.client.get('/')
self.assertEqual(response.status_code, 200)
self.assertTrue('<meta name="robots" content="noindex">' not in str(response.content))
... | Test that noindex flag will only show robots metatag when set | Test that noindex flag will only show robots metatag when set
| Python | mit | Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data | Test that noindex flag will only show robots metatag when set | from django.test import TestCase
from django.conf import settings
class TestAnalytics(TestCase):
def test_noindex_flag(self):
response = self.client.get('/')
self.assertEqual(response.status_code, 200)
self.assertTrue('<meta name="robots" content="noindex">' not in str(response.content))
... | <commit_before><commit_msg>Test that noindex flag will only show robots metatag when set<commit_after> | from django.test import TestCase
from django.conf import settings
class TestAnalytics(TestCase):
def test_noindex_flag(self):
response = self.client.get('/')
self.assertEqual(response.status_code, 200)
self.assertTrue('<meta name="robots" content="noindex">' not in str(response.content))
... | Test that noindex flag will only show robots metatag when setfrom django.test import TestCase
from django.conf import settings
class TestAnalytics(TestCase):
def test_noindex_flag(self):
response = self.client.get('/')
self.assertEqual(response.status_code, 200)
self.assertTrue('<meta nam... | <commit_before><commit_msg>Test that noindex flag will only show robots metatag when set<commit_after>from django.test import TestCase
from django.conf import settings
class TestAnalytics(TestCase):
def test_noindex_flag(self):
response = self.client.get('/')
self.assertEqual(response.status_code... | |
bac06acb1e6255040f371232776f3da75fb9247a | osf/migrations/0069_auto_20171127_1119.py | osf/migrations/0069_auto_20171127_1119.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-27 17:19
from __future__ import unicode_literals
import logging
from django.db import migrations
from osf.models import PreprintService
logger = logging.getLogger(__name__)
def add_preprint_doi_created(apps, schema_editor):
"""
Data migration tha... | Add data migration to populate preprint_doi_created field on existing published preprints where DOI identifier exists. Set to preprint date_published field. | Add data migration to populate preprint_doi_created field on existing published preprints where DOI identifier exists. Set to preprint date_published field.
| Python | apache-2.0 | baylee-d/osf.io,baylee-d/osf.io,erinspace/osf.io,cslzchen/osf.io,mattclark/osf.io,mfraezz/osf.io,cslzchen/osf.io,caseyrollins/osf.io,CenterForOpenScience/osf.io,laurenrevere/osf.io,Johnetordoff/osf.io,saradbowman/osf.io,icereval/osf.io,brianjgeiger/osf.io,felliott/osf.io,cslzchen/osf.io,TomBaxter/osf.io,felliott/osf.io... | Add data migration to populate preprint_doi_created field on existing published preprints where DOI identifier exists. Set to preprint date_published field. | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-27 17:19
from __future__ import unicode_literals
import logging
from django.db import migrations
from osf.models import PreprintService
logger = logging.getLogger(__name__)
def add_preprint_doi_created(apps, schema_editor):
"""
Data migration tha... | <commit_before><commit_msg>Add data migration to populate preprint_doi_created field on existing published preprints where DOI identifier exists. Set to preprint date_published field.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-27 17:19
from __future__ import unicode_literals
import logging
from django.db import migrations
from osf.models import PreprintService
logger = logging.getLogger(__name__)
def add_preprint_doi_created(apps, schema_editor):
"""
Data migration tha... | Add data migration to populate preprint_doi_created field on existing published preprints where DOI identifier exists. Set to preprint date_published field.# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-27 17:19
from __future__ import unicode_literals
import logging
from django.db import migrations
f... | <commit_before><commit_msg>Add data migration to populate preprint_doi_created field on existing published preprints where DOI identifier exists. Set to preprint date_published field.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-27 17:19
from __future__ import unicode_literals
import lo... | |
167a6497d79a4a18badd5ea85a87e7eefcd02696 | test/acceptance/__init__.py | test/acceptance/__init__.py | # -*- coding: utf-8 -*-
"""
Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U
This file is part of fiware-orion-pep
fiware-orion-pep 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 versio... | Add init file to the root acceptance tests folder | Add init file to the root acceptance tests folder
| Python | agpl-3.0 | telefonicaid/fiware-pep-steelskin,agroknow/fiware-pep-steelskin,agroknow/fiware-pep-steelskin,agroknow/fiware-pep-steelskin,telefonicaid/fiware-pep-steelskin,agroknow/fiware-pep-steelskin,telefonicaid/fiware-pep-steelskin,telefonicaid/fiware-pep-steelskin | Add init file to the root acceptance tests folder | # -*- coding: utf-8 -*-
"""
Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U
This file is part of fiware-orion-pep
fiware-orion-pep 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 versio... | <commit_before><commit_msg>Add init file to the root acceptance tests folder<commit_after> | # -*- coding: utf-8 -*-
"""
Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U
This file is part of fiware-orion-pep
fiware-orion-pep 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 versio... | Add init file to the root acceptance tests folder# -*- coding: utf-8 -*-
"""
Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U
This file is part of fiware-orion-pep
fiware-orion-pep is free software: you can redistribute it and/or
modify it under the terms of the GNU Affero General Public License as
publish... | <commit_before><commit_msg>Add init file to the root acceptance tests folder<commit_after># -*- coding: utf-8 -*-
"""
Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U
This file is part of fiware-orion-pep
fiware-orion-pep is free software: you can redistribute it and/or
modify it under the terms of the GNU... | |
b171eb0c77f2d68051b48145f4e49275ed6860b9 | account/tests/test_models.py | account/tests/test_models.py | from django.conf import settings
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase, override_settings
from django.contrib.auth.models import User
from account.models import SignupCode
class SignupCodeModelTestCase(TestCase):
def test_exists_no_match(self)... | Add tests for signup code exists method | Add tests for signup code exists method
| Python | mit | pinax/django-user-accounts,pinax/django-user-accounts | Add tests for signup code exists method | from django.conf import settings
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase, override_settings
from django.contrib.auth.models import User
from account.models import SignupCode
class SignupCodeModelTestCase(TestCase):
def test_exists_no_match(self)... | <commit_before><commit_msg>Add tests for signup code exists method<commit_after> | from django.conf import settings
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase, override_settings
from django.contrib.auth.models import User
from account.models import SignupCode
class SignupCodeModelTestCase(TestCase):
def test_exists_no_match(self)... | Add tests for signup code exists methodfrom django.conf import settings
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase, override_settings
from django.contrib.auth.models import User
from account.models import SignupCode
class SignupCodeModelTestCase(TestCa... | <commit_before><commit_msg>Add tests for signup code exists method<commit_after>from django.conf import settings
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase, override_settings
from django.contrib.auth.models import User
from account.models import SignupCo... | |
95874a5e06ff70d1cbea49321549beee5cc5abba | examples/store_and_retrieve_units_example.py | examples/store_and_retrieve_units_example.py | """
Author: Daniel Berke, berke.daniel@gmail.com
Date: October 27, 2019
Requirements: h5py>=2.10.0, unyt>=v2.4.0
Notes: This short example script shows how to save unit information attached
to a `unyt_array` using `attrs` in HDF5, and recover it upon reading the file.
It uses the Unyt package (https://github.com/yt-pro... | Create an example of storing units in HDF5 | Create an example of storing units in HDF5
This example script demonstrates how to store unit information attached to an array of numbers using HDF5 in such a way that the original data can be recovered upon reading the file. It uses the Unyt package (https://github.com/yt-project/unyt) for handling units, but presuma... | Python | bsd-3-clause | h5py/h5py,h5py/h5py,h5py/h5py | Create an example of storing units in HDF5
This example script demonstrates how to store unit information attached to an array of numbers using HDF5 in such a way that the original data can be recovered upon reading the file. It uses the Unyt package (https://github.com/yt-project/unyt) for handling units, but presuma... | """
Author: Daniel Berke, berke.daniel@gmail.com
Date: October 27, 2019
Requirements: h5py>=2.10.0, unyt>=v2.4.0
Notes: This short example script shows how to save unit information attached
to a `unyt_array` using `attrs` in HDF5, and recover it upon reading the file.
It uses the Unyt package (https://github.com/yt-pro... | <commit_before><commit_msg>Create an example of storing units in HDF5
This example script demonstrates how to store unit information attached to an array of numbers using HDF5 in such a way that the original data can be recovered upon reading the file. It uses the Unyt package (https://github.com/yt-project/unyt) for ... | """
Author: Daniel Berke, berke.daniel@gmail.com
Date: October 27, 2019
Requirements: h5py>=2.10.0, unyt>=v2.4.0
Notes: This short example script shows how to save unit information attached
to a `unyt_array` using `attrs` in HDF5, and recover it upon reading the file.
It uses the Unyt package (https://github.com/yt-pro... | Create an example of storing units in HDF5
This example script demonstrates how to store unit information attached to an array of numbers using HDF5 in such a way that the original data can be recovered upon reading the file. It uses the Unyt package (https://github.com/yt-project/unyt) for handling units, but presuma... | <commit_before><commit_msg>Create an example of storing units in HDF5
This example script demonstrates how to store unit information attached to an array of numbers using HDF5 in such a way that the original data can be recovered upon reading the file. It uses the Unyt package (https://github.com/yt-project/unyt) for ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.