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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ab8fc00a7dc6618d23e06f06e125da5ee69b2dba | event_registration_hr_contract/__openerp__.py | event_registration_hr_contract/__openerp__.py | # -*- coding: utf-8 -*-
# (c) 2016 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Event Registration Hr Contract",
'version': '8.0.1.1.0',
'license': "AGPL-3",
'author': "AvanzOSC",
'website': "http://www.avanzosc.es",
'contributors': ... | # -*- coding: utf-8 -*-
# (c) 2016 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Event Registration Hr Contract",
'version': '8.0.1.1.0',
'license': "AGPL-3",
'author': "AvanzOSC",
'website': "http://www.avanzosc.es",
'contributors': ... | Remove the dependence with the module hr_contract_stage. | [IMP] event_registration_hr_contract: Remove the dependence with the module hr_contract_stage.
| Python | agpl-3.0 | avanzosc/event-wip | # -*- coding: utf-8 -*-
# (c) 2016 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Event Registration Hr Contract",
'version': '8.0.1.1.0',
'license': "AGPL-3",
'author': "AvanzOSC",
'website': "http://www.avanzosc.es",
'contributors': ... | # -*- coding: utf-8 -*-
# (c) 2016 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Event Registration Hr Contract",
'version': '8.0.1.1.0',
'license': "AGPL-3",
'author': "AvanzOSC",
'website': "http://www.avanzosc.es",
'contributors': ... | <commit_before># -*- coding: utf-8 -*-
# (c) 2016 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Event Registration Hr Contract",
'version': '8.0.1.1.0',
'license': "AGPL-3",
'author': "AvanzOSC",
'website': "http://www.avanzosc.es",
'... | # -*- coding: utf-8 -*-
# (c) 2016 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Event Registration Hr Contract",
'version': '8.0.1.1.0',
'license': "AGPL-3",
'author': "AvanzOSC",
'website': "http://www.avanzosc.es",
'contributors': ... | # -*- coding: utf-8 -*-
# (c) 2016 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Event Registration Hr Contract",
'version': '8.0.1.1.0',
'license': "AGPL-3",
'author': "AvanzOSC",
'website': "http://www.avanzosc.es",
'contributors': ... | <commit_before># -*- coding: utf-8 -*-
# (c) 2016 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Event Registration Hr Contract",
'version': '8.0.1.1.0',
'license': "AGPL-3",
'author': "AvanzOSC",
'website': "http://www.avanzosc.es",
'... |
44a7c59d798d9a20d4d54b9cce7e56b8f88595cc | ch14/caesar.py | ch14/caesar.py | # Caesar Cipher
MAX_KEY_SIZE = 26
def getMode():
while True:
print('Do you wish to encrypt or decrypt a message?')
mode = input().lower()
if mode in 'encrypt e decrypt d'.split():
return mode
else:
print('Enter either "encrypt" or "e" or "decrypt" or "d".')
... | # Caesar Cipher
MAX_KEY_SIZE = 26
def getMode():
while True:
print('Do you wish to encrypt or decrypt a message?')
mode = input().lower()
if mode in 'encrypt e decrypt d'.split():
return mode
else:
print('Enter either "encrypt" or "e" or "decrypt" or "d".')
... | Modify the code in the getKey() function so that it gracefully ignores non-integer input. | Modify the code in the getKey() function so that it gracefully ignores non-integer input.
| Python | bsd-2-clause | aclogreco/InventGamesWP | # Caesar Cipher
MAX_KEY_SIZE = 26
def getMode():
while True:
print('Do you wish to encrypt or decrypt a message?')
mode = input().lower()
if mode in 'encrypt e decrypt d'.split():
return mode
else:
print('Enter either "encrypt" or "e" or "decrypt" or "d".')
... | # Caesar Cipher
MAX_KEY_SIZE = 26
def getMode():
while True:
print('Do you wish to encrypt or decrypt a message?')
mode = input().lower()
if mode in 'encrypt e decrypt d'.split():
return mode
else:
print('Enter either "encrypt" or "e" or "decrypt" or "d".')
... | <commit_before># Caesar Cipher
MAX_KEY_SIZE = 26
def getMode():
while True:
print('Do you wish to encrypt or decrypt a message?')
mode = input().lower()
if mode in 'encrypt e decrypt d'.split():
return mode
else:
print('Enter either "encrypt" or "e" or "decr... | # Caesar Cipher
MAX_KEY_SIZE = 26
def getMode():
while True:
print('Do you wish to encrypt or decrypt a message?')
mode = input().lower()
if mode in 'encrypt e decrypt d'.split():
return mode
else:
print('Enter either "encrypt" or "e" or "decrypt" or "d".')
... | # Caesar Cipher
MAX_KEY_SIZE = 26
def getMode():
while True:
print('Do you wish to encrypt or decrypt a message?')
mode = input().lower()
if mode in 'encrypt e decrypt d'.split():
return mode
else:
print('Enter either "encrypt" or "e" or "decrypt" or "d".')
... | <commit_before># Caesar Cipher
MAX_KEY_SIZE = 26
def getMode():
while True:
print('Do you wish to encrypt or decrypt a message?')
mode = input().lower()
if mode in 'encrypt e decrypt d'.split():
return mode
else:
print('Enter either "encrypt" or "e" or "decr... |
014b4905784f50fd13111ca8528fade9be4bd767 | skimage/feature/__init__.py | skimage/feature/__init__.py | from ._hog import hog
from ._greycomatrix import greycomatrix, greycoprops
from .hog import hog
from .texture import greycomatrix, greycoprops, local_binary_pattern
from .peak import peak_local_max
from ._harris import harris
from .template import match_template
| from ._hog import hog
from .texture import greycomatrix, greycoprops, local_binary_pattern
from .peak import peak_local_max
from ._harris import harris
from .template import match_template
| Fix import bug due to rebase | Fix import bug due to rebase
| Python | bsd-3-clause | blink1073/scikit-image,robintw/scikit-image,emon10005/scikit-image,newville/scikit-image,michaelaye/scikit-image,GaZ3ll3/scikit-image,chintak/scikit-image,chriscrosscutler/scikit-image,warmspringwinds/scikit-image,vighneshbirodkar/scikit-image,robintw/scikit-image,dpshelio/scikit-image,Hiyorimi/scikit-image,youprofit/s... | from ._hog import hog
from ._greycomatrix import greycomatrix, greycoprops
from .hog import hog
from .texture import greycomatrix, greycoprops, local_binary_pattern
from .peak import peak_local_max
from ._harris import harris
from .template import match_template
Fix import bug due to rebase | from ._hog import hog
from .texture import greycomatrix, greycoprops, local_binary_pattern
from .peak import peak_local_max
from ._harris import harris
from .template import match_template
| <commit_before>from ._hog import hog
from ._greycomatrix import greycomatrix, greycoprops
from .hog import hog
from .texture import greycomatrix, greycoprops, local_binary_pattern
from .peak import peak_local_max
from ._harris import harris
from .template import match_template
<commit_msg>Fix import bug due to rebase<c... | from ._hog import hog
from .texture import greycomatrix, greycoprops, local_binary_pattern
from .peak import peak_local_max
from ._harris import harris
from .template import match_template
| from ._hog import hog
from ._greycomatrix import greycomatrix, greycoprops
from .hog import hog
from .texture import greycomatrix, greycoprops, local_binary_pattern
from .peak import peak_local_max
from ._harris import harris
from .template import match_template
Fix import bug due to rebasefrom ._hog import hog
from .t... | <commit_before>from ._hog import hog
from ._greycomatrix import greycomatrix, greycoprops
from .hog import hog
from .texture import greycomatrix, greycoprops, local_binary_pattern
from .peak import peak_local_max
from ._harris import harris
from .template import match_template
<commit_msg>Fix import bug due to rebase<c... |
72865598fbe8658ade68f67da4e2a244a13713b9 | analysis/plot-marker-trajectories.py | analysis/plot-marker-trajectories.py | import climate
import lmj.plot
import numpy as np
import source
import plots
@climate.annotate(
root='load experiment data from this directory',
pattern='plot data from files matching this pattern',
markers='plot traces of these markers',
)
def main(root, pattern='*5/*block00/*circuit00.csv.gz', markers=... | import climate
import lmj.plot
import numpy as np
import source
import plots
@climate.annotate(
root='load experiment data from this directory',
pattern=('plot data from files matching this pattern', 'option'),
markers=('plot traces of these markers', 'option'),
spline=('interpolate data with a splin... | Add command-line flags for spline order and accuracy. | Add command-line flags for spline order and accuracy.
| Python | mit | lmjohns3/cube-experiment,lmjohns3/cube-experiment,lmjohns3/cube-experiment | import climate
import lmj.plot
import numpy as np
import source
import plots
@climate.annotate(
root='load experiment data from this directory',
pattern='plot data from files matching this pattern',
markers='plot traces of these markers',
)
def main(root, pattern='*5/*block00/*circuit00.csv.gz', markers=... | import climate
import lmj.plot
import numpy as np
import source
import plots
@climate.annotate(
root='load experiment data from this directory',
pattern=('plot data from files matching this pattern', 'option'),
markers=('plot traces of these markers', 'option'),
spline=('interpolate data with a splin... | <commit_before>import climate
import lmj.plot
import numpy as np
import source
import plots
@climate.annotate(
root='load experiment data from this directory',
pattern='plot data from files matching this pattern',
markers='plot traces of these markers',
)
def main(root, pattern='*5/*block00/*circuit00.cs... | import climate
import lmj.plot
import numpy as np
import source
import plots
@climate.annotate(
root='load experiment data from this directory',
pattern=('plot data from files matching this pattern', 'option'),
markers=('plot traces of these markers', 'option'),
spline=('interpolate data with a splin... | import climate
import lmj.plot
import numpy as np
import source
import plots
@climate.annotate(
root='load experiment data from this directory',
pattern='plot data from files matching this pattern',
markers='plot traces of these markers',
)
def main(root, pattern='*5/*block00/*circuit00.csv.gz', markers=... | <commit_before>import climate
import lmj.plot
import numpy as np
import source
import plots
@climate.annotate(
root='load experiment data from this directory',
pattern='plot data from files matching this pattern',
markers='plot traces of these markers',
)
def main(root, pattern='*5/*block00/*circuit00.cs... |
d38599b88a4537d92b562010ca4b7e56580f2e35 | graphene_django_extras/directives/__init__.py | graphene_django_extras/directives/__init__.py | # -*- coding: utf-8 -*-
from graphql.type.directives import specified_directives as default_directives
from .list import ShuffleGraphQLDirective, SampleGraphQLDirective
from .numbers import FloorGraphQLDirective, CeilGraphQLDirective
from .string import (
DefaultGraphQLDirective,
Base64GraphQLDirective,
Nu... | # -*- coding: utf-8 -*-
from graphql.type.directives import specified_directives as default_directives
from .date import *
from .list import *
from .numbers import *
from .string import *
all_directives = (
# date
DateGraphQLDirective,
# list
ShuffleGraphQLDirective,
SampleGraphQLDirective,
# ... | Reorder imports and use Black code style. Updated version to 0.4.4 | Reorder imports and use Black code style.
Updated version to 0.4.4
| Python | mit | eamigo86/graphene-django-extras | # -*- coding: utf-8 -*-
from graphql.type.directives import specified_directives as default_directives
from .list import ShuffleGraphQLDirective, SampleGraphQLDirective
from .numbers import FloorGraphQLDirective, CeilGraphQLDirective
from .string import (
DefaultGraphQLDirective,
Base64GraphQLDirective,
Nu... | # -*- coding: utf-8 -*-
from graphql.type.directives import specified_directives as default_directives
from .date import *
from .list import *
from .numbers import *
from .string import *
all_directives = (
# date
DateGraphQLDirective,
# list
ShuffleGraphQLDirective,
SampleGraphQLDirective,
# ... | <commit_before># -*- coding: utf-8 -*-
from graphql.type.directives import specified_directives as default_directives
from .list import ShuffleGraphQLDirective, SampleGraphQLDirective
from .numbers import FloorGraphQLDirective, CeilGraphQLDirective
from .string import (
DefaultGraphQLDirective,
Base64GraphQLDi... | # -*- coding: utf-8 -*-
from graphql.type.directives import specified_directives as default_directives
from .date import *
from .list import *
from .numbers import *
from .string import *
all_directives = (
# date
DateGraphQLDirective,
# list
ShuffleGraphQLDirective,
SampleGraphQLDirective,
# ... | # -*- coding: utf-8 -*-
from graphql.type.directives import specified_directives as default_directives
from .list import ShuffleGraphQLDirective, SampleGraphQLDirective
from .numbers import FloorGraphQLDirective, CeilGraphQLDirective
from .string import (
DefaultGraphQLDirective,
Base64GraphQLDirective,
Nu... | <commit_before># -*- coding: utf-8 -*-
from graphql.type.directives import specified_directives as default_directives
from .list import ShuffleGraphQLDirective, SampleGraphQLDirective
from .numbers import FloorGraphQLDirective, CeilGraphQLDirective
from .string import (
DefaultGraphQLDirective,
Base64GraphQLDi... |
baf41667c9c86484319c58e56187792ed571b6db | certificates/generator.py | certificates/generator.py | from os import system
from os import unlink
from os.path import dirname
from os.path import realpath
def generate_certificate_for(event_id, certificate_name, name_of_certificate_holder):
resources_path = dirname(realpath(__file__)) + '/resources/'
static_files_path = dirname(dirname(realpa... | from os import system
from os import unlink
from os.path import dirname
from os.path import realpath
def generate_certificate_for(event_id, certificate_name, name_of_certificate_holder):
resources_path = dirname(realpath(__file__)) + '/resources/'
static_files_path = dirname(dirname(realpa... | Fix writing UTF-8 texts to certificate templates | Fix writing UTF-8 texts to certificate templates
The certificate PDF can’t reliably render all variants of UTF-8 text.
We will need to disable non-ASCII input. | Python | mit | codeeu/coding-events,codeeu/coding-events,codeeu/coding-events,codeeu/coding-events,codeeu/coding-events | from os import system
from os import unlink
from os.path import dirname
from os.path import realpath
def generate_certificate_for(event_id, certificate_name, name_of_certificate_holder):
resources_path = dirname(realpath(__file__)) + '/resources/'
static_files_path = dirname(dirname(realpa... | from os import system
from os import unlink
from os.path import dirname
from os.path import realpath
def generate_certificate_for(event_id, certificate_name, name_of_certificate_holder):
resources_path = dirname(realpath(__file__)) + '/resources/'
static_files_path = dirname(dirname(realpa... | <commit_before>from os import system
from os import unlink
from os.path import dirname
from os.path import realpath
def generate_certificate_for(event_id, certificate_name, name_of_certificate_holder):
resources_path = dirname(realpath(__file__)) + '/resources/'
static_files_path = dirname... | from os import system
from os import unlink
from os.path import dirname
from os.path import realpath
def generate_certificate_for(event_id, certificate_name, name_of_certificate_holder):
resources_path = dirname(realpath(__file__)) + '/resources/'
static_files_path = dirname(dirname(realpa... | from os import system
from os import unlink
from os.path import dirname
from os.path import realpath
def generate_certificate_for(event_id, certificate_name, name_of_certificate_holder):
resources_path = dirname(realpath(__file__)) + '/resources/'
static_files_path = dirname(dirname(realpa... | <commit_before>from os import system
from os import unlink
from os.path import dirname
from os.path import realpath
def generate_certificate_for(event_id, certificate_name, name_of_certificate_holder):
resources_path = dirname(realpath(__file__)) + '/resources/'
static_files_path = dirname... |
5bad3f45bdca436515b416bbcfb45ca53b46ca2a | application/lomadee/data_importer.py | application/lomadee/data_importer.py | from django.conf import settings
from urllib.parse import urljoin, urlencode
class ComputerDataImporter(object):
def __init__(self):
pass
def build_api_url(self, **kwargs):
api_url = urljoin(settings.LOMADEE_API_URL, settings.LOMADEE_APP_TOKEN)
# Specific path to 'Computer' category... | from django.conf import settings
from urllib.parse import urljoin, urlencode
import requests
class ComputerDataImporter(object):
def __init__(self):
pass
def build_api_url(self, **kwargs):
api_url = urljoin(settings.LOMADEE_API_URL, settings.LOMADEE_APP_TOKEN)
# Specific path to 'Co... | Add get_data method to data importer | Add get_data method to data importer
Signed-off-by: Matheus Fernandes <9de26933bf4170c6685be29c190c23bc8c34d55f@gmail.com>
| Python | mit | msfernandes/facebook-chatbot | from django.conf import settings
from urllib.parse import urljoin, urlencode
class ComputerDataImporter(object):
def __init__(self):
pass
def build_api_url(self, **kwargs):
api_url = urljoin(settings.LOMADEE_API_URL, settings.LOMADEE_APP_TOKEN)
# Specific path to 'Computer' category... | from django.conf import settings
from urllib.parse import urljoin, urlencode
import requests
class ComputerDataImporter(object):
def __init__(self):
pass
def build_api_url(self, **kwargs):
api_url = urljoin(settings.LOMADEE_API_URL, settings.LOMADEE_APP_TOKEN)
# Specific path to 'Co... | <commit_before>from django.conf import settings
from urllib.parse import urljoin, urlencode
class ComputerDataImporter(object):
def __init__(self):
pass
def build_api_url(self, **kwargs):
api_url = urljoin(settings.LOMADEE_API_URL, settings.LOMADEE_APP_TOKEN)
# Specific path to 'Com... | from django.conf import settings
from urllib.parse import urljoin, urlencode
import requests
class ComputerDataImporter(object):
def __init__(self):
pass
def build_api_url(self, **kwargs):
api_url = urljoin(settings.LOMADEE_API_URL, settings.LOMADEE_APP_TOKEN)
# Specific path to 'Co... | from django.conf import settings
from urllib.parse import urljoin, urlencode
class ComputerDataImporter(object):
def __init__(self):
pass
def build_api_url(self, **kwargs):
api_url = urljoin(settings.LOMADEE_API_URL, settings.LOMADEE_APP_TOKEN)
# Specific path to 'Computer' category... | <commit_before>from django.conf import settings
from urllib.parse import urljoin, urlencode
class ComputerDataImporter(object):
def __init__(self):
pass
def build_api_url(self, **kwargs):
api_url = urljoin(settings.LOMADEE_API_URL, settings.LOMADEE_APP_TOKEN)
# Specific path to 'Com... |
b08bff08d69960c9035cefa4e4021d48530c5158 | anemoi/Tests/test_Analytical.py | anemoi/Tests/test_Analytical.py | import unittest
import numpy as np
from anemoi import AnalyticalHelmholtz
class TestMiniZephyr(unittest.TestCase):
def setUp(self):
pass
def test_forwardModelling(self):
nx = 100
nz = 200
systemConfig = {
'dx': 1., # m
'dz': 1., # ... | import unittest
import numpy as np
from anemoi import AnalyticalHelmholtz
class TestAnalyticalHelmholtz(unittest.TestCase):
def setUp(self):
pass
def test_cleanExecution(self):
nx = 100
nz = 200
systemConfig = {
'c': 2500., # m/s
'nx': n... | Rename one test, use default dx and dz, fix naming of test class. | Rename one test, use default dx and dz, fix naming of test class.
| Python | mit | uwoseis/zephyr,uwoseis/anemoi | import unittest
import numpy as np
from anemoi import AnalyticalHelmholtz
class TestMiniZephyr(unittest.TestCase):
def setUp(self):
pass
def test_forwardModelling(self):
nx = 100
nz = 200
systemConfig = {
'dx': 1., # m
'dz': 1., # ... | import unittest
import numpy as np
from anemoi import AnalyticalHelmholtz
class TestAnalyticalHelmholtz(unittest.TestCase):
def setUp(self):
pass
def test_cleanExecution(self):
nx = 100
nz = 200
systemConfig = {
'c': 2500., # m/s
'nx': n... | <commit_before>import unittest
import numpy as np
from anemoi import AnalyticalHelmholtz
class TestMiniZephyr(unittest.TestCase):
def setUp(self):
pass
def test_forwardModelling(self):
nx = 100
nz = 200
systemConfig = {
'dx': 1., # m
'dz': ... | import unittest
import numpy as np
from anemoi import AnalyticalHelmholtz
class TestAnalyticalHelmholtz(unittest.TestCase):
def setUp(self):
pass
def test_cleanExecution(self):
nx = 100
nz = 200
systemConfig = {
'c': 2500., # m/s
'nx': n... | import unittest
import numpy as np
from anemoi import AnalyticalHelmholtz
class TestMiniZephyr(unittest.TestCase):
def setUp(self):
pass
def test_forwardModelling(self):
nx = 100
nz = 200
systemConfig = {
'dx': 1., # m
'dz': 1., # ... | <commit_before>import unittest
import numpy as np
from anemoi import AnalyticalHelmholtz
class TestMiniZephyr(unittest.TestCase):
def setUp(self):
pass
def test_forwardModelling(self):
nx = 100
nz = 200
systemConfig = {
'dx': 1., # m
'dz': ... |
e97b5d343ca80ff050fca6d37efffcfe739b42e0 | cloud_maker/py_version.py | cloud_maker/py_version.py | # vim: fileencoding=utf-8
from __future__ import print_function, absolute_import, unicode_literals
import sys
class VersionError (ValueError):
pass
def check_ex ():
major, minor, patch = sys.version_info[0:2]
if major == 3:
if minor < 3 or (minor == 3 and patch < 4):
raise VersionError... | # vim: fileencoding=utf-8
from __future__ import print_function, absolute_import, unicode_literals
import sys
class VersionError (ValueError):
pass
def check_ex ():
v = sys.version_info
if v.major == 3:
if v.minor < 3 or (v.minor == 3 and v.micro < 4):
raise VersionError("Error: this i... | Fix usage of `version_info` on Python 2. | Fix usage of `version_info` on Python 2.
| Python | mit | sapphirecat/cloud-maker,sapphirecat/cloud-maker | # vim: fileencoding=utf-8
from __future__ import print_function, absolute_import, unicode_literals
import sys
class VersionError (ValueError):
pass
def check_ex ():
major, minor, patch = sys.version_info[0:2]
if major == 3:
if minor < 3 or (minor == 3 and patch < 4):
raise VersionError... | # vim: fileencoding=utf-8
from __future__ import print_function, absolute_import, unicode_literals
import sys
class VersionError (ValueError):
pass
def check_ex ():
v = sys.version_info
if v.major == 3:
if v.minor < 3 or (v.minor == 3 and v.micro < 4):
raise VersionError("Error: this i... | <commit_before># vim: fileencoding=utf-8
from __future__ import print_function, absolute_import, unicode_literals
import sys
class VersionError (ValueError):
pass
def check_ex ():
major, minor, patch = sys.version_info[0:2]
if major == 3:
if minor < 3 or (minor == 3 and patch < 4):
rai... | # vim: fileencoding=utf-8
from __future__ import print_function, absolute_import, unicode_literals
import sys
class VersionError (ValueError):
pass
def check_ex ():
v = sys.version_info
if v.major == 3:
if v.minor < 3 or (v.minor == 3 and v.micro < 4):
raise VersionError("Error: this i... | # vim: fileencoding=utf-8
from __future__ import print_function, absolute_import, unicode_literals
import sys
class VersionError (ValueError):
pass
def check_ex ():
major, minor, patch = sys.version_info[0:2]
if major == 3:
if minor < 3 or (minor == 3 and patch < 4):
raise VersionError... | <commit_before># vim: fileencoding=utf-8
from __future__ import print_function, absolute_import, unicode_literals
import sys
class VersionError (ValueError):
pass
def check_ex ():
major, minor, patch = sys.version_info[0:2]
if major == 3:
if minor < 3 or (minor == 3 and patch < 4):
rai... |
036a5f879ddf6f8c2f1ae3bfea6a58962783f949 | moocng/portal/management/commands/mailtest.py | moocng/portal/management/commands/mailtest.py | # Copyright 2013 Rooter Analysis S.L.
#
# 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 w... | # Copyright 2013 Rooter Analysis S.L.
#
# 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 w... | Change subject to every mail to was sent | Change subject to every mail to was sent
| Python | apache-2.0 | OpenMOOC/moocng,GeographicaGS/moocng,GeographicaGS/moocng,GeographicaGS/moocng,OpenMOOC/moocng,GeographicaGS/moocng | # Copyright 2013 Rooter Analysis S.L.
#
# 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 w... | # Copyright 2013 Rooter Analysis S.L.
#
# 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 w... | <commit_before># Copyright 2013 Rooter Analysis S.L.
#
# 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... | # Copyright 2013 Rooter Analysis S.L.
#
# 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 w... | # Copyright 2013 Rooter Analysis S.L.
#
# 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 w... | <commit_before># Copyright 2013 Rooter Analysis S.L.
#
# 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... |
08b4fae4352f68a524d51a7e14767e5b093c4a73 | social_django/migrations/0005_auto_20160727_2333.py | social_django/migrations/0005_auto_20160727_2333.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-28 02:33
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
replaces = [
('default', '0005_auto_20160727_2333'),
('social_auth', '0005_auto_20160727_2333')
]
depend... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-28 02:33
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
replaces = [
('social_auth', '0005_auto_20160727_2333')
]
dependencies = [
('social_django', '0004_auto_... | Remove replacement of non existing migration | Remove replacement of non existing migration
Fixes #16
| Python | bsd-3-clause | python-social-auth/social-app-django,python-social-auth/social-app-django,python-social-auth/social-app-django | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-28 02:33
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
replaces = [
('default', '0005_auto_20160727_2333'),
('social_auth', '0005_auto_20160727_2333')
]
depend... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-28 02:33
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
replaces = [
('social_auth', '0005_auto_20160727_2333')
]
dependencies = [
('social_django', '0004_auto_... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-28 02:33
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
replaces = [
('default', '0005_auto_20160727_2333'),
('social_auth', '0005_auto_20160727_2333')
... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-28 02:33
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
replaces = [
('social_auth', '0005_auto_20160727_2333')
]
dependencies = [
('social_django', '0004_auto_... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-28 02:33
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
replaces = [
('default', '0005_auto_20160727_2333'),
('social_auth', '0005_auto_20160727_2333')
]
depend... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-28 02:33
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
replaces = [
('default', '0005_auto_20160727_2333'),
('social_auth', '0005_auto_20160727_2333')
... |
8b9f064a7544360f9932ec03c92ea77b4382f2e3 | git-keeper-robot/gkeeprobot/dectorators.py | git-keeper-robot/gkeeprobot/dectorators.py | # Copyright 2018 Nathan Sommer and Ben Coleman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is dis... | # Copyright 2018 Nathan Sommer and Ben Coleman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is dis... | Increase polling freqency to speed up tests. | Increase polling freqency to speed up tests.
| Python | agpl-3.0 | git-keeper/git-keeper,git-keeper/git-keeper | # Copyright 2018 Nathan Sommer and Ben Coleman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is dis... | # Copyright 2018 Nathan Sommer and Ben Coleman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is dis... | <commit_before># Copyright 2018 Nathan Sommer and Ben Coleman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This... | # Copyright 2018 Nathan Sommer and Ben Coleman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is dis... | # Copyright 2018 Nathan Sommer and Ben Coleman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is dis... | <commit_before># Copyright 2018 Nathan Sommer and Ben Coleman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This... |
042c11e298dd76c16ef84b2ee1d96d75de6203d4 | print_traceback.py | print_traceback.py | import sys
import traceback
class CustomException(Exception):
def __init__(self, *args, **kwargs):
super(CustomException, self).__init__(*args, **kwargs)
def custom_function():
raise CustomException('Test to raise custom exception.')
try:
custom_function()
except:
_type, _value, _traceback = sys... | import sys
import traceback
class CustomException(Exception):
def __init__(self, *args, **kwargs):
super(CustomException, self).__init__(*args, **kwargs)
def custom_deep_function():
raise CustomException('Test to raise custom exception.')
def custom_function():
custom_deep_function()
try:
custom_f... | Print stack trace of exception. | Print stack trace of exception.
| Python | mit | iandmyhand/python-utils | import sys
import traceback
class CustomException(Exception):
def __init__(self, *args, **kwargs):
super(CustomException, self).__init__(*args, **kwargs)
def custom_function():
raise CustomException('Test to raise custom exception.')
try:
custom_function()
except:
_type, _value, _traceback = sys... | import sys
import traceback
class CustomException(Exception):
def __init__(self, *args, **kwargs):
super(CustomException, self).__init__(*args, **kwargs)
def custom_deep_function():
raise CustomException('Test to raise custom exception.')
def custom_function():
custom_deep_function()
try:
custom_f... | <commit_before>import sys
import traceback
class CustomException(Exception):
def __init__(self, *args, **kwargs):
super(CustomException, self).__init__(*args, **kwargs)
def custom_function():
raise CustomException('Test to raise custom exception.')
try:
custom_function()
except:
_type, _value, _... | import sys
import traceback
class CustomException(Exception):
def __init__(self, *args, **kwargs):
super(CustomException, self).__init__(*args, **kwargs)
def custom_deep_function():
raise CustomException('Test to raise custom exception.')
def custom_function():
custom_deep_function()
try:
custom_f... | import sys
import traceback
class CustomException(Exception):
def __init__(self, *args, **kwargs):
super(CustomException, self).__init__(*args, **kwargs)
def custom_function():
raise CustomException('Test to raise custom exception.')
try:
custom_function()
except:
_type, _value, _traceback = sys... | <commit_before>import sys
import traceback
class CustomException(Exception):
def __init__(self, *args, **kwargs):
super(CustomException, self).__init__(*args, **kwargs)
def custom_function():
raise CustomException('Test to raise custom exception.')
try:
custom_function()
except:
_type, _value, _... |
75f7ff7754eee79da9cd0a430a4fa16af21cdd4d | adhocracy4/actions/signals.py | adhocracy4/actions/signals.py | from django.apps import apps
from django.conf import settings
from django.db.models.signals import post_save
from .models import Action
from .verbs import Verbs
def _extract_target(instance):
target = None
if hasattr(instance, 'content_object'):
target = instance.content_object
elif hasattr(insta... | from itertools import chain
from django.apps import apps
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db.models.signals import post_delete, post_save
from .models import Action
from .verbs import Verbs
SYSTEM_ACTIONABLES = (
('a4phases', 'Phase'),
('... | Delete Actions if the related object is deleted | Delete Actions if the related object is deleted
As we are loosing all the information when the object of an action is
deleted, the action itself may be deleted, too.
| Python | agpl-3.0 | liqd/adhocracy4,liqd/adhocracy4,liqd/adhocracy4,liqd/adhocracy4 | from django.apps import apps
from django.conf import settings
from django.db.models.signals import post_save
from .models import Action
from .verbs import Verbs
def _extract_target(instance):
target = None
if hasattr(instance, 'content_object'):
target = instance.content_object
elif hasattr(insta... | from itertools import chain
from django.apps import apps
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db.models.signals import post_delete, post_save
from .models import Action
from .verbs import Verbs
SYSTEM_ACTIONABLES = (
('a4phases', 'Phase'),
('... | <commit_before>from django.apps import apps
from django.conf import settings
from django.db.models.signals import post_save
from .models import Action
from .verbs import Verbs
def _extract_target(instance):
target = None
if hasattr(instance, 'content_object'):
target = instance.content_object
eli... | from itertools import chain
from django.apps import apps
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db.models.signals import post_delete, post_save
from .models import Action
from .verbs import Verbs
SYSTEM_ACTIONABLES = (
('a4phases', 'Phase'),
('... | from django.apps import apps
from django.conf import settings
from django.db.models.signals import post_save
from .models import Action
from .verbs import Verbs
def _extract_target(instance):
target = None
if hasattr(instance, 'content_object'):
target = instance.content_object
elif hasattr(insta... | <commit_before>from django.apps import apps
from django.conf import settings
from django.db.models.signals import post_save
from .models import Action
from .verbs import Verbs
def _extract_target(instance):
target = None
if hasattr(instance, 'content_object'):
target = instance.content_object
eli... |
c5cd62969ebee36c99923ad7a5b9e7c527bff6cc | quantecon/__init__.py | quantecon/__init__.py | """
Import the main names to top level.
"""
try:
import numba
except:
raise ImportError("Cannot import numba from current anaconda distribution. Please run `conda install numba` to install the latest version.")
from .compute_fp import compute_fixed_point
from .discrete_rv import DiscreteRV
from .ecdf import ECDF
fr... | """
Import the main names to top level.
"""
try:
import numba
except:
raise ImportError("Cannot import numba from current anaconda distribution. Please run `conda install numba` to install the latest version.")
#-Modules-#
from . import quad
from . import random
#-Objects-#
from .compute_fp import compute_fixed_po... | Update base api to include module and object imports, fix missing import of random subpackage | Update base api to include module and object imports, fix missing import of random subpackage
| Python | bsd-3-clause | QuantEcon/QuantEcon.py,oyamad/QuantEcon.py,oyamad/QuantEcon.py,QuantEcon/QuantEcon.py | """
Import the main names to top level.
"""
try:
import numba
except:
raise ImportError("Cannot import numba from current anaconda distribution. Please run `conda install numba` to install the latest version.")
from .compute_fp import compute_fixed_point
from .discrete_rv import DiscreteRV
from .ecdf import ECDF
fr... | """
Import the main names to top level.
"""
try:
import numba
except:
raise ImportError("Cannot import numba from current anaconda distribution. Please run `conda install numba` to install the latest version.")
#-Modules-#
from . import quad
from . import random
#-Objects-#
from .compute_fp import compute_fixed_po... | <commit_before>"""
Import the main names to top level.
"""
try:
import numba
except:
raise ImportError("Cannot import numba from current anaconda distribution. Please run `conda install numba` to install the latest version.")
from .compute_fp import compute_fixed_point
from .discrete_rv import DiscreteRV
from .ecdf... | """
Import the main names to top level.
"""
try:
import numba
except:
raise ImportError("Cannot import numba from current anaconda distribution. Please run `conda install numba` to install the latest version.")
#-Modules-#
from . import quad
from . import random
#-Objects-#
from .compute_fp import compute_fixed_po... | """
Import the main names to top level.
"""
try:
import numba
except:
raise ImportError("Cannot import numba from current anaconda distribution. Please run `conda install numba` to install the latest version.")
from .compute_fp import compute_fixed_point
from .discrete_rv import DiscreteRV
from .ecdf import ECDF
fr... | <commit_before>"""
Import the main names to top level.
"""
try:
import numba
except:
raise ImportError("Cannot import numba from current anaconda distribution. Please run `conda install numba` to install the latest version.")
from .compute_fp import compute_fixed_point
from .discrete_rv import DiscreteRV
from .ecdf... |
05ecac15aa9b975bd83378daa0560182041bef97 | src/format_go_correspondance.py | src/format_go_correspondance.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import argparse
import re
def format_go_correspondance(args):
go = {}
with open(args.go_correspondance_input, "r") as go_correspondance_input:
for line in go_correspondance_input.readlines():
split_line = line[:-1].split('\... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import argparse
import re
def format_go_correspondance(args):
go = {}
with open(args.go_correspondance_input, "r") as go_correspondance_input:
for line in go_correspondance_input.readlines():
if not line.startswith('GO'):
... | Add test for go correspondance file begin | Add test for go correspondance file begin
| Python | apache-2.0 | ASaiM/group_humann2_uniref_abundances_to_GO,ASaiM/group_humann2_uniref_abundances_to_GO | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import argparse
import re
def format_go_correspondance(args):
go = {}
with open(args.go_correspondance_input, "r") as go_correspondance_input:
for line in go_correspondance_input.readlines():
split_line = line[:-1].split('\... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import argparse
import re
def format_go_correspondance(args):
go = {}
with open(args.go_correspondance_input, "r") as go_correspondance_input:
for line in go_correspondance_input.readlines():
if not line.startswith('GO'):
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import argparse
import re
def format_go_correspondance(args):
go = {}
with open(args.go_correspondance_input, "r") as go_correspondance_input:
for line in go_correspondance_input.readlines():
split_line = lin... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import argparse
import re
def format_go_correspondance(args):
go = {}
with open(args.go_correspondance_input, "r") as go_correspondance_input:
for line in go_correspondance_input.readlines():
if not line.startswith('GO'):
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import argparse
import re
def format_go_correspondance(args):
go = {}
with open(args.go_correspondance_input, "r") as go_correspondance_input:
for line in go_correspondance_input.readlines():
split_line = line[:-1].split('\... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import argparse
import re
def format_go_correspondance(args):
go = {}
with open(args.go_correspondance_input, "r") as go_correspondance_input:
for line in go_correspondance_input.readlines():
split_line = lin... |
52933f030b246615429ac74f7f156b7a33225d7f | opengrid/tests/test_plotting.py | opengrid/tests/test_plotting.py | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 30 02:37:25 2013
@author: Jan
"""
import unittest
class PlotStyleTest(unittest.TestCase):
def test_default(self):
from opengrid.library.plotting import plot_style
plt = plot_style()
class CarpetTest(unittest.TestCase):
def test_default(self):
... | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 30 02:37:25 2013
@author: Jan
"""
import unittest
import pandas as pd
from opengrid.library import plotting
class PlotStyleTest(unittest.TestCase):
def test_default(self):
plt = plotting.plot_style()
class CarpetTest(unittest.TestCase):
def test_defau... | Resolve RuntimeError: Invalid DISPLAY variable - tst | [BLD] Resolve RuntimeError: Invalid DISPLAY variable - tst
| Python | apache-2.0 | opengridcc/opengrid | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 30 02:37:25 2013
@author: Jan
"""
import unittest
class PlotStyleTest(unittest.TestCase):
def test_default(self):
from opengrid.library.plotting import plot_style
plt = plot_style()
class CarpetTest(unittest.TestCase):
def test_default(self):
... | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 30 02:37:25 2013
@author: Jan
"""
import unittest
import pandas as pd
from opengrid.library import plotting
class PlotStyleTest(unittest.TestCase):
def test_default(self):
plt = plotting.plot_style()
class CarpetTest(unittest.TestCase):
def test_defau... | <commit_before># -*- coding: utf-8 -*-
"""
Created on Mon Dec 30 02:37:25 2013
@author: Jan
"""
import unittest
class PlotStyleTest(unittest.TestCase):
def test_default(self):
from opengrid.library.plotting import plot_style
plt = plot_style()
class CarpetTest(unittest.TestCase):
def test_... | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 30 02:37:25 2013
@author: Jan
"""
import unittest
import pandas as pd
from opengrid.library import plotting
class PlotStyleTest(unittest.TestCase):
def test_default(self):
plt = plotting.plot_style()
class CarpetTest(unittest.TestCase):
def test_defau... | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 30 02:37:25 2013
@author: Jan
"""
import unittest
class PlotStyleTest(unittest.TestCase):
def test_default(self):
from opengrid.library.plotting import plot_style
plt = plot_style()
class CarpetTest(unittest.TestCase):
def test_default(self):
... | <commit_before># -*- coding: utf-8 -*-
"""
Created on Mon Dec 30 02:37:25 2013
@author: Jan
"""
import unittest
class PlotStyleTest(unittest.TestCase):
def test_default(self):
from opengrid.library.plotting import plot_style
plt = plot_style()
class CarpetTest(unittest.TestCase):
def test_... |
33e1c57cd6186820fb95b5d04a1f494710b2ccbe | democracy_club/apps/authorities/management/commands/import_mapit_area_type.py | democracy_club/apps/authorities/management/commands/import_mapit_area_type.py | import time
import requests
from bs4 import BeautifulSoup
from django.core.management.base import BaseCommand
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.geos import Point
from authorities.models import Authority, MapitArea
from authorities import constants
from authorities.helpers impor... | """
DIW
MTW
UTW
"""
import time
import requests
from bs4 import BeautifulSoup
from django.core.management.base import BaseCommand
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.geos import Point
from authorities.models import Authority, MapitArea
from authorities import constants
from auth... | Comment for types of area that need importing | Comment for types of area that need importing
| Python | bsd-3-clause | DemocracyClub/Website,DemocracyClub/Website,DemocracyClub/Website,DemocracyClub/Website | import time
import requests
from bs4 import BeautifulSoup
from django.core.management.base import BaseCommand
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.geos import Point
from authorities.models import Authority, MapitArea
from authorities import constants
from authorities.helpers impor... | """
DIW
MTW
UTW
"""
import time
import requests
from bs4 import BeautifulSoup
from django.core.management.base import BaseCommand
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.geos import Point
from authorities.models import Authority, MapitArea
from authorities import constants
from auth... | <commit_before>import time
import requests
from bs4 import BeautifulSoup
from django.core.management.base import BaseCommand
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.geos import Point
from authorities.models import Authority, MapitArea
from authorities import constants
from authoritie... | """
DIW
MTW
UTW
"""
import time
import requests
from bs4 import BeautifulSoup
from django.core.management.base import BaseCommand
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.geos import Point
from authorities.models import Authority, MapitArea
from authorities import constants
from auth... | import time
import requests
from bs4 import BeautifulSoup
from django.core.management.base import BaseCommand
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.geos import Point
from authorities.models import Authority, MapitArea
from authorities import constants
from authorities.helpers impor... | <commit_before>import time
import requests
from bs4 import BeautifulSoup
from django.core.management.base import BaseCommand
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.geos import Point
from authorities.models import Authority, MapitArea
from authorities import constants
from authoritie... |
c9c106f37c9fbbca1a93348695563e2587bc0c65 | manoseimas/lobbyists/urls.py | manoseimas/lobbyists/urls.py | from django.conf.urls import include, patterns, url
from manoseimas.lobbyists import views
urlpatterns = patterns(
'',
url(r'^$', 'manoseimas.lobbyists.views.lobbyists.lobbyist_list'),
url(r'^lobbyist/(?P<lobbyist_slug>.+)/$',
views.lobbyist_profile, name='lobbyist_profile'),
url(r'^json/', in... | from django.conf.urls import include, patterns, url
from manoseimas.lobbyists import views
urlpatterns = patterns(
'',
url(r'^$', 'manoseimas.lobbyists.views.lobbyists.lobbyist_list'),
url(r'^lobbyist/(?P<lobbyist_slug>.+)/',
views.lobbyist_profile, name='lobbyist_profile'),
url(r'^json/', inc... | Remove a useless trailing $ | Remove a useless trailing $
| Python | agpl-3.0 | ManoSeimas/manoseimas.lt,ManoSeimas/manoseimas.lt,ManoSeimas/manoseimas.lt,ManoSeimas/manoseimas.lt | from django.conf.urls import include, patterns, url
from manoseimas.lobbyists import views
urlpatterns = patterns(
'',
url(r'^$', 'manoseimas.lobbyists.views.lobbyists.lobbyist_list'),
url(r'^lobbyist/(?P<lobbyist_slug>.+)/$',
views.lobbyist_profile, name='lobbyist_profile'),
url(r'^json/', in... | from django.conf.urls import include, patterns, url
from manoseimas.lobbyists import views
urlpatterns = patterns(
'',
url(r'^$', 'manoseimas.lobbyists.views.lobbyists.lobbyist_list'),
url(r'^lobbyist/(?P<lobbyist_slug>.+)/',
views.lobbyist_profile, name='lobbyist_profile'),
url(r'^json/', inc... | <commit_before>from django.conf.urls import include, patterns, url
from manoseimas.lobbyists import views
urlpatterns = patterns(
'',
url(r'^$', 'manoseimas.lobbyists.views.lobbyists.lobbyist_list'),
url(r'^lobbyist/(?P<lobbyist_slug>.+)/$',
views.lobbyist_profile, name='lobbyist_profile'),
ur... | from django.conf.urls import include, patterns, url
from manoseimas.lobbyists import views
urlpatterns = patterns(
'',
url(r'^$', 'manoseimas.lobbyists.views.lobbyists.lobbyist_list'),
url(r'^lobbyist/(?P<lobbyist_slug>.+)/',
views.lobbyist_profile, name='lobbyist_profile'),
url(r'^json/', inc... | from django.conf.urls import include, patterns, url
from manoseimas.lobbyists import views
urlpatterns = patterns(
'',
url(r'^$', 'manoseimas.lobbyists.views.lobbyists.lobbyist_list'),
url(r'^lobbyist/(?P<lobbyist_slug>.+)/$',
views.lobbyist_profile, name='lobbyist_profile'),
url(r'^json/', in... | <commit_before>from django.conf.urls import include, patterns, url
from manoseimas.lobbyists import views
urlpatterns = patterns(
'',
url(r'^$', 'manoseimas.lobbyists.views.lobbyists.lobbyist_list'),
url(r'^lobbyist/(?P<lobbyist_slug>.+)/$',
views.lobbyist_profile, name='lobbyist_profile'),
ur... |
cc8e643902eb46f9e9d73a4367518e6ab6195308 | kindergarten-garden/kindergarten_garden.py | kindergarten-garden/kindergarten_garden.py | # File: kindergarten_garden.py
# Purpose: Write a program that, given a diagram, can tell you which plants each child in the kindergarten class is responsible for.
# Programmer: Amal Shehu
# Course: Exercism
# Date: Thursday 10th September 2016, 10:51 PM
| # File: kindergarten_garden.py
# Purpose: Write a program that, given a diagram, can tell you which plants each child in the kindergarten class is responsible for.
# Programmer: Amal Shehu
# Course: Exercism
# Date: Thursday 10th September 2016, 10:51 PM
class Garden(object):
plant_... | Add plant names and childs | Add plant names and childs
| Python | mit | amalshehu/exercism-python | # File: kindergarten_garden.py
# Purpose: Write a program that, given a diagram, can tell you which plants each child in the kindergarten class is responsible for.
# Programmer: Amal Shehu
# Course: Exercism
# Date: Thursday 10th September 2016, 10:51 PM
Add plant names and childs | # File: kindergarten_garden.py
# Purpose: Write a program that, given a diagram, can tell you which plants each child in the kindergarten class is responsible for.
# Programmer: Amal Shehu
# Course: Exercism
# Date: Thursday 10th September 2016, 10:51 PM
class Garden(object):
plant_... | <commit_before># File: kindergarten_garden.py
# Purpose: Write a program that, given a diagram, can tell you which plants each child in the kindergarten class is responsible for.
# Programmer: Amal Shehu
# Course: Exercism
# Date: Thursday 10th September 2016, 10:51 PM
<commit_msg>Add plant name... | # File: kindergarten_garden.py
# Purpose: Write a program that, given a diagram, can tell you which plants each child in the kindergarten class is responsible for.
# Programmer: Amal Shehu
# Course: Exercism
# Date: Thursday 10th September 2016, 10:51 PM
class Garden(object):
plant_... | # File: kindergarten_garden.py
# Purpose: Write a program that, given a diagram, can tell you which plants each child in the kindergarten class is responsible for.
# Programmer: Amal Shehu
# Course: Exercism
# Date: Thursday 10th September 2016, 10:51 PM
Add plant names and childs# File: ... | <commit_before># File: kindergarten_garden.py
# Purpose: Write a program that, given a diagram, can tell you which plants each child in the kindergarten class is responsible for.
# Programmer: Amal Shehu
# Course: Exercism
# Date: Thursday 10th September 2016, 10:51 PM
<commit_msg>Add plant name... |
c386e9608eecc1e21fb30f073800755713267c07 | rex/network_feeder.py | rex/network_feeder.py |
import time
import threading
import socket
class NetworkFeeder:
"""
A class that feeds data to a socket port
"""
def __init__(self, proto, host, port, data, is_client=True, delay=3, timeout=2):
if not is_client:
raise NotImplementedError("Server mode is not implemented.")
... |
import time
import threading
import socket
class NetworkFeeder:
"""
A class that feeds data to a socket port
"""
def __init__(self, proto, host, port, data, is_client=True, delay=5, timeout=2):
if not is_client:
raise NotImplementedError("Server mode is not implemented.")
... | Set default delay to 5 seconds (because of my slow laptop). | NetworkFeeder: Set default delay to 5 seconds (because of my slow laptop).
| Python | bsd-2-clause | shellphish/rex,shellphish/rex |
import time
import threading
import socket
class NetworkFeeder:
"""
A class that feeds data to a socket port
"""
def __init__(self, proto, host, port, data, is_client=True, delay=3, timeout=2):
if not is_client:
raise NotImplementedError("Server mode is not implemented.")
... |
import time
import threading
import socket
class NetworkFeeder:
"""
A class that feeds data to a socket port
"""
def __init__(self, proto, host, port, data, is_client=True, delay=5, timeout=2):
if not is_client:
raise NotImplementedError("Server mode is not implemented.")
... | <commit_before>
import time
import threading
import socket
class NetworkFeeder:
"""
A class that feeds data to a socket port
"""
def __init__(self, proto, host, port, data, is_client=True, delay=3, timeout=2):
if not is_client:
raise NotImplementedError("Server mode is not implem... |
import time
import threading
import socket
class NetworkFeeder:
"""
A class that feeds data to a socket port
"""
def __init__(self, proto, host, port, data, is_client=True, delay=5, timeout=2):
if not is_client:
raise NotImplementedError("Server mode is not implemented.")
... |
import time
import threading
import socket
class NetworkFeeder:
"""
A class that feeds data to a socket port
"""
def __init__(self, proto, host, port, data, is_client=True, delay=3, timeout=2):
if not is_client:
raise NotImplementedError("Server mode is not implemented.")
... | <commit_before>
import time
import threading
import socket
class NetworkFeeder:
"""
A class that feeds data to a socket port
"""
def __init__(self, proto, host, port, data, is_client=True, delay=3, timeout=2):
if not is_client:
raise NotImplementedError("Server mode is not implem... |
6ccaf810ddd8934926fd0e1b5b580ca31b3c67c8 | app/mod_budget/controller.py | app/mod_budget/controller.py | from flask import Blueprint
budget = Blueprint('budget', __name__, template_folder = 'templates')
@budget.route('/')
def default:
return "Hello World!"
| from flask import Blueprint
budget = Blueprint('budget', __name__, template_folder = 'templates')
@budget.route('/')
def default():
return "Hello World!"
| Fix missing parenthesis for default route in budget module. | Fix missing parenthesis for default route in budget module.
| Python | mit | Zillolo/mana-vault,Zillolo/mana-vault,Zillolo/mana-vault | from flask import Blueprint
budget = Blueprint('budget', __name__, template_folder = 'templates')
@budget.route('/')
def default:
return "Hello World!"
Fix missing parenthesis for default route in budget module. | from flask import Blueprint
budget = Blueprint('budget', __name__, template_folder = 'templates')
@budget.route('/')
def default():
return "Hello World!"
| <commit_before>from flask import Blueprint
budget = Blueprint('budget', __name__, template_folder = 'templates')
@budget.route('/')
def default:
return "Hello World!"
<commit_msg>Fix missing parenthesis for default route in budget module.<commit_after> | from flask import Blueprint
budget = Blueprint('budget', __name__, template_folder = 'templates')
@budget.route('/')
def default():
return "Hello World!"
| from flask import Blueprint
budget = Blueprint('budget', __name__, template_folder = 'templates')
@budget.route('/')
def default:
return "Hello World!"
Fix missing parenthesis for default route in budget module.from flask import Blueprint
budget = Blueprint('budget', __name__, template_folder = 'templates')
@bu... | <commit_before>from flask import Blueprint
budget = Blueprint('budget', __name__, template_folder = 'templates')
@budget.route('/')
def default:
return "Hello World!"
<commit_msg>Fix missing parenthesis for default route in budget module.<commit_after>from flask import Blueprint
budget = Blueprint('budget', __na... |
94d3b36e08a546ef470dd0d8dab55a4be3d4265b | examples/get_config.py | examples/get_config.py | import logging
logging.basicConfig()
from jenkinsapi.jenkins import Jenkins
J = Jenkins('http://localhost:8080')
jobName = 'create_fwrgmkbbzk'
config = J[jobName].get_config()
print config
| """
An example of how to use JenkinsAPI to fetch the config XML of a job.
"""
from jenkinsapi.jenkins import Jenkins
J = Jenkins('http://localhost:8080')
jobName = 'create_fwrgmkbbzk'
config = J[jobName].get_config()
print config
| Add a comment to this example | Add a comment to this example
| Python | mit | imsardine/jenkinsapi,domenkozar/jenkinsapi,jduan/jenkinsapi,mistermocha/jenkinsapi,zaro0508/jenkinsapi,salimfadhley/jenkinsapi,zaro0508/jenkinsapi,aerickson/jenkinsapi,imsardine/jenkinsapi,JohnLZeller/jenkinsapi,aerickson/jenkinsapi,jduan/jenkinsapi,zaro0508/jenkinsapi,mistermocha/jenkinsapi,JohnLZeller/jenkinsapi,sali... | import logging
logging.basicConfig()
from jenkinsapi.jenkins import Jenkins
J = Jenkins('http://localhost:8080')
jobName = 'create_fwrgmkbbzk'
config = J[jobName].get_config()
print config
Add a comment to this example | """
An example of how to use JenkinsAPI to fetch the config XML of a job.
"""
from jenkinsapi.jenkins import Jenkins
J = Jenkins('http://localhost:8080')
jobName = 'create_fwrgmkbbzk'
config = J[jobName].get_config()
print config
| <commit_before>import logging
logging.basicConfig()
from jenkinsapi.jenkins import Jenkins
J = Jenkins('http://localhost:8080')
jobName = 'create_fwrgmkbbzk'
config = J[jobName].get_config()
print config
<commit_msg>Add a comment to this example<commit_after> | """
An example of how to use JenkinsAPI to fetch the config XML of a job.
"""
from jenkinsapi.jenkins import Jenkins
J = Jenkins('http://localhost:8080')
jobName = 'create_fwrgmkbbzk'
config = J[jobName].get_config()
print config
| import logging
logging.basicConfig()
from jenkinsapi.jenkins import Jenkins
J = Jenkins('http://localhost:8080')
jobName = 'create_fwrgmkbbzk'
config = J[jobName].get_config()
print config
Add a comment to this example"""
An example of how to use JenkinsAPI to fetch the config XML of a job.
"""
from jenkinsapi.jenk... | <commit_before>import logging
logging.basicConfig()
from jenkinsapi.jenkins import Jenkins
J = Jenkins('http://localhost:8080')
jobName = 'create_fwrgmkbbzk'
config = J[jobName].get_config()
print config
<commit_msg>Add a comment to this example<commit_after>"""
An example of how to use JenkinsAPI to fetch the conf... |
450f082237e5b302988cece5c6eb091a5d8503df | examples/img_server.py | examples/img_server.py | #!/usr/bin/env python
"""
This example implements a server taking a single image when receiving a message from the client.
The image will be fragmented into chunks. The first packet sent contains the number of chunks to expect.
"""
import io
import picamera
import time
from nuts import UDPAuthChannel
def ta... | #!/usr/bin/env python
"""
This example implements a server taking a single image when receiving a message from the client.
The image will be fragmented into chunks. The first packet sent contains the number of chunks to expect.
"""
import io
import picamera
import time
from nuts import UDPAuthChannel
def ta... | Remove python2 print from img server | Remove python2 print from img server
| Python | mit | thusoy/nuts-auth,thusoy/nuts-auth | #!/usr/bin/env python
"""
This example implements a server taking a single image when receiving a message from the client.
The image will be fragmented into chunks. The first packet sent contains the number of chunks to expect.
"""
import io
import picamera
import time
from nuts import UDPAuthChannel
def ta... | #!/usr/bin/env python
"""
This example implements a server taking a single image when receiving a message from the client.
The image will be fragmented into chunks. The first packet sent contains the number of chunks to expect.
"""
import io
import picamera
import time
from nuts import UDPAuthChannel
def ta... | <commit_before>#!/usr/bin/env python
"""
This example implements a server taking a single image when receiving a message from the client.
The image will be fragmented into chunks. The first packet sent contains the number of chunks to expect.
"""
import io
import picamera
import time
from nuts import UDPAuthC... | #!/usr/bin/env python
"""
This example implements a server taking a single image when receiving a message from the client.
The image will be fragmented into chunks. The first packet sent contains the number of chunks to expect.
"""
import io
import picamera
import time
from nuts import UDPAuthChannel
def ta... | #!/usr/bin/env python
"""
This example implements a server taking a single image when receiving a message from the client.
The image will be fragmented into chunks. The first packet sent contains the number of chunks to expect.
"""
import io
import picamera
import time
from nuts import UDPAuthChannel
def ta... | <commit_before>#!/usr/bin/env python
"""
This example implements a server taking a single image when receiving a message from the client.
The image will be fragmented into chunks. The first packet sent contains the number of chunks to expect.
"""
import io
import picamera
import time
from nuts import UDPAuthC... |
1e6f3689a21e12104792236d88e7596cb8397ba5 | mezzanine/core/management.py | mezzanine/core/management.py |
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import models as auth_app
from django.db.models.signals import post_syncdb
def create_demo_user(app, created_models, verbosity, db, **kwargs):
if settings.DEBUG and User in created_models:
if verbosity >... |
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import models as auth_app
from django.db.models.signals import post_syncdb
def create_demo_user(app, created_models, verbosity, **kwargs):
if settings.DEBUG and User in created_models:
if verbosity >= 2:... | Fix post_syncdb signal for demo user to work with Django 1.1 | Fix post_syncdb signal for demo user to work with Django 1.1
| Python | bsd-2-clause | nikolas/mezzanine,AlexHill/mezzanine,webounty/mezzanine,douglaskastle/mezzanine,nikolas/mezzanine,christianwgd/mezzanine,jjz/mezzanine,guibernardino/mezzanine,stbarnabas/mezzanine,promil23/mezzanine,spookylukey/mezzanine,ryneeverett/mezzanine,gradel/mezzanine,jerivas/mezzanine,fusionbox/mezzanine,guibernardino/mezzanin... |
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import models as auth_app
from django.db.models.signals import post_syncdb
def create_demo_user(app, created_models, verbosity, db, **kwargs):
if settings.DEBUG and User in created_models:
if verbosity >... |
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import models as auth_app
from django.db.models.signals import post_syncdb
def create_demo_user(app, created_models, verbosity, **kwargs):
if settings.DEBUG and User in created_models:
if verbosity >= 2:... | <commit_before>
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import models as auth_app
from django.db.models.signals import post_syncdb
def create_demo_user(app, created_models, verbosity, db, **kwargs):
if settings.DEBUG and User in created_models:
... |
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import models as auth_app
from django.db.models.signals import post_syncdb
def create_demo_user(app, created_models, verbosity, **kwargs):
if settings.DEBUG and User in created_models:
if verbosity >= 2:... |
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import models as auth_app
from django.db.models.signals import post_syncdb
def create_demo_user(app, created_models, verbosity, db, **kwargs):
if settings.DEBUG and User in created_models:
if verbosity >... | <commit_before>
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import models as auth_app
from django.db.models.signals import post_syncdb
def create_demo_user(app, created_models, verbosity, db, **kwargs):
if settings.DEBUG and User in created_models:
... |
8ddab20fd41217fe4ea9b5e267443a4953d2d8f7 | apps/authentication/forms.py | apps/authentication/forms.py | from django import forms
class SignupForm(forms.Form):
def signup(self, request, user):
user.is_active = False
user.save()
| from django import forms
from django.core.mail import send_mail
class SignupForm(forms.Form):
def signup(self, request, user):
user.is_active = False
user.save()
send_mail(
'New user on MyQuotes',
'There is one new user asking for access. ID: {id}, Email: {email}'.... | Add email notification when new user has signed up | Add email notification when new user has signed up
| Python | bsd-3-clause | lucifurtun/myquotes,lucifurtun/myquotes,lucifurtun/myquotes,lucifurtun/myquotes | from django import forms
class SignupForm(forms.Form):
def signup(self, request, user):
user.is_active = False
user.save()
Add email notification when new user has signed up | from django import forms
from django.core.mail import send_mail
class SignupForm(forms.Form):
def signup(self, request, user):
user.is_active = False
user.save()
send_mail(
'New user on MyQuotes',
'There is one new user asking for access. ID: {id}, Email: {email}'.... | <commit_before>from django import forms
class SignupForm(forms.Form):
def signup(self, request, user):
user.is_active = False
user.save()
<commit_msg>Add email notification when new user has signed up<commit_after> | from django import forms
from django.core.mail import send_mail
class SignupForm(forms.Form):
def signup(self, request, user):
user.is_active = False
user.save()
send_mail(
'New user on MyQuotes',
'There is one new user asking for access. ID: {id}, Email: {email}'.... | from django import forms
class SignupForm(forms.Form):
def signup(self, request, user):
user.is_active = False
user.save()
Add email notification when new user has signed upfrom django import forms
from django.core.mail import send_mail
class SignupForm(forms.Form):
def signup(self, request,... | <commit_before>from django import forms
class SignupForm(forms.Form):
def signup(self, request, user):
user.is_active = False
user.save()
<commit_msg>Add email notification when new user has signed up<commit_after>from django import forms
from django.core.mail import send_mail
class SignupForm(f... |
ccb558526cd738c5312556a2a6f34471a3202091 | polymorphic_auth/tests/settings.py | polymorphic_auth/tests/settings.py | """
Test settings for ``polymorphic_auth`` app.
"""
AUTH_USER_MODEL = 'polymorphic_auth.User'
POLYMORPHIC_AUTH = {
'DEFAULT_CHILD_MODEL': 'polymorphic_auth_email.EmailUser',
}
DATABASES = {
'default': {
'ATOMIC_REQUESTS': True,
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME'... | """
Test settings for ``polymorphic_auth`` app.
"""
AUTH_USER_MODEL = 'polymorphic_auth.User'
POLYMORPHIC_AUTH = {
'DEFAULT_CHILD_MODEL': 'polymorphic_auth_email.EmailUser',
}
DATABASES = {
'default': {
'ATOMIC_REQUESTS': True,
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME'... | Add `polymorphic` to `INSTALLED_APPS`, and also `MessageMiddlware` (because Django wants it). | Add `polymorphic` to `INSTALLED_APPS`, and also `MessageMiddlware` (because Django wants it).
| Python | mit | ixc/django-polymorphic-auth | """
Test settings for ``polymorphic_auth`` app.
"""
AUTH_USER_MODEL = 'polymorphic_auth.User'
POLYMORPHIC_AUTH = {
'DEFAULT_CHILD_MODEL': 'polymorphic_auth_email.EmailUser',
}
DATABASES = {
'default': {
'ATOMIC_REQUESTS': True,
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME'... | """
Test settings for ``polymorphic_auth`` app.
"""
AUTH_USER_MODEL = 'polymorphic_auth.User'
POLYMORPHIC_AUTH = {
'DEFAULT_CHILD_MODEL': 'polymorphic_auth_email.EmailUser',
}
DATABASES = {
'default': {
'ATOMIC_REQUESTS': True,
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME'... | <commit_before>"""
Test settings for ``polymorphic_auth`` app.
"""
AUTH_USER_MODEL = 'polymorphic_auth.User'
POLYMORPHIC_AUTH = {
'DEFAULT_CHILD_MODEL': 'polymorphic_auth_email.EmailUser',
}
DATABASES = {
'default': {
'ATOMIC_REQUESTS': True,
'ENGINE': 'django.db.backends.postgresql_psycopg2',... | """
Test settings for ``polymorphic_auth`` app.
"""
AUTH_USER_MODEL = 'polymorphic_auth.User'
POLYMORPHIC_AUTH = {
'DEFAULT_CHILD_MODEL': 'polymorphic_auth_email.EmailUser',
}
DATABASES = {
'default': {
'ATOMIC_REQUESTS': True,
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME'... | """
Test settings for ``polymorphic_auth`` app.
"""
AUTH_USER_MODEL = 'polymorphic_auth.User'
POLYMORPHIC_AUTH = {
'DEFAULT_CHILD_MODEL': 'polymorphic_auth_email.EmailUser',
}
DATABASES = {
'default': {
'ATOMIC_REQUESTS': True,
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME'... | <commit_before>"""
Test settings for ``polymorphic_auth`` app.
"""
AUTH_USER_MODEL = 'polymorphic_auth.User'
POLYMORPHIC_AUTH = {
'DEFAULT_CHILD_MODEL': 'polymorphic_auth_email.EmailUser',
}
DATABASES = {
'default': {
'ATOMIC_REQUESTS': True,
'ENGINE': 'django.db.backends.postgresql_psycopg2',... |
3ff5ae10396da6571c54d1aebf7b604c2946bbe4 | _tests/run_tests.py | _tests/run_tests.py | #!/usr/bin/env python
# -*- encoding: utf-8
import pytest
import requests
@pytest.mark.parametrize('path', [
# Check pagination is working correctly
'/page/2/', '/page/3/',
])
def test_pages_appear_correctly(path):
resp = requests.get(f'http://localhost:5757/{path}')
assert resp.status_code == 200
| #!/usr/bin/env python
# -*- encoding: utf-8
import pytest
import requests
@pytest.mark.parametrize('path', [
# Check pagination is working correctly
'/page/2/', '/page/3/',
])
def test_pages_appear_correctly(path):
resp = requests.get(f'http://localhost:5757/{path}')
assert resp.status_code == 200
... | Add tests for year and month archives | Add tests for year and month archives
| Python | mit | alexwlchan/alexwlchan.net,alexwlchan/alexwlchan.net,alexwlchan/alexwlchan.net,alexwlchan/alexwlchan.net,alexwlchan/alexwlchan.net | #!/usr/bin/env python
# -*- encoding: utf-8
import pytest
import requests
@pytest.mark.parametrize('path', [
# Check pagination is working correctly
'/page/2/', '/page/3/',
])
def test_pages_appear_correctly(path):
resp = requests.get(f'http://localhost:5757/{path}')
assert resp.status_code == 200
Ad... | #!/usr/bin/env python
# -*- encoding: utf-8
import pytest
import requests
@pytest.mark.parametrize('path', [
# Check pagination is working correctly
'/page/2/', '/page/3/',
])
def test_pages_appear_correctly(path):
resp = requests.get(f'http://localhost:5757/{path}')
assert resp.status_code == 200
... | <commit_before>#!/usr/bin/env python
# -*- encoding: utf-8
import pytest
import requests
@pytest.mark.parametrize('path', [
# Check pagination is working correctly
'/page/2/', '/page/3/',
])
def test_pages_appear_correctly(path):
resp = requests.get(f'http://localhost:5757/{path}')
assert resp.status... | #!/usr/bin/env python
# -*- encoding: utf-8
import pytest
import requests
@pytest.mark.parametrize('path', [
# Check pagination is working correctly
'/page/2/', '/page/3/',
])
def test_pages_appear_correctly(path):
resp = requests.get(f'http://localhost:5757/{path}')
assert resp.status_code == 200
... | #!/usr/bin/env python
# -*- encoding: utf-8
import pytest
import requests
@pytest.mark.parametrize('path', [
# Check pagination is working correctly
'/page/2/', '/page/3/',
])
def test_pages_appear_correctly(path):
resp = requests.get(f'http://localhost:5757/{path}')
assert resp.status_code == 200
Ad... | <commit_before>#!/usr/bin/env python
# -*- encoding: utf-8
import pytest
import requests
@pytest.mark.parametrize('path', [
# Check pagination is working correctly
'/page/2/', '/page/3/',
])
def test_pages_appear_correctly(path):
resp = requests.get(f'http://localhost:5757/{path}')
assert resp.status... |
a0f0da456ad2142a179c789f63b3dd234979c68c | contrib/python-myna/myna/__init__.py | contrib/python-myna/myna/__init__.py | import shim
tmpdir = None
def setUp():
global tmpdir
tmpdir = shim.setup_shim_for('kubectl')
def tearDown():
global tmpdir
shim.teardown_shim_dir(tmpdir)
| from . import shim
tmpdir = None
def setUp():
global tmpdir
tmpdir = shim.setup_shim_for('kubectl')
def tearDown():
global tmpdir
shim.teardown_shim_dir(tmpdir)
| Update relative imports in the Python library to support Python3 | Update relative imports in the Python library to support Python3
| Python | apache-2.0 | SpectoLabs/myna,SpectoLabs/myna | import shim
tmpdir = None
def setUp():
global tmpdir
tmpdir = shim.setup_shim_for('kubectl')
def tearDown():
global tmpdir
shim.teardown_shim_dir(tmpdir)
Update relative imports in the Python library to support Python3 | from . import shim
tmpdir = None
def setUp():
global tmpdir
tmpdir = shim.setup_shim_for('kubectl')
def tearDown():
global tmpdir
shim.teardown_shim_dir(tmpdir)
| <commit_before>import shim
tmpdir = None
def setUp():
global tmpdir
tmpdir = shim.setup_shim_for('kubectl')
def tearDown():
global tmpdir
shim.teardown_shim_dir(tmpdir)
<commit_msg>Update relative imports in the Python library to support Python3<commit_after> | from . import shim
tmpdir = None
def setUp():
global tmpdir
tmpdir = shim.setup_shim_for('kubectl')
def tearDown():
global tmpdir
shim.teardown_shim_dir(tmpdir)
| import shim
tmpdir = None
def setUp():
global tmpdir
tmpdir = shim.setup_shim_for('kubectl')
def tearDown():
global tmpdir
shim.teardown_shim_dir(tmpdir)
Update relative imports in the Python library to support Python3from . import shim
tmpdir = None
def setUp():
global tmpdir
tmpdir = shim... | <commit_before>import shim
tmpdir = None
def setUp():
global tmpdir
tmpdir = shim.setup_shim_for('kubectl')
def tearDown():
global tmpdir
shim.teardown_shim_dir(tmpdir)
<commit_msg>Update relative imports in the Python library to support Python3<commit_after>from . import shim
tmpdir = None
def set... |
969344a4ed822eafcfbf7bd9d666ca45bf38168f | mass_mailing_partner/wizard/partner_merge.py | mass_mailing_partner/wizard/partner_merge.py | # Copyright 2020 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class BasePartnerMergeAutomaticWizard(models.TransientModel):
_inherit = "base.partner.merge.automatic.wizard"
def _merge(self, partner_ids, dst_partner=None, extra_check... | # Copyright 2020 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class BasePartnerMergeAutomaticWizard(models.TransientModel):
_inherit = "base.partner.merge.automatic.wizard"
def _merge(self, partner_ids, dst_partner=None, extra_check... | Add sudo() to prevent user without mailing access try to merge contacts | [FIX] mass_mailing_partner: Add sudo() to prevent user without mailing access try to merge contacts
| Python | agpl-3.0 | OCA/social,OCA/social,OCA/social | # Copyright 2020 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class BasePartnerMergeAutomaticWizard(models.TransientModel):
_inherit = "base.partner.merge.automatic.wizard"
def _merge(self, partner_ids, dst_partner=None, extra_check... | # Copyright 2020 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class BasePartnerMergeAutomaticWizard(models.TransientModel):
_inherit = "base.partner.merge.automatic.wizard"
def _merge(self, partner_ids, dst_partner=None, extra_check... | <commit_before># Copyright 2020 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class BasePartnerMergeAutomaticWizard(models.TransientModel):
_inherit = "base.partner.merge.automatic.wizard"
def _merge(self, partner_ids, dst_partner=No... | # Copyright 2020 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class BasePartnerMergeAutomaticWizard(models.TransientModel):
_inherit = "base.partner.merge.automatic.wizard"
def _merge(self, partner_ids, dst_partner=None, extra_check... | # Copyright 2020 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class BasePartnerMergeAutomaticWizard(models.TransientModel):
_inherit = "base.partner.merge.automatic.wizard"
def _merge(self, partner_ids, dst_partner=None, extra_check... | <commit_before># Copyright 2020 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class BasePartnerMergeAutomaticWizard(models.TransientModel):
_inherit = "base.partner.merge.automatic.wizard"
def _merge(self, partner_ids, dst_partner=No... |
7a50f9e69e8b9c57b87eb113e8b6736a94d43866 | satchmo/product/templatetags/satchmo_product.py | satchmo/product/templatetags/satchmo_product.py | from django import template
from django.conf import settings
from django.core import urlresolvers
from django.template import Context, Template
from django.utils.translation import get_language, ugettext_lazy as _
from satchmo.configuration import config_value
from satchmo.product.models import Category
from satchmo.sh... | from django import template
from django.conf import settings
from django.core import urlresolvers
from django.template import Context, Template
from django.utils.translation import get_language, ugettext_lazy as _
from satchmo.configuration import config_value
from satchmo.product.models import Category
from satchmo.sh... | Change the is_producttype template tag to return a boolean rather than a string. | Change the is_producttype template tag to return a boolean rather than a string.
| Python | bsd-3-clause | grengojbo/satchmo,grengojbo/satchmo | from django import template
from django.conf import settings
from django.core import urlresolvers
from django.template import Context, Template
from django.utils.translation import get_language, ugettext_lazy as _
from satchmo.configuration import config_value
from satchmo.product.models import Category
from satchmo.sh... | from django import template
from django.conf import settings
from django.core import urlresolvers
from django.template import Context, Template
from django.utils.translation import get_language, ugettext_lazy as _
from satchmo.configuration import config_value
from satchmo.product.models import Category
from satchmo.sh... | <commit_before>from django import template
from django.conf import settings
from django.core import urlresolvers
from django.template import Context, Template
from django.utils.translation import get_language, ugettext_lazy as _
from satchmo.configuration import config_value
from satchmo.product.models import Category
... | from django import template
from django.conf import settings
from django.core import urlresolvers
from django.template import Context, Template
from django.utils.translation import get_language, ugettext_lazy as _
from satchmo.configuration import config_value
from satchmo.product.models import Category
from satchmo.sh... | from django import template
from django.conf import settings
from django.core import urlresolvers
from django.template import Context, Template
from django.utils.translation import get_language, ugettext_lazy as _
from satchmo.configuration import config_value
from satchmo.product.models import Category
from satchmo.sh... | <commit_before>from django import template
from django.conf import settings
from django.core import urlresolvers
from django.template import Context, Template
from django.utils.translation import get_language, ugettext_lazy as _
from satchmo.configuration import config_value
from satchmo.product.models import Category
... |
7c85e2b278667e7340c7c6bf57c3c0c91210c471 | coolfig/__init__.py | coolfig/__init__.py | """
Support for working with different sources of configuration values.
class DefaultSettings(schema.Settings):
SECRET_KEY = schema.Value(str)
DEBUG = schema.Value(types.boolean, default=False)
DB_URL = schema.Value(types.sqlalchemy_url)
LOCALES = schema.Value(types.list(str))
... | """
Support for working with different sources of configuration values.
class DefaultSettings(schema.Settings):
SECRET_KEY = schema.Value(str)
DEBUG = schema.Value(types.boolean, default=False)
DB_URL = schema.Value(types.sqlalchemy_url)
LOCALES = schema.Value(types.list(str))
... | Add some more importing shortcuts | Add some more importing shortcuts
| Python | mit | GaretJax/coolfig | """
Support for working with different sources of configuration values.
class DefaultSettings(schema.Settings):
SECRET_KEY = schema.Value(str)
DEBUG = schema.Value(types.boolean, default=False)
DB_URL = schema.Value(types.sqlalchemy_url)
LOCALES = schema.Value(types.list(str))
... | """
Support for working with different sources of configuration values.
class DefaultSettings(schema.Settings):
SECRET_KEY = schema.Value(str)
DEBUG = schema.Value(types.boolean, default=False)
DB_URL = schema.Value(types.sqlalchemy_url)
LOCALES = schema.Value(types.list(str))
... | <commit_before>"""
Support for working with different sources of configuration values.
class DefaultSettings(schema.Settings):
SECRET_KEY = schema.Value(str)
DEBUG = schema.Value(types.boolean, default=False)
DB_URL = schema.Value(types.sqlalchemy_url)
LOCALES = schema.Value(types.l... | """
Support for working with different sources of configuration values.
class DefaultSettings(schema.Settings):
SECRET_KEY = schema.Value(str)
DEBUG = schema.Value(types.boolean, default=False)
DB_URL = schema.Value(types.sqlalchemy_url)
LOCALES = schema.Value(types.list(str))
... | """
Support for working with different sources of configuration values.
class DefaultSettings(schema.Settings):
SECRET_KEY = schema.Value(str)
DEBUG = schema.Value(types.boolean, default=False)
DB_URL = schema.Value(types.sqlalchemy_url)
LOCALES = schema.Value(types.list(str))
... | <commit_before>"""
Support for working with different sources of configuration values.
class DefaultSettings(schema.Settings):
SECRET_KEY = schema.Value(str)
DEBUG = schema.Value(types.boolean, default=False)
DB_URL = schema.Value(types.sqlalchemy_url)
LOCALES = schema.Value(types.l... |
726662d102453f7c7be5fb31499a8c4d5ab34444 | apps/storybase_user/models.py | apps/storybase_user/models.py | from django.contrib.auth.models import User
from django.db import models
from uuidfield.fields import UUIDField
from storybase.fields import ShortTextField
class Organization(models.Model):
""" An organization or a community group that users and stories can be associated with. """
organization_id = UUIDField(a... | from django.contrib.auth.models import User
from django.db import models
from uuidfield.fields import UUIDField
from storybase.fields import ShortTextField
class Organization(models.Model):
""" An organization or a community group that users and stories can be associated with. """
organization_id = UUIDField(a... | Revert "Updated fields for Project model." | Revert "Updated fields for Project model."
This reverts commit f68fc56dd2a7ec59d472806ffc14e993686e1f24.
| Python | mit | denverfoundation/storybase,denverfoundation/storybase,denverfoundation/storybase,denverfoundation/storybase | from django.contrib.auth.models import User
from django.db import models
from uuidfield.fields import UUIDField
from storybase.fields import ShortTextField
class Organization(models.Model):
""" An organization or a community group that users and stories can be associated with. """
organization_id = UUIDField(a... | from django.contrib.auth.models import User
from django.db import models
from uuidfield.fields import UUIDField
from storybase.fields import ShortTextField
class Organization(models.Model):
""" An organization or a community group that users and stories can be associated with. """
organization_id = UUIDField(a... | <commit_before>from django.contrib.auth.models import User
from django.db import models
from uuidfield.fields import UUIDField
from storybase.fields import ShortTextField
class Organization(models.Model):
""" An organization or a community group that users and stories can be associated with. """
organization_i... | from django.contrib.auth.models import User
from django.db import models
from uuidfield.fields import UUIDField
from storybase.fields import ShortTextField
class Organization(models.Model):
""" An organization or a community group that users and stories can be associated with. """
organization_id = UUIDField(a... | from django.contrib.auth.models import User
from django.db import models
from uuidfield.fields import UUIDField
from storybase.fields import ShortTextField
class Organization(models.Model):
""" An organization or a community group that users and stories can be associated with. """
organization_id = UUIDField(a... | <commit_before>from django.contrib.auth.models import User
from django.db import models
from uuidfield.fields import UUIDField
from storybase.fields import ShortTextField
class Organization(models.Model):
""" An organization or a community group that users and stories can be associated with. """
organization_i... |
787abe44ca65fb879ef8a6534bdf671d01f8a045 | runtests.py | runtests.py | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
ROOT_URLCONF='publisher.urls',
INSTALLED_APPS=[
... | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
ROOT_URLCONF='publisher.urls',
INSTALLED_APPS=[
... | Fix test runner importing wrong module. | Fix test runner importing wrong module.
| Python | bsd-3-clause | wearehoods/django-model-publisher-ai,wearehoods/django-model-publisher-ai,wearehoods/django-model-publisher-ai,jp74/django-model-publisher,jp74/django-model-publisher,jp74/django-model-publisher | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
ROOT_URLCONF='publisher.urls',
INSTALLED_APPS=[
... | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
ROOT_URLCONF='publisher.urls',
INSTALLED_APPS=[
... | <commit_before>import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
ROOT_URLCONF='publisher.urls',
INSTALLED_AP... | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
ROOT_URLCONF='publisher.urls',
INSTALLED_APPS=[
... | import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
ROOT_URLCONF='publisher.urls',
INSTALLED_APPS=[
... | <commit_before>import sys
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
ROOT_URLCONF='publisher.urls',
INSTALLED_AP... |
00e5adf2aa4223e37a191a454300d888af5687f5 | src/pip/__pip-runner__.py | src/pip/__pip-runner__.py | """Execute exactly this copy of pip, within a different environment.
This file is named as it is, to ensure that this module can't be imported via
an import statement.
"""
import importlib.util
import runpy
import sys
import types
from importlib.machinery import ModuleSpec
from os.path import dirname, join
from typin... | """Execute exactly this copy of pip, within a different environment.
This file is named as it is, to ensure that this module can't be imported via
an import statement.
"""
import runpy
import sys
import types
from importlib.machinery import ModuleSpec, PathFinder
from os.path import dirname
from typing import Optiona... | Rework the pip runner to use `PathFinder` | Rework the pip runner to use `PathFinder`
This makes it possible to only "replace" `pip` and have the submodules
get correctly located by the regular importlib machinery. This also
asserts that it was able to locate the module, ensuring that failure to
locate the module results in an exception.
| Python | mit | pypa/pip,sbidoul/pip,pfmoore/pip,pfmoore/pip,pypa/pip,pradyunsg/pip,pradyunsg/pip,sbidoul/pip | """Execute exactly this copy of pip, within a different environment.
This file is named as it is, to ensure that this module can't be imported via
an import statement.
"""
import importlib.util
import runpy
import sys
import types
from importlib.machinery import ModuleSpec
from os.path import dirname, join
from typin... | """Execute exactly this copy of pip, within a different environment.
This file is named as it is, to ensure that this module can't be imported via
an import statement.
"""
import runpy
import sys
import types
from importlib.machinery import ModuleSpec, PathFinder
from os.path import dirname
from typing import Optiona... | <commit_before>"""Execute exactly this copy of pip, within a different environment.
This file is named as it is, to ensure that this module can't be imported via
an import statement.
"""
import importlib.util
import runpy
import sys
import types
from importlib.machinery import ModuleSpec
from os.path import dirname, ... | """Execute exactly this copy of pip, within a different environment.
This file is named as it is, to ensure that this module can't be imported via
an import statement.
"""
import runpy
import sys
import types
from importlib.machinery import ModuleSpec, PathFinder
from os.path import dirname
from typing import Optiona... | """Execute exactly this copy of pip, within a different environment.
This file is named as it is, to ensure that this module can't be imported via
an import statement.
"""
import importlib.util
import runpy
import sys
import types
from importlib.machinery import ModuleSpec
from os.path import dirname, join
from typin... | <commit_before>"""Execute exactly this copy of pip, within a different environment.
This file is named as it is, to ensure that this module can't be imported via
an import statement.
"""
import importlib.util
import runpy
import sys
import types
from importlib.machinery import ModuleSpec
from os.path import dirname, ... |
7d722b5ff87ae1306e089e1bf5839632e628b663 | aws/customise-stack-template.py | aws/customise-stack-template.py | from amazonia.classes.sns import SNS
from troposphere import Ref, Join, cloudwatch
from troposphere.sns import Topic, Subscription
def user_registration_topic(emails):
return topic("UserRegistrationReceived", emails)
def topic(topic_title, emails):
topic = Topic(topic_title,
DisplayName=Join("", ... | from amazonia.classes.sns import SNS
from troposphere import Ref, Join, cloudwatch
from troposphere.sns import Topic, Subscription
def user_registration_topic(emails):
return topic("UserRegistrationReceived", emails)
def new_cors_site_request_received_topic(emails):
return topic("NewCorsSiteRequestReceived",... | Add SNS topic for event NewCorsSiteRequestReceived | Add SNS topic for event NewCorsSiteRequestReceived
| Python | bsd-3-clause | GeoscienceAustralia/geodesy-domain-model,GeoscienceAustralia/Geodesy-Web-Services,GeoscienceAustralia/Geodesy-Web-Services,GeoscienceAustralia/Geodesy-Web-Services,GeoscienceAustralia/geodesy-domain-model,GeoscienceAustralia/Geodesy-Web-Services | from amazonia.classes.sns import SNS
from troposphere import Ref, Join, cloudwatch
from troposphere.sns import Topic, Subscription
def user_registration_topic(emails):
return topic("UserRegistrationReceived", emails)
def topic(topic_title, emails):
topic = Topic(topic_title,
DisplayName=Join("", ... | from amazonia.classes.sns import SNS
from troposphere import Ref, Join, cloudwatch
from troposphere.sns import Topic, Subscription
def user_registration_topic(emails):
return topic("UserRegistrationReceived", emails)
def new_cors_site_request_received_topic(emails):
return topic("NewCorsSiteRequestReceived",... | <commit_before>from amazonia.classes.sns import SNS
from troposphere import Ref, Join, cloudwatch
from troposphere.sns import Topic, Subscription
def user_registration_topic(emails):
return topic("UserRegistrationReceived", emails)
def topic(topic_title, emails):
topic = Topic(topic_title,
Displa... | from amazonia.classes.sns import SNS
from troposphere import Ref, Join, cloudwatch
from troposphere.sns import Topic, Subscription
def user_registration_topic(emails):
return topic("UserRegistrationReceived", emails)
def new_cors_site_request_received_topic(emails):
return topic("NewCorsSiteRequestReceived",... | from amazonia.classes.sns import SNS
from troposphere import Ref, Join, cloudwatch
from troposphere.sns import Topic, Subscription
def user_registration_topic(emails):
return topic("UserRegistrationReceived", emails)
def topic(topic_title, emails):
topic = Topic(topic_title,
DisplayName=Join("", ... | <commit_before>from amazonia.classes.sns import SNS
from troposphere import Ref, Join, cloudwatch
from troposphere.sns import Topic, Subscription
def user_registration_topic(emails):
return topic("UserRegistrationReceived", emails)
def topic(topic_title, emails):
topic = Topic(topic_title,
Displa... |
d0e634e4472dcd82009801626c8e51d0a16fcae6 | cfp/management/commands/update_talks_and_workshops_from_applications.py | cfp/management/commands/update_talks_and_workshops_from_applications.py | from django.core.management.base import BaseCommand, CommandError
from events.models import Event
class Command(BaseCommand):
help = "Copies talk title and descriptions from the application."
def add_arguments(self, parser):
parser.add_argument('event_id', type=int)
def handle(self, *args, **op... | from django.core.management.base import BaseCommand, CommandError
from events.models import Event
class Command(BaseCommand):
help = "Copies talk title and descriptions from the application."
def add_arguments(self, parser):
parser.add_argument('event_id', type=int)
def handle(self, *args, **op... | Update workshops as well as talks | Update workshops as well as talks
| Python | bsd-3-clause | WebCampZg/conference-web,WebCampZg/conference-web,WebCampZg/conference-web | from django.core.management.base import BaseCommand, CommandError
from events.models import Event
class Command(BaseCommand):
help = "Copies talk title and descriptions from the application."
def add_arguments(self, parser):
parser.add_argument('event_id', type=int)
def handle(self, *args, **op... | from django.core.management.base import BaseCommand, CommandError
from events.models import Event
class Command(BaseCommand):
help = "Copies talk title and descriptions from the application."
def add_arguments(self, parser):
parser.add_argument('event_id', type=int)
def handle(self, *args, **op... | <commit_before>from django.core.management.base import BaseCommand, CommandError
from events.models import Event
class Command(BaseCommand):
help = "Copies talk title and descriptions from the application."
def add_arguments(self, parser):
parser.add_argument('event_id', type=int)
def handle(se... | from django.core.management.base import BaseCommand, CommandError
from events.models import Event
class Command(BaseCommand):
help = "Copies talk title and descriptions from the application."
def add_arguments(self, parser):
parser.add_argument('event_id', type=int)
def handle(self, *args, **op... | from django.core.management.base import BaseCommand, CommandError
from events.models import Event
class Command(BaseCommand):
help = "Copies talk title and descriptions from the application."
def add_arguments(self, parser):
parser.add_argument('event_id', type=int)
def handle(self, *args, **op... | <commit_before>from django.core.management.base import BaseCommand, CommandError
from events.models import Event
class Command(BaseCommand):
help = "Copies talk title and descriptions from the application."
def add_arguments(self, parser):
parser.add_argument('event_id', type=int)
def handle(se... |
2c4524c1f40ef9963caefec4ed258974b80a6db1 | messente/api/sms/__init__.py | messente/api/sms/__init__.py | # -*- coding: utf-8 -*-
# Copyright 2016 Messente Communications OÜ
#
# 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 ... | # -*- coding: utf-8 -*-
# Copyright 2016 Messente Communications OÜ
#
# 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 ... | Define public interface in sms module | Define public interface in sms module
| Python | apache-2.0 | messente/messente-python | # -*- coding: utf-8 -*-
# Copyright 2016 Messente Communications OÜ
#
# 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 ... | # -*- coding: utf-8 -*-
# Copyright 2016 Messente Communications OÜ
#
# 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 ... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2016 Messente Communications OÜ
#
# 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
#
# Unle... | # -*- coding: utf-8 -*-
# Copyright 2016 Messente Communications OÜ
#
# 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 ... | # -*- coding: utf-8 -*-
# Copyright 2016 Messente Communications OÜ
#
# 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 ... | <commit_before># -*- coding: utf-8 -*-
# Copyright 2016 Messente Communications OÜ
#
# 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
#
# Unle... |
456bf650d0c6c487616869986ca29bab4768b0cb | dash2012/fabfile.py | dash2012/fabfile.py | #encoding: utf-8
from fabric.api import run, settings, cd, env
env.use_ssh_config = True
env.ssh_config_path = '~/.ssh/config'
def deploy():
with settings(host_string='dash.daltonmatos.com'):
with cd("/var/mongrel2/apps/djangodash2012.daltonmatos.com"):
with cd("app/djangodash2012/"):
... | #encoding: utf-8
from fabric.api import run, settings, cd, env
env.use_ssh_config = True
env.ssh_config_path = '~/.ssh/config'
def deploy(branch='master'):
with settings(host_string='dash.daltonmatos.com'):
with cd("/var/mongrel2/apps/djangodash2012.daltonmatos.com"):
with cd("app/djangodash2... | Choose which branch will be deployed | Choose which branch will be deployed
| Python | bsd-3-clause | losmiserables/djangodash2012,losmiserables/djangodash2012 | #encoding: utf-8
from fabric.api import run, settings, cd, env
env.use_ssh_config = True
env.ssh_config_path = '~/.ssh/config'
def deploy():
with settings(host_string='dash.daltonmatos.com'):
with cd("/var/mongrel2/apps/djangodash2012.daltonmatos.com"):
with cd("app/djangodash2012/"):
... | #encoding: utf-8
from fabric.api import run, settings, cd, env
env.use_ssh_config = True
env.ssh_config_path = '~/.ssh/config'
def deploy(branch='master'):
with settings(host_string='dash.daltonmatos.com'):
with cd("/var/mongrel2/apps/djangodash2012.daltonmatos.com"):
with cd("app/djangodash2... | <commit_before>#encoding: utf-8
from fabric.api import run, settings, cd, env
env.use_ssh_config = True
env.ssh_config_path = '~/.ssh/config'
def deploy():
with settings(host_string='dash.daltonmatos.com'):
with cd("/var/mongrel2/apps/djangodash2012.daltonmatos.com"):
with cd("app/djangodash2... | #encoding: utf-8
from fabric.api import run, settings, cd, env
env.use_ssh_config = True
env.ssh_config_path = '~/.ssh/config'
def deploy(branch='master'):
with settings(host_string='dash.daltonmatos.com'):
with cd("/var/mongrel2/apps/djangodash2012.daltonmatos.com"):
with cd("app/djangodash2... | #encoding: utf-8
from fabric.api import run, settings, cd, env
env.use_ssh_config = True
env.ssh_config_path = '~/.ssh/config'
def deploy():
with settings(host_string='dash.daltonmatos.com'):
with cd("/var/mongrel2/apps/djangodash2012.daltonmatos.com"):
with cd("app/djangodash2012/"):
... | <commit_before>#encoding: utf-8
from fabric.api import run, settings, cd, env
env.use_ssh_config = True
env.ssh_config_path = '~/.ssh/config'
def deploy():
with settings(host_string='dash.daltonmatos.com'):
with cd("/var/mongrel2/apps/djangodash2012.daltonmatos.com"):
with cd("app/djangodash2... |
5b63b724a89c11aa06a8281cf778063c4a8a7096 | Artifactor/views.py | Artifactor/views.py | # -*- coding: utf-8 -*-
# vim: set ts=4
from django.forms import ModelForm
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
from Artifactor.models import Artifact
def ... | # -*- coding: utf-8 -*-
# vim: set ts=4
from django.forms import ModelForm
from django.http import Http404, HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
from Artifactor.models import Artifact
def index(re... | Return the right URL when a file is posted | Return the right URL when a file is posted
| Python | mit | ivoire/Artifactorial,ivoire/Artifactorial,ivoire/Artifactorial | # -*- coding: utf-8 -*-
# vim: set ts=4
from django.forms import ModelForm
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
from Artifactor.models import Artifact
def ... | # -*- coding: utf-8 -*-
# vim: set ts=4
from django.forms import ModelForm
from django.http import Http404, HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
from Artifactor.models import Artifact
def index(re... | <commit_before># -*- coding: utf-8 -*-
# vim: set ts=4
from django.forms import ModelForm
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
from Artifactor.models import ... | # -*- coding: utf-8 -*-
# vim: set ts=4
from django.forms import ModelForm
from django.http import Http404, HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
from Artifactor.models import Artifact
def index(re... | # -*- coding: utf-8 -*-
# vim: set ts=4
from django.forms import ModelForm
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
from Artifactor.models import Artifact
def ... | <commit_before># -*- coding: utf-8 -*-
# vim: set ts=4
from django.forms import ModelForm
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
from Artifactor.models import ... |
5706257685820787b70bfef6798491c34b9b9ad9 | ckanext/romania_theme/plugin.py | ckanext/romania_theme/plugin.py | import ckan.model as model
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
import os
def get_number_of_files():
return model.Session.execute("select count(*) from resource where state = 'active'").first()[0]
def get_number_of_external_links():
return model.Session.execute("select count... | import ckan.model as model
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
import os
def get_number_of_files():
return model.Session.execute("select count(*) from resource where state = 'active'").first()[0]
def get_number_of_external_links():
return model.Session.execute("select count... | Add check for PDF files | Add check for PDF files
| Python | agpl-3.0 | govro/ckanext-romania_theme,govro/ckanext-romania_theme,govro/ckanext-romania_theme,govro/ckanext-romania_theme | import ckan.model as model
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
import os
def get_number_of_files():
return model.Session.execute("select count(*) from resource where state = 'active'").first()[0]
def get_number_of_external_links():
return model.Session.execute("select count... | import ckan.model as model
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
import os
def get_number_of_files():
return model.Session.execute("select count(*) from resource where state = 'active'").first()[0]
def get_number_of_external_links():
return model.Session.execute("select count... | <commit_before>import ckan.model as model
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
import os
def get_number_of_files():
return model.Session.execute("select count(*) from resource where state = 'active'").first()[0]
def get_number_of_external_links():
return model.Session.execut... | import ckan.model as model
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
import os
def get_number_of_files():
return model.Session.execute("select count(*) from resource where state = 'active'").first()[0]
def get_number_of_external_links():
return model.Session.execute("select count... | import ckan.model as model
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
import os
def get_number_of_files():
return model.Session.execute("select count(*) from resource where state = 'active'").first()[0]
def get_number_of_external_links():
return model.Session.execute("select count... | <commit_before>import ckan.model as model
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
import os
def get_number_of_files():
return model.Session.execute("select count(*) from resource where state = 'active'").first()[0]
def get_number_of_external_links():
return model.Session.execut... |
14dcd8789c764743cfcb2e7a7b9b7d33b21a2779 | fluent_blogs/models/managers.py | fluent_blogs/models/managers.py | """
The manager class for the CMS models
"""
from datetime import datetime
from django.db import models
from django.db.models.query import QuerySet
from django.db.models.query_utils import Q
class EntryQuerySet(QuerySet):
def published(self):
"""
Return only published entries
"""
f... | """
The manager class for the CMS models
"""
from datetime import datetime
from django.db import models
from django.db.models.query import QuerySet
from django.db.models.query_utils import Q
class EntryQuerySet(QuerySet):
def published(self):
"""
Return only published entries
"""
f... | Fix .published() to accept current date as well. | Fix .published() to accept current date as well.
| Python | apache-2.0 | edoburu/django-fluent-blogs,edoburu/django-fluent-blogs | """
The manager class for the CMS models
"""
from datetime import datetime
from django.db import models
from django.db.models.query import QuerySet
from django.db.models.query_utils import Q
class EntryQuerySet(QuerySet):
def published(self):
"""
Return only published entries
"""
f... | """
The manager class for the CMS models
"""
from datetime import datetime
from django.db import models
from django.db.models.query import QuerySet
from django.db.models.query_utils import Q
class EntryQuerySet(QuerySet):
def published(self):
"""
Return only published entries
"""
f... | <commit_before>"""
The manager class for the CMS models
"""
from datetime import datetime
from django.db import models
from django.db.models.query import QuerySet
from django.db.models.query_utils import Q
class EntryQuerySet(QuerySet):
def published(self):
"""
Return only published entries
... | """
The manager class for the CMS models
"""
from datetime import datetime
from django.db import models
from django.db.models.query import QuerySet
from django.db.models.query_utils import Q
class EntryQuerySet(QuerySet):
def published(self):
"""
Return only published entries
"""
f... | """
The manager class for the CMS models
"""
from datetime import datetime
from django.db import models
from django.db.models.query import QuerySet
from django.db.models.query_utils import Q
class EntryQuerySet(QuerySet):
def published(self):
"""
Return only published entries
"""
f... | <commit_before>"""
The manager class for the CMS models
"""
from datetime import datetime
from django.db import models
from django.db.models.query import QuerySet
from django.db.models.query_utils import Q
class EntryQuerySet(QuerySet):
def published(self):
"""
Return only published entries
... |
618bf6d4c1fc5e60b7e94d1ad1030bf2cf0de5c2 | src/main/python/alppaca/server_mock/__init__.py | src/main/python/alppaca/server_mock/__init__.py | from __future__ import print_function, absolute_import, unicode_literals, division
from datetime import datetime, timedelta
from textwrap import dedent
from bottle import Bottle
import pytz
""" Super simple IMS mock.
Just listens on localhost:8080 for the appropriate url, returns a test role and
a dummy JSON respon... | """ Super simple IMS mock.
Just listens on localhost:8080 for the appropriate url, returns a test role and
a dummy JSON response.
"""
from __future__ import print_function, absolute_import, unicode_literals, division
from datetime import datetime, timedelta
from textwrap import dedent
from bottle import Bottle
impo... | Move string above the imports so it becomes a docstring | Move string above the imports so it becomes a docstring
| Python | apache-2.0 | ImmobilienScout24/afp-alppaca,ImmobilienScout24/alppaca,ImmobilienScout24/alppaca,ImmobilienScout24/afp-alppaca | from __future__ import print_function, absolute_import, unicode_literals, division
from datetime import datetime, timedelta
from textwrap import dedent
from bottle import Bottle
import pytz
""" Super simple IMS mock.
Just listens on localhost:8080 for the appropriate url, returns a test role and
a dummy JSON respon... | """ Super simple IMS mock.
Just listens on localhost:8080 for the appropriate url, returns a test role and
a dummy JSON response.
"""
from __future__ import print_function, absolute_import, unicode_literals, division
from datetime import datetime, timedelta
from textwrap import dedent
from bottle import Bottle
impo... | <commit_before>from __future__ import print_function, absolute_import, unicode_literals, division
from datetime import datetime, timedelta
from textwrap import dedent
from bottle import Bottle
import pytz
""" Super simple IMS mock.
Just listens on localhost:8080 for the appropriate url, returns a test role and
a du... | """ Super simple IMS mock.
Just listens on localhost:8080 for the appropriate url, returns a test role and
a dummy JSON response.
"""
from __future__ import print_function, absolute_import, unicode_literals, division
from datetime import datetime, timedelta
from textwrap import dedent
from bottle import Bottle
impo... | from __future__ import print_function, absolute_import, unicode_literals, division
from datetime import datetime, timedelta
from textwrap import dedent
from bottle import Bottle
import pytz
""" Super simple IMS mock.
Just listens on localhost:8080 for the appropriate url, returns a test role and
a dummy JSON respon... | <commit_before>from __future__ import print_function, absolute_import, unicode_literals, division
from datetime import datetime, timedelta
from textwrap import dedent
from bottle import Bottle
import pytz
""" Super simple IMS mock.
Just listens on localhost:8080 for the appropriate url, returns a test role and
a du... |
65be9926d1e6d769fcf6d88a6a9788791beef187 | id3lab/__init__.py | id3lab/__init__.py | import IPython
import ts_charting.lab.lab as tslab
import ipycli.standalone as sa
from workbench import sharedx
class ID3Lab(tslab.Lab):
def get_varname(self):
"""
Try to get the variable that this lab is
bound to in the IPython kernel
"""
inst = IPython.InteractiveShell._... | import IPython
import ts_charting.lab.lab as tslab
import ipycli.standalone as sa
from workbench import sharedx
class ID3Lab(tslab.Lab):
_html_obj = None
def __init__(self, draw=False, html_obj=None):
super(ID3Lab, self).__init__(draw=draw)
if html_obj is None:
html_obj = sharedx
... | Make ID3Lab allow attr to be pluggable | ENH: Make ID3Lab allow attr to be pluggable
| Python | apache-2.0 | dalejung/id3lab,dalejung/id3lab | import IPython
import ts_charting.lab.lab as tslab
import ipycli.standalone as sa
from workbench import sharedx
class ID3Lab(tslab.Lab):
def get_varname(self):
"""
Try to get the variable that this lab is
bound to in the IPython kernel
"""
inst = IPython.InteractiveShell._... | import IPython
import ts_charting.lab.lab as tslab
import ipycli.standalone as sa
from workbench import sharedx
class ID3Lab(tslab.Lab):
_html_obj = None
def __init__(self, draw=False, html_obj=None):
super(ID3Lab, self).__init__(draw=draw)
if html_obj is None:
html_obj = sharedx
... | <commit_before>import IPython
import ts_charting.lab.lab as tslab
import ipycli.standalone as sa
from workbench import sharedx
class ID3Lab(tslab.Lab):
def get_varname(self):
"""
Try to get the variable that this lab is
bound to in the IPython kernel
"""
inst = IPython.Int... | import IPython
import ts_charting.lab.lab as tslab
import ipycli.standalone as sa
from workbench import sharedx
class ID3Lab(tslab.Lab):
_html_obj = None
def __init__(self, draw=False, html_obj=None):
super(ID3Lab, self).__init__(draw=draw)
if html_obj is None:
html_obj = sharedx
... | import IPython
import ts_charting.lab.lab as tslab
import ipycli.standalone as sa
from workbench import sharedx
class ID3Lab(tslab.Lab):
def get_varname(self):
"""
Try to get the variable that this lab is
bound to in the IPython kernel
"""
inst = IPython.InteractiveShell._... | <commit_before>import IPython
import ts_charting.lab.lab as tslab
import ipycli.standalone as sa
from workbench import sharedx
class ID3Lab(tslab.Lab):
def get_varname(self):
"""
Try to get the variable that this lab is
bound to in the IPython kernel
"""
inst = IPython.Int... |
f0871086222be67ba4add4574cf03d3cb9d39d63 | tests/circular/template/test_interpolatedstr.py | tests/circular/template/test_interpolatedstr.py | from src.circular.template.interpolatedstr import InterpolatedStr
from src.circular.template.context import Context
from tests.utils import TObserver
def test_string_interp():
ctx = Context()
ctx.name = "James"
s = InterpolatedStr("My name is {{ surname }}, {{name}} {{ surname}}.")
s.bind_ctx(ctx)
... | from src.circular.template.interpolatedstr import InterpolatedStr
from src.circular.template.context import Context
from tests.utils import TObserver
def test_string_interp():
ctx = Context()
ctx.name = "James"
s = InterpolatedStr("My name is {{ surname }}, {{name}} {{ surname}}.")
s.bind_ctx(ctx)
... | Add test for run-together interpolated expressions. | Add test for run-together interpolated expressions.
| Python | mit | jonathanverner/circular,jonathanverner/circular,jonathanverner/circular | from src.circular.template.interpolatedstr import InterpolatedStr
from src.circular.template.context import Context
from tests.utils import TObserver
def test_string_interp():
ctx = Context()
ctx.name = "James"
s = InterpolatedStr("My name is {{ surname }}, {{name}} {{ surname}}.")
s.bind_ctx(ctx)
... | from src.circular.template.interpolatedstr import InterpolatedStr
from src.circular.template.context import Context
from tests.utils import TObserver
def test_string_interp():
ctx = Context()
ctx.name = "James"
s = InterpolatedStr("My name is {{ surname }}, {{name}} {{ surname}}.")
s.bind_ctx(ctx)
... | <commit_before>from src.circular.template.interpolatedstr import InterpolatedStr
from src.circular.template.context import Context
from tests.utils import TObserver
def test_string_interp():
ctx = Context()
ctx.name = "James"
s = InterpolatedStr("My name is {{ surname }}, {{name}} {{ surname}}.")
s.... | from src.circular.template.interpolatedstr import InterpolatedStr
from src.circular.template.context import Context
from tests.utils import TObserver
def test_string_interp():
ctx = Context()
ctx.name = "James"
s = InterpolatedStr("My name is {{ surname }}, {{name}} {{ surname}}.")
s.bind_ctx(ctx)
... | from src.circular.template.interpolatedstr import InterpolatedStr
from src.circular.template.context import Context
from tests.utils import TObserver
def test_string_interp():
ctx = Context()
ctx.name = "James"
s = InterpolatedStr("My name is {{ surname }}, {{name}} {{ surname}}.")
s.bind_ctx(ctx)
... | <commit_before>from src.circular.template.interpolatedstr import InterpolatedStr
from src.circular.template.context import Context
from tests.utils import TObserver
def test_string_interp():
ctx = Context()
ctx.name = "James"
s = InterpolatedStr("My name is {{ surname }}, {{name}} {{ surname}}.")
s.... |
7ce48df1dc525b214a5993853d313d7e1ab6050d | cms/templatetags/cms_js_tags.py | cms/templatetags/cms_js_tags.py | # -*- coding: utf-8 -*-
from classytags.core import Tag, Options
from django import template
from django.core.serializers.json import DjangoJSONEncoder
from django.utils import simplejson
from django.utils.text import javascript_quote
register = template.Library()
@register.filter
def js(value):
return simplejson... | # -*- coding: utf-8 -*-
from distutils.version import LooseVersion
from classytags.core import Tag, Options
import django
from django import template
from django.core.serializers.json import DjangoJSONEncoder
from django.utils.text import javascript_quote
DJANGO_1_4 = LooseVersion(django.get_version()) < LooseVersion... | Use json module instead of django.utils.simplejson for Django 1.5 | Use json module instead of django.utils.simplejson for Django 1.5
| Python | bsd-3-clause | wyg3958/django-cms,cyberintruder/django-cms,josjevv/django-cms,jproffitt/django-cms,webu/django-cms,mkoistinen/django-cms,czpython/django-cms,ojii/django-cms,memnonila/django-cms,Jaccorot/django-cms,11craft/django-cms,mkoistinen/django-cms,isotoma/django-cms,jsma/django-cms,bittner/django-cms,jproffitt/django-cms,intgr... | # -*- coding: utf-8 -*-
from classytags.core import Tag, Options
from django import template
from django.core.serializers.json import DjangoJSONEncoder
from django.utils import simplejson
from django.utils.text import javascript_quote
register = template.Library()
@register.filter
def js(value):
return simplejson... | # -*- coding: utf-8 -*-
from distutils.version import LooseVersion
from classytags.core import Tag, Options
import django
from django import template
from django.core.serializers.json import DjangoJSONEncoder
from django.utils.text import javascript_quote
DJANGO_1_4 = LooseVersion(django.get_version()) < LooseVersion... | <commit_before># -*- coding: utf-8 -*-
from classytags.core import Tag, Options
from django import template
from django.core.serializers.json import DjangoJSONEncoder
from django.utils import simplejson
from django.utils.text import javascript_quote
register = template.Library()
@register.filter
def js(value):
re... | # -*- coding: utf-8 -*-
from distutils.version import LooseVersion
from classytags.core import Tag, Options
import django
from django import template
from django.core.serializers.json import DjangoJSONEncoder
from django.utils.text import javascript_quote
DJANGO_1_4 = LooseVersion(django.get_version()) < LooseVersion... | # -*- coding: utf-8 -*-
from classytags.core import Tag, Options
from django import template
from django.core.serializers.json import DjangoJSONEncoder
from django.utils import simplejson
from django.utils.text import javascript_quote
register = template.Library()
@register.filter
def js(value):
return simplejson... | <commit_before># -*- coding: utf-8 -*-
from classytags.core import Tag, Options
from django import template
from django.core.serializers.json import DjangoJSONEncoder
from django.utils import simplejson
from django.utils.text import javascript_quote
register = template.Library()
@register.filter
def js(value):
re... |
27c451c8490e0f70ceb96327bc6d2aeb29605a40 | ui/helpers.py | ui/helpers.py | def get_referrer_from_request(request):
# determine what source led the user to the export directory
# if navigating internally then return None
return 'aaa'
| def get_referrer_from_request(request):
# TODO: determine what source led the user to the export directory
# if navigating internally then return None (ticket ED-138)
return 'aaa'
| Add TODO to comment in registration helper to reduce risk of task being forgotten | Add TODO to comment in registration helper to reduce risk of task being forgotten
| Python | mit | uktrade/directory-ui-supplier,uktrade/directory-ui-supplier,uktrade/directory-ui-supplier | def get_referrer_from_request(request):
# determine what source led the user to the export directory
# if navigating internally then return None
return 'aaa'
Add TODO to comment in registration helper to reduce risk of task being forgotten | def get_referrer_from_request(request):
# TODO: determine what source led the user to the export directory
# if navigating internally then return None (ticket ED-138)
return 'aaa'
| <commit_before>def get_referrer_from_request(request):
# determine what source led the user to the export directory
# if navigating internally then return None
return 'aaa'
<commit_msg>Add TODO to comment in registration helper to reduce risk of task being forgotten<commit_after> | def get_referrer_from_request(request):
# TODO: determine what source led the user to the export directory
# if navigating internally then return None (ticket ED-138)
return 'aaa'
| def get_referrer_from_request(request):
# determine what source led the user to the export directory
# if navigating internally then return None
return 'aaa'
Add TODO to comment in registration helper to reduce risk of task being forgottendef get_referrer_from_request(request):
# TODO: determine what so... | <commit_before>def get_referrer_from_request(request):
# determine what source led the user to the export directory
# if navigating internally then return None
return 'aaa'
<commit_msg>Add TODO to comment in registration helper to reduce risk of task being forgotten<commit_after>def get_referrer_from_reques... |
793c477f4e365d47d9245f43e9d49fccce303d2a | vcs/models.py | vcs/models.py | from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=10)
unique_... | from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=10)
unique_... | Use a OneToMany field for the activity joiner. | Use a OneToMany field for the activity joiner.
| Python | bsd-3-clause | AeroNotix/django-timetracker,AeroNotix/django-timetracker,AeroNotix/django-timetracker | from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=10)
unique_... | from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=10)
unique_... | <commit_before>from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=... | from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=10)
unique_... | from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=10)
unique_... | <commit_before>from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=... |
5a12255e0af4666a5a197bad94e2cbfe4229a310 | src/kernels/util.py | src/kernels/util.py | import numba
def selfparams(f):
def wrapped_func(obj, x1, x2):
return f(x1.astype('f8', copy=False),
x2.astype('f8', copy=False),
*obj.params)
wrapped_func.__name__ = f.__name__
wrapped_func.__doc__ = f.__doc__
return wrapped_func
def lazyjit(*args, **kwargs... | import numba
def selfparams(f):
def wrapped_func(self, x1, x2):
return f(x1.astype('f8', copy=False),
x2.astype('f8', copy=False),
*self.params)
wrapped_func.__name__ = f.__name__
wrapped_func.__doc__ = f.__doc__
return wrapped_func
def lazyjit(*args, **kwar... | Change obj to self in selfparams | Change obj to self in selfparams
This is so sphinx detects the first parameter in decorated functions
as `self`, and therefore does not display it in the method signature.
| Python | mit | jhamrick/gaussian_processes,jhamrick/gaussian_processes | import numba
def selfparams(f):
def wrapped_func(obj, x1, x2):
return f(x1.astype('f8', copy=False),
x2.astype('f8', copy=False),
*obj.params)
wrapped_func.__name__ = f.__name__
wrapped_func.__doc__ = f.__doc__
return wrapped_func
def lazyjit(*args, **kwargs... | import numba
def selfparams(f):
def wrapped_func(self, x1, x2):
return f(x1.astype('f8', copy=False),
x2.astype('f8', copy=False),
*self.params)
wrapped_func.__name__ = f.__name__
wrapped_func.__doc__ = f.__doc__
return wrapped_func
def lazyjit(*args, **kwar... | <commit_before>import numba
def selfparams(f):
def wrapped_func(obj, x1, x2):
return f(x1.astype('f8', copy=False),
x2.astype('f8', copy=False),
*obj.params)
wrapped_func.__name__ = f.__name__
wrapped_func.__doc__ = f.__doc__
return wrapped_func
def lazyjit(... | import numba
def selfparams(f):
def wrapped_func(self, x1, x2):
return f(x1.astype('f8', copy=False),
x2.astype('f8', copy=False),
*self.params)
wrapped_func.__name__ = f.__name__
wrapped_func.__doc__ = f.__doc__
return wrapped_func
def lazyjit(*args, **kwar... | import numba
def selfparams(f):
def wrapped_func(obj, x1, x2):
return f(x1.astype('f8', copy=False),
x2.astype('f8', copy=False),
*obj.params)
wrapped_func.__name__ = f.__name__
wrapped_func.__doc__ = f.__doc__
return wrapped_func
def lazyjit(*args, **kwargs... | <commit_before>import numba
def selfparams(f):
def wrapped_func(obj, x1, x2):
return f(x1.astype('f8', copy=False),
x2.astype('f8', copy=False),
*obj.params)
wrapped_func.__name__ = f.__name__
wrapped_func.__doc__ = f.__doc__
return wrapped_func
def lazyjit(... |
0b7d69869009888c26d1fdf3dee8a4f858fa70a3 | diary/forms.py | diary/forms.py | from django import forms
import cube.diary.models
class DiaryIdeaForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.DiaryIdea
class EventForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.Event
class ShowingForm(forms.ModelForm):
class Meta(object):
... | from django import forms
import cube.diary.models
class DiaryIdeaForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.DiaryIdea
class EventForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.Event
# Ensure soft wrapping is set for textareas:
wid... | Set wrapping to soft on textareas | Set wrapping to soft on textareas
| Python | agpl-3.0 | BenMotz/cubetoolkit,BenMotz/cubetoolkit,BenMotz/cubetoolkit,BenMotz/cubetoolkit | from django import forms
import cube.diary.models
class DiaryIdeaForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.DiaryIdea
class EventForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.Event
class ShowingForm(forms.ModelForm):
class Meta(object):
... | from django import forms
import cube.diary.models
class DiaryIdeaForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.DiaryIdea
class EventForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.Event
# Ensure soft wrapping is set for textareas:
wid... | <commit_before>from django import forms
import cube.diary.models
class DiaryIdeaForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.DiaryIdea
class EventForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.Event
class ShowingForm(forms.ModelForm):
class Me... | from django import forms
import cube.diary.models
class DiaryIdeaForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.DiaryIdea
class EventForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.Event
# Ensure soft wrapping is set for textareas:
wid... | from django import forms
import cube.diary.models
class DiaryIdeaForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.DiaryIdea
class EventForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.Event
class ShowingForm(forms.ModelForm):
class Meta(object):
... | <commit_before>from django import forms
import cube.diary.models
class DiaryIdeaForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.DiaryIdea
class EventForm(forms.ModelForm):
class Meta(object):
model = cube.diary.models.Event
class ShowingForm(forms.ModelForm):
class Me... |
6018abc4a1c2dfa139bb104ae6db69fef5994ff6 | plugins/chrome_extensions.py | plugins/chrome_extensions.py | ###################################################################################################
#
# chrome_extensions.py
# Adds the name and description of each Chrome extension found in a URLItem to the Interpretation field
#
# Plugin Author: Ryan Benson (ryan@obsidianforensics.com)
#
###########################... | ###################################################################################################
#
# chrome_extensions.py
# Adds the name and description of each Chrome extension found in a URLItem to the Interpretation field
#
# Plugin Author: Ryan Benson (ryan@obsidianforensics.com)
#
###########################... | Add try/except to catch if no extensions are parsed. | Add try/except to catch if no extensions are parsed.
| Python | apache-2.0 | obsidianforensics/hindsight,obsidianforensics/hindsight | ###################################################################################################
#
# chrome_extensions.py
# Adds the name and description of each Chrome extension found in a URLItem to the Interpretation field
#
# Plugin Author: Ryan Benson (ryan@obsidianforensics.com)
#
###########################... | ###################################################################################################
#
# chrome_extensions.py
# Adds the name and description of each Chrome extension found in a URLItem to the Interpretation field
#
# Plugin Author: Ryan Benson (ryan@obsidianforensics.com)
#
###########################... | <commit_before>###################################################################################################
#
# chrome_extensions.py
# Adds the name and description of each Chrome extension found in a URLItem to the Interpretation field
#
# Plugin Author: Ryan Benson (ryan@obsidianforensics.com)
#
############... | ###################################################################################################
#
# chrome_extensions.py
# Adds the name and description of each Chrome extension found in a URLItem to the Interpretation field
#
# Plugin Author: Ryan Benson (ryan@obsidianforensics.com)
#
###########################... | ###################################################################################################
#
# chrome_extensions.py
# Adds the name and description of each Chrome extension found in a URLItem to the Interpretation field
#
# Plugin Author: Ryan Benson (ryan@obsidianforensics.com)
#
###########################... | <commit_before>###################################################################################################
#
# chrome_extensions.py
# Adds the name and description of each Chrome extension found in a URLItem to the Interpretation field
#
# Plugin Author: Ryan Benson (ryan@obsidianforensics.com)
#
############... |
1b23ca7327d5414233222fdb26c1c1e88d0137a6 | takeyourmeds/telephony/views.py | takeyourmeds/telephony/views.py | import os
import json
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from . import actions
def info(request, uuid):
"""
Return the Twillio ML that we generated when the user
called /call
"""
data = open(os.path.join("/tmp", uuid + ".xml")).read()
re... | import os
from django.http import HttpResponse
def info(request, uuid):
"""
Return the Twillio ML that we generated when the user called /call
"""
with open(os.path.join('/tmp', '%s.xml' % uuid)) as f:
data = f.read()
return HttpResponse(data, content_type='text/xml')
| Tidy imports and opening the tmpfile | Tidy imports and opening the tmpfile
| Python | mit | takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web | import os
import json
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from . import actions
def info(request, uuid):
"""
Return the Twillio ML that we generated when the user
called /call
"""
data = open(os.path.join("/tmp", uuid + ".xml")).read()
re... | import os
from django.http import HttpResponse
def info(request, uuid):
"""
Return the Twillio ML that we generated when the user called /call
"""
with open(os.path.join('/tmp', '%s.xml' % uuid)) as f:
data = f.read()
return HttpResponse(data, content_type='text/xml')
| <commit_before>import os
import json
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from . import actions
def info(request, uuid):
"""
Return the Twillio ML that we generated when the user
called /call
"""
data = open(os.path.join("/tmp", uuid + ".xml")... | import os
from django.http import HttpResponse
def info(request, uuid):
"""
Return the Twillio ML that we generated when the user called /call
"""
with open(os.path.join('/tmp', '%s.xml' % uuid)) as f:
data = f.read()
return HttpResponse(data, content_type='text/xml')
| import os
import json
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from . import actions
def info(request, uuid):
"""
Return the Twillio ML that we generated when the user
called /call
"""
data = open(os.path.join("/tmp", uuid + ".xml")).read()
re... | <commit_before>import os
import json
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from . import actions
def info(request, uuid):
"""
Return the Twillio ML that we generated when the user
called /call
"""
data = open(os.path.join("/tmp", uuid + ".xml")... |
1c12843b251184d3e683d9cebf9948565bbfe518 | tests/conftest.py | tests/conftest.py | # pylint: disable=C0111
import pytest
import os
import tarfile
BASEDIR = os.path.dirname(__file__)
@pytest.fixture(autouse=True)
def set_up(tmpdir):
# print BASEDIR
tmpdir.chdir()
tar = tarfile.open(os.path.join(BASEDIR, "MockRepos.tar.gz"))
tar.extractall()
tar.close()
os.chdir('MockRepos')
print('In director... | # pylint: disable=C0111
import pytest
import os
import tarfile
BASEDIR = os.path.dirname(__file__)
@pytest.fixture(autouse=False)
def set_up(tmpdir):
# print BASEDIR
tmpdir.chdir()
tar = tarfile.open(os.path.join(BASEDIR, "MockRepos.tar.gz"))
tar.extractall()
tar.close()
os.chdir('MockRepos')
print('In directo... | Disable autouse for set_up so that help tests don't generate unnecessary files. | Disable autouse for set_up so that help tests don't generate unnecessary files. | Python | mit | bilderbuchi/ofStateManager | # pylint: disable=C0111
import pytest
import os
import tarfile
BASEDIR = os.path.dirname(__file__)
@pytest.fixture(autouse=True)
def set_up(tmpdir):
# print BASEDIR
tmpdir.chdir()
tar = tarfile.open(os.path.join(BASEDIR, "MockRepos.tar.gz"))
tar.extractall()
tar.close()
os.chdir('MockRepos')
print('In director... | # pylint: disable=C0111
import pytest
import os
import tarfile
BASEDIR = os.path.dirname(__file__)
@pytest.fixture(autouse=False)
def set_up(tmpdir):
# print BASEDIR
tmpdir.chdir()
tar = tarfile.open(os.path.join(BASEDIR, "MockRepos.tar.gz"))
tar.extractall()
tar.close()
os.chdir('MockRepos')
print('In directo... | <commit_before># pylint: disable=C0111
import pytest
import os
import tarfile
BASEDIR = os.path.dirname(__file__)
@pytest.fixture(autouse=True)
def set_up(tmpdir):
# print BASEDIR
tmpdir.chdir()
tar = tarfile.open(os.path.join(BASEDIR, "MockRepos.tar.gz"))
tar.extractall()
tar.close()
os.chdir('MockRepos')
pri... | # pylint: disable=C0111
import pytest
import os
import tarfile
BASEDIR = os.path.dirname(__file__)
@pytest.fixture(autouse=False)
def set_up(tmpdir):
# print BASEDIR
tmpdir.chdir()
tar = tarfile.open(os.path.join(BASEDIR, "MockRepos.tar.gz"))
tar.extractall()
tar.close()
os.chdir('MockRepos')
print('In directo... | # pylint: disable=C0111
import pytest
import os
import tarfile
BASEDIR = os.path.dirname(__file__)
@pytest.fixture(autouse=True)
def set_up(tmpdir):
# print BASEDIR
tmpdir.chdir()
tar = tarfile.open(os.path.join(BASEDIR, "MockRepos.tar.gz"))
tar.extractall()
tar.close()
os.chdir('MockRepos')
print('In director... | <commit_before># pylint: disable=C0111
import pytest
import os
import tarfile
BASEDIR = os.path.dirname(__file__)
@pytest.fixture(autouse=True)
def set_up(tmpdir):
# print BASEDIR
tmpdir.chdir()
tar = tarfile.open(os.path.join(BASEDIR, "MockRepos.tar.gz"))
tar.extractall()
tar.close()
os.chdir('MockRepos')
pri... |
b7b0724b7f663a8a0d0e5c46d66f42726d700f45 | djng/router.py | djng/router.py | from django.conf.urls.defaults import patterns
from django.core import urlresolvers
class Router(object):
"""
Convenient wrapper around Django's urlresolvers, allowing them to be used
from normal application code.
from django.http import HttpResponse
from django_openid.request_factory import Requ... | from django.conf.urls.defaults import patterns
from django.core import urlresolvers
class Router(object):
"""
Convenient wrapper around Django's urlresolvers, allowing them to be used
from normal application code.
from django.http import HttpResponse
from django_openid.request_factory import Requ... | Add back 1.0.X compatibility for Router URL resolution. | Add back 1.0.X compatibility for Router URL resolution.
Signed-off-by: Simon Willison <088e16a1019277b15d58faf0541e11910eb756f6@simonwillison.net> | Python | bsd-2-clause | simonw/djng | from django.conf.urls.defaults import patterns
from django.core import urlresolvers
class Router(object):
"""
Convenient wrapper around Django's urlresolvers, allowing them to be used
from normal application code.
from django.http import HttpResponse
from django_openid.request_factory import Requ... | from django.conf.urls.defaults import patterns
from django.core import urlresolvers
class Router(object):
"""
Convenient wrapper around Django's urlresolvers, allowing them to be used
from normal application code.
from django.http import HttpResponse
from django_openid.request_factory import Requ... | <commit_before>from django.conf.urls.defaults import patterns
from django.core import urlresolvers
class Router(object):
"""
Convenient wrapper around Django's urlresolvers, allowing them to be used
from normal application code.
from django.http import HttpResponse
from django_openid.request_fact... | from django.conf.urls.defaults import patterns
from django.core import urlresolvers
class Router(object):
"""
Convenient wrapper around Django's urlresolvers, allowing them to be used
from normal application code.
from django.http import HttpResponse
from django_openid.request_factory import Requ... | from django.conf.urls.defaults import patterns
from django.core import urlresolvers
class Router(object):
"""
Convenient wrapper around Django's urlresolvers, allowing them to be used
from normal application code.
from django.http import HttpResponse
from django_openid.request_factory import Requ... | <commit_before>from django.conf.urls.defaults import patterns
from django.core import urlresolvers
class Router(object):
"""
Convenient wrapper around Django's urlresolvers, allowing them to be used
from normal application code.
from django.http import HttpResponse
from django_openid.request_fact... |
97e048d0a743808ab0ec62b39306940b59dd3c8a | test.py | test.py | import bluePoV
import pygame
x,y = (480,64)
MAC = "00:00:00:00:00:00"
pygame.init()
pygame.display.set_mode((x,y))
s = pygame.display.get_surface()
driver = bluePoV.Driver([x,y],1)
#driver.connect(MAC)
s.fill([0,255,0])
driver.blit(s)
pygame.display.flip()
input("Press any key... ")
| import bluePoV
import pygame
x,y = (480,64)
MAC = "00:00:00:00:00:00"
pygame.init()
pygame.display.set_mode((x,y))
s = pygame.display.get_surface()
driver = bluePoV.Driver([x,y],depth=1,asServer=True)
#driver.connect(MAC)
s.fill([0,255,0])
driver.blit(s)
pygame.display.flip()
input("Press any key... ")
| Throw an error if bluetooth is not supported on the py3 installation | Throw an error if bluetooth is not supported on the py3 installation
| Python | mit | ABorgna/BluePoV-PC,ABorgna/BluePoV-PC,ABorgna/BluePoV-PC | import bluePoV
import pygame
x,y = (480,64)
MAC = "00:00:00:00:00:00"
pygame.init()
pygame.display.set_mode((x,y))
s = pygame.display.get_surface()
driver = bluePoV.Driver([x,y],1)
#driver.connect(MAC)
s.fill([0,255,0])
driver.blit(s)
pygame.display.flip()
input("Press any key... ")
Throw an error if bluetooth ... | import bluePoV
import pygame
x,y = (480,64)
MAC = "00:00:00:00:00:00"
pygame.init()
pygame.display.set_mode((x,y))
s = pygame.display.get_surface()
driver = bluePoV.Driver([x,y],depth=1,asServer=True)
#driver.connect(MAC)
s.fill([0,255,0])
driver.blit(s)
pygame.display.flip()
input("Press any key... ")
| <commit_before>import bluePoV
import pygame
x,y = (480,64)
MAC = "00:00:00:00:00:00"
pygame.init()
pygame.display.set_mode((x,y))
s = pygame.display.get_surface()
driver = bluePoV.Driver([x,y],1)
#driver.connect(MAC)
s.fill([0,255,0])
driver.blit(s)
pygame.display.flip()
input("Press any key... ")
<commit_msg>T... | import bluePoV
import pygame
x,y = (480,64)
MAC = "00:00:00:00:00:00"
pygame.init()
pygame.display.set_mode((x,y))
s = pygame.display.get_surface()
driver = bluePoV.Driver([x,y],depth=1,asServer=True)
#driver.connect(MAC)
s.fill([0,255,0])
driver.blit(s)
pygame.display.flip()
input("Press any key... ")
| import bluePoV
import pygame
x,y = (480,64)
MAC = "00:00:00:00:00:00"
pygame.init()
pygame.display.set_mode((x,y))
s = pygame.display.get_surface()
driver = bluePoV.Driver([x,y],1)
#driver.connect(MAC)
s.fill([0,255,0])
driver.blit(s)
pygame.display.flip()
input("Press any key... ")
Throw an error if bluetooth ... | <commit_before>import bluePoV
import pygame
x,y = (480,64)
MAC = "00:00:00:00:00:00"
pygame.init()
pygame.display.set_mode((x,y))
s = pygame.display.get_surface()
driver = bluePoV.Driver([x,y],1)
#driver.connect(MAC)
s.fill([0,255,0])
driver.blit(s)
pygame.display.flip()
input("Press any key... ")
<commit_msg>T... |
e4717e8017b9a476db1ed016c19d883cd786c7ce | tests/penn_chime/test_parameters.py | tests/penn_chime/test_parameters.py | """"""
from penn_chime.parameters import Parameters
def test_cli_defaults():
"""Ensure if the cli defaults have been updated."""
# TODO how to make this work when the module is installed?
_ = Parameters.create({'PARAMETERS': './defaults/cli.cfg'}, [])
def test_webapp_defaults():
"""Ensure the webapp... | """Test Parameters."""
from penn_chime.parameters import Parameters
def test_cypress_defaults():
"""Ensure the cypress defaults have been updated."""
# TODO how to make this work when the module is installed?
_ = Parameters.create({"PARAMETERS": "./defaults/cypress.cfg"}, [])
def test_cli_defaults():
... | Add test for cypress defaults | Add test for cypress defaults
| Python | mit | CodeForPhilly/chime,CodeForPhilly/chime,CodeForPhilly/chime | """"""
from penn_chime.parameters import Parameters
def test_cli_defaults():
"""Ensure if the cli defaults have been updated."""
# TODO how to make this work when the module is installed?
_ = Parameters.create({'PARAMETERS': './defaults/cli.cfg'}, [])
def test_webapp_defaults():
"""Ensure the webapp... | """Test Parameters."""
from penn_chime.parameters import Parameters
def test_cypress_defaults():
"""Ensure the cypress defaults have been updated."""
# TODO how to make this work when the module is installed?
_ = Parameters.create({"PARAMETERS": "./defaults/cypress.cfg"}, [])
def test_cli_defaults():
... | <commit_before>""""""
from penn_chime.parameters import Parameters
def test_cli_defaults():
"""Ensure if the cli defaults have been updated."""
# TODO how to make this work when the module is installed?
_ = Parameters.create({'PARAMETERS': './defaults/cli.cfg'}, [])
def test_webapp_defaults():
"""En... | """Test Parameters."""
from penn_chime.parameters import Parameters
def test_cypress_defaults():
"""Ensure the cypress defaults have been updated."""
# TODO how to make this work when the module is installed?
_ = Parameters.create({"PARAMETERS": "./defaults/cypress.cfg"}, [])
def test_cli_defaults():
... | """"""
from penn_chime.parameters import Parameters
def test_cli_defaults():
"""Ensure if the cli defaults have been updated."""
# TODO how to make this work when the module is installed?
_ = Parameters.create({'PARAMETERS': './defaults/cli.cfg'}, [])
def test_webapp_defaults():
"""Ensure the webapp... | <commit_before>""""""
from penn_chime.parameters import Parameters
def test_cli_defaults():
"""Ensure if the cli defaults have been updated."""
# TODO how to make this work when the module is installed?
_ = Parameters.create({'PARAMETERS': './defaults/cli.cfg'}, [])
def test_webapp_defaults():
"""En... |
88b198ff1de67d675b81c736eceeb7a2308851db | json2csv_business.py | json2csv_business.py | import json
def main():
# print the header of output csv file
print 'business_id,city,latitude,longitude'
# for each entry in input json file print one csv row
for line in open("data/yelp_academic_dataset_business.json"):
input_json = json.loads(line)
business_id = input_json['busines... | import json
def main():
# print the header of output csv file
print 'business_id,city,latitude,longitude'
# for each entry in input json file print one csv row
for line in open("data/yelp_academic_dataset_business.json"):
input_json = json.loads(line)
business_id = input_json['busines... | Replace commas in names of cities with spaces | Replace commas in names of cities with spaces | Python | mit | aysent/yelp-photo-explorer | import json
def main():
# print the header of output csv file
print 'business_id,city,latitude,longitude'
# for each entry in input json file print one csv row
for line in open("data/yelp_academic_dataset_business.json"):
input_json = json.loads(line)
business_id = input_json['busines... | import json
def main():
# print the header of output csv file
print 'business_id,city,latitude,longitude'
# for each entry in input json file print one csv row
for line in open("data/yelp_academic_dataset_business.json"):
input_json = json.loads(line)
business_id = input_json['busines... | <commit_before>import json
def main():
# print the header of output csv file
print 'business_id,city,latitude,longitude'
# for each entry in input json file print one csv row
for line in open("data/yelp_academic_dataset_business.json"):
input_json = json.loads(line)
business_id = inpu... | import json
def main():
# print the header of output csv file
print 'business_id,city,latitude,longitude'
# for each entry in input json file print one csv row
for line in open("data/yelp_academic_dataset_business.json"):
input_json = json.loads(line)
business_id = input_json['busines... | import json
def main():
# print the header of output csv file
print 'business_id,city,latitude,longitude'
# for each entry in input json file print one csv row
for line in open("data/yelp_academic_dataset_business.json"):
input_json = json.loads(line)
business_id = input_json['busines... | <commit_before>import json
def main():
# print the header of output csv file
print 'business_id,city,latitude,longitude'
# for each entry in input json file print one csv row
for line in open("data/yelp_academic_dataset_business.json"):
input_json = json.loads(line)
business_id = inpu... |
853490b9d89b6e72d3b3f0e83fa2edb17d684547 | jupyterlab/__init__.py | jupyterlab/__init__.py | """Server extension for JupyterLab."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
try:
from ._version import __version__
except ImportError as e:
# when we are python 3 only, add 'from e' at the end to chain the exception.
raise ImportError("No mod... | """Server extension for JupyterLab."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
try:
from ._version import __version__
except ImportError as e:
# when we are python 3 only, add 'from e' at the end to chain the exception.
raise ImportError("No mod... | Fix jupyterlab import error message | Fix jupyterlab import error message
| Python | bsd-3-clause | jupyter/jupyterlab,charnpreetsingh185/jupyterlab,eskirk/jupyterlab,charnpreetsingh185/jupyterlab,jupyter/jupyterlab,eskirk/jupyterlab,eskirk/jupyterlab,jupyter/jupyterlab,charnpreetsingh185/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,eskirk/jupyterlab,charnpreetsingh185/jupyterlab,charnpreetsingh185/jupyterlab,esk... | """Server extension for JupyterLab."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
try:
from ._version import __version__
except ImportError as e:
# when we are python 3 only, add 'from e' at the end to chain the exception.
raise ImportError("No mod... | """Server extension for JupyterLab."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
try:
from ._version import __version__
except ImportError as e:
# when we are python 3 only, add 'from e' at the end to chain the exception.
raise ImportError("No mod... | <commit_before>"""Server extension for JupyterLab."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
try:
from ._version import __version__
except ImportError as e:
# when we are python 3 only, add 'from e' at the end to chain the exception.
raise Impo... | """Server extension for JupyterLab."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
try:
from ._version import __version__
except ImportError as e:
# when we are python 3 only, add 'from e' at the end to chain the exception.
raise ImportError("No mod... | """Server extension for JupyterLab."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
try:
from ._version import __version__
except ImportError as e:
# when we are python 3 only, add 'from e' at the end to chain the exception.
raise ImportError("No mod... | <commit_before>"""Server extension for JupyterLab."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
try:
from ._version import __version__
except ImportError as e:
# when we are python 3 only, add 'from e' at the end to chain the exception.
raise Impo... |
89485bf26ebb7cf4570549cda42543061d6b4fd7 | docker/transport/basehttpadapter.py | docker/transport/basehttpadapter.py | import requests.adapters
class BaseHTTPAdapter(requests.adapters.HTTPAdapter):
def close(self):
self.pools.clear()
| import requests.adapters
class BaseHTTPAdapter(requests.adapters.HTTPAdapter):
def close(self):
super(BaseHTTPAdapter, self).close()
if hasattr(self, 'pools'):
self.pools.clear()
| Fix BaseHTTPAdapter for the SSL case | Fix BaseHTTPAdapter for the SSL case
Signed-off-by: Ulysses Souza <a0ff1337c6a0e43e9559f5f67fc3acb852912071@docker.com>
| Python | apache-2.0 | docker/docker-py,funkyfuture/docker-py,funkyfuture/docker-py,vdemeester/docker-py,vdemeester/docker-py,docker/docker-py | import requests.adapters
class BaseHTTPAdapter(requests.adapters.HTTPAdapter):
def close(self):
self.pools.clear()
Fix BaseHTTPAdapter for the SSL case
Signed-off-by: Ulysses Souza <a0ff1337c6a0e43e9559f5f67fc3acb852912071@docker.com> | import requests.adapters
class BaseHTTPAdapter(requests.adapters.HTTPAdapter):
def close(self):
super(BaseHTTPAdapter, self).close()
if hasattr(self, 'pools'):
self.pools.clear()
| <commit_before>import requests.adapters
class BaseHTTPAdapter(requests.adapters.HTTPAdapter):
def close(self):
self.pools.clear()
<commit_msg>Fix BaseHTTPAdapter for the SSL case
Signed-off-by: Ulysses Souza <a0ff1337c6a0e43e9559f5f67fc3acb852912071@docker.com><commit_after> | import requests.adapters
class BaseHTTPAdapter(requests.adapters.HTTPAdapter):
def close(self):
super(BaseHTTPAdapter, self).close()
if hasattr(self, 'pools'):
self.pools.clear()
| import requests.adapters
class BaseHTTPAdapter(requests.adapters.HTTPAdapter):
def close(self):
self.pools.clear()
Fix BaseHTTPAdapter for the SSL case
Signed-off-by: Ulysses Souza <a0ff1337c6a0e43e9559f5f67fc3acb852912071@docker.com>import requests.adapters
class BaseHTTPAdapter(requests.adapters.HTTP... | <commit_before>import requests.adapters
class BaseHTTPAdapter(requests.adapters.HTTPAdapter):
def close(self):
self.pools.clear()
<commit_msg>Fix BaseHTTPAdapter for the SSL case
Signed-off-by: Ulysses Souza <a0ff1337c6a0e43e9559f5f67fc3acb852912071@docker.com><commit_after>import requests.adapters
cla... |
b4d86431806cc9ce3019aa65db2a3b22c2bd4ac3 | flask_skeleton_api/views/general.py | flask_skeleton_api/views/general.py | from flask import request, Blueprint, Response
from flask import current_app
import json
# This is the blueprint object that gets registered into the app in blueprints.py.
general = Blueprint('general', __name__)
@general.route("/health")
def check_status():
return Response(response=json.dumps({
"app": "... | from flask import request, Blueprint, Response
from flask import current_app
import json
# This is the blueprint object that gets registered into the app in blueprints.py.
general = Blueprint('general', __name__)
@general.route("/health")
def check_status():
return Response(response=json.dumps({
"app": "... | Improve list of headers returned with health route in order to remove /r/n | Improve list of headers returned with health route in order to remove /r/n
| Python | mit | matthew-shaw/thing-api | from flask import request, Blueprint, Response
from flask import current_app
import json
# This is the blueprint object that gets registered into the app in blueprints.py.
general = Blueprint('general', __name__)
@general.route("/health")
def check_status():
return Response(response=json.dumps({
"app": "... | from flask import request, Blueprint, Response
from flask import current_app
import json
# This is the blueprint object that gets registered into the app in blueprints.py.
general = Blueprint('general', __name__)
@general.route("/health")
def check_status():
return Response(response=json.dumps({
"app": "... | <commit_before>from flask import request, Blueprint, Response
from flask import current_app
import json
# This is the blueprint object that gets registered into the app in blueprints.py.
general = Blueprint('general', __name__)
@general.route("/health")
def check_status():
return Response(response=json.dumps({
... | from flask import request, Blueprint, Response
from flask import current_app
import json
# This is the blueprint object that gets registered into the app in blueprints.py.
general = Blueprint('general', __name__)
@general.route("/health")
def check_status():
return Response(response=json.dumps({
"app": "... | from flask import request, Blueprint, Response
from flask import current_app
import json
# This is the blueprint object that gets registered into the app in blueprints.py.
general = Blueprint('general', __name__)
@general.route("/health")
def check_status():
return Response(response=json.dumps({
"app": "... | <commit_before>from flask import request, Blueprint, Response
from flask import current_app
import json
# This is the blueprint object that gets registered into the app in blueprints.py.
general = Blueprint('general', __name__)
@general.route("/health")
def check_status():
return Response(response=json.dumps({
... |
357db324df4b1bd8444c4bf2b89d210e968c8cd7 | tests/frame/test_frame_1.py | tests/frame/test_frame_1.py | import lz4.frame as lz4frame
import pytest
def test_create_compression_context():
context = lz4frame.create_compression_context()
assert context != None
def test_create_decompression_context():
context = lz4frame.create_decompression_context()
assert context != None
# TODO add source_size fixture
def... | import lz4.frame as lz4frame
import pytest
def test_create_compression_context():
context = lz4frame.create_compression_context()
assert context != None
def test_create_decompression_context():
context = lz4frame.create_decompression_context()
assert context != None
# TODO add store_source fixture
de... | Add tests for non-chunked roundtrip | Add tests for non-chunked roundtrip
| Python | bsd-3-clause | python-lz4/python-lz4,python-lz4/python-lz4 | import lz4.frame as lz4frame
import pytest
def test_create_compression_context():
context = lz4frame.create_compression_context()
assert context != None
def test_create_decompression_context():
context = lz4frame.create_decompression_context()
assert context != None
# TODO add source_size fixture
def... | import lz4.frame as lz4frame
import pytest
def test_create_compression_context():
context = lz4frame.create_compression_context()
assert context != None
def test_create_decompression_context():
context = lz4frame.create_decompression_context()
assert context != None
# TODO add store_source fixture
de... | <commit_before>import lz4.frame as lz4frame
import pytest
def test_create_compression_context():
context = lz4frame.create_compression_context()
assert context != None
def test_create_decompression_context():
context = lz4frame.create_decompression_context()
assert context != None
# TODO add source_s... | import lz4.frame as lz4frame
import pytest
def test_create_compression_context():
context = lz4frame.create_compression_context()
assert context != None
def test_create_decompression_context():
context = lz4frame.create_decompression_context()
assert context != None
# TODO add store_source fixture
de... | import lz4.frame as lz4frame
import pytest
def test_create_compression_context():
context = lz4frame.create_compression_context()
assert context != None
def test_create_decompression_context():
context = lz4frame.create_decompression_context()
assert context != None
# TODO add source_size fixture
def... | <commit_before>import lz4.frame as lz4frame
import pytest
def test_create_compression_context():
context = lz4frame.create_compression_context()
assert context != None
def test_create_decompression_context():
context = lz4frame.create_decompression_context()
assert context != None
# TODO add source_s... |
e1df9380be8891c813a8c87e8d8175393171ac17 | rest_framework_sso/querysets.py | rest_framework_sso/querysets.py | # coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.db.models import QuerySet, Q
from django.utils import timezone
import logging
logger = logging.getLogger(__name__)
class SessionTokenQuerySet(QuerySet):
def active(self):
return self.filter(Q(revoked_at__isnull=True) |... | # coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.db.models import QuerySet, Q
from django.utils import timezone
import logging
logger = logging.getLogger(__name__)
class SessionTokenQuerySet(QuerySet):
def active(self):
return self.filter(Q(revoked_at__isnull=True) |... | Stop using django's internal `_create_object_from_params` | Stop using django's internal `_create_object_from_params`
| Python | mit | namespace-ee/django-rest-framework-sso,namespace-ee/django-rest-framework-sso | # coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.db.models import QuerySet, Q
from django.utils import timezone
import logging
logger = logging.getLogger(__name__)
class SessionTokenQuerySet(QuerySet):
def active(self):
return self.filter(Q(revoked_at__isnull=True) |... | # coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.db.models import QuerySet, Q
from django.utils import timezone
import logging
logger = logging.getLogger(__name__)
class SessionTokenQuerySet(QuerySet):
def active(self):
return self.filter(Q(revoked_at__isnull=True) |... | <commit_before># coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.db.models import QuerySet, Q
from django.utils import timezone
import logging
logger = logging.getLogger(__name__)
class SessionTokenQuerySet(QuerySet):
def active(self):
return self.filter(Q(revoked_at_... | # coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.db.models import QuerySet, Q
from django.utils import timezone
import logging
logger = logging.getLogger(__name__)
class SessionTokenQuerySet(QuerySet):
def active(self):
return self.filter(Q(revoked_at__isnull=True) |... | # coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.db.models import QuerySet, Q
from django.utils import timezone
import logging
logger = logging.getLogger(__name__)
class SessionTokenQuerySet(QuerySet):
def active(self):
return self.filter(Q(revoked_at__isnull=True) |... | <commit_before># coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.db.models import QuerySet, Q
from django.utils import timezone
import logging
logger = logging.getLogger(__name__)
class SessionTokenQuerySet(QuerySet):
def active(self):
return self.filter(Q(revoked_at_... |
ff4b34cda7c0b5bc516d9f9e3689818000301336 | tests/test_planner.py | tests/test_planner.py | import cutplanner
import unittest
class TestPlanner(unittest.TestCase):
def setUp(self):
sizes = [80, 120]
needed = [10, 25, 75]
loss = 0.25
self.planner = cutplanner.Planner(sizes, needed, loss)
def test_get_largest(self):
largest = self.planner.get_largest_stock()
... | import cutplanner
import unittest
class TestPlanner(unittest.TestCase):
def setUp(self):
sizes = [80, 120]
needed = [10, 25, 75]
loss = 0.25
self.planner = cutplanner.Planner(sizes, needed, loss)
def test_largest_stock(self):
largest = self.planner.largest_stock
... | Update test for largest stock | Update test for largest stock
| Python | mit | alanc10n/py-cutplanner | import cutplanner
import unittest
class TestPlanner(unittest.TestCase):
def setUp(self):
sizes = [80, 120]
needed = [10, 25, 75]
loss = 0.25
self.planner = cutplanner.Planner(sizes, needed, loss)
def test_get_largest(self):
largest = self.planner.get_largest_stock()
... | import cutplanner
import unittest
class TestPlanner(unittest.TestCase):
def setUp(self):
sizes = [80, 120]
needed = [10, 25, 75]
loss = 0.25
self.planner = cutplanner.Planner(sizes, needed, loss)
def test_largest_stock(self):
largest = self.planner.largest_stock
... | <commit_before>import cutplanner
import unittest
class TestPlanner(unittest.TestCase):
def setUp(self):
sizes = [80, 120]
needed = [10, 25, 75]
loss = 0.25
self.planner = cutplanner.Planner(sizes, needed, loss)
def test_get_largest(self):
largest = self.planner.get_lar... | import cutplanner
import unittest
class TestPlanner(unittest.TestCase):
def setUp(self):
sizes = [80, 120]
needed = [10, 25, 75]
loss = 0.25
self.planner = cutplanner.Planner(sizes, needed, loss)
def test_largest_stock(self):
largest = self.planner.largest_stock
... | import cutplanner
import unittest
class TestPlanner(unittest.TestCase):
def setUp(self):
sizes = [80, 120]
needed = [10, 25, 75]
loss = 0.25
self.planner = cutplanner.Planner(sizes, needed, loss)
def test_get_largest(self):
largest = self.planner.get_largest_stock()
... | <commit_before>import cutplanner
import unittest
class TestPlanner(unittest.TestCase):
def setUp(self):
sizes = [80, 120]
needed = [10, 25, 75]
loss = 0.25
self.planner = cutplanner.Planner(sizes, needed, loss)
def test_get_largest(self):
largest = self.planner.get_lar... |
14e39e28c22da59049feeae0efd1a9fa2bfb51e6 | dockci/models/job_meta/config.py | dockci/models/job_meta/config.py | """
Job metadata stored along side the code
"""
from yaml_model import LoadOnAccess, Model, OnAccess
def get_job(slug):
"""
Wrapper to import, and return a Job object for the JobConfig to avoid
cyclic import
"""
from dockci.models.job import Job
return Job.query.filter_by(slug=slug).first()
... | """
Job metadata stored along side the code
"""
from yaml_model import LoadOnAccess, Model, OnAccess
def get_job(slug):
"""
Wrapper to import, and return a Job object for the JobConfig to avoid
cyclic import
"""
from dockci.models.job import Job
return Job.load(slug)
class JobConfig(Model):... | Fix OnAccess job link for JobConfig | Fix OnAccess job link for JobConfig
| Python | isc | sprucedev/DockCI-Agent,sprucedev/DockCI-Agent | """
Job metadata stored along side the code
"""
from yaml_model import LoadOnAccess, Model, OnAccess
def get_job(slug):
"""
Wrapper to import, and return a Job object for the JobConfig to avoid
cyclic import
"""
from dockci.models.job import Job
return Job.query.filter_by(slug=slug).first()
... | """
Job metadata stored along side the code
"""
from yaml_model import LoadOnAccess, Model, OnAccess
def get_job(slug):
"""
Wrapper to import, and return a Job object for the JobConfig to avoid
cyclic import
"""
from dockci.models.job import Job
return Job.load(slug)
class JobConfig(Model):... | <commit_before>"""
Job metadata stored along side the code
"""
from yaml_model import LoadOnAccess, Model, OnAccess
def get_job(slug):
"""
Wrapper to import, and return a Job object for the JobConfig to avoid
cyclic import
"""
from dockci.models.job import Job
return Job.query.filter_by(slug=... | """
Job metadata stored along side the code
"""
from yaml_model import LoadOnAccess, Model, OnAccess
def get_job(slug):
"""
Wrapper to import, and return a Job object for the JobConfig to avoid
cyclic import
"""
from dockci.models.job import Job
return Job.load(slug)
class JobConfig(Model):... | """
Job metadata stored along side the code
"""
from yaml_model import LoadOnAccess, Model, OnAccess
def get_job(slug):
"""
Wrapper to import, and return a Job object for the JobConfig to avoid
cyclic import
"""
from dockci.models.job import Job
return Job.query.filter_by(slug=slug).first()
... | <commit_before>"""
Job metadata stored along side the code
"""
from yaml_model import LoadOnAccess, Model, OnAccess
def get_job(slug):
"""
Wrapper to import, and return a Job object for the JobConfig to avoid
cyclic import
"""
from dockci.models.job import Job
return Job.query.filter_by(slug=... |
a1679be616d6d0d6ee807a708690549ec1798d04 | python/array_manipulation.py | python/array_manipulation.py | #!/bin/python3
import math
import os
import random
import re
import sys
def arrayManipulation(n, queries):
array = [0] * n
for a, b, k in queries:
# Start is a - 1 because this is a one indexed array
for i in range(a - 1, b):
array[i] += k
print(array)
return max(a... | #!/bin/python3
import math
import os
import random
import re
import sys
def arrayManipulation(n, queries):
# An array used to capture the difference of an element
# compared to the previous element.
# Therefore the value of diffs[n] after all array manipulations is
# the cumulative sum of values from... | Improve runtime by using an array of diffs | Improve runtime by using an array of diffs
| Python | mit | rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank | #!/bin/python3
import math
import os
import random
import re
import sys
def arrayManipulation(n, queries):
array = [0] * n
for a, b, k in queries:
# Start is a - 1 because this is a one indexed array
for i in range(a - 1, b):
array[i] += k
print(array)
return max(a... | #!/bin/python3
import math
import os
import random
import re
import sys
def arrayManipulation(n, queries):
# An array used to capture the difference of an element
# compared to the previous element.
# Therefore the value of diffs[n] after all array manipulations is
# the cumulative sum of values from... | <commit_before>#!/bin/python3
import math
import os
import random
import re
import sys
def arrayManipulation(n, queries):
array = [0] * n
for a, b, k in queries:
# Start is a - 1 because this is a one indexed array
for i in range(a - 1, b):
array[i] += k
print(array)
... | #!/bin/python3
import math
import os
import random
import re
import sys
def arrayManipulation(n, queries):
# An array used to capture the difference of an element
# compared to the previous element.
# Therefore the value of diffs[n] after all array manipulations is
# the cumulative sum of values from... | #!/bin/python3
import math
import os
import random
import re
import sys
def arrayManipulation(n, queries):
array = [0] * n
for a, b, k in queries:
# Start is a - 1 because this is a one indexed array
for i in range(a - 1, b):
array[i] += k
print(array)
return max(a... | <commit_before>#!/bin/python3
import math
import os
import random
import re
import sys
def arrayManipulation(n, queries):
array = [0] * n
for a, b, k in queries:
# Start is a - 1 because this is a one indexed array
for i in range(a - 1, b):
array[i] += k
print(array)
... |
34a3bf209c1bb09e2057eb4dd91ef426e3107c11 | monitor_temperature.py | monitor_temperature.py | import time
import serial
import matplotlib.pyplot as plt
import csv
import os
import brewkettle
reload(brewkettle)
filename = time.strftime("%Y-%m-%d %H:%M") + ".csv"
path = os.path.join("data", filename)
f = open(path, "w")
csv_writer = csv.writer(f)
kettle = brewkettle.BrewKettle()
kettle.turn_pump_on()
start = t... | import time
import serial
import matplotlib.pyplot as plt
import csv
import os
import brewkettle
reload(brewkettle)
filename = time.strftime("%Y-%m-%d %H:%M") + ".csv"
path = os.path.join("data", filename)
f = open(path, "w")
csv_writer = csv.writer(f)
csv_writer.writerow(["Time [s]", "Temperature [C]"])
kettle = bre... | Monitor temperature script as used for heating measurement | Monitor temperature script as used for heating measurement
| Python | mit | beercanlah/ardumashtun,beercanlah/ardumashtun | import time
import serial
import matplotlib.pyplot as plt
import csv
import os
import brewkettle
reload(brewkettle)
filename = time.strftime("%Y-%m-%d %H:%M") + ".csv"
path = os.path.join("data", filename)
f = open(path, "w")
csv_writer = csv.writer(f)
kettle = brewkettle.BrewKettle()
kettle.turn_pump_on()
start = t... | import time
import serial
import matplotlib.pyplot as plt
import csv
import os
import brewkettle
reload(brewkettle)
filename = time.strftime("%Y-%m-%d %H:%M") + ".csv"
path = os.path.join("data", filename)
f = open(path, "w")
csv_writer = csv.writer(f)
csv_writer.writerow(["Time [s]", "Temperature [C]"])
kettle = bre... | <commit_before>import time
import serial
import matplotlib.pyplot as plt
import csv
import os
import brewkettle
reload(brewkettle)
filename = time.strftime("%Y-%m-%d %H:%M") + ".csv"
path = os.path.join("data", filename)
f = open(path, "w")
csv_writer = csv.writer(f)
kettle = brewkettle.BrewKettle()
kettle.turn_pump_... | import time
import serial
import matplotlib.pyplot as plt
import csv
import os
import brewkettle
reload(brewkettle)
filename = time.strftime("%Y-%m-%d %H:%M") + ".csv"
path = os.path.join("data", filename)
f = open(path, "w")
csv_writer = csv.writer(f)
csv_writer.writerow(["Time [s]", "Temperature [C]"])
kettle = bre... | import time
import serial
import matplotlib.pyplot as plt
import csv
import os
import brewkettle
reload(brewkettle)
filename = time.strftime("%Y-%m-%d %H:%M") + ".csv"
path = os.path.join("data", filename)
f = open(path, "w")
csv_writer = csv.writer(f)
kettle = brewkettle.BrewKettle()
kettle.turn_pump_on()
start = t... | <commit_before>import time
import serial
import matplotlib.pyplot as plt
import csv
import os
import brewkettle
reload(brewkettle)
filename = time.strftime("%Y-%m-%d %H:%M") + ".csv"
path = os.path.join("data", filename)
f = open(path, "w")
csv_writer = csv.writer(f)
kettle = brewkettle.BrewKettle()
kettle.turn_pump_... |
60c0f2b74d7459b955da28ff16f67db1e81f5789 | moogle/search/views.py | moogle/search/views.py | # Stdlib imports
# E.g.: from math import sqrt
# Core Django imports
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render
# Third-party app imports
# E.g.: from django_extensions.db.models import TimeStampedModel
# Imports from local apps
from tokens.models import B... | # Stdlib imports
# E.g.: from math import sqrt
# Core Django imports
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render
# Third-party app imports
# E.g.: from django_extensions.db.models import TimeStampedModel
# Imports from local apps
from tokens.models import B... | Fix a issue when a provider has not been added | Fix a issue when a provider has not been added
| Python | apache-2.0 | nimiq/moogle-project | # Stdlib imports
# E.g.: from math import sqrt
# Core Django imports
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render
# Third-party app imports
# E.g.: from django_extensions.db.models import TimeStampedModel
# Imports from local apps
from tokens.models import B... | # Stdlib imports
# E.g.: from math import sqrt
# Core Django imports
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render
# Third-party app imports
# E.g.: from django_extensions.db.models import TimeStampedModel
# Imports from local apps
from tokens.models import B... | <commit_before># Stdlib imports
# E.g.: from math import sqrt
# Core Django imports
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render
# Third-party app imports
# E.g.: from django_extensions.db.models import TimeStampedModel
# Imports from local apps
from tokens.... | # Stdlib imports
# E.g.: from math import sqrt
# Core Django imports
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render
# Third-party app imports
# E.g.: from django_extensions.db.models import TimeStampedModel
# Imports from local apps
from tokens.models import B... | # Stdlib imports
# E.g.: from math import sqrt
# Core Django imports
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render
# Third-party app imports
# E.g.: from django_extensions.db.models import TimeStampedModel
# Imports from local apps
from tokens.models import B... | <commit_before># Stdlib imports
# E.g.: from math import sqrt
# Core Django imports
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render
# Third-party app imports
# E.g.: from django_extensions.db.models import TimeStampedModel
# Imports from local apps
from tokens.... |
f748ed437bb37e10433d0ca1e695122b2c799a15 | symposion/reviews/templatetags/review_tags.py | symposion/reviews/templatetags/review_tags.py | from django import template
from symposion.reviews.models import ReviewAssignment
register = template.Library()
@register.assignment_tag(takes_context=True)
def review_assignments(context):
request = context["request"]
assignments = ReviewAssignment.objects.filter(user=request.user)
return assignments
| from django import template
from symposion.reviews.models import ReviewAssignment
register = template.Library()
@register.simple_tag(takes_context=True)
def review_assignments(context):
request = context["request"]
assignments = ReviewAssignment.objects.filter(user=request.user)
return assignments
| Use simple_tag instead of assignment_tag. | Use simple_tag instead of assignment_tag.
https://docs.djangoproject.com/en/2.2/releases/1.9/#assignment-tag
| Python | mit | pydata/conf_site,pydata/conf_site,pydata/conf_site | from django import template
from symposion.reviews.models import ReviewAssignment
register = template.Library()
@register.assignment_tag(takes_context=True)
def review_assignments(context):
request = context["request"]
assignments = ReviewAssignment.objects.filter(user=request.user)
return assignments
... | from django import template
from symposion.reviews.models import ReviewAssignment
register = template.Library()
@register.simple_tag(takes_context=True)
def review_assignments(context):
request = context["request"]
assignments = ReviewAssignment.objects.filter(user=request.user)
return assignments
| <commit_before>from django import template
from symposion.reviews.models import ReviewAssignment
register = template.Library()
@register.assignment_tag(takes_context=True)
def review_assignments(context):
request = context["request"]
assignments = ReviewAssignment.objects.filter(user=request.user)
retu... | from django import template
from symposion.reviews.models import ReviewAssignment
register = template.Library()
@register.simple_tag(takes_context=True)
def review_assignments(context):
request = context["request"]
assignments = ReviewAssignment.objects.filter(user=request.user)
return assignments
| from django import template
from symposion.reviews.models import ReviewAssignment
register = template.Library()
@register.assignment_tag(takes_context=True)
def review_assignments(context):
request = context["request"]
assignments = ReviewAssignment.objects.filter(user=request.user)
return assignments
... | <commit_before>from django import template
from symposion.reviews.models import ReviewAssignment
register = template.Library()
@register.assignment_tag(takes_context=True)
def review_assignments(context):
request = context["request"]
assignments = ReviewAssignment.objects.filter(user=request.user)
retu... |
86fa8271b5788aadcbbde3decbcd413b9d22871c | util/namespace.py | util/namespace.py | """
Stuff for building namespace
"""
from _compat import *
class Namespace(object):
"""
Backport of SimpleNamespace() class added in Python 3.3
"""
__slots__ = '__doc__', '__dict__', '__weakref__'
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
def __iter__(self):
... | """
Stuff for building namespace
"""
from _compat import *
class Namespace(object):
"""
Backport of SimpleNamespace() class added in Python 3.3
"""
__slots__ = '__doc__', '__dict__', '__weakref__'
def __init__(self, **kwargs):
super(Namespace, self).__init__()
self.__dict__.update... | Call super __init__ from Namespace.__init__ | util: Call super __init__ from Namespace.__init__
| Python | unknown | embox/mybuild,abusalimov/mybuild,embox/mybuild,abusalimov/mybuild | """
Stuff for building namespace
"""
from _compat import *
class Namespace(object):
"""
Backport of SimpleNamespace() class added in Python 3.3
"""
__slots__ = '__doc__', '__dict__', '__weakref__'
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
def __iter__(self):
... | """
Stuff for building namespace
"""
from _compat import *
class Namespace(object):
"""
Backport of SimpleNamespace() class added in Python 3.3
"""
__slots__ = '__doc__', '__dict__', '__weakref__'
def __init__(self, **kwargs):
super(Namespace, self).__init__()
self.__dict__.update... | <commit_before>"""
Stuff for building namespace
"""
from _compat import *
class Namespace(object):
"""
Backport of SimpleNamespace() class added in Python 3.3
"""
__slots__ = '__doc__', '__dict__', '__weakref__'
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
def __iter__(... | """
Stuff for building namespace
"""
from _compat import *
class Namespace(object):
"""
Backport of SimpleNamespace() class added in Python 3.3
"""
__slots__ = '__doc__', '__dict__', '__weakref__'
def __init__(self, **kwargs):
super(Namespace, self).__init__()
self.__dict__.update... | """
Stuff for building namespace
"""
from _compat import *
class Namespace(object):
"""
Backport of SimpleNamespace() class added in Python 3.3
"""
__slots__ = '__doc__', '__dict__', '__weakref__'
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
def __iter__(self):
... | <commit_before>"""
Stuff for building namespace
"""
from _compat import *
class Namespace(object):
"""
Backport of SimpleNamespace() class added in Python 3.3
"""
__slots__ = '__doc__', '__dict__', '__weakref__'
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
def __iter__(... |
253daeb2e826a9fe87cd93c9bc1a2060d9b8fead | tests/project/settings.py | tests/project/settings.py | DATABASES = {
'default': {
'ENGINE': 'sqlite3',
'NAME': ':memory:'
}
}
MIDDLEWARE_CLASSES = [
'fandjango.middleware.FacebookMiddleware'
]
INSTALLED_APPS = [
'fandjango',
'south',
'tests.project.app'
]
ROOT_URLCONF = 'tests.project.urls'
FACEBOOK_APPLICATION_ID = 1812597119252... | DATABASES = {
'default': {
'ENGINE': 'sqlite3',
'NAME': ':memory:'
}
}
MIDDLEWARE_CLASSES = [
'fandjango.middleware.FacebookMiddleware'
]
INSTALLED_APPS = [
'fandjango',
'south',
'tests.project.app'
]
SOUTH_TESTS_MIGRATE = False
ROOT_URLCONF = 'tests.project.urls'
FACEBOOK_A... | Disable South migrations for tests. | Disable South migrations for tests.
| Python | mit | jgorset/fandjango,jgorset/fandjango | DATABASES = {
'default': {
'ENGINE': 'sqlite3',
'NAME': ':memory:'
}
}
MIDDLEWARE_CLASSES = [
'fandjango.middleware.FacebookMiddleware'
]
INSTALLED_APPS = [
'fandjango',
'south',
'tests.project.app'
]
ROOT_URLCONF = 'tests.project.urls'
FACEBOOK_APPLICATION_ID = 1812597119252... | DATABASES = {
'default': {
'ENGINE': 'sqlite3',
'NAME': ':memory:'
}
}
MIDDLEWARE_CLASSES = [
'fandjango.middleware.FacebookMiddleware'
]
INSTALLED_APPS = [
'fandjango',
'south',
'tests.project.app'
]
SOUTH_TESTS_MIGRATE = False
ROOT_URLCONF = 'tests.project.urls'
FACEBOOK_A... | <commit_before>DATABASES = {
'default': {
'ENGINE': 'sqlite3',
'NAME': ':memory:'
}
}
MIDDLEWARE_CLASSES = [
'fandjango.middleware.FacebookMiddleware'
]
INSTALLED_APPS = [
'fandjango',
'south',
'tests.project.app'
]
ROOT_URLCONF = 'tests.project.urls'
FACEBOOK_APPLICATION_ID ... | DATABASES = {
'default': {
'ENGINE': 'sqlite3',
'NAME': ':memory:'
}
}
MIDDLEWARE_CLASSES = [
'fandjango.middleware.FacebookMiddleware'
]
INSTALLED_APPS = [
'fandjango',
'south',
'tests.project.app'
]
SOUTH_TESTS_MIGRATE = False
ROOT_URLCONF = 'tests.project.urls'
FACEBOOK_A... | DATABASES = {
'default': {
'ENGINE': 'sqlite3',
'NAME': ':memory:'
}
}
MIDDLEWARE_CLASSES = [
'fandjango.middleware.FacebookMiddleware'
]
INSTALLED_APPS = [
'fandjango',
'south',
'tests.project.app'
]
ROOT_URLCONF = 'tests.project.urls'
FACEBOOK_APPLICATION_ID = 1812597119252... | <commit_before>DATABASES = {
'default': {
'ENGINE': 'sqlite3',
'NAME': ':memory:'
}
}
MIDDLEWARE_CLASSES = [
'fandjango.middleware.FacebookMiddleware'
]
INSTALLED_APPS = [
'fandjango',
'south',
'tests.project.app'
]
ROOT_URLCONF = 'tests.project.urls'
FACEBOOK_APPLICATION_ID ... |
9771381323e4eb44a13ffc8742615fba61ad2b85 | lino/modlib/notify/consumers.py | lino/modlib/notify/consumers.py | from channels import Group
def ws_echo(message):
Group(str(message.content['text'])).add(message.reply_channel)
message.reply_channel.send({
"text": message.content['text'],
})
| import json
from channels import Channel
from channels import Group
from channels.auth import channel_session_user, channel_session_user_from_http
from django.utils import timezone
from lino.modlib.notify.models import Notification
# This decorator copies the user from the HTTP session (only available in
# websocket... | Update receive and send functions according to the new requirements | Update receive and send functions according to the new requirements
| Python | unknown | lsaffre/lino,lsaffre/lino,khchine5/lino,khchine5/lino,khchine5/lino,lino-framework/lino,lino-framework/lino,lsaffre/lino,lsaffre/lino,lino-framework/lino,lino-framework/lino,lsaffre/lino,khchine5/lino,khchine5/lino,lino-framework/lino | from channels import Group
def ws_echo(message):
Group(str(message.content['text'])).add(message.reply_channel)
message.reply_channel.send({
"text": message.content['text'],
})
Update receive and send functions according to the new requirements | import json
from channels import Channel
from channels import Group
from channels.auth import channel_session_user, channel_session_user_from_http
from django.utils import timezone
from lino.modlib.notify.models import Notification
# This decorator copies the user from the HTTP session (only available in
# websocket... | <commit_before>from channels import Group
def ws_echo(message):
Group(str(message.content['text'])).add(message.reply_channel)
message.reply_channel.send({
"text": message.content['text'],
})
<commit_msg>Update receive and send functions according to the new requirements<commit_after> | import json
from channels import Channel
from channels import Group
from channels.auth import channel_session_user, channel_session_user_from_http
from django.utils import timezone
from lino.modlib.notify.models import Notification
# This decorator copies the user from the HTTP session (only available in
# websocket... | from channels import Group
def ws_echo(message):
Group(str(message.content['text'])).add(message.reply_channel)
message.reply_channel.send({
"text": message.content['text'],
})
Update receive and send functions according to the new requirementsimport json
from channels import Channel
from channel... | <commit_before>from channels import Group
def ws_echo(message):
Group(str(message.content['text'])).add(message.reply_channel)
message.reply_channel.send({
"text": message.content['text'],
})
<commit_msg>Update receive and send functions according to the new requirements<commit_after>import json
... |
50ba0c2c576a4b9eddaa64537dadfd8684463794 | ibmcnx/doc/DataSources.py | ibmcnx/doc/DataSources.py | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | Create script to save documentation to a file | 4: Create script to save documentation to a file
Task-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/4 | Python | apache-2.0 | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | <commit_before>######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Co... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | <commit_before>######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Co... |
cd996486b25ab35369994a4470f795ae31e06a9c | unit_tests/test_ccs.py | unit_tests/test_ccs.py | #!/usr/bin/env python3
import unittest
import sys
# This line allows the tests to run if you just naively run this script.
# But the preferred way is to use run_tests.sh
sys.path.insert(0,'../MultiQC')
from multiqc.modules.ccs.ccs import parse_ccs_log
class Test(unittest.TestCase):
def test_nothing(self):
... | #!/usr/bin/env python3
import unittest
import sys
# This line allows the tests to run if you just naively run this script.
# But the preferred way is to use run_tests.sh
sys.path.insert(0,'../MultiQC')
from multiqc.modules.ccs.ccs import parse_ccs_log
class Test(unittest.TestCase):
def test_parse_line(self):
... | Add first test for ccs | Add first test for ccs
| Python | mit | ewels/MultiQC_TestData,ewels/MultiQC_TestData,ewels/MultiQC_TestData,ewels/MultiQC_TestData,ewels/MultiQC_TestData | #!/usr/bin/env python3
import unittest
import sys
# This line allows the tests to run if you just naively run this script.
# But the preferred way is to use run_tests.sh
sys.path.insert(0,'../MultiQC')
from multiqc.modules.ccs.ccs import parse_ccs_log
class Test(unittest.TestCase):
def test_nothing(self):
... | #!/usr/bin/env python3
import unittest
import sys
# This line allows the tests to run if you just naively run this script.
# But the preferred way is to use run_tests.sh
sys.path.insert(0,'../MultiQC')
from multiqc.modules.ccs.ccs import parse_ccs_log
class Test(unittest.TestCase):
def test_parse_line(self):
... | <commit_before>#!/usr/bin/env python3
import unittest
import sys
# This line allows the tests to run if you just naively run this script.
# But the preferred way is to use run_tests.sh
sys.path.insert(0,'../MultiQC')
from multiqc.modules.ccs.ccs import parse_ccs_log
class Test(unittest.TestCase):
def test_noth... | #!/usr/bin/env python3
import unittest
import sys
# This line allows the tests to run if you just naively run this script.
# But the preferred way is to use run_tests.sh
sys.path.insert(0,'../MultiQC')
from multiqc.modules.ccs.ccs import parse_ccs_log
class Test(unittest.TestCase):
def test_parse_line(self):
... | #!/usr/bin/env python3
import unittest
import sys
# This line allows the tests to run if you just naively run this script.
# But the preferred way is to use run_tests.sh
sys.path.insert(0,'../MultiQC')
from multiqc.modules.ccs.ccs import parse_ccs_log
class Test(unittest.TestCase):
def test_nothing(self):
... | <commit_before>#!/usr/bin/env python3
import unittest
import sys
# This line allows the tests to run if you just naively run this script.
# But the preferred way is to use run_tests.sh
sys.path.insert(0,'../MultiQC')
from multiqc.modules.ccs.ccs import parse_ccs_log
class Test(unittest.TestCase):
def test_noth... |
9a52024ff5b8175ee8b8d4665d3c8c667003019b | glitter/blocks/redactor/tests.py | glitter/blocks/redactor/tests.py | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.contrib.auth import get_user_model
from django.contrib.conte... | Add test for redactor block creation | Add test for redactor block creation
| Python | bsd-3-clause | developersociety/django-glitter,blancltd/django-glitter,developersociety/django-glitter,developersociety/django-glitter,blancltd/django-glitter,blancltd/django-glitter | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.contrib.auth import get_user_model
from django.contrib.conte... | <commit_before>"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tes... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.contrib.auth import get_user_model
from django.contrib.conte... | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | <commit_before>"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tes... |
0b296bdef138ffc48363745e39d0d605e81b24cc | server.py | server.py | import bottle
import waitress
import controller
import breathe
from pytz import timezone
from apscheduler.schedulers.background import BackgroundScheduler
bottle_app = bottle.app()
scheduler = BackgroundScheduler()
scheduler.configure(timezone=timezone('US/Pacific'))
breather = breathe.Breathe()
my_controller = contro... | import bottle
import waitress
import controller
import breathe
from pytz import timezone
from apscheduler.schedulers.background import BackgroundScheduler
bottle_app = bottle.app()
scheduler = BackgroundScheduler()
scheduler.configure(timezone=timezone('US/Pacific'))
breather = breathe.Breathe()
my_controller = contro... | Set scheduler to start at 8pm | Set scheduler to start at 8pm
| Python | mit | tipsqueal/duwamish-lighthouse,tipsqueal/duwamish-lighthouse,illumenati/duwamish-lighthouse,illumenati/duwamish-lighthouse,YonasBerhe/duwamish-lighthouse | import bottle
import waitress
import controller
import breathe
from pytz import timezone
from apscheduler.schedulers.background import BackgroundScheduler
bottle_app = bottle.app()
scheduler = BackgroundScheduler()
scheduler.configure(timezone=timezone('US/Pacific'))
breather = breathe.Breathe()
my_controller = contro... | import bottle
import waitress
import controller
import breathe
from pytz import timezone
from apscheduler.schedulers.background import BackgroundScheduler
bottle_app = bottle.app()
scheduler = BackgroundScheduler()
scheduler.configure(timezone=timezone('US/Pacific'))
breather = breathe.Breathe()
my_controller = contro... | <commit_before>import bottle
import waitress
import controller
import breathe
from pytz import timezone
from apscheduler.schedulers.background import BackgroundScheduler
bottle_app = bottle.app()
scheduler = BackgroundScheduler()
scheduler.configure(timezone=timezone('US/Pacific'))
breather = breathe.Breathe()
my_cont... | import bottle
import waitress
import controller
import breathe
from pytz import timezone
from apscheduler.schedulers.background import BackgroundScheduler
bottle_app = bottle.app()
scheduler = BackgroundScheduler()
scheduler.configure(timezone=timezone('US/Pacific'))
breather = breathe.Breathe()
my_controller = contro... | import bottle
import waitress
import controller
import breathe
from pytz import timezone
from apscheduler.schedulers.background import BackgroundScheduler
bottle_app = bottle.app()
scheduler = BackgroundScheduler()
scheduler.configure(timezone=timezone('US/Pacific'))
breather = breathe.Breathe()
my_controller = contro... | <commit_before>import bottle
import waitress
import controller
import breathe
from pytz import timezone
from apscheduler.schedulers.background import BackgroundScheduler
bottle_app = bottle.app()
scheduler = BackgroundScheduler()
scheduler.configure(timezone=timezone('US/Pacific'))
breather = breathe.Breathe()
my_cont... |
0fa002e66f82eff593514c2249c4229604ec0f0a | server.py | server.py | import web
import cPickle as pickle
import json
urls = (
'/latest', 'latest',
'/history', 'history'
)
class latest:
def GET(self):
try:
latest = pickle.load(open("latest.p", "r"))
return json.dumps(latest)
except:
return "Could not read latest data"
cla... | import web
import cPickle as pickle
import json
urls = (
'/latest', 'latest',
'/history', 'history'
)
class latest:
def GET(self):
try:
with open("latest.p", 'r') as f:
latest = pickle.load(f)
return json.dumps(latest)
except:
return "Cou... | Make sure to close the file afterwards | Make sure to close the file afterwards
| Python | mit | martindisch/SensorTag,martindisch/SensorTag,martindisch/SensorTag,martindisch/SensorTag | import web
import cPickle as pickle
import json
urls = (
'/latest', 'latest',
'/history', 'history'
)
class latest:
def GET(self):
try:
latest = pickle.load(open("latest.p", "r"))
return json.dumps(latest)
except:
return "Could not read latest data"
cla... | import web
import cPickle as pickle
import json
urls = (
'/latest', 'latest',
'/history', 'history'
)
class latest:
def GET(self):
try:
with open("latest.p", 'r') as f:
latest = pickle.load(f)
return json.dumps(latest)
except:
return "Cou... | <commit_before>import web
import cPickle as pickle
import json
urls = (
'/latest', 'latest',
'/history', 'history'
)
class latest:
def GET(self):
try:
latest = pickle.load(open("latest.p", "r"))
return json.dumps(latest)
except:
return "Could not read la... | import web
import cPickle as pickle
import json
urls = (
'/latest', 'latest',
'/history', 'history'
)
class latest:
def GET(self):
try:
with open("latest.p", 'r') as f:
latest = pickle.load(f)
return json.dumps(latest)
except:
return "Cou... | import web
import cPickle as pickle
import json
urls = (
'/latest', 'latest',
'/history', 'history'
)
class latest:
def GET(self):
try:
latest = pickle.load(open("latest.p", "r"))
return json.dumps(latest)
except:
return "Could not read latest data"
cla... | <commit_before>import web
import cPickle as pickle
import json
urls = (
'/latest', 'latest',
'/history', 'history'
)
class latest:
def GET(self):
try:
latest = pickle.load(open("latest.p", "r"))
return json.dumps(latest)
except:
return "Could not read la... |
d936f53ae422fab360f5e1cd62f7114d91ba270c | extra_plots.py | extra_plots.py | """
Generate nice plots providing additional information
"""
import sys
import numpy as np
import matplotlib.pylab as plt
def neural_spike():
""" Plot various neural spikes
"""
def do_plot(cell_evo):
""" Plot [cAMP] for single cell over time
"""
plt.plot(range(len(cell_evo)), cell... | """
Generate nice plots providing additional information
"""
import sys
import numpy as np
import matplotlib.pylab as plt
from singularity_finder import compute_tau
def neural_spike():
""" Plot various neural spikes
"""
def do_plot(cell_evo):
""" Plot [cAMP] for single cell over time
"""... | Add lagged phase space plot | Add lagged phase space plot
| Python | mit | kpj/PyWave | """
Generate nice plots providing additional information
"""
import sys
import numpy as np
import matplotlib.pylab as plt
def neural_spike():
""" Plot various neural spikes
"""
def do_plot(cell_evo):
""" Plot [cAMP] for single cell over time
"""
plt.plot(range(len(cell_evo)), cell... | """
Generate nice plots providing additional information
"""
import sys
import numpy as np
import matplotlib.pylab as plt
from singularity_finder import compute_tau
def neural_spike():
""" Plot various neural spikes
"""
def do_plot(cell_evo):
""" Plot [cAMP] for single cell over time
"""... | <commit_before>"""
Generate nice plots providing additional information
"""
import sys
import numpy as np
import matplotlib.pylab as plt
def neural_spike():
""" Plot various neural spikes
"""
def do_plot(cell_evo):
""" Plot [cAMP] for single cell over time
"""
plt.plot(range(len(c... | """
Generate nice plots providing additional information
"""
import sys
import numpy as np
import matplotlib.pylab as plt
from singularity_finder import compute_tau
def neural_spike():
""" Plot various neural spikes
"""
def do_plot(cell_evo):
""" Plot [cAMP] for single cell over time
"""... | """
Generate nice plots providing additional information
"""
import sys
import numpy as np
import matplotlib.pylab as plt
def neural_spike():
""" Plot various neural spikes
"""
def do_plot(cell_evo):
""" Plot [cAMP] for single cell over time
"""
plt.plot(range(len(cell_evo)), cell... | <commit_before>"""
Generate nice plots providing additional information
"""
import sys
import numpy as np
import matplotlib.pylab as plt
def neural_spike():
""" Plot various neural spikes
"""
def do_plot(cell_evo):
""" Plot [cAMP] for single cell over time
"""
plt.plot(range(len(c... |
7316d1cb953812ae0286d59d1abc014b2f90794b | locust/__init__.py | locust/__init__.py | from .user.sequential_taskset import SequentialTaskSet
from .user.task import task, TaskSet
from .user.users import HttpUser, User
from .event import Events
from .wait_time import between, constant, constant_pacing
events = Events()
__version__ = "1.0b1"
| from .user.sequential_taskset import SequentialTaskSet
from .user.task import task, TaskSet
from .user.users import HttpUser, User
from .user.wait_time import between, constant, constant_pacing
from .event import Events
events = Events()
__version__ = "1.0b1"
| Move wait_time.py into user module | Move wait_time.py into user module | Python | mit | locustio/locust,mbeacom/locust,mbeacom/locust,mbeacom/locust,locustio/locust,locustio/locust,mbeacom/locust,locustio/locust | from .user.sequential_taskset import SequentialTaskSet
from .user.task import task, TaskSet
from .user.users import HttpUser, User
from .event import Events
from .wait_time import between, constant, constant_pacing
events = Events()
__version__ = "1.0b1"
Move wait_time.py into user module | from .user.sequential_taskset import SequentialTaskSet
from .user.task import task, TaskSet
from .user.users import HttpUser, User
from .user.wait_time import between, constant, constant_pacing
from .event import Events
events = Events()
__version__ = "1.0b1"
| <commit_before>from .user.sequential_taskset import SequentialTaskSet
from .user.task import task, TaskSet
from .user.users import HttpUser, User
from .event import Events
from .wait_time import between, constant, constant_pacing
events = Events()
__version__ = "1.0b1"
<commit_msg>Move wait_time.py into user module<c... | from .user.sequential_taskset import SequentialTaskSet
from .user.task import task, TaskSet
from .user.users import HttpUser, User
from .user.wait_time import between, constant, constant_pacing
from .event import Events
events = Events()
__version__ = "1.0b1"
| from .user.sequential_taskset import SequentialTaskSet
from .user.task import task, TaskSet
from .user.users import HttpUser, User
from .event import Events
from .wait_time import between, constant, constant_pacing
events = Events()
__version__ = "1.0b1"
Move wait_time.py into user modulefrom .user.sequential_taskset... | <commit_before>from .user.sequential_taskset import SequentialTaskSet
from .user.task import task, TaskSet
from .user.users import HttpUser, User
from .event import Events
from .wait_time import between, constant, constant_pacing
events = Events()
__version__ = "1.0b1"
<commit_msg>Move wait_time.py into user module<c... |
71eeb919373787569034225e8047079075df5569 | Challenges/chall_06.py | Challenges/chall_06.py | #!/usr/local/bin/python3
# Python Challenge - 6
# http://www.pythonchallenge.com/pc/def/channel.html
# http://www.pythonchallenge.com/pc/def/channel.zip
# Keyword: hockey -> oxygen
import re
import zipfile
def main():
'''
Hint: zip, now there are pairs
In the readme.txt:
welcome to my zipped list.
... | #!/usr/local/bin/python3
# Python Challenge - 6
# http://www.pythonchallenge.com/pc/def/channel.html
# http://www.pythonchallenge.com/pc/def/channel.zip
# Keyword: hockey -> oxygen
import re
import zipfile
def main():
'''
Hint: zip, now there are pairs
In the readme.txt:
welcome to my zipped list.
... | Add print statements for clarity | Add print statements for clarity
| Python | mit | HKuz/PythonChallenge | #!/usr/local/bin/python3
# Python Challenge - 6
# http://www.pythonchallenge.com/pc/def/channel.html
# http://www.pythonchallenge.com/pc/def/channel.zip
# Keyword: hockey -> oxygen
import re
import zipfile
def main():
'''
Hint: zip, now there are pairs
In the readme.txt:
welcome to my zipped list.
... | #!/usr/local/bin/python3
# Python Challenge - 6
# http://www.pythonchallenge.com/pc/def/channel.html
# http://www.pythonchallenge.com/pc/def/channel.zip
# Keyword: hockey -> oxygen
import re
import zipfile
def main():
'''
Hint: zip, now there are pairs
In the readme.txt:
welcome to my zipped list.
... | <commit_before>#!/usr/local/bin/python3
# Python Challenge - 6
# http://www.pythonchallenge.com/pc/def/channel.html
# http://www.pythonchallenge.com/pc/def/channel.zip
# Keyword: hockey -> oxygen
import re
import zipfile
def main():
'''
Hint: zip, now there are pairs
In the readme.txt:
welcome to my... | #!/usr/local/bin/python3
# Python Challenge - 6
# http://www.pythonchallenge.com/pc/def/channel.html
# http://www.pythonchallenge.com/pc/def/channel.zip
# Keyword: hockey -> oxygen
import re
import zipfile
def main():
'''
Hint: zip, now there are pairs
In the readme.txt:
welcome to my zipped list.
... | #!/usr/local/bin/python3
# Python Challenge - 6
# http://www.pythonchallenge.com/pc/def/channel.html
# http://www.pythonchallenge.com/pc/def/channel.zip
# Keyword: hockey -> oxygen
import re
import zipfile
def main():
'''
Hint: zip, now there are pairs
In the readme.txt:
welcome to my zipped list.
... | <commit_before>#!/usr/local/bin/python3
# Python Challenge - 6
# http://www.pythonchallenge.com/pc/def/channel.html
# http://www.pythonchallenge.com/pc/def/channel.zip
# Keyword: hockey -> oxygen
import re
import zipfile
def main():
'''
Hint: zip, now there are pairs
In the readme.txt:
welcome to my... |
3d1521892ba17120ca4461335713b9d2254311fe | marble/tests/test_clustering.py | marble/tests/test_clustering.py | """ Tests for the clustering computation """
from nose.tools import *
import marble as mb
# Test c = 0 in the checkerboard case
# Test c = 1 in the fully clustered case
# Test an intermediate situation with known result
| """ Tests for the clustering computation """
from nose.tools import *
import itertools
from shapely.geometry import Polygon
import marble as mb
#
# Synthetic data for tests
#
def grid():
""" Areal units arranged in a grid """
au = [i*3+j for i,j in itertools.product(range(3), repeat=2)]
units = {a:Polygo... | Add tests for the clustering of cities | Add tests for the clustering of cities
| Python | bsd-3-clause | walkerke/marble,scities/marble | """ Tests for the clustering computation """
from nose.tools import *
import marble as mb
# Test c = 0 in the checkerboard case
# Test c = 1 in the fully clustered case
# Test an intermediate situation with known result
Add tests for the clustering of cities | """ Tests for the clustering computation """
from nose.tools import *
import itertools
from shapely.geometry import Polygon
import marble as mb
#
# Synthetic data for tests
#
def grid():
""" Areal units arranged in a grid """
au = [i*3+j for i,j in itertools.product(range(3), repeat=2)]
units = {a:Polygo... | <commit_before>""" Tests for the clustering computation """
from nose.tools import *
import marble as mb
# Test c = 0 in the checkerboard case
# Test c = 1 in the fully clustered case
# Test an intermediate situation with known result
<commit_msg>Add tests for the clustering of cities<commit_after> | """ Tests for the clustering computation """
from nose.tools import *
import itertools
from shapely.geometry import Polygon
import marble as mb
#
# Synthetic data for tests
#
def grid():
""" Areal units arranged in a grid """
au = [i*3+j for i,j in itertools.product(range(3), repeat=2)]
units = {a:Polygo... | """ Tests for the clustering computation """
from nose.tools import *
import marble as mb
# Test c = 0 in the checkerboard case
# Test c = 1 in the fully clustered case
# Test an intermediate situation with known result
Add tests for the clustering of cities""" Tests for the clustering computation """
from nose.tool... | <commit_before>""" Tests for the clustering computation """
from nose.tools import *
import marble as mb
# Test c = 0 in the checkerboard case
# Test c = 1 in the fully clustered case
# Test an intermediate situation with known result
<commit_msg>Add tests for the clustering of cities<commit_after>""" Tests for the ... |
36ac84a0c8967b994242903a4cd404eac33af381 | sipa/model/pycroft/schema.py | sipa/model/pycroft/schema.py | # -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
cache: bool
traffic_b... | # -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
cache: bool
traffic_h... | Remove references to traffic balance | Remove references to traffic balance
| Python | mit | MarauderXtreme/sipa,agdsn/sipa,MarauderXtreme/sipa,MarauderXtreme/sipa,agdsn/sipa,agdsn/sipa,agdsn/sipa | # -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
cache: bool
traffic_b... | # -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
cache: bool
traffic_h... | <commit_before># -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
cache: boo... | # -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
cache: bool
traffic_h... | # -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
cache: bool
traffic_b... | <commit_before># -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
cache: boo... |
610fb9c9ac6a225df10ec770d44564e61af53ce0 | polling_stations/apps/addressbase/management/commands/import_cleaned_addresses.py | polling_stations/apps/addressbase/management/commands/import_cleaned_addresses.py | import os
import glob
from django.apps import apps
from django.db import connection
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""
Turn off auto system check for all apps
We will maunally run system checks only for the
'addressbase' and 'pollingstations' apps
... | import os
import glob
from django.apps import apps
from django.db import connection
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""
Turn off auto system check for all apps
We will maunally run system checks only for the
'addressbase' and 'pollingstations' apps
... | Use abspath for COPY command | Use abspath for COPY command
| Python | bsd-3-clause | chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations | import os
import glob
from django.apps import apps
from django.db import connection
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""
Turn off auto system check for all apps
We will maunally run system checks only for the
'addressbase' and 'pollingstations' apps
... | import os
import glob
from django.apps import apps
from django.db import connection
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""
Turn off auto system check for all apps
We will maunally run system checks only for the
'addressbase' and 'pollingstations' apps
... | <commit_before>import os
import glob
from django.apps import apps
from django.db import connection
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""
Turn off auto system check for all apps
We will maunally run system checks only for the
'addressbase' and 'pollingstat... | import os
import glob
from django.apps import apps
from django.db import connection
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""
Turn off auto system check for all apps
We will maunally run system checks only for the
'addressbase' and 'pollingstations' apps
... | import os
import glob
from django.apps import apps
from django.db import connection
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""
Turn off auto system check for all apps
We will maunally run system checks only for the
'addressbase' and 'pollingstations' apps
... | <commit_before>import os
import glob
from django.apps import apps
from django.db import connection
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""
Turn off auto system check for all apps
We will maunally run system checks only for the
'addressbase' and 'pollingstat... |
b556bffeb5ed48812258b452e05cc00cfb160453 | girder/app/app/configuration.py | girder/app/app/configuration.py | from girder.api import access
from girder.api.describe import Description, autoDescribeRoute
from girder.api.rest import Resource, RestException
from girder.constants import AccessType, TokenScope
from girder.models.setting import Setting
from .constants import Features, Deployment, Branding
class Configuration(Resou... | from girder.api import access
from girder.api.describe import Description, autoDescribeRoute
from girder.api.rest import Resource, RestException
from girder.constants import AccessType, TokenScope
from girder.models.setting import Setting
from .constants import Features, Deployment, Branding
class Configuration(Resou... | Fix up settings for upstream Girder change | Fix up settings for upstream Girder change
| Python | bsd-3-clause | OpenChemistry/mongochemserver | from girder.api import access
from girder.api.describe import Description, autoDescribeRoute
from girder.api.rest import Resource, RestException
from girder.constants import AccessType, TokenScope
from girder.models.setting import Setting
from .constants import Features, Deployment, Branding
class Configuration(Resou... | from girder.api import access
from girder.api.describe import Description, autoDescribeRoute
from girder.api.rest import Resource, RestException
from girder.constants import AccessType, TokenScope
from girder.models.setting import Setting
from .constants import Features, Deployment, Branding
class Configuration(Resou... | <commit_before>from girder.api import access
from girder.api.describe import Description, autoDescribeRoute
from girder.api.rest import Resource, RestException
from girder.constants import AccessType, TokenScope
from girder.models.setting import Setting
from .constants import Features, Deployment, Branding
class Conf... | from girder.api import access
from girder.api.describe import Description, autoDescribeRoute
from girder.api.rest import Resource, RestException
from girder.constants import AccessType, TokenScope
from girder.models.setting import Setting
from .constants import Features, Deployment, Branding
class Configuration(Resou... | from girder.api import access
from girder.api.describe import Description, autoDescribeRoute
from girder.api.rest import Resource, RestException
from girder.constants import AccessType, TokenScope
from girder.models.setting import Setting
from .constants import Features, Deployment, Branding
class Configuration(Resou... | <commit_before>from girder.api import access
from girder.api.describe import Description, autoDescribeRoute
from girder.api.rest import Resource, RestException
from girder.constants import AccessType, TokenScope
from girder.models.setting import Setting
from .constants import Features, Deployment, Branding
class Conf... |
a242100ccbeb1f647e9778ea853da40a2420e56a | fedimg/consumers.py | fedimg/consumers.py | #!/bin/env python
# -*- coding: utf8 -*-
import fedmsg.consumers
import fedmsg.encoding
import fedimg.uploader
class KojiConsumer(fedmsg.consumers.FedmsgConsumer):
# To our knowledge, all *image* builds appear under this
# exact topic, along with scratch builds.
topic = 'org.fedoraproject.prod.buildsys.... | #!/bin/env python
# -*- coding: utf8 -*-
import fedmsg.consumers
import fedmsg.encoding
import fedimg.uploader
class KojiConsumer(fedmsg.consumers.FedmsgConsumer):
# To our knowledge, all *image* builds appear under this
# exact topic, along with scratch builds.
topic = 'org.fedoraproject.prod.buildsys.... | Fix KeyError when getting fedmsg message info. | Fix KeyError when getting fedmsg message info.
| Python | agpl-3.0 | fedora-infra/fedimg,fedora-infra/fedimg | #!/bin/env python
# -*- coding: utf8 -*-
import fedmsg.consumers
import fedmsg.encoding
import fedimg.uploader
class KojiConsumer(fedmsg.consumers.FedmsgConsumer):
# To our knowledge, all *image* builds appear under this
# exact topic, along with scratch builds.
topic = 'org.fedoraproject.prod.buildsys.... | #!/bin/env python
# -*- coding: utf8 -*-
import fedmsg.consumers
import fedmsg.encoding
import fedimg.uploader
class KojiConsumer(fedmsg.consumers.FedmsgConsumer):
# To our knowledge, all *image* builds appear under this
# exact topic, along with scratch builds.
topic = 'org.fedoraproject.prod.buildsys.... | <commit_before>#!/bin/env python
# -*- coding: utf8 -*-
import fedmsg.consumers
import fedmsg.encoding
import fedimg.uploader
class KojiConsumer(fedmsg.consumers.FedmsgConsumer):
# To our knowledge, all *image* builds appear under this
# exact topic, along with scratch builds.
topic = 'org.fedoraproject... | #!/bin/env python
# -*- coding: utf8 -*-
import fedmsg.consumers
import fedmsg.encoding
import fedimg.uploader
class KojiConsumer(fedmsg.consumers.FedmsgConsumer):
# To our knowledge, all *image* builds appear under this
# exact topic, along with scratch builds.
topic = 'org.fedoraproject.prod.buildsys.... | #!/bin/env python
# -*- coding: utf8 -*-
import fedmsg.consumers
import fedmsg.encoding
import fedimg.uploader
class KojiConsumer(fedmsg.consumers.FedmsgConsumer):
# To our knowledge, all *image* builds appear under this
# exact topic, along with scratch builds.
topic = 'org.fedoraproject.prod.buildsys.... | <commit_before>#!/bin/env python
# -*- coding: utf8 -*-
import fedmsg.consumers
import fedmsg.encoding
import fedimg.uploader
class KojiConsumer(fedmsg.consumers.FedmsgConsumer):
# To our knowledge, all *image* builds appear under this
# exact topic, along with scratch builds.
topic = 'org.fedoraproject... |
b382c57e84d239f3f239f9e2587a3559e704f071 | mozcal/events/api.py | mozcal/events/api.py | from tastypie.resources import ModelResource
from models import Event
from mozcal.base.serializers import MozcalSerializer
class EventResource(ModelResource):
class Meta:
queryset = Event.objects.all()
filtering = {
"title": ('startswith',),
}
allowed_methods = ['get']
serializer = Mozca... | from tastypie.resources import ModelResource
from models import Event
from mozcal.base.serializers import MozcalSerializer
class EventResource(ModelResource):
class Meta:
queryset = Event.objects.all()
filtering = {
"title": ('startswith',),
}
allowed_methods = ['get']
include_resource_ur... | Exclude uri fields from EventResource | Exclude uri fields from EventResource
| Python | bsd-3-clause | yvan-sraka/wprevents,yvan-sraka/wprevents,yvan-sraka/wprevents,ppapadeas/wprevents,ppapadeas/wprevents,ppapadeas/wprevents,yvan-sraka/wprevents | from tastypie.resources import ModelResource
from models import Event
from mozcal.base.serializers import MozcalSerializer
class EventResource(ModelResource):
class Meta:
queryset = Event.objects.all()
filtering = {
"title": ('startswith',),
}
allowed_methods = ['get']
serializer = Mozca... | from tastypie.resources import ModelResource
from models import Event
from mozcal.base.serializers import MozcalSerializer
class EventResource(ModelResource):
class Meta:
queryset = Event.objects.all()
filtering = {
"title": ('startswith',),
}
allowed_methods = ['get']
include_resource_ur... | <commit_before>from tastypie.resources import ModelResource
from models import Event
from mozcal.base.serializers import MozcalSerializer
class EventResource(ModelResource):
class Meta:
queryset = Event.objects.all()
filtering = {
"title": ('startswith',),
}
allowed_methods = ['get']
ser... | from tastypie.resources import ModelResource
from models import Event
from mozcal.base.serializers import MozcalSerializer
class EventResource(ModelResource):
class Meta:
queryset = Event.objects.all()
filtering = {
"title": ('startswith',),
}
allowed_methods = ['get']
include_resource_ur... | from tastypie.resources import ModelResource
from models import Event
from mozcal.base.serializers import MozcalSerializer
class EventResource(ModelResource):
class Meta:
queryset = Event.objects.all()
filtering = {
"title": ('startswith',),
}
allowed_methods = ['get']
serializer = Mozca... | <commit_before>from tastypie.resources import ModelResource
from models import Event
from mozcal.base.serializers import MozcalSerializer
class EventResource(ModelResource):
class Meta:
queryset = Event.objects.all()
filtering = {
"title": ('startswith',),
}
allowed_methods = ['get']
ser... |
6c922f593dba7f3604763bbb489a910dee4c915a | .vim/templates/argparse.py | .vim/templates/argparse.py | import argparse
parser = argparse.ArgumentParser(description='A useful description of this script (might want to set this to __doc__)', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-x', metavar='nameofx', nargs='+', type=float, default=32*32*32, help='Helpful message about this argument... | import argparse
parser = argparse.ArgumentParser(description='A useful description of this script (might want to set this to __doc__)', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('strarg', type=str, help='A string argument')
parser.add_argument('numarg', type=float, help='A numerical a... | Add typed positional argument examples | Add typed positional argument examples
| Python | mit | SnoopJeDi/dotfiles,SnoopJeDi/dotfiles,SnoopJeDi/dotfiles | import argparse
parser = argparse.ArgumentParser(description='A useful description of this script (might want to set this to __doc__)', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-x', metavar='nameofx', nargs='+', type=float, default=32*32*32, help='Helpful message about this argument... | import argparse
parser = argparse.ArgumentParser(description='A useful description of this script (might want to set this to __doc__)', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('strarg', type=str, help='A string argument')
parser.add_argument('numarg', type=float, help='A numerical a... | <commit_before>import argparse
parser = argparse.ArgumentParser(description='A useful description of this script (might want to set this to __doc__)', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-x', metavar='nameofx', nargs='+', type=float, default=32*32*32, help='Helpful message abou... | import argparse
parser = argparse.ArgumentParser(description='A useful description of this script (might want to set this to __doc__)', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('strarg', type=str, help='A string argument')
parser.add_argument('numarg', type=float, help='A numerical a... | import argparse
parser = argparse.ArgumentParser(description='A useful description of this script (might want to set this to __doc__)', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-x', metavar='nameofx', nargs='+', type=float, default=32*32*32, help='Helpful message about this argument... | <commit_before>import argparse
parser = argparse.ArgumentParser(description='A useful description of this script (might want to set this to __doc__)', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-x', metavar='nameofx', nargs='+', type=float, default=32*32*32, help='Helpful message abou... |
0377db272c5535b478732fbf045a73b30a5eac00 | migrations/versions/849170064430_.py | migrations/versions/849170064430_.py | """add enqueue_job column to smtpserver table
Revision ID: 849170064430
Revises: a63df077051a
Create Date: 2018-11-22 10:04:00.330101
"""
# revision identifiers, used by Alembic.
revision = '849170064430'
down_revision = 'a63df077051a'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
... | """add enqueue_job column to smtpserver table
Revision ID: 849170064430
Revises: a63df077051a
Create Date: 2018-11-22 10:04:00.330101
"""
# revision identifiers, used by Alembic.
revision = '849170064430'
down_revision = '48ee74b8a7c8'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
... | Update down-revision of queue migration script | Update down-revision of queue migration script
| Python | agpl-3.0 | privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea | """add enqueue_job column to smtpserver table
Revision ID: 849170064430
Revises: a63df077051a
Create Date: 2018-11-22 10:04:00.330101
"""
# revision identifiers, used by Alembic.
revision = '849170064430'
down_revision = 'a63df077051a'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
... | """add enqueue_job column to smtpserver table
Revision ID: 849170064430
Revises: a63df077051a
Create Date: 2018-11-22 10:04:00.330101
"""
# revision identifiers, used by Alembic.
revision = '849170064430'
down_revision = '48ee74b8a7c8'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
... | <commit_before>"""add enqueue_job column to smtpserver table
Revision ID: 849170064430
Revises: a63df077051a
Create Date: 2018-11-22 10:04:00.330101
"""
# revision identifiers, used by Alembic.
revision = '849170064430'
down_revision = 'a63df077051a'
from alembic import op
import sqlalchemy as sa
def upgrade():
... | """add enqueue_job column to smtpserver table
Revision ID: 849170064430
Revises: a63df077051a
Create Date: 2018-11-22 10:04:00.330101
"""
# revision identifiers, used by Alembic.
revision = '849170064430'
down_revision = '48ee74b8a7c8'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
... | """add enqueue_job column to smtpserver table
Revision ID: 849170064430
Revises: a63df077051a
Create Date: 2018-11-22 10:04:00.330101
"""
# revision identifiers, used by Alembic.
revision = '849170064430'
down_revision = 'a63df077051a'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
... | <commit_before>"""add enqueue_job column to smtpserver table
Revision ID: 849170064430
Revises: a63df077051a
Create Date: 2018-11-22 10:04:00.330101
"""
# revision identifiers, used by Alembic.
revision = '849170064430'
down_revision = 'a63df077051a'
from alembic import op
import sqlalchemy as sa
def upgrade():
... |
3ad640e7881903caaa9faee12aaedf9990881513 | weather_api/weather/management/commands/save_locations_to_database.py | weather_api/weather/management/commands/save_locations_to_database.py | from django.core.management import BaseCommand
from django_pyowm.models import Location
from pyowm.webapi25.location import Location as LocationEntity
from weather_api.weather.singletons import owm
class Command(BaseCommand):
help = 'Save all locations from file to database'
def handle(self, *args, **option... | from django.core.management import BaseCommand
from django_pyowm.models import Location
from pyowm.webapi25.location import Location as LocationEntity
from weather_api.weather.singletons import owm
class Command(BaseCommand):
help = 'Save all locations from file to database'
def handle(self, *args, **option... | Make batch less, because sqlite cannot handle big batches | Make batch less, because sqlite cannot handle big batches
| Python | mit | dimka2014/weather-api,dimka2014/weather-api | from django.core.management import BaseCommand
from django_pyowm.models import Location
from pyowm.webapi25.location import Location as LocationEntity
from weather_api.weather.singletons import owm
class Command(BaseCommand):
help = 'Save all locations from file to database'
def handle(self, *args, **option... | from django.core.management import BaseCommand
from django_pyowm.models import Location
from pyowm.webapi25.location import Location as LocationEntity
from weather_api.weather.singletons import owm
class Command(BaseCommand):
help = 'Save all locations from file to database'
def handle(self, *args, **option... | <commit_before>from django.core.management import BaseCommand
from django_pyowm.models import Location
from pyowm.webapi25.location import Location as LocationEntity
from weather_api.weather.singletons import owm
class Command(BaseCommand):
help = 'Save all locations from file to database'
def handle(self, ... | from django.core.management import BaseCommand
from django_pyowm.models import Location
from pyowm.webapi25.location import Location as LocationEntity
from weather_api.weather.singletons import owm
class Command(BaseCommand):
help = 'Save all locations from file to database'
def handle(self, *args, **option... | from django.core.management import BaseCommand
from django_pyowm.models import Location
from pyowm.webapi25.location import Location as LocationEntity
from weather_api.weather.singletons import owm
class Command(BaseCommand):
help = 'Save all locations from file to database'
def handle(self, *args, **option... | <commit_before>from django.core.management import BaseCommand
from django_pyowm.models import Location
from pyowm.webapi25.location import Location as LocationEntity
from weather_api.weather.singletons import owm
class Command(BaseCommand):
help = 'Save all locations from file to database'
def handle(self, ... |
30c2463fbe5c14273bd23d05ac2d97450285132e | client/config.py | client/config.py | # set debug to False on non prod env
IS_DEV = True
# profile speed of methods and output it to terminal
PROFILE_METHODS = False
# set to false if you want to disable accessing redis
CACHE_DATA = True
| # set debug to False on non prod env
IS_DEV = True
# profile speed of methods and output it to terminal
PROFILE_METHODS = False
# set to false if you want to disable accessing redis
CACHE_DATA = False
| Reset caching variable to False | Reset caching variable to False
| Python | mit | SAAVY/magpie,SAAVY/magpie | # set debug to False on non prod env
IS_DEV = True
# profile speed of methods and output it to terminal
PROFILE_METHODS = False
# set to false if you want to disable accessing redis
CACHE_DATA = True
Reset caching variable to False | # set debug to False on non prod env
IS_DEV = True
# profile speed of methods and output it to terminal
PROFILE_METHODS = False
# set to false if you want to disable accessing redis
CACHE_DATA = False
| <commit_before># set debug to False on non prod env
IS_DEV = True
# profile speed of methods and output it to terminal
PROFILE_METHODS = False
# set to false if you want to disable accessing redis
CACHE_DATA = True
<commit_msg>Reset caching variable to False<commit_after> | # set debug to False on non prod env
IS_DEV = True
# profile speed of methods and output it to terminal
PROFILE_METHODS = False
# set to false if you want to disable accessing redis
CACHE_DATA = False
| # set debug to False on non prod env
IS_DEV = True
# profile speed of methods and output it to terminal
PROFILE_METHODS = False
# set to false if you want to disable accessing redis
CACHE_DATA = True
Reset caching variable to False# set debug to False on non prod env
IS_DEV = True
# profile speed of methods and outp... | <commit_before># set debug to False on non prod env
IS_DEV = True
# profile speed of methods and output it to terminal
PROFILE_METHODS = False
# set to false if you want to disable accessing redis
CACHE_DATA = True
<commit_msg>Reset caching variable to False<commit_after># set debug to False on non prod env
IS_DEV = ... |
dfbae8fd2f2346ecf7bb1e04c9c43c18e4da234d | src/encoded/authorization.py | src/encoded/authorization.py | from sqlalchemy.orm.exc import NoResultFound
from .storage import (
DBSession,
UserMap,
)
def groupfinder(login, request):
if ':' not in login:
return None
namespace, localname = login.split(':', 1)
if namespace == 'mailto':
session = DBSession()
query = session.query(... | from sqlalchemy.orm.exc import NoResultFound
from .storage import (
DBSession,
UserMap,
)
def groupfinder(login, request):
if ':' not in login:
return None
namespace, localname = login.split(':', 1)
if namespace == 'mailto':
session = DBSession()
model = session.query(... | Simplify the groupfinder a little. In general we should try to use session.query(...).get() rather than .filter(). | Simplify the groupfinder a little. In general we should try to use session.query(...).get() rather than .filter().
| Python | mit | kidaa/encoded,philiptzou/clincoded,ENCODE-DCC/snovault,T2DREAM/t2dream-portal,hms-dbmi/fourfront,hms-dbmi/fourfront,ClinGen/clincoded,ENCODE-DCC/snovault,ClinGen/clincoded,ENCODE-DCC/encoded,T2DREAM/t2dream-portal,philiptzou/clincoded,T2DREAM/t2dream-portal,4dn-dcic/fourfront,kidaa/encoded,kidaa/encoded,T2DREAM/t2dream... | from sqlalchemy.orm.exc import NoResultFound
from .storage import (
DBSession,
UserMap,
)
def groupfinder(login, request):
if ':' not in login:
return None
namespace, localname = login.split(':', 1)
if namespace == 'mailto':
session = DBSession()
query = session.query(... | from sqlalchemy.orm.exc import NoResultFound
from .storage import (
DBSession,
UserMap,
)
def groupfinder(login, request):
if ':' not in login:
return None
namespace, localname = login.split(':', 1)
if namespace == 'mailto':
session = DBSession()
model = session.query(... | <commit_before>from sqlalchemy.orm.exc import NoResultFound
from .storage import (
DBSession,
UserMap,
)
def groupfinder(login, request):
if ':' not in login:
return None
namespace, localname = login.split(':', 1)
if namespace == 'mailto':
session = DBSession()
query =... | from sqlalchemy.orm.exc import NoResultFound
from .storage import (
DBSession,
UserMap,
)
def groupfinder(login, request):
if ':' not in login:
return None
namespace, localname = login.split(':', 1)
if namespace == 'mailto':
session = DBSession()
model = session.query(... | from sqlalchemy.orm.exc import NoResultFound
from .storage import (
DBSession,
UserMap,
)
def groupfinder(login, request):
if ':' not in login:
return None
namespace, localname = login.split(':', 1)
if namespace == 'mailto':
session = DBSession()
query = session.query(... | <commit_before>from sqlalchemy.orm.exc import NoResultFound
from .storage import (
DBSession,
UserMap,
)
def groupfinder(login, request):
if ':' not in login:
return None
namespace, localname = login.split(':', 1)
if namespace == 'mailto':
session = DBSession()
query =... |
4765390537713d09b683c3cdbe22d128e00662f2 | tests/integration/test_frontend.py | tests/integration/test_frontend.py | """
Test the frontend.
"""
from base import IntegrationTestCase
from abilian.web.frontend import CRUDApp, BreadCrumbs
class FrontendTestCase(IntegrationTestCase):
def test(self):
pass
| """
Test the frontend.
"""
from flask.ext.wtf import Form
from sqlalchemy import Column, UnicodeText, String
from abilian.core.entities import Entity
from abilian.web.frontend import CRUDApp, Module
from .base import IntegrationTestCase
class EmailAddress(object):
pass
class Contact(Entity):
__tablename__ = 'c... | Add integration tests for CRM app. | Add integration tests for CRM app.
| Python | lgpl-2.1 | abilian/abilian-core,abilian/abilian-core,abilian/abilian-core,abilian/abilian-core,abilian/abilian-core | """
Test the frontend.
"""
from base import IntegrationTestCase
from abilian.web.frontend import CRUDApp, BreadCrumbs
class FrontendTestCase(IntegrationTestCase):
def test(self):
pass
Add integration tests for CRM app. | """
Test the frontend.
"""
from flask.ext.wtf import Form
from sqlalchemy import Column, UnicodeText, String
from abilian.core.entities import Entity
from abilian.web.frontend import CRUDApp, Module
from .base import IntegrationTestCase
class EmailAddress(object):
pass
class Contact(Entity):
__tablename__ = 'c... | <commit_before>"""
Test the frontend.
"""
from base import IntegrationTestCase
from abilian.web.frontend import CRUDApp, BreadCrumbs
class FrontendTestCase(IntegrationTestCase):
def test(self):
pass
<commit_msg>Add integration tests for CRM app.<commit_after> | """
Test the frontend.
"""
from flask.ext.wtf import Form
from sqlalchemy import Column, UnicodeText, String
from abilian.core.entities import Entity
from abilian.web.frontend import CRUDApp, Module
from .base import IntegrationTestCase
class EmailAddress(object):
pass
class Contact(Entity):
__tablename__ = 'c... | """
Test the frontend.
"""
from base import IntegrationTestCase
from abilian.web.frontend import CRUDApp, BreadCrumbs
class FrontendTestCase(IntegrationTestCase):
def test(self):
pass
Add integration tests for CRM app."""
Test the frontend.
"""
from flask.ext.wtf import Form
from sqlalchemy import Column, Uni... | <commit_before>"""
Test the frontend.
"""
from base import IntegrationTestCase
from abilian.web.frontend import CRUDApp, BreadCrumbs
class FrontendTestCase(IntegrationTestCase):
def test(self):
pass
<commit_msg>Add integration tests for CRM app.<commit_after>"""
Test the frontend.
"""
from flask.ext.wtf impor... |
b7bb3b0782fcece12531b90a17eda98c4ae59be0 | notes/templatetags/note_tags.py | notes/templatetags/note_tags.py | from django.template import Library, Node, TemplateSyntaxError
from django.utils.html import escape
from django.utils.http import urlquote
from django.utils.safestring import mark_safe
from notes.models import Note
from castle.models import Profile
register = Library()
#-----------------------------------------------... | from django.template import Library, Node, TemplateSyntaxError
from django.utils.html import escape
from django.utils.http import urlquote
from django.utils.safestring import mark_safe
from notes.models import Note
from castle.models import Profile
register = Library()
#-----------------------------------------------... | Update to display notes count bubble only when new notes are available | Update to display notes count bubble only when new notes are available
| Python | agpl-3.0 | ficlatte/main,HSAR/Ficlatte,stitzelj/Ficlatte,ficlatte/main,HSAR/Ficlatte,stitzelj/Ficlatte | from django.template import Library, Node, TemplateSyntaxError
from django.utils.html import escape
from django.utils.http import urlquote
from django.utils.safestring import mark_safe
from notes.models import Note
from castle.models import Profile
register = Library()
#-----------------------------------------------... | from django.template import Library, Node, TemplateSyntaxError
from django.utils.html import escape
from django.utils.http import urlquote
from django.utils.safestring import mark_safe
from notes.models import Note
from castle.models import Profile
register = Library()
#-----------------------------------------------... | <commit_before>from django.template import Library, Node, TemplateSyntaxError
from django.utils.html import escape
from django.utils.http import urlquote
from django.utils.safestring import mark_safe
from notes.models import Note
from castle.models import Profile
register = Library()
#--------------------------------... | from django.template import Library, Node, TemplateSyntaxError
from django.utils.html import escape
from django.utils.http import urlquote
from django.utils.safestring import mark_safe
from notes.models import Note
from castle.models import Profile
register = Library()
#-----------------------------------------------... | from django.template import Library, Node, TemplateSyntaxError
from django.utils.html import escape
from django.utils.http import urlquote
from django.utils.safestring import mark_safe
from notes.models import Note
from castle.models import Profile
register = Library()
#-----------------------------------------------... | <commit_before>from django.template import Library, Node, TemplateSyntaxError
from django.utils.html import escape
from django.utils.http import urlquote
from django.utils.safestring import mark_safe
from notes.models import Note
from castle.models import Profile
register = Library()
#--------------------------------... |
6d333d74d75c346c922dc65d8e311b4d976a9dd6 | tests/test_NistRandomnessBeacon.py | tests/test_NistRandomnessBeacon.py | from unittest import TestCase
from unittest.mock import (
Mock,
patch,
)
import requests.exceptions
from py_nist_beacon import NistRandomnessBeacon
from py_nist_beacon.nist_randomness_beacon_value import (
NistRandomnessBeaconValue
)
class TestNistRandomnessBeacon(TestCase):
def test_get_last_record... | Test that get last record method | Test that get last record method
| Python | apache-2.0 | urda/nistbeacon | Test that get last record method | from unittest import TestCase
from unittest.mock import (
Mock,
patch,
)
import requests.exceptions
from py_nist_beacon import NistRandomnessBeacon
from py_nist_beacon.nist_randomness_beacon_value import (
NistRandomnessBeaconValue
)
class TestNistRandomnessBeacon(TestCase):
def test_get_last_record... | <commit_before><commit_msg>Test that get last record method<commit_after> | from unittest import TestCase
from unittest.mock import (
Mock,
patch,
)
import requests.exceptions
from py_nist_beacon import NistRandomnessBeacon
from py_nist_beacon.nist_randomness_beacon_value import (
NistRandomnessBeaconValue
)
class TestNistRandomnessBeacon(TestCase):
def test_get_last_record... | Test that get last record methodfrom unittest import TestCase
from unittest.mock import (
Mock,
patch,
)
import requests.exceptions
from py_nist_beacon import NistRandomnessBeacon
from py_nist_beacon.nist_randomness_beacon_value import (
NistRandomnessBeaconValue
)
class TestNistRandomnessBeacon(TestCas... | <commit_before><commit_msg>Test that get last record method<commit_after>from unittest import TestCase
from unittest.mock import (
Mock,
patch,
)
import requests.exceptions
from py_nist_beacon import NistRandomnessBeacon
from py_nist_beacon.nist_randomness_beacon_value import (
NistRandomnessBeaconValue
)... | |
c4880ef0350d7cf58d9dff344f98f3b3096f2613 | this_app/models.py | this_app/models.py | from werkzeug.security import generate_password_hash, check_password_hash
class User(object):
"""represents a user who can CRUD his own bucketlists"""
users = {}
def __init__(self, email, username, password):
"""Constructor class to initialize class"""
self.email = email
self.use... | from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
class User(UserMixin):
"""Represents a user who can Create, Read, Update & Delete his own bucketlists"""
counter = 0
users = {}
def __init__(self, email, username, password):
"""Constru... | Update User model class with flask-login methods | Update User model class with flask-login methods
| Python | mit | borenho/flask-bucketlist,borenho/flask-bucketlist | from werkzeug.security import generate_password_hash, check_password_hash
class User(object):
"""represents a user who can CRUD his own bucketlists"""
users = {}
def __init__(self, email, username, password):
"""Constructor class to initialize class"""
self.email = email
self.use... | from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
class User(UserMixin):
"""Represents a user who can Create, Read, Update & Delete his own bucketlists"""
counter = 0
users = {}
def __init__(self, email, username, password):
"""Constru... | <commit_before>from werkzeug.security import generate_password_hash, check_password_hash
class User(object):
"""represents a user who can CRUD his own bucketlists"""
users = {}
def __init__(self, email, username, password):
"""Constructor class to initialize class"""
self.email = email
... | from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
class User(UserMixin):
"""Represents a user who can Create, Read, Update & Delete his own bucketlists"""
counter = 0
users = {}
def __init__(self, email, username, password):
"""Constru... | from werkzeug.security import generate_password_hash, check_password_hash
class User(object):
"""represents a user who can CRUD his own bucketlists"""
users = {}
def __init__(self, email, username, password):
"""Constructor class to initialize class"""
self.email = email
self.use... | <commit_before>from werkzeug.security import generate_password_hash, check_password_hash
class User(object):
"""represents a user who can CRUD his own bucketlists"""
users = {}
def __init__(self, email, username, password):
"""Constructor class to initialize class"""
self.email = email
... |
1c07b3b29c18147578c94a21abf6c34647a7185d | tests/test_parse.py | tests/test_parse.py | import pytest
from skidl import *
from .setup_teardown import *
def test_parser_1():
netlist_to_skidl(r'C:\xesscorp\KiCad\tools\skidl\tests\Arduino_Uno_R3_From_Scratch.net')
| import pytest
from skidl import *
from .setup_teardown import *
def test_parser_1():
netlist_to_skidl(get_filename('Arduino_Uno_R3_From_Scratch.net'))
| Fix remaining absolute path in tests | Fix remaining absolute path in tests
| Python | mit | xesscorp/skidl,xesscorp/skidl | import pytest
from skidl import *
from .setup_teardown import *
def test_parser_1():
netlist_to_skidl(r'C:\xesscorp\KiCad\tools\skidl\tests\Arduino_Uno_R3_From_Scratch.net')
Fix remaining absolute path in tests | import pytest
from skidl import *
from .setup_teardown import *
def test_parser_1():
netlist_to_skidl(get_filename('Arduino_Uno_R3_From_Scratch.net'))
| <commit_before>import pytest
from skidl import *
from .setup_teardown import *
def test_parser_1():
netlist_to_skidl(r'C:\xesscorp\KiCad\tools\skidl\tests\Arduino_Uno_R3_From_Scratch.net')
<commit_msg>Fix remaining absolute path in tests<commit_after> | import pytest
from skidl import *
from .setup_teardown import *
def test_parser_1():
netlist_to_skidl(get_filename('Arduino_Uno_R3_From_Scratch.net'))
| import pytest
from skidl import *
from .setup_teardown import *
def test_parser_1():
netlist_to_skidl(r'C:\xesscorp\KiCad\tools\skidl\tests\Arduino_Uno_R3_From_Scratch.net')
Fix remaining absolute path in testsimport pytest
from skidl import *
from .setup_teardown import *
def test_parser_1():
netlist_to_skid... | <commit_before>import pytest
from skidl import *
from .setup_teardown import *
def test_parser_1():
netlist_to_skidl(r'C:\xesscorp\KiCad\tools\skidl\tests\Arduino_Uno_R3_From_Scratch.net')
<commit_msg>Fix remaining absolute path in tests<commit_after>import pytest
from skidl import *
from .setup_teardown import *
... |
8cfbbe13d9a2c94529e2d2c06a8e154d9892c8c4 | numpy/distutils/fcompiler/nag.py | numpy/distutils/fcompiler/nag.py | import os
import sys
from numpy.distutils.cpuinfo import cpu
from numpy.distutils.fcompiler import FCompiler
class NAGFCompiler(FCompiler):
compiler_type = 'nag'
version_pattern = r'NAGWare Fortran 95 compiler Release (?P<version>[^\s]*)'
executables = {
'version_cmd' : ["f95", "-V"],
... | import os
import sys
from numpy.distutils.cpuinfo import cpu
from numpy.distutils.fcompiler import FCompiler
class NAGFCompiler(FCompiler):
compiler_type = 'nag'
version_pattern = r'NAGWare Fortran 95 compiler Release (?P<version>[^\s]*)'
executables = {
'version_cmd' : ["f95", "-V"],
... | Fix for using NAG Fortran 95, due to James Graham <jg307@cam.ac.uk> | Fix for using NAG Fortran 95, due to James Graham <jg307@cam.ac.uk>
| Python | bsd-3-clause | mingwpy/numpy,rmcgibbo/numpy,jakirkham/numpy,githubmlai/numpy,BabeNovelty/numpy,pizzathief/numpy,ogrisel/numpy,astrofrog/numpy,andsor/numpy,cowlicks/numpy,rhythmsosad/numpy,simongibbons/numpy,felipebetancur/numpy,stefanv/numpy,GrimDerp/numpy,CMartelLML/numpy,githubmlai/numpy,pyparallel/numpy,madphysicist/numpy,Dapid/nu... | import os
import sys
from numpy.distutils.cpuinfo import cpu
from numpy.distutils.fcompiler import FCompiler
class NAGFCompiler(FCompiler):
compiler_type = 'nag'
version_pattern = r'NAGWare Fortran 95 compiler Release (?P<version>[^\s]*)'
executables = {
'version_cmd' : ["f95", "-V"],
... | import os
import sys
from numpy.distutils.cpuinfo import cpu
from numpy.distutils.fcompiler import FCompiler
class NAGFCompiler(FCompiler):
compiler_type = 'nag'
version_pattern = r'NAGWare Fortran 95 compiler Release (?P<version>[^\s]*)'
executables = {
'version_cmd' : ["f95", "-V"],
... | <commit_before>import os
import sys
from numpy.distutils.cpuinfo import cpu
from numpy.distutils.fcompiler import FCompiler
class NAGFCompiler(FCompiler):
compiler_type = 'nag'
version_pattern = r'NAGWare Fortran 95 compiler Release (?P<version>[^\s]*)'
executables = {
'version_cmd' : ["f95", ... | import os
import sys
from numpy.distutils.cpuinfo import cpu
from numpy.distutils.fcompiler import FCompiler
class NAGFCompiler(FCompiler):
compiler_type = 'nag'
version_pattern = r'NAGWare Fortran 95 compiler Release (?P<version>[^\s]*)'
executables = {
'version_cmd' : ["f95", "-V"],
... | import os
import sys
from numpy.distutils.cpuinfo import cpu
from numpy.distutils.fcompiler import FCompiler
class NAGFCompiler(FCompiler):
compiler_type = 'nag'
version_pattern = r'NAGWare Fortran 95 compiler Release (?P<version>[^\s]*)'
executables = {
'version_cmd' : ["f95", "-V"],
... | <commit_before>import os
import sys
from numpy.distutils.cpuinfo import cpu
from numpy.distutils.fcompiler import FCompiler
class NAGFCompiler(FCompiler):
compiler_type = 'nag'
version_pattern = r'NAGWare Fortran 95 compiler Release (?P<version>[^\s]*)'
executables = {
'version_cmd' : ["f95", ... |
192c7b01a34c3b9200005744790b63bcd7a7333c | pytablereader/loadermanager/_base.py | pytablereader/loadermanager/_base.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property
def format... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property
def format... | Add an interface to change loading encoding for File/URL loaders | Add an interface to change loading encoding for File/URL loaders
| Python | mit | thombashi/pytablereader,thombashi/pytablereader,thombashi/pytablereader | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property
def format... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property
def format... | <commit_before># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property
def format... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property
def format... | <commit_before># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property... |
8b916c0d4b45427f4820bb63fcccc085375c405a | jsplot/plot.py | jsplot/plot.py | data = []
def plot(x, y, label=None):
d = {
"data": zip(x, y),
}
if label:
d["label"] = label
data.append(d)
def show():
from plotserver.runserver import main
main()
def grid(*args, **kwargs):
pass
def legend(*args, **kwargs):
pass
| data = []
def plot(x, y, format=None, label=None, lw=None):
d = {
"data": zip(x, y),
}
if label:
d["label"] = label
data.append(d)
def show():
from plotserver.runserver import main
main()
def grid(*args, **kwargs):
pass
def legend(*args, **kwargs):
pass
| Add format and lw kwargs | Add format and lw kwargs
| Python | mit | certik/jsplot,certik/jsplot | data = []
def plot(x, y, label=None):
d = {
"data": zip(x, y),
}
if label:
d["label"] = label
data.append(d)
def show():
from plotserver.runserver import main
main()
def grid(*args, **kwargs):
pass
def legend(*args, **kwargs):
pass
Add format and lw kwargs | data = []
def plot(x, y, format=None, label=None, lw=None):
d = {
"data": zip(x, y),
}
if label:
d["label"] = label
data.append(d)
def show():
from plotserver.runserver import main
main()
def grid(*args, **kwargs):
pass
def legend(*args, **kwargs):
pass
| <commit_before>data = []
def plot(x, y, label=None):
d = {
"data": zip(x, y),
}
if label:
d["label"] = label
data.append(d)
def show():
from plotserver.runserver import main
main()
def grid(*args, **kwargs):
pass
def legend(*args, **kwargs):
pass
<commit_msg>Add f... | data = []
def plot(x, y, format=None, label=None, lw=None):
d = {
"data": zip(x, y),
}
if label:
d["label"] = label
data.append(d)
def show():
from plotserver.runserver import main
main()
def grid(*args, **kwargs):
pass
def legend(*args, **kwargs):
pass
| data = []
def plot(x, y, label=None):
d = {
"data": zip(x, y),
}
if label:
d["label"] = label
data.append(d)
def show():
from plotserver.runserver import main
main()
def grid(*args, **kwargs):
pass
def legend(*args, **kwargs):
pass
Add format and lw kwargsdata = [... | <commit_before>data = []
def plot(x, y, label=None):
d = {
"data": zip(x, y),
}
if label:
d["label"] = label
data.append(d)
def show():
from plotserver.runserver import main
main()
def grid(*args, **kwargs):
pass
def legend(*args, **kwargs):
pass
<commit_msg>Add f... |
478eb4908874167c472eed120d7ba49c737114e9 | kokekunster/urls.py | kokekunster/urls.py | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | Fix semester url regex bug | Fix semester url regex bug
| Python | mit | afriestad/WikiLinks,afriestad/WikiLinks,afriestad/WikiLinks | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | <commit_before>"""kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, nam... | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | """kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | <commit_before>"""kokekunster URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, nam... |
85db14b8584995da667c92cda6a44e2b3395250e | greenlight/views/__init__.py | greenlight/views/__init__.py | from three import Three
from django.core.urlresolvers import reverse
from django.http import Http404
from .base import APIView
QC_three = Three(
endpoint = "http://dev-api.ville.quebec.qc.ca/open311/v2/",
format = "json",
jurisdiction = "ville.quebec.qc.ca",
)
class ServicesView(APIView):
def get(self, reques... | from three import Three
from django.core.urlresolvers import reverse
from django.http import Http404
from .base import APIView
QC_three = Three(
endpoint = "http://dev-api.ville.quebec.qc.ca/open311/v2/",
format = "json",
jurisdiction = "ville.quebec.qc.ca",
)
class ServicesView(APIView):
def get(self, reques... | Fix a bug when the open311 API returns an error. | Fix a bug when the open311 API returns an error.
| Python | mit | ironweb/lesfeuxverts-backend | from three import Three
from django.core.urlresolvers import reverse
from django.http import Http404
from .base import APIView
QC_three = Three(
endpoint = "http://dev-api.ville.quebec.qc.ca/open311/v2/",
format = "json",
jurisdiction = "ville.quebec.qc.ca",
)
class ServicesView(APIView):
def get(self, reques... | from three import Three
from django.core.urlresolvers import reverse
from django.http import Http404
from .base import APIView
QC_three = Three(
endpoint = "http://dev-api.ville.quebec.qc.ca/open311/v2/",
format = "json",
jurisdiction = "ville.quebec.qc.ca",
)
class ServicesView(APIView):
def get(self, reques... | <commit_before>from three import Three
from django.core.urlresolvers import reverse
from django.http import Http404
from .base import APIView
QC_three = Three(
endpoint = "http://dev-api.ville.quebec.qc.ca/open311/v2/",
format = "json",
jurisdiction = "ville.quebec.qc.ca",
)
class ServicesView(APIView):
def g... | from three import Three
from django.core.urlresolvers import reverse
from django.http import Http404
from .base import APIView
QC_three = Three(
endpoint = "http://dev-api.ville.quebec.qc.ca/open311/v2/",
format = "json",
jurisdiction = "ville.quebec.qc.ca",
)
class ServicesView(APIView):
def get(self, reques... | from three import Three
from django.core.urlresolvers import reverse
from django.http import Http404
from .base import APIView
QC_three = Three(
endpoint = "http://dev-api.ville.quebec.qc.ca/open311/v2/",
format = "json",
jurisdiction = "ville.quebec.qc.ca",
)
class ServicesView(APIView):
def get(self, reques... | <commit_before>from three import Three
from django.core.urlresolvers import reverse
from django.http import Http404
from .base import APIView
QC_three = Three(
endpoint = "http://dev-api.ville.quebec.qc.ca/open311/v2/",
format = "json",
jurisdiction = "ville.quebec.qc.ca",
)
class ServicesView(APIView):
def g... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.