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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fd55ae5927801e27e3a8642da2e00667509e8dc8 | services/flickr.py | services/flickr.py | import foauth.providers
class Flickr(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.flickr.com/'
docs_url = 'http://www.flickr.com/services/api/'
category = 'Pictures'
# URLs to interact with the API
request_token_url = 'http://www.flickr.com/services/o... | import foauth.providers
class Flickr(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.flickr.com/'
docs_url = 'http://www.flickr.com/services/api/'
category = 'Pictures'
# URLs to interact with the API
request_token_url = 'http://www.flickr.com/services/o... | Simplify Flickr's scope handling a bit | Simplify Flickr's scope handling a bit
| Python | bsd-3-clause | foauth/foauth.org,foauth/foauth.org,foauth/foauth.org | import foauth.providers
class Flickr(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.flickr.com/'
docs_url = 'http://www.flickr.com/services/api/'
category = 'Pictures'
# URLs to interact with the API
request_token_url = 'http://www.flickr.com/services/o... | import foauth.providers
class Flickr(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.flickr.com/'
docs_url = 'http://www.flickr.com/services/api/'
category = 'Pictures'
# URLs to interact with the API
request_token_url = 'http://www.flickr.com/services/o... | <commit_before>import foauth.providers
class Flickr(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.flickr.com/'
docs_url = 'http://www.flickr.com/services/api/'
category = 'Pictures'
# URLs to interact with the API
request_token_url = 'http://www.flickr... | import foauth.providers
class Flickr(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.flickr.com/'
docs_url = 'http://www.flickr.com/services/api/'
category = 'Pictures'
# URLs to interact with the API
request_token_url = 'http://www.flickr.com/services/o... | import foauth.providers
class Flickr(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.flickr.com/'
docs_url = 'http://www.flickr.com/services/api/'
category = 'Pictures'
# URLs to interact with the API
request_token_url = 'http://www.flickr.com/services/o... | <commit_before>import foauth.providers
class Flickr(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://www.flickr.com/'
docs_url = 'http://www.flickr.com/services/api/'
category = 'Pictures'
# URLs to interact with the API
request_token_url = 'http://www.flickr... |
bd2f5a6c62e446fc8b720b94e75313b5117767cb | trac/upgrades/db11.py | trac/upgrades/db11.py | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... | Fix typo in upgrade script | Fix typo in upgrade script
git-svn-id: 0d96b0c1a6983ccc08b3732614f4d6bfcf9cbb42@1647 af82e41b-90c4-0310-8c96-b1721e28e2e2
| Python | bsd-3-clause | rbaumg/trac,rbaumg/trac,rbaumg/trac,rbaumg/trac | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... | <commit_before>import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE ... | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... | import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE version (
... | <commit_before>import os.path
import shutil
sql = """
-- Remove empty values from the milestone list
DELETE FROM milestone WHERE COALESCE(name,'')='';
-- Add a description column to the version table, and remove unnamed versions
CREATE TEMP TABLE version_old AS SELECT * FROM version;
DROP TABLE version;
CREATE TABLE ... |
6d8461181a889c639cc497e35b38dee77ecb2941 | celery/patch.py | celery/patch.py | import logging
import sys
def _check_logger_class():
"""Make sure process name is recorded when loggers are used."""
from multiprocessing.process import current_process
logging._acquireLock()
try:
OldLoggerClass = logging.getLoggerClass()
if not getattr(OldLoggerClass, '_process_aware... | import logging
import sys
def _check_logger_class():
"""Make sure process name is recorded when loggers are used."""
from multiprocessing.process import current_process
logging._acquireLock()
try:
OldLoggerClass = logging.getLoggerClass()
if not getattr(OldLoggerClass, '_process_aware... | Make sure the logger class is process aware even when running Python >= 2.6 | Make sure the logger class is process aware even when running Python >= 2.6
| Python | bsd-3-clause | frac/celery,WoLpH/celery,ask/celery,ask/celery,cbrepo/celery,WoLpH/celery,cbrepo/celery,mitsuhiko/celery,frac/celery,mitsuhiko/celery | import logging
import sys
def _check_logger_class():
"""Make sure process name is recorded when loggers are used."""
from multiprocessing.process import current_process
logging._acquireLock()
try:
OldLoggerClass = logging.getLoggerClass()
if not getattr(OldLoggerClass, '_process_aware... | import logging
import sys
def _check_logger_class():
"""Make sure process name is recorded when loggers are used."""
from multiprocessing.process import current_process
logging._acquireLock()
try:
OldLoggerClass = logging.getLoggerClass()
if not getattr(OldLoggerClass, '_process_aware... | <commit_before>import logging
import sys
def _check_logger_class():
"""Make sure process name is recorded when loggers are used."""
from multiprocessing.process import current_process
logging._acquireLock()
try:
OldLoggerClass = logging.getLoggerClass()
if not getattr(OldLoggerClass, ... | import logging
import sys
def _check_logger_class():
"""Make sure process name is recorded when loggers are used."""
from multiprocessing.process import current_process
logging._acquireLock()
try:
OldLoggerClass = logging.getLoggerClass()
if not getattr(OldLoggerClass, '_process_aware... | import logging
import sys
def _check_logger_class():
"""Make sure process name is recorded when loggers are used."""
from multiprocessing.process import current_process
logging._acquireLock()
try:
OldLoggerClass = logging.getLoggerClass()
if not getattr(OldLoggerClass, '_process_aware... | <commit_before>import logging
import sys
def _check_logger_class():
"""Make sure process name is recorded when loggers are used."""
from multiprocessing.process import current_process
logging._acquireLock()
try:
OldLoggerClass = logging.getLoggerClass()
if not getattr(OldLoggerClass, ... |
5f11dba9339c91cb615a934d3f4a8e13cee7d3f5 | bin/link_venv.py | bin/link_venv.py | #!/usr/bin/python
#-*- coding:utf-8 -*-
"""
Executes the methos in utils.py
This file should be running under the original python,
not an env one
"""
import sys
from venv_dependencies.venv_dep_utils import *
def main(modules):
venv = get_active_venv()
if not venv:
print "No virtual envs"
#rais... | #!/usr/bin/python
#-*- coding:utf-8 -*-
"""
Executes the methos in utils.py
This file should be running under the original python,
not an env one
"""
import sys
from venv_dependencies.venv_dep_utils import *
def main(modules):
venv = get_active_venv()
if not venv:
raise SystemExit("No virtual envs")
... | Raise SystemExit if not in virtualenv. | Raise SystemExit if not in virtualenv.
| Python | mit | arruda/venv-dependencies | #!/usr/bin/python
#-*- coding:utf-8 -*-
"""
Executes the methos in utils.py
This file should be running under the original python,
not an env one
"""
import sys
from venv_dependencies.venv_dep_utils import *
def main(modules):
venv = get_active_venv()
if not venv:
print "No virtual envs"
#rais... | #!/usr/bin/python
#-*- coding:utf-8 -*-
"""
Executes the methos in utils.py
This file should be running under the original python,
not an env one
"""
import sys
from venv_dependencies.venv_dep_utils import *
def main(modules):
venv = get_active_venv()
if not venv:
raise SystemExit("No virtual envs")
... | <commit_before>#!/usr/bin/python
#-*- coding:utf-8 -*-
"""
Executes the methos in utils.py
This file should be running under the original python,
not an env one
"""
import sys
from venv_dependencies.venv_dep_utils import *
def main(modules):
venv = get_active_venv()
if not venv:
print "No virtual envs... | #!/usr/bin/python
#-*- coding:utf-8 -*-
"""
Executes the methos in utils.py
This file should be running under the original python,
not an env one
"""
import sys
from venv_dependencies.venv_dep_utils import *
def main(modules):
venv = get_active_venv()
if not venv:
raise SystemExit("No virtual envs")
... | #!/usr/bin/python
#-*- coding:utf-8 -*-
"""
Executes the methos in utils.py
This file should be running under the original python,
not an env one
"""
import sys
from venv_dependencies.venv_dep_utils import *
def main(modules):
venv = get_active_venv()
if not venv:
print "No virtual envs"
#rais... | <commit_before>#!/usr/bin/python
#-*- coding:utf-8 -*-
"""
Executes the methos in utils.py
This file should be running under the original python,
not an env one
"""
import sys
from venv_dependencies.venv_dep_utils import *
def main(modules):
venv = get_active_venv()
if not venv:
print "No virtual envs... |
b8e479e799539be2e413de8052bf0af084e63c8e | osgtest/tests/test_25_voms_admin.py | osgtest/tests/test_25_voms_admin.py | import os
import unittest
import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest
class TestSetupVomsAdmin(osgunittest.OSGTestCase):
def test_01_wait_for_voms_admin(self):
core.state['voms.started-webapp'] = False
core.skip_ok_unless_installed('voms-admin-server')
... | import os
import unittest
import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest
class TestSetupVomsAdmin(osgunittest.OSGTestCase):
def test_01_wait_for_voms_admin(self):
core.state['voms.started-webapp'] = False
core.skip_ok_unless_installed('voms-admin-server')
... | Increase the timeout value for the VOMS Admin start-up from 60s to 120s. Primarily, this is driven by occasional timeouts in the VMU tests, which can run slowly on a heavily loaded host. | Increase the timeout value for the VOMS Admin start-up from 60s to 120s.
Primarily, this is driven by occasional timeouts in the VMU tests, which
can run slowly on a heavily loaded host.
git-svn-id: 884a03e47e2adb735d896e55bb5ad6bc3421ba19@18485 4e558342-562e-0410-864c-e07659590f8c
| Python | apache-2.0 | efajardo/osg-test,efajardo/osg-test | import os
import unittest
import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest
class TestSetupVomsAdmin(osgunittest.OSGTestCase):
def test_01_wait_for_voms_admin(self):
core.state['voms.started-webapp'] = False
core.skip_ok_unless_installed('voms-admin-server')
... | import os
import unittest
import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest
class TestSetupVomsAdmin(osgunittest.OSGTestCase):
def test_01_wait_for_voms_admin(self):
core.state['voms.started-webapp'] = False
core.skip_ok_unless_installed('voms-admin-server')
... | <commit_before>import os
import unittest
import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest
class TestSetupVomsAdmin(osgunittest.OSGTestCase):
def test_01_wait_for_voms_admin(self):
core.state['voms.started-webapp'] = False
core.skip_ok_unless_installed('voms-a... | import os
import unittest
import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest
class TestSetupVomsAdmin(osgunittest.OSGTestCase):
def test_01_wait_for_voms_admin(self):
core.state['voms.started-webapp'] = False
core.skip_ok_unless_installed('voms-admin-server')
... | import os
import unittest
import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest
class TestSetupVomsAdmin(osgunittest.OSGTestCase):
def test_01_wait_for_voms_admin(self):
core.state['voms.started-webapp'] = False
core.skip_ok_unless_installed('voms-admin-server')
... | <commit_before>import os
import unittest
import osgtest.library.core as core
import osgtest.library.osgunittest as osgunittest
class TestSetupVomsAdmin(osgunittest.OSGTestCase):
def test_01_wait_for_voms_admin(self):
core.state['voms.started-webapp'] = False
core.skip_ok_unless_installed('voms-a... |
e7d7d299c95e82b09cb165382b1a548d50b2ff35 | bitjet/bitjet.py | bitjet/bitjet.py | import mmap
from ipywidgets import DOMWidget
from traitlets import Int, Unicode, List, Instance, Bytes, Enum
import base64
class BinaryView(DOMWidget):
_view_module = Unicode('nbextensions/bitjet/bitjet', sync=True)
_view_name = Unicode('BinaryView', sync=True)
_model_module = Unicode('nbextensions/bitje... | import mmap
from ipywidgets import DOMWidget
from traitlets import Int, Unicode, List, Instance, Bytes, Enum
import base64
class BinaryView(DOMWidget):
_view_module = Unicode('nbextensions/bitjet/bitjet', sync=True)
_view_name = Unicode('BinaryView', sync=True)
_model_module = Unicode('nbextensions/bitje... | Make default width be 8. | Make default width be 8.
| Python | bsd-3-clause | rgbkrk/bitjet,rgbkrk/bitjet | import mmap
from ipywidgets import DOMWidget
from traitlets import Int, Unicode, List, Instance, Bytes, Enum
import base64
class BinaryView(DOMWidget):
_view_module = Unicode('nbextensions/bitjet/bitjet', sync=True)
_view_name = Unicode('BinaryView', sync=True)
_model_module = Unicode('nbextensions/bitje... | import mmap
from ipywidgets import DOMWidget
from traitlets import Int, Unicode, List, Instance, Bytes, Enum
import base64
class BinaryView(DOMWidget):
_view_module = Unicode('nbextensions/bitjet/bitjet', sync=True)
_view_name = Unicode('BinaryView', sync=True)
_model_module = Unicode('nbextensions/bitje... | <commit_before>import mmap
from ipywidgets import DOMWidget
from traitlets import Int, Unicode, List, Instance, Bytes, Enum
import base64
class BinaryView(DOMWidget):
_view_module = Unicode('nbextensions/bitjet/bitjet', sync=True)
_view_name = Unicode('BinaryView', sync=True)
_model_module = Unicode('nbe... | import mmap
from ipywidgets import DOMWidget
from traitlets import Int, Unicode, List, Instance, Bytes, Enum
import base64
class BinaryView(DOMWidget):
_view_module = Unicode('nbextensions/bitjet/bitjet', sync=True)
_view_name = Unicode('BinaryView', sync=True)
_model_module = Unicode('nbextensions/bitje... | import mmap
from ipywidgets import DOMWidget
from traitlets import Int, Unicode, List, Instance, Bytes, Enum
import base64
class BinaryView(DOMWidget):
_view_module = Unicode('nbextensions/bitjet/bitjet', sync=True)
_view_name = Unicode('BinaryView', sync=True)
_model_module = Unicode('nbextensions/bitje... | <commit_before>import mmap
from ipywidgets import DOMWidget
from traitlets import Int, Unicode, List, Instance, Bytes, Enum
import base64
class BinaryView(DOMWidget):
_view_module = Unicode('nbextensions/bitjet/bitjet', sync=True)
_view_name = Unicode('BinaryView', sync=True)
_model_module = Unicode('nbe... |
b0bb270f1995271ea84c4ec428ade91b1550b36e | domotica/views.py | domotica/views.py | from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render
from django.http import HttpResponse, Http404
import s7
import light
def index(request):
s7conn = s7.S7Comm("10.0.3.9")
lights = light.loadAll(s7conn)
context = { 'lights' : lights }
return render(request, "light... | from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render
from django.http import HttpResponse, Http404
import s7
import light
PLC_IP = "10.0.3.9"
def index(request):
s7conn = s7.S7Comm(PLC_IP)
lights = light.loadAll(s7conn)
context = { 'lights' : lights }
return rende... | Move IP address to a constant at least | Move IP address to a constant at least
Perhaps we need to move it to the 'configuration' file later.
| Python | bsd-2-clause | kprovost/domotica,kprovost/domotica | from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render
from django.http import HttpResponse, Http404
import s7
import light
def index(request):
s7conn = s7.S7Comm("10.0.3.9")
lights = light.loadAll(s7conn)
context = { 'lights' : lights }
return render(request, "light... | from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render
from django.http import HttpResponse, Http404
import s7
import light
PLC_IP = "10.0.3.9"
def index(request):
s7conn = s7.S7Comm(PLC_IP)
lights = light.loadAll(s7conn)
context = { 'lights' : lights }
return rende... | <commit_before>from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render
from django.http import HttpResponse, Http404
import s7
import light
def index(request):
s7conn = s7.S7Comm("10.0.3.9")
lights = light.loadAll(s7conn)
context = { 'lights' : lights }
return render(... | from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render
from django.http import HttpResponse, Http404
import s7
import light
PLC_IP = "10.0.3.9"
def index(request):
s7conn = s7.S7Comm(PLC_IP)
lights = light.loadAll(s7conn)
context = { 'lights' : lights }
return rende... | from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render
from django.http import HttpResponse, Http404
import s7
import light
def index(request):
s7conn = s7.S7Comm("10.0.3.9")
lights = light.loadAll(s7conn)
context = { 'lights' : lights }
return render(request, "light... | <commit_before>from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render
from django.http import HttpResponse, Http404
import s7
import light
def index(request):
s7conn = s7.S7Comm("10.0.3.9")
lights = light.loadAll(s7conn)
context = { 'lights' : lights }
return render(... |
a5f34a8011718ba31dc3d70d761bc4583112f133 | common/morse_parse.py | common/morse_parse.py | f = open("morse_table.txt")
morse_table = f.read()
morse_table = dict([(morse[0:1], morse[2:len(morse)]) for morse in morse_table.split("\n")])
f.close()
| import inspect, os
common_dir = os.path.dirname(inspect.getfile(inspect.currentframe())) # script directory
f = open(os.path.join(common_dir, "morse_table.txt"))
morse_table = f.read()
morse_table = dict([(morse[0:1], morse[2:len(morse)]) for morse in morse_table.split("\n")])
f.close()
| Make morse parser not assume that the current working directory is common/ | Make morse parser not assume that the current working directory is common/
| Python | mit | nickodell/morse-code | f = open("morse_table.txt")
morse_table = f.read()
morse_table = dict([(morse[0:1], morse[2:len(morse)]) for morse in morse_table.split("\n")])
f.close()
Make morse parser not assume that the current working directory is common/ | import inspect, os
common_dir = os.path.dirname(inspect.getfile(inspect.currentframe())) # script directory
f = open(os.path.join(common_dir, "morse_table.txt"))
morse_table = f.read()
morse_table = dict([(morse[0:1], morse[2:len(morse)]) for morse in morse_table.split("\n")])
f.close()
| <commit_before>f = open("morse_table.txt")
morse_table = f.read()
morse_table = dict([(morse[0:1], morse[2:len(morse)]) for morse in morse_table.split("\n")])
f.close()
<commit_msg>Make morse parser not assume that the current working directory is common/<commit_after> | import inspect, os
common_dir = os.path.dirname(inspect.getfile(inspect.currentframe())) # script directory
f = open(os.path.join(common_dir, "morse_table.txt"))
morse_table = f.read()
morse_table = dict([(morse[0:1], morse[2:len(morse)]) for morse in morse_table.split("\n")])
f.close()
| f = open("morse_table.txt")
morse_table = f.read()
morse_table = dict([(morse[0:1], morse[2:len(morse)]) for morse in morse_table.split("\n")])
f.close()
Make morse parser not assume that the current working directory is common/import inspect, os
common_dir = os.path.dirname(inspect.getfile(inspect.currentframe())) #... | <commit_before>f = open("morse_table.txt")
morse_table = f.read()
morse_table = dict([(morse[0:1], morse[2:len(morse)]) for morse in morse_table.split("\n")])
f.close()
<commit_msg>Make morse parser not assume that the current working directory is common/<commit_after>import inspect, os
common_dir = os.path.dirname(i... |
0a2c2a32ceb19503816a9ef35d3de5468097f364 | gui_app/utils/StringUtil.py | gui_app/utils/StringUtil.py | import ast
def isEmpty(value):
if value:
return False
else:
return True
def isNotEmpty(value):
if not value:
return False
else:
return True
def stringToDict(param):
if isNotEmpty(param) or param != '':
return ast.literal_eval(param)
def stringToDictLis... | import ast
def isEmpty(value):
if value:
return False
else:
return True
def isNotEmpty(value):
if not value:
return False
else:
return True
def stringToDict(param):
if isNotEmpty(param) or param != '':
return ast.literal_eval(param)
def stringToDictLis... | Support to request null string | Support to request null string
| Python | apache-2.0 | cloudconductor/cloud_conductor_gui,cloudconductor/cloud_conductor_gui,cloudconductor/cloud_conductor_gui | import ast
def isEmpty(value):
if value:
return False
else:
return True
def isNotEmpty(value):
if not value:
return False
else:
return True
def stringToDict(param):
if isNotEmpty(param) or param != '':
return ast.literal_eval(param)
def stringToDictLis... | import ast
def isEmpty(value):
if value:
return False
else:
return True
def isNotEmpty(value):
if not value:
return False
else:
return True
def stringToDict(param):
if isNotEmpty(param) or param != '':
return ast.literal_eval(param)
def stringToDictLis... | <commit_before>import ast
def isEmpty(value):
if value:
return False
else:
return True
def isNotEmpty(value):
if not value:
return False
else:
return True
def stringToDict(param):
if isNotEmpty(param) or param != '':
return ast.literal_eval(param)
def ... | import ast
def isEmpty(value):
if value:
return False
else:
return True
def isNotEmpty(value):
if not value:
return False
else:
return True
def stringToDict(param):
if isNotEmpty(param) or param != '':
return ast.literal_eval(param)
def stringToDictLis... | import ast
def isEmpty(value):
if value:
return False
else:
return True
def isNotEmpty(value):
if not value:
return False
else:
return True
def stringToDict(param):
if isNotEmpty(param) or param != '':
return ast.literal_eval(param)
def stringToDictLis... | <commit_before>import ast
def isEmpty(value):
if value:
return False
else:
return True
def isNotEmpty(value):
if not value:
return False
else:
return True
def stringToDict(param):
if isNotEmpty(param) or param != '':
return ast.literal_eval(param)
def ... |
c9d33ef9a7f98798aec521e7f9e25e1db07bd077 | ursgal/__init__.py | ursgal/__init__.py | #!/usr/bin/env python
# encoding: utf-8
"""
"""
from __future__ import absolute_import
import sys
import os
import ursgal.uparams
# this is for unorthodox queries of the params.
# please use the unode functions or UParamsMapper
# to access params since they are translated,
# grouped and so on ...
base_dir = os.path... | #!/usr/bin/env python
# encoding: utf-8
"""
"""
from __future__ import absolute_import
import sys
import os
from packaging.version import parse as parse_version
import ursgal.uparams
# this is for unorthodox queries of the params.
# please use the unode functions or UParamsMapper
# to access params since they are tr... | Use `packaging.version.parser` for version parsing | Use `packaging.version.parser` for version parsing | Python | mit | ursgal/ursgal,ursgal/ursgal | #!/usr/bin/env python
# encoding: utf-8
"""
"""
from __future__ import absolute_import
import sys
import os
import ursgal.uparams
# this is for unorthodox queries of the params.
# please use the unode functions or UParamsMapper
# to access params since they are translated,
# grouped and so on ...
base_dir = os.path... | #!/usr/bin/env python
# encoding: utf-8
"""
"""
from __future__ import absolute_import
import sys
import os
from packaging.version import parse as parse_version
import ursgal.uparams
# this is for unorthodox queries of the params.
# please use the unode functions or UParamsMapper
# to access params since they are tr... | <commit_before>#!/usr/bin/env python
# encoding: utf-8
"""
"""
from __future__ import absolute_import
import sys
import os
import ursgal.uparams
# this is for unorthodox queries of the params.
# please use the unode functions or UParamsMapper
# to access params since they are translated,
# grouped and so on ...
bas... | #!/usr/bin/env python
# encoding: utf-8
"""
"""
from __future__ import absolute_import
import sys
import os
from packaging.version import parse as parse_version
import ursgal.uparams
# this is for unorthodox queries of the params.
# please use the unode functions or UParamsMapper
# to access params since they are tr... | #!/usr/bin/env python
# encoding: utf-8
"""
"""
from __future__ import absolute_import
import sys
import os
import ursgal.uparams
# this is for unorthodox queries of the params.
# please use the unode functions or UParamsMapper
# to access params since they are translated,
# grouped and so on ...
base_dir = os.path... | <commit_before>#!/usr/bin/env python
# encoding: utf-8
"""
"""
from __future__ import absolute_import
import sys
import os
import ursgal.uparams
# this is for unorthodox queries of the params.
# please use the unode functions or UParamsMapper
# to access params since they are translated,
# grouped and so on ...
bas... |
bdc70e84a7aab66a7494747b181d27814cf86161 | archie/headertiers/businessrules/IncludePath.py | archie/headertiers/businessrules/IncludePath.py | import logging
class IncludePath(object):
def __init__(self, project_layout, project_services):
self.project_layout = project_layout
self.project_services = project_services
def resolveIncludePaths(self, folder_path):
logger = logging.getLogger('Archie')
logger.debug('List incl... | import logging
class IncludePath(object):
def __init__(self, project_layout, project_services):
self.project_layout = project_layout
self.project_services = project_services
def resolveIncludePaths(self, folder_path):
logger = logging.getLogger('Archie')
logger.debug('List incl... | Fix up unit tests so they all pass. | Fix up unit tests so they all pass.
| Python | mit | niccroad/Archie,niccroad/Archie | import logging
class IncludePath(object):
def __init__(self, project_layout, project_services):
self.project_layout = project_layout
self.project_services = project_services
def resolveIncludePaths(self, folder_path):
logger = logging.getLogger('Archie')
logger.debug('List incl... | import logging
class IncludePath(object):
def __init__(self, project_layout, project_services):
self.project_layout = project_layout
self.project_services = project_services
def resolveIncludePaths(self, folder_path):
logger = logging.getLogger('Archie')
logger.debug('List incl... | <commit_before>import logging
class IncludePath(object):
def __init__(self, project_layout, project_services):
self.project_layout = project_layout
self.project_services = project_services
def resolveIncludePaths(self, folder_path):
logger = logging.getLogger('Archie')
logger.d... | import logging
class IncludePath(object):
def __init__(self, project_layout, project_services):
self.project_layout = project_layout
self.project_services = project_services
def resolveIncludePaths(self, folder_path):
logger = logging.getLogger('Archie')
logger.debug('List incl... | import logging
class IncludePath(object):
def __init__(self, project_layout, project_services):
self.project_layout = project_layout
self.project_services = project_services
def resolveIncludePaths(self, folder_path):
logger = logging.getLogger('Archie')
logger.debug('List incl... | <commit_before>import logging
class IncludePath(object):
def __init__(self, project_layout, project_services):
self.project_layout = project_layout
self.project_services = project_services
def resolveIncludePaths(self, folder_path):
logger = logging.getLogger('Archie')
logger.d... |
bb808bfe43154afa5b11265e4b5651183c7f87f0 | armstrong/hatband/sites.py | armstrong/hatband/sites.py | from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class HatbandAndDjangoRegistry(object):
def __init__(self, site, default_site=None):
if default_site is None:
default_site = django_site
super(HatbandAndDjango... | from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class HatbandAndDjangoRegistry(object):
def __init__(self, site, default_site=None):
if default_site is None:
default_site = django_site
super(HatbandAndDjango... | Make sure __setitem__ is available for site.register() | Make sure __setitem__ is available for site.register()
| Python | apache-2.0 | armstrong/armstrong.hatband,texastribune/armstrong.hatband,armstrong/armstrong.hatband,texastribune/armstrong.hatband,texastribune/armstrong.hatband,armstrong/armstrong.hatband | from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class HatbandAndDjangoRegistry(object):
def __init__(self, site, default_site=None):
if default_site is None:
default_site = django_site
super(HatbandAndDjango... | from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class HatbandAndDjangoRegistry(object):
def __init__(self, site, default_site=None):
if default_site is None:
default_site = django_site
super(HatbandAndDjango... | <commit_before>from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class HatbandAndDjangoRegistry(object):
def __init__(self, site, default_site=None):
if default_site is None:
default_site = django_site
super(H... | from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class HatbandAndDjangoRegistry(object):
def __init__(self, site, default_site=None):
if default_site is None:
default_site = django_site
super(HatbandAndDjango... | from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class HatbandAndDjangoRegistry(object):
def __init__(self, site, default_site=None):
if default_site is None:
default_site = django_site
super(HatbandAndDjango... | <commit_before>from django.contrib.admin.sites import AdminSite as DjangoAdminSite
from django.contrib.admin.sites import site as django_site
class HatbandAndDjangoRegistry(object):
def __init__(self, site, default_site=None):
if default_site is None:
default_site = django_site
super(H... |
5b18131069f860b712d8e54611541a8729496867 | suorganizer/urls.py | suorganizer/urls.py | """suorganizer URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | """suorganizer URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | Create URL pattern for Tag Detail. | Ch05: Create URL pattern for Tag Detail.
| Python | bsd-2-clause | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | """suorganizer URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | """suorganizer URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | <commit_before>"""suorganizer URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, nam... | """suorganizer URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | """suorganizer URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | <commit_before>"""suorganizer URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, nam... |
113fe8c84d7aff1577a9fadf8fa4650a31ea9307 | src/dataIO.py | src/dataIO.py | import numpy as np
def testOFFReader():
path = '../sample-data/chair.off'
raw_data = tuple(open(path, 'r'))
header = raw_data.strip(' ')[:-1]
n_vertices, n_faces = header[0], header[1]
if __name__ == '__main__':
a = testOFFReader()
print a
| import trimesh
import sys
import scipy.ndimage as nd
import numpy as np
import matplotlib.pyplot as plt
from stl import mesh
from mpl_toolkits import mplot3d
def getVerticesFaces(path):
raw_data = tuple(open(path, 'r'))
header = raw_data[1].split()
n_vertices = int(header[0])
n_faces = int(header[1]... | Add off file reader with 3d resampling | Add off file reader with 3d resampling
| Python | mit | meetshah1995/tf-3dgan | import numpy as np
def testOFFReader():
path = '../sample-data/chair.off'
raw_data = tuple(open(path, 'r'))
header = raw_data.strip(' ')[:-1]
n_vertices, n_faces = header[0], header[1]
if __name__ == '__main__':
a = testOFFReader()
print a
Add off file reader with 3d resampling | import trimesh
import sys
import scipy.ndimage as nd
import numpy as np
import matplotlib.pyplot as plt
from stl import mesh
from mpl_toolkits import mplot3d
def getVerticesFaces(path):
raw_data = tuple(open(path, 'r'))
header = raw_data[1].split()
n_vertices = int(header[0])
n_faces = int(header[1]... | <commit_before>import numpy as np
def testOFFReader():
path = '../sample-data/chair.off'
raw_data = tuple(open(path, 'r'))
header = raw_data.strip(' ')[:-1]
n_vertices, n_faces = header[0], header[1]
if __name__ == '__main__':
a = testOFFReader()
print a
<commit_msg>Add off file read... | import trimesh
import sys
import scipy.ndimage as nd
import numpy as np
import matplotlib.pyplot as plt
from stl import mesh
from mpl_toolkits import mplot3d
def getVerticesFaces(path):
raw_data = tuple(open(path, 'r'))
header = raw_data[1].split()
n_vertices = int(header[0])
n_faces = int(header[1]... | import numpy as np
def testOFFReader():
path = '../sample-data/chair.off'
raw_data = tuple(open(path, 'r'))
header = raw_data.strip(' ')[:-1]
n_vertices, n_faces = header[0], header[1]
if __name__ == '__main__':
a = testOFFReader()
print a
Add off file reader with 3d resamplingimport... | <commit_before>import numpy as np
def testOFFReader():
path = '../sample-data/chair.off'
raw_data = tuple(open(path, 'r'))
header = raw_data.strip(' ')[:-1]
n_vertices, n_faces = header[0], header[1]
if __name__ == '__main__':
a = testOFFReader()
print a
<commit_msg>Add off file read... |
fb792452d27be4c6015f417520c600a4b902b721 | learning_journal/tests/test_views.py | learning_journal/tests/test_views.py | # -*- coding: utf-8 -*-
from pyramid.testing import DummyRequest
from learning_journal.models import Entry, DBSession
import pytest
from learning_journal import main
import webtest
from learning_journal.views import (
list_view,
detail_view,
add_view,
edit_view
)
@pytest.fixture()
def app():
setti... | # -*- coding: utf-8 -*-
from pyramid.testing import DummyRequest
from learning_journal.models import Entry, DBSession
import pytest
from learning_journal import main
import webtest
from learning_journal.views import (
list_view,
detail_view,
add_view,
edit_view
)
@pytest.fixture()
def app():
setti... | Add test to assert no access to app | Add test to assert no access to app
| Python | mit | DZwell/learning_journal,DZwell/learning_journal,DZwell/learning_journal | # -*- coding: utf-8 -*-
from pyramid.testing import DummyRequest
from learning_journal.models import Entry, DBSession
import pytest
from learning_journal import main
import webtest
from learning_journal.views import (
list_view,
detail_view,
add_view,
edit_view
)
@pytest.fixture()
def app():
setti... | # -*- coding: utf-8 -*-
from pyramid.testing import DummyRequest
from learning_journal.models import Entry, DBSession
import pytest
from learning_journal import main
import webtest
from learning_journal.views import (
list_view,
detail_view,
add_view,
edit_view
)
@pytest.fixture()
def app():
setti... | <commit_before># -*- coding: utf-8 -*-
from pyramid.testing import DummyRequest
from learning_journal.models import Entry, DBSession
import pytest
from learning_journal import main
import webtest
from learning_journal.views import (
list_view,
detail_view,
add_view,
edit_view
)
@pytest.fixture()
def a... | # -*- coding: utf-8 -*-
from pyramid.testing import DummyRequest
from learning_journal.models import Entry, DBSession
import pytest
from learning_journal import main
import webtest
from learning_journal.views import (
list_view,
detail_view,
add_view,
edit_view
)
@pytest.fixture()
def app():
setti... | # -*- coding: utf-8 -*-
from pyramid.testing import DummyRequest
from learning_journal.models import Entry, DBSession
import pytest
from learning_journal import main
import webtest
from learning_journal.views import (
list_view,
detail_view,
add_view,
edit_view
)
@pytest.fixture()
def app():
setti... | <commit_before># -*- coding: utf-8 -*-
from pyramid.testing import DummyRequest
from learning_journal.models import Entry, DBSession
import pytest
from learning_journal import main
import webtest
from learning_journal.views import (
list_view,
detail_view,
add_view,
edit_view
)
@pytest.fixture()
def a... |
473c8748c4f8b33e51da2f4890cfe50a5aef3f29 | tests/test_variations.py | tests/test_variations.py | from nose import tools
import numpy as np
from trials.variations import *
class TestBernoulli:
def setup(self):
self.x = BernoulliVariation(1, 1)
def test_update(self):
self.x.update(100, 20)
def test_sample(self):
s1 = self.x.sample(10)
tools.assert_equals(len(s1), 10)... | from nose import tools
import numpy as np
from trials.variations import *
class TestBernoulli:
def setup(self):
self.x = BernoulliVariation(1, 1)
def test_update(self):
self.x.update(100, 20)
self.x.update(200, 10)
tools.assert_true(self.x.alpha == 301)
tools.assert_... | Add a test for update correctness | Add a test for update correctness
| Python | mit | bogdan-kulynych/trials | from nose import tools
import numpy as np
from trials.variations import *
class TestBernoulli:
def setup(self):
self.x = BernoulliVariation(1, 1)
def test_update(self):
self.x.update(100, 20)
def test_sample(self):
s1 = self.x.sample(10)
tools.assert_equals(len(s1), 10)... | from nose import tools
import numpy as np
from trials.variations import *
class TestBernoulli:
def setup(self):
self.x = BernoulliVariation(1, 1)
def test_update(self):
self.x.update(100, 20)
self.x.update(200, 10)
tools.assert_true(self.x.alpha == 301)
tools.assert_... | <commit_before>from nose import tools
import numpy as np
from trials.variations import *
class TestBernoulli:
def setup(self):
self.x = BernoulliVariation(1, 1)
def test_update(self):
self.x.update(100, 20)
def test_sample(self):
s1 = self.x.sample(10)
tools.assert_equa... | from nose import tools
import numpy as np
from trials.variations import *
class TestBernoulli:
def setup(self):
self.x = BernoulliVariation(1, 1)
def test_update(self):
self.x.update(100, 20)
self.x.update(200, 10)
tools.assert_true(self.x.alpha == 301)
tools.assert_... | from nose import tools
import numpy as np
from trials.variations import *
class TestBernoulli:
def setup(self):
self.x = BernoulliVariation(1, 1)
def test_update(self):
self.x.update(100, 20)
def test_sample(self):
s1 = self.x.sample(10)
tools.assert_equals(len(s1), 10)... | <commit_before>from nose import tools
import numpy as np
from trials.variations import *
class TestBernoulli:
def setup(self):
self.x = BernoulliVariation(1, 1)
def test_update(self):
self.x.update(100, 20)
def test_sample(self):
s1 = self.x.sample(10)
tools.assert_equa... |
c52dc9e5e9ca7f492f89f1db1bde52fdddd7136a | twistedchecker/functionaltests/trailingspace.py | twistedchecker/functionaltests/trailingspace.py | # enable: W9010,W9011
# A line with trailing space.
print "this line has trailing space"
# next blank line contains a whitespace
| # enable: W9010,W9011
# A line with trailing space.
print "this line has trailing space"
# next blank line contains a whitespace
# end of file
| Fix trailing space functional test. | Fix trailing space functional test.
| Python | mit | twisted/twistedchecker | # enable: W9010,W9011
# A line with trailing space.
print "this line has trailing space"
# next blank line contains a whitespace
Fix trailing space functional test. | # enable: W9010,W9011
# A line with trailing space.
print "this line has trailing space"
# next blank line contains a whitespace
# end of file
| <commit_before># enable: W9010,W9011
# A line with trailing space.
print "this line has trailing space"
# next blank line contains a whitespace
<commit_msg>Fix trailing space functional test.<commit_after> | # enable: W9010,W9011
# A line with trailing space.
print "this line has trailing space"
# next blank line contains a whitespace
# end of file
| # enable: W9010,W9011
# A line with trailing space.
print "this line has trailing space"
# next blank line contains a whitespace
Fix trailing space functional test.# enable: W9010,W9011
# A line with trailing space.
print "this line has trailing space"
# next blank line contains a whitespace
# end of file
| <commit_before># enable: W9010,W9011
# A line with trailing space.
print "this line has trailing space"
# next blank line contains a whitespace
<commit_msg>Fix trailing space functional test.<commit_after># enable: W9010,W9011
# A line with trailing space.
print "this line has trailing space"
# next blank line c... |
ee4d08b4795ed0818a48d97f5635c7ec2ba163fb | shopify_auth/backends.py | shopify_auth/backends.py | from django.contrib.auth.backends import RemoteUserBackend
class ShopUserBackend(RemoteUserBackend):
def authenticate(self, request=None, myshopify_domain=None, token=None, **kwargs):
if not myshopify_domain or not token or not request:
return
user = super(ShopUserBackend, self).auth... | from django.contrib.auth.backends import RemoteUserBackend
class ShopUserBackend(RemoteUserBackend):
def authenticate(self, request=None, myshopify_domain=None, token=None, **kwargs):
if not myshopify_domain or not token or not request:
return
try:
user = super(ShopUserBac... | Add regression fix for Django < 1.11 | Add regression fix for Django < 1.11
| Python | mit | discolabs/django-shopify-auth,discolabs/django-shopify-auth | from django.contrib.auth.backends import RemoteUserBackend
class ShopUserBackend(RemoteUserBackend):
def authenticate(self, request=None, myshopify_domain=None, token=None, **kwargs):
if not myshopify_domain or not token or not request:
return
user = super(ShopUserBackend, self).auth... | from django.contrib.auth.backends import RemoteUserBackend
class ShopUserBackend(RemoteUserBackend):
def authenticate(self, request=None, myshopify_domain=None, token=None, **kwargs):
if not myshopify_domain or not token or not request:
return
try:
user = super(ShopUserBac... | <commit_before>from django.contrib.auth.backends import RemoteUserBackend
class ShopUserBackend(RemoteUserBackend):
def authenticate(self, request=None, myshopify_domain=None, token=None, **kwargs):
if not myshopify_domain or not token or not request:
return
user = super(ShopUserBack... | from django.contrib.auth.backends import RemoteUserBackend
class ShopUserBackend(RemoteUserBackend):
def authenticate(self, request=None, myshopify_domain=None, token=None, **kwargs):
if not myshopify_domain or not token or not request:
return
try:
user = super(ShopUserBac... | from django.contrib.auth.backends import RemoteUserBackend
class ShopUserBackend(RemoteUserBackend):
def authenticate(self, request=None, myshopify_domain=None, token=None, **kwargs):
if not myshopify_domain or not token or not request:
return
user = super(ShopUserBackend, self).auth... | <commit_before>from django.contrib.auth.backends import RemoteUserBackend
class ShopUserBackend(RemoteUserBackend):
def authenticate(self, request=None, myshopify_domain=None, token=None, **kwargs):
if not myshopify_domain or not token or not request:
return
user = super(ShopUserBack... |
b39ca27dabcc9d949ed66be9fab2a6e4ed842fdb | iterator.py | iterator.py | import os, re, requests
rootdir = '_posts'
for subdir, dirs, files in os.walk(rootdir):
for file in files:
filename = os.path.join(subdir, file)
f = open(filename, "r")
contents = f.readlines()
f.close()
# Find first image
for key, line in enumerate(contents):
src = re.sear... | import os, re, requests
rootdir = '_posts'
for subdir, dirs, files in os.walk(rootdir):
for file in files:
filename = os.path.join(subdir, file)
f = open(filename, "r")
contents = f.readlines()
f.close()
# Find first image
if re.search('podcast', filename):
if re.s... | Add default images for podcasts if necessary | Add default images for podcasts if necessary
| Python | mit | jericson/stack-blog,StackExchange/stack-blog,dgrtwo/stack-blog,Zizouz212/stack-blog,moretti/stack-blog,NaeemShaikh/stack-blog.github.io,selfcommit/stack-blog,modulexcite/stack-blog,NaeemShaikh/stack-blog.github.io,jericson/stack-blog,modulexcite/stack-blog,Zizouz212/stack-blog,bjb568/stack-blog,hungvandinh/hungvandinh.... | import os, re, requests
rootdir = '_posts'
for subdir, dirs, files in os.walk(rootdir):
for file in files:
filename = os.path.join(subdir, file)
f = open(filename, "r")
contents = f.readlines()
f.close()
# Find first image
for key, line in enumerate(contents):
src = re.sear... | import os, re, requests
rootdir = '_posts'
for subdir, dirs, files in os.walk(rootdir):
for file in files:
filename = os.path.join(subdir, file)
f = open(filename, "r")
contents = f.readlines()
f.close()
# Find first image
if re.search('podcast', filename):
if re.s... | <commit_before>import os, re, requests
rootdir = '_posts'
for subdir, dirs, files in os.walk(rootdir):
for file in files:
filename = os.path.join(subdir, file)
f = open(filename, "r")
contents = f.readlines()
f.close()
# Find first image
for key, line in enumerate(contents):
... | import os, re, requests
rootdir = '_posts'
for subdir, dirs, files in os.walk(rootdir):
for file in files:
filename = os.path.join(subdir, file)
f = open(filename, "r")
contents = f.readlines()
f.close()
# Find first image
if re.search('podcast', filename):
if re.s... | import os, re, requests
rootdir = '_posts'
for subdir, dirs, files in os.walk(rootdir):
for file in files:
filename = os.path.join(subdir, file)
f = open(filename, "r")
contents = f.readlines()
f.close()
# Find first image
for key, line in enumerate(contents):
src = re.sear... | <commit_before>import os, re, requests
rootdir = '_posts'
for subdir, dirs, files in os.walk(rootdir):
for file in files:
filename = os.path.join(subdir, file)
f = open(filename, "r")
contents = f.readlines()
f.close()
# Find first image
for key, line in enumerate(contents):
... |
ca0e72ccd02cec3cc8e0e2c5d694e788c73ca9e2 | lib/addresses.py | lib/addresses.py | import logging
import warnings
try:
import cPickle as pickle
except ImportError:
import pickle
logger = logging.getLogger(__name__)
try:
address_book = pickle.load(open('address_book.p', 'rb'))
except IOError:
logger.debug('Could not load address book!')
warnings.warn('Could not load address book!... | import logging
import warnings
try:
import cPickle as pickle
except ImportError:
import pickle
logger = logging.getLogger(__name__)
try:
address_book = pickle.load(open('address_book.p', 'rb'))
except IOError:
logger.debug('Could not load address book!')
warnings.warn('Could not load address book!... | Modify format of address book dictionary | Modify format of address book dictionary
| Python | unlicense | CodingAnarchy/Amon | import logging
import warnings
try:
import cPickle as pickle
except ImportError:
import pickle
logger = logging.getLogger(__name__)
try:
address_book = pickle.load(open('address_book.p', 'rb'))
except IOError:
logger.debug('Could not load address book!')
warnings.warn('Could not load address book!... | import logging
import warnings
try:
import cPickle as pickle
except ImportError:
import pickle
logger = logging.getLogger(__name__)
try:
address_book = pickle.load(open('address_book.p', 'rb'))
except IOError:
logger.debug('Could not load address book!')
warnings.warn('Could not load address book!... | <commit_before>import logging
import warnings
try:
import cPickle as pickle
except ImportError:
import pickle
logger = logging.getLogger(__name__)
try:
address_book = pickle.load(open('address_book.p', 'rb'))
except IOError:
logger.debug('Could not load address book!')
warnings.warn('Could not loa... | import logging
import warnings
try:
import cPickle as pickle
except ImportError:
import pickle
logger = logging.getLogger(__name__)
try:
address_book = pickle.load(open('address_book.p', 'rb'))
except IOError:
logger.debug('Could not load address book!')
warnings.warn('Could not load address book!... | import logging
import warnings
try:
import cPickle as pickle
except ImportError:
import pickle
logger = logging.getLogger(__name__)
try:
address_book = pickle.load(open('address_book.p', 'rb'))
except IOError:
logger.debug('Could not load address book!')
warnings.warn('Could not load address book!... | <commit_before>import logging
import warnings
try:
import cPickle as pickle
except ImportError:
import pickle
logger = logging.getLogger(__name__)
try:
address_book = pickle.load(open('address_book.p', 'rb'))
except IOError:
logger.debug('Could not load address book!')
warnings.warn('Could not loa... |
d3f3cda6b4cbca9ddea6eeafc5725a646aadc14e | statirator/pages/views.py | statirator/pages/views.py | from __future__ import absolute_import
from django.views.generic.detail import DetailView
from django.template import Template
from django.template.response import TemplateResponse
from .models import Page
class PageView(DetailView):
model = Page
def get_queryset(self):
qs = Page.objects.filter(la... | from __future__ import absolute_import
from django.views.generic.detail import DetailView
from django.template import Template
from django.template.response import TemplateResponse
from .models import Page
class PageView(DetailView):
model = Page
def get_queryset(self):
qs = Page.objects.filter(la... | Use context as well for html page objects | Use context as well for html page objects
| Python | mit | MeirKriheli/statirator,MeirKriheli/statirator,MeirKriheli/statirator | from __future__ import absolute_import
from django.views.generic.detail import DetailView
from django.template import Template
from django.template.response import TemplateResponse
from .models import Page
class PageView(DetailView):
model = Page
def get_queryset(self):
qs = Page.objects.filter(la... | from __future__ import absolute_import
from django.views.generic.detail import DetailView
from django.template import Template
from django.template.response import TemplateResponse
from .models import Page
class PageView(DetailView):
model = Page
def get_queryset(self):
qs = Page.objects.filter(la... | <commit_before>from __future__ import absolute_import
from django.views.generic.detail import DetailView
from django.template import Template
from django.template.response import TemplateResponse
from .models import Page
class PageView(DetailView):
model = Page
def get_queryset(self):
qs = Page.ob... | from __future__ import absolute_import
from django.views.generic.detail import DetailView
from django.template import Template
from django.template.response import TemplateResponse
from .models import Page
class PageView(DetailView):
model = Page
def get_queryset(self):
qs = Page.objects.filter(la... | from __future__ import absolute_import
from django.views.generic.detail import DetailView
from django.template import Template
from django.template.response import TemplateResponse
from .models import Page
class PageView(DetailView):
model = Page
def get_queryset(self):
qs = Page.objects.filter(la... | <commit_before>from __future__ import absolute_import
from django.views.generic.detail import DetailView
from django.template import Template
from django.template.response import TemplateResponse
from .models import Page
class PageView(DetailView):
model = Page
def get_queryset(self):
qs = Page.ob... |
490b5b72e758eab32860c1be4d562debf1f3bd90 | migration_scripts/0.3/crypto_util.py | migration_scripts/0.3/crypto_util.py | # -*- coding: utf-8 -*-
# Minimal set of functions and variables from 0.2.1's crypto_util.py needed to
# regenerate journalist designations from soure's filesystem id's.
import random as badrandom
nouns = file("nouns.txt").read().split('\n')
adjectives = file("adjectives.txt").read().split('\n')
def displayid(n):
... | # -*- coding: utf-8 -*-
# Minimal set of functions and variables from 0.2.1's crypto_util.py needed to
# regenerate journalist designations from soure's filesystem id's.
import os
import random as badrandom
# Find the absolute path relative to this file so this script can be run anywhere
SRC_DIR = os.path.dirname(os.p... | Load files from absolute paths so this can be run from anywhere | Load files from absolute paths so this can be run from anywhere
| Python | agpl-3.0 | harlo/securedrop,jaseg/securedrop,jeann2013/securedrop,conorsch/securedrop,micahflee/securedrop,micahflee/securedrop,kelcecil/securedrop,ageis/securedrop,heartsucker/securedrop,jrosco/securedrop,chadmiller/securedrop,GabeIsman/securedrop,kelcecil/securedrop,jaseg/securedrop,jaseg/securedrop,ageis/securedrop,ageis/secur... | # -*- coding: utf-8 -*-
# Minimal set of functions and variables from 0.2.1's crypto_util.py needed to
# regenerate journalist designations from soure's filesystem id's.
import random as badrandom
nouns = file("nouns.txt").read().split('\n')
adjectives = file("adjectives.txt").read().split('\n')
def displayid(n):
... | # -*- coding: utf-8 -*-
# Minimal set of functions and variables from 0.2.1's crypto_util.py needed to
# regenerate journalist designations from soure's filesystem id's.
import os
import random as badrandom
# Find the absolute path relative to this file so this script can be run anywhere
SRC_DIR = os.path.dirname(os.p... | <commit_before># -*- coding: utf-8 -*-
# Minimal set of functions and variables from 0.2.1's crypto_util.py needed to
# regenerate journalist designations from soure's filesystem id's.
import random as badrandom
nouns = file("nouns.txt").read().split('\n')
adjectives = file("adjectives.txt").read().split('\n')
def di... | # -*- coding: utf-8 -*-
# Minimal set of functions and variables from 0.2.1's crypto_util.py needed to
# regenerate journalist designations from soure's filesystem id's.
import os
import random as badrandom
# Find the absolute path relative to this file so this script can be run anywhere
SRC_DIR = os.path.dirname(os.p... | # -*- coding: utf-8 -*-
# Minimal set of functions and variables from 0.2.1's crypto_util.py needed to
# regenerate journalist designations from soure's filesystem id's.
import random as badrandom
nouns = file("nouns.txt").read().split('\n')
adjectives = file("adjectives.txt").read().split('\n')
def displayid(n):
... | <commit_before># -*- coding: utf-8 -*-
# Minimal set of functions and variables from 0.2.1's crypto_util.py needed to
# regenerate journalist designations from soure's filesystem id's.
import random as badrandom
nouns = file("nouns.txt").read().split('\n')
adjectives = file("adjectives.txt").read().split('\n')
def di... |
e8c461d3c21b2367c08626ce09f79fe0fe92cdf9 | cupyx/scipy/special/erf.py | cupyx/scipy/special/erf.py | import cupy.core.fusion
from cupy.math import ufunc
_erf = ufunc.create_math_ufunc(
'erf', 1, 'cupyx_scipy_erf',
'''Error function.
.. seealso:: :meth: scipy.special.erf
''',
support_complex=False)
_erfc = ufunc.create_math_ufunc(
'erfc', 1, 'cupyx_scipy_erfc',
'''Complementary error f... | import cupy.core.fusion
from cupy.math import ufunc
_erf = ufunc.create_math_ufunc(
'erf', 1, 'cupyx_scipy_erf',
'''Error function.
.. seealso:: :meth:`scipy.special.erf`
''',
support_complex=False)
_erfc = ufunc.create_math_ufunc(
'erfc', 1, 'cupyx_scipy_erfc',
'''Complementary error ... | Fix docstring of error functions | Fix docstring of error functions
| Python | mit | cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy | import cupy.core.fusion
from cupy.math import ufunc
_erf = ufunc.create_math_ufunc(
'erf', 1, 'cupyx_scipy_erf',
'''Error function.
.. seealso:: :meth: scipy.special.erf
''',
support_complex=False)
_erfc = ufunc.create_math_ufunc(
'erfc', 1, 'cupyx_scipy_erfc',
'''Complementary error f... | import cupy.core.fusion
from cupy.math import ufunc
_erf = ufunc.create_math_ufunc(
'erf', 1, 'cupyx_scipy_erf',
'''Error function.
.. seealso:: :meth:`scipy.special.erf`
''',
support_complex=False)
_erfc = ufunc.create_math_ufunc(
'erfc', 1, 'cupyx_scipy_erfc',
'''Complementary error ... | <commit_before>import cupy.core.fusion
from cupy.math import ufunc
_erf = ufunc.create_math_ufunc(
'erf', 1, 'cupyx_scipy_erf',
'''Error function.
.. seealso:: :meth: scipy.special.erf
''',
support_complex=False)
_erfc = ufunc.create_math_ufunc(
'erfc', 1, 'cupyx_scipy_erfc',
'''Comple... | import cupy.core.fusion
from cupy.math import ufunc
_erf = ufunc.create_math_ufunc(
'erf', 1, 'cupyx_scipy_erf',
'''Error function.
.. seealso:: :meth:`scipy.special.erf`
''',
support_complex=False)
_erfc = ufunc.create_math_ufunc(
'erfc', 1, 'cupyx_scipy_erfc',
'''Complementary error ... | import cupy.core.fusion
from cupy.math import ufunc
_erf = ufunc.create_math_ufunc(
'erf', 1, 'cupyx_scipy_erf',
'''Error function.
.. seealso:: :meth: scipy.special.erf
''',
support_complex=False)
_erfc = ufunc.create_math_ufunc(
'erfc', 1, 'cupyx_scipy_erfc',
'''Complementary error f... | <commit_before>import cupy.core.fusion
from cupy.math import ufunc
_erf = ufunc.create_math_ufunc(
'erf', 1, 'cupyx_scipy_erf',
'''Error function.
.. seealso:: :meth: scipy.special.erf
''',
support_complex=False)
_erfc = ufunc.create_math_ufunc(
'erfc', 1, 'cupyx_scipy_erfc',
'''Comple... |
47bf5160010d0975297d39b200492270a5279e81 | common/lib/xmodule/xmodule/discussion_module.py | common/lib/xmodule/xmodule/discussion_module.py | from lxml import etree
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
import comment_client
import json
class DiscussionModule(XModule):
def get_html(self):
context = {
'discussion_id': self.discussion_id,
}
return self.system.render_templat... | from lxml import etree
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
import json
class DiscussionModule(XModule):
def get_html(self):
context = {
'discussion_id': self.discussion_id,
}
return self.system.render_template('discussion/_discussi... | Remove unnecessary import that was failing a test | Remove unnecessary import that was failing a test
| Python | agpl-3.0 | franosincic/edx-platform,shabab12/edx-platform,motion2015/edx-platform,rue89-tech/edx-platform,nanolearning/edx-platform,J861449197/edx-platform,mcgachey/edx-platform,halvertoluke/edx-platform,cyanna/edx-platform,jruiperezv/ANALYSE,jbassen/edx-platform,abdoosh00/edraak,LearnEra/LearnEraPlaftform,doganov/edx-platform,al... | from lxml import etree
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
import comment_client
import json
class DiscussionModule(XModule):
def get_html(self):
context = {
'discussion_id': self.discussion_id,
}
return self.system.render_templat... | from lxml import etree
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
import json
class DiscussionModule(XModule):
def get_html(self):
context = {
'discussion_id': self.discussion_id,
}
return self.system.render_template('discussion/_discussi... | <commit_before>from lxml import etree
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
import comment_client
import json
class DiscussionModule(XModule):
def get_html(self):
context = {
'discussion_id': self.discussion_id,
}
return self.system... | from lxml import etree
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
import json
class DiscussionModule(XModule):
def get_html(self):
context = {
'discussion_id': self.discussion_id,
}
return self.system.render_template('discussion/_discussi... | from lxml import etree
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
import comment_client
import json
class DiscussionModule(XModule):
def get_html(self):
context = {
'discussion_id': self.discussion_id,
}
return self.system.render_templat... | <commit_before>from lxml import etree
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
import comment_client
import json
class DiscussionModule(XModule):
def get_html(self):
context = {
'discussion_id': self.discussion_id,
}
return self.system... |
e2e6e603ddcc317bdd56e3de3f69656b776030bf | avalanche/benchmarks/classic/ctrl.py | avalanche/benchmarks/classic/ctrl.py | import torch
from avalanche.benchmarks import GenericCLScenario, dataset_benchmark
from avalanche.benchmarks.utils import AvalancheTensorDataset
from torchvision import transforms
import ctrl
def CTrL(stream_name):
stream = ctrl.get_stream(stream_name)
exps = [[], [], []]
norms = []
for t in stream:... | import torch
from avalanche.benchmarks import GenericCLScenario, dataset_benchmark
from avalanche.benchmarks.utils import AvalancheTensorDataset
from torchvision import transforms
import ctrl
def CTrL(stream_name):
stream = ctrl.get_stream(stream_name)
# Train, val and test experiences
exps = [[], [], [... | Add normalization to each task | Add normalization to each task
| Python | mit | ContinualAI/avalanche,ContinualAI/avalanche | import torch
from avalanche.benchmarks import GenericCLScenario, dataset_benchmark
from avalanche.benchmarks.utils import AvalancheTensorDataset
from torchvision import transforms
import ctrl
def CTrL(stream_name):
stream = ctrl.get_stream(stream_name)
exps = [[], [], []]
norms = []
for t in stream:... | import torch
from avalanche.benchmarks import GenericCLScenario, dataset_benchmark
from avalanche.benchmarks.utils import AvalancheTensorDataset
from torchvision import transforms
import ctrl
def CTrL(stream_name):
stream = ctrl.get_stream(stream_name)
# Train, val and test experiences
exps = [[], [], [... | <commit_before>import torch
from avalanche.benchmarks import GenericCLScenario, dataset_benchmark
from avalanche.benchmarks.utils import AvalancheTensorDataset
from torchvision import transforms
import ctrl
def CTrL(stream_name):
stream = ctrl.get_stream(stream_name)
exps = [[], [], []]
norms = []
f... | import torch
from avalanche.benchmarks import GenericCLScenario, dataset_benchmark
from avalanche.benchmarks.utils import AvalancheTensorDataset
from torchvision import transforms
import ctrl
def CTrL(stream_name):
stream = ctrl.get_stream(stream_name)
# Train, val and test experiences
exps = [[], [], [... | import torch
from avalanche.benchmarks import GenericCLScenario, dataset_benchmark
from avalanche.benchmarks.utils import AvalancheTensorDataset
from torchvision import transforms
import ctrl
def CTrL(stream_name):
stream = ctrl.get_stream(stream_name)
exps = [[], [], []]
norms = []
for t in stream:... | <commit_before>import torch
from avalanche.benchmarks import GenericCLScenario, dataset_benchmark
from avalanche.benchmarks.utils import AvalancheTensorDataset
from torchvision import transforms
import ctrl
def CTrL(stream_name):
stream = ctrl.get_stream(stream_name)
exps = [[], [], []]
norms = []
f... |
82b4e19e4d12c9a44c4258afaa78a7e386e0f7de | wiblog/formatting.py | wiblog/formatting.py | from django.utils.safestring import mark_safe
import CommonMark
# Convert a markdown string into HTML5, and prevent Django from escaping it
def mdToHTML(value):
return mark_safe(CommonMark.commonmark(value))
# Get a summary of a post
def summarize(fullBody):
firstNewline = fullBody.find("\n")
if firs... | import CommonMark
from images.models import Image
from django.utils.safestring import mark_safe
from django.core.exceptions import ObjectDoesNotExist
import re
def mdToHTML(value):
"""Convert a markdown string into HTML5, and prevent Django from escaping it
"""
tags = []
# Find all instance of the dy... | Add code to replace custom dynamic image tag with standard markdown image syntax | Add code to replace custom dynamic image tag with standard markdown image syntax
| Python | agpl-3.0 | lo-windigo/fragdev,lo-windigo/fragdev | from django.utils.safestring import mark_safe
import CommonMark
# Convert a markdown string into HTML5, and prevent Django from escaping it
def mdToHTML(value):
return mark_safe(CommonMark.commonmark(value))
# Get a summary of a post
def summarize(fullBody):
firstNewline = fullBody.find("\n")
if firs... | import CommonMark
from images.models import Image
from django.utils.safestring import mark_safe
from django.core.exceptions import ObjectDoesNotExist
import re
def mdToHTML(value):
"""Convert a markdown string into HTML5, and prevent Django from escaping it
"""
tags = []
# Find all instance of the dy... | <commit_before>from django.utils.safestring import mark_safe
import CommonMark
# Convert a markdown string into HTML5, and prevent Django from escaping it
def mdToHTML(value):
return mark_safe(CommonMark.commonmark(value))
# Get a summary of a post
def summarize(fullBody):
firstNewline = fullBody.find("\n... | import CommonMark
from images.models import Image
from django.utils.safestring import mark_safe
from django.core.exceptions import ObjectDoesNotExist
import re
def mdToHTML(value):
"""Convert a markdown string into HTML5, and prevent Django from escaping it
"""
tags = []
# Find all instance of the dy... | from django.utils.safestring import mark_safe
import CommonMark
# Convert a markdown string into HTML5, and prevent Django from escaping it
def mdToHTML(value):
return mark_safe(CommonMark.commonmark(value))
# Get a summary of a post
def summarize(fullBody):
firstNewline = fullBody.find("\n")
if firs... | <commit_before>from django.utils.safestring import mark_safe
import CommonMark
# Convert a markdown string into HTML5, and prevent Django from escaping it
def mdToHTML(value):
return mark_safe(CommonMark.commonmark(value))
# Get a summary of a post
def summarize(fullBody):
firstNewline = fullBody.find("\n... |
7a374b19cf89421a73ea55fdbcd1b16b52327568 | dm_control/composer/initializer.py | dm_control/composer/initializer.py | # Copyright 2018 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | # Copyright 2018 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | Rename `initialize_episode` --> `__call__` in `composer.Initializer` | Rename `initialize_episode` --> `__call__` in `composer.Initializer`
PiperOrigin-RevId: 234775654
| Python | apache-2.0 | deepmind/dm_control | # Copyright 2018 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | # Copyright 2018 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | <commit_before># Copyright 2018 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | # Copyright 2018 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | # Copyright 2018 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | <commit_before># Copyright 2018 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
b2edf170e65248b97333d319ce31bc49969f9c2d | lmod/__init__.py | lmod/__init__.py | import os
import re
from collections import OrderedDict
from subprocess import Popen, PIPE
LMOD_CMD = os.environ['LMOD_CMD']
LMOD_SYSTEM_NAME = os.environ.get('LMOD_SYSTEM_NAME', '')
def module(command, arguments=()):
cmd = [LMOD_CMD, 'python', '--terse', command]
cmd.extend(arguments)
result = Popen(cm... | import os
from subprocess import Popen, PIPE
LMOD_CMD = os.environ['LMOD_CMD']
LMOD_SYSTEM_NAME = os.environ.get('LMOD_SYSTEM_NAME', '')
def module(command, arguments=()):
cmd = [LMOD_CMD, 'python', '--terse', command]
cmd.extend(arguments)
result = Popen(cmd, stdout=PIPE, stderr=PIPE)
if command in ... | Remove unused import in lmod | Remove unused import in lmod
| Python | mit | cmd-ntrf/jupyter-lmod,cmd-ntrf/jupyter-lmod,cmd-ntrf/jupyter-lmod | import os
import re
from collections import OrderedDict
from subprocess import Popen, PIPE
LMOD_CMD = os.environ['LMOD_CMD']
LMOD_SYSTEM_NAME = os.environ.get('LMOD_SYSTEM_NAME', '')
def module(command, arguments=()):
cmd = [LMOD_CMD, 'python', '--terse', command]
cmd.extend(arguments)
result = Popen(cm... | import os
from subprocess import Popen, PIPE
LMOD_CMD = os.environ['LMOD_CMD']
LMOD_SYSTEM_NAME = os.environ.get('LMOD_SYSTEM_NAME', '')
def module(command, arguments=()):
cmd = [LMOD_CMD, 'python', '--terse', command]
cmd.extend(arguments)
result = Popen(cmd, stdout=PIPE, stderr=PIPE)
if command in ... | <commit_before>import os
import re
from collections import OrderedDict
from subprocess import Popen, PIPE
LMOD_CMD = os.environ['LMOD_CMD']
LMOD_SYSTEM_NAME = os.environ.get('LMOD_SYSTEM_NAME', '')
def module(command, arguments=()):
cmd = [LMOD_CMD, 'python', '--terse', command]
cmd.extend(arguments)
re... | import os
from subprocess import Popen, PIPE
LMOD_CMD = os.environ['LMOD_CMD']
LMOD_SYSTEM_NAME = os.environ.get('LMOD_SYSTEM_NAME', '')
def module(command, arguments=()):
cmd = [LMOD_CMD, 'python', '--terse', command]
cmd.extend(arguments)
result = Popen(cmd, stdout=PIPE, stderr=PIPE)
if command in ... | import os
import re
from collections import OrderedDict
from subprocess import Popen, PIPE
LMOD_CMD = os.environ['LMOD_CMD']
LMOD_SYSTEM_NAME = os.environ.get('LMOD_SYSTEM_NAME', '')
def module(command, arguments=()):
cmd = [LMOD_CMD, 'python', '--terse', command]
cmd.extend(arguments)
result = Popen(cm... | <commit_before>import os
import re
from collections import OrderedDict
from subprocess import Popen, PIPE
LMOD_CMD = os.environ['LMOD_CMD']
LMOD_SYSTEM_NAME = os.environ.get('LMOD_SYSTEM_NAME', '')
def module(command, arguments=()):
cmd = [LMOD_CMD, 'python', '--terse', command]
cmd.extend(arguments)
re... |
74e41bf9b8ebf9f3693c6ff6979230fd3e855fa5 | test_stack.py | test_stack.py | # Test file for stack.py
# Authors Mark, Efrain, Henry
import pytest
import stack as st
def test_init():
"""Test stack constructor."""
a = st.Stack()
assert isinstance(a, st.Stack)
def test_push(populated_stack):
"""Test push function, with empty and populated stacks."""
@pytest.fixture(scope='fun... | # Test file for stack.py
# Authors Mark, Efrain, Henry
import pytest
import stack as st
def test_init():
"""Test stack constructor."""
a = st.Stack()
assert isinstance(a, st.Stack)
def test_push(empty_stack, populated_stack):
"""Test push function, with empty and populated stacks."""
empty_stack... | Add push and pop test. | Add push and pop test.
| Python | mit | efrainc/data_structures | # Test file for stack.py
# Authors Mark, Efrain, Henry
import pytest
import stack as st
def test_init():
"""Test stack constructor."""
a = st.Stack()
assert isinstance(a, st.Stack)
def test_push(populated_stack):
"""Test push function, with empty and populated stacks."""
@pytest.fixture(scope='fun... | # Test file for stack.py
# Authors Mark, Efrain, Henry
import pytest
import stack as st
def test_init():
"""Test stack constructor."""
a = st.Stack()
assert isinstance(a, st.Stack)
def test_push(empty_stack, populated_stack):
"""Test push function, with empty and populated stacks."""
empty_stack... | <commit_before># Test file for stack.py
# Authors Mark, Efrain, Henry
import pytest
import stack as st
def test_init():
"""Test stack constructor."""
a = st.Stack()
assert isinstance(a, st.Stack)
def test_push(populated_stack):
"""Test push function, with empty and populated stacks."""
@pytest.fix... | # Test file for stack.py
# Authors Mark, Efrain, Henry
import pytest
import stack as st
def test_init():
"""Test stack constructor."""
a = st.Stack()
assert isinstance(a, st.Stack)
def test_push(empty_stack, populated_stack):
"""Test push function, with empty and populated stacks."""
empty_stack... | # Test file for stack.py
# Authors Mark, Efrain, Henry
import pytest
import stack as st
def test_init():
"""Test stack constructor."""
a = st.Stack()
assert isinstance(a, st.Stack)
def test_push(populated_stack):
"""Test push function, with empty and populated stacks."""
@pytest.fixture(scope='fun... | <commit_before># Test file for stack.py
# Authors Mark, Efrain, Henry
import pytest
import stack as st
def test_init():
"""Test stack constructor."""
a = st.Stack()
assert isinstance(a, st.Stack)
def test_push(populated_stack):
"""Test push function, with empty and populated stacks."""
@pytest.fix... |
824d769b1b1f55a018b380f6631f11727339a018 | fpsd/run_tests.py | fpsd/run_tests.py | #!/usr/bin/env python3.5
from subprocess import call
from os.path import dirname, abspath, join
# Run all the tests using py.test
call(["python3.5", "-m", "unittest", "-f", "-v", "test.test_sketchy_sites"])
call(["python3.5", "-m", "unittest", "-f", "-v", "test.test_utils"])
call(["python3.5", "-m", "unittest", "-f",... | #!/usr/bin/env python3.5
from subprocess import call
from os.path import dirname, abspath, join
# Run all the tests using py.test
call(["python3.5", "-m", "unittest", "-f", "-v", "test.test_sketchy_sites"])
call(["python3.5", "-m", "unittest", "-f", "-v", "test.test_utils"])
call(["python3.5", "-m", "unittest", "-f",... | Add feature generation tests to test runner | Add feature generation tests to test runner
| Python | agpl-3.0 | freedomofpress/FingerprintSecureDrop,freedomofpress/fingerprint-securedrop,freedomofpress/FingerprintSecureDrop,freedomofpress/fingerprint-securedrop,freedomofpress/fingerprint-securedrop | #!/usr/bin/env python3.5
from subprocess import call
from os.path import dirname, abspath, join
# Run all the tests using py.test
call(["python3.5", "-m", "unittest", "-f", "-v", "test.test_sketchy_sites"])
call(["python3.5", "-m", "unittest", "-f", "-v", "test.test_utils"])
call(["python3.5", "-m", "unittest", "-f",... | #!/usr/bin/env python3.5
from subprocess import call
from os.path import dirname, abspath, join
# Run all the tests using py.test
call(["python3.5", "-m", "unittest", "-f", "-v", "test.test_sketchy_sites"])
call(["python3.5", "-m", "unittest", "-f", "-v", "test.test_utils"])
call(["python3.5", "-m", "unittest", "-f",... | <commit_before>#!/usr/bin/env python3.5
from subprocess import call
from os.path import dirname, abspath, join
# Run all the tests using py.test
call(["python3.5", "-m", "unittest", "-f", "-v", "test.test_sketchy_sites"])
call(["python3.5", "-m", "unittest", "-f", "-v", "test.test_utils"])
call(["python3.5", "-m", "u... | #!/usr/bin/env python3.5
from subprocess import call
from os.path import dirname, abspath, join
# Run all the tests using py.test
call(["python3.5", "-m", "unittest", "-f", "-v", "test.test_sketchy_sites"])
call(["python3.5", "-m", "unittest", "-f", "-v", "test.test_utils"])
call(["python3.5", "-m", "unittest", "-f",... | #!/usr/bin/env python3.5
from subprocess import call
from os.path import dirname, abspath, join
# Run all the tests using py.test
call(["python3.5", "-m", "unittest", "-f", "-v", "test.test_sketchy_sites"])
call(["python3.5", "-m", "unittest", "-f", "-v", "test.test_utils"])
call(["python3.5", "-m", "unittest", "-f",... | <commit_before>#!/usr/bin/env python3.5
from subprocess import call
from os.path import dirname, abspath, join
# Run all the tests using py.test
call(["python3.5", "-m", "unittest", "-f", "-v", "test.test_sketchy_sites"])
call(["python3.5", "-m", "unittest", "-f", "-v", "test.test_utils"])
call(["python3.5", "-m", "u... |
7e120f1d722259b2af91db27ff066549a8549765 | tim/models.py | tim/models.py | from django.db import models
from django.utils.translation import ugettext as _
from development.models import Project
class ModeratedProject(Project):
"""
Project awaiting moderation. Registered Users not belonging to
any group have their edits created using a ModeratedProject as
opposed to a Project.... | from django.db import models
from django.utils.translation import ugettext as _
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from development.models import Project
class ModeratedProject(Project):
"""
Project awaiting moderation. Registered Users no... | Use ContentType for more abstract moderation | Use ContentType for more abstract moderation
| Python | bsd-3-clause | MAPC/developmentdatabase-python,MAPC/warren-st-development-database,MAPC/developmentdatabase-python,MAPC/warren-st-development-database | from django.db import models
from django.utils.translation import ugettext as _
from development.models import Project
class ModeratedProject(Project):
"""
Project awaiting moderation. Registered Users not belonging to
any group have their edits created using a ModeratedProject as
opposed to a Project.... | from django.db import models
from django.utils.translation import ugettext as _
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from development.models import Project
class ModeratedProject(Project):
"""
Project awaiting moderation. Registered Users no... | <commit_before>from django.db import models
from django.utils.translation import ugettext as _
from development.models import Project
class ModeratedProject(Project):
"""
Project awaiting moderation. Registered Users not belonging to
any group have their edits created using a ModeratedProject as
oppose... | from django.db import models
from django.utils.translation import ugettext as _
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from development.models import Project
class ModeratedProject(Project):
"""
Project awaiting moderation. Registered Users no... | from django.db import models
from django.utils.translation import ugettext as _
from development.models import Project
class ModeratedProject(Project):
"""
Project awaiting moderation. Registered Users not belonging to
any group have their edits created using a ModeratedProject as
opposed to a Project.... | <commit_before>from django.db import models
from django.utils.translation import ugettext as _
from development.models import Project
class ModeratedProject(Project):
"""
Project awaiting moderation. Registered Users not belonging to
any group have their edits created using a ModeratedProject as
oppose... |
e8537feff53310913047d06d95f4dd8e9dace1da | flow_workflow/historian/handler.py | flow_workflow/historian/handler.py | from flow import exit_codes
from flow.configuration.settings.injector import setting
from flow.handler import Handler
from flow.util.exit import exit_process
from flow_workflow.historian.messages import UpdateMessage
from injector import inject
from sqlalchemy.exc import ResourceClosedError, TimeoutError, Disconnection... | from flow import exit_codes
from flow.configuration.settings.injector import setting
from flow.handler import Handler
from flow.util.exit import exit_process
from flow_workflow.historian.messages import UpdateMessage
from injector import inject
from sqlalchemy.exc import ResourceClosedError, TimeoutError, Disconnection... | Add DatabaseError to list of errors that kill a historian | Add DatabaseError to list of errors that kill a historian
| Python | agpl-3.0 | genome/flow-workflow,genome/flow-workflow,genome/flow-workflow | from flow import exit_codes
from flow.configuration.settings.injector import setting
from flow.handler import Handler
from flow.util.exit import exit_process
from flow_workflow.historian.messages import UpdateMessage
from injector import inject
from sqlalchemy.exc import ResourceClosedError, TimeoutError, Disconnection... | from flow import exit_codes
from flow.configuration.settings.injector import setting
from flow.handler import Handler
from flow.util.exit import exit_process
from flow_workflow.historian.messages import UpdateMessage
from injector import inject
from sqlalchemy.exc import ResourceClosedError, TimeoutError, Disconnection... | <commit_before>from flow import exit_codes
from flow.configuration.settings.injector import setting
from flow.handler import Handler
from flow.util.exit import exit_process
from flow_workflow.historian.messages import UpdateMessage
from injector import inject
from sqlalchemy.exc import ResourceClosedError, TimeoutError... | from flow import exit_codes
from flow.configuration.settings.injector import setting
from flow.handler import Handler
from flow.util.exit import exit_process
from flow_workflow.historian.messages import UpdateMessage
from injector import inject
from sqlalchemy.exc import ResourceClosedError, TimeoutError, Disconnection... | from flow import exit_codes
from flow.configuration.settings.injector import setting
from flow.handler import Handler
from flow.util.exit import exit_process
from flow_workflow.historian.messages import UpdateMessage
from injector import inject
from sqlalchemy.exc import ResourceClosedError, TimeoutError, Disconnection... | <commit_before>from flow import exit_codes
from flow.configuration.settings.injector import setting
from flow.handler import Handler
from flow.util.exit import exit_process
from flow_workflow.historian.messages import UpdateMessage
from injector import inject
from sqlalchemy.exc import ResourceClosedError, TimeoutError... |
f727a71accdc8a12342fcb684c9ba718eedd8df2 | alexandria/traversal/__init__.py | alexandria/traversal/__init__.py | class Root(object):
"""
The main root object for any traversal
"""
__name__ = None
__parent__ = None
def __init__(self, request):
pass
def __getitem__(self, key):
next_ctx = None
if key == 'user':
next_ctx = User()
if key == 'domain':
... | class Root(object):
"""
The main root object for any traversal
"""
__name__ = None
__parent__ = None
def __init__(self, request):
pass
def __getitem__(self, key):
next_ctx = None
if key == 'user':
next_ctx = User()
if key == 'domain':
... | Set the __name__ on the traversal object | Set the __name__ on the traversal object
| Python | isc | cdunklau/alexandria,bertjwregeer/alexandria,bertjwregeer/alexandria,cdunklau/alexandria,cdunklau/alexandria | class Root(object):
"""
The main root object for any traversal
"""
__name__ = None
__parent__ = None
def __init__(self, request):
pass
def __getitem__(self, key):
next_ctx = None
if key == 'user':
next_ctx = User()
if key == 'domain':
... | class Root(object):
"""
The main root object for any traversal
"""
__name__ = None
__parent__ = None
def __init__(self, request):
pass
def __getitem__(self, key):
next_ctx = None
if key == 'user':
next_ctx = User()
if key == 'domain':
... | <commit_before>class Root(object):
"""
The main root object for any traversal
"""
__name__ = None
__parent__ = None
def __init__(self, request):
pass
def __getitem__(self, key):
next_ctx = None
if key == 'user':
next_ctx = User()
if key == 'd... | class Root(object):
"""
The main root object for any traversal
"""
__name__ = None
__parent__ = None
def __init__(self, request):
pass
def __getitem__(self, key):
next_ctx = None
if key == 'user':
next_ctx = User()
if key == 'domain':
... | class Root(object):
"""
The main root object for any traversal
"""
__name__ = None
__parent__ = None
def __init__(self, request):
pass
def __getitem__(self, key):
next_ctx = None
if key == 'user':
next_ctx = User()
if key == 'domain':
... | <commit_before>class Root(object):
"""
The main root object for any traversal
"""
__name__ = None
__parent__ = None
def __init__(self, request):
pass
def __getitem__(self, key):
next_ctx = None
if key == 'user':
next_ctx = User()
if key == 'd... |
643f3d1f89f9c69ed519e753360fa15b23e9bb1d | ankieta/petition_custom/forms.py | ankieta/petition_custom/forms.py | from petition.forms import BaseSignatureForm
from crispy_forms.layout import Layout
from crispy_forms.bootstrap import PrependedText
class SignatureForm(BaseSignatureForm):
def __init__(self, *args, **kwargs):
super(SignatureForm, self).__init__(*args, **kwargs)
self.helper.layout = Layout(
... | from petition.forms import BaseSignatureForm
from crispy_forms.layout import Layout
from crispy_forms.bootstrap import PrependedText
import swapper
Signature = swapper.load_model("petition", "Signature")
class SignatureForm(BaseSignatureForm):
def __init__(self, *args, **kwargs):
super(SignatureForm, sel... | Fix model definition in signature form | Fix model definition in signature form
| Python | bsd-3-clause | ad-m/petycja-faoo,ad-m/petycja-faoo,ad-m/petycja-faoo | from petition.forms import BaseSignatureForm
from crispy_forms.layout import Layout
from crispy_forms.bootstrap import PrependedText
class SignatureForm(BaseSignatureForm):
def __init__(self, *args, **kwargs):
super(SignatureForm, self).__init__(*args, **kwargs)
self.helper.layout = Layout(
... | from petition.forms import BaseSignatureForm
from crispy_forms.layout import Layout
from crispy_forms.bootstrap import PrependedText
import swapper
Signature = swapper.load_model("petition", "Signature")
class SignatureForm(BaseSignatureForm):
def __init__(self, *args, **kwargs):
super(SignatureForm, sel... | <commit_before>from petition.forms import BaseSignatureForm
from crispy_forms.layout import Layout
from crispy_forms.bootstrap import PrependedText
class SignatureForm(BaseSignatureForm):
def __init__(self, *args, **kwargs):
super(SignatureForm, self).__init__(*args, **kwargs)
self.helper.layout =... | from petition.forms import BaseSignatureForm
from crispy_forms.layout import Layout
from crispy_forms.bootstrap import PrependedText
import swapper
Signature = swapper.load_model("petition", "Signature")
class SignatureForm(BaseSignatureForm):
def __init__(self, *args, **kwargs):
super(SignatureForm, sel... | from petition.forms import BaseSignatureForm
from crispy_forms.layout import Layout
from crispy_forms.bootstrap import PrependedText
class SignatureForm(BaseSignatureForm):
def __init__(self, *args, **kwargs):
super(SignatureForm, self).__init__(*args, **kwargs)
self.helper.layout = Layout(
... | <commit_before>from petition.forms import BaseSignatureForm
from crispy_forms.layout import Layout
from crispy_forms.bootstrap import PrependedText
class SignatureForm(BaseSignatureForm):
def __init__(self, *args, **kwargs):
super(SignatureForm, self).__init__(*args, **kwargs)
self.helper.layout =... |
52cb99d09cd71efa0e4fc5f5554fc948410315a1 | txircd/modules/cmode_k.py | txircd/modules/cmode_k.py | from twisted.words.protocols import irc
from txircd.modbase import Mode
class PasswordMode(Mode):
def commandPermission(self, user, cmd, data):
if cmd != "JOIN":
return data
channels = data["targetchan"]
keys = data["keys"]
removeChannels = []
for index, chan in channels.enumerate():
if "k" in chan.mo... | from twisted.words.protocols import irc
from txircd.modbase import Mode
class PasswordMode(Mode):
def checkUnset(self, user, target, param):
if param == target.mode["k"]:
return True
return False
def commandPermission(self, user, cmd, data):
if cmd != "JOIN":
return data
channels = data["targetchan"]... | Check that the password parameter when unsetting mode k matches the password that is set | Check that the password parameter when unsetting mode k matches the password that is set
| Python | bsd-3-clause | ElementalAlchemist/txircd,DesertBus/txircd,Heufneutje/txircd | from twisted.words.protocols import irc
from txircd.modbase import Mode
class PasswordMode(Mode):
def commandPermission(self, user, cmd, data):
if cmd != "JOIN":
return data
channels = data["targetchan"]
keys = data["keys"]
removeChannels = []
for index, chan in channels.enumerate():
if "k" in chan.mo... | from twisted.words.protocols import irc
from txircd.modbase import Mode
class PasswordMode(Mode):
def checkUnset(self, user, target, param):
if param == target.mode["k"]:
return True
return False
def commandPermission(self, user, cmd, data):
if cmd != "JOIN":
return data
channels = data["targetchan"]... | <commit_before>from twisted.words.protocols import irc
from txircd.modbase import Mode
class PasswordMode(Mode):
def commandPermission(self, user, cmd, data):
if cmd != "JOIN":
return data
channels = data["targetchan"]
keys = data["keys"]
removeChannels = []
for index, chan in channels.enumerate():
if... | from twisted.words.protocols import irc
from txircd.modbase import Mode
class PasswordMode(Mode):
def checkUnset(self, user, target, param):
if param == target.mode["k"]:
return True
return False
def commandPermission(self, user, cmd, data):
if cmd != "JOIN":
return data
channels = data["targetchan"]... | from twisted.words.protocols import irc
from txircd.modbase import Mode
class PasswordMode(Mode):
def commandPermission(self, user, cmd, data):
if cmd != "JOIN":
return data
channels = data["targetchan"]
keys = data["keys"]
removeChannels = []
for index, chan in channels.enumerate():
if "k" in chan.mo... | <commit_before>from twisted.words.protocols import irc
from txircd.modbase import Mode
class PasswordMode(Mode):
def commandPermission(self, user, cmd, data):
if cmd != "JOIN":
return data
channels = data["targetchan"]
keys = data["keys"]
removeChannels = []
for index, chan in channels.enumerate():
if... |
9edaa9a843ab4e93deaf1e3b1c09d26e5eadf62d | tests/test_acceptance.py | tests/test_acceptance.py | import pytest
@pytest.mark.django_db
def test_homepage(client):
response = client.get('/')
assert response.status_code == 200
| import pytest
@pytest.mark.django_db
def test_homepage(client):
response = client.get('/')
assert response.status_code == 200
@pytest.mark.django_db
def test_resultspage_2012(client):
response = client.get('/results2012/')
assert response.status_code == 200
assert '2012: how it was' in response.... | Add acceptance tests for results pages (2012 and 2013) | Add acceptance tests for results pages (2012 and 2013)
| Python | unlicense | nott/next.filmfest.by,nott/next.filmfest.by,kinaklub/next.filmfest.by,kinaklub/next.filmfest.by,nott/next.filmfest.by,kinaklub/next.filmfest.by,kinaklub/next.filmfest.by,nott/next.filmfest.by | import pytest
@pytest.mark.django_db
def test_homepage(client):
response = client.get('/')
assert response.status_code == 200
Add acceptance tests for results pages (2012 and 2013) | import pytest
@pytest.mark.django_db
def test_homepage(client):
response = client.get('/')
assert response.status_code == 200
@pytest.mark.django_db
def test_resultspage_2012(client):
response = client.get('/results2012/')
assert response.status_code == 200
assert '2012: how it was' in response.... | <commit_before>import pytest
@pytest.mark.django_db
def test_homepage(client):
response = client.get('/')
assert response.status_code == 200
<commit_msg>Add acceptance tests for results pages (2012 and 2013)<commit_after> | import pytest
@pytest.mark.django_db
def test_homepage(client):
response = client.get('/')
assert response.status_code == 200
@pytest.mark.django_db
def test_resultspage_2012(client):
response = client.get('/results2012/')
assert response.status_code == 200
assert '2012: how it was' in response.... | import pytest
@pytest.mark.django_db
def test_homepage(client):
response = client.get('/')
assert response.status_code == 200
Add acceptance tests for results pages (2012 and 2013)import pytest
@pytest.mark.django_db
def test_homepage(client):
response = client.get('/')
assert response.status_code =... | <commit_before>import pytest
@pytest.mark.django_db
def test_homepage(client):
response = client.get('/')
assert response.status_code == 200
<commit_msg>Add acceptance tests for results pages (2012 and 2013)<commit_after>import pytest
@pytest.mark.django_db
def test_homepage(client):
response = client.g... |
c6a161b5c0fa3d76b09b34dfab8f057e8b10bce2 | tests/test_extensions.py | tests/test_extensions.py | import unittest
class TestExtensions(unittest.TestCase):
def test_import_extension(self):
import pybel.ext.test
assert pybel.ext.test.an_extension_function() == 42
def test_import_extension_2(self):
from pybel.ext.test import an_extension_function
assert an_extension_functio... | import unittest
class TestExtensions(unittest.TestCase):
def test_import_extension(self):
import pybel.ext.test
assert pybel.ext.test.an_extension_function() == 42
def test_import_extension_2(self):
from pybel.ext.test import an_extension_function
assert an_extension_functio... | Add a test for importing a nonexistent extension | Add a test for importing a nonexistent extension
| Python | mit | pybel/pybel,pybel/pybel,pybel/pybel | import unittest
class TestExtensions(unittest.TestCase):
def test_import_extension(self):
import pybel.ext.test
assert pybel.ext.test.an_extension_function() == 42
def test_import_extension_2(self):
from pybel.ext.test import an_extension_function
assert an_extension_functio... | import unittest
class TestExtensions(unittest.TestCase):
def test_import_extension(self):
import pybel.ext.test
assert pybel.ext.test.an_extension_function() == 42
def test_import_extension_2(self):
from pybel.ext.test import an_extension_function
assert an_extension_functio... | <commit_before>import unittest
class TestExtensions(unittest.TestCase):
def test_import_extension(self):
import pybel.ext.test
assert pybel.ext.test.an_extension_function() == 42
def test_import_extension_2(self):
from pybel.ext.test import an_extension_function
assert an_ex... | import unittest
class TestExtensions(unittest.TestCase):
def test_import_extension(self):
import pybel.ext.test
assert pybel.ext.test.an_extension_function() == 42
def test_import_extension_2(self):
from pybel.ext.test import an_extension_function
assert an_extension_functio... | import unittest
class TestExtensions(unittest.TestCase):
def test_import_extension(self):
import pybel.ext.test
assert pybel.ext.test.an_extension_function() == 42
def test_import_extension_2(self):
from pybel.ext.test import an_extension_function
assert an_extension_functio... | <commit_before>import unittest
class TestExtensions(unittest.TestCase):
def test_import_extension(self):
import pybel.ext.test
assert pybel.ext.test.an_extension_function() == 42
def test_import_extension_2(self):
from pybel.ext.test import an_extension_function
assert an_ex... |
d62f04e11715d93a2281f2f69d3a9e3323a6d1c4 | timemodel/tempo_event.py | timemodel/tempo_event.py | """
File: tempo_event.py
Purpose: Defines a tempo as an Event
"""
from timemodel.event import Event
class TempoEvent(Event):
"""
Defines tempo as an Event, given a Tempo and a time position.
"""
def __init__(self, tempo, time):
"""
Constructor.
Args:
te... | """
File: tempo_event.py
Purpose: Defines a tempo as an Event
"""
from timemodel.event import Event
from timemodel.position import Position
class TempoEvent(Event):
"""
Defines tempo as an Event, given a Tempo and a time position.
"""
def __init__(self, tempo, time):
"""
Construc... | Check time argument as Position type. | Check time argument as Position type.
| Python | mit | dpazel/music_rep | """
File: tempo_event.py
Purpose: Defines a tempo as an Event
"""
from timemodel.event import Event
class TempoEvent(Event):
"""
Defines tempo as an Event, given a Tempo and a time position.
"""
def __init__(self, tempo, time):
"""
Constructor.
Args:
te... | """
File: tempo_event.py
Purpose: Defines a tempo as an Event
"""
from timemodel.event import Event
from timemodel.position import Position
class TempoEvent(Event):
"""
Defines tempo as an Event, given a Tempo and a time position.
"""
def __init__(self, tempo, time):
"""
Construc... | <commit_before>"""
File: tempo_event.py
Purpose: Defines a tempo as an Event
"""
from timemodel.event import Event
class TempoEvent(Event):
"""
Defines tempo as an Event, given a Tempo and a time position.
"""
def __init__(self, tempo, time):
"""
Constructor.
Arg... | """
File: tempo_event.py
Purpose: Defines a tempo as an Event
"""
from timemodel.event import Event
from timemodel.position import Position
class TempoEvent(Event):
"""
Defines tempo as an Event, given a Tempo and a time position.
"""
def __init__(self, tempo, time):
"""
Construc... | """
File: tempo_event.py
Purpose: Defines a tempo as an Event
"""
from timemodel.event import Event
class TempoEvent(Event):
"""
Defines tempo as an Event, given a Tempo and a time position.
"""
def __init__(self, tempo, time):
"""
Constructor.
Args:
te... | <commit_before>"""
File: tempo_event.py
Purpose: Defines a tempo as an Event
"""
from timemodel.event import Event
class TempoEvent(Event):
"""
Defines tempo as an Event, given a Tempo and a time position.
"""
def __init__(self, tempo, time):
"""
Constructor.
Arg... |
7f2acf1b27dadc33e83fd02d5023b2d03e54821d | pavement.py | pavement.py | import paver
from paver.easy import *
import paver.setuputils
paver.setuputils.install_distutils_tasks()
import os, sys
from sphinxcontrib import paverutils
sys.path.append(os.getcwd())
updateProgressTables = True
try:
from runestone.server.chapternames import populateChapterInfob
except ImportError:
updateP... | import paver
from paver.easy import *
import paver.setuputils
paver.setuputils.install_distutils_tasks()
import os, sys
from sphinxcontrib import paverutils
sys.path.append(os.getcwd())
updateProgressTables = True
try:
from runestone.server.chapternames import populateChapterInfob
except ImportError:
updateP... | Change project name to cljsbook. | Change project name to cljsbook.
| Python | apache-2.0 | jdeisenberg/icljs,jdeisenberg/icljs | import paver
from paver.easy import *
import paver.setuputils
paver.setuputils.install_distutils_tasks()
import os, sys
from sphinxcontrib import paverutils
sys.path.append(os.getcwd())
updateProgressTables = True
try:
from runestone.server.chapternames import populateChapterInfob
except ImportError:
updateP... | import paver
from paver.easy import *
import paver.setuputils
paver.setuputils.install_distutils_tasks()
import os, sys
from sphinxcontrib import paverutils
sys.path.append(os.getcwd())
updateProgressTables = True
try:
from runestone.server.chapternames import populateChapterInfob
except ImportError:
updateP... | <commit_before>import paver
from paver.easy import *
import paver.setuputils
paver.setuputils.install_distutils_tasks()
import os, sys
from sphinxcontrib import paverutils
sys.path.append(os.getcwd())
updateProgressTables = True
try:
from runestone.server.chapternames import populateChapterInfob
except ImportErr... | import paver
from paver.easy import *
import paver.setuputils
paver.setuputils.install_distutils_tasks()
import os, sys
from sphinxcontrib import paverutils
sys.path.append(os.getcwd())
updateProgressTables = True
try:
from runestone.server.chapternames import populateChapterInfob
except ImportError:
updateP... | import paver
from paver.easy import *
import paver.setuputils
paver.setuputils.install_distutils_tasks()
import os, sys
from sphinxcontrib import paverutils
sys.path.append(os.getcwd())
updateProgressTables = True
try:
from runestone.server.chapternames import populateChapterInfob
except ImportError:
updateP... | <commit_before>import paver
from paver.easy import *
import paver.setuputils
paver.setuputils.install_distutils_tasks()
import os, sys
from sphinxcontrib import paverutils
sys.path.append(os.getcwd())
updateProgressTables = True
try:
from runestone.server.chapternames import populateChapterInfob
except ImportErr... |
7a63a17145804e465b3f6ba2e329fb17f5c2864b | svpb/activeTest.py | svpb/activeTest.py | from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import login_required, user_passes_test
def active_and_login_required(function=None,
redirect_field_name=REDIRECT_FIELD_NAME,
login_url=None):
actual_decorator = user_... | from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import login_required, user_passes_test
def active_and_login_required(function=None,
redirect_field_name=REDIRECT_FIELD_NAME,
login_url="/login"):
actual_decorator = u... | Use "/login" as default URL where to redirect URLs when not logged in. | Use "/login" as default URL where to redirect URLs when not logged in.
Could use "/" as alternative as well...
| Python | apache-2.0 | hkarl/svpb,hkarl/svpb,hkarl/svpb,hkarl/svpb | from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import login_required, user_passes_test
def active_and_login_required(function=None,
redirect_field_name=REDIRECT_FIELD_NAME,
login_url=None):
actual_decorator = user_... | from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import login_required, user_passes_test
def active_and_login_required(function=None,
redirect_field_name=REDIRECT_FIELD_NAME,
login_url="/login"):
actual_decorator = u... | <commit_before>from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import login_required, user_passes_test
def active_and_login_required(function=None,
redirect_field_name=REDIRECT_FIELD_NAME,
login_url=None):
actual_de... | from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import login_required, user_passes_test
def active_and_login_required(function=None,
redirect_field_name=REDIRECT_FIELD_NAME,
login_url="/login"):
actual_decorator = u... | from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import login_required, user_passes_test
def active_and_login_required(function=None,
redirect_field_name=REDIRECT_FIELD_NAME,
login_url=None):
actual_decorator = user_... | <commit_before>from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import login_required, user_passes_test
def active_and_login_required(function=None,
redirect_field_name=REDIRECT_FIELD_NAME,
login_url=None):
actual_de... |
23e36b51e6b0af7376f489bd3a5b997d7ca545a3 | cura_app.py | cura_app.py | #!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import sys
def exceptHook(type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show(type, value, traceback)
sys.excepthook = exceptHook
import cura.CuraApplication
if sys.p... | #!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import sys
def exceptHook(type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show(type, value, traceback)
sys.excepthook = exceptHook
import cura.CuraApplication
if sys.p... | Fix stdout/stderr output location so we do not output to UM but to cura | Fix stdout/stderr output location so we do not output to UM but to cura
Fixes #452
| Python | agpl-3.0 | hmflash/Cura,ynotstartups/Wanhao,Curahelper/Cura,markwal/Cura,totalretribution/Cura,markwal/Cura,fieldOfView/Cura,fieldOfView/Cura,hmflash/Cura,senttech/Cura,bq/Ultimaker-Cura,ad1217/Cura,ad1217/Cura,Curahelper/Cura,bq/Ultimaker-Cura,totalretribution/Cura,senttech/Cura,ynotstartups/Wanhao | #!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import sys
def exceptHook(type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show(type, value, traceback)
sys.excepthook = exceptHook
import cura.CuraApplication
if sys.p... | #!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import sys
def exceptHook(type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show(type, value, traceback)
sys.excepthook = exceptHook
import cura.CuraApplication
if sys.p... | <commit_before>#!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import sys
def exceptHook(type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show(type, value, traceback)
sys.excepthook = exceptHook
import cura.CuraApplic... | #!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import sys
def exceptHook(type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show(type, value, traceback)
sys.excepthook = exceptHook
import cura.CuraApplication
if sys.p... | #!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import sys
def exceptHook(type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show(type, value, traceback)
sys.excepthook = exceptHook
import cura.CuraApplication
if sys.p... | <commit_before>#!/usr/bin/env python3
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import sys
def exceptHook(type, value, traceback):
import cura.CrashHandler
cura.CrashHandler.show(type, value, traceback)
sys.excepthook = exceptHook
import cura.CuraApplic... |
fa7cd74318524a55c5b9d910ac7b37d69b8a4a99 | puzzles/triangles_printing/python.py | puzzles/triangles_printing/python.py | // range
r = 9
bound = round(r/2)
for y in range(r):
for x in range(r):
if (x >= bound-y AND x <= bound+y):
print("*", end='')
else:
print(" ", end='')
print();
| # range
r = 9
bound = round(r/2)
for y in range(r):
for x in range(r):
if (x >= bound-y AND x <= bound+y):
print("*", end='')
else:
print(" ", end='')
print();
| Fix Python syntax error in triangles_printing | Fix Python syntax error in triangles_printing | Python | cc0-1.0 | ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs... | // range
r = 9
bound = round(r/2)
for y in range(r):
for x in range(r):
if (x >= bound-y AND x <= bound+y):
print("*", end='')
else:
print(" ", end='')
print();
Fix Python syntax error in triangles_printing | # range
r = 9
bound = round(r/2)
for y in range(r):
for x in range(r):
if (x >= bound-y AND x <= bound+y):
print("*", end='')
else:
print(" ", end='')
print();
| <commit_before>// range
r = 9
bound = round(r/2)
for y in range(r):
for x in range(r):
if (x >= bound-y AND x <= bound+y):
print("*", end='')
else:
print(" ", end='')
print();
<commit_msg>Fix Python syntax error in triangles_printing<commit_after> | # range
r = 9
bound = round(r/2)
for y in range(r):
for x in range(r):
if (x >= bound-y AND x <= bound+y):
print("*", end='')
else:
print(" ", end='')
print();
| // range
r = 9
bound = round(r/2)
for y in range(r):
for x in range(r):
if (x >= bound-y AND x <= bound+y):
print("*", end='')
else:
print(" ", end='')
print();
Fix Python syntax error in triangles_printing# range
r = 9
bound = round(r/2)
for y in range(r):
for x in range(r):
if (x >= bo... | <commit_before>// range
r = 9
bound = round(r/2)
for y in range(r):
for x in range(r):
if (x >= bound-y AND x <= bound+y):
print("*", end='')
else:
print(" ", end='')
print();
<commit_msg>Fix Python syntax error in triangles_printing<commit_after># range
r = 9
bound = round(r/2)
for y in range... |
30fb89681658e0861ba2ff5bb76db81732024979 | nb_classifier.py | nb_classifier.py | from feature_format import featureFormat, targetFeatureSplit
import pickle
from sklearn.naive_bayes import GaussianNB
# loading the enron data dictionary
with open("final_project_dataset.pkl", "r") as data_file:
data_dict = pickle.load(data_file)
# removing 'TOTAL' outlier
del data_dict['TOTAL']
# selecting only... | from feature_format import featureFormat, targetFeatureSplit
import pickle
from sklearn.naive_bayes import GaussianNB
from sklearn.cross_validation import KFold
from sklearn.metrics import precision_score, recall_score, f1_score
import numpy as np
# loading the enron data dictionary
with open("final_project_dataset.pk... | Add KFold cross validation and evaluation metrics to GaussianNB | feat: Add KFold cross validation and evaluation metrics to GaussianNB
| Python | mit | rjegankumar/enron_email_fraud_identification | from feature_format import featureFormat, targetFeatureSplit
import pickle
from sklearn.naive_bayes import GaussianNB
# loading the enron data dictionary
with open("final_project_dataset.pkl", "r") as data_file:
data_dict = pickle.load(data_file)
# removing 'TOTAL' outlier
del data_dict['TOTAL']
# selecting only... | from feature_format import featureFormat, targetFeatureSplit
import pickle
from sklearn.naive_bayes import GaussianNB
from sklearn.cross_validation import KFold
from sklearn.metrics import precision_score, recall_score, f1_score
import numpy as np
# loading the enron data dictionary
with open("final_project_dataset.pk... | <commit_before>from feature_format import featureFormat, targetFeatureSplit
import pickle
from sklearn.naive_bayes import GaussianNB
# loading the enron data dictionary
with open("final_project_dataset.pkl", "r") as data_file:
data_dict = pickle.load(data_file)
# removing 'TOTAL' outlier
del data_dict['TOTAL']
#... | from feature_format import featureFormat, targetFeatureSplit
import pickle
from sklearn.naive_bayes import GaussianNB
from sklearn.cross_validation import KFold
from sklearn.metrics import precision_score, recall_score, f1_score
import numpy as np
# loading the enron data dictionary
with open("final_project_dataset.pk... | from feature_format import featureFormat, targetFeatureSplit
import pickle
from sklearn.naive_bayes import GaussianNB
# loading the enron data dictionary
with open("final_project_dataset.pkl", "r") as data_file:
data_dict = pickle.load(data_file)
# removing 'TOTAL' outlier
del data_dict['TOTAL']
# selecting only... | <commit_before>from feature_format import featureFormat, targetFeatureSplit
import pickle
from sklearn.naive_bayes import GaussianNB
# loading the enron data dictionary
with open("final_project_dataset.pkl", "r") as data_file:
data_dict = pickle.load(data_file)
# removing 'TOTAL' outlier
del data_dict['TOTAL']
#... |
bfc50caf2ad967fa930faf34c6cac6b20b7fd4a7 | nn/embedding/id_sequence_to_embedding.py | nn/embedding/id_sequence_to_embedding.py | from .ids_to_embeddings import ids_to_embeddings
from .embeddings_to_embedding import embeddings_to_embedding
from ..util import static_rank
def id_sequecne_to_embedding(child_id_sequence,
*,
output_embedding_size,
context_vector_s... | from .ids_to_embeddings import ids_to_embeddings
from .embeddings_to_embedding import embeddings_to_embedding
from ..util import static_rank
def id_sequecne_to_embedding(child_id_sequence,
child_embeddings,
*,
output_embedding_size... | Fix missing argument of child embeddings | Fix missing argument of child embeddings
| Python | unlicense | raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten | from .ids_to_embeddings import ids_to_embeddings
from .embeddings_to_embedding import embeddings_to_embedding
from ..util import static_rank
def id_sequecne_to_embedding(child_id_sequence,
*,
output_embedding_size,
context_vector_s... | from .ids_to_embeddings import ids_to_embeddings
from .embeddings_to_embedding import embeddings_to_embedding
from ..util import static_rank
def id_sequecne_to_embedding(child_id_sequence,
child_embeddings,
*,
output_embedding_size... | <commit_before>from .ids_to_embeddings import ids_to_embeddings
from .embeddings_to_embedding import embeddings_to_embedding
from ..util import static_rank
def id_sequecne_to_embedding(child_id_sequence,
*,
output_embedding_size,
c... | from .ids_to_embeddings import ids_to_embeddings
from .embeddings_to_embedding import embeddings_to_embedding
from ..util import static_rank
def id_sequecne_to_embedding(child_id_sequence,
child_embeddings,
*,
output_embedding_size... | from .ids_to_embeddings import ids_to_embeddings
from .embeddings_to_embedding import embeddings_to_embedding
from ..util import static_rank
def id_sequecne_to_embedding(child_id_sequence,
*,
output_embedding_size,
context_vector_s... | <commit_before>from .ids_to_embeddings import ids_to_embeddings
from .embeddings_to_embedding import embeddings_to_embedding
from ..util import static_rank
def id_sequecne_to_embedding(child_id_sequence,
*,
output_embedding_size,
c... |
083a9b4959feab6afe78509ed78cb60c44564cc2 | python/convert_line_endings.py | python/convert_line_endings.py | #!/usr/bin/python
import os
import sys
def convert_line_endings(file):
if '\r\n' in open(file, 'rb').read():
print '%s contains DOS line endings. Converting' % file
with open(file, 'rb') as infile:
text = infile.read()
text = text.replace('\r\n', '\n')
with open(fil... | #!/usr/bin/python
import os
import sys
def convert_line_endings(file):
if '\r\n' in open(file, 'rb').read():
print '%s contains DOS line endings. Converting' % file
with open(file, 'rb') as infile:
text = infile.read()
text = text.replace('\r\n', '\n')
with open(fil... | Convert line endings on Objective C/C++ test source too | [trunk] Convert line endings on Objective C/C++ test source too
| Python | bsd-3-clause | markfinal/BuildAMation,markfinal/BuildAMation,markfinal/BuildAMation,markfinal/BuildAMation,markfinal/BuildAMation | #!/usr/bin/python
import os
import sys
def convert_line_endings(file):
if '\r\n' in open(file, 'rb').read():
print '%s contains DOS line endings. Converting' % file
with open(file, 'rb') as infile:
text = infile.read()
text = text.replace('\r\n', '\n')
with open(fil... | #!/usr/bin/python
import os
import sys
def convert_line_endings(file):
if '\r\n' in open(file, 'rb').read():
print '%s contains DOS line endings. Converting' % file
with open(file, 'rb') as infile:
text = infile.read()
text = text.replace('\r\n', '\n')
with open(fil... | <commit_before>#!/usr/bin/python
import os
import sys
def convert_line_endings(file):
if '\r\n' in open(file, 'rb').read():
print '%s contains DOS line endings. Converting' % file
with open(file, 'rb') as infile:
text = infile.read()
text = text.replace('\r\n', '\n')
... | #!/usr/bin/python
import os
import sys
def convert_line_endings(file):
if '\r\n' in open(file, 'rb').read():
print '%s contains DOS line endings. Converting' % file
with open(file, 'rb') as infile:
text = infile.read()
text = text.replace('\r\n', '\n')
with open(fil... | #!/usr/bin/python
import os
import sys
def convert_line_endings(file):
if '\r\n' in open(file, 'rb').read():
print '%s contains DOS line endings. Converting' % file
with open(file, 'rb') as infile:
text = infile.read()
text = text.replace('\r\n', '\n')
with open(fil... | <commit_before>#!/usr/bin/python
import os
import sys
def convert_line_endings(file):
if '\r\n' in open(file, 'rb').read():
print '%s contains DOS line endings. Converting' % file
with open(file, 'rb') as infile:
text = infile.read()
text = text.replace('\r\n', '\n')
... |
b21503105b9f8bc1eb21b62778963f23dd794de0 | openacademy/model/openacademy_session.py | openacademy/model/openacademy_session.py | # -*- coding: utf-8 -*-
from openerp import fields, models, api
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
in... | # -*- coding: utf-8 -*-
from openerp import fields, models, api
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
in... | Add domain or and ilike | [REF] openacademy: Add domain or and ilike
| Python | apache-2.0 | colorisa/openacademy-proyect | # -*- coding: utf-8 -*-
from openerp import fields, models, api
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
in... | # -*- coding: utf-8 -*-
from openerp import fields, models, api
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
in... | <commit_before># -*- coding: utf-8 -*-
from openerp import fields, models, api
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number ... | # -*- coding: utf-8 -*-
from openerp import fields, models, api
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
in... | # -*- coding: utf-8 -*-
from openerp import fields, models, api
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
in... | <commit_before># -*- coding: utf-8 -*-
from openerp import fields, models, api
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number ... |
7b7ffd10d17f1f6ea0c81c87e6ab19caa68cf68c | pavement.py | pavement.py | import subprocess
from paver.easy import *
def call(*args, **kwargs):
return subprocess.call(args, **kwargs)
@task
def push():
"""Install the app and start it."""
call('palm-package', '.')
call('palm-install', '--device=emulator', '-r', 'org.markpasc.paperplain')
call('palm-install', '--device=... | import subprocess
from paver.easy import *
def call(*args, **kwargs):
return subprocess.call(args, **kwargs)
@task
def build():
"""Package up the app."""
call('palm-package', '.')
@task
def halt():
call('palm-launch', '--device=emulator', '-c', 'org.markpasc.paperplain')
@task
@needs('halt')
def ... | Split up some of the paver tasks so we can build and uninstall a la carte | Split up some of the paver tasks so we can build and uninstall a la carte
| Python | mit | markpasc/paperplain,markpasc/paperplain | import subprocess
from paver.easy import *
def call(*args, **kwargs):
return subprocess.call(args, **kwargs)
@task
def push():
"""Install the app and start it."""
call('palm-package', '.')
call('palm-install', '--device=emulator', '-r', 'org.markpasc.paperplain')
call('palm-install', '--device=... | import subprocess
from paver.easy import *
def call(*args, **kwargs):
return subprocess.call(args, **kwargs)
@task
def build():
"""Package up the app."""
call('palm-package', '.')
@task
def halt():
call('palm-launch', '--device=emulator', '-c', 'org.markpasc.paperplain')
@task
@needs('halt')
def ... | <commit_before>import subprocess
from paver.easy import *
def call(*args, **kwargs):
return subprocess.call(args, **kwargs)
@task
def push():
"""Install the app and start it."""
call('palm-package', '.')
call('palm-install', '--device=emulator', '-r', 'org.markpasc.paperplain')
call('palm-insta... | import subprocess
from paver.easy import *
def call(*args, **kwargs):
return subprocess.call(args, **kwargs)
@task
def build():
"""Package up the app."""
call('palm-package', '.')
@task
def halt():
call('palm-launch', '--device=emulator', '-c', 'org.markpasc.paperplain')
@task
@needs('halt')
def ... | import subprocess
from paver.easy import *
def call(*args, **kwargs):
return subprocess.call(args, **kwargs)
@task
def push():
"""Install the app and start it."""
call('palm-package', '.')
call('palm-install', '--device=emulator', '-r', 'org.markpasc.paperplain')
call('palm-install', '--device=... | <commit_before>import subprocess
from paver.easy import *
def call(*args, **kwargs):
return subprocess.call(args, **kwargs)
@task
def push():
"""Install the app and start it."""
call('palm-package', '.')
call('palm-install', '--device=emulator', '-r', 'org.markpasc.paperplain')
call('palm-insta... |
ebbea9212fc9cc3debb5300c2d008c653cc75af7 | dartcms/apps/dicts/views.py | dartcms/apps/dicts/views.py | # coding: utf-8
from django.forms.models import modelform_factory
from django.http import Http404
from dartcms import get_model
from dartcms.views import GridView, InsertObjectView, UpdateObjectView, DeleteObjectView
class DictsFormMixin(object):
def get_form_class(self):
return modelform_factory(self.mo... | # coding: utf-8
from django.forms.models import modelform_factory
from django.http import Http404
from dartcms import get_model
from dartcms.views import GridView, InsertObjectView, UpdateObjectView, DeleteObjectView
class DictsFormMixin(object):
def get_form_class(self):
return modelform_factory(self.mo... | Add search by name to dicts | Add search by name to dicts
| Python | mit | astrikov-d/dartcms,astrikov-d/dartcms,astrikov-d/dartcms | # coding: utf-8
from django.forms.models import modelform_factory
from django.http import Http404
from dartcms import get_model
from dartcms.views import GridView, InsertObjectView, UpdateObjectView, DeleteObjectView
class DictsFormMixin(object):
def get_form_class(self):
return modelform_factory(self.mo... | # coding: utf-8
from django.forms.models import modelform_factory
from django.http import Http404
from dartcms import get_model
from dartcms.views import GridView, InsertObjectView, UpdateObjectView, DeleteObjectView
class DictsFormMixin(object):
def get_form_class(self):
return modelform_factory(self.mo... | <commit_before># coding: utf-8
from django.forms.models import modelform_factory
from django.http import Http404
from dartcms import get_model
from dartcms.views import GridView, InsertObjectView, UpdateObjectView, DeleteObjectView
class DictsFormMixin(object):
def get_form_class(self):
return modelform_... | # coding: utf-8
from django.forms.models import modelform_factory
from django.http import Http404
from dartcms import get_model
from dartcms.views import GridView, InsertObjectView, UpdateObjectView, DeleteObjectView
class DictsFormMixin(object):
def get_form_class(self):
return modelform_factory(self.mo... | # coding: utf-8
from django.forms.models import modelform_factory
from django.http import Http404
from dartcms import get_model
from dartcms.views import GridView, InsertObjectView, UpdateObjectView, DeleteObjectView
class DictsFormMixin(object):
def get_form_class(self):
return modelform_factory(self.mo... | <commit_before># coding: utf-8
from django.forms.models import modelform_factory
from django.http import Http404
from dartcms import get_model
from dartcms.views import GridView, InsertObjectView, UpdateObjectView, DeleteObjectView
class DictsFormMixin(object):
def get_form_class(self):
return modelform_... |
abdfd4441cc40f5c698e12f8f6aaf1c405b171e2 | appengine_config.py | appengine_config.py | from google.appengine.ext import vendor
# Add any libraries installed in the "lib" folder.
vendor.add('lib')
| import os
import sys
from google.appengine.ext import vendor
# Add any libraries installed in the "lib" folder.
vendor.add('lib')
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) + os.sep
SHARED_SOURCE_DIRECTORIES = [
os.path.abspath(os.environ.get('ISB_CGC_COMMON_MODU... | Add shared code module path to Python module path | Add shared code module path to Python module path
| Python | apache-2.0 | isb-cgc/ISB-CGC-API,isb-cgc/ISB-CGC-API,isb-cgc/ISB-CGC-API | from google.appengine.ext import vendor
# Add any libraries installed in the "lib" folder.
vendor.add('lib')
Add shared code module path to Python module path | import os
import sys
from google.appengine.ext import vendor
# Add any libraries installed in the "lib" folder.
vendor.add('lib')
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) + os.sep
SHARED_SOURCE_DIRECTORIES = [
os.path.abspath(os.environ.get('ISB_CGC_COMMON_MODU... | <commit_before>from google.appengine.ext import vendor
# Add any libraries installed in the "lib" folder.
vendor.add('lib')
<commit_msg>Add shared code module path to Python module path<commit_after> | import os
import sys
from google.appengine.ext import vendor
# Add any libraries installed in the "lib" folder.
vendor.add('lib')
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) + os.sep
SHARED_SOURCE_DIRECTORIES = [
os.path.abspath(os.environ.get('ISB_CGC_COMMON_MODU... | from google.appengine.ext import vendor
# Add any libraries installed in the "lib" folder.
vendor.add('lib')
Add shared code module path to Python module pathimport os
import sys
from google.appengine.ext import vendor
# Add any libraries installed in the "lib" folder.
vendor.add('lib')
BASE_DIR = os.p... | <commit_before>from google.appengine.ext import vendor
# Add any libraries installed in the "lib" folder.
vendor.add('lib')
<commit_msg>Add shared code module path to Python module path<commit_after>import os
import sys
from google.appengine.ext import vendor
# Add any libraries installed in the "lib" folder.
vendor.a... |
b24094f979b90f087698d9696d661df7db857376 | moonlighty.py | moonlighty.py | #!flask/bin/python
from flask import Flask, render_template
from subprocess import Popen, PIPE
from flask.ext.script import Manager, Server
app = Flask(__name__)
manager = Manager(app)
manager.add_command("runserver", Server(host='0.0.0.0'))
@app.route('/')
def index():
return render_template('index.html')
@app... | #!venv/bin/python
from flask import Flask, render_template
from subprocess import Popen, PIPE
from flask.ext.script import Manager, Server
app = Flask(__name__)
manager = Manager(app)
manager.add_command("runserver", Server(host='0.0.0.0'))
@app.route('/')
def index():
return render_template('index.html')
@app.... | Add return value stating Steam was started | Add return value stating Steam was started
| Python | artistic-2.0 | VladimirDaniyan/moonlighty,VladimirDaniyan/moonlighty | #!flask/bin/python
from flask import Flask, render_template
from subprocess import Popen, PIPE
from flask.ext.script import Manager, Server
app = Flask(__name__)
manager = Manager(app)
manager.add_command("runserver", Server(host='0.0.0.0'))
@app.route('/')
def index():
return render_template('index.html')
@app... | #!venv/bin/python
from flask import Flask, render_template
from subprocess import Popen, PIPE
from flask.ext.script import Manager, Server
app = Flask(__name__)
manager = Manager(app)
manager.add_command("runserver", Server(host='0.0.0.0'))
@app.route('/')
def index():
return render_template('index.html')
@app.... | <commit_before>#!flask/bin/python
from flask import Flask, render_template
from subprocess import Popen, PIPE
from flask.ext.script import Manager, Server
app = Flask(__name__)
manager = Manager(app)
manager.add_command("runserver", Server(host='0.0.0.0'))
@app.route('/')
def index():
return render_template('ind... | #!venv/bin/python
from flask import Flask, render_template
from subprocess import Popen, PIPE
from flask.ext.script import Manager, Server
app = Flask(__name__)
manager = Manager(app)
manager.add_command("runserver", Server(host='0.0.0.0'))
@app.route('/')
def index():
return render_template('index.html')
@app.... | #!flask/bin/python
from flask import Flask, render_template
from subprocess import Popen, PIPE
from flask.ext.script import Manager, Server
app = Flask(__name__)
manager = Manager(app)
manager.add_command("runserver", Server(host='0.0.0.0'))
@app.route('/')
def index():
return render_template('index.html')
@app... | <commit_before>#!flask/bin/python
from flask import Flask, render_template
from subprocess import Popen, PIPE
from flask.ext.script import Manager, Server
app = Flask(__name__)
manager = Manager(app)
manager.add_command("runserver", Server(host='0.0.0.0'))
@app.route('/')
def index():
return render_template('ind... |
a5e3269b3e3d7f2b345473a7d22887cc2442524f | parafermions/tests/test_peschel_emery.py | parafermions/tests/test_peschel_emery.py | #!/usr/bin/env python
"""
Test the MPS class
"""
import unittest
import numpy as np
import parafermions as pf
class Test(unittest.TestCase):
def test_pe_degeneracy(self):
# should initialise with all zeros
N, l = 8, 0.2
pe = PeschelEmerySpinHalf(N, l, dtype=np.dtype('float64'))
d... | #!/usr/bin/env python
"""
Test the MPS class
"""
import unittest
import numpy as np
import parafermions as pf
class Test(unittest.TestCase):
def test_pe_degeneracy(self):
# should initialise with all zeros
N, l = 8, 0.2
pe = PeschelEmerySpinHalf(N, l, dtype=np.dtype('float64'))
d... | Fix syntax error in test | Fix syntax error in test
| Python | bsd-2-clause | nmoran/pf_resonances | #!/usr/bin/env python
"""
Test the MPS class
"""
import unittest
import numpy as np
import parafermions as pf
class Test(unittest.TestCase):
def test_pe_degeneracy(self):
# should initialise with all zeros
N, l = 8, 0.2
pe = PeschelEmerySpinHalf(N, l, dtype=np.dtype('float64'))
d... | #!/usr/bin/env python
"""
Test the MPS class
"""
import unittest
import numpy as np
import parafermions as pf
class Test(unittest.TestCase):
def test_pe_degeneracy(self):
# should initialise with all zeros
N, l = 8, 0.2
pe = PeschelEmerySpinHalf(N, l, dtype=np.dtype('float64'))
d... | <commit_before>#!/usr/bin/env python
"""
Test the MPS class
"""
import unittest
import numpy as np
import parafermions as pf
class Test(unittest.TestCase):
def test_pe_degeneracy(self):
# should initialise with all zeros
N, l = 8, 0.2
pe = PeschelEmerySpinHalf(N, l, dtype=np.dtype('float... | #!/usr/bin/env python
"""
Test the MPS class
"""
import unittest
import numpy as np
import parafermions as pf
class Test(unittest.TestCase):
def test_pe_degeneracy(self):
# should initialise with all zeros
N, l = 8, 0.2
pe = PeschelEmerySpinHalf(N, l, dtype=np.dtype('float64'))
d... | #!/usr/bin/env python
"""
Test the MPS class
"""
import unittest
import numpy as np
import parafermions as pf
class Test(unittest.TestCase):
def test_pe_degeneracy(self):
# should initialise with all zeros
N, l = 8, 0.2
pe = PeschelEmerySpinHalf(N, l, dtype=np.dtype('float64'))
d... | <commit_before>#!/usr/bin/env python
"""
Test the MPS class
"""
import unittest
import numpy as np
import parafermions as pf
class Test(unittest.TestCase):
def test_pe_degeneracy(self):
# should initialise with all zeros
N, l = 8, 0.2
pe = PeschelEmerySpinHalf(N, l, dtype=np.dtype('float... |
f5a04d1105c1995f44a1f7247d5e167069645e74 | pstastic.py | pstastic.py | from ete2 import Nexml, TreeStyle
import sys
if len(sys.argv) < 2:
print("Command line argument required: NeXML file")
exit(-1)
nexml = Nexml()
nexml.build_from_file(sys.argv[1])
def build_tree_style(tree):
# use our simple TSS cascade to prepare an ETE TreeStyle object
sheets = gather_tss_stylesheet... | from ete2 import Nexml, TreeStyle
import sys
if len(sys.argv) < 2:
print("Command line argument required: NeXML file")
exit(-1)
custom_stylesheet = None
if len(sys.argv) > 2:
if sys.argv[2]:
custom_stylesheet = sys.argv[2]
nexml = Nexml()
nexml.build_from_file(sys.argv[1])
def build_tree_sty... | Use a stylesheet if provided as 2nd arg | Use a stylesheet if provided as 2nd arg
| Python | mit | daisieh/phylostylotastic,OpenTreeOfLife/phylostylotastic,OpenTreeOfLife/phylostylotastic,daisieh/phylostylotastic,OpenTreeOfLife/phylostylotastic | from ete2 import Nexml, TreeStyle
import sys
if len(sys.argv) < 2:
print("Command line argument required: NeXML file")
exit(-1)
nexml = Nexml()
nexml.build_from_file(sys.argv[1])
def build_tree_style(tree):
# use our simple TSS cascade to prepare an ETE TreeStyle object
sheets = gather_tss_stylesheet... | from ete2 import Nexml, TreeStyle
import sys
if len(sys.argv) < 2:
print("Command line argument required: NeXML file")
exit(-1)
custom_stylesheet = None
if len(sys.argv) > 2:
if sys.argv[2]:
custom_stylesheet = sys.argv[2]
nexml = Nexml()
nexml.build_from_file(sys.argv[1])
def build_tree_sty... | <commit_before>from ete2 import Nexml, TreeStyle
import sys
if len(sys.argv) < 2:
print("Command line argument required: NeXML file")
exit(-1)
nexml = Nexml()
nexml.build_from_file(sys.argv[1])
def build_tree_style(tree):
# use our simple TSS cascade to prepare an ETE TreeStyle object
sheets = gather... | from ete2 import Nexml, TreeStyle
import sys
if len(sys.argv) < 2:
print("Command line argument required: NeXML file")
exit(-1)
custom_stylesheet = None
if len(sys.argv) > 2:
if sys.argv[2]:
custom_stylesheet = sys.argv[2]
nexml = Nexml()
nexml.build_from_file(sys.argv[1])
def build_tree_sty... | from ete2 import Nexml, TreeStyle
import sys
if len(sys.argv) < 2:
print("Command line argument required: NeXML file")
exit(-1)
nexml = Nexml()
nexml.build_from_file(sys.argv[1])
def build_tree_style(tree):
# use our simple TSS cascade to prepare an ETE TreeStyle object
sheets = gather_tss_stylesheet... | <commit_before>from ete2 import Nexml, TreeStyle
import sys
if len(sys.argv) < 2:
print("Command line argument required: NeXML file")
exit(-1)
nexml = Nexml()
nexml.build_from_file(sys.argv[1])
def build_tree_style(tree):
# use our simple TSS cascade to prepare an ETE TreeStyle object
sheets = gather... |
12b1e22a16551b3f7fb0e663e42f7d84f9882e2c | pkglib/tests/unit/test_pyinstall_unit.py | pkglib/tests/unit/test_pyinstall_unit.py | import os
import sys
import pytest
from mock import patch
import pytest
from pkglib.scripts import pyinstall
@pytest.mark.skipif('TRAVIS' in os.environ,
reason="Our monkey patch doesn't work with the version of setuptools on Travis. FIXME.")
def test_pyinstall_respects_i_flag():
"""Ensure th... | from __future__ import absolute_import
import os
import sys
import pytest
from mock import patch
from pkglib.scripts import pyinstall
from zc.buildout.easy_install import _get_index
def test_pyinstall_respects_i_flag():
"""Ensure that pyinstall allows us to override the PyPI URL with -i,
even if it's alrea... | Fix for the pyinstall unit test | Fix for the pyinstall unit test
| Python | mit | julietalucia/page-objects,manahl/pytest-plugins,manahl/pytest-plugins | import os
import sys
import pytest
from mock import patch
import pytest
from pkglib.scripts import pyinstall
@pytest.mark.skipif('TRAVIS' in os.environ,
reason="Our monkey patch doesn't work with the version of setuptools on Travis. FIXME.")
def test_pyinstall_respects_i_flag():
"""Ensure th... | from __future__ import absolute_import
import os
import sys
import pytest
from mock import patch
from pkglib.scripts import pyinstall
from zc.buildout.easy_install import _get_index
def test_pyinstall_respects_i_flag():
"""Ensure that pyinstall allows us to override the PyPI URL with -i,
even if it's alrea... | <commit_before>import os
import sys
import pytest
from mock import patch
import pytest
from pkglib.scripts import pyinstall
@pytest.mark.skipif('TRAVIS' in os.environ,
reason="Our monkey patch doesn't work with the version of setuptools on Travis. FIXME.")
def test_pyinstall_respects_i_flag():
... | from __future__ import absolute_import
import os
import sys
import pytest
from mock import patch
from pkglib.scripts import pyinstall
from zc.buildout.easy_install import _get_index
def test_pyinstall_respects_i_flag():
"""Ensure that pyinstall allows us to override the PyPI URL with -i,
even if it's alrea... | import os
import sys
import pytest
from mock import patch
import pytest
from pkglib.scripts import pyinstall
@pytest.mark.skipif('TRAVIS' in os.environ,
reason="Our monkey patch doesn't work with the version of setuptools on Travis. FIXME.")
def test_pyinstall_respects_i_flag():
"""Ensure th... | <commit_before>import os
import sys
import pytest
from mock import patch
import pytest
from pkglib.scripts import pyinstall
@pytest.mark.skipif('TRAVIS' in os.environ,
reason="Our monkey patch doesn't work with the version of setuptools on Travis. FIXME.")
def test_pyinstall_respects_i_flag():
... |
c0ecc75d2c02a1c6b514b09e5f9ad907fb04ce82 | new/meshes.py | new/meshes.py | class RectangularMesh(object):
def __init__(self, d, atlas='atlas', meshname='mesh'):
if not isinstance(d, (tuple, list)) or len(d) != 3:
raise ValueError('Cellsize d must be a tuple of length 3.')
elif d[0] <= 0 or d[1] <= 0 or d[2] <= 0:
raise ValueError('Cellsize dimension... | from atlases import BoxAtlas
class RectangularMesh(object):
def __init__(self, atlas, d, meshname='mesh'):
if not isinstance(d, (tuple, list)) or len(d) != 3:
raise ValueError('Cellsize d must be a tuple of length 3.')
elif d[0] <= 0 or d[1] <= 0 or d[2] <= 0:
raise ValueEr... | Add atlas as an argument for mesh initialisation. | Add atlas as an argument for mesh initialisation.
| Python | bsd-2-clause | fangohr/oommf-python,fangohr/oommf-python,fangohr/oommf-python | class RectangularMesh(object):
def __init__(self, d, atlas='atlas', meshname='mesh'):
if not isinstance(d, (tuple, list)) or len(d) != 3:
raise ValueError('Cellsize d must be a tuple of length 3.')
elif d[0] <= 0 or d[1] <= 0 or d[2] <= 0:
raise ValueError('Cellsize dimension... | from atlases import BoxAtlas
class RectangularMesh(object):
def __init__(self, atlas, d, meshname='mesh'):
if not isinstance(d, (tuple, list)) or len(d) != 3:
raise ValueError('Cellsize d must be a tuple of length 3.')
elif d[0] <= 0 or d[1] <= 0 or d[2] <= 0:
raise ValueEr... | <commit_before>class RectangularMesh(object):
def __init__(self, d, atlas='atlas', meshname='mesh'):
if not isinstance(d, (tuple, list)) or len(d) != 3:
raise ValueError('Cellsize d must be a tuple of length 3.')
elif d[0] <= 0 or d[1] <= 0 or d[2] <= 0:
raise ValueError('Cel... | from atlases import BoxAtlas
class RectangularMesh(object):
def __init__(self, atlas, d, meshname='mesh'):
if not isinstance(d, (tuple, list)) or len(d) != 3:
raise ValueError('Cellsize d must be a tuple of length 3.')
elif d[0] <= 0 or d[1] <= 0 or d[2] <= 0:
raise ValueEr... | class RectangularMesh(object):
def __init__(self, d, atlas='atlas', meshname='mesh'):
if not isinstance(d, (tuple, list)) or len(d) != 3:
raise ValueError('Cellsize d must be a tuple of length 3.')
elif d[0] <= 0 or d[1] <= 0 or d[2] <= 0:
raise ValueError('Cellsize dimension... | <commit_before>class RectangularMesh(object):
def __init__(self, d, atlas='atlas', meshname='mesh'):
if not isinstance(d, (tuple, list)) or len(d) != 3:
raise ValueError('Cellsize d must be a tuple of length 3.')
elif d[0] <= 0 or d[1] <= 0 or d[2] <= 0:
raise ValueError('Cel... |
94e070ec33dbc86e38de4839be9461db3a301685 | inonemonth/challenges/serializers.py | inonemonth/challenges/serializers.py | from rest_framework import serializers
from .models import Challenge, Role
from core.serializers import UserSerializer
class RoleSerializer(serializers.ModelSerializer):
#user = serializers.RelatedField(many=True)
#user = serializers.PrimaryKeyRelatedField()
#user = serializers.HyperlinkedRelatedField()
... | from rest_framework import serializers
from .models import Challenge, Role
from core.serializers import UserSerializer
from comments.serializers import CommentSerializer
class RoleSerializer(serializers.ModelSerializer):
#user = UserSerializer()
#challenge = serializers.RelatedField()
comment_set = Comme... | Include comments in Role serializer | Include comments in Role serializer
| Python | mit | robrechtdr/inonemonth,robrechtdr/inonemonth,robrechtdr/inonemonth,robrechtdr/inonemonth | from rest_framework import serializers
from .models import Challenge, Role
from core.serializers import UserSerializer
class RoleSerializer(serializers.ModelSerializer):
#user = serializers.RelatedField(many=True)
#user = serializers.PrimaryKeyRelatedField()
#user = serializers.HyperlinkedRelatedField()
... | from rest_framework import serializers
from .models import Challenge, Role
from core.serializers import UserSerializer
from comments.serializers import CommentSerializer
class RoleSerializer(serializers.ModelSerializer):
#user = UserSerializer()
#challenge = serializers.RelatedField()
comment_set = Comme... | <commit_before>from rest_framework import serializers
from .models import Challenge, Role
from core.serializers import UserSerializer
class RoleSerializer(serializers.ModelSerializer):
#user = serializers.RelatedField(many=True)
#user = serializers.PrimaryKeyRelatedField()
#user = serializers.Hyperlinked... | from rest_framework import serializers
from .models import Challenge, Role
from core.serializers import UserSerializer
from comments.serializers import CommentSerializer
class RoleSerializer(serializers.ModelSerializer):
#user = UserSerializer()
#challenge = serializers.RelatedField()
comment_set = Comme... | from rest_framework import serializers
from .models import Challenge, Role
from core.serializers import UserSerializer
class RoleSerializer(serializers.ModelSerializer):
#user = serializers.RelatedField(many=True)
#user = serializers.PrimaryKeyRelatedField()
#user = serializers.HyperlinkedRelatedField()
... | <commit_before>from rest_framework import serializers
from .models import Challenge, Role
from core.serializers import UserSerializer
class RoleSerializer(serializers.ModelSerializer):
#user = serializers.RelatedField(many=True)
#user = serializers.PrimaryKeyRelatedField()
#user = serializers.Hyperlinked... |
ac0198a5af01bc1f5b32a0e5d4bdc2f1a6664120 | selenium/behave/steps/screenshot.py | selenium/behave/steps/screenshot.py | ####
#### Check that counts for basic searches is within 10% of given counts
####
import re, os, time
import ftplib
from behave import *
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
@given('I want ... | ####
#### Check that counts for basic searches is within 10% of given counts
####
import re, os, time
import ftplib
from behave import *
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
@given('I want ... | Fix no endline at end of file | Fix no endline at end of file
| Python | bsd-3-clause | geneontology/amigo,geneontology/amigo,geneontology/amigo,geneontology/amigo,raymond91125/amigo,geneontology/amigo,geneontology/amigo,raymond91125/amigo,raymond91125/amigo,raymond91125/amigo,raymond91125/amigo,raymond91125/amigo,geneontology/amigo | ####
#### Check that counts for basic searches is within 10% of given counts
####
import re, os, time
import ftplib
from behave import *
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
@given('I want ... | ####
#### Check that counts for basic searches is within 10% of given counts
####
import re, os, time
import ftplib
from behave import *
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
@given('I want ... | <commit_before>####
#### Check that counts for basic searches is within 10% of given counts
####
import re, os, time
import ftplib
from behave import *
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
... | ####
#### Check that counts for basic searches is within 10% of given counts
####
import re, os, time
import ftplib
from behave import *
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
@given('I want ... | ####
#### Check that counts for basic searches is within 10% of given counts
####
import re, os, time
import ftplib
from behave import *
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
@given('I want ... | <commit_before>####
#### Check that counts for basic searches is within 10% of given counts
####
import re, os, time
import ftplib
from behave import *
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
... |
32be37d7b43d9cc8a85b292ab324ebab95bc1aca | tests/test_rule.py | tests/test_rule.py | from datetime import datetime
from unittest import TestCase
from rule import PriceRule
from stock import Stock
class TestPriceRule(TestCase):
@classmethod
def setUpClass(cls):
goog = Stock("GOOG")
goog.update(datetime(2014, 2, 10), 11)
cls.exchange = {"GOOG": goog}
def test_a_Pri... | from datetime import datetime
from unittest import TestCase
from rule import PriceRule
from stock import Stock
class TestPriceRule(TestCase):
@classmethod
def setUpClass(cls):
goog = Stock("GOOG")
goog.update(datetime(2014, 2, 10), 11)
cls.exchange = {"GOOG": goog}
def test_a_Pri... | Add a PriceRule test if match is attempted when stock is not in the exchange. | Add a PriceRule test if match is attempted when stock is not in the exchange.
| Python | mit | bsmukasa/stock_alerter | from datetime import datetime
from unittest import TestCase
from rule import PriceRule
from stock import Stock
class TestPriceRule(TestCase):
@classmethod
def setUpClass(cls):
goog = Stock("GOOG")
goog.update(datetime(2014, 2, 10), 11)
cls.exchange = {"GOOG": goog}
def test_a_Pri... | from datetime import datetime
from unittest import TestCase
from rule import PriceRule
from stock import Stock
class TestPriceRule(TestCase):
@classmethod
def setUpClass(cls):
goog = Stock("GOOG")
goog.update(datetime(2014, 2, 10), 11)
cls.exchange = {"GOOG": goog}
def test_a_Pri... | <commit_before>from datetime import datetime
from unittest import TestCase
from rule import PriceRule
from stock import Stock
class TestPriceRule(TestCase):
@classmethod
def setUpClass(cls):
goog = Stock("GOOG")
goog.update(datetime(2014, 2, 10), 11)
cls.exchange = {"GOOG": goog}
... | from datetime import datetime
from unittest import TestCase
from rule import PriceRule
from stock import Stock
class TestPriceRule(TestCase):
@classmethod
def setUpClass(cls):
goog = Stock("GOOG")
goog.update(datetime(2014, 2, 10), 11)
cls.exchange = {"GOOG": goog}
def test_a_Pri... | from datetime import datetime
from unittest import TestCase
from rule import PriceRule
from stock import Stock
class TestPriceRule(TestCase):
@classmethod
def setUpClass(cls):
goog = Stock("GOOG")
goog.update(datetime(2014, 2, 10), 11)
cls.exchange = {"GOOG": goog}
def test_a_Pri... | <commit_before>from datetime import datetime
from unittest import TestCase
from rule import PriceRule
from stock import Stock
class TestPriceRule(TestCase):
@classmethod
def setUpClass(cls):
goog = Stock("GOOG")
goog.update(datetime(2014, 2, 10), 11)
cls.exchange = {"GOOG": goog}
... |
6263c544a5f8e09f1e3c2ee761af70f71acd0c79 | webapp/tests/__init__.py | webapp/tests/__init__.py | # -*- coding: utf-8 -*-
from unittest import TestCase
from byceps.application import create_app
from byceps.blueprints.brand.models import Brand
from byceps.blueprints.party.models import Party
from byceps.database import db
class AbstractAppTestCase(TestCase):
def setUp(self):
self.app = create_app('t... | # -*- coding: utf-8 -*-
from unittest import TestCase
from byceps.application import create_app
from byceps.blueprints.brand.models import Brand
from byceps.blueprints.party.models import Party
from byceps.database import db
class AbstractAppTestCase(TestCase):
def setUp(self):
self.app = create_app('t... | Make brand and party available to tests. | Make brand and party available to tests.
| Python | bsd-3-clause | homeworkprod/byceps,m-ober/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps | # -*- coding: utf-8 -*-
from unittest import TestCase
from byceps.application import create_app
from byceps.blueprints.brand.models import Brand
from byceps.blueprints.party.models import Party
from byceps.database import db
class AbstractAppTestCase(TestCase):
def setUp(self):
self.app = create_app('t... | # -*- coding: utf-8 -*-
from unittest import TestCase
from byceps.application import create_app
from byceps.blueprints.brand.models import Brand
from byceps.blueprints.party.models import Party
from byceps.database import db
class AbstractAppTestCase(TestCase):
def setUp(self):
self.app = create_app('t... | <commit_before># -*- coding: utf-8 -*-
from unittest import TestCase
from byceps.application import create_app
from byceps.blueprints.brand.models import Brand
from byceps.blueprints.party.models import Party
from byceps.database import db
class AbstractAppTestCase(TestCase):
def setUp(self):
self.app ... | # -*- coding: utf-8 -*-
from unittest import TestCase
from byceps.application import create_app
from byceps.blueprints.brand.models import Brand
from byceps.blueprints.party.models import Party
from byceps.database import db
class AbstractAppTestCase(TestCase):
def setUp(self):
self.app = create_app('t... | # -*- coding: utf-8 -*-
from unittest import TestCase
from byceps.application import create_app
from byceps.blueprints.brand.models import Brand
from byceps.blueprints.party.models import Party
from byceps.database import db
class AbstractAppTestCase(TestCase):
def setUp(self):
self.app = create_app('t... | <commit_before># -*- coding: utf-8 -*-
from unittest import TestCase
from byceps.application import create_app
from byceps.blueprints.brand.models import Brand
from byceps.blueprints.party.models import Party
from byceps.database import db
class AbstractAppTestCase(TestCase):
def setUp(self):
self.app ... |
f1bc5d1b491926ccbe098a28a5b08a60741e5bc5 | this_app/models.py | this_app/models.py | from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
class User(UserMixin):
"""Represents a user who can Create, Read, Update & Delete his own bucketlists"""
counter = 0
users = {}
def __init__(self, email, username, password):
"""Constru... | from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
class User(UserMixin):
"""Represents a user who can Create, Read, Update & Delete his own bucketlists"""
counter = 0
users = {}
def __init__(self, email, username, password):
"""Constru... | Use autoincrementing ID as primary key | Use autoincrementing ID as primary key
| Python | mit | borenho/flask-bucketlist,borenho/flask-bucketlist | from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
class User(UserMixin):
"""Represents a user who can Create, Read, Update & Delete his own bucketlists"""
counter = 0
users = {}
def __init__(self, email, username, password):
"""Constru... | from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
class User(UserMixin):
"""Represents a user who can Create, Read, Update & Delete his own bucketlists"""
counter = 0
users = {}
def __init__(self, email, username, password):
"""Constru... | <commit_before>from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
class User(UserMixin):
"""Represents a user who can Create, Read, Update & Delete his own bucketlists"""
counter = 0
users = {}
def __init__(self, email, username, password):
... | from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
class User(UserMixin):
"""Represents a user who can Create, Read, Update & Delete his own bucketlists"""
counter = 0
users = {}
def __init__(self, email, username, password):
"""Constru... | from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
class User(UserMixin):
"""Represents a user who can Create, Read, Update & Delete his own bucketlists"""
counter = 0
users = {}
def __init__(self, email, username, password):
"""Constru... | <commit_before>from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
class User(UserMixin):
"""Represents a user who can Create, Read, Update & Delete his own bucketlists"""
counter = 0
users = {}
def __init__(self, email, username, password):
... |
7e27c47496a55f7a4c58c2c8c79ce854d80f0893 | skyfield/tests/test_trigonometry.py | skyfield/tests/test_trigonometry.py | from skyfield.api import Angle, Topos, load, load_file
from skyfield.trigonometry import position_angle_of
def test_position_angle():
a = Angle(degrees=0), Angle(degrees=0)
b = Angle(degrees=1), Angle(degrees=1)
assert str(position_angle_of(a, b)) == '315deg 00\' 15.7"'
def test_position_angle_against_nas... | from skyfield.api import Angle, Topos, load, load_file
from skyfield.trigonometry import position_angle_of
def test_position_angle():
a = Angle(degrees=0), Angle(degrees=0)
b = Angle(degrees=1), Angle(degrees=1)
assert str(position_angle_of(a, b)) == '315deg 00\' 15.7"'
def test_position_angle_against_nas... | Remove hack from position angle test | Remove hack from position angle test
| Python | mit | skyfielders/python-skyfield,skyfielders/python-skyfield | from skyfield.api import Angle, Topos, load, load_file
from skyfield.trigonometry import position_angle_of
def test_position_angle():
a = Angle(degrees=0), Angle(degrees=0)
b = Angle(degrees=1), Angle(degrees=1)
assert str(position_angle_of(a, b)) == '315deg 00\' 15.7"'
def test_position_angle_against_nas... | from skyfield.api import Angle, Topos, load, load_file
from skyfield.trigonometry import position_angle_of
def test_position_angle():
a = Angle(degrees=0), Angle(degrees=0)
b = Angle(degrees=1), Angle(degrees=1)
assert str(position_angle_of(a, b)) == '315deg 00\' 15.7"'
def test_position_angle_against_nas... | <commit_before>from skyfield.api import Angle, Topos, load, load_file
from skyfield.trigonometry import position_angle_of
def test_position_angle():
a = Angle(degrees=0), Angle(degrees=0)
b = Angle(degrees=1), Angle(degrees=1)
assert str(position_angle_of(a, b)) == '315deg 00\' 15.7"'
def test_position_an... | from skyfield.api import Angle, Topos, load, load_file
from skyfield.trigonometry import position_angle_of
def test_position_angle():
a = Angle(degrees=0), Angle(degrees=0)
b = Angle(degrees=1), Angle(degrees=1)
assert str(position_angle_of(a, b)) == '315deg 00\' 15.7"'
def test_position_angle_against_nas... | from skyfield.api import Angle, Topos, load, load_file
from skyfield.trigonometry import position_angle_of
def test_position_angle():
a = Angle(degrees=0), Angle(degrees=0)
b = Angle(degrees=1), Angle(degrees=1)
assert str(position_angle_of(a, b)) == '315deg 00\' 15.7"'
def test_position_angle_against_nas... | <commit_before>from skyfield.api import Angle, Topos, load, load_file
from skyfield.trigonometry import position_angle_of
def test_position_angle():
a = Angle(degrees=0), Angle(degrees=0)
b = Angle(degrees=1), Angle(degrees=1)
assert str(position_angle_of(a, b)) == '315deg 00\' 15.7"'
def test_position_an... |
0bd4d05dd9c4840cef93ef280d241e1e6a863a5d | server-example/app.py | server-example/app.py | # Example CI server that serves badges
from flask import Flask
import pybadges
app = Flask(__name__)
@app.route('/')
def serveBadges():
# First example
badge_arg = dict(
left_text='build',
right_text='passing',
right_color='#008000'
)
badge = pybadges.badge(**badge_arg)
... | # Copyright 2018 The pybadge Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Add license, right comment and format code | Add license, right comment and format code
| Python | apache-2.0 | google/pybadges,google/pybadges,google/pybadges | # Example CI server that serves badges
from flask import Flask
import pybadges
app = Flask(__name__)
@app.route('/')
def serveBadges():
# First example
badge_arg = dict(
left_text='build',
right_text='passing',
right_color='#008000'
)
badge = pybadges.badge(**badge_arg)
... | # Copyright 2018 The pybadge Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | <commit_before># Example CI server that serves badges
from flask import Flask
import pybadges
app = Flask(__name__)
@app.route('/')
def serveBadges():
# First example
badge_arg = dict(
left_text='build',
right_text='passing',
right_color='#008000'
)
badge = pybadges.badge(**b... | # Copyright 2018 The pybadge Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Example CI server that serves badges
from flask import Flask
import pybadges
app = Flask(__name__)
@app.route('/')
def serveBadges():
# First example
badge_arg = dict(
left_text='build',
right_text='passing',
right_color='#008000'
)
badge = pybadges.badge(**badge_arg)
... | <commit_before># Example CI server that serves badges
from flask import Flask
import pybadges
app = Flask(__name__)
@app.route('/')
def serveBadges():
# First example
badge_arg = dict(
left_text='build',
right_text='passing',
right_color='#008000'
)
badge = pybadges.badge(**b... |
33f5f15bd118a41798c5554ea58b2306803a6ca4 | src/foremast/pipeline/create_pipeline_manual.py | src/foremast/pipeline/create_pipeline_manual.py | # Foremast - Pipeline Tooling
#
# Copyright 2016 Gogo, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | # Foremast - Pipeline Tooling
#
# Copyright 2016 Gogo, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | Use new class name FileLookup | fix: Use new class name FileLookup
See also: #72
| Python | apache-2.0 | gogoair/foremast,gogoair/foremast | # Foremast - Pipeline Tooling
#
# Copyright 2016 Gogo, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | # Foremast - Pipeline Tooling
#
# Copyright 2016 Gogo, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | <commit_before># Foremast - Pipeline Tooling
#
# Copyright 2016 Gogo, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | # Foremast - Pipeline Tooling
#
# Copyright 2016 Gogo, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | # Foremast - Pipeline Tooling
#
# Copyright 2016 Gogo, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | <commit_before># Foremast - Pipeline Tooling
#
# Copyright 2016 Gogo, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... |
18c6b75231872f549101b0b057c0681f510d681c | tests/test_module_attributes.py | tests/test_module_attributes.py | from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import zstd
class TestModuleAttributes(unittest.TestCase):
def test_version(self):
self.assertEqual(zstd.ZSTD_VERSION, (1, 0, 0))
def test_constants(self):
self.assertEqual(z... | from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import zstd
class TestModuleAttributes(unittest.TestCase):
def test_version(self):
self.assertEqual(zstd.ZSTD_VERSION, (1, 1, 0))
def test_constants(self):
self.assertEqual(z... | Update zstd version in test | Update zstd version in test
To reflect the recent upgrade to 1.1.0. | Python | bsd-3-clause | indygreg/python-zstandard,terrelln/python-zstandard,terrelln/python-zstandard,indygreg/python-zstandard,indygreg/python-zstandard,indygreg/python-zstandard,terrelln/python-zstandard,terrelln/python-zstandard | from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import zstd
class TestModuleAttributes(unittest.TestCase):
def test_version(self):
self.assertEqual(zstd.ZSTD_VERSION, (1, 0, 0))
def test_constants(self):
self.assertEqual(z... | from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import zstd
class TestModuleAttributes(unittest.TestCase):
def test_version(self):
self.assertEqual(zstd.ZSTD_VERSION, (1, 1, 0))
def test_constants(self):
self.assertEqual(z... | <commit_before>from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import zstd
class TestModuleAttributes(unittest.TestCase):
def test_version(self):
self.assertEqual(zstd.ZSTD_VERSION, (1, 0, 0))
def test_constants(self):
sel... | from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import zstd
class TestModuleAttributes(unittest.TestCase):
def test_version(self):
self.assertEqual(zstd.ZSTD_VERSION, (1, 1, 0))
def test_constants(self):
self.assertEqual(z... | from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import zstd
class TestModuleAttributes(unittest.TestCase):
def test_version(self):
self.assertEqual(zstd.ZSTD_VERSION, (1, 0, 0))
def test_constants(self):
self.assertEqual(z... | <commit_before>from __future__ import unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import zstd
class TestModuleAttributes(unittest.TestCase):
def test_version(self):
self.assertEqual(zstd.ZSTD_VERSION, (1, 0, 0))
def test_constants(self):
sel... |
6487ca4227f75d11d9f3ee985056c3292d4df5e4 | dmoj/tests/test_control.py | dmoj/tests/test_control.py | import threading
import unittest
import requests
from dmoj.control import JudgeControlRequestHandler
try:
from unittest import mock
except ImportError:
import mock
try:
from http.server import HTTPServer
except ImportError:
from BaseHTTPServer import HTTPServer
class ControlServerTest(unittest.Tes... | import mock
import threading
import unittest
import requests
from dmoj.control import JudgeControlRequestHandler
try:
from http.server import HTTPServer
except ImportError:
from BaseHTTPServer import HTTPServer
class ControlServerTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cla... | Make it work in PY3.5 *properly* | Make it work in PY3.5 *properly* | Python | agpl-3.0 | DMOJ/judge,DMOJ/judge,DMOJ/judge | import threading
import unittest
import requests
from dmoj.control import JudgeControlRequestHandler
try:
from unittest import mock
except ImportError:
import mock
try:
from http.server import HTTPServer
except ImportError:
from BaseHTTPServer import HTTPServer
class ControlServerTest(unittest.Tes... | import mock
import threading
import unittest
import requests
from dmoj.control import JudgeControlRequestHandler
try:
from http.server import HTTPServer
except ImportError:
from BaseHTTPServer import HTTPServer
class ControlServerTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cla... | <commit_before>import threading
import unittest
import requests
from dmoj.control import JudgeControlRequestHandler
try:
from unittest import mock
except ImportError:
import mock
try:
from http.server import HTTPServer
except ImportError:
from BaseHTTPServer import HTTPServer
class ControlServerTe... | import mock
import threading
import unittest
import requests
from dmoj.control import JudgeControlRequestHandler
try:
from http.server import HTTPServer
except ImportError:
from BaseHTTPServer import HTTPServer
class ControlServerTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cla... | import threading
import unittest
import requests
from dmoj.control import JudgeControlRequestHandler
try:
from unittest import mock
except ImportError:
import mock
try:
from http.server import HTTPServer
except ImportError:
from BaseHTTPServer import HTTPServer
class ControlServerTest(unittest.Tes... | <commit_before>import threading
import unittest
import requests
from dmoj.control import JudgeControlRequestHandler
try:
from unittest import mock
except ImportError:
import mock
try:
from http.server import HTTPServer
except ImportError:
from BaseHTTPServer import HTTPServer
class ControlServerTe... |
90d7d5deabf9e55ce75da06a61088630c2a2d103 | gallery/urls.py | gallery/urls.py | # coding: utf-8
# Copyright (c) 2011-2012 Aymeric Augustin. All rights reserved.
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import permission_required
from . import views
protect = permission_required('gallery.view')
urlpatterns = patterns('',
url(r'^$', protect(views.Gallery... | # coding: utf-8
# Copyright (c) 2011-2012 Aymeric Augustin. All rights reserved.
from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('',
url(r'^$', views.GalleryIndexView.as_view(), name='gallery-index'),
url(r'^year/(?P<year>\d{4})/$', views.GalleryYearView.as_view(), name... | Remove blanket protection in preparation for granular access control. | Remove blanket protection in preparation for granular access control.
| Python | bsd-3-clause | aaugustin/myks-gallery,aaugustin/myks-gallery | # coding: utf-8
# Copyright (c) 2011-2012 Aymeric Augustin. All rights reserved.
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import permission_required
from . import views
protect = permission_required('gallery.view')
urlpatterns = patterns('',
url(r'^$', protect(views.Gallery... | # coding: utf-8
# Copyright (c) 2011-2012 Aymeric Augustin. All rights reserved.
from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('',
url(r'^$', views.GalleryIndexView.as_view(), name='gallery-index'),
url(r'^year/(?P<year>\d{4})/$', views.GalleryYearView.as_view(), name... | <commit_before># coding: utf-8
# Copyright (c) 2011-2012 Aymeric Augustin. All rights reserved.
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import permission_required
from . import views
protect = permission_required('gallery.view')
urlpatterns = patterns('',
url(r'^$', protec... | # coding: utf-8
# Copyright (c) 2011-2012 Aymeric Augustin. All rights reserved.
from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('',
url(r'^$', views.GalleryIndexView.as_view(), name='gallery-index'),
url(r'^year/(?P<year>\d{4})/$', views.GalleryYearView.as_view(), name... | # coding: utf-8
# Copyright (c) 2011-2012 Aymeric Augustin. All rights reserved.
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import permission_required
from . import views
protect = permission_required('gallery.view')
urlpatterns = patterns('',
url(r'^$', protect(views.Gallery... | <commit_before># coding: utf-8
# Copyright (c) 2011-2012 Aymeric Augustin. All rights reserved.
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import permission_required
from . import views
protect = permission_required('gallery.view')
urlpatterns = patterns('',
url(r'^$', protec... |
d93ad2c809d8a7c0c1693c463ae244735e5c19e3 | dockerfabric/__init__.py | dockerfabric/__init__.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
__version__ = '0.3.10'
DEFAULT_SOCAT_VERSION = '1.7.3.0'
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
__version__ = '0.3.10'
DEFAULT_SOCAT_VERSION = '1.7.3.1'
| Use more recent socat version. | Use more recent socat version.
| Python | mit | merll/docker-fabric | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
__version__ = '0.3.10'
DEFAULT_SOCAT_VERSION = '1.7.3.0'
Use more recent socat version. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
__version__ = '0.3.10'
DEFAULT_SOCAT_VERSION = '1.7.3.1'
| <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
__version__ = '0.3.10'
DEFAULT_SOCAT_VERSION = '1.7.3.0'
<commit_msg>Use more recent socat version.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
__version__ = '0.3.10'
DEFAULT_SOCAT_VERSION = '1.7.3.1'
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
__version__ = '0.3.10'
DEFAULT_SOCAT_VERSION = '1.7.3.0'
Use more recent socat version.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
__version__ = '0.3.10'
DEFAULT_SOCAT_VERSION = '1.7.3.1'
| <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
__version__ = '0.3.10'
DEFAULT_SOCAT_VERSION = '1.7.3.0'
<commit_msg>Use more recent socat version.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
__version__ = '0.3.10'
DEFAULT_SOCAT_VERSION = '1.7.3.1'
|
09089e4112c47c0b1b7549f0cc5651fa299cd961 | tests/test_workers.py | tests/test_workers.py | import pytest
import workers.repo_info_worker.repo_info_worker.runtime as ri
def test_workers():
# print(dir(runtime))
ri.run()
assert 0 | import pytest
import workers.repo_info_worker.runtime
def test_workers():
assert True | Fix broken worker stub test | Fix broken worker stub test
Signed-off-by: Carter Landis <[email protected]>
| Python | mit | OSSHealth/ghdata,OSSHealth/ghdata,OSSHealth/ghdata | import pytest
import workers.repo_info_worker.repo_info_worker.runtime as ri
def test_workers():
# print(dir(runtime))
ri.run()
assert 0Fix broken worker stub test
Signed-off-by: Carter Landis <[email protected]> | import pytest
import workers.repo_info_worker.runtime
def test_workers():
assert True | <commit_before>import pytest
import workers.repo_info_worker.repo_info_worker.runtime as ri
def test_workers():
# print(dir(runtime))
ri.run()
assert 0<commit_msg>Fix broken worker stub test
Signed-off-by: Carter Landis <[email protected]><commit_after> | import pytest
import workers.repo_info_worker.runtime
def test_workers():
assert True | import pytest
import workers.repo_info_worker.repo_info_worker.runtime as ri
def test_workers():
# print(dir(runtime))
ri.run()
assert 0Fix broken worker stub test
Signed-off-by: Carter Landis <[email protected]>import pytest
import workers.repo_info_worker.runtim... | <commit_before>import pytest
import workers.repo_info_worker.repo_info_worker.runtime as ri
def test_workers():
# print(dir(runtime))
ri.run()
assert 0<commit_msg>Fix broken worker stub test
Signed-off-by: Carter Landis <[email protected]><commit_after>import pytes... |
c8a9498067d7bd65bd52cab1a443c8ecd62a03c5 | tensorflow_lite_support/python/task/core/proto/external_file_pb2.py | tensorflow_lite_support/python/task/core/proto/external_file_pb2.py | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Normalize naming scheme for protos in docstring | Normalize naming scheme for protos in docstring
| Python | apache-2.0 | tensorflow/tflite-support,tensorflow/tflite-support,tensorflow/tflite-support,tensorflow/tflite-support,tensorflow/tflite-support,tensorflow/tflite-support | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before># Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before># Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
fcb041d46c40dd497524a70657cfc71220a2da76 | {{cookiecutter.repo_name}}/tests/test_{{cookiecutter.repo_name}}.py | {{cookiecutter.repo_name}}/tests/test_{{cookiecutter.repo_name}}.py | # -*- coding: utf-8 -*-
import pytest
@pytest.fixture
def basic_app():
"""Fixture for a default app.
Returns:
:class:`{{cookiecutter.app_class_name}}`: App instance
"""
from {{cookiecutter.repo_name}} import {{cookiecutter.app_class_name}}
return {{cookiecutter.app_class_name}}()
def tes... | # -*- coding: utf-8 -*-
import pytest
@pytest.fixture
def basic_app():
"""Fixture for a default app.
Returns:
:class:`{{cookiecutter.app_class_name}}`: App instance
"""
from {{cookiecutter.repo_name}}.{{cookiecutter.repo_name}} import {{cookiecutter.app_class_name}}
return {{cookiecutter.a... | Fix local import of the app | Fix local import of the app
| Python | mit | hackebrot/cookiedozer,hackebrot/cookiedozer | # -*- coding: utf-8 -*-
import pytest
@pytest.fixture
def basic_app():
"""Fixture for a default app.
Returns:
:class:`{{cookiecutter.app_class_name}}`: App instance
"""
from {{cookiecutter.repo_name}} import {{cookiecutter.app_class_name}}
return {{cookiecutter.app_class_name}}()
def tes... | # -*- coding: utf-8 -*-
import pytest
@pytest.fixture
def basic_app():
"""Fixture for a default app.
Returns:
:class:`{{cookiecutter.app_class_name}}`: App instance
"""
from {{cookiecutter.repo_name}}.{{cookiecutter.repo_name}} import {{cookiecutter.app_class_name}}
return {{cookiecutter.a... | <commit_before># -*- coding: utf-8 -*-
import pytest
@pytest.fixture
def basic_app():
"""Fixture for a default app.
Returns:
:class:`{{cookiecutter.app_class_name}}`: App instance
"""
from {{cookiecutter.repo_name}} import {{cookiecutter.app_class_name}}
return {{cookiecutter.app_class_nam... | # -*- coding: utf-8 -*-
import pytest
@pytest.fixture
def basic_app():
"""Fixture for a default app.
Returns:
:class:`{{cookiecutter.app_class_name}}`: App instance
"""
from {{cookiecutter.repo_name}}.{{cookiecutter.repo_name}} import {{cookiecutter.app_class_name}}
return {{cookiecutter.a... | # -*- coding: utf-8 -*-
import pytest
@pytest.fixture
def basic_app():
"""Fixture for a default app.
Returns:
:class:`{{cookiecutter.app_class_name}}`: App instance
"""
from {{cookiecutter.repo_name}} import {{cookiecutter.app_class_name}}
return {{cookiecutter.app_class_name}}()
def tes... | <commit_before># -*- coding: utf-8 -*-
import pytest
@pytest.fixture
def basic_app():
"""Fixture for a default app.
Returns:
:class:`{{cookiecutter.app_class_name}}`: App instance
"""
from {{cookiecutter.repo_name}} import {{cookiecutter.app_class_name}}
return {{cookiecutter.app_class_nam... |
3d23722089036042295365760a8fbdf5c69d09d2 | tests/docformat_test.py | tests/docformat_test.py | # -*- coding: utf-8 -*-
"""Test document formats for correctness
"""
from __future__ import absolute_import
import os
import os.path as op
import yaml
import pytest
import restructuredtext_lint as rstlint
from .conftest import PROJ_DIR
DIRS = [PROJ_DIR]
def proj_files(suffix):
for dir in DIRS:
for f in... | # -*- coding: utf-8 -*-
"""Test document formats for correctness
"""
from __future__ import absolute_import
import os
import os.path as op
import json
import yaml
import pytest
import restructuredtext_lint as rstlint
from .conftest import PROJ_DIR
DIRS = [PROJ_DIR]
def proj_files(suffix):
for dir in DIRS:
... | Check JSON syntax as part of tests | Check JSON syntax as part of tests
| Python | mit | bbiskup/purkinje,bbiskup/purkinje,bbiskup/purkinje,bbiskup/purkinje | # -*- coding: utf-8 -*-
"""Test document formats for correctness
"""
from __future__ import absolute_import
import os
import os.path as op
import yaml
import pytest
import restructuredtext_lint as rstlint
from .conftest import PROJ_DIR
DIRS = [PROJ_DIR]
def proj_files(suffix):
for dir in DIRS:
for f in... | # -*- coding: utf-8 -*-
"""Test document formats for correctness
"""
from __future__ import absolute_import
import os
import os.path as op
import json
import yaml
import pytest
import restructuredtext_lint as rstlint
from .conftest import PROJ_DIR
DIRS = [PROJ_DIR]
def proj_files(suffix):
for dir in DIRS:
... | <commit_before># -*- coding: utf-8 -*-
"""Test document formats for correctness
"""
from __future__ import absolute_import
import os
import os.path as op
import yaml
import pytest
import restructuredtext_lint as rstlint
from .conftest import PROJ_DIR
DIRS = [PROJ_DIR]
def proj_files(suffix):
for dir in DIRS:
... | # -*- coding: utf-8 -*-
"""Test document formats for correctness
"""
from __future__ import absolute_import
import os
import os.path as op
import json
import yaml
import pytest
import restructuredtext_lint as rstlint
from .conftest import PROJ_DIR
DIRS = [PROJ_DIR]
def proj_files(suffix):
for dir in DIRS:
... | # -*- coding: utf-8 -*-
"""Test document formats for correctness
"""
from __future__ import absolute_import
import os
import os.path as op
import yaml
import pytest
import restructuredtext_lint as rstlint
from .conftest import PROJ_DIR
DIRS = [PROJ_DIR]
def proj_files(suffix):
for dir in DIRS:
for f in... | <commit_before># -*- coding: utf-8 -*-
"""Test document formats for correctness
"""
from __future__ import absolute_import
import os
import os.path as op
import yaml
import pytest
import restructuredtext_lint as rstlint
from .conftest import PROJ_DIR
DIRS = [PROJ_DIR]
def proj_files(suffix):
for dir in DIRS:
... |
171d14e2a0b433a0e6fc8837889c26f2d106f7a8 | fancypages/models/base.py | fancypages/models/base.py | from django.db import models
from .. import abstract_models
from ..manager import PageManager
class PageType(abstract_models.AbstractPageType):
class Meta:
app_label = 'fancypages'
class VisibilityType(abstract_models.AbstractVisibilityType):
class Meta:
app_label = 'fancypages'
class Fan... | from django.db import models
from .. import abstract_models
from ..manager import PageManager
class PageType(abstract_models.AbstractPageType):
class Meta:
app_label = 'fancypages'
class VisibilityType(abstract_models.AbstractVisibilityType):
class Meta:
app_label = 'fancypages'
class Fan... | Change string formatting to use format | Change string formatting to use format
| Python | bsd-3-clause | tangentlabs/django-fancypages,socradev/django-fancypages,tangentlabs/django-fancypages,socradev/django-fancypages,socradev/django-fancypages,tangentlabs/django-fancypages | from django.db import models
from .. import abstract_models
from ..manager import PageManager
class PageType(abstract_models.AbstractPageType):
class Meta:
app_label = 'fancypages'
class VisibilityType(abstract_models.AbstractVisibilityType):
class Meta:
app_label = 'fancypages'
class Fan... | from django.db import models
from .. import abstract_models
from ..manager import PageManager
class PageType(abstract_models.AbstractPageType):
class Meta:
app_label = 'fancypages'
class VisibilityType(abstract_models.AbstractVisibilityType):
class Meta:
app_label = 'fancypages'
class Fan... | <commit_before>from django.db import models
from .. import abstract_models
from ..manager import PageManager
class PageType(abstract_models.AbstractPageType):
class Meta:
app_label = 'fancypages'
class VisibilityType(abstract_models.AbstractVisibilityType):
class Meta:
app_label = 'fancypag... | from django.db import models
from .. import abstract_models
from ..manager import PageManager
class PageType(abstract_models.AbstractPageType):
class Meta:
app_label = 'fancypages'
class VisibilityType(abstract_models.AbstractVisibilityType):
class Meta:
app_label = 'fancypages'
class Fan... | from django.db import models
from .. import abstract_models
from ..manager import PageManager
class PageType(abstract_models.AbstractPageType):
class Meta:
app_label = 'fancypages'
class VisibilityType(abstract_models.AbstractVisibilityType):
class Meta:
app_label = 'fancypages'
class Fan... | <commit_before>from django.db import models
from .. import abstract_models
from ..manager import PageManager
class PageType(abstract_models.AbstractPageType):
class Meta:
app_label = 'fancypages'
class VisibilityType(abstract_models.AbstractVisibilityType):
class Meta:
app_label = 'fancypag... |
7cb7474e4ed51e0080c42e97acd823d1417bdbe9 | UM/Qt/GL/QtTexture.py | UM/Qt/GL/QtTexture.py | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtGui import QOpenGLTexture, QImage
from UM.View.GL.Texture import Texture
from UM.View.GL.OpenGL import OpenGL
## Texture subclass using PyQt for the OpenGL implementation.
class QtTexture(Texture):
de... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtGui import QOpenGLTexture, QImage
from UM.View.GL.Texture import Texture
from UM.View.GL.OpenGL import OpenGL
## Texture subclass using PyQt for the OpenGL implementation.
class QtTexture(Texture):
de... | Set Texture minification/magnification filters to Linear | Set Texture minification/magnification filters to Linear
This improves the quality of textures that need to be rendered at a
smaller
size.
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtGui import QOpenGLTexture, QImage
from UM.View.GL.Texture import Texture
from UM.View.GL.OpenGL import OpenGL
## Texture subclass using PyQt for the OpenGL implementation.
class QtTexture(Texture):
de... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtGui import QOpenGLTexture, QImage
from UM.View.GL.Texture import Texture
from UM.View.GL.OpenGL import OpenGL
## Texture subclass using PyQt for the OpenGL implementation.
class QtTexture(Texture):
de... | <commit_before># Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtGui import QOpenGLTexture, QImage
from UM.View.GL.Texture import Texture
from UM.View.GL.OpenGL import OpenGL
## Texture subclass using PyQt for the OpenGL implementation.
class QtTexture(T... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtGui import QOpenGLTexture, QImage
from UM.View.GL.Texture import Texture
from UM.View.GL.OpenGL import OpenGL
## Texture subclass using PyQt for the OpenGL implementation.
class QtTexture(Texture):
de... | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtGui import QOpenGLTexture, QImage
from UM.View.GL.Texture import Texture
from UM.View.GL.OpenGL import OpenGL
## Texture subclass using PyQt for the OpenGL implementation.
class QtTexture(Texture):
de... | <commit_before># Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from PyQt5.QtGui import QOpenGLTexture, QImage
from UM.View.GL.Texture import Texture
from UM.View.GL.OpenGL import OpenGL
## Texture subclass using PyQt for the OpenGL implementation.
class QtTexture(T... |
7654a81760d228227c3e3ef9ff9cac9927b4674a | scheduler/tests.py | scheduler/tests.py | from django.test import TestCase
# Create your tests here.
| from django.test import TestCase
from .models import Event, Volunteer
class VolunteerTestCase(TestCase):
def test_gets_public_name(self):
event = Event.objects.create(name='event', slug='event',
description='event', slots_per_day=1,
... | Add a test for public names | Add a test for public names
| Python | mit | thomasleese/rooster,thomasleese/rooster,thomasleese/rooster | from django.test import TestCase
# Create your tests here.
Add a test for public names | from django.test import TestCase
from .models import Event, Volunteer
class VolunteerTestCase(TestCase):
def test_gets_public_name(self):
event = Event.objects.create(name='event', slug='event',
description='event', slots_per_day=1,
... | <commit_before>from django.test import TestCase
# Create your tests here.
<commit_msg>Add a test for public names<commit_after> | from django.test import TestCase
from .models import Event, Volunteer
class VolunteerTestCase(TestCase):
def test_gets_public_name(self):
event = Event.objects.create(name='event', slug='event',
description='event', slots_per_day=1,
... | from django.test import TestCase
# Create your tests here.
Add a test for public namesfrom django.test import TestCase
from .models import Event, Volunteer
class VolunteerTestCase(TestCase):
def test_gets_public_name(self):
event = Event.objects.create(name='event', slug='event',
... | <commit_before>from django.test import TestCase
# Create your tests here.
<commit_msg>Add a test for public names<commit_after>from django.test import TestCase
from .models import Event, Volunteer
class VolunteerTestCase(TestCase):
def test_gets_public_name(self):
event = Event.objects.create(name='eve... |
28f7a893f28e8ee6e2dbc46c4a9dfdefe8bb11b5 | employees/serializers.py | employees/serializers.py | from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
depth = 1
fields = ('pk',
'username',
'email',
'first_name',
'last... | from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
depth = 1
fields = ('pk',
'username',
'email',
'first_name',
'last... | Change total_score in Employee Serializer | Change total_score in Employee Serializer
| Python | apache-2.0 | belatrix/BackendAllStars | from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
depth = 1
fields = ('pk',
'username',
'email',
'first_name',
'last... | from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
depth = 1
fields = ('pk',
'username',
'email',
'first_name',
'last... | <commit_before>from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
depth = 1
fields = ('pk',
'username',
'email',
'first_name',
... | from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
depth = 1
fields = ('pk',
'username',
'email',
'first_name',
'last... | from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
depth = 1
fields = ('pk',
'username',
'email',
'first_name',
'last... | <commit_before>from .models import Employee
from rest_framework import serializers
class EmployeeSerializer(serializers.ModelSerializer):
class Meta:
model = Employee
depth = 1
fields = ('pk',
'username',
'email',
'first_name',
... |
2eaf5b4d236e7d90ca88bab1e41fb280d5b21fc3 | spicedham/gottaimportthemall.py | spicedham/gottaimportthemall.py | import spicedham.bayes
import spicedham.digitdestroyer
import spicedham.nonsensefilter
from spicedham.sqlalchemywrapper import SqlAlchemyWrapper
| import spicedham.bayes
import spicedham.digitdestroyer
import spicedham.nonsensefilter
try:
from spicedham.sqlalchemywrapper import SqlAlchemyWrapper
except ImportError:
pass
| Fix ImportError if sqlalchemy not installed | Fix ImportError if sqlalchemy not installed
If sqlalchemy isn't installed, this would try to import the sqlalchemy
wrapper and then kick up an ImportError.
This changes it so that if there's an ImportError, it gets ignored.
| Python | mpl-2.0 | mozilla/spicedham,mozilla/spicedham | import spicedham.bayes
import spicedham.digitdestroyer
import spicedham.nonsensefilter
from spicedham.sqlalchemywrapper import SqlAlchemyWrapper
Fix ImportError if sqlalchemy not installed
If sqlalchemy isn't installed, this would try to import the sqlalchemy
wrapper and then kick up an ImportError.
This changes it s... | import spicedham.bayes
import spicedham.digitdestroyer
import spicedham.nonsensefilter
try:
from spicedham.sqlalchemywrapper import SqlAlchemyWrapper
except ImportError:
pass
| <commit_before>import spicedham.bayes
import spicedham.digitdestroyer
import spicedham.nonsensefilter
from spicedham.sqlalchemywrapper import SqlAlchemyWrapper
<commit_msg>Fix ImportError if sqlalchemy not installed
If sqlalchemy isn't installed, this would try to import the sqlalchemy
wrapper and then kick up an Impo... | import spicedham.bayes
import spicedham.digitdestroyer
import spicedham.nonsensefilter
try:
from spicedham.sqlalchemywrapper import SqlAlchemyWrapper
except ImportError:
pass
| import spicedham.bayes
import spicedham.digitdestroyer
import spicedham.nonsensefilter
from spicedham.sqlalchemywrapper import SqlAlchemyWrapper
Fix ImportError if sqlalchemy not installed
If sqlalchemy isn't installed, this would try to import the sqlalchemy
wrapper and then kick up an ImportError.
This changes it s... | <commit_before>import spicedham.bayes
import spicedham.digitdestroyer
import spicedham.nonsensefilter
from spicedham.sqlalchemywrapper import SqlAlchemyWrapper
<commit_msg>Fix ImportError if sqlalchemy not installed
If sqlalchemy isn't installed, this would try to import the sqlalchemy
wrapper and then kick up an Impo... |
abc6aa2a2c28acd97d22f4281875daf721505dc7 | examples/status_watcher.py | examples/status_watcher.py | import logging
import flist
from flist import opcode
from twisted.internet import reactor
def log_status(data):
logging.debug("{character} is {status}: {statusmsg}".format(**data))
def on_disconnect():
reactor.callLater(60, connect)
def connect():
account = flist.account_login('account', 'password')
... | import logging
from flist import account_login, opcode
from twisted.internet import reactor
def log_status(data):
logging.debug("{character} is {status}: {statusmsg}".format(**data))
def on_disconnect():
reactor.callLater(60, connect)
def connect():
account = account_login('account', 'password')
char... | Clean up imports in example | Clean up imports in example
| Python | bsd-2-clause | StormyDragon/python-flist | import logging
import flist
from flist import opcode
from twisted.internet import reactor
def log_status(data):
logging.debug("{character} is {status}: {statusmsg}".format(**data))
def on_disconnect():
reactor.callLater(60, connect)
def connect():
account = flist.account_login('account', 'password')
... | import logging
from flist import account_login, opcode
from twisted.internet import reactor
def log_status(data):
logging.debug("{character} is {status}: {statusmsg}".format(**data))
def on_disconnect():
reactor.callLater(60, connect)
def connect():
account = account_login('account', 'password')
char... | <commit_before>import logging
import flist
from flist import opcode
from twisted.internet import reactor
def log_status(data):
logging.debug("{character} is {status}: {statusmsg}".format(**data))
def on_disconnect():
reactor.callLater(60, connect)
def connect():
account = flist.account_login('account', '... | import logging
from flist import account_login, opcode
from twisted.internet import reactor
def log_status(data):
logging.debug("{character} is {status}: {statusmsg}".format(**data))
def on_disconnect():
reactor.callLater(60, connect)
def connect():
account = account_login('account', 'password')
char... | import logging
import flist
from flist import opcode
from twisted.internet import reactor
def log_status(data):
logging.debug("{character} is {status}: {statusmsg}".format(**data))
def on_disconnect():
reactor.callLater(60, connect)
def connect():
account = flist.account_login('account', 'password')
... | <commit_before>import logging
import flist
from flist import opcode
from twisted.internet import reactor
def log_status(data):
logging.debug("{character} is {status}: {statusmsg}".format(**data))
def on_disconnect():
reactor.callLater(60, connect)
def connect():
account = flist.account_login('account', '... |
9e5bb5dd850332cdb410fbc2c9fdf78d08b3e9fb | every_election/apps/organisations/constants.py | every_election/apps/organisations/constants.py | PARENT_TO_CHILD_AREAS = {
'DIS': ['DIW',],
'MTD': ['MTW',],
'CTY': ['CED',],
'LBO': ['LBW',],
'CED': ['CPC',],
'UTA': ['UTW', 'UTE'],
'NIA': ['NIE',],
}
CHILD_TO_PARENT_AREAS = {
'DIW': 'DIS',
'MTW': 'MTD',
'UTW': 'UTA',
'UTE': 'UTA',
'CED': 'CTY',
'LBW': 'LBO',
'... | PARENT_TO_CHILD_AREAS = {
'DIS': ['DIW',],
'MTD': ['MTW',],
'CTY': ['CED',],
'LBO': ['LBW',],
'CED': ['CPC',],
'UTA': ['UTW', 'UTE'],
'NIA': ['NIE',],
'COI': ['COP',],
}
CHILD_TO_PARENT_AREAS = {
'DIW': 'DIS',
'MTW': 'MTD',
'UTW': 'UTA',
'UTE': 'UTA',
'CED': 'CTY',
... | Support the Isles of Scilly | Support the Isles of Scilly
| Python | bsd-3-clause | DemocracyClub/EveryElection,DemocracyClub/EveryElection,DemocracyClub/EveryElection | PARENT_TO_CHILD_AREAS = {
'DIS': ['DIW',],
'MTD': ['MTW',],
'CTY': ['CED',],
'LBO': ['LBW',],
'CED': ['CPC',],
'UTA': ['UTW', 'UTE'],
'NIA': ['NIE',],
}
CHILD_TO_PARENT_AREAS = {
'DIW': 'DIS',
'MTW': 'MTD',
'UTW': 'UTA',
'UTE': 'UTA',
'CED': 'CTY',
'LBW': 'LBO',
'... | PARENT_TO_CHILD_AREAS = {
'DIS': ['DIW',],
'MTD': ['MTW',],
'CTY': ['CED',],
'LBO': ['LBW',],
'CED': ['CPC',],
'UTA': ['UTW', 'UTE'],
'NIA': ['NIE',],
'COI': ['COP',],
}
CHILD_TO_PARENT_AREAS = {
'DIW': 'DIS',
'MTW': 'MTD',
'UTW': 'UTA',
'UTE': 'UTA',
'CED': 'CTY',
... | <commit_before>PARENT_TO_CHILD_AREAS = {
'DIS': ['DIW',],
'MTD': ['MTW',],
'CTY': ['CED',],
'LBO': ['LBW',],
'CED': ['CPC',],
'UTA': ['UTW', 'UTE'],
'NIA': ['NIE',],
}
CHILD_TO_PARENT_AREAS = {
'DIW': 'DIS',
'MTW': 'MTD',
'UTW': 'UTA',
'UTE': 'UTA',
'CED': 'CTY',
'LBW... | PARENT_TO_CHILD_AREAS = {
'DIS': ['DIW',],
'MTD': ['MTW',],
'CTY': ['CED',],
'LBO': ['LBW',],
'CED': ['CPC',],
'UTA': ['UTW', 'UTE'],
'NIA': ['NIE',],
'COI': ['COP',],
}
CHILD_TO_PARENT_AREAS = {
'DIW': 'DIS',
'MTW': 'MTD',
'UTW': 'UTA',
'UTE': 'UTA',
'CED': 'CTY',
... | PARENT_TO_CHILD_AREAS = {
'DIS': ['DIW',],
'MTD': ['MTW',],
'CTY': ['CED',],
'LBO': ['LBW',],
'CED': ['CPC',],
'UTA': ['UTW', 'UTE'],
'NIA': ['NIE',],
}
CHILD_TO_PARENT_AREAS = {
'DIW': 'DIS',
'MTW': 'MTD',
'UTW': 'UTA',
'UTE': 'UTA',
'CED': 'CTY',
'LBW': 'LBO',
'... | <commit_before>PARENT_TO_CHILD_AREAS = {
'DIS': ['DIW',],
'MTD': ['MTW',],
'CTY': ['CED',],
'LBO': ['LBW',],
'CED': ['CPC',],
'UTA': ['UTW', 'UTE'],
'NIA': ['NIE',],
}
CHILD_TO_PARENT_AREAS = {
'DIW': 'DIS',
'MTW': 'MTD',
'UTW': 'UTA',
'UTE': 'UTA',
'CED': 'CTY',
'LBW... |
1aab2f41191d3de0b7bade31cdf83ae14be9dc2a | Lib/test/test_copy_reg.py | Lib/test/test_copy_reg.py | import copy_reg
class C:
pass
try:
copy_reg.pickle(C, None, None)
except TypeError, e:
print "Caught expected TypeError:"
print e
else:
print "Failed to catch expected TypeError when registering a class type."
print
try:
copy_reg.pickle(type(1), "not a callable")
except TypeError, e:
pr... | import copy_reg
import test_support
import unittest
class C:
pass
class CopyRegTestCase(unittest.TestCase):
def test_class(self):
self.assertRaises(TypeError, copy_reg.pickle,
C, None, None)
def test_noncallable_reduce(self):
self.assertRaises(TypeError, copy_... | Convert copy_reg test to PyUnit. | Convert copy_reg test to PyUnit.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | import copy_reg
class C:
pass
try:
copy_reg.pickle(C, None, None)
except TypeError, e:
print "Caught expected TypeError:"
print e
else:
print "Failed to catch expected TypeError when registering a class type."
print
try:
copy_reg.pickle(type(1), "not a callable")
except TypeError, e:
pr... | import copy_reg
import test_support
import unittest
class C:
pass
class CopyRegTestCase(unittest.TestCase):
def test_class(self):
self.assertRaises(TypeError, copy_reg.pickle,
C, None, None)
def test_noncallable_reduce(self):
self.assertRaises(TypeError, copy_... | <commit_before>import copy_reg
class C:
pass
try:
copy_reg.pickle(C, None, None)
except TypeError, e:
print "Caught expected TypeError:"
print e
else:
print "Failed to catch expected TypeError when registering a class type."
print
try:
copy_reg.pickle(type(1), "not a callable")
except TypeE... | import copy_reg
import test_support
import unittest
class C:
pass
class CopyRegTestCase(unittest.TestCase):
def test_class(self):
self.assertRaises(TypeError, copy_reg.pickle,
C, None, None)
def test_noncallable_reduce(self):
self.assertRaises(TypeError, copy_... | import copy_reg
class C:
pass
try:
copy_reg.pickle(C, None, None)
except TypeError, e:
print "Caught expected TypeError:"
print e
else:
print "Failed to catch expected TypeError when registering a class type."
print
try:
copy_reg.pickle(type(1), "not a callable")
except TypeError, e:
pr... | <commit_before>import copy_reg
class C:
pass
try:
copy_reg.pickle(C, None, None)
except TypeError, e:
print "Caught expected TypeError:"
print e
else:
print "Failed to catch expected TypeError when registering a class type."
print
try:
copy_reg.pickle(type(1), "not a callable")
except TypeE... |
581a36245c84850616cfd837177f0fd39e85f06d | django/conf/locale/lt/formats.py | django/conf/locale/lt/formats.py | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'Y \m. F j \d.'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
# YEAR_MONTH_F... | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'Y \m. F j \d.'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
# YEAR_MONTH_F... | Correct Lithuanian short date format. | Correct Lithuanian short date format.
| Python | bsd-3-clause | ironbox360/django,lsqtongxin/django,maxsocl/django,erikr/django,koniiiik/django,adelton/django,mitya57/django,aroche/django,apollo13/django,x111ong/django,hybrideagle/django,gchp/django,hobarrera/django,darkryder/django,stevenewey/django,peterlauri/django,frePPLe/django,hynekcer/django,TimYi/django,wkschwartz/django,df... | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'Y \m. F j \d.'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
# YEAR_MONTH_F... | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'Y \m. F j \d.'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
# YEAR_MONTH_F... | <commit_before># -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'Y \m. F j \d.'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT = ... | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'Y \m. F j \d.'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
# YEAR_MONTH_F... | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'Y \m. F j \d.'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
# YEAR_MONTH_F... | <commit_before># -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'Y \m. F j \d.'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT = ... |
8281a2f614d686ba7c8c14e108d8415a43c80602 | tests/blueprints/test_bp_features.py | tests/blueprints/test_bp_features.py | from flask import url_for
from tests.base import SampleFrontendTestBase
class BpFeaturesTestCase(SampleFrontendTestBase):
def test_bustimes_reachable(self):
self.assert200(self.client.get(url_for('features.bustimes')))
self.assertTemplateUsed("bustimes.html")
| from unittest.mock import patch, MagicMock
from flask import url_for
from tests.base import SampleFrontendTestBase
class BpFeaturesTestCase(SampleFrontendTestBase):
def test_bustimes_reachable(self):
mock = MagicMock()
with patch('sipa.blueprints.features.get_bustimes', mock):
resp =... | Improve test_bustimes speed by using mock | Improve test_bustimes speed by using mock
| Python | mit | MarauderXtreme/sipa,agdsn/sipa,agdsn/sipa,agdsn/sipa,lukasjuhrich/sipa,lukasjuhrich/sipa,MarauderXtreme/sipa,agdsn/sipa,lukasjuhrich/sipa,MarauderXtreme/sipa,lukasjuhrich/sipa | from flask import url_for
from tests.base import SampleFrontendTestBase
class BpFeaturesTestCase(SampleFrontendTestBase):
def test_bustimes_reachable(self):
self.assert200(self.client.get(url_for('features.bustimes')))
self.assertTemplateUsed("bustimes.html")
Improve test_bustimes speed by using ... | from unittest.mock import patch, MagicMock
from flask import url_for
from tests.base import SampleFrontendTestBase
class BpFeaturesTestCase(SampleFrontendTestBase):
def test_bustimes_reachable(self):
mock = MagicMock()
with patch('sipa.blueprints.features.get_bustimes', mock):
resp =... | <commit_before>from flask import url_for
from tests.base import SampleFrontendTestBase
class BpFeaturesTestCase(SampleFrontendTestBase):
def test_bustimes_reachable(self):
self.assert200(self.client.get(url_for('features.bustimes')))
self.assertTemplateUsed("bustimes.html")
<commit_msg>Improve te... | from unittest.mock import patch, MagicMock
from flask import url_for
from tests.base import SampleFrontendTestBase
class BpFeaturesTestCase(SampleFrontendTestBase):
def test_bustimes_reachable(self):
mock = MagicMock()
with patch('sipa.blueprints.features.get_bustimes', mock):
resp =... | from flask import url_for
from tests.base import SampleFrontendTestBase
class BpFeaturesTestCase(SampleFrontendTestBase):
def test_bustimes_reachable(self):
self.assert200(self.client.get(url_for('features.bustimes')))
self.assertTemplateUsed("bustimes.html")
Improve test_bustimes speed by using ... | <commit_before>from flask import url_for
from tests.base import SampleFrontendTestBase
class BpFeaturesTestCase(SampleFrontendTestBase):
def test_bustimes_reachable(self):
self.assert200(self.client.get(url_for('features.bustimes')))
self.assertTemplateUsed("bustimes.html")
<commit_msg>Improve te... |
89f7678aa065d70d12d880ddaa7c22bbab2e84a8 | scripts/install.py | scripts/install.py | import subprocess
def run(command, *args, **kwargs):
print("+ {}".format(command))
subprocess.run(command, *args, **kwargs)
run("git submodule update --init", shell=True)
run("pip install -e magma", shell=True)
run("pip install -e mantle", shell=True)
run("pip install -e loam", shell=True)
run("pip install fa... | import subprocess
def run(command, *args, **kwargs):
print("+ {}".format(command))
subprocess.run(command, *args, **kwargs)
run("git submodule update --init", shell=True)
run("pip install -e magma", shell=True)
run("pip install -e mantle", shell=True)
run("pip install -e loam", shell=True)
run("pip install fa... | Install jupyter so people can follow along with notebooks | Install jupyter so people can follow along with notebooks
| Python | mit | phanrahan/magmathon,phanrahan/magmathon | import subprocess
def run(command, *args, **kwargs):
print("+ {}".format(command))
subprocess.run(command, *args, **kwargs)
run("git submodule update --init", shell=True)
run("pip install -e magma", shell=True)
run("pip install -e mantle", shell=True)
run("pip install -e loam", shell=True)
run("pip install fa... | import subprocess
def run(command, *args, **kwargs):
print("+ {}".format(command))
subprocess.run(command, *args, **kwargs)
run("git submodule update --init", shell=True)
run("pip install -e magma", shell=True)
run("pip install -e mantle", shell=True)
run("pip install -e loam", shell=True)
run("pip install fa... | <commit_before>import subprocess
def run(command, *args, **kwargs):
print("+ {}".format(command))
subprocess.run(command, *args, **kwargs)
run("git submodule update --init", shell=True)
run("pip install -e magma", shell=True)
run("pip install -e mantle", shell=True)
run("pip install -e loam", shell=True)
run(... | import subprocess
def run(command, *args, **kwargs):
print("+ {}".format(command))
subprocess.run(command, *args, **kwargs)
run("git submodule update --init", shell=True)
run("pip install -e magma", shell=True)
run("pip install -e mantle", shell=True)
run("pip install -e loam", shell=True)
run("pip install fa... | import subprocess
def run(command, *args, **kwargs):
print("+ {}".format(command))
subprocess.run(command, *args, **kwargs)
run("git submodule update --init", shell=True)
run("pip install -e magma", shell=True)
run("pip install -e mantle", shell=True)
run("pip install -e loam", shell=True)
run("pip install fa... | <commit_before>import subprocess
def run(command, *args, **kwargs):
print("+ {}".format(command))
subprocess.run(command, *args, **kwargs)
run("git submodule update --init", shell=True)
run("pip install -e magma", shell=True)
run("pip install -e mantle", shell=True)
run("pip install -e loam", shell=True)
run(... |
6041ecfa5b9bb89a7fa1502fe4d26868dc749b94 | dimod/package_info.py | dimod/package_info.py | # Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | # Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Update version 0.7.3 -> 0.7.4 | Update version 0.7.3 -> 0.7.4 | Python | apache-2.0 | dwavesystems/dimod,dwavesystems/dimod | # Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | # Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | <commit_before># Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | # Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | # Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | <commit_before># Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
8f1cbac14b2a24a3a124107c8252b7be6282f5a4 | ODBPy/Components.py | ODBPy/Components.py | #!/usr/bin/env python3
import os.path
from collections import namedtuple
from .LineRecordParser import *
from .SurfaceParser import *
from .PolygonParser import *
from .ComponentParser import *
from .Decoder import *
from .Treeifier import *
from .Units import *
Components = namedtuple("Components", ["top", "bot"])
d... | #!/usr/bin/env python3
import os.path
from collections import namedtuple
from .LineRecordParser import *
from .SurfaceParser import *
from .PolygonParser import *
from .ComponentParser import *
from .Decoder import *
from .Treeifier import *
from .Units import *
Components = namedtuple("Components", ["top", "bot"])
d... | Allow ODB without components on bottom | Allow ODB without components on bottom
| Python | apache-2.0 | ulikoehler/ODBPy | #!/usr/bin/env python3
import os.path
from collections import namedtuple
from .LineRecordParser import *
from .SurfaceParser import *
from .PolygonParser import *
from .ComponentParser import *
from .Decoder import *
from .Treeifier import *
from .Units import *
Components = namedtuple("Components", ["top", "bot"])
d... | #!/usr/bin/env python3
import os.path
from collections import namedtuple
from .LineRecordParser import *
from .SurfaceParser import *
from .PolygonParser import *
from .ComponentParser import *
from .Decoder import *
from .Treeifier import *
from .Units import *
Components = namedtuple("Components", ["top", "bot"])
d... | <commit_before>#!/usr/bin/env python3
import os.path
from collections import namedtuple
from .LineRecordParser import *
from .SurfaceParser import *
from .PolygonParser import *
from .ComponentParser import *
from .Decoder import *
from .Treeifier import *
from .Units import *
Components = namedtuple("Components", ["t... | #!/usr/bin/env python3
import os.path
from collections import namedtuple
from .LineRecordParser import *
from .SurfaceParser import *
from .PolygonParser import *
from .ComponentParser import *
from .Decoder import *
from .Treeifier import *
from .Units import *
Components = namedtuple("Components", ["top", "bot"])
d... | #!/usr/bin/env python3
import os.path
from collections import namedtuple
from .LineRecordParser import *
from .SurfaceParser import *
from .PolygonParser import *
from .ComponentParser import *
from .Decoder import *
from .Treeifier import *
from .Units import *
Components = namedtuple("Components", ["top", "bot"])
d... | <commit_before>#!/usr/bin/env python3
import os.path
from collections import namedtuple
from .LineRecordParser import *
from .SurfaceParser import *
from .PolygonParser import *
from .ComponentParser import *
from .Decoder import *
from .Treeifier import *
from .Units import *
Components = namedtuple("Components", ["t... |
0b6d5b0d10974842a0e52904d9793bfa4313ffb0 | src/api/v1/watchers/__init__.py | src/api/v1/watchers/__init__.py | """
Copyright 2016 ElasticBox All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | """
Copyright 2016 ElasticBox All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | Fix user role filtered namespace | Fix user role filtered namespace
| Python | apache-2.0 | ElasticBox/elastickube,ElasticBox/elastickube,ElasticBox/elastickube,ElasticBox/elastickube,ElasticBox/elastickube | """
Copyright 2016 ElasticBox All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | """
Copyright 2016 ElasticBox All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | <commit_before>"""
Copyright 2016 ElasticBox All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law o... | """
Copyright 2016 ElasticBox All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | """
Copyright 2016 ElasticBox All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | <commit_before>"""
Copyright 2016 ElasticBox All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law o... |
78c176c19a5fa03d03c9f2ff9b083a134888f964 | test_arrange_schedule.py | test_arrange_schedule.py | import unittest
from arrange_schedule import *
class Arrange_Schedule(unittest.TestCase):
def setUp(self):
# test_read_system_setting
keys = ['board_py_dir','shutdown','max_db_log','min_db_activity']
system_setting = read_system_setting()
for key in keys:
assert key in s... | import unittest
from arrange_schedule import *
class Arrange_Schedule(unittest.TestCase):
def setUp(self):
# test_read_system_setting
keys = ['board_py_dir','shutdown','max_db_log','min_db_activity']
system_setting = read_system_setting()
for key in keys:
assert key in s... | Add test case for set_schedule_log | Add test case for set_schedule_log
| Python | apache-2.0 | Billy4195/electronic-blackboard,chenyang14/electronic-blackboard,stvreumi/electronic-blackboard,stvreumi/electronic-blackboard,Billy4195/electronic-blackboard,Billy4195/electronic-blackboard,SWLBot/electronic-blackboard,Billy4195/electronic-blackboard,chenyang14/electronic-blackboard,chenyang14/electronic-blackboard,SW... | import unittest
from arrange_schedule import *
class Arrange_Schedule(unittest.TestCase):
def setUp(self):
# test_read_system_setting
keys = ['board_py_dir','shutdown','max_db_log','min_db_activity']
system_setting = read_system_setting()
for key in keys:
assert key in s... | import unittest
from arrange_schedule import *
class Arrange_Schedule(unittest.TestCase):
def setUp(self):
# test_read_system_setting
keys = ['board_py_dir','shutdown','max_db_log','min_db_activity']
system_setting = read_system_setting()
for key in keys:
assert key in s... | <commit_before>import unittest
from arrange_schedule import *
class Arrange_Schedule(unittest.TestCase):
def setUp(self):
# test_read_system_setting
keys = ['board_py_dir','shutdown','max_db_log','min_db_activity']
system_setting = read_system_setting()
for key in keys:
... | import unittest
from arrange_schedule import *
class Arrange_Schedule(unittest.TestCase):
def setUp(self):
# test_read_system_setting
keys = ['board_py_dir','shutdown','max_db_log','min_db_activity']
system_setting = read_system_setting()
for key in keys:
assert key in s... | import unittest
from arrange_schedule import *
class Arrange_Schedule(unittest.TestCase):
def setUp(self):
# test_read_system_setting
keys = ['board_py_dir','shutdown','max_db_log','min_db_activity']
system_setting = read_system_setting()
for key in keys:
assert key in s... | <commit_before>import unittest
from arrange_schedule import *
class Arrange_Schedule(unittest.TestCase):
def setUp(self):
# test_read_system_setting
keys = ['board_py_dir','shutdown','max_db_log','min_db_activity']
system_setting = read_system_setting()
for key in keys:
... |
ebc4acb745287762cc8cb0a18fb97ed3e01c9ab0 | mkerefuse/util.py | mkerefuse/util.py | from lxml import html
class XPathObject(object):
input_properties = {}
"""Dict of keys (property names) and XPaths (to read vals from)"""
@classmethod
def FromHTML(cls, html_contents):
inst = cls()
print("Reading through {b} bytes for {c} properties...".format(
b=len(html_... | import json
from lxml import html
class XPathObject(object):
input_properties = {}
"""Dict of keys (property names) and XPaths (to read vals from)"""
@classmethod
def FromHTML(cls, html_contents):
inst = cls()
print("Reading through {b} bytes for {c} properties...".format(
... | Add json library for repr() calls | Add json library for repr() calls
| Python | unlicense | tomislacker/python-mke-trash-pickup,tomislacker/python-mke-trash-pickup | from lxml import html
class XPathObject(object):
input_properties = {}
"""Dict of keys (property names) and XPaths (to read vals from)"""
@classmethod
def FromHTML(cls, html_contents):
inst = cls()
print("Reading through {b} bytes for {c} properties...".format(
b=len(html_... | import json
from lxml import html
class XPathObject(object):
input_properties = {}
"""Dict of keys (property names) and XPaths (to read vals from)"""
@classmethod
def FromHTML(cls, html_contents):
inst = cls()
print("Reading through {b} bytes for {c} properties...".format(
... | <commit_before>from lxml import html
class XPathObject(object):
input_properties = {}
"""Dict of keys (property names) and XPaths (to read vals from)"""
@classmethod
def FromHTML(cls, html_contents):
inst = cls()
print("Reading through {b} bytes for {c} properties...".format(
... | import json
from lxml import html
class XPathObject(object):
input_properties = {}
"""Dict of keys (property names) and XPaths (to read vals from)"""
@classmethod
def FromHTML(cls, html_contents):
inst = cls()
print("Reading through {b} bytes for {c} properties...".format(
... | from lxml import html
class XPathObject(object):
input_properties = {}
"""Dict of keys (property names) and XPaths (to read vals from)"""
@classmethod
def FromHTML(cls, html_contents):
inst = cls()
print("Reading through {b} bytes for {c} properties...".format(
b=len(html_... | <commit_before>from lxml import html
class XPathObject(object):
input_properties = {}
"""Dict of keys (property names) and XPaths (to read vals from)"""
@classmethod
def FromHTML(cls, html_contents):
inst = cls()
print("Reading through {b} bytes for {c} properties...".format(
... |
5ec594545cf30e387d888b5509dcdaf2ce9518e3 | fake_useragent/settings.py | fake_useragent/settings.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import tempfile
__version__ = '0.1.11'
DB = os.path.join(
tempfile.gettempdir(),
'fake_useragent_{version}.json'.format(
version=__version__,
),
)
CACHE_SERVER = 'https://fake-useragent.herokuapp.com/brows... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import tempfile
__version__ = '0.1.11'
DB = os.path.join(
tempfile.gettempdir(),
'fake_useragent_{version}.json'.format(
version=__version__,
),
)
CACHE_SERVER = 'https://fake-useragent.herokuapp.com/brows... | Fix tests failing on long line | Fix tests failing on long line | Python | apache-2.0 | hellysmile/fake-useragent,hellysmile/fake-useragent,hellysmile/fake-useragent | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import tempfile
__version__ = '0.1.11'
DB = os.path.join(
tempfile.gettempdir(),
'fake_useragent_{version}.json'.format(
version=__version__,
),
)
CACHE_SERVER = 'https://fake-useragent.herokuapp.com/brows... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import tempfile
__version__ = '0.1.11'
DB = os.path.join(
tempfile.gettempdir(),
'fake_useragent_{version}.json'.format(
version=__version__,
),
)
CACHE_SERVER = 'https://fake-useragent.herokuapp.com/brows... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import tempfile
__version__ = '0.1.11'
DB = os.path.join(
tempfile.gettempdir(),
'fake_useragent_{version}.json'.format(
version=__version__,
),
)
CACHE_SERVER = 'https://fake-useragent.hero... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import tempfile
__version__ = '0.1.11'
DB = os.path.join(
tempfile.gettempdir(),
'fake_useragent_{version}.json'.format(
version=__version__,
),
)
CACHE_SERVER = 'https://fake-useragent.herokuapp.com/brows... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import tempfile
__version__ = '0.1.11'
DB = os.path.join(
tempfile.gettempdir(),
'fake_useragent_{version}.json'.format(
version=__version__,
),
)
CACHE_SERVER = 'https://fake-useragent.herokuapp.com/brows... | <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import tempfile
__version__ = '0.1.11'
DB = os.path.join(
tempfile.gettempdir(),
'fake_useragent_{version}.json'.format(
version=__version__,
),
)
CACHE_SERVER = 'https://fake-useragent.hero... |
0183a92ad8488f80e884df7da231e4202b4e3bdb | shipyard2/rules/pods/operations/build.py | shipyard2/rules/pods/operations/build.py | from pathlib import Path
import shipyard2.rules.pods
OPS_DB_PATH = Path('/srv/operations/database/v1')
shipyard2.rules.pods.define_pod(
name='database',
apps=[
shipyard2.rules.pods.App(
name='database',
exec=[
'python3',
*('-m', 'g1.operations.d... | from pathlib import Path
import shipyard2.rules.pods
OPS_DB_PATH = Path('/srv/operations/database/v1')
shipyard2.rules.pods.define_pod(
name='database',
apps=[
shipyard2.rules.pods.App(
name='database',
exec=[
'python3',
*('-m', 'g1.operations.d... | Add journal watcher unit to pod rules | Add journal watcher unit to pod rules
| Python | mit | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | from pathlib import Path
import shipyard2.rules.pods
OPS_DB_PATH = Path('/srv/operations/database/v1')
shipyard2.rules.pods.define_pod(
name='database',
apps=[
shipyard2.rules.pods.App(
name='database',
exec=[
'python3',
*('-m', 'g1.operations.d... | from pathlib import Path
import shipyard2.rules.pods
OPS_DB_PATH = Path('/srv/operations/database/v1')
shipyard2.rules.pods.define_pod(
name='database',
apps=[
shipyard2.rules.pods.App(
name='database',
exec=[
'python3',
*('-m', 'g1.operations.d... | <commit_before>from pathlib import Path
import shipyard2.rules.pods
OPS_DB_PATH = Path('/srv/operations/database/v1')
shipyard2.rules.pods.define_pod(
name='database',
apps=[
shipyard2.rules.pods.App(
name='database',
exec=[
'python3',
*('-m', '... | from pathlib import Path
import shipyard2.rules.pods
OPS_DB_PATH = Path('/srv/operations/database/v1')
shipyard2.rules.pods.define_pod(
name='database',
apps=[
shipyard2.rules.pods.App(
name='database',
exec=[
'python3',
*('-m', 'g1.operations.d... | from pathlib import Path
import shipyard2.rules.pods
OPS_DB_PATH = Path('/srv/operations/database/v1')
shipyard2.rules.pods.define_pod(
name='database',
apps=[
shipyard2.rules.pods.App(
name='database',
exec=[
'python3',
*('-m', 'g1.operations.d... | <commit_before>from pathlib import Path
import shipyard2.rules.pods
OPS_DB_PATH = Path('/srv/operations/database/v1')
shipyard2.rules.pods.define_pod(
name='database',
apps=[
shipyard2.rules.pods.App(
name='database',
exec=[
'python3',
*('-m', '... |
d0d79ae8073b3d363b3b99e0e42659662b2bf4eb | go/conversation/models.py | go/conversation/models.py | from django.db import models
from go.contacts.models import Contact
class Conversation(models.Model):
"""A conversation with an audience"""
user = models.ForeignKey('auth.User')
subject = models.CharField('Conversation Name', max_length=255)
message = models.TextField('Message')
start_date = model... | from django.db import models
from go.contacts.models import Contact
class Conversation(models.Model):
"""A conversation with an audience"""
user = models.ForeignKey('auth.User')
subject = models.CharField('Conversation Name', max_length=255)
message = models.TextField('Message')
start_date = model... | Add link from conversations to message batches. | Add link from conversations to message batches.
| Python | bsd-3-clause | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | from django.db import models
from go.contacts.models import Contact
class Conversation(models.Model):
"""A conversation with an audience"""
user = models.ForeignKey('auth.User')
subject = models.CharField('Conversation Name', max_length=255)
message = models.TextField('Message')
start_date = model... | from django.db import models
from go.contacts.models import Contact
class Conversation(models.Model):
"""A conversation with an audience"""
user = models.ForeignKey('auth.User')
subject = models.CharField('Conversation Name', max_length=255)
message = models.TextField('Message')
start_date = model... | <commit_before>from django.db import models
from go.contacts.models import Contact
class Conversation(models.Model):
"""A conversation with an audience"""
user = models.ForeignKey('auth.User')
subject = models.CharField('Conversation Name', max_length=255)
message = models.TextField('Message')
sta... | from django.db import models
from go.contacts.models import Contact
class Conversation(models.Model):
"""A conversation with an audience"""
user = models.ForeignKey('auth.User')
subject = models.CharField('Conversation Name', max_length=255)
message = models.TextField('Message')
start_date = model... | from django.db import models
from go.contacts.models import Contact
class Conversation(models.Model):
"""A conversation with an audience"""
user = models.ForeignKey('auth.User')
subject = models.CharField('Conversation Name', max_length=255)
message = models.TextField('Message')
start_date = model... | <commit_before>from django.db import models
from go.contacts.models import Contact
class Conversation(models.Model):
"""A conversation with an audience"""
user = models.ForeignKey('auth.User')
subject = models.CharField('Conversation Name', max_length=255)
message = models.TextField('Message')
sta... |
8ff998d6f56077d4a6d2c174b3871100e43bae86 | buildscripts/create_conda_pyenv_retry.py | buildscripts/create_conda_pyenv_retry.py | import subprocess
from os import unlink
from os.path import realpath, islink, isfile, isdir
import sys
import shutil
import time
def rm_rf(path):
if islink(path) or isfile(path):
# Note that we have to check if the destination is a link because
# exists('/path/to/dead-link') will return False, alth... | import subprocess
from os import unlink
from os.path import realpath, islink, isfile, isdir
import sys
import shutil
import time
def rm_rf(path):
if islink(path) or isfile(path):
# Note that we have to check if the destination is a link because
# exists('/path/to/dead-link') will return False, alth... | Make shell=True for the conda subprocess | Make shell=True for the conda subprocess
| Python | bsd-2-clause | mwiebe/dynd-python,aterrel/dynd-python,izaid/dynd-python,mwiebe/dynd-python,pombredanne/dynd-python,pombredanne/dynd-python,insertinterestingnamehere/dynd-python,aterrel/dynd-python,pombredanne/dynd-python,mwiebe/dynd-python,izaid/dynd-python,cpcloud/dynd-python,michaelpacer/dynd-python,michaelpacer/dynd-python,izaid/d... | import subprocess
from os import unlink
from os.path import realpath, islink, isfile, isdir
import sys
import shutil
import time
def rm_rf(path):
if islink(path) or isfile(path):
# Note that we have to check if the destination is a link because
# exists('/path/to/dead-link') will return False, alth... | import subprocess
from os import unlink
from os.path import realpath, islink, isfile, isdir
import sys
import shutil
import time
def rm_rf(path):
if islink(path) or isfile(path):
# Note that we have to check if the destination is a link because
# exists('/path/to/dead-link') will return False, alth... | <commit_before>import subprocess
from os import unlink
from os.path import realpath, islink, isfile, isdir
import sys
import shutil
import time
def rm_rf(path):
if islink(path) or isfile(path):
# Note that we have to check if the destination is a link because
# exists('/path/to/dead-link') will ret... | import subprocess
from os import unlink
from os.path import realpath, islink, isfile, isdir
import sys
import shutil
import time
def rm_rf(path):
if islink(path) or isfile(path):
# Note that we have to check if the destination is a link because
# exists('/path/to/dead-link') will return False, alth... | import subprocess
from os import unlink
from os.path import realpath, islink, isfile, isdir
import sys
import shutil
import time
def rm_rf(path):
if islink(path) or isfile(path):
# Note that we have to check if the destination is a link because
# exists('/path/to/dead-link') will return False, alth... | <commit_before>import subprocess
from os import unlink
from os.path import realpath, islink, isfile, isdir
import sys
import shutil
import time
def rm_rf(path):
if islink(path) or isfile(path):
# Note that we have to check if the destination is a link because
# exists('/path/to/dead-link') will ret... |
36a76ba62533fe04f71da4e8d4ac7e5a22d0835d | tests/test_20_message.py | tests/test_20_message.py |
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import open
import os.path
from eccodes_grib import eccodes
from eccodes_grib import message
TEST_DATA = os.path.join(os.path.dirname(__file__), 'sample-data', 'ERA5_levels.grib')
def test_GribMessage():
codes_id... |
from __future__ import absolute_import, division, print_function, unicode_literals
import os.path
from eccodes_grib import eccodes
from eccodes_grib import message
TEST_DATA = os.path.join(os.path.dirname(__file__), 'sample-data', 'ERA5_levels.grib')
def test_GribMessage():
codes_id = eccodes.grib_new_from_f... | Fix python 2.7 (CFFI requires the use of the native open). | Fix python 2.7 (CFFI requires the use of the native open).
| Python | apache-2.0 | ecmwf/cfgrib |
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import open
import os.path
from eccodes_grib import eccodes
from eccodes_grib import message
TEST_DATA = os.path.join(os.path.dirname(__file__), 'sample-data', 'ERA5_levels.grib')
def test_GribMessage():
codes_id... |
from __future__ import absolute_import, division, print_function, unicode_literals
import os.path
from eccodes_grib import eccodes
from eccodes_grib import message
TEST_DATA = os.path.join(os.path.dirname(__file__), 'sample-data', 'ERA5_levels.grib')
def test_GribMessage():
codes_id = eccodes.grib_new_from_f... | <commit_before>
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import open
import os.path
from eccodes_grib import eccodes
from eccodes_grib import message
TEST_DATA = os.path.join(os.path.dirname(__file__), 'sample-data', 'ERA5_levels.grib')
def test_GribMessage(... |
from __future__ import absolute_import, division, print_function, unicode_literals
import os.path
from eccodes_grib import eccodes
from eccodes_grib import message
TEST_DATA = os.path.join(os.path.dirname(__file__), 'sample-data', 'ERA5_levels.grib')
def test_GribMessage():
codes_id = eccodes.grib_new_from_f... |
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import open
import os.path
from eccodes_grib import eccodes
from eccodes_grib import message
TEST_DATA = os.path.join(os.path.dirname(__file__), 'sample-data', 'ERA5_levels.grib')
def test_GribMessage():
codes_id... | <commit_before>
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import open
import os.path
from eccodes_grib import eccodes
from eccodes_grib import message
TEST_DATA = os.path.join(os.path.dirname(__file__), 'sample-data', 'ERA5_levels.grib')
def test_GribMessage(... |
274fe2d2e63a9cf079e8cdce2732b81c21816c96 | cellarDAO.py | cellarDAO.py | import string
class CellarDAO(object):
#Init class with mongo database
def __init__(self, database):
self.db = database
self.bottles = database.bottles
#Get all bottles in cellar
def find_bottles(self):
current_bottles = []
for bottle in self.bottles.find():
current_bottles.append({'name':bottle['n... | import string
class CellarDAO(object):
#Init class with mongo database
def __init__(self, database):
self.db = database
self.bottles = database.bottles
#Get all bottles in cellar
def find_bottles(self):
current_bottles = []
for bottle in self.bottles.find():
current_bottles.append({'name':bottle['n... | Fix bug to insert the bottle in mongoDB | Fix bug to insert the bottle in mongoDB
| Python | mit | djolaq/wine-bottle,djolaq/wine-bottle | import string
class CellarDAO(object):
#Init class with mongo database
def __init__(self, database):
self.db = database
self.bottles = database.bottles
#Get all bottles in cellar
def find_bottles(self):
current_bottles = []
for bottle in self.bottles.find():
current_bottles.append({'name':bottle['n... | import string
class CellarDAO(object):
#Init class with mongo database
def __init__(self, database):
self.db = database
self.bottles = database.bottles
#Get all bottles in cellar
def find_bottles(self):
current_bottles = []
for bottle in self.bottles.find():
current_bottles.append({'name':bottle['n... | <commit_before>import string
class CellarDAO(object):
#Init class with mongo database
def __init__(self, database):
self.db = database
self.bottles = database.bottles
#Get all bottles in cellar
def find_bottles(self):
current_bottles = []
for bottle in self.bottles.find():
current_bottles.append({'... | import string
class CellarDAO(object):
#Init class with mongo database
def __init__(self, database):
self.db = database
self.bottles = database.bottles
#Get all bottles in cellar
def find_bottles(self):
current_bottles = []
for bottle in self.bottles.find():
current_bottles.append({'name':bottle['n... | import string
class CellarDAO(object):
#Init class with mongo database
def __init__(self, database):
self.db = database
self.bottles = database.bottles
#Get all bottles in cellar
def find_bottles(self):
current_bottles = []
for bottle in self.bottles.find():
current_bottles.append({'name':bottle['n... | <commit_before>import string
class CellarDAO(object):
#Init class with mongo database
def __init__(self, database):
self.db = database
self.bottles = database.bottles
#Get all bottles in cellar
def find_bottles(self):
current_bottles = []
for bottle in self.bottles.find():
current_bottles.append({'... |
60ae97e2060cb01ac159acc6c0c7abdf866019b0 | clean_lxd.py | clean_lxd.py | #!/usr/bin/env python
from __future__ import print_function
from argparse import ArgumentParser
from datetime import (
datetime,
timedelta,
)
import json
import os
import subprocess
import sys
def list_old_juju_containers(hours):
env = dict(os.environ)
containers = json.loads(subprocess.check_out... | #!/usr/bin/env python
from __future__ import print_function
from argparse import ArgumentParser
from datetime import (
datetime,
timedelta,
)
import json
import os
import subprocess
import sys
from dateutil import (
parser as date_parser,
tz,
)
def list_old_juju_containers(hours):
env = ... | Use dateutil to calculate age of container. | Use dateutil to calculate age of container. | Python | agpl-3.0 | mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju | #!/usr/bin/env python
from __future__ import print_function
from argparse import ArgumentParser
from datetime import (
datetime,
timedelta,
)
import json
import os
import subprocess
import sys
def list_old_juju_containers(hours):
env = dict(os.environ)
containers = json.loads(subprocess.check_out... | #!/usr/bin/env python
from __future__ import print_function
from argparse import ArgumentParser
from datetime import (
datetime,
timedelta,
)
import json
import os
import subprocess
import sys
from dateutil import (
parser as date_parser,
tz,
)
def list_old_juju_containers(hours):
env = ... | <commit_before>#!/usr/bin/env python
from __future__ import print_function
from argparse import ArgumentParser
from datetime import (
datetime,
timedelta,
)
import json
import os
import subprocess
import sys
def list_old_juju_containers(hours):
env = dict(os.environ)
containers = json.loads(subpr... | #!/usr/bin/env python
from __future__ import print_function
from argparse import ArgumentParser
from datetime import (
datetime,
timedelta,
)
import json
import os
import subprocess
import sys
from dateutil import (
parser as date_parser,
tz,
)
def list_old_juju_containers(hours):
env = ... | #!/usr/bin/env python
from __future__ import print_function
from argparse import ArgumentParser
from datetime import (
datetime,
timedelta,
)
import json
import os
import subprocess
import sys
def list_old_juju_containers(hours):
env = dict(os.environ)
containers = json.loads(subprocess.check_out... | <commit_before>#!/usr/bin/env python
from __future__ import print_function
from argparse import ArgumentParser
from datetime import (
datetime,
timedelta,
)
import json
import os
import subprocess
import sys
def list_old_juju_containers(hours):
env = dict(os.environ)
containers = json.loads(subpr... |
77d658a8874c3808c6660248073552809b1a69f7 | show/utils.py | show/utils.py | from django.utils import timezone
from show.models import Show
def get_current_permitted_show(klass=Show):
# does_not_repeat requires a datetime match. All the others operate on
# time.
# todo: may need to fall back to SQL since we can't cast datetime to date
# using the ORM. Or use time fields inst... | from django.utils import timezone
from show.models import Show
def get_current_permitted_show(klass=Show, now=None):
# does_not_repeat requires a datetime match. All the others operate on
# time.
# todo: may need to fall back to SQL since we can't cast datetime to date
# using the ORM. Or use time f... | Change calculation for on air now | Change calculation for on air now
| Python | bsd-3-clause | praekelt/jmbo-show,praekelt/jmbo-show | from django.utils import timezone
from show.models import Show
def get_current_permitted_show(klass=Show):
# does_not_repeat requires a datetime match. All the others operate on
# time.
# todo: may need to fall back to SQL since we can't cast datetime to date
# using the ORM. Or use time fields inst... | from django.utils import timezone
from show.models import Show
def get_current_permitted_show(klass=Show, now=None):
# does_not_repeat requires a datetime match. All the others operate on
# time.
# todo: may need to fall back to SQL since we can't cast datetime to date
# using the ORM. Or use time f... | <commit_before>from django.utils import timezone
from show.models import Show
def get_current_permitted_show(klass=Show):
# does_not_repeat requires a datetime match. All the others operate on
# time.
# todo: may need to fall back to SQL since we can't cast datetime to date
# using the ORM. Or use t... | from django.utils import timezone
from show.models import Show
def get_current_permitted_show(klass=Show, now=None):
# does_not_repeat requires a datetime match. All the others operate on
# time.
# todo: may need to fall back to SQL since we can't cast datetime to date
# using the ORM. Or use time f... | from django.utils import timezone
from show.models import Show
def get_current_permitted_show(klass=Show):
# does_not_repeat requires a datetime match. All the others operate on
# time.
# todo: may need to fall back to SQL since we can't cast datetime to date
# using the ORM. Or use time fields inst... | <commit_before>from django.utils import timezone
from show.models import Show
def get_current_permitted_show(klass=Show):
# does_not_repeat requires a datetime match. All the others operate on
# time.
# todo: may need to fall back to SQL since we can't cast datetime to date
# using the ORM. Or use t... |
d5ddfb8af861f02074fe113f87a6ea6b4f1bc5db | tests/child-process-sigterm-trap.py | tests/child-process-sigterm-trap.py | #!/usr/bin/env python3
from common import *
import sys, signal
# Be naughty and ignore SIGTERM to simulate hanging child
signal.signal(signal.SIGTERM, signal.SIG_IGN)
# Start a server that listens for incoming connections
try:
print_ok("child starting up on port %s" % sys.argv[1])
s = TcpServer(int(sys.argv[... | #!/usr/bin/env python3
from common import *
import sys, signal
# Be naughty and ignore SIGTERM to simulate hanging child
signal.signal(signal.SIGTERM, signal.SIG_IGN)
# Start a server that listens for incoming connections
try:
print_ok("child starting up on port %s" % sys.argv[1])
s = TcpServer(int(sys.argv[1]))... | Fix formatting in child sample to match other files | Fix formatting in child sample to match other files
| Python | apache-2.0 | square/ghostunnel,square/ghostunnel | #!/usr/bin/env python3
from common import *
import sys, signal
# Be naughty and ignore SIGTERM to simulate hanging child
signal.signal(signal.SIGTERM, signal.SIG_IGN)
# Start a server that listens for incoming connections
try:
print_ok("child starting up on port %s" % sys.argv[1])
s = TcpServer(int(sys.argv[... | #!/usr/bin/env python3
from common import *
import sys, signal
# Be naughty and ignore SIGTERM to simulate hanging child
signal.signal(signal.SIGTERM, signal.SIG_IGN)
# Start a server that listens for incoming connections
try:
print_ok("child starting up on port %s" % sys.argv[1])
s = TcpServer(int(sys.argv[1]))... | <commit_before>#!/usr/bin/env python3
from common import *
import sys, signal
# Be naughty and ignore SIGTERM to simulate hanging child
signal.signal(signal.SIGTERM, signal.SIG_IGN)
# Start a server that listens for incoming connections
try:
print_ok("child starting up on port %s" % sys.argv[1])
s = TcpServe... | #!/usr/bin/env python3
from common import *
import sys, signal
# Be naughty and ignore SIGTERM to simulate hanging child
signal.signal(signal.SIGTERM, signal.SIG_IGN)
# Start a server that listens for incoming connections
try:
print_ok("child starting up on port %s" % sys.argv[1])
s = TcpServer(int(sys.argv[1]))... | #!/usr/bin/env python3
from common import *
import sys, signal
# Be naughty and ignore SIGTERM to simulate hanging child
signal.signal(signal.SIGTERM, signal.SIG_IGN)
# Start a server that listens for incoming connections
try:
print_ok("child starting up on port %s" % sys.argv[1])
s = TcpServer(int(sys.argv[... | <commit_before>#!/usr/bin/env python3
from common import *
import sys, signal
# Be naughty and ignore SIGTERM to simulate hanging child
signal.signal(signal.SIGTERM, signal.SIG_IGN)
# Start a server that listens for incoming connections
try:
print_ok("child starting up on port %s" % sys.argv[1])
s = TcpServe... |
9d1d99f8178252e91ae2ea62a20f6f4a104946fd | entities/base.py | entities/base.py | from kivy.uix.widget import Widget
from kivy.core.window import Window
from kivy.graphics import Ellipse
from engine.entity import Entity
class BaseEntity(Widget, Entity):
def __init__(self, imageStr, **kwargs):
Widget.__init__(self, **kwargs)
Entity.__init__(self)
with self.canvas:
... | from kivy.uix.widget import Widget
from kivy.core.window import Window
from kivy.graphics import Ellipse
from engine.entity import Entity
class BaseEntity(Widget, Entity):
def __init__(self, imageStr, **kwargs):
self.active = False
Widget.__init__(self, **kwargs)
Entity.__init__(self)
... | Add active flag to entities | Add active flag to entities
| Python | mit | nephilahacks/spider-eats-the-kiwi | from kivy.uix.widget import Widget
from kivy.core.window import Window
from kivy.graphics import Ellipse
from engine.entity import Entity
class BaseEntity(Widget, Entity):
def __init__(self, imageStr, **kwargs):
Widget.__init__(self, **kwargs)
Entity.__init__(self)
with self.canvas:
... | from kivy.uix.widget import Widget
from kivy.core.window import Window
from kivy.graphics import Ellipse
from engine.entity import Entity
class BaseEntity(Widget, Entity):
def __init__(self, imageStr, **kwargs):
self.active = False
Widget.__init__(self, **kwargs)
Entity.__init__(self)
... | <commit_before>from kivy.uix.widget import Widget
from kivy.core.window import Window
from kivy.graphics import Ellipse
from engine.entity import Entity
class BaseEntity(Widget, Entity):
def __init__(self, imageStr, **kwargs):
Widget.__init__(self, **kwargs)
Entity.__init__(self)
with self.... | from kivy.uix.widget import Widget
from kivy.core.window import Window
from kivy.graphics import Ellipse
from engine.entity import Entity
class BaseEntity(Widget, Entity):
def __init__(self, imageStr, **kwargs):
self.active = False
Widget.__init__(self, **kwargs)
Entity.__init__(self)
... | from kivy.uix.widget import Widget
from kivy.core.window import Window
from kivy.graphics import Ellipse
from engine.entity import Entity
class BaseEntity(Widget, Entity):
def __init__(self, imageStr, **kwargs):
Widget.__init__(self, **kwargs)
Entity.__init__(self)
with self.canvas:
... | <commit_before>from kivy.uix.widget import Widget
from kivy.core.window import Window
from kivy.graphics import Ellipse
from engine.entity import Entity
class BaseEntity(Widget, Entity):
def __init__(self, imageStr, **kwargs):
Widget.__init__(self, **kwargs)
Entity.__init__(self)
with self.... |
404dab76db0938aa951d13eee71d2c8fbb773f54 | ibmcnx/doc/DataSources.py | ibmcnx/doc/DataSources.py | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | Create script to save documentation to a file | 4: Create script to save documentation to a file
Task-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/4 | Python | apache-2.0 | stoeps13/ibmcnx2,stoeps13/ibmcnx2 | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | <commit_before>######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Co... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | <commit_before>######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: [email protected]
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Co... |
a61033c46a1b53346eb23d8edc9b04ed79c65b33 | poradnia/cases/migrations/0021_initial_permission_group.py | poradnia/cases/migrations/0021_initial_permission_group.py |
from django.db import migrations
PERM_INITIAL = {'wsparcie': ('can_add_record',
'can_change_own_record',
'can_view',
'can_view_all'
),
'obserwator': (
'can_vie... |
from django.db import migrations
PERM_INITIAL = {'wsparcie': ('can_add_record',
'can_change_own_record',
'can_view',
'can_view_all'
),
'obserwator': (
'can_vie... | Fix direct assignment to the forward side of a many-to-many | Fix direct assignment to the forward side of a many-to-many
| Python | mit | rwakulszowa/poradnia,watchdogpolska/poradnia,rwakulszowa/poradnia,rwakulszowa/poradnia,watchdogpolska/poradnia.siecobywatelska.pl,rwakulszowa/poradnia,watchdogpolska/poradnia,watchdogpolska/poradnia.siecobywatelska.pl,watchdogpolska/poradnia.siecobywatelska.pl,watchdogpolska/poradnia,watchdogpolska/poradnia |
from django.db import migrations
PERM_INITIAL = {'wsparcie': ('can_add_record',
'can_change_own_record',
'can_view',
'can_view_all'
),
'obserwator': (
'can_vie... |
from django.db import migrations
PERM_INITIAL = {'wsparcie': ('can_add_record',
'can_change_own_record',
'can_view',
'can_view_all'
),
'obserwator': (
'can_vie... | <commit_before>
from django.db import migrations
PERM_INITIAL = {'wsparcie': ('can_add_record',
'can_change_own_record',
'can_view',
'can_view_all'
),
'obserwator': (
... |
from django.db import migrations
PERM_INITIAL = {'wsparcie': ('can_add_record',
'can_change_own_record',
'can_view',
'can_view_all'
),
'obserwator': (
'can_vie... |
from django.db import migrations
PERM_INITIAL = {'wsparcie': ('can_add_record',
'can_change_own_record',
'can_view',
'can_view_all'
),
'obserwator': (
'can_vie... | <commit_before>
from django.db import migrations
PERM_INITIAL = {'wsparcie': ('can_add_record',
'can_change_own_record',
'can_view',
'can_view_all'
),
'obserwator': (
... |
e9d8773bae818f1f85fbc81369fbda5797b43249 | install/install_system.py | install/install_system.py | #!/usr/bin/env python
import subprocess
def main():
# Install system dependencies
subprocess.call(["apt-get", "update"])
subprocess.call(["apt-get", "-y", "upgrade"])
subprocess.call(["apt-get", "-y", "--force-yes", "install", "upstart"])
subprocess.call(["apt-get", "-y", "install", "python-dev"]... | #!/usr/bin/env python
import subprocess
def main():
# Install system dependencies
subprocess.call(["apt-get", "update"])
subprocess.call(["apt-get", "-y", "upgrade"])
subprocess.call(["apt-get", "-y", "--force-yes", "install", "upstart"])
subprocess.call(["apt-get", "-y", "install", "python-dev"]... | Fix path to gpio upstart script | Fix path to gpio upstart script
| Python | mit | projectweekend/Pi-GPIO-Server,thijstriemstra/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server,thijstriemstra/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server,thijstriemstra/Pi-GPIO-Server,thijstriemstra/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server | #!/usr/bin/env python
import subprocess
def main():
# Install system dependencies
subprocess.call(["apt-get", "update"])
subprocess.call(["apt-get", "-y", "upgrade"])
subprocess.call(["apt-get", "-y", "--force-yes", "install", "upstart"])
subprocess.call(["apt-get", "-y", "install", "python-dev"]... | #!/usr/bin/env python
import subprocess
def main():
# Install system dependencies
subprocess.call(["apt-get", "update"])
subprocess.call(["apt-get", "-y", "upgrade"])
subprocess.call(["apt-get", "-y", "--force-yes", "install", "upstart"])
subprocess.call(["apt-get", "-y", "install", "python-dev"]... | <commit_before>#!/usr/bin/env python
import subprocess
def main():
# Install system dependencies
subprocess.call(["apt-get", "update"])
subprocess.call(["apt-get", "-y", "upgrade"])
subprocess.call(["apt-get", "-y", "--force-yes", "install", "upstart"])
subprocess.call(["apt-get", "-y", "install"... | #!/usr/bin/env python
import subprocess
def main():
# Install system dependencies
subprocess.call(["apt-get", "update"])
subprocess.call(["apt-get", "-y", "upgrade"])
subprocess.call(["apt-get", "-y", "--force-yes", "install", "upstart"])
subprocess.call(["apt-get", "-y", "install", "python-dev"]... | #!/usr/bin/env python
import subprocess
def main():
# Install system dependencies
subprocess.call(["apt-get", "update"])
subprocess.call(["apt-get", "-y", "upgrade"])
subprocess.call(["apt-get", "-y", "--force-yes", "install", "upstart"])
subprocess.call(["apt-get", "-y", "install", "python-dev"]... | <commit_before>#!/usr/bin/env python
import subprocess
def main():
# Install system dependencies
subprocess.call(["apt-get", "update"])
subprocess.call(["apt-get", "-y", "upgrade"])
subprocess.call(["apt-get", "-y", "--force-yes", "install", "upstart"])
subprocess.call(["apt-get", "-y", "install"... |
2cb8a5c386e2cdd69d64af8bc2e0e6b2e9770250 | tmaps/extensions/auth.py | tmaps/extensions/auth.py | import datetime
from flask import current_app
from passlib.hash import sha256_crypt
from flask_jwt import JWT
from tmaps.models import User
jwt = JWT()
# TODO: Use HTTPS for connections to /auth
@jwt.authentication_handler
def authenticate(username, password):
"""Check if there is a user with this username-pw... | import datetime
from flask import current_app, request
from passlib.hash import sha256_crypt
from flask_jwt import JWT
from tmaps.models import User
jwt = JWT()
# TODO: Use HTTPS for connections to /auth
@jwt.authentication_handler
def authenticate(username, password):
"""Check if there is a user with this us... | Fix bug in JWT error handling | Fix bug in JWT error handling
| Python | agpl-3.0 | TissueMAPS/TmServer | import datetime
from flask import current_app
from passlib.hash import sha256_crypt
from flask_jwt import JWT
from tmaps.models import User
jwt = JWT()
# TODO: Use HTTPS for connections to /auth
@jwt.authentication_handler
def authenticate(username, password):
"""Check if there is a user with this username-pw... | import datetime
from flask import current_app, request
from passlib.hash import sha256_crypt
from flask_jwt import JWT
from tmaps.models import User
jwt = JWT()
# TODO: Use HTTPS for connections to /auth
@jwt.authentication_handler
def authenticate(username, password):
"""Check if there is a user with this us... | <commit_before>import datetime
from flask import current_app
from passlib.hash import sha256_crypt
from flask_jwt import JWT
from tmaps.models import User
jwt = JWT()
# TODO: Use HTTPS for connections to /auth
@jwt.authentication_handler
def authenticate(username, password):
"""Check if there is a user with t... | import datetime
from flask import current_app, request
from passlib.hash import sha256_crypt
from flask_jwt import JWT
from tmaps.models import User
jwt = JWT()
# TODO: Use HTTPS for connections to /auth
@jwt.authentication_handler
def authenticate(username, password):
"""Check if there is a user with this us... | import datetime
from flask import current_app
from passlib.hash import sha256_crypt
from flask_jwt import JWT
from tmaps.models import User
jwt = JWT()
# TODO: Use HTTPS for connections to /auth
@jwt.authentication_handler
def authenticate(username, password):
"""Check if there is a user with this username-pw... | <commit_before>import datetime
from flask import current_app
from passlib.hash import sha256_crypt
from flask_jwt import JWT
from tmaps.models import User
jwt = JWT()
# TODO: Use HTTPS for connections to /auth
@jwt.authentication_handler
def authenticate(username, password):
"""Check if there is a user with t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.