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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
42221c7b858951376ba59385fa42cac11d542fdd | plugin/script/sphinxexampleae.py | plugin/script/sphinxexampleae.py |
def process( node_name, handle ):
handle.editorTemplate( beginScrollLayout=True )
handle.editorTemplate( beginLayout="Float Attributes" )
handle.editorTemplate( "floatAttr", addControl=True )
handle.editorTemplate( endLayout=True )
handle.editorTemplate( addExtraControls=True )
handle.edito... |
float_attr_help = """
This is the *annotation* for the floatAttr attribute
Here are some bullet points pertaining to this attribute
- The help is written in rst
- I don't know what else to put in the list
"""
string_attr_help = """
This is the *annotation* for the stringAttr attribute
"""
def process( node_name, ... | Add another attribute and some annotations | Add another attribute and some annotations
We write the annotations in rst for the moment.
| Python | bsd-3-clause | michaeljones/sphinx-maya-node |
def process( node_name, handle ):
handle.editorTemplate( beginScrollLayout=True )
handle.editorTemplate( beginLayout="Float Attributes" )
handle.editorTemplate( "floatAttr", addControl=True )
handle.editorTemplate( endLayout=True )
handle.editorTemplate( addExtraControls=True )
handle.edito... |
float_attr_help = """
This is the *annotation* for the floatAttr attribute
Here are some bullet points pertaining to this attribute
- The help is written in rst
- I don't know what else to put in the list
"""
string_attr_help = """
This is the *annotation* for the stringAttr attribute
"""
def process( node_name, ... | <commit_before>
def process( node_name, handle ):
handle.editorTemplate( beginScrollLayout=True )
handle.editorTemplate( beginLayout="Float Attributes" )
handle.editorTemplate( "floatAttr", addControl=True )
handle.editorTemplate( endLayout=True )
handle.editorTemplate( addExtraControls=True )
... |
float_attr_help = """
This is the *annotation* for the floatAttr attribute
Here are some bullet points pertaining to this attribute
- The help is written in rst
- I don't know what else to put in the list
"""
string_attr_help = """
This is the *annotation* for the stringAttr attribute
"""
def process( node_name, ... |
def process( node_name, handle ):
handle.editorTemplate( beginScrollLayout=True )
handle.editorTemplate( beginLayout="Float Attributes" )
handle.editorTemplate( "floatAttr", addControl=True )
handle.editorTemplate( endLayout=True )
handle.editorTemplate( addExtraControls=True )
handle.edito... | <commit_before>
def process( node_name, handle ):
handle.editorTemplate( beginScrollLayout=True )
handle.editorTemplate( beginLayout="Float Attributes" )
handle.editorTemplate( "floatAttr", addControl=True )
handle.editorTemplate( endLayout=True )
handle.editorTemplate( addExtraControls=True )
... |
59030daa60a4d2006cae6192219071e2a8017364 | test/conftest.py | test/conftest.py | from os.path import join, dirname, abspath
default_base_dir = join(dirname(abspath(__file__)), 'completion')
import run
def pytest_addoption(parser):
parser.addoption(
"--base-dir", default=default_base_dir,
help="Directory in which integration test case files locate.")
parser.addoption(
... | from os.path import join, dirname, abspath
default_base_dir = join(dirname(abspath(__file__)), 'completion')
import run
def pytest_addoption(parser):
parser.addoption(
"--base-dir", default=default_base_dir,
help="Directory in which integration test case files locate.")
parser.addoption(
... | Add --test-files option to py.test | Add --test-files option to py.test
At this point, py.test should be equivalent to test/run.py
| Python | mit | tjwei/jedi,jonashaag/jedi,mfussenegger/jedi,jonashaag/jedi,dwillmer/jedi,WoLpH/jedi,tjwei/jedi,mfussenegger/jedi,dwillmer/jedi,flurischt/jedi,WoLpH/jedi,flurischt/jedi | from os.path import join, dirname, abspath
default_base_dir = join(dirname(abspath(__file__)), 'completion')
import run
def pytest_addoption(parser):
parser.addoption(
"--base-dir", default=default_base_dir,
help="Directory in which integration test case files locate.")
parser.addoption(
... | from os.path import join, dirname, abspath
default_base_dir = join(dirname(abspath(__file__)), 'completion')
import run
def pytest_addoption(parser):
parser.addoption(
"--base-dir", default=default_base_dir,
help="Directory in which integration test case files locate.")
parser.addoption(
... | <commit_before>from os.path import join, dirname, abspath
default_base_dir = join(dirname(abspath(__file__)), 'completion')
import run
def pytest_addoption(parser):
parser.addoption(
"--base-dir", default=default_base_dir,
help="Directory in which integration test case files locate.")
parser.... | from os.path import join, dirname, abspath
default_base_dir = join(dirname(abspath(__file__)), 'completion')
import run
def pytest_addoption(parser):
parser.addoption(
"--base-dir", default=default_base_dir,
help="Directory in which integration test case files locate.")
parser.addoption(
... | from os.path import join, dirname, abspath
default_base_dir = join(dirname(abspath(__file__)), 'completion')
import run
def pytest_addoption(parser):
parser.addoption(
"--base-dir", default=default_base_dir,
help="Directory in which integration test case files locate.")
parser.addoption(
... | <commit_before>from os.path import join, dirname, abspath
default_base_dir = join(dirname(abspath(__file__)), 'completion')
import run
def pytest_addoption(parser):
parser.addoption(
"--base-dir", default=default_base_dir,
help="Directory in which integration test case files locate.")
parser.... |
4aa1623e08519127a06f49060d546c5ef18e906c | vcs/models.py | vcs/models.py | from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=10)
unique_... | from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=10)
unique_... | Use a OneToMany field for the activity joiner. | Use a OneToMany field for the activity joiner.
| Python | bsd-3-clause | AeroNotix/django-timetracker,AeroNotix/django-timetracker,AeroNotix/django-timetracker | from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=10)
unique_... | from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=10)
unique_... | <commit_before>from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=... | from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=10)
unique_... | from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=10)
unique_... | <commit_before>from django.db import models
class Activity(models.Model):
group = models.CharField(max_length=4)
grouptype = models.TextField()
groupdetail = models.TextField()
details = models.TextField()
disabled = models.BooleanField()
time = models.DecimalField(decimal_places=2, max_digits=... |
d43750206ef97a39f4bb7cd7d4e69d4f634c13e1 | api/runserver.py | api/runserver.py | import os
from ricardo_api import app
isDebug = False
if os.environ['FLASK_ENV'] == "development":
isDebug = True
app.run(host= '0.0.0.0', debug=isDebug)
| import os
from ricardo_api import app
isDebug = False
if 'FLASK_ENV' in os.environ and os.environ['FLASK_ENV'] == "development":
isDebug = True
app.run(host= '0.0.0.0', debug=isDebug)
| Correct debug mode with env. | [api]: Correct debug mode with env.
| Python | agpl-3.0 | medialab/ricardo,medialab/ricardo,medialab/ricardo,medialab/ricardo | import os
from ricardo_api import app
isDebug = False
if os.environ['FLASK_ENV'] == "development":
isDebug = True
app.run(host= '0.0.0.0', debug=isDebug)
[api]: Correct debug mode with env. | import os
from ricardo_api import app
isDebug = False
if 'FLASK_ENV' in os.environ and os.environ['FLASK_ENV'] == "development":
isDebug = True
app.run(host= '0.0.0.0', debug=isDebug)
| <commit_before>import os
from ricardo_api import app
isDebug = False
if os.environ['FLASK_ENV'] == "development":
isDebug = True
app.run(host= '0.0.0.0', debug=isDebug)
<commit_msg>[api]: Correct debug mode with env.<commit_after> | import os
from ricardo_api import app
isDebug = False
if 'FLASK_ENV' in os.environ and os.environ['FLASK_ENV'] == "development":
isDebug = True
app.run(host= '0.0.0.0', debug=isDebug)
| import os
from ricardo_api import app
isDebug = False
if os.environ['FLASK_ENV'] == "development":
isDebug = True
app.run(host= '0.0.0.0', debug=isDebug)
[api]: Correct debug mode with env.import os
from ricardo_api import app
isDebug = False
if 'FLASK_ENV' in os.environ and os.environ['FLASK_ENV'] == "developme... | <commit_before>import os
from ricardo_api import app
isDebug = False
if os.environ['FLASK_ENV'] == "development":
isDebug = True
app.run(host= '0.0.0.0', debug=isDebug)
<commit_msg>[api]: Correct debug mode with env.<commit_after>import os
from ricardo_api import app
isDebug = False
if 'FLASK_ENV' in os.environ ... |
98e824af43b729eb5b5737597506a5ca87312814 | apps/polls/tests.py | apps/polls/tests.py | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | import datetime
from django.test import TestCase
from django.utils import timezone
from apps.polls.models import Poll
class PollMethoTests(TestCase):
def test_was_published_recently_with_future_poll(self):
"""
was_published_recently() should return False for polls whose
pub_date is in the future
"""
futu... | Create a test to expose the bug | Create a test to expose the bug
| Python | bsd-3-clause | hoale/teracy-tutorial,hoale/teracy-tutorial | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | import datetime
from django.test import TestCase
from django.utils import timezone
from apps.polls.models import Poll
class PollMethoTests(TestCase):
def test_was_published_recently_with_future_poll(self):
"""
was_published_recently() should return False for polls whose
pub_date is in the future
"""
futu... | <commit_before>"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tes... | import datetime
from django.test import TestCase
from django.utils import timezone
from apps.polls.models import Poll
class PollMethoTests(TestCase):
def test_was_published_recently_with_future_poll(self):
"""
was_published_recently() should return False for polls whose
pub_date is in the future
"""
futu... | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | <commit_before>"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tes... |
990008a6fb2788d25445ee9ec21375515527bdc8 | nodeconductor/backup/utils.py | nodeconductor/backup/utils.py | import pkg_resources
from django.utils import six
from django.utils.lru_cache import lru_cache
@lru_cache()
def get_backup_strategies():
entry_points = pkg_resources.get_entry_map('nodeconductor').get('backup_strategies', {})
strategies = dict((name.upper(), entry_point.load()) for name, entry_point in entry... | import pkg_resources
from django.utils import six
from django.utils.lru_cache import lru_cache
@lru_cache()
def get_backup_strategies():
entry_points = pkg_resources.get_entry_map('nodeconductor').get('backup_strategies', {})
strategies = {name.upper(): entry_point.load() for name, entry_point in six.iterite... | Use new comprehension syntax and six (nc-263) | Use new comprehension syntax and six (nc-263)
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | import pkg_resources
from django.utils import six
from django.utils.lru_cache import lru_cache
@lru_cache()
def get_backup_strategies():
entry_points = pkg_resources.get_entry_map('nodeconductor').get('backup_strategies', {})
strategies = dict((name.upper(), entry_point.load()) for name, entry_point in entry... | import pkg_resources
from django.utils import six
from django.utils.lru_cache import lru_cache
@lru_cache()
def get_backup_strategies():
entry_points = pkg_resources.get_entry_map('nodeconductor').get('backup_strategies', {})
strategies = {name.upper(): entry_point.load() for name, entry_point in six.iterite... | <commit_before>import pkg_resources
from django.utils import six
from django.utils.lru_cache import lru_cache
@lru_cache()
def get_backup_strategies():
entry_points = pkg_resources.get_entry_map('nodeconductor').get('backup_strategies', {})
strategies = dict((name.upper(), entry_point.load()) for name, entry... | import pkg_resources
from django.utils import six
from django.utils.lru_cache import lru_cache
@lru_cache()
def get_backup_strategies():
entry_points = pkg_resources.get_entry_map('nodeconductor').get('backup_strategies', {})
strategies = {name.upper(): entry_point.load() for name, entry_point in six.iterite... | import pkg_resources
from django.utils import six
from django.utils.lru_cache import lru_cache
@lru_cache()
def get_backup_strategies():
entry_points = pkg_resources.get_entry_map('nodeconductor').get('backup_strategies', {})
strategies = dict((name.upper(), entry_point.load()) for name, entry_point in entry... | <commit_before>import pkg_resources
from django.utils import six
from django.utils.lru_cache import lru_cache
@lru_cache()
def get_backup_strategies():
entry_points = pkg_resources.get_entry_map('nodeconductor').get('backup_strategies', {})
strategies = dict((name.upper(), entry_point.load()) for name, entry... |
f376eb478783448b5e372c2c4a7f7ee0e4891e88 | examples/python/values.py | examples/python/values.py | #! /usr/bin/env python
#
# values.py
#
"""
An example of using values via Python API
"""
from opencog.atomspace import AtomSpace, TruthValue
from opencog.type_constructors import *
a = AtomSpace()
set_type_ctor_atomspace(a)
a = FloatValue([1.0, 2.0, 3.0])
b = FloatValue([1.0, 2.0, 3.0])
c = FloatValue(1.0)
print('{}... | #! /usr/bin/env python
#
# values.py
#
"""
An example of using values via Python API
"""
from opencog.atomspace import AtomSpace, TruthValue
from opencog.type_constructors import *
from opencog.scheme_wrapper import scheme_eval_v
atomspace = AtomSpace()
set_type_ctor_atomspace(atomspace)
a = FloatValue([1.0, 2.0, 3.... | Add example of scheme_eval_v usage | Add example of scheme_eval_v usage
| Python | agpl-3.0 | rTreutlein/atomspace,rTreutlein/atomspace,rTreutlein/atomspace,AmeBel/atomspace,rTreutlein/atomspace,AmeBel/atomspace,AmeBel/atomspace,AmeBel/atomspace,rTreutlein/atomspace,AmeBel/atomspace | #! /usr/bin/env python
#
# values.py
#
"""
An example of using values via Python API
"""
from opencog.atomspace import AtomSpace, TruthValue
from opencog.type_constructors import *
a = AtomSpace()
set_type_ctor_atomspace(a)
a = FloatValue([1.0, 2.0, 3.0])
b = FloatValue([1.0, 2.0, 3.0])
c = FloatValue(1.0)
print('{}... | #! /usr/bin/env python
#
# values.py
#
"""
An example of using values via Python API
"""
from opencog.atomspace import AtomSpace, TruthValue
from opencog.type_constructors import *
from opencog.scheme_wrapper import scheme_eval_v
atomspace = AtomSpace()
set_type_ctor_atomspace(atomspace)
a = FloatValue([1.0, 2.0, 3.... | <commit_before>#! /usr/bin/env python
#
# values.py
#
"""
An example of using values via Python API
"""
from opencog.atomspace import AtomSpace, TruthValue
from opencog.type_constructors import *
a = AtomSpace()
set_type_ctor_atomspace(a)
a = FloatValue([1.0, 2.0, 3.0])
b = FloatValue([1.0, 2.0, 3.0])
c = FloatValue... | #! /usr/bin/env python
#
# values.py
#
"""
An example of using values via Python API
"""
from opencog.atomspace import AtomSpace, TruthValue
from opencog.type_constructors import *
from opencog.scheme_wrapper import scheme_eval_v
atomspace = AtomSpace()
set_type_ctor_atomspace(atomspace)
a = FloatValue([1.0, 2.0, 3.... | #! /usr/bin/env python
#
# values.py
#
"""
An example of using values via Python API
"""
from opencog.atomspace import AtomSpace, TruthValue
from opencog.type_constructors import *
a = AtomSpace()
set_type_ctor_atomspace(a)
a = FloatValue([1.0, 2.0, 3.0])
b = FloatValue([1.0, 2.0, 3.0])
c = FloatValue(1.0)
print('{}... | <commit_before>#! /usr/bin/env python
#
# values.py
#
"""
An example of using values via Python API
"""
from opencog.atomspace import AtomSpace, TruthValue
from opencog.type_constructors import *
a = AtomSpace()
set_type_ctor_atomspace(a)
a = FloatValue([1.0, 2.0, 3.0])
b = FloatValue([1.0, 2.0, 3.0])
c = FloatValue... |
d76c2764d5489308064011e291f9181eac4a3fd6 | feed_sources/NJTransit.py | feed_sources/NJTransit.py | """Fetch NJ TRANSIT bus and rail feeds.
Requires username and password to log in first.
Cannot check for whether a feed is new or not, so only call to fetch this one once
an email is sent to the developer account saying new feeds are available.
"""
import logging
import requests
from FeedSource import FeedSource
L... | """Fetch NJ TRANSIT bus and rail feeds.
Requires username and password to log in first.
Cannot check for whether a feed is new or not, so only call to fetch this one once
an email is sent to the developer account saying new feeds are available.
"""
import logging
import requests
from FeedSource import FeedSource
L... | Add logging for NJ TRANSIT login status | Add logging for NJ TRANSIT login status
| Python | mit | flibbertigibbet/gtfs-feed-fetcher,azavea/gtfs-feed-fetcher | """Fetch NJ TRANSIT bus and rail feeds.
Requires username and password to log in first.
Cannot check for whether a feed is new or not, so only call to fetch this one once
an email is sent to the developer account saying new feeds are available.
"""
import logging
import requests
from FeedSource import FeedSource
L... | """Fetch NJ TRANSIT bus and rail feeds.
Requires username and password to log in first.
Cannot check for whether a feed is new or not, so only call to fetch this one once
an email is sent to the developer account saying new feeds are available.
"""
import logging
import requests
from FeedSource import FeedSource
L... | <commit_before>"""Fetch NJ TRANSIT bus and rail feeds.
Requires username and password to log in first.
Cannot check for whether a feed is new or not, so only call to fetch this one once
an email is sent to the developer account saying new feeds are available.
"""
import logging
import requests
from FeedSource import... | """Fetch NJ TRANSIT bus and rail feeds.
Requires username and password to log in first.
Cannot check for whether a feed is new or not, so only call to fetch this one once
an email is sent to the developer account saying new feeds are available.
"""
import logging
import requests
from FeedSource import FeedSource
L... | """Fetch NJ TRANSIT bus and rail feeds.
Requires username and password to log in first.
Cannot check for whether a feed is new or not, so only call to fetch this one once
an email is sent to the developer account saying new feeds are available.
"""
import logging
import requests
from FeedSource import FeedSource
L... | <commit_before>"""Fetch NJ TRANSIT bus and rail feeds.
Requires username and password to log in first.
Cannot check for whether a feed is new or not, so only call to fetch this one once
an email is sent to the developer account saying new feeds are available.
"""
import logging
import requests
from FeedSource import... |
385d7a5734e91217e9d8c0464327dedb30a69621 | profile_python.py | profile_python.py | # coding: utf8
# Copyright 2013-2015 Vincent Jacques <[email protected]>
import cProfile as profile
import pstats
import cairo
from DrawTurksHead import TurksHead
stats_filename = "profiling/profile_python.stats"
img = cairo.ImageSurface(cairo.FORMAT_RGB24, 3200, 2400)
ctx = cairo.Context(img)
ctx.set_s... | # coding: utf8
# Copyright 2013-2015 Vincent Jacques <[email protected]>
import cProfile as profile
import pstats
import cairo
from DrawTurksHead import TurksHead
stats_filename = "/tmp/profile.stats"
img = cairo.ImageSurface(cairo.FORMAT_RGB24, 3200, 2400)
ctx = cairo.Context(img)
ctx.set_source_rgb(1,... | Change name of stats file | Change name of stats file
| Python | mit | jacquev6/DrawTurksHead,jacquev6/DrawTurksHead,jacquev6/DrawTurksHead | # coding: utf8
# Copyright 2013-2015 Vincent Jacques <[email protected]>
import cProfile as profile
import pstats
import cairo
from DrawTurksHead import TurksHead
stats_filename = "profiling/profile_python.stats"
img = cairo.ImageSurface(cairo.FORMAT_RGB24, 3200, 2400)
ctx = cairo.Context(img)
ctx.set_s... | # coding: utf8
# Copyright 2013-2015 Vincent Jacques <[email protected]>
import cProfile as profile
import pstats
import cairo
from DrawTurksHead import TurksHead
stats_filename = "/tmp/profile.stats"
img = cairo.ImageSurface(cairo.FORMAT_RGB24, 3200, 2400)
ctx = cairo.Context(img)
ctx.set_source_rgb(1,... | <commit_before># coding: utf8
# Copyright 2013-2015 Vincent Jacques <[email protected]>
import cProfile as profile
import pstats
import cairo
from DrawTurksHead import TurksHead
stats_filename = "profiling/profile_python.stats"
img = cairo.ImageSurface(cairo.FORMAT_RGB24, 3200, 2400)
ctx = cairo.Context... | # coding: utf8
# Copyright 2013-2015 Vincent Jacques <[email protected]>
import cProfile as profile
import pstats
import cairo
from DrawTurksHead import TurksHead
stats_filename = "/tmp/profile.stats"
img = cairo.ImageSurface(cairo.FORMAT_RGB24, 3200, 2400)
ctx = cairo.Context(img)
ctx.set_source_rgb(1,... | # coding: utf8
# Copyright 2013-2015 Vincent Jacques <[email protected]>
import cProfile as profile
import pstats
import cairo
from DrawTurksHead import TurksHead
stats_filename = "profiling/profile_python.stats"
img = cairo.ImageSurface(cairo.FORMAT_RGB24, 3200, 2400)
ctx = cairo.Context(img)
ctx.set_s... | <commit_before># coding: utf8
# Copyright 2013-2015 Vincent Jacques <[email protected]>
import cProfile as profile
import pstats
import cairo
from DrawTurksHead import TurksHead
stats_filename = "profiling/profile_python.stats"
img = cairo.ImageSurface(cairo.FORMAT_RGB24, 3200, 2400)
ctx = cairo.Context... |
dcd36fab023ac2530cbfa17449e3ce8f61ad6bdc | ssl-cert-parse.py | ssl-cert-parse.py | #!/usr/bin/env python3
import datetime
import ssl
import OpenSSL
def GetCert(SiteName, Port):
return ssl.get_server_certificate((SiteName, Port))
def ParseCert(CertRaw):
Cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, CertRaw)
print(str(Cert.get_subject())[18:-2])
prin... | #!/usr/bin/env python3
import datetime
import ssl
import OpenSSL
def GetCert(SiteName, Port):
return ssl.get_server_certificate((SiteName, Port))
def ParseCert(CertRaw):
Cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, CertRaw)
CertSubject = str(Cert.get_subject())[18:-2]
... | Fix ParseCert() function, add variables, add a return statement | Fix ParseCert() function, add variables, add a return statement
| Python | apache-2.0 | ivuk/ssl-cert-parse | #!/usr/bin/env python3
import datetime
import ssl
import OpenSSL
def GetCert(SiteName, Port):
return ssl.get_server_certificate((SiteName, Port))
def ParseCert(CertRaw):
Cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, CertRaw)
print(str(Cert.get_subject())[18:-2])
prin... | #!/usr/bin/env python3
import datetime
import ssl
import OpenSSL
def GetCert(SiteName, Port):
return ssl.get_server_certificate((SiteName, Port))
def ParseCert(CertRaw):
Cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, CertRaw)
CertSubject = str(Cert.get_subject())[18:-2]
... | <commit_before>#!/usr/bin/env python3
import datetime
import ssl
import OpenSSL
def GetCert(SiteName, Port):
return ssl.get_server_certificate((SiteName, Port))
def ParseCert(CertRaw):
Cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, CertRaw)
print(str(Cert.get_subject())[1... | #!/usr/bin/env python3
import datetime
import ssl
import OpenSSL
def GetCert(SiteName, Port):
return ssl.get_server_certificate((SiteName, Port))
def ParseCert(CertRaw):
Cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, CertRaw)
CertSubject = str(Cert.get_subject())[18:-2]
... | #!/usr/bin/env python3
import datetime
import ssl
import OpenSSL
def GetCert(SiteName, Port):
return ssl.get_server_certificate((SiteName, Port))
def ParseCert(CertRaw):
Cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, CertRaw)
print(str(Cert.get_subject())[18:-2])
prin... | <commit_before>#!/usr/bin/env python3
import datetime
import ssl
import OpenSSL
def GetCert(SiteName, Port):
return ssl.get_server_certificate((SiteName, Port))
def ParseCert(CertRaw):
Cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_PEM, CertRaw)
print(str(Cert.get_subject())[1... |
5cb7aaac10c6c8cf818c46b2d0f47fe707e2b93c | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/config/urls.py | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/config/urls.py | import django.views.static
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView
admin.autodiscover()
urlpatterns = [
url(r'^$', TemplateView.as_v... | import django.views.static
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView
admin.autodiscover()
urlpatterns = [
url(r'^$', TemplateView.as_v... | Update url includes for django 2.0 | Update url includes for django 2.0
| Python | mit | r0x73/django-template,r0x73/django-template,r0x73/django-template | import django.views.static
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView
admin.autodiscover()
urlpatterns = [
url(r'^$', TemplateView.as_v... | import django.views.static
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView
admin.autodiscover()
urlpatterns = [
url(r'^$', TemplateView.as_v... | <commit_before>import django.views.static
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView
admin.autodiscover()
urlpatterns = [
url(r'^$', Te... | import django.views.static
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView
admin.autodiscover()
urlpatterns = [
url(r'^$', TemplateView.as_v... | import django.views.static
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView
admin.autodiscover()
urlpatterns = [
url(r'^$', TemplateView.as_v... | <commit_before>import django.views.static
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic import TemplateView
admin.autodiscover()
urlpatterns = [
url(r'^$', Te... |
572dca82aab583e91e5b8402d1334bae55244d16 | hs_tracking/middleware.py | hs_tracking/middleware.py | from .models import Session
class Tracking(object):
"""The default tracking middleware logs all successful responses as a 'visit' variable with
the URL path as its value."""
def process_response(self, request, response):
if response.status_code == 200:
session = Session.objects.for_re... | from .models import Session
class Tracking(object):
"""The default tracking middleware logs all successful responses as a 'visit' variable with
the URL path as its value."""
def process_response(self, request, response):
if request.path.startswith('/heartbeat/'):
return response
... | Disable use tracking of all heartbeat app urls. | Disable use tracking of all heartbeat app urls.
| Python | bsd-3-clause | RENCI/xDCIShare,FescueFungiShare/hydroshare,ResearchSoftwareInstitute/MyHPOM,RENCI/xDCIShare,FescueFungiShare/hydroshare,hydroshare/hydroshare,hydroshare/hydroshare,FescueFungiShare/hydroshare,ResearchSoftwareInstitute/MyHPOM,FescueFungiShare/hydroshare,hydroshare/hydroshare,RENCI/xDCIShare,RENCI/xDCIShare,ResearchSoft... | from .models import Session
class Tracking(object):
"""The default tracking middleware logs all successful responses as a 'visit' variable with
the URL path as its value."""
def process_response(self, request, response):
if response.status_code == 200:
session = Session.objects.for_re... | from .models import Session
class Tracking(object):
"""The default tracking middleware logs all successful responses as a 'visit' variable with
the URL path as its value."""
def process_response(self, request, response):
if request.path.startswith('/heartbeat/'):
return response
... | <commit_before>from .models import Session
class Tracking(object):
"""The default tracking middleware logs all successful responses as a 'visit' variable with
the URL path as its value."""
def process_response(self, request, response):
if response.status_code == 200:
session = Session... | from .models import Session
class Tracking(object):
"""The default tracking middleware logs all successful responses as a 'visit' variable with
the URL path as its value."""
def process_response(self, request, response):
if request.path.startswith('/heartbeat/'):
return response
... | from .models import Session
class Tracking(object):
"""The default tracking middleware logs all successful responses as a 'visit' variable with
the URL path as its value."""
def process_response(self, request, response):
if response.status_code == 200:
session = Session.objects.for_re... | <commit_before>from .models import Session
class Tracking(object):
"""The default tracking middleware logs all successful responses as a 'visit' variable with
the URL path as its value."""
def process_response(self, request, response):
if response.status_code == 200:
session = Session... |
93d3a2f19cfb3ef9ae62d04ce24901df81bafc3e | luigi/rfam/families_csv.py | luigi/rfam/families_csv.py | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless requir... | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless requir... | Fix typo and use correct name | Fix typo and use correct name
We want to use the pretty name, not the standard one for import. In
addition, I fix a typo in the name of the the is_suppressed column.
| Python | apache-2.0 | RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless requir... | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless requir... | <commit_before># -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.... | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless requir... | # -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless requir... | <commit_before># -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.... |
5aa809aa36bbc32610b9b7998b8606bbfc65508a | swift/__init__.py | swift/__init__.py | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | Switch trunk to 1.4.1, now that the 1.4.0 release branch is branched out | Switch trunk to 1.4.1, now that the 1.4.0 release branch is branched out | Python | apache-2.0 | mjzmjz/swift,iostackproject/IO-Bandwidth-Differentiation,Triv90/SwiftUml,VictorLowther/swift,mjwtom/swift,psachin/swift,hurricanerix/swift,levythu/swift,smerritt/swift,zackmdavis/swift,prashanthpai/swift,IPVL/swift-kilo,zaitcev/swift-lfs,hbhdytf/mac2,Khushbu27/Tutorial,clayg/swift,larsbutler/swift,nadeemsyed/swift,Mira... | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | <commit_before>import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
r... | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | <commit_before>import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
r... |
49155373b9eea3812c295c9d89c40a7c9c1c1c13 | migrations/versions/20170214191843_pubmed_rename_identifiers_list_to_article_ids.py | migrations/versions/20170214191843_pubmed_rename_identifiers_list_to_article_ids.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from alembic import op
# revision identifiers, used by Alembic.
revision = '3dbb46f23ed7'
down_revision = u'0087dc1eb534'
branch_labels = None
d... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from alembic import op
# revision identifiers, used by Alembic.
revision = '3dbb46f23ed7'
down_revision = u'b32475938a2d'
branch_labels = None
d... | Fix migrations to have a single path | Fix migrations to have a single path
As it took us a while to merge some PRs, the migrations ended branching in two
parts. This commit fixes to use a single path. It shouldn't cause any issues, as
we're only messing with the `down` migrations and the migrations aren't
dependent on each other.
| Python | mit | opentrials/scraper,opentrials/collectors | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from alembic import op
# revision identifiers, used by Alembic.
revision = '3dbb46f23ed7'
down_revision = u'0087dc1eb534'
branch_labels = None
d... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from alembic import op
# revision identifiers, used by Alembic.
revision = '3dbb46f23ed7'
down_revision = u'b32475938a2d'
branch_labels = None
d... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from alembic import op
# revision identifiers, used by Alembic.
revision = '3dbb46f23ed7'
down_revision = u'0087dc1eb534'
branch_... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from alembic import op
# revision identifiers, used by Alembic.
revision = '3dbb46f23ed7'
down_revision = u'b32475938a2d'
branch_labels = None
d... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from alembic import op
# revision identifiers, used by Alembic.
revision = '3dbb46f23ed7'
down_revision = u'0087dc1eb534'
branch_labels = None
d... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from alembic import op
# revision identifiers, used by Alembic.
revision = '3dbb46f23ed7'
down_revision = u'0087dc1eb534'
branch_... |
4ccf9226466b716cf1cbe6bdcfd13d7dfe66501e | megalist_dataflow/setup.py | megalist_dataflow/setup.py | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Update Apache Beam runtime dependencies | Update Apache Beam runtime dependencies
| Python | apache-2.0 | google/megalista,google/megalista | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | <commit_before># Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | <commit_before># Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
60f9acad7610ee8bed324d1e142cc4801a9e3713 | ibmcnx/doc/DataSources.py | ibmcnx/doc/DataSources.py | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | Create script to save documentation to a file | 4: Create script to save documentation to a file
Task-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/4 | Python | apache-2.0 | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | <commit_before>######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Co... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | <commit_before>######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Co... |
2cbffa60c0b12a268e0347a6a4ecfc6d5acb29e3 | lamor_flexbe_states/src/lamor_flexbe_states/detect_person_state.py | lamor_flexbe_states/src/lamor_flexbe_states/detect_person_state.py | #!/usr/bin/env python
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxySubscriberCached
from geometry_msgs.msg import PoseStamped
class DetectPersonState(EventState):
'''
Detects the nearest person and provides their pose.
-- wait_timeout float Time (seconds) to wait for a person ... | #!/usr/bin/env python
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxySubscriberCached
from geometry_msgs.msg import PoseStamped
class DetectPersonState(EventState):
'''
Detects the nearest person and provides their pose.
-- wait_timeout float Time (seconds) to wait for a person ... | Set person pose to None if no person is present | [lamor_flexbe_state] Set person pose to None if no person is present
| Python | mit | marinaKollmitz/lamor15,pschillinger/lamor15,pschillinger/lamor15,marinaKollmitz/lamor15,pschillinger/lamor15,marinaKollmitz/lamor15,pschillinger/lamor15,marinaKollmitz/lamor15,marinaKollmitz/lamor15,pschillinger/lamor15 | #!/usr/bin/env python
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxySubscriberCached
from geometry_msgs.msg import PoseStamped
class DetectPersonState(EventState):
'''
Detects the nearest person and provides their pose.
-- wait_timeout float Time (seconds) to wait for a person ... | #!/usr/bin/env python
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxySubscriberCached
from geometry_msgs.msg import PoseStamped
class DetectPersonState(EventState):
'''
Detects the nearest person and provides their pose.
-- wait_timeout float Time (seconds) to wait for a person ... | <commit_before>#!/usr/bin/env python
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxySubscriberCached
from geometry_msgs.msg import PoseStamped
class DetectPersonState(EventState):
'''
Detects the nearest person and provides their pose.
-- wait_timeout float Time (seconds) to wai... | #!/usr/bin/env python
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxySubscriberCached
from geometry_msgs.msg import PoseStamped
class DetectPersonState(EventState):
'''
Detects the nearest person and provides their pose.
-- wait_timeout float Time (seconds) to wait for a person ... | #!/usr/bin/env python
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxySubscriberCached
from geometry_msgs.msg import PoseStamped
class DetectPersonState(EventState):
'''
Detects the nearest person and provides their pose.
-- wait_timeout float Time (seconds) to wait for a person ... | <commit_before>#!/usr/bin/env python
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxySubscriberCached
from geometry_msgs.msg import PoseStamped
class DetectPersonState(EventState):
'''
Detects the nearest person and provides their pose.
-- wait_timeout float Time (seconds) to wai... |
206a59c838623aae5e0b0f91f8089ffc13e2cfd0 | pipenv/vendor/pythonfinder/environment.py | pipenv/vendor/pythonfinder/environment.py | # -*- coding=utf-8 -*-
from __future__ import print_function, absolute_import
import os
import platform
import sys
def is_type_checking():
from typing import TYPE_CHECKING
return TYPE_CHECKING
PYENV_INSTALLED = bool(os.environ.get("PYENV_SHELL")) or bool(
os.environ.get("PYENV_ROOT")
)
ASDF_INSTALLED = ... | # -*- coding=utf-8 -*-
from __future__ import print_function, absolute_import
import os
import platform
import sys
def is_type_checking():
try:
from typing import TYPE_CHECKING
except ImportError:
return False
return TYPE_CHECKING
PYENV_INSTALLED = bool(os.environ.get("PYENV_SHELL")) or ... | Fix typing check for pythonfinder | Fix typing check for pythonfinder
Signed-off-by: Dan Ryan <[email protected]>
| Python | mit | kennethreitz/pipenv | # -*- coding=utf-8 -*-
from __future__ import print_function, absolute_import
import os
import platform
import sys
def is_type_checking():
from typing import TYPE_CHECKING
return TYPE_CHECKING
PYENV_INSTALLED = bool(os.environ.get("PYENV_SHELL")) or bool(
os.environ.get("PYENV_ROOT")
)
ASDF_INSTALLED = ... | # -*- coding=utf-8 -*-
from __future__ import print_function, absolute_import
import os
import platform
import sys
def is_type_checking():
try:
from typing import TYPE_CHECKING
except ImportError:
return False
return TYPE_CHECKING
PYENV_INSTALLED = bool(os.environ.get("PYENV_SHELL")) or ... | <commit_before># -*- coding=utf-8 -*-
from __future__ import print_function, absolute_import
import os
import platform
import sys
def is_type_checking():
from typing import TYPE_CHECKING
return TYPE_CHECKING
PYENV_INSTALLED = bool(os.environ.get("PYENV_SHELL")) or bool(
os.environ.get("PYENV_ROOT")
)
AS... | # -*- coding=utf-8 -*-
from __future__ import print_function, absolute_import
import os
import platform
import sys
def is_type_checking():
try:
from typing import TYPE_CHECKING
except ImportError:
return False
return TYPE_CHECKING
PYENV_INSTALLED = bool(os.environ.get("PYENV_SHELL")) or ... | # -*- coding=utf-8 -*-
from __future__ import print_function, absolute_import
import os
import platform
import sys
def is_type_checking():
from typing import TYPE_CHECKING
return TYPE_CHECKING
PYENV_INSTALLED = bool(os.environ.get("PYENV_SHELL")) or bool(
os.environ.get("PYENV_ROOT")
)
ASDF_INSTALLED = ... | <commit_before># -*- coding=utf-8 -*-
from __future__ import print_function, absolute_import
import os
import platform
import sys
def is_type_checking():
from typing import TYPE_CHECKING
return TYPE_CHECKING
PYENV_INSTALLED = bool(os.environ.get("PYENV_SHELL")) or bool(
os.environ.get("PYENV_ROOT")
)
AS... |
c8a1b25c1579eba5cb68c1a4cdd60116b3496429 | pre_commit_robotframework_tidy/rf_tidy.py | pre_commit_robotframework_tidy/rf_tidy.py | from __future__ import print_function
import argparse
from robot.errors import DataError
from robot.tidy import Tidy
def main(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help='Filenames to run')
parser.add_argument('--use-pipes', action='store_true', dest='... | from __future__ import print_function
import argparse
from robot.errors import DataError
from robot.tidy import Tidy
def main(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help='Filenames to run')
parser.add_argument('--use-pipes', action='store_true', dest='... | Format results as robot files | Format results as robot files
| Python | mit | guykisel/pre-commit-robotframework-tidy | from __future__ import print_function
import argparse
from robot.errors import DataError
from robot.tidy import Tidy
def main(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help='Filenames to run')
parser.add_argument('--use-pipes', action='store_true', dest='... | from __future__ import print_function
import argparse
from robot.errors import DataError
from robot.tidy import Tidy
def main(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help='Filenames to run')
parser.add_argument('--use-pipes', action='store_true', dest='... | <commit_before>from __future__ import print_function
import argparse
from robot.errors import DataError
from robot.tidy import Tidy
def main(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help='Filenames to run')
parser.add_argument('--use-pipes', action='stor... | from __future__ import print_function
import argparse
from robot.errors import DataError
from robot.tidy import Tidy
def main(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help='Filenames to run')
parser.add_argument('--use-pipes', action='store_true', dest='... | from __future__ import print_function
import argparse
from robot.errors import DataError
from robot.tidy import Tidy
def main(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help='Filenames to run')
parser.add_argument('--use-pipes', action='store_true', dest='... | <commit_before>from __future__ import print_function
import argparse
from robot.errors import DataError
from robot.tidy import Tidy
def main(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help='Filenames to run')
parser.add_argument('--use-pipes', action='stor... |
ff011f280f6f6aaf74dd2f4ff3cdfb3831aa147c | ideskeleton/builder.py | ideskeleton/builder.py | def build(source_path, overwrite = True):
pass | import os.path
def build(source_path, overwrite = True):
if not os.path.exists(source_path):
raise IOError("source_path does not exist so not skeleton can be built")
'''
for root, dirs, files in os.walk("."):
path = root.split('/')
print (len(path) - 1) *'---' , os.path.basename(root) ... | Make the first test pass by checking if source_path argument exists | Make the first test pass by checking if source_path argument exists
| Python | mit | jruizaranguren/ideskeleton | def build(source_path, overwrite = True):
passMake the first test pass by checking if source_path argument exists | import os.path
def build(source_path, overwrite = True):
if not os.path.exists(source_path):
raise IOError("source_path does not exist so not skeleton can be built")
'''
for root, dirs, files in os.walk("."):
path = root.split('/')
print (len(path) - 1) *'---' , os.path.basename(root) ... | <commit_before>def build(source_path, overwrite = True):
pass<commit_msg>Make the first test pass by checking if source_path argument exists<commit_after> | import os.path
def build(source_path, overwrite = True):
if not os.path.exists(source_path):
raise IOError("source_path does not exist so not skeleton can be built")
'''
for root, dirs, files in os.walk("."):
path = root.split('/')
print (len(path) - 1) *'---' , os.path.basename(root) ... | def build(source_path, overwrite = True):
passMake the first test pass by checking if source_path argument existsimport os.path
def build(source_path, overwrite = True):
if not os.path.exists(source_path):
raise IOError("source_path does not exist so not skeleton can be built")
'''
for root, d... | <commit_before>def build(source_path, overwrite = True):
pass<commit_msg>Make the first test pass by checking if source_path argument exists<commit_after>import os.path
def build(source_path, overwrite = True):
if not os.path.exists(source_path):
raise IOError("source_path does not exist so not skelet... |
3bbe101f609349c2475079f052d5400e77822237 | common/my_filters.py | common/my_filters.py | from google.appengine.ext import webapp
import re
# More info on custom Django template filters here:
# https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#registering-custom-filters
register = webapp.template.create_template_register()
@register.filter
def digits(value):
return re.sub('[^0-9]', '... | from google.appengine.ext import webapp
from helpers.youtube_video_helper import YouTubeVideoHelper
import re
# More info on custom Django template filters here:
# https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#registering-custom-filters
register = webapp.template.create_template_register()
@regi... | Fix video suggestion review showing wrong time | Fix video suggestion review showing wrong time
| Python | mit | nwalters512/the-blue-alliance,verycumbersome/the-blue-alliance,tsteward/the-blue-alliance,tsteward/the-blue-alliance,fangeugene/the-blue-alliance,the-blue-alliance/the-blue-alliance,nwalters512/the-blue-alliance,fangeugene/the-blue-alliance,jaredhasenklein/the-blue-alliance,bdaroz/the-blue-alliance,the-blue-alliance/th... | from google.appengine.ext import webapp
import re
# More info on custom Django template filters here:
# https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#registering-custom-filters
register = webapp.template.create_template_register()
@register.filter
def digits(value):
return re.sub('[^0-9]', '... | from google.appengine.ext import webapp
from helpers.youtube_video_helper import YouTubeVideoHelper
import re
# More info on custom Django template filters here:
# https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#registering-custom-filters
register = webapp.template.create_template_register()
@regi... | <commit_before>from google.appengine.ext import webapp
import re
# More info on custom Django template filters here:
# https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#registering-custom-filters
register = webapp.template.create_template_register()
@register.filter
def digits(value):
return re.... | from google.appengine.ext import webapp
from helpers.youtube_video_helper import YouTubeVideoHelper
import re
# More info on custom Django template filters here:
# https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#registering-custom-filters
register = webapp.template.create_template_register()
@regi... | from google.appengine.ext import webapp
import re
# More info on custom Django template filters here:
# https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#registering-custom-filters
register = webapp.template.create_template_register()
@register.filter
def digits(value):
return re.sub('[^0-9]', '... | <commit_before>from google.appengine.ext import webapp
import re
# More info on custom Django template filters here:
# https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#registering-custom-filters
register = webapp.template.create_template_register()
@register.filter
def digits(value):
return re.... |
34575124ea6b16f7a7d4f2ae5e073a87709843d2 | engine/meta.py | engine/meta.py | registered = {}
class GObjectMeta(type):
def __new__(cls, name, bases, dict):
c = super().__new__(cls, name, bases, dict)
qualname = '{}.{}'.format(c.__module__, c.__qualname__)
if qualname in registered:
print(cls, qualname)
c = type(name, (registered[qualname], c),... | registered = {}
created = {}
class GObjectMeta(type):
def __new__(cls, name, bases, dict):
c = super().__new__(cls, name, bases, dict)
# Do not handle classes that are already decorated
if c.__module__.startswith('<meta>'):
return c
# Fullname of the class (base module... | Add __fullname__ attribute on all game classes | Add __fullname__ attribute on all game classes
| Python | bsd-3-clause | entwanne/NAGM | registered = {}
class GObjectMeta(type):
def __new__(cls, name, bases, dict):
c = super().__new__(cls, name, bases, dict)
qualname = '{}.{}'.format(c.__module__, c.__qualname__)
if qualname in registered:
print(cls, qualname)
c = type(name, (registered[qualname], c),... | registered = {}
created = {}
class GObjectMeta(type):
def __new__(cls, name, bases, dict):
c = super().__new__(cls, name, bases, dict)
# Do not handle classes that are already decorated
if c.__module__.startswith('<meta>'):
return c
# Fullname of the class (base module... | <commit_before>registered = {}
class GObjectMeta(type):
def __new__(cls, name, bases, dict):
c = super().__new__(cls, name, bases, dict)
qualname = '{}.{}'.format(c.__module__, c.__qualname__)
if qualname in registered:
print(cls, qualname)
c = type(name, (registered... | registered = {}
created = {}
class GObjectMeta(type):
def __new__(cls, name, bases, dict):
c = super().__new__(cls, name, bases, dict)
# Do not handle classes that are already decorated
if c.__module__.startswith('<meta>'):
return c
# Fullname of the class (base module... | registered = {}
class GObjectMeta(type):
def __new__(cls, name, bases, dict):
c = super().__new__(cls, name, bases, dict)
qualname = '{}.{}'.format(c.__module__, c.__qualname__)
if qualname in registered:
print(cls, qualname)
c = type(name, (registered[qualname], c),... | <commit_before>registered = {}
class GObjectMeta(type):
def __new__(cls, name, bases, dict):
c = super().__new__(cls, name, bases, dict)
qualname = '{}.{}'.format(c.__module__, c.__qualname__)
if qualname in registered:
print(cls, qualname)
c = type(name, (registered... |
95ccab69cfff30c24932c4cd156983a29639435d | nginxauthdaemon/crowdauth.py | nginxauthdaemon/crowdauth.py | import crowd
from auth import Authenticator
class CrowdAuthenticator(Authenticator):
"""Atlassian Crowd authenticator. Requires configuration options CROWD_URL, CROWD_APP_NAME, CROWD_APP_PASSWORD"""
def __init__(self, config):
super(CrowdAuthenticator, self).__init__(config)
app_url = config[... | import crowd
from auth import Authenticator
class CrowdAuthenticator(Authenticator):
"""Atlassian Crowd authenticator. Requires configuration options CROWD_URL, CROWD_APP_NAME, CROWD_APP_PASSWORD"""
def __init__(self, config):
super(CrowdAuthenticator, self).__init__(config)
app_url = config[... | Fix 500 error when Crowd auth is failed | Fix 500 error when Crowd auth is failed
| Python | mit | akurdyukov/nginxauthdaemon,akurdyukov/nginxauthdaemon | import crowd
from auth import Authenticator
class CrowdAuthenticator(Authenticator):
"""Atlassian Crowd authenticator. Requires configuration options CROWD_URL, CROWD_APP_NAME, CROWD_APP_PASSWORD"""
def __init__(self, config):
super(CrowdAuthenticator, self).__init__(config)
app_url = config[... | import crowd
from auth import Authenticator
class CrowdAuthenticator(Authenticator):
"""Atlassian Crowd authenticator. Requires configuration options CROWD_URL, CROWD_APP_NAME, CROWD_APP_PASSWORD"""
def __init__(self, config):
super(CrowdAuthenticator, self).__init__(config)
app_url = config[... | <commit_before>import crowd
from auth import Authenticator
class CrowdAuthenticator(Authenticator):
"""Atlassian Crowd authenticator. Requires configuration options CROWD_URL, CROWD_APP_NAME, CROWD_APP_PASSWORD"""
def __init__(self, config):
super(CrowdAuthenticator, self).__init__(config)
ap... | import crowd
from auth import Authenticator
class CrowdAuthenticator(Authenticator):
"""Atlassian Crowd authenticator. Requires configuration options CROWD_URL, CROWD_APP_NAME, CROWD_APP_PASSWORD"""
def __init__(self, config):
super(CrowdAuthenticator, self).__init__(config)
app_url = config[... | import crowd
from auth import Authenticator
class CrowdAuthenticator(Authenticator):
"""Atlassian Crowd authenticator. Requires configuration options CROWD_URL, CROWD_APP_NAME, CROWD_APP_PASSWORD"""
def __init__(self, config):
super(CrowdAuthenticator, self).__init__(config)
app_url = config[... | <commit_before>import crowd
from auth import Authenticator
class CrowdAuthenticator(Authenticator):
"""Atlassian Crowd authenticator. Requires configuration options CROWD_URL, CROWD_APP_NAME, CROWD_APP_PASSWORD"""
def __init__(self, config):
super(CrowdAuthenticator, self).__init__(config)
ap... |
6c2a154bf902b5f658b2c2cbf4b65c6ed33e6c1b | pywineds/utils.py | pywineds/utils.py |
"""
Exposes utility functions.
"""
from contextlib import contextmanager
import logging
import timeit
log = logging.getLogger("wineds")
@contextmanager
def time_it(task_desc):
"""
A context manager for timing chunks of code and logging it.
Arguments:
task_desc: task description for logging pur... |
"""
Exposes utility functions.
"""
from contextlib import contextmanager
import logging
import timeit
REPORTING_TYPE_ALL = ""
REPORTING_TYPE_ELD = "TC-Election Day Reporting"
REPORTING_TYPE_VBM = "TC-VBM Reporting"
REPORTING_KEYS_SIMPLE = (REPORTING_TYPE_ALL, )
REPORTING_KEYS_COMPLETE = (REPORTING_TYPE_ELD, REPOR... | Add some reporting_type global variables. | Add some reporting_type global variables.
| Python | bsd-3-clause | cjerdonek/wineds-converter |
"""
Exposes utility functions.
"""
from contextlib import contextmanager
import logging
import timeit
log = logging.getLogger("wineds")
@contextmanager
def time_it(task_desc):
"""
A context manager for timing chunks of code and logging it.
Arguments:
task_desc: task description for logging pur... |
"""
Exposes utility functions.
"""
from contextlib import contextmanager
import logging
import timeit
REPORTING_TYPE_ALL = ""
REPORTING_TYPE_ELD = "TC-Election Day Reporting"
REPORTING_TYPE_VBM = "TC-VBM Reporting"
REPORTING_KEYS_SIMPLE = (REPORTING_TYPE_ALL, )
REPORTING_KEYS_COMPLETE = (REPORTING_TYPE_ELD, REPOR... | <commit_before>
"""
Exposes utility functions.
"""
from contextlib import contextmanager
import logging
import timeit
log = logging.getLogger("wineds")
@contextmanager
def time_it(task_desc):
"""
A context manager for timing chunks of code and logging it.
Arguments:
task_desc: task description ... |
"""
Exposes utility functions.
"""
from contextlib import contextmanager
import logging
import timeit
REPORTING_TYPE_ALL = ""
REPORTING_TYPE_ELD = "TC-Election Day Reporting"
REPORTING_TYPE_VBM = "TC-VBM Reporting"
REPORTING_KEYS_SIMPLE = (REPORTING_TYPE_ALL, )
REPORTING_KEYS_COMPLETE = (REPORTING_TYPE_ELD, REPOR... |
"""
Exposes utility functions.
"""
from contextlib import contextmanager
import logging
import timeit
log = logging.getLogger("wineds")
@contextmanager
def time_it(task_desc):
"""
A context manager for timing chunks of code and logging it.
Arguments:
task_desc: task description for logging pur... | <commit_before>
"""
Exposes utility functions.
"""
from contextlib import contextmanager
import logging
import timeit
log = logging.getLogger("wineds")
@contextmanager
def time_it(task_desc):
"""
A context manager for timing chunks of code and logging it.
Arguments:
task_desc: task description ... |
febd7d8b113b8ef3ac9a843b873f4be5b203b53c | apps/bluebottle_utils/models.py | apps/bluebottle_utils/models.py | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
line1 = models.CharField(max_length=100, blank=True)
line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=True)
state ... | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
line1 = models.CharField(max_length=100, blank=True)
line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=True)
state ... | Update __unicode__ method in Address model for previous changes. | Update __unicode__ method in Address model for previous changes.
| Python | bsd-3-clause | onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
line1 = models.CharField(max_length=100, blank=True)
line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=True)
state ... | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
line1 = models.CharField(max_length=100, blank=True)
line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=True)
state ... | <commit_before>from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
line1 = models.CharField(max_length=100, blank=True)
line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=T... | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
line1 = models.CharField(max_length=100, blank=True)
line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=True)
state ... | from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
line1 = models.CharField(max_length=100, blank=True)
line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=True)
state ... | <commit_before>from django.db import models
from django_countries import CountryField
class Address(models.Model):
"""
A postal address.
"""
line1 = models.CharField(max_length=100, blank=True)
line2 = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=T... |
3b7658dd7783b789cd4632caa94f0ba044305418 | bugsnag/handlers.py | bugsnag/handlers.py | from __future__ import division, print_function, absolute_import
import logging
import bugsnag
class BugsnagHandler(logging.Handler):
def __init__(self, api_key=None):
super(BugsnagHandler, self).__init__()
# Check if API key has been specified.
if not bugsnag.configuration.api_key and no... | from __future__ import division, print_function, absolute_import
import logging
import bugsnag
class BugsnagHandler(logging.Handler):
def __init__(self, api_key=None):
super(BugsnagHandler, self).__init__()
# Check if API key has been specified.
if not bugsnag.configuration.api_key and no... | Send partial LogRecord event in extra ata | Send partial LogRecord event in extra ata
| Python | mit | overplumbum/bugsnag-python,overplumbum/bugsnag-python,bugsnag/bugsnag-python,bugsnag/bugsnag-python | from __future__ import division, print_function, absolute_import
import logging
import bugsnag
class BugsnagHandler(logging.Handler):
def __init__(self, api_key=None):
super(BugsnagHandler, self).__init__()
# Check if API key has been specified.
if not bugsnag.configuration.api_key and no... | from __future__ import division, print_function, absolute_import
import logging
import bugsnag
class BugsnagHandler(logging.Handler):
def __init__(self, api_key=None):
super(BugsnagHandler, self).__init__()
# Check if API key has been specified.
if not bugsnag.configuration.api_key and no... | <commit_before>from __future__ import division, print_function, absolute_import
import logging
import bugsnag
class BugsnagHandler(logging.Handler):
def __init__(self, api_key=None):
super(BugsnagHandler, self).__init__()
# Check if API key has been specified.
if not bugsnag.configuration... | from __future__ import division, print_function, absolute_import
import logging
import bugsnag
class BugsnagHandler(logging.Handler):
def __init__(self, api_key=None):
super(BugsnagHandler, self).__init__()
# Check if API key has been specified.
if not bugsnag.configuration.api_key and no... | from __future__ import division, print_function, absolute_import
import logging
import bugsnag
class BugsnagHandler(logging.Handler):
def __init__(self, api_key=None):
super(BugsnagHandler, self).__init__()
# Check if API key has been specified.
if not bugsnag.configuration.api_key and no... | <commit_before>from __future__ import division, print_function, absolute_import
import logging
import bugsnag
class BugsnagHandler(logging.Handler):
def __init__(self, api_key=None):
super(BugsnagHandler, self).__init__()
# Check if API key has been specified.
if not bugsnag.configuration... |
5cc0931b0b636c627efa3ada9abae29528799554 | machine/pentium/translator.py | machine/pentium/translator.py | '''Module for handling assembly language code.'''
import sys
import traceback
from transf import transformation
from transf import parse
from machine.pentium.data import *
from machine.pentium.binary import *
from machine.pentium.logical import *
from machine.pentium.shift import *
from machine.pentium.control impo... | '''Module for handling assembly language code.'''
import sys
import traceback
from transf import transformation
from transf import parse
import ir.check
from machine.pentium.data import *
from machine.pentium.binary import *
from machine.pentium.logical import *
from machine.pentium.shift import *
from machine.pen... | Check AST after translating statements. | Check AST after translating statements.
| Python | lgpl-2.1 | mewbak/idc,mewbak/idc | '''Module for handling assembly language code.'''
import sys
import traceback
from transf import transformation
from transf import parse
from machine.pentium.data import *
from machine.pentium.binary import *
from machine.pentium.logical import *
from machine.pentium.shift import *
from machine.pentium.control impo... | '''Module for handling assembly language code.'''
import sys
import traceback
from transf import transformation
from transf import parse
import ir.check
from machine.pentium.data import *
from machine.pentium.binary import *
from machine.pentium.logical import *
from machine.pentium.shift import *
from machine.pen... | <commit_before>'''Module for handling assembly language code.'''
import sys
import traceback
from transf import transformation
from transf import parse
from machine.pentium.data import *
from machine.pentium.binary import *
from machine.pentium.logical import *
from machine.pentium.shift import *
from machine.penti... | '''Module for handling assembly language code.'''
import sys
import traceback
from transf import transformation
from transf import parse
import ir.check
from machine.pentium.data import *
from machine.pentium.binary import *
from machine.pentium.logical import *
from machine.pentium.shift import *
from machine.pen... | '''Module for handling assembly language code.'''
import sys
import traceback
from transf import transformation
from transf import parse
from machine.pentium.data import *
from machine.pentium.binary import *
from machine.pentium.logical import *
from machine.pentium.shift import *
from machine.pentium.control impo... | <commit_before>'''Module for handling assembly language code.'''
import sys
import traceback
from transf import transformation
from transf import parse
from machine.pentium.data import *
from machine.pentium.binary import *
from machine.pentium.logical import *
from machine.pentium.shift import *
from machine.penti... |
21e9254abeebb7260f74db9c94e480cc2b5bbcc9 | tests/conftest.py | tests/conftest.py | import pytest
@pytest.fixture(scope='session')
def base_url(base_url, request):
return base_url or 'https://developer.allizom.org'
| import pytest
VIEWPORT = {
'large': {'width': 1201, 'height': 1024}, # also nav-break-ends
'desktop': {'width': 1025, 'height': 1024},
'tablet': {'width': 851, 'height': 1024}, # also nav-block-ends
'mobile': {'width': 481, 'height': 1024},
'small': {'width': 320, 'height': 480}}
@pytest.fixture(s... | Add viewport sizes fixture to tests. | Add viewport sizes fixture to tests.
| Python | mpl-2.0 | safwanrahman/kuma,Elchi3/kuma,mozilla/kuma,jwhitlock/kuma,SphinxKnight/kuma,SphinxKnight/kuma,Elchi3/kuma,mozilla/kuma,SphinxKnight/kuma,a2sheppy/kuma,safwanrahman/kuma,Elchi3/kuma,mozilla/kuma,yfdyh000/kuma,yfdyh000/kuma,SphinxKnight/kuma,safwanrahman/kuma,a2sheppy/kuma,yfdyh000/kuma,yfdyh000/kuma,safwanrahman/kuma,Sp... | import pytest
@pytest.fixture(scope='session')
def base_url(base_url, request):
return base_url or 'https://developer.allizom.org'
Add viewport sizes fixture to tests. | import pytest
VIEWPORT = {
'large': {'width': 1201, 'height': 1024}, # also nav-break-ends
'desktop': {'width': 1025, 'height': 1024},
'tablet': {'width': 851, 'height': 1024}, # also nav-block-ends
'mobile': {'width': 481, 'height': 1024},
'small': {'width': 320, 'height': 480}}
@pytest.fixture(s... | <commit_before>import pytest
@pytest.fixture(scope='session')
def base_url(base_url, request):
return base_url or 'https://developer.allizom.org'
<commit_msg>Add viewport sizes fixture to tests.<commit_after> | import pytest
VIEWPORT = {
'large': {'width': 1201, 'height': 1024}, # also nav-break-ends
'desktop': {'width': 1025, 'height': 1024},
'tablet': {'width': 851, 'height': 1024}, # also nav-block-ends
'mobile': {'width': 481, 'height': 1024},
'small': {'width': 320, 'height': 480}}
@pytest.fixture(s... | import pytest
@pytest.fixture(scope='session')
def base_url(base_url, request):
return base_url or 'https://developer.allizom.org'
Add viewport sizes fixture to tests.import pytest
VIEWPORT = {
'large': {'width': 1201, 'height': 1024}, # also nav-break-ends
'desktop': {'width': 1025, 'height': 1024},
... | <commit_before>import pytest
@pytest.fixture(scope='session')
def base_url(base_url, request):
return base_url or 'https://developer.allizom.org'
<commit_msg>Add viewport sizes fixture to tests.<commit_after>import pytest
VIEWPORT = {
'large': {'width': 1201, 'height': 1024}, # also nav-break-ends
'desk... |
8691191000af0ad736f6b4bedf720e972ab962a8 | tests/conftest.py | tests/conftest.py | # Do not run actual tests in linter environments.
def pytest_collection_modifyitems(session, config, items):
for linter in ["flake8", "black", "isort"]:
try:
if config.getoption("--" + linter):
items[:] = [item for item in items if item.get_marker(linter)]
except ValueE... | # Do not run actual tests in linter environments.
def pytest_collection_modifyitems(session, config, items):
for linter in ["flake8", "black", "isort"]:
try:
if config.getoption("--" + linter):
items[:] = [item for item in items if item.get_closest_marker(linter)]
excep... | Correct pytest linter test collection. | Correct pytest linter test collection.
| Python | bsd-2-clause | proofit404/dependencies,proofit404/dependencies,proofit404/dependencies,proofit404/dependencies | # Do not run actual tests in linter environments.
def pytest_collection_modifyitems(session, config, items):
for linter in ["flake8", "black", "isort"]:
try:
if config.getoption("--" + linter):
items[:] = [item for item in items if item.get_marker(linter)]
except ValueE... | # Do not run actual tests in linter environments.
def pytest_collection_modifyitems(session, config, items):
for linter in ["flake8", "black", "isort"]:
try:
if config.getoption("--" + linter):
items[:] = [item for item in items if item.get_closest_marker(linter)]
excep... | <commit_before># Do not run actual tests in linter environments.
def pytest_collection_modifyitems(session, config, items):
for linter in ["flake8", "black", "isort"]:
try:
if config.getoption("--" + linter):
items[:] = [item for item in items if item.get_marker(linter)]
... | # Do not run actual tests in linter environments.
def pytest_collection_modifyitems(session, config, items):
for linter in ["flake8", "black", "isort"]:
try:
if config.getoption("--" + linter):
items[:] = [item for item in items if item.get_closest_marker(linter)]
excep... | # Do not run actual tests in linter environments.
def pytest_collection_modifyitems(session, config, items):
for linter in ["flake8", "black", "isort"]:
try:
if config.getoption("--" + linter):
items[:] = [item for item in items if item.get_marker(linter)]
except ValueE... | <commit_before># Do not run actual tests in linter environments.
def pytest_collection_modifyitems(session, config, items):
for linter in ["flake8", "black", "isort"]:
try:
if config.getoption("--" + linter):
items[:] = [item for item in items if item.get_marker(linter)]
... |
534633d078fe6f81e67ead075ac31faac0c3c60d | tests/__init__.py | tests/__init__.py | import pycurl
def setup_package():
print('Testing %s' % pycurl.version)
| def setup_package():
# import here, not globally, so that running
# python -m tests.appmanager
# to launch the app manager is possible without having pycurl installed
# (as the test app does not depend on pycurl)
import pycurl
print('Testing %s' % pycurl.version)
| Make it possible to run test app without pycurl being installed | Make it possible to run test app without pycurl being installed
| Python | lgpl-2.1 | pycurl/pycurl,pycurl/pycurl,pycurl/pycurl | import pycurl
def setup_package():
print('Testing %s' % pycurl.version)
Make it possible to run test app without pycurl being installed | def setup_package():
# import here, not globally, so that running
# python -m tests.appmanager
# to launch the app manager is possible without having pycurl installed
# (as the test app does not depend on pycurl)
import pycurl
print('Testing %s' % pycurl.version)
| <commit_before>import pycurl
def setup_package():
print('Testing %s' % pycurl.version)
<commit_msg>Make it possible to run test app without pycurl being installed<commit_after> | def setup_package():
# import here, not globally, so that running
# python -m tests.appmanager
# to launch the app manager is possible without having pycurl installed
# (as the test app does not depend on pycurl)
import pycurl
print('Testing %s' % pycurl.version)
| import pycurl
def setup_package():
print('Testing %s' % pycurl.version)
Make it possible to run test app without pycurl being installeddef setup_package():
# import here, not globally, so that running
# python -m tests.appmanager
# to launch the app manager is possible without having pycurl installed
... | <commit_before>import pycurl
def setup_package():
print('Testing %s' % pycurl.version)
<commit_msg>Make it possible to run test app without pycurl being installed<commit_after>def setup_package():
# import here, not globally, so that running
# python -m tests.appmanager
# to launch the app manager is p... |
0909837d93c44acc7374a7dee50e7eb869999e92 | geotrek/settings/dev.py | geotrek/settings/dev.py | from .default import * # NOQA
#
# Django Development
# ..........................
DEBUG = True
TEMPLATE_DEBUG = True
SOUTH_TESTS_MIGRATE = False # Tested at settings.tests
#
# Developper additions
# ..........................
INSTALLED_APPS = (
'debug_toolbar',
'django_extensions',
) + INSTALLED_APPS
IN... | from .default import * # NOQA
#
# Django Development
# ..........................
DEBUG = True
TEMPLATE_DEBUG = True
SOUTH_TESTS_MIGRATE = False # Tested at settings.tests
#
# Developper additions
# ..........................
INSTALLED_APPS = (
# 'debug_toolbar',
'django_extensions',
) + INSTALLED_APPS
... | Disable debug toolbar. It creates import problems | Disable debug toolbar. It creates import problems
| Python | bsd-2-clause | makinacorpus/Geotrek,Anaethelion/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,Anaethelion/Geotrek,Anaethelion/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,Anaethelion/Geotrek,GeotrekCE/Geotrek-admin | from .default import * # NOQA
#
# Django Development
# ..........................
DEBUG = True
TEMPLATE_DEBUG = True
SOUTH_TESTS_MIGRATE = False # Tested at settings.tests
#
# Developper additions
# ..........................
INSTALLED_APPS = (
'debug_toolbar',
'django_extensions',
) + INSTALLED_APPS
IN... | from .default import * # NOQA
#
# Django Development
# ..........................
DEBUG = True
TEMPLATE_DEBUG = True
SOUTH_TESTS_MIGRATE = False # Tested at settings.tests
#
# Developper additions
# ..........................
INSTALLED_APPS = (
# 'debug_toolbar',
'django_extensions',
) + INSTALLED_APPS
... | <commit_before>from .default import * # NOQA
#
# Django Development
# ..........................
DEBUG = True
TEMPLATE_DEBUG = True
SOUTH_TESTS_MIGRATE = False # Tested at settings.tests
#
# Developper additions
# ..........................
INSTALLED_APPS = (
'debug_toolbar',
'django_extensions',
) + INS... | from .default import * # NOQA
#
# Django Development
# ..........................
DEBUG = True
TEMPLATE_DEBUG = True
SOUTH_TESTS_MIGRATE = False # Tested at settings.tests
#
# Developper additions
# ..........................
INSTALLED_APPS = (
# 'debug_toolbar',
'django_extensions',
) + INSTALLED_APPS
... | from .default import * # NOQA
#
# Django Development
# ..........................
DEBUG = True
TEMPLATE_DEBUG = True
SOUTH_TESTS_MIGRATE = False # Tested at settings.tests
#
# Developper additions
# ..........................
INSTALLED_APPS = (
'debug_toolbar',
'django_extensions',
) + INSTALLED_APPS
IN... | <commit_before>from .default import * # NOQA
#
# Django Development
# ..........................
DEBUG = True
TEMPLATE_DEBUG = True
SOUTH_TESTS_MIGRATE = False # Tested at settings.tests
#
# Developper additions
# ..........................
INSTALLED_APPS = (
'debug_toolbar',
'django_extensions',
) + INS... |
f4479b3aa7828e646e3a26493a1b8dfe9174e209 | betty/conf/urls.py | betty/conf/urls.py | try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from .app import settings
from django.conf.urls.static import static
try:
from django.conf.urls import include, patterns, url
except ImportError:
# django < 1.5 compat
from django.conf.urls.defaults import inc... | try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from .app import settings
from django.conf.urls.static import static
try:
from django.conf.urls import include, patterns, url
except ImportError:
# django < 1.5 compat
from django.conf.urls.defaults import inc... | Append trailing slash to BETTY_IMAGE_URL if not present | Append trailing slash to BETTY_IMAGE_URL if not present
| Python | mit | theonion/betty-cropper,theonion/betty-cropper,theonion/betty-cropper,theonion/betty-cropper | try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from .app import settings
from django.conf.urls.static import static
try:
from django.conf.urls import include, patterns, url
except ImportError:
# django < 1.5 compat
from django.conf.urls.defaults import inc... | try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from .app import settings
from django.conf.urls.static import static
try:
from django.conf.urls import include, patterns, url
except ImportError:
# django < 1.5 compat
from django.conf.urls.defaults import inc... | <commit_before>try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from .app import settings
from django.conf.urls.static import static
try:
from django.conf.urls import include, patterns, url
except ImportError:
# django < 1.5 compat
from django.conf.urls.defa... | try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from .app import settings
from django.conf.urls.static import static
try:
from django.conf.urls import include, patterns, url
except ImportError:
# django < 1.5 compat
from django.conf.urls.defaults import inc... | try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from .app import settings
from django.conf.urls.static import static
try:
from django.conf.urls import include, patterns, url
except ImportError:
# django < 1.5 compat
from django.conf.urls.defaults import inc... | <commit_before>try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from .app import settings
from django.conf.urls.static import static
try:
from django.conf.urls import include, patterns, url
except ImportError:
# django < 1.5 compat
from django.conf.urls.defa... |
1b9622cedecef0c6c45c11a84bd178adcff752e2 | squadron/exthandlers/download.py | squadron/exthandlers/download.py | import urllib
from extutils import get_filename
from template import render
import requests
import yaml
import jsonschema
SCHEMA = {
'$schema': 'http://json-schema.org/draft-04/schema#',
'description': 'Describes the extract extension handler input',
'type':'object',
'properties': {
'url': {
... | import urllib
from extutils import get_filename
from template import render
import requests
import yaml
import jsonschema
SCHEMA = {
'$schema': 'http://json-schema.org/draft-04/schema#',
'description': 'Describes the extract extension handler input',
'type':'object',
'properties': {
'url': {
... | Raise Exception when there's an HTTP error | Raise Exception when there's an HTTP error
| Python | mit | gosquadron/squadron,gosquadron/squadron | import urllib
from extutils import get_filename
from template import render
import requests
import yaml
import jsonschema
SCHEMA = {
'$schema': 'http://json-schema.org/draft-04/schema#',
'description': 'Describes the extract extension handler input',
'type':'object',
'properties': {
'url': {
... | import urllib
from extutils import get_filename
from template import render
import requests
import yaml
import jsonschema
SCHEMA = {
'$schema': 'http://json-schema.org/draft-04/schema#',
'description': 'Describes the extract extension handler input',
'type':'object',
'properties': {
'url': {
... | <commit_before>import urllib
from extutils import get_filename
from template import render
import requests
import yaml
import jsonschema
SCHEMA = {
'$schema': 'http://json-schema.org/draft-04/schema#',
'description': 'Describes the extract extension handler input',
'type':'object',
'properties': {
... | import urllib
from extutils import get_filename
from template import render
import requests
import yaml
import jsonschema
SCHEMA = {
'$schema': 'http://json-schema.org/draft-04/schema#',
'description': 'Describes the extract extension handler input',
'type':'object',
'properties': {
'url': {
... | import urllib
from extutils import get_filename
from template import render
import requests
import yaml
import jsonschema
SCHEMA = {
'$schema': 'http://json-schema.org/draft-04/schema#',
'description': 'Describes the extract extension handler input',
'type':'object',
'properties': {
'url': {
... | <commit_before>import urllib
from extutils import get_filename
from template import render
import requests
import yaml
import jsonschema
SCHEMA = {
'$schema': 'http://json-schema.org/draft-04/schema#',
'description': 'Describes the extract extension handler input',
'type':'object',
'properties': {
... |
7e51d073952d10d3994fb93458e60c03b6746099 | app/services/g6importService.py | app/services/g6importService.py | import json
import jsonschema
from flask import current_app
from jsonschema import validate
with open("schemata/g6-scs-schema.json") as json_file1:
G6_SCS_SCHEMA = json.load(json_file1)
with open("schemata/g6-saas-schema.json") as json_file2:
G6_SAAS_SCHEMA = json.load(json_file2)
with open("schemata/g6-iaas... | import json
import jsonschema
from jsonschema import validate
with open("schemata/g6-scs-schema.json") as json_file1:
G6_SCS_SCHEMA = json.load(json_file1)
with open("schemata/g6-saas-schema.json") as json_file2:
G6_SAAS_SCHEMA = json.load(json_file2)
with open("schemata/g6-iaas-schema.json") as json_file3:
... | Improve code by avoiding flow through exception handling | Improve code by avoiding flow through exception handling
| Python | mit | RichardKnop/digitalmarketplace-api,mtekel/digitalmarketplace-api,mtekel/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,RichardKnop/digitalmarketplace-api,alphagov/digitalmarketplace-api,RichardKnop/digitalmarketplace-api,mtekel/digitalmarketplace-api,RichardKnop/digitalmarketplac... | import json
import jsonschema
from flask import current_app
from jsonschema import validate
with open("schemata/g6-scs-schema.json") as json_file1:
G6_SCS_SCHEMA = json.load(json_file1)
with open("schemata/g6-saas-schema.json") as json_file2:
G6_SAAS_SCHEMA = json.load(json_file2)
with open("schemata/g6-iaas... | import json
import jsonschema
from jsonschema import validate
with open("schemata/g6-scs-schema.json") as json_file1:
G6_SCS_SCHEMA = json.load(json_file1)
with open("schemata/g6-saas-schema.json") as json_file2:
G6_SAAS_SCHEMA = json.load(json_file2)
with open("schemata/g6-iaas-schema.json") as json_file3:
... | <commit_before>import json
import jsonschema
from flask import current_app
from jsonschema import validate
with open("schemata/g6-scs-schema.json") as json_file1:
G6_SCS_SCHEMA = json.load(json_file1)
with open("schemata/g6-saas-schema.json") as json_file2:
G6_SAAS_SCHEMA = json.load(json_file2)
with open("s... | import json
import jsonschema
from jsonschema import validate
with open("schemata/g6-scs-schema.json") as json_file1:
G6_SCS_SCHEMA = json.load(json_file1)
with open("schemata/g6-saas-schema.json") as json_file2:
G6_SAAS_SCHEMA = json.load(json_file2)
with open("schemata/g6-iaas-schema.json") as json_file3:
... | import json
import jsonschema
from flask import current_app
from jsonschema import validate
with open("schemata/g6-scs-schema.json") as json_file1:
G6_SCS_SCHEMA = json.load(json_file1)
with open("schemata/g6-saas-schema.json") as json_file2:
G6_SAAS_SCHEMA = json.load(json_file2)
with open("schemata/g6-iaas... | <commit_before>import json
import jsonschema
from flask import current_app
from jsonschema import validate
with open("schemata/g6-scs-schema.json") as json_file1:
G6_SCS_SCHEMA = json.load(json_file1)
with open("schemata/g6-saas-schema.json") as json_file2:
G6_SAAS_SCHEMA = json.load(json_file2)
with open("s... |
b2aa4e4375dfea9c20a8242edeed495e649acc1a | vroom/graphics.py | vroom/graphics.py | import pygame
class Graphic:
car_color = (255, 50, 50)
car_width = 3
road_color = (255, 255, 255)
road_width = 6
draw_methods = {
'Car': 'draw_car',
'Road': 'draw_road',
}
def __init__(self, surface):
self.surface = surface
def draw(self, obj):
object_... | import pygame
class Graphic:
car_color = (255, 50, 50)
car_width = 3
road_color = (255, 255, 255)
road_width = 6
draw_methods = {
'Car': 'draw_car',
'Road': 'draw_road',
}
def __init__(self, surface):
self.surface = surface
def draw(self, obj):
object_... | Make car colors easier to read | Make car colors easier to read
| Python | mit | thibault/vroom | import pygame
class Graphic:
car_color = (255, 50, 50)
car_width = 3
road_color = (255, 255, 255)
road_width = 6
draw_methods = {
'Car': 'draw_car',
'Road': 'draw_road',
}
def __init__(self, surface):
self.surface = surface
def draw(self, obj):
object_... | import pygame
class Graphic:
car_color = (255, 50, 50)
car_width = 3
road_color = (255, 255, 255)
road_width = 6
draw_methods = {
'Car': 'draw_car',
'Road': 'draw_road',
}
def __init__(self, surface):
self.surface = surface
def draw(self, obj):
object_... | <commit_before>import pygame
class Graphic:
car_color = (255, 50, 50)
car_width = 3
road_color = (255, 255, 255)
road_width = 6
draw_methods = {
'Car': 'draw_car',
'Road': 'draw_road',
}
def __init__(self, surface):
self.surface = surface
def draw(self, obj):
... | import pygame
class Graphic:
car_color = (255, 50, 50)
car_width = 3
road_color = (255, 255, 255)
road_width = 6
draw_methods = {
'Car': 'draw_car',
'Road': 'draw_road',
}
def __init__(self, surface):
self.surface = surface
def draw(self, obj):
object_... | import pygame
class Graphic:
car_color = (255, 50, 50)
car_width = 3
road_color = (255, 255, 255)
road_width = 6
draw_methods = {
'Car': 'draw_car',
'Road': 'draw_road',
}
def __init__(self, surface):
self.surface = surface
def draw(self, obj):
object_... | <commit_before>import pygame
class Graphic:
car_color = (255, 50, 50)
car_width = 3
road_color = (255, 255, 255)
road_width = 6
draw_methods = {
'Car': 'draw_car',
'Road': 'draw_road',
}
def __init__(self, surface):
self.surface = surface
def draw(self, obj):
... |
135d4ff79a9a650442548fa5acf44f2dbcd20c0e | voltron/common.py | voltron/common.py | import os
import logging
import logging.config
LOG_CONFIG = {
'version': 1,
'formatters': {
'standard': {'format': 'voltron: [%(levelname)s] %(message)s'}
},
'handlers': {
'default': {
'class': 'logging.StreamHandler',
'formatter': 'standard'
}
},
... | import os
import logging
import logging.config
LOG_CONFIG = {
'version': 1,
'formatters': {
'standard': {'format': 'voltron: [%(levelname)s] %(message)s'}
},
'handlers': {
'default': {
'class': 'logging.StreamHandler',
'formatter': 'standard'
}
},
... | Create some shims for py3k | Create some shims for py3k
| Python | mit | snare/voltron,snare/voltron,snare/voltron,snare/voltron | import os
import logging
import logging.config
LOG_CONFIG = {
'version': 1,
'formatters': {
'standard': {'format': 'voltron: [%(levelname)s] %(message)s'}
},
'handlers': {
'default': {
'class': 'logging.StreamHandler',
'formatter': 'standard'
}
},
... | import os
import logging
import logging.config
LOG_CONFIG = {
'version': 1,
'formatters': {
'standard': {'format': 'voltron: [%(levelname)s] %(message)s'}
},
'handlers': {
'default': {
'class': 'logging.StreamHandler',
'formatter': 'standard'
}
},
... | <commit_before>import os
import logging
import logging.config
LOG_CONFIG = {
'version': 1,
'formatters': {
'standard': {'format': 'voltron: [%(levelname)s] %(message)s'}
},
'handlers': {
'default': {
'class': 'logging.StreamHandler',
'formatter': 'standard'
... | import os
import logging
import logging.config
LOG_CONFIG = {
'version': 1,
'formatters': {
'standard': {'format': 'voltron: [%(levelname)s] %(message)s'}
},
'handlers': {
'default': {
'class': 'logging.StreamHandler',
'formatter': 'standard'
}
},
... | import os
import logging
import logging.config
LOG_CONFIG = {
'version': 1,
'formatters': {
'standard': {'format': 'voltron: [%(levelname)s] %(message)s'}
},
'handlers': {
'default': {
'class': 'logging.StreamHandler',
'formatter': 'standard'
}
},
... | <commit_before>import os
import logging
import logging.config
LOG_CONFIG = {
'version': 1,
'formatters': {
'standard': {'format': 'voltron: [%(levelname)s] %(message)s'}
},
'handlers': {
'default': {
'class': 'logging.StreamHandler',
'formatter': 'standard'
... |
05ed4d54d48ddf6540f8dc0d162e4fc95337dbb6 | blah/commands.py | blah/commands.py | import os
import subprocess
import sys
def find_command(name):
return commands[name]
def what_is_this_command():
repository = find_current_repository()
if repository is None:
print "Could not find source control repository"
else:
print "{0}+file://{1}".format(repository.type, repositor... | import os
import subprocess
import sys
def find_command(name):
return commands[name]
def what_is_this_command():
directory = sys.argv[2] if len(sys.argv) > 2 else os.getcwd()
repository = find_repository(directory)
if repository is None:
print "Could not find source control repository"
els... | Allow path to be explicitly set when using what-is-this | Allow path to be explicitly set when using what-is-this
| Python | bsd-2-clause | mwilliamson/mayo | import os
import subprocess
import sys
def find_command(name):
return commands[name]
def what_is_this_command():
repository = find_current_repository()
if repository is None:
print "Could not find source control repository"
else:
print "{0}+file://{1}".format(repository.type, repositor... | import os
import subprocess
import sys
def find_command(name):
return commands[name]
def what_is_this_command():
directory = sys.argv[2] if len(sys.argv) > 2 else os.getcwd()
repository = find_repository(directory)
if repository is None:
print "Could not find source control repository"
els... | <commit_before>import os
import subprocess
import sys
def find_command(name):
return commands[name]
def what_is_this_command():
repository = find_current_repository()
if repository is None:
print "Could not find source control repository"
else:
print "{0}+file://{1}".format(repository.... | import os
import subprocess
import sys
def find_command(name):
return commands[name]
def what_is_this_command():
directory = sys.argv[2] if len(sys.argv) > 2 else os.getcwd()
repository = find_repository(directory)
if repository is None:
print "Could not find source control repository"
els... | import os
import subprocess
import sys
def find_command(name):
return commands[name]
def what_is_this_command():
repository = find_current_repository()
if repository is None:
print "Could not find source control repository"
else:
print "{0}+file://{1}".format(repository.type, repositor... | <commit_before>import os
import subprocess
import sys
def find_command(name):
return commands[name]
def what_is_this_command():
repository = find_current_repository()
if repository is None:
print "Could not find source control repository"
else:
print "{0}+file://{1}".format(repository.... |
675364683c5415f1db7a5599d8ad97f72f69aaf0 | buckets/utils.py | buckets/utils.py | import string
import random
from django.conf import settings
def validate_settings():
assert settings.AWS, \
"No AWS settings found"
assert settings.AWS.get('ACCESS_KEY'), \
"AWS access key is not set in settings"
assert settings.AWS.get('SECRET_KEY'), \
"AWS secret key is not set ... | import string
import random
from django.conf import settings
def validate_settings():
assert settings.AWS, \
"No AWS settings found"
assert settings.AWS.get('ACCESS_KEY'), \
"AWS access key is not set in settings"
assert settings.AWS.get('SECRET_KEY'), \
"AWS secret key is not set ... | Make random IDs start with a letter | Make random IDs start with a letter
| Python | agpl-3.0 | Cadasta/django-buckets,Cadasta/django-buckets,Cadasta/django-buckets | import string
import random
from django.conf import settings
def validate_settings():
assert settings.AWS, \
"No AWS settings found"
assert settings.AWS.get('ACCESS_KEY'), \
"AWS access key is not set in settings"
assert settings.AWS.get('SECRET_KEY'), \
"AWS secret key is not set ... | import string
import random
from django.conf import settings
def validate_settings():
assert settings.AWS, \
"No AWS settings found"
assert settings.AWS.get('ACCESS_KEY'), \
"AWS access key is not set in settings"
assert settings.AWS.get('SECRET_KEY'), \
"AWS secret key is not set ... | <commit_before>import string
import random
from django.conf import settings
def validate_settings():
assert settings.AWS, \
"No AWS settings found"
assert settings.AWS.get('ACCESS_KEY'), \
"AWS access key is not set in settings"
assert settings.AWS.get('SECRET_KEY'), \
"AWS secret ... | import string
import random
from django.conf import settings
def validate_settings():
assert settings.AWS, \
"No AWS settings found"
assert settings.AWS.get('ACCESS_KEY'), \
"AWS access key is not set in settings"
assert settings.AWS.get('SECRET_KEY'), \
"AWS secret key is not set ... | import string
import random
from django.conf import settings
def validate_settings():
assert settings.AWS, \
"No AWS settings found"
assert settings.AWS.get('ACCESS_KEY'), \
"AWS access key is not set in settings"
assert settings.AWS.get('SECRET_KEY'), \
"AWS secret key is not set ... | <commit_before>import string
import random
from django.conf import settings
def validate_settings():
assert settings.AWS, \
"No AWS settings found"
assert settings.AWS.get('ACCESS_KEY'), \
"AWS access key is not set in settings"
assert settings.AWS.get('SECRET_KEY'), \
"AWS secret ... |
c298abfddbdf83a12ab6c826dbb3562fb358e963 | foyer/tests/test_performance.py | foyer/tests/test_performance.py | import mbuild as mb
import parmed as pmd
import pytest
from foyer import Forcefield
from foyer.tests.utils import get_fn
from foyer.utils.io import has_mbuild
@pytest.mark.timeout(1)
def test_fullerene():
fullerene = pmd.load_file(get_fn('fullerene.pdb'), structure=True)
forcefield = Forcefield(get_fn('fulle... | import mbuild as mb
import parmed as pmd
import pytest
from foyer import Forcefield
from foyer.tests.utils import get_fn
from foyer.utils.io import has_mbuild
@pytest.mark.timeout(1)
def test_fullerene():
fullerene = pmd.load_file(get_fn('fullerene.pdb'), structure=True)
forcefield = Forcefield(get_fn('fulle... | Drop a timeout time to its previous value | Drop a timeout time to its previous value
| Python | mit | mosdef-hub/foyer,iModels/foyer,mosdef-hub/foyer,iModels/foyer | import mbuild as mb
import parmed as pmd
import pytest
from foyer import Forcefield
from foyer.tests.utils import get_fn
from foyer.utils.io import has_mbuild
@pytest.mark.timeout(1)
def test_fullerene():
fullerene = pmd.load_file(get_fn('fullerene.pdb'), structure=True)
forcefield = Forcefield(get_fn('fulle... | import mbuild as mb
import parmed as pmd
import pytest
from foyer import Forcefield
from foyer.tests.utils import get_fn
from foyer.utils.io import has_mbuild
@pytest.mark.timeout(1)
def test_fullerene():
fullerene = pmd.load_file(get_fn('fullerene.pdb'), structure=True)
forcefield = Forcefield(get_fn('fulle... | <commit_before>import mbuild as mb
import parmed as pmd
import pytest
from foyer import Forcefield
from foyer.tests.utils import get_fn
from foyer.utils.io import has_mbuild
@pytest.mark.timeout(1)
def test_fullerene():
fullerene = pmd.load_file(get_fn('fullerene.pdb'), structure=True)
forcefield = Forcefiel... | import mbuild as mb
import parmed as pmd
import pytest
from foyer import Forcefield
from foyer.tests.utils import get_fn
from foyer.utils.io import has_mbuild
@pytest.mark.timeout(1)
def test_fullerene():
fullerene = pmd.load_file(get_fn('fullerene.pdb'), structure=True)
forcefield = Forcefield(get_fn('fulle... | import mbuild as mb
import parmed as pmd
import pytest
from foyer import Forcefield
from foyer.tests.utils import get_fn
from foyer.utils.io import has_mbuild
@pytest.mark.timeout(1)
def test_fullerene():
fullerene = pmd.load_file(get_fn('fullerene.pdb'), structure=True)
forcefield = Forcefield(get_fn('fulle... | <commit_before>import mbuild as mb
import parmed as pmd
import pytest
from foyer import Forcefield
from foyer.tests.utils import get_fn
from foyer.utils.io import has_mbuild
@pytest.mark.timeout(1)
def test_fullerene():
fullerene = pmd.load_file(get_fn('fullerene.pdb'), structure=True)
forcefield = Forcefiel... |
c3e2fccbc2a7afa0d146041c0b3392dd89aa5deb | analysis/plot-marker-trajectories.py | analysis/plot-marker-trajectories.py | import climate
import lmj.plot
import numpy as np
import source
import plots
@climate.annotate(
root='load experiment data from this directory',
pattern=('plot data from files matching this pattern', 'option'),
markers=('plot traces of these markers', 'option'),
spline=('interpolate data with a splin... | import climate
import lmj.plot
import numpy as np
import source
import plots
@climate.annotate(
root='load experiment data from this directory',
pattern=('plot data from files matching this pattern', 'option'),
markers=('plot traces of these markers', 'option'),
spline=('interpolate data with a splin... | Add SVT options to plotting script. | Add SVT options to plotting script.
| Python | mit | lmjohns3/cube-experiment,lmjohns3/cube-experiment,lmjohns3/cube-experiment | import climate
import lmj.plot
import numpy as np
import source
import plots
@climate.annotate(
root='load experiment data from this directory',
pattern=('plot data from files matching this pattern', 'option'),
markers=('plot traces of these markers', 'option'),
spline=('interpolate data with a splin... | import climate
import lmj.plot
import numpy as np
import source
import plots
@climate.annotate(
root='load experiment data from this directory',
pattern=('plot data from files matching this pattern', 'option'),
markers=('plot traces of these markers', 'option'),
spline=('interpolate data with a splin... | <commit_before>import climate
import lmj.plot
import numpy as np
import source
import plots
@climate.annotate(
root='load experiment data from this directory',
pattern=('plot data from files matching this pattern', 'option'),
markers=('plot traces of these markers', 'option'),
spline=('interpolate da... | import climate
import lmj.plot
import numpy as np
import source
import plots
@climate.annotate(
root='load experiment data from this directory',
pattern=('plot data from files matching this pattern', 'option'),
markers=('plot traces of these markers', 'option'),
spline=('interpolate data with a splin... | import climate
import lmj.plot
import numpy as np
import source
import plots
@climate.annotate(
root='load experiment data from this directory',
pattern=('plot data from files matching this pattern', 'option'),
markers=('plot traces of these markers', 'option'),
spline=('interpolate data with a splin... | <commit_before>import climate
import lmj.plot
import numpy as np
import source
import plots
@climate.annotate(
root='load experiment data from this directory',
pattern=('plot data from files matching this pattern', 'option'),
markers=('plot traces of these markers', 'option'),
spline=('interpolate da... |
d06adea5117eb3ebfddd8592889346089c7391f7 | dictlearn/wordnik_api_demo.py | dictlearn/wordnik_api_demo.py | from wordnik import swagger, WordApi, AccountApi
client = swagger.ApiClient(
'dd3d32ae6b4709e1150040139c308fb77446e0a8ecc93db31',
'https://api.wordnik.com/v4')
word_api = WordApi.WordApi(client)
words = ['paint', 'mimic', 'mimics', 'francie', 'frolic', 'funhouse']
for word in words:
print('=== {} ==='.for... | import nltk
from wordnik import swagger, WordApi, AccountApi
client = swagger.ApiClient(
'dd3d32ae6b4709e1150040139c308fb77446e0a8ecc93db31',
'https://api.wordnik.com/v4')
word_api = WordApi.WordApi(client)
toktok = nltk.ToktokTokenizer()
words = ['paint', 'mimic', 'mimics', 'francie', 'frolic', 'funhouse']
f... | Add tokenization to the WordNik demo | Add tokenization to the WordNik demo
| Python | mit | tombosc/dict_based_learning,tombosc/dict_based_learning | from wordnik import swagger, WordApi, AccountApi
client = swagger.ApiClient(
'dd3d32ae6b4709e1150040139c308fb77446e0a8ecc93db31',
'https://api.wordnik.com/v4')
word_api = WordApi.WordApi(client)
words = ['paint', 'mimic', 'mimics', 'francie', 'frolic', 'funhouse']
for word in words:
print('=== {} ==='.for... | import nltk
from wordnik import swagger, WordApi, AccountApi
client = swagger.ApiClient(
'dd3d32ae6b4709e1150040139c308fb77446e0a8ecc93db31',
'https://api.wordnik.com/v4')
word_api = WordApi.WordApi(client)
toktok = nltk.ToktokTokenizer()
words = ['paint', 'mimic', 'mimics', 'francie', 'frolic', 'funhouse']
f... | <commit_before>from wordnik import swagger, WordApi, AccountApi
client = swagger.ApiClient(
'dd3d32ae6b4709e1150040139c308fb77446e0a8ecc93db31',
'https://api.wordnik.com/v4')
word_api = WordApi.WordApi(client)
words = ['paint', 'mimic', 'mimics', 'francie', 'frolic', 'funhouse']
for word in words:
print('... | import nltk
from wordnik import swagger, WordApi, AccountApi
client = swagger.ApiClient(
'dd3d32ae6b4709e1150040139c308fb77446e0a8ecc93db31',
'https://api.wordnik.com/v4')
word_api = WordApi.WordApi(client)
toktok = nltk.ToktokTokenizer()
words = ['paint', 'mimic', 'mimics', 'francie', 'frolic', 'funhouse']
f... | from wordnik import swagger, WordApi, AccountApi
client = swagger.ApiClient(
'dd3d32ae6b4709e1150040139c308fb77446e0a8ecc93db31',
'https://api.wordnik.com/v4')
word_api = WordApi.WordApi(client)
words = ['paint', 'mimic', 'mimics', 'francie', 'frolic', 'funhouse']
for word in words:
print('=== {} ==='.for... | <commit_before>from wordnik import swagger, WordApi, AccountApi
client = swagger.ApiClient(
'dd3d32ae6b4709e1150040139c308fb77446e0a8ecc93db31',
'https://api.wordnik.com/v4')
word_api = WordApi.WordApi(client)
words = ['paint', 'mimic', 'mimics', 'francie', 'frolic', 'funhouse']
for word in words:
print('... |
a186a29ab028e601bd1f3dff0d37e09e412a7379 | bringing_buzzwords_home/urls.py | bringing_buzzwords_home/urls.py | from django.conf.urls import include, url
from django.contrib import admin
from visualize import views
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from rest_framework import routers
router = routers.DefaultRouter()
router.register(r'state', views.StateViewSet)
urlpatterns = [
url(r'^$', ... | from django.conf.urls import include, url
from django.contrib import admin
from visualize import views
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from rest_framework import routers
router = routers.DefaultRouter()
router.register(r'state', views.StateViewSet)
urlpatterns = [
url(r'^$', ... | Fix the trailing slash bug. | Fix the trailing slash bug.
| Python | mit | Bringing-Buzzwords-Home/bringing_buzzwords_home,Bringing-Buzzwords-Home/bringing_buzzwords_home,Bringing-Buzzwords-Home/bringing_buzzwords_home | from django.conf.urls import include, url
from django.contrib import admin
from visualize import views
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from rest_framework import routers
router = routers.DefaultRouter()
router.register(r'state', views.StateViewSet)
urlpatterns = [
url(r'^$', ... | from django.conf.urls import include, url
from django.contrib import admin
from visualize import views
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from rest_framework import routers
router = routers.DefaultRouter()
router.register(r'state', views.StateViewSet)
urlpatterns = [
url(r'^$', ... | <commit_before>from django.conf.urls import include, url
from django.contrib import admin
from visualize import views
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from rest_framework import routers
router = routers.DefaultRouter()
router.register(r'state', views.StateViewSet)
urlpatterns = [
... | from django.conf.urls import include, url
from django.contrib import admin
from visualize import views
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from rest_framework import routers
router = routers.DefaultRouter()
router.register(r'state', views.StateViewSet)
urlpatterns = [
url(r'^$', ... | from django.conf.urls import include, url
from django.contrib import admin
from visualize import views
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from rest_framework import routers
router = routers.DefaultRouter()
router.register(r'state', views.StateViewSet)
urlpatterns = [
url(r'^$', ... | <commit_before>from django.conf.urls import include, url
from django.contrib import admin
from visualize import views
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from rest_framework import routers
router = routers.DefaultRouter()
router.register(r'state', views.StateViewSet)
urlpatterns = [
... |
c2210463fc12121cd4de2a485d7d814d0ebe86b5 | robber/matchers/contain.py | robber/matchers/contain.py | from robber import expect
from base import Base
class Contain(Base):
"""
expect({'key': value}).to.contain('key')
expect([1, 2, 3]).to.contain(2)
"""
def matches(self):
return self.expected in self.actual
def failure_message(self):
return 'Expected {} to contain {}'.format(self... | from robber import expect
from base import Base
class Contain(Base):
"""
expect({'key': value}).to.contain('key')
expect([1, 2, 3]).to.contain(2)
"""
def matches(self):
return self.expected in self.actual
def failure_message(self):
return 'Expected {0} to contain {1}'.format(se... | Add numbers in string format For compatibility with python 2.6 | Add numbers in string format
For compatibility with python 2.6 | Python | mit | vesln/robber.py,taoenator/robber.py | from robber import expect
from base import Base
class Contain(Base):
"""
expect({'key': value}).to.contain('key')
expect([1, 2, 3]).to.contain(2)
"""
def matches(self):
return self.expected in self.actual
def failure_message(self):
return 'Expected {} to contain {}'.format(self... | from robber import expect
from base import Base
class Contain(Base):
"""
expect({'key': value}).to.contain('key')
expect([1, 2, 3]).to.contain(2)
"""
def matches(self):
return self.expected in self.actual
def failure_message(self):
return 'Expected {0} to contain {1}'.format(se... | <commit_before>from robber import expect
from base import Base
class Contain(Base):
"""
expect({'key': value}).to.contain('key')
expect([1, 2, 3]).to.contain(2)
"""
def matches(self):
return self.expected in self.actual
def failure_message(self):
return 'Expected {} to contain ... | from robber import expect
from base import Base
class Contain(Base):
"""
expect({'key': value}).to.contain('key')
expect([1, 2, 3]).to.contain(2)
"""
def matches(self):
return self.expected in self.actual
def failure_message(self):
return 'Expected {0} to contain {1}'.format(se... | from robber import expect
from base import Base
class Contain(Base):
"""
expect({'key': value}).to.contain('key')
expect([1, 2, 3]).to.contain(2)
"""
def matches(self):
return self.expected in self.actual
def failure_message(self):
return 'Expected {} to contain {}'.format(self... | <commit_before>from robber import expect
from base import Base
class Contain(Base):
"""
expect({'key': value}).to.contain('key')
expect([1, 2, 3]).to.contain(2)
"""
def matches(self):
return self.expected in self.actual
def failure_message(self):
return 'Expected {} to contain ... |
062e65a161f9c84e5cd18b85790b195eec947b99 | social_website_django_angular/social_website_django_angular/urls.py | social_website_django_angular/social_website_django_angular/urls.py | """social_website_django_angular URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home,... | """social_website_django_angular URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home,... | Set up url for index page | Set up url for index page
| Python | mit | tomaszzacharczuk/social-website-django-angular,tomaszzacharczuk/social-website-django-angular,tomaszzacharczuk/social-website-django-angular | """social_website_django_angular URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home,... | """social_website_django_angular URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home,... | <commit_before>"""social_website_django_angular URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^... | """social_website_django_angular URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home,... | """social_website_django_angular URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home,... | <commit_before>"""social_website_django_angular URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^... |
6fd1305f2a4a2e08b51c421b1c2cfdd33b407119 | src/puzzle/problems/problem.py | src/puzzle/problems/problem.py | from data import meta
class Problem(object):
def __init__(self, name, lines):
self.name = name
self.lines = lines
self._solutions = None
self._constraints = []
@property
def kind(self):
return str(type(self)).strip("'<>").split('.').pop()
@property
def solution(self):
return self.s... | from data import meta
_THRESHOLD = 0.01
class Problem(object):
def __init__(self, name, lines, threshold=_THRESHOLD):
self.name = name
self.lines = lines
self._threshold = threshold
self._solutions = None
self._constraints = [
lambda k, v: v > self._threshold
]
@property
def kind... | Set a threshold on Problem and enforce it. | Set a threshold on Problem and enforce it.
| Python | mit | PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge | from data import meta
class Problem(object):
def __init__(self, name, lines):
self.name = name
self.lines = lines
self._solutions = None
self._constraints = []
@property
def kind(self):
return str(type(self)).strip("'<>").split('.').pop()
@property
def solution(self):
return self.s... | from data import meta
_THRESHOLD = 0.01
class Problem(object):
def __init__(self, name, lines, threshold=_THRESHOLD):
self.name = name
self.lines = lines
self._threshold = threshold
self._solutions = None
self._constraints = [
lambda k, v: v > self._threshold
]
@property
def kind... | <commit_before>from data import meta
class Problem(object):
def __init__(self, name, lines):
self.name = name
self.lines = lines
self._solutions = None
self._constraints = []
@property
def kind(self):
return str(type(self)).strip("'<>").split('.').pop()
@property
def solution(self):
... | from data import meta
_THRESHOLD = 0.01
class Problem(object):
def __init__(self, name, lines, threshold=_THRESHOLD):
self.name = name
self.lines = lines
self._threshold = threshold
self._solutions = None
self._constraints = [
lambda k, v: v > self._threshold
]
@property
def kind... | from data import meta
class Problem(object):
def __init__(self, name, lines):
self.name = name
self.lines = lines
self._solutions = None
self._constraints = []
@property
def kind(self):
return str(type(self)).strip("'<>").split('.').pop()
@property
def solution(self):
return self.s... | <commit_before>from data import meta
class Problem(object):
def __init__(self, name, lines):
self.name = name
self.lines = lines
self._solutions = None
self._constraints = []
@property
def kind(self):
return str(type(self)).strip("'<>").split('.').pop()
@property
def solution(self):
... |
84c225a9ca7529bca74f853e7b23a1a750647d6f | campus02/urls.py | campus02/urls.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns(
'',
url(r'^', include('django.contrib.auth.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^web/', include('... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns(
'',
url(r'^', include('django.contrib.auth.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^web/', include('... | Fix URL routing for index page. | Fix URL routing for index page.
| Python | mit | fladi/django-campus02,fladi/django-campus02 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns(
'',
url(r'^', include('django.contrib.auth.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^web/', include('... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns(
'',
url(r'^', include('django.contrib.auth.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^web/', include('... | <commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns(
'',
url(r'^', include('django.contrib.auth.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^w... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns(
'',
url(r'^', include('django.contrib.auth.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^web/', include('... | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns(
'',
url(r'^', include('django.contrib.auth.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^web/', include('... | <commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns(
'',
url(r'^', include('django.contrib.auth.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^w... |
d44fee53020470e2d9a8cd2393f5f0125dbd1fab | python/client.py | python/client.py | import grpc
import hello_pb2
import hello_pb2_grpc
def run():
channel = grpc.insecure_channel('localhost:50051')
stub = hello_pb2_grpc.HelloServiceStub(channel)
# ideally, you should have try catch block here too
response = stub.SayHello(hello_pb2.HelloReq(Name='Euler'))
print(response.Result)
... | import grpc
import hello_pb2
import hello_pb2_grpc
def run():
channel = grpc.insecure_channel('localhost:50051')
stub = hello_pb2_grpc.HelloServiceStub(channel)
# ideally, you should have try catch block here too
response = stub.SayHello(hello_pb2.HelloReq(Name='Euler'))
print(response.Result)
... | Update python version for better error handling | Update python version for better error handling
| Python | mit | avinassh/grpc-errors,avinassh/grpc-errors,avinassh/grpc-errors,avinassh/grpc-errors,avinassh/grpc-errors,avinassh/grpc-errors,avinassh/grpc-errors,avinassh/grpc-errors | import grpc
import hello_pb2
import hello_pb2_grpc
def run():
channel = grpc.insecure_channel('localhost:50051')
stub = hello_pb2_grpc.HelloServiceStub(channel)
# ideally, you should have try catch block here too
response = stub.SayHello(hello_pb2.HelloReq(Name='Euler'))
print(response.Result)
... | import grpc
import hello_pb2
import hello_pb2_grpc
def run():
channel = grpc.insecure_channel('localhost:50051')
stub = hello_pb2_grpc.HelloServiceStub(channel)
# ideally, you should have try catch block here too
response = stub.SayHello(hello_pb2.HelloReq(Name='Euler'))
print(response.Result)
... | <commit_before>import grpc
import hello_pb2
import hello_pb2_grpc
def run():
channel = grpc.insecure_channel('localhost:50051')
stub = hello_pb2_grpc.HelloServiceStub(channel)
# ideally, you should have try catch block here too
response = stub.SayHello(hello_pb2.HelloReq(Name='Euler'))
print(resp... | import grpc
import hello_pb2
import hello_pb2_grpc
def run():
channel = grpc.insecure_channel('localhost:50051')
stub = hello_pb2_grpc.HelloServiceStub(channel)
# ideally, you should have try catch block here too
response = stub.SayHello(hello_pb2.HelloReq(Name='Euler'))
print(response.Result)
... | import grpc
import hello_pb2
import hello_pb2_grpc
def run():
channel = grpc.insecure_channel('localhost:50051')
stub = hello_pb2_grpc.HelloServiceStub(channel)
# ideally, you should have try catch block here too
response = stub.SayHello(hello_pb2.HelloReq(Name='Euler'))
print(response.Result)
... | <commit_before>import grpc
import hello_pb2
import hello_pb2_grpc
def run():
channel = grpc.insecure_channel('localhost:50051')
stub = hello_pb2_grpc.HelloServiceStub(channel)
# ideally, you should have try catch block here too
response = stub.SayHello(hello_pb2.HelloReq(Name='Euler'))
print(resp... |
97229a7e51279906254a7befa0456a4c89a9b0ea | planner/models.py | planner/models.py | from django.db import models
# Route model
# Start and end locations with additional stop-overs
class Route(models.Model):
origin = models.CharField(max_length=63)
destination = models.CharField(max_length=63)
class Waypoint(models.Model):
waypoint = models.CharField(max_length=63)
route = models.Fo... | from django.db import models
# Route model
# Start and end locations with additional stop-overs
class Route(models.Model):
origin = models.CharField(max_length=63)
destination = models.CharField(max_length=63)
def __unicode__(self):
return "{} to {}".format(
self.origin,
s... | Add unicode methods to model classes | Add unicode methods to model classes
| Python | apache-2.0 | jwarren116/RoadTrip,jwarren116/RoadTrip,jwarren116/RoadTrip | from django.db import models
# Route model
# Start and end locations with additional stop-overs
class Route(models.Model):
origin = models.CharField(max_length=63)
destination = models.CharField(max_length=63)
class Waypoint(models.Model):
waypoint = models.CharField(max_length=63)
route = models.Fo... | from django.db import models
# Route model
# Start and end locations with additional stop-overs
class Route(models.Model):
origin = models.CharField(max_length=63)
destination = models.CharField(max_length=63)
def __unicode__(self):
return "{} to {}".format(
self.origin,
s... | <commit_before>from django.db import models
# Route model
# Start and end locations with additional stop-overs
class Route(models.Model):
origin = models.CharField(max_length=63)
destination = models.CharField(max_length=63)
class Waypoint(models.Model):
waypoint = models.CharField(max_length=63)
ro... | from django.db import models
# Route model
# Start and end locations with additional stop-overs
class Route(models.Model):
origin = models.CharField(max_length=63)
destination = models.CharField(max_length=63)
def __unicode__(self):
return "{} to {}".format(
self.origin,
s... | from django.db import models
# Route model
# Start and end locations with additional stop-overs
class Route(models.Model):
origin = models.CharField(max_length=63)
destination = models.CharField(max_length=63)
class Waypoint(models.Model):
waypoint = models.CharField(max_length=63)
route = models.Fo... | <commit_before>from django.db import models
# Route model
# Start and end locations with additional stop-overs
class Route(models.Model):
origin = models.CharField(max_length=63)
destination = models.CharField(max_length=63)
class Waypoint(models.Model):
waypoint = models.CharField(max_length=63)
ro... |
1aef29a64886522d81d2f6a15bd4e48419a66545 | ziggy/__init__.py | ziggy/__init__.py | # -*- coding: utf-8 -*-
"""
Ziggy
~~~~~~~~
:copyright: (c) 2012 by Rhett Garber
:license: ISC, see LICENSE for more details.
"""
__title__ = 'ziggy'
__version__ = '0.0.1'
__build__ = 0
__author__ = 'Rhett Garber'
__license__ = 'ISC'
__copyright__ = 'Copyright 2012 Rhett Garber'
import logging
from . import utils
... | # -*- coding: utf-8 -*-
"""
Ziggy
~~~~~~~~
:copyright: (c) 2012 by Rhett Garber
:license: ISC, see LICENSE for more details.
"""
__title__ = 'ziggy'
__version__ = '0.0.1'
__build__ = 0
__author__ = 'Rhett Garber'
__license__ = 'ISC'
__copyright__ = 'Copyright 2012 Rhett Garber'
import logging
from . import utils
... | Allow unsetting of configuration (for testing) | Allow unsetting of configuration (for testing)
| Python | isc | rhettg/Ziggy,rhettg/BlueOx | # -*- coding: utf-8 -*-
"""
Ziggy
~~~~~~~~
:copyright: (c) 2012 by Rhett Garber
:license: ISC, see LICENSE for more details.
"""
__title__ = 'ziggy'
__version__ = '0.0.1'
__build__ = 0
__author__ = 'Rhett Garber'
__license__ = 'ISC'
__copyright__ = 'Copyright 2012 Rhett Garber'
import logging
from . import utils
... | # -*- coding: utf-8 -*-
"""
Ziggy
~~~~~~~~
:copyright: (c) 2012 by Rhett Garber
:license: ISC, see LICENSE for more details.
"""
__title__ = 'ziggy'
__version__ = '0.0.1'
__build__ = 0
__author__ = 'Rhett Garber'
__license__ = 'ISC'
__copyright__ = 'Copyright 2012 Rhett Garber'
import logging
from . import utils
... | <commit_before># -*- coding: utf-8 -*-
"""
Ziggy
~~~~~~~~
:copyright: (c) 2012 by Rhett Garber
:license: ISC, see LICENSE for more details.
"""
__title__ = 'ziggy'
__version__ = '0.0.1'
__build__ = 0
__author__ = 'Rhett Garber'
__license__ = 'ISC'
__copyright__ = 'Copyright 2012 Rhett Garber'
import logging
from ... | # -*- coding: utf-8 -*-
"""
Ziggy
~~~~~~~~
:copyright: (c) 2012 by Rhett Garber
:license: ISC, see LICENSE for more details.
"""
__title__ = 'ziggy'
__version__ = '0.0.1'
__build__ = 0
__author__ = 'Rhett Garber'
__license__ = 'ISC'
__copyright__ = 'Copyright 2012 Rhett Garber'
import logging
from . import utils
... | # -*- coding: utf-8 -*-
"""
Ziggy
~~~~~~~~
:copyright: (c) 2012 by Rhett Garber
:license: ISC, see LICENSE for more details.
"""
__title__ = 'ziggy'
__version__ = '0.0.1'
__build__ = 0
__author__ = 'Rhett Garber'
__license__ = 'ISC'
__copyright__ = 'Copyright 2012 Rhett Garber'
import logging
from . import utils
... | <commit_before># -*- coding: utf-8 -*-
"""
Ziggy
~~~~~~~~
:copyright: (c) 2012 by Rhett Garber
:license: ISC, see LICENSE for more details.
"""
__title__ = 'ziggy'
__version__ = '0.0.1'
__build__ = 0
__author__ = 'Rhett Garber'
__license__ = 'ISC'
__copyright__ = 'Copyright 2012 Rhett Garber'
import logging
from ... |
168a7c9b9f5c0699009d8ef6eea0078c2a6a19cc | oonib/handlers.py | oonib/handlers.py | import types
from cyclone import escape
from cyclone import web
class OONIBHandler(web.RequestHandler):
def write_error(self, status_code, exception=None, **kw):
self.set_status(status_code)
if exception:
self.write({'error': exception.log_message})
def write(self, chunk):
... | import types
from cyclone import escape
from cyclone import web
class OONIBHandler(web.RequestHandler):
def write_error(self, status_code, exception=None, **kw):
self.set_status(status_code)
if hasattr(exception, 'log_message'):
self.write({'error': exception.log_message})
else... | Handle writing exceptions that don't have log_exception attribute | Handle writing exceptions that don't have log_exception attribute
| Python | bsd-2-clause | dstufft/ooni-backend,dstufft/ooni-backend | import types
from cyclone import escape
from cyclone import web
class OONIBHandler(web.RequestHandler):
def write_error(self, status_code, exception=None, **kw):
self.set_status(status_code)
if exception:
self.write({'error': exception.log_message})
def write(self, chunk):
... | import types
from cyclone import escape
from cyclone import web
class OONIBHandler(web.RequestHandler):
def write_error(self, status_code, exception=None, **kw):
self.set_status(status_code)
if hasattr(exception, 'log_message'):
self.write({'error': exception.log_message})
else... | <commit_before>import types
from cyclone import escape
from cyclone import web
class OONIBHandler(web.RequestHandler):
def write_error(self, status_code, exception=None, **kw):
self.set_status(status_code)
if exception:
self.write({'error': exception.log_message})
def write(self, ... | import types
from cyclone import escape
from cyclone import web
class OONIBHandler(web.RequestHandler):
def write_error(self, status_code, exception=None, **kw):
self.set_status(status_code)
if hasattr(exception, 'log_message'):
self.write({'error': exception.log_message})
else... | import types
from cyclone import escape
from cyclone import web
class OONIBHandler(web.RequestHandler):
def write_error(self, status_code, exception=None, **kw):
self.set_status(status_code)
if exception:
self.write({'error': exception.log_message})
def write(self, chunk):
... | <commit_before>import types
from cyclone import escape
from cyclone import web
class OONIBHandler(web.RequestHandler):
def write_error(self, status_code, exception=None, **kw):
self.set_status(status_code)
if exception:
self.write({'error': exception.log_message})
def write(self, ... |
8c90485e5cab6294a38cfc9332eda6fe8ca15483 | project/config.py | project/config.py | import os
config = {}
system_mongo_host = os.environ.get('MONGODB_PORT_27017_TCP_ADDR')
system_elastic_host = os.environ.get('ELASTIC_PORT_9300_TCP_ADDR')
config['HOST'] = ''
config['PORT'] = 5000
config['MONGODB_HOST'] = system_mongo_host if system_mongo_host else 'localhost'
config['MONGODB_PORT'] = 27017
config['... | import os
config = {}
system_mongo_host = os.environ.get('MONGODB_PORT_27017_TCP_ADDR')
system_elastic_host = os.environ.get('ELASTIC_PORT_9300_TCP_ADDR')
config['HOST'] = ''
config['PORT'] = 5000
config['MONGODB_HOST'] = system_mongo_host if system_mongo_host else 'localhost'
config['MONGODB_PORT'] = 27017
config['... | Add two new domains to whitelist for CORS. | Add two new domains to whitelist for CORS.
| Python | apache-2.0 | AustinStoneProjects/Founderati-Server,AustinStoneProjects/Founderati-Server | import os
config = {}
system_mongo_host = os.environ.get('MONGODB_PORT_27017_TCP_ADDR')
system_elastic_host = os.environ.get('ELASTIC_PORT_9300_TCP_ADDR')
config['HOST'] = ''
config['PORT'] = 5000
config['MONGODB_HOST'] = system_mongo_host if system_mongo_host else 'localhost'
config['MONGODB_PORT'] = 27017
config['... | import os
config = {}
system_mongo_host = os.environ.get('MONGODB_PORT_27017_TCP_ADDR')
system_elastic_host = os.environ.get('ELASTIC_PORT_9300_TCP_ADDR')
config['HOST'] = ''
config['PORT'] = 5000
config['MONGODB_HOST'] = system_mongo_host if system_mongo_host else 'localhost'
config['MONGODB_PORT'] = 27017
config['... | <commit_before>import os
config = {}
system_mongo_host = os.environ.get('MONGODB_PORT_27017_TCP_ADDR')
system_elastic_host = os.environ.get('ELASTIC_PORT_9300_TCP_ADDR')
config['HOST'] = ''
config['PORT'] = 5000
config['MONGODB_HOST'] = system_mongo_host if system_mongo_host else 'localhost'
config['MONGODB_PORT'] =... | import os
config = {}
system_mongo_host = os.environ.get('MONGODB_PORT_27017_TCP_ADDR')
system_elastic_host = os.environ.get('ELASTIC_PORT_9300_TCP_ADDR')
config['HOST'] = ''
config['PORT'] = 5000
config['MONGODB_HOST'] = system_mongo_host if system_mongo_host else 'localhost'
config['MONGODB_PORT'] = 27017
config['... | import os
config = {}
system_mongo_host = os.environ.get('MONGODB_PORT_27017_TCP_ADDR')
system_elastic_host = os.environ.get('ELASTIC_PORT_9300_TCP_ADDR')
config['HOST'] = ''
config['PORT'] = 5000
config['MONGODB_HOST'] = system_mongo_host if system_mongo_host else 'localhost'
config['MONGODB_PORT'] = 27017
config['... | <commit_before>import os
config = {}
system_mongo_host = os.environ.get('MONGODB_PORT_27017_TCP_ADDR')
system_elastic_host = os.environ.get('ELASTIC_PORT_9300_TCP_ADDR')
config['HOST'] = ''
config['PORT'] = 5000
config['MONGODB_HOST'] = system_mongo_host if system_mongo_host else 'localhost'
config['MONGODB_PORT'] =... |
616bd7c5ff8ba5fe5dd190a459b93980613a3ad4 | myuw_mobile/restclients/dao_implementation/hfs.py | myuw_mobile/restclients/dao_implementation/hfs.py | from os.path import dirname
from restclients.dao_implementation.mock import get_mockdata_url
from restclients.dao_implementation.live import get_con_pool, get_live_url
class File(object):
"""
This implementation returns mock/static content.
Use this DAO with this configuration:
RESTCLIENTS_HFS_DAO_C... | from os.path import dirname
from restclients.dao_implementation.mock import get_mockdata_url
from restclients.dao_implementation.live import get_con_pool, get_live_url
import logging
from myuw_mobile.logger.logback import log_info
class File(object):
"""
This implementation returns mock/static content.
U... | Fix bug: must specify the port number. | Fix bug: must specify the port number.
| Python | apache-2.0 | uw-it-aca/myuw,uw-it-aca/myuw,fanglinfang/myuw,uw-it-aca/myuw,fanglinfang/myuw,fanglinfang/myuw,uw-it-aca/myuw | from os.path import dirname
from restclients.dao_implementation.mock import get_mockdata_url
from restclients.dao_implementation.live import get_con_pool, get_live_url
class File(object):
"""
This implementation returns mock/static content.
Use this DAO with this configuration:
RESTCLIENTS_HFS_DAO_C... | from os.path import dirname
from restclients.dao_implementation.mock import get_mockdata_url
from restclients.dao_implementation.live import get_con_pool, get_live_url
import logging
from myuw_mobile.logger.logback import log_info
class File(object):
"""
This implementation returns mock/static content.
U... | <commit_before>from os.path import dirname
from restclients.dao_implementation.mock import get_mockdata_url
from restclients.dao_implementation.live import get_con_pool, get_live_url
class File(object):
"""
This implementation returns mock/static content.
Use this DAO with this configuration:
RESTCL... | from os.path import dirname
from restclients.dao_implementation.mock import get_mockdata_url
from restclients.dao_implementation.live import get_con_pool, get_live_url
import logging
from myuw_mobile.logger.logback import log_info
class File(object):
"""
This implementation returns mock/static content.
U... | from os.path import dirname
from restclients.dao_implementation.mock import get_mockdata_url
from restclients.dao_implementation.live import get_con_pool, get_live_url
class File(object):
"""
This implementation returns mock/static content.
Use this DAO with this configuration:
RESTCLIENTS_HFS_DAO_C... | <commit_before>from os.path import dirname
from restclients.dao_implementation.mock import get_mockdata_url
from restclients.dao_implementation.live import get_con_pool, get_live_url
class File(object):
"""
This implementation returns mock/static content.
Use this DAO with this configuration:
RESTCL... |
882175afea0e2c35e2b223e15feb195a005f7d42 | common/config.py | common/config.py | #
# Poet Configurations
#
# client authentication token
AUTH = 'b9c39a336bb97a9c9bda2b82bdaacff3'
# directory to save output files to
ARCHIVE_DIR = 'archive'
#
# The below configs let you bake in the server IP and beacon interval
# into the final executable so it can simply be executed without supplying
# command li... | #
# Poet Configurations
#
# default client authentication token. change this to whatever you want!
AUTH = 'b9c39a336bb97a9c9bda2b82bdaacff3'
# directory to save output files to
ARCHIVE_DIR = 'archive'
#
# The below configs let you bake in the server IP and beacon interval
# into the final executable so it can simply... | Add comment about changing auth token | Add comment about changing auth token
| Python | mit | mossberg/poet | #
# Poet Configurations
#
# client authentication token
AUTH = 'b9c39a336bb97a9c9bda2b82bdaacff3'
# directory to save output files to
ARCHIVE_DIR = 'archive'
#
# The below configs let you bake in the server IP and beacon interval
# into the final executable so it can simply be executed without supplying
# command li... | #
# Poet Configurations
#
# default client authentication token. change this to whatever you want!
AUTH = 'b9c39a336bb97a9c9bda2b82bdaacff3'
# directory to save output files to
ARCHIVE_DIR = 'archive'
#
# The below configs let you bake in the server IP and beacon interval
# into the final executable so it can simply... | <commit_before>#
# Poet Configurations
#
# client authentication token
AUTH = 'b9c39a336bb97a9c9bda2b82bdaacff3'
# directory to save output files to
ARCHIVE_DIR = 'archive'
#
# The below configs let you bake in the server IP and beacon interval
# into the final executable so it can simply be executed without supplyi... | #
# Poet Configurations
#
# default client authentication token. change this to whatever you want!
AUTH = 'b9c39a336bb97a9c9bda2b82bdaacff3'
# directory to save output files to
ARCHIVE_DIR = 'archive'
#
# The below configs let you bake in the server IP and beacon interval
# into the final executable so it can simply... | #
# Poet Configurations
#
# client authentication token
AUTH = 'b9c39a336bb97a9c9bda2b82bdaacff3'
# directory to save output files to
ARCHIVE_DIR = 'archive'
#
# The below configs let you bake in the server IP and beacon interval
# into the final executable so it can simply be executed without supplying
# command li... | <commit_before>#
# Poet Configurations
#
# client authentication token
AUTH = 'b9c39a336bb97a9c9bda2b82bdaacff3'
# directory to save output files to
ARCHIVE_DIR = 'archive'
#
# The below configs let you bake in the server IP and beacon interval
# into the final executable so it can simply be executed without supplyi... |
1262a213f5330ab3ac62581cd93a484eb72ebd60 | picaxe/urls.py | picaxe/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.sites.models import Site
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'picaxe.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
... | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.sites.models import Site
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'picaxe.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
... | Add missing ^ to regex | Add missing ^ to regex
| Python | mit | TuinfeesT/PicAxe | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.sites.models import Site
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'picaxe.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
... | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.sites.models import Site
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'picaxe.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
... | <commit_before>from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.sites.models import Site
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'picaxe.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.... | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.sites.models import Site
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'picaxe.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
... | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.sites.models import Site
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'picaxe.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
... | <commit_before>from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.sites.models import Site
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'picaxe.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.... |
5d0fa6d6f66cce56b9704601c4399ca0adcc419a | programmingtheorems/python/theorem_of_selection.py | programmingtheorems/python/theorem_of_selection.py | #! /usr/bin/env python
# Copyright Lajos Katona
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | #! /usr/bin/env python
# Copyright Lajos Katona
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | Fix pep8 error with new newline | Fix pep8 error with new newline
Change-Id: I47b12c62eb1653bcbbe552464aab72c486bbd1cc
| Python | apache-2.0 | elajkat/hugradexam,elajkat/hugradexam | #! /usr/bin/env python
# Copyright Lajos Katona
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | #! /usr/bin/env python
# Copyright Lajos Katona
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | <commit_before>#! /usr/bin/env python
# Copyright Lajos Katona
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | #! /usr/bin/env python
# Copyright Lajos Katona
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | #! /usr/bin/env python
# Copyright Lajos Katona
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | <commit_before>#! /usr/bin/env python
# Copyright Lajos Katona
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... |
296f7aa83244af1cc63c4f7cdeae2d2adf6ac51d | moodlefuse/exception.py | moodlefuse/exception.py | #!/usr/bin/env python
# encoding: utf-8
"""Class to handle Exceptions relating to MoodleFUSE actions
"""
from functools import wraps
from moodlefuse.core import config
class MoodleFuseException(Exception):
def __init__(self, debug_info):
exception_reason = "ERROR ENCOUNTERED: MoodleFUSE has encountered... | #!/usr/bin/env python
# encoding: utf-8
"""Class to handle Exceptions relating to MoodleFUSE actions
"""
from functools import wraps
from moodlefuse.core import config
class MoodleFuseException(Exception):
def __init__(self, debug_info):
_EXCEPTION_REASON = "ERROR ENCOUNTERED: MoodleFUSE has encountere... | Change error message to local constant | Change error message to local constant
| Python | mit | BroganD1993/MoodleFUSE,BroganD1993/MoodleFUSE | #!/usr/bin/env python
# encoding: utf-8
"""Class to handle Exceptions relating to MoodleFUSE actions
"""
from functools import wraps
from moodlefuse.core import config
class MoodleFuseException(Exception):
def __init__(self, debug_info):
exception_reason = "ERROR ENCOUNTERED: MoodleFUSE has encountered... | #!/usr/bin/env python
# encoding: utf-8
"""Class to handle Exceptions relating to MoodleFUSE actions
"""
from functools import wraps
from moodlefuse.core import config
class MoodleFuseException(Exception):
def __init__(self, debug_info):
_EXCEPTION_REASON = "ERROR ENCOUNTERED: MoodleFUSE has encountere... | <commit_before>#!/usr/bin/env python
# encoding: utf-8
"""Class to handle Exceptions relating to MoodleFUSE actions
"""
from functools import wraps
from moodlefuse.core import config
class MoodleFuseException(Exception):
def __init__(self, debug_info):
exception_reason = "ERROR ENCOUNTERED: MoodleFUSE ... | #!/usr/bin/env python
# encoding: utf-8
"""Class to handle Exceptions relating to MoodleFUSE actions
"""
from functools import wraps
from moodlefuse.core import config
class MoodleFuseException(Exception):
def __init__(self, debug_info):
_EXCEPTION_REASON = "ERROR ENCOUNTERED: MoodleFUSE has encountere... | #!/usr/bin/env python
# encoding: utf-8
"""Class to handle Exceptions relating to MoodleFUSE actions
"""
from functools import wraps
from moodlefuse.core import config
class MoodleFuseException(Exception):
def __init__(self, debug_info):
exception_reason = "ERROR ENCOUNTERED: MoodleFUSE has encountered... | <commit_before>#!/usr/bin/env python
# encoding: utf-8
"""Class to handle Exceptions relating to MoodleFUSE actions
"""
from functools import wraps
from moodlefuse.core import config
class MoodleFuseException(Exception):
def __init__(self, debug_info):
exception_reason = "ERROR ENCOUNTERED: MoodleFUSE ... |
0e99654d606038098d45fb83cc40405742e43ae8 | readthedocs/builds/filters.py | readthedocs/builds/filters.py | from django.utils.translation import ugettext_lazy as _
import django_filters
from builds import constants
from builds.models import Build, Version
ANY_REPO = (
('', _('Any')),
)
BUILD_TYPES = ANY_REPO + constants.BUILD_TYPES
class VersionFilter(django_filters.FilterSet):
project = django_filters.CharFil... | from django.utils.translation import ugettext_lazy as _
import django_filters
from builds import constants
from builds.models import Build, Version
ANY_REPO = (
('', _('Any')),
)
BUILD_TYPES = ANY_REPO + constants.BUILD_TYPES
class VersionFilter(django_filters.FilterSet):
project = django_filters.CharFil... | Remove version from Build filter. | Remove version from Build filter.
| Python | mit | agjohnson/readthedocs.org,fujita-shintaro/readthedocs.org,GovReady/readthedocs.org,nyergler/pythonslides,Tazer/readthedocs.org,techtonik/readthedocs.org,takluyver/readthedocs.org,nyergler/pythonslides,GovReady/readthedocs.org,nikolas/readthedocs.org,gjtorikian/readthedocs.org,cgourlay/readthedocs.org,d0ugal/readthedocs... | from django.utils.translation import ugettext_lazy as _
import django_filters
from builds import constants
from builds.models import Build, Version
ANY_REPO = (
('', _('Any')),
)
BUILD_TYPES = ANY_REPO + constants.BUILD_TYPES
class VersionFilter(django_filters.FilterSet):
project = django_filters.CharFil... | from django.utils.translation import ugettext_lazy as _
import django_filters
from builds import constants
from builds.models import Build, Version
ANY_REPO = (
('', _('Any')),
)
BUILD_TYPES = ANY_REPO + constants.BUILD_TYPES
class VersionFilter(django_filters.FilterSet):
project = django_filters.CharFil... | <commit_before>from django.utils.translation import ugettext_lazy as _
import django_filters
from builds import constants
from builds.models import Build, Version
ANY_REPO = (
('', _('Any')),
)
BUILD_TYPES = ANY_REPO + constants.BUILD_TYPES
class VersionFilter(django_filters.FilterSet):
project = django_... | from django.utils.translation import ugettext_lazy as _
import django_filters
from builds import constants
from builds.models import Build, Version
ANY_REPO = (
('', _('Any')),
)
BUILD_TYPES = ANY_REPO + constants.BUILD_TYPES
class VersionFilter(django_filters.FilterSet):
project = django_filters.CharFil... | from django.utils.translation import ugettext_lazy as _
import django_filters
from builds import constants
from builds.models import Build, Version
ANY_REPO = (
('', _('Any')),
)
BUILD_TYPES = ANY_REPO + constants.BUILD_TYPES
class VersionFilter(django_filters.FilterSet):
project = django_filters.CharFil... | <commit_before>from django.utils.translation import ugettext_lazy as _
import django_filters
from builds import constants
from builds.models import Build, Version
ANY_REPO = (
('', _('Any')),
)
BUILD_TYPES = ANY_REPO + constants.BUILD_TYPES
class VersionFilter(django_filters.FilterSet):
project = django_... |
1778b3943ed55819ef38a46e8fdc417ed835176f | run.py | run.py | #!/usr/bin/env python
import os
import signal
import sys
from app.main import app, queues, sched
def _teardown(signal, frame):
sched.shutdown(wait=False)
for queue in queues.values():
queue.put(None)
queues.clear()
# Let the interrupt bubble up so that Flask/Werkzeug see it
raise Keyboard... | #!/usr/bin/env python
import logging
import os
import signal
import sys
from app.main import app, queues, sched
def _teardown(signal, frame):
sched.shutdown(wait=False)
for queue in queues.values():
queue.put(None)
queues.clear()
# Let the interrupt bubble up so that Flask/Werkzeug see it
... | Configure logger in debug mode | Configure logger in debug mode
| Python | mit | martinp/jarvis2,mpolden/jarvis2,Foxboron/Frank,Foxboron/Frank,martinp/jarvis2,mpolden/jarvis2,martinp/jarvis2,Foxboron/Frank,mpolden/jarvis2 | #!/usr/bin/env python
import os
import signal
import sys
from app.main import app, queues, sched
def _teardown(signal, frame):
sched.shutdown(wait=False)
for queue in queues.values():
queue.put(None)
queues.clear()
# Let the interrupt bubble up so that Flask/Werkzeug see it
raise Keyboard... | #!/usr/bin/env python
import logging
import os
import signal
import sys
from app.main import app, queues, sched
def _teardown(signal, frame):
sched.shutdown(wait=False)
for queue in queues.values():
queue.put(None)
queues.clear()
# Let the interrupt bubble up so that Flask/Werkzeug see it
... | <commit_before>#!/usr/bin/env python
import os
import signal
import sys
from app.main import app, queues, sched
def _teardown(signal, frame):
sched.shutdown(wait=False)
for queue in queues.values():
queue.put(None)
queues.clear()
# Let the interrupt bubble up so that Flask/Werkzeug see it
... | #!/usr/bin/env python
import logging
import os
import signal
import sys
from app.main import app, queues, sched
def _teardown(signal, frame):
sched.shutdown(wait=False)
for queue in queues.values():
queue.put(None)
queues.clear()
# Let the interrupt bubble up so that Flask/Werkzeug see it
... | #!/usr/bin/env python
import os
import signal
import sys
from app.main import app, queues, sched
def _teardown(signal, frame):
sched.shutdown(wait=False)
for queue in queues.values():
queue.put(None)
queues.clear()
# Let the interrupt bubble up so that Flask/Werkzeug see it
raise Keyboard... | <commit_before>#!/usr/bin/env python
import os
import signal
import sys
from app.main import app, queues, sched
def _teardown(signal, frame):
sched.shutdown(wait=False)
for queue in queues.values():
queue.put(None)
queues.clear()
# Let the interrupt bubble up so that Flask/Werkzeug see it
... |
0b7636422c632172dfc68ea2a5f21ec649248c8c | nimp/commands/vs_build.py | nimp/commands/vs_build.py | # -*- coding: utf-8 -*-
from nimp.commands._command import *
from nimp.utilities.build import *
#-------------------------------------------------------------------------------
class VsBuildCommand(Command):
def __init__(self):
Command.__init__(self, 'vs-build', 'Builds a Visual Studio project')
#--... | # -*- coding: utf-8 -*-
from nimp.commands._command import *
from nimp.utilities.build import *
#-------------------------------------------------------------------------------
class VsBuildCommand(Command):
def __init__(self):
Command.__init__(self, 'vs-build', 'Builds a Visual Studio project')
#--... | Use separate variable names for Visual Studio config/platform. | Use separate variable names for Visual Studio config/platform.
| Python | mit | dontnod/nimp | # -*- coding: utf-8 -*-
from nimp.commands._command import *
from nimp.utilities.build import *
#-------------------------------------------------------------------------------
class VsBuildCommand(Command):
def __init__(self):
Command.__init__(self, 'vs-build', 'Builds a Visual Studio project')
#--... | # -*- coding: utf-8 -*-
from nimp.commands._command import *
from nimp.utilities.build import *
#-------------------------------------------------------------------------------
class VsBuildCommand(Command):
def __init__(self):
Command.__init__(self, 'vs-build', 'Builds a Visual Studio project')
#--... | <commit_before># -*- coding: utf-8 -*-
from nimp.commands._command import *
from nimp.utilities.build import *
#-------------------------------------------------------------------------------
class VsBuildCommand(Command):
def __init__(self):
Command.__init__(self, 'vs-build', 'Builds a Visual Studio pro... | # -*- coding: utf-8 -*-
from nimp.commands._command import *
from nimp.utilities.build import *
#-------------------------------------------------------------------------------
class VsBuildCommand(Command):
def __init__(self):
Command.__init__(self, 'vs-build', 'Builds a Visual Studio project')
#--... | # -*- coding: utf-8 -*-
from nimp.commands._command import *
from nimp.utilities.build import *
#-------------------------------------------------------------------------------
class VsBuildCommand(Command):
def __init__(self):
Command.__init__(self, 'vs-build', 'Builds a Visual Studio project')
#--... | <commit_before># -*- coding: utf-8 -*-
from nimp.commands._command import *
from nimp.utilities.build import *
#-------------------------------------------------------------------------------
class VsBuildCommand(Command):
def __init__(self):
Command.__init__(self, 'vs-build', 'Builds a Visual Studio pro... |
84b01f0015163dc016293162f1525be76329e602 | pythonforandroid/recipes/cryptography/__init__.py | pythonforandroid/recipes/cryptography/__init__.py | from pythonforandroid.recipe import CompiledComponentsPythonRecipe, Recipe
class CryptographyRecipe(CompiledComponentsPythonRecipe):
name = 'cryptography'
version = '2.4.2'
url = 'https://github.com/pyca/cryptography/archive/{version}.tar.gz'
depends = ['openssl', 'idna', 'asn1crypto', 'six', 'setupto... | from pythonforandroid.recipe import CompiledComponentsPythonRecipe, Recipe
class CryptographyRecipe(CompiledComponentsPythonRecipe):
name = 'cryptography'
version = '2.4.2'
url = 'https://github.com/pyca/cryptography/archive/{version}.tar.gz'
depends = ['openssl', 'idna', 'asn1crypto', 'six', 'setupto... | Move libraries from LDFLAGS to LIBS for cryptography recipe | Move libraries from LDFLAGS to LIBS for cryptography recipe
Because this is how you are supposed to do it, you must use LDFLAGS for linker flags and LDLIBS (or the equivalent LOADLIBES) for the libraries
| Python | mit | kronenpj/python-for-android,rnixx/python-for-android,PKRoma/python-for-android,germn/python-for-android,PKRoma/python-for-android,kronenpj/python-for-android,rnixx/python-for-android,germn/python-for-android,rnixx/python-for-android,kivy/python-for-android,PKRoma/python-for-android,rnixx/python-for-android,germn/python... | from pythonforandroid.recipe import CompiledComponentsPythonRecipe, Recipe
class CryptographyRecipe(CompiledComponentsPythonRecipe):
name = 'cryptography'
version = '2.4.2'
url = 'https://github.com/pyca/cryptography/archive/{version}.tar.gz'
depends = ['openssl', 'idna', 'asn1crypto', 'six', 'setupto... | from pythonforandroid.recipe import CompiledComponentsPythonRecipe, Recipe
class CryptographyRecipe(CompiledComponentsPythonRecipe):
name = 'cryptography'
version = '2.4.2'
url = 'https://github.com/pyca/cryptography/archive/{version}.tar.gz'
depends = ['openssl', 'idna', 'asn1crypto', 'six', 'setupto... | <commit_before>from pythonforandroid.recipe import CompiledComponentsPythonRecipe, Recipe
class CryptographyRecipe(CompiledComponentsPythonRecipe):
name = 'cryptography'
version = '2.4.2'
url = 'https://github.com/pyca/cryptography/archive/{version}.tar.gz'
depends = ['openssl', 'idna', 'asn1crypto', ... | from pythonforandroid.recipe import CompiledComponentsPythonRecipe, Recipe
class CryptographyRecipe(CompiledComponentsPythonRecipe):
name = 'cryptography'
version = '2.4.2'
url = 'https://github.com/pyca/cryptography/archive/{version}.tar.gz'
depends = ['openssl', 'idna', 'asn1crypto', 'six', 'setupto... | from pythonforandroid.recipe import CompiledComponentsPythonRecipe, Recipe
class CryptographyRecipe(CompiledComponentsPythonRecipe):
name = 'cryptography'
version = '2.4.2'
url = 'https://github.com/pyca/cryptography/archive/{version}.tar.gz'
depends = ['openssl', 'idna', 'asn1crypto', 'six', 'setupto... | <commit_before>from pythonforandroid.recipe import CompiledComponentsPythonRecipe, Recipe
class CryptographyRecipe(CompiledComponentsPythonRecipe):
name = 'cryptography'
version = '2.4.2'
url = 'https://github.com/pyca/cryptography/archive/{version}.tar.gz'
depends = ['openssl', 'idna', 'asn1crypto', ... |
72301067306d6baf4aab0315a769c75dd585b46d | pi_setup/boot_config.py | pi_setup/boot_config.py | #!/usr/bin/env python
from utils import file_templates
from utils.validation import is_valid_gpu_mem
def main():
gpu_mem = 0
while gpu_mem == 0:
user_input = raw_input("Enter GPU memory in MB (16/32/64/128/256): ")
if is_valid_gpu_mem(user_input):
gpu_mem = user_input
else:
print("Acceptable memory valu... | #!/usr/bin/env python
from utils import file_templates
from utils.validation import is_valid_gpu_mem
def main():
user_input = raw_input("Want to change the GPU memory split? (Y/N): ")
if user_input == 'Y':
gpu_mem = 0
while gpu_mem == 0:
mem_split = raw_input("Enter GPU memory in MB (16/32/64/128/256): ")
... | Make GPU mem split optional | Make GPU mem split optional
| Python | mit | projectweekend/Pi-Setup,projectweekend/Pi-Setup | #!/usr/bin/env python
from utils import file_templates
from utils.validation import is_valid_gpu_mem
def main():
gpu_mem = 0
while gpu_mem == 0:
user_input = raw_input("Enter GPU memory in MB (16/32/64/128/256): ")
if is_valid_gpu_mem(user_input):
gpu_mem = user_input
else:
print("Acceptable memory valu... | #!/usr/bin/env python
from utils import file_templates
from utils.validation import is_valid_gpu_mem
def main():
user_input = raw_input("Want to change the GPU memory split? (Y/N): ")
if user_input == 'Y':
gpu_mem = 0
while gpu_mem == 0:
mem_split = raw_input("Enter GPU memory in MB (16/32/64/128/256): ")
... | <commit_before>#!/usr/bin/env python
from utils import file_templates
from utils.validation import is_valid_gpu_mem
def main():
gpu_mem = 0
while gpu_mem == 0:
user_input = raw_input("Enter GPU memory in MB (16/32/64/128/256): ")
if is_valid_gpu_mem(user_input):
gpu_mem = user_input
else:
print("Accepta... | #!/usr/bin/env python
from utils import file_templates
from utils.validation import is_valid_gpu_mem
def main():
user_input = raw_input("Want to change the GPU memory split? (Y/N): ")
if user_input == 'Y':
gpu_mem = 0
while gpu_mem == 0:
mem_split = raw_input("Enter GPU memory in MB (16/32/64/128/256): ")
... | #!/usr/bin/env python
from utils import file_templates
from utils.validation import is_valid_gpu_mem
def main():
gpu_mem = 0
while gpu_mem == 0:
user_input = raw_input("Enter GPU memory in MB (16/32/64/128/256): ")
if is_valid_gpu_mem(user_input):
gpu_mem = user_input
else:
print("Acceptable memory valu... | <commit_before>#!/usr/bin/env python
from utils import file_templates
from utils.validation import is_valid_gpu_mem
def main():
gpu_mem = 0
while gpu_mem == 0:
user_input = raw_input("Enter GPU memory in MB (16/32/64/128/256): ")
if is_valid_gpu_mem(user_input):
gpu_mem = user_input
else:
print("Accepta... |
2fe5f960f4998a0337bceabd7db930ac5d5a4fd1 | qipipe/qiprofile/helpers.py | qipipe/qiprofile/helpers.py | import re
from datetime import datetime
TRAILING_NUM_REGEX = re.compile("(\d+)$")
"""A regular expression to extract the trailing number from a string."""
DATE_REGEX = re.compile("(0?\d|1[12])/(0?\d|[12]\d|3[12])/((19|20)?\d\d)$")
class DateError(Exception):
pass
def trailing_number(s):
"""
:param s: ... | import re
from datetime import datetime
TRAILING_NUM_REGEX = re.compile("(\d+)$")
"""A regular expression to extract the trailing number from a string."""
DATE_REGEX = re.compile("(0?\d|1[12])/(0?\d|[12]\d|3[12])/((19|20)?\d\d)$")
class DateError(Exception):
pass
def trailing_number(s):
"""
:param s: ... | Change lambda to function in doc. | Change lambda to function in doc.
| Python | bsd-2-clause | ohsu-qin/qipipe | import re
from datetime import datetime
TRAILING_NUM_REGEX = re.compile("(\d+)$")
"""A regular expression to extract the trailing number from a string."""
DATE_REGEX = re.compile("(0?\d|1[12])/(0?\d|[12]\d|3[12])/((19|20)?\d\d)$")
class DateError(Exception):
pass
def trailing_number(s):
"""
:param s: ... | import re
from datetime import datetime
TRAILING_NUM_REGEX = re.compile("(\d+)$")
"""A regular expression to extract the trailing number from a string."""
DATE_REGEX = re.compile("(0?\d|1[12])/(0?\d|[12]\d|3[12])/((19|20)?\d\d)$")
class DateError(Exception):
pass
def trailing_number(s):
"""
:param s: ... | <commit_before>import re
from datetime import datetime
TRAILING_NUM_REGEX = re.compile("(\d+)$")
"""A regular expression to extract the trailing number from a string."""
DATE_REGEX = re.compile("(0?\d|1[12])/(0?\d|[12]\d|3[12])/((19|20)?\d\d)$")
class DateError(Exception):
pass
def trailing_number(s):
"""... | import re
from datetime import datetime
TRAILING_NUM_REGEX = re.compile("(\d+)$")
"""A regular expression to extract the trailing number from a string."""
DATE_REGEX = re.compile("(0?\d|1[12])/(0?\d|[12]\d|3[12])/((19|20)?\d\d)$")
class DateError(Exception):
pass
def trailing_number(s):
"""
:param s: ... | import re
from datetime import datetime
TRAILING_NUM_REGEX = re.compile("(\d+)$")
"""A regular expression to extract the trailing number from a string."""
DATE_REGEX = re.compile("(0?\d|1[12])/(0?\d|[12]\d|3[12])/((19|20)?\d\d)$")
class DateError(Exception):
pass
def trailing_number(s):
"""
:param s: ... | <commit_before>import re
from datetime import datetime
TRAILING_NUM_REGEX = re.compile("(\d+)$")
"""A regular expression to extract the trailing number from a string."""
DATE_REGEX = re.compile("(0?\d|1[12])/(0?\d|[12]\d|3[12])/((19|20)?\d\d)$")
class DateError(Exception):
pass
def trailing_number(s):
"""... |
2f360d9986c13adaaf670b80b27dad995823b849 | bandstructure/system/tightbindingsystem.py | bandstructure/system/tightbindingsystem.py | import numpy as np
from .system import System
class TightBindingSystem(System):
def setDefaultParams(self):
self.params.setdefault('t', 1) # nearest neighbor tunneling strength
self.params.setdefault('t2', 0) # next-nearest neighbor ..
def tunnelingRate(self, dr):
t = self.get("t"... | import numpy as np
from .system import System
class TightBindingSystem(System):
def setDefaultParams(self):
self.params.setdefault('t', 1) # nearest neighbor tunneling strength
self.params.setdefault('t2', 0) # next-nearest neighbor ..
def tunnelingRate(self, dr):
t = self.get("t"... | Use new functions for getting (next) nearest neighbors | Use new functions for getting (next) nearest neighbors
| Python | mit | sharkdp/bandstructure,sharkdp/bandstructure | import numpy as np
from .system import System
class TightBindingSystem(System):
def setDefaultParams(self):
self.params.setdefault('t', 1) # nearest neighbor tunneling strength
self.params.setdefault('t2', 0) # next-nearest neighbor ..
def tunnelingRate(self, dr):
t = self.get("t"... | import numpy as np
from .system import System
class TightBindingSystem(System):
def setDefaultParams(self):
self.params.setdefault('t', 1) # nearest neighbor tunneling strength
self.params.setdefault('t2', 0) # next-nearest neighbor ..
def tunnelingRate(self, dr):
t = self.get("t"... | <commit_before>import numpy as np
from .system import System
class TightBindingSystem(System):
def setDefaultParams(self):
self.params.setdefault('t', 1) # nearest neighbor tunneling strength
self.params.setdefault('t2', 0) # next-nearest neighbor ..
def tunnelingRate(self, dr):
t... | import numpy as np
from .system import System
class TightBindingSystem(System):
def setDefaultParams(self):
self.params.setdefault('t', 1) # nearest neighbor tunneling strength
self.params.setdefault('t2', 0) # next-nearest neighbor ..
def tunnelingRate(self, dr):
t = self.get("t"... | import numpy as np
from .system import System
class TightBindingSystem(System):
def setDefaultParams(self):
self.params.setdefault('t', 1) # nearest neighbor tunneling strength
self.params.setdefault('t2', 0) # next-nearest neighbor ..
def tunnelingRate(self, dr):
t = self.get("t"... | <commit_before>import numpy as np
from .system import System
class TightBindingSystem(System):
def setDefaultParams(self):
self.params.setdefault('t', 1) # nearest neighbor tunneling strength
self.params.setdefault('t2', 0) # next-nearest neighbor ..
def tunnelingRate(self, dr):
t... |
086281e93c1868418f8845aa9366c75319b0e8c7 | newsman/test/test_rss_parser.py | newsman/test/test_rss_parser.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('UTF-8')
sys.path.append('..')
from analyzer import rss_parser
#entries = rss_parser.parse(feed_link='http://news.yahoo.com/rss/us', language='en')
#entries = rss_parser.parse(feed_link='http://www.engadget.com/rss.xml', langu... | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('UTF-8')
sys.path.append('..')
from analyzer import rss_parser
#entries = rss_parser.parse(feed_link='http://news.yahoo.com/rss/us', language='en')
#entries = rss_parser.parse(feed_link='http://www.engadget.com/rss.xml', langu... | Comment out a test case | Comment out a test case
| Python | agpl-3.0 | chengdujin/newsman,chengdujin/newsman,chengdujin/newsman | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('UTF-8')
sys.path.append('..')
from analyzer import rss_parser
#entries = rss_parser.parse(feed_link='http://news.yahoo.com/rss/us', language='en')
#entries = rss_parser.parse(feed_link='http://www.engadget.com/rss.xml', langu... | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('UTF-8')
sys.path.append('..')
from analyzer import rss_parser
#entries = rss_parser.parse(feed_link='http://news.yahoo.com/rss/us', language='en')
#entries = rss_parser.parse(feed_link='http://www.engadget.com/rss.xml', langu... | <commit_before>#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('UTF-8')
sys.path.append('..')
from analyzer import rss_parser
#entries = rss_parser.parse(feed_link='http://news.yahoo.com/rss/us', language='en')
#entries = rss_parser.parse(feed_link='http://www.engadget.com/... | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('UTF-8')
sys.path.append('..')
from analyzer import rss_parser
#entries = rss_parser.parse(feed_link='http://news.yahoo.com/rss/us', language='en')
#entries = rss_parser.parse(feed_link='http://www.engadget.com/rss.xml', langu... | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('UTF-8')
sys.path.append('..')
from analyzer import rss_parser
#entries = rss_parser.parse(feed_link='http://news.yahoo.com/rss/us', language='en')
#entries = rss_parser.parse(feed_link='http://www.engadget.com/rss.xml', langu... | <commit_before>#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('UTF-8')
sys.path.append('..')
from analyzer import rss_parser
#entries = rss_parser.parse(feed_link='http://news.yahoo.com/rss/us', language='en')
#entries = rss_parser.parse(feed_link='http://www.engadget.com/... |
611f95b0c72e436ebf056329349216625c61e133 | wagtail/tests/testapp/migrations/0009_defaultstreampage.py | wagtail/tests/testapp/migrations/0009_defaultstreampage.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-21 11:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
class Migration(migrations... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-21 11:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
class Migration(migrations... | Adjust testapp migration dependency to be valid on 1.6.x | Adjust testapp migration dependency to be valid on 1.6.x
| Python | bsd-3-clause | mixxorz/wagtail,nutztherookie/wagtail,rsalmaso/wagtail,torchbox/wagtail,chrxr/wagtail,gasman/wagtail,zerolab/wagtail,Toshakins/wagtail,takeflight/wagtail,FlipperPA/wagtail,iansprice/wagtail,takeflight/wagtail,wagtail/wagtail,nilnvoid/wagtail,nealtodd/wagtail,FlipperPA/wagtail,nilnvoid/wagtail,chrxr/wagtail,takeflight/w... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-21 11:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
class Migration(migrations... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-21 11:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
class Migration(migrations... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-21 11:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
class Migra... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-21 11:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
class Migration(migrations... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-21 11:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
class Migration(migrations... | <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-21 11:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks
class Migra... |
c5946e378147f6d4d42c7a3e531388e6203f29e4 | fantasyStocks/static/stockCleaner.py | fantasyStocks/static/stockCleaner.py | import json
with open("stocks.json") as f:
| from pprint import pprint
import json
import re
REGEXP = re.compile("(?P<symbol>[A-Z]{1,4}).*")
with open("stocks.json") as f:
l = json.loads(f.read())
out = []
for i in l:
if not "^" in i["symbol"]:
out.append(i)
with open("newStocks.json", "w") as w:
w.write(json.dumps(out)... | Write script to remove duplicates from stocks.json | Write script to remove duplicates from stocks.json
| Python | apache-2.0 | ddsnowboard/FantasyStocks,ddsnowboard/FantasyStocks,ddsnowboard/FantasyStocks | import json
with open("stocks.json") as f:
Write script to remove duplicates from stocks.json | from pprint import pprint
import json
import re
REGEXP = re.compile("(?P<symbol>[A-Z]{1,4}).*")
with open("stocks.json") as f:
l = json.loads(f.read())
out = []
for i in l:
if not "^" in i["symbol"]:
out.append(i)
with open("newStocks.json", "w") as w:
w.write(json.dumps(out)... | <commit_before>import json
with open("stocks.json") as f:
<commit_msg>Write script to remove duplicates from stocks.json<commit_after> | from pprint import pprint
import json
import re
REGEXP = re.compile("(?P<symbol>[A-Z]{1,4}).*")
with open("stocks.json") as f:
l = json.loads(f.read())
out = []
for i in l:
if not "^" in i["symbol"]:
out.append(i)
with open("newStocks.json", "w") as w:
w.write(json.dumps(out)... | import json
with open("stocks.json") as f:
Write script to remove duplicates from stocks.jsonfrom pprint import pprint
import json
import re
REGEXP = re.compile("(?P<symbol>[A-Z]{1,4}).*")
with open("stocks.json") as f:
l = json.loads(f.read())
out = []
for i in l:
if not "^" in i["symbol"]:
... | <commit_before>import json
with open("stocks.json") as f:
<commit_msg>Write script to remove duplicates from stocks.json<commit_after>from pprint import pprint
import json
import re
REGEXP = re.compile("(?P<symbol>[A-Z]{1,4}).*")
with open("stocks.json") as f:
l = json.loads(f.read())
out = []
for i in... |
d1c3f195e455b926429aadf84cfd9fc51db2802f | fluent_contents/tests/test_models.py | fluent_contents/tests/test_models.py | from django.contrib.contenttypes.models import ContentType
from fluent_contents.models import ContentItem
from fluent_contents.tests.utils import AppTestCase
class ModelTests(AppTestCase):
"""
Testing the data model.
"""
def test_stale_model_str(self):
"""
No matter what, the Content... | import django
from django.contrib.contenttypes.models import ContentType
from fluent_contents.models import ContentItem
from fluent_contents.tests.utils import AppTestCase
class ModelTests(AppTestCase):
"""
Testing the data model.
"""
def test_stale_model_str(self):
"""
No matter wha... | Improve tests for older Django versions | Improve tests for older Django versions
| Python | apache-2.0 | edoburu/django-fluent-contents,edoburu/django-fluent-contents,django-fluent/django-fluent-contents,django-fluent/django-fluent-contents,django-fluent/django-fluent-contents,edoburu/django-fluent-contents | from django.contrib.contenttypes.models import ContentType
from fluent_contents.models import ContentItem
from fluent_contents.tests.utils import AppTestCase
class ModelTests(AppTestCase):
"""
Testing the data model.
"""
def test_stale_model_str(self):
"""
No matter what, the Content... | import django
from django.contrib.contenttypes.models import ContentType
from fluent_contents.models import ContentItem
from fluent_contents.tests.utils import AppTestCase
class ModelTests(AppTestCase):
"""
Testing the data model.
"""
def test_stale_model_str(self):
"""
No matter wha... | <commit_before>from django.contrib.contenttypes.models import ContentType
from fluent_contents.models import ContentItem
from fluent_contents.tests.utils import AppTestCase
class ModelTests(AppTestCase):
"""
Testing the data model.
"""
def test_stale_model_str(self):
"""
No matter wh... | import django
from django.contrib.contenttypes.models import ContentType
from fluent_contents.models import ContentItem
from fluent_contents.tests.utils import AppTestCase
class ModelTests(AppTestCase):
"""
Testing the data model.
"""
def test_stale_model_str(self):
"""
No matter wha... | from django.contrib.contenttypes.models import ContentType
from fluent_contents.models import ContentItem
from fluent_contents.tests.utils import AppTestCase
class ModelTests(AppTestCase):
"""
Testing the data model.
"""
def test_stale_model_str(self):
"""
No matter what, the Content... | <commit_before>from django.contrib.contenttypes.models import ContentType
from fluent_contents.models import ContentItem
from fluent_contents.tests.utils import AppTestCase
class ModelTests(AppTestCase):
"""
Testing the data model.
"""
def test_stale_model_str(self):
"""
No matter wh... |
d677027fb2e99305ec618b42c0bd96fa7f41125d | armaadmin/interface/common.py | armaadmin/interface/common.py | import base64
import os
from armaadmin import users, web
class AuthorizedHandler(web.HTTPHandler):
auth = [ 'Basic', 'Key' ]
realm = 'unknown'
def respond(self):
auth_header = self.request.headers.get('Authorization')
if not auth_header:
return unauthorized()
try:
self.auth_type, self.auth_string = ... | import base64
import os
from armaadmin import users, web
class AuthorizedHandler(web.HTTPHandler):
auth = [ 'Basic', 'Key' ]
realm = 'unknown'
def respond(self):
auth_header = self.request.headers.get('Authorization')
if not auth_header:
return unauthorized()
try:
self.auth_type, self.auth_string = ... | Use stream for lower memory usage | Use stream for lower memory usage
| Python | mit | fkmclane/MCP,fkmclane/MCP,fkmclane/MCP,fkmclane/MCP | import base64
import os
from armaadmin import users, web
class AuthorizedHandler(web.HTTPHandler):
auth = [ 'Basic', 'Key' ]
realm = 'unknown'
def respond(self):
auth_header = self.request.headers.get('Authorization')
if not auth_header:
return unauthorized()
try:
self.auth_type, self.auth_string = ... | import base64
import os
from armaadmin import users, web
class AuthorizedHandler(web.HTTPHandler):
auth = [ 'Basic', 'Key' ]
realm = 'unknown'
def respond(self):
auth_header = self.request.headers.get('Authorization')
if not auth_header:
return unauthorized()
try:
self.auth_type, self.auth_string = ... | <commit_before>import base64
import os
from armaadmin import users, web
class AuthorizedHandler(web.HTTPHandler):
auth = [ 'Basic', 'Key' ]
realm = 'unknown'
def respond(self):
auth_header = self.request.headers.get('Authorization')
if not auth_header:
return unauthorized()
try:
self.auth_type, self... | import base64
import os
from armaadmin import users, web
class AuthorizedHandler(web.HTTPHandler):
auth = [ 'Basic', 'Key' ]
realm = 'unknown'
def respond(self):
auth_header = self.request.headers.get('Authorization')
if not auth_header:
return unauthorized()
try:
self.auth_type, self.auth_string = ... | import base64
import os
from armaadmin import users, web
class AuthorizedHandler(web.HTTPHandler):
auth = [ 'Basic', 'Key' ]
realm = 'unknown'
def respond(self):
auth_header = self.request.headers.get('Authorization')
if not auth_header:
return unauthorized()
try:
self.auth_type, self.auth_string = ... | <commit_before>import base64
import os
from armaadmin import users, web
class AuthorizedHandler(web.HTTPHandler):
auth = [ 'Basic', 'Key' ]
realm = 'unknown'
def respond(self):
auth_header = self.request.headers.get('Authorization')
if not auth_header:
return unauthorized()
try:
self.auth_type, self... |
2c8b60569d20a350b33f3c5e8ba00bdc3d9bbee4 | ask_sweden/lambda_function.py | ask_sweden/lambda_function.py | import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
from ask import alexa
def lambda_handler(request_obj, context=None):
return alexa.route_request(request_obj)
@alexa.default
def default_handler(request):
logger.info('default_handler')
return alexa.respond('There were 42 accidents ... | import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
from ask import alexa
def lambda_handler(request_obj, context=None):
return alexa.route_request(request_obj)
@alexa.default
def default_handler(request):
logger.info('default_handler')
return alexa.respond('There were 42 accidents ... | Use respond instead of create_response | Use respond instead of create_response
| Python | mit | geoaxis/ask-sweden,geoaxis/ask-sweden | import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
from ask import alexa
def lambda_handler(request_obj, context=None):
return alexa.route_request(request_obj)
@alexa.default
def default_handler(request):
logger.info('default_handler')
return alexa.respond('There were 42 accidents ... | import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
from ask import alexa
def lambda_handler(request_obj, context=None):
return alexa.route_request(request_obj)
@alexa.default
def default_handler(request):
logger.info('default_handler')
return alexa.respond('There were 42 accidents ... | <commit_before>import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
from ask import alexa
def lambda_handler(request_obj, context=None):
return alexa.route_request(request_obj)
@alexa.default
def default_handler(request):
logger.info('default_handler')
return alexa.respond('There wer... | import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
from ask import alexa
def lambda_handler(request_obj, context=None):
return alexa.route_request(request_obj)
@alexa.default
def default_handler(request):
logger.info('default_handler')
return alexa.respond('There were 42 accidents ... | import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
from ask import alexa
def lambda_handler(request_obj, context=None):
return alexa.route_request(request_obj)
@alexa.default
def default_handler(request):
logger.info('default_handler')
return alexa.respond('There were 42 accidents ... | <commit_before>import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
from ask import alexa
def lambda_handler(request_obj, context=None):
return alexa.route_request(request_obj)
@alexa.default
def default_handler(request):
logger.info('default_handler')
return alexa.respond('There wer... |
aa82f91d220e8985c7f6dc68433ad65e70a71d15 | froide/foirequest/tests/test_mail.py | froide/foirequest/tests/test_mail.py | # -*- coding: utf-8 -*-
from __future__ import with_statement
from django.test import TestCase
from foirequest.tasks import _process_mail
from foirequest.models import FoiRequest
class MailTest(TestCase):
fixtures = ['publicbodies.json', "foirequest.json"]
def test_working(self):
with file("foirequ... | # -*- coding: utf-8 -*-
from __future__ import with_statement
from django.test import TestCase
from foirequest.tasks import _process_mail
from foirequest.models import FoiRequest
class MailTest(TestCase):
fixtures = ['publicbodies.json', "foirequest.json"]
def test_working(self):
with file("foirequ... | Test for attachment in mail test | Test for attachment in mail test | Python | mit | catcosmo/froide,okfse/froide,fin/froide,stefanw/froide,catcosmo/froide,fin/froide,LilithWittmann/froide,LilithWittmann/froide,okfse/froide,LilithWittmann/froide,ryankanno/froide,stefanw/froide,LilithWittmann/froide,catcosmo/froide,catcosmo/froide,ryankanno/froide,CodeforHawaii/froide,okfse/froide,ryankanno/froide,ryank... | # -*- coding: utf-8 -*-
from __future__ import with_statement
from django.test import TestCase
from foirequest.tasks import _process_mail
from foirequest.models import FoiRequest
class MailTest(TestCase):
fixtures = ['publicbodies.json', "foirequest.json"]
def test_working(self):
with file("foirequ... | # -*- coding: utf-8 -*-
from __future__ import with_statement
from django.test import TestCase
from foirequest.tasks import _process_mail
from foirequest.models import FoiRequest
class MailTest(TestCase):
fixtures = ['publicbodies.json', "foirequest.json"]
def test_working(self):
with file("foirequ... | <commit_before># -*- coding: utf-8 -*-
from __future__ import with_statement
from django.test import TestCase
from foirequest.tasks import _process_mail
from foirequest.models import FoiRequest
class MailTest(TestCase):
fixtures = ['publicbodies.json', "foirequest.json"]
def test_working(self):
wit... | # -*- coding: utf-8 -*-
from __future__ import with_statement
from django.test import TestCase
from foirequest.tasks import _process_mail
from foirequest.models import FoiRequest
class MailTest(TestCase):
fixtures = ['publicbodies.json', "foirequest.json"]
def test_working(self):
with file("foirequ... | # -*- coding: utf-8 -*-
from __future__ import with_statement
from django.test import TestCase
from foirequest.tasks import _process_mail
from foirequest.models import FoiRequest
class MailTest(TestCase):
fixtures = ['publicbodies.json', "foirequest.json"]
def test_working(self):
with file("foirequ... | <commit_before># -*- coding: utf-8 -*-
from __future__ import with_statement
from django.test import TestCase
from foirequest.tasks import _process_mail
from foirequest.models import FoiRequest
class MailTest(TestCase):
fixtures = ['publicbodies.json', "foirequest.json"]
def test_working(self):
wit... |
20f0d90f5c64322864ad5fda4b4c9314e6c1cb11 | run.py | run.py | #!/usr/bin/env python
# coding=utf-8
import sys
from kitchen.text.converters import getwriter
from utils.log import getLogger, open_log, close_log
from utils.misc import output_exception
from system.factory_manager import Manager
sys.stdout = getwriter('utf-8')(sys.stdout)
sys.stderr = getwriter('utf-8')(sys.stderr)... | #!/usr/bin/env python
# coding=utf-8
import os
import sys
from kitchen.text.converters import getwriter
from utils.log import getLogger, open_log, close_log
from utils.misc import output_exception
from system.factory_manager import Manager
sys.stdout = getwriter('utf-8')(sys.stdout)
sys.stderr = getwriter('utf-8')(s... | Create logs folder if it doesn't exist (to prevent errors) | Create logs folder if it doesn't exist (to prevent errors)
| Python | artistic-2.0 | UltrosBot/Ultros,UltrosBot/Ultros | #!/usr/bin/env python
# coding=utf-8
import sys
from kitchen.text.converters import getwriter
from utils.log import getLogger, open_log, close_log
from utils.misc import output_exception
from system.factory_manager import Manager
sys.stdout = getwriter('utf-8')(sys.stdout)
sys.stderr = getwriter('utf-8')(sys.stderr)... | #!/usr/bin/env python
# coding=utf-8
import os
import sys
from kitchen.text.converters import getwriter
from utils.log import getLogger, open_log, close_log
from utils.misc import output_exception
from system.factory_manager import Manager
sys.stdout = getwriter('utf-8')(sys.stdout)
sys.stderr = getwriter('utf-8')(s... | <commit_before>#!/usr/bin/env python
# coding=utf-8
import sys
from kitchen.text.converters import getwriter
from utils.log import getLogger, open_log, close_log
from utils.misc import output_exception
from system.factory_manager import Manager
sys.stdout = getwriter('utf-8')(sys.stdout)
sys.stderr = getwriter('utf-... | #!/usr/bin/env python
# coding=utf-8
import os
import sys
from kitchen.text.converters import getwriter
from utils.log import getLogger, open_log, close_log
from utils.misc import output_exception
from system.factory_manager import Manager
sys.stdout = getwriter('utf-8')(sys.stdout)
sys.stderr = getwriter('utf-8')(s... | #!/usr/bin/env python
# coding=utf-8
import sys
from kitchen.text.converters import getwriter
from utils.log import getLogger, open_log, close_log
from utils.misc import output_exception
from system.factory_manager import Manager
sys.stdout = getwriter('utf-8')(sys.stdout)
sys.stderr = getwriter('utf-8')(sys.stderr)... | <commit_before>#!/usr/bin/env python
# coding=utf-8
import sys
from kitchen.text.converters import getwriter
from utils.log import getLogger, open_log, close_log
from utils.misc import output_exception
from system.factory_manager import Manager
sys.stdout = getwriter('utf-8')(sys.stdout)
sys.stderr = getwriter('utf-... |
80215a593c2fdcf0a0ae8b1c61c4342faffd6dac | run.py | run.py | import bb2gh
import time
config_yaml = 'config.yaml'
for issue_id in range(1, 500):
while True:
try:
bb2gh.migrate(config_yaml, verbose=True, issue_ids=[issue_id])
except Exception as inst:
print 'issue_id',issue_id
print type(inst)
print inst.data['... | import bb2gh
import time
config_yaml = 'config.yaml'
for issue_id in range(190, 500):
while True:
try:
bb2gh.migrate(config_yaml, verbose=True, issue_ids=[issue_id])
except Exception as inst:
print 'issue_id',issue_id
print type(inst)
print inst
... | Fix bug, 'message' key throwing error. | Fix bug, 'message' key throwing error.
| Python | mit | wd15/bb2gh | import bb2gh
import time
config_yaml = 'config.yaml'
for issue_id in range(1, 500):
while True:
try:
bb2gh.migrate(config_yaml, verbose=True, issue_ids=[issue_id])
except Exception as inst:
print 'issue_id',issue_id
print type(inst)
print inst.data['... | import bb2gh
import time
config_yaml = 'config.yaml'
for issue_id in range(190, 500):
while True:
try:
bb2gh.migrate(config_yaml, verbose=True, issue_ids=[issue_id])
except Exception as inst:
print 'issue_id',issue_id
print type(inst)
print inst
... | <commit_before>import bb2gh
import time
config_yaml = 'config.yaml'
for issue_id in range(1, 500):
while True:
try:
bb2gh.migrate(config_yaml, verbose=True, issue_ids=[issue_id])
except Exception as inst:
print 'issue_id',issue_id
print type(inst)
pr... | import bb2gh
import time
config_yaml = 'config.yaml'
for issue_id in range(190, 500):
while True:
try:
bb2gh.migrate(config_yaml, verbose=True, issue_ids=[issue_id])
except Exception as inst:
print 'issue_id',issue_id
print type(inst)
print inst
... | import bb2gh
import time
config_yaml = 'config.yaml'
for issue_id in range(1, 500):
while True:
try:
bb2gh.migrate(config_yaml, verbose=True, issue_ids=[issue_id])
except Exception as inst:
print 'issue_id',issue_id
print type(inst)
print inst.data['... | <commit_before>import bb2gh
import time
config_yaml = 'config.yaml'
for issue_id in range(1, 500):
while True:
try:
bb2gh.migrate(config_yaml, verbose=True, issue_ids=[issue_id])
except Exception as inst:
print 'issue_id',issue_id
print type(inst)
pr... |
ba983dea1e20409d403a86d62c300ea3d257b58a | parserscripts/phage.py | parserscripts/phage.py | import re
class Phage:
supported_databases = {
# European Nucleotide Archive phage database
"ENA": r"^gi\|[0-9]+\|ref\|([^\|]+)\|\ ([^,]+)[^$]*$",
# National Center for Biotechnology Information phage database
"NCBI": r"^ENA\|([^\|]+)\|[^\ ]+\ ([^,]+)[^$]*$",
# Actinobact... | import re
class Phage:
SUPPORTED_DATABASES = {
# European Nucleotide Archive phage database
"ENA": r"^gi\|[0-9]+\|ref\|([^\|]+)\|\ ([^,]+)[^$]*$",
# National Center for Biotechnology Information phage database
"NCBI": r"^ENA\|([^\|]+)\|[^\ ]+\ ([^,]+)[^$]*$",
# Actinobact... | Rename to follow constant naming conventions | Rename to follow constant naming conventions
| Python | mit | mbonsma/phageParser,mbonsma/phageParser,phageParser/phageParser,mbonsma/phageParser,phageParser/phageParser,goyalsid/phageParser,goyalsid/phageParser,phageParser/phageParser,phageParser/phageParser,mbonsma/phageParser,goyalsid/phageParser | import re
class Phage:
supported_databases = {
# European Nucleotide Archive phage database
"ENA": r"^gi\|[0-9]+\|ref\|([^\|]+)\|\ ([^,]+)[^$]*$",
# National Center for Biotechnology Information phage database
"NCBI": r"^ENA\|([^\|]+)\|[^\ ]+\ ([^,]+)[^$]*$",
# Actinobact... | import re
class Phage:
SUPPORTED_DATABASES = {
# European Nucleotide Archive phage database
"ENA": r"^gi\|[0-9]+\|ref\|([^\|]+)\|\ ([^,]+)[^$]*$",
# National Center for Biotechnology Information phage database
"NCBI": r"^ENA\|([^\|]+)\|[^\ ]+\ ([^,]+)[^$]*$",
# Actinobact... | <commit_before>import re
class Phage:
supported_databases = {
# European Nucleotide Archive phage database
"ENA": r"^gi\|[0-9]+\|ref\|([^\|]+)\|\ ([^,]+)[^$]*$",
# National Center for Biotechnology Information phage database
"NCBI": r"^ENA\|([^\|]+)\|[^\ ]+\ ([^,]+)[^$]*$",
... | import re
class Phage:
SUPPORTED_DATABASES = {
# European Nucleotide Archive phage database
"ENA": r"^gi\|[0-9]+\|ref\|([^\|]+)\|\ ([^,]+)[^$]*$",
# National Center for Biotechnology Information phage database
"NCBI": r"^ENA\|([^\|]+)\|[^\ ]+\ ([^,]+)[^$]*$",
# Actinobact... | import re
class Phage:
supported_databases = {
# European Nucleotide Archive phage database
"ENA": r"^gi\|[0-9]+\|ref\|([^\|]+)\|\ ([^,]+)[^$]*$",
# National Center for Biotechnology Information phage database
"NCBI": r"^ENA\|([^\|]+)\|[^\ ]+\ ([^,]+)[^$]*$",
# Actinobact... | <commit_before>import re
class Phage:
supported_databases = {
# European Nucleotide Archive phage database
"ENA": r"^gi\|[0-9]+\|ref\|([^\|]+)\|\ ([^,]+)[^$]*$",
# National Center for Biotechnology Information phage database
"NCBI": r"^ENA\|([^\|]+)\|[^\ ]+\ ([^,]+)[^$]*$",
... |
8c05cb85c47db892dd13abbd91b3948c09b9a954 | statsmodels/tools/__init__.py | statsmodels/tools/__init__.py | from tools import add_constant, categorical
from datautils import Dataset
from statsmodels import NoseWrapper as Tester
test = Tester().test
| from tools import add_constant, categorical
from statsmodels import NoseWrapper as Tester
test = Tester().test
| Remove import of moved file | REF: Remove import of moved file
| Python | bsd-3-clause | josef-pkt/statsmodels,adammenges/statsmodels,saketkc/statsmodels,DonBeo/statsmodels,edhuckle/statsmodels,saketkc/statsmodels,wkfwkf/statsmodels,wzbozon/statsmodels,huongttlan/statsmodels,kiyoto/statsmodels,astocko/statsmodels,musically-ut/statsmodels,bsipocz/statsmodels,wwf5067/statsmodels,jstoxrocky/statsmodels,cbmoor... | from tools import add_constant, categorical
from datautils import Dataset
from statsmodels import NoseWrapper as Tester
test = Tester().test
REF: Remove import of moved file | from tools import add_constant, categorical
from statsmodels import NoseWrapper as Tester
test = Tester().test
| <commit_before>from tools import add_constant, categorical
from datautils import Dataset
from statsmodels import NoseWrapper as Tester
test = Tester().test
<commit_msg>REF: Remove import of moved file<commit_after> | from tools import add_constant, categorical
from statsmodels import NoseWrapper as Tester
test = Tester().test
| from tools import add_constant, categorical
from datautils import Dataset
from statsmodels import NoseWrapper as Tester
test = Tester().test
REF: Remove import of moved filefrom tools import add_constant, categorical
from statsmodels import NoseWrapper as Tester
test = Tester().test
| <commit_before>from tools import add_constant, categorical
from datautils import Dataset
from statsmodels import NoseWrapper as Tester
test = Tester().test
<commit_msg>REF: Remove import of moved file<commit_after>from tools import add_constant, categorical
from statsmodels import NoseWrapper as Tester
test = Tester(... |
b090c7ae0f5407562e3adc818d2f65ccd4ea7e02 | src/arc_utilities/listener.py | src/arc_utilities/listener.py | from copy import deepcopy
from threading import Lock
import rospy
from arc_utilities.ros_helpers import wait_for
class Listener:
def __init__(self, topic_name, topic_type, wait_for_data=False):
"""
Listener is a wrapper around a subscriber where the callback simply records the latest msg.
... | from copy import deepcopy
from threading import Lock
import rospy
from arc_utilities.ros_helpers import wait_for
class Listener:
def __init__(self, topic_name, topic_type, wait_for_data=False, callback=None):
"""
Listener is a wrapper around a subscriber where the callback simply records the late... | Allow optional callbacks for Listeners | Allow optional callbacks for Listeners
| Python | bsd-2-clause | WPI-ARC/arc_utilities,UM-ARM-Lab/arc_utilities,UM-ARM-Lab/arc_utilities,UM-ARM-Lab/arc_utilities,WPI-ARC/arc_utilities,WPI-ARC/arc_utilities | from copy import deepcopy
from threading import Lock
import rospy
from arc_utilities.ros_helpers import wait_for
class Listener:
def __init__(self, topic_name, topic_type, wait_for_data=False):
"""
Listener is a wrapper around a subscriber where the callback simply records the latest msg.
... | from copy import deepcopy
from threading import Lock
import rospy
from arc_utilities.ros_helpers import wait_for
class Listener:
def __init__(self, topic_name, topic_type, wait_for_data=False, callback=None):
"""
Listener is a wrapper around a subscriber where the callback simply records the late... | <commit_before>from copy import deepcopy
from threading import Lock
import rospy
from arc_utilities.ros_helpers import wait_for
class Listener:
def __init__(self, topic_name, topic_type, wait_for_data=False):
"""
Listener is a wrapper around a subscriber where the callback simply records the late... | from copy import deepcopy
from threading import Lock
import rospy
from arc_utilities.ros_helpers import wait_for
class Listener:
def __init__(self, topic_name, topic_type, wait_for_data=False, callback=None):
"""
Listener is a wrapper around a subscriber where the callback simply records the late... | from copy import deepcopy
from threading import Lock
import rospy
from arc_utilities.ros_helpers import wait_for
class Listener:
def __init__(self, topic_name, topic_type, wait_for_data=False):
"""
Listener is a wrapper around a subscriber where the callback simply records the latest msg.
... | <commit_before>from copy import deepcopy
from threading import Lock
import rospy
from arc_utilities.ros_helpers import wait_for
class Listener:
def __init__(self, topic_name, topic_type, wait_for_data=False):
"""
Listener is a wrapper around a subscriber where the callback simply records the late... |
06599b85719aa0c82da9635939bfcaf20b473fd3 | run_tests.py | run_tests.py | import os
import sys
from django.conf import settings
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
INSTALLED_APPS=(
'django.contrib.auth',
'django.contrib.contenttyp... | import os
import sys
import django
from django.conf import settings
DJANGO_VERSION = float('.'.join([str(i) for i in django.VERSION[0:2]]))
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},... | Fix running tests for both django 1.6 and 1.7 | Fix running tests for both django 1.6 and 1.7
| Python | bsd-3-clause | Alir3z4/django-cuser | import os
import sys
from django.conf import settings
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
INSTALLED_APPS=(
'django.contrib.auth',
'django.contrib.contenttyp... | import os
import sys
import django
from django.conf import settings
DJANGO_VERSION = float('.'.join([str(i) for i in django.VERSION[0:2]]))
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},... | <commit_before>import os
import sys
from django.conf import settings
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
INSTALLED_APPS=(
'django.contrib.auth',
'django.con... | import os
import sys
import django
from django.conf import settings
DJANGO_VERSION = float('.'.join([str(i) for i in django.VERSION[0:2]]))
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},... | import os
import sys
from django.conf import settings
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
INSTALLED_APPS=(
'django.contrib.auth',
'django.contrib.contenttyp... | <commit_before>import os
import sys
from django.conf import settings
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
INSTALLED_APPS=(
'django.contrib.auth',
'django.con... |
c774093bd448b6f8bf9ceef2d68ce1033ba06640 | run_tests.py | run_tests.py | import os
import sys
import django
from django.conf import settings
DJANGO_VERSION = float('.'.join([str(i) for i in django.VERSION[0:2]]))
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},... | import os
import sys
import django
from django.conf import settings
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
INSTALLED_APPS=(
'django.contrib.admin',
'django.co... | Remove backward compt and fix test runner | Remove backward compt and fix test runner
| Python | bsd-3-clause | Alir3z4/django-cuser | import os
import sys
import django
from django.conf import settings
DJANGO_VERSION = float('.'.join([str(i) for i in django.VERSION[0:2]]))
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},... | import os
import sys
import django
from django.conf import settings
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
INSTALLED_APPS=(
'django.contrib.admin',
'django.co... | <commit_before>import os
import sys
import django
from django.conf import settings
DJANGO_VERSION = float('.'.join([str(i) for i in django.VERSION[0:2]]))
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
... | import os
import sys
import django
from django.conf import settings
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
INSTALLED_APPS=(
'django.contrib.admin',
'django.co... | import os
import sys
import django
from django.conf import settings
DJANGO_VERSION = float('.'.join([str(i) for i in django.VERSION[0:2]]))
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},... | <commit_before>import os
import sys
import django
from django.conf import settings
DJANGO_VERSION = float('.'.join([str(i) for i in django.VERSION[0:2]]))
DIR_NAME = os.path.dirname(__file__)
settings.configure(
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
... |
7fc62edee40ecedc49b0529e17ac04e4d7bf6865 | door/models.py | door/models.py | from django.db import models
from django.utils import timezone
class DoorStatus(models.Model):
datetime = models.DateTimeField()
status = models.BooleanField(default=False)
name = models.CharField(max_length=20)
def __str__(self):
return self.name
@staticmethod
def get_door_by_name(n... | from django.db import models
from django.utils import timezone
class DoorStatus(models.Model):
datetime = models.DateTimeField()
status = models.BooleanField(default=False)
name = models.CharField(max_length=20)
def __str__(self):
return self.name
@staticmethod
def get_door_by_name(n... | Change plural name of DoorStatus model | Change plural name of DoorStatus model
| Python | mit | hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website | from django.db import models
from django.utils import timezone
class DoorStatus(models.Model):
datetime = models.DateTimeField()
status = models.BooleanField(default=False)
name = models.CharField(max_length=20)
def __str__(self):
return self.name
@staticmethod
def get_door_by_name(n... | from django.db import models
from django.utils import timezone
class DoorStatus(models.Model):
datetime = models.DateTimeField()
status = models.BooleanField(default=False)
name = models.CharField(max_length=20)
def __str__(self):
return self.name
@staticmethod
def get_door_by_name(n... | <commit_before>from django.db import models
from django.utils import timezone
class DoorStatus(models.Model):
datetime = models.DateTimeField()
status = models.BooleanField(default=False)
name = models.CharField(max_length=20)
def __str__(self):
return self.name
@staticmethod
def get... | from django.db import models
from django.utils import timezone
class DoorStatus(models.Model):
datetime = models.DateTimeField()
status = models.BooleanField(default=False)
name = models.CharField(max_length=20)
def __str__(self):
return self.name
@staticmethod
def get_door_by_name(n... | from django.db import models
from django.utils import timezone
class DoorStatus(models.Model):
datetime = models.DateTimeField()
status = models.BooleanField(default=False)
name = models.CharField(max_length=20)
def __str__(self):
return self.name
@staticmethod
def get_door_by_name(n... | <commit_before>from django.db import models
from django.utils import timezone
class DoorStatus(models.Model):
datetime = models.DateTimeField()
status = models.BooleanField(default=False)
name = models.CharField(max_length=20)
def __str__(self):
return self.name
@staticmethod
def get... |
4e727b52828122c37b8c398f16ad914898968e83 | examples/rmg/minimal/input.py | examples/rmg/minimal/input.py | # Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'],
kineticsEstimator = 'rate rules',
)
# List of species
species(
label='et... | # Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'],
kineticsEstimator = 'rate rules',
)
# List of species
species(
label='et... | Remove solvent(water) from minimal example. | Remove solvent(water) from minimal example.
Minimal should be just that - minimal.
This hides issue #165 | Python | mit | enochd/RMG-Py,nickvandewiele/RMG-Py,faribas/RMG-Py,comocheng/RMG-Py,nyee/RMG-Py,chatelak/RMG-Py,pierrelb/RMG-Py,faribas/RMG-Py,comocheng/RMG-Py,pierrelb/RMG-Py,nyee/RMG-Py,enochd/RMG-Py,nickvandewiele/RMG-Py,KEHANG/RMG-Py,chatelak/RMG-Py,KEHANG/RMG-Py | # Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'],
kineticsEstimator = 'rate rules',
)
# List of species
species(
label='et... | # Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'],
kineticsEstimator = 'rate rules',
)
# List of species
species(
label='et... | <commit_before># Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'],
kineticsEstimator = 'rate rules',
)
# List of species
species... | # Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'],
kineticsEstimator = 'rate rules',
)
# List of species
species(
label='et... | # Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'],
kineticsEstimator = 'rate rules',
)
# List of species
species(
label='et... | <commit_before># Data sources
database(
thermoLibraries = ['primaryThermoLibrary'],
reactionLibraries = [],
seedMechanisms = [],
kineticsDepositories = ['training'],
kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'],
kineticsEstimator = 'rate rules',
)
# List of species
species... |
f8b8f3a223f195704f8cc9753963fbe82f1e4674 | feincms/content/rss/models.py | feincms/content/rss/models.py | from datetime import datetime
from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
import feedparser
class RSSContent(models.Model):
link = models.URLField(_('link'))
rendered_co... | from datetime import datetime
from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
import feedparser
class RSSContent(models.Model):
title = models.CharField(help_text=_('The rss fie... | Add a title field to the RSSContent | Add a title field to the RSSContent
| Python | bsd-3-clause | hgrimelid/feincms,joshuajonah/feincms,michaelkuty/feincms,matthiask/feincms2-content,nickburlett/feincms,michaelkuty/feincms,nickburlett/feincms,matthiask/django-content-editor,michaelkuty/feincms,nickburlett/feincms,hgrimelid/feincms,feincms/feincms,feincms/feincms,joshuajonah/feincms,matthiask/django-content-editor,m... | from datetime import datetime
from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
import feedparser
class RSSContent(models.Model):
link = models.URLField(_('link'))
rendered_co... | from datetime import datetime
from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
import feedparser
class RSSContent(models.Model):
title = models.CharField(help_text=_('The rss fie... | <commit_before>from datetime import datetime
from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
import feedparser
class RSSContent(models.Model):
link = models.URLField(_('link'))
... | from datetime import datetime
from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
import feedparser
class RSSContent(models.Model):
title = models.CharField(help_text=_('The rss fie... | from datetime import datetime
from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
import feedparser
class RSSContent(models.Model):
link = models.URLField(_('link'))
rendered_co... | <commit_before>from datetime import datetime
from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
import feedparser
class RSSContent(models.Model):
link = models.URLField(_('link'))
... |
fae3e55b1c472cd314676431a34fe6e160418626 | tests/test_command_line.py | tests/test_command_line.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import subprocess
class TestCommandLine(object):
def setup(self):
"""Set up the environment by moving to the demos directory."""
os.chdir("demos")
def teardown(self):
os.chdir("..")
def add(self, *args):
self.db.add_all... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import subprocess
from dallinger.command_line import heroku_id
class TestCommandLine(object):
def setup(self):
"""Set up the environment by moving to the demos directory."""
os.chdir("demos")
def teardown(self):
os.chdir("..")
... | Test for Heroku app name length | Test for Heroku app name length
| Python | mit | jcpeterson/Dallinger,Dallinger/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import subprocess
class TestCommandLine(object):
def setup(self):
"""Set up the environment by moving to the demos directory."""
os.chdir("demos")
def teardown(self):
os.chdir("..")
def add(self, *args):
self.db.add_all... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import subprocess
from dallinger.command_line import heroku_id
class TestCommandLine(object):
def setup(self):
"""Set up the environment by moving to the demos directory."""
os.chdir("demos")
def teardown(self):
os.chdir("..")
... | <commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import subprocess
class TestCommandLine(object):
def setup(self):
"""Set up the environment by moving to the demos directory."""
os.chdir("demos")
def teardown(self):
os.chdir("..")
def add(self, *args):
... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import subprocess
from dallinger.command_line import heroku_id
class TestCommandLine(object):
def setup(self):
"""Set up the environment by moving to the demos directory."""
os.chdir("demos")
def teardown(self):
os.chdir("..")
... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import subprocess
class TestCommandLine(object):
def setup(self):
"""Set up the environment by moving to the demos directory."""
os.chdir("demos")
def teardown(self):
os.chdir("..")
def add(self, *args):
self.db.add_all... | <commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import subprocess
class TestCommandLine(object):
def setup(self):
"""Set up the environment by moving to the demos directory."""
os.chdir("demos")
def teardown(self):
os.chdir("..")
def add(self, *args):
... |
ccc6c983411f951ef3906d55d6a0946c7ef93c75 | app/brief_utils.py | app/brief_utils.py | from flask import abort
from .models import Service
from .validation import get_validation_errors
from .service_utils import filter_services
def validate_brief_data(brief, enforce_required=True, required_fields=None):
errs = get_validation_errors(
'briefs-{}-{}'.format(brief.framework.slug, brief.lot.slu... | from flask import abort
from .models import Service
from .validation import get_validation_errors
from .service_utils import filter_services
def validate_brief_data(brief, enforce_required=True, required_fields=None):
errs = get_validation_errors(
'briefs-{}-{}'.format(brief.framework.slug, brief.lot.slu... | Add criteria weighting 100% total validation | Add criteria weighting 100% total validation
Checks the criteria weighting sum if all criteria fields are set.
This relies on all three fields being required.
If the fields don't add up to a 100 an error is added for each field
that doesn't have any other validation errors.
| Python | mit | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | from flask import abort
from .models import Service
from .validation import get_validation_errors
from .service_utils import filter_services
def validate_brief_data(brief, enforce_required=True, required_fields=None):
errs = get_validation_errors(
'briefs-{}-{}'.format(brief.framework.slug, brief.lot.slu... | from flask import abort
from .models import Service
from .validation import get_validation_errors
from .service_utils import filter_services
def validate_brief_data(brief, enforce_required=True, required_fields=None):
errs = get_validation_errors(
'briefs-{}-{}'.format(brief.framework.slug, brief.lot.slu... | <commit_before>from flask import abort
from .models import Service
from .validation import get_validation_errors
from .service_utils import filter_services
def validate_brief_data(brief, enforce_required=True, required_fields=None):
errs = get_validation_errors(
'briefs-{}-{}'.format(brief.framework.slug... | from flask import abort
from .models import Service
from .validation import get_validation_errors
from .service_utils import filter_services
def validate_brief_data(brief, enforce_required=True, required_fields=None):
errs = get_validation_errors(
'briefs-{}-{}'.format(brief.framework.slug, brief.lot.slu... | from flask import abort
from .models import Service
from .validation import get_validation_errors
from .service_utils import filter_services
def validate_brief_data(brief, enforce_required=True, required_fields=None):
errs = get_validation_errors(
'briefs-{}-{}'.format(brief.framework.slug, brief.lot.slu... | <commit_before>from flask import abort
from .models import Service
from .validation import get_validation_errors
from .service_utils import filter_services
def validate_brief_data(brief, enforce_required=True, required_fields=None):
errs = get_validation_errors(
'briefs-{}-{}'.format(brief.framework.slug... |
e378902b85bf865e0b020bd4afe0e12d593a95a8 | github-keys-check.py | github-keys-check.py | #!/usr/bin/python3
import urllib.request
import argparse
import pwd
import sys
def key_for_user(user):
url = 'https://github.com/%s.keys' % user
with urllib.request.urlopen(url) as f:
return f.read().decode('utf-8')
def validate_user(username, min_uid):
"""
Validates that a given username is... | #!/usr/bin/python3
import urllib.request
import argparse
import pwd
import grp
import sys
def key_for_user(user):
url = 'https://github.com/%s.keys' % user
with urllib.request.urlopen(url) as f:
return f.read().decode('utf-8')
def validate_user(username, min_uid, in_group):
"""
Validates tha... | Add --in-group parameter to validate users | Add --in-group parameter to validate users
Allows github login only for users in a certain group. This
can be used to whitelist users who are allowed to ssh in
| Python | apache-2.0 | yuvipanda/github-ssh-auth | #!/usr/bin/python3
import urllib.request
import argparse
import pwd
import sys
def key_for_user(user):
url = 'https://github.com/%s.keys' % user
with urllib.request.urlopen(url) as f:
return f.read().decode('utf-8')
def validate_user(username, min_uid):
"""
Validates that a given username is... | #!/usr/bin/python3
import urllib.request
import argparse
import pwd
import grp
import sys
def key_for_user(user):
url = 'https://github.com/%s.keys' % user
with urllib.request.urlopen(url) as f:
return f.read().decode('utf-8')
def validate_user(username, min_uid, in_group):
"""
Validates tha... | <commit_before>#!/usr/bin/python3
import urllib.request
import argparse
import pwd
import sys
def key_for_user(user):
url = 'https://github.com/%s.keys' % user
with urllib.request.urlopen(url) as f:
return f.read().decode('utf-8')
def validate_user(username, min_uid):
"""
Validates that a gi... | #!/usr/bin/python3
import urllib.request
import argparse
import pwd
import grp
import sys
def key_for_user(user):
url = 'https://github.com/%s.keys' % user
with urllib.request.urlopen(url) as f:
return f.read().decode('utf-8')
def validate_user(username, min_uid, in_group):
"""
Validates tha... | #!/usr/bin/python3
import urllib.request
import argparse
import pwd
import sys
def key_for_user(user):
url = 'https://github.com/%s.keys' % user
with urllib.request.urlopen(url) as f:
return f.read().decode('utf-8')
def validate_user(username, min_uid):
"""
Validates that a given username is... | <commit_before>#!/usr/bin/python3
import urllib.request
import argparse
import pwd
import sys
def key_for_user(user):
url = 'https://github.com/%s.keys' % user
with urllib.request.urlopen(url) as f:
return f.read().decode('utf-8')
def validate_user(username, min_uid):
"""
Validates that a gi... |
d5eccc801634f1b841fbc31de545e530b6d4bd54 | startup.py | startup.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from collections import Counter
import pandas as pd
XLS_NAME = 'startup.xls'
SHEET_NAME = 'STARTUP_15092014'
COL_NAME = 'nat.giuridica'
def main():
xls = pd.ExcelFile(XLS_NAME)
sheet = xls.parse(SHEET_NAME, index_col=None)
for k,v in Counter(sheet[COL_NAME]... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from collections import Counter
import pandas as pd
XLS_NAME = 'startup.xls'
SHEET_NAME = 'STARTUP_15092014'
def main():
xls = pd.ExcelFile(XLS_NAME)
sheet = xls.parse(SHEET_NAME, index_col=None, convert_float=False)
data = [el for el in sheet['nat.giuridi... | Add pretty output for two more fields. | Add pretty output for two more fields.
| Python | mit | jacquerie/italian-startups-report | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from collections import Counter
import pandas as pd
XLS_NAME = 'startup.xls'
SHEET_NAME = 'STARTUP_15092014'
COL_NAME = 'nat.giuridica'
def main():
xls = pd.ExcelFile(XLS_NAME)
sheet = xls.parse(SHEET_NAME, index_col=None)
for k,v in Counter(sheet[COL_NAME]... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from collections import Counter
import pandas as pd
XLS_NAME = 'startup.xls'
SHEET_NAME = 'STARTUP_15092014'
def main():
xls = pd.ExcelFile(XLS_NAME)
sheet = xls.parse(SHEET_NAME, index_col=None, convert_float=False)
data = [el for el in sheet['nat.giuridi... | <commit_before>#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from collections import Counter
import pandas as pd
XLS_NAME = 'startup.xls'
SHEET_NAME = 'STARTUP_15092014'
COL_NAME = 'nat.giuridica'
def main():
xls = pd.ExcelFile(XLS_NAME)
sheet = xls.parse(SHEET_NAME, index_col=None)
for k,v in Counter(... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from collections import Counter
import pandas as pd
XLS_NAME = 'startup.xls'
SHEET_NAME = 'STARTUP_15092014'
def main():
xls = pd.ExcelFile(XLS_NAME)
sheet = xls.parse(SHEET_NAME, index_col=None, convert_float=False)
data = [el for el in sheet['nat.giuridi... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from collections import Counter
import pandas as pd
XLS_NAME = 'startup.xls'
SHEET_NAME = 'STARTUP_15092014'
COL_NAME = 'nat.giuridica'
def main():
xls = pd.ExcelFile(XLS_NAME)
sheet = xls.parse(SHEET_NAME, index_col=None)
for k,v in Counter(sheet[COL_NAME]... | <commit_before>#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from collections import Counter
import pandas as pd
XLS_NAME = 'startup.xls'
SHEET_NAME = 'STARTUP_15092014'
COL_NAME = 'nat.giuridica'
def main():
xls = pd.ExcelFile(XLS_NAME)
sheet = xls.parse(SHEET_NAME, index_col=None)
for k,v in Counter(... |
34db881007bf0dad3b7e870d36ab4e4a68b0fd3d | emcee/run_emcee.py | emcee/run_emcee.py | #! /usr/bin/python
from os.path import abspath, join as pathjoin
from shutil import copy
from subprocess import call
from tempfile import mkdtemp
install_dir = mkdtemp(prefix='emcee.')
games_dir = abspath(pathjoin('..', 'games'))
libraries_dir = abspath('libraries')
infra_dir = abspath('infra')
print 'Installing emce... | #! /usr/bin/python
from os.path import abspath, join as pathjoin
from shutil import copy
from subprocess import Popen
from tempfile import mkdtemp
install_dir = mkdtemp(prefix='emcee.')
games_dir = abspath(pathjoin('..', 'games'))
libraries_dir = abspath('libraries')
infra_dir = abspath('infra')
print 'Installing emc... | Deploy pubsub_ws along with emcee | Deploy pubsub_ws along with emcee
| Python | mit | douglassquirrel/alexandra,douglassquirrel/alexandra,douglassquirrel/alexandra | #! /usr/bin/python
from os.path import abspath, join as pathjoin
from shutil import copy
from subprocess import call
from tempfile import mkdtemp
install_dir = mkdtemp(prefix='emcee.')
games_dir = abspath(pathjoin('..', 'games'))
libraries_dir = abspath('libraries')
infra_dir = abspath('infra')
print 'Installing emce... | #! /usr/bin/python
from os.path import abspath, join as pathjoin
from shutil import copy
from subprocess import Popen
from tempfile import mkdtemp
install_dir = mkdtemp(prefix='emcee.')
games_dir = abspath(pathjoin('..', 'games'))
libraries_dir = abspath('libraries')
infra_dir = abspath('infra')
print 'Installing emc... | <commit_before>#! /usr/bin/python
from os.path import abspath, join as pathjoin
from shutil import copy
from subprocess import call
from tempfile import mkdtemp
install_dir = mkdtemp(prefix='emcee.')
games_dir = abspath(pathjoin('..', 'games'))
libraries_dir = abspath('libraries')
infra_dir = abspath('infra')
print '... | #! /usr/bin/python
from os.path import abspath, join as pathjoin
from shutil import copy
from subprocess import Popen
from tempfile import mkdtemp
install_dir = mkdtemp(prefix='emcee.')
games_dir = abspath(pathjoin('..', 'games'))
libraries_dir = abspath('libraries')
infra_dir = abspath('infra')
print 'Installing emc... | #! /usr/bin/python
from os.path import abspath, join as pathjoin
from shutil import copy
from subprocess import call
from tempfile import mkdtemp
install_dir = mkdtemp(prefix='emcee.')
games_dir = abspath(pathjoin('..', 'games'))
libraries_dir = abspath('libraries')
infra_dir = abspath('infra')
print 'Installing emce... | <commit_before>#! /usr/bin/python
from os.path import abspath, join as pathjoin
from shutil import copy
from subprocess import call
from tempfile import mkdtemp
install_dir = mkdtemp(prefix='emcee.')
games_dir = abspath(pathjoin('..', 'games'))
libraries_dir = abspath('libraries')
infra_dir = abspath('infra')
print '... |
d5a2a11d23b9f5393b0b39ca2f90978276311f52 | app/slot/routes.py | app/slot/routes.py | from app import app
from app.slot import controller as con
import config
from auth import requires_auth
from flask import render_template
from flask.ext.login import login_required
@app.route('/dashboard')
# @requires_auth
@login_required
def index():
return con.index()
@app.route('/new', methods=['GET', 'POST... | from app import app
from app.slot import controller as con
import config
from auth import requires_auth
from flask import render_template
from flask.ext.login import login_required
@app.route('/')
@app.route('/dashboard')
@login_required
def index():
return con.index()
@app.route('/new', methods=['GET', 'POST']... | Add / route to index. Remove old requires_auth decorator. | Add / route to index.
Remove old requires_auth decorator.
| Python | mit | nhshd-slot/SLOT,nhshd-slot/SLOT,nhshd-slot/SLOT | from app import app
from app.slot import controller as con
import config
from auth import requires_auth
from flask import render_template
from flask.ext.login import login_required
@app.route('/dashboard')
# @requires_auth
@login_required
def index():
return con.index()
@app.route('/new', methods=['GET', 'POST... | from app import app
from app.slot import controller as con
import config
from auth import requires_auth
from flask import render_template
from flask.ext.login import login_required
@app.route('/')
@app.route('/dashboard')
@login_required
def index():
return con.index()
@app.route('/new', methods=['GET', 'POST']... | <commit_before>from app import app
from app.slot import controller as con
import config
from auth import requires_auth
from flask import render_template
from flask.ext.login import login_required
@app.route('/dashboard')
# @requires_auth
@login_required
def index():
return con.index()
@app.route('/new', method... | from app import app
from app.slot import controller as con
import config
from auth import requires_auth
from flask import render_template
from flask.ext.login import login_required
@app.route('/')
@app.route('/dashboard')
@login_required
def index():
return con.index()
@app.route('/new', methods=['GET', 'POST']... | from app import app
from app.slot import controller as con
import config
from auth import requires_auth
from flask import render_template
from flask.ext.login import login_required
@app.route('/dashboard')
# @requires_auth
@login_required
def index():
return con.index()
@app.route('/new', methods=['GET', 'POST... | <commit_before>from app import app
from app.slot import controller as con
import config
from auth import requires_auth
from flask import render_template
from flask.ext.login import login_required
@app.route('/dashboard')
# @requires_auth
@login_required
def index():
return con.index()
@app.route('/new', method... |
ecc816295154a3756e87349b4cff397ebd17b95f | sipa/base.py | sipa/base.py | # -*- coding: utf-8 -*-
"""
Basic utilities for the Flask app
These are basic utilities necessary for the Flask app which are
disjoint from any blueprint.
"""
from flask import request, session
from flask_login import AnonymousUserMixin, LoginManager
from werkzeug.routing import IntegerConverter as BaseIntegerConverte... | # -*- coding: utf-8 -*-
"""
Basic utilities for the Flask app
These are basic utilities necessary for the Flask app which are
disjoint from any blueprint.
"""
from flask import request, session
from flask_login import AnonymousUserMixin, LoginManager
from flask_babel import gettext
from werkzeug.routing import Integer... | Set up flask to handle login redirects. | Set up flask to handle login redirects.
Fix #147.
| Python | mit | lukasjuhrich/sipa,agdsn/sipa,agdsn/sipa,lukasjuhrich/sipa,lukasjuhrich/sipa,agdsn/sipa,agdsn/sipa,lukasjuhrich/sipa,MarauderXtreme/sipa,MarauderXtreme/sipa,MarauderXtreme/sipa | # -*- coding: utf-8 -*-
"""
Basic utilities for the Flask app
These are basic utilities necessary for the Flask app which are
disjoint from any blueprint.
"""
from flask import request, session
from flask_login import AnonymousUserMixin, LoginManager
from werkzeug.routing import IntegerConverter as BaseIntegerConverte... | # -*- coding: utf-8 -*-
"""
Basic utilities for the Flask app
These are basic utilities necessary for the Flask app which are
disjoint from any blueprint.
"""
from flask import request, session
from flask_login import AnonymousUserMixin, LoginManager
from flask_babel import gettext
from werkzeug.routing import Integer... | <commit_before># -*- coding: utf-8 -*-
"""
Basic utilities for the Flask app
These are basic utilities necessary for the Flask app which are
disjoint from any blueprint.
"""
from flask import request, session
from flask_login import AnonymousUserMixin, LoginManager
from werkzeug.routing import IntegerConverter as Base... | # -*- coding: utf-8 -*-
"""
Basic utilities for the Flask app
These are basic utilities necessary for the Flask app which are
disjoint from any blueprint.
"""
from flask import request, session
from flask_login import AnonymousUserMixin, LoginManager
from flask_babel import gettext
from werkzeug.routing import Integer... | # -*- coding: utf-8 -*-
"""
Basic utilities for the Flask app
These are basic utilities necessary for the Flask app which are
disjoint from any blueprint.
"""
from flask import request, session
from flask_login import AnonymousUserMixin, LoginManager
from werkzeug.routing import IntegerConverter as BaseIntegerConverte... | <commit_before># -*- coding: utf-8 -*-
"""
Basic utilities for the Flask app
These are basic utilities necessary for the Flask app which are
disjoint from any blueprint.
"""
from flask import request, session
from flask_login import AnonymousUserMixin, LoginManager
from werkzeug.routing import IntegerConverter as Base... |
4bf614e072a603f4b46038e2f59459c305844553 | ReversiTest.py | ReversiTest.py | import unittest
import reversi
class TestUM(unittest.TestCase):
def setUp(self):
self.board = reversi.ReversiBoard().set_default_board()
def tearDown(self):
self.board = None
def test_up(self):
tuple = (4, 3)
result = self.board.up(tuple)
self.assertEqual(result,... | #!/usr/bin/python
import unittest
import reversi
class ReversiTest(unittest.TestCase):
def setUp(self):
self.board = reversi.ReversiBoard().set_default_board()
def tearDown(self):
self.board = None
def test_up(self):
tuple = (4, 3)
result = self.board.up(tuple)
s... | Update class name in the unit tester | Update class name in the unit tester
| Python | mit | dmitrym0/reversi-py | import unittest
import reversi
class TestUM(unittest.TestCase):
def setUp(self):
self.board = reversi.ReversiBoard().set_default_board()
def tearDown(self):
self.board = None
def test_up(self):
tuple = (4, 3)
result = self.board.up(tuple)
self.assertEqual(result,... | #!/usr/bin/python
import unittest
import reversi
class ReversiTest(unittest.TestCase):
def setUp(self):
self.board = reversi.ReversiBoard().set_default_board()
def tearDown(self):
self.board = None
def test_up(self):
tuple = (4, 3)
result = self.board.up(tuple)
s... | <commit_before>import unittest
import reversi
class TestUM(unittest.TestCase):
def setUp(self):
self.board = reversi.ReversiBoard().set_default_board()
def tearDown(self):
self.board = None
def test_up(self):
tuple = (4, 3)
result = self.board.up(tuple)
self.asse... | #!/usr/bin/python
import unittest
import reversi
class ReversiTest(unittest.TestCase):
def setUp(self):
self.board = reversi.ReversiBoard().set_default_board()
def tearDown(self):
self.board = None
def test_up(self):
tuple = (4, 3)
result = self.board.up(tuple)
s... | import unittest
import reversi
class TestUM(unittest.TestCase):
def setUp(self):
self.board = reversi.ReversiBoard().set_default_board()
def tearDown(self):
self.board = None
def test_up(self):
tuple = (4, 3)
result = self.board.up(tuple)
self.assertEqual(result,... | <commit_before>import unittest
import reversi
class TestUM(unittest.TestCase):
def setUp(self):
self.board = reversi.ReversiBoard().set_default_board()
def tearDown(self):
self.board = None
def test_up(self):
tuple = (4, 3)
result = self.board.up(tuple)
self.asse... |
38603c8b35c15c134a0499ac92a7c1f7dee4f526 | send_test_data.py | send_test_data.py | #!/usr/bin/env python
import requests
import datetime
import time
import json
import random
from random import choice
random.seed(datetime.datetime.now())
names = ("vehicle_speed", "fuel_consumed_since_restart", "latitude",
"longitude")
while True:
data = {"records": [
{"timestamp": time.time() ... | #!/usr/bin/env python
import requests
import datetime
import time
import json
import sys
from util import massage_record
names = ("vehicle_speed", "fuel_consumed_since_restart", "latitude",
"longitude")
def send_records(records):
data = {"records": records}
print "Sending %s" % data
headers = {'... | Send test data from actual trace files. | Send test data from actual trace files.
| Python | bsd-3-clause | openxc/web-logging-example,openxc/web-logging-example | #!/usr/bin/env python
import requests
import datetime
import time
import json
import random
from random import choice
random.seed(datetime.datetime.now())
names = ("vehicle_speed", "fuel_consumed_since_restart", "latitude",
"longitude")
while True:
data = {"records": [
{"timestamp": time.time() ... | #!/usr/bin/env python
import requests
import datetime
import time
import json
import sys
from util import massage_record
names = ("vehicle_speed", "fuel_consumed_since_restart", "latitude",
"longitude")
def send_records(records):
data = {"records": records}
print "Sending %s" % data
headers = {'... | <commit_before>#!/usr/bin/env python
import requests
import datetime
import time
import json
import random
from random import choice
random.seed(datetime.datetime.now())
names = ("vehicle_speed", "fuel_consumed_since_restart", "latitude",
"longitude")
while True:
data = {"records": [
{"timestamp... | #!/usr/bin/env python
import requests
import datetime
import time
import json
import sys
from util import massage_record
names = ("vehicle_speed", "fuel_consumed_since_restart", "latitude",
"longitude")
def send_records(records):
data = {"records": records}
print "Sending %s" % data
headers = {'... | #!/usr/bin/env python
import requests
import datetime
import time
import json
import random
from random import choice
random.seed(datetime.datetime.now())
names = ("vehicle_speed", "fuel_consumed_since_restart", "latitude",
"longitude")
while True:
data = {"records": [
{"timestamp": time.time() ... | <commit_before>#!/usr/bin/env python
import requests
import datetime
import time
import json
import random
from random import choice
random.seed(datetime.datetime.now())
names = ("vehicle_speed", "fuel_consumed_since_restart", "latitude",
"longitude")
while True:
data = {"records": [
{"timestamp... |
b9ac30b0e428038986de64e069954ee340b991a9 | integration/group.py | integration/group.py | from spec import Spec, eq_
from fabric import ThreadingGroup as Group
class Group_(Spec):
def simple_command_on_multiple_hosts(self):
"""
Run command on localhost...twice!
"""
group = Group('localhost', 'localhost')
result = group.run('echo foo', hide=True)
# NOTE:... | from spec import Spec, eq_
from fabric import ThreadingGroup as Group
class Group_(Spec):
def simple_command(self):
group = Group('localhost', '127.0.0.1')
result = group.run('echo foo', hide=True)
eq_(
[x.stdout.strip() for x in result.values()],
['foo', 'foo'],
... | Tidy up existing integration test | Tidy up existing integration test
| Python | bsd-2-clause | fabric/fabric | from spec import Spec, eq_
from fabric import ThreadingGroup as Group
class Group_(Spec):
def simple_command_on_multiple_hosts(self):
"""
Run command on localhost...twice!
"""
group = Group('localhost', 'localhost')
result = group.run('echo foo', hide=True)
# NOTE:... | from spec import Spec, eq_
from fabric import ThreadingGroup as Group
class Group_(Spec):
def simple_command(self):
group = Group('localhost', '127.0.0.1')
result = group.run('echo foo', hide=True)
eq_(
[x.stdout.strip() for x in result.values()],
['foo', 'foo'],
... | <commit_before>from spec import Spec, eq_
from fabric import ThreadingGroup as Group
class Group_(Spec):
def simple_command_on_multiple_hosts(self):
"""
Run command on localhost...twice!
"""
group = Group('localhost', 'localhost')
result = group.run('echo foo', hide=True)
... | from spec import Spec, eq_
from fabric import ThreadingGroup as Group
class Group_(Spec):
def simple_command(self):
group = Group('localhost', '127.0.0.1')
result = group.run('echo foo', hide=True)
eq_(
[x.stdout.strip() for x in result.values()],
['foo', 'foo'],
... | from spec import Spec, eq_
from fabric import ThreadingGroup as Group
class Group_(Spec):
def simple_command_on_multiple_hosts(self):
"""
Run command on localhost...twice!
"""
group = Group('localhost', 'localhost')
result = group.run('echo foo', hide=True)
# NOTE:... | <commit_before>from spec import Spec, eq_
from fabric import ThreadingGroup as Group
class Group_(Spec):
def simple_command_on_multiple_hosts(self):
"""
Run command on localhost...twice!
"""
group = Group('localhost', 'localhost')
result = group.run('echo foo', hide=True)
... |
58a96c65f1e9868fb607cd3ce56dbf60905f62a7 | autoencoder/api.py | autoencoder/api.py | from .io import preprocess
from .train import train
from .network import mlp
def autoencode(count_matrix, kfold=None, dimreduce=True, reconstruct=True,
mask=None, type='normal', activation='relu', testset=False,
learning_rate=1e-2, hidden_size=(256,64,256), l2_coef=0.,
epo... | from .io import preprocess
from .train import train
from .network import mlp
def autoencode(count_matrix, kfold=None, dimreduce=True, reconstruct=True,
mask=None, type='normal', activation='relu', testset=False,
learning_rate=1e-2, hidden_size=(256,64,256), l2_coef=0.,
epo... | Add optimizer to the API | Add optimizer to the API
Former-commit-id: 3e06c976ad6a7d4409817fb0fa1472237bfa28b7 | Python | apache-2.0 | theislab/dca,theislab/dca,theislab/dca | from .io import preprocess
from .train import train
from .network import mlp
def autoencode(count_matrix, kfold=None, dimreduce=True, reconstruct=True,
mask=None, type='normal', activation='relu', testset=False,
learning_rate=1e-2, hidden_size=(256,64,256), l2_coef=0.,
epo... | from .io import preprocess
from .train import train
from .network import mlp
def autoencode(count_matrix, kfold=None, dimreduce=True, reconstruct=True,
mask=None, type='normal', activation='relu', testset=False,
learning_rate=1e-2, hidden_size=(256,64,256), l2_coef=0.,
epo... | <commit_before>from .io import preprocess
from .train import train
from .network import mlp
def autoencode(count_matrix, kfold=None, dimreduce=True, reconstruct=True,
mask=None, type='normal', activation='relu', testset=False,
learning_rate=1e-2, hidden_size=(256,64,256), l2_coef=0.,
... | from .io import preprocess
from .train import train
from .network import mlp
def autoencode(count_matrix, kfold=None, dimreduce=True, reconstruct=True,
mask=None, type='normal', activation='relu', testset=False,
learning_rate=1e-2, hidden_size=(256,64,256), l2_coef=0.,
epo... | from .io import preprocess
from .train import train
from .network import mlp
def autoencode(count_matrix, kfold=None, dimreduce=True, reconstruct=True,
mask=None, type='normal', activation='relu', testset=False,
learning_rate=1e-2, hidden_size=(256,64,256), l2_coef=0.,
epo... | <commit_before>from .io import preprocess
from .train import train
from .network import mlp
def autoencode(count_matrix, kfold=None, dimreduce=True, reconstruct=True,
mask=None, type='normal', activation='relu', testset=False,
learning_rate=1e-2, hidden_size=(256,64,256), l2_coef=0.,
... |
1ed040f9d64e12adf964e9f86cc1e18bd8d21593 | scripts/rename.py | scripts/rename.py | import logging
from scripts.util import documents
from scrapi import settings
from scrapi.linter import RawDocument
from scrapi.processing.elasticsearch import es
from scrapi.tasks import normalize, process_normalized, process_raw
logger = logging.getLogger(__name__)
def rename(source, target, dry=True):
asser... | import logging
from scripts.util import documents
from scrapi import settings
from scrapi.linter import RawDocument
from scrapi.processing.elasticsearch import es
from scrapi.tasks import normalize, process_normalized, process_raw
logger = logging.getLogger(__name__)
def rename(source, target, dry=True):
asser... | Stop cassandra from deleting documents, delete documents from old index as well | Stop cassandra from deleting documents, delete documents from old index as well
| Python | apache-2.0 | erinspace/scrapi,mehanig/scrapi,alexgarciac/scrapi,felliott/scrapi,fabianvf/scrapi,icereval/scrapi,jeffreyliu3230/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi,mehanig/scrapi,CenterForOpenScience/scrapi,ostwald/scrapi,fabianvf/scrapi,felliott/scrapi | import logging
from scripts.util import documents
from scrapi import settings
from scrapi.linter import RawDocument
from scrapi.processing.elasticsearch import es
from scrapi.tasks import normalize, process_normalized, process_raw
logger = logging.getLogger(__name__)
def rename(source, target, dry=True):
asser... | import logging
from scripts.util import documents
from scrapi import settings
from scrapi.linter import RawDocument
from scrapi.processing.elasticsearch import es
from scrapi.tasks import normalize, process_normalized, process_raw
logger = logging.getLogger(__name__)
def rename(source, target, dry=True):
asser... | <commit_before>import logging
from scripts.util import documents
from scrapi import settings
from scrapi.linter import RawDocument
from scrapi.processing.elasticsearch import es
from scrapi.tasks import normalize, process_normalized, process_raw
logger = logging.getLogger(__name__)
def rename(source, target, dry=T... | import logging
from scripts.util import documents
from scrapi import settings
from scrapi.linter import RawDocument
from scrapi.processing.elasticsearch import es
from scrapi.tasks import normalize, process_normalized, process_raw
logger = logging.getLogger(__name__)
def rename(source, target, dry=True):
asser... | import logging
from scripts.util import documents
from scrapi import settings
from scrapi.linter import RawDocument
from scrapi.processing.elasticsearch import es
from scrapi.tasks import normalize, process_normalized, process_raw
logger = logging.getLogger(__name__)
def rename(source, target, dry=True):
asser... | <commit_before>import logging
from scripts.util import documents
from scrapi import settings
from scrapi.linter import RawDocument
from scrapi.processing.elasticsearch import es
from scrapi.tasks import normalize, process_normalized, process_raw
logger = logging.getLogger(__name__)
def rename(source, target, dry=T... |
473121ce5a3caa20576d02c79669408fd4177a43 | features/steps/interactive.py | features/steps/interactive.py | import time, pexpect, re
import nose.tools as nt
import subprocess as spr
PROMPT = "root@\w+:[^\r]+"
UP_ARROW = "\x1b[A"
def type(process, input_):
process.send(input_.encode())
process.expect(PROMPT)
# Remove the typed input from the returned standard out
return re.sub(re.escape(input_.strip()), ''... | import time, pexpect, re
import nose.tools as nt
import subprocess as spr
PROMPT = "root@\w+:[^\r]+"
ENTER = "\n"
def type(process, input_):
process.send(input_.encode())
process.expect(PROMPT)
# Remove the typed input from the returned standard out
return re.sub(re.escape(input_.strip()), '', proce... | Use "\n" to fix waiting for prompt in feature tests on CI | Use "\n" to fix waiting for prompt in feature tests on CI
| Python | mit | michaelbarton/command-line-interface,pbelmann/command-line-interface,bioboxes/command-line-interface,pbelmann/command-line-interface,michaelbarton/command-line-interface,bioboxes/command-line-interface | import time, pexpect, re
import nose.tools as nt
import subprocess as spr
PROMPT = "root@\w+:[^\r]+"
UP_ARROW = "\x1b[A"
def type(process, input_):
process.send(input_.encode())
process.expect(PROMPT)
# Remove the typed input from the returned standard out
return re.sub(re.escape(input_.strip()), ''... | import time, pexpect, re
import nose.tools as nt
import subprocess as spr
PROMPT = "root@\w+:[^\r]+"
ENTER = "\n"
def type(process, input_):
process.send(input_.encode())
process.expect(PROMPT)
# Remove the typed input from the returned standard out
return re.sub(re.escape(input_.strip()), '', proce... | <commit_before>import time, pexpect, re
import nose.tools as nt
import subprocess as spr
PROMPT = "root@\w+:[^\r]+"
UP_ARROW = "\x1b[A"
def type(process, input_):
process.send(input_.encode())
process.expect(PROMPT)
# Remove the typed input from the returned standard out
return re.sub(re.escape(inpu... | import time, pexpect, re
import nose.tools as nt
import subprocess as spr
PROMPT = "root@\w+:[^\r]+"
ENTER = "\n"
def type(process, input_):
process.send(input_.encode())
process.expect(PROMPT)
# Remove the typed input from the returned standard out
return re.sub(re.escape(input_.strip()), '', proce... | import time, pexpect, re
import nose.tools as nt
import subprocess as spr
PROMPT = "root@\w+:[^\r]+"
UP_ARROW = "\x1b[A"
def type(process, input_):
process.send(input_.encode())
process.expect(PROMPT)
# Remove the typed input from the returned standard out
return re.sub(re.escape(input_.strip()), ''... | <commit_before>import time, pexpect, re
import nose.tools as nt
import subprocess as spr
PROMPT = "root@\w+:[^\r]+"
UP_ARROW = "\x1b[A"
def type(process, input_):
process.send(input_.encode())
process.expect(PROMPT)
# Remove the typed input from the returned standard out
return re.sub(re.escape(inpu... |
624276b80b6d69b788b2f48691941cd89847237b | software/Pi/ui.py | software/Pi/ui.py | """
Handles LED output for the Raspberry Pi 3
Image tracking software. Imported using 'import ui'
Version: 5/06/17
Dependencies: RPi.GPIO
Note: will only work on a Raspberry Pi!
"""
import RPi.GPIO as gpio
import time
ledPin = 16 #GPIO23
#Set up RPi GPIO
def setup():
gpio.setmode(gpio.BOARD)
gpio.setup(ledPin... | """
Handles LED output for the Raspberry Pi 3
Image tracking software. Imported using 'import ui'
Version: 5/06/17
Dependencies: RPi.GPIO
Note: will only work on a Raspberry Pi!
"""
import RPi.GPIO as gpio
import time
ledPin = 16 #GPIO23
#Set up RPi GPIO
def setup():
gpio.setmode(gpio.BOARD)
gpio.setwarnings(... | Disable warnings for GPIO channels... | Disable warnings for GPIO channels...
| Python | mit | AdlerFarHorizons/eclipse-tracking,AdlerFarHorizons/eclipse-tracking,AdlerFarHorizons/eclipse-tracking,AdlerFarHorizons/eclipse-tracking | """
Handles LED output for the Raspberry Pi 3
Image tracking software. Imported using 'import ui'
Version: 5/06/17
Dependencies: RPi.GPIO
Note: will only work on a Raspberry Pi!
"""
import RPi.GPIO as gpio
import time
ledPin = 16 #GPIO23
#Set up RPi GPIO
def setup():
gpio.setmode(gpio.BOARD)
gpio.setup(ledPin... | """
Handles LED output for the Raspberry Pi 3
Image tracking software. Imported using 'import ui'
Version: 5/06/17
Dependencies: RPi.GPIO
Note: will only work on a Raspberry Pi!
"""
import RPi.GPIO as gpio
import time
ledPin = 16 #GPIO23
#Set up RPi GPIO
def setup():
gpio.setmode(gpio.BOARD)
gpio.setwarnings(... | <commit_before>"""
Handles LED output for the Raspberry Pi 3
Image tracking software. Imported using 'import ui'
Version: 5/06/17
Dependencies: RPi.GPIO
Note: will only work on a Raspberry Pi!
"""
import RPi.GPIO as gpio
import time
ledPin = 16 #GPIO23
#Set up RPi GPIO
def setup():
gpio.setmode(gpio.BOARD)
gp... | """
Handles LED output for the Raspberry Pi 3
Image tracking software. Imported using 'import ui'
Version: 5/06/17
Dependencies: RPi.GPIO
Note: will only work on a Raspberry Pi!
"""
import RPi.GPIO as gpio
import time
ledPin = 16 #GPIO23
#Set up RPi GPIO
def setup():
gpio.setmode(gpio.BOARD)
gpio.setwarnings(... | """
Handles LED output for the Raspberry Pi 3
Image tracking software. Imported using 'import ui'
Version: 5/06/17
Dependencies: RPi.GPIO
Note: will only work on a Raspberry Pi!
"""
import RPi.GPIO as gpio
import time
ledPin = 16 #GPIO23
#Set up RPi GPIO
def setup():
gpio.setmode(gpio.BOARD)
gpio.setup(ledPin... | <commit_before>"""
Handles LED output for the Raspberry Pi 3
Image tracking software. Imported using 'import ui'
Version: 5/06/17
Dependencies: RPi.GPIO
Note: will only work on a Raspberry Pi!
"""
import RPi.GPIO as gpio
import time
ledPin = 16 #GPIO23
#Set up RPi GPIO
def setup():
gpio.setmode(gpio.BOARD)
gp... |
6d9b9d043e1d27e93f9cbf221ddc29db8760f789 | config.py | config.py | MINUTES = 60
HOURS = MINUTES * 60
DAYS = HOURS * 24
WEEKS = DAYS * 7
YEARS = DAYS * 365
# Allows you to do `3 * DAYS` to make configuration clearer.
# Technically the value for YEARS is wrong, but it's close enough.
POW_DIGITS = 2
PROTOCOL_VERSION = b"0xdeadbeef"
assert len(PROTOCOL_VERSION) <= 16
PROTOCOL_VERSION =... | MINUTES = 60
HOURS = MINUTES * 60
DAYS = HOURS * 24
WEEKS = DAYS * 7
YEARS = DAYS * 365
# Allows you to do `3 * DAYS` to make configuration clearer.
# Technically the value for YEARS is wrong, but it's close enough.
POW_DIGITS = 2
PROTOCOL_VERSION = b"0xdeadbeef"
assert len(PROTOCOL_VERSION) <= 16
PROTOCOL_VERSION =... | Increase prune time to 7 days, not 7 seconds. | Increase prune time to 7 days, not 7 seconds.
For testing, this should be lowered, but not pushed.
| Python | mit | 5225225/node,5225225/node | MINUTES = 60
HOURS = MINUTES * 60
DAYS = HOURS * 24
WEEKS = DAYS * 7
YEARS = DAYS * 365
# Allows you to do `3 * DAYS` to make configuration clearer.
# Technically the value for YEARS is wrong, but it's close enough.
POW_DIGITS = 2
PROTOCOL_VERSION = b"0xdeadbeef"
assert len(PROTOCOL_VERSION) <= 16
PROTOCOL_VERSION =... | MINUTES = 60
HOURS = MINUTES * 60
DAYS = HOURS * 24
WEEKS = DAYS * 7
YEARS = DAYS * 365
# Allows you to do `3 * DAYS` to make configuration clearer.
# Technically the value for YEARS is wrong, but it's close enough.
POW_DIGITS = 2
PROTOCOL_VERSION = b"0xdeadbeef"
assert len(PROTOCOL_VERSION) <= 16
PROTOCOL_VERSION =... | <commit_before>MINUTES = 60
HOURS = MINUTES * 60
DAYS = HOURS * 24
WEEKS = DAYS * 7
YEARS = DAYS * 365
# Allows you to do `3 * DAYS` to make configuration clearer.
# Technically the value for YEARS is wrong, but it's close enough.
POW_DIGITS = 2
PROTOCOL_VERSION = b"0xdeadbeef"
assert len(PROTOCOL_VERSION) <= 16
PRO... | MINUTES = 60
HOURS = MINUTES * 60
DAYS = HOURS * 24
WEEKS = DAYS * 7
YEARS = DAYS * 365
# Allows you to do `3 * DAYS` to make configuration clearer.
# Technically the value for YEARS is wrong, but it's close enough.
POW_DIGITS = 2
PROTOCOL_VERSION = b"0xdeadbeef"
assert len(PROTOCOL_VERSION) <= 16
PROTOCOL_VERSION =... | MINUTES = 60
HOURS = MINUTES * 60
DAYS = HOURS * 24
WEEKS = DAYS * 7
YEARS = DAYS * 365
# Allows you to do `3 * DAYS` to make configuration clearer.
# Technically the value for YEARS is wrong, but it's close enough.
POW_DIGITS = 2
PROTOCOL_VERSION = b"0xdeadbeef"
assert len(PROTOCOL_VERSION) <= 16
PROTOCOL_VERSION =... | <commit_before>MINUTES = 60
HOURS = MINUTES * 60
DAYS = HOURS * 24
WEEKS = DAYS * 7
YEARS = DAYS * 365
# Allows you to do `3 * DAYS` to make configuration clearer.
# Technically the value for YEARS is wrong, but it's close enough.
POW_DIGITS = 2
PROTOCOL_VERSION = b"0xdeadbeef"
assert len(PROTOCOL_VERSION) <= 16
PRO... |
c266fbd7a3478d582dc0d6c88fc5e3d8b7a8f62f | survey/views/survey_result.py | survey/views/survey_result.py | # -*- coding: utf-8 -*-
import datetime
import os
from django.http.response import HttpResponse
from django.shortcuts import get_object_or_404
from survey.management.survey2csv import Survey2CSV
from survey.models import Survey
def serve_result_csv(request, pk):
survey = get_object_or_404(Survey, pk=pk)
tr... | # -*- coding: utf-8 -*-
import datetime
import os
from django.http.response import HttpResponse
from django.shortcuts import get_object_or_404
from survey.management.survey2csv import Survey2CSV
from survey.models import Survey
def serve_result_csv(request, pk):
survey = get_object_or_404(Survey, pk=pk)
tr... | Fix - Apache error AH02429 | Fix - Apache error AH02429
Response header name 'mimetype=' contains invalid characters, aborting request
| Python | agpl-3.0 | Pierre-Sassoulas/django-survey,Pierre-Sassoulas/django-survey,Pierre-Sassoulas/django-survey | # -*- coding: utf-8 -*-
import datetime
import os
from django.http.response import HttpResponse
from django.shortcuts import get_object_or_404
from survey.management.survey2csv import Survey2CSV
from survey.models import Survey
def serve_result_csv(request, pk):
survey = get_object_or_404(Survey, pk=pk)
tr... | # -*- coding: utf-8 -*-
import datetime
import os
from django.http.response import HttpResponse
from django.shortcuts import get_object_or_404
from survey.management.survey2csv import Survey2CSV
from survey.models import Survey
def serve_result_csv(request, pk):
survey = get_object_or_404(Survey, pk=pk)
tr... | <commit_before># -*- coding: utf-8 -*-
import datetime
import os
from django.http.response import HttpResponse
from django.shortcuts import get_object_or_404
from survey.management.survey2csv import Survey2CSV
from survey.models import Survey
def serve_result_csv(request, pk):
survey = get_object_or_404(Survey... | # -*- coding: utf-8 -*-
import datetime
import os
from django.http.response import HttpResponse
from django.shortcuts import get_object_or_404
from survey.management.survey2csv import Survey2CSV
from survey.models import Survey
def serve_result_csv(request, pk):
survey = get_object_or_404(Survey, pk=pk)
tr... | # -*- coding: utf-8 -*-
import datetime
import os
from django.http.response import HttpResponse
from django.shortcuts import get_object_or_404
from survey.management.survey2csv import Survey2CSV
from survey.models import Survey
def serve_result_csv(request, pk):
survey = get_object_or_404(Survey, pk=pk)
tr... | <commit_before># -*- coding: utf-8 -*-
import datetime
import os
from django.http.response import HttpResponse
from django.shortcuts import get_object_or_404
from survey.management.survey2csv import Survey2CSV
from survey.models import Survey
def serve_result_csv(request, pk):
survey = get_object_or_404(Survey... |
9a121f309ded039f770339d51b43d0933a98d982 | app/main/views.py | app/main/views.py | from flask import render_template, current_app, flash, redirect, url_for
from . import main
from forms import ContactForm
from ..email import send_email
@main.route('/')
def index():
return render_template('index.html')
@main.route('/about')
def about():
return render_template('about.html')
@main.route('/men... | from flask import render_template, current_app, flash, redirect, url_for, send_from_directory
from . import main
from forms import ContactForm
from ..email import send_email
@main.route('/<path:filename>')
def static_from_root(filename):
return send_from_directory(current_app.static_folder, filename)
@main.route(... | Add additional view for sitemap.xml | Add additional view for sitemap.xml
| Python | mit | jordandietch/workforsushi,jordandietch/workforsushi,jordandietch/workforsushi,jordandietch/workforsushi | from flask import render_template, current_app, flash, redirect, url_for
from . import main
from forms import ContactForm
from ..email import send_email
@main.route('/')
def index():
return render_template('index.html')
@main.route('/about')
def about():
return render_template('about.html')
@main.route('/men... | from flask import render_template, current_app, flash, redirect, url_for, send_from_directory
from . import main
from forms import ContactForm
from ..email import send_email
@main.route('/<path:filename>')
def static_from_root(filename):
return send_from_directory(current_app.static_folder, filename)
@main.route(... | <commit_before>from flask import render_template, current_app, flash, redirect, url_for
from . import main
from forms import ContactForm
from ..email import send_email
@main.route('/')
def index():
return render_template('index.html')
@main.route('/about')
def about():
return render_template('about.html')
@m... | from flask import render_template, current_app, flash, redirect, url_for, send_from_directory
from . import main
from forms import ContactForm
from ..email import send_email
@main.route('/<path:filename>')
def static_from_root(filename):
return send_from_directory(current_app.static_folder, filename)
@main.route(... | from flask import render_template, current_app, flash, redirect, url_for
from . import main
from forms import ContactForm
from ..email import send_email
@main.route('/')
def index():
return render_template('index.html')
@main.route('/about')
def about():
return render_template('about.html')
@main.route('/men... | <commit_before>from flask import render_template, current_app, flash, redirect, url_for
from . import main
from forms import ContactForm
from ..email import send_email
@main.route('/')
def index():
return render_template('index.html')
@main.route('/about')
def about():
return render_template('about.html')
@m... |
49606a1a14696f41a03c7b69cbcf382cab50210c | t/integration/test_py_amqp.py | t/integration/test_py_amqp.py | from __future__ import absolute_import, unicode_literals
import os
import pytest
import kombu
from .common import BasicFunctionality
def get_connection(
hostname, port, vhost):
return kombu.Connection('amqp://{}:{}'.format(hostname, port))
@pytest.fixture()
def connection(request):
# this fixture... | from __future__ import absolute_import, unicode_literals
import os
import pytest
import kombu
from .common import BasicFunctionality
def get_connection(
hostname, port, vhost):
return kombu.Connection('pyamqp://{}:{}'.format(hostname, port))
@pytest.fixture()
def connection(request):
# this fixtu... | Use explicit py-amqp transport instead of amqp in integration tests | Use explicit py-amqp transport instead of amqp in integration tests
| Python | bsd-3-clause | ZoranPavlovic/kombu,ZoranPavlovic/kombu,celery/kombu | from __future__ import absolute_import, unicode_literals
import os
import pytest
import kombu
from .common import BasicFunctionality
def get_connection(
hostname, port, vhost):
return kombu.Connection('amqp://{}:{}'.format(hostname, port))
@pytest.fixture()
def connection(request):
# this fixture... | from __future__ import absolute_import, unicode_literals
import os
import pytest
import kombu
from .common import BasicFunctionality
def get_connection(
hostname, port, vhost):
return kombu.Connection('pyamqp://{}:{}'.format(hostname, port))
@pytest.fixture()
def connection(request):
# this fixtu... | <commit_before>from __future__ import absolute_import, unicode_literals
import os
import pytest
import kombu
from .common import BasicFunctionality
def get_connection(
hostname, port, vhost):
return kombu.Connection('amqp://{}:{}'.format(hostname, port))
@pytest.fixture()
def connection(request):
... | from __future__ import absolute_import, unicode_literals
import os
import pytest
import kombu
from .common import BasicFunctionality
def get_connection(
hostname, port, vhost):
return kombu.Connection('pyamqp://{}:{}'.format(hostname, port))
@pytest.fixture()
def connection(request):
# this fixtu... | from __future__ import absolute_import, unicode_literals
import os
import pytest
import kombu
from .common import BasicFunctionality
def get_connection(
hostname, port, vhost):
return kombu.Connection('amqp://{}:{}'.format(hostname, port))
@pytest.fixture()
def connection(request):
# this fixture... | <commit_before>from __future__ import absolute_import, unicode_literals
import os
import pytest
import kombu
from .common import BasicFunctionality
def get_connection(
hostname, port, vhost):
return kombu.Connection('amqp://{}:{}'.format(hostname, port))
@pytest.fixture()
def connection(request):
... |
36bde060bbdb4cf9d0396719b8b82952a73bf2b5 | bucky/collector.py | bucky/collector.py |
import time
import multiprocessing
try:
from setproctitle import setproctitle
except ImportError:
def setproctitle(title):
pass
class StatsCollector(multiprocessing.Process):
def __init__(self, queue):
super(StatsCollector, self).__init__()
self.queue = queue
def close(sel... |
import time
import multiprocessing
try:
from setproctitle import setproctitle
except ImportError:
def setproctitle(title):
pass
class StatsCollector(multiprocessing.Process):
def __init__(self, queue):
super(StatsCollector, self).__init__()
self.queue = queue
def close(sel... | Change the back-off algo for failures | Change the back-off algo for failures
| Python | apache-2.0 | jsiembida/bucky3 |
import time
import multiprocessing
try:
from setproctitle import setproctitle
except ImportError:
def setproctitle(title):
pass
class StatsCollector(multiprocessing.Process):
def __init__(self, queue):
super(StatsCollector, self).__init__()
self.queue = queue
def close(sel... |
import time
import multiprocessing
try:
from setproctitle import setproctitle
except ImportError:
def setproctitle(title):
pass
class StatsCollector(multiprocessing.Process):
def __init__(self, queue):
super(StatsCollector, self).__init__()
self.queue = queue
def close(sel... | <commit_before>
import time
import multiprocessing
try:
from setproctitle import setproctitle
except ImportError:
def setproctitle(title):
pass
class StatsCollector(multiprocessing.Process):
def __init__(self, queue):
super(StatsCollector, self).__init__()
self.queue = queue
... |
import time
import multiprocessing
try:
from setproctitle import setproctitle
except ImportError:
def setproctitle(title):
pass
class StatsCollector(multiprocessing.Process):
def __init__(self, queue):
super(StatsCollector, self).__init__()
self.queue = queue
def close(sel... |
import time
import multiprocessing
try:
from setproctitle import setproctitle
except ImportError:
def setproctitle(title):
pass
class StatsCollector(multiprocessing.Process):
def __init__(self, queue):
super(StatsCollector, self).__init__()
self.queue = queue
def close(sel... | <commit_before>
import time
import multiprocessing
try:
from setproctitle import setproctitle
except ImportError:
def setproctitle(title):
pass
class StatsCollector(multiprocessing.Process):
def __init__(self, queue):
super(StatsCollector, self).__init__()
self.queue = queue
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.