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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5a82f76e3e95268fb1bbb297faa43e7f7cb59058 | tests/perf_concrete_execution.py | tests/perf_concrete_execution.py |
# Performance tests on concrete code execution without invoking Unicorn engine
import os
import time
import logging
import angr
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests'))
def test_tight_loop(arch):
b = angr.Project(os.path.join(test_locatio... |
# Performance tests on concrete code execution without invoking Unicorn engine
import os
import time
import logging
import angr
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests'))
def test_tight_loop(arch):
b = angr.Project(os.path.join(test_locatio... | Enable SimLightRegisters and remove COPY_STATES for the performance test case. | Enable SimLightRegisters and remove COPY_STATES for the performance test case.
| Python | bsd-2-clause | angr/angr,schieb/angr,schieb/angr,iamahuman/angr,schieb/angr,iamahuman/angr,angr/angr,iamahuman/angr,angr/angr |
# Performance tests on concrete code execution without invoking Unicorn engine
import os
import time
import logging
import angr
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests'))
def test_tight_loop(arch):
b = angr.Project(os.path.join(test_locatio... |
# Performance tests on concrete code execution without invoking Unicorn engine
import os
import time
import logging
import angr
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests'))
def test_tight_loop(arch):
b = angr.Project(os.path.join(test_locatio... | <commit_before>
# Performance tests on concrete code execution without invoking Unicorn engine
import os
import time
import logging
import angr
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests'))
def test_tight_loop(arch):
b = angr.Project(os.path.jo... |
# Performance tests on concrete code execution without invoking Unicorn engine
import os
import time
import logging
import angr
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests'))
def test_tight_loop(arch):
b = angr.Project(os.path.join(test_locatio... |
# Performance tests on concrete code execution without invoking Unicorn engine
import os
import time
import logging
import angr
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests'))
def test_tight_loop(arch):
b = angr.Project(os.path.join(test_locatio... | <commit_before>
# Performance tests on concrete code execution without invoking Unicorn engine
import os
import time
import logging
import angr
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests'))
def test_tight_loop(arch):
b = angr.Project(os.path.jo... |
db981f7616283992fd1d17a3b1bf7d300b8ee34f | proper_parens.py | proper_parens.py | #!/usr/bin/env python
from __future__ import unicode_literals
<<<<<<< HEAD
def check_statement1(value):
output = 0
while output >= 0:
for item in value:
if item == ")":
output -= 1
if output == -1:
return -1
elif item == "(":
... | #!/usr/bin/env python
from __future__ import unicode_literals
def check_statement(value):
''' Return 1, 0, or -1 if input is open, balanced, or broken. '''
output = 0
index = 0
while index < len(value) and output >= 0:
# If the count is ever < 0, statement must be -1 (broken), end loop
... | Fix proper parens merge conflict | Fix proper parens merge conflict
| Python | mit | constanthatz/data-structures | #!/usr/bin/env python
from __future__ import unicode_literals
<<<<<<< HEAD
def check_statement1(value):
output = 0
while output >= 0:
for item in value:
if item == ")":
output -= 1
if output == -1:
return -1
elif item == "(":
... | #!/usr/bin/env python
from __future__ import unicode_literals
def check_statement(value):
''' Return 1, 0, or -1 if input is open, balanced, or broken. '''
output = 0
index = 0
while index < len(value) and output >= 0:
# If the count is ever < 0, statement must be -1 (broken), end loop
... | <commit_before>#!/usr/bin/env python
from __future__ import unicode_literals
<<<<<<< HEAD
def check_statement1(value):
output = 0
while output >= 0:
for item in value:
if item == ")":
output -= 1
if output == -1:
return -1
eli... | #!/usr/bin/env python
from __future__ import unicode_literals
def check_statement(value):
''' Return 1, 0, or -1 if input is open, balanced, or broken. '''
output = 0
index = 0
while index < len(value) and output >= 0:
# If the count is ever < 0, statement must be -1 (broken), end loop
... | #!/usr/bin/env python
from __future__ import unicode_literals
<<<<<<< HEAD
def check_statement1(value):
output = 0
while output >= 0:
for item in value:
if item == ")":
output -= 1
if output == -1:
return -1
elif item == "(":
... | <commit_before>#!/usr/bin/env python
from __future__ import unicode_literals
<<<<<<< HEAD
def check_statement1(value):
output = 0
while output >= 0:
for item in value:
if item == ")":
output -= 1
if output == -1:
return -1
eli... |
075b8ba1813360720fc8933dc5e167f92b4e3aaf | python/epidb/client/client.py | python/epidb/client/client.py |
import urllib
__version__ = '0.0~20090901.1'
__user_agent__ = 'EpiDBClient v%s/python' % __version__
class EpiDBClientOpener(urllib.FancyURLopener):
version = __user_agent__
class EpiDBClient:
version = __version__
user_agent = __user_agent__
server = 'https://egg.science.uva.nl:7443'
path_survey = '/survey/... |
import urllib
import urllib2
__version__ = '0.0~20090901.1'
__user_agent__ = 'EpiDBClient v%s/python' % __version__
class EpiDBClient:
version = __version__
user_agent = __user_agent__
server = 'https://egg.science.uva.nl:7443'
path_survey = '/survey/'
def __init__(self, api_key=None):
self.api_key = api_k... | Send api-key through HTTP cookie. | [python] Send api-key through HTTP cookie.
| Python | agpl-3.0 | ISIFoundation/influenzanet-epidb-client |
import urllib
__version__ = '0.0~20090901.1'
__user_agent__ = 'EpiDBClient v%s/python' % __version__
class EpiDBClientOpener(urllib.FancyURLopener):
version = __user_agent__
class EpiDBClient:
version = __version__
user_agent = __user_agent__
server = 'https://egg.science.uva.nl:7443'
path_survey = '/survey/... |
import urllib
import urllib2
__version__ = '0.0~20090901.1'
__user_agent__ = 'EpiDBClient v%s/python' % __version__
class EpiDBClient:
version = __version__
user_agent = __user_agent__
server = 'https://egg.science.uva.nl:7443'
path_survey = '/survey/'
def __init__(self, api_key=None):
self.api_key = api_k... | <commit_before>
import urllib
__version__ = '0.0~20090901.1'
__user_agent__ = 'EpiDBClient v%s/python' % __version__
class EpiDBClientOpener(urllib.FancyURLopener):
version = __user_agent__
class EpiDBClient:
version = __version__
user_agent = __user_agent__
server = 'https://egg.science.uva.nl:7443'
path_sur... |
import urllib
import urllib2
__version__ = '0.0~20090901.1'
__user_agent__ = 'EpiDBClient v%s/python' % __version__
class EpiDBClient:
version = __version__
user_agent = __user_agent__
server = 'https://egg.science.uva.nl:7443'
path_survey = '/survey/'
def __init__(self, api_key=None):
self.api_key = api_k... |
import urllib
__version__ = '0.0~20090901.1'
__user_agent__ = 'EpiDBClient v%s/python' % __version__
class EpiDBClientOpener(urllib.FancyURLopener):
version = __user_agent__
class EpiDBClient:
version = __version__
user_agent = __user_agent__
server = 'https://egg.science.uva.nl:7443'
path_survey = '/survey/... | <commit_before>
import urllib
__version__ = '0.0~20090901.1'
__user_agent__ = 'EpiDBClient v%s/python' % __version__
class EpiDBClientOpener(urllib.FancyURLopener):
version = __user_agent__
class EpiDBClient:
version = __version__
user_agent = __user_agent__
server = 'https://egg.science.uva.nl:7443'
path_sur... |
d3933d58b2ebcb0fb0c6301344335ae018973774 | n_pair_mc_loss.py | n_pair_mc_loss.py | from chainer import cuda
from chainer.functions import matmul
from chainer.functions import transpose
from chainer.functions import softmax_cross_entropy
from chainer.functions import batch_l2_norm_squared
def n_pair_mc_loss(f, f_p, l2_reg):
"""Multi-class N-pair loss (N-pair-mc loss) function.
Args:
... | from chainer import cuda
from chainer.functions import matmul
from chainer.functions import transpose
from chainer.functions import softmax_cross_entropy
from chainer.functions import batch_l2_norm_squared
def n_pair_mc_loss(f, f_p, l2_reg):
"""Multi-class N-pair loss (N-pair-mc loss) function.
Args:
... | Modify to average the L2 norm loss of output vectors | Modify to average the L2 norm loss of output vectors
| Python | mit | ronekko/deep_metric_learning | from chainer import cuda
from chainer.functions import matmul
from chainer.functions import transpose
from chainer.functions import softmax_cross_entropy
from chainer.functions import batch_l2_norm_squared
def n_pair_mc_loss(f, f_p, l2_reg):
"""Multi-class N-pair loss (N-pair-mc loss) function.
Args:
... | from chainer import cuda
from chainer.functions import matmul
from chainer.functions import transpose
from chainer.functions import softmax_cross_entropy
from chainer.functions import batch_l2_norm_squared
def n_pair_mc_loss(f, f_p, l2_reg):
"""Multi-class N-pair loss (N-pair-mc loss) function.
Args:
... | <commit_before>from chainer import cuda
from chainer.functions import matmul
from chainer.functions import transpose
from chainer.functions import softmax_cross_entropy
from chainer.functions import batch_l2_norm_squared
def n_pair_mc_loss(f, f_p, l2_reg):
"""Multi-class N-pair loss (N-pair-mc loss) function.
... | from chainer import cuda
from chainer.functions import matmul
from chainer.functions import transpose
from chainer.functions import softmax_cross_entropy
from chainer.functions import batch_l2_norm_squared
def n_pair_mc_loss(f, f_p, l2_reg):
"""Multi-class N-pair loss (N-pair-mc loss) function.
Args:
... | from chainer import cuda
from chainer.functions import matmul
from chainer.functions import transpose
from chainer.functions import softmax_cross_entropy
from chainer.functions import batch_l2_norm_squared
def n_pair_mc_loss(f, f_p, l2_reg):
"""Multi-class N-pair loss (N-pair-mc loss) function.
Args:
... | <commit_before>from chainer import cuda
from chainer.functions import matmul
from chainer.functions import transpose
from chainer.functions import softmax_cross_entropy
from chainer.functions import batch_l2_norm_squared
def n_pair_mc_loss(f, f_p, l2_reg):
"""Multi-class N-pair loss (N-pair-mc loss) function.
... |
0261930771864cc4cdba58ece3959020fb499cd1 | neupy/__init__.py | neupy/__init__.py | """
NeuPy is the Artificial Neural Network library implemented in Python.
"""
__version__ = '0.2.1'
| """
NeuPy is the Artificial Neural Network library implemented in Python.
"""
__version__ = '0.3.0dev1'
| Set up version 0.3.0 dev 1. | Set up version 0.3.0 dev 1.
| Python | mit | itdxer/neupy,itdxer/neupy,itdxer/neupy,itdxer/neupy | """
NeuPy is the Artificial Neural Network library implemented in Python.
"""
__version__ = '0.2.1'
Set up version 0.3.0 dev 1. | """
NeuPy is the Artificial Neural Network library implemented in Python.
"""
__version__ = '0.3.0dev1'
| <commit_before>"""
NeuPy is the Artificial Neural Network library implemented in Python.
"""
__version__ = '0.2.1'
<commit_msg>Set up version 0.3.0 dev 1.<commit_after> | """
NeuPy is the Artificial Neural Network library implemented in Python.
"""
__version__ = '0.3.0dev1'
| """
NeuPy is the Artificial Neural Network library implemented in Python.
"""
__version__ = '0.2.1'
Set up version 0.3.0 dev 1."""
NeuPy is the Artificial Neural Network library implemented in Python.
"""
__version__ = '0.3.0dev1'
| <commit_before>"""
NeuPy is the Artificial Neural Network library implemented in Python.
"""
__version__ = '0.2.1'
<commit_msg>Set up version 0.3.0 dev 1.<commit_after>"""
NeuPy is the Artificial Neural Network library implemented in Python.
"""
__version__ = '0.3.0dev1'
|
a094d29959243777fad47ea38b4497d891b9990e | data/data/models.py | data/data/models.py | from django.db import models
from uuid import uuid4
import hashlib
def _get_rand_hash():
uid = uuid4()
return hashlib.sha1(str(uid)).hexdigest()
def generate_token_secret():
return _get_rand_hash(), _get_rand_hash()
class User(models.Model):
username = models.CharField(max_length=200, unique=True)... | from django.db import models
from uuid import uuid4
import hashlib
def get_rand_hash():
uid = uuid4()
return hashlib.sha1(str(uid)).hexdigest()
class User(models.Model):
username = models.CharField(max_length=200, unique=True)
password = models.CharField(max_length=200)
token = models.CharField(... | Set token and secret by default | Set token and secret by default
| Python | bsd-2-clause | honza/oauth-service,honza/oauth-service | from django.db import models
from uuid import uuid4
import hashlib
def _get_rand_hash():
uid = uuid4()
return hashlib.sha1(str(uid)).hexdigest()
def generate_token_secret():
return _get_rand_hash(), _get_rand_hash()
class User(models.Model):
username = models.CharField(max_length=200, unique=True)... | from django.db import models
from uuid import uuid4
import hashlib
def get_rand_hash():
uid = uuid4()
return hashlib.sha1(str(uid)).hexdigest()
class User(models.Model):
username = models.CharField(max_length=200, unique=True)
password = models.CharField(max_length=200)
token = models.CharField(... | <commit_before>from django.db import models
from uuid import uuid4
import hashlib
def _get_rand_hash():
uid = uuid4()
return hashlib.sha1(str(uid)).hexdigest()
def generate_token_secret():
return _get_rand_hash(), _get_rand_hash()
class User(models.Model):
username = models.CharField(max_length=20... | from django.db import models
from uuid import uuid4
import hashlib
def get_rand_hash():
uid = uuid4()
return hashlib.sha1(str(uid)).hexdigest()
class User(models.Model):
username = models.CharField(max_length=200, unique=True)
password = models.CharField(max_length=200)
token = models.CharField(... | from django.db import models
from uuid import uuid4
import hashlib
def _get_rand_hash():
uid = uuid4()
return hashlib.sha1(str(uid)).hexdigest()
def generate_token_secret():
return _get_rand_hash(), _get_rand_hash()
class User(models.Model):
username = models.CharField(max_length=200, unique=True)... | <commit_before>from django.db import models
from uuid import uuid4
import hashlib
def _get_rand_hash():
uid = uuid4()
return hashlib.sha1(str(uid)).hexdigest()
def generate_token_secret():
return _get_rand_hash(), _get_rand_hash()
class User(models.Model):
username = models.CharField(max_length=20... |
d96b07d529ea7ced5cbe5f5accaa84485e14395a | Lib/test/test_tk.py | Lib/test/test_tk.py | from test import support
# Skip test if _tkinter wasn't built.
support.import_module('_tkinter')
import tkinter
from tkinter.test import runtktests
import unittest
import tkinter
try:
tkinter.Button()
except tkinter.TclError as msg:
# assuming tk is not available
raise unittest.SkipTest("tk not availabl... | from test import support
# Skip test if _tkinter wasn't built.
support.import_module('_tkinter')
import tkinter
from tkinter.test import runtktests
import unittest
try:
tkinter.Button()
except tkinter.TclError as msg:
# assuming tk is not available
raise unittest.SkipTest("tk not available: %s" % msg)
de... | Remove redundant import of tkinter. | Remove redundant import of tkinter.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | from test import support
# Skip test if _tkinter wasn't built.
support.import_module('_tkinter')
import tkinter
from tkinter.test import runtktests
import unittest
import tkinter
try:
tkinter.Button()
except tkinter.TclError as msg:
# assuming tk is not available
raise unittest.SkipTest("tk not availabl... | from test import support
# Skip test if _tkinter wasn't built.
support.import_module('_tkinter')
import tkinter
from tkinter.test import runtktests
import unittest
try:
tkinter.Button()
except tkinter.TclError as msg:
# assuming tk is not available
raise unittest.SkipTest("tk not available: %s" % msg)
de... | <commit_before>from test import support
# Skip test if _tkinter wasn't built.
support.import_module('_tkinter')
import tkinter
from tkinter.test import runtktests
import unittest
import tkinter
try:
tkinter.Button()
except tkinter.TclError as msg:
# assuming tk is not available
raise unittest.SkipTest("... | from test import support
# Skip test if _tkinter wasn't built.
support.import_module('_tkinter')
import tkinter
from tkinter.test import runtktests
import unittest
try:
tkinter.Button()
except tkinter.TclError as msg:
# assuming tk is not available
raise unittest.SkipTest("tk not available: %s" % msg)
de... | from test import support
# Skip test if _tkinter wasn't built.
support.import_module('_tkinter')
import tkinter
from tkinter.test import runtktests
import unittest
import tkinter
try:
tkinter.Button()
except tkinter.TclError as msg:
# assuming tk is not available
raise unittest.SkipTest("tk not availabl... | <commit_before>from test import support
# Skip test if _tkinter wasn't built.
support.import_module('_tkinter')
import tkinter
from tkinter.test import runtktests
import unittest
import tkinter
try:
tkinter.Button()
except tkinter.TclError as msg:
# assuming tk is not available
raise unittest.SkipTest("... |
4d4de16969439c71f0e9e15b32b26bd4b7310e8f | Simulated_import.py | Simulated_import.py | #!/usr/bin/env python
# We're going to simulate how evolution_master should import things
from genes import golang
from genes import web_cli
# etc...
| #!/usr/bin/env python
# We're going to simulate how evolution_master should import things
from genes import docker
from genes import java
# etc...
| Change simulated around for existing modules | Change simulated around for existing modules | Python | mit | hatchery/Genepool2,hatchery/genepool | #!/usr/bin/env python
# We're going to simulate how evolution_master should import things
from genes import golang
from genes import web_cli
# etc...
Change simulated around for existing modules | #!/usr/bin/env python
# We're going to simulate how evolution_master should import things
from genes import docker
from genes import java
# etc...
| <commit_before>#!/usr/bin/env python
# We're going to simulate how evolution_master should import things
from genes import golang
from genes import web_cli
# etc...
<commit_msg>Change simulated around for existing modules<commit_after> | #!/usr/bin/env python
# We're going to simulate how evolution_master should import things
from genes import docker
from genes import java
# etc...
| #!/usr/bin/env python
# We're going to simulate how evolution_master should import things
from genes import golang
from genes import web_cli
# etc...
Change simulated around for existing modules#!/usr/bin/env python
# We're going to simulate how evolution_master should import things
from genes import docker
from gen... | <commit_before>#!/usr/bin/env python
# We're going to simulate how evolution_master should import things
from genes import golang
from genes import web_cli
# etc...
<commit_msg>Change simulated around for existing modules<commit_after>#!/usr/bin/env python
# We're going to simulate how evolution_master should import ... |
f29377a4f7208d75490e550a732a24cb6f471f18 | linked_list.py | linked_list.py | # -*- coding: utf-8 -*-
class Node(object):
""" """
def __init__(self, value, pointer=None):
self.value = value
self.pointer = pointer
class LinkedList(object):
""" """
def __init__(self):
self.length = 0
self.header = None
def push(self, value):
temp_nod... | # -*- coding: utf-8 -*-
class Node(object):
""" """
def __init__(self, value, pointer=None):
self.value = value
self.pointer = pointer
class LinkedList(object):
""" """
def __init__(self):
self.length = 0
self.header = None
def __len__(self):
return self.... | Add size and len finctions. | Add size and len finctions.
| Python | mit | jefferyrayrussell/data-structures | # -*- coding: utf-8 -*-
class Node(object):
""" """
def __init__(self, value, pointer=None):
self.value = value
self.pointer = pointer
class LinkedList(object):
""" """
def __init__(self):
self.length = 0
self.header = None
def push(self, value):
temp_nod... | # -*- coding: utf-8 -*-
class Node(object):
""" """
def __init__(self, value, pointer=None):
self.value = value
self.pointer = pointer
class LinkedList(object):
""" """
def __init__(self):
self.length = 0
self.header = None
def __len__(self):
return self.... | <commit_before># -*- coding: utf-8 -*-
class Node(object):
""" """
def __init__(self, value, pointer=None):
self.value = value
self.pointer = pointer
class LinkedList(object):
""" """
def __init__(self):
self.length = 0
self.header = None
def push(self, value):
... | # -*- coding: utf-8 -*-
class Node(object):
""" """
def __init__(self, value, pointer=None):
self.value = value
self.pointer = pointer
class LinkedList(object):
""" """
def __init__(self):
self.length = 0
self.header = None
def __len__(self):
return self.... | # -*- coding: utf-8 -*-
class Node(object):
""" """
def __init__(self, value, pointer=None):
self.value = value
self.pointer = pointer
class LinkedList(object):
""" """
def __init__(self):
self.length = 0
self.header = None
def push(self, value):
temp_nod... | <commit_before># -*- coding: utf-8 -*-
class Node(object):
""" """
def __init__(self, value, pointer=None):
self.value = value
self.pointer = pointer
class LinkedList(object):
""" """
def __init__(self):
self.length = 0
self.header = None
def push(self, value):
... |
3c1523f2fc3fec918f451a7dc361be9eb631524c | serrano/urls.py | serrano/urls.py | from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(r'^contexts/', ... | import time
from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(r'^... | Insert unused import to test pyflakes in travis | Insert unused import to test pyflakes in travis
| Python | bsd-2-clause | chop-dbhi/serrano,rv816/serrano_night,rv816/serrano_night,chop-dbhi/serrano | from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(r'^contexts/', ... | import time
from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(r'^... | <commit_before>from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(... | import time
from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(r'^... | from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(r'^contexts/', ... | <commit_before>from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
url(r'', include(patterns('',
url(r'^$', include('serrano.resources')),
url(r'^fields/', include('serrano.resources.field')),
url(r'^concepts/', include('serrano.resources.concept')),
url(... |
06e858fc86f8f34ccae521cb269c959569f53f97 | script/sample/submitpython.py | script/sample/submitpython.py | #!/usr/bin/env python
from __future__ import print_function
import multyvac
multyvac.config.set_key(api_key='admin', api_secret_key='12345', api_url='http://docker:8000/v1')
def add(a, b):
return a + b
jid = multyvac.submit(add, 3, 4)
result = multyvac.get(jid).get_result()
print("result = {}".format(result))
| #!/usr/bin/env python
# CLOUDPIPE_URL=http://`echo $DOCKER_HOST | cut -d ":" -f2 | tr -d "/"`:8000/v1 python2 script/sample/submitpython.py
from __future__ import print_function
import multyvac
import os
# Grab from the CLOUDPIPE_URL environment variable, otherwise assume they have
# /etc/hosts configured to point ... | Allow api_url in the script to be configurable | Allow api_url in the script to be configurable
| Python | bsd-3-clause | cloudpipe/cloudpipe,cloudpipe/cloudpipe,cloudpipe/cloudpipe | #!/usr/bin/env python
from __future__ import print_function
import multyvac
multyvac.config.set_key(api_key='admin', api_secret_key='12345', api_url='http://docker:8000/v1')
def add(a, b):
return a + b
jid = multyvac.submit(add, 3, 4)
result = multyvac.get(jid).get_result()
print("result = {}".format(result))
... | #!/usr/bin/env python
# CLOUDPIPE_URL=http://`echo $DOCKER_HOST | cut -d ":" -f2 | tr -d "/"`:8000/v1 python2 script/sample/submitpython.py
from __future__ import print_function
import multyvac
import os
# Grab from the CLOUDPIPE_URL environment variable, otherwise assume they have
# /etc/hosts configured to point ... | <commit_before>#!/usr/bin/env python
from __future__ import print_function
import multyvac
multyvac.config.set_key(api_key='admin', api_secret_key='12345', api_url='http://docker:8000/v1')
def add(a, b):
return a + b
jid = multyvac.submit(add, 3, 4)
result = multyvac.get(jid).get_result()
print("result = {}".f... | #!/usr/bin/env python
# CLOUDPIPE_URL=http://`echo $DOCKER_HOST | cut -d ":" -f2 | tr -d "/"`:8000/v1 python2 script/sample/submitpython.py
from __future__ import print_function
import multyvac
import os
# Grab from the CLOUDPIPE_URL environment variable, otherwise assume they have
# /etc/hosts configured to point ... | #!/usr/bin/env python
from __future__ import print_function
import multyvac
multyvac.config.set_key(api_key='admin', api_secret_key='12345', api_url='http://docker:8000/v1')
def add(a, b):
return a + b
jid = multyvac.submit(add, 3, 4)
result = multyvac.get(jid).get_result()
print("result = {}".format(result))
... | <commit_before>#!/usr/bin/env python
from __future__ import print_function
import multyvac
multyvac.config.set_key(api_key='admin', api_secret_key='12345', api_url='http://docker:8000/v1')
def add(a, b):
return a + b
jid = multyvac.submit(add, 3, 4)
result = multyvac.get(jid).get_result()
print("result = {}".f... |
f33c66d4b1b439f6d4ede943812985783d961483 | Speech/processor.py | Speech/processor.py | # Retrieve file from Facebook
import urllib, convert, re, os
# from speech_py import speech_to_text_offline as STT_o
# from speech_py import speech_to_text_google as STT
from speech_py import speech_to_text_ibm_rest as STT
def transcribe(audio_url):
if not os.path.isdir('./audio/retrieved_audio'):
os.makedirs('./a... | # Retrieve file from Facebook
import urllib, convert, re, os
# from speech_py import speech_to_text_offline as STT_o
# from speech_py import speech_to_text_google as STT
from speech_py import speech_to_text_ibm_rest as STT
def transcribe(audio_url):
if not os.path.isdir('./audio/retrieved_audio'):
os.makedirs('./a... | Modify ffmpeg path heroku 2 | Modify ffmpeg path heroku 2
| Python | mit | hungtraan/FacebookBot,hungtraan/FacebookBot,hungtraan/FacebookBot | # Retrieve file from Facebook
import urllib, convert, re, os
# from speech_py import speech_to_text_offline as STT_o
# from speech_py import speech_to_text_google as STT
from speech_py import speech_to_text_ibm_rest as STT
def transcribe(audio_url):
if not os.path.isdir('./audio/retrieved_audio'):
os.makedirs('./a... | # Retrieve file from Facebook
import urllib, convert, re, os
# from speech_py import speech_to_text_offline as STT_o
# from speech_py import speech_to_text_google as STT
from speech_py import speech_to_text_ibm_rest as STT
def transcribe(audio_url):
if not os.path.isdir('./audio/retrieved_audio'):
os.makedirs('./a... | <commit_before># Retrieve file from Facebook
import urllib, convert, re, os
# from speech_py import speech_to_text_offline as STT_o
# from speech_py import speech_to_text_google as STT
from speech_py import speech_to_text_ibm_rest as STT
def transcribe(audio_url):
if not os.path.isdir('./audio/retrieved_audio'):
o... | # Retrieve file from Facebook
import urllib, convert, re, os
# from speech_py import speech_to_text_offline as STT_o
# from speech_py import speech_to_text_google as STT
from speech_py import speech_to_text_ibm_rest as STT
def transcribe(audio_url):
if not os.path.isdir('./audio/retrieved_audio'):
os.makedirs('./a... | # Retrieve file from Facebook
import urllib, convert, re, os
# from speech_py import speech_to_text_offline as STT_o
# from speech_py import speech_to_text_google as STT
from speech_py import speech_to_text_ibm_rest as STT
def transcribe(audio_url):
if not os.path.isdir('./audio/retrieved_audio'):
os.makedirs('./a... | <commit_before># Retrieve file from Facebook
import urllib, convert, re, os
# from speech_py import speech_to_text_offline as STT_o
# from speech_py import speech_to_text_google as STT
from speech_py import speech_to_text_ibm_rest as STT
def transcribe(audio_url):
if not os.path.isdir('./audio/retrieved_audio'):
o... |
5d3c6452f8efd0667948094693e90392abb99091 | statsmodels/tests/test_package.py | statsmodels/tests/test_package.py | import subprocess
import pytest
from statsmodels.compat.platform import PLATFORM_WIN
from statsmodels.compat.scipy import SCIPY_11
def test_lazy_imports():
# Check that when statsmodels.api is imported, matplotlib is _not_ imported
cmd = ("import statsmodels.api as sm; "
"import sys; "
... | import subprocess
import pytest
from statsmodels.compat.platform import PLATFORM_WIN
from statsmodels.compat.scipy import SCIPY_11
def test_lazy_imports():
# Check that when statsmodels.api is imported, matplotlib is _not_ imported
cmd = ("import statsmodels.api as sm; "
"import sys; "
... | Use python3 for test_docstring_optimization_compat subprocess | TST: Use python3 for test_docstring_optimization_compat subprocess
| Python | bsd-3-clause | jseabold/statsmodels,bashtage/statsmodels,bashtage/statsmodels,statsmodels/statsmodels,josef-pkt/statsmodels,josef-pkt/statsmodels,jseabold/statsmodels,bashtage/statsmodels,josef-pkt/statsmodels,statsmodels/statsmodels,statsmodels/statsmodels,bashtage/statsmodels,statsmodels/statsmodels,statsmodels/statsmodels,josef-pk... | import subprocess
import pytest
from statsmodels.compat.platform import PLATFORM_WIN
from statsmodels.compat.scipy import SCIPY_11
def test_lazy_imports():
# Check that when statsmodels.api is imported, matplotlib is _not_ imported
cmd = ("import statsmodels.api as sm; "
"import sys; "
... | import subprocess
import pytest
from statsmodels.compat.platform import PLATFORM_WIN
from statsmodels.compat.scipy import SCIPY_11
def test_lazy_imports():
# Check that when statsmodels.api is imported, matplotlib is _not_ imported
cmd = ("import statsmodels.api as sm; "
"import sys; "
... | <commit_before>import subprocess
import pytest
from statsmodels.compat.platform import PLATFORM_WIN
from statsmodels.compat.scipy import SCIPY_11
def test_lazy_imports():
# Check that when statsmodels.api is imported, matplotlib is _not_ imported
cmd = ("import statsmodels.api as sm; "
"import sy... | import subprocess
import pytest
from statsmodels.compat.platform import PLATFORM_WIN
from statsmodels.compat.scipy import SCIPY_11
def test_lazy_imports():
# Check that when statsmodels.api is imported, matplotlib is _not_ imported
cmd = ("import statsmodels.api as sm; "
"import sys; "
... | import subprocess
import pytest
from statsmodels.compat.platform import PLATFORM_WIN
from statsmodels.compat.scipy import SCIPY_11
def test_lazy_imports():
# Check that when statsmodels.api is imported, matplotlib is _not_ imported
cmd = ("import statsmodels.api as sm; "
"import sys; "
... | <commit_before>import subprocess
import pytest
from statsmodels.compat.platform import PLATFORM_WIN
from statsmodels.compat.scipy import SCIPY_11
def test_lazy_imports():
# Check that when statsmodels.api is imported, matplotlib is _not_ imported
cmd = ("import statsmodels.api as sm; "
"import sy... |
18ad742656f8ef0b47e4e8d810939ea93528aee4 | plugins/urlgrabber.py | plugins/urlgrabber.py | from plugins.categories import ISilentCommand
try:
import requests_pyopenssl
from requests.packages.urllib3 import connectionpool
connectionpool.ssl_wrap_socket = requests_pyopenssl.ssl_wrap_socket
except ImportError:
pass
import requests
from bs4 import BeautifulSoup
class URLGrabber (ISilentCommand... | from plugins.categories import ISilentCommand
try:
import requests_pyopenssl
from requests.packages.urllib3 import connectionpool
connectionpool.ssl_wrap_socket = requests_pyopenssl.ssl_wrap_socket
except ImportError:
pass
import requests
from bs4 import BeautifulSoup
class URLGrabber (ISilentCommand... | Include colons in URL matching | Include colons in URL matching | Python | isc | ComSSA/KhlavKalash | from plugins.categories import ISilentCommand
try:
import requests_pyopenssl
from requests.packages.urllib3 import connectionpool
connectionpool.ssl_wrap_socket = requests_pyopenssl.ssl_wrap_socket
except ImportError:
pass
import requests
from bs4 import BeautifulSoup
class URLGrabber (ISilentCommand... | from plugins.categories import ISilentCommand
try:
import requests_pyopenssl
from requests.packages.urllib3 import connectionpool
connectionpool.ssl_wrap_socket = requests_pyopenssl.ssl_wrap_socket
except ImportError:
pass
import requests
from bs4 import BeautifulSoup
class URLGrabber (ISilentCommand... | <commit_before>from plugins.categories import ISilentCommand
try:
import requests_pyopenssl
from requests.packages.urllib3 import connectionpool
connectionpool.ssl_wrap_socket = requests_pyopenssl.ssl_wrap_socket
except ImportError:
pass
import requests
from bs4 import BeautifulSoup
class URLGrabber ... | from plugins.categories import ISilentCommand
try:
import requests_pyopenssl
from requests.packages.urllib3 import connectionpool
connectionpool.ssl_wrap_socket = requests_pyopenssl.ssl_wrap_socket
except ImportError:
pass
import requests
from bs4 import BeautifulSoup
class URLGrabber (ISilentCommand... | from plugins.categories import ISilentCommand
try:
import requests_pyopenssl
from requests.packages.urllib3 import connectionpool
connectionpool.ssl_wrap_socket = requests_pyopenssl.ssl_wrap_socket
except ImportError:
pass
import requests
from bs4 import BeautifulSoup
class URLGrabber (ISilentCommand... | <commit_before>from plugins.categories import ISilentCommand
try:
import requests_pyopenssl
from requests.packages.urllib3 import connectionpool
connectionpool.ssl_wrap_socket = requests_pyopenssl.ssl_wrap_socket
except ImportError:
pass
import requests
from bs4 import BeautifulSoup
class URLGrabber ... |
1510d5657e6084cb94de514d1ba05e3b30f0ce5f | tools/python/frame_processor/frame_processor.py | tools/python/frame_processor/frame_processor.py | from frame_receiver.ipc_channel import IpcChannel, IpcChannelException
from frame_receiver.ipc_message import IpcMessage, IpcMessageException
from frame_processor_config import FrameProcessorConfig
import time
class FrameProcessor(object):
def __init__(self):
# Instantiate a configuration container ... | from frame_receiver.ipc_channel import IpcChannel, IpcChannelException
from frame_receiver.ipc_message import IpcMessage, IpcMessageException
from frame_processor_config import FrameProcessorConfig
import time
class FrameProcessor(object):
def __init__(self):
# Instantiate a configuration container ... | Revert "Update python frame processor test harness to send IPC JSON messages to frame receiver for testing of control path and channel multiplexing" | Revert "Update python frame processor test harness to send IPC JSON messages to frame receiver for testing of control path and channel multiplexing"
This reverts commit 0e301d3ee54366187b2e12fa5c6927f27e907347.
| Python | apache-2.0 | odin-detector/odin-data,odin-detector/odin-data,odin-detector/odin-data,percival-detector/odin-data,odin-detector/odin-data,odin-detector/odin-data,odin-detector/odin-data,percival-detector/odin-data,percival-detector/odin-data,percival-detector/odin-data,odin-detector/odin-data,percival-detector/odin-data,percival-det... | from frame_receiver.ipc_channel import IpcChannel, IpcChannelException
from frame_receiver.ipc_message import IpcMessage, IpcMessageException
from frame_processor_config import FrameProcessorConfig
import time
class FrameProcessor(object):
def __init__(self):
# Instantiate a configuration container ... | from frame_receiver.ipc_channel import IpcChannel, IpcChannelException
from frame_receiver.ipc_message import IpcMessage, IpcMessageException
from frame_processor_config import FrameProcessorConfig
import time
class FrameProcessor(object):
def __init__(self):
# Instantiate a configuration container ... | <commit_before>from frame_receiver.ipc_channel import IpcChannel, IpcChannelException
from frame_receiver.ipc_message import IpcMessage, IpcMessageException
from frame_processor_config import FrameProcessorConfig
import time
class FrameProcessor(object):
def __init__(self):
# Instantiate a configura... | from frame_receiver.ipc_channel import IpcChannel, IpcChannelException
from frame_receiver.ipc_message import IpcMessage, IpcMessageException
from frame_processor_config import FrameProcessorConfig
import time
class FrameProcessor(object):
def __init__(self):
# Instantiate a configuration container ... | from frame_receiver.ipc_channel import IpcChannel, IpcChannelException
from frame_receiver.ipc_message import IpcMessage, IpcMessageException
from frame_processor_config import FrameProcessorConfig
import time
class FrameProcessor(object):
def __init__(self):
# Instantiate a configuration container ... | <commit_before>from frame_receiver.ipc_channel import IpcChannel, IpcChannelException
from frame_receiver.ipc_message import IpcMessage, IpcMessageException
from frame_processor_config import FrameProcessorConfig
import time
class FrameProcessor(object):
def __init__(self):
# Instantiate a configura... |
6f995fbe0532fc4ea36f3f7cd24240d3525b115f | Ref.py | Ref.py | """
MoinMoin - Ref Macro
Collect and emit footnotes. Note that currently footnote
text cannot contain wiki markup.
@copyright: 2011 Jason L. Wright <[email protected]>
@license: BSD
"""
from MoinMoin import config, wikiutil
from MoinMoin.parser.text_moin_wiki import Parser as WikiParser
from Moin... | """
MoinMoin - Ref Macro
Collect and emit references (as footnotes)
@copyright: 2011 Jason L. Wright <[email protected]>
@license: BSD
"""
from MoinMoin import config, wikiutil
from MoinMoin.parser.text_moin_wiki import Parser as WikiParser
from MoinMoin.support.python_compatibility import hash_new
i... | Update text to reflect current usage | Update text to reflect current usage
| Python | bsd-2-clause | wrigjl/moin-ref-bibtex | """
MoinMoin - Ref Macro
Collect and emit footnotes. Note that currently footnote
text cannot contain wiki markup.
@copyright: 2011 Jason L. Wright <[email protected]>
@license: BSD
"""
from MoinMoin import config, wikiutil
from MoinMoin.parser.text_moin_wiki import Parser as WikiParser
from Moin... | """
MoinMoin - Ref Macro
Collect and emit references (as footnotes)
@copyright: 2011 Jason L. Wright <[email protected]>
@license: BSD
"""
from MoinMoin import config, wikiutil
from MoinMoin.parser.text_moin_wiki import Parser as WikiParser
from MoinMoin.support.python_compatibility import hash_new
i... | <commit_before>"""
MoinMoin - Ref Macro
Collect and emit footnotes. Note that currently footnote
text cannot contain wiki markup.
@copyright: 2011 Jason L. Wright <[email protected]>
@license: BSD
"""
from MoinMoin import config, wikiutil
from MoinMoin.parser.text_moin_wiki import Parser as WikiP... | """
MoinMoin - Ref Macro
Collect and emit references (as footnotes)
@copyright: 2011 Jason L. Wright <[email protected]>
@license: BSD
"""
from MoinMoin import config, wikiutil
from MoinMoin.parser.text_moin_wiki import Parser as WikiParser
from MoinMoin.support.python_compatibility import hash_new
i... | """
MoinMoin - Ref Macro
Collect and emit footnotes. Note that currently footnote
text cannot contain wiki markup.
@copyright: 2011 Jason L. Wright <[email protected]>
@license: BSD
"""
from MoinMoin import config, wikiutil
from MoinMoin.parser.text_moin_wiki import Parser as WikiParser
from Moin... | <commit_before>"""
MoinMoin - Ref Macro
Collect and emit footnotes. Note that currently footnote
text cannot contain wiki markup.
@copyright: 2011 Jason L. Wright <[email protected]>
@license: BSD
"""
from MoinMoin import config, wikiutil
from MoinMoin.parser.text_moin_wiki import Parser as WikiP... |
7f44c6a114f95c25b533c9b69988798ba3919d68 | wger/email/forms.py | wger/email/forms.py | # -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | # -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | Use correct order of arguments of pgettext | Use correct order of arguments of pgettext
| Python | agpl-3.0 | rolandgeider/wger,rolandgeider/wger,wger-project/wger,DeveloperMal/wger,DeveloperMal/wger,wger-project/wger,rolandgeider/wger,kjagoo/wger_stark,petervanderdoes/wger,rolandgeider/wger,petervanderdoes/wger,wger-project/wger,wger-project/wger,petervanderdoes/wger,DeveloperMal/wger,kjagoo/wger_stark,kjagoo/wger_stark,peter... | # -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | # -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | <commit_before># -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... | # -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | # -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | <commit_before># -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... |
47bf5652c621da89a72597b8198fbfde84c2049c | healthfun/person/models.py | healthfun/person/models.py | from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Person(models.Model):
first_name = models.CharField(verbose_name=_(u"First Name"), max_length=75, blank=True)
last_name = models.CharField(verbose_name=_(u"Last Name"), max_le... | from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Person(models.Model):
first_name = models.CharField(verbose_name=_(u"First Name"), max_length=75, blank=True)
last_name = models.CharField(verbose_name=_(u"Last Name"), max_le... | Use email to 'print' a person | Use email to 'print' a person
| Python | agpl-3.0 | frlan/healthfun | from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Person(models.Model):
first_name = models.CharField(verbose_name=_(u"First Name"), max_length=75, blank=True)
last_name = models.CharField(verbose_name=_(u"Last Name"), max_le... | from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Person(models.Model):
first_name = models.CharField(verbose_name=_(u"First Name"), max_length=75, blank=True)
last_name = models.CharField(verbose_name=_(u"Last Name"), max_le... | <commit_before>from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Person(models.Model):
first_name = models.CharField(verbose_name=_(u"First Name"), max_length=75, blank=True)
last_name = models.CharField(verbose_name=_(u"Last... | from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Person(models.Model):
first_name = models.CharField(verbose_name=_(u"First Name"), max_length=75, blank=True)
last_name = models.CharField(verbose_name=_(u"Last Name"), max_le... | from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Person(models.Model):
first_name = models.CharField(verbose_name=_(u"First Name"), max_length=75, blank=True)
last_name = models.CharField(verbose_name=_(u"Last Name"), max_le... | <commit_before>from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Person(models.Model):
first_name = models.CharField(verbose_name=_(u"First Name"), max_length=75, blank=True)
last_name = models.CharField(verbose_name=_(u"Last... |
80a08e9f5720e60536a74af6798d1126341ac158 | honeycomb/urls.py | honeycomb/urls.py | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url('^', include('django.contrib.auth.urls')),
url('^', include('usermgmt.urls')),
url('^', include('... | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = [
url(r'^_admin/', admin.site.urls),
url('^', include('django.contrib.auth.urls')),
url('^', include('usermgmt.urls')),
url('^', incl... | Move django admin to /_admin | Move django admin to /_admin
| Python | mit | OpenFurry/honeycomb,makyo/honeycomb,makyo/honeycomb,OpenFurry/honeycomb,OpenFurry/honeycomb,makyo/honeycomb,OpenFurry/honeycomb,makyo/honeycomb | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url('^', include('django.contrib.auth.urls')),
url('^', include('usermgmt.urls')),
url('^', include('... | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = [
url(r'^_admin/', admin.site.urls),
url('^', include('django.contrib.auth.urls')),
url('^', include('usermgmt.urls')),
url('^', incl... | <commit_before>from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url('^', include('django.contrib.auth.urls')),
url('^', include('usermgmt.urls')),
url... | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = [
url(r'^_admin/', admin.site.urls),
url('^', include('django.contrib.auth.urls')),
url('^', include('usermgmt.urls')),
url('^', incl... | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url('^', include('django.contrib.auth.urls')),
url('^', include('usermgmt.urls')),
url('^', include('... | <commit_before>from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url('^', include('django.contrib.auth.urls')),
url('^', include('usermgmt.urls')),
url... |
c24a7287d0ac540d6ef6dcf353b06ee42aaa7a43 | serrano/decorators.py | serrano/decorators.py | from functools import wraps
from django.conf import settings
from django.http import HttpResponse
from django.contrib.auth import authenticate, login
def get_token(request):
return request.REQUEST.get('token', '')
def check_auth(func):
@wraps(func)
def inner(self, request, *args, **kwargs):
auth... | from functools import wraps
from django.conf import settings
from django.http import HttpResponse
from django.contrib.auth import authenticate, login
def get_token(request):
"Attempts to retrieve a token from the request."
if 'token' in request.REQUEST:
return request.REQUEST['token']
if 'HTTP_API... | Add support for extracting the token from request headers | Add support for extracting the token from request headers
Clients can now set the `Api-Token` header instead of supplying the
token as a GET or POST parameter. | Python | bsd-2-clause | chop-dbhi/serrano,rv816/serrano_night,rv816/serrano_night,chop-dbhi/serrano | from functools import wraps
from django.conf import settings
from django.http import HttpResponse
from django.contrib.auth import authenticate, login
def get_token(request):
return request.REQUEST.get('token', '')
def check_auth(func):
@wraps(func)
def inner(self, request, *args, **kwargs):
auth... | from functools import wraps
from django.conf import settings
from django.http import HttpResponse
from django.contrib.auth import authenticate, login
def get_token(request):
"Attempts to retrieve a token from the request."
if 'token' in request.REQUEST:
return request.REQUEST['token']
if 'HTTP_API... | <commit_before>from functools import wraps
from django.conf import settings
from django.http import HttpResponse
from django.contrib.auth import authenticate, login
def get_token(request):
return request.REQUEST.get('token', '')
def check_auth(func):
@wraps(func)
def inner(self, request, *args, **kwargs... | from functools import wraps
from django.conf import settings
from django.http import HttpResponse
from django.contrib.auth import authenticate, login
def get_token(request):
"Attempts to retrieve a token from the request."
if 'token' in request.REQUEST:
return request.REQUEST['token']
if 'HTTP_API... | from functools import wraps
from django.conf import settings
from django.http import HttpResponse
from django.contrib.auth import authenticate, login
def get_token(request):
return request.REQUEST.get('token', '')
def check_auth(func):
@wraps(func)
def inner(self, request, *args, **kwargs):
auth... | <commit_before>from functools import wraps
from django.conf import settings
from django.http import HttpResponse
from django.contrib.auth import authenticate, login
def get_token(request):
return request.REQUEST.get('token', '')
def check_auth(func):
@wraps(func)
def inner(self, request, *args, **kwargs... |
e31099e964f809a8a6ebcb071c7c2b57e17248c2 | reviewboard/changedescs/evolutions/changedesc_user.py | reviewboard/changedescs/evolutions/changedesc_user.py | from __future__ import unicode_literals
from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('ChangeDescription', 'user', models.ForeignKey, blank=True,
related_model='auth.User'),
]
| from __future__ import unicode_literals
from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('ChangeDescription', 'user', models.ForeignKey, null=True,
related_model='auth.User'),
]
| Fix evolution for change description users | Fix evolution for change description users
Trivial change
| Python | mit | sgallagher/reviewboard,chipx86/reviewboard,chipx86/reviewboard,chipx86/reviewboard,sgallagher/reviewboard,davidt/reviewboard,brennie/reviewboard,reviewboard/reviewboard,sgallagher/reviewboard,davidt/reviewboard,reviewboard/reviewboard,reviewboard/reviewboard,sgallagher/reviewboard,brennie/reviewboard,brennie/reviewboar... | from __future__ import unicode_literals
from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('ChangeDescription', 'user', models.ForeignKey, blank=True,
related_model='auth.User'),
]
Fix evolution for change description users
Trivial change | from __future__ import unicode_literals
from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('ChangeDescription', 'user', models.ForeignKey, null=True,
related_model='auth.User'),
]
| <commit_before>from __future__ import unicode_literals
from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('ChangeDescription', 'user', models.ForeignKey, blank=True,
related_model='auth.User'),
]
<commit_msg>Fix evolution for change description users
... | from __future__ import unicode_literals
from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('ChangeDescription', 'user', models.ForeignKey, null=True,
related_model='auth.User'),
]
| from __future__ import unicode_literals
from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('ChangeDescription', 'user', models.ForeignKey, blank=True,
related_model='auth.User'),
]
Fix evolution for change description users
Trivial changefrom __futur... | <commit_before>from __future__ import unicode_literals
from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('ChangeDescription', 'user', models.ForeignKey, blank=True,
related_model='auth.User'),
]
<commit_msg>Fix evolution for change description users
... |
cd5bfa0fb09835e4e33236ec4292a16ed5556088 | tests/parser.py | tests/parser.py | from spec import Spec, skip, ok_, eq_, raises
from invoke.parser import Parser, Context, Argument
from invoke.collection import Collection
class Parser_(Spec):
def has_and_requires_initial_context(self):
c = Context()
p = Parser(initial=c)
eq_(p.initial, c)
def may_also_take_addition... | from spec import Spec, skip, ok_, eq_, raises
from invoke.parser import Parser, Context, Argument
from invoke.collection import Collection
class Parser_(Spec):
def can_take_initial_context(self):
c = Context()
p = Parser(initial=c)
eq_(p.initial, c)
def can_take_initial_and_other_con... | Update tests to explicitly account for previous | Update tests to explicitly account for previous
| Python | bsd-2-clause | mattrobenolt/invoke,frol/invoke,sophacles/invoke,pyinvoke/invoke,tyewang/invoke,frol/invoke,mattrobenolt/invoke,pfmoore/invoke,singingwolfboy/invoke,kejbaly2/invoke,pfmoore/invoke,pyinvoke/invoke,mkusz/invoke,alex/invoke,mkusz/invoke,kejbaly2/invoke | from spec import Spec, skip, ok_, eq_, raises
from invoke.parser import Parser, Context, Argument
from invoke.collection import Collection
class Parser_(Spec):
def has_and_requires_initial_context(self):
c = Context()
p = Parser(initial=c)
eq_(p.initial, c)
def may_also_take_addition... | from spec import Spec, skip, ok_, eq_, raises
from invoke.parser import Parser, Context, Argument
from invoke.collection import Collection
class Parser_(Spec):
def can_take_initial_context(self):
c = Context()
p = Parser(initial=c)
eq_(p.initial, c)
def can_take_initial_and_other_con... | <commit_before>from spec import Spec, skip, ok_, eq_, raises
from invoke.parser import Parser, Context, Argument
from invoke.collection import Collection
class Parser_(Spec):
def has_and_requires_initial_context(self):
c = Context()
p = Parser(initial=c)
eq_(p.initial, c)
def may_als... | from spec import Spec, skip, ok_, eq_, raises
from invoke.parser import Parser, Context, Argument
from invoke.collection import Collection
class Parser_(Spec):
def can_take_initial_context(self):
c = Context()
p = Parser(initial=c)
eq_(p.initial, c)
def can_take_initial_and_other_con... | from spec import Spec, skip, ok_, eq_, raises
from invoke.parser import Parser, Context, Argument
from invoke.collection import Collection
class Parser_(Spec):
def has_and_requires_initial_context(self):
c = Context()
p = Parser(initial=c)
eq_(p.initial, c)
def may_also_take_addition... | <commit_before>from spec import Spec, skip, ok_, eq_, raises
from invoke.parser import Parser, Context, Argument
from invoke.collection import Collection
class Parser_(Spec):
def has_and_requires_initial_context(self):
c = Context()
p = Parser(initial=c)
eq_(p.initial, c)
def may_als... |
d01b09256f8fda4b222f3e26366817f4ac5b4c5a | zinnia/tests/test_admin_forms.py | zinnia/tests/test_admin_forms.py | """Test cases for Zinnia's admin forms"""
from django.test import TestCase
from django.contrib.admin.widgets import RelatedFieldWidgetWrapper
from zinnia.models import Category
from zinnia.admin.forms import EntryAdminForm
from zinnia.admin.forms import CategoryAdminForm
class EntryAdminFormTestCase(TestCase):
... | """Test cases for Zinnia's admin forms"""
from django.test import TestCase
from django.contrib.admin.widgets import RelatedFieldWidgetWrapper
from zinnia.models import Category
from zinnia.admin.forms import EntryAdminForm
from zinnia.admin.forms import CategoryAdminForm
class EntryAdminFormTestCase(TestCase):
... | Remove now useless test for initial sites value in form | Remove now useless test for initial sites value in form
| Python | bsd-3-clause | extertioner/django-blog-zinnia,Maplecroft/django-blog-zinnia,Zopieux/django-blog-zinnia,ghachey/django-blog-zinnia,dapeng0802/django-blog-zinnia,bywbilly/django-blog-zinnia,dapeng0802/django-blog-zinnia,Zopieux/django-blog-zinnia,aorzh/django-blog-zinnia,Zopieux/django-blog-zinnia,bywbilly/django-blog-zinnia,aorzh/djan... | """Test cases for Zinnia's admin forms"""
from django.test import TestCase
from django.contrib.admin.widgets import RelatedFieldWidgetWrapper
from zinnia.models import Category
from zinnia.admin.forms import EntryAdminForm
from zinnia.admin.forms import CategoryAdminForm
class EntryAdminFormTestCase(TestCase):
... | """Test cases for Zinnia's admin forms"""
from django.test import TestCase
from django.contrib.admin.widgets import RelatedFieldWidgetWrapper
from zinnia.models import Category
from zinnia.admin.forms import EntryAdminForm
from zinnia.admin.forms import CategoryAdminForm
class EntryAdminFormTestCase(TestCase):
... | <commit_before>"""Test cases for Zinnia's admin forms"""
from django.test import TestCase
from django.contrib.admin.widgets import RelatedFieldWidgetWrapper
from zinnia.models import Category
from zinnia.admin.forms import EntryAdminForm
from zinnia.admin.forms import CategoryAdminForm
class EntryAdminFormTestCase(T... | """Test cases for Zinnia's admin forms"""
from django.test import TestCase
from django.contrib.admin.widgets import RelatedFieldWidgetWrapper
from zinnia.models import Category
from zinnia.admin.forms import EntryAdminForm
from zinnia.admin.forms import CategoryAdminForm
class EntryAdminFormTestCase(TestCase):
... | """Test cases for Zinnia's admin forms"""
from django.test import TestCase
from django.contrib.admin.widgets import RelatedFieldWidgetWrapper
from zinnia.models import Category
from zinnia.admin.forms import EntryAdminForm
from zinnia.admin.forms import CategoryAdminForm
class EntryAdminFormTestCase(TestCase):
... | <commit_before>"""Test cases for Zinnia's admin forms"""
from django.test import TestCase
from django.contrib.admin.widgets import RelatedFieldWidgetWrapper
from zinnia.models import Category
from zinnia.admin.forms import EntryAdminForm
from zinnia.admin.forms import CategoryAdminForm
class EntryAdminFormTestCase(T... |
f096225138afff2a722b1b019eb94e14f8d18fc3 | sutro/dispatcher.py | sutro/dispatcher.py | import random
import gevent.queue
class MessageDispatcher(object):
def __init__(self, stats):
self.consumers = {}
self.stats = stats
def get_connection_count(self):
return sum(len(sockets) for sockets in self.consumers.itervalues())
def on_message_received(self, namespace, messa... | import posixpath
import random
import gevent.queue
def _walk_namespace_hierarchy(namespace):
assert namespace.startswith("/")
yield namespace
while namespace != "/":
namespace = posixpath.dirname(namespace)
yield namespace
class MessageDispatcher(object):
def __init__(self, stats):... | Make sockets listen to parent namespaces as well. | Make sockets listen to parent namespaces as well.
For example, /live/test will now receive messages destined for
/live/test, /live and /. This allows us to send messages to multiple
endpoints at once such as refreshing all liveupdate threads or the like.
| Python | bsd-3-clause | spladug/sutro,spladug/sutro | import random
import gevent.queue
class MessageDispatcher(object):
def __init__(self, stats):
self.consumers = {}
self.stats = stats
def get_connection_count(self):
return sum(len(sockets) for sockets in self.consumers.itervalues())
def on_message_received(self, namespace, messa... | import posixpath
import random
import gevent.queue
def _walk_namespace_hierarchy(namespace):
assert namespace.startswith("/")
yield namespace
while namespace != "/":
namespace = posixpath.dirname(namespace)
yield namespace
class MessageDispatcher(object):
def __init__(self, stats):... | <commit_before>import random
import gevent.queue
class MessageDispatcher(object):
def __init__(self, stats):
self.consumers = {}
self.stats = stats
def get_connection_count(self):
return sum(len(sockets) for sockets in self.consumers.itervalues())
def on_message_received(self, n... | import posixpath
import random
import gevent.queue
def _walk_namespace_hierarchy(namespace):
assert namespace.startswith("/")
yield namespace
while namespace != "/":
namespace = posixpath.dirname(namespace)
yield namespace
class MessageDispatcher(object):
def __init__(self, stats):... | import random
import gevent.queue
class MessageDispatcher(object):
def __init__(self, stats):
self.consumers = {}
self.stats = stats
def get_connection_count(self):
return sum(len(sockets) for sockets in self.consumers.itervalues())
def on_message_received(self, namespace, messa... | <commit_before>import random
import gevent.queue
class MessageDispatcher(object):
def __init__(self, stats):
self.consumers = {}
self.stats = stats
def get_connection_count(self):
return sum(len(sockets) for sockets in self.consumers.itervalues())
def on_message_received(self, n... |
f4ee715a5bd6ea979cf09fb847a861f621d42c7b | CFC_WebApp/utils/update_client.py | CFC_WebApp/utils/update_client.py | from dao.client import Client
import sys
def update_entry(clientName, createKeyOpt):
newKey = Client(clientName).update(createKey = createKeyOpt)
print "%s: %s" % (clientName, newKey)
if __name__ == '__main__':
# Deal with getopt here to support -a
update_entry(sys.argv[1], bool(sys.argv[2]))
| from dao.client import Client
import sys
def update_entry(clientName, createKeyOpt):
print "createKeyOpt = %s" % createKeyOpt
newKey = Client(clientName).update(createKey = createKeyOpt)
print "%s: %s" % (clientName, newKey)
if __name__ == '__main__':
# Deal with getopt here to support -a
update_entry(sys.a... | Fix stupid bug in the client creation script | Fix stupid bug in the client creation script
bool(String) doesn't actually convert a string to a boolean.
So we were creating a new ID even if the user typed in "False".
Fixed with a simple boolean check instead.
| Python | bsd-3-clause | sunil07t/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server,joshzarrabi/e-mission-server,joshzarrabi/e-mission-server,e-mission/e-mission-server,yw374cornell/e-mission-server,sdsingh/e-mission-server,shankari/e-mission-server,joshzarrabi/e-mission-server,joshzarrabi/e-missi... | from dao.client import Client
import sys
def update_entry(clientName, createKeyOpt):
newKey = Client(clientName).update(createKey = createKeyOpt)
print "%s: %s" % (clientName, newKey)
if __name__ == '__main__':
# Deal with getopt here to support -a
update_entry(sys.argv[1], bool(sys.argv[2]))
Fix stupid bug i... | from dao.client import Client
import sys
def update_entry(clientName, createKeyOpt):
print "createKeyOpt = %s" % createKeyOpt
newKey = Client(clientName).update(createKey = createKeyOpt)
print "%s: %s" % (clientName, newKey)
if __name__ == '__main__':
# Deal with getopt here to support -a
update_entry(sys.a... | <commit_before>from dao.client import Client
import sys
def update_entry(clientName, createKeyOpt):
newKey = Client(clientName).update(createKey = createKeyOpt)
print "%s: %s" % (clientName, newKey)
if __name__ == '__main__':
# Deal with getopt here to support -a
update_entry(sys.argv[1], bool(sys.argv[2]))
<... | from dao.client import Client
import sys
def update_entry(clientName, createKeyOpt):
print "createKeyOpt = %s" % createKeyOpt
newKey = Client(clientName).update(createKey = createKeyOpt)
print "%s: %s" % (clientName, newKey)
if __name__ == '__main__':
# Deal with getopt here to support -a
update_entry(sys.a... | from dao.client import Client
import sys
def update_entry(clientName, createKeyOpt):
newKey = Client(clientName).update(createKey = createKeyOpt)
print "%s: %s" % (clientName, newKey)
if __name__ == '__main__':
# Deal with getopt here to support -a
update_entry(sys.argv[1], bool(sys.argv[2]))
Fix stupid bug i... | <commit_before>from dao.client import Client
import sys
def update_entry(clientName, createKeyOpt):
newKey = Client(clientName).update(createKey = createKeyOpt)
print "%s: %s" % (clientName, newKey)
if __name__ == '__main__':
# Deal with getopt here to support -a
update_entry(sys.argv[1], bool(sys.argv[2]))
<... |
9697010c909e3a4777bdef7c2889813ae3decad7 | telemetry/telemetry/internal/platform/profiler/android_screen_recorder_profiler.py | telemetry/telemetry/internal/platform/profiler/android_screen_recorder_profiler.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
from telemetry.internal.platform import profiler
from telemetry.internal import util
from telemetry.internal.backends.chrome imp... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
from telemetry.core import util
from telemetry.internal.platform import profiler
from telemetry.internal.backends.chrome import ... | Fix an import path in the Android screen recorder | telemetry: Fix an import path in the Android screen recorder
Review URL: https://codereview.chromium.org/1301613004
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#343960}
| Python | bsd-3-clause | benschmaus/catapult,SummerLW/Perf-Insight-Report,sahiljain/catapult,catapult-project/catapult-csm,benschmaus/catapult,catapult-project/catapult-csm,catapult-project/catapult,catapult-project/catapult,SummerLW/Perf-Insight-Report,catapult-project/catapult-csm,SummerLW/Perf-Insight-Report,sahiljain/catapult,SummerLW/Perf... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
from telemetry.internal.platform import profiler
from telemetry.internal import util
from telemetry.internal.backends.chrome imp... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
from telemetry.core import util
from telemetry.internal.platform import profiler
from telemetry.internal.backends.chrome import ... | <commit_before># Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
from telemetry.internal.platform import profiler
from telemetry.internal import util
from telemetry.internal.back... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
from telemetry.core import util
from telemetry.internal.platform import profiler
from telemetry.internal.backends.chrome import ... | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
from telemetry.internal.platform import profiler
from telemetry.internal import util
from telemetry.internal.backends.chrome imp... | <commit_before># Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
from telemetry.internal.platform import profiler
from telemetry.internal import util
from telemetry.internal.back... |
4268f8194bd93bd7f4be24c34938ca343e457c34 | dbaas/workflow/steps/tests/__init__.py | dbaas/workflow/steps/tests/__init__.py | from unittest import TestCase
from physical.tests.factory import PlanFactory, DatabaseInfraFactory, InstanceFactory
class TestBaseStep(TestCase):
def setUp(self):
self.plan = PlanFactory()
self.environment = self.plan.environments.first()
self.infra = DatabaseInfraFactory(plan=self.plan, ... | from django.test import TestCase
from physical.tests.factory import PlanFactory, DatabaseInfraFactory, InstanceFactory
class TestBaseStep(TestCase):
def setUp(self):
self.plan = PlanFactory()
self.environment = self.plan.environments.first()
self.infra = DatabaseInfraFactory(plan=self.pla... | Change TestCase from unittest to django.test | Change TestCase from unittest to django.test
| Python | bsd-3-clause | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | from unittest import TestCase
from physical.tests.factory import PlanFactory, DatabaseInfraFactory, InstanceFactory
class TestBaseStep(TestCase):
def setUp(self):
self.plan = PlanFactory()
self.environment = self.plan.environments.first()
self.infra = DatabaseInfraFactory(plan=self.plan, ... | from django.test import TestCase
from physical.tests.factory import PlanFactory, DatabaseInfraFactory, InstanceFactory
class TestBaseStep(TestCase):
def setUp(self):
self.plan = PlanFactory()
self.environment = self.plan.environments.first()
self.infra = DatabaseInfraFactory(plan=self.pla... | <commit_before>from unittest import TestCase
from physical.tests.factory import PlanFactory, DatabaseInfraFactory, InstanceFactory
class TestBaseStep(TestCase):
def setUp(self):
self.plan = PlanFactory()
self.environment = self.plan.environments.first()
self.infra = DatabaseInfraFactory(p... | from django.test import TestCase
from physical.tests.factory import PlanFactory, DatabaseInfraFactory, InstanceFactory
class TestBaseStep(TestCase):
def setUp(self):
self.plan = PlanFactory()
self.environment = self.plan.environments.first()
self.infra = DatabaseInfraFactory(plan=self.pla... | from unittest import TestCase
from physical.tests.factory import PlanFactory, DatabaseInfraFactory, InstanceFactory
class TestBaseStep(TestCase):
def setUp(self):
self.plan = PlanFactory()
self.environment = self.plan.environments.first()
self.infra = DatabaseInfraFactory(plan=self.plan, ... | <commit_before>from unittest import TestCase
from physical.tests.factory import PlanFactory, DatabaseInfraFactory, InstanceFactory
class TestBaseStep(TestCase):
def setUp(self):
self.plan = PlanFactory()
self.environment = self.plan.environments.first()
self.infra = DatabaseInfraFactory(p... |
3031bcfda01a55c70f3af860bb5620a5530e654a | Motor/src/main/python/vehicles.py | Motor/src/main/python/vehicles.py | from Adafruit_MotorHAT import Adafruit_MotorHAT
class Vehicle:
def __init__(self, motor_hat=None):
self.motor_hat = motor_hat
self.motors = []
def release(self):
self.motor_hat.getMotor(1).run(Adafruit_MotorHAT.RELEASE)
self.motor_hat.getMotor(2).run(Adafruit_MotorHAT.RELEASE)... | from Adafruit_MotorHAT import Adafruit_MotorHAT
class Vehicle:
def __init__(self, motor_hat=Adafruit_MotorHAT()):
self.motor_hat = motor_hat
self.motors = []
def release(self):
self.motor_hat.getMotor(1).run(Adafruit_MotorHAT.RELEASE)
self.motor_hat.getMotor(2).run(Adafruit_Mo... | Build vehicle with motor hat. | Build vehicle with motor hat.
| Python | mit | misalcedo/RapBot,misalcedo/RapBot,misalcedo/RapBot,misalcedo/RapBot | from Adafruit_MotorHAT import Adafruit_MotorHAT
class Vehicle:
def __init__(self, motor_hat=None):
self.motor_hat = motor_hat
self.motors = []
def release(self):
self.motor_hat.getMotor(1).run(Adafruit_MotorHAT.RELEASE)
self.motor_hat.getMotor(2).run(Adafruit_MotorHAT.RELEASE)... | from Adafruit_MotorHAT import Adafruit_MotorHAT
class Vehicle:
def __init__(self, motor_hat=Adafruit_MotorHAT()):
self.motor_hat = motor_hat
self.motors = []
def release(self):
self.motor_hat.getMotor(1).run(Adafruit_MotorHAT.RELEASE)
self.motor_hat.getMotor(2).run(Adafruit_Mo... | <commit_before>from Adafruit_MotorHAT import Adafruit_MotorHAT
class Vehicle:
def __init__(self, motor_hat=None):
self.motor_hat = motor_hat
self.motors = []
def release(self):
self.motor_hat.getMotor(1).run(Adafruit_MotorHAT.RELEASE)
self.motor_hat.getMotor(2).run(Adafruit_Mo... | from Adafruit_MotorHAT import Adafruit_MotorHAT
class Vehicle:
def __init__(self, motor_hat=Adafruit_MotorHAT()):
self.motor_hat = motor_hat
self.motors = []
def release(self):
self.motor_hat.getMotor(1).run(Adafruit_MotorHAT.RELEASE)
self.motor_hat.getMotor(2).run(Adafruit_Mo... | from Adafruit_MotorHAT import Adafruit_MotorHAT
class Vehicle:
def __init__(self, motor_hat=None):
self.motor_hat = motor_hat
self.motors = []
def release(self):
self.motor_hat.getMotor(1).run(Adafruit_MotorHAT.RELEASE)
self.motor_hat.getMotor(2).run(Adafruit_MotorHAT.RELEASE)... | <commit_before>from Adafruit_MotorHAT import Adafruit_MotorHAT
class Vehicle:
def __init__(self, motor_hat=None):
self.motor_hat = motor_hat
self.motors = []
def release(self):
self.motor_hat.getMotor(1).run(Adafruit_MotorHAT.RELEASE)
self.motor_hat.getMotor(2).run(Adafruit_Mo... |
0007ea4aa0f7ebadfadb0c6f605c51a1d11e483c | account/managers.py | account/managers.py | from __future__ import unicode_literals
from django.db import models, IntegrityError
class EmailAddressManager(models.Manager):
def add_email(self, user, email, **kwargs):
confirm = kwargs.pop("confirm", False)
try:
email_address = self.create(user=user, email=email, **kwargs)
... | from __future__ import unicode_literals
from django.db import models, IntegrityError
class EmailAddressManager(models.Manager):
def add_email(self, user, email, **kwargs):
confirm = kwargs.pop("confirm", False)
email_address = self.create(user=user, email=email, **kwargs)
if confirm and ... | Allow IntegrityError to propagate with duplicate email | Allow IntegrityError to propagate with duplicate email
Fixes #62. When ACCOUNT_EMAIL_UNIQUE is True we should fail loudly when an
attempt to insert a duplicate occurs. Let the callers handle the failure.
| Python | mit | mentholi/django-user-accounts,jawed123/django-user-accounts,ntucker/django-user-accounts,jpotterm/django-user-accounts,rizumu/django-user-accounts,jacobwegner/django-user-accounts,mentholi/django-user-accounts,pinax/django-user-accounts,GeoNode/geonode-user-accounts,nderituedwin/django-user-accounts,mysociety/django-us... | from __future__ import unicode_literals
from django.db import models, IntegrityError
class EmailAddressManager(models.Manager):
def add_email(self, user, email, **kwargs):
confirm = kwargs.pop("confirm", False)
try:
email_address = self.create(user=user, email=email, **kwargs)
... | from __future__ import unicode_literals
from django.db import models, IntegrityError
class EmailAddressManager(models.Manager):
def add_email(self, user, email, **kwargs):
confirm = kwargs.pop("confirm", False)
email_address = self.create(user=user, email=email, **kwargs)
if confirm and ... | <commit_before>from __future__ import unicode_literals
from django.db import models, IntegrityError
class EmailAddressManager(models.Manager):
def add_email(self, user, email, **kwargs):
confirm = kwargs.pop("confirm", False)
try:
email_address = self.create(user=user, email=email, *... | from __future__ import unicode_literals
from django.db import models, IntegrityError
class EmailAddressManager(models.Manager):
def add_email(self, user, email, **kwargs):
confirm = kwargs.pop("confirm", False)
email_address = self.create(user=user, email=email, **kwargs)
if confirm and ... | from __future__ import unicode_literals
from django.db import models, IntegrityError
class EmailAddressManager(models.Manager):
def add_email(self, user, email, **kwargs):
confirm = kwargs.pop("confirm", False)
try:
email_address = self.create(user=user, email=email, **kwargs)
... | <commit_before>from __future__ import unicode_literals
from django.db import models, IntegrityError
class EmailAddressManager(models.Manager):
def add_email(self, user, email, **kwargs):
confirm = kwargs.pop("confirm", False)
try:
email_address = self.create(user=user, email=email, *... |
2ee1e8046323e2632c8cd8c8d88e3c313caabe1e | kobo/hub/forms.py | kobo/hub/forms.py | # -*- coding: utf-8 -*-
import django.forms as forms
from django.db.models import Q
class TaskSearchForm(forms.Form):
search = forms.CharField(required=False)
my = forms.BooleanField(required=False)
def get_query(self, request):
self.is_valid()
search = self.cleaned_data["search"]
... | # -*- coding: utf-8 -*-
import django.forms as forms
from django.db.models import Q
class TaskSearchForm(forms.Form):
search = forms.CharField(required=False)
my = forms.BooleanField(required=False)
def get_query(self, request):
self.is_valid()
search = self.cleaned_data["search"]
... | Enable searching in task list by label. | Enable searching in task list by label.
| Python | lgpl-2.1 | pombredanne/https-git.fedorahosted.org-git-kobo,release-engineering/kobo,release-engineering/kobo,release-engineering/kobo,pombredanne/https-git.fedorahosted.org-git-kobo,release-engineering/kobo,pombredanne/https-git.fedorahosted.org-git-kobo,pombredanne/https-git.fedorahosted.org-git-kobo | # -*- coding: utf-8 -*-
import django.forms as forms
from django.db.models import Q
class TaskSearchForm(forms.Form):
search = forms.CharField(required=False)
my = forms.BooleanField(required=False)
def get_query(self, request):
self.is_valid()
search = self.cleaned_data["search"]
... | # -*- coding: utf-8 -*-
import django.forms as forms
from django.db.models import Q
class TaskSearchForm(forms.Form):
search = forms.CharField(required=False)
my = forms.BooleanField(required=False)
def get_query(self, request):
self.is_valid()
search = self.cleaned_data["search"]
... | <commit_before># -*- coding: utf-8 -*-
import django.forms as forms
from django.db.models import Q
class TaskSearchForm(forms.Form):
search = forms.CharField(required=False)
my = forms.BooleanField(required=False)
def get_query(self, request):
self.is_valid()
search = self.cleaned_dat... | # -*- coding: utf-8 -*-
import django.forms as forms
from django.db.models import Q
class TaskSearchForm(forms.Form):
search = forms.CharField(required=False)
my = forms.BooleanField(required=False)
def get_query(self, request):
self.is_valid()
search = self.cleaned_data["search"]
... | # -*- coding: utf-8 -*-
import django.forms as forms
from django.db.models import Q
class TaskSearchForm(forms.Form):
search = forms.CharField(required=False)
my = forms.BooleanField(required=False)
def get_query(self, request):
self.is_valid()
search = self.cleaned_data["search"]
... | <commit_before># -*- coding: utf-8 -*-
import django.forms as forms
from django.db.models import Q
class TaskSearchForm(forms.Form):
search = forms.CharField(required=False)
my = forms.BooleanField(required=False)
def get_query(self, request):
self.is_valid()
search = self.cleaned_dat... |
56aa7fa21b218e047e9f3d7c2239aa6a22d9a5b1 | kombu/__init__.py | kombu/__init__.py | """AMQP Messaging Framework for Python"""
VERSION = (1, 0, 0, "rc4")
__version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:])
__author__ = "Ask Solem"
__contact__ = "[email protected]"
__homepage__ = "http://github.com/ask/kombu/"
__docformat__ = "restructuredtext"
import os
if not os.environ.get("KOM... | """AMQP Messaging Framework for Python"""
VERSION = (1, 0, 0, "rc4")
__version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:])
__author__ = "Ask Solem"
__contact__ = "[email protected]"
__homepage__ = "http://github.com/ask/kombu/"
__docformat__ = "restructuredtext en"
import os
import sys
if not os.en... | Load kombu root module lazily | Load kombu root module lazily
| Python | bsd-3-clause | urbn/kombu,depop/kombu,bmbouter/kombu,WoLpH/kombu,ZoranPavlovic/kombu,depop/kombu,mathom/kombu,xujun10110/kombu,romank0/kombu,xujun10110/kombu,alex/kombu,numb3r3/kombu,alex/kombu,andresriancho/kombu,daevaorn/kombu,daevaorn/kombu,iris-edu-int/kombu,ZoranPavlovic/kombu,WoLpH/kombu,cce/kombu,mverrilli/kombu,disqus/kombu,c... | """AMQP Messaging Framework for Python"""
VERSION = (1, 0, 0, "rc4")
__version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:])
__author__ = "Ask Solem"
__contact__ = "[email protected]"
__homepage__ = "http://github.com/ask/kombu/"
__docformat__ = "restructuredtext"
import os
if not os.environ.get("KOM... | """AMQP Messaging Framework for Python"""
VERSION = (1, 0, 0, "rc4")
__version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:])
__author__ = "Ask Solem"
__contact__ = "[email protected]"
__homepage__ = "http://github.com/ask/kombu/"
__docformat__ = "restructuredtext en"
import os
import sys
if not os.en... | <commit_before>"""AMQP Messaging Framework for Python"""
VERSION = (1, 0, 0, "rc4")
__version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:])
__author__ = "Ask Solem"
__contact__ = "[email protected]"
__homepage__ = "http://github.com/ask/kombu/"
__docformat__ = "restructuredtext"
import os
if not os.e... | """AMQP Messaging Framework for Python"""
VERSION = (1, 0, 0, "rc4")
__version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:])
__author__ = "Ask Solem"
__contact__ = "[email protected]"
__homepage__ = "http://github.com/ask/kombu/"
__docformat__ = "restructuredtext en"
import os
import sys
if not os.en... | """AMQP Messaging Framework for Python"""
VERSION = (1, 0, 0, "rc4")
__version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:])
__author__ = "Ask Solem"
__contact__ = "[email protected]"
__homepage__ = "http://github.com/ask/kombu/"
__docformat__ = "restructuredtext"
import os
if not os.environ.get("KOM... | <commit_before>"""AMQP Messaging Framework for Python"""
VERSION = (1, 0, 0, "rc4")
__version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:])
__author__ = "Ask Solem"
__contact__ = "[email protected]"
__homepage__ = "http://github.com/ask/kombu/"
__docformat__ = "restructuredtext"
import os
if not os.e... |
3b75688e18ed3adb06f26a51c7f12b6e419b6837 | tests/test_domain_parser.py | tests/test_domain_parser.py | import unittest
from domain_parser import domain_parser
class DomainParserTestCase(unittest.TestCase):
def test_google(self):
"""Is google.com properly parsed?"""
assert domain_parser.parse_domain(
'http://www.google.com') == ('com', 'google', 'www')
def test_gaurdian(self):
... | import unittest
from domain_parser import domain_parser
class DomainParserTestCase(unittest.TestCase):
def test_google(self):
"""Is google.com properly parsed?"""
assert domain_parser.parse_domain(
'http://www.google.com') == ('com', 'google', 'www')
def test_guardian(self):
... | Fix a very small typo in the name of the test. | Fix a very small typo in the name of the test.
Test name has been changed from test_gaurdian to test_guardian, to reflect Guardian website name | Python | apache-2.0 | jeffknupp/domain-parser,jeffknupp/domain-parser | import unittest
from domain_parser import domain_parser
class DomainParserTestCase(unittest.TestCase):
def test_google(self):
"""Is google.com properly parsed?"""
assert domain_parser.parse_domain(
'http://www.google.com') == ('com', 'google', 'www')
def test_gaurdian(self):
... | import unittest
from domain_parser import domain_parser
class DomainParserTestCase(unittest.TestCase):
def test_google(self):
"""Is google.com properly parsed?"""
assert domain_parser.parse_domain(
'http://www.google.com') == ('com', 'google', 'www')
def test_guardian(self):
... | <commit_before>import unittest
from domain_parser import domain_parser
class DomainParserTestCase(unittest.TestCase):
def test_google(self):
"""Is google.com properly parsed?"""
assert domain_parser.parse_domain(
'http://www.google.com') == ('com', 'google', 'www')
def test_g... | import unittest
from domain_parser import domain_parser
class DomainParserTestCase(unittest.TestCase):
def test_google(self):
"""Is google.com properly parsed?"""
assert domain_parser.parse_domain(
'http://www.google.com') == ('com', 'google', 'www')
def test_guardian(self):
... | import unittest
from domain_parser import domain_parser
class DomainParserTestCase(unittest.TestCase):
def test_google(self):
"""Is google.com properly parsed?"""
assert domain_parser.parse_domain(
'http://www.google.com') == ('com', 'google', 'www')
def test_gaurdian(self):
... | <commit_before>import unittest
from domain_parser import domain_parser
class DomainParserTestCase(unittest.TestCase):
def test_google(self):
"""Is google.com properly parsed?"""
assert domain_parser.parse_domain(
'http://www.google.com') == ('com', 'google', 'www')
def test_g... |
33524fe8cad5f8bf4448c7dd7426d1e1452bb324 | example_of_usage.py | example_of_usage.py | # -----------------------------------------------------------------------------
# Created: 04.03.2014
# Copyright: (c) Josua Schmid 2014
# Licence: GPLv3
#
# Sample script for parsing HTML tables
# -----------------------------------------------------------------------------
import urllib.request
from pprint... | # -----------------------------------------------------------------------------
# Created: 04.03.2014
# Copyright: (c) Josua Schmid 2014
# Licence: AGPLv3
#
# Sample script for parsing HTML tables
# -----------------------------------------------------------------------------
import urllib.request
from pprin... | Change license according to project license | Change license according to project license
| Python | agpl-3.0 | schmijos/html-table-parser-python3,schmijos/html-table-parser-python3 | # -----------------------------------------------------------------------------
# Created: 04.03.2014
# Copyright: (c) Josua Schmid 2014
# Licence: GPLv3
#
# Sample script for parsing HTML tables
# -----------------------------------------------------------------------------
import urllib.request
from pprint... | # -----------------------------------------------------------------------------
# Created: 04.03.2014
# Copyright: (c) Josua Schmid 2014
# Licence: AGPLv3
#
# Sample script for parsing HTML tables
# -----------------------------------------------------------------------------
import urllib.request
from pprin... | <commit_before># -----------------------------------------------------------------------------
# Created: 04.03.2014
# Copyright: (c) Josua Schmid 2014
# Licence: GPLv3
#
# Sample script for parsing HTML tables
# -----------------------------------------------------------------------------
import urllib.requ... | # -----------------------------------------------------------------------------
# Created: 04.03.2014
# Copyright: (c) Josua Schmid 2014
# Licence: AGPLv3
#
# Sample script for parsing HTML tables
# -----------------------------------------------------------------------------
import urllib.request
from pprin... | # -----------------------------------------------------------------------------
# Created: 04.03.2014
# Copyright: (c) Josua Schmid 2014
# Licence: GPLv3
#
# Sample script for parsing HTML tables
# -----------------------------------------------------------------------------
import urllib.request
from pprint... | <commit_before># -----------------------------------------------------------------------------
# Created: 04.03.2014
# Copyright: (c) Josua Schmid 2014
# Licence: GPLv3
#
# Sample script for parsing HTML tables
# -----------------------------------------------------------------------------
import urllib.requ... |
b471b4d3a6d9da439f05ccb27d5d39aa884e724b | piwars/controllers/__main__.py | piwars/controllers/__main__.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import importlib
from .. import robots
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--controller", default="remote")
parser.add_argument("--robot", default="text")
args = parser.parse_args()... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import importlib
from .. import robots
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--controller", default="remote")
parser.add_argument("--robot", default="text")
args = parser.parse_args()... | Switch to .run from .start to avoid confusion with an incoming command | Switch to .run from .start to avoid confusion with an incoming command
| Python | mit | westpark/robotics | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import importlib
from .. import robots
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--controller", default="remote")
parser.add_argument("--robot", default="text")
args = parser.parse_args()... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import importlib
from .. import robots
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--controller", default="remote")
parser.add_argument("--robot", default="text")
args = parser.parse_args()... | <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import importlib
from .. import robots
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--controller", default="remote")
parser.add_argument("--robot", default="text")
args = pars... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import importlib
from .. import robots
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--controller", default="remote")
parser.add_argument("--robot", default="text")
args = parser.parse_args()... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import importlib
from .. import robots
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--controller", default="remote")
parser.add_argument("--robot", default="text")
args = parser.parse_args()... | <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import importlib
from .. import robots
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--controller", default="remote")
parser.add_argument("--robot", default="text")
args = pars... |
23bce5ac6a73473f6f166c674988e68af18d2b51 | billing/__init__.py | billing/__init__.py | __version__ = '1.7.2'
__copyright__ = 'Copyright (c) 2020, Skioo SA'
__licence__ = 'MIT'
__URL__ = 'https://github.com/skioo/django-customer-billing'
| __version__ = '1.7.3'
__copyright__ = 'Copyright (c) 2020, Skioo SA'
__licence__ = 'MIT'
__URL__ = 'https://github.com/skioo/django-customer-billing'
| Update project version to 1.7.3 | Update project version to 1.7.3
| Python | mit | skioo/django-customer-billing,skioo/django-customer-billing | __version__ = '1.7.2'
__copyright__ = 'Copyright (c) 2020, Skioo SA'
__licence__ = 'MIT'
__URL__ = 'https://github.com/skioo/django-customer-billing'
Update project version to 1.7.3 | __version__ = '1.7.3'
__copyright__ = 'Copyright (c) 2020, Skioo SA'
__licence__ = 'MIT'
__URL__ = 'https://github.com/skioo/django-customer-billing'
| <commit_before>__version__ = '1.7.2'
__copyright__ = 'Copyright (c) 2020, Skioo SA'
__licence__ = 'MIT'
__URL__ = 'https://github.com/skioo/django-customer-billing'
<commit_msg>Update project version to 1.7.3<commit_after> | __version__ = '1.7.3'
__copyright__ = 'Copyright (c) 2020, Skioo SA'
__licence__ = 'MIT'
__URL__ = 'https://github.com/skioo/django-customer-billing'
| __version__ = '1.7.2'
__copyright__ = 'Copyright (c) 2020, Skioo SA'
__licence__ = 'MIT'
__URL__ = 'https://github.com/skioo/django-customer-billing'
Update project version to 1.7.3__version__ = '1.7.3'
__copyright__ = 'Copyright (c) 2020, Skioo SA'
__licence__ = 'MIT'
__URL__ = 'https://github.com/skioo/django-custome... | <commit_before>__version__ = '1.7.2'
__copyright__ = 'Copyright (c) 2020, Skioo SA'
__licence__ = 'MIT'
__URL__ = 'https://github.com/skioo/django-customer-billing'
<commit_msg>Update project version to 1.7.3<commit_after>__version__ = '1.7.3'
__copyright__ = 'Copyright (c) 2020, Skioo SA'
__licence__ = 'MIT'
__URL__ =... |
f22a217e86602b138451801afd3cd3c1c6314655 | bin/post_reports.py | bin/post_reports.py | #!/usr/bin/env python3
import os
import django
from fitbit.slack import post_message
IDS_TO_POST = os.environ['AUTOPOST'].split(',')
if __name__ == '__main__':
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fitbitslackbot.settings")
django.setup()
# Cannot import these until django is setup
from f... | #!/usr/bin/env python3
import os
import django
from fitbit.slack import post_message
if __name__ == '__main__':
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fitbitslackbot.settings")
django.setup()
# Cannot import these until django is setup
from fitbit.models import Token
from fitbit.views ... | Send all user data to the slack | Send all user data to the slack
| Python | apache-2.0 | Bachmann1234/fitbitSlackBot,Bachmann1234/fitbitSlackBot | #!/usr/bin/env python3
import os
import django
from fitbit.slack import post_message
IDS_TO_POST = os.environ['AUTOPOST'].split(',')
if __name__ == '__main__':
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fitbitslackbot.settings")
django.setup()
# Cannot import these until django is setup
from f... | #!/usr/bin/env python3
import os
import django
from fitbit.slack import post_message
if __name__ == '__main__':
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fitbitslackbot.settings")
django.setup()
# Cannot import these until django is setup
from fitbit.models import Token
from fitbit.views ... | <commit_before>#!/usr/bin/env python3
import os
import django
from fitbit.slack import post_message
IDS_TO_POST = os.environ['AUTOPOST'].split(',')
if __name__ == '__main__':
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fitbitslackbot.settings")
django.setup()
# Cannot import these until django is s... | #!/usr/bin/env python3
import os
import django
from fitbit.slack import post_message
if __name__ == '__main__':
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fitbitslackbot.settings")
django.setup()
# Cannot import these until django is setup
from fitbit.models import Token
from fitbit.views ... | #!/usr/bin/env python3
import os
import django
from fitbit.slack import post_message
IDS_TO_POST = os.environ['AUTOPOST'].split(',')
if __name__ == '__main__':
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fitbitslackbot.settings")
django.setup()
# Cannot import these until django is setup
from f... | <commit_before>#!/usr/bin/env python3
import os
import django
from fitbit.slack import post_message
IDS_TO_POST = os.environ['AUTOPOST'].split(',')
if __name__ == '__main__':
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fitbitslackbot.settings")
django.setup()
# Cannot import these until django is s... |
83bb9f15ae8ceed3352232b26176b74607a08efb | tests/test_tools.py | tests/test_tools.py | """Test the functions in the tools file."""
import bibpy.tools
def test_version_format():
assert bibpy.tools.version_format().format('0.1.0') == '%(prog)s v0.1.0'
program_name = dict(prog='tool_name')
assert (bibpy.tools.version_format() % program_name).format('2.3') ==\
'tool_name v2.3'
def t... | """Test the functions in the tools file."""
import bibpy.tools
def test_version_format():
assert bibpy.tools.version_format().format('0.1.0') == '%(prog)s v0.1.0'
program_name = dict(prog='tool_name')
assert (bibpy.tools.version_format() % program_name).format('2.3') ==\
'tool_name v2.3'
def t... | Add test for predicate composition | Add test for predicate composition
| Python | mit | MisanthropicBit/bibpy,MisanthropicBit/bibpy | """Test the functions in the tools file."""
import bibpy.tools
def test_version_format():
assert bibpy.tools.version_format().format('0.1.0') == '%(prog)s v0.1.0'
program_name = dict(prog='tool_name')
assert (bibpy.tools.version_format() % program_name).format('2.3') ==\
'tool_name v2.3'
def t... | """Test the functions in the tools file."""
import bibpy.tools
def test_version_format():
assert bibpy.tools.version_format().format('0.1.0') == '%(prog)s v0.1.0'
program_name = dict(prog='tool_name')
assert (bibpy.tools.version_format() % program_name).format('2.3') ==\
'tool_name v2.3'
def t... | <commit_before>"""Test the functions in the tools file."""
import bibpy.tools
def test_version_format():
assert bibpy.tools.version_format().format('0.1.0') == '%(prog)s v0.1.0'
program_name = dict(prog='tool_name')
assert (bibpy.tools.version_format() % program_name).format('2.3') ==\
'tool_nam... | """Test the functions in the tools file."""
import bibpy.tools
def test_version_format():
assert bibpy.tools.version_format().format('0.1.0') == '%(prog)s v0.1.0'
program_name = dict(prog='tool_name')
assert (bibpy.tools.version_format() % program_name).format('2.3') ==\
'tool_name v2.3'
def t... | """Test the functions in the tools file."""
import bibpy.tools
def test_version_format():
assert bibpy.tools.version_format().format('0.1.0') == '%(prog)s v0.1.0'
program_name = dict(prog='tool_name')
assert (bibpy.tools.version_format() % program_name).format('2.3') ==\
'tool_name v2.3'
def t... | <commit_before>"""Test the functions in the tools file."""
import bibpy.tools
def test_version_format():
assert bibpy.tools.version_format().format('0.1.0') == '%(prog)s v0.1.0'
program_name = dict(prog='tool_name')
assert (bibpy.tools.version_format() % program_name).format('2.3') ==\
'tool_nam... |
9c5a088af964a70453617b9925f9a027890497bb | tests/test_utils.py | tests/test_utils.py | import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-001'}
return sample_page
def test_build_img_... | import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-009'}
return sample_page
def test_build_img_... | Update sample good page to test changes from 1 to 2 digits | Update sample good page to test changes from 1 to 2 digits
| Python | mit | ma3lstrom/manga-cork,ma3lstrom/manga-cork,ma3lstrom/manga-cork | import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-001'}
return sample_page
def test_build_img_... | import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-009'}
return sample_page
def test_build_img_... | <commit_before>import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-001'}
return sample_page
def ... | import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-009'}
return sample_page
def test_build_img_... | import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-001'}
return sample_page
def test_build_img_... | <commit_before>import pytest
from mangacork import utils
@pytest.fixture
def sample_page_bad_format():
sample_page = {'chapter': "chapter1", 'page': 3}
return sample_page
@pytest.fixture
def sample_page_good_format():
sample_page = {'chapter':'manga_ch1', 'page':'x_v001-001'}
return sample_page
def ... |
096800e08d29581e5a515dd01031c64eb2f01539 | pyxform/tests_v1/test_audit.py | pyxform/tests_v1/test_audit.py | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | | |
| | type | name ... | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | |
| | type | name | label |
... | Remove non-required column from test. | Remove non-required column from test.
| Python | bsd-2-clause | XLSForm/pyxform,XLSForm/pyxform | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | | |
| | type | name ... | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | |
| | type | name | label |
... | <commit_before>from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | | |
| | t... | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | |
| | type | name | label |
... | from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | | |
| | type | name ... | <commit_before>from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class AuditTest(PyxformTestCase):
def test_audit(self):
self.assertPyxformXform(
name="meta_audit",
md="""
| survey | | | | |
| | t... |
7b3276708417284242b4e0c9a13c6194dcc83aa7 | quickstartup/contacts/views.py | quickstartup/contacts/views.py | # coding: utf-8
from django.core.urlresolvers import reverse
from django.views.generic import CreateView
from django.utils.translation import ugettext_lazy as _
from django.contrib import messages
from .forms import ContactForm
class ContactView(CreateView):
template_name = 'contacts/contact.html'
form_cla... | # coding: utf-8
from django.core.urlresolvers import reverse
from django.views.generic import CreateView
from django.utils.translation import ugettext_lazy as _
from django.contrib import messages
from .forms import ContactForm
class ContactView(CreateView):
template_name = 'contacts/contact.html'
form_cla... | Set flash message *after* message sending | Set flash message *after* message sending
| Python | mit | georgeyk/quickstartup,georgeyk/quickstartup,osantana/quickstartup,osantana/quickstartup,osantana/quickstartup,georgeyk/quickstartup | # coding: utf-8
from django.core.urlresolvers import reverse
from django.views.generic import CreateView
from django.utils.translation import ugettext_lazy as _
from django.contrib import messages
from .forms import ContactForm
class ContactView(CreateView):
template_name = 'contacts/contact.html'
form_cla... | # coding: utf-8
from django.core.urlresolvers import reverse
from django.views.generic import CreateView
from django.utils.translation import ugettext_lazy as _
from django.contrib import messages
from .forms import ContactForm
class ContactView(CreateView):
template_name = 'contacts/contact.html'
form_cla... | <commit_before># coding: utf-8
from django.core.urlresolvers import reverse
from django.views.generic import CreateView
from django.utils.translation import ugettext_lazy as _
from django.contrib import messages
from .forms import ContactForm
class ContactView(CreateView):
template_name = 'contacts/contact.htm... | # coding: utf-8
from django.core.urlresolvers import reverse
from django.views.generic import CreateView
from django.utils.translation import ugettext_lazy as _
from django.contrib import messages
from .forms import ContactForm
class ContactView(CreateView):
template_name = 'contacts/contact.html'
form_cla... | # coding: utf-8
from django.core.urlresolvers import reverse
from django.views.generic import CreateView
from django.utils.translation import ugettext_lazy as _
from django.contrib import messages
from .forms import ContactForm
class ContactView(CreateView):
template_name = 'contacts/contact.html'
form_cla... | <commit_before># coding: utf-8
from django.core.urlresolvers import reverse
from django.views.generic import CreateView
from django.utils.translation import ugettext_lazy as _
from django.contrib import messages
from .forms import ContactForm
class ContactView(CreateView):
template_name = 'contacts/contact.htm... |
77a5ecc7c406e4a6acf814a2f0381dc605e0d14c | leds/led_dance.py | leds/led_dance.py | # Light LEDs at 'random' and make them fade over time
#
# Usage:
#
# led_dance(speed)
#
# 'speed' is the time between each new LED being turned on. Note that the
# random number is actually based on time and so the speed will determine
# the pattern (and it is not really random).
#
# Hold button 'A' pressed to stop ... | # Light LEDs at random and make them fade over time
#
# Usage:
#
# led_dance(delay)
#
# 'delay' is the time between each new LED being turned on.
import microbit
def led_dance(delay):
dots = [ [0]*5, [0]*5, [0]*5, [0]*5, [0]*5 ]
microbit.display.set_display_mode(1)
while True:
dots[microbit.ran... | Update for new version of micropython for microbit | Update for new version of micropython for microbit
| Python | mit | jrmhaig/microbit_playground | # Light LEDs at 'random' and make them fade over time
#
# Usage:
#
# led_dance(speed)
#
# 'speed' is the time between each new LED being turned on. Note that the
# random number is actually based on time and so the speed will determine
# the pattern (and it is not really random).
#
# Hold button 'A' pressed to stop ... | # Light LEDs at random and make them fade over time
#
# Usage:
#
# led_dance(delay)
#
# 'delay' is the time between each new LED being turned on.
import microbit
def led_dance(delay):
dots = [ [0]*5, [0]*5, [0]*5, [0]*5, [0]*5 ]
microbit.display.set_display_mode(1)
while True:
dots[microbit.ran... | <commit_before># Light LEDs at 'random' and make them fade over time
#
# Usage:
#
# led_dance(speed)
#
# 'speed' is the time between each new LED being turned on. Note that the
# random number is actually based on time and so the speed will determine
# the pattern (and it is not really random).
#
# Hold button 'A' p... | # Light LEDs at random and make them fade over time
#
# Usage:
#
# led_dance(delay)
#
# 'delay' is the time between each new LED being turned on.
import microbit
def led_dance(delay):
dots = [ [0]*5, [0]*5, [0]*5, [0]*5, [0]*5 ]
microbit.display.set_display_mode(1)
while True:
dots[microbit.ran... | # Light LEDs at 'random' and make them fade over time
#
# Usage:
#
# led_dance(speed)
#
# 'speed' is the time between each new LED being turned on. Note that the
# random number is actually based on time and so the speed will determine
# the pattern (and it is not really random).
#
# Hold button 'A' pressed to stop ... | <commit_before># Light LEDs at 'random' and make them fade over time
#
# Usage:
#
# led_dance(speed)
#
# 'speed' is the time between each new LED being turned on. Note that the
# random number is actually based on time and so the speed will determine
# the pattern (and it is not really random).
#
# Hold button 'A' p... |
dccc51fcc51290648964c350cfff2254cfa99834 | oauth_provider/consts.py | oauth_provider/consts.py | from django.utils.translation import ugettext_lazy as _
KEY_SIZE = 16
SECRET_SIZE = 16
VERIFIER_SIZE = 10
CONSUMER_KEY_SIZE = 256
MAX_URL_LENGTH = 2083 # http://www.boutell.com/newfaq/misc/urllength.html
PENDING = 1
ACCEPTED = 2
CANCELED = 3
REJECTED = 4
CONSUMER_STATES = (
(PENDING, _('Pending')),
(ACCEPTE... | from django.utils.translation import ugettext_lazy as _
from django.conf import settings
KEY_SIZE = getattr(settings, 'OAUTH_PROVIDER_KEY_SIZE', 16)
SECRET_SIZE = getattr(settings, 'OAUTH_PROVIDER_SECRET_SIZE', 16)
VERIFIER_SIZE = getattr(settings, 'OAUTH_PROVIDER_VERIFIER_SIZE', 10)
CONSUMER_KEY_SIZE = getattr(settin... | Allow settings to override default lengths. | Allow settings to override default lengths.
| Python | bsd-3-clause | e-loue/django-oauth-plus | from django.utils.translation import ugettext_lazy as _
KEY_SIZE = 16
SECRET_SIZE = 16
VERIFIER_SIZE = 10
CONSUMER_KEY_SIZE = 256
MAX_URL_LENGTH = 2083 # http://www.boutell.com/newfaq/misc/urllength.html
PENDING = 1
ACCEPTED = 2
CANCELED = 3
REJECTED = 4
CONSUMER_STATES = (
(PENDING, _('Pending')),
(ACCEPTE... | from django.utils.translation import ugettext_lazy as _
from django.conf import settings
KEY_SIZE = getattr(settings, 'OAUTH_PROVIDER_KEY_SIZE', 16)
SECRET_SIZE = getattr(settings, 'OAUTH_PROVIDER_SECRET_SIZE', 16)
VERIFIER_SIZE = getattr(settings, 'OAUTH_PROVIDER_VERIFIER_SIZE', 10)
CONSUMER_KEY_SIZE = getattr(settin... | <commit_before>from django.utils.translation import ugettext_lazy as _
KEY_SIZE = 16
SECRET_SIZE = 16
VERIFIER_SIZE = 10
CONSUMER_KEY_SIZE = 256
MAX_URL_LENGTH = 2083 # http://www.boutell.com/newfaq/misc/urllength.html
PENDING = 1
ACCEPTED = 2
CANCELED = 3
REJECTED = 4
CONSUMER_STATES = (
(PENDING, _('Pending')... | from django.utils.translation import ugettext_lazy as _
from django.conf import settings
KEY_SIZE = getattr(settings, 'OAUTH_PROVIDER_KEY_SIZE', 16)
SECRET_SIZE = getattr(settings, 'OAUTH_PROVIDER_SECRET_SIZE', 16)
VERIFIER_SIZE = getattr(settings, 'OAUTH_PROVIDER_VERIFIER_SIZE', 10)
CONSUMER_KEY_SIZE = getattr(settin... | from django.utils.translation import ugettext_lazy as _
KEY_SIZE = 16
SECRET_SIZE = 16
VERIFIER_SIZE = 10
CONSUMER_KEY_SIZE = 256
MAX_URL_LENGTH = 2083 # http://www.boutell.com/newfaq/misc/urllength.html
PENDING = 1
ACCEPTED = 2
CANCELED = 3
REJECTED = 4
CONSUMER_STATES = (
(PENDING, _('Pending')),
(ACCEPTE... | <commit_before>from django.utils.translation import ugettext_lazy as _
KEY_SIZE = 16
SECRET_SIZE = 16
VERIFIER_SIZE = 10
CONSUMER_KEY_SIZE = 256
MAX_URL_LENGTH = 2083 # http://www.boutell.com/newfaq/misc/urllength.html
PENDING = 1
ACCEPTED = 2
CANCELED = 3
REJECTED = 4
CONSUMER_STATES = (
(PENDING, _('Pending')... |
99a8147a31060442368d79ebeee231744183a6d1 | tests/test_adam.py | tests/test_adam.py | import pytest
from adam.adam import *
def test_contains_asset():
storage = AssetStorage()
a = Asset()
storage['key'] = a
assert storage['key'] == a
def test_contains_key():
storage = AssetStorage()
a = Asset()
assert 'key' not in storage
storage['key'] = a
assert 'key' in stor... | import pytest
from adam.adam import *
def test_contains_asset():
storage = AssetStorage()
a = Asset()
storage['key'] = a
assert storage['key'] == a
def test_contains_key():
storage = AssetStorage()
a = Asset()
assert 'key' not in storage
storage['key'] = a
assert 'key' in stor... | Test for reading a wave file asserts that the essence is set. | Test for reading a wave file asserts that the essence is set.
| Python | agpl-3.0 | eseifert/madam | import pytest
from adam.adam import *
def test_contains_asset():
storage = AssetStorage()
a = Asset()
storage['key'] = a
assert storage['key'] == a
def test_contains_key():
storage = AssetStorage()
a = Asset()
assert 'key' not in storage
storage['key'] = a
assert 'key' in stor... | import pytest
from adam.adam import *
def test_contains_asset():
storage = AssetStorage()
a = Asset()
storage['key'] = a
assert storage['key'] == a
def test_contains_key():
storage = AssetStorage()
a = Asset()
assert 'key' not in storage
storage['key'] = a
assert 'key' in stor... | <commit_before>import pytest
from adam.adam import *
def test_contains_asset():
storage = AssetStorage()
a = Asset()
storage['key'] = a
assert storage['key'] == a
def test_contains_key():
storage = AssetStorage()
a = Asset()
assert 'key' not in storage
storage['key'] = a
asser... | import pytest
from adam.adam import *
def test_contains_asset():
storage = AssetStorage()
a = Asset()
storage['key'] = a
assert storage['key'] == a
def test_contains_key():
storage = AssetStorage()
a = Asset()
assert 'key' not in storage
storage['key'] = a
assert 'key' in stor... | import pytest
from adam.adam import *
def test_contains_asset():
storage = AssetStorage()
a = Asset()
storage['key'] = a
assert storage['key'] == a
def test_contains_key():
storage = AssetStorage()
a = Asset()
assert 'key' not in storage
storage['key'] = a
assert 'key' in stor... | <commit_before>import pytest
from adam.adam import *
def test_contains_asset():
storage = AssetStorage()
a = Asset()
storage['key'] = a
assert storage['key'] == a
def test_contains_key():
storage = AssetStorage()
a = Asset()
assert 'key' not in storage
storage['key'] = a
asser... |
268718b9ad28c8bad26a7fede52a88d51ac5a8da | tests/test_opts.py | tests/test_opts.py | import sys
from skeletor import config
from skeletor.config import Config
from .base import BaseTestCase
from .helpers import nostdout
class OptsTests(BaseTestCase):
def test_something(self):
assert True
| import optparse
from skeletor.opts import Option
from .base import BaseTestCase
class OptsTests(BaseTestCase):
def should_raise_exception_when_require_used_incorrectly(self):
try:
Option('-n', '--does_not_take_val', action="store_true",
default=None, required=True)
... | Test for custom option class | Test for custom option class
| Python | bsd-3-clause | krak3n/Facio,krak3n/Facio,krak3n/Facio,krak3n/Facio,krak3n/Facio | import sys
from skeletor import config
from skeletor.config import Config
from .base import BaseTestCase
from .helpers import nostdout
class OptsTests(BaseTestCase):
def test_something(self):
assert True
Test for custom option class | import optparse
from skeletor.opts import Option
from .base import BaseTestCase
class OptsTests(BaseTestCase):
def should_raise_exception_when_require_used_incorrectly(self):
try:
Option('-n', '--does_not_take_val', action="store_true",
default=None, required=True)
... | <commit_before>import sys
from skeletor import config
from skeletor.config import Config
from .base import BaseTestCase
from .helpers import nostdout
class OptsTests(BaseTestCase):
def test_something(self):
assert True
<commit_msg>Test for custom option class<commit_after> | import optparse
from skeletor.opts import Option
from .base import BaseTestCase
class OptsTests(BaseTestCase):
def should_raise_exception_when_require_used_incorrectly(self):
try:
Option('-n', '--does_not_take_val', action="store_true",
default=None, required=True)
... | import sys
from skeletor import config
from skeletor.config import Config
from .base import BaseTestCase
from .helpers import nostdout
class OptsTests(BaseTestCase):
def test_something(self):
assert True
Test for custom option classimport optparse
from skeletor.opts import Option
from .base import Ba... | <commit_before>import sys
from skeletor import config
from skeletor.config import Config
from .base import BaseTestCase
from .helpers import nostdout
class OptsTests(BaseTestCase):
def test_something(self):
assert True
<commit_msg>Test for custom option class<commit_after>import optparse
from skeletor... |
80c3d7693b17f38c80b2e1a06716969a8ef11adf | tests/test_simple_features.py | tests/test_simple_features.py | from wordgraph.points import Point
import wordgraph
EPOCH_START = 1407109280
def time_values(values, start=EPOCH_START, increment=1):
datapoints = []
for index, value in enumerate(values):
datapoints.append(Point(x=value, y=start + (increment * index)))
return datapoints
def test_monotonic_up_per... | from wordgraph.points import Point
import wordgraph
EPOCH_START = 1407109280
def time_values(values, start=EPOCH_START, increment=1):
datapoints = []
for index, value in enumerate(values):
datapoints.append(Point(x=value, y=start + (increment * index)))
return datapoints
def test_monotonic_up_per... | Test case for tent map time series | Test case for tent map time series
Generate a time series with both a monionically increase and decreasing
sections.
| Python | apache-2.0 | tleeuwenburg/wordgraph,tleeuwenburg/wordgraph | from wordgraph.points import Point
import wordgraph
EPOCH_START = 1407109280
def time_values(values, start=EPOCH_START, increment=1):
datapoints = []
for index, value in enumerate(values):
datapoints.append(Point(x=value, y=start + (increment * index)))
return datapoints
def test_monotonic_up_per... | from wordgraph.points import Point
import wordgraph
EPOCH_START = 1407109280
def time_values(values, start=EPOCH_START, increment=1):
datapoints = []
for index, value in enumerate(values):
datapoints.append(Point(x=value, y=start + (increment * index)))
return datapoints
def test_monotonic_up_per... | <commit_before>from wordgraph.points import Point
import wordgraph
EPOCH_START = 1407109280
def time_values(values, start=EPOCH_START, increment=1):
datapoints = []
for index, value in enumerate(values):
datapoints.append(Point(x=value, y=start + (increment * index)))
return datapoints
def test_m... | from wordgraph.points import Point
import wordgraph
EPOCH_START = 1407109280
def time_values(values, start=EPOCH_START, increment=1):
datapoints = []
for index, value in enumerate(values):
datapoints.append(Point(x=value, y=start + (increment * index)))
return datapoints
def test_monotonic_up_per... | from wordgraph.points import Point
import wordgraph
EPOCH_START = 1407109280
def time_values(values, start=EPOCH_START, increment=1):
datapoints = []
for index, value in enumerate(values):
datapoints.append(Point(x=value, y=start + (increment * index)))
return datapoints
def test_monotonic_up_per... | <commit_before>from wordgraph.points import Point
import wordgraph
EPOCH_START = 1407109280
def time_values(values, start=EPOCH_START, increment=1):
datapoints = []
for index, value in enumerate(values):
datapoints.append(Point(x=value, y=start + (increment * index)))
return datapoints
def test_m... |
6a940fbd0cc8c4e4a9f17423c593452d010b6883 | app/lib/query/__init__.py | app/lib/query/__init__.py | # -*- coding: utf-8 -*-
"""
Initialisation file for query directory.
"""
| # -*- coding: utf-8 -*-
"""
Initialisation file for query directory, relating to local database queries.
"""
| Update query init file docstring. | Update query init file docstring.
| Python | mit | MichaelCurrin/twitterverse,MichaelCurrin/twitterverse | # -*- coding: utf-8 -*-
"""
Initialisation file for query directory.
"""
Update query init file docstring. | # -*- coding: utf-8 -*-
"""
Initialisation file for query directory, relating to local database queries.
"""
| <commit_before># -*- coding: utf-8 -*-
"""
Initialisation file for query directory.
"""
<commit_msg>Update query init file docstring.<commit_after> | # -*- coding: utf-8 -*-
"""
Initialisation file for query directory, relating to local database queries.
"""
| # -*- coding: utf-8 -*-
"""
Initialisation file for query directory.
"""
Update query init file docstring.# -*- coding: utf-8 -*-
"""
Initialisation file for query directory, relating to local database queries.
"""
| <commit_before># -*- coding: utf-8 -*-
"""
Initialisation file for query directory.
"""
<commit_msg>Update query init file docstring.<commit_after># -*- coding: utf-8 -*-
"""
Initialisation file for query directory, relating to local database queries.
"""
|
3ebf82c7ef356de3c4d427cea3723737661522e8 | pinax/waitinglist/management/commands/mail_out_survey_links.py | pinax/waitinglist/management/commands/mail_out_survey_links.py | from django.conf import settings
from django.core.mail import EmailMessage
from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
from django.contrib.sites.models import Site
from ...models import WaitingListEntry, Survey
class Command(BaseCommand):
help = "Emai... | from django.conf import settings
from django.core.mail import EmailMessage
from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
from django.contrib.sites.models import Site
from ...models import WaitingListEntry, Survey
class Command(BaseCommand):
help = "Emai... | Fix paths in mail out email management command | Fix paths in mail out email management command
| Python | mit | pinax/pinax-waitinglist,pinax/pinax-waitinglist | from django.conf import settings
from django.core.mail import EmailMessage
from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
from django.contrib.sites.models import Site
from ...models import WaitingListEntry, Survey
class Command(BaseCommand):
help = "Emai... | from django.conf import settings
from django.core.mail import EmailMessage
from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
from django.contrib.sites.models import Site
from ...models import WaitingListEntry, Survey
class Command(BaseCommand):
help = "Emai... | <commit_before>from django.conf import settings
from django.core.mail import EmailMessage
from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
from django.contrib.sites.models import Site
from ...models import WaitingListEntry, Survey
class Command(BaseCommand):
... | from django.conf import settings
from django.core.mail import EmailMessage
from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
from django.contrib.sites.models import Site
from ...models import WaitingListEntry, Survey
class Command(BaseCommand):
help = "Emai... | from django.conf import settings
from django.core.mail import EmailMessage
from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
from django.contrib.sites.models import Site
from ...models import WaitingListEntry, Survey
class Command(BaseCommand):
help = "Emai... | <commit_before>from django.conf import settings
from django.core.mail import EmailMessage
from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
from django.contrib.sites.models import Site
from ...models import WaitingListEntry, Survey
class Command(BaseCommand):
... |
73c7161d4414a9259ee6123ee3d3540153f30b9e | purchase_edi_file/models/purchase_order_line.py | purchase_edi_file/models/purchase_order_line.py | # Copyright (C) 2021 Akretion (http://www.akretion.com).
from odoo import _, exceptions, models
class PurchaseOrderLine(models.Model):
_inherit = "purchase.order.line"
def _get_lines_by_profiles(self, partner):
profile_lines = {
key: self.env["purchase.order.line"]
for key i... | # Copyright (C) 2021 Akretion (http://www.akretion.com).
from odoo import _, exceptions, models
class PurchaseOrderLine(models.Model):
_inherit = "purchase.order.line"
def _get_lines_by_profiles(self, partner):
profile_lines = {
key: self.env["purchase.order.line"]
for key i... | Add qty when searching seller because even if not passed a verification is made by default in _select_seller | Add qty when searching seller because even if not passed a verification is made by default in _select_seller
| Python | agpl-3.0 | akretion/ak-odoo-incubator,akretion/ak-odoo-incubator,akretion/ak-odoo-incubator,akretion/ak-odoo-incubator | # Copyright (C) 2021 Akretion (http://www.akretion.com).
from odoo import _, exceptions, models
class PurchaseOrderLine(models.Model):
_inherit = "purchase.order.line"
def _get_lines_by_profiles(self, partner):
profile_lines = {
key: self.env["purchase.order.line"]
for key i... | # Copyright (C) 2021 Akretion (http://www.akretion.com).
from odoo import _, exceptions, models
class PurchaseOrderLine(models.Model):
_inherit = "purchase.order.line"
def _get_lines_by_profiles(self, partner):
profile_lines = {
key: self.env["purchase.order.line"]
for key i... | <commit_before># Copyright (C) 2021 Akretion (http://www.akretion.com).
from odoo import _, exceptions, models
class PurchaseOrderLine(models.Model):
_inherit = "purchase.order.line"
def _get_lines_by_profiles(self, partner):
profile_lines = {
key: self.env["purchase.order.line"]
... | # Copyright (C) 2021 Akretion (http://www.akretion.com).
from odoo import _, exceptions, models
class PurchaseOrderLine(models.Model):
_inherit = "purchase.order.line"
def _get_lines_by_profiles(self, partner):
profile_lines = {
key: self.env["purchase.order.line"]
for key i... | # Copyright (C) 2021 Akretion (http://www.akretion.com).
from odoo import _, exceptions, models
class PurchaseOrderLine(models.Model):
_inherit = "purchase.order.line"
def _get_lines_by_profiles(self, partner):
profile_lines = {
key: self.env["purchase.order.line"]
for key i... | <commit_before># Copyright (C) 2021 Akretion (http://www.akretion.com).
from odoo import _, exceptions, models
class PurchaseOrderLine(models.Model):
_inherit = "purchase.order.line"
def _get_lines_by_profiles(self, partner):
profile_lines = {
key: self.env["purchase.order.line"]
... |
701b935564521d64cc35dc51753493f4dc2782f6 | python/ql/test/library-tests/frameworks/django/SqlExecution.py | python/ql/test/library-tests/frameworks/django/SqlExecution.py | from django.db import connection, models
from django.db.models.expressions import RawSQL
def test_plain():
cursor = connection.cursor()
cursor.execute("some sql") # $getSql="some sql"
def test_context():
with connection.cursor() as cursor:
cursor.execute("some sql") # $getSql="some sql"
... | from django.db import connection, models
from django.db.models.expressions import RawSQL
def test_plain():
cursor = connection.cursor()
cursor.execute("some sql") # $getSql="some sql"
def test_context():
with connection.cursor() as cursor:
cursor.execute("some sql") # $getSql="some sql"
... | Add example of QuerySet chain (django) | Python: Add example of QuerySet chain (django)
| Python | mit | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | from django.db import connection, models
from django.db.models.expressions import RawSQL
def test_plain():
cursor = connection.cursor()
cursor.execute("some sql") # $getSql="some sql"
def test_context():
with connection.cursor() as cursor:
cursor.execute("some sql") # $getSql="some sql"
... | from django.db import connection, models
from django.db.models.expressions import RawSQL
def test_plain():
cursor = connection.cursor()
cursor.execute("some sql") # $getSql="some sql"
def test_context():
with connection.cursor() as cursor:
cursor.execute("some sql") # $getSql="some sql"
... | <commit_before>from django.db import connection, models
from django.db.models.expressions import RawSQL
def test_plain():
cursor = connection.cursor()
cursor.execute("some sql") # $getSql="some sql"
def test_context():
with connection.cursor() as cursor:
cursor.execute("some sql") # $getSql="s... | from django.db import connection, models
from django.db.models.expressions import RawSQL
def test_plain():
cursor = connection.cursor()
cursor.execute("some sql") # $getSql="some sql"
def test_context():
with connection.cursor() as cursor:
cursor.execute("some sql") # $getSql="some sql"
... | from django.db import connection, models
from django.db.models.expressions import RawSQL
def test_plain():
cursor = connection.cursor()
cursor.execute("some sql") # $getSql="some sql"
def test_context():
with connection.cursor() as cursor:
cursor.execute("some sql") # $getSql="some sql"
... | <commit_before>from django.db import connection, models
from django.db.models.expressions import RawSQL
def test_plain():
cursor = connection.cursor()
cursor.execute("some sql") # $getSql="some sql"
def test_context():
with connection.cursor() as cursor:
cursor.execute("some sql") # $getSql="s... |
3fe0313d67857ec302cc20e0cdc30d658e41dd97 | troposphere/ecr.py | troposphere/ecr.py | from . import AWSObject, AWSProperty, Tags
from .compat import policytypes
class LifecyclePolicy(AWSProperty):
props = {
'LifecyclePolicyText': (basestring, False),
'RegistryId': (basestring, False),
}
class Repository(AWSObject):
resource_type = "AWS::ECR::Repository"
props = {
... | # Copyright (c) 2012-2021, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 31.0.0
from . import AWSObject, AWSProperty, Tags
from .compat import policytypes
class PublicRepository(AWSObje... | Update ECR per 2020-12-18 and 2021-02-04 changes | Update ECR per 2020-12-18 and 2021-02-04 changes
| Python | bsd-2-clause | cloudtools/troposphere,cloudtools/troposphere | from . import AWSObject, AWSProperty, Tags
from .compat import policytypes
class LifecyclePolicy(AWSProperty):
props = {
'LifecyclePolicyText': (basestring, False),
'RegistryId': (basestring, False),
}
class Repository(AWSObject):
resource_type = "AWS::ECR::Repository"
props = {
... | # Copyright (c) 2012-2021, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 31.0.0
from . import AWSObject, AWSProperty, Tags
from .compat import policytypes
class PublicRepository(AWSObje... | <commit_before>from . import AWSObject, AWSProperty, Tags
from .compat import policytypes
class LifecyclePolicy(AWSProperty):
props = {
'LifecyclePolicyText': (basestring, False),
'RegistryId': (basestring, False),
}
class Repository(AWSObject):
resource_type = "AWS::ECR::Repository"
... | # Copyright (c) 2012-2021, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 31.0.0
from . import AWSObject, AWSProperty, Tags
from .compat import policytypes
class PublicRepository(AWSObje... | from . import AWSObject, AWSProperty, Tags
from .compat import policytypes
class LifecyclePolicy(AWSProperty):
props = {
'LifecyclePolicyText': (basestring, False),
'RegistryId': (basestring, False),
}
class Repository(AWSObject):
resource_type = "AWS::ECR::Repository"
props = {
... | <commit_before>from . import AWSObject, AWSProperty, Tags
from .compat import policytypes
class LifecyclePolicy(AWSProperty):
props = {
'LifecyclePolicyText': (basestring, False),
'RegistryId': (basestring, False),
}
class Repository(AWSObject):
resource_type = "AWS::ECR::Repository"
... |
5b7e2c7c4ad28634db9641a2b8c96f4d047ae503 | arim/fields.py | arim/fields.py | import re
from django import forms
mac_pattern = re.compile("^[0-9a-f]{12}$")
class MacAddrFormField(forms.CharField):
def __init__(self, *args, **kwargs):
kwargs['max_length'] = 17
super(MacAddrFormField, self).__init__(*args, **kwargs)
def clean(self, value):
value = super(MacAddr... | import re
from django import forms
mac_pattern = re.compile("^[0-9a-f]{12}$")
class MacAddrFormField(forms.CharField):
def __init__(self, *args, **kwargs):
kwargs['max_length'] = 17
super(MacAddrFormField, self).__init__(*args, **kwargs)
def clean(self, value):
value = super(MacAddr... | Revert "Properly handle non-hex characters in MAC" | Revert "Properly handle non-hex characters in MAC"
This reverts commit 2734a3f0212c722fb9fe3698dfea0dbd8a14faa7.
| Python | bsd-3-clause | OSU-Net/arim,drkitty/arim,OSU-Net/arim,drkitty/arim,drkitty/arim,OSU-Net/arim | import re
from django import forms
mac_pattern = re.compile("^[0-9a-f]{12}$")
class MacAddrFormField(forms.CharField):
def __init__(self, *args, **kwargs):
kwargs['max_length'] = 17
super(MacAddrFormField, self).__init__(*args, **kwargs)
def clean(self, value):
value = super(MacAddr... | import re
from django import forms
mac_pattern = re.compile("^[0-9a-f]{12}$")
class MacAddrFormField(forms.CharField):
def __init__(self, *args, **kwargs):
kwargs['max_length'] = 17
super(MacAddrFormField, self).__init__(*args, **kwargs)
def clean(self, value):
value = super(MacAddr... | <commit_before>import re
from django import forms
mac_pattern = re.compile("^[0-9a-f]{12}$")
class MacAddrFormField(forms.CharField):
def __init__(self, *args, **kwargs):
kwargs['max_length'] = 17
super(MacAddrFormField, self).__init__(*args, **kwargs)
def clean(self, value):
value ... | import re
from django import forms
mac_pattern = re.compile("^[0-9a-f]{12}$")
class MacAddrFormField(forms.CharField):
def __init__(self, *args, **kwargs):
kwargs['max_length'] = 17
super(MacAddrFormField, self).__init__(*args, **kwargs)
def clean(self, value):
value = super(MacAddr... | import re
from django import forms
mac_pattern = re.compile("^[0-9a-f]{12}$")
class MacAddrFormField(forms.CharField):
def __init__(self, *args, **kwargs):
kwargs['max_length'] = 17
super(MacAddrFormField, self).__init__(*args, **kwargs)
def clean(self, value):
value = super(MacAddr... | <commit_before>import re
from django import forms
mac_pattern = re.compile("^[0-9a-f]{12}$")
class MacAddrFormField(forms.CharField):
def __init__(self, *args, **kwargs):
kwargs['max_length'] = 17
super(MacAddrFormField, self).__init__(*args, **kwargs)
def clean(self, value):
value ... |
bd3dad98976d5e02c4a941ae3c687174db78781d | src/WebCatch/catchLink.py | src/WebCatch/catchLink.py | import requests
import re
import os
url = "https://www.autohome.com.cn/shanghai/"
urlBox = []
def catchURL(url):
file = requests.get(url,timeout=2)
data = file.content
links = re.findall(r'(https?://[^\s)";]+\.(\w|/)*)',str(data))
for i in links:
try:
currentURL = i[0]
i... | import requests
import re
import os
url = "https://www.autohome.com.cn/shanghai/"
urlBox = []
def catchURL(url):
file = requests.get(url,timeout=5)
data = file.content
links = re.findall(r'(https?://[^\s)";]+\.(\w|/)*)',str(data))
for i in links:
try:
currentURL = i[0]
i... | Put the crawled link into the database | Put the crawled link into the database
| Python | mit | zhaodjie/py_learning | import requests
import re
import os
url = "https://www.autohome.com.cn/shanghai/"
urlBox = []
def catchURL(url):
file = requests.get(url,timeout=2)
data = file.content
links = re.findall(r'(https?://[^\s)";]+\.(\w|/)*)',str(data))
for i in links:
try:
currentURL = i[0]
i... | import requests
import re
import os
url = "https://www.autohome.com.cn/shanghai/"
urlBox = []
def catchURL(url):
file = requests.get(url,timeout=5)
data = file.content
links = re.findall(r'(https?://[^\s)";]+\.(\w|/)*)',str(data))
for i in links:
try:
currentURL = i[0]
i... | <commit_before>import requests
import re
import os
url = "https://www.autohome.com.cn/shanghai/"
urlBox = []
def catchURL(url):
file = requests.get(url,timeout=2)
data = file.content
links = re.findall(r'(https?://[^\s)";]+\.(\w|/)*)',str(data))
for i in links:
try:
currentURL = i[0... | import requests
import re
import os
url = "https://www.autohome.com.cn/shanghai/"
urlBox = []
def catchURL(url):
file = requests.get(url,timeout=5)
data = file.content
links = re.findall(r'(https?://[^\s)";]+\.(\w|/)*)',str(data))
for i in links:
try:
currentURL = i[0]
i... | import requests
import re
import os
url = "https://www.autohome.com.cn/shanghai/"
urlBox = []
def catchURL(url):
file = requests.get(url,timeout=2)
data = file.content
links = re.findall(r'(https?://[^\s)";]+\.(\w|/)*)',str(data))
for i in links:
try:
currentURL = i[0]
i... | <commit_before>import requests
import re
import os
url = "https://www.autohome.com.cn/shanghai/"
urlBox = []
def catchURL(url):
file = requests.get(url,timeout=2)
data = file.content
links = re.findall(r'(https?://[^\s)";]+\.(\w|/)*)',str(data))
for i in links:
try:
currentURL = i[0... |
9d077b9c2d37b7cfc46849fe70c45b238806f134 | aiorest/__init__.py | aiorest/__init__.py | import collections
import re
import sys
__version__ = '0.1.2'
version = __version__ + ' , Python ' + sys.version
VersionInfo = collections.namedtuple('VersionInfo',
'major minor micro releaselevel serial')
def _parse_version(ver):
RE = (r'^(?P<major>\d+)\.(?P<minor>\d+)\.... | import collections
import re
import sys
__version__ = '0.1.2'
version = __version__ + ' , Python ' + sys.version
VersionInfo = collections.namedtuple('VersionInfo',
'major minor micro releaselevel serial')
def _parse_version(ver):
RE = (r'^(?P<major>\d+)\.(?P<minor>\d+)\.... | Make version format PEP 440 compatible | Make version format PEP 440 compatible
| Python | mit | aio-libs/aiorest | import collections
import re
import sys
__version__ = '0.1.2'
version = __version__ + ' , Python ' + sys.version
VersionInfo = collections.namedtuple('VersionInfo',
'major minor micro releaselevel serial')
def _parse_version(ver):
RE = (r'^(?P<major>\d+)\.(?P<minor>\d+)\.... | import collections
import re
import sys
__version__ = '0.1.2'
version = __version__ + ' , Python ' + sys.version
VersionInfo = collections.namedtuple('VersionInfo',
'major minor micro releaselevel serial')
def _parse_version(ver):
RE = (r'^(?P<major>\d+)\.(?P<minor>\d+)\.... | <commit_before>import collections
import re
import sys
__version__ = '0.1.2'
version = __version__ + ' , Python ' + sys.version
VersionInfo = collections.namedtuple('VersionInfo',
'major minor micro releaselevel serial')
def _parse_version(ver):
RE = (r'^(?P<major>\d+)\.(... | import collections
import re
import sys
__version__ = '0.1.2'
version = __version__ + ' , Python ' + sys.version
VersionInfo = collections.namedtuple('VersionInfo',
'major minor micro releaselevel serial')
def _parse_version(ver):
RE = (r'^(?P<major>\d+)\.(?P<minor>\d+)\.... | import collections
import re
import sys
__version__ = '0.1.2'
version = __version__ + ' , Python ' + sys.version
VersionInfo = collections.namedtuple('VersionInfo',
'major minor micro releaselevel serial')
def _parse_version(ver):
RE = (r'^(?P<major>\d+)\.(?P<minor>\d+)\.... | <commit_before>import collections
import re
import sys
__version__ = '0.1.2'
version = __version__ + ' , Python ' + sys.version
VersionInfo = collections.namedtuple('VersionInfo',
'major minor micro releaselevel serial')
def _parse_version(ver):
RE = (r'^(?P<major>\d+)\.(... |
cf4015104cd8043024e55de4bab2ef598d6209a9 | mhvdb2/resources/payments.py | mhvdb2/resources/payments.py | from mhvdb2.models import Payment, Entity
import re
from datetime import datetime
from peewee import DoesNotExist
def validate(amount, email, method, type, notes, reference):
errors = []
if not amount or not amount.isdigit() or int(amount) <= 0:
errors.append("Sorry, you need to provide a valid amoun... | from mhvdb2.models import Payment, Entity
import re
from datetime import datetime
from peewee import DoesNotExist
def validate(amount, email, method, type, notes, reference):
errors = []
if not amount or not amount.isdigit() or int(amount) <= 0:
errors.append("Sorry, you need to provide a valid amoun... | Return invalid if payment method is not supported yet | Return invalid if payment method is not supported yet
| Python | mit | makehackvoid/mhvdb2,makehackvoid/mhvdb2 | from mhvdb2.models import Payment, Entity
import re
from datetime import datetime
from peewee import DoesNotExist
def validate(amount, email, method, type, notes, reference):
errors = []
if not amount or not amount.isdigit() or int(amount) <= 0:
errors.append("Sorry, you need to provide a valid amoun... | from mhvdb2.models import Payment, Entity
import re
from datetime import datetime
from peewee import DoesNotExist
def validate(amount, email, method, type, notes, reference):
errors = []
if not amount or not amount.isdigit() or int(amount) <= 0:
errors.append("Sorry, you need to provide a valid amoun... | <commit_before>from mhvdb2.models import Payment, Entity
import re
from datetime import datetime
from peewee import DoesNotExist
def validate(amount, email, method, type, notes, reference):
errors = []
if not amount or not amount.isdigit() or int(amount) <= 0:
errors.append("Sorry, you need to provid... | from mhvdb2.models import Payment, Entity
import re
from datetime import datetime
from peewee import DoesNotExist
def validate(amount, email, method, type, notes, reference):
errors = []
if not amount or not amount.isdigit() or int(amount) <= 0:
errors.append("Sorry, you need to provide a valid amoun... | from mhvdb2.models import Payment, Entity
import re
from datetime import datetime
from peewee import DoesNotExist
def validate(amount, email, method, type, notes, reference):
errors = []
if not amount or not amount.isdigit() or int(amount) <= 0:
errors.append("Sorry, you need to provide a valid amoun... | <commit_before>from mhvdb2.models import Payment, Entity
import re
from datetime import datetime
from peewee import DoesNotExist
def validate(amount, email, method, type, notes, reference):
errors = []
if not amount or not amount.isdigit() or int(amount) <= 0:
errors.append("Sorry, you need to provid... |
545f688f0dd59df009e2392cbf27ef06865a4b89 | src/azure/cli/__main__.py | src/azure/cli/__main__.py | import sys
import azure.cli.main
from azure.cli._telemetry import init_telemetry, user_agrees_to_telemetry, telemetry_flush
try:
try:
if user_agrees_to_telemetry():
init_telemetry()
except Exception: #pylint: disable=broad-except
pass
sys.exit(azure.cli.main.main(sys.argv[1:... | import sys
import os
import azure.cli.main
from azure.cli._telemetry import init_telemetry, user_agrees_to_telemetry, telemetry_flush
try:
try:
if user_agrees_to_telemetry():
init_telemetry()
except Exception: #pylint: disable=broad-except
pass
args = sys.argv[1:]
#... | Speed up argument completions by not loading all command packages unless we have to... | Speed up argument completions by not loading all command packages unless we have to...
| Python | mit | yugangw-msft/azure-cli,BurtBiel/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,QingChenmsft/azure-cli,samedder/azure-cli,BurtBiel/azure-cli,yugangw-msft/azure-cli,samedder/azure-cli,QingChenmsft/azure-cli,samedder/azure-cli,QingChenmsft/azure-cli,QingChenmsft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure... | import sys
import azure.cli.main
from azure.cli._telemetry import init_telemetry, user_agrees_to_telemetry, telemetry_flush
try:
try:
if user_agrees_to_telemetry():
init_telemetry()
except Exception: #pylint: disable=broad-except
pass
sys.exit(azure.cli.main.main(sys.argv[1:... | import sys
import os
import azure.cli.main
from azure.cli._telemetry import init_telemetry, user_agrees_to_telemetry, telemetry_flush
try:
try:
if user_agrees_to_telemetry():
init_telemetry()
except Exception: #pylint: disable=broad-except
pass
args = sys.argv[1:]
#... | <commit_before>import sys
import azure.cli.main
from azure.cli._telemetry import init_telemetry, user_agrees_to_telemetry, telemetry_flush
try:
try:
if user_agrees_to_telemetry():
init_telemetry()
except Exception: #pylint: disable=broad-except
pass
sys.exit(azure.cli.main.m... | import sys
import os
import azure.cli.main
from azure.cli._telemetry import init_telemetry, user_agrees_to_telemetry, telemetry_flush
try:
try:
if user_agrees_to_telemetry():
init_telemetry()
except Exception: #pylint: disable=broad-except
pass
args = sys.argv[1:]
#... | import sys
import azure.cli.main
from azure.cli._telemetry import init_telemetry, user_agrees_to_telemetry, telemetry_flush
try:
try:
if user_agrees_to_telemetry():
init_telemetry()
except Exception: #pylint: disable=broad-except
pass
sys.exit(azure.cli.main.main(sys.argv[1:... | <commit_before>import sys
import azure.cli.main
from azure.cli._telemetry import init_telemetry, user_agrees_to_telemetry, telemetry_flush
try:
try:
if user_agrees_to_telemetry():
init_telemetry()
except Exception: #pylint: disable=broad-except
pass
sys.exit(azure.cli.main.m... |
e6ca7ef801115d16d809c563b657c3a63e828fb1 | corehq/apps/locations/management/commands/location_last_modified.py | corehq/apps/locations/management/commands/location_last_modified.py | from django.core.management.base import BaseCommand
from corehq.apps.locations.models import Location
from dimagi.utils.couch.database import iter_docs
from datetime import datetime
class Command(BaseCommand):
help = 'Populate last_modified field for locations'
def handle(self, *args, **options):
self... | from django.core.management.base import BaseCommand
from corehq.apps.locations.models import Location
from dimagi.utils.couch.database import iter_docs
from datetime import datetime
class Command(BaseCommand):
help = 'Populate last_modified field for locations'
def handle(self, *args, **options):
self... | Exclude psi domains or this takes forever | Exclude psi domains or this takes forever
| Python | bsd-3-clause | qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,SEL-Columbia/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,qedsoft... | from django.core.management.base import BaseCommand
from corehq.apps.locations.models import Location
from dimagi.utils.couch.database import iter_docs
from datetime import datetime
class Command(BaseCommand):
help = 'Populate last_modified field for locations'
def handle(self, *args, **options):
self... | from django.core.management.base import BaseCommand
from corehq.apps.locations.models import Location
from dimagi.utils.couch.database import iter_docs
from datetime import datetime
class Command(BaseCommand):
help = 'Populate last_modified field for locations'
def handle(self, *args, **options):
self... | <commit_before>from django.core.management.base import BaseCommand
from corehq.apps.locations.models import Location
from dimagi.utils.couch.database import iter_docs
from datetime import datetime
class Command(BaseCommand):
help = 'Populate last_modified field for locations'
def handle(self, *args, **options... | from django.core.management.base import BaseCommand
from corehq.apps.locations.models import Location
from dimagi.utils.couch.database import iter_docs
from datetime import datetime
class Command(BaseCommand):
help = 'Populate last_modified field for locations'
def handle(self, *args, **options):
self... | from django.core.management.base import BaseCommand
from corehq.apps.locations.models import Location
from dimagi.utils.couch.database import iter_docs
from datetime import datetime
class Command(BaseCommand):
help = 'Populate last_modified field for locations'
def handle(self, *args, **options):
self... | <commit_before>from django.core.management.base import BaseCommand
from corehq.apps.locations.models import Location
from dimagi.utils.couch.database import iter_docs
from datetime import datetime
class Command(BaseCommand):
help = 'Populate last_modified field for locations'
def handle(self, *args, **options... |
e2813d7c27079a259f542ff36383ec0aa2233a9e | spyder_terminal/__init__.py | spyder_terminal/__init__.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Spyder Te... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Spyder Te... | Set development version to v0.3.0.dev0 | Set development version to v0.3.0.dev0
| Python | mit | spyder-ide/spyder-terminal,spyder-ide/spyder-terminal,spyder-ide/spyder-terminal,spyder-ide/spyder-terminal | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Spyder Te... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Spyder Te... | <commit_before># -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# ---------------------------------------------------------------------------... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Spyder Te... | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# -----------------------------------------------------------------------------
"""Spyder Te... | <commit_before># -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
# ---------------------------------------------------------------------------... |
352cb871a86abd926842a0624475db1f2ee2c0ce | TorGTK/list_elements.py | TorGTK/list_elements.py | from var import *
from ui_elements import *
from gi.repository import Gtk
from torctl import *
# ORGANIZATION OF THESE LISTS:
# 1. Main list for all the elements
# 2. A sublist for each element, with the first being a label, and the second
# being the element itself
# List for main listbox
lb_main_elements = [
["... | from var import *
from ui_elements import *
from gi.repository import Gtk
from torctl import *
# ORGANIZATION OF THESE LISTS:
# 1. Main list for all the elements
# 2. A sublist for each element, with the first being a label, and the second
# being the element itself
# List for main listbox
lb_main_elements = [
["... | Add field (not working yet) for Tor exit node selection | Add field (not working yet) for Tor exit node selection
| Python | bsd-2-clause | neelchauhan/TorNova,neelchauhan/TorGTK | from var import *
from ui_elements import *
from gi.repository import Gtk
from torctl import *
# ORGANIZATION OF THESE LISTS:
# 1. Main list for all the elements
# 2. A sublist for each element, with the first being a label, and the second
# being the element itself
# List for main listbox
lb_main_elements = [
["... | from var import *
from ui_elements import *
from gi.repository import Gtk
from torctl import *
# ORGANIZATION OF THESE LISTS:
# 1. Main list for all the elements
# 2. A sublist for each element, with the first being a label, and the second
# being the element itself
# List for main listbox
lb_main_elements = [
["... | <commit_before>from var import *
from ui_elements import *
from gi.repository import Gtk
from torctl import *
# ORGANIZATION OF THESE LISTS:
# 1. Main list for all the elements
# 2. A sublist for each element, with the first being a label, and the second
# being the element itself
# List for main listbox
lb_main_e... | from var import *
from ui_elements import *
from gi.repository import Gtk
from torctl import *
# ORGANIZATION OF THESE LISTS:
# 1. Main list for all the elements
# 2. A sublist for each element, with the first being a label, and the second
# being the element itself
# List for main listbox
lb_main_elements = [
["... | from var import *
from ui_elements import *
from gi.repository import Gtk
from torctl import *
# ORGANIZATION OF THESE LISTS:
# 1. Main list for all the elements
# 2. A sublist for each element, with the first being a label, and the second
# being the element itself
# List for main listbox
lb_main_elements = [
["... | <commit_before>from var import *
from ui_elements import *
from gi.repository import Gtk
from torctl import *
# ORGANIZATION OF THESE LISTS:
# 1. Main list for all the elements
# 2. A sublist for each element, with the first being a label, and the second
# being the element itself
# List for main listbox
lb_main_e... |
3f136f153cdc60c1dcc757a8a35ef116bb892a1c | python/prep_policekml.py | python/prep_policekml.py | """
A collection of classes used to manipulate Police KML data, used with prepgml4ogr.py.
"""
import os
from lxml import etree
class prep_kml():
def __init__ (self, inputfile):
self.inputfile = inputfile
self.infile = os.path.basename(inputfile)
self.feat_types = ['Placemark']
def get... | """
prep_kml class used to manipulate police.uk KML data, used with prepgml4ogr.py
"""
import os
from lxml import etree
class prep_kml():
def __init__(self, inputfile):
self.inputfile = inputfile
self.infile = os.path.basename(inputfile)
self.feat_types = ['Placemark']
def get_feat_t... | Remove stray comment, update docstring and minor PEP8 changes | Remove stray comment, update docstring and minor PEP8 changes
| Python | mit | AstunTechnology/Loader | """
A collection of classes used to manipulate Police KML data, used with prepgml4ogr.py.
"""
import os
from lxml import etree
class prep_kml():
def __init__ (self, inputfile):
self.inputfile = inputfile
self.infile = os.path.basename(inputfile)
self.feat_types = ['Placemark']
def get... | """
prep_kml class used to manipulate police.uk KML data, used with prepgml4ogr.py
"""
import os
from lxml import etree
class prep_kml():
def __init__(self, inputfile):
self.inputfile = inputfile
self.infile = os.path.basename(inputfile)
self.feat_types = ['Placemark']
def get_feat_t... | <commit_before>"""
A collection of classes used to manipulate Police KML data, used with prepgml4ogr.py.
"""
import os
from lxml import etree
class prep_kml():
def __init__ (self, inputfile):
self.inputfile = inputfile
self.infile = os.path.basename(inputfile)
self.feat_types = ['Placemark... | """
prep_kml class used to manipulate police.uk KML data, used with prepgml4ogr.py
"""
import os
from lxml import etree
class prep_kml():
def __init__(self, inputfile):
self.inputfile = inputfile
self.infile = os.path.basename(inputfile)
self.feat_types = ['Placemark']
def get_feat_t... | """
A collection of classes used to manipulate Police KML data, used with prepgml4ogr.py.
"""
import os
from lxml import etree
class prep_kml():
def __init__ (self, inputfile):
self.inputfile = inputfile
self.infile = os.path.basename(inputfile)
self.feat_types = ['Placemark']
def get... | <commit_before>"""
A collection of classes used to manipulate Police KML data, used with prepgml4ogr.py.
"""
import os
from lxml import etree
class prep_kml():
def __init__ (self, inputfile):
self.inputfile = inputfile
self.infile = os.path.basename(inputfile)
self.feat_types = ['Placemark... |
3ebf7f1633a072cd09f006910660373527d335bb | project_template/project_settings.py | project_template/project_settings.py | # Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `project_settings_local.py`
from icekit.project.settings.icekit import * # glamkit, icekit
# Override the defa... | # Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `project_settings_local.py`
from icekit.project.settings.glamkit import * # glamkit, icekit
# Override the def... | Use glamkit settings as default in glamkit branch. | Use glamkit settings as default in glamkit branch.
| Python | mit | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | # Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `project_settings_local.py`
from icekit.project.settings.icekit import * # glamkit, icekit
# Override the defa... | # Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `project_settings_local.py`
from icekit.project.settings.glamkit import * # glamkit, icekit
# Override the def... | <commit_before># Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `project_settings_local.py`
from icekit.project.settings.icekit import * # glamkit, icekit
# Ov... | # Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `project_settings_local.py`
from icekit.project.settings.glamkit import * # glamkit, icekit
# Override the def... | # Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `project_settings_local.py`
from icekit.project.settings.icekit import * # glamkit, icekit
# Override the defa... | <commit_before># Do not commit secrets to VCS.
# Local environment variables will be loaded from `.env.local`.
# Additional environment variables will be loaded from `.env.$DOTENV`.
# Local settings will be imported from `project_settings_local.py`
from icekit.project.settings.icekit import * # glamkit, icekit
# Ov... |
fe65e85e0a29341a6eebbb1bafb28b8d1225abfc | harvester/rq_worker_sns_msgs.py | harvester/rq_worker_sns_msgs.py | '''A custom rq worker class to add start & stop SNS messages to all jobs'''
import logging
from rq.worker import Worker
from harvester.sns_message import publish_to_harvesting
logger = logging.getLogger(__name__)
class SNSWorker(Worker):
def execute_job(self, job, queue):
"""Spawns a work horse to perfo... | '''A custom rq worker class to add start & stop SNS messages to all jobs'''
import logging
from rq.worker import Worker
from harvester.sns_message import publish_to_harvesting
logger = logging.getLogger(__name__)
def exception_to_sns(job, *exc_info):
'''Make an exception handler to report exceptions to SNS msg ... | Add RQ exception handler to report to SNS topic | Add RQ exception handler to report to SNS topic
| Python | bsd-3-clause | mredar/harvester,barbarahui/harvester,barbarahui/harvester,mredar/harvester,ucldc/harvester,ucldc/harvester | '''A custom rq worker class to add start & stop SNS messages to all jobs'''
import logging
from rq.worker import Worker
from harvester.sns_message import publish_to_harvesting
logger = logging.getLogger(__name__)
class SNSWorker(Worker):
def execute_job(self, job, queue):
"""Spawns a work horse to perfo... | '''A custom rq worker class to add start & stop SNS messages to all jobs'''
import logging
from rq.worker import Worker
from harvester.sns_message import publish_to_harvesting
logger = logging.getLogger(__name__)
def exception_to_sns(job, *exc_info):
'''Make an exception handler to report exceptions to SNS msg ... | <commit_before>'''A custom rq worker class to add start & stop SNS messages to all jobs'''
import logging
from rq.worker import Worker
from harvester.sns_message import publish_to_harvesting
logger = logging.getLogger(__name__)
class SNSWorker(Worker):
def execute_job(self, job, queue):
"""Spawns a work... | '''A custom rq worker class to add start & stop SNS messages to all jobs'''
import logging
from rq.worker import Worker
from harvester.sns_message import publish_to_harvesting
logger = logging.getLogger(__name__)
def exception_to_sns(job, *exc_info):
'''Make an exception handler to report exceptions to SNS msg ... | '''A custom rq worker class to add start & stop SNS messages to all jobs'''
import logging
from rq.worker import Worker
from harvester.sns_message import publish_to_harvesting
logger = logging.getLogger(__name__)
class SNSWorker(Worker):
def execute_job(self, job, queue):
"""Spawns a work horse to perfo... | <commit_before>'''A custom rq worker class to add start & stop SNS messages to all jobs'''
import logging
from rq.worker import Worker
from harvester.sns_message import publish_to_harvesting
logger = logging.getLogger(__name__)
class SNSWorker(Worker):
def execute_job(self, job, queue):
"""Spawns a work... |
e27088976467dd95ad2672123cb39dd54b78f413 | blog/models.py | blog/models.py | from django.db import models
from django.template.defaultfilters import slugify
from django.core.urlresolvers import reverse_lazy
class Category(models.Model):
title = models.CharField(max_length=80)
class Meta:
verbose_name_plural = 'categories'
def __unicode__(self):
return self.title
... | from django.db import models
from django.core.exceptions import ValidationError
from django.template.defaultfilters import slugify
from django.core.urlresolvers import reverse_lazy
def validate_no_commas(value):
if ',' in value:
raise ValidationError('%s contains commas' % value)
class Category(models.Mod... | Add validation in category and get_slug in post | Add validation in category and get_slug in post
| Python | mit | jmcomets/jmcomets.github.io | from django.db import models
from django.template.defaultfilters import slugify
from django.core.urlresolvers import reverse_lazy
class Category(models.Model):
title = models.CharField(max_length=80)
class Meta:
verbose_name_plural = 'categories'
def __unicode__(self):
return self.title
... | from django.db import models
from django.core.exceptions import ValidationError
from django.template.defaultfilters import slugify
from django.core.urlresolvers import reverse_lazy
def validate_no_commas(value):
if ',' in value:
raise ValidationError('%s contains commas' % value)
class Category(models.Mod... | <commit_before>from django.db import models
from django.template.defaultfilters import slugify
from django.core.urlresolvers import reverse_lazy
class Category(models.Model):
title = models.CharField(max_length=80)
class Meta:
verbose_name_plural = 'categories'
def __unicode__(self):
retu... | from django.db import models
from django.core.exceptions import ValidationError
from django.template.defaultfilters import slugify
from django.core.urlresolvers import reverse_lazy
def validate_no_commas(value):
if ',' in value:
raise ValidationError('%s contains commas' % value)
class Category(models.Mod... | from django.db import models
from django.template.defaultfilters import slugify
from django.core.urlresolvers import reverse_lazy
class Category(models.Model):
title = models.CharField(max_length=80)
class Meta:
verbose_name_plural = 'categories'
def __unicode__(self):
return self.title
... | <commit_before>from django.db import models
from django.template.defaultfilters import slugify
from django.core.urlresolvers import reverse_lazy
class Category(models.Model):
title = models.CharField(max_length=80)
class Meta:
verbose_name_plural = 'categories'
def __unicode__(self):
retu... |
f9c178e641fa27b6c0c2bf32a969c52ba17042bf | blockbuster/bb_logging.py | blockbuster/bb_logging.py | import logging
import logging.handlers
# ######### Set up logging ##########
# log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
logger = logging.getLogger('bb_log')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
tfh = logging.handlers.TimedRotat... | import logging
import logging.handlers
# ######### Set up logging ##########
# log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
logger = logging.getLogger('bb_log')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
tfh = logging.handlers.TimedRotat... | Update log output so that it works more nicely with ELK | Update log output so that it works more nicely with ELK
| Python | mit | mattstibbs/blockbuster-server,mattstibbs/blockbuster-server | import logging
import logging.handlers
# ######### Set up logging ##########
# log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
logger = logging.getLogger('bb_log')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
tfh = logging.handlers.TimedRotat... | import logging
import logging.handlers
# ######### Set up logging ##########
# log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
logger = logging.getLogger('bb_log')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
tfh = logging.handlers.TimedRotat... | <commit_before>import logging
import logging.handlers
# ######### Set up logging ##########
# log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
logger = logging.getLogger('bb_log')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
tfh = logging.hand... | import logging
import logging.handlers
# ######### Set up logging ##########
# log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
logger = logging.getLogger('bb_log')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
tfh = logging.handlers.TimedRotat... | import logging
import logging.handlers
# ######### Set up logging ##########
# log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
logger = logging.getLogger('bb_log')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
tfh = logging.handlers.TimedRotat... | <commit_before>import logging
import logging.handlers
# ######### Set up logging ##########
# log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
logger = logging.getLogger('bb_log')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
tfh = logging.hand... |
eff3195097e9599b87f5cec9bbae744b91ae16cf | buses/utils.py | buses/utils.py | import re
def minify(template_source):
template_source = re.sub(r'(\n *)+', '\n', template_source)
template_source = re.sub(r'({%.+%})\n+', r'\1', template_source)
return template_source
| import re
from haystack.utils import default_get_identifier
def minify(template_source):
template_source = re.sub(r'(\n *)+', '\n', template_source)
template_source = re.sub(r'({%.+%})\n+', r'\1', template_source)
return template_source
def get_identifier(obj_or_string):
if isinstance(obj_or_string, ... | Add custom Hastack get_identifier function | Add custom Hastack get_identifier function
| Python | mpl-2.0 | jclgoodwin/bustimes.org.uk,jclgoodwin/bustimes.org.uk,stev-0/bustimes.org.uk,stev-0/bustimes.org.uk,stev-0/bustimes.org.uk,stev-0/bustimes.org.uk,stev-0/bustimes.org.uk,jclgoodwin/bustimes.org.uk,jclgoodwin/bustimes.org.uk | import re
def minify(template_source):
template_source = re.sub(r'(\n *)+', '\n', template_source)
template_source = re.sub(r'({%.+%})\n+', r'\1', template_source)
return template_source
Add custom Hastack get_identifier function | import re
from haystack.utils import default_get_identifier
def minify(template_source):
template_source = re.sub(r'(\n *)+', '\n', template_source)
template_source = re.sub(r'({%.+%})\n+', r'\1', template_source)
return template_source
def get_identifier(obj_or_string):
if isinstance(obj_or_string, ... | <commit_before>import re
def minify(template_source):
template_source = re.sub(r'(\n *)+', '\n', template_source)
template_source = re.sub(r'({%.+%})\n+', r'\1', template_source)
return template_source
<commit_msg>Add custom Hastack get_identifier function<commit_after> | import re
from haystack.utils import default_get_identifier
def minify(template_source):
template_source = re.sub(r'(\n *)+', '\n', template_source)
template_source = re.sub(r'({%.+%})\n+', r'\1', template_source)
return template_source
def get_identifier(obj_or_string):
if isinstance(obj_or_string, ... | import re
def minify(template_source):
template_source = re.sub(r'(\n *)+', '\n', template_source)
template_source = re.sub(r'({%.+%})\n+', r'\1', template_source)
return template_source
Add custom Hastack get_identifier functionimport re
from haystack.utils import default_get_identifier
def minify(temp... | <commit_before>import re
def minify(template_source):
template_source = re.sub(r'(\n *)+', '\n', template_source)
template_source = re.sub(r'({%.+%})\n+', r'\1', template_source)
return template_source
<commit_msg>Add custom Hastack get_identifier function<commit_after>import re
from haystack.utils import... |
303923dd287014551e4b542a9300a13ecebfa2f9 | registration/__init__.py | registration/__init__.py | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_backend():
"""
Return an instance of the registration backend for use on this
site, as determined by the ``REGISTRATION_BACKEND`` setting. Raise
``django.cor... | Add utility function for retrieving the active registration backend. | Add utility function for retrieving the active registration backend.
| Python | bsd-3-clause | dinie/django-registration,Avenza/django-registration,FundedByMe/django-registration,FundedByMe/django-registration,dinie/django-registration | Add utility function for retrieving the active registration backend. | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_backend():
"""
Return an instance of the registration backend for use on this
site, as determined by the ``REGISTRATION_BACKEND`` setting. Raise
``django.cor... | <commit_before><commit_msg>Add utility function for retrieving the active registration backend.<commit_after> | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_backend():
"""
Return an instance of the registration backend for use on this
site, as determined by the ``REGISTRATION_BACKEND`` setting. Raise
``django.cor... | Add utility function for retrieving the active registration backend.from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_backend():
"""
Return an instance of the registration backend for use on this
site, as determ... | <commit_before><commit_msg>Add utility function for retrieving the active registration backend.<commit_after>from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_backend():
"""
Return an instance of the registration ba... | |
b9a7289c1f3466bb0caee1488a16dafbae327c6f | tartpy/eventloop.py | tartpy/eventloop.py | """
Very basic implementation of an event loop
==========================================
The eventloop is a singleton to schedule and run events.
Exports
-------
- ``EventLoop``: the basic eventloop
"""
import queue
import sched
import threading
import time
from .singleton import Singleton
class EventLoop(obj... | """
Very basic implementation of an event loop
==========================================
The eventloop is a singleton to schedule and run events.
Exports
-------
- ``EventLoop``: the basic eventloop
"""
import queue
import sched
import threading
import time
from .singleton import Singleton
class EventLoop(obj... | Fix threaded run of the new event loop | Fix threaded run of the new event loop | Python | mit | waltermoreira/tartpy | """
Very basic implementation of an event loop
==========================================
The eventloop is a singleton to schedule and run events.
Exports
-------
- ``EventLoop``: the basic eventloop
"""
import queue
import sched
import threading
import time
from .singleton import Singleton
class EventLoop(obj... | """
Very basic implementation of an event loop
==========================================
The eventloop is a singleton to schedule and run events.
Exports
-------
- ``EventLoop``: the basic eventloop
"""
import queue
import sched
import threading
import time
from .singleton import Singleton
class EventLoop(obj... | <commit_before>"""
Very basic implementation of an event loop
==========================================
The eventloop is a singleton to schedule and run events.
Exports
-------
- ``EventLoop``: the basic eventloop
"""
import queue
import sched
import threading
import time
from .singleton import Singleton
clas... | """
Very basic implementation of an event loop
==========================================
The eventloop is a singleton to schedule and run events.
Exports
-------
- ``EventLoop``: the basic eventloop
"""
import queue
import sched
import threading
import time
from .singleton import Singleton
class EventLoop(obj... | """
Very basic implementation of an event loop
==========================================
The eventloop is a singleton to schedule and run events.
Exports
-------
- ``EventLoop``: the basic eventloop
"""
import queue
import sched
import threading
import time
from .singleton import Singleton
class EventLoop(obj... | <commit_before>"""
Very basic implementation of an event loop
==========================================
The eventloop is a singleton to schedule and run events.
Exports
-------
- ``EventLoop``: the basic eventloop
"""
import queue
import sched
import threading
import time
from .singleton import Singleton
clas... |
ae42042d38d4f53a88a25cb4dc18ad86f23c0f28 | derrida/__init__.py | derrida/__init__.py | __version_info__ = (1, 3, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environ... | __version_info__ = (1, 2, 2, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | Set version to 1.2.2 final | Set version to 1.2.2 final
| Python | apache-2.0 | Princeton-CDH/derrida-django,Princeton-CDH/derrida-django,Princeton-CDH/derrida-django,Princeton-CDH/derrida-django | __version_info__ = (1, 3, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environ... | __version_info__ = (1, 2, 2, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | <commit_before>__version_info__ = (1, 3, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the t... | __version_info__ = (1, 2, 2, None)
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environm... | __version_info__ = (1, 3, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the template environ... | <commit_before>__version_info__ = (1, 3, 0, 'dev')
# Dot-connect all but the last. Last is dash-connected if not None.
__version__ = '.'.join([str(i) for i in __version_info__[:-1]])
if __version_info__[-1] is not None:
__version__ += ('-%s' % (__version_info__[-1],))
# context processor to add version to the t... |
3409aa543b4f0a4c574afd7ff4fdd59d1bd8a4b0 | tests/date_tests.py | tests/date_tests.py | # -*- coding: utf-8 -*-
#
# (C) Pywikibot team, 2014
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
from tests.utils import unittest
from pywikibot import date
class TestDate(unittest.TestCase):
"""Test cases for date library"""
def __init__(self, formatname):
super(Test... | # -*- coding: utf-8 -*-
#
# (C) Pywikibot team, 2014
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
from tests.utils import unittest
from pywikibot import date
class TestDate(unittest.TestCase):
"""Test cases for date library"""
def testMapEntry(self):
"""Test the validi... | Revert "Progressing dots to show test is running" | Revert "Progressing dots to show test is running"
Breaks tests; https://travis-ci.org/wikimedia/pywikibot-core/builds/26752150
This reverts commit 93379dbf499c58438917728b74862f282c15dba4.
Change-Id: Iacb4cc9e6999d265b46c558ed3999c1198f87de0
| Python | mit | hasteur/g13bot_tools_new,smalyshev/pywikibot-core,h4ck3rm1k3/pywikibot-core,TridevGuha/pywikibot-core,npdoty/pywikibot,icyflame/batman,valhallasw/pywikibot-core,darthbhyrava/pywikibot-local,hasteur/g13bot_tools_new,xZise/pywikibot-core,npdoty/pywikibot,magul/pywikibot-core,happy5214/pywikibot-core,VcamX/pywikibot-core,... | # -*- coding: utf-8 -*-
#
# (C) Pywikibot team, 2014
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
from tests.utils import unittest
from pywikibot import date
class TestDate(unittest.TestCase):
"""Test cases for date library"""
def __init__(self, formatname):
super(Test... | # -*- coding: utf-8 -*-
#
# (C) Pywikibot team, 2014
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
from tests.utils import unittest
from pywikibot import date
class TestDate(unittest.TestCase):
"""Test cases for date library"""
def testMapEntry(self):
"""Test the validi... | <commit_before># -*- coding: utf-8 -*-
#
# (C) Pywikibot team, 2014
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
from tests.utils import unittest
from pywikibot import date
class TestDate(unittest.TestCase):
"""Test cases for date library"""
def __init__(self, formatname):
... | # -*- coding: utf-8 -*-
#
# (C) Pywikibot team, 2014
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
from tests.utils import unittest
from pywikibot import date
class TestDate(unittest.TestCase):
"""Test cases for date library"""
def testMapEntry(self):
"""Test the validi... | # -*- coding: utf-8 -*-
#
# (C) Pywikibot team, 2014
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
from tests.utils import unittest
from pywikibot import date
class TestDate(unittest.TestCase):
"""Test cases for date library"""
def __init__(self, formatname):
super(Test... | <commit_before># -*- coding: utf-8 -*-
#
# (C) Pywikibot team, 2014
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
from tests.utils import unittest
from pywikibot import date
class TestDate(unittest.TestCase):
"""Test cases for date library"""
def __init__(self, formatname):
... |
9fbef73081b0cb608e32c91a57502aaefa0599cc | tests/test_basic.py | tests/test_basic.py | import unittest
import os, sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.append(os.path.join(PROJECT_ROOT, ".."))
from CodeConverter import CodeConverter
class TestBasic(unittest.TestCase):
def setUp(self):
pass
def test_initialize(self):
self.assertEqual(CodeConverter('foo').s, 'foo... | import unittest
import os, sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.append(os.path.join(PROJECT_ROOT, ".."))
from CodeConverter import CodeConverter
class TestBasic(unittest.TestCase):
def setUp(self):
pass
def test_initialize(self):
self.assertEqual(CodeConverter('foo').s, 'foo... | Add test to check python version | Add test to check python version
| Python | mit | kyamaguchi/SublimeObjC2RubyMotion,kyamaguchi/SublimeObjC2RubyMotion | import unittest
import os, sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.append(os.path.join(PROJECT_ROOT, ".."))
from CodeConverter import CodeConverter
class TestBasic(unittest.TestCase):
def setUp(self):
pass
def test_initialize(self):
self.assertEqual(CodeConverter('foo').s, 'foo... | import unittest
import os, sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.append(os.path.join(PROJECT_ROOT, ".."))
from CodeConverter import CodeConverter
class TestBasic(unittest.TestCase):
def setUp(self):
pass
def test_initialize(self):
self.assertEqual(CodeConverter('foo').s, 'foo... | <commit_before>import unittest
import os, sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.append(os.path.join(PROJECT_ROOT, ".."))
from CodeConverter import CodeConverter
class TestBasic(unittest.TestCase):
def setUp(self):
pass
def test_initialize(self):
self.assertEqual(CodeConverter... | import unittest
import os, sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.append(os.path.join(PROJECT_ROOT, ".."))
from CodeConverter import CodeConverter
class TestBasic(unittest.TestCase):
def setUp(self):
pass
def test_initialize(self):
self.assertEqual(CodeConverter('foo').s, 'foo... | import unittest
import os, sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.append(os.path.join(PROJECT_ROOT, ".."))
from CodeConverter import CodeConverter
class TestBasic(unittest.TestCase):
def setUp(self):
pass
def test_initialize(self):
self.assertEqual(CodeConverter('foo').s, 'foo... | <commit_before>import unittest
import os, sys
PROJECT_ROOT = os.path.dirname(__file__)
sys.path.append(os.path.join(PROJECT_ROOT, ".."))
from CodeConverter import CodeConverter
class TestBasic(unittest.TestCase):
def setUp(self):
pass
def test_initialize(self):
self.assertEqual(CodeConverter... |
5d6206f42323c9fd5e4185f36e75a2466adf79e8 | thinc/neural/_classes/feed_forward.py | thinc/neural/_classes/feed_forward.py | from .model import Model
class FeedForward(Model):
'''A feed-forward network, that chains multiple Model instances together.'''
def __init__(self, layers, **kwargs):
Model.__init__(self, **kwargs)
self.layers.extend(layers)
if self.layers:
nO = self.layers[0].output_shape[1... | from .model import Model
from ... import describe
def _run_child_hooks(model, X, y):
for layer in model._layers:
for hook in layer.on_data_hooks:
hook(layer, X, y)
@describe.on_data(_run_child_hooks)
class FeedForward(Model):
'''A feed-forward network, that chains multiple Model instances ... | Improve how child hooks are run in FeedForward | Improve how child hooks are run in FeedForward
| Python | mit | explosion/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc | from .model import Model
class FeedForward(Model):
'''A feed-forward network, that chains multiple Model instances together.'''
def __init__(self, layers, **kwargs):
Model.__init__(self, **kwargs)
self.layers.extend(layers)
if self.layers:
nO = self.layers[0].output_shape[1... | from .model import Model
from ... import describe
def _run_child_hooks(model, X, y):
for layer in model._layers:
for hook in layer.on_data_hooks:
hook(layer, X, y)
@describe.on_data(_run_child_hooks)
class FeedForward(Model):
'''A feed-forward network, that chains multiple Model instances ... | <commit_before>from .model import Model
class FeedForward(Model):
'''A feed-forward network, that chains multiple Model instances together.'''
def __init__(self, layers, **kwargs):
Model.__init__(self, **kwargs)
self.layers.extend(layers)
if self.layers:
nO = self.layers[0]... | from .model import Model
from ... import describe
def _run_child_hooks(model, X, y):
for layer in model._layers:
for hook in layer.on_data_hooks:
hook(layer, X, y)
@describe.on_data(_run_child_hooks)
class FeedForward(Model):
'''A feed-forward network, that chains multiple Model instances ... | from .model import Model
class FeedForward(Model):
'''A feed-forward network, that chains multiple Model instances together.'''
def __init__(self, layers, **kwargs):
Model.__init__(self, **kwargs)
self.layers.extend(layers)
if self.layers:
nO = self.layers[0].output_shape[1... | <commit_before>from .model import Model
class FeedForward(Model):
'''A feed-forward network, that chains multiple Model instances together.'''
def __init__(self, layers, **kwargs):
Model.__init__(self, **kwargs)
self.layers.extend(layers)
if self.layers:
nO = self.layers[0]... |
741db5b16922ceca0c23a95caa143f9ff7baeee2 | Api/app/types.py | Api/app/types.py | import graphene
from graphene_django import DjangoObjectType
from app import models
class TagType(DjangoObjectType):
class Meta:
model = models.Tag
interfaces = (graphene.relay.Node,)
@classmethod
def get_node(cls, id, context, info):
return models.Tag.objects.get(pk=id)
class... | import graphene
from graphene_django import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from app import models
class TagType(DjangoObjectType):
class Meta:
model = models.Tag
interfaces = (graphene.relay.Node,)
articles = DjangoFilterConnectionField(lambda... | Fix tag and article connections | Fix tag and article connections
| Python | mit | rcatlin/ryancatlin-info,rcatlin/ryancatlin-info,rcatlin/ryancatlin-info,rcatlin/ryancatlin-info | import graphene
from graphene_django import DjangoObjectType
from app import models
class TagType(DjangoObjectType):
class Meta:
model = models.Tag
interfaces = (graphene.relay.Node,)
@classmethod
def get_node(cls, id, context, info):
return models.Tag.objects.get(pk=id)
class... | import graphene
from graphene_django import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from app import models
class TagType(DjangoObjectType):
class Meta:
model = models.Tag
interfaces = (graphene.relay.Node,)
articles = DjangoFilterConnectionField(lambda... | <commit_before>import graphene
from graphene_django import DjangoObjectType
from app import models
class TagType(DjangoObjectType):
class Meta:
model = models.Tag
interfaces = (graphene.relay.Node,)
@classmethod
def get_node(cls, id, context, info):
return models.Tag.objects.get... | import graphene
from graphene_django import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from app import models
class TagType(DjangoObjectType):
class Meta:
model = models.Tag
interfaces = (graphene.relay.Node,)
articles = DjangoFilterConnectionField(lambda... | import graphene
from graphene_django import DjangoObjectType
from app import models
class TagType(DjangoObjectType):
class Meta:
model = models.Tag
interfaces = (graphene.relay.Node,)
@classmethod
def get_node(cls, id, context, info):
return models.Tag.objects.get(pk=id)
class... | <commit_before>import graphene
from graphene_django import DjangoObjectType
from app import models
class TagType(DjangoObjectType):
class Meta:
model = models.Tag
interfaces = (graphene.relay.Node,)
@classmethod
def get_node(cls, id, context, info):
return models.Tag.objects.get... |
d98ecce6e83db415338f946bfab5191f5671550e | numba/typesystem/__init__.py | numba/typesystem/__init__.py | from basetypes import *
from exttypes import *
from closuretypes import *
from ssatypes import *
from templatetypes import *
from typemapper import *
__all__ = minitypes.__all__ + [
'O', 'b1', 'i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8',
'f4', 'f8', 'f16', 'c8', 'c16', 'c32', 'template',
]
#---------------... | from basetypes import *
from exttypes import *
from closuretypes import *
from ssatypes import *
from templatetypes import *
from typemapper import *
__all__ = minitypes.__all__ + [
'O', 'b1', 'i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8',
'f4', 'f8', 'f16', 'c8', 'c16', 'c32', 'template',
]
#---------------... | Use the right float names for type shortcuts | Use the right float names for type shortcuts
| Python | bsd-2-clause | stefanseefeld/numba,stonebig/numba,stefanseefeld/numba,pombredanne/numba,pitrou/numba,seibert/numba,GaZ3ll3/numba,pitrou/numba,numba/numba,cpcloud/numba,IntelLabs/numba,stefanseefeld/numba,numba/numba,pombredanne/numba,stonebig/numba,jriehl/numba,GaZ3ll3/numba,gmarkall/numba,seibert/numba,stefanseefeld/numba,gmarkall/n... | from basetypes import *
from exttypes import *
from closuretypes import *
from ssatypes import *
from templatetypes import *
from typemapper import *
__all__ = minitypes.__all__ + [
'O', 'b1', 'i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8',
'f4', 'f8', 'f16', 'c8', 'c16', 'c32', 'template',
]
#---------------... | from basetypes import *
from exttypes import *
from closuretypes import *
from ssatypes import *
from templatetypes import *
from typemapper import *
__all__ = minitypes.__all__ + [
'O', 'b1', 'i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8',
'f4', 'f8', 'f16', 'c8', 'c16', 'c32', 'template',
]
#---------------... | <commit_before>from basetypes import *
from exttypes import *
from closuretypes import *
from ssatypes import *
from templatetypes import *
from typemapper import *
__all__ = minitypes.__all__ + [
'O', 'b1', 'i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8',
'f4', 'f8', 'f16', 'c8', 'c16', 'c32', 'template',
]
#... | from basetypes import *
from exttypes import *
from closuretypes import *
from ssatypes import *
from templatetypes import *
from typemapper import *
__all__ = minitypes.__all__ + [
'O', 'b1', 'i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8',
'f4', 'f8', 'f16', 'c8', 'c16', 'c32', 'template',
]
#---------------... | from basetypes import *
from exttypes import *
from closuretypes import *
from ssatypes import *
from templatetypes import *
from typemapper import *
__all__ = minitypes.__all__ + [
'O', 'b1', 'i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8',
'f4', 'f8', 'f16', 'c8', 'c16', 'c32', 'template',
]
#---------------... | <commit_before>from basetypes import *
from exttypes import *
from closuretypes import *
from ssatypes import *
from templatetypes import *
from typemapper import *
__all__ = minitypes.__all__ + [
'O', 'b1', 'i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8',
'f4', 'f8', 'f16', 'c8', 'c16', 'c32', 'template',
]
#... |
379c083be77ba5373881f84adf7d2a8e87e930f4 | birdy/dependencies.py | birdy/dependencies.py | # -*- coding: utf-8 -*-
"""
This module is used to manage optional dependencies.
Example usage::
from birdy.dependencies import ipywidgets as widgets
"""
import warnings
from .exceptions import IPythonWarning
# TODO: we ignore warnings for now. They are only needed when birdy is used in a notebook,
# but we cu... | # -*- coding: utf-8 -*-
"""
This module is used to manage optional dependencies.
Example usage::
from birdy.dependencies import ipywidgets as widgets
"""
import warnings
from .exceptions import IPythonWarning
# TODO: we ignore warnings for now. They are only needed when birdy is used in a notebook,
# but we cu... | Fix unused import flag by codacy | Fix unused import flag by codacy
| Python | apache-2.0 | bird-house/birdy | # -*- coding: utf-8 -*-
"""
This module is used to manage optional dependencies.
Example usage::
from birdy.dependencies import ipywidgets as widgets
"""
import warnings
from .exceptions import IPythonWarning
# TODO: we ignore warnings for now. They are only needed when birdy is used in a notebook,
# but we cu... | # -*- coding: utf-8 -*-
"""
This module is used to manage optional dependencies.
Example usage::
from birdy.dependencies import ipywidgets as widgets
"""
import warnings
from .exceptions import IPythonWarning
# TODO: we ignore warnings for now. They are only needed when birdy is used in a notebook,
# but we cu... | <commit_before># -*- coding: utf-8 -*-
"""
This module is used to manage optional dependencies.
Example usage::
from birdy.dependencies import ipywidgets as widgets
"""
import warnings
from .exceptions import IPythonWarning
# TODO: we ignore warnings for now. They are only needed when birdy is used in a notebo... | # -*- coding: utf-8 -*-
"""
This module is used to manage optional dependencies.
Example usage::
from birdy.dependencies import ipywidgets as widgets
"""
import warnings
from .exceptions import IPythonWarning
# TODO: we ignore warnings for now. They are only needed when birdy is used in a notebook,
# but we cu... | # -*- coding: utf-8 -*-
"""
This module is used to manage optional dependencies.
Example usage::
from birdy.dependencies import ipywidgets as widgets
"""
import warnings
from .exceptions import IPythonWarning
# TODO: we ignore warnings for now. They are only needed when birdy is used in a notebook,
# but we cu... | <commit_before># -*- coding: utf-8 -*-
"""
This module is used to manage optional dependencies.
Example usage::
from birdy.dependencies import ipywidgets as widgets
"""
import warnings
from .exceptions import IPythonWarning
# TODO: we ignore warnings for now. They are only needed when birdy is used in a notebo... |
d7d2361bb27c8649e38b61b65ba193e5ea716ed5 | blog/posts/helpers.py | blog/posts/helpers.py | from models import Post
def get_post_url(post):
post_year = str(post.publication_date.year)
post_month = '%02d' % post.publication_date.month
post_title = post.title
url = u'/blog/' + post_year + '/' + post_month + '/' + post_title + '/'
return url
def post_as_components(post_text):
''' This f... | from models import Post
from django.core.urlresolvers import reverse
def get_post_url(post):
post_year = str(post.publication_date.year)
post_month = '%02d' % post.publication_date.month
post_title = post.title
#url = u'/blog/' + post_year + '/' + post_month + '/' + post_title + '/'
url = reverse('... | Use named urls for get_post_url(). | Use named urls for get_post_url().
The helper should not assume knowledge of the post url structure.
| Python | mit | Lukasa/minimalog | from models import Post
def get_post_url(post):
post_year = str(post.publication_date.year)
post_month = '%02d' % post.publication_date.month
post_title = post.title
url = u'/blog/' + post_year + '/' + post_month + '/' + post_title + '/'
return url
def post_as_components(post_text):
''' This f... | from models import Post
from django.core.urlresolvers import reverse
def get_post_url(post):
post_year = str(post.publication_date.year)
post_month = '%02d' % post.publication_date.month
post_title = post.title
#url = u'/blog/' + post_year + '/' + post_month + '/' + post_title + '/'
url = reverse('... | <commit_before>from models import Post
def get_post_url(post):
post_year = str(post.publication_date.year)
post_month = '%02d' % post.publication_date.month
post_title = post.title
url = u'/blog/' + post_year + '/' + post_month + '/' + post_title + '/'
return url
def post_as_components(post_text):... | from models import Post
from django.core.urlresolvers import reverse
def get_post_url(post):
post_year = str(post.publication_date.year)
post_month = '%02d' % post.publication_date.month
post_title = post.title
#url = u'/blog/' + post_year + '/' + post_month + '/' + post_title + '/'
url = reverse('... | from models import Post
def get_post_url(post):
post_year = str(post.publication_date.year)
post_month = '%02d' % post.publication_date.month
post_title = post.title
url = u'/blog/' + post_year + '/' + post_month + '/' + post_title + '/'
return url
def post_as_components(post_text):
''' This f... | <commit_before>from models import Post
def get_post_url(post):
post_year = str(post.publication_date.year)
post_month = '%02d' % post.publication_date.month
post_title = post.title
url = u'/blog/' + post_year + '/' + post_month + '/' + post_title + '/'
return url
def post_as_components(post_text):... |
77a6bb72318e9b02cbb1179cbbbacd3dd0bad55f | bookstore/__init__.py | bookstore/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Bookstore
Stores IPython notebooks automagically onto OpenStack clouds through Swift.
'''
__title__ = 'bookstore'
__version__ = '1.0.0'
__build__ = 0x010000
__author__ = 'Kyle Kelley'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2013 Kyle Kelley'
from . impo... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Bookstore
Stores IPython notebooks automagically onto OpenStack clouds through Swift.
'''
__title__ = 'bookstore'
__version__ = '1.0.0'
__build__ = 0x010000
__author__ = 'Kyle Kelley'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2013 Kyle Kelley'
#from . imp... | Add unit test for bookstore | Add unit test for bookstore
| Python | apache-2.0 | wusung/ipython-notebook-store | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Bookstore
Stores IPython notebooks automagically onto OpenStack clouds through Swift.
'''
__title__ = 'bookstore'
__version__ = '1.0.0'
__build__ = 0x010000
__author__ = 'Kyle Kelley'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2013 Kyle Kelley'
from . impo... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Bookstore
Stores IPython notebooks automagically onto OpenStack clouds through Swift.
'''
__title__ = 'bookstore'
__version__ = '1.0.0'
__build__ = 0x010000
__author__ = 'Kyle Kelley'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2013 Kyle Kelley'
#from . imp... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Bookstore
Stores IPython notebooks automagically onto OpenStack clouds through Swift.
'''
__title__ = 'bookstore'
__version__ = '1.0.0'
__build__ = 0x010000
__author__ = 'Kyle Kelley'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2013 Kyle Kelle... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Bookstore
Stores IPython notebooks automagically onto OpenStack clouds through Swift.
'''
__title__ = 'bookstore'
__version__ = '1.0.0'
__build__ = 0x010000
__author__ = 'Kyle Kelley'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2013 Kyle Kelley'
#from . imp... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Bookstore
Stores IPython notebooks automagically onto OpenStack clouds through Swift.
'''
__title__ = 'bookstore'
__version__ = '1.0.0'
__build__ = 0x010000
__author__ = 'Kyle Kelley'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2013 Kyle Kelley'
from . impo... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Bookstore
Stores IPython notebooks automagically onto OpenStack clouds through Swift.
'''
__title__ = 'bookstore'
__version__ = '1.0.0'
__build__ = 0x010000
__author__ = 'Kyle Kelley'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2013 Kyle Kelle... |
14b9ed3052054cf983fe6b7b1903faca3f1a0a13 | couchdb/tests/testutil.py | couchdb/tests/testutil.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import uuid
from couchdb import client
class TempDatabaseMixin(object):
temp_dbs = None
_d... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import random
import sys
from couchdb import client
class TempDatabaseMixin(object):
temp_dbs ... | Use a random number instead of uuid for temp database name. | Use a random number instead of uuid for temp database name.
| Python | bsd-3-clause | djc/couchdb-python,djc/couchdb-python,infinit/couchdb-python,Roger/couchdb-python | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import uuid
from couchdb import client
class TempDatabaseMixin(object):
temp_dbs = None
_d... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import random
import sys
from couchdb import client
class TempDatabaseMixin(object):
temp_dbs ... | <commit_before># -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import uuid
from couchdb import client
class TempDatabaseMixin(object):
temp_db... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import random
import sys
from couchdb import client
class TempDatabaseMixin(object):
temp_dbs ... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import uuid
from couchdb import client
class TempDatabaseMixin(object):
temp_dbs = None
_d... | <commit_before># -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import uuid
from couchdb import client
class TempDatabaseMixin(object):
temp_db... |
ee5cf0b47d50904061daf62c33741d50b848f02b | feature_extraction.py | feature_extraction.py | from PIL import Image
import glob
def _get_rectangle_masks():
TRAIN_MASKS = './data/train/*_mask.tif'
rectangle_masks = []
for file_name in glob.glob(TRAIN_MASKS):
image = Image.open(file_name)
rectangle_mask = ((0,0), (0,0))
mask_coord = [(i-image.width*(i/image.width), i/image.wi... | from PIL import Image
import glob
def _get_masks():
TRAIN_MASKS = './data/train/*_mask.tif'
return [Image.open(file_name) for file_name in glob.glob(TRAIN_MASKS)]
def _get_rectangle_masks():
rectangle_masks = []
for image in _get_masks():
rectangle_mask = ((0,0), (0,0))
mask_coord = ... | Move mask gathering to it's own function | Move mask gathering to it's own function
| Python | mit | Brok-Bucholtz/Ultrasound-Nerve-Segmentation | from PIL import Image
import glob
def _get_rectangle_masks():
TRAIN_MASKS = './data/train/*_mask.tif'
rectangle_masks = []
for file_name in glob.glob(TRAIN_MASKS):
image = Image.open(file_name)
rectangle_mask = ((0,0), (0,0))
mask_coord = [(i-image.width*(i/image.width), i/image.wi... | from PIL import Image
import glob
def _get_masks():
TRAIN_MASKS = './data/train/*_mask.tif'
return [Image.open(file_name) for file_name in glob.glob(TRAIN_MASKS)]
def _get_rectangle_masks():
rectangle_masks = []
for image in _get_masks():
rectangle_mask = ((0,0), (0,0))
mask_coord = ... | <commit_before>from PIL import Image
import glob
def _get_rectangle_masks():
TRAIN_MASKS = './data/train/*_mask.tif'
rectangle_masks = []
for file_name in glob.glob(TRAIN_MASKS):
image = Image.open(file_name)
rectangle_mask = ((0,0), (0,0))
mask_coord = [(i-image.width*(i/image.wid... | from PIL import Image
import glob
def _get_masks():
TRAIN_MASKS = './data/train/*_mask.tif'
return [Image.open(file_name) for file_name in glob.glob(TRAIN_MASKS)]
def _get_rectangle_masks():
rectangle_masks = []
for image in _get_masks():
rectangle_mask = ((0,0), (0,0))
mask_coord = ... | from PIL import Image
import glob
def _get_rectangle_masks():
TRAIN_MASKS = './data/train/*_mask.tif'
rectangle_masks = []
for file_name in glob.glob(TRAIN_MASKS):
image = Image.open(file_name)
rectangle_mask = ((0,0), (0,0))
mask_coord = [(i-image.width*(i/image.width), i/image.wi... | <commit_before>from PIL import Image
import glob
def _get_rectangle_masks():
TRAIN_MASKS = './data/train/*_mask.tif'
rectangle_masks = []
for file_name in glob.glob(TRAIN_MASKS):
image = Image.open(file_name)
rectangle_mask = ((0,0), (0,0))
mask_coord = [(i-image.width*(i/image.wid... |
d28cb58c91e1282569eaa4f3f4d99f50d6e23ceb | clippings/__init__.py | clippings/__init__.py | """Python module to manipulate Kindle clippings files."""
__version__ = '0.3.0'
| """Python module to manipulate Kindle clippings files."""
__version__ = '0.4.0'
| Set correct version in package | Set correct version in package
| Python | mit | samueldg/clippings | """Python module to manipulate Kindle clippings files."""
__version__ = '0.3.0'
Set correct version in package | """Python module to manipulate Kindle clippings files."""
__version__ = '0.4.0'
| <commit_before>"""Python module to manipulate Kindle clippings files."""
__version__ = '0.3.0'
<commit_msg>Set correct version in package<commit_after> | """Python module to manipulate Kindle clippings files."""
__version__ = '0.4.0'
| """Python module to manipulate Kindle clippings files."""
__version__ = '0.3.0'
Set correct version in package"""Python module to manipulate Kindle clippings files."""
__version__ = '0.4.0'
| <commit_before>"""Python module to manipulate Kindle clippings files."""
__version__ = '0.3.0'
<commit_msg>Set correct version in package<commit_after>"""Python module to manipulate Kindle clippings files."""
__version__ = '0.4.0'
|
a1b4afc062b246dc347526202ef00a43992afa28 | code/kmeans.py | code/kmeans.py | #returns the distance between two data points
def distance(X, Y):
d = 0
for row in range(len(X)):
for col in range(len(X[row]):
if X[row][col] != Y[row][col]:
d += 1
return d
#partitions the data into the sets closest to each centroid
def fit(data, centroids):
pass
#returns k centroids which... | from random import randint
from copy import deepcopy
from parse import parse
#In this file, I am assuming that the 6 metadata entries at the front of each
# raw data point hae been stripped off during initial parsing.
#returns the distance between two data points
def distance(X, Y):
assert(len(X) == len(Y))
d... | Add helper to find representative centroid of a subset of data, add helper to generate initial k centroid intelligently | Add helper to find representative centroid of a subset of data, add helper to generate initial k centroid intelligently
| Python | mit | mkaplan218/clusterverify | #returns the distance between two data points
def distance(X, Y):
d = 0
for row in range(len(X)):
for col in range(len(X[row]):
if X[row][col] != Y[row][col]:
d += 1
return d
#partitions the data into the sets closest to each centroid
def fit(data, centroids):
pass
#returns k centroids which... | from random import randint
from copy import deepcopy
from parse import parse
#In this file, I am assuming that the 6 metadata entries at the front of each
# raw data point hae been stripped off during initial parsing.
#returns the distance between two data points
def distance(X, Y):
assert(len(X) == len(Y))
d... | <commit_before>#returns the distance between two data points
def distance(X, Y):
d = 0
for row in range(len(X)):
for col in range(len(X[row]):
if X[row][col] != Y[row][col]:
d += 1
return d
#partitions the data into the sets closest to each centroid
def fit(data, centroids):
pass
#returns k ... | from random import randint
from copy import deepcopy
from parse import parse
#In this file, I am assuming that the 6 metadata entries at the front of each
# raw data point hae been stripped off during initial parsing.
#returns the distance between two data points
def distance(X, Y):
assert(len(X) == len(Y))
d... | #returns the distance between two data points
def distance(X, Y):
d = 0
for row in range(len(X)):
for col in range(len(X[row]):
if X[row][col] != Y[row][col]:
d += 1
return d
#partitions the data into the sets closest to each centroid
def fit(data, centroids):
pass
#returns k centroids which... | <commit_before>#returns the distance between two data points
def distance(X, Y):
d = 0
for row in range(len(X)):
for col in range(len(X[row]):
if X[row][col] != Y[row][col]:
d += 1
return d
#partitions the data into the sets closest to each centroid
def fit(data, centroids):
pass
#returns k ... |
1c26d3e2237d731024fe5c9494c2da7e0867653d | inonemonth/challenges/serializers.py | inonemonth/challenges/serializers.py | from rest_framework import serializers
from .models import Challenge, Role
from core.serializers import UserSerializer
#from comments.serializers import HeadCommentSerializer, TailCommentSerializer
class ChallengeSerializer(serializers.ModelSerializer):
#role_set = serializers.HyperlinkedRelatedField(view_name=... | from rest_framework import serializers
from .models import Challenge, Role
from core.serializers import UserSerializer
#from comments.serializers import HeadCommentSerializer, TailCommentSerializer
class ChallengeSerializer(serializers.ModelSerializer):
#role_set = serializers.HyperlinkedRelatedField(view_name=... | Correct repo field name in serializer | Correct repo field name in serializer
| Python | mit | robrechtdr/inonemonth,robrechtdr/inonemonth,robrechtdr/inonemonth,robrechtdr/inonemonth | from rest_framework import serializers
from .models import Challenge, Role
from core.serializers import UserSerializer
#from comments.serializers import HeadCommentSerializer, TailCommentSerializer
class ChallengeSerializer(serializers.ModelSerializer):
#role_set = serializers.HyperlinkedRelatedField(view_name=... | from rest_framework import serializers
from .models import Challenge, Role
from core.serializers import UserSerializer
#from comments.serializers import HeadCommentSerializer, TailCommentSerializer
class ChallengeSerializer(serializers.ModelSerializer):
#role_set = serializers.HyperlinkedRelatedField(view_name=... | <commit_before>from rest_framework import serializers
from .models import Challenge, Role
from core.serializers import UserSerializer
#from comments.serializers import HeadCommentSerializer, TailCommentSerializer
class ChallengeSerializer(serializers.ModelSerializer):
#role_set = serializers.HyperlinkedRelatedF... | from rest_framework import serializers
from .models import Challenge, Role
from core.serializers import UserSerializer
#from comments.serializers import HeadCommentSerializer, TailCommentSerializer
class ChallengeSerializer(serializers.ModelSerializer):
#role_set = serializers.HyperlinkedRelatedField(view_name=... | from rest_framework import serializers
from .models import Challenge, Role
from core.serializers import UserSerializer
#from comments.serializers import HeadCommentSerializer, TailCommentSerializer
class ChallengeSerializer(serializers.ModelSerializer):
#role_set = serializers.HyperlinkedRelatedField(view_name=... | <commit_before>from rest_framework import serializers
from .models import Challenge, Role
from core.serializers import UserSerializer
#from comments.serializers import HeadCommentSerializer, TailCommentSerializer
class ChallengeSerializer(serializers.ModelSerializer):
#role_set = serializers.HyperlinkedRelatedF... |
cd6429cd177e550d047408cc212b64648e0cbe6c | calc_cov.py | calc_cov.py | import mne
import sys
from mne import compute_covariance
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from my_settings import *
reject = dict(grad=4000e-13, # T / m (gradiometers)
mag=4e-12, # T (magnetometers)
eeg=180e-6 #
)
subject = sys.ar... | import mne
import sys
from mne import compute_covariance
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from my_settings import *
subject = sys.argv[1]
epochs = mne.read_epochs(epochs_folder + "%s_trial_start-epo.fif" % subject)
epochs.drop_bad_epochs(reject=reject_params)
fig = epochs.pl... | Clean up and change cov time | Clean up and change cov time
| Python | bsd-3-clause | MadsJensen/CAA,MadsJensen/CAA | import mne
import sys
from mne import compute_covariance
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from my_settings import *
reject = dict(grad=4000e-13, # T / m (gradiometers)
mag=4e-12, # T (magnetometers)
eeg=180e-6 #
)
subject = sys.ar... | import mne
import sys
from mne import compute_covariance
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from my_settings import *
subject = sys.argv[1]
epochs = mne.read_epochs(epochs_folder + "%s_trial_start-epo.fif" % subject)
epochs.drop_bad_epochs(reject=reject_params)
fig = epochs.pl... | <commit_before>import mne
import sys
from mne import compute_covariance
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from my_settings import *
reject = dict(grad=4000e-13, # T / m (gradiometers)
mag=4e-12, # T (magnetometers)
eeg=180e-6 #
)
s... | import mne
import sys
from mne import compute_covariance
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from my_settings import *
subject = sys.argv[1]
epochs = mne.read_epochs(epochs_folder + "%s_trial_start-epo.fif" % subject)
epochs.drop_bad_epochs(reject=reject_params)
fig = epochs.pl... | import mne
import sys
from mne import compute_covariance
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from my_settings import *
reject = dict(grad=4000e-13, # T / m (gradiometers)
mag=4e-12, # T (magnetometers)
eeg=180e-6 #
)
subject = sys.ar... | <commit_before>import mne
import sys
from mne import compute_covariance
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from my_settings import *
reject = dict(grad=4000e-13, # T / m (gradiometers)
mag=4e-12, # T (magnetometers)
eeg=180e-6 #
)
s... |
666952b40005bf1695b5a5473c05d2e4b066f240 | reporter/reporter/reports/briccs/data_quality/blank_study_id.py | reporter/reporter/reports/briccs/data_quality/blank_study_id.py | #!/usr/bin/env python3
from reporter.reports import Report, Schedule
from reporter import get_case_link, RECIPIENT_BRICCS_ADMIN
class BriccsCivcrmBlankStudyId(Report):
def __init__(self):
super().__init__(
introduction=("The following participants have a blank "
... | #!/usr/bin/env python3
from reporter.reports import Report, Schedule
from reporter import get_case_link, RECIPIENT_BRICCS_DQ
class BriccsCivcrmBlankStudyId(Report):
def __init__(self):
super().__init__(
introduction=("The following participants have a blank "
... | Send to DQ not admin | Send to DQ not admin
| Python | mit | LCBRU/reporter,LCBRU/reporter | #!/usr/bin/env python3
from reporter.reports import Report, Schedule
from reporter import get_case_link, RECIPIENT_BRICCS_ADMIN
class BriccsCivcrmBlankStudyId(Report):
def __init__(self):
super().__init__(
introduction=("The following participants have a blank "
... | #!/usr/bin/env python3
from reporter.reports import Report, Schedule
from reporter import get_case_link, RECIPIENT_BRICCS_DQ
class BriccsCivcrmBlankStudyId(Report):
def __init__(self):
super().__init__(
introduction=("The following participants have a blank "
... | <commit_before>#!/usr/bin/env python3
from reporter.reports import Report, Schedule
from reporter import get_case_link, RECIPIENT_BRICCS_ADMIN
class BriccsCivcrmBlankStudyId(Report):
def __init__(self):
super().__init__(
introduction=("The following participants have a blank "
... | #!/usr/bin/env python3
from reporter.reports import Report, Schedule
from reporter import get_case_link, RECIPIENT_BRICCS_DQ
class BriccsCivcrmBlankStudyId(Report):
def __init__(self):
super().__init__(
introduction=("The following participants have a blank "
... | #!/usr/bin/env python3
from reporter.reports import Report, Schedule
from reporter import get_case_link, RECIPIENT_BRICCS_ADMIN
class BriccsCivcrmBlankStudyId(Report):
def __init__(self):
super().__init__(
introduction=("The following participants have a blank "
... | <commit_before>#!/usr/bin/env python3
from reporter.reports import Report, Schedule
from reporter import get_case_link, RECIPIENT_BRICCS_ADMIN
class BriccsCivcrmBlankStudyId(Report):
def __init__(self):
super().__init__(
introduction=("The following participants have a blank "
... |
bfd34a7aaf903c823d41068173c09bc5b1a251bc | test/sasdataloader/test/utest_sesans.py | test/sasdataloader/test/utest_sesans.py | """
Unit tests for the SESANS .ses reader
"""
import unittest
from sas.sascalc.dataloader.loader import Loader
import os.path
class sesans_reader(unittest.TestCase):
def setUp(self):
self.loader = Loader()
def test_sesans_load(self):
"""
Test .SES file loading
"""
... | """
Unit tests for the SESANS .ses reader
"""
import unittest
from sas.sascalc.dataloader.loader import Loader
import os.path
class sesans_reader(unittest.TestCase):
def setUp(self):
self.loader = Loader()
def test_sesans_load(self):
"""
Test .SES file loading
"""
... | Test that .SES files are tagged as Sesans | Test that .SES files are tagged as Sesans
| Python | bsd-3-clause | lewisodriscoll/sasview,lewisodriscoll/sasview,SasView/sasview,lewisodriscoll/sasview,SasView/sasview,SasView/sasview,SasView/sasview,lewisodriscoll/sasview,SasView/sasview,SasView/sasview,lewisodriscoll/sasview | """
Unit tests for the SESANS .ses reader
"""
import unittest
from sas.sascalc.dataloader.loader import Loader
import os.path
class sesans_reader(unittest.TestCase):
def setUp(self):
self.loader = Loader()
def test_sesans_load(self):
"""
Test .SES file loading
"""
... | """
Unit tests for the SESANS .ses reader
"""
import unittest
from sas.sascalc.dataloader.loader import Loader
import os.path
class sesans_reader(unittest.TestCase):
def setUp(self):
self.loader = Loader()
def test_sesans_load(self):
"""
Test .SES file loading
"""
... | <commit_before>"""
Unit tests for the SESANS .ses reader
"""
import unittest
from sas.sascalc.dataloader.loader import Loader
import os.path
class sesans_reader(unittest.TestCase):
def setUp(self):
self.loader = Loader()
def test_sesans_load(self):
"""
Test .SES file loading... | """
Unit tests for the SESANS .ses reader
"""
import unittest
from sas.sascalc.dataloader.loader import Loader
import os.path
class sesans_reader(unittest.TestCase):
def setUp(self):
self.loader = Loader()
def test_sesans_load(self):
"""
Test .SES file loading
"""
... | """
Unit tests for the SESANS .ses reader
"""
import unittest
from sas.sascalc.dataloader.loader import Loader
import os.path
class sesans_reader(unittest.TestCase):
def setUp(self):
self.loader = Loader()
def test_sesans_load(self):
"""
Test .SES file loading
"""
... | <commit_before>"""
Unit tests for the SESANS .ses reader
"""
import unittest
from sas.sascalc.dataloader.loader import Loader
import os.path
class sesans_reader(unittest.TestCase):
def setUp(self):
self.loader = Loader()
def test_sesans_load(self):
"""
Test .SES file loading... |
8581fae9a70571ed19a97078b7de87eeae8b7033 | data/models.py | data/models.py | from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=200)
exact_name = models.CharField(max_length=600, null=True, blank=True)
options = models.CharField(max_length=100)
occupied = models.FloatField()
virtual = models.FloatField()
homo_orbital = model... | Add model to store log data | Add model to store log data
| Python | mit | crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp | Add model to store log data | from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=200)
exact_name = models.CharField(max_length=600, null=True, blank=True)
options = models.CharField(max_length=100)
occupied = models.FloatField()
virtual = models.FloatField()
homo_orbital = model... | <commit_before><commit_msg>Add model to store log data<commit_after> | from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=200)
exact_name = models.CharField(max_length=600, null=True, blank=True)
options = models.CharField(max_length=100)
occupied = models.FloatField()
virtual = models.FloatField()
homo_orbital = model... | Add model to store log datafrom django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=200)
exact_name = models.CharField(max_length=600, null=True, blank=True)
options = models.CharField(max_length=100)
occupied = models.FloatField()
virtual = models.FloatField... | <commit_before><commit_msg>Add model to store log data<commit_after>from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=200)
exact_name = models.CharField(max_length=600, null=True, blank=True)
options = models.CharField(max_length=100)
occupied = models.Flo... | |
d0aba6489a96003c9a746bd38818cffa717d1469 | akatsuki/bib2html.py | akatsuki/bib2html.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from akatsuki.exporter import export_html
from akatsuki.parser import load_bibtex_file
from akatsuki.utils import sort_by_date
def main(bibtex_file, html_file):
"""Load BibTeX file and export to HTML file"""
entries = load... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from akatsuki.exporter import export_html
from akatsuki.parser import load_bibtex_file
from akatsuki.utils import pmid_to_url, sort_by_date
def main(bibtex_file, html_file):
"""Load BibTeX file and export to HTML file"""
e... | Add pmid to url convertion | Add pmid to url convertion
| Python | mit | 403JFW/akatsuki | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from akatsuki.exporter import export_html
from akatsuki.parser import load_bibtex_file
from akatsuki.utils import sort_by_date
def main(bibtex_file, html_file):
"""Load BibTeX file and export to HTML file"""
entries = load... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from akatsuki.exporter import export_html
from akatsuki.parser import load_bibtex_file
from akatsuki.utils import pmid_to_url, sort_by_date
def main(bibtex_file, html_file):
"""Load BibTeX file and export to HTML file"""
e... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from akatsuki.exporter import export_html
from akatsuki.parser import load_bibtex_file
from akatsuki.utils import sort_by_date
def main(bibtex_file, html_file):
"""Load BibTeX file and export to HTML file"""
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from akatsuki.exporter import export_html
from akatsuki.parser import load_bibtex_file
from akatsuki.utils import pmid_to_url, sort_by_date
def main(bibtex_file, html_file):
"""Load BibTeX file and export to HTML file"""
e... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from akatsuki.exporter import export_html
from akatsuki.parser import load_bibtex_file
from akatsuki.utils import sort_by_date
def main(bibtex_file, html_file):
"""Load BibTeX file and export to HTML file"""
entries = load... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from akatsuki.exporter import export_html
from akatsuki.parser import load_bibtex_file
from akatsuki.utils import sort_by_date
def main(bibtex_file, html_file):
"""Load BibTeX file and export to HTML file"""
... |
ea48d59c4e4073de940b394d2bc99e411cfbd3fb | example_of_usage.py | example_of_usage.py | # -----------------------------------------------------------------------------
# Created: 04.03.2014
# Copyright: (c) Josua Schmid 2014
# Licence: AGPLv3
#
# Sample script for parsing HTML tables
# -----------------------------------------------------------------------------
import urllib.request
from pprin... | # -----------------------------------------------------------------------------
# Created: 04.03.2014
# Copyright: (c) Josua Schmid 2014
# Licence: AGPLv3
#
# Sample script for parsing HTML tables
# -----------------------------------------------------------------------------
import urllib.request
from pprin... | Add named tables to the examples | Add named tables to the examples
| Python | agpl-3.0 | schmijos/html-table-parser-python3,schmijos/html-table-parser-python3 | # -----------------------------------------------------------------------------
# Created: 04.03.2014
# Copyright: (c) Josua Schmid 2014
# Licence: AGPLv3
#
# Sample script for parsing HTML tables
# -----------------------------------------------------------------------------
import urllib.request
from pprin... | # -----------------------------------------------------------------------------
# Created: 04.03.2014
# Copyright: (c) Josua Schmid 2014
# Licence: AGPLv3
#
# Sample script for parsing HTML tables
# -----------------------------------------------------------------------------
import urllib.request
from pprin... | <commit_before># -----------------------------------------------------------------------------
# Created: 04.03.2014
# Copyright: (c) Josua Schmid 2014
# Licence: AGPLv3
#
# Sample script for parsing HTML tables
# -----------------------------------------------------------------------------
import urllib.req... | # -----------------------------------------------------------------------------
# Created: 04.03.2014
# Copyright: (c) Josua Schmid 2014
# Licence: AGPLv3
#
# Sample script for parsing HTML tables
# -----------------------------------------------------------------------------
import urllib.request
from pprin... | # -----------------------------------------------------------------------------
# Created: 04.03.2014
# Copyright: (c) Josua Schmid 2014
# Licence: AGPLv3
#
# Sample script for parsing HTML tables
# -----------------------------------------------------------------------------
import urllib.request
from pprin... | <commit_before># -----------------------------------------------------------------------------
# Created: 04.03.2014
# Copyright: (c) Josua Schmid 2014
# Licence: AGPLv3
#
# Sample script for parsing HTML tables
# -----------------------------------------------------------------------------
import urllib.req... |
246d2f47791f26ffe55bc9d09c59875b6045a847 | data/models.py | data/models.py | import numpy
import ast
from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.CharField(max_le... | import numpy
import ast
from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
created = models.DateTimeField(aut... | Add created field to DataPoint model | Add created field to DataPoint model
| Python | mit | crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp | import numpy
import ast
from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.CharField(max_le... | import numpy
import ast
from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
created = models.DateTimeField(aut... | <commit_before>import numpy
import ast
from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.C... | import numpy
import ast
from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
created = models.DateTimeField(aut... | import numpy
import ast
from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.CharField(max_le... | <commit_before>import numpy
import ast
from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.C... |
80d052df13653943bc2a2369cfbea4cf0e77ce12 | django_tables/__init__.py | django_tables/__init__.py | __version__ = (0, 3, 'dev')
from memory import *
from models import *
from columns import *
from options import *
| __version__ = (0, 2, 1)
from memory import *
from models import *
from columns import *
from options import *
| Prepare to fix a new version. | Prepare to fix a new version.
| Python | bsd-2-clause | PolicyStat/django-tables,miracle2k/django-tables,isolationism/mongoengine-tables | __version__ = (0, 3, 'dev')
from memory import *
from models import *
from columns import *
from options import *
Prepare to fix a new version. | __version__ = (0, 2, 1)
from memory import *
from models import *
from columns import *
from options import *
| <commit_before>__version__ = (0, 3, 'dev')
from memory import *
from models import *
from columns import *
from options import *
<commit_msg>Prepare to fix a new version.<commit_after> | __version__ = (0, 2, 1)
from memory import *
from models import *
from columns import *
from options import *
| __version__ = (0, 3, 'dev')
from memory import *
from models import *
from columns import *
from options import *
Prepare to fix a new version.__version__ = (0, 2, 1)
from memory import *
from models import *
from columns import *
from options import *
| <commit_before>__version__ = (0, 3, 'dev')
from memory import *
from models import *
from columns import *
from options import *
<commit_msg>Prepare to fix a new version.<commit_after>__version__ = (0, 2, 1)
from memory import *
from models import *
from columns import *
from options import *
|
1082db1f71ed3e84fd4068d3834ce72e744cdcca | build/fbcode_builder/specs/fbthrift.py | build/fbcode_builder/specs/fbthrift.py | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.rsocket as rsocket
import spec... | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.rsocket as rsocket
import spec... | Cut fbcode_builder dep for thrift on krb5 | Cut fbcode_builder dep for thrift on krb5
Summary: [Thrift] Cut `fbcode_builder` dep for `thrift` on `krb5`. In the past, Thrift depended on Kerberos and the `krb5` implementation for its transport-layer security. However, Thrift has since migrated fully to Transport Layer Security for its transport-layer security and... | Python | apache-2.0 | facebook/wangle,facebook/wangle,facebook/wangle | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.rsocket as rsocket
import spec... | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.rsocket as rsocket
import spec... | <commit_before>#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.rsocket as rsoc... | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.rsocket as rsocket
import spec... | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.rsocket as rsocket
import spec... | <commit_before>#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import specs.folly as folly
import specs.fizz as fizz
import specs.rsocket as rsoc... |
020e48affc34162676193ab97dad7f8ffbdaaaa6 | jupyter_kernel/magics/shell_magic.py | jupyter_kernel/magics/shell_magic.py | # Copyright (c) Calico Development Team.
# Distributed under the terms of the Modified BSD License.
# http://calicoproject.org/
from jupyter_kernel import Magic
import subprocess
class ShellMagic(Magic):
def line_shell(self, *args):
"""%shell COMMAND - run the line as a shell command"""
command =... | # Copyright (c) Calico Development Team.
# Distributed under the terms of the Modified BSD License.
# http://calicoproject.org/
from jupyter_kernel import Magic
import subprocess
class ShellMagic(Magic):
def line_shell(self, *args):
"""%shell COMMAND - run the line as a shell command"""
command =... | Fix bytes problem on python 3. | Fix bytes problem on python 3.
| Python | bsd-3-clause | Calysto/metakernel | # Copyright (c) Calico Development Team.
# Distributed under the terms of the Modified BSD License.
# http://calicoproject.org/
from jupyter_kernel import Magic
import subprocess
class ShellMagic(Magic):
def line_shell(self, *args):
"""%shell COMMAND - run the line as a shell command"""
command =... | # Copyright (c) Calico Development Team.
# Distributed under the terms of the Modified BSD License.
# http://calicoproject.org/
from jupyter_kernel import Magic
import subprocess
class ShellMagic(Magic):
def line_shell(self, *args):
"""%shell COMMAND - run the line as a shell command"""
command =... | <commit_before># Copyright (c) Calico Development Team.
# Distributed under the terms of the Modified BSD License.
# http://calicoproject.org/
from jupyter_kernel import Magic
import subprocess
class ShellMagic(Magic):
def line_shell(self, *args):
"""%shell COMMAND - run the line as a shell command"""
... | # Copyright (c) Calico Development Team.
# Distributed under the terms of the Modified BSD License.
# http://calicoproject.org/
from jupyter_kernel import Magic
import subprocess
class ShellMagic(Magic):
def line_shell(self, *args):
"""%shell COMMAND - run the line as a shell command"""
command =... | # Copyright (c) Calico Development Team.
# Distributed under the terms of the Modified BSD License.
# http://calicoproject.org/
from jupyter_kernel import Magic
import subprocess
class ShellMagic(Magic):
def line_shell(self, *args):
"""%shell COMMAND - run the line as a shell command"""
command =... | <commit_before># Copyright (c) Calico Development Team.
# Distributed under the terms of the Modified BSD License.
# http://calicoproject.org/
from jupyter_kernel import Magic
import subprocess
class ShellMagic(Magic):
def line_shell(self, *args):
"""%shell COMMAND - run the line as a shell command"""
... |
15f482fbb7b1b98b48545f6e5ab3986859c38e55 | watchman/main.py | watchman/main.py | from __future__ import print_function
import sys
import os
from sh import cd, hg
def _get_subdirectories(current_dir):
return [directory for directory in os.listdir(current_dir)
if os.path.isdir(os.path.join(current_dir, directory))
and directory[0] != '.']
def check():
current_work... | from __future__ import print_function
import sys
import os
from sh import cd, hg
def _get_subdirectories(current_dir):
return [directory for directory in os.listdir(current_dir)
if os.path.isdir(os.path.join(current_dir, directory))
and directory[0] != '.']
def check():
current_work... | Remove change dir commands and now it sends directly. | Remove change dir commands and now it sends directly.
| Python | mit | alephmelo/watchman | from __future__ import print_function
import sys
import os
from sh import cd, hg
def _get_subdirectories(current_dir):
return [directory for directory in os.listdir(current_dir)
if os.path.isdir(os.path.join(current_dir, directory))
and directory[0] != '.']
def check():
current_work... | from __future__ import print_function
import sys
import os
from sh import cd, hg
def _get_subdirectories(current_dir):
return [directory for directory in os.listdir(current_dir)
if os.path.isdir(os.path.join(current_dir, directory))
and directory[0] != '.']
def check():
current_work... | <commit_before>from __future__ import print_function
import sys
import os
from sh import cd, hg
def _get_subdirectories(current_dir):
return [directory for directory in os.listdir(current_dir)
if os.path.isdir(os.path.join(current_dir, directory))
and directory[0] != '.']
def check():
... | from __future__ import print_function
import sys
import os
from sh import cd, hg
def _get_subdirectories(current_dir):
return [directory for directory in os.listdir(current_dir)
if os.path.isdir(os.path.join(current_dir, directory))
and directory[0] != '.']
def check():
current_work... | from __future__ import print_function
import sys
import os
from sh import cd, hg
def _get_subdirectories(current_dir):
return [directory for directory in os.listdir(current_dir)
if os.path.isdir(os.path.join(current_dir, directory))
and directory[0] != '.']
def check():
current_work... | <commit_before>from __future__ import print_function
import sys
import os
from sh import cd, hg
def _get_subdirectories(current_dir):
return [directory for directory in os.listdir(current_dir)
if os.path.isdir(os.path.join(current_dir, directory))
and directory[0] != '.']
def check():
... |
84942c895343d7803144b0a95feeabe481fe0e3d | behave/formatter/base.py | behave/formatter/base.py | class Formatter(object):
name = None
description = None
def __init__(self, stream, config):
self.stream = stream
self.config = config
def uri(self, uri):
pass
def feature(self, feature):
pass
def background(self, background):
pass
def scenario(sel... | class Formatter(object):
name = None
description = None
def __init__(self, stream, config):
self.stream = stream
self.config = config
def uri(self, uri):
pass
def feature(self, feature):
pass
def background(self, background):
pass
def scenario(sel... | Remove blank line at end of file. | Remove blank line at end of file.
| Python | bsd-2-clause | hugeinc/behave-parallel,metaperl/behave,KevinOrtman/behave,KevinOrtman/behave,connorsml/behave,Gimpneek/behave,charleswhchan/behave,charleswhchan/behave,vrutkovs/behave,mzcity123/behave,Gimpneek/behave,spacediver/behave,KevinMarkVI/behave-parallel,jenisys/behave,memee/behave,allanlewis/behave,vrutkovs/behave,mzcity123/... | class Formatter(object):
name = None
description = None
def __init__(self, stream, config):
self.stream = stream
self.config = config
def uri(self, uri):
pass
def feature(self, feature):
pass
def background(self, background):
pass
def scenario(sel... | class Formatter(object):
name = None
description = None
def __init__(self, stream, config):
self.stream = stream
self.config = config
def uri(self, uri):
pass
def feature(self, feature):
pass
def background(self, background):
pass
def scenario(sel... | <commit_before>class Formatter(object):
name = None
description = None
def __init__(self, stream, config):
self.stream = stream
self.config = config
def uri(self, uri):
pass
def feature(self, feature):
pass
def background(self, background):
pass
d... | class Formatter(object):
name = None
description = None
def __init__(self, stream, config):
self.stream = stream
self.config = config
def uri(self, uri):
pass
def feature(self, feature):
pass
def background(self, background):
pass
def scenario(sel... | class Formatter(object):
name = None
description = None
def __init__(self, stream, config):
self.stream = stream
self.config = config
def uri(self, uri):
pass
def feature(self, feature):
pass
def background(self, background):
pass
def scenario(sel... | <commit_before>class Formatter(object):
name = None
description = None
def __init__(self, stream, config):
self.stream = stream
self.config = config
def uri(self, uri):
pass
def feature(self, feature):
pass
def background(self, background):
pass
d... |
88647bd762da9619c066c9bd79e48cb234247707 | geotagging/views.py | geotagging/views.py | from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.contenttypes.models import ContentType
from geotagging.models import Point
def add_edit_point(request, content_type_id, object_id,
template=Non... | from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from geotagging.models import Point
def add_edit_point(request, cont... | Fix a bug when you try to add a geo tag to an object that does not have already one | Fix a bug when you try to add a geo tag to an object that does not have already one | Python | bsd-3-clause | uclastudentmedia/django-geotagging,uclastudentmedia/django-geotagging,uclastudentmedia/django-geotagging | from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.contenttypes.models import ContentType
from geotagging.models import Point
def add_edit_point(request, content_type_id, object_id,
template=Non... | from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from geotagging.models import Point
def add_edit_point(request, cont... | <commit_before>from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.contenttypes.models import ContentType
from geotagging.models import Point
def add_edit_point(request, content_type_id, object_id,
... | from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from geotagging.models import Point
def add_edit_point(request, cont... | from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.contenttypes.models import ContentType
from geotagging.models import Point
def add_edit_point(request, content_type_id, object_id,
template=Non... | <commit_before>from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.contenttypes.models import ContentType
from geotagging.models import Point
def add_edit_point(request, content_type_id, object_id,
... |
ef11a6388dabd07afb3d11f7b097226e68fdf243 | project/estimation/models.py | project/estimation/models.py | from .. import db
class Question(db.Model):
id = db.Column(db.Integer, primary_key=True)
text = db.Column(db.String(240), unique=True, index=True)
answer = db.Column(db.Numeric) | from .. import db
class Question(db.Model):
id = db.Column(db.Integer, primary_key=True)
text = db.Column(db.String(240), unique=True, index=True)
answer = db.Column(db.Numeric)
class Estimate(db.Model):
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey('us... | Add model to keep track of users' estimates. | Add model to keep track of users' estimates.
| Python | mit | rahimnathwani/measure-anything | from .. import db
class Question(db.Model):
id = db.Column(db.Integer, primary_key=True)
text = db.Column(db.String(240), unique=True, index=True)
answer = db.Column(db.Numeric)Add model to keep track of users' estimates. | from .. import db
class Question(db.Model):
id = db.Column(db.Integer, primary_key=True)
text = db.Column(db.String(240), unique=True, index=True)
answer = db.Column(db.Numeric)
class Estimate(db.Model):
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey('us... | <commit_before>from .. import db
class Question(db.Model):
id = db.Column(db.Integer, primary_key=True)
text = db.Column(db.String(240), unique=True, index=True)
answer = db.Column(db.Numeric)<commit_msg>Add model to keep track of users' estimates.<commit_after> | from .. import db
class Question(db.Model):
id = db.Column(db.Integer, primary_key=True)
text = db.Column(db.String(240), unique=True, index=True)
answer = db.Column(db.Numeric)
class Estimate(db.Model):
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey('us... | from .. import db
class Question(db.Model):
id = db.Column(db.Integer, primary_key=True)
text = db.Column(db.String(240), unique=True, index=True)
answer = db.Column(db.Numeric)Add model to keep track of users' estimates.from .. import db
class Question(db.Model):
id = db.Column(db.Integer, primary_key=True)
... | <commit_before>from .. import db
class Question(db.Model):
id = db.Column(db.Integer, primary_key=True)
text = db.Column(db.String(240), unique=True, index=True)
answer = db.Column(db.Numeric)<commit_msg>Add model to keep track of users' estimates.<commit_after>from .. import db
class Question(db.Model):
id = ... |
224269d0794d1037213b429c0fcb7c5953129230 | aldryn_config.py | aldryn_config.py | # -*- coding: utf-8 -*-
from aldryn_client import forms
class Form(forms.BaseForm):
def to_settings(self, cleaned_data, settings_dict):
settings_dict['MIDDLEWARE_CLASSES'].append(
'country_segment.middleware.ResolveCountryCodeMiddleware')
return settings_dict
| # -*- coding: utf-8 -*-
from aldryn_client import forms
class Form(forms.BaseForm):
def to_settings(self, cleaned_data, settings_dict):
country_mw = 'country_segment.middleware.ResolveCountryCodeMiddleware'
if country_mw not in settings_dict['MIDDLEWARE_CLASSES']:
for position, mw in enumerate(s... | Put the middleware near the top (again). | Put the middleware near the top (again).
| Python | bsd-3-clause | aldryn/aldryn-country-segment | # -*- coding: utf-8 -*-
from aldryn_client import forms
class Form(forms.BaseForm):
def to_settings(self, cleaned_data, settings_dict):
settings_dict['MIDDLEWARE_CLASSES'].append(
'country_segment.middleware.ResolveCountryCodeMiddleware')
return settings_dict
Put the middleware near t... | # -*- coding: utf-8 -*-
from aldryn_client import forms
class Form(forms.BaseForm):
def to_settings(self, cleaned_data, settings_dict):
country_mw = 'country_segment.middleware.ResolveCountryCodeMiddleware'
if country_mw not in settings_dict['MIDDLEWARE_CLASSES']:
for position, mw in enumerate(s... | <commit_before># -*- coding: utf-8 -*-
from aldryn_client import forms
class Form(forms.BaseForm):
def to_settings(self, cleaned_data, settings_dict):
settings_dict['MIDDLEWARE_CLASSES'].append(
'country_segment.middleware.ResolveCountryCodeMiddleware')
return settings_dict
<commit_ms... | # -*- coding: utf-8 -*-
from aldryn_client import forms
class Form(forms.BaseForm):
def to_settings(self, cleaned_data, settings_dict):
country_mw = 'country_segment.middleware.ResolveCountryCodeMiddleware'
if country_mw not in settings_dict['MIDDLEWARE_CLASSES']:
for position, mw in enumerate(s... | # -*- coding: utf-8 -*-
from aldryn_client import forms
class Form(forms.BaseForm):
def to_settings(self, cleaned_data, settings_dict):
settings_dict['MIDDLEWARE_CLASSES'].append(
'country_segment.middleware.ResolveCountryCodeMiddleware')
return settings_dict
Put the middleware near t... | <commit_before># -*- coding: utf-8 -*-
from aldryn_client import forms
class Form(forms.BaseForm):
def to_settings(self, cleaned_data, settings_dict):
settings_dict['MIDDLEWARE_CLASSES'].append(
'country_segment.middleware.ResolveCountryCodeMiddleware')
return settings_dict
<commit_ms... |
ed09054447b17a88b902dcff95dee89772867cf7 | dropbot/stomp_listener.py | dropbot/stomp_listener.py | import stomp
import urlparse
import json
urlparse.uses_netloc.append('tcp')
class ZKillboardStompListener(object):
def __init__(self, bot):
self.bot = bot
self.conn = None
def on_error(self, headers, message):
pass
def on_message(self, headers, message):
kill = json.load... | import stomp
import urlparse
import json
urlparse.uses_netloc.append('tcp')
class ZKillboardStompListener(object):
def __init__(self, bot):
self.bot = bot
self.conn = None
def on_error(self, headers, message):
pass
def on_message(self, headers, message):
kill = json.load... | Make sure we're checking ints to ints. | Make sure we're checking ints to ints.
| Python | mit | nikdoof/dropbot,nikdoof/dropbot | import stomp
import urlparse
import json
urlparse.uses_netloc.append('tcp')
class ZKillboardStompListener(object):
def __init__(self, bot):
self.bot = bot
self.conn = None
def on_error(self, headers, message):
pass
def on_message(self, headers, message):
kill = json.load... | import stomp
import urlparse
import json
urlparse.uses_netloc.append('tcp')
class ZKillboardStompListener(object):
def __init__(self, bot):
self.bot = bot
self.conn = None
def on_error(self, headers, message):
pass
def on_message(self, headers, message):
kill = json.load... | <commit_before>import stomp
import urlparse
import json
urlparse.uses_netloc.append('tcp')
class ZKillboardStompListener(object):
def __init__(self, bot):
self.bot = bot
self.conn = None
def on_error(self, headers, message):
pass
def on_message(self, headers, message):
k... | import stomp
import urlparse
import json
urlparse.uses_netloc.append('tcp')
class ZKillboardStompListener(object):
def __init__(self, bot):
self.bot = bot
self.conn = None
def on_error(self, headers, message):
pass
def on_message(self, headers, message):
kill = json.load... | import stomp
import urlparse
import json
urlparse.uses_netloc.append('tcp')
class ZKillboardStompListener(object):
def __init__(self, bot):
self.bot = bot
self.conn = None
def on_error(self, headers, message):
pass
def on_message(self, headers, message):
kill = json.load... | <commit_before>import stomp
import urlparse
import json
urlparse.uses_netloc.append('tcp')
class ZKillboardStompListener(object):
def __init__(self, bot):
self.bot = bot
self.conn = None
def on_error(self, headers, message):
pass
def on_message(self, headers, message):
k... |
be7c5fc964ce3386df2bf246f12838e4ba2a2cb6 | saleor/core/utils/filters.py | saleor/core/utils/filters.py | from __future__ import unicode_literals
def get_sort_by_choices(filter):
return [(choice[0], choice[1].lower()) for choice in
filter.filters['sort_by'].field.choices[1::2]]
def get_now_sorted_by(filter, fields):
sort_by = filter.form.cleaned_data.get('sort_by')
if sort_by:
sort_by = ... | from __future__ import unicode_literals
def get_sort_by_choices(filter):
return [(choice[0], choice[1].lower()) for choice in
filter.filters['sort_by'].field.choices[1::2]]
def get_now_sorted_by(filter, fields, default_sort='name'):
sort_by = filter.form.cleaned_data.get('sort_by')
if sort_b... | Add default_sort param to get_now_sorting_by | Add default_sort param to get_now_sorting_by
| Python | bsd-3-clause | UITools/saleor,UITools/saleor,UITools/saleor,maferelo/saleor,mociepka/saleor,maferelo/saleor,mociepka/saleor,mociepka/saleor,UITools/saleor,maferelo/saleor,UITools/saleor | from __future__ import unicode_literals
def get_sort_by_choices(filter):
return [(choice[0], choice[1].lower()) for choice in
filter.filters['sort_by'].field.choices[1::2]]
def get_now_sorted_by(filter, fields):
sort_by = filter.form.cleaned_data.get('sort_by')
if sort_by:
sort_by = ... | from __future__ import unicode_literals
def get_sort_by_choices(filter):
return [(choice[0], choice[1].lower()) for choice in
filter.filters['sort_by'].field.choices[1::2]]
def get_now_sorted_by(filter, fields, default_sort='name'):
sort_by = filter.form.cleaned_data.get('sort_by')
if sort_b... | <commit_before>from __future__ import unicode_literals
def get_sort_by_choices(filter):
return [(choice[0], choice[1].lower()) for choice in
filter.filters['sort_by'].field.choices[1::2]]
def get_now_sorted_by(filter, fields):
sort_by = filter.form.cleaned_data.get('sort_by')
if sort_by:
... | from __future__ import unicode_literals
def get_sort_by_choices(filter):
return [(choice[0], choice[1].lower()) for choice in
filter.filters['sort_by'].field.choices[1::2]]
def get_now_sorted_by(filter, fields, default_sort='name'):
sort_by = filter.form.cleaned_data.get('sort_by')
if sort_b... | from __future__ import unicode_literals
def get_sort_by_choices(filter):
return [(choice[0], choice[1].lower()) for choice in
filter.filters['sort_by'].field.choices[1::2]]
def get_now_sorted_by(filter, fields):
sort_by = filter.form.cleaned_data.get('sort_by')
if sort_by:
sort_by = ... | <commit_before>from __future__ import unicode_literals
def get_sort_by_choices(filter):
return [(choice[0], choice[1].lower()) for choice in
filter.filters['sort_by'].field.choices[1::2]]
def get_now_sorted_by(filter, fields):
sort_by = filter.form.cleaned_data.get('sort_by')
if sort_by:
... |
8f834aebfa2d0f3cf392a6c2530c00699a27dafa | crowd_anki/anki/overrides/exporting.py | crowd_anki/anki/overrides/exporting.py | import os
import anki.exporting
import anki.hooks
import anki.utils
import aqt.exporting
import aqt.utils
from aqt import QFileDialog
from aqt.exporting import ExportDialog
from ...utils import constants
# aqt part:
def exporter_changed(self, exporter_id):
self.exporter = aqt.exporting.exporters()[exporter_id]... | import os
import anki.exporting
import anki.hooks
import anki.utils
import aqt.exporting
import aqt.utils
from aqt import QFileDialog
from aqt.exporting import ExportDialog
from ...utils import constants
# aqt part:
def exporter_changed(self, exporter_id):
self.exporter = aqt.exporting.exporters(self.col)[expo... | Update exporter to work with Anki ≥ 2.1.36 | Update exporter to work with Anki ≥ 2.1.36
`exporters` now takes an argument.
See e3b4802f47395b9c1a75ff89505410e91f34477e
Introduced after 2.1.35 but before 2.1.36. (Testing explicitly shows
that this change is needed for 2.1.36 and 2.1.37, but breaks 2.1.35.)
Fix #113.
| Python | mit | Stvad/CrowdAnki,Stvad/CrowdAnki,Stvad/CrowdAnki | import os
import anki.exporting
import anki.hooks
import anki.utils
import aqt.exporting
import aqt.utils
from aqt import QFileDialog
from aqt.exporting import ExportDialog
from ...utils import constants
# aqt part:
def exporter_changed(self, exporter_id):
self.exporter = aqt.exporting.exporters()[exporter_id]... | import os
import anki.exporting
import anki.hooks
import anki.utils
import aqt.exporting
import aqt.utils
from aqt import QFileDialog
from aqt.exporting import ExportDialog
from ...utils import constants
# aqt part:
def exporter_changed(self, exporter_id):
self.exporter = aqt.exporting.exporters(self.col)[expo... | <commit_before>import os
import anki.exporting
import anki.hooks
import anki.utils
import aqt.exporting
import aqt.utils
from aqt import QFileDialog
from aqt.exporting import ExportDialog
from ...utils import constants
# aqt part:
def exporter_changed(self, exporter_id):
self.exporter = aqt.exporting.exporters... | import os
import anki.exporting
import anki.hooks
import anki.utils
import aqt.exporting
import aqt.utils
from aqt import QFileDialog
from aqt.exporting import ExportDialog
from ...utils import constants
# aqt part:
def exporter_changed(self, exporter_id):
self.exporter = aqt.exporting.exporters(self.col)[expo... | import os
import anki.exporting
import anki.hooks
import anki.utils
import aqt.exporting
import aqt.utils
from aqt import QFileDialog
from aqt.exporting import ExportDialog
from ...utils import constants
# aqt part:
def exporter_changed(self, exporter_id):
self.exporter = aqt.exporting.exporters()[exporter_id]... | <commit_before>import os
import anki.exporting
import anki.hooks
import anki.utils
import aqt.exporting
import aqt.utils
from aqt import QFileDialog
from aqt.exporting import ExportDialog
from ...utils import constants
# aqt part:
def exporter_changed(self, exporter_id):
self.exporter = aqt.exporting.exporters... |
2ad47f6ce00246cbf54639438d9279b8a7fa9b29 | python/tests/t_envoy_logs.py | python/tests/t_envoy_logs.py | import pytest, re
from kat.utils import ShellCommand
from abstract_tests import AmbassadorTest, ServiceType, HTTP
access_log_entry_regex = re.compile('^ACCESS \\[.*?\\] \\\"GET \\/ambassador')
class EnvoyLogPathTest(AmbassadorTest):
target: ServiceType
log_path: str
def init(self):
self.target ... | import pytest, re
from kat.utils import ShellCommand
from abstract_tests import AmbassadorTest, ServiceType, HTTP
access_log_entry_regex = re.compile('^MY_REQUEST 200 .*')
class EnvoyLogTest(AmbassadorTest):
target: ServiceType
log_path: str
def init(self):
self.target = HTTP()
self.log... | Test for Envoy logs format | Test for Envoy logs format
Signed-off-by: Alvaro Saurin <[email protected]>
| Python | apache-2.0 | datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador | import pytest, re
from kat.utils import ShellCommand
from abstract_tests import AmbassadorTest, ServiceType, HTTP
access_log_entry_regex = re.compile('^ACCESS \\[.*?\\] \\\"GET \\/ambassador')
class EnvoyLogPathTest(AmbassadorTest):
target: ServiceType
log_path: str
def init(self):
self.target ... | import pytest, re
from kat.utils import ShellCommand
from abstract_tests import AmbassadorTest, ServiceType, HTTP
access_log_entry_regex = re.compile('^MY_REQUEST 200 .*')
class EnvoyLogTest(AmbassadorTest):
target: ServiceType
log_path: str
def init(self):
self.target = HTTP()
self.log... | <commit_before>import pytest, re
from kat.utils import ShellCommand
from abstract_tests import AmbassadorTest, ServiceType, HTTP
access_log_entry_regex = re.compile('^ACCESS \\[.*?\\] \\\"GET \\/ambassador')
class EnvoyLogPathTest(AmbassadorTest):
target: ServiceType
log_path: str
def init(self):
... | import pytest, re
from kat.utils import ShellCommand
from abstract_tests import AmbassadorTest, ServiceType, HTTP
access_log_entry_regex = re.compile('^MY_REQUEST 200 .*')
class EnvoyLogTest(AmbassadorTest):
target: ServiceType
log_path: str
def init(self):
self.target = HTTP()
self.log... | import pytest, re
from kat.utils import ShellCommand
from abstract_tests import AmbassadorTest, ServiceType, HTTP
access_log_entry_regex = re.compile('^ACCESS \\[.*?\\] \\\"GET \\/ambassador')
class EnvoyLogPathTest(AmbassadorTest):
target: ServiceType
log_path: str
def init(self):
self.target ... | <commit_before>import pytest, re
from kat.utils import ShellCommand
from abstract_tests import AmbassadorTest, ServiceType, HTTP
access_log_entry_regex = re.compile('^ACCESS \\[.*?\\] \\\"GET \\/ambassador')
class EnvoyLogPathTest(AmbassadorTest):
target: ServiceType
log_path: str
def init(self):
... |
7adfe4822bf75d1df2dc2a566b3b26c9fd494431 | rest_framework_jwt/compat.py | rest_framework_jwt/compat.py | from distutils.version import StrictVersion
import rest_framework
from rest_framework import serializers
from django.forms import widgets
if StrictVersion(rest_framework.VERSION) < StrictVersion('3.0.0'):
class Serializer(serializers.Serializer):
pass
class PasswordField(serializers.CharField):
... | from distutils.version import StrictVersion
import rest_framework
from rest_framework import serializers
from django.forms import widgets
DRF_VERSION_INFO = StrictVersion(rest_framework.VERSION).version
DRF2 = DRF_VERSION_INFO[0] == 2
DRF3 = DRF_VERSION_INFO[0] == 3
if DRF2:
class Serializer(serializers.Serial... | Use request.data in DRF >= 3 | Use request.data in DRF >= 3
| Python | mit | orf/django-rest-framework-jwt,shanemgrey/django-rest-framework-jwt,GetBlimp/django-rest-framework-jwt,blaklites/django-rest-framework-jwt,plentific/django-rest-framework-jwt,ArabellaTech/django-rest-framework-jwt | from distutils.version import StrictVersion
import rest_framework
from rest_framework import serializers
from django.forms import widgets
if StrictVersion(rest_framework.VERSION) < StrictVersion('3.0.0'):
class Serializer(serializers.Serializer):
pass
class PasswordField(serializers.CharField):
... | from distutils.version import StrictVersion
import rest_framework
from rest_framework import serializers
from django.forms import widgets
DRF_VERSION_INFO = StrictVersion(rest_framework.VERSION).version
DRF2 = DRF_VERSION_INFO[0] == 2
DRF3 = DRF_VERSION_INFO[0] == 3
if DRF2:
class Serializer(serializers.Serial... | <commit_before>from distutils.version import StrictVersion
import rest_framework
from rest_framework import serializers
from django.forms import widgets
if StrictVersion(rest_framework.VERSION) < StrictVersion('3.0.0'):
class Serializer(serializers.Serializer):
pass
class PasswordField(serializers.C... | from distutils.version import StrictVersion
import rest_framework
from rest_framework import serializers
from django.forms import widgets
DRF_VERSION_INFO = StrictVersion(rest_framework.VERSION).version
DRF2 = DRF_VERSION_INFO[0] == 2
DRF3 = DRF_VERSION_INFO[0] == 3
if DRF2:
class Serializer(serializers.Serial... | from distutils.version import StrictVersion
import rest_framework
from rest_framework import serializers
from django.forms import widgets
if StrictVersion(rest_framework.VERSION) < StrictVersion('3.0.0'):
class Serializer(serializers.Serializer):
pass
class PasswordField(serializers.CharField):
... | <commit_before>from distutils.version import StrictVersion
import rest_framework
from rest_framework import serializers
from django.forms import widgets
if StrictVersion(rest_framework.VERSION) < StrictVersion('3.0.0'):
class Serializer(serializers.Serializer):
pass
class PasswordField(serializers.C... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.