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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6c8122be60b25bbe9ba4ff8a714370e801e6ae70 | cufflinks/offline.py | cufflinks/offline.py | import plotly.offline as py_offline
### Offline Mode
def go_offline(connected=False):
try:
py_offline.init_notebook_mode(connected)
except TypeError:
#For older versions of plotly
py_offline.init_notebook_mode()
py_offline.__PLOTLY_OFFLINE_INITIALIZED=True
def go_online():
py_offline.__PLOTLY_OFFLINE_INIT... | import plotly.offline as py_offline
### Offline Mode
def run_from_ipython():
try:
__IPYTHON__
return True
except NameError:
return False
def go_offline(connected=False):
if run_from_ipython():
try:
py_offline.init_notebook_mode(connected)
except TypeE... | Call init_notebook_mode only if inside IPython | Call init_notebook_mode only if inside IPython
| Python | mit | santosjorge/cufflinks | import plotly.offline as py_offline
### Offline Mode
def go_offline(connected=False):
try:
py_offline.init_notebook_mode(connected)
except TypeError:
#For older versions of plotly
py_offline.init_notebook_mode()
py_offline.__PLOTLY_OFFLINE_INITIALIZED=True
def go_online():
py_offline.__PLOTLY_OFFLINE_INIT... | import plotly.offline as py_offline
### Offline Mode
def run_from_ipython():
try:
__IPYTHON__
return True
except NameError:
return False
def go_offline(connected=False):
if run_from_ipython():
try:
py_offline.init_notebook_mode(connected)
except TypeE... | <commit_before>import plotly.offline as py_offline
### Offline Mode
def go_offline(connected=False):
try:
py_offline.init_notebook_mode(connected)
except TypeError:
#For older versions of plotly
py_offline.init_notebook_mode()
py_offline.__PLOTLY_OFFLINE_INITIALIZED=True
def go_online():
py_offline.__PLOT... | import plotly.offline as py_offline
### Offline Mode
def run_from_ipython():
try:
__IPYTHON__
return True
except NameError:
return False
def go_offline(connected=False):
if run_from_ipython():
try:
py_offline.init_notebook_mode(connected)
except TypeE... | import plotly.offline as py_offline
### Offline Mode
def go_offline(connected=False):
try:
py_offline.init_notebook_mode(connected)
except TypeError:
#For older versions of plotly
py_offline.init_notebook_mode()
py_offline.__PLOTLY_OFFLINE_INITIALIZED=True
def go_online():
py_offline.__PLOTLY_OFFLINE_INIT... | <commit_before>import plotly.offline as py_offline
### Offline Mode
def go_offline(connected=False):
try:
py_offline.init_notebook_mode(connected)
except TypeError:
#For older versions of plotly
py_offline.init_notebook_mode()
py_offline.__PLOTLY_OFFLINE_INITIALIZED=True
def go_online():
py_offline.__PLOT... |
979ec05ed34cec2af0d45dc76b84921af85f84e9 | script/compile-coffee.py | script/compile-coffee.py | #!/usr/bin/env python
import os
import subprocess
import sys
from lib.util import *
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
def main():
input_file = sys.argv[1]
output_dir = os.path.dirname(sys.argv[2])
coffee = os.path.join(SOURCE_ROOT, 'node_modules', 'coffee-script', 'bin',
... | #!/usr/bin/env python
import os
import subprocess
import sys
from lib.util import *
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
def main():
input_file = sys.argv[1]
output_dir = os.path.dirname(sys.argv[2])
coffee = os.path.join(SOURCE_ROOT, 'node_modules', 'coffee-script', 'bin',
... | Fix running node from python. | [Win] Fix running node from python.
There is a mysterious "WindowsError [error 5] Access is denied" error is
the "executable" is not specified under Windows.
| Python | mit | mjaniszew/electron,meowlab/electron,rreimann/electron,eriser/electron,tonyganch/electron,nicholasess/electron,wolfflow/electron,thingsinjars/electron,dongjoon-hyun/electron,rhencke/electron,Evercoder/electron,yan-foto/electron,mattdesl/electron,pirafrank/electron,nagyistoce/electron-atom-shell,bitemyapp/electron,Andrey... | #!/usr/bin/env python
import os
import subprocess
import sys
from lib.util import *
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
def main():
input_file = sys.argv[1]
output_dir = os.path.dirname(sys.argv[2])
coffee = os.path.join(SOURCE_ROOT, 'node_modules', 'coffee-script', 'bin',
... | #!/usr/bin/env python
import os
import subprocess
import sys
from lib.util import *
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
def main():
input_file = sys.argv[1]
output_dir = os.path.dirname(sys.argv[2])
coffee = os.path.join(SOURCE_ROOT, 'node_modules', 'coffee-script', 'bin',
... | <commit_before>#!/usr/bin/env python
import os
import subprocess
import sys
from lib.util import *
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
def main():
input_file = sys.argv[1]
output_dir = os.path.dirname(sys.argv[2])
coffee = os.path.join(SOURCE_ROOT, 'node_modules', 'coffee-script', 'bin... | #!/usr/bin/env python
import os
import subprocess
import sys
from lib.util import *
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
def main():
input_file = sys.argv[1]
output_dir = os.path.dirname(sys.argv[2])
coffee = os.path.join(SOURCE_ROOT, 'node_modules', 'coffee-script', 'bin',
... | #!/usr/bin/env python
import os
import subprocess
import sys
from lib.util import *
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
def main():
input_file = sys.argv[1]
output_dir = os.path.dirname(sys.argv[2])
coffee = os.path.join(SOURCE_ROOT, 'node_modules', 'coffee-script', 'bin',
... | <commit_before>#!/usr/bin/env python
import os
import subprocess
import sys
from lib.util import *
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
def main():
input_file = sys.argv[1]
output_dir = os.path.dirname(sys.argv[2])
coffee = os.path.join(SOURCE_ROOT, 'node_modules', 'coffee-script', 'bin... |
785fcdca3c9bfb908444d3b9339457c616761f2c | tests/flights_to_test.py | tests/flights_to_test.py | import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
class TestBasicInst... | import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
class TestBasicFlig... | Change instaflights name in flights_to tests | Change instaflights name in flights_to tests
| Python | mit | Jamil/sabre_dev_studio | import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
class TestBasicInst... | import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
class TestBasicFlig... | <commit_before>import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
clas... | import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
class TestBasicFlig... | import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
class TestBasicInst... | <commit_before>import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
clas... |
d623ae9eed5fd8e558461de8bc52a83ff0a168af | recursive_remove_ltac.py | recursive_remove_ltac.py | import re
__all__ = ["recursively_remove_ltac"]
LTAC_REG = re.compile(r'^\s*(?:Local\s+|Global\s+)?Ltac\s+([^\s]+)', re.MULTILINE)
def recursively_remove_ltac(statements, exclude_n=3):
"""Removes any Ltac statement which is not used later in
statements. Does not remove any code in the last exclude_n
sta... | import re
__all__ = ["recursively_remove_ltac"]
LTAC_REG = re.compile(r'^\s*(?:Local\s+|Global\s+)?Ltac\s+([^\s]+)', re.MULTILINE)
def recursively_remove_ltac(statements, exclude_n=3):
"""Removes any Ltac statement which is not used later in
statements. Does not remove any code in the last exclude_n
sta... | Add a comment with a TODO | Add a comment with a TODO
| Python | mit | JasonGross/coq-tools,JasonGross/coq-tools | import re
__all__ = ["recursively_remove_ltac"]
LTAC_REG = re.compile(r'^\s*(?:Local\s+|Global\s+)?Ltac\s+([^\s]+)', re.MULTILINE)
def recursively_remove_ltac(statements, exclude_n=3):
"""Removes any Ltac statement which is not used later in
statements. Does not remove any code in the last exclude_n
sta... | import re
__all__ = ["recursively_remove_ltac"]
LTAC_REG = re.compile(r'^\s*(?:Local\s+|Global\s+)?Ltac\s+([^\s]+)', re.MULTILINE)
def recursively_remove_ltac(statements, exclude_n=3):
"""Removes any Ltac statement which is not used later in
statements. Does not remove any code in the last exclude_n
sta... | <commit_before>import re
__all__ = ["recursively_remove_ltac"]
LTAC_REG = re.compile(r'^\s*(?:Local\s+|Global\s+)?Ltac\s+([^\s]+)', re.MULTILINE)
def recursively_remove_ltac(statements, exclude_n=3):
"""Removes any Ltac statement which is not used later in
statements. Does not remove any code in the last ex... | import re
__all__ = ["recursively_remove_ltac"]
LTAC_REG = re.compile(r'^\s*(?:Local\s+|Global\s+)?Ltac\s+([^\s]+)', re.MULTILINE)
def recursively_remove_ltac(statements, exclude_n=3):
"""Removes any Ltac statement which is not used later in
statements. Does not remove any code in the last exclude_n
sta... | import re
__all__ = ["recursively_remove_ltac"]
LTAC_REG = re.compile(r'^\s*(?:Local\s+|Global\s+)?Ltac\s+([^\s]+)', re.MULTILINE)
def recursively_remove_ltac(statements, exclude_n=3):
"""Removes any Ltac statement which is not used later in
statements. Does not remove any code in the last exclude_n
sta... | <commit_before>import re
__all__ = ["recursively_remove_ltac"]
LTAC_REG = re.compile(r'^\s*(?:Local\s+|Global\s+)?Ltac\s+([^\s]+)', re.MULTILINE)
def recursively_remove_ltac(statements, exclude_n=3):
"""Removes any Ltac statement which is not used later in
statements. Does not remove any code in the last ex... |
65f5695b90054f73d7119f0c50be51f61de777fa | tardis/tests/tests_slow/runner.py | tardis/tests/tests_slow/runner.py | import argparse
import json
import os
import time
import requests
from tardis import __githash__ as tardis_githash
parser = argparse.ArgumentParser(description="Run slow integration tests")
parser.add_argument("--yaml", dest="yaml_filepath",
help="Path to YAML config file for integration tests.")... | import argparse
import datetime
import json
import os
import time
import requests
from tardis import __githash__ as tardis_githash
parser = argparse.ArgumentParser(description="Run slow integration tests")
parser.add_argument("--yaml", dest="yaml_filepath",
help="Path to YAML config file for inte... | Print the time of checking status at github. | Print the time of checking status at github.
| Python | bsd-3-clause | kaushik94/tardis,orbitfold/tardis,kaushik94/tardis,orbitfold/tardis,orbitfold/tardis,kaushik94/tardis,orbitfold/tardis,kaushik94/tardis | import argparse
import json
import os
import time
import requests
from tardis import __githash__ as tardis_githash
parser = argparse.ArgumentParser(description="Run slow integration tests")
parser.add_argument("--yaml", dest="yaml_filepath",
help="Path to YAML config file for integration tests.")... | import argparse
import datetime
import json
import os
import time
import requests
from tardis import __githash__ as tardis_githash
parser = argparse.ArgumentParser(description="Run slow integration tests")
parser.add_argument("--yaml", dest="yaml_filepath",
help="Path to YAML config file for inte... | <commit_before>import argparse
import json
import os
import time
import requests
from tardis import __githash__ as tardis_githash
parser = argparse.ArgumentParser(description="Run slow integration tests")
parser.add_argument("--yaml", dest="yaml_filepath",
help="Path to YAML config file for integ... | import argparse
import datetime
import json
import os
import time
import requests
from tardis import __githash__ as tardis_githash
parser = argparse.ArgumentParser(description="Run slow integration tests")
parser.add_argument("--yaml", dest="yaml_filepath",
help="Path to YAML config file for inte... | import argparse
import json
import os
import time
import requests
from tardis import __githash__ as tardis_githash
parser = argparse.ArgumentParser(description="Run slow integration tests")
parser.add_argument("--yaml", dest="yaml_filepath",
help="Path to YAML config file for integration tests.")... | <commit_before>import argparse
import json
import os
import time
import requests
from tardis import __githash__ as tardis_githash
parser = argparse.ArgumentParser(description="Run slow integration tests")
parser.add_argument("--yaml", dest="yaml_filepath",
help="Path to YAML config file for integ... |
0d38b9592fbb63e25b080d2f17b690c478042455 | google-code-jam-2012/perfect-game/perfect-game.py | google-code-jam-2012/perfect-game/perfect-game.py | #!/usr/bin/env python
import sys
if len(sys.argv) < 2:
sys.exit('Usage: %s file.in' % sys.argv[0])
file = open(sys.argv[1], 'r')
T = int(file.readline())
for i in xrange(1, T+1):
N = int(file.readline())
L = map(int, file.readline().split(' '))
P = map(int, file.readline().split(' '))
assert N == len(L)... | #!/usr/bin/env python
# expected time per attempt is given by equation
# time = L[0] + (1-P[0])*L[1] + (1-P[0])*(1-P[1])*L[2] + ...
# where L is the expected time and P is the probability of failure, per level
# swap two levels if L[i]*P[i+1] > L[i+1]*P[i]
import sys
if len(sys.argv) < 2:
sys.exit('Usage: %s file.... | Add comments to Perfect Game solution | Add comments to Perfect Game solution
| Python | mit | robertdimarco/puzzles,robertdimarco/puzzles,robertdimarco/puzzles,robertdimarco/puzzles,robertdimarco/puzzles,robertdimarco/puzzles,robertdimarco/puzzles,robertdimarco/puzzles,robertdimarco/puzzles,robertdimarco/puzzles | #!/usr/bin/env python
import sys
if len(sys.argv) < 2:
sys.exit('Usage: %s file.in' % sys.argv[0])
file = open(sys.argv[1], 'r')
T = int(file.readline())
for i in xrange(1, T+1):
N = int(file.readline())
L = map(int, file.readline().split(' '))
P = map(int, file.readline().split(' '))
assert N == len(L)... | #!/usr/bin/env python
# expected time per attempt is given by equation
# time = L[0] + (1-P[0])*L[1] + (1-P[0])*(1-P[1])*L[2] + ...
# where L is the expected time and P is the probability of failure, per level
# swap two levels if L[i]*P[i+1] > L[i+1]*P[i]
import sys
if len(sys.argv) < 2:
sys.exit('Usage: %s file.... | <commit_before>#!/usr/bin/env python
import sys
if len(sys.argv) < 2:
sys.exit('Usage: %s file.in' % sys.argv[0])
file = open(sys.argv[1], 'r')
T = int(file.readline())
for i in xrange(1, T+1):
N = int(file.readline())
L = map(int, file.readline().split(' '))
P = map(int, file.readline().split(' '))
ass... | #!/usr/bin/env python
# expected time per attempt is given by equation
# time = L[0] + (1-P[0])*L[1] + (1-P[0])*(1-P[1])*L[2] + ...
# where L is the expected time and P is the probability of failure, per level
# swap two levels if L[i]*P[i+1] > L[i+1]*P[i]
import sys
if len(sys.argv) < 2:
sys.exit('Usage: %s file.... | #!/usr/bin/env python
import sys
if len(sys.argv) < 2:
sys.exit('Usage: %s file.in' % sys.argv[0])
file = open(sys.argv[1], 'r')
T = int(file.readline())
for i in xrange(1, T+1):
N = int(file.readline())
L = map(int, file.readline().split(' '))
P = map(int, file.readline().split(' '))
assert N == len(L)... | <commit_before>#!/usr/bin/env python
import sys
if len(sys.argv) < 2:
sys.exit('Usage: %s file.in' % sys.argv[0])
file = open(sys.argv[1], 'r')
T = int(file.readline())
for i in xrange(1, T+1):
N = int(file.readline())
L = map(int, file.readline().split(' '))
P = map(int, file.readline().split(' '))
ass... |
93870690f17a4baddeb33549a1f6c67eeee1abe0 | src/adhocracy/lib/tiles/util.py | src/adhocracy/lib/tiles/util.py | import logging
from time import time
from pylons import tmpl_context as c
from adhocracy import config
from adhocracy.lib.cache import memoize
log = logging.getLogger(__name__)
class BaseTile(object):
'''
Base class for tiles
'''
def render_tile(template_name, def_name, tile, cached=False, **kwargs):... | import logging
from time import time
from pylons import tmpl_context as c
from adhocracy import config
from adhocracy.lib.cache import memoize
log = logging.getLogger(__name__)
class BaseTile(object):
'''
Base class for tiles
'''
def render_tile(template_name, def_name, tile, cached=False, **kwargs):... | Increase cache tile duration from 6 hours to 1 week | Increase cache tile duration from 6 hours to 1 week
| Python | agpl-3.0 | alkadis/vcv,DanielNeugebauer/adhocracy,alkadis/vcv,phihag/adhocracy,DanielNeugebauer/adhocracy,phihag/adhocracy,alkadis/vcv,DanielNeugebauer/adhocracy,DanielNeugebauer/adhocracy,DanielNeugebauer/adhocracy,phihag/adhocracy,liqd/adhocracy,phihag/adhocracy,liqd/adhocracy,liqd/adhocracy,liqd/adhocracy,alkadis/vcv,alkadis/v... | import logging
from time import time
from pylons import tmpl_context as c
from adhocracy import config
from adhocracy.lib.cache import memoize
log = logging.getLogger(__name__)
class BaseTile(object):
'''
Base class for tiles
'''
def render_tile(template_name, def_name, tile, cached=False, **kwargs):... | import logging
from time import time
from pylons import tmpl_context as c
from adhocracy import config
from adhocracy.lib.cache import memoize
log = logging.getLogger(__name__)
class BaseTile(object):
'''
Base class for tiles
'''
def render_tile(template_name, def_name, tile, cached=False, **kwargs):... | <commit_before>import logging
from time import time
from pylons import tmpl_context as c
from adhocracy import config
from adhocracy.lib.cache import memoize
log = logging.getLogger(__name__)
class BaseTile(object):
'''
Base class for tiles
'''
def render_tile(template_name, def_name, tile, cached=Fa... | import logging
from time import time
from pylons import tmpl_context as c
from adhocracy import config
from adhocracy.lib.cache import memoize
log = logging.getLogger(__name__)
class BaseTile(object):
'''
Base class for tiles
'''
def render_tile(template_name, def_name, tile, cached=False, **kwargs):... | import logging
from time import time
from pylons import tmpl_context as c
from adhocracy import config
from adhocracy.lib.cache import memoize
log = logging.getLogger(__name__)
class BaseTile(object):
'''
Base class for tiles
'''
def render_tile(template_name, def_name, tile, cached=False, **kwargs):... | <commit_before>import logging
from time import time
from pylons import tmpl_context as c
from adhocracy import config
from adhocracy.lib.cache import memoize
log = logging.getLogger(__name__)
class BaseTile(object):
'''
Base class for tiles
'''
def render_tile(template_name, def_name, tile, cached=Fa... |
4d247da1ecd39bcd699a55b5387412a1ac9e1582 | txlege84/topics/management/commands/bootstraptopics.py | txlege84/topics/management/commands/bootstraptopics.py | from django.core.management.base import BaseCommand
from topics.models import Topic
class Command(BaseCommand):
help = u'Bootstrap the topic lists in the database.'
def handle(self, *args, **kwargs):
self.load_topics()
def load_topics(self):
self.stdout.write(u'Loading hot list topics..... | from django.core.management.base import BaseCommand
from topics.models import Topic
class Command(BaseCommand):
help = u'Bootstrap the topic lists in the database.'
def handle(self, *args, **kwargs):
self.load_topics()
def load_topics(self):
self.stdout.write(u'Loading hot list topics..... | Split Energy and Environment, change Civil Liberties to Social Justice | Split Energy and Environment, change Civil Liberties to Social Justice
| Python | mit | texastribune/txlege84,texastribune/txlege84,texastribune/txlege84,texastribune/txlege84 | from django.core.management.base import BaseCommand
from topics.models import Topic
class Command(BaseCommand):
help = u'Bootstrap the topic lists in the database.'
def handle(self, *args, **kwargs):
self.load_topics()
def load_topics(self):
self.stdout.write(u'Loading hot list topics..... | from django.core.management.base import BaseCommand
from topics.models import Topic
class Command(BaseCommand):
help = u'Bootstrap the topic lists in the database.'
def handle(self, *args, **kwargs):
self.load_topics()
def load_topics(self):
self.stdout.write(u'Loading hot list topics..... | <commit_before>from django.core.management.base import BaseCommand
from topics.models import Topic
class Command(BaseCommand):
help = u'Bootstrap the topic lists in the database.'
def handle(self, *args, **kwargs):
self.load_topics()
def load_topics(self):
self.stdout.write(u'Loading ho... | from django.core.management.base import BaseCommand
from topics.models import Topic
class Command(BaseCommand):
help = u'Bootstrap the topic lists in the database.'
def handle(self, *args, **kwargs):
self.load_topics()
def load_topics(self):
self.stdout.write(u'Loading hot list topics..... | from django.core.management.base import BaseCommand
from topics.models import Topic
class Command(BaseCommand):
help = u'Bootstrap the topic lists in the database.'
def handle(self, *args, **kwargs):
self.load_topics()
def load_topics(self):
self.stdout.write(u'Loading hot list topics..... | <commit_before>from django.core.management.base import BaseCommand
from topics.models import Topic
class Command(BaseCommand):
help = u'Bootstrap the topic lists in the database.'
def handle(self, *args, **kwargs):
self.load_topics()
def load_topics(self):
self.stdout.write(u'Loading ho... |
fd8caec8567178abe09abc810f1e96bfc4bb531b | calc.py | calc.py | import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__== '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
elif command == 'multiply':
print(multiply_all(sums))
| import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__== '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
elif command == 'multiply':
print(multiply_all(nums))
| Fix bug in 'multiply' support | Fix bug in 'multiply' support
| Python | bsd-3-clause | tanecious/calc | import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__== '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
elif command == 'multiply':
print(multiply_all(sums))
Fix bug in 'multiply... | import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__== '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
elif command == 'multiply':
print(multiply_all(nums))
| <commit_before>import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__== '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
elif command == 'multiply':
print(multiply_all(sums))
<comm... | import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__== '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
elif command == 'multiply':
print(multiply_all(nums))
| import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__== '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
elif command == 'multiply':
print(multiply_all(sums))
Fix bug in 'multiply... | <commit_before>import sys
def add_all(nums):
return sum(nums)
def multiply_all(nums):
return reduce(lambda a, b: a * b, nums)
if __name__== '__main__':
command = sys.argv[1]
nums = map(float, sys.argv[2:])
if command == 'add':
print(add_all(nums))
elif command == 'multiply':
print(multiply_all(sums))
<comm... |
5c5de666e86d6f2627df79762b0e3b0f188861d4 | scripts/claim_vlan.py | scripts/claim_vlan.py | import MySQLdb
from datetime import datetime, timedelta
db = MySQLdb.connect(host="10.0.196.2",
user="ciuser",
passwd="secret",
db="ciresources")
cur = db.cursor()
f = '%Y-%m-%d %H:%M:%S'
three_hours_ago_dt = datetime.utcnow() - timedelta(hours=3)
three_... | import MySQLdb
from datetime import datetime, timedelta
db = MySQLdb.connect(host="10.0.196.2",
user="ciuser",
passwd="secret",
db="ciresources")
cur = db.cursor()
f = '%Y-%m-%d %H:%M:%S'
three_hours_ago_dt = datetime.utcnow() - timedelta(hours=3)
three_... | Fix timestamp comparison on ciresources | Fix timestamp comparison on ciresources
| Python | apache-2.0 | CiscoSystems/project-config-third-party,CiscoSystems/project-config-third-party | import MySQLdb
from datetime import datetime, timedelta
db = MySQLdb.connect(host="10.0.196.2",
user="ciuser",
passwd="secret",
db="ciresources")
cur = db.cursor()
f = '%Y-%m-%d %H:%M:%S'
three_hours_ago_dt = datetime.utcnow() - timedelta(hours=3)
three_... | import MySQLdb
from datetime import datetime, timedelta
db = MySQLdb.connect(host="10.0.196.2",
user="ciuser",
passwd="secret",
db="ciresources")
cur = db.cursor()
f = '%Y-%m-%d %H:%M:%S'
three_hours_ago_dt = datetime.utcnow() - timedelta(hours=3)
three_... | <commit_before>import MySQLdb
from datetime import datetime, timedelta
db = MySQLdb.connect(host="10.0.196.2",
user="ciuser",
passwd="secret",
db="ciresources")
cur = db.cursor()
f = '%Y-%m-%d %H:%M:%S'
three_hours_ago_dt = datetime.utcnow() - timedelta(... | import MySQLdb
from datetime import datetime, timedelta
db = MySQLdb.connect(host="10.0.196.2",
user="ciuser",
passwd="secret",
db="ciresources")
cur = db.cursor()
f = '%Y-%m-%d %H:%M:%S'
three_hours_ago_dt = datetime.utcnow() - timedelta(hours=3)
three_... | import MySQLdb
from datetime import datetime, timedelta
db = MySQLdb.connect(host="10.0.196.2",
user="ciuser",
passwd="secret",
db="ciresources")
cur = db.cursor()
f = '%Y-%m-%d %H:%M:%S'
three_hours_ago_dt = datetime.utcnow() - timedelta(hours=3)
three_... | <commit_before>import MySQLdb
from datetime import datetime, timedelta
db = MySQLdb.connect(host="10.0.196.2",
user="ciuser",
passwd="secret",
db="ciresources")
cur = db.cursor()
f = '%Y-%m-%d %H:%M:%S'
three_hours_ago_dt = datetime.utcnow() - timedelta(... |
224abc99becc1683605a6dc5c3460510efef3efb | tests/test_pyserial.py | tests/test_pyserial.py | from __future__ import (absolute_import, print_function, unicode_literals)
import os
import sys
lib_path = os.path.abspath('../')
sys.path.append(lib_path)
import io
import struct
import unittest
import threading
import time
import serial
try:
import unittest2 as unittest
except ImportError:
import unittest
... | from __future__ import (absolute_import, print_function, unicode_literals)
import os
import sys
lib_path = os.path.abspath('../')
sys.path.append(lib_path)
import io
import struct
import unittest
import threading
import time
import serial
try:
import unittest2 as unittest
except ImportError:
import unittest
... | Comment out the pyserial TestIsCorrectVariant test. | Comment out the pyserial TestIsCorrectVariant test.
| Python | agpl-3.0 | Jnesselr/s3g,makerbot/s3g,Jnesselr/s3g,makerbot/s3g,makerbot/s3g,makerbot/s3g | from __future__ import (absolute_import, print_function, unicode_literals)
import os
import sys
lib_path = os.path.abspath('../')
sys.path.append(lib_path)
import io
import struct
import unittest
import threading
import time
import serial
try:
import unittest2 as unittest
except ImportError:
import unittest
... | from __future__ import (absolute_import, print_function, unicode_literals)
import os
import sys
lib_path = os.path.abspath('../')
sys.path.append(lib_path)
import io
import struct
import unittest
import threading
import time
import serial
try:
import unittest2 as unittest
except ImportError:
import unittest
... | <commit_before>from __future__ import (absolute_import, print_function, unicode_literals)
import os
import sys
lib_path = os.path.abspath('../')
sys.path.append(lib_path)
import io
import struct
import unittest
import threading
import time
import serial
try:
import unittest2 as unittest
except ImportError:
i... | from __future__ import (absolute_import, print_function, unicode_literals)
import os
import sys
lib_path = os.path.abspath('../')
sys.path.append(lib_path)
import io
import struct
import unittest
import threading
import time
import serial
try:
import unittest2 as unittest
except ImportError:
import unittest
... | from __future__ import (absolute_import, print_function, unicode_literals)
import os
import sys
lib_path = os.path.abspath('../')
sys.path.append(lib_path)
import io
import struct
import unittest
import threading
import time
import serial
try:
import unittest2 as unittest
except ImportError:
import unittest
... | <commit_before>from __future__ import (absolute_import, print_function, unicode_literals)
import os
import sys
lib_path = os.path.abspath('../')
sys.path.append(lib_path)
import io
import struct
import unittest
import threading
import time
import serial
try:
import unittest2 as unittest
except ImportError:
i... |
e716a71bad4e02410e2a0908d630abbee1d4c691 | django/contrib/admin/__init__.py | django/contrib/admin/__init__.py | from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL
from django.contrib.admin.options import StackedInline, TabularInline
from django.contrib.admin.sites import AdminSite, site
def autodiscover():
"""
Auto-discover INSTALLED_APPS admin.py modules and fail silently when
not present. T... | # ACTION_CHECKBOX_NAME is unused, but should stay since its import from here
# has been referenced in documentation.
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL
from django.contrib.admin.options import StackedInline, TabularInli... | Revert the removal of an unused import (in [14175]) that was referenced in documentation. Thanks for noticing, clong. | Revert the removal of an unused import (in [14175]) that was referenced in documentation. Thanks for noticing, clong.
git-svn-id: 4f9f921b081c523744c7bf24d959a0db39629563@14359 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| Python | bsd-3-clause | schinckel/django,DasIch/django,coldmind/django,rwillmer/django,jpic/django,techdragon/django,abomyi/django,EmadMokhtar/Django,koniiiik/django,auvipy/django,elkingtonmcb/django,Balachan27/django,jscn/django,darkryder/django,lunafeng/django,sergei-maertens/django,Leila20/django,chyeh727/django,huang4fstudio/django,saydul... | from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL
from django.contrib.admin.options import StackedInline, TabularInline
from django.contrib.admin.sites import AdminSite, site
def autodiscover():
"""
Auto-discover INSTALLED_APPS admin.py modules and fail silently when
not present. T... | # ACTION_CHECKBOX_NAME is unused, but should stay since its import from here
# has been referenced in documentation.
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL
from django.contrib.admin.options import StackedInline, TabularInli... | <commit_before>from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL
from django.contrib.admin.options import StackedInline, TabularInline
from django.contrib.admin.sites import AdminSite, site
def autodiscover():
"""
Auto-discover INSTALLED_APPS admin.py modules and fail silently when
... | # ACTION_CHECKBOX_NAME is unused, but should stay since its import from here
# has been referenced in documentation.
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL
from django.contrib.admin.options import StackedInline, TabularInli... | from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL
from django.contrib.admin.options import StackedInline, TabularInline
from django.contrib.admin.sites import AdminSite, site
def autodiscover():
"""
Auto-discover INSTALLED_APPS admin.py modules and fail silently when
not present. T... | <commit_before>from django.contrib.admin.options import ModelAdmin, HORIZONTAL, VERTICAL
from django.contrib.admin.options import StackedInline, TabularInline
from django.contrib.admin.sites import AdminSite, site
def autodiscover():
"""
Auto-discover INSTALLED_APPS admin.py modules and fail silently when
... |
0d7add686605d9d86e688f9f65f617555282ab60 | opwen_email_server/backend/email_sender.py | opwen_email_server/backend/email_sender.py | from typing import Tuple
from opwen_email_server import azure_constants as constants
from opwen_email_server import config
from opwen_email_server.services.queue import AzureQueue
from opwen_email_server.services.sendgrid import SendgridEmailSender
QUEUE = AzureQueue(account=config.QUEUES_ACCOUNT, key=config.QUEUES_K... | from typing import Tuple
from opwen_email_server import azure_constants as constants
from opwen_email_server import config
from opwen_email_server.services.queue import AzureQueue
from opwen_email_server.services.sendgrid import SendgridEmailSender
QUEUE = AzureQueue(account=config.QUEUES_ACCOUNT, key=config.QUEUES_K... | Add debugging CLI hook for email sending | Add debugging CLI hook for email sending
| Python | apache-2.0 | ascoderu/opwen-cloudserver,ascoderu/opwen-cloudserver | from typing import Tuple
from opwen_email_server import azure_constants as constants
from opwen_email_server import config
from opwen_email_server.services.queue import AzureQueue
from opwen_email_server.services.sendgrid import SendgridEmailSender
QUEUE = AzureQueue(account=config.QUEUES_ACCOUNT, key=config.QUEUES_K... | from typing import Tuple
from opwen_email_server import azure_constants as constants
from opwen_email_server import config
from opwen_email_server.services.queue import AzureQueue
from opwen_email_server.services.sendgrid import SendgridEmailSender
QUEUE = AzureQueue(account=config.QUEUES_ACCOUNT, key=config.QUEUES_K... | <commit_before>from typing import Tuple
from opwen_email_server import azure_constants as constants
from opwen_email_server import config
from opwen_email_server.services.queue import AzureQueue
from opwen_email_server.services.sendgrid import SendgridEmailSender
QUEUE = AzureQueue(account=config.QUEUES_ACCOUNT, key=... | from typing import Tuple
from opwen_email_server import azure_constants as constants
from opwen_email_server import config
from opwen_email_server.services.queue import AzureQueue
from opwen_email_server.services.sendgrid import SendgridEmailSender
QUEUE = AzureQueue(account=config.QUEUES_ACCOUNT, key=config.QUEUES_K... | from typing import Tuple
from opwen_email_server import azure_constants as constants
from opwen_email_server import config
from opwen_email_server.services.queue import AzureQueue
from opwen_email_server.services.sendgrid import SendgridEmailSender
QUEUE = AzureQueue(account=config.QUEUES_ACCOUNT, key=config.QUEUES_K... | <commit_before>from typing import Tuple
from opwen_email_server import azure_constants as constants
from opwen_email_server import config
from opwen_email_server.services.queue import AzureQueue
from opwen_email_server.services.sendgrid import SendgridEmailSender
QUEUE = AzureQueue(account=config.QUEUES_ACCOUNT, key=... |
cc6c80ad64fe7f4d4cb2b4e367c595f1b08f9d3b | i3blocks-sonos.py | i3blocks-sonos.py | #!/usr/bin/env python3
#
# By Henrik Lilleengen ([email protected])
#
# Released under the MIT License: https://opensource.org/licenses/MIT
import soco, sys
speakers = list(soco.discover())
state = speakers[0].get_current_transport_info()['current_transport_state']
if state == 'PLAYING':
if len(sys.argv) > 1 a... | #!/usr/bin/env python3
#
# By Henrik Lilleengen ([email protected])
#
# Released under the MIT License: https://opensource.org/licenses/MIT
import soco, sys
speakers = list(soco.discover())
if len(speakers) > 0:
state = speakers[0].get_current_transport_info()['current_transport_state']
if state == 'PLAYING... | Remove script crash when no sonos is found | Remove script crash when no sonos is found
| Python | mit | Lilleengen/i3blocks-sonos | #!/usr/bin/env python3
#
# By Henrik Lilleengen ([email protected])
#
# Released under the MIT License: https://opensource.org/licenses/MIT
import soco, sys
speakers = list(soco.discover())
state = speakers[0].get_current_transport_info()['current_transport_state']
if state == 'PLAYING':
if len(sys.argv) > 1 a... | #!/usr/bin/env python3
#
# By Henrik Lilleengen ([email protected])
#
# Released under the MIT License: https://opensource.org/licenses/MIT
import soco, sys
speakers = list(soco.discover())
if len(speakers) > 0:
state = speakers[0].get_current_transport_info()['current_transport_state']
if state == 'PLAYING... | <commit_before>#!/usr/bin/env python3
#
# By Henrik Lilleengen ([email protected])
#
# Released under the MIT License: https://opensource.org/licenses/MIT
import soco, sys
speakers = list(soco.discover())
state = speakers[0].get_current_transport_info()['current_transport_state']
if state == 'PLAYING':
if len(... | #!/usr/bin/env python3
#
# By Henrik Lilleengen ([email protected])
#
# Released under the MIT License: https://opensource.org/licenses/MIT
import soco, sys
speakers = list(soco.discover())
if len(speakers) > 0:
state = speakers[0].get_current_transport_info()['current_transport_state']
if state == 'PLAYING... | #!/usr/bin/env python3
#
# By Henrik Lilleengen ([email protected])
#
# Released under the MIT License: https://opensource.org/licenses/MIT
import soco, sys
speakers = list(soco.discover())
state = speakers[0].get_current_transport_info()['current_transport_state']
if state == 'PLAYING':
if len(sys.argv) > 1 a... | <commit_before>#!/usr/bin/env python3
#
# By Henrik Lilleengen ([email protected])
#
# Released under the MIT License: https://opensource.org/licenses/MIT
import soco, sys
speakers = list(soco.discover())
state = speakers[0].get_current_transport_info()['current_transport_state']
if state == 'PLAYING':
if len(... |
ce48ef985a8e79d0cd636abf2116917fde24d6d2 | candidates/tests/test_posts_view.py | candidates/tests/test_posts_view.py | from __future__ import unicode_literals
from django_webtest import WebTest
from .uk_examples import UK2015ExamplesMixin
class TestPostsView(UK2015ExamplesMixin, WebTest):
def setUp(self):
super(TestPostsView, self).setUp()
def test_single_election_posts_page(self):
response = self.app.get... | from __future__ import unicode_literals
from django_webtest import WebTest
from .uk_examples import UK2015ExamplesMixin
class TestPostsView(UK2015ExamplesMixin, WebTest):
def test_single_election_posts_page(self):
response = self.app.get('/posts')
self.assertTrue(
response.html.fi... | Remove an unnecessary method override | Remove an unnecessary method override
| Python | agpl-3.0 | DemocracyClub/yournextrepresentative,mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextrepresentative,neavouli/yournextrepresentative,DemocracyClub/yournextrepresentative,mysociety/yournextrepresentative,DemocracyClub/yournextrepresentative,mysociety/yournextrepresentative,neavouli/yournextr... | from __future__ import unicode_literals
from django_webtest import WebTest
from .uk_examples import UK2015ExamplesMixin
class TestPostsView(UK2015ExamplesMixin, WebTest):
def setUp(self):
super(TestPostsView, self).setUp()
def test_single_election_posts_page(self):
response = self.app.get... | from __future__ import unicode_literals
from django_webtest import WebTest
from .uk_examples import UK2015ExamplesMixin
class TestPostsView(UK2015ExamplesMixin, WebTest):
def test_single_election_posts_page(self):
response = self.app.get('/posts')
self.assertTrue(
response.html.fi... | <commit_before>from __future__ import unicode_literals
from django_webtest import WebTest
from .uk_examples import UK2015ExamplesMixin
class TestPostsView(UK2015ExamplesMixin, WebTest):
def setUp(self):
super(TestPostsView, self).setUp()
def test_single_election_posts_page(self):
response... | from __future__ import unicode_literals
from django_webtest import WebTest
from .uk_examples import UK2015ExamplesMixin
class TestPostsView(UK2015ExamplesMixin, WebTest):
def test_single_election_posts_page(self):
response = self.app.get('/posts')
self.assertTrue(
response.html.fi... | from __future__ import unicode_literals
from django_webtest import WebTest
from .uk_examples import UK2015ExamplesMixin
class TestPostsView(UK2015ExamplesMixin, WebTest):
def setUp(self):
super(TestPostsView, self).setUp()
def test_single_election_posts_page(self):
response = self.app.get... | <commit_before>from __future__ import unicode_literals
from django_webtest import WebTest
from .uk_examples import UK2015ExamplesMixin
class TestPostsView(UK2015ExamplesMixin, WebTest):
def setUp(self):
super(TestPostsView, self).setUp()
def test_single_election_posts_page(self):
response... |
014925aa73e85fe3cb0d939a3d5d9c30424e32b4 | func.py | func.py | # PyArt by MohamadKh75
# 2017-10-05
# ********************
from pathlib import Path
# Set the Alphabet folder path
folder_path = Path("Alphabet").resolve()
# Read all Capital Letters - AA is Capital A
def letter_reader(letter):
# if it's Capital - AA is Capital A
if 65 <= ord(letter) <= 90:
letter_... | # PyArt by MohamadKh75
# 2017-10-05
# ********************
from pathlib import Path
# Set the Alphabet folder path
folder_path = Path("Alphabet").resolve()
# Read all Capital Letters - AA is Capital A
def letter_reader(letter):
# if it's Capital - AA is Capital A
if 65 <= ord(letter) <= 90:
letter_... | Add Numbers and Symbols Exception | Add Numbers and Symbols Exception
| Python | mit | MohamadKh75/Arthon | # PyArt by MohamadKh75
# 2017-10-05
# ********************
from pathlib import Path
# Set the Alphabet folder path
folder_path = Path("Alphabet").resolve()
# Read all Capital Letters - AA is Capital A
def letter_reader(letter):
# if it's Capital - AA is Capital A
if 65 <= ord(letter) <= 90:
letter_... | # PyArt by MohamadKh75
# 2017-10-05
# ********************
from pathlib import Path
# Set the Alphabet folder path
folder_path = Path("Alphabet").resolve()
# Read all Capital Letters - AA is Capital A
def letter_reader(letter):
# if it's Capital - AA is Capital A
if 65 <= ord(letter) <= 90:
letter_... | <commit_before># PyArt by MohamadKh75
# 2017-10-05
# ********************
from pathlib import Path
# Set the Alphabet folder path
folder_path = Path("Alphabet").resolve()
# Read all Capital Letters - AA is Capital A
def letter_reader(letter):
# if it's Capital - AA is Capital A
if 65 <= ord(letter) <= 90:
... | # PyArt by MohamadKh75
# 2017-10-05
# ********************
from pathlib import Path
# Set the Alphabet folder path
folder_path = Path("Alphabet").resolve()
# Read all Capital Letters - AA is Capital A
def letter_reader(letter):
# if it's Capital - AA is Capital A
if 65 <= ord(letter) <= 90:
letter_... | # PyArt by MohamadKh75
# 2017-10-05
# ********************
from pathlib import Path
# Set the Alphabet folder path
folder_path = Path("Alphabet").resolve()
# Read all Capital Letters - AA is Capital A
def letter_reader(letter):
# if it's Capital - AA is Capital A
if 65 <= ord(letter) <= 90:
letter_... | <commit_before># PyArt by MohamadKh75
# 2017-10-05
# ********************
from pathlib import Path
# Set the Alphabet folder path
folder_path = Path("Alphabet").resolve()
# Read all Capital Letters - AA is Capital A
def letter_reader(letter):
# if it's Capital - AA is Capital A
if 65 <= ord(letter) <= 90:
... |
374981fd60c0116e861d598eec763cc2b8165189 | cs251tk/common/check_submit_date.py | cs251tk/common/check_submit_date.py | import os
from dateutil.parser import parse
from ..common import run, chdir
def check_dates(spec_id, username, spec, basedir):
""" Port of the CheckDates program from C++
Finds the first submission date for an assignment
by comparing first commits for all files in the spec
and ret... | import os
from dateutil.parser import parse
from ..common import run, chdir
def check_dates(spec_id, username, spec, basedir):
""" Port of the CheckDates program from C++
Finds the first submission date for an assignment
by comparing first commits for all files in the spec
and ret... | Add -- to git log call | Add -- to git log call | Python | mit | StoDevX/cs251-toolkit,StoDevX/cs251-toolkit,StoDevX/cs251-toolkit,StoDevX/cs251-toolkit | import os
from dateutil.parser import parse
from ..common import run, chdir
def check_dates(spec_id, username, spec, basedir):
""" Port of the CheckDates program from C++
Finds the first submission date for an assignment
by comparing first commits for all files in the spec
and ret... | import os
from dateutil.parser import parse
from ..common import run, chdir
def check_dates(spec_id, username, spec, basedir):
""" Port of the CheckDates program from C++
Finds the first submission date for an assignment
by comparing first commits for all files in the spec
and ret... | <commit_before>import os
from dateutil.parser import parse
from ..common import run, chdir
def check_dates(spec_id, username, spec, basedir):
""" Port of the CheckDates program from C++
Finds the first submission date for an assignment
by comparing first commits for all files in the spec
... | import os
from dateutil.parser import parse
from ..common import run, chdir
def check_dates(spec_id, username, spec, basedir):
""" Port of the CheckDates program from C++
Finds the first submission date for an assignment
by comparing first commits for all files in the spec
and ret... | import os
from dateutil.parser import parse
from ..common import run, chdir
def check_dates(spec_id, username, spec, basedir):
""" Port of the CheckDates program from C++
Finds the first submission date for an assignment
by comparing first commits for all files in the spec
and ret... | <commit_before>import os
from dateutil.parser import parse
from ..common import run, chdir
def check_dates(spec_id, username, spec, basedir):
""" Port of the CheckDates program from C++
Finds the first submission date for an assignment
by comparing first commits for all files in the spec
... |
f0e29748ff899d7e65d1f4169e890d3e3c4bda0e | icekit/project/settings/_test.py | icekit/project/settings/_test.py | from ._base import *
# DJANGO ######################################################################
DATABASE_NAME = 'test_%s' % DATABASES['default']['NAME']
DATABASES = {
'default': {
'NAME': DATABASE_NAME,
'TEST': {
'NAME': DATABASE_NAME,
# See: https://docs.djangoprojec... | from ._base import *
# DJANGO ######################################################################
DATABASE_NAME = 'test_%s' % DATABASES['default']['NAME']
DATABASES['default'].update({
'NAME': DATABASE_NAME,
'TEST': {
'NAME': DATABASE_NAME,
# See: https://docs.djangoproject.com/en/1.7/ref/... | Update instead of overriding `DATABASES` setting in `test` settings. | Update instead of overriding `DATABASES` setting in `test` settings.
| Python | mit | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | from ._base import *
# DJANGO ######################################################################
DATABASE_NAME = 'test_%s' % DATABASES['default']['NAME']
DATABASES = {
'default': {
'NAME': DATABASE_NAME,
'TEST': {
'NAME': DATABASE_NAME,
# See: https://docs.djangoprojec... | from ._base import *
# DJANGO ######################################################################
DATABASE_NAME = 'test_%s' % DATABASES['default']['NAME']
DATABASES['default'].update({
'NAME': DATABASE_NAME,
'TEST': {
'NAME': DATABASE_NAME,
# See: https://docs.djangoproject.com/en/1.7/ref/... | <commit_before>from ._base import *
# DJANGO ######################################################################
DATABASE_NAME = 'test_%s' % DATABASES['default']['NAME']
DATABASES = {
'default': {
'NAME': DATABASE_NAME,
'TEST': {
'NAME': DATABASE_NAME,
# See: https://do... | from ._base import *
# DJANGO ######################################################################
DATABASE_NAME = 'test_%s' % DATABASES['default']['NAME']
DATABASES['default'].update({
'NAME': DATABASE_NAME,
'TEST': {
'NAME': DATABASE_NAME,
# See: https://docs.djangoproject.com/en/1.7/ref/... | from ._base import *
# DJANGO ######################################################################
DATABASE_NAME = 'test_%s' % DATABASES['default']['NAME']
DATABASES = {
'default': {
'NAME': DATABASE_NAME,
'TEST': {
'NAME': DATABASE_NAME,
# See: https://docs.djangoprojec... | <commit_before>from ._base import *
# DJANGO ######################################################################
DATABASE_NAME = 'test_%s' % DATABASES['default']['NAME']
DATABASES = {
'default': {
'NAME': DATABASE_NAME,
'TEST': {
'NAME': DATABASE_NAME,
# See: https://do... |
e637e5f53990709ed654b661465685ad9d05a182 | api/spawner/templates/constants.py | api/spawner/templates/constants.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from django.conf import settings
JOB_NAME = 'plxjob-{task_type}{task_idx}-{experiment_uuid}'
DEFAULT_PORT = 2222
ENV_VAR_TEMPLATE = '{name: "{var_name}", value: "{var_value}"}'
VOLUME_NAME = 'pv-{vol_name}'
VOLUME_CLAIM_NAME = 'p... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from django.conf import settings
JOB_NAME = 'plxjob-{task_type}{task_idx}-{experiment_uuid}'
DEFAULT_PORT = 2222
ENV_VAR_TEMPLATE = '{name: "{var_name}", value: "{var_value}"}'
VOLUME_NAME = 'pv-{vol_name}'
VOLUME_CLAIM_NAME = 'p... | Update cluster config map key format | Update cluster config map key format
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from django.conf import settings
JOB_NAME = 'plxjob-{task_type}{task_idx}-{experiment_uuid}'
DEFAULT_PORT = 2222
ENV_VAR_TEMPLATE = '{name: "{var_name}", value: "{var_value}"}'
VOLUME_NAME = 'pv-{vol_name}'
VOLUME_CLAIM_NAME = 'p... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from django.conf import settings
JOB_NAME = 'plxjob-{task_type}{task_idx}-{experiment_uuid}'
DEFAULT_PORT = 2222
ENV_VAR_TEMPLATE = '{name: "{var_name}", value: "{var_value}"}'
VOLUME_NAME = 'pv-{vol_name}'
VOLUME_CLAIM_NAME = 'p... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from django.conf import settings
JOB_NAME = 'plxjob-{task_type}{task_idx}-{experiment_uuid}'
DEFAULT_PORT = 2222
ENV_VAR_TEMPLATE = '{name: "{var_name}", value: "{var_value}"}'
VOLUME_NAME = 'pv-{vol_name}'
VOLUME_... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from django.conf import settings
JOB_NAME = 'plxjob-{task_type}{task_idx}-{experiment_uuid}'
DEFAULT_PORT = 2222
ENV_VAR_TEMPLATE = '{name: "{var_name}", value: "{var_value}"}'
VOLUME_NAME = 'pv-{vol_name}'
VOLUME_CLAIM_NAME = 'p... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from django.conf import settings
JOB_NAME = 'plxjob-{task_type}{task_idx}-{experiment_uuid}'
DEFAULT_PORT = 2222
ENV_VAR_TEMPLATE = '{name: "{var_name}", value: "{var_value}"}'
VOLUME_NAME = 'pv-{vol_name}'
VOLUME_CLAIM_NAME = 'p... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from django.conf import settings
JOB_NAME = 'plxjob-{task_type}{task_idx}-{experiment_uuid}'
DEFAULT_PORT = 2222
ENV_VAR_TEMPLATE = '{name: "{var_name}", value: "{var_value}"}'
VOLUME_NAME = 'pv-{vol_name}'
VOLUME_... |
70d009834123cb5a10788763fed3193017cc8162 | libpebble2/__init__.py | libpebble2/__init__.py | __author__ = 'katharine'
from .exceptions import *
| __author__ = 'katharine'
import logging
from .exceptions import *
logging.getLogger('libpebble2').addHandler(logging.NullHandler())
| Add a default null logger per python recommendations. | Add a default null logger per python recommendations.
| Python | mit | pebble/libpebble2 | __author__ = 'katharine'
from .exceptions import *
Add a default null logger per python recommendations. | __author__ = 'katharine'
import logging
from .exceptions import *
logging.getLogger('libpebble2').addHandler(logging.NullHandler())
| <commit_before>__author__ = 'katharine'
from .exceptions import *
<commit_msg>Add a default null logger per python recommendations.<commit_after> | __author__ = 'katharine'
import logging
from .exceptions import *
logging.getLogger('libpebble2').addHandler(logging.NullHandler())
| __author__ = 'katharine'
from .exceptions import *
Add a default null logger per python recommendations.__author__ = 'katharine'
import logging
from .exceptions import *
logging.getLogger('libpebble2').addHandler(logging.NullHandler())
| <commit_before>__author__ = 'katharine'
from .exceptions import *
<commit_msg>Add a default null logger per python recommendations.<commit_after>__author__ = 'katharine'
import logging
from .exceptions import *
logging.getLogger('libpebble2').addHandler(logging.NullHandler())
|
60156236836944205f3993badcf179aaa6e7ae54 | ehriportal/portal/api/handlers.py | ehriportal/portal/api/handlers.py | """
Piston handlers for notable resources.
"""
from piston.handler import BaseHandler
from portal import models
class RepositoryHandler(BaseHandler):
model = models.Repository
class CollectionHandler(BaseHandler):
model = models.Collection
class PlaceHandler(BaseHandler):
model = models.Place
clas... | """
Piston handlers for notable resources.
"""
from piston.handler import BaseHandler
from portal import models
class ResourceHandler(BaseHandler):
model = models.Resource
class RepositoryHandler(BaseHandler):
model = models.Repository
class CollectionHandler(BaseHandler):
model = models.Collection
... | Add an (unexposed) ResourceHandler so inheriting objects serialise better | Add an (unexposed) ResourceHandler so inheriting objects serialise better
| Python | mit | mikesname/ehri-collections,mikesname/ehri-collections,mikesname/ehri-collections | """
Piston handlers for notable resources.
"""
from piston.handler import BaseHandler
from portal import models
class RepositoryHandler(BaseHandler):
model = models.Repository
class CollectionHandler(BaseHandler):
model = models.Collection
class PlaceHandler(BaseHandler):
model = models.Place
clas... | """
Piston handlers for notable resources.
"""
from piston.handler import BaseHandler
from portal import models
class ResourceHandler(BaseHandler):
model = models.Resource
class RepositoryHandler(BaseHandler):
model = models.Repository
class CollectionHandler(BaseHandler):
model = models.Collection
... | <commit_before>"""
Piston handlers for notable resources.
"""
from piston.handler import BaseHandler
from portal import models
class RepositoryHandler(BaseHandler):
model = models.Repository
class CollectionHandler(BaseHandler):
model = models.Collection
class PlaceHandler(BaseHandler):
model = mode... | """
Piston handlers for notable resources.
"""
from piston.handler import BaseHandler
from portal import models
class ResourceHandler(BaseHandler):
model = models.Resource
class RepositoryHandler(BaseHandler):
model = models.Repository
class CollectionHandler(BaseHandler):
model = models.Collection
... | """
Piston handlers for notable resources.
"""
from piston.handler import BaseHandler
from portal import models
class RepositoryHandler(BaseHandler):
model = models.Repository
class CollectionHandler(BaseHandler):
model = models.Collection
class PlaceHandler(BaseHandler):
model = models.Place
clas... | <commit_before>"""
Piston handlers for notable resources.
"""
from piston.handler import BaseHandler
from portal import models
class RepositoryHandler(BaseHandler):
model = models.Repository
class CollectionHandler(BaseHandler):
model = models.Collection
class PlaceHandler(BaseHandler):
model = mode... |
51f4d40cf6750d35f10f37d939a2c30c5f26d300 | backend/scripts/updatedf.py | backend/scripts/updatedf.py | #!/usr/bin/env python
#import hashlib
import os
def main():
for root, dirs, files in os.walk("/mcfs/data/materialscommons"):
for f in files:
print f
if __name__ == "__main__":
main()
| #!/usr/bin/env python
import hashlib
import os
import rethinkdb as r
def main():
conn = r.connect('localhost', 28015, db='materialscommons')
for root, dirs, files in os.walk("/mcfs/data/materialscommons"):
for f in files:
path = os.path.join(root, f)
with open(path) as fd:
... | Update script to write results to the database. | Update script to write results to the database.
| Python | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | #!/usr/bin/env python
#import hashlib
import os
def main():
for root, dirs, files in os.walk("/mcfs/data/materialscommons"):
for f in files:
print f
if __name__ == "__main__":
main()
Update script to write results to the database. | #!/usr/bin/env python
import hashlib
import os
import rethinkdb as r
def main():
conn = r.connect('localhost', 28015, db='materialscommons')
for root, dirs, files in os.walk("/mcfs/data/materialscommons"):
for f in files:
path = os.path.join(root, f)
with open(path) as fd:
... | <commit_before>#!/usr/bin/env python
#import hashlib
import os
def main():
for root, dirs, files in os.walk("/mcfs/data/materialscommons"):
for f in files:
print f
if __name__ == "__main__":
main()
<commit_msg>Update script to write results to the database.<commit_after> | #!/usr/bin/env python
import hashlib
import os
import rethinkdb as r
def main():
conn = r.connect('localhost', 28015, db='materialscommons')
for root, dirs, files in os.walk("/mcfs/data/materialscommons"):
for f in files:
path = os.path.join(root, f)
with open(path) as fd:
... | #!/usr/bin/env python
#import hashlib
import os
def main():
for root, dirs, files in os.walk("/mcfs/data/materialscommons"):
for f in files:
print f
if __name__ == "__main__":
main()
Update script to write results to the database.#!/usr/bin/env python
import hashlib
import os
import reth... | <commit_before>#!/usr/bin/env python
#import hashlib
import os
def main():
for root, dirs, files in os.walk("/mcfs/data/materialscommons"):
for f in files:
print f
if __name__ == "__main__":
main()
<commit_msg>Update script to write results to the database.<commit_after>#!/usr/bin/env pyt... |
923d49c753acf7d8945d6b79efbdb08363e130a2 | noseprogressive/tests/test_utils.py | noseprogressive/tests/test_utils.py | from os import chdir, getcwd
from os.path import dirname, basename
from unittest import TestCase
from nose.tools import eq_
from noseprogressive.utils import human_path, frame_of_test
class UtilsTests(TestCase):
"""Tests for independent little bits and pieces"""
def test_human_path(self):
chdir(dir... | from os import chdir, getcwd
from os.path import dirname, basename
from unittest import TestCase
from nose.tools import eq_
from noseprogressive.utils import human_path, frame_of_test
class UtilsTests(TestCase):
"""Tests for independent little bits and pieces"""
def test_human_path(self):
chdir(dir... | Bring test_frame_of_test_null_file up to date with new signature of frame_of_test(). | Bring test_frame_of_test_null_file up to date with new signature of frame_of_test().
| Python | mit | pmclanahan/pytest-progressive,erikrose/nose-progressive,veo-labs/nose-progressive,olivierverdier/nose-progressive | from os import chdir, getcwd
from os.path import dirname, basename
from unittest import TestCase
from nose.tools import eq_
from noseprogressive.utils import human_path, frame_of_test
class UtilsTests(TestCase):
"""Tests for independent little bits and pieces"""
def test_human_path(self):
chdir(dir... | from os import chdir, getcwd
from os.path import dirname, basename
from unittest import TestCase
from nose.tools import eq_
from noseprogressive.utils import human_path, frame_of_test
class UtilsTests(TestCase):
"""Tests for independent little bits and pieces"""
def test_human_path(self):
chdir(dir... | <commit_before>from os import chdir, getcwd
from os.path import dirname, basename
from unittest import TestCase
from nose.tools import eq_
from noseprogressive.utils import human_path, frame_of_test
class UtilsTests(TestCase):
"""Tests for independent little bits and pieces"""
def test_human_path(self):
... | from os import chdir, getcwd
from os.path import dirname, basename
from unittest import TestCase
from nose.tools import eq_
from noseprogressive.utils import human_path, frame_of_test
class UtilsTests(TestCase):
"""Tests for independent little bits and pieces"""
def test_human_path(self):
chdir(dir... | from os import chdir, getcwd
from os.path import dirname, basename
from unittest import TestCase
from nose.tools import eq_
from noseprogressive.utils import human_path, frame_of_test
class UtilsTests(TestCase):
"""Tests for independent little bits and pieces"""
def test_human_path(self):
chdir(dir... | <commit_before>from os import chdir, getcwd
from os.path import dirname, basename
from unittest import TestCase
from nose.tools import eq_
from noseprogressive.utils import human_path, frame_of_test
class UtilsTests(TestCase):
"""Tests for independent little bits and pieces"""
def test_human_path(self):
... |
e6af9d901f26fdf779a6a13319face483fe48a3b | dwitter/dweet/views.py | dwitter/dweet/views.py | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from dwitter.models import Dweet
def fullscreen_dweet(request, dweet_id):
dweet = get_obje... | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from dwitter.models import Dweet
from django.views.decorators.clickjacking import xframe_opti... | Disable clickjacking protection on demos to display them in iframes | Disable clickjacking protection on demos to display them in iframes
| Python | apache-2.0 | lionleaf/dwitter,lionleaf/dwitter,lionleaf/dwitter | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from dwitter.models import Dweet
def fullscreen_dweet(request, dweet_id):
dweet = get_obje... | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from dwitter.models import Dweet
from django.views.decorators.clickjacking import xframe_opti... | <commit_before>from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from dwitter.models import Dweet
def fullscreen_dweet(request, dweet_id):
d... | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from dwitter.models import Dweet
from django.views.decorators.clickjacking import xframe_opti... | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from dwitter.models import Dweet
def fullscreen_dweet(request, dweet_id):
dweet = get_obje... | <commit_before>from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from dwitter.models import Dweet
def fullscreen_dweet(request, dweet_id):
d... |
d16373609b2f30c6ffa576c1269c529f12c9622c | backend/uclapi/timetable/urls.py | backend/uclapi/timetable/urls.py | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^personal_fast$', views.get_personal_timetable_fast),
url(r'^personal$', views.get_personal_timetable),
url(r'^bymodule$', views.get_modules_timetable),
]
| from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^personal$', views.get_personal_timetable_fast),
url(r'^bymodule$', views.get_modules_timetable),
]
| Switch to fast method for personal timetable | Switch to fast method for personal timetable
| Python | mit | uclapi/uclapi,uclapi/uclapi,uclapi/uclapi,uclapi/uclapi | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^personal_fast$', views.get_personal_timetable_fast),
url(r'^personal$', views.get_personal_timetable),
url(r'^bymodule$', views.get_modules_timetable),
]
Switch to fast method for personal timetable | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^personal$', views.get_personal_timetable_fast),
url(r'^bymodule$', views.get_modules_timetable),
]
| <commit_before>from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^personal_fast$', views.get_personal_timetable_fast),
url(r'^personal$', views.get_personal_timetable),
url(r'^bymodule$', views.get_modules_timetable),
]
<commit_msg>Switch to fast method for personal timetable<comm... | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^personal$', views.get_personal_timetable_fast),
url(r'^bymodule$', views.get_modules_timetable),
]
| from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^personal_fast$', views.get_personal_timetable_fast),
url(r'^personal$', views.get_personal_timetable),
url(r'^bymodule$', views.get_modules_timetable),
]
Switch to fast method for personal timetablefrom django.conf.urls import url... | <commit_before>from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^personal_fast$', views.get_personal_timetable_fast),
url(r'^personal$', views.get_personal_timetable),
url(r'^bymodule$', views.get_modules_timetable),
]
<commit_msg>Switch to fast method for personal timetable<comm... |
0812ec319291b709613152e9e1d781671047a428 | config.py | config.py | import os
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
ACCESS_TOKEN = os.environ['ACCESS_TOKEN']
PAGE_ID = os.environ['PAGE_ID']
APP_ID = os.environ['APP_ID']
VERIFY_TOKEN = os.environ['VERIFY_TOKEN']
| import os
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', 'sqlite://')
ACCESS_TOKEN = os.environ.get('ACCESS_TOKEN')
PAGE_ID = os.environ.get('PAGE_ID')
APP_ID = os.environ.get('APP_ID')
VERIFY_TOKEN = os.environ.get('VERIFY_TOKEN')
| Make server ignore missing environment variables | Make server ignore missing environment variables
This is by far the best solution for setup, CI and testing purposes.
| Python | mit | Stark-Mountain/meetup-facebook-bot,Stark-Mountain/meetup-facebook-bot | import os
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
ACCESS_TOKEN = os.environ['ACCESS_TOKEN']
PAGE_ID = os.environ['PAGE_ID']
APP_ID = os.environ['APP_ID']
VERIFY_TOKEN = os.environ['VERIFY_TOKEN']
Make server ignore missing environment variables
This is by far the best solution for setup, CI and testing ... | import os
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', 'sqlite://')
ACCESS_TOKEN = os.environ.get('ACCESS_TOKEN')
PAGE_ID = os.environ.get('PAGE_ID')
APP_ID = os.environ.get('APP_ID')
VERIFY_TOKEN = os.environ.get('VERIFY_TOKEN')
| <commit_before>import os
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
ACCESS_TOKEN = os.environ['ACCESS_TOKEN']
PAGE_ID = os.environ['PAGE_ID']
APP_ID = os.environ['APP_ID']
VERIFY_TOKEN = os.environ['VERIFY_TOKEN']
<commit_msg>Make server ignore missing environment variables
This is by far the best solution... | import os
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', 'sqlite://')
ACCESS_TOKEN = os.environ.get('ACCESS_TOKEN')
PAGE_ID = os.environ.get('PAGE_ID')
APP_ID = os.environ.get('APP_ID')
VERIFY_TOKEN = os.environ.get('VERIFY_TOKEN')
| import os
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
ACCESS_TOKEN = os.environ['ACCESS_TOKEN']
PAGE_ID = os.environ['PAGE_ID']
APP_ID = os.environ['APP_ID']
VERIFY_TOKEN = os.environ['VERIFY_TOKEN']
Make server ignore missing environment variables
This is by far the best solution for setup, CI and testing ... | <commit_before>import os
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
ACCESS_TOKEN = os.environ['ACCESS_TOKEN']
PAGE_ID = os.environ['PAGE_ID']
APP_ID = os.environ['APP_ID']
VERIFY_TOKEN = os.environ['VERIFY_TOKEN']
<commit_msg>Make server ignore missing environment variables
This is by far the best solution... |
d7e03596f8bf1e886e984c0ea98334af878a15e2 | meta/bytecodetools/print_code.py | meta/bytecodetools/print_code.py | '''
Created on May 10, 2012
@author: sean
'''
from .bytecode_consumer import ByteCodeConsumer
from argparse import ArgumentParser
class ByteCodePrinter(ByteCodeConsumer):
def generic_consume(self, instr):
print instr
def main():
parser = ArgumentParser()
parser.add_argument()
if __name__ ==... | '''
Created on May 10, 2012
@author: sean
'''
from __future__ import print_function
from .bytecode_consumer import ByteCodeConsumer
from argparse import ArgumentParser
class ByteCodePrinter(ByteCodeConsumer):
def generic_consume(self, instr):
print(instr)
def main():
parser = ArgumentParser()
... | Use __future__.print_function so syntax is valid on Python 3 | Use __future__.print_function so syntax is valid on Python 3
| Python | bsd-3-clause | enthought/Meta,gutomaia/Meta | '''
Created on May 10, 2012
@author: sean
'''
from .bytecode_consumer import ByteCodeConsumer
from argparse import ArgumentParser
class ByteCodePrinter(ByteCodeConsumer):
def generic_consume(self, instr):
print instr
def main():
parser = ArgumentParser()
parser.add_argument()
if __name__ ==... | '''
Created on May 10, 2012
@author: sean
'''
from __future__ import print_function
from .bytecode_consumer import ByteCodeConsumer
from argparse import ArgumentParser
class ByteCodePrinter(ByteCodeConsumer):
def generic_consume(self, instr):
print(instr)
def main():
parser = ArgumentParser()
... | <commit_before>'''
Created on May 10, 2012
@author: sean
'''
from .bytecode_consumer import ByteCodeConsumer
from argparse import ArgumentParser
class ByteCodePrinter(ByteCodeConsumer):
def generic_consume(self, instr):
print instr
def main():
parser = ArgumentParser()
parser.add_argument()
... | '''
Created on May 10, 2012
@author: sean
'''
from __future__ import print_function
from .bytecode_consumer import ByteCodeConsumer
from argparse import ArgumentParser
class ByteCodePrinter(ByteCodeConsumer):
def generic_consume(self, instr):
print(instr)
def main():
parser = ArgumentParser()
... | '''
Created on May 10, 2012
@author: sean
'''
from .bytecode_consumer import ByteCodeConsumer
from argparse import ArgumentParser
class ByteCodePrinter(ByteCodeConsumer):
def generic_consume(self, instr):
print instr
def main():
parser = ArgumentParser()
parser.add_argument()
if __name__ ==... | <commit_before>'''
Created on May 10, 2012
@author: sean
'''
from .bytecode_consumer import ByteCodeConsumer
from argparse import ArgumentParser
class ByteCodePrinter(ByteCodeConsumer):
def generic_consume(self, instr):
print instr
def main():
parser = ArgumentParser()
parser.add_argument()
... |
ca5c3648ad5f28090c09ecbbc0e008c51a4ce708 | bin/push/silent_ios_push.py | bin/push/silent_ios_push.py | import json
import logging
import argparse
import emission.net.ext_service.push.notify_usage as pnu
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
parser = argparse.ArgumentParser(prog="silent_ios_push")
parser.add_argument("interval",
help="specify the sync interval that the ... | import json
import logging
import argparse
import emission.net.ext_service.push.notify_usage as pnu
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
parser = argparse.ArgumentParser(prog="silent_ios_push")
parser.add_argument("interval",
help="specify the sync interval that the ... | Add a new dev (optional) parameter and use it | Add a new dev (optional) parameter and use it
Actually use the functionality in 78e2efd09d61c2abee95590aa637a64fa0618896
| Python | bsd-3-clause | sunil07t/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server | import json
import logging
import argparse
import emission.net.ext_service.push.notify_usage as pnu
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
parser = argparse.ArgumentParser(prog="silent_ios_push")
parser.add_argument("interval",
help="specify the sync interval that the ... | import json
import logging
import argparse
import emission.net.ext_service.push.notify_usage as pnu
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
parser = argparse.ArgumentParser(prog="silent_ios_push")
parser.add_argument("interval",
help="specify the sync interval that the ... | <commit_before>import json
import logging
import argparse
import emission.net.ext_service.push.notify_usage as pnu
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
parser = argparse.ArgumentParser(prog="silent_ios_push")
parser.add_argument("interval",
help="specify the sync int... | import json
import logging
import argparse
import emission.net.ext_service.push.notify_usage as pnu
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
parser = argparse.ArgumentParser(prog="silent_ios_push")
parser.add_argument("interval",
help="specify the sync interval that the ... | import json
import logging
import argparse
import emission.net.ext_service.push.notify_usage as pnu
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
parser = argparse.ArgumentParser(prog="silent_ios_push")
parser.add_argument("interval",
help="specify the sync interval that the ... | <commit_before>import json
import logging
import argparse
import emission.net.ext_service.push.notify_usage as pnu
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
parser = argparse.ArgumentParser(prog="silent_ios_push")
parser.add_argument("interval",
help="specify the sync int... |
21149eb8d128c405d0b69991d1855e99ced951c7 | ExperimentsManager/tests.py | ExperimentsManager/tests.py | from django.test import TestCase
from .models import Experiment
from UserManager.models import WorkbenchUser
from django.contrib.auth.models import User
from django.test import Client
class ExperimentTestCase(TestCase):
def setUp(self):
self.user = User.objects.create_user('test', '[email protected]', 'test')
... | from django.test import TestCase
from .models import Experiment
from UserManager.models import WorkbenchUser
from django.contrib.auth.models import User
from django.test import Client
class ExperimentTestCase(TestCase):
def setUp(self):
self.user = User.objects.create_user('test', '[email protected]', 'test')
... | Test fixed: WorkbenchUser is auto created by signal, so creating it separately is not required | Test fixed: WorkbenchUser is auto created by signal, so creating it separately is not required
| Python | mit | MOOCworkbench/MOOCworkbench,MOOCworkbench/MOOCworkbench,MOOCworkbench/MOOCworkbench | from django.test import TestCase
from .models import Experiment
from UserManager.models import WorkbenchUser
from django.contrib.auth.models import User
from django.test import Client
class ExperimentTestCase(TestCase):
def setUp(self):
self.user = User.objects.create_user('test', '[email protected]', 'test')
... | from django.test import TestCase
from .models import Experiment
from UserManager.models import WorkbenchUser
from django.contrib.auth.models import User
from django.test import Client
class ExperimentTestCase(TestCase):
def setUp(self):
self.user = User.objects.create_user('test', '[email protected]', 'test')
... | <commit_before>from django.test import TestCase
from .models import Experiment
from UserManager.models import WorkbenchUser
from django.contrib.auth.models import User
from django.test import Client
class ExperimentTestCase(TestCase):
def setUp(self):
self.user = User.objects.create_user('test', 'test@tes... | from django.test import TestCase
from .models import Experiment
from UserManager.models import WorkbenchUser
from django.contrib.auth.models import User
from django.test import Client
class ExperimentTestCase(TestCase):
def setUp(self):
self.user = User.objects.create_user('test', '[email protected]', 'test')
... | from django.test import TestCase
from .models import Experiment
from UserManager.models import WorkbenchUser
from django.contrib.auth.models import User
from django.test import Client
class ExperimentTestCase(TestCase):
def setUp(self):
self.user = User.objects.create_user('test', '[email protected]', 'test')
... | <commit_before>from django.test import TestCase
from .models import Experiment
from UserManager.models import WorkbenchUser
from django.contrib.auth.models import User
from django.test import Client
class ExperimentTestCase(TestCase):
def setUp(self):
self.user = User.objects.create_user('test', 'test@tes... |
32e83559e00b7d5a363585d599cd087af854c445 | chainer/links/loss/crf1d.py | chainer/links/loss/crf1d.py | from chainer.functions.loss import crf1d
from chainer import link
from chainer import variable
class CRF1d(link.Link):
"""Linear-chain conditional random field loss layer.
This link wraps the :func:`~chainer.functions.crf1d` function.
It holds a transition cost matrix as a parameter.
Args:
... | from chainer.functions.loss import crf1d
from chainer import link
from chainer import variable
class CRF1d(link.Link):
"""Linear-chain conditional random field loss layer.
This link wraps the :func:`~chainer.functions.crf1d` function.
It holds a transition cost matrix as a parameter.
Args:
... | Support custom initializer in links.CRF1d | Support custom initializer in links.CRF1d
| Python | mit | keisuke-umezawa/chainer,hvy/chainer,okuta/chainer,niboshi/chainer,niboshi/chainer,okuta/chainer,chainer/chainer,chainer/chainer,keisuke-umezawa/chainer,keisuke-umezawa/chainer,okuta/chainer,pfnet/chainer,tkerola/chainer,wkentaro/chainer,chainer/chainer,okuta/chainer,hvy/chainer,niboshi/chainer,hvy/chainer,chainer/chain... | from chainer.functions.loss import crf1d
from chainer import link
from chainer import variable
class CRF1d(link.Link):
"""Linear-chain conditional random field loss layer.
This link wraps the :func:`~chainer.functions.crf1d` function.
It holds a transition cost matrix as a parameter.
Args:
... | from chainer.functions.loss import crf1d
from chainer import link
from chainer import variable
class CRF1d(link.Link):
"""Linear-chain conditional random field loss layer.
This link wraps the :func:`~chainer.functions.crf1d` function.
It holds a transition cost matrix as a parameter.
Args:
... | <commit_before>from chainer.functions.loss import crf1d
from chainer import link
from chainer import variable
class CRF1d(link.Link):
"""Linear-chain conditional random field loss layer.
This link wraps the :func:`~chainer.functions.crf1d` function.
It holds a transition cost matrix as a parameter.
... | from chainer.functions.loss import crf1d
from chainer import link
from chainer import variable
class CRF1d(link.Link):
"""Linear-chain conditional random field loss layer.
This link wraps the :func:`~chainer.functions.crf1d` function.
It holds a transition cost matrix as a parameter.
Args:
... | from chainer.functions.loss import crf1d
from chainer import link
from chainer import variable
class CRF1d(link.Link):
"""Linear-chain conditional random field loss layer.
This link wraps the :func:`~chainer.functions.crf1d` function.
It holds a transition cost matrix as a parameter.
Args:
... | <commit_before>from chainer.functions.loss import crf1d
from chainer import link
from chainer import variable
class CRF1d(link.Link):
"""Linear-chain conditional random field loss layer.
This link wraps the :func:`~chainer.functions.crf1d` function.
It holds a transition cost matrix as a parameter.
... |
8214d516b3feba92ab3ad3b1f2fa1cf253e83012 | pyexcel/internal/__init__.py | pyexcel/internal/__init__.py | """
pyexcel.internal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pyexcel internals that subjected to change
:copyright: (c) 2015-2017 by Onni Software Ltd.
:license: New BSD License
"""
from lml.loader import scan_plugins
from pyexcel.internal.plugins import PARSER, RENDERER # noqa
from pyexcel.int... | """
pyexcel.internal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pyexcel internals that subjected to change
:copyright: (c) 2015-2017 by Onni Software Ltd.
:license: New BSD License
"""
from lml.loader import scan_plugins
from pyexcel.internal.plugins import PARSER, RENDERER # noqa
from pyexcel.int... | Remove use of deprecated `scan_plugins` method | Remove use of deprecated `scan_plugins` method
`scan_plugins` has been deprecated in favour of `scan_plugins_regex`. This
is causing warnings to be logged.
The new method takes a regular expression as its first argument, rather than a
simple prefix string. This commit adds a regular expression which does the s... | Python | bsd-3-clause | chfw/pyexcel,chfw/pyexcel | """
pyexcel.internal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pyexcel internals that subjected to change
:copyright: (c) 2015-2017 by Onni Software Ltd.
:license: New BSD License
"""
from lml.loader import scan_plugins
from pyexcel.internal.plugins import PARSER, RENDERER # noqa
from pyexcel.int... | """
pyexcel.internal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pyexcel internals that subjected to change
:copyright: (c) 2015-2017 by Onni Software Ltd.
:license: New BSD License
"""
from lml.loader import scan_plugins
from pyexcel.internal.plugins import PARSER, RENDERER # noqa
from pyexcel.int... | <commit_before>"""
pyexcel.internal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pyexcel internals that subjected to change
:copyright: (c) 2015-2017 by Onni Software Ltd.
:license: New BSD License
"""
from lml.loader import scan_plugins
from pyexcel.internal.plugins import PARSER, RENDERER # noqa
f... | """
pyexcel.internal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pyexcel internals that subjected to change
:copyright: (c) 2015-2017 by Onni Software Ltd.
:license: New BSD License
"""
from lml.loader import scan_plugins
from pyexcel.internal.plugins import PARSER, RENDERER # noqa
from pyexcel.int... | """
pyexcel.internal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pyexcel internals that subjected to change
:copyright: (c) 2015-2017 by Onni Software Ltd.
:license: New BSD License
"""
from lml.loader import scan_plugins
from pyexcel.internal.plugins import PARSER, RENDERER # noqa
from pyexcel.int... | <commit_before>"""
pyexcel.internal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pyexcel internals that subjected to change
:copyright: (c) 2015-2017 by Onni Software Ltd.
:license: New BSD License
"""
from lml.loader import scan_plugins
from pyexcel.internal.plugins import PARSER, RENDERER # noqa
f... |
a23a1050501563889c2806a514fe2994a2ebe3a8 | example/consume_many_csv_files.py | example/consume_many_csv_files.py | from __future__ import print_function
from itertools import chain
from itertools import imap
import karld
from karld.path import i_walk_csv_paths
def main():
"""
Consume many csv files as if one.
"""
import pathlib
input_dir = pathlib.Path('test_data/things_kinds')
# # Use a generator expr... | from __future__ import print_function
from itertools import chain
try:
from itertools import imap
except ImportError:
# if python 3
imap = map
import karld
from karld.path import i_walk_csv_paths
def main():
"""
Consume many csv files as if one.
"""
import pathlib
input_dir = pathl... | Add python3 support in example | Add python3 support in example
| Python | apache-2.0 | johnwlockwood/stream_tap,johnwlockwood/karl_data,johnwlockwood/stream_tap,johnwlockwood/iter_karld_tools | from __future__ import print_function
from itertools import chain
from itertools import imap
import karld
from karld.path import i_walk_csv_paths
def main():
"""
Consume many csv files as if one.
"""
import pathlib
input_dir = pathlib.Path('test_data/things_kinds')
# # Use a generator expr... | from __future__ import print_function
from itertools import chain
try:
from itertools import imap
except ImportError:
# if python 3
imap = map
import karld
from karld.path import i_walk_csv_paths
def main():
"""
Consume many csv files as if one.
"""
import pathlib
input_dir = pathl... | <commit_before>from __future__ import print_function
from itertools import chain
from itertools import imap
import karld
from karld.path import i_walk_csv_paths
def main():
"""
Consume many csv files as if one.
"""
import pathlib
input_dir = pathlib.Path('test_data/things_kinds')
# # Use a... | from __future__ import print_function
from itertools import chain
try:
from itertools import imap
except ImportError:
# if python 3
imap = map
import karld
from karld.path import i_walk_csv_paths
def main():
"""
Consume many csv files as if one.
"""
import pathlib
input_dir = pathl... | from __future__ import print_function
from itertools import chain
from itertools import imap
import karld
from karld.path import i_walk_csv_paths
def main():
"""
Consume many csv files as if one.
"""
import pathlib
input_dir = pathlib.Path('test_data/things_kinds')
# # Use a generator expr... | <commit_before>from __future__ import print_function
from itertools import chain
from itertools import imap
import karld
from karld.path import i_walk_csv_paths
def main():
"""
Consume many csv files as if one.
"""
import pathlib
input_dir = pathlib.Path('test_data/things_kinds')
# # Use a... |
29384b927b620b7e943343409f62511451bb3059 | neupy/algorithms/memory/utils.py | neupy/algorithms/memory/utils.py | from numpy import where
__all__ = ('sign2bin', 'bin2sign', 'hopfield_energy')
def sign2bin(matrix):
return where(matrix == 1, 1, 0)
def bin2sign(matrix):
return where(matrix == 0, -1, 1)
def hopfield_energy(weight, input_data, output_data):
energy_output = -0.5 * input_data.dot(weight).dot(output_da... | from numpy import where, inner
from numpy.core.umath_tests import inner1d
__all__ = ('sign2bin', 'bin2sign', 'hopfield_energy')
def sign2bin(matrix):
return where(matrix == 1, 1, 0)
def bin2sign(matrix):
return where(matrix == 0, -1, 1)
def hopfield_energy(weight, input_data, output_data):
return -0... | Fix problem with Hopfield energy function for Python 2.7 | Fix problem with Hopfield energy function for Python 2.7
| Python | mit | stczhc/neupy,stczhc/neupy,itdxer/neupy,itdxer/neupy,stczhc/neupy,stczhc/neupy,itdxer/neupy,itdxer/neupy | from numpy import where
__all__ = ('sign2bin', 'bin2sign', 'hopfield_energy')
def sign2bin(matrix):
return where(matrix == 1, 1, 0)
def bin2sign(matrix):
return where(matrix == 0, -1, 1)
def hopfield_energy(weight, input_data, output_data):
energy_output = -0.5 * input_data.dot(weight).dot(output_da... | from numpy import where, inner
from numpy.core.umath_tests import inner1d
__all__ = ('sign2bin', 'bin2sign', 'hopfield_energy')
def sign2bin(matrix):
return where(matrix == 1, 1, 0)
def bin2sign(matrix):
return where(matrix == 0, -1, 1)
def hopfield_energy(weight, input_data, output_data):
return -0... | <commit_before>from numpy import where
__all__ = ('sign2bin', 'bin2sign', 'hopfield_energy')
def sign2bin(matrix):
return where(matrix == 1, 1, 0)
def bin2sign(matrix):
return where(matrix == 0, -1, 1)
def hopfield_energy(weight, input_data, output_data):
energy_output = -0.5 * input_data.dot(weight... | from numpy import where, inner
from numpy.core.umath_tests import inner1d
__all__ = ('sign2bin', 'bin2sign', 'hopfield_energy')
def sign2bin(matrix):
return where(matrix == 1, 1, 0)
def bin2sign(matrix):
return where(matrix == 0, -1, 1)
def hopfield_energy(weight, input_data, output_data):
return -0... | from numpy import where
__all__ = ('sign2bin', 'bin2sign', 'hopfield_energy')
def sign2bin(matrix):
return where(matrix == 1, 1, 0)
def bin2sign(matrix):
return where(matrix == 0, -1, 1)
def hopfield_energy(weight, input_data, output_data):
energy_output = -0.5 * input_data.dot(weight).dot(output_da... | <commit_before>from numpy import where
__all__ = ('sign2bin', 'bin2sign', 'hopfield_energy')
def sign2bin(matrix):
return where(matrix == 1, 1, 0)
def bin2sign(matrix):
return where(matrix == 0, -1, 1)
def hopfield_energy(weight, input_data, output_data):
energy_output = -0.5 * input_data.dot(weight... |
bf28376f252fd474d594e5039d0b2f2bb1afc26a | IPython/frontend.py | IPython/frontend.py | import sys
import types
class ShimModule(types.ModuleType):
def __getattribute__(self, key):
exec 'from IPython import %s' % key
return eval(key)
sys.modules['IPython.frontend'] = ShimModule('frontend')
| """
Shim to maintain backwards compatibility with old frontend imports.
We have moved all contents of the old `frontend` subpackage into top-level
subpackages (`html`, `qt` and `terminal`). This will let code that was making
`from IPython.frontend...` calls continue working, though a warning will be
printed.
"""
#--... | Add proper warnings on use of the backwards compatibility shim. | Add proper warnings on use of the backwards compatibility shim.
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | import sys
import types
class ShimModule(types.ModuleType):
def __getattribute__(self, key):
exec 'from IPython import %s' % key
return eval(key)
sys.modules['IPython.frontend'] = ShimModule('frontend')
Add proper warnings on use of the backwards compatibility shim. | """
Shim to maintain backwards compatibility with old frontend imports.
We have moved all contents of the old `frontend` subpackage into top-level
subpackages (`html`, `qt` and `terminal`). This will let code that was making
`from IPython.frontend...` calls continue working, though a warning will be
printed.
"""
#--... | <commit_before>import sys
import types
class ShimModule(types.ModuleType):
def __getattribute__(self, key):
exec 'from IPython import %s' % key
return eval(key)
sys.modules['IPython.frontend'] = ShimModule('frontend')
<commit_msg>Add proper warnings on use of the backwards compatibility shim.<co... | """
Shim to maintain backwards compatibility with old frontend imports.
We have moved all contents of the old `frontend` subpackage into top-level
subpackages (`html`, `qt` and `terminal`). This will let code that was making
`from IPython.frontend...` calls continue working, though a warning will be
printed.
"""
#--... | import sys
import types
class ShimModule(types.ModuleType):
def __getattribute__(self, key):
exec 'from IPython import %s' % key
return eval(key)
sys.modules['IPython.frontend'] = ShimModule('frontend')
Add proper warnings on use of the backwards compatibility shim."""
Shim to maintain backwards... | <commit_before>import sys
import types
class ShimModule(types.ModuleType):
def __getattribute__(self, key):
exec 'from IPython import %s' % key
return eval(key)
sys.modules['IPython.frontend'] = ShimModule('frontend')
<commit_msg>Add proper warnings on use of the backwards compatibility shim.<co... |
981a74b116081f3ce1d97262c3c88104a953cdf4 | saau/sections/misc/header.py | saau/sections/misc/header.py | import matplotlib.pyplot as plt
from operator import gt, lt, itemgetter
from lxml.etree import fromstring, XMLSyntaxError
def frange(start, stop, step):
cur = start
op = gt if start > stop else lt
while op(cur, stop):
yield cur
cur += step
def parse_lines(lines):
for line in lines:
... | import matplotlib.pyplot as plt
from operator import itemgetter
from lxml.etree import fromstring, XMLSyntaxError
import numpy as np
def parse_lines(lines):
for line in lines:
try:
xml_line = fromstring(line.encode('utf-8'))
except XMLSyntaxError:
attrs = []
else:... | Use numpy's float supporting range | Use numpy's float supporting range
| Python | mit | Mause/statistical_atlas_of_au | import matplotlib.pyplot as plt
from operator import gt, lt, itemgetter
from lxml.etree import fromstring, XMLSyntaxError
def frange(start, stop, step):
cur = start
op = gt if start > stop else lt
while op(cur, stop):
yield cur
cur += step
def parse_lines(lines):
for line in lines:
... | import matplotlib.pyplot as plt
from operator import itemgetter
from lxml.etree import fromstring, XMLSyntaxError
import numpy as np
def parse_lines(lines):
for line in lines:
try:
xml_line = fromstring(line.encode('utf-8'))
except XMLSyntaxError:
attrs = []
else:... | <commit_before>import matplotlib.pyplot as plt
from operator import gt, lt, itemgetter
from lxml.etree import fromstring, XMLSyntaxError
def frange(start, stop, step):
cur = start
op = gt if start > stop else lt
while op(cur, stop):
yield cur
cur += step
def parse_lines(lines):
for ... | import matplotlib.pyplot as plt
from operator import itemgetter
from lxml.etree import fromstring, XMLSyntaxError
import numpy as np
def parse_lines(lines):
for line in lines:
try:
xml_line = fromstring(line.encode('utf-8'))
except XMLSyntaxError:
attrs = []
else:... | import matplotlib.pyplot as plt
from operator import gt, lt, itemgetter
from lxml.etree import fromstring, XMLSyntaxError
def frange(start, stop, step):
cur = start
op = gt if start > stop else lt
while op(cur, stop):
yield cur
cur += step
def parse_lines(lines):
for line in lines:
... | <commit_before>import matplotlib.pyplot as plt
from operator import gt, lt, itemgetter
from lxml.etree import fromstring, XMLSyntaxError
def frange(start, stop, step):
cur = start
op = gt if start > stop else lt
while op(cur, stop):
yield cur
cur += step
def parse_lines(lines):
for ... |
f4bbb244716f9471b520f53ebffaf34a31503cd1 | Web/scripts/CPWeb/__init__.py | Web/scripts/CPWeb/__init__.py | """
CPWeb - A collection of commonly used routines to produce CoolProp's online documentation
=====
"""
from __future__ import division, absolute_import, print_function
import codecs
import csv
import cStringIO
def get_version():
return 5.0
if __name__ == "__main__":
print('You are using version %s of the... | """
CPWeb - A collection of commonly used routines to produce CoolProp's online documentation
=====
"""
from __future__ import division, absolute_import, print_function
def get_version():
return 5.0
if __name__ == "__main__":
print('You are using version %s of the Python package for creating CoolProp\' onli... | Remove unused imports (besides they are Py 2.x only) | Remove unused imports (besides they are Py 2.x only)
| Python | mit | CoolProp/CoolProp,CoolProp/CoolProp,henningjp/CoolProp,henningjp/CoolProp,CoolProp/CoolProp,CoolProp/CoolProp,CoolProp/CoolProp,henningjp/CoolProp,henningjp/CoolProp,henningjp/CoolProp,henningjp/CoolProp,henningjp/CoolProp,CoolProp/CoolProp,CoolProp/CoolProp,henningjp/CoolProp,CoolProp/CoolProp | """
CPWeb - A collection of commonly used routines to produce CoolProp's online documentation
=====
"""
from __future__ import division, absolute_import, print_function
import codecs
import csv
import cStringIO
def get_version():
return 5.0
if __name__ == "__main__":
print('You are using version %s of the... | """
CPWeb - A collection of commonly used routines to produce CoolProp's online documentation
=====
"""
from __future__ import division, absolute_import, print_function
def get_version():
return 5.0
if __name__ == "__main__":
print('You are using version %s of the Python package for creating CoolProp\' onli... | <commit_before>"""
CPWeb - A collection of commonly used routines to produce CoolProp's online documentation
=====
"""
from __future__ import division, absolute_import, print_function
import codecs
import csv
import cStringIO
def get_version():
return 5.0
if __name__ == "__main__":
print('You are using ve... | """
CPWeb - A collection of commonly used routines to produce CoolProp's online documentation
=====
"""
from __future__ import division, absolute_import, print_function
def get_version():
return 5.0
if __name__ == "__main__":
print('You are using version %s of the Python package for creating CoolProp\' onli... | """
CPWeb - A collection of commonly used routines to produce CoolProp's online documentation
=====
"""
from __future__ import division, absolute_import, print_function
import codecs
import csv
import cStringIO
def get_version():
return 5.0
if __name__ == "__main__":
print('You are using version %s of the... | <commit_before>"""
CPWeb - A collection of commonly used routines to produce CoolProp's online documentation
=====
"""
from __future__ import division, absolute_import, print_function
import codecs
import csv
import cStringIO
def get_version():
return 5.0
if __name__ == "__main__":
print('You are using ve... |
37ab58016e69993b5ab1d63c99d9afcf54bd95af | fireplace/cards/tgt/neutral_epic.py | fireplace/cards/tgt/neutral_epic.py | from ..utils import *
##
# Minions
# Kodorider
class AT_099:
inspire = Summon(CONTROLLER, "AT_099t")
| from ..utils import *
##
# Minions
# Twilight Guardian
class AT_017:
play = HOLDING_DRAGON & Buff(SELF, "AT_017e")
# Sideshow Spelleater
class AT_098:
play = Summon(CONTROLLER, Copy(ENEMY_HERO_POWER))
# Kodorider
class AT_099:
inspire = Summon(CONTROLLER, "AT_099t")
# Master of Ceremonies
class AT_117:
pla... | Implement more TGT Neutral Epics | Implement more TGT Neutral Epics
| Python | agpl-3.0 | Meerkov/fireplace,Ragowit/fireplace,oftc-ftw/fireplace,liujimj/fireplace,oftc-ftw/fireplace,smallnamespace/fireplace,Ragowit/fireplace,Meerkov/fireplace,liujimj/fireplace,amw2104/fireplace,beheh/fireplace,amw2104/fireplace,NightKev/fireplace,smallnamespace/fireplace,jleclanche/fireplace | from ..utils import *
##
# Minions
# Kodorider
class AT_099:
inspire = Summon(CONTROLLER, "AT_099t")
Implement more TGT Neutral Epics | from ..utils import *
##
# Minions
# Twilight Guardian
class AT_017:
play = HOLDING_DRAGON & Buff(SELF, "AT_017e")
# Sideshow Spelleater
class AT_098:
play = Summon(CONTROLLER, Copy(ENEMY_HERO_POWER))
# Kodorider
class AT_099:
inspire = Summon(CONTROLLER, "AT_099t")
# Master of Ceremonies
class AT_117:
pla... | <commit_before>from ..utils import *
##
# Minions
# Kodorider
class AT_099:
inspire = Summon(CONTROLLER, "AT_099t")
<commit_msg>Implement more TGT Neutral Epics<commit_after> | from ..utils import *
##
# Minions
# Twilight Guardian
class AT_017:
play = HOLDING_DRAGON & Buff(SELF, "AT_017e")
# Sideshow Spelleater
class AT_098:
play = Summon(CONTROLLER, Copy(ENEMY_HERO_POWER))
# Kodorider
class AT_099:
inspire = Summon(CONTROLLER, "AT_099t")
# Master of Ceremonies
class AT_117:
pla... | from ..utils import *
##
# Minions
# Kodorider
class AT_099:
inspire = Summon(CONTROLLER, "AT_099t")
Implement more TGT Neutral Epicsfrom ..utils import *
##
# Minions
# Twilight Guardian
class AT_017:
play = HOLDING_DRAGON & Buff(SELF, "AT_017e")
# Sideshow Spelleater
class AT_098:
play = Summon(CONTROLLER,... | <commit_before>from ..utils import *
##
# Minions
# Kodorider
class AT_099:
inspire = Summon(CONTROLLER, "AT_099t")
<commit_msg>Implement more TGT Neutral Epics<commit_after>from ..utils import *
##
# Minions
# Twilight Guardian
class AT_017:
play = HOLDING_DRAGON & Buff(SELF, "AT_017e")
# Sideshow Spelleater... |
dfe1213ba9de5e5e5aaf9690a2cf5e3b295869fa | examples/graph/degree_sequence.py | examples/graph/degree_sequence.py | #!/usr/bin/env python
"""
Random graph from given degree sequence.
"""
__author__ = """Aric Hagberg ([email protected])"""
__date__ = "$Date: 2004-11-03 08:11:09 -0700 (Wed, 03 Nov 2004) $"
__credits__ = """"""
__revision__ = "$Revision: 503 $"
# Copyright (C) 2004 by
# Aric Hagberg <[email protected]>
# Dan Sc... | #!/usr/bin/env python
"""
Random graph from given degree sequence.
"""
__author__ = """Aric Hagberg ([email protected])"""
__date__ = "$Date: 2004-11-03 08:11:09 -0700 (Wed, 03 Nov 2004) $"
__credits__ = """"""
__revision__ = "$Revision: 503 $"
# Copyright (C) 2004 by
# Aric Hagberg <[email protected]>
# Dan Sc... | Remove Python 3 incompatible print statement | Remove Python 3 incompatible print statement
| Python | bsd-3-clause | RMKD/networkx,jakevdp/networkx,JamesClough/networkx,jni/networkx,harlowja/networkx,debsankha/networkx,andnovar/networkx,tmilicic/networkx,ghdk/networkx,goulu/networkx,RMKD/networkx,dmoliveira/networkx,beni55/networkx,chrisnatali/networkx,wasade/networkx,nathania/networkx,jakevdp/networkx,blublud/networkx,kernc/networkx... | #!/usr/bin/env python
"""
Random graph from given degree sequence.
"""
__author__ = """Aric Hagberg ([email protected])"""
__date__ = "$Date: 2004-11-03 08:11:09 -0700 (Wed, 03 Nov 2004) $"
__credits__ = """"""
__revision__ = "$Revision: 503 $"
# Copyright (C) 2004 by
# Aric Hagberg <[email protected]>
# Dan Sc... | #!/usr/bin/env python
"""
Random graph from given degree sequence.
"""
__author__ = """Aric Hagberg ([email protected])"""
__date__ = "$Date: 2004-11-03 08:11:09 -0700 (Wed, 03 Nov 2004) $"
__credits__ = """"""
__revision__ = "$Revision: 503 $"
# Copyright (C) 2004 by
# Aric Hagberg <[email protected]>
# Dan Sc... | <commit_before>#!/usr/bin/env python
"""
Random graph from given degree sequence.
"""
__author__ = """Aric Hagberg ([email protected])"""
__date__ = "$Date: 2004-11-03 08:11:09 -0700 (Wed, 03 Nov 2004) $"
__credits__ = """"""
__revision__ = "$Revision: 503 $"
# Copyright (C) 2004 by
# Aric Hagberg <[email protected]... | #!/usr/bin/env python
"""
Random graph from given degree sequence.
"""
__author__ = """Aric Hagberg ([email protected])"""
__date__ = "$Date: 2004-11-03 08:11:09 -0700 (Wed, 03 Nov 2004) $"
__credits__ = """"""
__revision__ = "$Revision: 503 $"
# Copyright (C) 2004 by
# Aric Hagberg <[email protected]>
# Dan Sc... | #!/usr/bin/env python
"""
Random graph from given degree sequence.
"""
__author__ = """Aric Hagberg ([email protected])"""
__date__ = "$Date: 2004-11-03 08:11:09 -0700 (Wed, 03 Nov 2004) $"
__credits__ = """"""
__revision__ = "$Revision: 503 $"
# Copyright (C) 2004 by
# Aric Hagberg <[email protected]>
# Dan Sc... | <commit_before>#!/usr/bin/env python
"""
Random graph from given degree sequence.
"""
__author__ = """Aric Hagberg ([email protected])"""
__date__ = "$Date: 2004-11-03 08:11:09 -0700 (Wed, 03 Nov 2004) $"
__credits__ = """"""
__revision__ = "$Revision: 503 $"
# Copyright (C) 2004 by
# Aric Hagberg <[email protected]... |
b3ddba27c92f36ee9534903b43ff632daa148585 | froide/publicbody/search_indexes.py | froide/publicbody/search_indexes.py | from django.conf import settings
from haystack import indexes
from haystack import site
from publicbody.models import PublicBody
from helper.searchindex import QueuedRealTimeSearchIndex
PUBLIC_BODY_BOOSTS = getattr(settings, "FROIDE_PUBLIC_BODY_BOOSTS", {})
class PublicBodyIndex(QueuedRealTimeSearchIndex):
te... | from django.conf import settings
from haystack import indexes
from haystack import site
from publicbody.models import PublicBody
from helper.searchindex import QueuedRealTimeSearchIndex
PUBLIC_BODY_BOOSTS = getattr(settings, "FROIDE_PUBLIC_BODY_BOOSTS", {})
class PublicBodyIndex(QueuedRealTimeSearchIndex):
te... | Fix public body search index by indexing jurisdiction name | Fix public body search index by indexing jurisdiction name | Python | mit | CodeforHawaii/froide,ryankanno/froide,okfse/froide,stefanw/froide,CodeforHawaii/froide,catcosmo/froide,LilithWittmann/froide,ryankanno/froide,stefanw/froide,fin/froide,okfse/froide,LilithWittmann/froide,catcosmo/froide,fin/froide,okfse/froide,okfse/froide,fin/froide,ryankanno/froide,LilithWittmann/froide,catcosmo/froid... | from django.conf import settings
from haystack import indexes
from haystack import site
from publicbody.models import PublicBody
from helper.searchindex import QueuedRealTimeSearchIndex
PUBLIC_BODY_BOOSTS = getattr(settings, "FROIDE_PUBLIC_BODY_BOOSTS", {})
class PublicBodyIndex(QueuedRealTimeSearchIndex):
te... | from django.conf import settings
from haystack import indexes
from haystack import site
from publicbody.models import PublicBody
from helper.searchindex import QueuedRealTimeSearchIndex
PUBLIC_BODY_BOOSTS = getattr(settings, "FROIDE_PUBLIC_BODY_BOOSTS", {})
class PublicBodyIndex(QueuedRealTimeSearchIndex):
te... | <commit_before>from django.conf import settings
from haystack import indexes
from haystack import site
from publicbody.models import PublicBody
from helper.searchindex import QueuedRealTimeSearchIndex
PUBLIC_BODY_BOOSTS = getattr(settings, "FROIDE_PUBLIC_BODY_BOOSTS", {})
class PublicBodyIndex(QueuedRealTimeSearc... | from django.conf import settings
from haystack import indexes
from haystack import site
from publicbody.models import PublicBody
from helper.searchindex import QueuedRealTimeSearchIndex
PUBLIC_BODY_BOOSTS = getattr(settings, "FROIDE_PUBLIC_BODY_BOOSTS", {})
class PublicBodyIndex(QueuedRealTimeSearchIndex):
te... | from django.conf import settings
from haystack import indexes
from haystack import site
from publicbody.models import PublicBody
from helper.searchindex import QueuedRealTimeSearchIndex
PUBLIC_BODY_BOOSTS = getattr(settings, "FROIDE_PUBLIC_BODY_BOOSTS", {})
class PublicBodyIndex(QueuedRealTimeSearchIndex):
te... | <commit_before>from django.conf import settings
from haystack import indexes
from haystack import site
from publicbody.models import PublicBody
from helper.searchindex import QueuedRealTimeSearchIndex
PUBLIC_BODY_BOOSTS = getattr(settings, "FROIDE_PUBLIC_BODY_BOOSTS", {})
class PublicBodyIndex(QueuedRealTimeSearc... |
de381a56e87a21da1e82146da01bb546c5094ec4 | scripts/asgard-deploy.py | scripts/asgard-deploy.py | #!/usr/bin/env python
import sys
import logging
import click
from os import path
# Add top-level module path to sys.path before importing tubular code.
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
from tubular import asgard
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
@cl... | #!/usr/bin/env python
import sys
import logging
import traceback
import click
from os import path
# Add top-level module path to sys.path before importing tubular code.
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
from tubular import asgard
logging.basicConfig(stream=sys.stdout, level=l... | Print the traceback as well for debugging purposes. | Print the traceback as well for debugging purposes.
| Python | agpl-3.0 | eltoncarr/tubular,eltoncarr/tubular | #!/usr/bin/env python
import sys
import logging
import click
from os import path
# Add top-level module path to sys.path before importing tubular code.
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
from tubular import asgard
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
@cl... | #!/usr/bin/env python
import sys
import logging
import traceback
import click
from os import path
# Add top-level module path to sys.path before importing tubular code.
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
from tubular import asgard
logging.basicConfig(stream=sys.stdout, level=l... | <commit_before>#!/usr/bin/env python
import sys
import logging
import click
from os import path
# Add top-level module path to sys.path before importing tubular code.
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
from tubular import asgard
logging.basicConfig(stream=sys.stdout, level=log... | #!/usr/bin/env python
import sys
import logging
import traceback
import click
from os import path
# Add top-level module path to sys.path before importing tubular code.
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
from tubular import asgard
logging.basicConfig(stream=sys.stdout, level=l... | #!/usr/bin/env python
import sys
import logging
import click
from os import path
# Add top-level module path to sys.path before importing tubular code.
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
from tubular import asgard
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
@cl... | <commit_before>#!/usr/bin/env python
import sys
import logging
import click
from os import path
# Add top-level module path to sys.path before importing tubular code.
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
from tubular import asgard
logging.basicConfig(stream=sys.stdout, level=log... |
9926cbb1919b96999d479f5a8d67e17ce71a1091 | motobot/irc_message.py | motobot/irc_message.py | class IRCMessage:
""" Class to store and parse an IRC Message. """
def __init__(self, msg):
""" Parse a raw IRC message to IRCMessage. """
self.sender = None
self.nick = None
self.command = None
self.params = []
self.__parse_msg(msg)
def __parse_msg(self, ... | class IRCMessage:
""" Class to store and parse an IRC Message. """
def __init__(self, msg):
""" Parse a raw IRC message to IRCMessage. """
self.sender = None
self.nick = None
self.command = None
self.params = []
self.__parse_msg(msg)
def __parse_msg(self, ... | Improve the get_nick a tiny amount | Improve the get_nick a tiny amount
| Python | mit | Motoko11/MotoBot | class IRCMessage:
""" Class to store and parse an IRC Message. """
def __init__(self, msg):
""" Parse a raw IRC message to IRCMessage. """
self.sender = None
self.nick = None
self.command = None
self.params = []
self.__parse_msg(msg)
def __parse_msg(self, ... | class IRCMessage:
""" Class to store and parse an IRC Message. """
def __init__(self, msg):
""" Parse a raw IRC message to IRCMessage. """
self.sender = None
self.nick = None
self.command = None
self.params = []
self.__parse_msg(msg)
def __parse_msg(self, ... | <commit_before>class IRCMessage:
""" Class to store and parse an IRC Message. """
def __init__(self, msg):
""" Parse a raw IRC message to IRCMessage. """
self.sender = None
self.nick = None
self.command = None
self.params = []
self.__parse_msg(msg)
def __p... | class IRCMessage:
""" Class to store and parse an IRC Message. """
def __init__(self, msg):
""" Parse a raw IRC message to IRCMessage. """
self.sender = None
self.nick = None
self.command = None
self.params = []
self.__parse_msg(msg)
def __parse_msg(self, ... | class IRCMessage:
""" Class to store and parse an IRC Message. """
def __init__(self, msg):
""" Parse a raw IRC message to IRCMessage. """
self.sender = None
self.nick = None
self.command = None
self.params = []
self.__parse_msg(msg)
def __parse_msg(self, ... | <commit_before>class IRCMessage:
""" Class to store and parse an IRC Message. """
def __init__(self, msg):
""" Parse a raw IRC message to IRCMessage. """
self.sender = None
self.nick = None
self.command = None
self.params = []
self.__parse_msg(msg)
def __p... |
6ad4796030aab2f6dbf8389b4030007d0fcf8761 | panoptes/test/mount/test_ioptron.py | panoptes/test/mount/test_ioptron.py | from nose.tools import raises
import panoptes
from panoptes.mount.ioptron import Mount
class TestIOptron():
@raises(AssertionError)
def test_no_config_no_commands(self):
""" Mount needs a config """
mount = Mount()
@raises(AssertionError)
def test_config_no_commands(self):
""" """
mount = Mount(config={... | from nose.tools import raises
import panoptes
from panoptes.mount.ioptron import Mount
class TestIOptron():
@raises(AssertionError)
def test_no_config_no_commands(self):
""" Mount needs a config """
mount = Mount()
@raises(AssertionError)
def test_config_bad_commands(self):
""" Passes in a default config ... | Update to test for mount setup | Update to test for mount setup
| Python | mit | Guokr1991/POCS,joshwalawender/POCS,AstroHuntsman/POCS,panoptes/POCS,AstroHuntsman/POCS,panoptes/POCS,Guokr1991/POCS,Guokr1991/POCS,Guokr1991/POCS,panoptes/POCS,AstroHuntsman/POCS,panoptes/POCS,joshwalawender/POCS,AstroHuntsman/POCS,fmin2958/POCS,joshwalawender/POCS,fmin2958/POCS,fmin2958/POCS | from nose.tools import raises
import panoptes
from panoptes.mount.ioptron import Mount
class TestIOptron():
@raises(AssertionError)
def test_no_config_no_commands(self):
""" Mount needs a config """
mount = Mount()
@raises(AssertionError)
def test_config_no_commands(self):
""" """
mount = Mount(config={... | from nose.tools import raises
import panoptes
from panoptes.mount.ioptron import Mount
class TestIOptron():
@raises(AssertionError)
def test_no_config_no_commands(self):
""" Mount needs a config """
mount = Mount()
@raises(AssertionError)
def test_config_bad_commands(self):
""" Passes in a default config ... | <commit_before>from nose.tools import raises
import panoptes
from panoptes.mount.ioptron import Mount
class TestIOptron():
@raises(AssertionError)
def test_no_config_no_commands(self):
""" Mount needs a config """
mount = Mount()
@raises(AssertionError)
def test_config_no_commands(self):
""" """
mount =... | from nose.tools import raises
import panoptes
from panoptes.mount.ioptron import Mount
class TestIOptron():
@raises(AssertionError)
def test_no_config_no_commands(self):
""" Mount needs a config """
mount = Mount()
@raises(AssertionError)
def test_config_bad_commands(self):
""" Passes in a default config ... | from nose.tools import raises
import panoptes
from panoptes.mount.ioptron import Mount
class TestIOptron():
@raises(AssertionError)
def test_no_config_no_commands(self):
""" Mount needs a config """
mount = Mount()
@raises(AssertionError)
def test_config_no_commands(self):
""" """
mount = Mount(config={... | <commit_before>from nose.tools import raises
import panoptes
from panoptes.mount.ioptron import Mount
class TestIOptron():
@raises(AssertionError)
def test_no_config_no_commands(self):
""" Mount needs a config """
mount = Mount()
@raises(AssertionError)
def test_config_no_commands(self):
""" """
mount =... |
24d4fee92c1c2ff4bac1fe09d9b436748234a48c | main.py | main.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
""" Main script. Executes the XML Server implementation with an HTTP
connection and default parameters.
"""
import sys
import argparse
from server import xml_server
from connection import http_connection
parser = argparse.ArgumentParser()
parser.add... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
""" Main script. Executes the XML Server implementation with an HTTP
connection and default parameters.
"""
import sys
import argparse
from server import xml_server, defective_servers
from connection import http_connection
parser = argparse.Argument... | Add argument for execution of defective server. | Add argument for execution of defective server.
| Python | apache-2.0 | Solucionamos/dummybmc | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
""" Main script. Executes the XML Server implementation with an HTTP
connection and default parameters.
"""
import sys
import argparse
from server import xml_server
from connection import http_connection
parser = argparse.ArgumentParser()
parser.add... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
""" Main script. Executes the XML Server implementation with an HTTP
connection and default parameters.
"""
import sys
import argparse
from server import xml_server, defective_servers
from connection import http_connection
parser = argparse.Argument... | <commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
""" Main script. Executes the XML Server implementation with an HTTP
connection and default parameters.
"""
import sys
import argparse
from server import xml_server
from connection import http_connection
parser = argparse.ArgumentPars... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
""" Main script. Executes the XML Server implementation with an HTTP
connection and default parameters.
"""
import sys
import argparse
from server import xml_server, defective_servers
from connection import http_connection
parser = argparse.Argument... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
""" Main script. Executes the XML Server implementation with an HTTP
connection and default parameters.
"""
import sys
import argparse
from server import xml_server
from connection import http_connection
parser = argparse.ArgumentParser()
parser.add... | <commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
""" Main script. Executes the XML Server implementation with an HTTP
connection and default parameters.
"""
import sys
import argparse
from server import xml_server
from connection import http_connection
parser = argparse.ArgumentPars... |
52c2205804d8dc38447bca1ccbf5599e00cd1d7b | main.py | main.py | #!/usr/bin/env python3
import requests
CONFIG_DIR = "config"
class Bot:
def __init__(self):
self.config = Config(CONFIG_DIR)
self.api = TelegramBotApi(self.config.get_auth_token())
def run(self):
self.api.send_message(self.config.get_user_id(), "test")
class TelegramBotApi:
de... | #!/usr/bin/env python3
import requests
CONFIG_DIR = "config"
class Bot:
def __init__(self):
self.config = Config(CONFIG_DIR)
self.api = TelegramBotApi(self.config.get_auth_token())
def run(self):
self.api.send_message(self.config.get_admin_user_id(), "test")
class TelegramBotApi:
... | Rename user_id config key to admin_user_id | Rename user_id config key to admin_user_id
| Python | agpl-3.0 | alvarogzp/telegram-bot,alvarogzp/telegram-bot | #!/usr/bin/env python3
import requests
CONFIG_DIR = "config"
class Bot:
def __init__(self):
self.config = Config(CONFIG_DIR)
self.api = TelegramBotApi(self.config.get_auth_token())
def run(self):
self.api.send_message(self.config.get_user_id(), "test")
class TelegramBotApi:
de... | #!/usr/bin/env python3
import requests
CONFIG_DIR = "config"
class Bot:
def __init__(self):
self.config = Config(CONFIG_DIR)
self.api = TelegramBotApi(self.config.get_auth_token())
def run(self):
self.api.send_message(self.config.get_admin_user_id(), "test")
class TelegramBotApi:
... | <commit_before>#!/usr/bin/env python3
import requests
CONFIG_DIR = "config"
class Bot:
def __init__(self):
self.config = Config(CONFIG_DIR)
self.api = TelegramBotApi(self.config.get_auth_token())
def run(self):
self.api.send_message(self.config.get_user_id(), "test")
class Telegra... | #!/usr/bin/env python3
import requests
CONFIG_DIR = "config"
class Bot:
def __init__(self):
self.config = Config(CONFIG_DIR)
self.api = TelegramBotApi(self.config.get_auth_token())
def run(self):
self.api.send_message(self.config.get_admin_user_id(), "test")
class TelegramBotApi:
... | #!/usr/bin/env python3
import requests
CONFIG_DIR = "config"
class Bot:
def __init__(self):
self.config = Config(CONFIG_DIR)
self.api = TelegramBotApi(self.config.get_auth_token())
def run(self):
self.api.send_message(self.config.get_user_id(), "test")
class TelegramBotApi:
de... | <commit_before>#!/usr/bin/env python3
import requests
CONFIG_DIR = "config"
class Bot:
def __init__(self):
self.config = Config(CONFIG_DIR)
self.api = TelegramBotApi(self.config.get_auth_token())
def run(self):
self.api.send_message(self.config.get_user_id(), "test")
class Telegra... |
4ca8889396595f9da99becbb88fb7e38ab0ed560 | hunter/reviewsapi.py | hunter/reviewsapi.py | import requests
import os
from .endpoints import *
class UnauthorizedToken(Exception):
pass
class ReviewsAPI:
def __init__(self):
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': token, 'Content-Length': '0'}
def certifications(self):
try:
... | import requests
import os
from .endpoints import *
class UnauthorizedToken(Exception):
pass
class ReviewsAPI:
def __init__(self):
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': token, 'Content-Length': '0'}
def certifications(self):
try:
... | Raise exception if connection not succeed and customize error message | Raise exception if connection not succeed and customize error message
| Python | mit | anapaulagomes/reviews-assigner | import requests
import os
from .endpoints import *
class UnauthorizedToken(Exception):
pass
class ReviewsAPI:
def __init__(self):
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': token, 'Content-Length': '0'}
def certifications(self):
try:
... | import requests
import os
from .endpoints import *
class UnauthorizedToken(Exception):
pass
class ReviewsAPI:
def __init__(self):
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': token, 'Content-Length': '0'}
def certifications(self):
try:
... | <commit_before>import requests
import os
from .endpoints import *
class UnauthorizedToken(Exception):
pass
class ReviewsAPI:
def __init__(self):
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': token, 'Content-Length': '0'}
def certifications(self):
... | import requests
import os
from .endpoints import *
class UnauthorizedToken(Exception):
pass
class ReviewsAPI:
def __init__(self):
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': token, 'Content-Length': '0'}
def certifications(self):
try:
... | import requests
import os
from .endpoints import *
class UnauthorizedToken(Exception):
pass
class ReviewsAPI:
def __init__(self):
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': token, 'Content-Length': '0'}
def certifications(self):
try:
... | <commit_before>import requests
import os
from .endpoints import *
class UnauthorizedToken(Exception):
pass
class ReviewsAPI:
def __init__(self):
token = os.environ.get('UDACITY_AUTH_TOKEN')
self.headers = {'Authorization': token, 'Content-Length': '0'}
def certifications(self):
... |
bdca4889442e7d84f8c4e68ecdbee676d46ff264 | examples/test_with_data_provider.py | examples/test_with_data_provider.py | from pytf.dataprovider import DataProvider
try:
from unittest.mock import call
except ImportError:
from mock import call
@DataProvider([call(max=5), call(max=10), call(max=15)])
class TestCase(object):
def __init__(self, max):
self.max = max
@DataProvider([call(n=3), call(n=7), call(n=12), c... | from pytf.dataprovider import DataProvider, call
@DataProvider(max_5=call(max=5), max_10=call(max=10), max_15=call(max=15))
class TestCase(object):
def __init__(self, max):
self.max = max
@DataProvider(n_3=call(n=3), n_7=call(n=7), n_12=call(n=12), n_20=call(n=20))
def test_test(self, n):
... | Fix data provider example file. | Fix data provider example file.
| Python | mit | Lothiraldan/pytf | from pytf.dataprovider import DataProvider
try:
from unittest.mock import call
except ImportError:
from mock import call
@DataProvider([call(max=5), call(max=10), call(max=15)])
class TestCase(object):
def __init__(self, max):
self.max = max
@DataProvider([call(n=3), call(n=7), call(n=12), c... | from pytf.dataprovider import DataProvider, call
@DataProvider(max_5=call(max=5), max_10=call(max=10), max_15=call(max=15))
class TestCase(object):
def __init__(self, max):
self.max = max
@DataProvider(n_3=call(n=3), n_7=call(n=7), n_12=call(n=12), n_20=call(n=20))
def test_test(self, n):
... | <commit_before>from pytf.dataprovider import DataProvider
try:
from unittest.mock import call
except ImportError:
from mock import call
@DataProvider([call(max=5), call(max=10), call(max=15)])
class TestCase(object):
def __init__(self, max):
self.max = max
@DataProvider([call(n=3), call(n=7)... | from pytf.dataprovider import DataProvider, call
@DataProvider(max_5=call(max=5), max_10=call(max=10), max_15=call(max=15))
class TestCase(object):
def __init__(self, max):
self.max = max
@DataProvider(n_3=call(n=3), n_7=call(n=7), n_12=call(n=12), n_20=call(n=20))
def test_test(self, n):
... | from pytf.dataprovider import DataProvider
try:
from unittest.mock import call
except ImportError:
from mock import call
@DataProvider([call(max=5), call(max=10), call(max=15)])
class TestCase(object):
def __init__(self, max):
self.max = max
@DataProvider([call(n=3), call(n=7), call(n=12), c... | <commit_before>from pytf.dataprovider import DataProvider
try:
from unittest.mock import call
except ImportError:
from mock import call
@DataProvider([call(max=5), call(max=10), call(max=15)])
class TestCase(object):
def __init__(self, max):
self.max = max
@DataProvider([call(n=3), call(n=7)... |
346e296872e1ca011eb5e469505de1c15c86732f | Doc/tools/sphinx-build.py | Doc/tools/sphinx-build.py | # -*- coding: utf-8 -*-
"""
Sphinx - Python documentation toolchain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2007 by Georg Brandl.
:license: Python license.
"""
import sys
if __name__ == '__main__':
if sys.version_info[:3] < (2, 5, 0):
print >>sys.stderr, """\
Error: Sphinx ne... | # -*- coding: utf-8 -*-
"""
Sphinx - Python documentation toolchain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2007 by Georg Brandl.
:license: Python license.
"""
import sys
if __name__ == '__main__':
if sys.version_info[:3] < (2, 5, 0):
print >>sys.stderr, """\
Error: Sphinx ne... | Clarify the comment about setting the PYTHON variable for the Doc Makefile. | Clarify the comment about setting the PYTHON variable for the Doc Makefile.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | # -*- coding: utf-8 -*-
"""
Sphinx - Python documentation toolchain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2007 by Georg Brandl.
:license: Python license.
"""
import sys
if __name__ == '__main__':
if sys.version_info[:3] < (2, 5, 0):
print >>sys.stderr, """\
Error: Sphinx ne... | # -*- coding: utf-8 -*-
"""
Sphinx - Python documentation toolchain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2007 by Georg Brandl.
:license: Python license.
"""
import sys
if __name__ == '__main__':
if sys.version_info[:3] < (2, 5, 0):
print >>sys.stderr, """\
Error: Sphinx ne... | <commit_before># -*- coding: utf-8 -*-
"""
Sphinx - Python documentation toolchain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2007 by Georg Brandl.
:license: Python license.
"""
import sys
if __name__ == '__main__':
if sys.version_info[:3] < (2, 5, 0):
print >>sys.stderr, """\
E... | # -*- coding: utf-8 -*-
"""
Sphinx - Python documentation toolchain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2007 by Georg Brandl.
:license: Python license.
"""
import sys
if __name__ == '__main__':
if sys.version_info[:3] < (2, 5, 0):
print >>sys.stderr, """\
Error: Sphinx ne... | # -*- coding: utf-8 -*-
"""
Sphinx - Python documentation toolchain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2007 by Georg Brandl.
:license: Python license.
"""
import sys
if __name__ == '__main__':
if sys.version_info[:3] < (2, 5, 0):
print >>sys.stderr, """\
Error: Sphinx ne... | <commit_before># -*- coding: utf-8 -*-
"""
Sphinx - Python documentation toolchain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2007 by Georg Brandl.
:license: Python license.
"""
import sys
if __name__ == '__main__':
if sys.version_info[:3] < (2, 5, 0):
print >>sys.stderr, """\
E... |
f68e8612f1e8198a4b300b67536d654e13809eb4 | plinth/modules/monkeysphere/urls.py | plinth/modules/monkeysphere/urls.py | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | Allow SHA256 hashes in URLs | monkeysphere: Allow SHA256 hashes in URLs
| Python | agpl-3.0 | kkampardi/Plinth,harry-7/Plinth,harry-7/Plinth,freedomboxtwh/Plinth,harry-7/Plinth,freedomboxtwh/Plinth,freedomboxtwh/Plinth,harry-7/Plinth,kkampardi/Plinth,kkampardi/Plinth,vignanl/Plinth,vignanl/Plinth,vignanl/Plinth,freedomboxtwh/Plinth,kkampardi/Plinth,freedomboxtwh/Plinth,kkampardi/Plinth,vignanl/Plinth,vignanl/Pl... | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | <commit_before>#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This progra... | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | #
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | <commit_before>#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This progra... |
547c9e36255870bcee8a800a3fa95c3806a95c2c | newsApp/linkManager.py | newsApp/linkManager.py | import os
import time
from constants import *
from dbhelper import *
from dbItemManagerV2 import DbItemManagerV2
from link import Link
LINK_EXPIRY_TIME_IN_DAYS = 80
class LinkManager(DbItemManagerV2):
"""
Manage links stored on AWS dynamo db database.
Contains functions for CRUD operations on the links ... | import os
import time
from constants import *
from dbhelper import *
from dbItemManagerV2 import DbItemManagerV2
from link import Link
LINK_EXPIRY_TIME_IN_DAYS = 80
class LinkManager(DbItemManagerV2):
"""
Manage links stored on AWS dynamo db database.
Contains functions for CRUD operations on the links ... | Update links when it starts getting redirected | Update links when it starts getting redirected
| Python | mit | adityabansal/newsAroundMe,adityabansal/newsAroundMe,adityabansal/newsAroundMe | import os
import time
from constants import *
from dbhelper import *
from dbItemManagerV2 import DbItemManagerV2
from link import Link
LINK_EXPIRY_TIME_IN_DAYS = 80
class LinkManager(DbItemManagerV2):
"""
Manage links stored on AWS dynamo db database.
Contains functions for CRUD operations on the links ... | import os
import time
from constants import *
from dbhelper import *
from dbItemManagerV2 import DbItemManagerV2
from link import Link
LINK_EXPIRY_TIME_IN_DAYS = 80
class LinkManager(DbItemManagerV2):
"""
Manage links stored on AWS dynamo db database.
Contains functions for CRUD operations on the links ... | <commit_before>import os
import time
from constants import *
from dbhelper import *
from dbItemManagerV2 import DbItemManagerV2
from link import Link
LINK_EXPIRY_TIME_IN_DAYS = 80
class LinkManager(DbItemManagerV2):
"""
Manage links stored on AWS dynamo db database.
Contains functions for CRUD operation... | import os
import time
from constants import *
from dbhelper import *
from dbItemManagerV2 import DbItemManagerV2
from link import Link
LINK_EXPIRY_TIME_IN_DAYS = 80
class LinkManager(DbItemManagerV2):
"""
Manage links stored on AWS dynamo db database.
Contains functions for CRUD operations on the links ... | import os
import time
from constants import *
from dbhelper import *
from dbItemManagerV2 import DbItemManagerV2
from link import Link
LINK_EXPIRY_TIME_IN_DAYS = 80
class LinkManager(DbItemManagerV2):
"""
Manage links stored on AWS dynamo db database.
Contains functions for CRUD operations on the links ... | <commit_before>import os
import time
from constants import *
from dbhelper import *
from dbItemManagerV2 import DbItemManagerV2
from link import Link
LINK_EXPIRY_TIME_IN_DAYS = 80
class LinkManager(DbItemManagerV2):
"""
Manage links stored on AWS dynamo db database.
Contains functions for CRUD operation... |
366ecdd77520004c307cbbf127bb374ab546ce7e | run-quince.py | run-quince.py | #!/usr/bin/env python3
# coding: utf-8
# Raytheon BBN Technologies 2016
# Contributiors: Graham Rowlands
#
# This file runs the main loop
# Use PyQt5 by default
import os
os.environ["QT_API"] = 'pyqt5'
from qtpy.QtWidgets import QApplication
import sys
import argparse
from quince.view import *
if __name__ == "__mai... | #!/usr/bin/env python3
# coding: utf-8
# Raytheon BBN Technologies 2016
# Contributiors: Graham Rowlands
#
# This file runs the main loop
# Use PyQt5 by default
import os
os.environ["QT_API"] = 'pyqt5'
from qtpy.QtWidgets import QApplication
import sys
import argparse
import ctypes
from quince.view import *
if __na... | Use windows API to change the AppID and use our icon. | Use windows API to change the AppID and use our icon.
| Python | apache-2.0 | BBN-Q/Quince | #!/usr/bin/env python3
# coding: utf-8
# Raytheon BBN Technologies 2016
# Contributiors: Graham Rowlands
#
# This file runs the main loop
# Use PyQt5 by default
import os
os.environ["QT_API"] = 'pyqt5'
from qtpy.QtWidgets import QApplication
import sys
import argparse
from quince.view import *
if __name__ == "__mai... | #!/usr/bin/env python3
# coding: utf-8
# Raytheon BBN Technologies 2016
# Contributiors: Graham Rowlands
#
# This file runs the main loop
# Use PyQt5 by default
import os
os.environ["QT_API"] = 'pyqt5'
from qtpy.QtWidgets import QApplication
import sys
import argparse
import ctypes
from quince.view import *
if __na... | <commit_before>#!/usr/bin/env python3
# coding: utf-8
# Raytheon BBN Technologies 2016
# Contributiors: Graham Rowlands
#
# This file runs the main loop
# Use PyQt5 by default
import os
os.environ["QT_API"] = 'pyqt5'
from qtpy.QtWidgets import QApplication
import sys
import argparse
from quince.view import *
if __n... | #!/usr/bin/env python3
# coding: utf-8
# Raytheon BBN Technologies 2016
# Contributiors: Graham Rowlands
#
# This file runs the main loop
# Use PyQt5 by default
import os
os.environ["QT_API"] = 'pyqt5'
from qtpy.QtWidgets import QApplication
import sys
import argparse
import ctypes
from quince.view import *
if __na... | #!/usr/bin/env python3
# coding: utf-8
# Raytheon BBN Technologies 2016
# Contributiors: Graham Rowlands
#
# This file runs the main loop
# Use PyQt5 by default
import os
os.environ["QT_API"] = 'pyqt5'
from qtpy.QtWidgets import QApplication
import sys
import argparse
from quince.view import *
if __name__ == "__mai... | <commit_before>#!/usr/bin/env python3
# coding: utf-8
# Raytheon BBN Technologies 2016
# Contributiors: Graham Rowlands
#
# This file runs the main loop
# Use PyQt5 by default
import os
os.environ["QT_API"] = 'pyqt5'
from qtpy.QtWidgets import QApplication
import sys
import argparse
from quince.view import *
if __n... |
7b3f239964c6663a9b655553202567fccead85c8 | mollie/api/resources/profiles.py | mollie/api/resources/profiles.py | from ..error import IdentifierError
from ..objects.profile import Profile
from .base import Base
class Profiles(Base):
RESOURCE_ID_PREFIX = 'pfl_'
def get_resource_object(self, result):
return Profile(result, self.client)
def get(self, profile_id, **params):
if not profile_id or \
... | from ..error import IdentifierError
from ..objects.profile import Profile
from .base import Base
class Profiles(Base):
RESOURCE_ID_PREFIX = 'pfl_'
def get_resource_object(self, result):
return Profile(result, self.client)
def get(self, profile_id, **params):
if not profile_id or \
... | Add 'me' to profile IdentifierError | Add 'me' to profile IdentifierError
| Python | bsd-2-clause | mollie/mollie-api-python | from ..error import IdentifierError
from ..objects.profile import Profile
from .base import Base
class Profiles(Base):
RESOURCE_ID_PREFIX = 'pfl_'
def get_resource_object(self, result):
return Profile(result, self.client)
def get(self, profile_id, **params):
if not profile_id or \
... | from ..error import IdentifierError
from ..objects.profile import Profile
from .base import Base
class Profiles(Base):
RESOURCE_ID_PREFIX = 'pfl_'
def get_resource_object(self, result):
return Profile(result, self.client)
def get(self, profile_id, **params):
if not profile_id or \
... | <commit_before>from ..error import IdentifierError
from ..objects.profile import Profile
from .base import Base
class Profiles(Base):
RESOURCE_ID_PREFIX = 'pfl_'
def get_resource_object(self, result):
return Profile(result, self.client)
def get(self, profile_id, **params):
if not profile... | from ..error import IdentifierError
from ..objects.profile import Profile
from .base import Base
class Profiles(Base):
RESOURCE_ID_PREFIX = 'pfl_'
def get_resource_object(self, result):
return Profile(result, self.client)
def get(self, profile_id, **params):
if not profile_id or \
... | from ..error import IdentifierError
from ..objects.profile import Profile
from .base import Base
class Profiles(Base):
RESOURCE_ID_PREFIX = 'pfl_'
def get_resource_object(self, result):
return Profile(result, self.client)
def get(self, profile_id, **params):
if not profile_id or \
... | <commit_before>from ..error import IdentifierError
from ..objects.profile import Profile
from .base import Base
class Profiles(Base):
RESOURCE_ID_PREFIX = 'pfl_'
def get_resource_object(self, result):
return Profile(result, self.client)
def get(self, profile_id, **params):
if not profile... |
a2eae87fc76ba1e9fbfa8102c3e19c239445a62a | nazs/web/forms.py | nazs/web/forms.py | from achilles.forms import * # noqa
from nazs.models import SingletonModel
# Override forms template
Form.template_name = 'web/form.html'
class ModelForm(ModelForm):
def get_form(self, form_data=None, *args, **kwargs):
# manage SingletonModels
if issubclass(self.form_class.Meta.model, Singleto... | from achilles.forms import * # noqa
from nazs.models import SingletonModel
# Override forms template
Form.template_name = 'web/form.html'
class ModelForm(ModelForm):
def get_form(self, form_data=None, *args, **kwargs):
# manage SingletonModels
if issubclass(self.form_class.Meta.model, Singleto... | Fix form retrieval in ModelForm | Fix form retrieval in ModelForm
| Python | agpl-3.0 | exekias/droplet,exekias/droplet,exekias/droplet | from achilles.forms import * # noqa
from nazs.models import SingletonModel
# Override forms template
Form.template_name = 'web/form.html'
class ModelForm(ModelForm):
def get_form(self, form_data=None, *args, **kwargs):
# manage SingletonModels
if issubclass(self.form_class.Meta.model, Singleto... | from achilles.forms import * # noqa
from nazs.models import SingletonModel
# Override forms template
Form.template_name = 'web/form.html'
class ModelForm(ModelForm):
def get_form(self, form_data=None, *args, **kwargs):
# manage SingletonModels
if issubclass(self.form_class.Meta.model, Singleto... | <commit_before>from achilles.forms import * # noqa
from nazs.models import SingletonModel
# Override forms template
Form.template_name = 'web/form.html'
class ModelForm(ModelForm):
def get_form(self, form_data=None, *args, **kwargs):
# manage SingletonModels
if issubclass(self.form_class.Meta.... | from achilles.forms import * # noqa
from nazs.models import SingletonModel
# Override forms template
Form.template_name = 'web/form.html'
class ModelForm(ModelForm):
def get_form(self, form_data=None, *args, **kwargs):
# manage SingletonModels
if issubclass(self.form_class.Meta.model, Singleto... | from achilles.forms import * # noqa
from nazs.models import SingletonModel
# Override forms template
Form.template_name = 'web/form.html'
class ModelForm(ModelForm):
def get_form(self, form_data=None, *args, **kwargs):
# manage SingletonModels
if issubclass(self.form_class.Meta.model, Singleto... | <commit_before>from achilles.forms import * # noqa
from nazs.models import SingletonModel
# Override forms template
Form.template_name = 'web/form.html'
class ModelForm(ModelForm):
def get_form(self, form_data=None, *args, **kwargs):
# manage SingletonModels
if issubclass(self.form_class.Meta.... |
b6dff8fcd7dec56703006f2a7bcf1c8c72d0c21b | price_security/models/invoice.py | price_security/models/invoice.py | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import fields, models, api
class ac... | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import fields, models, api
class ac... | FIX price sec. related field as readonly | FIX price sec. related field as readonly
| Python | agpl-3.0 | ingadhoc/product,ingadhoc/product | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import fields, models, api
class ac... | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import fields, models, api
class ac... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import fields, models,... | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import fields, models, api
class ac... | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import fields, models, api
class ac... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import fields, models,... |
38de795103748ca757a03a62da8ef3d89b0bf682 | GoProController/models.py | GoProController/models.py | from django.db import models
class Camera(models.Model):
ssid = models.CharField(max_length=255)
password = models.CharField(max_length=255)
date_added = models.DateTimeField(auto_now_add=True)
last_attempt = models.DateTimeField(auto_now=True)
last_update = models.DateTimeField(null=True, blank=T... | from django.db import models
class Camera(models.Model):
ssid = models.CharField(max_length=255)
password = models.CharField(max_length=255)
date_added = models.DateTimeField(auto_now_add=True)
last_attempt = models.DateTimeField(auto_now=True)
last_update = models.DateTimeField(null=True, blank=T... | Fix bug that prevent commands with no values from being added | Fix bug that prevent commands with no values from being added
| Python | apache-2.0 | Nzaga/GoProController,joshvillbrandt/GoProController,Nzaga/GoProController,joshvillbrandt/GoProController | from django.db import models
class Camera(models.Model):
ssid = models.CharField(max_length=255)
password = models.CharField(max_length=255)
date_added = models.DateTimeField(auto_now_add=True)
last_attempt = models.DateTimeField(auto_now=True)
last_update = models.DateTimeField(null=True, blank=T... | from django.db import models
class Camera(models.Model):
ssid = models.CharField(max_length=255)
password = models.CharField(max_length=255)
date_added = models.DateTimeField(auto_now_add=True)
last_attempt = models.DateTimeField(auto_now=True)
last_update = models.DateTimeField(null=True, blank=T... | <commit_before>from django.db import models
class Camera(models.Model):
ssid = models.CharField(max_length=255)
password = models.CharField(max_length=255)
date_added = models.DateTimeField(auto_now_add=True)
last_attempt = models.DateTimeField(auto_now=True)
last_update = models.DateTimeField(nul... | from django.db import models
class Camera(models.Model):
ssid = models.CharField(max_length=255)
password = models.CharField(max_length=255)
date_added = models.DateTimeField(auto_now_add=True)
last_attempt = models.DateTimeField(auto_now=True)
last_update = models.DateTimeField(null=True, blank=T... | from django.db import models
class Camera(models.Model):
ssid = models.CharField(max_length=255)
password = models.CharField(max_length=255)
date_added = models.DateTimeField(auto_now_add=True)
last_attempt = models.DateTimeField(auto_now=True)
last_update = models.DateTimeField(null=True, blank=T... | <commit_before>from django.db import models
class Camera(models.Model):
ssid = models.CharField(max_length=255)
password = models.CharField(max_length=255)
date_added = models.DateTimeField(auto_now_add=True)
last_attempt = models.DateTimeField(auto_now=True)
last_update = models.DateTimeField(nul... |
caff96633ce29a2139bc61bb5ee333efd69d50ef | processmysteps/default_config.py | processmysteps/default_config.py | """
Base line settings
"""
CONFIG = {
'input_path': None,
'backup_path': None,
'dest_path': None,
'life_all': None,
'db': {
'host': None,
'port': None,
'name': None,
'user': None,
'pass': None
},
# 'preprocess': {
# 'max_acc': 30.0
# },
... | """
Base line settings
"""
CONFIG = {
'input_path': None,
'backup_path': None,
'dest_path': None,
'life_all': None,
'db': {
'host': None,
'port': None,
'name': None,
'user': None,
'pass': None
},
# 'preprocess': {
# 'max_acc': 30.0
# },
... | Remove default classifier path from default config | Remove default classifier path from default config
| Python | mit | ruipgil/ProcessMySteps,ruipgil/ProcessMySteps | """
Base line settings
"""
CONFIG = {
'input_path': None,
'backup_path': None,
'dest_path': None,
'life_all': None,
'db': {
'host': None,
'port': None,
'name': None,
'user': None,
'pass': None
},
# 'preprocess': {
# 'max_acc': 30.0
# },
... | """
Base line settings
"""
CONFIG = {
'input_path': None,
'backup_path': None,
'dest_path': None,
'life_all': None,
'db': {
'host': None,
'port': None,
'name': None,
'user': None,
'pass': None
},
# 'preprocess': {
# 'max_acc': 30.0
# },
... | <commit_before>"""
Base line settings
"""
CONFIG = {
'input_path': None,
'backup_path': None,
'dest_path': None,
'life_all': None,
'db': {
'host': None,
'port': None,
'name': None,
'user': None,
'pass': None
},
# 'preprocess': {
# 'max_acc': 3... | """
Base line settings
"""
CONFIG = {
'input_path': None,
'backup_path': None,
'dest_path': None,
'life_all': None,
'db': {
'host': None,
'port': None,
'name': None,
'user': None,
'pass': None
},
# 'preprocess': {
# 'max_acc': 30.0
# },
... | """
Base line settings
"""
CONFIG = {
'input_path': None,
'backup_path': None,
'dest_path': None,
'life_all': None,
'db': {
'host': None,
'port': None,
'name': None,
'user': None,
'pass': None
},
# 'preprocess': {
# 'max_acc': 30.0
# },
... | <commit_before>"""
Base line settings
"""
CONFIG = {
'input_path': None,
'backup_path': None,
'dest_path': None,
'life_all': None,
'db': {
'host': None,
'port': None,
'name': None,
'user': None,
'pass': None
},
# 'preprocess': {
# 'max_acc': 3... |
5f522cf58a1566513e874002bdaeb063e8a02497 | server/models/checkup.py | server/models/checkup.py | # -*- coding: utf-8 -*-
from datetime import datetime
from app import db
class Checkup(db.Model):
__tablename__ = 'checkup'
id = db.Column(db.Integer, primary_key=True)
created = db.Column(db.DateTime, default=datetime.utcnow)
repo_name = db.Column(db.String, unique=True) # github-user/repo-name
... | # -*- coding: utf-8 -*-
from datetime import datetime
from app import db
class Checkup(db.Model):
__tablename__ = 'checkup'
id = db.Column(db.Integer, primary_key=True)
created = db.Column(db.DateTime, default=datetime.utcnow)
# TODO: add one unique constraint on the column group of owner and repo
... | Update model and add TODO | Update model and add TODO
| Python | mit | harunurhan/repologist,harunurhan/repodoctor,harunurhan/repologist,harunurhan/repodoctor | # -*- coding: utf-8 -*-
from datetime import datetime
from app import db
class Checkup(db.Model):
__tablename__ = 'checkup'
id = db.Column(db.Integer, primary_key=True)
created = db.Column(db.DateTime, default=datetime.utcnow)
repo_name = db.Column(db.String, unique=True) # github-user/repo-name
... | # -*- coding: utf-8 -*-
from datetime import datetime
from app import db
class Checkup(db.Model):
__tablename__ = 'checkup'
id = db.Column(db.Integer, primary_key=True)
created = db.Column(db.DateTime, default=datetime.utcnow)
# TODO: add one unique constraint on the column group of owner and repo
... | <commit_before># -*- coding: utf-8 -*-
from datetime import datetime
from app import db
class Checkup(db.Model):
__tablename__ = 'checkup'
id = db.Column(db.Integer, primary_key=True)
created = db.Column(db.DateTime, default=datetime.utcnow)
repo_name = db.Column(db.String, unique=True) # github-use... | # -*- coding: utf-8 -*-
from datetime import datetime
from app import db
class Checkup(db.Model):
__tablename__ = 'checkup'
id = db.Column(db.Integer, primary_key=True)
created = db.Column(db.DateTime, default=datetime.utcnow)
# TODO: add one unique constraint on the column group of owner and repo
... | # -*- coding: utf-8 -*-
from datetime import datetime
from app import db
class Checkup(db.Model):
__tablename__ = 'checkup'
id = db.Column(db.Integer, primary_key=True)
created = db.Column(db.DateTime, default=datetime.utcnow)
repo_name = db.Column(db.String, unique=True) # github-user/repo-name
... | <commit_before># -*- coding: utf-8 -*-
from datetime import datetime
from app import db
class Checkup(db.Model):
__tablename__ = 'checkup'
id = db.Column(db.Integer, primary_key=True)
created = db.Column(db.DateTime, default=datetime.utcnow)
repo_name = db.Column(db.String, unique=True) # github-use... |
2e042201d6c0e0709d7056d399052389d1ea54b0 | shopify_auth/__init__.py | shopify_auth/__init__.py | import shopify
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
VERSION = (0, 1, 5)
__version__ = '.'.join(map(str, VERSION))
__author__ = 'Gavin Ballard'
def initialize():
if not settings.SHOPIFY_APP_API_KEY or not settings.SHOPIFY_APP_API_SECRET:
raise Imp... | VERSION = (0, 1, 6)
__version__ = '.'.join(map(str, VERSION))
__author__ = 'Gavin Ballard'
def initialize():
import shopify
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
if not settings.SHOPIFY_APP_API_KEY or not settings.SHOPIFY_APP_API_SECRET:
... | Move imports inside initialize() method so that we don’t break things on initial setup. | Move imports inside initialize() method so that we don’t break things on initial setup. | Python | mit | RafaAguilar/django-shopify-auth,discolabs/django-shopify-auth,RafaAguilar/django-shopify-auth,funkybob/django-shopify-auth,funkybob/django-shopify-auth,discolabs/django-shopify-auth | import shopify
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
VERSION = (0, 1, 5)
__version__ = '.'.join(map(str, VERSION))
__author__ = 'Gavin Ballard'
def initialize():
if not settings.SHOPIFY_APP_API_KEY or not settings.SHOPIFY_APP_API_SECRET:
raise Imp... | VERSION = (0, 1, 6)
__version__ = '.'.join(map(str, VERSION))
__author__ = 'Gavin Ballard'
def initialize():
import shopify
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
if not settings.SHOPIFY_APP_API_KEY or not settings.SHOPIFY_APP_API_SECRET:
... | <commit_before>import shopify
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
VERSION = (0, 1, 5)
__version__ = '.'.join(map(str, VERSION))
__author__ = 'Gavin Ballard'
def initialize():
if not settings.SHOPIFY_APP_API_KEY or not settings.SHOPIFY_APP_API_SECRET:
... | VERSION = (0, 1, 6)
__version__ = '.'.join(map(str, VERSION))
__author__ = 'Gavin Ballard'
def initialize():
import shopify
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
if not settings.SHOPIFY_APP_API_KEY or not settings.SHOPIFY_APP_API_SECRET:
... | import shopify
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
VERSION = (0, 1, 5)
__version__ = '.'.join(map(str, VERSION))
__author__ = 'Gavin Ballard'
def initialize():
if not settings.SHOPIFY_APP_API_KEY or not settings.SHOPIFY_APP_API_SECRET:
raise Imp... | <commit_before>import shopify
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
VERSION = (0, 1, 5)
__version__ = '.'.join(map(str, VERSION))
__author__ = 'Gavin Ballard'
def initialize():
if not settings.SHOPIFY_APP_API_KEY or not settings.SHOPIFY_APP_API_SECRET:
... |
3989abf6de879af6982a76ea3522f11f789c6569 | MarkovNetwork/_version.py | MarkovNetwork/_version.py | # -*- coding: utf-8 -*-
"""
Copyright 2016 Randal S. Olson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge... | # -*- coding: utf-8 -*-
"""
Copyright 2016 Randal S. Olson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge... | Increment version for speedup release | Increment version for speedup release | Python | mit | rhiever/MarkovNetwork,rhiever/MarkovNetwork | # -*- coding: utf-8 -*-
"""
Copyright 2016 Randal S. Olson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge... | # -*- coding: utf-8 -*-
"""
Copyright 2016 Randal S. Olson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge... | <commit_before># -*- coding: utf-8 -*-
"""
Copyright 2016 Randal S. Olson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy... | # -*- coding: utf-8 -*-
"""
Copyright 2016 Randal S. Olson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge... | # -*- coding: utf-8 -*-
"""
Copyright 2016 Randal S. Olson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge... | <commit_before># -*- coding: utf-8 -*-
"""
Copyright 2016 Randal S. Olson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy... |
f0e07f97fd43a0f54c8b0996944038a07e9a0e96 | metering/loader.py | metering/loader.py | """
metering.loader
~~~~~~~~~
Define the meter data models
"""
from nemreader import read_nem_file
from sqlalchemy.orm import sessionmaker
from energy_shaper import split_into_daily_intervals
from . import get_db_engine
from . import save_energy_reading
from . import refresh_daily_stats
from . import refre... | """
metering.loader
~~~~~~~~~
Define the meter data models
"""
import logging
from nemreader import read_nem_file
from sqlalchemy.orm import sessionmaker
from energy_shaper import split_into_daily_intervals
from . import get_db_engine
from . import save_energy_reading
from . import refresh_daily_stats
from... | Add error handling for when the meter name does not match the NEM file | Add error handling for when the meter name does not match the NEM file
| Python | agpl-3.0 | aguinane/energyusage,aguinane/energyusage,aguinane/energyusage,aguinane/energyusage | """
metering.loader
~~~~~~~~~
Define the meter data models
"""
from nemreader import read_nem_file
from sqlalchemy.orm import sessionmaker
from energy_shaper import split_into_daily_intervals
from . import get_db_engine
from . import save_energy_reading
from . import refresh_daily_stats
from . import refre... | """
metering.loader
~~~~~~~~~
Define the meter data models
"""
import logging
from nemreader import read_nem_file
from sqlalchemy.orm import sessionmaker
from energy_shaper import split_into_daily_intervals
from . import get_db_engine
from . import save_energy_reading
from . import refresh_daily_stats
from... | <commit_before>"""
metering.loader
~~~~~~~~~
Define the meter data models
"""
from nemreader import read_nem_file
from sqlalchemy.orm import sessionmaker
from energy_shaper import split_into_daily_intervals
from . import get_db_engine
from . import save_energy_reading
from . import refresh_daily_stats
from... | """
metering.loader
~~~~~~~~~
Define the meter data models
"""
import logging
from nemreader import read_nem_file
from sqlalchemy.orm import sessionmaker
from energy_shaper import split_into_daily_intervals
from . import get_db_engine
from . import save_energy_reading
from . import refresh_daily_stats
from... | """
metering.loader
~~~~~~~~~
Define the meter data models
"""
from nemreader import read_nem_file
from sqlalchemy.orm import sessionmaker
from energy_shaper import split_into_daily_intervals
from . import get_db_engine
from . import save_energy_reading
from . import refresh_daily_stats
from . import refre... | <commit_before>"""
metering.loader
~~~~~~~~~
Define the meter data models
"""
from nemreader import read_nem_file
from sqlalchemy.orm import sessionmaker
from energy_shaper import split_into_daily_intervals
from . import get_db_engine
from . import save_energy_reading
from . import refresh_daily_stats
from... |
8064be72de340fca963da2cade2b73aa969fbdbd | csunplugged/activities/models.py | csunplugged/activities/models.py | from django.db import models
class Activity(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
| from django.db import models
class Activity(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
def __str__(self):
return self.name
| Add string representation for Activity model | Add string representation for Activity model
| Python | mit | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | from django.db import models
class Activity(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
Add string representation for Activity model | from django.db import models
class Activity(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
def __str__(self):
return self.name
| <commit_before>from django.db import models
class Activity(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
<commit_msg>Add string representation for Activity model<commit_after> | from django.db import models
class Activity(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
def __str__(self):
return self.name
| from django.db import models
class Activity(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
Add string representation for Activity modelfrom django.db import models
class Activity(models.Model):
name = models.CharField(max_length=200)
description = models.TextFi... | <commit_before>from django.db import models
class Activity(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
<commit_msg>Add string representation for Activity model<commit_after>from django.db import models
class Activity(models.Model):
name = models.CharField(max_le... |
f20eb91dcf04bc8e33fbb48ebfbef1b56acbf02d | web.py | web.py | """ Heroku/Python Quickstart: https://blog.heroku.com/archives/2011/9/28/python_and_django"""
import os
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home_page():
return 'Hello from the SPARK learn-a-thon!'
if __name__ == '__main__':
port = int(os.environ.get("PORT", 5000))
app.run(h... | """ Heroku/Python Quickstart: https://blog.heroku.com/archives/2011/9/28/python_and_django"""
import os
import random
import requests
from flask import Flask
import tweepy
import settings
app = Flask(__name__)
@app.route('/')
def home_page():
return 'Hello from the SPARK learn-a-thon!'
def get_instagram_im... | Make functions that pull a number of tweets and pics | Make functions that pull a number of tweets and pics
| Python | apache-2.0 | samanehsan/spark_github,samanehsan/spark_github,samanehsan/learn-git,samanehsan/learn-git | """ Heroku/Python Quickstart: https://blog.heroku.com/archives/2011/9/28/python_and_django"""
import os
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home_page():
return 'Hello from the SPARK learn-a-thon!'
if __name__ == '__main__':
port = int(os.environ.get("PORT", 5000))
app.run(h... | """ Heroku/Python Quickstart: https://blog.heroku.com/archives/2011/9/28/python_and_django"""
import os
import random
import requests
from flask import Flask
import tweepy
import settings
app = Flask(__name__)
@app.route('/')
def home_page():
return 'Hello from the SPARK learn-a-thon!'
def get_instagram_im... | <commit_before>""" Heroku/Python Quickstart: https://blog.heroku.com/archives/2011/9/28/python_and_django"""
import os
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home_page():
return 'Hello from the SPARK learn-a-thon!'
if __name__ == '__main__':
port = int(os.environ.get("PORT", 5000)... | """ Heroku/Python Quickstart: https://blog.heroku.com/archives/2011/9/28/python_and_django"""
import os
import random
import requests
from flask import Flask
import tweepy
import settings
app = Flask(__name__)
@app.route('/')
def home_page():
return 'Hello from the SPARK learn-a-thon!'
def get_instagram_im... | """ Heroku/Python Quickstart: https://blog.heroku.com/archives/2011/9/28/python_and_django"""
import os
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home_page():
return 'Hello from the SPARK learn-a-thon!'
if __name__ == '__main__':
port = int(os.environ.get("PORT", 5000))
app.run(h... | <commit_before>""" Heroku/Python Quickstart: https://blog.heroku.com/archives/2011/9/28/python_and_django"""
import os
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home_page():
return 'Hello from the SPARK learn-a-thon!'
if __name__ == '__main__':
port = int(os.environ.get("PORT", 5000)... |
d9189f91370abd1e20e5010bb70d9c47efd58215 | muver/reference.py | muver/reference.py | from wrappers import bowtie2, picard, samtools
def create_reference_indices(ref_fn):
'''
For a given reference FASTA file, generate several indices.
'''
bowtie2.build(ref_fn)
samtools.faidx_index(ref_fn)
picard.create_sequence_dictionary(ref_fn)
def read_chrom_sizes(reference_ass... | import os
from wrappers import bowtie2, picard, samtools
def create_reference_indices(ref_fn):
'''
For a given reference FASTA file, generate several indices.
'''
bowtie2.build(ref_fn)
samtools.faidx_index(ref_fn)
picard.create_sequence_dictionary(ref_fn)
def read_chrom_sizes(... | Change read_chrom_sizes to read from a FAIDX index if available | Change read_chrom_sizes to read from a FAIDX index if available
| Python | mit | NIEHS/muver | from wrappers import bowtie2, picard, samtools
def create_reference_indices(ref_fn):
'''
For a given reference FASTA file, generate several indices.
'''
bowtie2.build(ref_fn)
samtools.faidx_index(ref_fn)
picard.create_sequence_dictionary(ref_fn)
def read_chrom_sizes(reference_ass... | import os
from wrappers import bowtie2, picard, samtools
def create_reference_indices(ref_fn):
'''
For a given reference FASTA file, generate several indices.
'''
bowtie2.build(ref_fn)
samtools.faidx_index(ref_fn)
picard.create_sequence_dictionary(ref_fn)
def read_chrom_sizes(... | <commit_before>from wrappers import bowtie2, picard, samtools
def create_reference_indices(ref_fn):
'''
For a given reference FASTA file, generate several indices.
'''
bowtie2.build(ref_fn)
samtools.faidx_index(ref_fn)
picard.create_sequence_dictionary(ref_fn)
def read_chrom_size... | import os
from wrappers import bowtie2, picard, samtools
def create_reference_indices(ref_fn):
'''
For a given reference FASTA file, generate several indices.
'''
bowtie2.build(ref_fn)
samtools.faidx_index(ref_fn)
picard.create_sequence_dictionary(ref_fn)
def read_chrom_sizes(... | from wrappers import bowtie2, picard, samtools
def create_reference_indices(ref_fn):
'''
For a given reference FASTA file, generate several indices.
'''
bowtie2.build(ref_fn)
samtools.faidx_index(ref_fn)
picard.create_sequence_dictionary(ref_fn)
def read_chrom_sizes(reference_ass... | <commit_before>from wrappers import bowtie2, picard, samtools
def create_reference_indices(ref_fn):
'''
For a given reference FASTA file, generate several indices.
'''
bowtie2.build(ref_fn)
samtools.faidx_index(ref_fn)
picard.create_sequence_dictionary(ref_fn)
def read_chrom_size... |
4657acf6408b2fb416e2c9577ac09d18d81f8a68 | nameless/config.py | nameless/config.py | import os
_basedir = os.path.abspath(os.path.dirname(__file__))
# Plugin settings
DATABASE_NAMES = ['atc', 'nhs', 'sms']
# Using sqlite for local development, will be SQL on production.
SQLALCHEMY_BINDS = {
'atc': 'sqlite:///' + os.path.join(_basedir, 'db/atc.db'),
'nhs': 'sqlite:///' + os.path.join(_basedir, '... | import os
_basedir = os.path.abspath(os.path.dirname(__file__))
# Plugin settings
DATABASE_NAMES = ['atc', 'sms']
# Using sqlite for local development, will be SQL on production.
SQLALCHEMY_BINDS = {
'atc': 'sqlite:///' + os.path.join(_basedir, 'db/atc.db'),
'sms': 'sqlite:///' + os.path.join(_basedir, 'db/sms.... | Remove unused NHS database mockup | Remove unused NHS database mockup
| Python | mit | jawrainey/sris | import os
_basedir = os.path.abspath(os.path.dirname(__file__))
# Plugin settings
DATABASE_NAMES = ['atc', 'nhs', 'sms']
# Using sqlite for local development, will be SQL on production.
SQLALCHEMY_BINDS = {
'atc': 'sqlite:///' + os.path.join(_basedir, 'db/atc.db'),
'nhs': 'sqlite:///' + os.path.join(_basedir, '... | import os
_basedir = os.path.abspath(os.path.dirname(__file__))
# Plugin settings
DATABASE_NAMES = ['atc', 'sms']
# Using sqlite for local development, will be SQL on production.
SQLALCHEMY_BINDS = {
'atc': 'sqlite:///' + os.path.join(_basedir, 'db/atc.db'),
'sms': 'sqlite:///' + os.path.join(_basedir, 'db/sms.... | <commit_before>import os
_basedir = os.path.abspath(os.path.dirname(__file__))
# Plugin settings
DATABASE_NAMES = ['atc', 'nhs', 'sms']
# Using sqlite for local development, will be SQL on production.
SQLALCHEMY_BINDS = {
'atc': 'sqlite:///' + os.path.join(_basedir, 'db/atc.db'),
'nhs': 'sqlite:///' + os.path.j... | import os
_basedir = os.path.abspath(os.path.dirname(__file__))
# Plugin settings
DATABASE_NAMES = ['atc', 'sms']
# Using sqlite for local development, will be SQL on production.
SQLALCHEMY_BINDS = {
'atc': 'sqlite:///' + os.path.join(_basedir, 'db/atc.db'),
'sms': 'sqlite:///' + os.path.join(_basedir, 'db/sms.... | import os
_basedir = os.path.abspath(os.path.dirname(__file__))
# Plugin settings
DATABASE_NAMES = ['atc', 'nhs', 'sms']
# Using sqlite for local development, will be SQL on production.
SQLALCHEMY_BINDS = {
'atc': 'sqlite:///' + os.path.join(_basedir, 'db/atc.db'),
'nhs': 'sqlite:///' + os.path.join(_basedir, '... | <commit_before>import os
_basedir = os.path.abspath(os.path.dirname(__file__))
# Plugin settings
DATABASE_NAMES = ['atc', 'nhs', 'sms']
# Using sqlite for local development, will be SQL on production.
SQLALCHEMY_BINDS = {
'atc': 'sqlite:///' + os.path.join(_basedir, 'db/atc.db'),
'nhs': 'sqlite:///' + os.path.j... |
d60dea7b7b1fb073eef2c350177b3920f32de748 | 6/e6.py | 6/e6.py | #!/usr/bin/env python
def sum_seq_squares(n):
return (n * (n+1) * ((2*n)+1)) / 6
def sum_seq(n):
return (n * (n + 1)) / 2
def main():
sum_seq_sq_100 = sum_seq_squares(100)
sum_seq_100 = sum_seq(100)
sq_sum_seq_100 = sum_seq_100**2
diff = sq_sum_seq_100 - sum_seq_sq_100
print('diff is {0}'.format(diff))
... | #!/usr/bin/env python
# http://www.proofwiki.org/wiki/Sum_of_Sequence_of_Squares
def sum_seq_squares(n):
return (n * (n+1) * ((2*n)+1)) / 6
# http://www.regentsprep.org/regents/math/algtrig/ATP2/ArithSeq.htm
def sum_seq(n):
return (n * (n + 1)) / 2
def main():
sum_seq_sq_100 = sum_seq_squares(100)
sum_seq_... | Add comments indicating source of formulae.. | Add comments indicating source of formulae..
| Python | mit | cveazey/ProjectEuler,cveazey/ProjectEuler | #!/usr/bin/env python
def sum_seq_squares(n):
return (n * (n+1) * ((2*n)+1)) / 6
def sum_seq(n):
return (n * (n + 1)) / 2
def main():
sum_seq_sq_100 = sum_seq_squares(100)
sum_seq_100 = sum_seq(100)
sq_sum_seq_100 = sum_seq_100**2
diff = sq_sum_seq_100 - sum_seq_sq_100
print('diff is {0}'.format(diff))
... | #!/usr/bin/env python
# http://www.proofwiki.org/wiki/Sum_of_Sequence_of_Squares
def sum_seq_squares(n):
return (n * (n+1) * ((2*n)+1)) / 6
# http://www.regentsprep.org/regents/math/algtrig/ATP2/ArithSeq.htm
def sum_seq(n):
return (n * (n + 1)) / 2
def main():
sum_seq_sq_100 = sum_seq_squares(100)
sum_seq_... | <commit_before>#!/usr/bin/env python
def sum_seq_squares(n):
return (n * (n+1) * ((2*n)+1)) / 6
def sum_seq(n):
return (n * (n + 1)) / 2
def main():
sum_seq_sq_100 = sum_seq_squares(100)
sum_seq_100 = sum_seq(100)
sq_sum_seq_100 = sum_seq_100**2
diff = sq_sum_seq_100 - sum_seq_sq_100
print('diff is {0}'... | #!/usr/bin/env python
# http://www.proofwiki.org/wiki/Sum_of_Sequence_of_Squares
def sum_seq_squares(n):
return (n * (n+1) * ((2*n)+1)) / 6
# http://www.regentsprep.org/regents/math/algtrig/ATP2/ArithSeq.htm
def sum_seq(n):
return (n * (n + 1)) / 2
def main():
sum_seq_sq_100 = sum_seq_squares(100)
sum_seq_... | #!/usr/bin/env python
def sum_seq_squares(n):
return (n * (n+1) * ((2*n)+1)) / 6
def sum_seq(n):
return (n * (n + 1)) / 2
def main():
sum_seq_sq_100 = sum_seq_squares(100)
sum_seq_100 = sum_seq(100)
sq_sum_seq_100 = sum_seq_100**2
diff = sq_sum_seq_100 - sum_seq_sq_100
print('diff is {0}'.format(diff))
... | <commit_before>#!/usr/bin/env python
def sum_seq_squares(n):
return (n * (n+1) * ((2*n)+1)) / 6
def sum_seq(n):
return (n * (n + 1)) / 2
def main():
sum_seq_sq_100 = sum_seq_squares(100)
sum_seq_100 = sum_seq(100)
sq_sum_seq_100 = sum_seq_100**2
diff = sq_sum_seq_100 - sum_seq_sq_100
print('diff is {0}'... |
91ff11cde50ce2485c0a6725651931f88a085ca7 | app.py | app.py | """ app.py """
from flask import Flask, render_template
import requests
app = Flask(__name__)
def get_time():
try:
response = requests.get('http://localhost:3001/time')
except requests.exceptions.ConnectionError:
return 'Unavailable'
return response.json().get('datetime')
def get_user... | """ app.py """
from flask import Flask, render_template
import requests
app = Flask(__name__)
def get_time():
try:
response = requests.get('http://localhost:3001/time', timeout=3.0)
except (requests.exceptions.ConnectionError,
requests.exceptions.Timeout):
return 'Unavailable'
... | Update get_time to handle timeout errors. | Update get_time to handle timeout errors.
| Python | mit | danriti/short-circuit,danriti/short-circuit | """ app.py """
from flask import Flask, render_template
import requests
app = Flask(__name__)
def get_time():
try:
response = requests.get('http://localhost:3001/time')
except requests.exceptions.ConnectionError:
return 'Unavailable'
return response.json().get('datetime')
def get_user... | """ app.py """
from flask import Flask, render_template
import requests
app = Flask(__name__)
def get_time():
try:
response = requests.get('http://localhost:3001/time', timeout=3.0)
except (requests.exceptions.ConnectionError,
requests.exceptions.Timeout):
return 'Unavailable'
... | <commit_before>""" app.py """
from flask import Flask, render_template
import requests
app = Flask(__name__)
def get_time():
try:
response = requests.get('http://localhost:3001/time')
except requests.exceptions.ConnectionError:
return 'Unavailable'
return response.json().get('datetime')... | """ app.py """
from flask import Flask, render_template
import requests
app = Flask(__name__)
def get_time():
try:
response = requests.get('http://localhost:3001/time', timeout=3.0)
except (requests.exceptions.ConnectionError,
requests.exceptions.Timeout):
return 'Unavailable'
... | """ app.py """
from flask import Flask, render_template
import requests
app = Flask(__name__)
def get_time():
try:
response = requests.get('http://localhost:3001/time')
except requests.exceptions.ConnectionError:
return 'Unavailable'
return response.json().get('datetime')
def get_user... | <commit_before>""" app.py """
from flask import Flask, render_template
import requests
app = Flask(__name__)
def get_time():
try:
response = requests.get('http://localhost:3001/time')
except requests.exceptions.ConnectionError:
return 'Unavailable'
return response.json().get('datetime')... |
e62db9661295ff3912dbaaaff0d9f267f0b7ffe1 | auth.py | auth.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bottle.ext import auth
from utils import conf
try:
auth_import = conf('auth')['engine'].split('.')[-1]
auth_from = u".".join(conf('auth')['engine'].split('.')[:-1])
auth_engine = getattr(__import__(auth_from, fromlist=[auth_import]),
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bottle.ext import auth
from utils import conf
try:
auth_import = conf('auth')['engine'].split('.')[-1]
auth_from = u".".join(conf('auth')['engine'].split('.')[:-1])
auth_engine = getattr(__import__(auth_from, fromlist=[auth_import]),
... | Add url callback on custom login | Add url callback on custom login
| Python | mit | AndrzejR/mining,mining/mining,mlgruby/mining,mining/mining,mlgruby/mining,mlgruby/mining,jgabriellima/mining,avelino/mining,jgabriellima/mining,seagoat/mining,chrisdamba/mining,seagoat/mining,avelino/mining,AndrzejR/mining,chrisdamba/mining | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bottle.ext import auth
from utils import conf
try:
auth_import = conf('auth')['engine'].split('.')[-1]
auth_from = u".".join(conf('auth')['engine'].split('.')[:-1])
auth_engine = getattr(__import__(auth_from, fromlist=[auth_import]),
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bottle.ext import auth
from utils import conf
try:
auth_import = conf('auth')['engine'].split('.')[-1]
auth_from = u".".join(conf('auth')['engine'].split('.')[:-1])
auth_engine = getattr(__import__(auth_from, fromlist=[auth_import]),
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bottle.ext import auth
from utils import conf
try:
auth_import = conf('auth')['engine'].split('.')[-1]
auth_from = u".".join(conf('auth')['engine'].split('.')[:-1])
auth_engine = getattr(__import__(auth_from, fromlist=[auth_import]),
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bottle.ext import auth
from utils import conf
try:
auth_import = conf('auth')['engine'].split('.')[-1]
auth_from = u".".join(conf('auth')['engine'].split('.')[:-1])
auth_engine = getattr(__import__(auth_from, fromlist=[auth_import]),
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bottle.ext import auth
from utils import conf
try:
auth_import = conf('auth')['engine'].split('.')[-1]
auth_from = u".".join(conf('auth')['engine'].split('.')[:-1])
auth_engine = getattr(__import__(auth_from, fromlist=[auth_import]),
... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bottle.ext import auth
from utils import conf
try:
auth_import = conf('auth')['engine'].split('.')[-1]
auth_from = u".".join(conf('auth')['engine'].split('.')[:-1])
auth_engine = getattr(__import__(auth_from, fromlist=[auth_import]),
... |
8157af3da0e535074b18c76f0e5391d8cac806e8 | whats_fresh/whats_fresh_api/tests/views/test_stories.py | whats_fresh/whats_fresh_api/tests/views/test_stories.py | from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from whats_fresh_api.models import *
from django.contrib.gis.db import models
import json
class StoriesTestCase(TestCase):
fixtures = ['whats_fresh_api/tests/testdata/test_fixtures.json']
def s... | from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from whats_fresh_api.models import *
from django.contrib.gis.db import models
import json
class StoriesTestCase(TestCase):
fixtures = ['whats_fresh_api/tests/testdata/test_fixtures.json']
def s... | Add error field to expected JSON | Add error field to expected JSON
| Python | apache-2.0 | osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api | from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from whats_fresh_api.models import *
from django.contrib.gis.db import models
import json
class StoriesTestCase(TestCase):
fixtures = ['whats_fresh_api/tests/testdata/test_fixtures.json']
def s... | from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from whats_fresh_api.models import *
from django.contrib.gis.db import models
import json
class StoriesTestCase(TestCase):
fixtures = ['whats_fresh_api/tests/testdata/test_fixtures.json']
def s... | <commit_before>from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from whats_fresh_api.models import *
from django.contrib.gis.db import models
import json
class StoriesTestCase(TestCase):
fixtures = ['whats_fresh_api/tests/testdata/test_fixtures.js... | from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from whats_fresh_api.models import *
from django.contrib.gis.db import models
import json
class StoriesTestCase(TestCase):
fixtures = ['whats_fresh_api/tests/testdata/test_fixtures.json']
def s... | from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from whats_fresh_api.models import *
from django.contrib.gis.db import models
import json
class StoriesTestCase(TestCase):
fixtures = ['whats_fresh_api/tests/testdata/test_fixtures.json']
def s... | <commit_before>from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from whats_fresh_api.models import *
from django.contrib.gis.db import models
import json
class StoriesTestCase(TestCase):
fixtures = ['whats_fresh_api/tests/testdata/test_fixtures.js... |
f2139cad673ee50f027164bda80d86979d5ce7a0 | passenger_wsgi.py | passenger_wsgi.py | import os
import sys
try:
from flask import Flask, render_template, send_file, Response
import requests
except ImportError:
INTERP = "venv/bin/python"
if os.path.relpath(sys.executable, os.getcwd()) != INTERP:
try:
os.execl(INTERP, INTERP, *sys.argv)
except OSError:
... | import os
import sys
try:
from flask import Flask
import flask_login
from flask_restless import APIManager
from flask_sqlalchemy import SQLAlchemy
import requests
except ImportError:
INTERP = "venv/bin/python"
if os.path.relpath(sys.executable, os.getcwd()) != INTERP:
try:
... | Add more imports for further functionality | Add more imports for further functionality
`flask_login`, `flask_restless`, `flask_sqlalchemy` | Python | mit | GregBrimble/boilerplate-web-service,GregBrimble/boilerplate-web-service | import os
import sys
try:
from flask import Flask, render_template, send_file, Response
import requests
except ImportError:
INTERP = "venv/bin/python"
if os.path.relpath(sys.executable, os.getcwd()) != INTERP:
try:
os.execl(INTERP, INTERP, *sys.argv)
except OSError:
... | import os
import sys
try:
from flask import Flask
import flask_login
from flask_restless import APIManager
from flask_sqlalchemy import SQLAlchemy
import requests
except ImportError:
INTERP = "venv/bin/python"
if os.path.relpath(sys.executable, os.getcwd()) != INTERP:
try:
... | <commit_before>import os
import sys
try:
from flask import Flask, render_template, send_file, Response
import requests
except ImportError:
INTERP = "venv/bin/python"
if os.path.relpath(sys.executable, os.getcwd()) != INTERP:
try:
os.execl(INTERP, INTERP, *sys.argv)
exce... | import os
import sys
try:
from flask import Flask
import flask_login
from flask_restless import APIManager
from flask_sqlalchemy import SQLAlchemy
import requests
except ImportError:
INTERP = "venv/bin/python"
if os.path.relpath(sys.executable, os.getcwd()) != INTERP:
try:
... | import os
import sys
try:
from flask import Flask, render_template, send_file, Response
import requests
except ImportError:
INTERP = "venv/bin/python"
if os.path.relpath(sys.executable, os.getcwd()) != INTERP:
try:
os.execl(INTERP, INTERP, *sys.argv)
except OSError:
... | <commit_before>import os
import sys
try:
from flask import Flask, render_template, send_file, Response
import requests
except ImportError:
INTERP = "venv/bin/python"
if os.path.relpath(sys.executable, os.getcwd()) != INTERP:
try:
os.execl(INTERP, INTERP, *sys.argv)
exce... |
abae242bbcdc3eefcd0ab1ff29f660f89d47db1a | mirigata/surprise/models.py | mirigata/surprise/models.py | from django.db import models
class Surprise(models.Model):
link = models.URLField(max_length=500)
description = models.TextField(max_length=1000)
| from django.core.urlresolvers import reverse
from django.db import models
class Surprise(models.Model):
link = models.URLField(max_length=500)
description = models.TextField(max_length=1000)
def get_absolute_url(self):
return reverse('surprise-detail', kwargs={"pk": self.id})
| Add absolute URL for Surprises | Add absolute URL for Surprises
This allows the CreateView to work correctly
| Python | agpl-3.0 | mirigata/mirigata,mirigata/mirigata,mirigata/mirigata,mirigata/mirigata | from django.db import models
class Surprise(models.Model):
link = models.URLField(max_length=500)
description = models.TextField(max_length=1000)
Add absolute URL for Surprises
This allows the CreateView to work correctly | from django.core.urlresolvers import reverse
from django.db import models
class Surprise(models.Model):
link = models.URLField(max_length=500)
description = models.TextField(max_length=1000)
def get_absolute_url(self):
return reverse('surprise-detail', kwargs={"pk": self.id})
| <commit_before>from django.db import models
class Surprise(models.Model):
link = models.URLField(max_length=500)
description = models.TextField(max_length=1000)
<commit_msg>Add absolute URL for Surprises
This allows the CreateView to work correctly<commit_after> | from django.core.urlresolvers import reverse
from django.db import models
class Surprise(models.Model):
link = models.URLField(max_length=500)
description = models.TextField(max_length=1000)
def get_absolute_url(self):
return reverse('surprise-detail', kwargs={"pk": self.id})
| from django.db import models
class Surprise(models.Model):
link = models.URLField(max_length=500)
description = models.TextField(max_length=1000)
Add absolute URL for Surprises
This allows the CreateView to work correctlyfrom django.core.urlresolvers import reverse
from django.db import models
class Surpri... | <commit_before>from django.db import models
class Surprise(models.Model):
link = models.URLField(max_length=500)
description = models.TextField(max_length=1000)
<commit_msg>Add absolute URL for Surprises
This allows the CreateView to work correctly<commit_after>from django.core.urlresolvers import reverse
fr... |
8b944f04ebf9b635029182a3137e9368edafe9d2 | pgsearch/utils.py | pgsearch/utils.py | from django.contrib.postgres.search import SearchVector, SearchRank, SearchQuery
import shlex
import string
def parseSearchString(search_string):
search_strings = shlex.split(search_string)
translator = str.maketrans({key: None for key in string.punctuation})
search_strings = [s.translate(translator) for ... | from django.contrib.postgres.search import SearchVector, SearchRank, SearchQuery
import shlex
import string
def parseSearchString(search_string):
try:
search_strings = shlex.split(search_string)
translator = str.maketrans({key: None for key in string.punctuation})
search_strings = [s.trans... | Handle exception for bad search strings | Handle exception for bad search strings
| Python | bsd-3-clause | groundupnews/gu,groundupnews/gu,groundupnews/gu,groundupnews/gu,groundupnews/gu | from django.contrib.postgres.search import SearchVector, SearchRank, SearchQuery
import shlex
import string
def parseSearchString(search_string):
search_strings = shlex.split(search_string)
translator = str.maketrans({key: None for key in string.punctuation})
search_strings = [s.translate(translator) for ... | from django.contrib.postgres.search import SearchVector, SearchRank, SearchQuery
import shlex
import string
def parseSearchString(search_string):
try:
search_strings = shlex.split(search_string)
translator = str.maketrans({key: None for key in string.punctuation})
search_strings = [s.trans... | <commit_before>from django.contrib.postgres.search import SearchVector, SearchRank, SearchQuery
import shlex
import string
def parseSearchString(search_string):
search_strings = shlex.split(search_string)
translator = str.maketrans({key: None for key in string.punctuation})
search_strings = [s.translate(t... | from django.contrib.postgres.search import SearchVector, SearchRank, SearchQuery
import shlex
import string
def parseSearchString(search_string):
try:
search_strings = shlex.split(search_string)
translator = str.maketrans({key: None for key in string.punctuation})
search_strings = [s.trans... | from django.contrib.postgres.search import SearchVector, SearchRank, SearchQuery
import shlex
import string
def parseSearchString(search_string):
search_strings = shlex.split(search_string)
translator = str.maketrans({key: None for key in string.punctuation})
search_strings = [s.translate(translator) for ... | <commit_before>from django.contrib.postgres.search import SearchVector, SearchRank, SearchQuery
import shlex
import string
def parseSearchString(search_string):
search_strings = shlex.split(search_string)
translator = str.maketrans({key: None for key in string.punctuation})
search_strings = [s.translate(t... |
b077df615eb4354f416877cc2857fb9848e158eb | saleor/core/templatetags/shop.py | saleor/core/templatetags/shop.py | from __future__ import unicode_literals
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
from django.template import Library
from django.utils.http import urlencode
register = Library()
@register.filter
def slice(items, group_size=1):
args = [... | from __future__ import unicode_literals
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
from django.template import Library
from django.utils.http import urlencode
register = Library()
@register.filter
def slice(items, group_size=1):
args = [... | Fix get_sort_by_toggle to work with QueryDicts with multiple values | Fix get_sort_by_toggle to work with QueryDicts with multiple values
| Python | bsd-3-clause | UITools/saleor,mociepka/saleor,mociepka/saleor,UITools/saleor,maferelo/saleor,maferelo/saleor,UITools/saleor,UITools/saleor,mociepka/saleor,maferelo/saleor,UITools/saleor | from __future__ import unicode_literals
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
from django.template import Library
from django.utils.http import urlencode
register = Library()
@register.filter
def slice(items, group_size=1):
args = [... | from __future__ import unicode_literals
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
from django.template import Library
from django.utils.http import urlencode
register = Library()
@register.filter
def slice(items, group_size=1):
args = [... | <commit_before>from __future__ import unicode_literals
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
from django.template import Library
from django.utils.http import urlencode
register = Library()
@register.filter
def slice(items, group_size=1... | from __future__ import unicode_literals
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
from django.template import Library
from django.utils.http import urlencode
register = Library()
@register.filter
def slice(items, group_size=1):
args = [... | from __future__ import unicode_literals
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
from django.template import Library
from django.utils.http import urlencode
register = Library()
@register.filter
def slice(items, group_size=1):
args = [... | <commit_before>from __future__ import unicode_literals
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
from django.template import Library
from django.utils.http import urlencode
register = Library()
@register.filter
def slice(items, group_size=1... |
7842919b2af368c640363b4e4e05144049b111ba | ovp_core/emails.py | ovp_core/emails.py | from django.core.mail import EmailMultiAlternatives
from django.template import Context, Template
from django.template.loader import get_template
from django.conf import settings
import threading
class EmailThread(threading.Thread):
def __init__(self, msg):
self.msg = msg
threading.Thread.__init__(sel... | from django.core.mail import EmailMultiAlternatives
from django.template import Context, Template
from django.template.loader import get_template
from django.conf import settings
import threading
class EmailThread(threading.Thread):
def __init__(self, msg):
self.msg = msg
threading.Thread.__init__(sel... | Remove BaseMail dependency on User object | Remove BaseMail dependency on User object
| Python | agpl-3.0 | OpenVolunteeringPlatform/django-ovp-core,OpenVolunteeringPlatform/django-ovp-core | from django.core.mail import EmailMultiAlternatives
from django.template import Context, Template
from django.template.loader import get_template
from django.conf import settings
import threading
class EmailThread(threading.Thread):
def __init__(self, msg):
self.msg = msg
threading.Thread.__init__(sel... | from django.core.mail import EmailMultiAlternatives
from django.template import Context, Template
from django.template.loader import get_template
from django.conf import settings
import threading
class EmailThread(threading.Thread):
def __init__(self, msg):
self.msg = msg
threading.Thread.__init__(sel... | <commit_before>from django.core.mail import EmailMultiAlternatives
from django.template import Context, Template
from django.template.loader import get_template
from django.conf import settings
import threading
class EmailThread(threading.Thread):
def __init__(self, msg):
self.msg = msg
threading.Thre... | from django.core.mail import EmailMultiAlternatives
from django.template import Context, Template
from django.template.loader import get_template
from django.conf import settings
import threading
class EmailThread(threading.Thread):
def __init__(self, msg):
self.msg = msg
threading.Thread.__init__(sel... | from django.core.mail import EmailMultiAlternatives
from django.template import Context, Template
from django.template.loader import get_template
from django.conf import settings
import threading
class EmailThread(threading.Thread):
def __init__(self, msg):
self.msg = msg
threading.Thread.__init__(sel... | <commit_before>from django.core.mail import EmailMultiAlternatives
from django.template import Context, Template
from django.template.loader import get_template
from django.conf import settings
import threading
class EmailThread(threading.Thread):
def __init__(self, msg):
self.msg = msg
threading.Thre... |
3c9de69112c8158877e4b0060ef0ab89c083f376 | packages/custom.py | packages/custom.py | # -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.packages import package
from cerbero.enums import License
class GStreamer:
url = "http://gstreamer.freedesktop.org"
version = '1.14.0'
vendor = 'GStreamer Project'
licenses = [License.LGPL]
org = 'org.freedesktop.gstreamer... | # -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.packages import package
from cerbero.enums import License
class GStreamer:
url = "http://gstreamer.freedesktop.org"
version = '1.14.0.1'
vendor = 'GStreamer Project'
licenses = [License.LGPL]
org = 'org.freedesktop.gstream... | Build 1.14.0.1 package for Windows | Build 1.14.0.1 package for Windows
| Python | lgpl-2.1 | GStreamer/cerbero,atsushieno/cerbero,centricular/cerbero,fluendo/cerbero,atsushieno/cerbero,nirbheek/cerbero,fluendo/cerbero,centricular/cerbero,centricular/cerbero,GStreamer/cerbero,fluendo/cerbero,atsushieno/cerbero,fluendo/cerbero,nirbheek/cerbero,centricular/cerbero,GStreamer/cerbero,atsushieno/cerbero,atsushieno/c... | # -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.packages import package
from cerbero.enums import License
class GStreamer:
url = "http://gstreamer.freedesktop.org"
version = '1.14.0'
vendor = 'GStreamer Project'
licenses = [License.LGPL]
org = 'org.freedesktop.gstreamer... | # -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.packages import package
from cerbero.enums import License
class GStreamer:
url = "http://gstreamer.freedesktop.org"
version = '1.14.0.1'
vendor = 'GStreamer Project'
licenses = [License.LGPL]
org = 'org.freedesktop.gstream... | <commit_before># -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.packages import package
from cerbero.enums import License
class GStreamer:
url = "http://gstreamer.freedesktop.org"
version = '1.14.0'
vendor = 'GStreamer Project'
licenses = [License.LGPL]
org = 'org.freede... | # -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.packages import package
from cerbero.enums import License
class GStreamer:
url = "http://gstreamer.freedesktop.org"
version = '1.14.0.1'
vendor = 'GStreamer Project'
licenses = [License.LGPL]
org = 'org.freedesktop.gstream... | # -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.packages import package
from cerbero.enums import License
class GStreamer:
url = "http://gstreamer.freedesktop.org"
version = '1.14.0'
vendor = 'GStreamer Project'
licenses = [License.LGPL]
org = 'org.freedesktop.gstreamer... | <commit_before># -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.packages import package
from cerbero.enums import License
class GStreamer:
url = "http://gstreamer.freedesktop.org"
version = '1.14.0'
vendor = 'GStreamer Project'
licenses = [License.LGPL]
org = 'org.freede... |
2652919c8d2e6fad8f7b3d47f5e82528b4b5214e | plots/monotone.py | plots/monotone.py |
# MONOTONE
# Produce a monotonically decreasing output plot from noisy data
# Input: columns: t x
# Output: columns: t_i x_i , sampled such that x_i <= x_j
# for j > i.
from string import *
import sys
# Set PYTHONPATH=$PWD
from plottools import *
if len(sys.argv) != 3:
abort("usage:... |
# MONOTONE
# Produce a monotonically decreasing output plot from noisy data
# Input: columns: t x
# Output: columns: t_i x_i , sampled such that x_i <= x_j
# for j > i.
from string import *
import sys
# Set PYTHONPATH=$PWD
from plottools import *
if len(sys.argv) != 3:
abort("usage:... | Write the last point for plot completeness | Write the last point for plot completeness
| Python | mit | ECP-CANDLE/Database,ECP-CANDLE/Database |
# MONOTONE
# Produce a monotonically decreasing output plot from noisy data
# Input: columns: t x
# Output: columns: t_i x_i , sampled such that x_i <= x_j
# for j > i.
from string import *
import sys
# Set PYTHONPATH=$PWD
from plottools import *
if len(sys.argv) != 3:
abort("usage:... |
# MONOTONE
# Produce a monotonically decreasing output plot from noisy data
# Input: columns: t x
# Output: columns: t_i x_i , sampled such that x_i <= x_j
# for j > i.
from string import *
import sys
# Set PYTHONPATH=$PWD
from plottools import *
if len(sys.argv) != 3:
abort("usage:... | <commit_before>
# MONOTONE
# Produce a monotonically decreasing output plot from noisy data
# Input: columns: t x
# Output: columns: t_i x_i , sampled such that x_i <= x_j
# for j > i.
from string import *
import sys
# Set PYTHONPATH=$PWD
from plottools import *
if len(sys.argv) != 3:
... |
# MONOTONE
# Produce a monotonically decreasing output plot from noisy data
# Input: columns: t x
# Output: columns: t_i x_i , sampled such that x_i <= x_j
# for j > i.
from string import *
import sys
# Set PYTHONPATH=$PWD
from plottools import *
if len(sys.argv) != 3:
abort("usage:... |
# MONOTONE
# Produce a monotonically decreasing output plot from noisy data
# Input: columns: t x
# Output: columns: t_i x_i , sampled such that x_i <= x_j
# for j > i.
from string import *
import sys
# Set PYTHONPATH=$PWD
from plottools import *
if len(sys.argv) != 3:
abort("usage:... | <commit_before>
# MONOTONE
# Produce a monotonically decreasing output plot from noisy data
# Input: columns: t x
# Output: columns: t_i x_i , sampled such that x_i <= x_j
# for j > i.
from string import *
import sys
# Set PYTHONPATH=$PWD
from plottools import *
if len(sys.argv) != 3:
... |
4c66010cf0cd4f763b362b6e84eb67d7ef1278b8 | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jack Brewer
# Copyright (c) 2015 Jack Brewer
#
# License: MIT
"""This module exports the Stylint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class Stylint(NodeLinter):
"""Provides an inte... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jack Brewer
# Copyright (c) 2015 Jack Brewer
#
# License: MIT
"""This module exports the Stylint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class Stylint(NodeLinter):
"""Provides an inte... | Make "near" group optional in regex | Make "near" group optional in regex
Some errors output with a column number. For these, the `near` group should match.
```
1:2 semicolons error unnecessary semicolon found
```
But some won't. For these, the `near` match should be optional.
```
1 sortOrder error prefer alphabetical when sorting properties
... | Python | mit | jackbrewer/SublimeLinter-contrib-stylint | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jack Brewer
# Copyright (c) 2015 Jack Brewer
#
# License: MIT
"""This module exports the Stylint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class Stylint(NodeLinter):
"""Provides an inte... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jack Brewer
# Copyright (c) 2015 Jack Brewer
#
# License: MIT
"""This module exports the Stylint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class Stylint(NodeLinter):
"""Provides an inte... | <commit_before>#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jack Brewer
# Copyright (c) 2015 Jack Brewer
#
# License: MIT
"""This module exports the Stylint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class Stylint(NodeLinter):
"""P... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jack Brewer
# Copyright (c) 2015 Jack Brewer
#
# License: MIT
"""This module exports the Stylint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class Stylint(NodeLinter):
"""Provides an inte... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jack Brewer
# Copyright (c) 2015 Jack Brewer
#
# License: MIT
"""This module exports the Stylint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class Stylint(NodeLinter):
"""Provides an inte... | <commit_before>#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jack Brewer
# Copyright (c) 2015 Jack Brewer
#
# License: MIT
"""This module exports the Stylint plugin class."""
from SublimeLinter.lint import NodeLinter, util
class Stylint(NodeLinter):
"""P... |
3fbbba8dae5c97cedf414eea8a39482c01a269e6 | main.py | main.py |
import io
import json
import logging
import os
import pdb
import traceback
from logging import config
from functools import wraps
from flask import (
Flask,
render_template,
request,
send_file,
send_from_directory,
)
app = Flask(__name__)
config.fileConfig('logger.conf')
logger = logging.getLo... |
import io
import json
import logging
import os
import pdb
import traceback
from logging import config
from functools import wraps
from flask import (
Flask,
render_template,
request,
send_file,
send_from_directory,
)
app = Flask(__name__)
config.fileConfig('logger.conf')
logger = logging.getLo... | Add `debug=True` to avoid restarting the server after each change | Add `debug=True` to avoid restarting the server after each change
| Python | mit | danoneata/video_annotation,danoneata/video_annotation,danoneata/video_annotation |
import io
import json
import logging
import os
import pdb
import traceback
from logging import config
from functools import wraps
from flask import (
Flask,
render_template,
request,
send_file,
send_from_directory,
)
app = Flask(__name__)
config.fileConfig('logger.conf')
logger = logging.getLo... |
import io
import json
import logging
import os
import pdb
import traceback
from logging import config
from functools import wraps
from flask import (
Flask,
render_template,
request,
send_file,
send_from_directory,
)
app = Flask(__name__)
config.fileConfig('logger.conf')
logger = logging.getLo... | <commit_before>
import io
import json
import logging
import os
import pdb
import traceback
from logging import config
from functools import wraps
from flask import (
Flask,
render_template,
request,
send_file,
send_from_directory,
)
app = Flask(__name__)
config.fileConfig('logger.conf')
logger ... |
import io
import json
import logging
import os
import pdb
import traceback
from logging import config
from functools import wraps
from flask import (
Flask,
render_template,
request,
send_file,
send_from_directory,
)
app = Flask(__name__)
config.fileConfig('logger.conf')
logger = logging.getLo... |
import io
import json
import logging
import os
import pdb
import traceback
from logging import config
from functools import wraps
from flask import (
Flask,
render_template,
request,
send_file,
send_from_directory,
)
app = Flask(__name__)
config.fileConfig('logger.conf')
logger = logging.getLo... | <commit_before>
import io
import json
import logging
import os
import pdb
import traceback
from logging import config
from functools import wraps
from flask import (
Flask,
render_template,
request,
send_file,
send_from_directory,
)
app = Flask(__name__)
config.fileConfig('logger.conf')
logger ... |
7119c07b422f823f40939691fa84f0c2581ae70d | test/unit/helpers/test_qiprofile_helper.py | test/unit/helpers/test_qiprofile_helper.py | import datetime
import pytz
from nose.tools import (assert_is_none)
from qipipe.helpers.qiprofile_helper import QIProfile
from qiprofile.models import Project
from test import project
from test.helpers.logging_helper import logger
SUBJECT = 'Breast099'
"""The test subject."""
SESSION = 'Session01'
"""The test sessio... | import datetime
import pytz
from nose.tools import (assert_is_none)
from qipipe.helpers.qiprofile_helper import QIProfile
from qiprofile_rest.models import Project
from test import project
from test.helpers.logging_helper import logger
SUBJECT = 'Breast099'
"""The test subject."""
SESSION = 'Session01'
"""The test s... | Fix the REST module name. | Fix the REST module name.
| Python | bsd-2-clause | ohsu-qin/qipipe | import datetime
import pytz
from nose.tools import (assert_is_none)
from qipipe.helpers.qiprofile_helper import QIProfile
from qiprofile.models import Project
from test import project
from test.helpers.logging_helper import logger
SUBJECT = 'Breast099'
"""The test subject."""
SESSION = 'Session01'
"""The test sessio... | import datetime
import pytz
from nose.tools import (assert_is_none)
from qipipe.helpers.qiprofile_helper import QIProfile
from qiprofile_rest.models import Project
from test import project
from test.helpers.logging_helper import logger
SUBJECT = 'Breast099'
"""The test subject."""
SESSION = 'Session01'
"""The test s... | <commit_before>import datetime
import pytz
from nose.tools import (assert_is_none)
from qipipe.helpers.qiprofile_helper import QIProfile
from qiprofile.models import Project
from test import project
from test.helpers.logging_helper import logger
SUBJECT = 'Breast099'
"""The test subject."""
SESSION = 'Session01'
"""... | import datetime
import pytz
from nose.tools import (assert_is_none)
from qipipe.helpers.qiprofile_helper import QIProfile
from qiprofile_rest.models import Project
from test import project
from test.helpers.logging_helper import logger
SUBJECT = 'Breast099'
"""The test subject."""
SESSION = 'Session01'
"""The test s... | import datetime
import pytz
from nose.tools import (assert_is_none)
from qipipe.helpers.qiprofile_helper import QIProfile
from qiprofile.models import Project
from test import project
from test.helpers.logging_helper import logger
SUBJECT = 'Breast099'
"""The test subject."""
SESSION = 'Session01'
"""The test sessio... | <commit_before>import datetime
import pytz
from nose.tools import (assert_is_none)
from qipipe.helpers.qiprofile_helper import QIProfile
from qiprofile.models import Project
from test import project
from test.helpers.logging_helper import logger
SUBJECT = 'Breast099'
"""The test subject."""
SESSION = 'Session01'
"""... |
a3923263a100dd39772533aa37ea7ff956e6c874 | manage.py | manage.py | # -*- coding: utf-8 -*-
from flask.ext.script import Manager, Server
from yoyo import create_app
manager = Manager(create_app)
manager.add_option('-c', '--configfile', dest='configfile', required=False)
if __name__ == '__main__':
manager.run()
| # -*- coding: utf-8 -*-
from flask.ext.script import Manager, Server
from yoyo import create_app
manager = Manager(create_app)
manager.add_option('-c', '--configfile', dest='configfile', required=False)
manager.add_command('runserver', Server(
use_debugger = True,
use_reloader = True,
host = '0.0.0.0',
... | Make app accessible outside the development machine. | Make app accessible outside the development machine. | Python | mit | jaapverloop/massa | # -*- coding: utf-8 -*-
from flask.ext.script import Manager, Server
from yoyo import create_app
manager = Manager(create_app)
manager.add_option('-c', '--configfile', dest='configfile', required=False)
if __name__ == '__main__':
manager.run()
Make app accessible outside the development machine. | # -*- coding: utf-8 -*-
from flask.ext.script import Manager, Server
from yoyo import create_app
manager = Manager(create_app)
manager.add_option('-c', '--configfile', dest='configfile', required=False)
manager.add_command('runserver', Server(
use_debugger = True,
use_reloader = True,
host = '0.0.0.0',
... | <commit_before># -*- coding: utf-8 -*-
from flask.ext.script import Manager, Server
from yoyo import create_app
manager = Manager(create_app)
manager.add_option('-c', '--configfile', dest='configfile', required=False)
if __name__ == '__main__':
manager.run()
<commit_msg>Make app accessible outside the developme... | # -*- coding: utf-8 -*-
from flask.ext.script import Manager, Server
from yoyo import create_app
manager = Manager(create_app)
manager.add_option('-c', '--configfile', dest='configfile', required=False)
manager.add_command('runserver', Server(
use_debugger = True,
use_reloader = True,
host = '0.0.0.0',
... | # -*- coding: utf-8 -*-
from flask.ext.script import Manager, Server
from yoyo import create_app
manager = Manager(create_app)
manager.add_option('-c', '--configfile', dest='configfile', required=False)
if __name__ == '__main__':
manager.run()
Make app accessible outside the development machine.# -*- coding: ut... | <commit_before># -*- coding: utf-8 -*-
from flask.ext.script import Manager, Server
from yoyo import create_app
manager = Manager(create_app)
manager.add_option('-c', '--configfile', dest='configfile', required=False)
if __name__ == '__main__':
manager.run()
<commit_msg>Make app accessible outside the developme... |
08b54819a56d9bfc65225045d97a4c331f9a3e11 | manage.py | manage.py | #!/usr/bin/env python3
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from service import app, db
# db.create_all() needs all models to be imported
from service.db_access import *
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
if _... | #!/usr/bin/env python3
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from service import app, db
# db.create_all() needs all models to be imported explicitly (not *)
from service.db_access import User
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', ... | Fix model import needed by create_all() | Fix model import needed by create_all()
| Python | mit | LandRegistry/login-api,LandRegistry/login-api | #!/usr/bin/env python3
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from service import app, db
# db.create_all() needs all models to be imported
from service.db_access import *
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
if _... | #!/usr/bin/env python3
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from service import app, db
# db.create_all() needs all models to be imported explicitly (not *)
from service.db_access import User
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', ... | <commit_before>#!/usr/bin/env python3
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from service import app, db
# db.create_all() needs all models to be imported
from service.db_access import *
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', Migrate... | #!/usr/bin/env python3
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from service import app, db
# db.create_all() needs all models to be imported explicitly (not *)
from service.db_access import User
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', ... | #!/usr/bin/env python3
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from service import app, db
# db.create_all() needs all models to be imported
from service.db_access import *
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
if _... | <commit_before>#!/usr/bin/env python3
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from service import app, db
# db.create_all() needs all models to be imported
from service.db_access import *
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', Migrate... |
a3ad91928f7d4753204a2443237c7f720fed37f1 | inselect/gui/sort_document_items.py | inselect/gui/sort_document_items.py | from PySide.QtCore import QSettings
from inselect.lib.sort_document_items import sort_document_items
# QSettings path
_PATH = 'sort_by_columns'
# Global - set to instance of CookieCutterChoice in cookie_cutter_boxes
_SORT_DOCUMENT = None
def sort_items_choice():
"Returns an instance of SortDocumentItems"
g... | from PySide.QtCore import QSettings
from inselect.lib.sort_document_items import sort_document_items
# QSettings path
_PATH = 'sort_by_columns'
# Global - set to instance of CookieCutterChoice in cookie_cutter_boxes
_SORT_DOCUMENT = None
def sort_items_choice():
"Returns an instance of SortDocumentItems"
g... | Fix persistence of 'sort by' preference on Windows | Fix persistence of 'sort by' preference on Windows
| Python | bsd-3-clause | NaturalHistoryMuseum/inselect,NaturalHistoryMuseum/inselect | from PySide.QtCore import QSettings
from inselect.lib.sort_document_items import sort_document_items
# QSettings path
_PATH = 'sort_by_columns'
# Global - set to instance of CookieCutterChoice in cookie_cutter_boxes
_SORT_DOCUMENT = None
def sort_items_choice():
"Returns an instance of SortDocumentItems"
g... | from PySide.QtCore import QSettings
from inselect.lib.sort_document_items import sort_document_items
# QSettings path
_PATH = 'sort_by_columns'
# Global - set to instance of CookieCutterChoice in cookie_cutter_boxes
_SORT_DOCUMENT = None
def sort_items_choice():
"Returns an instance of SortDocumentItems"
g... | <commit_before>from PySide.QtCore import QSettings
from inselect.lib.sort_document_items import sort_document_items
# QSettings path
_PATH = 'sort_by_columns'
# Global - set to instance of CookieCutterChoice in cookie_cutter_boxes
_SORT_DOCUMENT = None
def sort_items_choice():
"Returns an instance of SortDocum... | from PySide.QtCore import QSettings
from inselect.lib.sort_document_items import sort_document_items
# QSettings path
_PATH = 'sort_by_columns'
# Global - set to instance of CookieCutterChoice in cookie_cutter_boxes
_SORT_DOCUMENT = None
def sort_items_choice():
"Returns an instance of SortDocumentItems"
g... | from PySide.QtCore import QSettings
from inselect.lib.sort_document_items import sort_document_items
# QSettings path
_PATH = 'sort_by_columns'
# Global - set to instance of CookieCutterChoice in cookie_cutter_boxes
_SORT_DOCUMENT = None
def sort_items_choice():
"Returns an instance of SortDocumentItems"
g... | <commit_before>from PySide.QtCore import QSettings
from inselect.lib.sort_document_items import sort_document_items
# QSettings path
_PATH = 'sort_by_columns'
# Global - set to instance of CookieCutterChoice in cookie_cutter_boxes
_SORT_DOCUMENT = None
def sort_items_choice():
"Returns an instance of SortDocum... |
783f7a5d17b3db83e1f27ad3bebb4c165c4e66ca | django_settings/keymaker.py | django_settings/keymaker.py | class KeyMaker(object):
def __init__(self, prefix):
self.prefix = prefix
def convert(self, arg):
return str(arg)
def args_to_key(self, args):
return ":".join(map(self.convert, args))
def kwargs_to_key(self, kwargs):
return ":".join([
"%s:%s" % (self.convert... | import sys
class KeyMaker(object):
def __init__(self, prefix):
self.prefix = prefix
def convert(self, arg):
if sys.version_info < (3,) and isinstance(arg, unicode):
return arg.encode(django.settings.DEFAULT_CHARSET)
return str(arg)
def args_to_key(self, args):
... | Fix convert to support python 2 and python 3 | Fix convert to support python 2 and python 3
| Python | bsd-3-clause | jrutila/django-settings,jrutila/django-settings,jrutila/django-settings,jrutila/django-settings | class KeyMaker(object):
def __init__(self, prefix):
self.prefix = prefix
def convert(self, arg):
return str(arg)
def args_to_key(self, args):
return ":".join(map(self.convert, args))
def kwargs_to_key(self, kwargs):
return ":".join([
"%s:%s" % (self.convert... | import sys
class KeyMaker(object):
def __init__(self, prefix):
self.prefix = prefix
def convert(self, arg):
if sys.version_info < (3,) and isinstance(arg, unicode):
return arg.encode(django.settings.DEFAULT_CHARSET)
return str(arg)
def args_to_key(self, args):
... | <commit_before>class KeyMaker(object):
def __init__(self, prefix):
self.prefix = prefix
def convert(self, arg):
return str(arg)
def args_to_key(self, args):
return ":".join(map(self.convert, args))
def kwargs_to_key(self, kwargs):
return ":".join([
"%s:%s" ... | import sys
class KeyMaker(object):
def __init__(self, prefix):
self.prefix = prefix
def convert(self, arg):
if sys.version_info < (3,) and isinstance(arg, unicode):
return arg.encode(django.settings.DEFAULT_CHARSET)
return str(arg)
def args_to_key(self, args):
... | class KeyMaker(object):
def __init__(self, prefix):
self.prefix = prefix
def convert(self, arg):
return str(arg)
def args_to_key(self, args):
return ":".join(map(self.convert, args))
def kwargs_to_key(self, kwargs):
return ":".join([
"%s:%s" % (self.convert... | <commit_before>class KeyMaker(object):
def __init__(self, prefix):
self.prefix = prefix
def convert(self, arg):
return str(arg)
def args_to_key(self, args):
return ":".join(map(self.convert, args))
def kwargs_to_key(self, kwargs):
return ":".join([
"%s:%s" ... |
f8eb93f1845a7776c61a59bafc6fdeb689712aff | examples/comp/ask_user_dialog.py | examples/comp/ask_user_dialog.py | """Example showing the Ask User dialog controls and overall usage."""
import fusionless as fu
dialog = fu.AskUserDialog()
dialog.add_text("text", default="Default text value")
dialog.add_position("position", default=(0.2, 0.8))
dialog.add_slider("slider", default=0.5, min=-10, max=10)
dialog.add_screw("screw")
dialog... | """Example showing the Ask User dialog controls and overall usage."""
import fusionless as fu
dialog = fu.AskUserDialog("Example Ask User Dialog")
dialog.add_text("text", default="Default text value")
dialog.add_position("position", default=(0.2, 0.8))
dialog.add_slider("slider", default=0.5, min=-10, max=10)
dialog.... | Add dialog title to example | Add dialog title to example
| Python | bsd-3-clause | BigRoy/fusionless,BigRoy/fusionscript | """Example showing the Ask User dialog controls and overall usage."""
import fusionless as fu
dialog = fu.AskUserDialog()
dialog.add_text("text", default="Default text value")
dialog.add_position("position", default=(0.2, 0.8))
dialog.add_slider("slider", default=0.5, min=-10, max=10)
dialog.add_screw("screw")
dialog... | """Example showing the Ask User dialog controls and overall usage."""
import fusionless as fu
dialog = fu.AskUserDialog("Example Ask User Dialog")
dialog.add_text("text", default="Default text value")
dialog.add_position("position", default=(0.2, 0.8))
dialog.add_slider("slider", default=0.5, min=-10, max=10)
dialog.... | <commit_before>"""Example showing the Ask User dialog controls and overall usage."""
import fusionless as fu
dialog = fu.AskUserDialog()
dialog.add_text("text", default="Default text value")
dialog.add_position("position", default=(0.2, 0.8))
dialog.add_slider("slider", default=0.5, min=-10, max=10)
dialog.add_screw(... | """Example showing the Ask User dialog controls and overall usage."""
import fusionless as fu
dialog = fu.AskUserDialog("Example Ask User Dialog")
dialog.add_text("text", default="Default text value")
dialog.add_position("position", default=(0.2, 0.8))
dialog.add_slider("slider", default=0.5, min=-10, max=10)
dialog.... | """Example showing the Ask User dialog controls and overall usage."""
import fusionless as fu
dialog = fu.AskUserDialog()
dialog.add_text("text", default="Default text value")
dialog.add_position("position", default=(0.2, 0.8))
dialog.add_slider("slider", default=0.5, min=-10, max=10)
dialog.add_screw("screw")
dialog... | <commit_before>"""Example showing the Ask User dialog controls and overall usage."""
import fusionless as fu
dialog = fu.AskUserDialog()
dialog.add_text("text", default="Default text value")
dialog.add_position("position", default=(0.2, 0.8))
dialog.add_slider("slider", default=0.5, min=-10, max=10)
dialog.add_screw(... |
c5ccf36fbeb6b744918e3090422763103b181de8 | tests/test_tripleStandardize.py | tests/test_tripleStandardize.py | import json
from ppp_nlp_classical import Triple, TriplesBucket, computeTree, simplify, buildBucket, DependenciesTree, tripleProduce1, tripleProduce2, tripleProduce3, buildTree
from ppp_datamodel import Triple, Resource, Missing
import data
from unittest import TestCase
class StandardTripleTests(TestCase):
def ... | import json
from ppp_nlp_classical import Triple, TriplesBucket, computeTree, simplify, buildBucket, DependenciesTree, tripleProduce1, tripleProduce2, tripleProduce3, buildTree
from ppp_datamodel import Triple, Resource, Missing
import data
from unittest import TestCase
class StandardTripleTests(TestCase):
def ... | Fix name (copy paste fail...) | Fix name (copy paste fail...)
| Python | agpl-3.0 | ProjetPP/PPP-QuestionParsing-Grammatical,ProjetPP/PPP-QuestionParsing-Grammatical | import json
from ppp_nlp_classical import Triple, TriplesBucket, computeTree, simplify, buildBucket, DependenciesTree, tripleProduce1, tripleProduce2, tripleProduce3, buildTree
from ppp_datamodel import Triple, Resource, Missing
import data
from unittest import TestCase
class StandardTripleTests(TestCase):
def ... | import json
from ppp_nlp_classical import Triple, TriplesBucket, computeTree, simplify, buildBucket, DependenciesTree, tripleProduce1, tripleProduce2, tripleProduce3, buildTree
from ppp_datamodel import Triple, Resource, Missing
import data
from unittest import TestCase
class StandardTripleTests(TestCase):
def ... | <commit_before>import json
from ppp_nlp_classical import Triple, TriplesBucket, computeTree, simplify, buildBucket, DependenciesTree, tripleProduce1, tripleProduce2, tripleProduce3, buildTree
from ppp_datamodel import Triple, Resource, Missing
import data
from unittest import TestCase
class StandardTripleTests(TestC... | import json
from ppp_nlp_classical import Triple, TriplesBucket, computeTree, simplify, buildBucket, DependenciesTree, tripleProduce1, tripleProduce2, tripleProduce3, buildTree
from ppp_datamodel import Triple, Resource, Missing
import data
from unittest import TestCase
class StandardTripleTests(TestCase):
def ... | import json
from ppp_nlp_classical import Triple, TriplesBucket, computeTree, simplify, buildBucket, DependenciesTree, tripleProduce1, tripleProduce2, tripleProduce3, buildTree
from ppp_datamodel import Triple, Resource, Missing
import data
from unittest import TestCase
class StandardTripleTests(TestCase):
def ... | <commit_before>import json
from ppp_nlp_classical import Triple, TriplesBucket, computeTree, simplify, buildBucket, DependenciesTree, tripleProduce1, tripleProduce2, tripleProduce3, buildTree
from ppp_datamodel import Triple, Resource, Missing
import data
from unittest import TestCase
class StandardTripleTests(TestC... |
818d89c897603eeb33caf1ca2cdaeae5c3010880 | engines/mako_engine.py | engines/mako_engine.py | #!/usr/bin/env python
"""Provide the mako templating engine."""
from __future__ import print_function
from mako.template import Template
from mako.lookup import TemplateLookup
from . import Engine
class MakoEngine(Engine):
"""Mako templating engine."""
handle = 'mako'
def __init__(self, template, t... | #!/usr/bin/env python
"""Provide the mako templating engine."""
from __future__ import print_function
from mako.template import Template
from mako.lookup import TemplateLookup
from . import Engine
class MakoEngine(Engine):
"""Mako templating engine."""
handle = 'mako'
def __init__(self, template, d... | Use passed directory in mako engine. | Use passed directory in mako engine.
| Python | mit | blubberdiblub/eztemplate | #!/usr/bin/env python
"""Provide the mako templating engine."""
from __future__ import print_function
from mako.template import Template
from mako.lookup import TemplateLookup
from . import Engine
class MakoEngine(Engine):
"""Mako templating engine."""
handle = 'mako'
def __init__(self, template, t... | #!/usr/bin/env python
"""Provide the mako templating engine."""
from __future__ import print_function
from mako.template import Template
from mako.lookup import TemplateLookup
from . import Engine
class MakoEngine(Engine):
"""Mako templating engine."""
handle = 'mako'
def __init__(self, template, d... | <commit_before>#!/usr/bin/env python
"""Provide the mako templating engine."""
from __future__ import print_function
from mako.template import Template
from mako.lookup import TemplateLookup
from . import Engine
class MakoEngine(Engine):
"""Mako templating engine."""
handle = 'mako'
def __init__(se... | #!/usr/bin/env python
"""Provide the mako templating engine."""
from __future__ import print_function
from mako.template import Template
from mako.lookup import TemplateLookup
from . import Engine
class MakoEngine(Engine):
"""Mako templating engine."""
handle = 'mako'
def __init__(self, template, d... | #!/usr/bin/env python
"""Provide the mako templating engine."""
from __future__ import print_function
from mako.template import Template
from mako.lookup import TemplateLookup
from . import Engine
class MakoEngine(Engine):
"""Mako templating engine."""
handle = 'mako'
def __init__(self, template, t... | <commit_before>#!/usr/bin/env python
"""Provide the mako templating engine."""
from __future__ import print_function
from mako.template import Template
from mako.lookup import TemplateLookup
from . import Engine
class MakoEngine(Engine):
"""Mako templating engine."""
handle = 'mako'
def __init__(se... |
04c3cac3054626773bc0434453378cb295f7e38c | pytus2000/read.py | pytus2000/read.py | import pandas as pd
from .datadicts import diary
def read_diary_file(path_to_file):
return pd.read_csv(
path_to_file,
delimiter='\t',
nrows=50,
converters=_column_name_to_type_mapping(diary),
low_memory=False # some columns seem to have mixed types
)
def _column_name... | import pandas as pd
from .datadicts import diary
def read_diary_file(path_to_file):
return pd.read_csv(
path_to_file,
delimiter='\t',
converters=_column_name_to_type_mapping(diary),
low_memory=False # some columns seem to have mixed types
)
def _column_name_to_type_mapping(m... | Add handling of invalid values | Add handling of invalid values
Values that are not defined in the data dictionary will be replaced by None.
| Python | mit | timtroendle/pytus2000 | import pandas as pd
from .datadicts import diary
def read_diary_file(path_to_file):
return pd.read_csv(
path_to_file,
delimiter='\t',
nrows=50,
converters=_column_name_to_type_mapping(diary),
low_memory=False # some columns seem to have mixed types
)
def _column_name... | import pandas as pd
from .datadicts import diary
def read_diary_file(path_to_file):
return pd.read_csv(
path_to_file,
delimiter='\t',
converters=_column_name_to_type_mapping(diary),
low_memory=False # some columns seem to have mixed types
)
def _column_name_to_type_mapping(m... | <commit_before>import pandas as pd
from .datadicts import diary
def read_diary_file(path_to_file):
return pd.read_csv(
path_to_file,
delimiter='\t',
nrows=50,
converters=_column_name_to_type_mapping(diary),
low_memory=False # some columns seem to have mixed types
)
d... | import pandas as pd
from .datadicts import diary
def read_diary_file(path_to_file):
return pd.read_csv(
path_to_file,
delimiter='\t',
converters=_column_name_to_type_mapping(diary),
low_memory=False # some columns seem to have mixed types
)
def _column_name_to_type_mapping(m... | import pandas as pd
from .datadicts import diary
def read_diary_file(path_to_file):
return pd.read_csv(
path_to_file,
delimiter='\t',
nrows=50,
converters=_column_name_to_type_mapping(diary),
low_memory=False # some columns seem to have mixed types
)
def _column_name... | <commit_before>import pandas as pd
from .datadicts import diary
def read_diary_file(path_to_file):
return pd.read_csv(
path_to_file,
delimiter='\t',
nrows=50,
converters=_column_name_to_type_mapping(diary),
low_memory=False # some columns seem to have mixed types
)
d... |
826f23f0fc7eea4c72dcc26f637f3752bee51b47 | test/ctypesgentest.py | test/ctypesgentest.py | import optparse, sys, StringIO
sys.path.append("..")
import ctypesgencore
"""ctypesgentest is a simple module for testing ctypesgen on various C constructs. It consists of a
single function, test(). test() takes a string that represents a C header file, along with some
keyword arguments representing options. It proces... | import optparse, sys, StringIO
sys.path.append(".") # Allow tests to be called from parent directory with Python 2.6
sys.path.append("..")
import ctypesgencore
"""ctypesgentest is a simple module for testing ctypesgen on various C constructs. It consists of a
single function, test(). test() takes a string that repres... | Allow tests to be called from parent directory of "test" | Allow tests to be called from parent directory of "test"
git-svn-id: 397be6d5b34b040010577acc149a81bea378be26@89 1754e6c4-832e-0410-bb55-0fb906f63d99
| Python | bsd-3-clause | kanzure/ctypesgen,kanzure/ctypesgen,novas0x2a/ctypesgen,davidjamesca/ctypesgen,kanzure/ctypesgen | import optparse, sys, StringIO
sys.path.append("..")
import ctypesgencore
"""ctypesgentest is a simple module for testing ctypesgen on various C constructs. It consists of a
single function, test(). test() takes a string that represents a C header file, along with some
keyword arguments representing options. It proces... | import optparse, sys, StringIO
sys.path.append(".") # Allow tests to be called from parent directory with Python 2.6
sys.path.append("..")
import ctypesgencore
"""ctypesgentest is a simple module for testing ctypesgen on various C constructs. It consists of a
single function, test(). test() takes a string that repres... | <commit_before>import optparse, sys, StringIO
sys.path.append("..")
import ctypesgencore
"""ctypesgentest is a simple module for testing ctypesgen on various C constructs. It consists of a
single function, test(). test() takes a string that represents a C header file, along with some
keyword arguments representing opt... | import optparse, sys, StringIO
sys.path.append(".") # Allow tests to be called from parent directory with Python 2.6
sys.path.append("..")
import ctypesgencore
"""ctypesgentest is a simple module for testing ctypesgen on various C constructs. It consists of a
single function, test(). test() takes a string that repres... | import optparse, sys, StringIO
sys.path.append("..")
import ctypesgencore
"""ctypesgentest is a simple module for testing ctypesgen on various C constructs. It consists of a
single function, test(). test() takes a string that represents a C header file, along with some
keyword arguments representing options. It proces... | <commit_before>import optparse, sys, StringIO
sys.path.append("..")
import ctypesgencore
"""ctypesgentest is a simple module for testing ctypesgen on various C constructs. It consists of a
single function, test(). test() takes a string that represents a C header file, along with some
keyword arguments representing opt... |
69eafa95df4bdeb143d40c321f0a312d06efff1f | skimage/segmentation/__init__.py | skimage/segmentation/__init__.py | from .random_walker_segmentation import random_walker
from ._felzenszwalb import felzenszwalb
from ._slic import slic
from ._quickshift import quickshift
from .boundaries import find_boundaries, visualize_boundaries, mark_boundaries
from ._clear_border import clear_border
from ._join import join_segmentations, relabel_... | from .random_walker_segmentation import random_walker
from ._felzenszwalb import felzenszwalb
from ._slic import slic
from ._quickshift import quickshift
from .boundaries import find_boundaries, visualize_boundaries, mark_boundaries
from ._clear_border import clear_border
from ._join import join_segmentations, relabel_... | Add __all__ to segmentation package | Add __all__ to segmentation package
| Python | bsd-3-clause | Midafi/scikit-image,pratapvardhan/scikit-image,michaelaye/scikit-image,bsipocz/scikit-image,blink1073/scikit-image,robintw/scikit-image,oew1v07/scikit-image,Britefury/scikit-image,chriscrosscutler/scikit-image,Hiyorimi/scikit-image,vighneshbirodkar/scikit-image,paalge/scikit-image,newville/scikit-image,ajaybhat/scikit-... | from .random_walker_segmentation import random_walker
from ._felzenszwalb import felzenszwalb
from ._slic import slic
from ._quickshift import quickshift
from .boundaries import find_boundaries, visualize_boundaries, mark_boundaries
from ._clear_border import clear_border
from ._join import join_segmentations, relabel_... | from .random_walker_segmentation import random_walker
from ._felzenszwalb import felzenszwalb
from ._slic import slic
from ._quickshift import quickshift
from .boundaries import find_boundaries, visualize_boundaries, mark_boundaries
from ._clear_border import clear_border
from ._join import join_segmentations, relabel_... | <commit_before>from .random_walker_segmentation import random_walker
from ._felzenszwalb import felzenszwalb
from ._slic import slic
from ._quickshift import quickshift
from .boundaries import find_boundaries, visualize_boundaries, mark_boundaries
from ._clear_border import clear_border
from ._join import join_segmenta... | from .random_walker_segmentation import random_walker
from ._felzenszwalb import felzenszwalb
from ._slic import slic
from ._quickshift import quickshift
from .boundaries import find_boundaries, visualize_boundaries, mark_boundaries
from ._clear_border import clear_border
from ._join import join_segmentations, relabel_... | from .random_walker_segmentation import random_walker
from ._felzenszwalb import felzenszwalb
from ._slic import slic
from ._quickshift import quickshift
from .boundaries import find_boundaries, visualize_boundaries, mark_boundaries
from ._clear_border import clear_border
from ._join import join_segmentations, relabel_... | <commit_before>from .random_walker_segmentation import random_walker
from ._felzenszwalb import felzenszwalb
from ._slic import slic
from ._quickshift import quickshift
from .boundaries import find_boundaries, visualize_boundaries, mark_boundaries
from ._clear_border import clear_border
from ._join import join_segmenta... |
d59f3259875ffac49668ffb3ce34ca511385ebb7 | rated/settings.py | rated/settings.py |
from django.conf import settings
DEFAULT_REALM = getattr(settings, 'RATED_DEFAULT_REALM', 'default')
DEFAULT_LIMIT = getattr(settings, 'RATED_DEFAULT_LIMIT', 100)
DEFAULT_DURATION = getattr(settings, 'RATED_DEFAULT_DURATION', 60 * 60)
RESPONSE_CODE = getattr(settings, 'RATED_RESPONSE_CODE', 429)
RESPONSE_MESSAGE = g... |
from django.conf import settings
DEFAULT_REALM = getattr(settings, 'RATED_DEFAULT_REALM', 'default')
DEFAULT_LIMIT = getattr(settings, 'RATED_DEFAULT_LIMIT', 100)
DEFAULT_DURATION = getattr(settings, 'RATED_DEFAULT_DURATION', 60 * 60)
RESPONSE_CODE = getattr(settings, 'RATED_RESPONSE_CODE', 429)
RESPONSE_MESSAGE = g... | Fix USE_X_FORWARDED_FOR for proxied environments | Fix USE_X_FORWARDED_FOR for proxied environments
The settings for USE_X_FORWARDED_FOR were not being respected because the settings were not being passed through. | Python | bsd-3-clause | funkybob/django-rated |
from django.conf import settings
DEFAULT_REALM = getattr(settings, 'RATED_DEFAULT_REALM', 'default')
DEFAULT_LIMIT = getattr(settings, 'RATED_DEFAULT_LIMIT', 100)
DEFAULT_DURATION = getattr(settings, 'RATED_DEFAULT_DURATION', 60 * 60)
RESPONSE_CODE = getattr(settings, 'RATED_RESPONSE_CODE', 429)
RESPONSE_MESSAGE = g... |
from django.conf import settings
DEFAULT_REALM = getattr(settings, 'RATED_DEFAULT_REALM', 'default')
DEFAULT_LIMIT = getattr(settings, 'RATED_DEFAULT_LIMIT', 100)
DEFAULT_DURATION = getattr(settings, 'RATED_DEFAULT_DURATION', 60 * 60)
RESPONSE_CODE = getattr(settings, 'RATED_RESPONSE_CODE', 429)
RESPONSE_MESSAGE = g... | <commit_before>
from django.conf import settings
DEFAULT_REALM = getattr(settings, 'RATED_DEFAULT_REALM', 'default')
DEFAULT_LIMIT = getattr(settings, 'RATED_DEFAULT_LIMIT', 100)
DEFAULT_DURATION = getattr(settings, 'RATED_DEFAULT_DURATION', 60 * 60)
RESPONSE_CODE = getattr(settings, 'RATED_RESPONSE_CODE', 429)
RESPO... |
from django.conf import settings
DEFAULT_REALM = getattr(settings, 'RATED_DEFAULT_REALM', 'default')
DEFAULT_LIMIT = getattr(settings, 'RATED_DEFAULT_LIMIT', 100)
DEFAULT_DURATION = getattr(settings, 'RATED_DEFAULT_DURATION', 60 * 60)
RESPONSE_CODE = getattr(settings, 'RATED_RESPONSE_CODE', 429)
RESPONSE_MESSAGE = g... |
from django.conf import settings
DEFAULT_REALM = getattr(settings, 'RATED_DEFAULT_REALM', 'default')
DEFAULT_LIMIT = getattr(settings, 'RATED_DEFAULT_LIMIT', 100)
DEFAULT_DURATION = getattr(settings, 'RATED_DEFAULT_DURATION', 60 * 60)
RESPONSE_CODE = getattr(settings, 'RATED_RESPONSE_CODE', 429)
RESPONSE_MESSAGE = g... | <commit_before>
from django.conf import settings
DEFAULT_REALM = getattr(settings, 'RATED_DEFAULT_REALM', 'default')
DEFAULT_LIMIT = getattr(settings, 'RATED_DEFAULT_LIMIT', 100)
DEFAULT_DURATION = getattr(settings, 'RATED_DEFAULT_DURATION', 60 * 60)
RESPONSE_CODE = getattr(settings, 'RATED_RESPONSE_CODE', 429)
RESPO... |
c1ae43fd33cd0f8eb3e270907a8ed7e728d1e268 | server.py | server.py | import evdev
import requests
import json
import datetime
import yaml
def main():
config = load_config()
dev = evdev.InputDevice(config['device_path'])
output_line('Initialized - Capturing device: ' + str(dev))
for event in dev.read_loop():
if event.type == evdev.ecodes.EV_KEY:
event = evdev.categor... | import evdev
import requests
import json
import datetime
import yaml
def main():
config = load_config()
dev = evdev.InputDevice(config['device_path'])
output_line('Initialized - Capturing device: ' + str(dev))
for event in dev.read_loop():
if event.type == evdev.ecodes.EV_KEY:
output_line(event)
... | Add captured_at timestamp to POST payload | Add captured_at timestamp to POST payload
Timestamp is in ISO 8601 format
| Python | mit | nicolas-fricke/keypost | import evdev
import requests
import json
import datetime
import yaml
def main():
config = load_config()
dev = evdev.InputDevice(config['device_path'])
output_line('Initialized - Capturing device: ' + str(dev))
for event in dev.read_loop():
if event.type == evdev.ecodes.EV_KEY:
event = evdev.categor... | import evdev
import requests
import json
import datetime
import yaml
def main():
config = load_config()
dev = evdev.InputDevice(config['device_path'])
output_line('Initialized - Capturing device: ' + str(dev))
for event in dev.read_loop():
if event.type == evdev.ecodes.EV_KEY:
output_line(event)
... | <commit_before>import evdev
import requests
import json
import datetime
import yaml
def main():
config = load_config()
dev = evdev.InputDevice(config['device_path'])
output_line('Initialized - Capturing device: ' + str(dev))
for event in dev.read_loop():
if event.type == evdev.ecodes.EV_KEY:
event ... | import evdev
import requests
import json
import datetime
import yaml
def main():
config = load_config()
dev = evdev.InputDevice(config['device_path'])
output_line('Initialized - Capturing device: ' + str(dev))
for event in dev.read_loop():
if event.type == evdev.ecodes.EV_KEY:
output_line(event)
... | import evdev
import requests
import json
import datetime
import yaml
def main():
config = load_config()
dev = evdev.InputDevice(config['device_path'])
output_line('Initialized - Capturing device: ' + str(dev))
for event in dev.read_loop():
if event.type == evdev.ecodes.EV_KEY:
event = evdev.categor... | <commit_before>import evdev
import requests
import json
import datetime
import yaml
def main():
config = load_config()
dev = evdev.InputDevice(config['device_path'])
output_line('Initialized - Capturing device: ' + str(dev))
for event in dev.read_loop():
if event.type == evdev.ecodes.EV_KEY:
event ... |
4c5550420b8a9f1bf88f4329952f6e2a161cd20f | test/test_panels/test_navigation.py | test/test_panels/test_navigation.py | from pyqode.core.api import TextHelper
from pyqode.qt.QtTest import QTest
def test_toggle_button(editor):
editor.file.open('test/files/example.json')
editor.show()
TextHelper(editor).goto_line(6)
QTest.qWait(500)
panel = editor.panels.get('NavigationPanel')
assert len(panel._widgets) == 4
... | from pyqode.core.api import TextHelper
from pyqode.qt.QtTest import QTest
def test_toggle_button(editor):
editor.file.open('test/files/example.json')
editor.show()
TextHelper(editor).goto_line(6)
QTest.qWait(500)
panel = editor.panels.get('NavigationPanel')
assert len(panel._widgets) == 4
... | Fix test on kaos with latest qt5 | Fix test on kaos with latest qt5
| Python | mit | pyQode/pyqode.json,pyQode/pyqode.json | from pyqode.core.api import TextHelper
from pyqode.qt.QtTest import QTest
def test_toggle_button(editor):
editor.file.open('test/files/example.json')
editor.show()
TextHelper(editor).goto_line(6)
QTest.qWait(500)
panel = editor.panels.get('NavigationPanel')
assert len(panel._widgets) == 4
... | from pyqode.core.api import TextHelper
from pyqode.qt.QtTest import QTest
def test_toggle_button(editor):
editor.file.open('test/files/example.json')
editor.show()
TextHelper(editor).goto_line(6)
QTest.qWait(500)
panel = editor.panels.get('NavigationPanel')
assert len(panel._widgets) == 4
... | <commit_before>from pyqode.core.api import TextHelper
from pyqode.qt.QtTest import QTest
def test_toggle_button(editor):
editor.file.open('test/files/example.json')
editor.show()
TextHelper(editor).goto_line(6)
QTest.qWait(500)
panel = editor.panels.get('NavigationPanel')
assert len(panel._wid... | from pyqode.core.api import TextHelper
from pyqode.qt.QtTest import QTest
def test_toggle_button(editor):
editor.file.open('test/files/example.json')
editor.show()
TextHelper(editor).goto_line(6)
QTest.qWait(500)
panel = editor.panels.get('NavigationPanel')
assert len(panel._widgets) == 4
... | from pyqode.core.api import TextHelper
from pyqode.qt.QtTest import QTest
def test_toggle_button(editor):
editor.file.open('test/files/example.json')
editor.show()
TextHelper(editor).goto_line(6)
QTest.qWait(500)
panel = editor.panels.get('NavigationPanel')
assert len(panel._widgets) == 4
... | <commit_before>from pyqode.core.api import TextHelper
from pyqode.qt.QtTest import QTest
def test_toggle_button(editor):
editor.file.open('test/files/example.json')
editor.show()
TextHelper(editor).goto_line(6)
QTest.qWait(500)
panel = editor.panels.get('NavigationPanel')
assert len(panel._wid... |
8e6662a4aaf654ddf18c1c4e733c58db5b9b5579 | opps/channels/context_processors.py | opps/channels/context_processors.py | # -*- coding: utf-8 -*-
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import get_current_site
from .models import Channel
def channel_context(request):
""" Channel context processors
"""
site = get_current_site(request)
opps_menu = Channel.objects... | # -*- coding: utf-8 -*-
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import get_current_site
from django.core.cache import cache
from .models import Channel
def channel_context(request):
""" Channel context processors
"""
site = get_current_site(requ... | Add cache in opps menu list via context processors | Add cache in opps menu list via context processors
| Python | mit | YACOWS/opps,opps/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,opps/opps,williamroot/opps,jeanmask/opps,williamroot/opps,YACOWS/opps,williamroot/opps,YACOWS/opps,opps/opps,jeanmask/opps,opps/opps,williamroot/opps | # -*- coding: utf-8 -*-
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import get_current_site
from .models import Channel
def channel_context(request):
""" Channel context processors
"""
site = get_current_site(request)
opps_menu = Channel.objects... | # -*- coding: utf-8 -*-
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import get_current_site
from django.core.cache import cache
from .models import Channel
def channel_context(request):
""" Channel context processors
"""
site = get_current_site(requ... | <commit_before># -*- coding: utf-8 -*-
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import get_current_site
from .models import Channel
def channel_context(request):
""" Channel context processors
"""
site = get_current_site(request)
opps_menu = ... | # -*- coding: utf-8 -*-
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import get_current_site
from django.core.cache import cache
from .models import Channel
def channel_context(request):
""" Channel context processors
"""
site = get_current_site(requ... | # -*- coding: utf-8 -*-
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import get_current_site
from .models import Channel
def channel_context(request):
""" Channel context processors
"""
site = get_current_site(request)
opps_menu = Channel.objects... | <commit_before># -*- coding: utf-8 -*-
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import get_current_site
from .models import Channel
def channel_context(request):
""" Channel context processors
"""
site = get_current_site(request)
opps_menu = ... |
7060f48df582dcfae1768cc37d00a25e0e2e1f6f | app/views/comment_view.py | app/views/comment_view.py | from flask import jsonify
from flask_classy import FlaskView
from flask_user import current_user, login_required
from ..models import CommentModel, PostModel
from ..forms import CommentForm
class Comment(FlaskView):
def get(self):
pass
def all(self, post_id):
comment = CommentModel()
... | from flask import jsonify
from flask_classy import FlaskView
from flask_user import current_user, login_required
from ..models import CommentModel, PostModel
from ..forms import CommentForm
class Comment(FlaskView):
def get(self):
pass
def all(self, post_id):
comment = CommentModel()
... | Comment post endpoint return a ksopn, fix issue saving comments add post id and convert it to int | Comment post endpoint return a ksopn, fix issue saving comments add post id and convert it to int
| Python | mit | oldani/nanodegree-blog,oldani/nanodegree-blog,oldani/nanodegree-blog | from flask import jsonify
from flask_classy import FlaskView
from flask_user import current_user, login_required
from ..models import CommentModel, PostModel
from ..forms import CommentForm
class Comment(FlaskView):
def get(self):
pass
def all(self, post_id):
comment = CommentModel()
... | from flask import jsonify
from flask_classy import FlaskView
from flask_user import current_user, login_required
from ..models import CommentModel, PostModel
from ..forms import CommentForm
class Comment(FlaskView):
def get(self):
pass
def all(self, post_id):
comment = CommentModel()
... | <commit_before>from flask import jsonify
from flask_classy import FlaskView
from flask_user import current_user, login_required
from ..models import CommentModel, PostModel
from ..forms import CommentForm
class Comment(FlaskView):
def get(self):
pass
def all(self, post_id):
comment = Comment... | from flask import jsonify
from flask_classy import FlaskView
from flask_user import current_user, login_required
from ..models import CommentModel, PostModel
from ..forms import CommentForm
class Comment(FlaskView):
def get(self):
pass
def all(self, post_id):
comment = CommentModel()
... | from flask import jsonify
from flask_classy import FlaskView
from flask_user import current_user, login_required
from ..models import CommentModel, PostModel
from ..forms import CommentForm
class Comment(FlaskView):
def get(self):
pass
def all(self, post_id):
comment = CommentModel()
... | <commit_before>from flask import jsonify
from flask_classy import FlaskView
from flask_user import current_user, login_required
from ..models import CommentModel, PostModel
from ..forms import CommentForm
class Comment(FlaskView):
def get(self):
pass
def all(self, post_id):
comment = Comment... |
6e7dfe97cdce58f892f88560e4b4709e6625e6bd | metatlas/__init__.py | metatlas/__init__.py | __version__ = '0.2'
from .mzml_loader import mzml_to_hdf
from .h5_query import plot_heatmap, plot_spectrogram, plot_xic
from .h5_query import get_data, get_XIC, get_HeatMapRTMZ, get_spectrogram
| __version__ = '0.2'
from .mzml_loader import mzml_to_hdf
from .h5_query import plot_heatmap, plot_spectrogram, plot_XIC
from .h5_query import get_data, get_XIC, get_heatmap, get_spectrogram
| Clean up package level imports | Clean up package level imports
| Python | bsd-3-clause | aitatanit/metatlas,aitatanit/metatlas,aitatanit/metatlas,metabolite-atlas/metatlas,biorack/metatlas,biorack/metatlas,metabolite-atlas/metatlas,metabolite-atlas/metatlas | __version__ = '0.2'
from .mzml_loader import mzml_to_hdf
from .h5_query import plot_heatmap, plot_spectrogram, plot_xic
from .h5_query import get_data, get_XIC, get_HeatMapRTMZ, get_spectrogram
Clean up package level imports | __version__ = '0.2'
from .mzml_loader import mzml_to_hdf
from .h5_query import plot_heatmap, plot_spectrogram, plot_XIC
from .h5_query import get_data, get_XIC, get_heatmap, get_spectrogram
| <commit_before>__version__ = '0.2'
from .mzml_loader import mzml_to_hdf
from .h5_query import plot_heatmap, plot_spectrogram, plot_xic
from .h5_query import get_data, get_XIC, get_HeatMapRTMZ, get_spectrogram
<commit_msg>Clean up package level imports<commit_after> | __version__ = '0.2'
from .mzml_loader import mzml_to_hdf
from .h5_query import plot_heatmap, plot_spectrogram, plot_XIC
from .h5_query import get_data, get_XIC, get_heatmap, get_spectrogram
| __version__ = '0.2'
from .mzml_loader import mzml_to_hdf
from .h5_query import plot_heatmap, plot_spectrogram, plot_xic
from .h5_query import get_data, get_XIC, get_HeatMapRTMZ, get_spectrogram
Clean up package level imports__version__ = '0.2'
from .mzml_loader import mzml_to_hdf
from .h5_query import plot_heatmap, plo... | <commit_before>__version__ = '0.2'
from .mzml_loader import mzml_to_hdf
from .h5_query import plot_heatmap, plot_spectrogram, plot_xic
from .h5_query import get_data, get_XIC, get_HeatMapRTMZ, get_spectrogram
<commit_msg>Clean up package level imports<commit_after>__version__ = '0.2'
from .mzml_loader import mzml_to_hd... |
aa3e36cc37b2ddcc5d166965f8abeff560e6b0f1 | migrations/config.py | migrations/config.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import logging
from logging.handlers import SysLogHandler
from dotenv import load_dotenv
load_dotenv('.env')
# Storage
DATABASE_URL =... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import logging
from logging.handlers import SysLogHandler
from dotenv import load_dotenv
load_dotenv('.env')
# Storage
if not os.envi... | Use test database on alembic when necessary | Use test database on alembic when necessary
| Python | agpl-3.0 | frictionlessdata/goodtables.io,frictionlessdata/goodtables.io,frictionlessdata/goodtables.io,frictionlessdata/goodtables.io | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import logging
from logging.handlers import SysLogHandler
from dotenv import load_dotenv
load_dotenv('.env')
# Storage
DATABASE_URL =... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import logging
from logging.handlers import SysLogHandler
from dotenv import load_dotenv
load_dotenv('.env')
# Storage
if not os.envi... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import logging
from logging.handlers import SysLogHandler
from dotenv import load_dotenv
load_dotenv('.env')
# Storage
... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import logging
from logging.handlers import SysLogHandler
from dotenv import load_dotenv
load_dotenv('.env')
# Storage
if not os.envi... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import logging
from logging.handlers import SysLogHandler
from dotenv import load_dotenv
load_dotenv('.env')
# Storage
DATABASE_URL =... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import logging
from logging.handlers import SysLogHandler
from dotenv import load_dotenv
load_dotenv('.env')
# Storage
... |
2b3281863f11fa577dd6504e58f6faec8ada2259 | qiime_studio/api/v1.py | qiime_studio/api/v1.py | from flask import Blueprint, jsonify
from .security import validate_request_authentication
from qiime.sdk import PluginManager
PLUGIN_MANAGER = PluginManager()
v1 = Blueprint('v1', __name__)
v1.before_request(validate_request_authentication)
@v1.route('/', methods=['GET', 'POST'])
def root():
return jsonify(con... | from flask import Blueprint, jsonify
from .security import validate_request_authentication
from qiime.sdk import PluginManager
PLUGIN_MANAGER = PluginManager()
v1 = Blueprint('v1', __name__)
v1.before_request(validate_request_authentication)
@v1.route('/', methods=['GET', 'POST'])
def root():
return jsonify(con... | Change order of API call | Change order of API call
| Python | bsd-3-clause | jakereps/qiime-studio-frontend,jakereps/qiime-studio,qiime2/qiime-studio,qiime2/qiime-studio,jakereps/qiime-studio,qiime2/qiime-studio-frontend,qiime2/qiime-studio-frontend,qiime2/qiime-studio,jakereps/qiime-studio,jakereps/qiime-studio-frontend | from flask import Blueprint, jsonify
from .security import validate_request_authentication
from qiime.sdk import PluginManager
PLUGIN_MANAGER = PluginManager()
v1 = Blueprint('v1', __name__)
v1.before_request(validate_request_authentication)
@v1.route('/', methods=['GET', 'POST'])
def root():
return jsonify(con... | from flask import Blueprint, jsonify
from .security import validate_request_authentication
from qiime.sdk import PluginManager
PLUGIN_MANAGER = PluginManager()
v1 = Blueprint('v1', __name__)
v1.before_request(validate_request_authentication)
@v1.route('/', methods=['GET', 'POST'])
def root():
return jsonify(con... | <commit_before>from flask import Blueprint, jsonify
from .security import validate_request_authentication
from qiime.sdk import PluginManager
PLUGIN_MANAGER = PluginManager()
v1 = Blueprint('v1', __name__)
v1.before_request(validate_request_authentication)
@v1.route('/', methods=['GET', 'POST'])
def root():
ret... | from flask import Blueprint, jsonify
from .security import validate_request_authentication
from qiime.sdk import PluginManager
PLUGIN_MANAGER = PluginManager()
v1 = Blueprint('v1', __name__)
v1.before_request(validate_request_authentication)
@v1.route('/', methods=['GET', 'POST'])
def root():
return jsonify(con... | from flask import Blueprint, jsonify
from .security import validate_request_authentication
from qiime.sdk import PluginManager
PLUGIN_MANAGER = PluginManager()
v1 = Blueprint('v1', __name__)
v1.before_request(validate_request_authentication)
@v1.route('/', methods=['GET', 'POST'])
def root():
return jsonify(con... | <commit_before>from flask import Blueprint, jsonify
from .security import validate_request_authentication
from qiime.sdk import PluginManager
PLUGIN_MANAGER = PluginManager()
v1 = Blueprint('v1', __name__)
v1.before_request(validate_request_authentication)
@v1.route('/', methods=['GET', 'POST'])
def root():
ret... |
e1a7e4535e64c005fb508ba6d3fed021bbd40a62 | oedb_datamodels/versions/1a73867b1e79_add_meta_search.py | oedb_datamodels/versions/1a73867b1e79_add_meta_search.py | """Add meta_search table
Revision ID: 1a73867b1e79
Revises: 1c6e2fb3d3b6
Create Date: 2019-04-29 11:47:04.783168
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
from sqlalchemy.orm.session import sessionmaker
from api.actions import update_meta_search
# revision identif... | """Add meta_search table
Revision ID: 1a73867b1e79
Revises: 1c6e2fb3d3b6
Create Date: 2019-04-29 11:47:04.783168
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
from sqlalchemy.orm.session import sessionmaker
from api.actions import update_meta_search
from dataedit.views... | Update only tables in visible schemas | Update only tables in visible schemas
| Python | agpl-3.0 | openego/oeplatform,openego/oeplatform,openego/oeplatform,openego/oeplatform | """Add meta_search table
Revision ID: 1a73867b1e79
Revises: 1c6e2fb3d3b6
Create Date: 2019-04-29 11:47:04.783168
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
from sqlalchemy.orm.session import sessionmaker
from api.actions import update_meta_search
# revision identif... | """Add meta_search table
Revision ID: 1a73867b1e79
Revises: 1c6e2fb3d3b6
Create Date: 2019-04-29 11:47:04.783168
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
from sqlalchemy.orm.session import sessionmaker
from api.actions import update_meta_search
from dataedit.views... | <commit_before>"""Add meta_search table
Revision ID: 1a73867b1e79
Revises: 1c6e2fb3d3b6
Create Date: 2019-04-29 11:47:04.783168
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
from sqlalchemy.orm.session import sessionmaker
from api.actions import update_meta_search
# r... | """Add meta_search table
Revision ID: 1a73867b1e79
Revises: 1c6e2fb3d3b6
Create Date: 2019-04-29 11:47:04.783168
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
from sqlalchemy.orm.session import sessionmaker
from api.actions import update_meta_search
from dataedit.views... | """Add meta_search table
Revision ID: 1a73867b1e79
Revises: 1c6e2fb3d3b6
Create Date: 2019-04-29 11:47:04.783168
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
from sqlalchemy.orm.session import sessionmaker
from api.actions import update_meta_search
# revision identif... | <commit_before>"""Add meta_search table
Revision ID: 1a73867b1e79
Revises: 1c6e2fb3d3b6
Create Date: 2019-04-29 11:47:04.783168
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
from sqlalchemy.orm.session import sessionmaker
from api.actions import update_meta_search
# r... |
7eb10376b585e56faad4672959f6654f2500a38d | astropy/units/__init__.py | astropy/units/__init__.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains classes and functions for defining and converting
between different physical units.
This code is adapted from the `pynbody
<http://code.google.com/p/pynbody/>`_ units module written by Andrew
Pontzen, who has granted the Astr... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains classes and functions for defining and converting
between different physical units.
This code is adapted from the `pynbody
<http://code.google.com/p/pynbody/>`_ units module written by Andrew
Pontzen, who has granted the Astr... | Add `one` as shortcut to `dimensionless_unscaled` | Add `one` as shortcut to `dimensionless_unscaled`
I find creating dimensionless `Quantity`es overly painful compared to quantities with dimensions. Currently the two existing options are:
1. Putting `u.km`, `u.s` next to `u.dimensionless_unscaled`. Too large.
2. Putting `u.km`, `u.s` next to `u.Unit('')` or `u.Uni... | Python | bsd-3-clause | kelle/astropy,aleksandr-bakanov/astropy,bsipocz/astropy,kelle/astropy,mhvk/astropy,funbaker/astropy,larrybradley/astropy,MSeifert04/astropy,aleksandr-bakanov/astropy,saimn/astropy,DougBurke/astropy,AustereCuriosity/astropy,AustereCuriosity/astropy,StuartLittlefair/astropy,astropy/astropy,lpsinger/astropy,AustereCuriosi... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains classes and functions for defining and converting
between different physical units.
This code is adapted from the `pynbody
<http://code.google.com/p/pynbody/>`_ units module written by Andrew
Pontzen, who has granted the Astr... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains classes and functions for defining and converting
between different physical units.
This code is adapted from the `pynbody
<http://code.google.com/p/pynbody/>`_ units module written by Andrew
Pontzen, who has granted the Astr... | <commit_before># Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains classes and functions for defining and converting
between different physical units.
This code is adapted from the `pynbody
<http://code.google.com/p/pynbody/>`_ units module written by Andrew
Pontzen, who has g... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains classes and functions for defining and converting
between different physical units.
This code is adapted from the `pynbody
<http://code.google.com/p/pynbody/>`_ units module written by Andrew
Pontzen, who has granted the Astr... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains classes and functions for defining and converting
between different physical units.
This code is adapted from the `pynbody
<http://code.google.com/p/pynbody/>`_ units module written by Andrew
Pontzen, who has granted the Astr... | <commit_before># Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains classes and functions for defining and converting
between different physical units.
This code is adapted from the `pynbody
<http://code.google.com/p/pynbody/>`_ units module written by Andrew
Pontzen, who has g... |
8a9fa06c36a89e3fde93059cfbe827506d5b8b62 | orchard/errors/e500.py | orchard/errors/e500.py | # -*- coding: utf-8 -*-
"""
This module sets up the view for handling ``500 Internal Server Error`` errors.
"""
import datetime
import flask
import flask_classful
from orchard.errors import blueprint
class Error500View(flask_classful.FlaskView):
"""
View for ``500 Internal Server Error`` errors.
... | # -*- coding: utf-8 -*-
"""
This module sets up the view for handling ``500 Internal Server Error`` errors.
"""
import datetime
import flask
import flask_classful
from orchard.errors import blueprint
class Error500View(flask_classful.FlaskView):
"""
View for ``500 Internal Server Error`` errors.
... | Disable exception logging of status code 500 during testing. | Disable exception logging of status code 500 during testing.
| Python | mit | BMeu/Orchard,BMeu/Orchard | # -*- coding: utf-8 -*-
"""
This module sets up the view for handling ``500 Internal Server Error`` errors.
"""
import datetime
import flask
import flask_classful
from orchard.errors import blueprint
class Error500View(flask_classful.FlaskView):
"""
View for ``500 Internal Server Error`` errors.
... | # -*- coding: utf-8 -*-
"""
This module sets up the view for handling ``500 Internal Server Error`` errors.
"""
import datetime
import flask
import flask_classful
from orchard.errors import blueprint
class Error500View(flask_classful.FlaskView):
"""
View for ``500 Internal Server Error`` errors.
... | <commit_before># -*- coding: utf-8 -*-
"""
This module sets up the view for handling ``500 Internal Server Error`` errors.
"""
import datetime
import flask
import flask_classful
from orchard.errors import blueprint
class Error500View(flask_classful.FlaskView):
"""
View for ``500 Internal Server Er... | # -*- coding: utf-8 -*-
"""
This module sets up the view for handling ``500 Internal Server Error`` errors.
"""
import datetime
import flask
import flask_classful
from orchard.errors import blueprint
class Error500View(flask_classful.FlaskView):
"""
View for ``500 Internal Server Error`` errors.
... | # -*- coding: utf-8 -*-
"""
This module sets up the view for handling ``500 Internal Server Error`` errors.
"""
import datetime
import flask
import flask_classful
from orchard.errors import blueprint
class Error500View(flask_classful.FlaskView):
"""
View for ``500 Internal Server Error`` errors.
... | <commit_before># -*- coding: utf-8 -*-
"""
This module sets up the view for handling ``500 Internal Server Error`` errors.
"""
import datetime
import flask
import flask_classful
from orchard.errors import blueprint
class Error500View(flask_classful.FlaskView):
"""
View for ``500 Internal Server Er... |
282ac04e49c6adef237ea30fa4dcae64e6f959d8 | stronghold/middleware.py | stronghold/middleware.py | from django.contrib.auth.decorators import login_required
from stronghold import conf
class LoginRequiredMiddleware(object):
"""
Force all views to use login required
View is deemed to be public if the @public decorator is applied to the view
View is also deemed to be Public if listed in in django s... | from django.contrib.auth.decorators import login_required
from stronghold import conf
class LoginRequiredMiddleware(object):
"""
Force all views to use login required
View is deemed to be public if the @public decorator is applied to the view
View is also deemed to be Public if listed in in django s... | Support for non-blank server roots | Support for non-blank server roots
Using request.path_info instead of request.path for regex matching.
This opens support for root server URLs such in the form of
'www.example.com/django_root/<view_url>'
| Python | mit | mgrouchy/django-stronghold,SunilMohanAdapa/django-stronghold,SunilMohanAdapa/django-stronghold | from django.contrib.auth.decorators import login_required
from stronghold import conf
class LoginRequiredMiddleware(object):
"""
Force all views to use login required
View is deemed to be public if the @public decorator is applied to the view
View is also deemed to be Public if listed in in django s... | from django.contrib.auth.decorators import login_required
from stronghold import conf
class LoginRequiredMiddleware(object):
"""
Force all views to use login required
View is deemed to be public if the @public decorator is applied to the view
View is also deemed to be Public if listed in in django s... | <commit_before>from django.contrib.auth.decorators import login_required
from stronghold import conf
class LoginRequiredMiddleware(object):
"""
Force all views to use login required
View is deemed to be public if the @public decorator is applied to the view
View is also deemed to be Public if listed... | from django.contrib.auth.decorators import login_required
from stronghold import conf
class LoginRequiredMiddleware(object):
"""
Force all views to use login required
View is deemed to be public if the @public decorator is applied to the view
View is also deemed to be Public if listed in in django s... | from django.contrib.auth.decorators import login_required
from stronghold import conf
class LoginRequiredMiddleware(object):
"""
Force all views to use login required
View is deemed to be public if the @public decorator is applied to the view
View is also deemed to be Public if listed in in django s... | <commit_before>from django.contrib.auth.decorators import login_required
from stronghold import conf
class LoginRequiredMiddleware(object):
"""
Force all views to use login required
View is deemed to be public if the @public decorator is applied to the view
View is also deemed to be Public if listed... |
6edd4114c4e715a3a0c440af455fff089a099620 | scrapy/squeues.py | scrapy/squeues.py | """
Scheduler queues
"""
import marshal
from six.moves import cPickle as pickle
from queuelib import queue
def _serializable_queue(queue_class, serialize, deserialize):
class SerializableQueue(queue_class):
def push(self, obj):
s = serialize(obj)
super(SerializableQueue, self).p... | """
Scheduler queues
"""
import marshal
from six.moves import cPickle as pickle
from queuelib import queue
def _serializable_queue(queue_class, serialize, deserialize):
class SerializableQueue(queue_class):
def push(self, obj):
s = serialize(obj)
super(SerializableQueue, self).p... | Clarify comment about Pyhton versions | Clarify comment about Pyhton versions
| Python | bsd-3-clause | pablohoffman/scrapy,pawelmhm/scrapy,finfish/scrapy,Ryezhang/scrapy,ssteo/scrapy,pawelmhm/scrapy,ssteo/scrapy,scrapy/scrapy,pawelmhm/scrapy,starrify/scrapy,ArturGaspar/scrapy,ssteo/scrapy,wujuguang/scrapy,dangra/scrapy,pablohoffman/scrapy,dangra/scrapy,elacuesta/scrapy,starrify/scrapy,scrapy/scrapy,kmike/scrapy,pablohof... | """
Scheduler queues
"""
import marshal
from six.moves import cPickle as pickle
from queuelib import queue
def _serializable_queue(queue_class, serialize, deserialize):
class SerializableQueue(queue_class):
def push(self, obj):
s = serialize(obj)
super(SerializableQueue, self).p... | """
Scheduler queues
"""
import marshal
from six.moves import cPickle as pickle
from queuelib import queue
def _serializable_queue(queue_class, serialize, deserialize):
class SerializableQueue(queue_class):
def push(self, obj):
s = serialize(obj)
super(SerializableQueue, self).p... | <commit_before>"""
Scheduler queues
"""
import marshal
from six.moves import cPickle as pickle
from queuelib import queue
def _serializable_queue(queue_class, serialize, deserialize):
class SerializableQueue(queue_class):
def push(self, obj):
s = serialize(obj)
super(Serializabl... | """
Scheduler queues
"""
import marshal
from six.moves import cPickle as pickle
from queuelib import queue
def _serializable_queue(queue_class, serialize, deserialize):
class SerializableQueue(queue_class):
def push(self, obj):
s = serialize(obj)
super(SerializableQueue, self).p... | """
Scheduler queues
"""
import marshal
from six.moves import cPickle as pickle
from queuelib import queue
def _serializable_queue(queue_class, serialize, deserialize):
class SerializableQueue(queue_class):
def push(self, obj):
s = serialize(obj)
super(SerializableQueue, self).p... | <commit_before>"""
Scheduler queues
"""
import marshal
from six.moves import cPickle as pickle
from queuelib import queue
def _serializable_queue(queue_class, serialize, deserialize):
class SerializableQueue(queue_class):
def push(self, obj):
s = serialize(obj)
super(Serializabl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.