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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
94aec9e4a6501e875dbd6b59df57598f742a82da | ca_on_niagara/people.py | ca_on_niagara/people.py | from __future__ import unicode_literals
from utils import CSVScraper
COUNCIL_PAGE = 'http://www.niagararegion.ca/test/sherpa-list-to-csv.aspx?list=council-elected-officials-csv'
class NiagaraPersonScraper(CSVScraper):
csv_url = 'http://www.niagararegion.ca/test/sherpa-list-to-csv.aspx?list=council-elected-offici... | from __future__ import unicode_literals
from utils import CSVScraper
COUNCIL_PAGE = 'http://www.niagararegion.ca/test/sherpa-list-to-csv.aspx?list=council-elected-officials-csv'
class NiagaraPersonScraper(CSVScraper):
# The new data file:
# * has underscores in headers
# * yses "District_ID" instead of "... | Add comments about new file | ca_on_niagara: Add comments about new file
| Python | mit | opencivicdata/scrapers-ca,opencivicdata/scrapers-ca | from __future__ import unicode_literals
from utils import CSVScraper
COUNCIL_PAGE = 'http://www.niagararegion.ca/test/sherpa-list-to-csv.aspx?list=council-elected-officials-csv'
class NiagaraPersonScraper(CSVScraper):
csv_url = 'http://www.niagararegion.ca/test/sherpa-list-to-csv.aspx?list=council-elected-offici... | from __future__ import unicode_literals
from utils import CSVScraper
COUNCIL_PAGE = 'http://www.niagararegion.ca/test/sherpa-list-to-csv.aspx?list=council-elected-officials-csv'
class NiagaraPersonScraper(CSVScraper):
# The new data file:
# * has underscores in headers
# * yses "District_ID" instead of "... | <commit_before>from __future__ import unicode_literals
from utils import CSVScraper
COUNCIL_PAGE = 'http://www.niagararegion.ca/test/sherpa-list-to-csv.aspx?list=council-elected-officials-csv'
class NiagaraPersonScraper(CSVScraper):
csv_url = 'http://www.niagararegion.ca/test/sherpa-list-to-csv.aspx?list=council... | from __future__ import unicode_literals
from utils import CSVScraper
COUNCIL_PAGE = 'http://www.niagararegion.ca/test/sherpa-list-to-csv.aspx?list=council-elected-officials-csv'
class NiagaraPersonScraper(CSVScraper):
# The new data file:
# * has underscores in headers
# * yses "District_ID" instead of "... | from __future__ import unicode_literals
from utils import CSVScraper
COUNCIL_PAGE = 'http://www.niagararegion.ca/test/sherpa-list-to-csv.aspx?list=council-elected-officials-csv'
class NiagaraPersonScraper(CSVScraper):
csv_url = 'http://www.niagararegion.ca/test/sherpa-list-to-csv.aspx?list=council-elected-offici... | <commit_before>from __future__ import unicode_literals
from utils import CSVScraper
COUNCIL_PAGE = 'http://www.niagararegion.ca/test/sherpa-list-to-csv.aspx?list=council-elected-officials-csv'
class NiagaraPersonScraper(CSVScraper):
csv_url = 'http://www.niagararegion.ca/test/sherpa-list-to-csv.aspx?list=council... |
abe6a2d2269b2b12d77ec4484ece9bbe81b6810e | ce/transformer/utils.py | ce/transformer/utils.py | def expand(tree):
| from ce.transformer.core import TreeTransformer
from ce.transformer.biop import associativity, distribute_for_distributivity
def transform(tree, reduction_methods=None, transform_methods=None):
t = TreeTransformer(tree)
t.reduction_methods = reduction_methods or []
t.transform_methods = transform_methods ... | Add some transformation utility functions | Add some transformation utility functions
| Python | mit | admk/soap | def expand(tree):
Add some transformation utility functions | from ce.transformer.core import TreeTransformer
from ce.transformer.biop import associativity, distribute_for_distributivity
def transform(tree, reduction_methods=None, transform_methods=None):
t = TreeTransformer(tree)
t.reduction_methods = reduction_methods or []
t.transform_methods = transform_methods ... | <commit_before>def expand(tree):
<commit_msg>Add some transformation utility functions<commit_after> | from ce.transformer.core import TreeTransformer
from ce.transformer.biop import associativity, distribute_for_distributivity
def transform(tree, reduction_methods=None, transform_methods=None):
t = TreeTransformer(tree)
t.reduction_methods = reduction_methods or []
t.transform_methods = transform_methods ... | def expand(tree):
Add some transformation utility functionsfrom ce.transformer.core import TreeTransformer
from ce.transformer.biop import associativity, distribute_for_distributivity
def transform(tree, reduction_methods=None, transform_methods=None):
t = TreeTransformer(tree)
t.reduction_methods = redu... | <commit_before>def expand(tree):
<commit_msg>Add some transformation utility functions<commit_after>from ce.transformer.core import TreeTransformer
from ce.transformer.biop import associativity, distribute_for_distributivity
def transform(tree, reduction_methods=None, transform_methods=None):
t = TreeTransfo... |
084d95d9409e676ba6de2621a38982da9cd1e81c | benchmarker/modules/problems/res10ssd/opencv.py | benchmarker/modules/problems/res10ssd/opencv.py | import cv2
# TODO: make this downloadable
PATH_PROTO = "/mnt/kodi/blackbird/Scry/models/3rd_party/res10_ssd/deploy.prototxt.txt"
PATH_WEIGHTS = "/mnt/kodi/blackbird/Scry/models/3rd_party/res10_ssd/res10_300x300_ssd_iter_140000.caffemodel"
def get_kernel(params, unparsed_args=None):
assert params["mode"] == "inf... | from pathlib import Path
import cv2
def get_kernel(params, unparsed_args=None):
proto = "deploy.prototxt.txt"
weights = "res10_300x300_ssd_iter_140000.caffemodel"
BASE = Path("~/.cache/benchmarker/models").expanduser()
PATH_PROTO = BASE.joinpath(proto)
PATH_WEIGHTS = BASE.joinpath(weights)
... | Fix hardwired weights for res10ssd | Fix hardwired weights for res10ssd
| Python | mpl-2.0 | undertherain/benchmarker,undertherain/benchmarker,undertherain/benchmarker,undertherain/benchmarker | import cv2
# TODO: make this downloadable
PATH_PROTO = "/mnt/kodi/blackbird/Scry/models/3rd_party/res10_ssd/deploy.prototxt.txt"
PATH_WEIGHTS = "/mnt/kodi/blackbird/Scry/models/3rd_party/res10_ssd/res10_300x300_ssd_iter_140000.caffemodel"
def get_kernel(params, unparsed_args=None):
assert params["mode"] == "inf... | from pathlib import Path
import cv2
def get_kernel(params, unparsed_args=None):
proto = "deploy.prototxt.txt"
weights = "res10_300x300_ssd_iter_140000.caffemodel"
BASE = Path("~/.cache/benchmarker/models").expanduser()
PATH_PROTO = BASE.joinpath(proto)
PATH_WEIGHTS = BASE.joinpath(weights)
... | <commit_before>import cv2
# TODO: make this downloadable
PATH_PROTO = "/mnt/kodi/blackbird/Scry/models/3rd_party/res10_ssd/deploy.prototxt.txt"
PATH_WEIGHTS = "/mnt/kodi/blackbird/Scry/models/3rd_party/res10_ssd/res10_300x300_ssd_iter_140000.caffemodel"
def get_kernel(params, unparsed_args=None):
assert params[... | from pathlib import Path
import cv2
def get_kernel(params, unparsed_args=None):
proto = "deploy.prototxt.txt"
weights = "res10_300x300_ssd_iter_140000.caffemodel"
BASE = Path("~/.cache/benchmarker/models").expanduser()
PATH_PROTO = BASE.joinpath(proto)
PATH_WEIGHTS = BASE.joinpath(weights)
... | import cv2
# TODO: make this downloadable
PATH_PROTO = "/mnt/kodi/blackbird/Scry/models/3rd_party/res10_ssd/deploy.prototxt.txt"
PATH_WEIGHTS = "/mnt/kodi/blackbird/Scry/models/3rd_party/res10_ssd/res10_300x300_ssd_iter_140000.caffemodel"
def get_kernel(params, unparsed_args=None):
assert params["mode"] == "inf... | <commit_before>import cv2
# TODO: make this downloadable
PATH_PROTO = "/mnt/kodi/blackbird/Scry/models/3rd_party/res10_ssd/deploy.prototxt.txt"
PATH_WEIGHTS = "/mnt/kodi/blackbird/Scry/models/3rd_party/res10_ssd/res10_300x300_ssd_iter_140000.caffemodel"
def get_kernel(params, unparsed_args=None):
assert params[... |
3c0f8899521465fcb2d4685b6e6e6e3e61c0eabc | kitchen/dashboard/graphs.py | kitchen/dashboard/graphs.py | """Facility to render node graphs using pydot"""
import os
import pydot
from kitchen.settings import STATIC_ROOT, REPO
def generate_node_map(nodes):
"""Generates a graphviz nodemap"""
graph = pydot.Dot(graph_type='digraph')
graph_nodes = {}
# Create nodes
for node in nodes:
label = node['... | """Facility to render node graphs using pydot"""
import os
import pydot
from kitchen.settings import STATIC_ROOT, REPO
def generate_node_map(nodes):
"""Generates a graphviz nodemap"""
graph = pydot.Dot(graph_type='digraph')
graph_nodes = {}
# Create nodes
for node in nodes:
label = node['... | Change to "ask for forgiveness", as the 'client_roles' condition could get too complicated | Change to "ask for forgiveness", as the 'client_roles' condition could get too complicated
| Python | apache-2.0 | edelight/kitchen,edelight/kitchen,edelight/kitchen,edelight/kitchen | """Facility to render node graphs using pydot"""
import os
import pydot
from kitchen.settings import STATIC_ROOT, REPO
def generate_node_map(nodes):
"""Generates a graphviz nodemap"""
graph = pydot.Dot(graph_type='digraph')
graph_nodes = {}
# Create nodes
for node in nodes:
label = node['... | """Facility to render node graphs using pydot"""
import os
import pydot
from kitchen.settings import STATIC_ROOT, REPO
def generate_node_map(nodes):
"""Generates a graphviz nodemap"""
graph = pydot.Dot(graph_type='digraph')
graph_nodes = {}
# Create nodes
for node in nodes:
label = node['... | <commit_before>"""Facility to render node graphs using pydot"""
import os
import pydot
from kitchen.settings import STATIC_ROOT, REPO
def generate_node_map(nodes):
"""Generates a graphviz nodemap"""
graph = pydot.Dot(graph_type='digraph')
graph_nodes = {}
# Create nodes
for node in nodes:
... | """Facility to render node graphs using pydot"""
import os
import pydot
from kitchen.settings import STATIC_ROOT, REPO
def generate_node_map(nodes):
"""Generates a graphviz nodemap"""
graph = pydot.Dot(graph_type='digraph')
graph_nodes = {}
# Create nodes
for node in nodes:
label = node['... | """Facility to render node graphs using pydot"""
import os
import pydot
from kitchen.settings import STATIC_ROOT, REPO
def generate_node_map(nodes):
"""Generates a graphviz nodemap"""
graph = pydot.Dot(graph_type='digraph')
graph_nodes = {}
# Create nodes
for node in nodes:
label = node['... | <commit_before>"""Facility to render node graphs using pydot"""
import os
import pydot
from kitchen.settings import STATIC_ROOT, REPO
def generate_node_map(nodes):
"""Generates a graphviz nodemap"""
graph = pydot.Dot(graph_type='digraph')
graph_nodes = {}
# Create nodes
for node in nodes:
... |
5f7e05a831b86d750ef1d7717c8e1bbfdba4fc7c | tohu/v5/logging.py | tohu/v5/logging.py | import logging
__all__ = ['logger']
#
# Create logger
#
logger = logging.getLogger('tohu')
logger.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('{asctime} {levelname} {message}', datefmt='%Y-%m-%d %H:%M:%S', style='{')
ch.setFormatter(formatter)
logger.a... | import logging
__all__ = ['logger']
#
# Create logger
#
logger = logging.getLogger('tohu_v5')
logger.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('{asctime} {levelname} {message}', datefmt='%Y-%m-%d %H:%M:%S', style='{')
ch.setFormatter(formatter)
logge... | Use different logger name for the time being to avoid duplicate debug messages | Use different logger name for the time being to avoid duplicate debug messages
| Python | mit | maxalbert/tohu | import logging
__all__ = ['logger']
#
# Create logger
#
logger = logging.getLogger('tohu')
logger.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('{asctime} {levelname} {message}', datefmt='%Y-%m-%d %H:%M:%S', style='{')
ch.setFormatter(formatter)
logger.a... | import logging
__all__ = ['logger']
#
# Create logger
#
logger = logging.getLogger('tohu_v5')
logger.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('{asctime} {levelname} {message}', datefmt='%Y-%m-%d %H:%M:%S', style='{')
ch.setFormatter(formatter)
logge... | <commit_before>import logging
__all__ = ['logger']
#
# Create logger
#
logger = logging.getLogger('tohu')
logger.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('{asctime} {levelname} {message}', datefmt='%Y-%m-%d %H:%M:%S', style='{')
ch.setFormatter(form... | import logging
__all__ = ['logger']
#
# Create logger
#
logger = logging.getLogger('tohu_v5')
logger.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('{asctime} {levelname} {message}', datefmt='%Y-%m-%d %H:%M:%S', style='{')
ch.setFormatter(formatter)
logge... | import logging
__all__ = ['logger']
#
# Create logger
#
logger = logging.getLogger('tohu')
logger.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('{asctime} {levelname} {message}', datefmt='%Y-%m-%d %H:%M:%S', style='{')
ch.setFormatter(formatter)
logger.a... | <commit_before>import logging
__all__ = ['logger']
#
# Create logger
#
logger = logging.getLogger('tohu')
logger.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('{asctime} {levelname} {message}', datefmt='%Y-%m-%d %H:%M:%S', style='{')
ch.setFormatter(form... |
9354bf323db14bf68d68a0af26d59b46d068af0f | seleniumbase/console_scripts/rich_helper.py | seleniumbase/console_scripts/rich_helper.py | from rich.console import Console
from rich.markdown import Markdown
from rich.syntax import Syntax
def process_syntax(code, lang, theme, line_numbers, code_width, word_wrap):
syntax = Syntax(
code,
lang,
theme=theme,
line_numbers=line_numbers,
code_width=code_width,
... | from rich.console import Console
from rich.markdown import Markdown
from rich.syntax import Syntax
def process_syntax(code, lang, theme, line_numbers, code_width, word_wrap):
syntax = Syntax(
code,
lang,
theme=theme,
line_numbers=line_numbers,
code_width=code_width,
... | Update double_width_emojis list to improve "rich" printing | Update double_width_emojis list to improve "rich" printing
| Python | mit | seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase | from rich.console import Console
from rich.markdown import Markdown
from rich.syntax import Syntax
def process_syntax(code, lang, theme, line_numbers, code_width, word_wrap):
syntax = Syntax(
code,
lang,
theme=theme,
line_numbers=line_numbers,
code_width=code_width,
... | from rich.console import Console
from rich.markdown import Markdown
from rich.syntax import Syntax
def process_syntax(code, lang, theme, line_numbers, code_width, word_wrap):
syntax = Syntax(
code,
lang,
theme=theme,
line_numbers=line_numbers,
code_width=code_width,
... | <commit_before>from rich.console import Console
from rich.markdown import Markdown
from rich.syntax import Syntax
def process_syntax(code, lang, theme, line_numbers, code_width, word_wrap):
syntax = Syntax(
code,
lang,
theme=theme,
line_numbers=line_numbers,
code_width=code... | from rich.console import Console
from rich.markdown import Markdown
from rich.syntax import Syntax
def process_syntax(code, lang, theme, line_numbers, code_width, word_wrap):
syntax = Syntax(
code,
lang,
theme=theme,
line_numbers=line_numbers,
code_width=code_width,
... | from rich.console import Console
from rich.markdown import Markdown
from rich.syntax import Syntax
def process_syntax(code, lang, theme, line_numbers, code_width, word_wrap):
syntax = Syntax(
code,
lang,
theme=theme,
line_numbers=line_numbers,
code_width=code_width,
... | <commit_before>from rich.console import Console
from rich.markdown import Markdown
from rich.syntax import Syntax
def process_syntax(code, lang, theme, line_numbers, code_width, word_wrap):
syntax = Syntax(
code,
lang,
theme=theme,
line_numbers=line_numbers,
code_width=code... |
d8d24b48d4956d569a0d0e37733c73db43015035 | test_settings.py | test_settings.py | from os.path import expanduser
from foundry.settings import *
# Postgis because we want to test full functionality
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'jmbo_spatial',
'USER': 'postgres',
'PASSWORD': '',
'HOST': '',
... | from os.path import expanduser
from foundry.settings import *
# Postgis because we want to test full functionality
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'jmbo_spatial',
'USER': 'postgres',
'PASSWORD': '',
'HOST': '',
... | Disable some apps for tests | Disable some apps for tests
| Python | bsd-3-clause | praekelt/jmbo-foundry,praekelt/jmbo-foundry,praekelt/jmbo-foundry | from os.path import expanduser
from foundry.settings import *
# Postgis because we want to test full functionality
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'jmbo_spatial',
'USER': 'postgres',
'PASSWORD': '',
'HOST': '',
... | from os.path import expanduser
from foundry.settings import *
# Postgis because we want to test full functionality
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'jmbo_spatial',
'USER': 'postgres',
'PASSWORD': '',
'HOST': '',
... | <commit_before>from os.path import expanduser
from foundry.settings import *
# Postgis because we want to test full functionality
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'jmbo_spatial',
'USER': 'postgres',
'PASSWORD': '',
'HOST... | from os.path import expanduser
from foundry.settings import *
# Postgis because we want to test full functionality
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'jmbo_spatial',
'USER': 'postgres',
'PASSWORD': '',
'HOST': '',
... | from os.path import expanduser
from foundry.settings import *
# Postgis because we want to test full functionality
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'jmbo_spatial',
'USER': 'postgres',
'PASSWORD': '',
'HOST': '',
... | <commit_before>from os.path import expanduser
from foundry.settings import *
# Postgis because we want to test full functionality
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'jmbo_spatial',
'USER': 'postgres',
'PASSWORD': '',
'HOST... |
b958d723f73f7743d646c2c6911bf8428583bf0e | tests/test_compound.py | tests/test_compound.py | import pytest
from katana.storage import Node, Pair, prepare
from katana.compound import sequence, group, repeat, option, maybe
from katana.term import term
A = term('a')
B = term('b')
C = term('c')
node = lambda x: Node(x, 'data')
def test_sequence():
na = node('a')
nb = node('b')
s = sequence(A, B)
... | import pytest
from katana.storage import Node, Pair, prepare
from katana.compound import sequence, group, repeat, option, maybe
from katana.term import term
Ta = term('a')
Tb = term('b')
Tc = term('c')
Na = Node('a', 'data')
Nb = Node('b', 'data')
Nc = Node('c', 'data')
def test_sequence():
s = sequence(Ta, Tb)... | Refactor test case for compound terms | Refactor test case for compound terms
| Python | mit | eugene-eeo/katana | import pytest
from katana.storage import Node, Pair, prepare
from katana.compound import sequence, group, repeat, option, maybe
from katana.term import term
A = term('a')
B = term('b')
C = term('c')
node = lambda x: Node(x, 'data')
def test_sequence():
na = node('a')
nb = node('b')
s = sequence(A, B)
... | import pytest
from katana.storage import Node, Pair, prepare
from katana.compound import sequence, group, repeat, option, maybe
from katana.term import term
Ta = term('a')
Tb = term('b')
Tc = term('c')
Na = Node('a', 'data')
Nb = Node('b', 'data')
Nc = Node('c', 'data')
def test_sequence():
s = sequence(Ta, Tb)... | <commit_before>import pytest
from katana.storage import Node, Pair, prepare
from katana.compound import sequence, group, repeat, option, maybe
from katana.term import term
A = term('a')
B = term('b')
C = term('c')
node = lambda x: Node(x, 'data')
def test_sequence():
na = node('a')
nb = node('b')
s = se... | import pytest
from katana.storage import Node, Pair, prepare
from katana.compound import sequence, group, repeat, option, maybe
from katana.term import term
Ta = term('a')
Tb = term('b')
Tc = term('c')
Na = Node('a', 'data')
Nb = Node('b', 'data')
Nc = Node('c', 'data')
def test_sequence():
s = sequence(Ta, Tb)... | import pytest
from katana.storage import Node, Pair, prepare
from katana.compound import sequence, group, repeat, option, maybe
from katana.term import term
A = term('a')
B = term('b')
C = term('c')
node = lambda x: Node(x, 'data')
def test_sequence():
na = node('a')
nb = node('b')
s = sequence(A, B)
... | <commit_before>import pytest
from katana.storage import Node, Pair, prepare
from katana.compound import sequence, group, repeat, option, maybe
from katana.term import term
A = term('a')
B = term('b')
C = term('c')
node = lambda x: Node(x, 'data')
def test_sequence():
na = node('a')
nb = node('b')
s = se... |
573d3d8b652527e0293321e09474f7a6e5b243f4 | tests/test_dispatch.py | tests/test_dispatch.py | import accordian
import pytest
def test_unknown_event(loop):
"""
An exception should be thrown when trying to register a
handler for an unknown event.
"""
dispatch = accordian.Dispatch(loop=loop)
with pytest.raises(ValueError):
dispatch.on("unknown")
def test_clean_stop(loop):
di... | import pytest
def test_start_idempotent(loop, dispatch):
loop.run_until_complete(dispatch.start())
assert dispatch.running
loop.run_until_complete(dispatch.start())
assert dispatch.running
def test_stop_idempotent(loop, dispatch):
loop.run_until_complete(dispatch.start())
assert dispatch.ru... | Test dispatch (un)register, basic handler | Test dispatch (un)register, basic handler
| Python | mit | numberoverzero/accordian | import accordian
import pytest
def test_unknown_event(loop):
"""
An exception should be thrown when trying to register a
handler for an unknown event.
"""
dispatch = accordian.Dispatch(loop=loop)
with pytest.raises(ValueError):
dispatch.on("unknown")
def test_clean_stop(loop):
di... | import pytest
def test_start_idempotent(loop, dispatch):
loop.run_until_complete(dispatch.start())
assert dispatch.running
loop.run_until_complete(dispatch.start())
assert dispatch.running
def test_stop_idempotent(loop, dispatch):
loop.run_until_complete(dispatch.start())
assert dispatch.ru... | <commit_before>import accordian
import pytest
def test_unknown_event(loop):
"""
An exception should be thrown when trying to register a
handler for an unknown event.
"""
dispatch = accordian.Dispatch(loop=loop)
with pytest.raises(ValueError):
dispatch.on("unknown")
def test_clean_sto... | import pytest
def test_start_idempotent(loop, dispatch):
loop.run_until_complete(dispatch.start())
assert dispatch.running
loop.run_until_complete(dispatch.start())
assert dispatch.running
def test_stop_idempotent(loop, dispatch):
loop.run_until_complete(dispatch.start())
assert dispatch.ru... | import accordian
import pytest
def test_unknown_event(loop):
"""
An exception should be thrown when trying to register a
handler for an unknown event.
"""
dispatch = accordian.Dispatch(loop=loop)
with pytest.raises(ValueError):
dispatch.on("unknown")
def test_clean_stop(loop):
di... | <commit_before>import accordian
import pytest
def test_unknown_event(loop):
"""
An exception should be thrown when trying to register a
handler for an unknown event.
"""
dispatch = accordian.Dispatch(loop=loop)
with pytest.raises(ValueError):
dispatch.on("unknown")
def test_clean_sto... |
6794cc50e272d134900673ed4eaded73580b746c | tests/test_response.py | tests/test_response.py | import json
import unittest
from alerta.app import create_app, db
class ApiResponseTestCase(unittest.TestCase):
def setUp(self):
test_config = {
'TESTING': True,
'BASE_URL': 'https://api.alerta.dev:9898/_'
}
self.app = create_app(test_config)
self.client =... | import json
import unittest
from alerta.app import create_app, db
class ApiResponseTestCase(unittest.TestCase):
def setUp(self):
test_config = {
'TESTING': True,
'BASE_URL': 'https://api.alerta.dev:9898/_'
}
self.app = create_app(test_config)
self.client =... | Add test for custom id in response | Add test for custom id in response
| Python | apache-2.0 | guardian/alerta,guardian/alerta,guardian/alerta,guardian/alerta | import json
import unittest
from alerta.app import create_app, db
class ApiResponseTestCase(unittest.TestCase):
def setUp(self):
test_config = {
'TESTING': True,
'BASE_URL': 'https://api.alerta.dev:9898/_'
}
self.app = create_app(test_config)
self.client =... | import json
import unittest
from alerta.app import create_app, db
class ApiResponseTestCase(unittest.TestCase):
def setUp(self):
test_config = {
'TESTING': True,
'BASE_URL': 'https://api.alerta.dev:9898/_'
}
self.app = create_app(test_config)
self.client =... | <commit_before>import json
import unittest
from alerta.app import create_app, db
class ApiResponseTestCase(unittest.TestCase):
def setUp(self):
test_config = {
'TESTING': True,
'BASE_URL': 'https://api.alerta.dev:9898/_'
}
self.app = create_app(test_config)
... | import json
import unittest
from alerta.app import create_app, db
class ApiResponseTestCase(unittest.TestCase):
def setUp(self):
test_config = {
'TESTING': True,
'BASE_URL': 'https://api.alerta.dev:9898/_'
}
self.app = create_app(test_config)
self.client =... | import json
import unittest
from alerta.app import create_app, db
class ApiResponseTestCase(unittest.TestCase):
def setUp(self):
test_config = {
'TESTING': True,
'BASE_URL': 'https://api.alerta.dev:9898/_'
}
self.app = create_app(test_config)
self.client =... | <commit_before>import json
import unittest
from alerta.app import create_app, db
class ApiResponseTestCase(unittest.TestCase):
def setUp(self):
test_config = {
'TESTING': True,
'BASE_URL': 'https://api.alerta.dev:9898/_'
}
self.app = create_app(test_config)
... |
906c48fc91fdf3518fecf79e957cd618fc117b5b | traw/__init__.py | traw/__init__.py | from pbr.version import VersionInfo
__version__ = VersionInfo('instabrade').semantic_version().release_string()
from .client import Client # NOQA
| """ TRAW: TestRail API Wrapper
TRAW is an API wrapper for Gurrock's TestRail test management suite
The intended way to begin is to instantiate the TRAW Client:
.. code-block:: python
import traw
testrail = traw.Client(username='username',
user_api_key='api_key',
... | Update docstrings and help() messages | Update docstrings and help() messages
| Python | mit | levi-rs/traw | from pbr.version import VersionInfo
__version__ = VersionInfo('instabrade').semantic_version().release_string()
from .client import Client # NOQA
Update docstrings and help() messages | """ TRAW: TestRail API Wrapper
TRAW is an API wrapper for Gurrock's TestRail test management suite
The intended way to begin is to instantiate the TRAW Client:
.. code-block:: python
import traw
testrail = traw.Client(username='username',
user_api_key='api_key',
... | <commit_before>from pbr.version import VersionInfo
__version__ = VersionInfo('instabrade').semantic_version().release_string()
from .client import Client # NOQA
<commit_msg>Update docstrings and help() messages<commit_after> | """ TRAW: TestRail API Wrapper
TRAW is an API wrapper for Gurrock's TestRail test management suite
The intended way to begin is to instantiate the TRAW Client:
.. code-block:: python
import traw
testrail = traw.Client(username='username',
user_api_key='api_key',
... | from pbr.version import VersionInfo
__version__ = VersionInfo('instabrade').semantic_version().release_string()
from .client import Client # NOQA
Update docstrings and help() messages""" TRAW: TestRail API Wrapper
TRAW is an API wrapper for Gurrock's TestRail test management suite
The intended way to begin is to ... | <commit_before>from pbr.version import VersionInfo
__version__ = VersionInfo('instabrade').semantic_version().release_string()
from .client import Client # NOQA
<commit_msg>Update docstrings and help() messages<commit_after>""" TRAW: TestRail API Wrapper
TRAW is an API wrapper for Gurrock's TestRail test managemen... |
5c0bee77329f68ed0b2e3b576747886492007b8c | neovim/tabpage.py | neovim/tabpage.py | from util import RemoteMap
class Tabpage(object):
@property
def windows(self):
if not hasattr(self, '_windows'):
self._windows = RemoteSequence(self,
self.Window,
lambda: self.get_windows())
return... | from util import RemoteMap, RemoteSequence
class Tabpage(object):
@property
def windows(self):
if not hasattr(self, '_windows'):
self._windows = RemoteSequence(self,
self._vim.Window,
lambda: self.get_wind... | Fix 'windows' property of Tabpage objects | Fix 'windows' property of Tabpage objects
| Python | apache-2.0 | bfredl/python-client,fwalch/python-client,Shougo/python-client,neovim/python-client,meitham/python-client,brcolow/python-client,traverseda/python-client,neovim/python-client,Shougo/python-client,meitham/python-client,starcraftman/python-client,brcolow/python-client,0x90sled/python-client,fwalch/python-client,zchee/pyth... | from util import RemoteMap
class Tabpage(object):
@property
def windows(self):
if not hasattr(self, '_windows'):
self._windows = RemoteSequence(self,
self.Window,
lambda: self.get_windows())
return... | from util import RemoteMap, RemoteSequence
class Tabpage(object):
@property
def windows(self):
if not hasattr(self, '_windows'):
self._windows = RemoteSequence(self,
self._vim.Window,
lambda: self.get_wind... | <commit_before>from util import RemoteMap
class Tabpage(object):
@property
def windows(self):
if not hasattr(self, '_windows'):
self._windows = RemoteSequence(self,
self.Window,
lambda: self.get_windows())... | from util import RemoteMap, RemoteSequence
class Tabpage(object):
@property
def windows(self):
if not hasattr(self, '_windows'):
self._windows = RemoteSequence(self,
self._vim.Window,
lambda: self.get_wind... | from util import RemoteMap
class Tabpage(object):
@property
def windows(self):
if not hasattr(self, '_windows'):
self._windows = RemoteSequence(self,
self.Window,
lambda: self.get_windows())
return... | <commit_before>from util import RemoteMap
class Tabpage(object):
@property
def windows(self):
if not hasattr(self, '_windows'):
self._windows = RemoteSequence(self,
self.Window,
lambda: self.get_windows())... |
b5ecb9c41aacea5450966a2539dc5a6af56ef168 | sale_order_mail_product_attach_prod_pack/__init__.py | sale_order_mail_product_attach_prod_pack/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Ingenieria ADHOC - ADHOC SA
# https://launchpad.net/~ingenieria-adhoc
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lice... | # -*- coding: utf-8 -*-
##############################################################################
#
# Ingenieria ADHOC - ADHOC SA
# https://launchpad.net/~ingenieria-adhoc
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lice... | FIX sale order prod attach prod pack | FIX sale order prod attach prod pack
| Python | agpl-3.0 | ingadhoc/account-payment,ingadhoc/product,syci/ingadhoc-odoo-addons,ingadhoc/sale,ingadhoc/sale,jorsea/odoo-addons,ClearCorp/account-financial-tools,bmya/odoo-addons,HBEE/odoo-addons,bmya/odoo-addons,maljac/odoo-addons,maljac/odoo-addons,ingadhoc/odoo-addons,ingadhoc/partner,syci/ingadhoc-odoo-addons,dvitme/odoo-addons... | # -*- coding: utf-8 -*-
##############################################################################
#
# Ingenieria ADHOC - ADHOC SA
# https://launchpad.net/~ingenieria-adhoc
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lice... | # -*- coding: utf-8 -*-
##############################################################################
#
# Ingenieria ADHOC - ADHOC SA
# https://launchpad.net/~ingenieria-adhoc
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lice... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# Ingenieria ADHOC - ADHOC SA
# https://launchpad.net/~ingenieria-adhoc
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... | # -*- coding: utf-8 -*-
##############################################################################
#
# Ingenieria ADHOC - ADHOC SA
# https://launchpad.net/~ingenieria-adhoc
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lice... | # -*- coding: utf-8 -*-
##############################################################################
#
# Ingenieria ADHOC - ADHOC SA
# https://launchpad.net/~ingenieria-adhoc
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lice... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# Ingenieria ADHOC - ADHOC SA
# https://launchpad.net/~ingenieria-adhoc
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... |
12a6c979c7648b9fa43165286afebac9e8df7101 | src/app.py | src/app.py | '''
The main app
'''
from flask import Flask
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
return 'A work in progress, check back later'
if __name__ == '__main__':
app.run()
| '''
The main app
'''
from flask import Flask
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
return 'A work in progress, check back later'
@app.route('/add', methods=['POST'])
def add_reminder():
return 'Use this method to POST new reminders to the database'
@app.route('/show',... | Add method stubs for sending and receiving tasks to/ from the database | Add method stubs for sending and receiving tasks to/ from the database
| Python | bsd-2-clause | ambidextrousTx/RPostIt | '''
The main app
'''
from flask import Flask
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
return 'A work in progress, check back later'
if __name__ == '__main__':
app.run()
Add method stubs for sending and receiving tasks to/ from the database | '''
The main app
'''
from flask import Flask
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
return 'A work in progress, check back later'
@app.route('/add', methods=['POST'])
def add_reminder():
return 'Use this method to POST new reminders to the database'
@app.route('/show',... | <commit_before>'''
The main app
'''
from flask import Flask
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
return 'A work in progress, check back later'
if __name__ == '__main__':
app.run()
<commit_msg>Add method stubs for sending and receiving tasks to/ from the database<commi... | '''
The main app
'''
from flask import Flask
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
return 'A work in progress, check back later'
@app.route('/add', methods=['POST'])
def add_reminder():
return 'Use this method to POST new reminders to the database'
@app.route('/show',... | '''
The main app
'''
from flask import Flask
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
return 'A work in progress, check back later'
if __name__ == '__main__':
app.run()
Add method stubs for sending and receiving tasks to/ from the database'''
The main app
'''
from flask... | <commit_before>'''
The main app
'''
from flask import Flask
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
return 'A work in progress, check back later'
if __name__ == '__main__':
app.run()
<commit_msg>Add method stubs for sending and receiving tasks to/ from the database<commi... |
b7ea23ce3cfdcc41450a2512d62da17e67a316fd | test/test_driver.py | test/test_driver.py | #!/usr/bin/env python
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import os
import sys
driver = webdriver.Firefox()
driver.get("file://%s" % (os.path.join(os.getcwd(... | #!/usr/bin/env python
"""
Selenium test runner.
"""
import os
import sys
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
def main():
"""
Main program.
"""
driver = webdriver.Firefox()
driver.get(
"file://%s" % (os.path.join(os.getcwd(), "test/test_... | Tidy up python test script | Tidy up python test script
| Python | mit | johnelse/ocaml-webaudio,johnelse/ocaml-webaudio,johnelse/ocaml-webaudio | #!/usr/bin/env python
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import os
import sys
driver = webdriver.Firefox()
driver.get("file://%s" % (os.path.join(os.getcwd(... | #!/usr/bin/env python
"""
Selenium test runner.
"""
import os
import sys
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
def main():
"""
Main program.
"""
driver = webdriver.Firefox()
driver.get(
"file://%s" % (os.path.join(os.getcwd(), "test/test_... | <commit_before>#!/usr/bin/env python
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import os
import sys
driver = webdriver.Firefox()
driver.get("file://%s" % (os.path.... | #!/usr/bin/env python
"""
Selenium test runner.
"""
import os
import sys
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
def main():
"""
Main program.
"""
driver = webdriver.Firefox()
driver.get(
"file://%s" % (os.path.join(os.getcwd(), "test/test_... | #!/usr/bin/env python
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import os
import sys
driver = webdriver.Firefox()
driver.get("file://%s" % (os.path.join(os.getcwd(... | <commit_before>#!/usr/bin/env python
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import os
import sys
driver = webdriver.Firefox()
driver.get("file://%s" % (os.path.... |
2e186c85fffd85904a25de7ec1086f66d8c413e9 | test_interpreter.py | test_interpreter.py | import unittest
import brainfuck
hello_case = ("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.", "Hello World!\n")
class InterpreterTestCase(unittest.TestCase):
def setUp(self):
self.interpreter = brainfuck.BrainfuckInterpreter()
def test_hel... | import unittest
import brainfuck
hello_case = ("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.", "Hello World!\n")
class InterpreterTestCase(unittest.TestCase):
def setUp(self):
self.interpreter = brainfuck.BrainfuckInterpreter()
def test_he... | Put spaces between class methods | Put spaces between class methods
| Python | bsd-3-clause | handrake/brainfuck | import unittest
import brainfuck
hello_case = ("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.", "Hello World!\n")
class InterpreterTestCase(unittest.TestCase):
def setUp(self):
self.interpreter = brainfuck.BrainfuckInterpreter()
def test_hel... | import unittest
import brainfuck
hello_case = ("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.", "Hello World!\n")
class InterpreterTestCase(unittest.TestCase):
def setUp(self):
self.interpreter = brainfuck.BrainfuckInterpreter()
def test_he... | <commit_before>import unittest
import brainfuck
hello_case = ("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.", "Hello World!\n")
class InterpreterTestCase(unittest.TestCase):
def setUp(self):
self.interpreter = brainfuck.BrainfuckInterpreter()
... | import unittest
import brainfuck
hello_case = ("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.", "Hello World!\n")
class InterpreterTestCase(unittest.TestCase):
def setUp(self):
self.interpreter = brainfuck.BrainfuckInterpreter()
def test_he... | import unittest
import brainfuck
hello_case = ("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.", "Hello World!\n")
class InterpreterTestCase(unittest.TestCase):
def setUp(self):
self.interpreter = brainfuck.BrainfuckInterpreter()
def test_hel... | <commit_before>import unittest
import brainfuck
hello_case = ("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.", "Hello World!\n")
class InterpreterTestCase(unittest.TestCase):
def setUp(self):
self.interpreter = brainfuck.BrainfuckInterpreter()
... |
1a63ff0ec55f0e32c13b0dc8a0f0c2c71d07395f | app.py | app.py | import sys
from module import test
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return test.test_print()
if __name__ == '__main__':
app.run(port=8000, debug=True)
| import sys
from module import init
from flask import Flask
from flask import render_template
from flask import url_for
app = Flask(__name__)
@app.route('/')
@app.route('/index')
def index():
return render_template('index.html')
@app.route('/signup')
def sign_up():
return 'WIP'
@app.route('/signin')
def sig... | Add HTTP error exception and init some code. | [UPDATE]: Add HTTP error exception and init some code.
| Python | mit | channprj/uptime-robot,channprj/uptime-robot,channprj/uptime-robot | import sys
from module import test
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return test.test_print()
if __name__ == '__main__':
app.run(port=8000, debug=True)
[UPDATE]: Add HTTP error exception and init some code. | import sys
from module import init
from flask import Flask
from flask import render_template
from flask import url_for
app = Flask(__name__)
@app.route('/')
@app.route('/index')
def index():
return render_template('index.html')
@app.route('/signup')
def sign_up():
return 'WIP'
@app.route('/signin')
def sig... | <commit_before>import sys
from module import test
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return test.test_print()
if __name__ == '__main__':
app.run(port=8000, debug=True)
<commit_msg>[UPDATE]: Add HTTP error exception and init some code.<commit_after> | import sys
from module import init
from flask import Flask
from flask import render_template
from flask import url_for
app = Flask(__name__)
@app.route('/')
@app.route('/index')
def index():
return render_template('index.html')
@app.route('/signup')
def sign_up():
return 'WIP'
@app.route('/signin')
def sig... | import sys
from module import test
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return test.test_print()
if __name__ == '__main__':
app.run(port=8000, debug=True)
[UPDATE]: Add HTTP error exception and init some code.import sys
from module import init
from flask import Flask
fr... | <commit_before>import sys
from module import test
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return test.test_print()
if __name__ == '__main__':
app.run(port=8000, debug=True)
<commit_msg>[UPDATE]: Add HTTP error exception and init some code.<commit_after>import sys
from modul... |
62cbc5025913b8d6dd2b5323ad027d6b5ff56efb | resources/migrations/0007_auto_20180306_1150.py | resources/migrations/0007_auto_20180306_1150.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtaildocs', '0007_merge'),
('core', '0026_auto_20180306_1150'),
('resources', '0006_add_fi... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtaildocs', '0007_merge'),
('resources', '0006_add_field_for_absolute_slideshare_url'),
]
... | Update migration file to lose dependency from discarded migration file | Update migration file to lose dependency from discarded migration file
| Python | bsd-3-clause | PARINetwork/pari,PARINetwork/pari,PARINetwork/pari,PARINetwork/pari | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtaildocs', '0007_merge'),
('core', '0026_auto_20180306_1150'),
('resources', '0006_add_fi... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtaildocs', '0007_merge'),
('resources', '0006_add_field_for_absolute_slideshare_url'),
]
... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtaildocs', '0007_merge'),
('core', '0026_auto_20180306_1150'),
('resources... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtaildocs', '0007_merge'),
('resources', '0006_add_field_for_absolute_slideshare_url'),
]
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtaildocs', '0007_merge'),
('core', '0026_auto_20180306_1150'),
('resources', '0006_add_fi... | <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtaildocs', '0007_merge'),
('core', '0026_auto_20180306_1150'),
('resources... |
cddc9b20855147541859976229e1dc34a611de26 | twitterfunctions.py | twitterfunctions.py | #!/usr/bin/env python
# twitterfunctions.py
# description: This file contains all the functions that are used when connecting to Twitter. Almost all of them rely on Tweepy
# copyrigtht: 2015 William Patton - PattonWebz
# licence: GPLv3
import tweepy
def authenticatetwitter(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, A... | #!/usr/bin/env python
# twitterfunctions.py
# description: This file contains all the functions that are used when connecting to Twitter. Almost all of them rely on Tweepy
# copyrigtht: 2015 William Patton - PattonWebz
# licence: GPLv3
import tweepy
def authenticatetwitter(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, A... | Change the api.update_status() call to explicitly state the 'status' message. | Change the api.update_status() call to explicitly state the 'status' message.
- A recent version of Tweepy required it to be explicit, no harm in always being so
| Python | agpl-3.0 | pattonwebz/ScheduledTweetBot | #!/usr/bin/env python
# twitterfunctions.py
# description: This file contains all the functions that are used when connecting to Twitter. Almost all of them rely on Tweepy
# copyrigtht: 2015 William Patton - PattonWebz
# licence: GPLv3
import tweepy
def authenticatetwitter(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, A... | #!/usr/bin/env python
# twitterfunctions.py
# description: This file contains all the functions that are used when connecting to Twitter. Almost all of them rely on Tweepy
# copyrigtht: 2015 William Patton - PattonWebz
# licence: GPLv3
import tweepy
def authenticatetwitter(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, A... | <commit_before>#!/usr/bin/env python
# twitterfunctions.py
# description: This file contains all the functions that are used when connecting to Twitter. Almost all of them rely on Tweepy
# copyrigtht: 2015 William Patton - PattonWebz
# licence: GPLv3
import tweepy
def authenticatetwitter(CONSUMER_KEY, CONSUMER_SECRET... | #!/usr/bin/env python
# twitterfunctions.py
# description: This file contains all the functions that are used when connecting to Twitter. Almost all of them rely on Tweepy
# copyrigtht: 2015 William Patton - PattonWebz
# licence: GPLv3
import tweepy
def authenticatetwitter(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, A... | #!/usr/bin/env python
# twitterfunctions.py
# description: This file contains all the functions that are used when connecting to Twitter. Almost all of them rely on Tweepy
# copyrigtht: 2015 William Patton - PattonWebz
# licence: GPLv3
import tweepy
def authenticatetwitter(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, A... | <commit_before>#!/usr/bin/env python
# twitterfunctions.py
# description: This file contains all the functions that are used when connecting to Twitter. Almost all of them rely on Tweepy
# copyrigtht: 2015 William Patton - PattonWebz
# licence: GPLv3
import tweepy
def authenticatetwitter(CONSUMER_KEY, CONSUMER_SECRET... |
00c28d76d93331d7a501f0006cbadcaef48e499f | d1lod/tests/conftest.py | d1lod/tests/conftest.py | import pytest
from d1lod import sesame
@pytest.fixture(scope="module")
def store():
return sesame.Store('localhost', 8080)
@pytest.fixture(scope="module")
def repo(store):
return sesame.Repository(store, 'test')
@pytest.fixture(scope="module")
def interface(repo):
return sesame.Interface(repo)
| import pytest
from d1lod import sesame
@pytest.fixture(scope="module")
def store():
return sesame.Store('localhost', 8080)
@pytest.fixture(scope="module")
def repo(store):
namespaces = {
'owl': 'http://www.w3.org/2002/07/owl#',
'rdfs': 'http://www.w3.org/2000/01/rdf-schema#',
'rdf': '... | Add default set of namespaces to test repository instance | Add default set of namespaces to test repository instance
| Python | apache-2.0 | ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod | import pytest
from d1lod import sesame
@pytest.fixture(scope="module")
def store():
return sesame.Store('localhost', 8080)
@pytest.fixture(scope="module")
def repo(store):
return sesame.Repository(store, 'test')
@pytest.fixture(scope="module")
def interface(repo):
return sesame.Interface(repo)
Add defau... | import pytest
from d1lod import sesame
@pytest.fixture(scope="module")
def store():
return sesame.Store('localhost', 8080)
@pytest.fixture(scope="module")
def repo(store):
namespaces = {
'owl': 'http://www.w3.org/2002/07/owl#',
'rdfs': 'http://www.w3.org/2000/01/rdf-schema#',
'rdf': '... | <commit_before>import pytest
from d1lod import sesame
@pytest.fixture(scope="module")
def store():
return sesame.Store('localhost', 8080)
@pytest.fixture(scope="module")
def repo(store):
return sesame.Repository(store, 'test')
@pytest.fixture(scope="module")
def interface(repo):
return sesame.Interface(... | import pytest
from d1lod import sesame
@pytest.fixture(scope="module")
def store():
return sesame.Store('localhost', 8080)
@pytest.fixture(scope="module")
def repo(store):
namespaces = {
'owl': 'http://www.w3.org/2002/07/owl#',
'rdfs': 'http://www.w3.org/2000/01/rdf-schema#',
'rdf': '... | import pytest
from d1lod import sesame
@pytest.fixture(scope="module")
def store():
return sesame.Store('localhost', 8080)
@pytest.fixture(scope="module")
def repo(store):
return sesame.Repository(store, 'test')
@pytest.fixture(scope="module")
def interface(repo):
return sesame.Interface(repo)
Add defau... | <commit_before>import pytest
from d1lod import sesame
@pytest.fixture(scope="module")
def store():
return sesame.Store('localhost', 8080)
@pytest.fixture(scope="module")
def repo(store):
return sesame.Repository(store, 'test')
@pytest.fixture(scope="module")
def interface(repo):
return sesame.Interface(... |
5a92874673f8dc5b08dd7826a10121a83fb2f0c6 | rotational-cipher/rotational_cipher.py | rotational-cipher/rotational_cipher.py | import string
UPPER = string.ascii_uppercase
LOWER = string.ascii_lowercase
def rotate(s, n):
rules = shift_rules(n)
return "".join(map(lambda k: rules.get(k, k), s))
def shift_rules(n):
shifted = UPPER[n:] + UPPER[:n] + LOWER[n:] + LOWER[:n]
return {k:v for k,v in zip(UPPER+LOWER, shifted)}
| import string
UPPER = string.ascii_uppercase
LOWER = string.ascii_lowercase
def rotate(s, n):
rules = shift_rules(n)
return "".join(rules.get(ch, ch) for ch in s)
def shift_rules(n):
shifted = UPPER[n:] + UPPER[:n] + LOWER[n:] + LOWER[:n]
return {k:v for k,v in zip(UPPER+LOWER, shifted)}
| Use a comprehension instead of a lambda function | Use a comprehension instead of a lambda function
| Python | agpl-3.0 | CubicComet/exercism-python-solutions | import string
UPPER = string.ascii_uppercase
LOWER = string.ascii_lowercase
def rotate(s, n):
rules = shift_rules(n)
return "".join(map(lambda k: rules.get(k, k), s))
def shift_rules(n):
shifted = UPPER[n:] + UPPER[:n] + LOWER[n:] + LOWER[:n]
return {k:v for k,v in zip(UPPER+LOWER, shifted)}
Use a... | import string
UPPER = string.ascii_uppercase
LOWER = string.ascii_lowercase
def rotate(s, n):
rules = shift_rules(n)
return "".join(rules.get(ch, ch) for ch in s)
def shift_rules(n):
shifted = UPPER[n:] + UPPER[:n] + LOWER[n:] + LOWER[:n]
return {k:v for k,v in zip(UPPER+LOWER, shifted)}
| <commit_before>import string
UPPER = string.ascii_uppercase
LOWER = string.ascii_lowercase
def rotate(s, n):
rules = shift_rules(n)
return "".join(map(lambda k: rules.get(k, k), s))
def shift_rules(n):
shifted = UPPER[n:] + UPPER[:n] + LOWER[n:] + LOWER[:n]
return {k:v for k,v in zip(UPPER+LOWER, ... | import string
UPPER = string.ascii_uppercase
LOWER = string.ascii_lowercase
def rotate(s, n):
rules = shift_rules(n)
return "".join(rules.get(ch, ch) for ch in s)
def shift_rules(n):
shifted = UPPER[n:] + UPPER[:n] + LOWER[n:] + LOWER[:n]
return {k:v for k,v in zip(UPPER+LOWER, shifted)}
| import string
UPPER = string.ascii_uppercase
LOWER = string.ascii_lowercase
def rotate(s, n):
rules = shift_rules(n)
return "".join(map(lambda k: rules.get(k, k), s))
def shift_rules(n):
shifted = UPPER[n:] + UPPER[:n] + LOWER[n:] + LOWER[:n]
return {k:v for k,v in zip(UPPER+LOWER, shifted)}
Use a... | <commit_before>import string
UPPER = string.ascii_uppercase
LOWER = string.ascii_lowercase
def rotate(s, n):
rules = shift_rules(n)
return "".join(map(lambda k: rules.get(k, k), s))
def shift_rules(n):
shifted = UPPER[n:] + UPPER[:n] + LOWER[n:] + LOWER[:n]
return {k:v for k,v in zip(UPPER+LOWER, ... |
f3e0cc4b5a778b04373773dabd27be8782b1af93 | cosmo_tester/test_suites/snapshots/conftest.py | cosmo_tester/test_suites/snapshots/conftest.py | import pytest
from cosmo_tester.framework.test_hosts import Hosts
from cosmo_tester.test_suites.snapshots import get_multi_tenant_versions_list
@pytest.fixture(scope='function', params=get_multi_tenant_versions_list())
def hosts(request, ssh_key, module_tmpdir, test_config, logger):
hosts = Hosts(
ssh_ke... | import pytest
from cosmo_tester.framework.test_hosts import Hosts, get_image
from cosmo_tester.test_suites.snapshots import get_multi_tenant_versions_list
@pytest.fixture(scope='function', params=get_multi_tenant_versions_list())
def hosts(request, ssh_key, module_tmpdir, test_config, logger):
hosts = Hosts(
... | Use specified images for snapshot fixture | Use specified images for snapshot fixture
| Python | apache-2.0 | cloudify-cosmo/cloudify-system-tests,cloudify-cosmo/cloudify-system-tests | import pytest
from cosmo_tester.framework.test_hosts import Hosts
from cosmo_tester.test_suites.snapshots import get_multi_tenant_versions_list
@pytest.fixture(scope='function', params=get_multi_tenant_versions_list())
def hosts(request, ssh_key, module_tmpdir, test_config, logger):
hosts = Hosts(
ssh_ke... | import pytest
from cosmo_tester.framework.test_hosts import Hosts, get_image
from cosmo_tester.test_suites.snapshots import get_multi_tenant_versions_list
@pytest.fixture(scope='function', params=get_multi_tenant_versions_list())
def hosts(request, ssh_key, module_tmpdir, test_config, logger):
hosts = Hosts(
... | <commit_before>import pytest
from cosmo_tester.framework.test_hosts import Hosts
from cosmo_tester.test_suites.snapshots import get_multi_tenant_versions_list
@pytest.fixture(scope='function', params=get_multi_tenant_versions_list())
def hosts(request, ssh_key, module_tmpdir, test_config, logger):
hosts = Hosts(... | import pytest
from cosmo_tester.framework.test_hosts import Hosts, get_image
from cosmo_tester.test_suites.snapshots import get_multi_tenant_versions_list
@pytest.fixture(scope='function', params=get_multi_tenant_versions_list())
def hosts(request, ssh_key, module_tmpdir, test_config, logger):
hosts = Hosts(
... | import pytest
from cosmo_tester.framework.test_hosts import Hosts
from cosmo_tester.test_suites.snapshots import get_multi_tenant_versions_list
@pytest.fixture(scope='function', params=get_multi_tenant_versions_list())
def hosts(request, ssh_key, module_tmpdir, test_config, logger):
hosts = Hosts(
ssh_ke... | <commit_before>import pytest
from cosmo_tester.framework.test_hosts import Hosts
from cosmo_tester.test_suites.snapshots import get_multi_tenant_versions_list
@pytest.fixture(scope='function', params=get_multi_tenant_versions_list())
def hosts(request, ssh_key, module_tmpdir, test_config, logger):
hosts = Hosts(... |
b3c10f9cc4c53116c35e76dec184f4b44d28aaf4 | views/main.py | views/main.py | from flask import redirect
from flask import render_template
from flask import request
import database.link
from database import db_txn
from linkr import app
from uri.link import *
from uri.main import *
@app.route(LinkAliasRedirectURI.path, methods=LinkAliasRedirectURI.methods)
@db_txn
def alias_route(alias):
#... | from flask import redirect
from flask import render_template
from flask import request
import database.link
from linkr import app
from uri.link import *
from uri.main import *
@app.route(LinkAliasRedirectURI.path, methods=LinkAliasRedirectURI.methods)
def alias_route(alias):
# Attempt to fetch the link mapping f... | Remove unnecessary @db_txn decorator on alias_route | Remove unnecessary @db_txn decorator on alias_route
| Python | mit | LINKIWI/linkr,LINKIWI/linkr,LINKIWI/linkr | from flask import redirect
from flask import render_template
from flask import request
import database.link
from database import db_txn
from linkr import app
from uri.link import *
from uri.main import *
@app.route(LinkAliasRedirectURI.path, methods=LinkAliasRedirectURI.methods)
@db_txn
def alias_route(alias):
#... | from flask import redirect
from flask import render_template
from flask import request
import database.link
from linkr import app
from uri.link import *
from uri.main import *
@app.route(LinkAliasRedirectURI.path, methods=LinkAliasRedirectURI.methods)
def alias_route(alias):
# Attempt to fetch the link mapping f... | <commit_before>from flask import redirect
from flask import render_template
from flask import request
import database.link
from database import db_txn
from linkr import app
from uri.link import *
from uri.main import *
@app.route(LinkAliasRedirectURI.path, methods=LinkAliasRedirectURI.methods)
@db_txn
def alias_rout... | from flask import redirect
from flask import render_template
from flask import request
import database.link
from linkr import app
from uri.link import *
from uri.main import *
@app.route(LinkAliasRedirectURI.path, methods=LinkAliasRedirectURI.methods)
def alias_route(alias):
# Attempt to fetch the link mapping f... | from flask import redirect
from flask import render_template
from flask import request
import database.link
from database import db_txn
from linkr import app
from uri.link import *
from uri.main import *
@app.route(LinkAliasRedirectURI.path, methods=LinkAliasRedirectURI.methods)
@db_txn
def alias_route(alias):
#... | <commit_before>from flask import redirect
from flask import render_template
from flask import request
import database.link
from database import db_txn
from linkr import app
from uri.link import *
from uri.main import *
@app.route(LinkAliasRedirectURI.path, methods=LinkAliasRedirectURI.methods)
@db_txn
def alias_rout... |
bc0022c32ef912eba9cc3d9683c1649443d6aa35 | pyfibot/modules/module_btc.py | pyfibot/modules/module_btc.py | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
def command_btc(bot, user, channel, args):
"""Display current BTC exchange rates from mtgox. Usage: btc [whitespace separated list of currency codes]"""
currencies = ["EUR"]
if args:
currencies = args.spli... | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
def command_btc(bot, user, channel, args):
"""Display current BTC exchange rates from mtgox. Usage: btc [whitespace separated list of currency codes]"""
currencies = ["EUR"]
if args:
currencies = args.spli... | Add support for LTC in mtgox | Add support for LTC in mtgox
| Python | bsd-3-clause | rnyberg/pyfibot,EArmour/pyfibot,EArmour/pyfibot,aapa/pyfibot,lepinkainen/pyfibot,huqa/pyfibot,rnyberg/pyfibot,huqa/pyfibot,aapa/pyfibot,lepinkainen/pyfibot | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
def command_btc(bot, user, channel, args):
"""Display current BTC exchange rates from mtgox. Usage: btc [whitespace separated list of currency codes]"""
currencies = ["EUR"]
if args:
currencies = args.spli... | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
def command_btc(bot, user, channel, args):
"""Display current BTC exchange rates from mtgox. Usage: btc [whitespace separated list of currency codes]"""
currencies = ["EUR"]
if args:
currencies = args.spli... | <commit_before># -*- encoding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
def command_btc(bot, user, channel, args):
"""Display current BTC exchange rates from mtgox. Usage: btc [whitespace separated list of currency codes]"""
currencies = ["EUR"]
if args:
currenc... | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
def command_btc(bot, user, channel, args):
"""Display current BTC exchange rates from mtgox. Usage: btc [whitespace separated list of currency codes]"""
currencies = ["EUR"]
if args:
currencies = args.spli... | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
def command_btc(bot, user, channel, args):
"""Display current BTC exchange rates from mtgox. Usage: btc [whitespace separated list of currency codes]"""
currencies = ["EUR"]
if args:
currencies = args.spli... | <commit_before># -*- encoding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
def command_btc(bot, user, channel, args):
"""Display current BTC exchange rates from mtgox. Usage: btc [whitespace separated list of currency codes]"""
currencies = ["EUR"]
if args:
currenc... |
aa97385399e358110e5fbacaaa41c9b7fb8c75be | src/nodeconductor_assembly_waldur/experts/filters.py | src/nodeconductor_assembly_waldur/experts/filters.py | import django_filters
from nodeconductor.core import filters as core_filters
from . import models
class ExpertProviderFilter(django_filters.FilterSet):
customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid')
customer_uuid = django_filters.UUIDFilter(name='customer__uuid')
... | import django_filters
from nodeconductor.core import filters as core_filters
from . import models
class ExpertProviderFilter(django_filters.FilterSet):
customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid')
customer_uuid = django_filters.UUIDFilter(name='customer__uuid')
... | Add name filter to expert requests | Add name filter to expert requests [WAL-989]
| Python | mit | opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind | import django_filters
from nodeconductor.core import filters as core_filters
from . import models
class ExpertProviderFilter(django_filters.FilterSet):
customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid')
customer_uuid = django_filters.UUIDFilter(name='customer__uuid')
... | import django_filters
from nodeconductor.core import filters as core_filters
from . import models
class ExpertProviderFilter(django_filters.FilterSet):
customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid')
customer_uuid = django_filters.UUIDFilter(name='customer__uuid')
... | <commit_before>import django_filters
from nodeconductor.core import filters as core_filters
from . import models
class ExpertProviderFilter(django_filters.FilterSet):
customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid')
customer_uuid = django_filters.UUIDFilter(name='custome... | import django_filters
from nodeconductor.core import filters as core_filters
from . import models
class ExpertProviderFilter(django_filters.FilterSet):
customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid')
customer_uuid = django_filters.UUIDFilter(name='customer__uuid')
... | import django_filters
from nodeconductor.core import filters as core_filters
from . import models
class ExpertProviderFilter(django_filters.FilterSet):
customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid')
customer_uuid = django_filters.UUIDFilter(name='customer__uuid')
... | <commit_before>import django_filters
from nodeconductor.core import filters as core_filters
from . import models
class ExpertProviderFilter(django_filters.FilterSet):
customer = core_filters.URLFilter(view_name='customer-detail', name='customer__uuid')
customer_uuid = django_filters.UUIDFilter(name='custome... |
744c995ffe1faf55fda68405243551dbb078ae60 | uchicagohvz/production_settings.py | uchicagohvz/production_settings.py | from local_settings import *
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', # Or path to database file if using sqlite3.
'USER': ... | from local_settings import *
ALLOWED_HOSTS = ['uchicagohvz.org']
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', # Or path to database fi... | Add ALLOWED_HOSTS to production settings | Add ALLOWED_HOSTS to production settings
| Python | mit | kz26/uchicago-hvz,kz26/uchicago-hvz,kz26/uchicago-hvz | from local_settings import *
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', # Or path to database file if using sqlite3.
'USER': ... | from local_settings import *
ALLOWED_HOSTS = ['uchicagohvz.org']
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', # Or path to database fi... | <commit_before>from local_settings import *
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', # Or path to database file if using sqlite3.
... | from local_settings import *
ALLOWED_HOSTS = ['uchicagohvz.org']
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', # Or path to database fi... | from local_settings import *
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', # Or path to database file if using sqlite3.
'USER': ... | <commit_before>from local_settings import *
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'uchicagohvz', # Or path to database file if using sqlite3.
... |
61b7524d2ebc84765f9ecafba1fa7aaccba82f6f | bot/handlers/reaction.py | bot/handlers/reaction.py | from handlers.base import MessageHandler
import settings
class ReactionHandler(MessageHandler):
TRIGGER_ANCHOR = ''
TRIGGER_PREFIX = ''
TRIGGERS = sorted(settings.EMOJI_REACTIONS.iterkeys())
HELP = 'add emoji reactions'
def handle_message(self, event, triggers, query):
for trigger in triggers:
tr... | from handlers.base import MessageHandler
import settings
class ReactionHandler(MessageHandler):
TRIGGER_ANCHOR = ''
TRIGGER_PREFIX = ''
TRIGGERS = sorted(settings.EMOJI_REACTIONS.keys())
HELP = 'add emoji reactions'
def handle_message(self, event, triggers, query):
for trigger in triggers:
trigge... | Use keys instead of iterkeys | Use keys instead of iterkeys
| Python | mit | nkouevda/slack-rtm-bot | from handlers.base import MessageHandler
import settings
class ReactionHandler(MessageHandler):
TRIGGER_ANCHOR = ''
TRIGGER_PREFIX = ''
TRIGGERS = sorted(settings.EMOJI_REACTIONS.iterkeys())
HELP = 'add emoji reactions'
def handle_message(self, event, triggers, query):
for trigger in triggers:
tr... | from handlers.base import MessageHandler
import settings
class ReactionHandler(MessageHandler):
TRIGGER_ANCHOR = ''
TRIGGER_PREFIX = ''
TRIGGERS = sorted(settings.EMOJI_REACTIONS.keys())
HELP = 'add emoji reactions'
def handle_message(self, event, triggers, query):
for trigger in triggers:
trigge... | <commit_before>from handlers.base import MessageHandler
import settings
class ReactionHandler(MessageHandler):
TRIGGER_ANCHOR = ''
TRIGGER_PREFIX = ''
TRIGGERS = sorted(settings.EMOJI_REACTIONS.iterkeys())
HELP = 'add emoji reactions'
def handle_message(self, event, triggers, query):
for trigger in tri... | from handlers.base import MessageHandler
import settings
class ReactionHandler(MessageHandler):
TRIGGER_ANCHOR = ''
TRIGGER_PREFIX = ''
TRIGGERS = sorted(settings.EMOJI_REACTIONS.keys())
HELP = 'add emoji reactions'
def handle_message(self, event, triggers, query):
for trigger in triggers:
trigge... | from handlers.base import MessageHandler
import settings
class ReactionHandler(MessageHandler):
TRIGGER_ANCHOR = ''
TRIGGER_PREFIX = ''
TRIGGERS = sorted(settings.EMOJI_REACTIONS.iterkeys())
HELP = 'add emoji reactions'
def handle_message(self, event, triggers, query):
for trigger in triggers:
tr... | <commit_before>from handlers.base import MessageHandler
import settings
class ReactionHandler(MessageHandler):
TRIGGER_ANCHOR = ''
TRIGGER_PREFIX = ''
TRIGGERS = sorted(settings.EMOJI_REACTIONS.iterkeys())
HELP = 'add emoji reactions'
def handle_message(self, event, triggers, query):
for trigger in tri... |
00c3f1e3eb38a22d95c6e59f72e51a9b53723a31 | brains/namelist/tasks.py | brains/namelist/tasks.py | from celery.task import task
from namelist.scrape import get_user_profile_id, scrape_profile, NotFound
from namelist.models import Player, Category
@task()
def import_user(user, profile_name_or_id, category=None):
if isinstance(profile_name_or_id, basestring):
try:
profile_id = get_user_profile... | from celery.task import task
from namelist.scrape import get_user_profile_id, scrape_profile, NotFound
from namelist.models import Player, Category
@task()
def import_user(profile_name_or_id, category=None, user=None):
if isinstance(profile_name_or_id, basestring):
try:
profile_id = get_user_pr... | Fix duplicate profile key errors with a less specific query. | Fix duplicate profile key errors with a less specific query.
| Python | bsd-3-clause | crisisking/udbraaains,crisisking/udbraaains,crisisking/udbraaains,crisisking/udbraaains | from celery.task import task
from namelist.scrape import get_user_profile_id, scrape_profile, NotFound
from namelist.models import Player, Category
@task()
def import_user(user, profile_name_or_id, category=None):
if isinstance(profile_name_or_id, basestring):
try:
profile_id = get_user_profile... | from celery.task import task
from namelist.scrape import get_user_profile_id, scrape_profile, NotFound
from namelist.models import Player, Category
@task()
def import_user(profile_name_or_id, category=None, user=None):
if isinstance(profile_name_or_id, basestring):
try:
profile_id = get_user_pr... | <commit_before>from celery.task import task
from namelist.scrape import get_user_profile_id, scrape_profile, NotFound
from namelist.models import Player, Category
@task()
def import_user(user, profile_name_or_id, category=None):
if isinstance(profile_name_or_id, basestring):
try:
profile_id = g... | from celery.task import task
from namelist.scrape import get_user_profile_id, scrape_profile, NotFound
from namelist.models import Player, Category
@task()
def import_user(profile_name_or_id, category=None, user=None):
if isinstance(profile_name_or_id, basestring):
try:
profile_id = get_user_pr... | from celery.task import task
from namelist.scrape import get_user_profile_id, scrape_profile, NotFound
from namelist.models import Player, Category
@task()
def import_user(user, profile_name_or_id, category=None):
if isinstance(profile_name_or_id, basestring):
try:
profile_id = get_user_profile... | <commit_before>from celery.task import task
from namelist.scrape import get_user_profile_id, scrape_profile, NotFound
from namelist.models import Player, Category
@task()
def import_user(user, profile_name_or_id, category=None):
if isinstance(profile_name_or_id, basestring):
try:
profile_id = g... |
d1641d90d474caa34b53fc74fbb095a20e1e4ce0 | test_pq/settings.py | test_pq/settings.py | try:
from psycopg2cffi import compat
compat.register()
except ImportError:
pass
DEBUG=False
TEMPLATE=DEBUG
USE_TZ = True
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'django-pq',
'USER': 'dj... | import os
try:
from psycopg2cffi import compat
compat.register()
except ImportError:
pass
DEBUG=False
TEMPLATE=DEBUG
USE_TZ = True
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'django-pq',
'... | Make test logging level set by getenv. | Make test logging level set by getenv.
| Python | bsd-2-clause | bretth/django-pq | try:
from psycopg2cffi import compat
compat.register()
except ImportError:
pass
DEBUG=False
TEMPLATE=DEBUG
USE_TZ = True
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'django-pq',
'USER': 'dj... | import os
try:
from psycopg2cffi import compat
compat.register()
except ImportError:
pass
DEBUG=False
TEMPLATE=DEBUG
USE_TZ = True
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'django-pq',
'... | <commit_before>try:
from psycopg2cffi import compat
compat.register()
except ImportError:
pass
DEBUG=False
TEMPLATE=DEBUG
USE_TZ = True
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'django-pq',
... | import os
try:
from psycopg2cffi import compat
compat.register()
except ImportError:
pass
DEBUG=False
TEMPLATE=DEBUG
USE_TZ = True
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'django-pq',
'... | try:
from psycopg2cffi import compat
compat.register()
except ImportError:
pass
DEBUG=False
TEMPLATE=DEBUG
USE_TZ = True
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'django-pq',
'USER': 'dj... | <commit_before>try:
from psycopg2cffi import compat
compat.register()
except ImportError:
pass
DEBUG=False
TEMPLATE=DEBUG
USE_TZ = True
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'django-pq',
... |
480f1794d37c524893645e296e22a37490a2795e | frappe/patches/v12_0/update_print_format_type.py | frappe/patches/v12_0/update_print_format_type.py | import frappe
def execute():
frappe.db.sql('''
UPDATE `tabPrint Format`
SET `print_format_type` = "Jinja"
WHERE `print_format_type` in ("Server", "Client")
''')
frappe.db.sql('''
UPDATE `tabPrint Format`
SET `print_format_type` = "JS"
WHERE `print_format_type` = "Js"
''')
| import frappe
def execute():
frappe.db.sql('''
UPDATE `tabPrint Format`
SET `print_format_type` = 'Jinja'
WHERE `print_format_type` in ('Server', 'Client')
''')
frappe.db.sql('''
UPDATE `tabPrint Format`
SET `print_format_type` = 'JS'
WHERE `print_format_type` = 'Js'
''')
| Make db query postgres compatible | Make db query postgres compatible
| Python | mit | mhbu50/frappe,saurabh6790/frappe,adityahase/frappe,vjFaLk/frappe,StrellaGroup/frappe,adityahase/frappe,saurabh6790/frappe,almeidapaulopt/frappe,yashodhank/frappe,StrellaGroup/frappe,StrellaGroup/frappe,frappe/frappe,yashodhank/frappe,yashodhank/frappe,adityahase/frappe,yashodhank/frappe,almeidapaulopt/frappe,vjFaLk/fra... | import frappe
def execute():
frappe.db.sql('''
UPDATE `tabPrint Format`
SET `print_format_type` = "Jinja"
WHERE `print_format_type` in ("Server", "Client")
''')
frappe.db.sql('''
UPDATE `tabPrint Format`
SET `print_format_type` = "JS"
WHERE `print_format_type` = "Js"
''')
Make db query postgres compati... | import frappe
def execute():
frappe.db.sql('''
UPDATE `tabPrint Format`
SET `print_format_type` = 'Jinja'
WHERE `print_format_type` in ('Server', 'Client')
''')
frappe.db.sql('''
UPDATE `tabPrint Format`
SET `print_format_type` = 'JS'
WHERE `print_format_type` = 'Js'
''')
| <commit_before>import frappe
def execute():
frappe.db.sql('''
UPDATE `tabPrint Format`
SET `print_format_type` = "Jinja"
WHERE `print_format_type` in ("Server", "Client")
''')
frappe.db.sql('''
UPDATE `tabPrint Format`
SET `print_format_type` = "JS"
WHERE `print_format_type` = "Js"
''')
<commit_msg>Mak... | import frappe
def execute():
frappe.db.sql('''
UPDATE `tabPrint Format`
SET `print_format_type` = 'Jinja'
WHERE `print_format_type` in ('Server', 'Client')
''')
frappe.db.sql('''
UPDATE `tabPrint Format`
SET `print_format_type` = 'JS'
WHERE `print_format_type` = 'Js'
''')
| import frappe
def execute():
frappe.db.sql('''
UPDATE `tabPrint Format`
SET `print_format_type` = "Jinja"
WHERE `print_format_type` in ("Server", "Client")
''')
frappe.db.sql('''
UPDATE `tabPrint Format`
SET `print_format_type` = "JS"
WHERE `print_format_type` = "Js"
''')
Make db query postgres compati... | <commit_before>import frappe
def execute():
frappe.db.sql('''
UPDATE `tabPrint Format`
SET `print_format_type` = "Jinja"
WHERE `print_format_type` in ("Server", "Client")
''')
frappe.db.sql('''
UPDATE `tabPrint Format`
SET `print_format_type` = "JS"
WHERE `print_format_type` = "Js"
''')
<commit_msg>Mak... |
1de05b64363d6a99cceb3b047813893915c0842b | pyetherscan/settings.py | pyetherscan/settings.py | import os
TESTING_API_KEY = 'YourApiKeyToken'
ETHERSCAN_API_KEY = os.environ.get('ETHERSCAN_API_KEY', TESTING_API_KEY)
| import os
HOME_DIR = os.path.expanduser('~')
CONFIG_FILE = '.pyetherscan.ini'
PATH = os.path.join(HOME_DIR, CONFIG_FILE)
TESTING_API_KEY = 'YourApiKeyToken'
if os.path.isfile(PATH):
from configparser import ConfigParser
config = ConfigParser()
config.read(PATH)
ETHERSCAN_API_KEY = config['Credentials'... | Add support for a configuration file | Add support for a configuration file
| Python | mit | Marto32/pyetherscan | import os
TESTING_API_KEY = 'YourApiKeyToken'
ETHERSCAN_API_KEY = os.environ.get('ETHERSCAN_API_KEY', TESTING_API_KEY)
Add support for a configuration file | import os
HOME_DIR = os.path.expanduser('~')
CONFIG_FILE = '.pyetherscan.ini'
PATH = os.path.join(HOME_DIR, CONFIG_FILE)
TESTING_API_KEY = 'YourApiKeyToken'
if os.path.isfile(PATH):
from configparser import ConfigParser
config = ConfigParser()
config.read(PATH)
ETHERSCAN_API_KEY = config['Credentials'... | <commit_before>import os
TESTING_API_KEY = 'YourApiKeyToken'
ETHERSCAN_API_KEY = os.environ.get('ETHERSCAN_API_KEY', TESTING_API_KEY)
<commit_msg>Add support for a configuration file<commit_after> | import os
HOME_DIR = os.path.expanduser('~')
CONFIG_FILE = '.pyetherscan.ini'
PATH = os.path.join(HOME_DIR, CONFIG_FILE)
TESTING_API_KEY = 'YourApiKeyToken'
if os.path.isfile(PATH):
from configparser import ConfigParser
config = ConfigParser()
config.read(PATH)
ETHERSCAN_API_KEY = config['Credentials'... | import os
TESTING_API_KEY = 'YourApiKeyToken'
ETHERSCAN_API_KEY = os.environ.get('ETHERSCAN_API_KEY', TESTING_API_KEY)
Add support for a configuration fileimport os
HOME_DIR = os.path.expanduser('~')
CONFIG_FILE = '.pyetherscan.ini'
PATH = os.path.join(HOME_DIR, CONFIG_FILE)
TESTING_API_KEY = 'YourApiKeyToken'
if os... | <commit_before>import os
TESTING_API_KEY = 'YourApiKeyToken'
ETHERSCAN_API_KEY = os.environ.get('ETHERSCAN_API_KEY', TESTING_API_KEY)
<commit_msg>Add support for a configuration file<commit_after>import os
HOME_DIR = os.path.expanduser('~')
CONFIG_FILE = '.pyetherscan.ini'
PATH = os.path.join(HOME_DIR, CONFIG_FILE)
T... |
f98ff54c363fc2f2b0885464afffcb92cdea8cfe | ubersmith/calls/device.py | ubersmith/calls/device.py | """Device call classes.
These classes implement any response cleaning and validation needed. If a
call class isn't defined for a given method then one is created using
ubersmith.calls.BaseCall.
"""
from ubersmith.calls import BaseCall, GroupCall
from ubersmith.utils import prepend_base
__all__ = [
'GetCall',
... | """Device call classes.
These classes implement any response cleaning and validation needed. If a
call class isn't defined for a given method then one is created using
ubersmith.calls.BaseCall.
"""
from ubersmith.calls import BaseCall, GroupCall, FileCall
from ubersmith.utils import prepend_base
__all__ = [
'G... | Make module graph call return a file. | Make module graph call return a file.
| Python | mit | hivelocity/python-ubersmith,jasonkeene/python-ubersmith,hivelocity/python-ubersmith,jasonkeene/python-ubersmith | """Device call classes.
These classes implement any response cleaning and validation needed. If a
call class isn't defined for a given method then one is created using
ubersmith.calls.BaseCall.
"""
from ubersmith.calls import BaseCall, GroupCall
from ubersmith.utils import prepend_base
__all__ = [
'GetCall',
... | """Device call classes.
These classes implement any response cleaning and validation needed. If a
call class isn't defined for a given method then one is created using
ubersmith.calls.BaseCall.
"""
from ubersmith.calls import BaseCall, GroupCall, FileCall
from ubersmith.utils import prepend_base
__all__ = [
'G... | <commit_before>"""Device call classes.
These classes implement any response cleaning and validation needed. If a
call class isn't defined for a given method then one is created using
ubersmith.calls.BaseCall.
"""
from ubersmith.calls import BaseCall, GroupCall
from ubersmith.utils import prepend_base
__all__ = [
... | """Device call classes.
These classes implement any response cleaning and validation needed. If a
call class isn't defined for a given method then one is created using
ubersmith.calls.BaseCall.
"""
from ubersmith.calls import BaseCall, GroupCall, FileCall
from ubersmith.utils import prepend_base
__all__ = [
'G... | """Device call classes.
These classes implement any response cleaning and validation needed. If a
call class isn't defined for a given method then one is created using
ubersmith.calls.BaseCall.
"""
from ubersmith.calls import BaseCall, GroupCall
from ubersmith.utils import prepend_base
__all__ = [
'GetCall',
... | <commit_before>"""Device call classes.
These classes implement any response cleaning and validation needed. If a
call class isn't defined for a given method then one is created using
ubersmith.calls.BaseCall.
"""
from ubersmith.calls import BaseCall, GroupCall
from ubersmith.utils import prepend_base
__all__ = [
... |
223be3e40e32564087095227e229c1b0649becd8 | tests/test_feeds.py | tests/test_feeds.py | import pytest
from django.core.urlresolvers import reverse
from name.models import Name, Location
pytestmark = pytest.mark.django_db
def test_feed_has_georss_namespace(client):
response = client.get(reverse('name_feed'))
assert 'xmlns:georss' in response.content
def test_feed_response_is_application_xml(... | import pytest
from django.core.urlresolvers import reverse
from name.feeds import NameAtomFeed
from name.models import Name, Location
pytestmark = pytest.mark.django_db
def test_feed_has_georss_namespace(rf):
request = rf.get(reverse('name_feed'))
feed = NameAtomFeed()
response = feed(request)
asse... | Test the feed using the request factory instead of the client. | Test the feed using the request factory instead of the client.
| Python | bsd-3-clause | damonkelley/django-name,unt-libraries/django-name,damonkelley/django-name,unt-libraries/django-name,unt-libraries/django-name,damonkelley/django-name | import pytest
from django.core.urlresolvers import reverse
from name.models import Name, Location
pytestmark = pytest.mark.django_db
def test_feed_has_georss_namespace(client):
response = client.get(reverse('name_feed'))
assert 'xmlns:georss' in response.content
def test_feed_response_is_application_xml(... | import pytest
from django.core.urlresolvers import reverse
from name.feeds import NameAtomFeed
from name.models import Name, Location
pytestmark = pytest.mark.django_db
def test_feed_has_georss_namespace(rf):
request = rf.get(reverse('name_feed'))
feed = NameAtomFeed()
response = feed(request)
asse... | <commit_before>import pytest
from django.core.urlresolvers import reverse
from name.models import Name, Location
pytestmark = pytest.mark.django_db
def test_feed_has_georss_namespace(client):
response = client.get(reverse('name_feed'))
assert 'xmlns:georss' in response.content
def test_feed_response_is_a... | import pytest
from django.core.urlresolvers import reverse
from name.feeds import NameAtomFeed
from name.models import Name, Location
pytestmark = pytest.mark.django_db
def test_feed_has_georss_namespace(rf):
request = rf.get(reverse('name_feed'))
feed = NameAtomFeed()
response = feed(request)
asse... | import pytest
from django.core.urlresolvers import reverse
from name.models import Name, Location
pytestmark = pytest.mark.django_db
def test_feed_has_georss_namespace(client):
response = client.get(reverse('name_feed'))
assert 'xmlns:georss' in response.content
def test_feed_response_is_application_xml(... | <commit_before>import pytest
from django.core.urlresolvers import reverse
from name.models import Name, Location
pytestmark = pytest.mark.django_db
def test_feed_has_georss_namespace(client):
response = client.get(reverse('name_feed'))
assert 'xmlns:georss' in response.content
def test_feed_response_is_a... |
0907bef1a0f92f9f7fef628afba75e1d02db1d70 | thermof/__init__.py | thermof/__init__.py | # Date: August 2017
# Author: Kutay B. Sezginel
"""
Thermal conductivity calculations of porous crystals using Lammps
"""
from .simulation import Simulation
from .trajectory import Trajectory
from .mof import MOF
| # Date: August 2017
# Author: Kutay B. Sezginel
"""
Thermal conductivity calculations of porous crystals using Lammps
"""
from .simulation import Simulation
from .trajectory import Trajectory
from .parameters import Parameters
from .mof import MOF
| Add parameter import to main module | Add parameter import to main module
| Python | mit | kbsezginel/tee_mof,kbsezginel/tee_mof | # Date: August 2017
# Author: Kutay B. Sezginel
"""
Thermal conductivity calculations of porous crystals using Lammps
"""
from .simulation import Simulation
from .trajectory import Trajectory
from .mof import MOF
Add parameter import to main module | # Date: August 2017
# Author: Kutay B. Sezginel
"""
Thermal conductivity calculations of porous crystals using Lammps
"""
from .simulation import Simulation
from .trajectory import Trajectory
from .parameters import Parameters
from .mof import MOF
| <commit_before># Date: August 2017
# Author: Kutay B. Sezginel
"""
Thermal conductivity calculations of porous crystals using Lammps
"""
from .simulation import Simulation
from .trajectory import Trajectory
from .mof import MOF
<commit_msg>Add parameter import to main module<commit_after> | # Date: August 2017
# Author: Kutay B. Sezginel
"""
Thermal conductivity calculations of porous crystals using Lammps
"""
from .simulation import Simulation
from .trajectory import Trajectory
from .parameters import Parameters
from .mof import MOF
| # Date: August 2017
# Author: Kutay B. Sezginel
"""
Thermal conductivity calculations of porous crystals using Lammps
"""
from .simulation import Simulation
from .trajectory import Trajectory
from .mof import MOF
Add parameter import to main module# Date: August 2017
# Author: Kutay B. Sezginel
"""
Thermal conductivity... | <commit_before># Date: August 2017
# Author: Kutay B. Sezginel
"""
Thermal conductivity calculations of porous crystals using Lammps
"""
from .simulation import Simulation
from .trajectory import Trajectory
from .mof import MOF
<commit_msg>Add parameter import to main module<commit_after># Date: August 2017
# Author: K... |
21e5356e7092d6cd98ae2e3dd5befc98a36711d0 | python_server/server.py | python_server/server.py | import flask
import os
current_dir = os.path.dirname(os.path.realpath(__file__))
parent_dir = os.path.dirname(current_dir)
data_dir = os.path.join(parent_dir, "static-site", "data")
app = flask.Flask(__name__)
def add_data(file_name):
return "data/" + file_name
@app.route("/data_files")
def data_files():
body =... | from flask.ext.cors import CORS
import flask
import os
import csv
current_dir = os.path.dirname(os.path.realpath(__file__))
parent_dir = os.path.dirname(current_dir)
data_dir = os.path.join(parent_dir, "static-site", "data")
app = flask.Flask(__name__)
CORS(app)
def reduce_to_json(json_data, next_data):
labels = ... | Add endpoint to convert the csv datafiles to json | Add endpoint to convert the csv datafiles to json
| Python | epl-1.0 | jacqt/clojurescript-ode-solvers,jacqt/clojurescript-ode-solvers,jacqt/clojurescript-ode-solvers | import flask
import os
current_dir = os.path.dirname(os.path.realpath(__file__))
parent_dir = os.path.dirname(current_dir)
data_dir = os.path.join(parent_dir, "static-site", "data")
app = flask.Flask(__name__)
def add_data(file_name):
return "data/" + file_name
@app.route("/data_files")
def data_files():
body =... | from flask.ext.cors import CORS
import flask
import os
import csv
current_dir = os.path.dirname(os.path.realpath(__file__))
parent_dir = os.path.dirname(current_dir)
data_dir = os.path.join(parent_dir, "static-site", "data")
app = flask.Flask(__name__)
CORS(app)
def reduce_to_json(json_data, next_data):
labels = ... | <commit_before>import flask
import os
current_dir = os.path.dirname(os.path.realpath(__file__))
parent_dir = os.path.dirname(current_dir)
data_dir = os.path.join(parent_dir, "static-site", "data")
app = flask.Flask(__name__)
def add_data(file_name):
return "data/" + file_name
@app.route("/data_files")
def data_fi... | from flask.ext.cors import CORS
import flask
import os
import csv
current_dir = os.path.dirname(os.path.realpath(__file__))
parent_dir = os.path.dirname(current_dir)
data_dir = os.path.join(parent_dir, "static-site", "data")
app = flask.Flask(__name__)
CORS(app)
def reduce_to_json(json_data, next_data):
labels = ... | import flask
import os
current_dir = os.path.dirname(os.path.realpath(__file__))
parent_dir = os.path.dirname(current_dir)
data_dir = os.path.join(parent_dir, "static-site", "data")
app = flask.Flask(__name__)
def add_data(file_name):
return "data/" + file_name
@app.route("/data_files")
def data_files():
body =... | <commit_before>import flask
import os
current_dir = os.path.dirname(os.path.realpath(__file__))
parent_dir = os.path.dirname(current_dir)
data_dir = os.path.join(parent_dir, "static-site", "data")
app = flask.Flask(__name__)
def add_data(file_name):
return "data/" + file_name
@app.route("/data_files")
def data_fi... |
794c9f1ce78f7e74e916675f7f388fa93df445a5 | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/tests/factories.py | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/tests/factories.py | from feder.users import models
import factory
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: 'user-{0}'.format(n))
email = factory.Sequence(lambda n: 'user-{0}@example.com'.format(n))
password = factory.PosteGnerationMethodCall('set_password', 'password')
... | from feder.users import models
import factory
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: 'user-{0}'.format(n))
email = factory.Sequence(lambda n: 'user-{0}@example.com'.format(n))
password = factory.PosteGnerationMethodCall('set_password', 'password')
... | Fix flake erros in UserFactory | Fix flake erros in UserFactory | Python | bsd-3-clause | aeikenberry/cookiecutter-django-rest-babel,crdoconnor/cookiecutter-django,ddiazpinto/cookiecutter-django,ovidner/cookiecutter-django,luzfcb/cookiecutter-django,topwebmaster/cookiecutter-django,hackebrot/cookiecutter-django,thisjustin/cookiecutter-django,drxos/cookiecutter-django-dokku,ovidner/cookiecutter-django,pydann... | from feder.users import models
import factory
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: 'user-{0}'.format(n))
email = factory.Sequence(lambda n: 'user-{0}@example.com'.format(n))
password = factory.PosteGnerationMethodCall('set_password', 'password')
... | from feder.users import models
import factory
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: 'user-{0}'.format(n))
email = factory.Sequence(lambda n: 'user-{0}@example.com'.format(n))
password = factory.PosteGnerationMethodCall('set_password', 'password')
... | <commit_before>from feder.users import models
import factory
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: 'user-{0}'.format(n))
email = factory.Sequence(lambda n: 'user-{0}@example.com'.format(n))
password = factory.PosteGnerationMethodCall('set_password', 'p... | from feder.users import models
import factory
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: 'user-{0}'.format(n))
email = factory.Sequence(lambda n: 'user-{0}@example.com'.format(n))
password = factory.PosteGnerationMethodCall('set_password', 'password')
... | from feder.users import models
import factory
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: 'user-{0}'.format(n))
email = factory.Sequence(lambda n: 'user-{0}@example.com'.format(n))
password = factory.PosteGnerationMethodCall('set_password', 'password')
... | <commit_before>from feder.users import models
import factory
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: 'user-{0}'.format(n))
email = factory.Sequence(lambda n: 'user-{0}@example.com'.format(n))
password = factory.PosteGnerationMethodCall('set_password', 'p... |
96bf0e8dbf30650ba91e70a766071c6e348da6f3 | reactive/nodemanager.py | reactive/nodemanager.py | from charms.reactive import when, when_not, set_state, remove_state
from charms.hadoop import get_hadoop_base
from jujubigdata.handlers import YARN
from jujubigdata import utils
@when('resourcemanager.ready')
@when_not('nodemanager.started')
def start_nodemanager(resourcemanager):
hadoop = get_hadoop_base()
y... | from charms.reactive import when, when_not, set_state, remove_state
from charms.layer.hadoop_base import get_hadoop_base
from jujubigdata.handlers import YARN
from jujubigdata import utils
@when('resourcemanager.ready')
@when_not('nodemanager.started')
def start_nodemanager(resourcemanager):
hadoop = get_hadoop_b... | Update charms.hadoop reference to follow convention | Update charms.hadoop reference to follow convention
| Python | apache-2.0 | juju-solutions/layer-apache-hadoop-nodemanager | from charms.reactive import when, when_not, set_state, remove_state
from charms.hadoop import get_hadoop_base
from jujubigdata.handlers import YARN
from jujubigdata import utils
@when('resourcemanager.ready')
@when_not('nodemanager.started')
def start_nodemanager(resourcemanager):
hadoop = get_hadoop_base()
y... | from charms.reactive import when, when_not, set_state, remove_state
from charms.layer.hadoop_base import get_hadoop_base
from jujubigdata.handlers import YARN
from jujubigdata import utils
@when('resourcemanager.ready')
@when_not('nodemanager.started')
def start_nodemanager(resourcemanager):
hadoop = get_hadoop_b... | <commit_before>from charms.reactive import when, when_not, set_state, remove_state
from charms.hadoop import get_hadoop_base
from jujubigdata.handlers import YARN
from jujubigdata import utils
@when('resourcemanager.ready')
@when_not('nodemanager.started')
def start_nodemanager(resourcemanager):
hadoop = get_hado... | from charms.reactive import when, when_not, set_state, remove_state
from charms.layer.hadoop_base import get_hadoop_base
from jujubigdata.handlers import YARN
from jujubigdata import utils
@when('resourcemanager.ready')
@when_not('nodemanager.started')
def start_nodemanager(resourcemanager):
hadoop = get_hadoop_b... | from charms.reactive import when, when_not, set_state, remove_state
from charms.hadoop import get_hadoop_base
from jujubigdata.handlers import YARN
from jujubigdata import utils
@when('resourcemanager.ready')
@when_not('nodemanager.started')
def start_nodemanager(resourcemanager):
hadoop = get_hadoop_base()
y... | <commit_before>from charms.reactive import when, when_not, set_state, remove_state
from charms.hadoop import get_hadoop_base
from jujubigdata.handlers import YARN
from jujubigdata import utils
@when('resourcemanager.ready')
@when_not('nodemanager.started')
def start_nodemanager(resourcemanager):
hadoop = get_hado... |
a41660f3ae7137bd4d391847b297ef9a4a281109 | twixer-cli.py | twixer-cli.py | from twixer.twixer import main
if __name__ == '__main__':
main() | #!/user/bin/env python
from twixer.twixer import main
if __name__ == '__main__':
main() | Add a command line launcher | Add a command line launcher
| Python | mit | davidmogar/twixer,davidmogar/twixer | from twixer.twixer import main
if __name__ == '__main__':
main()Add a command line launcher | #!/user/bin/env python
from twixer.twixer import main
if __name__ == '__main__':
main() | <commit_before>from twixer.twixer import main
if __name__ == '__main__':
main()<commit_msg>Add a command line launcher<commit_after> | #!/user/bin/env python
from twixer.twixer import main
if __name__ == '__main__':
main() | from twixer.twixer import main
if __name__ == '__main__':
main()Add a command line launcher#!/user/bin/env python
from twixer.twixer import main
if __name__ == '__main__':
main() | <commit_before>from twixer.twixer import main
if __name__ == '__main__':
main()<commit_msg>Add a command line launcher<commit_after>#!/user/bin/env python
from twixer.twixer import main
if __name__ == '__main__':
main() |
e90b38e1e8d701b7d62ff7b6441972fca39be002 | transducer/eager.py | transducer/eager.py | from transducer._util import UNSET
from transducer.infrastructure import Reduced
# Transducible processes
def transduce(transducer, reducer, iterable, init=UNSET):
r = transducer(reducer)
accumulator = reducer.initial() if init is UNSET else init
for item in iterable:
accumulator = r.step(accumul... | from transducer._util import UNSET
from transducer.infrastructure import Reduced
# Transducible processes
def transduce(transducer, reducer, iterable, init=UNSET):
r = transducer(reducer)
accumulator = r.initial() if init is UNSET else init
for item in iterable:
accumulator = r.step(accumulator, ... | Call initial() on the transformed reducer rather than on the 'bottom' reducer. | Call initial() on the transformed reducer rather than on the 'bottom' reducer.
| Python | mit | sixty-north/python-transducers | from transducer._util import UNSET
from transducer.infrastructure import Reduced
# Transducible processes
def transduce(transducer, reducer, iterable, init=UNSET):
r = transducer(reducer)
accumulator = reducer.initial() if init is UNSET else init
for item in iterable:
accumulator = r.step(accumul... | from transducer._util import UNSET
from transducer.infrastructure import Reduced
# Transducible processes
def transduce(transducer, reducer, iterable, init=UNSET):
r = transducer(reducer)
accumulator = r.initial() if init is UNSET else init
for item in iterable:
accumulator = r.step(accumulator, ... | <commit_before>from transducer._util import UNSET
from transducer.infrastructure import Reduced
# Transducible processes
def transduce(transducer, reducer, iterable, init=UNSET):
r = transducer(reducer)
accumulator = reducer.initial() if init is UNSET else init
for item in iterable:
accumulator =... | from transducer._util import UNSET
from transducer.infrastructure import Reduced
# Transducible processes
def transduce(transducer, reducer, iterable, init=UNSET):
r = transducer(reducer)
accumulator = r.initial() if init is UNSET else init
for item in iterable:
accumulator = r.step(accumulator, ... | from transducer._util import UNSET
from transducer.infrastructure import Reduced
# Transducible processes
def transduce(transducer, reducer, iterable, init=UNSET):
r = transducer(reducer)
accumulator = reducer.initial() if init is UNSET else init
for item in iterable:
accumulator = r.step(accumul... | <commit_before>from transducer._util import UNSET
from transducer.infrastructure import Reduced
# Transducible processes
def transduce(transducer, reducer, iterable, init=UNSET):
r = transducer(reducer)
accumulator = reducer.initial() if init is UNSET else init
for item in iterable:
accumulator =... |
f5b13d16045e7e734a66bc13873ab5f4e8045f5a | skylines/views/about.py | skylines/views/about.py | import os.path
from flask import Blueprint, render_template
from flask.ext.babel import _
from skylines import app
from skylines.lib.helpers import markdown
about_blueprint = Blueprint('about', 'skylines')
@about_blueprint.route('/')
def about():
return render_template('about.jinja')
@about_blueprint.route('... | import os.path
from flask import Blueprint, render_template, current_app
from flask.ext.babel import _
from skylines.lib.helpers import markdown
about_blueprint = Blueprint('about', 'skylines')
@about_blueprint.route('/')
def about():
return render_template('about.jinja')
@about_blueprint.route('/imprint')
d... | Use current_app in Blueprint module | flask/views: Use current_app in Blueprint module
| Python | agpl-3.0 | RBE-Avionik/skylines,RBE-Avionik/skylines,Harry-R/skylines,Turbo87/skylines,snip/skylines,shadowoneau/skylines,TobiasLohner/SkyLines,TobiasLohner/SkyLines,TobiasLohner/SkyLines,kerel-fs/skylines,Harry-R/skylines,skylines-project/skylines,shadowoneau/skylines,Turbo87/skylines,snip/skylines,shadowoneau/skylines,RBE-Avion... | import os.path
from flask import Blueprint, render_template
from flask.ext.babel import _
from skylines import app
from skylines.lib.helpers import markdown
about_blueprint = Blueprint('about', 'skylines')
@about_blueprint.route('/')
def about():
return render_template('about.jinja')
@about_blueprint.route('... | import os.path
from flask import Blueprint, render_template, current_app
from flask.ext.babel import _
from skylines.lib.helpers import markdown
about_blueprint = Blueprint('about', 'skylines')
@about_blueprint.route('/')
def about():
return render_template('about.jinja')
@about_blueprint.route('/imprint')
d... | <commit_before>import os.path
from flask import Blueprint, render_template
from flask.ext.babel import _
from skylines import app
from skylines.lib.helpers import markdown
about_blueprint = Blueprint('about', 'skylines')
@about_blueprint.route('/')
def about():
return render_template('about.jinja')
@about_bl... | import os.path
from flask import Blueprint, render_template, current_app
from flask.ext.babel import _
from skylines.lib.helpers import markdown
about_blueprint = Blueprint('about', 'skylines')
@about_blueprint.route('/')
def about():
return render_template('about.jinja')
@about_blueprint.route('/imprint')
d... | import os.path
from flask import Blueprint, render_template
from flask.ext.babel import _
from skylines import app
from skylines.lib.helpers import markdown
about_blueprint = Blueprint('about', 'skylines')
@about_blueprint.route('/')
def about():
return render_template('about.jinja')
@about_blueprint.route('... | <commit_before>import os.path
from flask import Blueprint, render_template
from flask.ext.babel import _
from skylines import app
from skylines.lib.helpers import markdown
about_blueprint = Blueprint('about', 'skylines')
@about_blueprint.route('/')
def about():
return render_template('about.jinja')
@about_bl... |
7fb46ddf6bab9d32908c8fb9c859fd8151fbd089 | qipr/registry/forms/facet_form.py | qipr/registry/forms/facet_form.py | from registry.models import *
from operator import attrgetter
related_by_projects_Models = [
BigAim,
ClinicalArea,
ClinicalSetting,
Descriptor,
]
class FacetForm:
def __init__(self):
self.facet_categories = [model.__name__ for model in related_by_projects_Models]
for model in rela... | from registry.models import *
from operator import attrgetter
related_by_projects_Models = [
BigAim,
ClinicalArea,
ClinicalSetting,
Descriptor,
]
class FacetForm:
def __init__(self):
self.facet_categories = [model.__name__ for model in related_by_projects_Models]
for model in rela... | Change the facet to sort by name instead of project count | Change the facet to sort by name instead of project count
| Python | apache-2.0 | ctsit/qipr,ctsit/qipr,ctsit/qipr,ctsit/qipr,ctsit/qipr | from registry.models import *
from operator import attrgetter
related_by_projects_Models = [
BigAim,
ClinicalArea,
ClinicalSetting,
Descriptor,
]
class FacetForm:
def __init__(self):
self.facet_categories = [model.__name__ for model in related_by_projects_Models]
for model in rela... | from registry.models import *
from operator import attrgetter
related_by_projects_Models = [
BigAim,
ClinicalArea,
ClinicalSetting,
Descriptor,
]
class FacetForm:
def __init__(self):
self.facet_categories = [model.__name__ for model in related_by_projects_Models]
for model in rela... | <commit_before>from registry.models import *
from operator import attrgetter
related_by_projects_Models = [
BigAim,
ClinicalArea,
ClinicalSetting,
Descriptor,
]
class FacetForm:
def __init__(self):
self.facet_categories = [model.__name__ for model in related_by_projects_Models]
fo... | from registry.models import *
from operator import attrgetter
related_by_projects_Models = [
BigAim,
ClinicalArea,
ClinicalSetting,
Descriptor,
]
class FacetForm:
def __init__(self):
self.facet_categories = [model.__name__ for model in related_by_projects_Models]
for model in rela... | from registry.models import *
from operator import attrgetter
related_by_projects_Models = [
BigAim,
ClinicalArea,
ClinicalSetting,
Descriptor,
]
class FacetForm:
def __init__(self):
self.facet_categories = [model.__name__ for model in related_by_projects_Models]
for model in rela... | <commit_before>from registry.models import *
from operator import attrgetter
related_by_projects_Models = [
BigAim,
ClinicalArea,
ClinicalSetting,
Descriptor,
]
class FacetForm:
def __init__(self):
self.facet_categories = [model.__name__ for model in related_by_projects_Models]
fo... |
8f3760697dffc8f8be789a1a8594dae97b245536 | app/redidropper/startup/settings.py | app/redidropper/startup/settings.py | # Goal: Store settings which can be over-ruled
# using environment variables.
#
# @authors:
# Andrei Sura <[email protected]>
# Ruchi Vivek Desai <[email protected]>
# Sanath Pasumarthy <[email protected]>
#
# @TODO: add code to check for valid paths
import os
DB_USER = os.get... | # Goal: Store settings which can be over-ruled
# using environment variables.
#
# @authors:
# Andrei Sura <[email protected]>
# Ruchi Vivek Desai <[email protected]>
# Sanath Pasumarthy <[email protected]>
#
# @TODO: add code to check for valid paths
import os
# Limit the max ... | Allow max 20MB file chunks | Allow max 20MB file chunks
| Python | bsd-3-clause | indera/redi-dropper-client,indera/redi-dropper-client,indera/redi-dropper-client,indera/redi-dropper-client,indera/redi-dropper-client | # Goal: Store settings which can be over-ruled
# using environment variables.
#
# @authors:
# Andrei Sura <[email protected]>
# Ruchi Vivek Desai <[email protected]>
# Sanath Pasumarthy <[email protected]>
#
# @TODO: add code to check for valid paths
import os
DB_USER = os.get... | # Goal: Store settings which can be over-ruled
# using environment variables.
#
# @authors:
# Andrei Sura <[email protected]>
# Ruchi Vivek Desai <[email protected]>
# Sanath Pasumarthy <[email protected]>
#
# @TODO: add code to check for valid paths
import os
# Limit the max ... | <commit_before># Goal: Store settings which can be over-ruled
# using environment variables.
#
# @authors:
# Andrei Sura <[email protected]>
# Ruchi Vivek Desai <[email protected]>
# Sanath Pasumarthy <[email protected]>
#
# @TODO: add code to check for valid paths
import os
D... | # Goal: Store settings which can be over-ruled
# using environment variables.
#
# @authors:
# Andrei Sura <[email protected]>
# Ruchi Vivek Desai <[email protected]>
# Sanath Pasumarthy <[email protected]>
#
# @TODO: add code to check for valid paths
import os
# Limit the max ... | # Goal: Store settings which can be over-ruled
# using environment variables.
#
# @authors:
# Andrei Sura <[email protected]>
# Ruchi Vivek Desai <[email protected]>
# Sanath Pasumarthy <[email protected]>
#
# @TODO: add code to check for valid paths
import os
DB_USER = os.get... | <commit_before># Goal: Store settings which can be over-ruled
# using environment variables.
#
# @authors:
# Andrei Sura <[email protected]>
# Ruchi Vivek Desai <[email protected]>
# Sanath Pasumarthy <[email protected]>
#
# @TODO: add code to check for valid paths
import os
D... |
ab12d9e847448750067e798ba1b5a4238451dfee | antfarm/views/static.py | antfarm/views/static.py |
'''
Helper for serving static content.
'''
from antfarm import response
import mimetypes
class ServeStatic(object):
def __init__(self, root):
self.root = root
def __call__(self, path):
full_path = os.path.absdir(os.path.join(self.root, path))
if not full_path.startswith(self.root):
... |
'''
Helper for serving static content.
'''
import os.path
from antfarm import response
import mimetypes
class ServeStatic(object):
def __init__(self, root):
self.root = root
def __call__(self, request, path):
full_path = os.path.abspath(os.path.join(self.root, path))
if not full_pat... | Handle missing files gracefully in ServeStatic | Handle missing files gracefully in ServeStatic
| Python | mit | funkybob/antfarm |
'''
Helper for serving static content.
'''
from antfarm import response
import mimetypes
class ServeStatic(object):
def __init__(self, root):
self.root = root
def __call__(self, path):
full_path = os.path.absdir(os.path.join(self.root, path))
if not full_path.startswith(self.root):
... |
'''
Helper for serving static content.
'''
import os.path
from antfarm import response
import mimetypes
class ServeStatic(object):
def __init__(self, root):
self.root = root
def __call__(self, request, path):
full_path = os.path.abspath(os.path.join(self.root, path))
if not full_pat... | <commit_before>
'''
Helper for serving static content.
'''
from antfarm import response
import mimetypes
class ServeStatic(object):
def __init__(self, root):
self.root = root
def __call__(self, path):
full_path = os.path.absdir(os.path.join(self.root, path))
if not full_path.startswit... |
'''
Helper for serving static content.
'''
import os.path
from antfarm import response
import mimetypes
class ServeStatic(object):
def __init__(self, root):
self.root = root
def __call__(self, request, path):
full_path = os.path.abspath(os.path.join(self.root, path))
if not full_pat... |
'''
Helper for serving static content.
'''
from antfarm import response
import mimetypes
class ServeStatic(object):
def __init__(self, root):
self.root = root
def __call__(self, path):
full_path = os.path.absdir(os.path.join(self.root, path))
if not full_path.startswith(self.root):
... | <commit_before>
'''
Helper for serving static content.
'''
from antfarm import response
import mimetypes
class ServeStatic(object):
def __init__(self, root):
self.root = root
def __call__(self, path):
full_path = os.path.absdir(os.path.join(self.root, path))
if not full_path.startswit... |
c9275ff9859f28753e2e261054e7c0aacc4c28dc | monitoring/co2/local/k30.py | monitoring/co2/local/k30.py | #!/usr/bin/env python3
#Python app to run a K-30 Sensor
import serial
import time
from optparse import OptionParser
import sys
ser = serial.Serial("/dev/ttyAMA0")
print("Serial Connected!", file=sys.stderr)
ser.flushInput()
time.sleep(1)
parser = OptionParser()
parser.add_option("-t", "--average-time", dest="avgtime... | #!/usr/bin/env python
#Python app to run a K-30 Sensor
import serial
import time
from optparse import OptionParser
import sys
ser = serial.Serial("/dev/serial0")
#print("Serial Connected!", file=sys.stderr)
ser.flushInput()
time.sleep(1)
parser = OptionParser()
parser.add_option("-t", "--average-time", dest="avgtime... | Revert to python2, python3 converted code isn't working as expected | Revert to python2, python3 converted code isn't working as expected
| Python | mit | xopok/xopok-scripts,xopok/xopok-scripts | #!/usr/bin/env python3
#Python app to run a K-30 Sensor
import serial
import time
from optparse import OptionParser
import sys
ser = serial.Serial("/dev/ttyAMA0")
print("Serial Connected!", file=sys.stderr)
ser.flushInput()
time.sleep(1)
parser = OptionParser()
parser.add_option("-t", "--average-time", dest="avgtime... | #!/usr/bin/env python
#Python app to run a K-30 Sensor
import serial
import time
from optparse import OptionParser
import sys
ser = serial.Serial("/dev/serial0")
#print("Serial Connected!", file=sys.stderr)
ser.flushInput()
time.sleep(1)
parser = OptionParser()
parser.add_option("-t", "--average-time", dest="avgtime... | <commit_before>#!/usr/bin/env python3
#Python app to run a K-30 Sensor
import serial
import time
from optparse import OptionParser
import sys
ser = serial.Serial("/dev/ttyAMA0")
print("Serial Connected!", file=sys.stderr)
ser.flushInput()
time.sleep(1)
parser = OptionParser()
parser.add_option("-t", "--average-time"... | #!/usr/bin/env python
#Python app to run a K-30 Sensor
import serial
import time
from optparse import OptionParser
import sys
ser = serial.Serial("/dev/serial0")
#print("Serial Connected!", file=sys.stderr)
ser.flushInput()
time.sleep(1)
parser = OptionParser()
parser.add_option("-t", "--average-time", dest="avgtime... | #!/usr/bin/env python3
#Python app to run a K-30 Sensor
import serial
import time
from optparse import OptionParser
import sys
ser = serial.Serial("/dev/ttyAMA0")
print("Serial Connected!", file=sys.stderr)
ser.flushInput()
time.sleep(1)
parser = OptionParser()
parser.add_option("-t", "--average-time", dest="avgtime... | <commit_before>#!/usr/bin/env python3
#Python app to run a K-30 Sensor
import serial
import time
from optparse import OptionParser
import sys
ser = serial.Serial("/dev/ttyAMA0")
print("Serial Connected!", file=sys.stderr)
ser.flushInput()
time.sleep(1)
parser = OptionParser()
parser.add_option("-t", "--average-time"... |
43f02a76b72f0ada55c39d1b5f131a5ec72d29e6 | apps/core/decorators.py | apps/core/decorators.py | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from functools import wraps
class AuthenticationRequiredError(RuntimeError):
pass
def ajax_login_required(func):
@wraps(func)
def __wrapper(request, *args, **kwargs):
# Check authenticatio... | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from functools import wraps
from django.core.exceptions import PermissionDenied
def ajax_login_required(func):
@wraps(func)
def __wrapper(request, *args, **kwargs):
# Check authentication
... | Return 403 Permission Denied error for unauthenticated AJAX requests | Return 403 Permission Denied error for unauthenticated AJAX requests
| Python | agpl-3.0 | strongswan/strongTNC,strongswan/strongTNC,strongswan/strongTNC,strongswan/strongTNC | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from functools import wraps
class AuthenticationRequiredError(RuntimeError):
pass
def ajax_login_required(func):
@wraps(func)
def __wrapper(request, *args, **kwargs):
# Check authenticatio... | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from functools import wraps
from django.core.exceptions import PermissionDenied
def ajax_login_required(func):
@wraps(func)
def __wrapper(request, *args, **kwargs):
# Check authentication
... | <commit_before># -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from functools import wraps
class AuthenticationRequiredError(RuntimeError):
pass
def ajax_login_required(func):
@wraps(func)
def __wrapper(request, *args, **kwargs):
# Chec... | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from functools import wraps
from django.core.exceptions import PermissionDenied
def ajax_login_required(func):
@wraps(func)
def __wrapper(request, *args, **kwargs):
# Check authentication
... | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from functools import wraps
class AuthenticationRequiredError(RuntimeError):
pass
def ajax_login_required(func):
@wraps(func)
def __wrapper(request, *args, **kwargs):
# Check authenticatio... | <commit_before># -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from functools import wraps
class AuthenticationRequiredError(RuntimeError):
pass
def ajax_login_required(func):
@wraps(func)
def __wrapper(request, *args, **kwargs):
# Chec... |
696504f00604c91ad476d0faa5598dfeb739947e | assassins_guild/wsgi.py | assassins_guild/wsgi.py | """
WSGI config for assassins_guild project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "assassins_guild.settings")
fr... | """
WSGI config for assassins_guild project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "assassins_guild.settings")
fr... | Revert "Deactivating Cling, let's see if that helps." | Revert "Deactivating Cling, let's see if that helps."
This reverts commit a43f5ffbb21ea85f5d0756a4fcf6019b824dfb84.
| Python | mit | TaymonB/assassins-guild.com | """
WSGI config for assassins_guild project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "assassins_guild.settings")
fr... | """
WSGI config for assassins_guild project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "assassins_guild.settings")
fr... | <commit_before>"""
WSGI config for assassins_guild project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "assassins_guild... | """
WSGI config for assassins_guild project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "assassins_guild.settings")
fr... | """
WSGI config for assassins_guild project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "assassins_guild.settings")
fr... | <commit_before>"""
WSGI config for assassins_guild project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "assassins_guild... |
1de19bed8b61b87c1f1afd1b2c8e5499a9e2da9a | backend/breach/tests.py | backend/breach/tests.py | from django.test import TestCase
from breach.models import SampleSet, Victim, Target
from breach.analyzer import decide_next_world_state
class AnalyzerTestCase(TestCase):
def setUp(self):
target = Target.objects.create(
endpoint="http://di.uoa.gr/",
prefix="test",
alpha... | from django.test import TestCase
from breach.models import SampleSet, Victim, Target
from breach.analyzer import decide_next_world_state
class AnalyzerTestCase(TestCase):
def setUp(self):
target = Target.objects.create(
endpoint='http://di.uoa.gr/',
prefix='test',
alpha... | Fix double quotes in analyzer testcase | Fix double quotes in analyzer testcase
| Python | mit | dimkarakostas/rupture,dionyziz/rupture,esarafianou/rupture,dimriou/rupture,dimkarakostas/rupture,dionyziz/rupture,esarafianou/rupture,dionyziz/rupture,esarafianou/rupture,esarafianou/rupture,dimkarakostas/rupture,dimriou/rupture,dimriou/rupture,dionyziz/rupture,dionyziz/rupture,dimriou/rupture,dimriou/rupture,dimkarako... | from django.test import TestCase
from breach.models import SampleSet, Victim, Target
from breach.analyzer import decide_next_world_state
class AnalyzerTestCase(TestCase):
def setUp(self):
target = Target.objects.create(
endpoint="http://di.uoa.gr/",
prefix="test",
alpha... | from django.test import TestCase
from breach.models import SampleSet, Victim, Target
from breach.analyzer import decide_next_world_state
class AnalyzerTestCase(TestCase):
def setUp(self):
target = Target.objects.create(
endpoint='http://di.uoa.gr/',
prefix='test',
alpha... | <commit_before>from django.test import TestCase
from breach.models import SampleSet, Victim, Target
from breach.analyzer import decide_next_world_state
class AnalyzerTestCase(TestCase):
def setUp(self):
target = Target.objects.create(
endpoint="http://di.uoa.gr/",
prefix="test",
... | from django.test import TestCase
from breach.models import SampleSet, Victim, Target
from breach.analyzer import decide_next_world_state
class AnalyzerTestCase(TestCase):
def setUp(self):
target = Target.objects.create(
endpoint='http://di.uoa.gr/',
prefix='test',
alpha... | from django.test import TestCase
from breach.models import SampleSet, Victim, Target
from breach.analyzer import decide_next_world_state
class AnalyzerTestCase(TestCase):
def setUp(self):
target = Target.objects.create(
endpoint="http://di.uoa.gr/",
prefix="test",
alpha... | <commit_before>from django.test import TestCase
from breach.models import SampleSet, Victim, Target
from breach.analyzer import decide_next_world_state
class AnalyzerTestCase(TestCase):
def setUp(self):
target = Target.objects.create(
endpoint="http://di.uoa.gr/",
prefix="test",
... |
4a6b1eea0ceda8fb4e9753ba91e1a6ba60c9182a | utils/add_sample_feeds.py | utils/add_sample_feeds.py | from smoke_signal import app, init_db
from smoke_signal.database.helpers import add_feed
from utils.generate_feed import SampleFeed
from os import walk
feeds_dir = app.root_path + "/test_resources/feeds/"
app.config['DATABASE_PATH'] = 'sqlite:///smoke_signal/test_resources/posts.db'
def create_sample_feed_files(nu... | from smoke_signal import app, init_db
from smoke_signal.database.helpers import add_feed
from utils.generate_feed import SampleFeed
import feedparser
from os import walk, makedirs
FEEDS_DIR = app.root_path + "/test_resources/feeds/"
app.config['DATABASE_PATH'] = 'sqlite:///smoke_signal/test_resources/posts.db'
def... | Make script for adding sample feeds more usable | Make script for adding sample feeds more usable
| Python | mit | flacerdk/smoke-signal,flacerdk/smoke-signal,flacerdk/smoke-signal | from smoke_signal import app, init_db
from smoke_signal.database.helpers import add_feed
from utils.generate_feed import SampleFeed
from os import walk
feeds_dir = app.root_path + "/test_resources/feeds/"
app.config['DATABASE_PATH'] = 'sqlite:///smoke_signal/test_resources/posts.db'
def create_sample_feed_files(nu... | from smoke_signal import app, init_db
from smoke_signal.database.helpers import add_feed
from utils.generate_feed import SampleFeed
import feedparser
from os import walk, makedirs
FEEDS_DIR = app.root_path + "/test_resources/feeds/"
app.config['DATABASE_PATH'] = 'sqlite:///smoke_signal/test_resources/posts.db'
def... | <commit_before>from smoke_signal import app, init_db
from smoke_signal.database.helpers import add_feed
from utils.generate_feed import SampleFeed
from os import walk
feeds_dir = app.root_path + "/test_resources/feeds/"
app.config['DATABASE_PATH'] = 'sqlite:///smoke_signal/test_resources/posts.db'
def create_sampl... | from smoke_signal import app, init_db
from smoke_signal.database.helpers import add_feed
from utils.generate_feed import SampleFeed
import feedparser
from os import walk, makedirs
FEEDS_DIR = app.root_path + "/test_resources/feeds/"
app.config['DATABASE_PATH'] = 'sqlite:///smoke_signal/test_resources/posts.db'
def... | from smoke_signal import app, init_db
from smoke_signal.database.helpers import add_feed
from utils.generate_feed import SampleFeed
from os import walk
feeds_dir = app.root_path + "/test_resources/feeds/"
app.config['DATABASE_PATH'] = 'sqlite:///smoke_signal/test_resources/posts.db'
def create_sample_feed_files(nu... | <commit_before>from smoke_signal import app, init_db
from smoke_signal.database.helpers import add_feed
from utils.generate_feed import SampleFeed
from os import walk
feeds_dir = app.root_path + "/test_resources/feeds/"
app.config['DATABASE_PATH'] = 'sqlite:///smoke_signal/test_resources/posts.db'
def create_sampl... |
9c3ad42fab1ac73a500e43c98026525d96c2121a | sci_lib.py | sci_lib.py | #!/usr/bin/python
#Author: Scott T. Salesky
#Created: 12.6.2014
#Purpose: Collection of functions, routines to use
#Python for scientific work
#----------------------------------------------
| #!/usr/bin/python
#Author: Scott T. Salesky
#Created: 12.6.2014
#Purpose: Collection of useful Python classes,
#routines, and functions for scientific work
#----------------------------------------------
#Import all required packages
import numpy as np
from matplotlib.colors import Normalize
def read_f90_bin(path,nx,... | Add the MidPointNormalize class, which allows one to define the midpoint of a colormap. Useful, e.g. if plotting data in the range [-6,3] with contourf and a diverging colormap, where zero still should be shaded in white. | Add the MidPointNormalize class, which allows one to define the midpoint of a colormap. Useful, e.g. if plotting data in the range [-6,3] with contourf and a diverging colormap, where zero still should be shaded in white.
| Python | mit | ssalesky/Science-Library | #!/usr/bin/python
#Author: Scott T. Salesky
#Created: 12.6.2014
#Purpose: Collection of functions, routines to use
#Python for scientific work
#----------------------------------------------
Add the MidPointNormalize class, which allows one to define the midpoint of a colormap. Useful, e.g. if plotting data in the ran... | #!/usr/bin/python
#Author: Scott T. Salesky
#Created: 12.6.2014
#Purpose: Collection of useful Python classes,
#routines, and functions for scientific work
#----------------------------------------------
#Import all required packages
import numpy as np
from matplotlib.colors import Normalize
def read_f90_bin(path,nx,... | <commit_before>#!/usr/bin/python
#Author: Scott T. Salesky
#Created: 12.6.2014
#Purpose: Collection of functions, routines to use
#Python for scientific work
#----------------------------------------------
<commit_msg>Add the MidPointNormalize class, which allows one to define the midpoint of a colormap. Useful, e.g. ... | #!/usr/bin/python
#Author: Scott T. Salesky
#Created: 12.6.2014
#Purpose: Collection of useful Python classes,
#routines, and functions for scientific work
#----------------------------------------------
#Import all required packages
import numpy as np
from matplotlib.colors import Normalize
def read_f90_bin(path,nx,... | #!/usr/bin/python
#Author: Scott T. Salesky
#Created: 12.6.2014
#Purpose: Collection of functions, routines to use
#Python for scientific work
#----------------------------------------------
Add the MidPointNormalize class, which allows one to define the midpoint of a colormap. Useful, e.g. if plotting data in the ran... | <commit_before>#!/usr/bin/python
#Author: Scott T. Salesky
#Created: 12.6.2014
#Purpose: Collection of functions, routines to use
#Python for scientific work
#----------------------------------------------
<commit_msg>Add the MidPointNormalize class, which allows one to define the midpoint of a colormap. Useful, e.g. ... |
493480f3a9d34e01d0a64442b29529d70a44a8ee | smugcli/stdout_interceptor.py | smugcli/stdout_interceptor.py | """Context manager base class man-in-the-middling the global stdout."""
import sys
class Error(Exception):
"""Base class for all exception of this module."""
class InvalidUsageError(Error):
"""Error raised on incorrect API uses."""
class StdoutInterceptor():
"""Context manager base class man-in-the-middlin... | """Context manager base class man-in-the-middling the global stdout."""
import sys
class Error(Exception):
"""Base class for all exception of this module."""
class InvalidUsageError(Error):
"""Error raised on incorrect API uses."""
class StdoutInterceptor():
"""Context manager base class man-in-the-middlin... | Fix invalid annotation. The type of `self` in base class should be left to be deduced to the child type. | Fix invalid annotation. The type of `self` in base class should be left to be deduced to the child type.
| Python | mit | graveljp/smugcli | """Context manager base class man-in-the-middling the global stdout."""
import sys
class Error(Exception):
"""Base class for all exception of this module."""
class InvalidUsageError(Error):
"""Error raised on incorrect API uses."""
class StdoutInterceptor():
"""Context manager base class man-in-the-middlin... | """Context manager base class man-in-the-middling the global stdout."""
import sys
class Error(Exception):
"""Base class for all exception of this module."""
class InvalidUsageError(Error):
"""Error raised on incorrect API uses."""
class StdoutInterceptor():
"""Context manager base class man-in-the-middlin... | <commit_before>"""Context manager base class man-in-the-middling the global stdout."""
import sys
class Error(Exception):
"""Base class for all exception of this module."""
class InvalidUsageError(Error):
"""Error raised on incorrect API uses."""
class StdoutInterceptor():
"""Context manager base class man... | """Context manager base class man-in-the-middling the global stdout."""
import sys
class Error(Exception):
"""Base class for all exception of this module."""
class InvalidUsageError(Error):
"""Error raised on incorrect API uses."""
class StdoutInterceptor():
"""Context manager base class man-in-the-middlin... | """Context manager base class man-in-the-middling the global stdout."""
import sys
class Error(Exception):
"""Base class for all exception of this module."""
class InvalidUsageError(Error):
"""Error raised on incorrect API uses."""
class StdoutInterceptor():
"""Context manager base class man-in-the-middlin... | <commit_before>"""Context manager base class man-in-the-middling the global stdout."""
import sys
class Error(Exception):
"""Base class for all exception of this module."""
class InvalidUsageError(Error):
"""Error raised on incorrect API uses."""
class StdoutInterceptor():
"""Context manager base class man... |
b207cd8005a0d3a56dc87cc1194458128f94a675 | awacs/helpers/trust.py | awacs/helpers/trust.py | from awacs.aws import Statement, Principal, Allow, Policy
from awacs import sts
def get_default_assumerole_policy(region=''):
""" Helper function for building the Default AssumeRole Policy
Taken from here:
https://github.com/boto/boto/blob/develop/boto/iam/connection.py#L29
Used to allow ec2 inst... | from awacs.aws import Statement, Principal, Allow, Policy
from awacs import sts
def make_simple_assume_statement(principal):
return Statement(
Principal=Principal('Service', [principal]),
Effect=Allow,
Action=[sts.AssumeRole])
def get_default_assumerole_policy(region=''):
""" Helper ... | Simplify the code a little | Simplify the code a little
| Python | bsd-2-clause | craigbruce/awacs,cloudtools/awacs | from awacs.aws import Statement, Principal, Allow, Policy
from awacs import sts
def get_default_assumerole_policy(region=''):
""" Helper function for building the Default AssumeRole Policy
Taken from here:
https://github.com/boto/boto/blob/develop/boto/iam/connection.py#L29
Used to allow ec2 inst... | from awacs.aws import Statement, Principal, Allow, Policy
from awacs import sts
def make_simple_assume_statement(principal):
return Statement(
Principal=Principal('Service', [principal]),
Effect=Allow,
Action=[sts.AssumeRole])
def get_default_assumerole_policy(region=''):
""" Helper ... | <commit_before>from awacs.aws import Statement, Principal, Allow, Policy
from awacs import sts
def get_default_assumerole_policy(region=''):
""" Helper function for building the Default AssumeRole Policy
Taken from here:
https://github.com/boto/boto/blob/develop/boto/iam/connection.py#L29
Used to... | from awacs.aws import Statement, Principal, Allow, Policy
from awacs import sts
def make_simple_assume_statement(principal):
return Statement(
Principal=Principal('Service', [principal]),
Effect=Allow,
Action=[sts.AssumeRole])
def get_default_assumerole_policy(region=''):
""" Helper ... | from awacs.aws import Statement, Principal, Allow, Policy
from awacs import sts
def get_default_assumerole_policy(region=''):
""" Helper function for building the Default AssumeRole Policy
Taken from here:
https://github.com/boto/boto/blob/develop/boto/iam/connection.py#L29
Used to allow ec2 inst... | <commit_before>from awacs.aws import Statement, Principal, Allow, Policy
from awacs import sts
def get_default_assumerole_policy(region=''):
""" Helper function for building the Default AssumeRole Policy
Taken from here:
https://github.com/boto/boto/blob/develop/boto/iam/connection.py#L29
Used to... |
5923d751d9541758a67915db67ee799ba0d1cd6d | polling_stations/api/mixins.py | polling_stations/api/mixins.py | from rest_framework.decorators import list_route
from rest_framework.response import Response
class PollingEntityMixin():
def output(self, request):
if not self.validate_request():
return Response(
{'detail': 'council_id parameter must be specified'}, 400)
queryset = ... | from rest_framework.decorators import list_route
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
class LargeResultsSetPagination(LimitOffsetPagination):
default_limit = 100
max_limit = 1000
class PollingEntityMixin():
pagination_class = LargeResu... | Use pagination on stations and districts endpoints with no filter | Use pagination on stations and districts endpoints with no filter
If no filter is passed to /pollingstations or /pollingdistricts
use pagination (when filtering, there is no pagination)
This means:
- HTML outputs stay responsive/useful
- People can't tie up our server with a query that says
'give me boundaries for ... | Python | bsd-3-clause | chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations | from rest_framework.decorators import list_route
from rest_framework.response import Response
class PollingEntityMixin():
def output(self, request):
if not self.validate_request():
return Response(
{'detail': 'council_id parameter must be specified'}, 400)
queryset = ... | from rest_framework.decorators import list_route
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
class LargeResultsSetPagination(LimitOffsetPagination):
default_limit = 100
max_limit = 1000
class PollingEntityMixin():
pagination_class = LargeResu... | <commit_before>from rest_framework.decorators import list_route
from rest_framework.response import Response
class PollingEntityMixin():
def output(self, request):
if not self.validate_request():
return Response(
{'detail': 'council_id parameter must be specified'}, 400)
... | from rest_framework.decorators import list_route
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
class LargeResultsSetPagination(LimitOffsetPagination):
default_limit = 100
max_limit = 1000
class PollingEntityMixin():
pagination_class = LargeResu... | from rest_framework.decorators import list_route
from rest_framework.response import Response
class PollingEntityMixin():
def output(self, request):
if not self.validate_request():
return Response(
{'detail': 'council_id parameter must be specified'}, 400)
queryset = ... | <commit_before>from rest_framework.decorators import list_route
from rest_framework.response import Response
class PollingEntityMixin():
def output(self, request):
if not self.validate_request():
return Response(
{'detail': 'council_id parameter must be specified'}, 400)
... |
61266aee4c01fdfc9f3134b825f31154fd3f7efa | version.py | version.py | # -*- coding: utf-8 -*-
import platform
WINDOWS = platform.system().lower() == "windows"
VERSION = u'3.6.45'
| # -*- coding: utf-8 -*-
import platform
WINDOWS = platform.system().lower() == "windows"
VERSION = u'3.6.46'
| Fix geting font list on Windows | Fix geting font list on Windows
| Python | mit | rupor-github/fb2mobi,rupor-github/fb2mobi | # -*- coding: utf-8 -*-
import platform
WINDOWS = platform.system().lower() == "windows"
VERSION = u'3.6.45'
Fix geting font list on Windows | # -*- coding: utf-8 -*-
import platform
WINDOWS = platform.system().lower() == "windows"
VERSION = u'3.6.46'
| <commit_before># -*- coding: utf-8 -*-
import platform
WINDOWS = platform.system().lower() == "windows"
VERSION = u'3.6.45'
<commit_msg>Fix geting font list on Windows<commit_after> | # -*- coding: utf-8 -*-
import platform
WINDOWS = platform.system().lower() == "windows"
VERSION = u'3.6.46'
| # -*- coding: utf-8 -*-
import platform
WINDOWS = platform.system().lower() == "windows"
VERSION = u'3.6.45'
Fix geting font list on Windows# -*- coding: utf-8 -*-
import platform
WINDOWS = platform.system().lower() == "windows"
VERSION = u'3.6.46'
| <commit_before># -*- coding: utf-8 -*-
import platform
WINDOWS = platform.system().lower() == "windows"
VERSION = u'3.6.45'
<commit_msg>Fix geting font list on Windows<commit_after># -*- coding: utf-8 -*-
import platform
WINDOWS = platform.system().lower() == "windows"
VERSION = u'3.6.46'
|
07a1a4bf4dc9ed6173c19e3409b11a311e029d7a | sim.py | sim.py | from gensim import models
import time
start_time = time.perf_counter()
print('\nLoading vectors...\n')
w = models.KeyedVectors.load_word2vec_format('/home/ubuntu/sim/CBOW|skipgram.bin', binary=True)
relations = {'': [''],
'': [''],
'': ['']}
original_verbs = list(relations.keys())
for ve... | from gensim import models
import time
start_time = time.perf_counter()
print('\nLoading vectors...\n')
w = models.KeyedVectors.load_word2vec_format('/home/ubuntu/sim/CBOW|skipgram.bin', binary=True)
relations = {'': [''],
'': [''],
'': ['']}
original_verbs = list(relations.keys())
for ve... | Print data for each paraverb. | Print data for each paraverb.
| Python | mit | albertomh/ug-dissertation | from gensim import models
import time
start_time = time.perf_counter()
print('\nLoading vectors...\n')
w = models.KeyedVectors.load_word2vec_format('/home/ubuntu/sim/CBOW|skipgram.bin', binary=True)
relations = {'': [''],
'': [''],
'': ['']}
original_verbs = list(relations.keys())
for ve... | from gensim import models
import time
start_time = time.perf_counter()
print('\nLoading vectors...\n')
w = models.KeyedVectors.load_word2vec_format('/home/ubuntu/sim/CBOW|skipgram.bin', binary=True)
relations = {'': [''],
'': [''],
'': ['']}
original_verbs = list(relations.keys())
for ve... | <commit_before>from gensim import models
import time
start_time = time.perf_counter()
print('\nLoading vectors...\n')
w = models.KeyedVectors.load_word2vec_format('/home/ubuntu/sim/CBOW|skipgram.bin', binary=True)
relations = {'': [''],
'': [''],
'': ['']}
original_verbs = list(relations.k... | from gensim import models
import time
start_time = time.perf_counter()
print('\nLoading vectors...\n')
w = models.KeyedVectors.load_word2vec_format('/home/ubuntu/sim/CBOW|skipgram.bin', binary=True)
relations = {'': [''],
'': [''],
'': ['']}
original_verbs = list(relations.keys())
for ve... | from gensim import models
import time
start_time = time.perf_counter()
print('\nLoading vectors...\n')
w = models.KeyedVectors.load_word2vec_format('/home/ubuntu/sim/CBOW|skipgram.bin', binary=True)
relations = {'': [''],
'': [''],
'': ['']}
original_verbs = list(relations.keys())
for ve... | <commit_before>from gensim import models
import time
start_time = time.perf_counter()
print('\nLoading vectors...\n')
w = models.KeyedVectors.load_word2vec_format('/home/ubuntu/sim/CBOW|skipgram.bin', binary=True)
relations = {'': [''],
'': [''],
'': ['']}
original_verbs = list(relations.k... |
48edfcddca89c506107035bd804fa536d3dec84d | geotrek/signage/migrations/0013_auto_20200423_1255.py | geotrek/signage/migrations/0013_auto_20200423_1255.py | # Generated by Django 2.0.13 on 2020-04-23 12:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('signage', '0012_auto_20200406_1411'),
]
operations = [
migrations.RemoveField(
model_name='bla... | # Generated by Django 2.0.13 on 2020-04-23 12:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('signage', '0012_auto_20200406_1411'),
]
operations = [
migrations.RunSQL(sql=[("DELETE FROM geotrek.signag... | Remove element with deleted=true before removefield | Remove element with deleted=true before removefield
| Python | bsd-2-clause | makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek | # Generated by Django 2.0.13 on 2020-04-23 12:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('signage', '0012_auto_20200406_1411'),
]
operations = [
migrations.RemoveField(
model_name='bla... | # Generated by Django 2.0.13 on 2020-04-23 12:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('signage', '0012_auto_20200406_1411'),
]
operations = [
migrations.RunSQL(sql=[("DELETE FROM geotrek.signag... | <commit_before># Generated by Django 2.0.13 on 2020-04-23 12:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('signage', '0012_auto_20200406_1411'),
]
operations = [
migrations.RemoveField(
... | # Generated by Django 2.0.13 on 2020-04-23 12:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('signage', '0012_auto_20200406_1411'),
]
operations = [
migrations.RunSQL(sql=[("DELETE FROM geotrek.signag... | # Generated by Django 2.0.13 on 2020-04-23 12:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('signage', '0012_auto_20200406_1411'),
]
operations = [
migrations.RemoveField(
model_name='bla... | <commit_before># Generated by Django 2.0.13 on 2020-04-23 12:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('signage', '0012_auto_20200406_1411'),
]
operations = [
migrations.RemoveField(
... |
c8ce77037135259a4d1bc38bd7b136d6e517755e | acquisition/setup.py | acquisition/setup.py | from setuptools import setup, find_packages
dm3_url = 'git+https://[email protected]/cjh1/pydm3reader.git' \
'@filelike#egg=dm3_lib-1.2'
bottle_url = 'https://github.com/bottlepy/bottle/archive/41ed6965.zip' \
'#egg=bottle-0.13-dev'
setup(
name='tomviz-acquisition',
version='0.0.1',
description='... | from setuptools import setup, find_packages
dm3_url = 'git+https://[email protected]/cjh1/pydm3reader.git' \
'@filelike#egg=dm3_lib-1.2'
bottle_url = 'https://github.com/bottlepy/bottle/archive/41ed6965.zip' \
'#egg=bottle-0.13-dev'
setup(
name='tomviz-acquisition',
version='0.0.1',
description='... | Make the extra 'tiff' to be less confusing | Make the extra 'tiff' to be less confusing
It matches the new version of the documentation, and is how it is
normally spelled.
Signed-off-by: Marcus D. Hanwell <[email protected]>
| Python | bsd-3-clause | OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz | from setuptools import setup, find_packages
dm3_url = 'git+https://[email protected]/cjh1/pydm3reader.git' \
'@filelike#egg=dm3_lib-1.2'
bottle_url = 'https://github.com/bottlepy/bottle/archive/41ed6965.zip' \
'#egg=bottle-0.13-dev'
setup(
name='tomviz-acquisition',
version='0.0.1',
description='... | from setuptools import setup, find_packages
dm3_url = 'git+https://[email protected]/cjh1/pydm3reader.git' \
'@filelike#egg=dm3_lib-1.2'
bottle_url = 'https://github.com/bottlepy/bottle/archive/41ed6965.zip' \
'#egg=bottle-0.13-dev'
setup(
name='tomviz-acquisition',
version='0.0.1',
description='... | <commit_before>from setuptools import setup, find_packages
dm3_url = 'git+https://[email protected]/cjh1/pydm3reader.git' \
'@filelike#egg=dm3_lib-1.2'
bottle_url = 'https://github.com/bottlepy/bottle/archive/41ed6965.zip' \
'#egg=bottle-0.13-dev'
setup(
name='tomviz-acquisition',
version='0.0.1',
... | from setuptools import setup, find_packages
dm3_url = 'git+https://[email protected]/cjh1/pydm3reader.git' \
'@filelike#egg=dm3_lib-1.2'
bottle_url = 'https://github.com/bottlepy/bottle/archive/41ed6965.zip' \
'#egg=bottle-0.13-dev'
setup(
name='tomviz-acquisition',
version='0.0.1',
description='... | from setuptools import setup, find_packages
dm3_url = 'git+https://[email protected]/cjh1/pydm3reader.git' \
'@filelike#egg=dm3_lib-1.2'
bottle_url = 'https://github.com/bottlepy/bottle/archive/41ed6965.zip' \
'#egg=bottle-0.13-dev'
setup(
name='tomviz-acquisition',
version='0.0.1',
description='... | <commit_before>from setuptools import setup, find_packages
dm3_url = 'git+https://[email protected]/cjh1/pydm3reader.git' \
'@filelike#egg=dm3_lib-1.2'
bottle_url = 'https://github.com/bottlepy/bottle/archive/41ed6965.zip' \
'#egg=bottle-0.13-dev'
setup(
name='tomviz-acquisition',
version='0.0.1',
... |
84f6cc46e7ba7e2e3c046e957545687ce6802278 | cegui/src/ScriptingModules/PythonScriptModule/bindings/distutils/PyCEGUI/__init__.py | cegui/src/ScriptingModules/PythonScriptModule/bindings/distutils/PyCEGUI/__init__.py | import os
import os.path
# atrocious and unholy!
def get_my_path():
import fake
return os.path.dirname(str(fake).split()[3][1:])
libpath = os.path.abspath(get_my_path())
#print "libpath =", libpath
os.environ['PATH'] = libpath + ";" + os.environ['PATH']
from PyCEGUI import *
| import os
import os.path
# atrocious and unholy!
def get_my_path():
import fake
return os.path.dirname(os.path.abspath(fake.__file__))
libpath = get_my_path()
#print "libpath =", libpath
os.environ['PATH'] = libpath + ";" + os.environ['PATH']
from PyCEGUI import *
| Use a less pathetic method to retrieve the PyCEGUI dirname | MOD: Use a less pathetic method to retrieve the PyCEGUI dirname
| Python | mit | cbeck88/cegui-mirror-two,cbeck88/cegui-mirror-two,cbeck88/cegui-mirror-two,cbeck88/cegui-mirror-two,cbeck88/cegui-mirror-two | import os
import os.path
# atrocious and unholy!
def get_my_path():
import fake
return os.path.dirname(str(fake).split()[3][1:])
libpath = os.path.abspath(get_my_path())
#print "libpath =", libpath
os.environ['PATH'] = libpath + ";" + os.environ['PATH']
from PyCEGUI import *
MOD: Use a less pathetic method t... | import os
import os.path
# atrocious and unholy!
def get_my_path():
import fake
return os.path.dirname(os.path.abspath(fake.__file__))
libpath = get_my_path()
#print "libpath =", libpath
os.environ['PATH'] = libpath + ";" + os.environ['PATH']
from PyCEGUI import *
| <commit_before>import os
import os.path
# atrocious and unholy!
def get_my_path():
import fake
return os.path.dirname(str(fake).split()[3][1:])
libpath = os.path.abspath(get_my_path())
#print "libpath =", libpath
os.environ['PATH'] = libpath + ";" + os.environ['PATH']
from PyCEGUI import *
<commit_msg>MOD: U... | import os
import os.path
# atrocious and unholy!
def get_my_path():
import fake
return os.path.dirname(os.path.abspath(fake.__file__))
libpath = get_my_path()
#print "libpath =", libpath
os.environ['PATH'] = libpath + ";" + os.environ['PATH']
from PyCEGUI import *
| import os
import os.path
# atrocious and unholy!
def get_my_path():
import fake
return os.path.dirname(str(fake).split()[3][1:])
libpath = os.path.abspath(get_my_path())
#print "libpath =", libpath
os.environ['PATH'] = libpath + ";" + os.environ['PATH']
from PyCEGUI import *
MOD: Use a less pathetic method t... | <commit_before>import os
import os.path
# atrocious and unholy!
def get_my_path():
import fake
return os.path.dirname(str(fake).split()[3][1:])
libpath = os.path.abspath(get_my_path())
#print "libpath =", libpath
os.environ['PATH'] = libpath + ";" + os.environ['PATH']
from PyCEGUI import *
<commit_msg>MOD: U... |
082238e4d92d9bef64540c3fca1ac07c0e553a51 | inthe_am/taskmanager/models/bugwarriorconfigrunlog.py | inthe_am/taskmanager/models/bugwarriorconfigrunlog.py | from django.db import models
from .bugwarriorconfig import BugwarriorConfig
class BugwarriorConfigRunLog(models.Model):
config = models.ForeignKey(
BugwarriorConfig,
related_name='run_logs',
)
success = models.BooleanField(default=False)
output = models.TextField()
stack_trace = m... | from django.db import models
from .bugwarriorconfig import BugwarriorConfig
class BugwarriorConfigRunLog(models.Model):
config = models.ForeignKey(
BugwarriorConfig,
related_name='run_logs',
)
success = models.BooleanField(default=False)
output = models.TextField()
stack_trace = m... | Fix unicode handling in bugwarrior run log. | Fix unicode handling in bugwarrior run log.
| Python | agpl-3.0 | coddingtonbear/inthe.am,coddingtonbear/inthe.am,coddingtonbear/inthe.am,coddingtonbear/inthe.am,coddingtonbear/inthe.am | from django.db import models
from .bugwarriorconfig import BugwarriorConfig
class BugwarriorConfigRunLog(models.Model):
config = models.ForeignKey(
BugwarriorConfig,
related_name='run_logs',
)
success = models.BooleanField(default=False)
output = models.TextField()
stack_trace = m... | from django.db import models
from .bugwarriorconfig import BugwarriorConfig
class BugwarriorConfigRunLog(models.Model):
config = models.ForeignKey(
BugwarriorConfig,
related_name='run_logs',
)
success = models.BooleanField(default=False)
output = models.TextField()
stack_trace = m... | <commit_before>from django.db import models
from .bugwarriorconfig import BugwarriorConfig
class BugwarriorConfigRunLog(models.Model):
config = models.ForeignKey(
BugwarriorConfig,
related_name='run_logs',
)
success = models.BooleanField(default=False)
output = models.TextField()
... | from django.db import models
from .bugwarriorconfig import BugwarriorConfig
class BugwarriorConfigRunLog(models.Model):
config = models.ForeignKey(
BugwarriorConfig,
related_name='run_logs',
)
success = models.BooleanField(default=False)
output = models.TextField()
stack_trace = m... | from django.db import models
from .bugwarriorconfig import BugwarriorConfig
class BugwarriorConfigRunLog(models.Model):
config = models.ForeignKey(
BugwarriorConfig,
related_name='run_logs',
)
success = models.BooleanField(default=False)
output = models.TextField()
stack_trace = m... | <commit_before>from django.db import models
from .bugwarriorconfig import BugwarriorConfig
class BugwarriorConfigRunLog(models.Model):
config = models.ForeignKey(
BugwarriorConfig,
related_name='run_logs',
)
success = models.BooleanField(default=False)
output = models.TextField()
... |
e9b7c19a7080bd9e9a88f0e2eb53a662ee5b154b | tests/python/verify_image.py | tests/python/verify_image.py | import unittest
import os
from selenium import webdriver
from time import sleep
class TestClaimsLogin(unittest.TestCase):
def setUp(self):
self.driver = webdriver.PhantomJS()
self.ip = os.environ.get('DOCKER_IP', '172.17.0.1')
def test_verify_main_screen_loaded(self):
self.driver.get(... | import unittest
import os
from selenium import webdriver
from time import sleep
class TestClaimsLogin(unittest.TestCase):
def setUp(self):
self.driver = webdriver.PhantomJS()
self.ip = os.environ.get('DOCKER_IP', '172.17.0.1')
def test_verify_main_screen_loaded(self):
self.driver.get(... | Change self.assertIn to self.assertTrue('Hello Implementer' in greeting.txt) | Change self.assertIn to self.assertTrue('Hello Implementer' in greeting.txt)
| Python | mit | censof/ansible-deployment,censof/ansible-deployment,censof/ansible-deployment | import unittest
import os
from selenium import webdriver
from time import sleep
class TestClaimsLogin(unittest.TestCase):
def setUp(self):
self.driver = webdriver.PhantomJS()
self.ip = os.environ.get('DOCKER_IP', '172.17.0.1')
def test_verify_main_screen_loaded(self):
self.driver.get(... | import unittest
import os
from selenium import webdriver
from time import sleep
class TestClaimsLogin(unittest.TestCase):
def setUp(self):
self.driver = webdriver.PhantomJS()
self.ip = os.environ.get('DOCKER_IP', '172.17.0.1')
def test_verify_main_screen_loaded(self):
self.driver.get(... | <commit_before>import unittest
import os
from selenium import webdriver
from time import sleep
class TestClaimsLogin(unittest.TestCase):
def setUp(self):
self.driver = webdriver.PhantomJS()
self.ip = os.environ.get('DOCKER_IP', '172.17.0.1')
def test_verify_main_screen_loaded(self):
s... | import unittest
import os
from selenium import webdriver
from time import sleep
class TestClaimsLogin(unittest.TestCase):
def setUp(self):
self.driver = webdriver.PhantomJS()
self.ip = os.environ.get('DOCKER_IP', '172.17.0.1')
def test_verify_main_screen_loaded(self):
self.driver.get(... | import unittest
import os
from selenium import webdriver
from time import sleep
class TestClaimsLogin(unittest.TestCase):
def setUp(self):
self.driver = webdriver.PhantomJS()
self.ip = os.environ.get('DOCKER_IP', '172.17.0.1')
def test_verify_main_screen_loaded(self):
self.driver.get(... | <commit_before>import unittest
import os
from selenium import webdriver
from time import sleep
class TestClaimsLogin(unittest.TestCase):
def setUp(self):
self.driver = webdriver.PhantomJS()
self.ip = os.environ.get('DOCKER_IP', '172.17.0.1')
def test_verify_main_screen_loaded(self):
s... |
dce91e460421ef9416f5ca98a5850c23a0cbf7c0 | akaudit/userinput.py | akaudit/userinput.py | def yesno(prompt='? '):
# raw_input returns the empty string for "enter"
yes = set(['yes','y', 'ye', ''])
no = set(['no','n'])
choice = input(prompt).lower()
if choice in yes:
return True
elif choice in no:
return False
else:
sys.stdout.write("Please respond with 'yes' or 'no'")
| from six.moves import input
def yesno(prompt='? '):
# raw_input returns the empty string for "enter"
yes = set(['yes','y', 'ye', ''])
no = set(['no','n'])
choice = input(prompt).lower()
if choice in yes:
return True
elif choice in no:
return False
else:
sys.stdout.write("Please respond with 'yes' or 'no'... | Support input() on python 2. | Support input() on python 2.
| Python | apache-2.0 | flaccid/akaudit | def yesno(prompt='? '):
# raw_input returns the empty string for "enter"
yes = set(['yes','y', 'ye', ''])
no = set(['no','n'])
choice = input(prompt).lower()
if choice in yes:
return True
elif choice in no:
return False
else:
sys.stdout.write("Please respond with 'yes' or 'no'")
Support input() on python ... | from six.moves import input
def yesno(prompt='? '):
# raw_input returns the empty string for "enter"
yes = set(['yes','y', 'ye', ''])
no = set(['no','n'])
choice = input(prompt).lower()
if choice in yes:
return True
elif choice in no:
return False
else:
sys.stdout.write("Please respond with 'yes' or 'no'... | <commit_before>def yesno(prompt='? '):
# raw_input returns the empty string for "enter"
yes = set(['yes','y', 'ye', ''])
no = set(['no','n'])
choice = input(prompt).lower()
if choice in yes:
return True
elif choice in no:
return False
else:
sys.stdout.write("Please respond with 'yes' or 'no'")
<commit_msg... | from six.moves import input
def yesno(prompt='? '):
# raw_input returns the empty string for "enter"
yes = set(['yes','y', 'ye', ''])
no = set(['no','n'])
choice = input(prompt).lower()
if choice in yes:
return True
elif choice in no:
return False
else:
sys.stdout.write("Please respond with 'yes' or 'no'... | def yesno(prompt='? '):
# raw_input returns the empty string for "enter"
yes = set(['yes','y', 'ye', ''])
no = set(['no','n'])
choice = input(prompt).lower()
if choice in yes:
return True
elif choice in no:
return False
else:
sys.stdout.write("Please respond with 'yes' or 'no'")
Support input() on python ... | <commit_before>def yesno(prompt='? '):
# raw_input returns the empty string for "enter"
yes = set(['yes','y', 'ye', ''])
no = set(['no','n'])
choice = input(prompt).lower()
if choice in yes:
return True
elif choice in no:
return False
else:
sys.stdout.write("Please respond with 'yes' or 'no'")
<commit_msg... |
5317a0370e6c2880cd66f78cc6e49d5fe48079fb | corehq/ex-submodules/casexml/apps/phone/const.py | corehq/ex-submodules/casexml/apps/phone/const.py | # how long a cached payload sits around for (in seconds).
INITIAL_SYNC_CACHE_TIMEOUT = 60 * 60 # 1 hour
# the threshold for setting a cached payload on initial sync (in seconds).
# restores that take less than this time will not be cached to allow
# for rapid iteration on fixtures/cases/etc.
INITIAL_SYNC_CACHE_THRESH... | # how long a cached payload sits around for (in seconds).
INITIAL_SYNC_CACHE_TIMEOUT = 60 * 60 # 1 hour
# the threshold for setting a cached payload on initial sync (in seconds).
# restores that take less than this time will not be cached to allow
# for rapid iteration on fixtures/cases/etc.
INITIAL_SYNC_CACHE_THRESH... | Update async restore cache key | Update async restore cache key
| Python | bsd-3-clause | qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq | # how long a cached payload sits around for (in seconds).
INITIAL_SYNC_CACHE_TIMEOUT = 60 * 60 # 1 hour
# the threshold for setting a cached payload on initial sync (in seconds).
# restores that take less than this time will not be cached to allow
# for rapid iteration on fixtures/cases/etc.
INITIAL_SYNC_CACHE_THRESH... | # how long a cached payload sits around for (in seconds).
INITIAL_SYNC_CACHE_TIMEOUT = 60 * 60 # 1 hour
# the threshold for setting a cached payload on initial sync (in seconds).
# restores that take less than this time will not be cached to allow
# for rapid iteration on fixtures/cases/etc.
INITIAL_SYNC_CACHE_THRESH... | <commit_before># how long a cached payload sits around for (in seconds).
INITIAL_SYNC_CACHE_TIMEOUT = 60 * 60 # 1 hour
# the threshold for setting a cached payload on initial sync (in seconds).
# restores that take less than this time will not be cached to allow
# for rapid iteration on fixtures/cases/etc.
INITIAL_SY... | # how long a cached payload sits around for (in seconds).
INITIAL_SYNC_CACHE_TIMEOUT = 60 * 60 # 1 hour
# the threshold for setting a cached payload on initial sync (in seconds).
# restores that take less than this time will not be cached to allow
# for rapid iteration on fixtures/cases/etc.
INITIAL_SYNC_CACHE_THRESH... | # how long a cached payload sits around for (in seconds).
INITIAL_SYNC_CACHE_TIMEOUT = 60 * 60 # 1 hour
# the threshold for setting a cached payload on initial sync (in seconds).
# restores that take less than this time will not be cached to allow
# for rapid iteration on fixtures/cases/etc.
INITIAL_SYNC_CACHE_THRESH... | <commit_before># how long a cached payload sits around for (in seconds).
INITIAL_SYNC_CACHE_TIMEOUT = 60 * 60 # 1 hour
# the threshold for setting a cached payload on initial sync (in seconds).
# restores that take less than this time will not be cached to allow
# for rapid iteration on fixtures/cases/etc.
INITIAL_SY... |
372edf44efd7e028890e4623a950052a606bb123 | shade/tests/functional/util.py | shade/tests/functional/util.py | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | Enable running tests against RAX and IBM | Enable running tests against RAX and IBM
Rackspace requires performance flavors be used for boot from volume. IBM
does not have Ubuntu or Cirros images in the cloud.
Change-Id: I95c15d92072311eb4aa0a4b7f551a95c4dc6e082
| Python | apache-2.0 | dtroyer/python-openstacksdk,openstack/python-openstacksdk,stackforge/python-openstacksdk,openstack-infra/shade,dtroyer/python-openstacksdk,openstack-infra/shade,stackforge/python-openstacksdk,openstack/python-openstacksdk | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | <commit_before># -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | <commit_before># -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
e208b4429fa69e6c192a036a94660d8b55028676 | typ/tests/arg_parser_test.py | typ/tests/arg_parser_test.py | # Copyright 2014 Dirk Pranke. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2014 Dirk Pranke. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Fix ArgumentParserTest.test_argv_from_args to be more portable. | Fix ArgumentParserTest.test_argv_from_args to be more portable.
One of the tests was testing --jobs 4, but on a machine w/
4 CPUs, that would get reduced to the default. This patch
changes things to test --jobs 3, which is less likely to be
seen in the wild.
| Python | apache-2.0 | dpranke/typ | # Copyright 2014 Dirk Pranke. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2014 Dirk Pranke. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | <commit_before># Copyright 2014 Dirk Pranke. 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 appl... | # Copyright 2014 Dirk Pranke. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2014 Dirk Pranke. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | <commit_before># Copyright 2014 Dirk Pranke. 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 appl... |
aeb9b1abb8b3bf4ebcd2e019b724446bad72190d | dbsettings/management.py | dbsettings/management.py | from django.db.models.signals import post_migrate
def mk_permissions(permissions, appname, verbosity):
"""
Make permission at app level - hack with empty ContentType.
Adapted code from http://djangosnippets.org/snippets/334/
"""
from django.contrib.auth.models import Permission
from django.co... | from django.db.models.signals import post_migrate
def mk_permissions(permissions, appname, verbosity):
"""
Make permission at app level - hack with empty ContentType.
Adapted code from http://djangosnippets.org/snippets/334/
"""
from django.contrib.auth.models import Permission
from django.co... | Change __name__ for label (Django 1.9) | Change __name__ for label (Django 1.9)
| Python | bsd-3-clause | zlorf/django-dbsettings,helber/django-dbsettings,DjangoAdminHackers/django-dbsettings,zlorf/django-dbsettings,sciyoshi/django-dbsettings,helber/django-dbsettings,DjangoAdminHackers/django-dbsettings,sciyoshi/django-dbsettings | from django.db.models.signals import post_migrate
def mk_permissions(permissions, appname, verbosity):
"""
Make permission at app level - hack with empty ContentType.
Adapted code from http://djangosnippets.org/snippets/334/
"""
from django.contrib.auth.models import Permission
from django.co... | from django.db.models.signals import post_migrate
def mk_permissions(permissions, appname, verbosity):
"""
Make permission at app level - hack with empty ContentType.
Adapted code from http://djangosnippets.org/snippets/334/
"""
from django.contrib.auth.models import Permission
from django.co... | <commit_before>from django.db.models.signals import post_migrate
def mk_permissions(permissions, appname, verbosity):
"""
Make permission at app level - hack with empty ContentType.
Adapted code from http://djangosnippets.org/snippets/334/
"""
from django.contrib.auth.models import Permission
... | from django.db.models.signals import post_migrate
def mk_permissions(permissions, appname, verbosity):
"""
Make permission at app level - hack with empty ContentType.
Adapted code from http://djangosnippets.org/snippets/334/
"""
from django.contrib.auth.models import Permission
from django.co... | from django.db.models.signals import post_migrate
def mk_permissions(permissions, appname, verbosity):
"""
Make permission at app level - hack with empty ContentType.
Adapted code from http://djangosnippets.org/snippets/334/
"""
from django.contrib.auth.models import Permission
from django.co... | <commit_before>from django.db.models.signals import post_migrate
def mk_permissions(permissions, appname, verbosity):
"""
Make permission at app level - hack with empty ContentType.
Adapted code from http://djangosnippets.org/snippets/334/
"""
from django.contrib.auth.models import Permission
... |
e03aae99999f48a8d7ef8012f5b3718d1523224e | cla_backend/apps/cla_eventlog/management/commands/find_and_delete_old_cases.py | cla_backend/apps/cla_eventlog/management/commands/find_and_delete_old_cases.py | import sys
from django.core.management.base import BaseCommand
from dateutil.relativedelta import relativedelta
from legalaid.models import Case
from cla_butler.tasks import DeleteOldData
class FindAndDeleteCasesUsingCreationTime(DeleteOldData):
def get_eligible_cases(self):
two_years = self.now - relati... | import sys
from django.core.management.base import BaseCommand
from dateutil.relativedelta import relativedelta
from legalaid.models import Case
from cla_butler.tasks import DeleteOldData
class FindAndDeleteCasesUsingCreationTime(DeleteOldData):
def get_eligible_cases(self):
two_years = self.now - relati... | Refactor command to accept input or no input on delete | Refactor command to accept input or no input on delete | Python | mit | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | import sys
from django.core.management.base import BaseCommand
from dateutil.relativedelta import relativedelta
from legalaid.models import Case
from cla_butler.tasks import DeleteOldData
class FindAndDeleteCasesUsingCreationTime(DeleteOldData):
def get_eligible_cases(self):
two_years = self.now - relati... | import sys
from django.core.management.base import BaseCommand
from dateutil.relativedelta import relativedelta
from legalaid.models import Case
from cla_butler.tasks import DeleteOldData
class FindAndDeleteCasesUsingCreationTime(DeleteOldData):
def get_eligible_cases(self):
two_years = self.now - relati... | <commit_before>import sys
from django.core.management.base import BaseCommand
from dateutil.relativedelta import relativedelta
from legalaid.models import Case
from cla_butler.tasks import DeleteOldData
class FindAndDeleteCasesUsingCreationTime(DeleteOldData):
def get_eligible_cases(self):
two_years = se... | import sys
from django.core.management.base import BaseCommand
from dateutil.relativedelta import relativedelta
from legalaid.models import Case
from cla_butler.tasks import DeleteOldData
class FindAndDeleteCasesUsingCreationTime(DeleteOldData):
def get_eligible_cases(self):
two_years = self.now - relati... | import sys
from django.core.management.base import BaseCommand
from dateutil.relativedelta import relativedelta
from legalaid.models import Case
from cla_butler.tasks import DeleteOldData
class FindAndDeleteCasesUsingCreationTime(DeleteOldData):
def get_eligible_cases(self):
two_years = self.now - relati... | <commit_before>import sys
from django.core.management.base import BaseCommand
from dateutil.relativedelta import relativedelta
from legalaid.models import Case
from cla_butler.tasks import DeleteOldData
class FindAndDeleteCasesUsingCreationTime(DeleteOldData):
def get_eligible_cases(self):
two_years = se... |
8bf1e479f1dd8423613d6eb0f5c78dd78fdc9c67 | troposphere/sns.py | troposphere/sns.py | # Copyright (c) 2012-2013, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
class Subscription(AWSProperty):
props = {
'Endpoint': (basestring, True),
'Protocol': (basestring, True),
}
class TopicPolicy(AWSObject):
... | # Copyright (c) 2012-2013, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
class Subscription(AWSProperty):
props = {
'Endpoint': (basestring, True),
'Protocol': (basestring, True),
}
class TopicPolicy(AWSObject):
... | Validate the Subscription policy is made up of Subscription objects | Validate the Subscription policy is made up of Subscription objects
| Python | bsd-2-clause | wangqiang8511/troposphere,7digital/troposphere,pas256/troposphere,Hons/troposphere,WeAreCloudar/troposphere,johnctitus/troposphere,nicolaka/troposphere,LouTheBrew/troposphere,yxd-hde/troposphere,jantman/troposphere,alonsodomin/troposphere,micahhausler/troposphere,inetCatapult/troposphere,garnaat/troposphere,cloudtools/... | # Copyright (c) 2012-2013, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
class Subscription(AWSProperty):
props = {
'Endpoint': (basestring, True),
'Protocol': (basestring, True),
}
class TopicPolicy(AWSObject):
... | # Copyright (c) 2012-2013, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
class Subscription(AWSProperty):
props = {
'Endpoint': (basestring, True),
'Protocol': (basestring, True),
}
class TopicPolicy(AWSObject):
... | <commit_before># Copyright (c) 2012-2013, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
class Subscription(AWSProperty):
props = {
'Endpoint': (basestring, True),
'Protocol': (basestring, True),
}
class TopicPoli... | # Copyright (c) 2012-2013, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
class Subscription(AWSProperty):
props = {
'Endpoint': (basestring, True),
'Protocol': (basestring, True),
}
class TopicPolicy(AWSObject):
... | # Copyright (c) 2012-2013, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
class Subscription(AWSProperty):
props = {
'Endpoint': (basestring, True),
'Protocol': (basestring, True),
}
class TopicPolicy(AWSObject):
... | <commit_before># Copyright (c) 2012-2013, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
class Subscription(AWSProperty):
props = {
'Endpoint': (basestring, True),
'Protocol': (basestring, True),
}
class TopicPoli... |
ceed67d1e3dbe831d5301406d15eec583d85825f | blueplayer/__main__.py | blueplayer/__main__.py | import sys
import serial
from blueplayer import blueplayer
def main(args):
# first argument should be a serial terminal to open
if not len(args):
port = "/dev/ttyAMA0"
else:
port = args[0]
player = None
with serial.Serial(port) as serial_port:
try:
player = bl... | import sys
import serial
from blueplayer import blueplayer
def main():
args = sys.argv[1:]
# first argument should be a serial terminal to open
if not len(args):
port = "/dev/ttyAMA0"
else:
port = args[0]
player = None
with serial.Serial(port) as serial_port:
try:
... | Fix args in entry point | Fix args in entry point
| Python | mit | dylwhich/rpi-ipod-emulator | import sys
import serial
from blueplayer import blueplayer
def main(args):
# first argument should be a serial terminal to open
if not len(args):
port = "/dev/ttyAMA0"
else:
port = args[0]
player = None
with serial.Serial(port) as serial_port:
try:
player = bl... | import sys
import serial
from blueplayer import blueplayer
def main():
args = sys.argv[1:]
# first argument should be a serial terminal to open
if not len(args):
port = "/dev/ttyAMA0"
else:
port = args[0]
player = None
with serial.Serial(port) as serial_port:
try:
... | <commit_before>import sys
import serial
from blueplayer import blueplayer
def main(args):
# first argument should be a serial terminal to open
if not len(args):
port = "/dev/ttyAMA0"
else:
port = args[0]
player = None
with serial.Serial(port) as serial_port:
try:
... | import sys
import serial
from blueplayer import blueplayer
def main():
args = sys.argv[1:]
# first argument should be a serial terminal to open
if not len(args):
port = "/dev/ttyAMA0"
else:
port = args[0]
player = None
with serial.Serial(port) as serial_port:
try:
... | import sys
import serial
from blueplayer import blueplayer
def main(args):
# first argument should be a serial terminal to open
if not len(args):
port = "/dev/ttyAMA0"
else:
port = args[0]
player = None
with serial.Serial(port) as serial_port:
try:
player = bl... | <commit_before>import sys
import serial
from blueplayer import blueplayer
def main(args):
# first argument should be a serial terminal to open
if not len(args):
port = "/dev/ttyAMA0"
else:
port = args[0]
player = None
with serial.Serial(port) as serial_port:
try:
... |
67ebd0a80ec51e29dd176c8375c92e7cebf9b686 | dmoj/executors/KOTLIN.py | dmoj/executors/KOTLIN.py | import os.path
from dmoj.executors.java_executor import JavaExecutor
with open(os.path.join(os.path.dirname(__file__), 'java-security.policy')) as policy_file:
policy = policy_file.read()
class Executor(JavaExecutor):
name = 'KOTLIN'
ext = '.kt'
compiler = 'kotlinc'
vm = 'kotlin_vm'
securit... | import os.path
from dmoj.executors.java_executor import JavaExecutor
with open(os.path.join(os.path.dirname(__file__), 'java-security.policy')) as policy_file:
policy = policy_file.read()
class Executor(JavaExecutor):
name = 'KOTLIN'
ext = '.kt'
compiler = 'kotlinc'
compiler_time_limit = 20
... | Raise Kotlin compiler time limit to 20s | Raise Kotlin compiler time limit to 20s | Python | agpl-3.0 | DMOJ/judge,DMOJ/judge,DMOJ/judge | import os.path
from dmoj.executors.java_executor import JavaExecutor
with open(os.path.join(os.path.dirname(__file__), 'java-security.policy')) as policy_file:
policy = policy_file.read()
class Executor(JavaExecutor):
name = 'KOTLIN'
ext = '.kt'
compiler = 'kotlinc'
vm = 'kotlin_vm'
securit... | import os.path
from dmoj.executors.java_executor import JavaExecutor
with open(os.path.join(os.path.dirname(__file__), 'java-security.policy')) as policy_file:
policy = policy_file.read()
class Executor(JavaExecutor):
name = 'KOTLIN'
ext = '.kt'
compiler = 'kotlinc'
compiler_time_limit = 20
... | <commit_before>import os.path
from dmoj.executors.java_executor import JavaExecutor
with open(os.path.join(os.path.dirname(__file__), 'java-security.policy')) as policy_file:
policy = policy_file.read()
class Executor(JavaExecutor):
name = 'KOTLIN'
ext = '.kt'
compiler = 'kotlinc'
vm = 'kotlin_... | import os.path
from dmoj.executors.java_executor import JavaExecutor
with open(os.path.join(os.path.dirname(__file__), 'java-security.policy')) as policy_file:
policy = policy_file.read()
class Executor(JavaExecutor):
name = 'KOTLIN'
ext = '.kt'
compiler = 'kotlinc'
compiler_time_limit = 20
... | import os.path
from dmoj.executors.java_executor import JavaExecutor
with open(os.path.join(os.path.dirname(__file__), 'java-security.policy')) as policy_file:
policy = policy_file.read()
class Executor(JavaExecutor):
name = 'KOTLIN'
ext = '.kt'
compiler = 'kotlinc'
vm = 'kotlin_vm'
securit... | <commit_before>import os.path
from dmoj.executors.java_executor import JavaExecutor
with open(os.path.join(os.path.dirname(__file__), 'java-security.policy')) as policy_file:
policy = policy_file.read()
class Executor(JavaExecutor):
name = 'KOTLIN'
ext = '.kt'
compiler = 'kotlinc'
vm = 'kotlin_... |
e582a8632409cdf5625b51978e742ca9282c3d6f | show_vmbstereocamera.py | show_vmbstereocamera.py | #! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Show the images from two Allied Vision cameras
#
#
# External dependencies
#
import sys
from PySide import QtGui
import VisionToolkit as vt
#
# Main application
#
if __name__ == '__main__' :
application = QtGui.QApplication( sys.argv )
widget = vt.VmbStereoCame... | #! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Show the images from two Allied Vision cameras
#
#
# External dependencies
#
import sys
import cv2
import numpy as np
#from PySide import QtGui
import VisionToolkit as vt
#
# Image callback function
#
def Callback( frame_left, frame_right ) :
# Put images side by... | Add OpenCV display for debug. | Add OpenCV display for debug.
| Python | mit | microy/PyStereoVisionToolkit,microy/VisionToolkit,microy/StereoVision,microy/VisionToolkit,microy/StereoVision,microy/PyStereoVisionToolkit | #! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Show the images from two Allied Vision cameras
#
#
# External dependencies
#
import sys
from PySide import QtGui
import VisionToolkit as vt
#
# Main application
#
if __name__ == '__main__' :
application = QtGui.QApplication( sys.argv )
widget = vt.VmbStereoCame... | #! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Show the images from two Allied Vision cameras
#
#
# External dependencies
#
import sys
import cv2
import numpy as np
#from PySide import QtGui
import VisionToolkit as vt
#
# Image callback function
#
def Callback( frame_left, frame_right ) :
# Put images side by... | <commit_before>#! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Show the images from two Allied Vision cameras
#
#
# External dependencies
#
import sys
from PySide import QtGui
import VisionToolkit as vt
#
# Main application
#
if __name__ == '__main__' :
application = QtGui.QApplication( sys.argv )
widget = v... | #! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Show the images from two Allied Vision cameras
#
#
# External dependencies
#
import sys
import cv2
import numpy as np
#from PySide import QtGui
import VisionToolkit as vt
#
# Image callback function
#
def Callback( frame_left, frame_right ) :
# Put images side by... | #! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Show the images from two Allied Vision cameras
#
#
# External dependencies
#
import sys
from PySide import QtGui
import VisionToolkit as vt
#
# Main application
#
if __name__ == '__main__' :
application = QtGui.QApplication( sys.argv )
widget = vt.VmbStereoCame... | <commit_before>#! /usr/bin/env python
# -*- coding:utf-8 -*-
#
# Show the images from two Allied Vision cameras
#
#
# External dependencies
#
import sys
from PySide import QtGui
import VisionToolkit as vt
#
# Main application
#
if __name__ == '__main__' :
application = QtGui.QApplication( sys.argv )
widget = v... |
4a3779602161cc0f9e955eba526508a70b98963d | byteaccess/__init__.py | byteaccess/__init__.py | from byteaccess.byteaccess import ByteAccess, access_over_file
from byteaccess.winmemaccess import access_over_process
| from byteaccess.byteaccess import ByteAccess, access_over_file
from byteaccess.winmemaccess import access_over_process
__version__ = 'TODO: Figure out Python 3 version conventions'
| Add version placeholder for now | Add version placeholder for now
| Python | bsd-2-clause | ChadSki/halolib | from byteaccess.byteaccess import ByteAccess, access_over_file
from byteaccess.winmemaccess import access_over_process
Add version placeholder for now | from byteaccess.byteaccess import ByteAccess, access_over_file
from byteaccess.winmemaccess import access_over_process
__version__ = 'TODO: Figure out Python 3 version conventions'
| <commit_before>from byteaccess.byteaccess import ByteAccess, access_over_file
from byteaccess.winmemaccess import access_over_process
<commit_msg>Add version placeholder for now<commit_after> | from byteaccess.byteaccess import ByteAccess, access_over_file
from byteaccess.winmemaccess import access_over_process
__version__ = 'TODO: Figure out Python 3 version conventions'
| from byteaccess.byteaccess import ByteAccess, access_over_file
from byteaccess.winmemaccess import access_over_process
Add version placeholder for nowfrom byteaccess.byteaccess import ByteAccess, access_over_file
from byteaccess.winmemaccess import access_over_process
__version__ = 'TODO: Figure out Python 3 version c... | <commit_before>from byteaccess.byteaccess import ByteAccess, access_over_file
from byteaccess.winmemaccess import access_over_process
<commit_msg>Add version placeholder for now<commit_after>from byteaccess.byteaccess import ByteAccess, access_over_file
from byteaccess.winmemaccess import access_over_process
__version... |
aa19102b6679a19adb8eb7146742aaf357ad28ef | stagecraft/tools/txex-migration.py | stagecraft/tools/txex-migration.py | #!/usr/bin/env python
import os
import sys
try:
username = os.environ['GOOGLE_USERNAME']
password = os.environ['GOOGLE_PASSWORD']
except KeyError:
print("Please supply username (GOOGLE_USERNAME)"
"and password (GOOGLE_PASSWORD) as environment variables")
sys.exit(1)
from spreadsheets import... | #!/usr/bin/env python
import os
import sys
try:
username = os.environ['GOOGLE_USERNAME']
password = os.environ['GOOGLE_PASSWORD']
except KeyError:
print("Please supply username (GOOGLE_USERNAME)"
"and password (GOOGLE_PASSWORD) as environment variables")
sys.exit(1)
column_positions = {
... | Use new configureable spreadsheet loader in script. | Use new configureable spreadsheet loader in script.
These are the correct positions currently.
| Python | mit | alphagov/stagecraft,alphagov/stagecraft,alphagov/stagecraft,alphagov/stagecraft | #!/usr/bin/env python
import os
import sys
try:
username = os.environ['GOOGLE_USERNAME']
password = os.environ['GOOGLE_PASSWORD']
except KeyError:
print("Please supply username (GOOGLE_USERNAME)"
"and password (GOOGLE_PASSWORD) as environment variables")
sys.exit(1)
from spreadsheets import... | #!/usr/bin/env python
import os
import sys
try:
username = os.environ['GOOGLE_USERNAME']
password = os.environ['GOOGLE_PASSWORD']
except KeyError:
print("Please supply username (GOOGLE_USERNAME)"
"and password (GOOGLE_PASSWORD) as environment variables")
sys.exit(1)
column_positions = {
... | <commit_before>#!/usr/bin/env python
import os
import sys
try:
username = os.environ['GOOGLE_USERNAME']
password = os.environ['GOOGLE_PASSWORD']
except KeyError:
print("Please supply username (GOOGLE_USERNAME)"
"and password (GOOGLE_PASSWORD) as environment variables")
sys.exit(1)
from spre... | #!/usr/bin/env python
import os
import sys
try:
username = os.environ['GOOGLE_USERNAME']
password = os.environ['GOOGLE_PASSWORD']
except KeyError:
print("Please supply username (GOOGLE_USERNAME)"
"and password (GOOGLE_PASSWORD) as environment variables")
sys.exit(1)
column_positions = {
... | #!/usr/bin/env python
import os
import sys
try:
username = os.environ['GOOGLE_USERNAME']
password = os.environ['GOOGLE_PASSWORD']
except KeyError:
print("Please supply username (GOOGLE_USERNAME)"
"and password (GOOGLE_PASSWORD) as environment variables")
sys.exit(1)
from spreadsheets import... | <commit_before>#!/usr/bin/env python
import os
import sys
try:
username = os.environ['GOOGLE_USERNAME']
password = os.environ['GOOGLE_PASSWORD']
except KeyError:
print("Please supply username (GOOGLE_USERNAME)"
"and password (GOOGLE_PASSWORD) as environment variables")
sys.exit(1)
from spre... |
001d13cc0b958cb97fdcc84d6c07e8ba9d0568b6 | ceilometer/__init__.py | ceilometer/__init__.py | # Copyright 2014 eNovance
#
# Authors: Julien Danjou <[email protected]>
#
# 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 requir... | # Copyright 2014 eNovance
#
# Authors: Julien Danjou <[email protected]>
#
# 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 requir... | Disable eventlet monkey-patching of DNS | Disable eventlet monkey-patching of DNS
This change avoids eventlet's monkey-patching of DNS
resolution. eventlet's doesn't support IPv6, for example.
A similar change was made in nova, so this is just copying
that code and technique to ceilometer.
Fixes bug #1404886 bug #1325399
Change-Id: I06391fb5f651dbd430a6fb75b0... | Python | apache-2.0 | sileht/aodh,ityaptin/ceilometer,mathslinux/ceilometer,cernops/ceilometer,Juniper/ceilometer,idegtiarov/ceilometer,Juniper/ceilometer,openstack/ceilometer,pkilambi/ceilometer,mathslinux/ceilometer,pczerkas/aodh,eayunstack/ceilometer,pczerkas/aodh,fabian4/ceilometer,cernops/ceilometer,maestro-hybrid-cloud/ceilometer,redh... | # Copyright 2014 eNovance
#
# Authors: Julien Danjou <[email protected]>
#
# 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 requir... | # Copyright 2014 eNovance
#
# Authors: Julien Danjou <[email protected]>
#
# 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 requir... | <commit_before># Copyright 2014 eNovance
#
# Authors: Julien Danjou <[email protected]>
#
# 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
#
... | # Copyright 2014 eNovance
#
# Authors: Julien Danjou <[email protected]>
#
# 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 requir... | # Copyright 2014 eNovance
#
# Authors: Julien Danjou <[email protected]>
#
# 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 requir... | <commit_before># Copyright 2014 eNovance
#
# Authors: Julien Danjou <[email protected]>
#
# 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
#
... |
5ebcb9a666f03439bb075ac5961d2230ea649371 | dockci/api/exceptions.py | dockci/api/exceptions.py | """ Exceptions relating to API issues """
from werkzeug.exceptions import HTTPException
class BaseActionException(HTTPException):
""" An HTTP exception for when an action can't be performed """
response = None
def __init__(self, action=None):
super(BaseActionException, self).__init__()
if... | """ Exceptions relating to API issues """
from werkzeug.exceptions import HTTPException
class BaseActionExceptionMixin(HTTPException):
""" An HTTP exception for when an action can't be performed """
response = None
def __init__(self, action=None):
super(BaseActionExceptionMixin, self).__init__()
... | Make BaseActionException mixin for pylint | Make BaseActionException mixin for pylint
| Python | isc | RickyCook/DockCI,sprucedev/DockCI,sprucedev/DockCI-Agent,sprucedev/DockCI,sprucedev/DockCI,sprucedev/DockCI,RickyCook/DockCI,RickyCook/DockCI,RickyCook/DockCI,sprucedev/DockCI-Agent | """ Exceptions relating to API issues """
from werkzeug.exceptions import HTTPException
class BaseActionException(HTTPException):
""" An HTTP exception for when an action can't be performed """
response = None
def __init__(self, action=None):
super(BaseActionException, self).__init__()
if... | """ Exceptions relating to API issues """
from werkzeug.exceptions import HTTPException
class BaseActionExceptionMixin(HTTPException):
""" An HTTP exception for when an action can't be performed """
response = None
def __init__(self, action=None):
super(BaseActionExceptionMixin, self).__init__()
... | <commit_before>""" Exceptions relating to API issues """
from werkzeug.exceptions import HTTPException
class BaseActionException(HTTPException):
""" An HTTP exception for when an action can't be performed """
response = None
def __init__(self, action=None):
super(BaseActionException, self).__init... | """ Exceptions relating to API issues """
from werkzeug.exceptions import HTTPException
class BaseActionExceptionMixin(HTTPException):
""" An HTTP exception for when an action can't be performed """
response = None
def __init__(self, action=None):
super(BaseActionExceptionMixin, self).__init__()
... | """ Exceptions relating to API issues """
from werkzeug.exceptions import HTTPException
class BaseActionException(HTTPException):
""" An HTTP exception for when an action can't be performed """
response = None
def __init__(self, action=None):
super(BaseActionException, self).__init__()
if... | <commit_before>""" Exceptions relating to API issues """
from werkzeug.exceptions import HTTPException
class BaseActionException(HTTPException):
""" An HTTP exception for when an action can't be performed """
response = None
def __init__(self, action=None):
super(BaseActionException, self).__init... |
c5eb64cda6972df0e96a9f3dc9e776386ef50a78 | examples/hello_world.py | examples/hello_world.py | #!/usr/bin/env python3
from __future__ import print_function
import os
from binascii import hexlify
import cantools
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
MOTOHAWK_PATH = os.path.join(SCRIPT_DIR,
'..',
'tests',
'... | #!/usr/bin/env python3
#
# > python3 hello_world.py
# Message: {'Temperature': 250.1, 'AverageRadius': 3.2, 'Enable': 'Enabled'}
# Encoded: c001400000000000
# Decoded: {'Enable': 'Enabled', 'AverageRadius': 3.2, 'Temperature': 250.1}
#
from __future__ import print_function
import os
from binascii import hexlify
import... | Correct DBC file path in hello world example. | Correct DBC file path in hello world example.
| Python | mit | cantools/cantools,eerimoq/cantools | #!/usr/bin/env python3
from __future__ import print_function
import os
from binascii import hexlify
import cantools
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
MOTOHAWK_PATH = os.path.join(SCRIPT_DIR,
'..',
'tests',
'... | #!/usr/bin/env python3
#
# > python3 hello_world.py
# Message: {'Temperature': 250.1, 'AverageRadius': 3.2, 'Enable': 'Enabled'}
# Encoded: c001400000000000
# Decoded: {'Enable': 'Enabled', 'AverageRadius': 3.2, 'Temperature': 250.1}
#
from __future__ import print_function
import os
from binascii import hexlify
import... | <commit_before>#!/usr/bin/env python3
from __future__ import print_function
import os
from binascii import hexlify
import cantools
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
MOTOHAWK_PATH = os.path.join(SCRIPT_DIR,
'..',
'tests',
... | #!/usr/bin/env python3
#
# > python3 hello_world.py
# Message: {'Temperature': 250.1, 'AverageRadius': 3.2, 'Enable': 'Enabled'}
# Encoded: c001400000000000
# Decoded: {'Enable': 'Enabled', 'AverageRadius': 3.2, 'Temperature': 250.1}
#
from __future__ import print_function
import os
from binascii import hexlify
import... | #!/usr/bin/env python3
from __future__ import print_function
import os
from binascii import hexlify
import cantools
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
MOTOHAWK_PATH = os.path.join(SCRIPT_DIR,
'..',
'tests',
'... | <commit_before>#!/usr/bin/env python3
from __future__ import print_function
import os
from binascii import hexlify
import cantools
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
MOTOHAWK_PATH = os.path.join(SCRIPT_DIR,
'..',
'tests',
... |
c9c4284cf4906f75d481c59f2693ef1e499f3c32 | zou/app/blueprints/crud/entity_type.py | zou/app/blueprints/crud/entity_type.py | from .base import BaseModelResource, BaseModelsResource
from zou.app.models.entity_type import EntityType
from zou.app.utils import events
from zou.app.services import entities_service
class EntityTypesResource(BaseModelsResource):
def __init__(self):
BaseModelsResource.__init__(self, EntityType)
d... | from .base import BaseModelResource, BaseModelsResource
from zou.app.models.entity_type import EntityType
from zou.app.utils import events
from zou.app.services import entities_service
class EntityTypesResource(BaseModelsResource):
def __init__(self):
BaseModelsResource.__init__(self, EntityType)
d... | Fix entity type post deletion | Fix entity type post deletion
| Python | agpl-3.0 | cgwire/zou | from .base import BaseModelResource, BaseModelsResource
from zou.app.models.entity_type import EntityType
from zou.app.utils import events
from zou.app.services import entities_service
class EntityTypesResource(BaseModelsResource):
def __init__(self):
BaseModelsResource.__init__(self, EntityType)
d... | from .base import BaseModelResource, BaseModelsResource
from zou.app.models.entity_type import EntityType
from zou.app.utils import events
from zou.app.services import entities_service
class EntityTypesResource(BaseModelsResource):
def __init__(self):
BaseModelsResource.__init__(self, EntityType)
d... | <commit_before>from .base import BaseModelResource, BaseModelsResource
from zou.app.models.entity_type import EntityType
from zou.app.utils import events
from zou.app.services import entities_service
class EntityTypesResource(BaseModelsResource):
def __init__(self):
BaseModelsResource.__init__(self, Ent... | from .base import BaseModelResource, BaseModelsResource
from zou.app.models.entity_type import EntityType
from zou.app.utils import events
from zou.app.services import entities_service
class EntityTypesResource(BaseModelsResource):
def __init__(self):
BaseModelsResource.__init__(self, EntityType)
d... | from .base import BaseModelResource, BaseModelsResource
from zou.app.models.entity_type import EntityType
from zou.app.utils import events
from zou.app.services import entities_service
class EntityTypesResource(BaseModelsResource):
def __init__(self):
BaseModelsResource.__init__(self, EntityType)
d... | <commit_before>from .base import BaseModelResource, BaseModelsResource
from zou.app.models.entity_type import EntityType
from zou.app.utils import events
from zou.app.services import entities_service
class EntityTypesResource(BaseModelsResource):
def __init__(self):
BaseModelsResource.__init__(self, Ent... |
8f14e64701fb26da8e4a614da6129964f29be16d | testapp/testapp/testmain/models.py | testapp/testapp/testmain/models.py | from django.db import models
class ClassRoom(models.Model):
number = models.CharField(max_length=4)
def __unicode__(self):
return unicode(self.number)
class Lab(models.Model):
name = models.CharField(max_length=10)
def __unicode__(self):
return unicode(self.name)
class Dept(models.M... | from django.db import models
class ClassRoom(models.Model):
number = models.CharField(max_length=4)
def __unicode__(self):
return unicode(self.number)
class Lab(models.Model):
name = models.CharField(max_length=10)
def __unicode__(self):
return unicode(self.name)
class Dept(models.M... | Add new testing model `School` | Add new testing model `School`
Issue #43
| Python | mit | applegrew/django-select2,dulaccc/django-select2,strongriley/django-select2,Feria/https-github.com-applegrew-django-select2,hobarrera/django-select2,hisie/django-select2,Feria/https-github.com-applegrew-django-select2,hisie/django-select2,bubenkoff/django-select2,pbs/django-select2,dantagg/django-select2,hobarrera/djang... | from django.db import models
class ClassRoom(models.Model):
number = models.CharField(max_length=4)
def __unicode__(self):
return unicode(self.number)
class Lab(models.Model):
name = models.CharField(max_length=10)
def __unicode__(self):
return unicode(self.name)
class Dept(models.M... | from django.db import models
class ClassRoom(models.Model):
number = models.CharField(max_length=4)
def __unicode__(self):
return unicode(self.number)
class Lab(models.Model):
name = models.CharField(max_length=10)
def __unicode__(self):
return unicode(self.name)
class Dept(models.M... | <commit_before>from django.db import models
class ClassRoom(models.Model):
number = models.CharField(max_length=4)
def __unicode__(self):
return unicode(self.number)
class Lab(models.Model):
name = models.CharField(max_length=10)
def __unicode__(self):
return unicode(self.name)
clas... | from django.db import models
class ClassRoom(models.Model):
number = models.CharField(max_length=4)
def __unicode__(self):
return unicode(self.number)
class Lab(models.Model):
name = models.CharField(max_length=10)
def __unicode__(self):
return unicode(self.name)
class Dept(models.M... | from django.db import models
class ClassRoom(models.Model):
number = models.CharField(max_length=4)
def __unicode__(self):
return unicode(self.number)
class Lab(models.Model):
name = models.CharField(max_length=10)
def __unicode__(self):
return unicode(self.name)
class Dept(models.M... | <commit_before>from django.db import models
class ClassRoom(models.Model):
number = models.CharField(max_length=4)
def __unicode__(self):
return unicode(self.number)
class Lab(models.Model):
name = models.CharField(max_length=10)
def __unicode__(self):
return unicode(self.name)
clas... |
7733eef2eb6674ce800126e5abf4d98c0434b224 | 16B/16B-242/imaging/concat_and_split.py | 16B/16B-242/imaging/concat_and_split.py |
'''
Combine the tracks, then split out the science fields
'''
import os
from glob import glob
from tasks import virtualconcat, split
# Grab all of the MS tracks in the folder (should be 12)
myvis = glob("*.speclines.ms")
assert len(myvis) == 12
default('virtualconcat')
virtualconcat(vis=myvis, concatvis='16B-242_... |
'''
Combine the tracks, then split out the science fields
'''
import os
from glob import glob
from tasks import virtualconcat, split
# Grab all of the MS tracks in the folder (should be 12)
myvis = glob("16B-242.*.ms")
assert len(myvis) == 12
default('virtualconcat')
virtualconcat(vis=myvis, concatvis='16B-242_li... | Change glob for 242 tracks | Change glob for 242 tracks
| Python | mit | e-koch/VLA_Lband,e-koch/VLA_Lband |
'''
Combine the tracks, then split out the science fields
'''
import os
from glob import glob
from tasks import virtualconcat, split
# Grab all of the MS tracks in the folder (should be 12)
myvis = glob("*.speclines.ms")
assert len(myvis) == 12
default('virtualconcat')
virtualconcat(vis=myvis, concatvis='16B-242_... |
'''
Combine the tracks, then split out the science fields
'''
import os
from glob import glob
from tasks import virtualconcat, split
# Grab all of the MS tracks in the folder (should be 12)
myvis = glob("16B-242.*.ms")
assert len(myvis) == 12
default('virtualconcat')
virtualconcat(vis=myvis, concatvis='16B-242_li... | <commit_before>
'''
Combine the tracks, then split out the science fields
'''
import os
from glob import glob
from tasks import virtualconcat, split
# Grab all of the MS tracks in the folder (should be 12)
myvis = glob("*.speclines.ms")
assert len(myvis) == 12
default('virtualconcat')
virtualconcat(vis=myvis, conc... |
'''
Combine the tracks, then split out the science fields
'''
import os
from glob import glob
from tasks import virtualconcat, split
# Grab all of the MS tracks in the folder (should be 12)
myvis = glob("16B-242.*.ms")
assert len(myvis) == 12
default('virtualconcat')
virtualconcat(vis=myvis, concatvis='16B-242_li... |
'''
Combine the tracks, then split out the science fields
'''
import os
from glob import glob
from tasks import virtualconcat, split
# Grab all of the MS tracks in the folder (should be 12)
myvis = glob("*.speclines.ms")
assert len(myvis) == 12
default('virtualconcat')
virtualconcat(vis=myvis, concatvis='16B-242_... | <commit_before>
'''
Combine the tracks, then split out the science fields
'''
import os
from glob import glob
from tasks import virtualconcat, split
# Grab all of the MS tracks in the folder (should be 12)
myvis = glob("*.speclines.ms")
assert len(myvis) == 12
default('virtualconcat')
virtualconcat(vis=myvis, conc... |
4246ec034ed52fa0dc7aa947b4f560f95f082538 | Lib/unittest/test/__init__.py | Lib/unittest/test/__init__.py | """Test suite for distutils.
This test suite consists of a collection of test modules in the
distutils.tests package. Each test module has a name starting with
'test' and contains a function test_suite(). The function is expected
to return an initialized unittest.TestSuite instance.
Tests for the command classes in... | import os
import sys
import unittest
here = os.path.dirname(__file__)
loader = unittest.defaultTestLoader
def test_suite():
suite = unittest.TestSuite()
for fn in os.listdir(here):
if fn.startswith("test") and fn.endswith(".py"):
modname = "unittest.test." + fn[:-3]
__import__... | Remove incorrect docstring in unittest.test | Remove incorrect docstring in unittest.test
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | """Test suite for distutils.
This test suite consists of a collection of test modules in the
distutils.tests package. Each test module has a name starting with
'test' and contains a function test_suite(). The function is expected
to return an initialized unittest.TestSuite instance.
Tests for the command classes in... | import os
import sys
import unittest
here = os.path.dirname(__file__)
loader = unittest.defaultTestLoader
def test_suite():
suite = unittest.TestSuite()
for fn in os.listdir(here):
if fn.startswith("test") and fn.endswith(".py"):
modname = "unittest.test." + fn[:-3]
__import__... | <commit_before>"""Test suite for distutils.
This test suite consists of a collection of test modules in the
distutils.tests package. Each test module has a name starting with
'test' and contains a function test_suite(). The function is expected
to return an initialized unittest.TestSuite instance.
Tests for the com... | import os
import sys
import unittest
here = os.path.dirname(__file__)
loader = unittest.defaultTestLoader
def test_suite():
suite = unittest.TestSuite()
for fn in os.listdir(here):
if fn.startswith("test") and fn.endswith(".py"):
modname = "unittest.test." + fn[:-3]
__import__... | """Test suite for distutils.
This test suite consists of a collection of test modules in the
distutils.tests package. Each test module has a name starting with
'test' and contains a function test_suite(). The function is expected
to return an initialized unittest.TestSuite instance.
Tests for the command classes in... | <commit_before>"""Test suite for distutils.
This test suite consists of a collection of test modules in the
distutils.tests package. Each test module has a name starting with
'test' and contains a function test_suite(). The function is expected
to return an initialized unittest.TestSuite instance.
Tests for the com... |
60eb4891013dfc5a00fbecd98a79999a365c0839 | example/article/admin.py | example/article/admin.py | from django.contrib import admin
from django.forms import ModelForm
from article.models import Article
# The timezone support was introduced in Django 1.4, fallback to standard library for 1.3.
try:
from django.utils.timezone import now
except ImportError:
from datetime import datetime
now = datetime.now
... | from django.contrib import admin
from django.forms import ModelForm
from django.utils.timezone import now
from article.models import Article
class ArticleAdminForm(ModelForm):
def __init__(self, *args, **kwargs):
super(ArticleAdminForm, self).__init__(*args, **kwargs)
self.fields['publication_dat... | Remove old Django compatibility code | Remove old Django compatibility code
| Python | apache-2.0 | django-fluent/django-fluent-comments,edoburu/django-fluent-comments,django-fluent/django-fluent-comments,edoburu/django-fluent-comments,edoburu/django-fluent-comments,django-fluent/django-fluent-comments,django-fluent/django-fluent-comments | from django.contrib import admin
from django.forms import ModelForm
from article.models import Article
# The timezone support was introduced in Django 1.4, fallback to standard library for 1.3.
try:
from django.utils.timezone import now
except ImportError:
from datetime import datetime
now = datetime.now
... | from django.contrib import admin
from django.forms import ModelForm
from django.utils.timezone import now
from article.models import Article
class ArticleAdminForm(ModelForm):
def __init__(self, *args, **kwargs):
super(ArticleAdminForm, self).__init__(*args, **kwargs)
self.fields['publication_dat... | <commit_before>from django.contrib import admin
from django.forms import ModelForm
from article.models import Article
# The timezone support was introduced in Django 1.4, fallback to standard library for 1.3.
try:
from django.utils.timezone import now
except ImportError:
from datetime import datetime
now =... | from django.contrib import admin
from django.forms import ModelForm
from django.utils.timezone import now
from article.models import Article
class ArticleAdminForm(ModelForm):
def __init__(self, *args, **kwargs):
super(ArticleAdminForm, self).__init__(*args, **kwargs)
self.fields['publication_dat... | from django.contrib import admin
from django.forms import ModelForm
from article.models import Article
# The timezone support was introduced in Django 1.4, fallback to standard library for 1.3.
try:
from django.utils.timezone import now
except ImportError:
from datetime import datetime
now = datetime.now
... | <commit_before>from django.contrib import admin
from django.forms import ModelForm
from article.models import Article
# The timezone support was introduced in Django 1.4, fallback to standard library for 1.3.
try:
from django.utils.timezone import now
except ImportError:
from datetime import datetime
now =... |
685ae9d284a9df71563c05773e4110e5ddc16b38 | backend/breach/forms.py | backend/breach/forms.py | from django.forms import ModelForm
from breach.models import Target, Victim
class TargetForm(ModelForm):
class Meta:
model = Target
fields = (
'name',
'endpoint',
'prefix',
'alphabet',
'secretlength',
'alignmentalphabet',
... | from django.forms import ModelForm
from breach.models import Target, Victim
class TargetForm(ModelForm):
class Meta:
model = Target
fields = (
'name',
'endpoint',
'prefix',
'alphabet',
'secretlength',
'alignmentalphabet',
... | Add sourceip and target parameters to AttackForm | Add sourceip and target parameters to AttackForm
| Python | mit | dimkarakostas/rupture,dionyziz/rupture,dimriou/rupture,dimriou/rupture,dimriou/rupture,dionyziz/rupture,dimkarakostas/rupture,dimriou/rupture,esarafianou/rupture,esarafianou/rupture,dionyziz/rupture,dimkarakostas/rupture,dionyziz/rupture,dimkarakostas/rupture,dimriou/rupture,dionyziz/rupture,dimkarakostas/rupture,esara... | from django.forms import ModelForm
from breach.models import Target, Victim
class TargetForm(ModelForm):
class Meta:
model = Target
fields = (
'name',
'endpoint',
'prefix',
'alphabet',
'secretlength',
'alignmentalphabet',
... | from django.forms import ModelForm
from breach.models import Target, Victim
class TargetForm(ModelForm):
class Meta:
model = Target
fields = (
'name',
'endpoint',
'prefix',
'alphabet',
'secretlength',
'alignmentalphabet',
... | <commit_before>from django.forms import ModelForm
from breach.models import Target, Victim
class TargetForm(ModelForm):
class Meta:
model = Target
fields = (
'name',
'endpoint',
'prefix',
'alphabet',
'secretlength',
'alignment... | from django.forms import ModelForm
from breach.models import Target, Victim
class TargetForm(ModelForm):
class Meta:
model = Target
fields = (
'name',
'endpoint',
'prefix',
'alphabet',
'secretlength',
'alignmentalphabet',
... | from django.forms import ModelForm
from breach.models import Target, Victim
class TargetForm(ModelForm):
class Meta:
model = Target
fields = (
'name',
'endpoint',
'prefix',
'alphabet',
'secretlength',
'alignmentalphabet',
... | <commit_before>from django.forms import ModelForm
from breach.models import Target, Victim
class TargetForm(ModelForm):
class Meta:
model = Target
fields = (
'name',
'endpoint',
'prefix',
'alphabet',
'secretlength',
'alignment... |
09a54e7a09b362b48bde21dad25b14e73cf72c98 | main.py | main.py | import re
class dna():
"""Instantiate a DNA object"""
def __init__(self):
self.sequence = ""
def genSequence(self, N):
"""Generate a DNA sequence of length N in the subset [G-A-T-C]"""
import random
self.sequence = ""
for i in range(N):
... | import re
class dna():
"""Instantiate a DNA object"""
def __init__(self):
self.sequence = ""
def genSequence(self, N):
"""Generate a DNA sequence of length N in the subset [G-A-T-C]"""
import random
self.sequence = ""
for i in range(N):
... | Return all most frequent subsequences | Return all most frequent subsequences
| Python | mit | kir0ul/dna | import re
class dna():
"""Instantiate a DNA object"""
def __init__(self):
self.sequence = ""
def genSequence(self, N):
"""Generate a DNA sequence of length N in the subset [G-A-T-C]"""
import random
self.sequence = ""
for i in range(N):
... | import re
class dna():
"""Instantiate a DNA object"""
def __init__(self):
self.sequence = ""
def genSequence(self, N):
"""Generate a DNA sequence of length N in the subset [G-A-T-C]"""
import random
self.sequence = ""
for i in range(N):
... | <commit_before>import re
class dna():
"""Instantiate a DNA object"""
def __init__(self):
self.sequence = ""
def genSequence(self, N):
"""Generate a DNA sequence of length N in the subset [G-A-T-C]"""
import random
self.sequence = ""
for i in ... | import re
class dna():
"""Instantiate a DNA object"""
def __init__(self):
self.sequence = ""
def genSequence(self, N):
"""Generate a DNA sequence of length N in the subset [G-A-T-C]"""
import random
self.sequence = ""
for i in range(N):
... | import re
class dna():
"""Instantiate a DNA object"""
def __init__(self):
self.sequence = ""
def genSequence(self, N):
"""Generate a DNA sequence of length N in the subset [G-A-T-C]"""
import random
self.sequence = ""
for i in range(N):
... | <commit_before>import re
class dna():
"""Instantiate a DNA object"""
def __init__(self):
self.sequence = ""
def genSequence(self, N):
"""Generate a DNA sequence of length N in the subset [G-A-T-C]"""
import random
self.sequence = ""
for i in ... |
c7a67d4a69e1fe2ecb7f6c1a56202c6153e9766c | frigg/builds/filters.py | frigg/builds/filters.py | from rest_framework import filters
from frigg.builds.models import Build, Project
class ProjectPermissionFilter(filters.BaseFilterBackend):
def filter_queryset(self, request, queryset, view):
return queryset.filter(Project.objects.permitted_query(request.user))
class BuildPermissionFilter(filters.BaseF... | from rest_framework import filters
from frigg.builds.models import Build, Project
class ProjectPermissionFilter(filters.BaseFilterBackend):
def filter_queryset(self, request, queryset, view):
return queryset.filter(Project.objects.permitted_query(request.user)).distinct()
class BuildPermissionFilter(fi... | Fix multiple instance bug in api | Fix multiple instance bug in api
| Python | mit | frigg/frigg-hq,frigg/frigg-hq,frigg/frigg-hq | from rest_framework import filters
from frigg.builds.models import Build, Project
class ProjectPermissionFilter(filters.BaseFilterBackend):
def filter_queryset(self, request, queryset, view):
return queryset.filter(Project.objects.permitted_query(request.user))
class BuildPermissionFilter(filters.BaseF... | from rest_framework import filters
from frigg.builds.models import Build, Project
class ProjectPermissionFilter(filters.BaseFilterBackend):
def filter_queryset(self, request, queryset, view):
return queryset.filter(Project.objects.permitted_query(request.user)).distinct()
class BuildPermissionFilter(fi... | <commit_before>from rest_framework import filters
from frigg.builds.models import Build, Project
class ProjectPermissionFilter(filters.BaseFilterBackend):
def filter_queryset(self, request, queryset, view):
return queryset.filter(Project.objects.permitted_query(request.user))
class BuildPermissionFilte... | from rest_framework import filters
from frigg.builds.models import Build, Project
class ProjectPermissionFilter(filters.BaseFilterBackend):
def filter_queryset(self, request, queryset, view):
return queryset.filter(Project.objects.permitted_query(request.user)).distinct()
class BuildPermissionFilter(fi... | from rest_framework import filters
from frigg.builds.models import Build, Project
class ProjectPermissionFilter(filters.BaseFilterBackend):
def filter_queryset(self, request, queryset, view):
return queryset.filter(Project.objects.permitted_query(request.user))
class BuildPermissionFilter(filters.BaseF... | <commit_before>from rest_framework import filters
from frigg.builds.models import Build, Project
class ProjectPermissionFilter(filters.BaseFilterBackend):
def filter_queryset(self, request, queryset, view):
return queryset.filter(Project.objects.permitted_query(request.user))
class BuildPermissionFilte... |
e3f8fa13758ebed06abc1369d8c85474f7346d29 | api/nodes/urls.py | api/nodes/urls.py | from django.conf.urls import url
from api.nodes import views
urlpatterns = [
# Examples:
# url(r'^$', 'api.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', views.NodeList.as_view(), name='node-list'),
url(r'^(?P<node_id>\w+)/$', views.NodeDetail.as_view(), name='node-d... | from django.conf.urls import url
from api.nodes import views
urlpatterns = [
# Examples:
# url(r'^$', 'api.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', views.NodeList.as_view(), name='node-list'),
url(r'^bulk_delete/(?P<confirmation_token>\w+)/$', views.NodeBulkDel... | Add second delete url where users will send request to confirm they want to bulk delete. | Add second delete url where users will send request to confirm they want to bulk delete.
| Python | apache-2.0 | GageGaskins/osf.io,adlius/osf.io,brandonPurvis/osf.io,cwisecarver/osf.io,chrisseto/osf.io,abought/osf.io,GageGaskins/osf.io,binoculars/osf.io,RomanZWang/osf.io,danielneis/osf.io,Nesiehr/osf.io,KAsante95/osf.io,baylee-d/osf.io,billyhunt/osf.io,adlius/osf.io,HalcyonChimera/osf.io,wearpants/osf.io,erinspace/osf.io,crcrese... | from django.conf.urls import url
from api.nodes import views
urlpatterns = [
# Examples:
# url(r'^$', 'api.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', views.NodeList.as_view(), name='node-list'),
url(r'^(?P<node_id>\w+)/$', views.NodeDetail.as_view(), name='node-d... | from django.conf.urls import url
from api.nodes import views
urlpatterns = [
# Examples:
# url(r'^$', 'api.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', views.NodeList.as_view(), name='node-list'),
url(r'^bulk_delete/(?P<confirmation_token>\w+)/$', views.NodeBulkDel... | <commit_before>from django.conf.urls import url
from api.nodes import views
urlpatterns = [
# Examples:
# url(r'^$', 'api.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', views.NodeList.as_view(), name='node-list'),
url(r'^(?P<node_id>\w+)/$', views.NodeDetail.as_view(... | from django.conf.urls import url
from api.nodes import views
urlpatterns = [
# Examples:
# url(r'^$', 'api.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', views.NodeList.as_view(), name='node-list'),
url(r'^bulk_delete/(?P<confirmation_token>\w+)/$', views.NodeBulkDel... | from django.conf.urls import url
from api.nodes import views
urlpatterns = [
# Examples:
# url(r'^$', 'api.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', views.NodeList.as_view(), name='node-list'),
url(r'^(?P<node_id>\w+)/$', views.NodeDetail.as_view(), name='node-d... | <commit_before>from django.conf.urls import url
from api.nodes import views
urlpatterns = [
# Examples:
# url(r'^$', 'api.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', views.NodeList.as_view(), name='node-list'),
url(r'^(?P<node_id>\w+)/$', views.NodeDetail.as_view(... |
ed98c6fc0c8872263a696d4d403eba773c759233 | tests/httplib_adapter_test.py | tests/httplib_adapter_test.py | import sys
import unittest
import ocookie.httplib_adapter
from tests import app
py3 = sys.version_info[0] == 3
if py3:
import http.client as httplib
else:
import httplib
port = 5040
app.run(port)
class HttplibAdapterTest(unittest.TestCase):
def test_cookies(self):
conn = httplib.HTTPConnection('l... | import sys
import unittest
import ocookie.httplib_adapter
from tests import app
py3 = sys.version_info[0] == 3
if py3:
import http.client as httplib
def to_bytes(text):
return text.encode('utf8')
else:
import httplib
def to_bytes(text):
return text
port = 5040
app.run(port)
class Http... | Deal with str/bytes mismatch in python 3 | Deal with str/bytes mismatch in python 3
| Python | bsd-2-clause | p/ocookie | import sys
import unittest
import ocookie.httplib_adapter
from tests import app
py3 = sys.version_info[0] == 3
if py3:
import http.client as httplib
else:
import httplib
port = 5040
app.run(port)
class HttplibAdapterTest(unittest.TestCase):
def test_cookies(self):
conn = httplib.HTTPConnection('l... | import sys
import unittest
import ocookie.httplib_adapter
from tests import app
py3 = sys.version_info[0] == 3
if py3:
import http.client as httplib
def to_bytes(text):
return text.encode('utf8')
else:
import httplib
def to_bytes(text):
return text
port = 5040
app.run(port)
class Http... | <commit_before>import sys
import unittest
import ocookie.httplib_adapter
from tests import app
py3 = sys.version_info[0] == 3
if py3:
import http.client as httplib
else:
import httplib
port = 5040
app.run(port)
class HttplibAdapterTest(unittest.TestCase):
def test_cookies(self):
conn = httplib.HT... | import sys
import unittest
import ocookie.httplib_adapter
from tests import app
py3 = sys.version_info[0] == 3
if py3:
import http.client as httplib
def to_bytes(text):
return text.encode('utf8')
else:
import httplib
def to_bytes(text):
return text
port = 5040
app.run(port)
class Http... | import sys
import unittest
import ocookie.httplib_adapter
from tests import app
py3 = sys.version_info[0] == 3
if py3:
import http.client as httplib
else:
import httplib
port = 5040
app.run(port)
class HttplibAdapterTest(unittest.TestCase):
def test_cookies(self):
conn = httplib.HTTPConnection('l... | <commit_before>import sys
import unittest
import ocookie.httplib_adapter
from tests import app
py3 = sys.version_info[0] == 3
if py3:
import http.client as httplib
else:
import httplib
port = 5040
app.run(port)
class HttplibAdapterTest(unittest.TestCase):
def test_cookies(self):
conn = httplib.HT... |
1822e23094793bbadd4be0c326b8d28204dfa0ed | gtbhdsiggen/__init__.py | gtbhdsiggen/__init__.py | from .timings import *
from .pattern import *
from .exceptions import *
import serial
import logging
logger = logging.getLogger(__name__)
class HDSignalGenerator(TimingsMixin, PatternMixin):
def __init__(self, device):
self.serial = serial.Serial(device, 19200, 8, 'N', 1, timeout=5)
def _execute(sel... | from .timings import *
from .pattern import *
from .exceptions import *
import serial
import logging
logger = logging.getLogger(__name__)
class HDSignalGenerator(TimingsMixin, PatternMixin):
def __init__(self, device):
if not device:
raise HDSignalGeneratorException("Invalid serial device: %s... | Raise exception on empty device name | main: Raise exception on empty device name
| Python | lgpl-2.1 | veo-labs/gtbhdsiggen | from .timings import *
from .pattern import *
from .exceptions import *
import serial
import logging
logger = logging.getLogger(__name__)
class HDSignalGenerator(TimingsMixin, PatternMixin):
def __init__(self, device):
self.serial = serial.Serial(device, 19200, 8, 'N', 1, timeout=5)
def _execute(sel... | from .timings import *
from .pattern import *
from .exceptions import *
import serial
import logging
logger = logging.getLogger(__name__)
class HDSignalGenerator(TimingsMixin, PatternMixin):
def __init__(self, device):
if not device:
raise HDSignalGeneratorException("Invalid serial device: %s... | <commit_before>from .timings import *
from .pattern import *
from .exceptions import *
import serial
import logging
logger = logging.getLogger(__name__)
class HDSignalGenerator(TimingsMixin, PatternMixin):
def __init__(self, device):
self.serial = serial.Serial(device, 19200, 8, 'N', 1, timeout=5)
d... | from .timings import *
from .pattern import *
from .exceptions import *
import serial
import logging
logger = logging.getLogger(__name__)
class HDSignalGenerator(TimingsMixin, PatternMixin):
def __init__(self, device):
if not device:
raise HDSignalGeneratorException("Invalid serial device: %s... | from .timings import *
from .pattern import *
from .exceptions import *
import serial
import logging
logger = logging.getLogger(__name__)
class HDSignalGenerator(TimingsMixin, PatternMixin):
def __init__(self, device):
self.serial = serial.Serial(device, 19200, 8, 'N', 1, timeout=5)
def _execute(sel... | <commit_before>from .timings import *
from .pattern import *
from .exceptions import *
import serial
import logging
logger = logging.getLogger(__name__)
class HDSignalGenerator(TimingsMixin, PatternMixin):
def __init__(self, device):
self.serial = serial.Serial(device, 19200, 8, 'N', 1, timeout=5)
d... |
94245d7a52a274c6763382a10e3a1dbe0b2cbf18 | cea/interfaces/dashboard/api/dashboard.py | cea/interfaces/dashboard/api/dashboard.py | from flask_restplus import Namespace, Resource, fields, abort
import cea.config
import cea.plots.cache
api = Namespace('Dashboard', description='Dashboard plots')
LAYOUTS = ['row', 'grid', 'map']
CATEGORIES = {c.name: {'label': c.label, 'plots': [{'id': p.id(), 'name': p.name} for p in c.plots]}
for c... | from flask_restplus import Namespace, Resource, fields, abort
import cea.config
import cea.plots.cache
api = Namespace('Dashboard', description='Dashboard plots')
LAYOUTS = ['row', 'grid', 'map']
CATEGORIES = {c.name: {'label': c.label, 'plots': [{'id': p.id(), 'name': p.name} for p in c.plots]}
for c... | Allow 'scenario-name' to be null if it does not exist | Allow 'scenario-name' to be null if it does not exist
| Python | mit | architecture-building-systems/CityEnergyAnalyst,architecture-building-systems/CityEnergyAnalyst,architecture-building-systems/CityEnergyAnalyst | from flask_restplus import Namespace, Resource, fields, abort
import cea.config
import cea.plots.cache
api = Namespace('Dashboard', description='Dashboard plots')
LAYOUTS = ['row', 'grid', 'map']
CATEGORIES = {c.name: {'label': c.label, 'plots': [{'id': p.id(), 'name': p.name} for p in c.plots]}
for c... | from flask_restplus import Namespace, Resource, fields, abort
import cea.config
import cea.plots.cache
api = Namespace('Dashboard', description='Dashboard plots')
LAYOUTS = ['row', 'grid', 'map']
CATEGORIES = {c.name: {'label': c.label, 'plots': [{'id': p.id(), 'name': p.name} for p in c.plots]}
for c... | <commit_before>from flask_restplus import Namespace, Resource, fields, abort
import cea.config
import cea.plots.cache
api = Namespace('Dashboard', description='Dashboard plots')
LAYOUTS = ['row', 'grid', 'map']
CATEGORIES = {c.name: {'label': c.label, 'plots': [{'id': p.id(), 'name': p.name} for p in c.plots]}
... | from flask_restplus import Namespace, Resource, fields, abort
import cea.config
import cea.plots.cache
api = Namespace('Dashboard', description='Dashboard plots')
LAYOUTS = ['row', 'grid', 'map']
CATEGORIES = {c.name: {'label': c.label, 'plots': [{'id': p.id(), 'name': p.name} for p in c.plots]}
for c... | from flask_restplus import Namespace, Resource, fields, abort
import cea.config
import cea.plots.cache
api = Namespace('Dashboard', description='Dashboard plots')
LAYOUTS = ['row', 'grid', 'map']
CATEGORIES = {c.name: {'label': c.label, 'plots': [{'id': p.id(), 'name': p.name} for p in c.plots]}
for c... | <commit_before>from flask_restplus import Namespace, Resource, fields, abort
import cea.config
import cea.plots.cache
api = Namespace('Dashboard', description='Dashboard plots')
LAYOUTS = ['row', 'grid', 'map']
CATEGORIES = {c.name: {'label': c.label, 'plots': [{'id': p.id(), 'name': p.name} for p in c.plots]}
... |
e8fc301de8fab1d9dfcb99aa94e7c4467dab689a | amy/workshops/migrations/0223_membership_agreement_link.py | amy/workshops/migrations/0223_membership_agreement_link.py | # Generated by Django 2.2.13 on 2020-11-18 20:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0222_workshoprequest_workshop_listed'),
]
operations = [
migrations.AddField(
model_name='membership',
... | # Generated by Django 2.2.17 on 2020-11-29 10:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0222_workshoprequest_workshop_listed'),
]
operations = [
migrations.AddField(
model_name='membership',
... | Update help text in migration | Update help text in migration
| Python | mit | swcarpentry/amy,pbanaszkiewicz/amy,swcarpentry/amy,pbanaszkiewicz/amy,swcarpentry/amy,pbanaszkiewicz/amy | # Generated by Django 2.2.13 on 2020-11-18 20:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0222_workshoprequest_workshop_listed'),
]
operations = [
migrations.AddField(
model_name='membership',
... | # Generated by Django 2.2.17 on 2020-11-29 10:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0222_workshoprequest_workshop_listed'),
]
operations = [
migrations.AddField(
model_name='membership',
... | <commit_before># Generated by Django 2.2.13 on 2020-11-18 20:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0222_workshoprequest_workshop_listed'),
]
operations = [
migrations.AddField(
model_name='membershi... | # Generated by Django 2.2.17 on 2020-11-29 10:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0222_workshoprequest_workshop_listed'),
]
operations = [
migrations.AddField(
model_name='membership',
... | # Generated by Django 2.2.13 on 2020-11-18 20:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0222_workshoprequest_workshop_listed'),
]
operations = [
migrations.AddField(
model_name='membership',
... | <commit_before># Generated by Django 2.2.13 on 2020-11-18 20:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0222_workshoprequest_workshop_listed'),
]
operations = [
migrations.AddField(
model_name='membershi... |
772b41b4a00611d9245ac8560bc8d3c477ce9166 | _pytest/test_everything.py | _pytest/test_everything.py | from __future__ import print_function, unicode_literals
import glob
import json
def test_everything(realish_eventrouter, team):
datafiles = glob.glob("_pytest/data/websocket/*.json")
for fname in sorted(datafiles):
data = json.loads(open(fname, "r").read())
team.ws.add(data)
realish_... | from __future__ import print_function, unicode_literals
import glob
import json
def test_everything(realish_eventrouter, team):
datafiles = glob.glob("_pytest/data/websocket/*.json")
for fname in sorted(datafiles):
data = json.loads(open(fname, "r").read())
team.ws.add(data)
realish_... | Fix test broken in the previous commit | Fix test broken in the previous commit
| Python | mit | rawdigits/wee-slack,wee-slack/wee-slack | from __future__ import print_function, unicode_literals
import glob
import json
def test_everything(realish_eventrouter, team):
datafiles = glob.glob("_pytest/data/websocket/*.json")
for fname in sorted(datafiles):
data = json.loads(open(fname, "r").read())
team.ws.add(data)
realish_... | from __future__ import print_function, unicode_literals
import glob
import json
def test_everything(realish_eventrouter, team):
datafiles = glob.glob("_pytest/data/websocket/*.json")
for fname in sorted(datafiles):
data = json.loads(open(fname, "r").read())
team.ws.add(data)
realish_... | <commit_before>from __future__ import print_function, unicode_literals
import glob
import json
def test_everything(realish_eventrouter, team):
datafiles = glob.glob("_pytest/data/websocket/*.json")
for fname in sorted(datafiles):
data = json.loads(open(fname, "r").read())
team.ws.add(data)
... | from __future__ import print_function, unicode_literals
import glob
import json
def test_everything(realish_eventrouter, team):
datafiles = glob.glob("_pytest/data/websocket/*.json")
for fname in sorted(datafiles):
data = json.loads(open(fname, "r").read())
team.ws.add(data)
realish_... | from __future__ import print_function, unicode_literals
import glob
import json
def test_everything(realish_eventrouter, team):
datafiles = glob.glob("_pytest/data/websocket/*.json")
for fname in sorted(datafiles):
data = json.loads(open(fname, "r").read())
team.ws.add(data)
realish_... | <commit_before>from __future__ import print_function, unicode_literals
import glob
import json
def test_everything(realish_eventrouter, team):
datafiles = glob.glob("_pytest/data/websocket/*.json")
for fname in sorted(datafiles):
data = json.loads(open(fname, "r").read())
team.ws.add(data)
... |
96780184daeb63ea5eb5fa3229e32bc6b4968ba6 | meterbus/telegram_ack.py | meterbus/telegram_ack.py | from .exceptions import MBusFrameDecodeError, MBusFrameCRCError, FrameMismatch
class TelegramACK(object):
@staticmethod
def parse(data):
if data is None:
raise MBusFrameDecodeError("Data is None")
if data is not None and len(data) < 1:
raise MBusFrameDecodeError("Inval... | from .exceptions import MBusFrameDecodeError, MBusFrameCRCError, FrameMismatch
class TelegramACK(object):
@staticmethod
def parse(data):
if data is None:
raise MBusFrameDecodeError("Data is None")
if data is not None and len(data) < 1:
raise MBusFrameDecodeError("Inval... | Support for writing this frame to serial port | Support for writing this frame to serial port
| Python | bsd-3-clause | ganehag/pyMeterBus | from .exceptions import MBusFrameDecodeError, MBusFrameCRCError, FrameMismatch
class TelegramACK(object):
@staticmethod
def parse(data):
if data is None:
raise MBusFrameDecodeError("Data is None")
if data is not None and len(data) < 1:
raise MBusFrameDecodeError("Inval... | from .exceptions import MBusFrameDecodeError, MBusFrameCRCError, FrameMismatch
class TelegramACK(object):
@staticmethod
def parse(data):
if data is None:
raise MBusFrameDecodeError("Data is None")
if data is not None and len(data) < 1:
raise MBusFrameDecodeError("Inval... | <commit_before>from .exceptions import MBusFrameDecodeError, MBusFrameCRCError, FrameMismatch
class TelegramACK(object):
@staticmethod
def parse(data):
if data is None:
raise MBusFrameDecodeError("Data is None")
if data is not None and len(data) < 1:
raise MBusFrameDec... | from .exceptions import MBusFrameDecodeError, MBusFrameCRCError, FrameMismatch
class TelegramACK(object):
@staticmethod
def parse(data):
if data is None:
raise MBusFrameDecodeError("Data is None")
if data is not None and len(data) < 1:
raise MBusFrameDecodeError("Inval... | from .exceptions import MBusFrameDecodeError, MBusFrameCRCError, FrameMismatch
class TelegramACK(object):
@staticmethod
def parse(data):
if data is None:
raise MBusFrameDecodeError("Data is None")
if data is not None and len(data) < 1:
raise MBusFrameDecodeError("Inval... | <commit_before>from .exceptions import MBusFrameDecodeError, MBusFrameCRCError, FrameMismatch
class TelegramACK(object):
@staticmethod
def parse(data):
if data is None:
raise MBusFrameDecodeError("Data is None")
if data is not None and len(data) < 1:
raise MBusFrameDec... |
8255449613cb721ece23b822b8ef380a31f9b0bc | flattening_ocds/tests/test_input.py | flattening_ocds/tests/test_input.py | from flattening_ocds.input import unflatten_line, SpreadsheetInput, unflatten
def test_unflatten_line():
# Check flat fields remain flat
assert unflatten_line({'a': 1, 'b': 2}) == {'a': 1, 'b': 2}
assert unflatten_line({'a/b': 1, 'a/c': 2, 'd/e': 3}) == {'a': {'b': 1, 'c': 2}, 'd': {'e': 3}}
# Check m... | from flattening_ocds.input import unflatten_line, SpreadsheetInput, unflatten
class ListInput(SpreadsheetInput):
def __init__(self, sheets, **kwargs):
self.sheets = sheets
super(ListInput, self).__init__(**kwargs)
def get_sheet_lines(self, sheet_name):
print(sheet_name)
return... | Add some unit tests of the unflatten function | Add some unit tests of the unflatten function
| Python | mit | OpenDataServices/flatten-tool | from flattening_ocds.input import unflatten_line, SpreadsheetInput, unflatten
def test_unflatten_line():
# Check flat fields remain flat
assert unflatten_line({'a': 1, 'b': 2}) == {'a': 1, 'b': 2}
assert unflatten_line({'a/b': 1, 'a/c': 2, 'd/e': 3}) == {'a': {'b': 1, 'c': 2}, 'd': {'e': 3}}
# Check m... | from flattening_ocds.input import unflatten_line, SpreadsheetInput, unflatten
class ListInput(SpreadsheetInput):
def __init__(self, sheets, **kwargs):
self.sheets = sheets
super(ListInput, self).__init__(**kwargs)
def get_sheet_lines(self, sheet_name):
print(sheet_name)
return... | <commit_before>from flattening_ocds.input import unflatten_line, SpreadsheetInput, unflatten
def test_unflatten_line():
# Check flat fields remain flat
assert unflatten_line({'a': 1, 'b': 2}) == {'a': 1, 'b': 2}
assert unflatten_line({'a/b': 1, 'a/c': 2, 'd/e': 3}) == {'a': {'b': 1, 'c': 2}, 'd': {'e': 3}... | from flattening_ocds.input import unflatten_line, SpreadsheetInput, unflatten
class ListInput(SpreadsheetInput):
def __init__(self, sheets, **kwargs):
self.sheets = sheets
super(ListInput, self).__init__(**kwargs)
def get_sheet_lines(self, sheet_name):
print(sheet_name)
return... | from flattening_ocds.input import unflatten_line, SpreadsheetInput, unflatten
def test_unflatten_line():
# Check flat fields remain flat
assert unflatten_line({'a': 1, 'b': 2}) == {'a': 1, 'b': 2}
assert unflatten_line({'a/b': 1, 'a/c': 2, 'd/e': 3}) == {'a': {'b': 1, 'c': 2}, 'd': {'e': 3}}
# Check m... | <commit_before>from flattening_ocds.input import unflatten_line, SpreadsheetInput, unflatten
def test_unflatten_line():
# Check flat fields remain flat
assert unflatten_line({'a': 1, 'b': 2}) == {'a': 1, 'b': 2}
assert unflatten_line({'a/b': 1, 'a/c': 2, 'd/e': 3}) == {'a': {'b': 1, 'c': 2}, 'd': {'e': 3}... |
51f07e4b74153c7746d4429a1f562fdb70d927f8 | kolibri/deployment/default/settings/debug_panel.py | kolibri/deployment/default/settings/debug_panel.py | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .dev import * # noqa
INTERNAL_IPS = ["127.0.0.1"]
DEBUG_TOOLBAR_CONFIG = {"SHOW_TOOLBAR_CALLBACK": lambda x: True}
MIDDLEWARE.append("debug_panel.middleware.DebugPanelMiddleware") # noqa
INST... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .dev import * # noqa
INTERNAL_IPS = ["127.0.0.1"]
DEBUG_TOOLBAR_CONFIG = {"SHOW_TOOLBAR_CALLBACK": lambda x: True}
MIDDLEWARE.append("debug_panel.middleware.DebugPanelMiddleware") # noqa
INST... | Add cache to make debug panel usable. | Add cache to make debug panel usable.
| Python | mit | indirectlylit/kolibri,mrpau/kolibri,learningequality/kolibri,mrpau/kolibri,indirectlylit/kolibri,learningequality/kolibri,mrpau/kolibri,indirectlylit/kolibri,mrpau/kolibri,learningequality/kolibri,indirectlylit/kolibri,learningequality/kolibri | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .dev import * # noqa
INTERNAL_IPS = ["127.0.0.1"]
DEBUG_TOOLBAR_CONFIG = {"SHOW_TOOLBAR_CALLBACK": lambda x: True}
MIDDLEWARE.append("debug_panel.middleware.DebugPanelMiddleware") # noqa
INST... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .dev import * # noqa
INTERNAL_IPS = ["127.0.0.1"]
DEBUG_TOOLBAR_CONFIG = {"SHOW_TOOLBAR_CALLBACK": lambda x: True}
MIDDLEWARE.append("debug_panel.middleware.DebugPanelMiddleware") # noqa
INST... | <commit_before>from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .dev import * # noqa
INTERNAL_IPS = ["127.0.0.1"]
DEBUG_TOOLBAR_CONFIG = {"SHOW_TOOLBAR_CALLBACK": lambda x: True}
MIDDLEWARE.append("debug_panel.middleware.DebugPanelMiddleware"... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .dev import * # noqa
INTERNAL_IPS = ["127.0.0.1"]
DEBUG_TOOLBAR_CONFIG = {"SHOW_TOOLBAR_CALLBACK": lambda x: True}
MIDDLEWARE.append("debug_panel.middleware.DebugPanelMiddleware") # noqa
INST... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .dev import * # noqa
INTERNAL_IPS = ["127.0.0.1"]
DEBUG_TOOLBAR_CONFIG = {"SHOW_TOOLBAR_CALLBACK": lambda x: True}
MIDDLEWARE.append("debug_panel.middleware.DebugPanelMiddleware") # noqa
INST... | <commit_before>from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from .dev import * # noqa
INTERNAL_IPS = ["127.0.0.1"]
DEBUG_TOOLBAR_CONFIG = {"SHOW_TOOLBAR_CALLBACK": lambda x: True}
MIDDLEWARE.append("debug_panel.middleware.DebugPanelMiddleware"... |
75d12ae7cd3d671cf20e1a269497a19b669ec49b | dataset/dataset/spiders/dataset_spider.py | dataset/dataset/spiders/dataset_spider.py | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from .. import items
class DatasetSpider(CrawlSpider):
name = 'dataset'
allowed_domains = ['data.gc.ca/data/en']
start_urls = ['http://data.gc.ca/data/... | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from .. import items
class DatasetSpider(CrawlSpider):
name = 'dataset'
allowed_domains = ['data.gc.ca']
start_urls = ['http://data.gc.ca/data/en/datas... | Fix allowable domain otherwise filtered | Fix allowable domain otherwise filtered
| Python | mit | MaxLikelihood/CODE | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from .. import items
class DatasetSpider(CrawlSpider):
name = 'dataset'
allowed_domains = ['data.gc.ca/data/en']
start_urls = ['http://data.gc.ca/data/... | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from .. import items
class DatasetSpider(CrawlSpider):
name = 'dataset'
allowed_domains = ['data.gc.ca']
start_urls = ['http://data.gc.ca/data/en/datas... | <commit_before>from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from .. import items
class DatasetSpider(CrawlSpider):
name = 'dataset'
allowed_domains = ['data.gc.ca/data/en']
start_urls = ['http://d... | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from .. import items
class DatasetSpider(CrawlSpider):
name = 'dataset'
allowed_domains = ['data.gc.ca']
start_urls = ['http://data.gc.ca/data/en/datas... | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from .. import items
class DatasetSpider(CrawlSpider):
name = 'dataset'
allowed_domains = ['data.gc.ca/data/en']
start_urls = ['http://data.gc.ca/data/... | <commit_before>from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from .. import items
class DatasetSpider(CrawlSpider):
name = 'dataset'
allowed_domains = ['data.gc.ca/data/en']
start_urls = ['http://d... |
aeac44b782397e78925fa74d2e87aa73c88b8162 | core/polyaxon/utils/np_utils.py | core/polyaxon/utils/np_utils.py | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, Inc.
#
# 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 ... | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, Inc.
#
# 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 ... | Add check for nan values | Add check for nan values
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, Inc.
#
# 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 ... | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, Inc.
#
# 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 ... | <commit_before>#!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, Inc.
#
# 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... | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, Inc.
#
# 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 ... | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, Inc.
#
# 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 ... | <commit_before>#!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, Inc.
#
# 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... |
066a7dacf20ed3dd123790dc78e99317856ea731 | tutorial/polls/admin.py | tutorial/polls/admin.py | from django.contrib import admin
# Register your models here.
from .models import Question
class QuestionAdmin(admin.ModelAdmin):
fields = ['pub_date', 'question_text']
admin.site.register(Question, QuestionAdmin) | from django.contrib import admin
# Register your models here.
from .models import Question
class QuestionAdmin(admin.ModelAdmin):
#fields = ['pub_date', 'question_text']
fieldsets = [
(None, {'fields' : ['question_text']}),
('Date Information', { 'fields' : ['pub_date'], 'classes': ['collap... | Put Question Admin fields in a fieldset and added a collapse class to the date field | Put Question Admin fields in a fieldset and added a collapse class to the date field
| Python | mit | ikosenn/django_reignited,ikosenn/django_reignited | from django.contrib import admin
# Register your models here.
from .models import Question
class QuestionAdmin(admin.ModelAdmin):
fields = ['pub_date', 'question_text']
admin.site.register(Question, QuestionAdmin)Put Question Admin fields in a fieldset and added a collapse class to the date field | from django.contrib import admin
# Register your models here.
from .models import Question
class QuestionAdmin(admin.ModelAdmin):
#fields = ['pub_date', 'question_text']
fieldsets = [
(None, {'fields' : ['question_text']}),
('Date Information', { 'fields' : ['pub_date'], 'classes': ['collap... | <commit_before>from django.contrib import admin
# Register your models here.
from .models import Question
class QuestionAdmin(admin.ModelAdmin):
fields = ['pub_date', 'question_text']
admin.site.register(Question, QuestionAdmin)<commit_msg>Put Question Admin fields in a fieldset and added a collapse class to t... | from django.contrib import admin
# Register your models here.
from .models import Question
class QuestionAdmin(admin.ModelAdmin):
#fields = ['pub_date', 'question_text']
fieldsets = [
(None, {'fields' : ['question_text']}),
('Date Information', { 'fields' : ['pub_date'], 'classes': ['collap... | from django.contrib import admin
# Register your models here.
from .models import Question
class QuestionAdmin(admin.ModelAdmin):
fields = ['pub_date', 'question_text']
admin.site.register(Question, QuestionAdmin)Put Question Admin fields in a fieldset and added a collapse class to the date fieldfrom django.co... | <commit_before>from django.contrib import admin
# Register your models here.
from .models import Question
class QuestionAdmin(admin.ModelAdmin):
fields = ['pub_date', 'question_text']
admin.site.register(Question, QuestionAdmin)<commit_msg>Put Question Admin fields in a fieldset and added a collapse class to t... |
b58fa9dabe216de7dae8c7a0aeb30dc48e8f6d4d | salt/matchers/list_match.py | salt/matchers/list_match.py | # -*- coding: utf-8 -*-
'''
This is the default list matcher.
'''
from __future__ import absolute_import, print_function, unicode_literals
import collections
import salt.ext.six as six # pylint: disable=3rd-party-module-not-gated
def match(tgt):
'''
Determines if this host is on the list
'''
try:
... | # -*- coding: utf-8 -*-
'''
This is the default list matcher.
'''
from __future__ import absolute_import, print_function, unicode_literals
import logging
log = logging.getLogger(__name__)
def match(tgt):
'''
Determines if this host is on the list
'''
try:
if ',' + __opts__['id'] + ',' in tgt ... | Make sequence optimization more efficient | Make sequence optimization more efficient
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | # -*- coding: utf-8 -*-
'''
This is the default list matcher.
'''
from __future__ import absolute_import, print_function, unicode_literals
import collections
import salt.ext.six as six # pylint: disable=3rd-party-module-not-gated
def match(tgt):
'''
Determines if this host is on the list
'''
try:
... | # -*- coding: utf-8 -*-
'''
This is the default list matcher.
'''
from __future__ import absolute_import, print_function, unicode_literals
import logging
log = logging.getLogger(__name__)
def match(tgt):
'''
Determines if this host is on the list
'''
try:
if ',' + __opts__['id'] + ',' in tgt ... | <commit_before># -*- coding: utf-8 -*-
'''
This is the default list matcher.
'''
from __future__ import absolute_import, print_function, unicode_literals
import collections
import salt.ext.six as six # pylint: disable=3rd-party-module-not-gated
def match(tgt):
'''
Determines if this host is on the list
'... | # -*- coding: utf-8 -*-
'''
This is the default list matcher.
'''
from __future__ import absolute_import, print_function, unicode_literals
import logging
log = logging.getLogger(__name__)
def match(tgt):
'''
Determines if this host is on the list
'''
try:
if ',' + __opts__['id'] + ',' in tgt ... | # -*- coding: utf-8 -*-
'''
This is the default list matcher.
'''
from __future__ import absolute_import, print_function, unicode_literals
import collections
import salt.ext.six as six # pylint: disable=3rd-party-module-not-gated
def match(tgt):
'''
Determines if this host is on the list
'''
try:
... | <commit_before># -*- coding: utf-8 -*-
'''
This is the default list matcher.
'''
from __future__ import absolute_import, print_function, unicode_literals
import collections
import salt.ext.six as six # pylint: disable=3rd-party-module-not-gated
def match(tgt):
'''
Determines if this host is on the list
'... |
180e6bc667f033cb87730b738d3f4602c16bbae9 | website/notifications/views.py | website/notifications/views.py | from framework.auth.decorators import must_be_logged_in
from model import Subscription
from flask import request
from modularodm import Q
from modularodm.exceptions import NoResultsFound
from modularodm.storage.mongostorage import KeyExistsException
@must_be_logged_in
def subscribe(auth, **kwargs):
user = auth.us... | from framework.auth.decorators import must_be_logged_in
from model import Subscription
from flask import request
from modularodm import Q
from modularodm.exceptions import NoResultsFound
from modularodm.storage.mongostorage import KeyExistsException
@must_be_logged_in
def subscribe(auth, **kwargs):
user = auth.us... | Use node id (not project id) to create component Subscriptions | Use node id (not project id) to create component Subscriptions
| Python | apache-2.0 | billyhunt/osf.io,TomBaxter/osf.io,aaxelb/osf.io,lamdnhan/osf.io,binoculars/osf.io,pattisdr/osf.io,erinspace/osf.io,GageGaskins/osf.io,asanfilippo7/osf.io,GageGaskins/osf.io,brianjgeiger/osf.io,saradbowman/osf.io,rdhyee/osf.io,hmoco/osf.io,barbour-em/osf.io,kwierman/osf.io,alexschiller/osf.io,caseyrollins/osf.io,jnayak1... | from framework.auth.decorators import must_be_logged_in
from model import Subscription
from flask import request
from modularodm import Q
from modularodm.exceptions import NoResultsFound
from modularodm.storage.mongostorage import KeyExistsException
@must_be_logged_in
def subscribe(auth, **kwargs):
user = auth.us... | from framework.auth.decorators import must_be_logged_in
from model import Subscription
from flask import request
from modularodm import Q
from modularodm.exceptions import NoResultsFound
from modularodm.storage.mongostorage import KeyExistsException
@must_be_logged_in
def subscribe(auth, **kwargs):
user = auth.us... | <commit_before>from framework.auth.decorators import must_be_logged_in
from model import Subscription
from flask import request
from modularodm import Q
from modularodm.exceptions import NoResultsFound
from modularodm.storage.mongostorage import KeyExistsException
@must_be_logged_in
def subscribe(auth, **kwargs):
... | from framework.auth.decorators import must_be_logged_in
from model import Subscription
from flask import request
from modularodm import Q
from modularodm.exceptions import NoResultsFound
from modularodm.storage.mongostorage import KeyExistsException
@must_be_logged_in
def subscribe(auth, **kwargs):
user = auth.us... | from framework.auth.decorators import must_be_logged_in
from model import Subscription
from flask import request
from modularodm import Q
from modularodm.exceptions import NoResultsFound
from modularodm.storage.mongostorage import KeyExistsException
@must_be_logged_in
def subscribe(auth, **kwargs):
user = auth.us... | <commit_before>from framework.auth.decorators import must_be_logged_in
from model import Subscription
from flask import request
from modularodm import Q
from modularodm.exceptions import NoResultsFound
from modularodm.storage.mongostorage import KeyExistsException
@must_be_logged_in
def subscribe(auth, **kwargs):
... |
5b283e1dd48b811b54345de53c177d78e4eb084a | fancypages/__init__.py | fancypages/__init__.py | import os
__version__ = (0, 0, 1, 'alpha', 1)
FP_MAIN_TEMPLATE_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__))
)
| import os
__version__ = (0, 0, 1, 'alpha', 1)
def get_fancypages_paths(path):
return [os.path.join(os.path.dirname(os.path.abspath(__file__)), path)]
| Bring path function in line with oscar fancypages | Bring path function in line with oscar fancypages
| Python | bsd-3-clause | socradev/django-fancypages,tangentlabs/django-fancypages,tangentlabs/django-fancypages,socradev/django-fancypages,socradev/django-fancypages,tangentlabs/django-fancypages | import os
__version__ = (0, 0, 1, 'alpha', 1)
FP_MAIN_TEMPLATE_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__))
)
Bring path function in line with oscar fancypages | import os
__version__ = (0, 0, 1, 'alpha', 1)
def get_fancypages_paths(path):
return [os.path.join(os.path.dirname(os.path.abspath(__file__)), path)]
| <commit_before>import os
__version__ = (0, 0, 1, 'alpha', 1)
FP_MAIN_TEMPLATE_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__))
)
<commit_msg>Bring path function in line with oscar fancypages<commit_after> | import os
__version__ = (0, 0, 1, 'alpha', 1)
def get_fancypages_paths(path):
return [os.path.join(os.path.dirname(os.path.abspath(__file__)), path)]
| import os
__version__ = (0, 0, 1, 'alpha', 1)
FP_MAIN_TEMPLATE_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__))
)
Bring path function in line with oscar fancypagesimport os
__version__ = (0, 0, 1, 'alpha', 1)
def get_fancypages_paths(path):
return [os.path.join(os.path.dirname(os.path.abspath... | <commit_before>import os
__version__ = (0, 0, 1, 'alpha', 1)
FP_MAIN_TEMPLATE_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__))
)
<commit_msg>Bring path function in line with oscar fancypages<commit_after>import os
__version__ = (0, 0, 1, 'alpha', 1)
def get_fancypages_paths(path):
return [os.... |
050c043cbe478ffc5037c9b4d9376325cf731927 | build/adama-package/adama/__init__.py | build/adama-package/adama/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
from .tools import location_of
HERE = location_of(__file__)
__author__ = 'Walter Moreira'
__email__ = '[email protected]'
__version__ = open(os.path.join(HERE, 'VERSION')).read().strip()
from flask import Flask
a... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Walter Moreira'
__email__ = '[email protected]'
__version__ = open('/adama-package/adama/VERSION').read().strip()
from flask import Flask
app = Flask(__name__)
app.debug = True
app.debug_log_format = ('---\n'
'%(asctime)s %(m... | Simplify code for working in container | Simplify code for working in container
| Python | mit | waltermoreira/adama-app,waltermoreira/adama-app,waltermoreira/adama-app | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
from .tools import location_of
HERE = location_of(__file__)
__author__ = 'Walter Moreira'
__email__ = '[email protected]'
__version__ = open(os.path.join(HERE, 'VERSION')).read().strip()
from flask import Flask
a... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Walter Moreira'
__email__ = '[email protected]'
__version__ = open('/adama-package/adama/VERSION').read().strip()
from flask import Flask
app = Flask(__name__)
app.debug = True
app.debug_log_format = ('---\n'
'%(asctime)s %(m... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
from .tools import location_of
HERE = location_of(__file__)
__author__ = 'Walter Moreira'
__email__ = '[email protected]'
__version__ = open(os.path.join(HERE, 'VERSION')).read().strip()
from flask ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Walter Moreira'
__email__ = '[email protected]'
__version__ = open('/adama-package/adama/VERSION').read().strip()
from flask import Flask
app = Flask(__name__)
app.debug = True
app.debug_log_format = ('---\n'
'%(asctime)s %(m... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
from .tools import location_of
HERE = location_of(__file__)
__author__ = 'Walter Moreira'
__email__ = '[email protected]'
__version__ = open(os.path.join(HERE, 'VERSION')).read().strip()
from flask import Flask
a... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
from .tools import location_of
HERE = location_of(__file__)
__author__ = 'Walter Moreira'
__email__ = '[email protected]'
__version__ = open(os.path.join(HERE, 'VERSION')).read().strip()
from flask ... |
e67ad68601b15d136ec9d0489c4700a962cf3391 | hanzo/warctools/__init__.py | hanzo/warctools/__init__.py | from .record import ArchiveRecord
from .warc import WarcRecord
from .arc import ArcRecord
from .mixed import MixedRecord
from .s3 import list_files
from . import record, warc, arc
def expand_files(files):
for file in files:
if file.startswith('s3:'):
for f in list_files(file):
y... | from .record import ArchiveRecord
from .warc import WarcRecord
from .arc import ArcRecord
from .mixed import MixedRecord
from .s3 import list_files
from . import record, warc, arc, s3
def expand_files(files):
for file in files:
if file.startswith('s3:'):
for f in list_files(file):
... | Add s3 lib to package. | Add s3 lib to package.
| Python | mit | internetarchive/warctools,internetarchive/warctools | from .record import ArchiveRecord
from .warc import WarcRecord
from .arc import ArcRecord
from .mixed import MixedRecord
from .s3 import list_files
from . import record, warc, arc
def expand_files(files):
for file in files:
if file.startswith('s3:'):
for f in list_files(file):
y... | from .record import ArchiveRecord
from .warc import WarcRecord
from .arc import ArcRecord
from .mixed import MixedRecord
from .s3 import list_files
from . import record, warc, arc, s3
def expand_files(files):
for file in files:
if file.startswith('s3:'):
for f in list_files(file):
... | <commit_before>from .record import ArchiveRecord
from .warc import WarcRecord
from .arc import ArcRecord
from .mixed import MixedRecord
from .s3 import list_files
from . import record, warc, arc
def expand_files(files):
for file in files:
if file.startswith('s3:'):
for f in list_files(file):
... | from .record import ArchiveRecord
from .warc import WarcRecord
from .arc import ArcRecord
from .mixed import MixedRecord
from .s3 import list_files
from . import record, warc, arc, s3
def expand_files(files):
for file in files:
if file.startswith('s3:'):
for f in list_files(file):
... | from .record import ArchiveRecord
from .warc import WarcRecord
from .arc import ArcRecord
from .mixed import MixedRecord
from .s3 import list_files
from . import record, warc, arc
def expand_files(files):
for file in files:
if file.startswith('s3:'):
for f in list_files(file):
y... | <commit_before>from .record import ArchiveRecord
from .warc import WarcRecord
from .arc import ArcRecord
from .mixed import MixedRecord
from .s3 import list_files
from . import record, warc, arc
def expand_files(files):
for file in files:
if file.startswith('s3:'):
for f in list_files(file):
... |
bc6c6098505a90e3fb1180bd28d9c650c6d1e51d | heltour/tournament/tasks.py | heltour/tournament/tasks.py | from heltour.tournament.models import *
from heltour.tournament import lichessapi
from heltour.celery import app
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
# Disabled for now because of rate-limiting
lichess_teams = [] # ['lichess4545-league']
@app.task(bind=True)
def update_play... | from heltour.tournament.models import *
from heltour.tournament import lichessapi
from heltour.celery import app
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
# Disabled for now because of rate-limiting
lichess_teams = [] # ['lichess4545-league']
@app.task(bind=True)
def update_play... | Add completion log message to the background task | Add completion log message to the background task | Python | mit | cyanfish/heltour,cyanfish/heltour,cyanfish/heltour,cyanfish/heltour | from heltour.tournament.models import *
from heltour.tournament import lichessapi
from heltour.celery import app
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
# Disabled for now because of rate-limiting
lichess_teams = [] # ['lichess4545-league']
@app.task(bind=True)
def update_play... | from heltour.tournament.models import *
from heltour.tournament import lichessapi
from heltour.celery import app
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
# Disabled for now because of rate-limiting
lichess_teams = [] # ['lichess4545-league']
@app.task(bind=True)
def update_play... | <commit_before>from heltour.tournament.models import *
from heltour.tournament import lichessapi
from heltour.celery import app
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
# Disabled for now because of rate-limiting
lichess_teams = [] # ['lichess4545-league']
@app.task(bind=True)
... | from heltour.tournament.models import *
from heltour.tournament import lichessapi
from heltour.celery import app
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
# Disabled for now because of rate-limiting
lichess_teams = [] # ['lichess4545-league']
@app.task(bind=True)
def update_play... | from heltour.tournament.models import *
from heltour.tournament import lichessapi
from heltour.celery import app
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
# Disabled for now because of rate-limiting
lichess_teams = [] # ['lichess4545-league']
@app.task(bind=True)
def update_play... | <commit_before>from heltour.tournament.models import *
from heltour.tournament import lichessapi
from heltour.celery import app
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
# Disabled for now because of rate-limiting
lichess_teams = [] # ['lichess4545-league']
@app.task(bind=True)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.