commit stringlengths 40 40 | old_file stringlengths 4 150 | new_file stringlengths 4 150 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 501 | message stringlengths 15 4.06k | lang stringclasses 4
values | license stringclasses 13
values | repos stringlengths 5 91.5k | diff stringlengths 0 4.35k |
|---|---|---|---|---|---|---|---|---|---|---|
5834127e59b1da93bd814575cd7cbba391e253c8 | run_borealis.py | run_borealis.py | from borealis import BotBorealis
try:
print("Welcome to BOREALIS.")
print("Initializing BOREALIS and its subcomponents.")
bot = BotBorealis("config.yml")
print("Initialization completed. Readying subcomponents.")
bot.setup()
print("Subcomponents ready. All systems functional.")
print("Starting BORE... | from borealis import BotBorealis
import time
while True:
bot = None
try:
print("Welcome to BOREALIS.")
print("Initializing BOREALIS and its subcomponents.")
bot = BotBorealis("config.yml")
print("Initialization completed. Readying subcomponents.")
bot.setup()
print("Subcomponents ready. ... | Implement recovery Bot will now automatically restart after an exception is caught. | Implement recovery
Bot will now automatically restart after an exception is caught.
| Python | agpl-3.0 | Aurorastation/BOREALISbot2 | ---
+++
@@ -1,20 +1,32 @@
from borealis import BotBorealis
+import time
-try:
- print("Welcome to BOREALIS.")
- print("Initializing BOREALIS and its subcomponents.")
- bot = BotBorealis("config.yml")
+while True:
+ bot = None
- print("Initialization completed. Readying subcomponents.")
- bot.setup()
+ try:
+ pr... |
fb54f741783ddefd0f452216b96808dea52c055e | sai/__init__.py | sai/__init__.py | import os
import logging
from flask import Flask, abort, g
from config import config
from api_v1 import bp as api_v1_bp
from ui import bp as ui_bp
app = Flask(__name__)
app.config.from_object(config)
app.register_blueprint(api_v1_bp, url_prefix='/api/v1')
app.register_blueprint(ui_bp, url_path='/')
@app.before_re... | import os
import logging
from flask import Flask, abort, g
from config import config
from api_v1 import bp as api_v1_bp
from ui import bp as ui_bp
app = Flask(__name__)
app.config.from_object(config)
app.register_blueprint(api_v1_bp, url_prefix='/api/v1')
app.register_blueprint(ui_bp, url_path='/')
@app.before_fi... | Remove remaining reference to mongo | Remove remaining reference to mongo
| Python | apache-2.0 | sivel/sai | ---
+++
@@ -12,11 +12,6 @@
app.register_blueprint(api_v1_bp, url_prefix='/api/v1')
app.register_blueprint(ui_bp, url_path='/')
-
-
-@app.before_request
-def globalize():
- g.mongo, g.db = mongo, db
@app.before_first_request |
64d109e975eb42bc06bb6b5e1deb26536e6f1def | tests/test_KociembaSolver.py | tests/test_KociembaSolver.py | from src.Move import Move
from src.NaiveCube import NaiveCube
from src.Cubie imort Cube
from src.Solver import Kociemba
import timeout_decorator
import unittest
class TestKociembaSolver(unittest.TestCase):
@timeout_decorator.timeout(300)
def _test_solution(self, c):
solver = Kociemba.KociembaSolver(c)... | from src.Move import Move
from src.NaiveCube import NaiveCube
from src.Cubie imort Cube
from src.Solver import Kociemba
import timeout_decorator
import unittest
class TestKociembaSolver(unittest.TestCase):
@timeout_decorator.timeout(300)
def _test_solution(self, c):
solver = Kociemba.KociembaSolver(c)... | Reduce the number of test for Kociemba Solver | Reduce the number of test for Kociemba Solver
| Python | mit | Wiston999/python-rubik | ---
+++
@@ -13,7 +13,7 @@
return solver.solution()
def test_solution(self):
- for i in range(100):
+ for i in range(20):
c = Cube()
cr = Cube()
c.shuffle(i) |
50f3233a8560120cc0c55b02849f1b586cf1aa27 | languages_plus/utils.py | languages_plus/utils.py | from django.core.exceptions import ObjectDoesNotExist
from countries_plus.models import Country
from .models import Language, CultureCode
def associate_countries_and_languages():
for country in Country.objects.all():
langs = country.languages.strip(',')
if langs:
codes = langs.split("... | from django.core.exceptions import ObjectDoesNotExist
from countries_plus.models import Country
from .models import Language, CultureCode
def associate_countries_and_languages():
for country in Country.objects.all():
langs = ''
try:
langs = country.languages.strip(',')
if lang... | Fix a crash if a country has no languages spoken | Fix a crash if a country has no languages spoken
| Python | mit | cordery/django-languages-plus | ---
+++
@@ -6,7 +6,9 @@
def associate_countries_and_languages():
for country in Country.objects.all():
- langs = country.languages.strip(',')
+ langs = ''
+ try:
+ langs = country.languages.strip(',')
if langs:
codes = langs.split(",")
for cod... |
780a330e1f185d7c19953edb5bc1767582501197 | tests/test_card.py | tests/test_card.py | """
Created on Dec 04, 2016
@author: john papa
Copyright 2016 John Papa. All rights reserved.
This work is licensed under the MIT License.
"""
import unittest
from cards.card import Card
class Test_Card(unittest.TestCase):
def setUp(self):
self._suit = "clubs"
self._rank = "10"
self._c... | """
Created on Dec 04, 2016
@author: john papa
Copyright 2016 John Papa. All rights reserved.
This work is licensed under the MIT License.
"""
import unittest
from cards.card import Card
class Test_Card(unittest.TestCase):
def setUp(self):
self._suit = "clubs"
self._rank = "10"
self._c... | Change ConcreteCard test class params. | Change ConcreteCard test class params.
| Python | mit | johnpapa2/twenty-one,johnpapa2/twenty-one | ---
+++
@@ -37,8 +37,8 @@
class ConcreteCard(Card):
- def __init__(self, *args, **kwargs):
- super().__init__(*args, **kwargs)
+ def __init__(self, suit, rank):
+ super().__init__(suit, rank)
@property
def value(self): |
e264224ee69cb37a02f28a6c78a231dd6d41db58 | examples/web_rewrite_headers_middleware.py | examples/web_rewrite_headers_middleware.py | #!/usr/bin/env python3
"""
Example for rewriting response headers by middleware.
"""
import asyncio
from aiohttp.web import Application, Response
@asyncio.coroutine
def handler(request):
return Response(text="Everything is fine")
@asyncio.coroutine
def middleware_factory(app, next_handler):
@asyncio.corou... | #!/usr/bin/env python3
"""
Example for rewriting response headers by middleware.
"""
import asyncio
from aiohttp.web import Application, Response, HTTPException
@asyncio.coroutine
def handler(request):
return Response(text="Everything is fine")
@asyncio.coroutine
def middleware_factory(app, next_handler):
... | Fix example for rewriting response headers in middleware to set headers for exceptions like 404 Not Found | Fix example for rewriting response headers in middleware to set headers for exceptions like 404 Not Found
| Python | apache-2.0 | alex-eri/aiohttp-1,jettify/aiohttp,hellysmile/aiohttp,z2v/aiohttp,juliatem/aiohttp,rutsky/aiohttp,AlexLisovoy/aiohttp,KeepSafe/aiohttp,mind1master/aiohttp,rutsky/aiohttp,Eyepea/aiohttp,jojurajan/aiohttp,mind1master/aiohttp,jashandeep-sohi/aiohttp,mind1master/aiohttp,alexsdutton/aiohttp,elastic-coders/aiohttp,pathcl/aio... | ---
+++
@@ -4,7 +4,7 @@
"""
import asyncio
-from aiohttp.web import Application, Response
+from aiohttp.web import Application, Response, HTTPException
@asyncio.coroutine
@@ -17,7 +17,10 @@
@asyncio.coroutine
def middleware(request):
- response = yield from next_handler(request)
+ t... |
b75a9eab312a2ac787e4b0e44115f8bad4508418 | route/__init__.py | route/__init__.py | class Route(object):
def __init__(self, ip, domain):
self.ip = ip
self.domain = domain
def __str__(self):
return self.domain
def query(self):
""" search domain routing info """
pass
def register(self):
""" register domain nginx reverse proxy """
... | from route.db import db_session
from route.models import Domain
import os
import subprocess
class Route(object):
def __init__(self, ip, domain):
self.ip = ip
self.domain = domain
def __str__(self):
return self.domain
def search(self, option, value):
""" search domain rou... | Add register, restart, write to handle nginx | Add register, restart, write to handle nginx
| Python | apache-2.0 | bunseokbot/proxy_register,bunseokbot/proxy_register | ---
+++
@@ -1,3 +1,10 @@
+from route.db import db_session
+from route.models import Domain
+
+import os
+import subprocess
+
+
class Route(object):
def __init__(self, ip, domain):
self.ip = ip
@@ -6,13 +13,57 @@
def __str__(self):
return self.domain
- def query(self):
+ def search... |
90cd7a194ce1294d6b14b819b10ca62e3d058cb9 | auslib/test/web/test_dockerflow.py | auslib/test/web/test_dockerflow.py | import mock
from auslib.test.web.test_client import ClientTestBase
class TestDockerflowEndpoints(ClientTestBase):
def testVersion(self):
ret = self.client.get("/__version__")
self.assertEquals(ret.data, """
{
"source":"https://github.com/mozilla/balrog",
"version":"1.0",
"commit":"abcdef12... | import mock
from auslib.test.web.test_client import ClientTestBase
class TestDockerflowEndpoints(ClientTestBase):
def testVersion(self):
ret = self.client.get("/__version__")
self.assertEquals(ret.data, """
{
"source":"https://github.com/mozilla/balrog",
"version":"1.0",
"commit":"abcdef12... | Add test to make sure public facing app raises exception when it hits an error. | Add test to make sure public facing app raises exception when it hits an error.
| Python | mpl-2.0 | aksareen/balrog,nurav/balrog,nurav/balrog,mozbhearsum/balrog,tieu/balrog,mozbhearsum/balrog,aksareen/balrog,testbhearsum/balrog,testbhearsum/balrog,nurav/balrog,aksareen/balrog,tieu/balrog,nurav/balrog,tieu/balrog,mozbhearsum/balrog,tieu/balrog,testbhearsum/balrog,mozbhearsum/balrog,aksareen/balrog,testbhearsum/balrog | ---
+++
@@ -21,6 +21,14 @@
self.assertEqual(ret.status_code, 200)
self.assertEqual(cr.call_count, 1)
+ def testHeartbeatWithException(self):
+ with mock.patch("auslib.global_state.dbo.rules.countRules") as cr:
+ cr.side_effect = Exception("kabom!")
+ # Becau... |
9b255d781e3b0aefa708e1366810d14700384d10 | satyr/__init__.py | satyr/__init__.py | from __future__ import absolute_import, division, print_function
import logging
import pkg_resources as _pkg_resources
from .scheduler import QueueScheduler
from .executor import OneOffExecutor
from .messages import PythonTask, PythonTaskStatus # important to register classes
logging.basicConfig(level=logging.DEBU... | from __future__ import absolute_import, division, print_function
import logging
import pkg_resources as _pkg_resources
from .scheduler import QueueScheduler
from .executor import OneOffExecutor
from .messages import PythonTask, PythonTaskStatus # important to register classes
logging.basicConfig(level=logging.INFO... | Set default logging level to INFO | Set default logging level to INFO
| Python | apache-2.0 | lensacom/satyr | ---
+++
@@ -8,7 +8,7 @@
from .messages import PythonTask, PythonTaskStatus # important to register classes
-logging.basicConfig(level=logging.DEBUG,
+logging.basicConfig(level=logging.INFO,
format='%(relativeCreated)6d %(threadName)s %(message)s')
__version__ = _pkg_resources.get_distrib... |
bcef6c233fd607d160bc9042c7957abcea1e43cd | ycml/transformers/base.py | ycml/transformers/base.py | import logging
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from ..utils import Timer
__all__ = ['PureTransformer', 'identity']
logger = logging.getLogger(__name__)
# Helper class. A transformer that only does transformation and does not need to fit any internal parameters.
class ... | import logging
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from ..utils import Timer
__all__ = ['PureTransformer', 'identity']
logger = logging.getLogger(__name__)
# Helper class. A transformer that only does transformation and does not need to fit any internal parameters.
class ... | Reshape transformers to 2D matrix | Reshape transformers to 2D matrix
| Python | apache-2.0 | skylander86/ycml | ---
+++
@@ -25,7 +25,11 @@
def transform(self, X, **kwargs):
timer = Timer()
transformed = self._transform(X, **kwargs)
- if self.nparray: transformed = np.array(transformed)
+ if self.nparray:
+ transformed = np.array(transformed)
+ if transformed.ndim == 1:... |
c7daef487fee51b68d410d2f4be3fd16068c7d5a | tests/export/test_task_types_to_csv.py | tests/export/test_task_types_to_csv.py | from tests.base import ApiDBTestCase
class TasksCsvExportTestCase(ApiDBTestCase):
def setUp(self):
super(TasksCsvExportTestCase, self).setUp()
self.generate_fixture_project_status()
self.generate_fixture_project()
self.generate_fixture_asset_type()
self.generate_fixture_d... | from tests.base import ApiDBTestCase
class TasksCsvExportTestCase(ApiDBTestCase):
def setUp(self):
super(TasksCsvExportTestCase, self).setUp()
self.generate_fixture_project_status()
self.generate_fixture_project()
self.generate_fixture_asset_type()
self.generate_fixture_d... | Fix task type export test | Fix task type export test
| Python | agpl-3.0 | cgwire/zou | ---
+++
@@ -16,6 +16,7 @@
csv_task_types = self.get_raw("export/csv/task-types.csv")
expected_result = """Department;Name\r
Animation;Animation\r
+Animation;Layout\r
Modeling;Shaders\r
"""
self.assertEqual(csv_task_types, expected_result) |
b77d4a534f5f6435f0f60c0a082b9ae02673d574 | tests/twisted/connect/network-error.py | tests/twisted/connect/network-error.py |
"""
Connection is disconnected because server closes its TCP stream abruptly.
"""
from gabbletest import exec_test
from servicetest import EventPattern
import constants as cs
import sys
def test(q, bus, conn, stream):
conn.Connect()
q.expect('dbus-signal', signal='StatusChanged',
args=[cs.CONN_S... |
"""
Connection is disconnected because server closes its TCP stream abruptly.
"""
from gabbletest import exec_test
from servicetest import EventPattern
import constants as cs
import sys
def test(q, bus, conn, stream):
conn.Connect()
q.expect('dbus-signal', signal='StatusChanged',
args=[cs.CONN_S... | Make sure state change signal to 'disconnected' is also sent. | Make sure state change signal to 'disconnected' is also sent.
| Python | lgpl-2.1 | Ziemin/telepathy-gabble,jku/telepathy-gabble,mlundblad/telepathy-gabble,Ziemin/telepathy-gabble,jku/telepathy-gabble,Ziemin/telepathy-gabble,Ziemin/telepathy-gabble,jku/telepathy-gabble,mlundblad/telepathy-gabble,mlundblad/telepathy-gabble | ---
+++
@@ -22,6 +22,9 @@
stream.transport.loseConnection()
# Gabble disconnect and close its connection
+ q.expect('dbus-signal', signal='StatusChanged',
+ args=[cs.CONN_STATUS_DISCONNECTED, cs.CSR_NONE_SPECIFIED])
+
q.expect('dbus-signal',
signal='NameOwnerChanged',
... |
d1614d3747f72c1f32e74afb6e4b98eb476c7266 | utils/layers_test.py | utils/layers_test.py | # Lint as: python3
"""Tests for spectral."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import os
import layers
class LayersTest(tf.test.TestCase):
def test_conv_transpose_shape(self):
inputs =... | # Lint as: python3
"""Tests for spectral."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import os
import layers
class LayersTest(tf.test.TestCase):
def test_conv_transpose_shape(self):
inputs =... | Add Second Shape Test for Layers Util | Add Second Shape Test for Layers Util
| Python | apache-2.0 | googleinterns/audio_synthesis | ---
+++
@@ -22,6 +22,15 @@
outputs = conv_transpose(inputs)
self.assertShapeEqual(inputs, outputs)
+
+ def test_conv_transpose_shape_upscale(self):
+ inputs = np.random.normal(size=(10, 5, 2)).astype(np.float32)
+ conv_transpose = layers.Conv1DTranspose(
+ ... |
2450955e2beb14e4c6ba0394e4bcd64e2ce2e4ec | wordcloud/views.py | wordcloud/views.py | import json
import os
from django.conf import settings
from django.http import HttpResponse
from django.views.decorators.cache import cache_page
from .wordcloud import popular_words
@cache_page(60*60*4)
def wordcloud(request, max_entries=30):
""" Return tag cloud JSON results"""
max_entries = int(max_entri... | import json
import os
from django.conf import settings
from django.http import HttpResponse
from django.views.decorators.cache import cache_page
from .wordcloud import popular_words
@cache_page(60*60*4)
def wordcloud(request, max_entries=30):
""" Return tag cloud JSON results"""
max_entries = int(max_entri... | Add diagnostic output for when X-SendFile is misconfigured | Add diagnostic output for when X-SendFile is misconfigured
| Python | agpl-3.0 | mysociety/pombola,geoffkilpin/pombola,mysociety/pombola,geoffkilpin/pombola,geoffkilpin/pombola,geoffkilpin/pombola,mysociety/pombola,geoffkilpin/pombola,mysociety/pombola,mysociety/pombola,geoffkilpin/pombola,mysociety/pombola | ---
+++
@@ -18,7 +18,13 @@
settings.MEDIA_ROOT, 'wordcloud_cache', leaf_name
)
if os.path.exists(cache_path):
- response = HttpResponse()
+ response = HttpResponse(json.dumps({
+ 'error':
+ ("If you can see this, then X-SendFile isn't configured "
+ "... |
4955e830d3130a6ae86d4a1c37db23777ee792d7 | go_http/__init__.py | go_http/__init__.py | """Vumi Go HTTP API client library."""
from .send import HttpApiSender, LoggingSender
__version__ = "0.3.1a0"
__all__ = [
'HttpApiSender', 'LoggingSender',
]
| """Vumi Go HTTP API client library."""
from .send import HttpApiSender, LoggingSender
from .account import AccountApiClient
__version__ = "0.3.1a0"
__all__ = [
'HttpApiSender', 'LoggingSender',
'AccountApiClient',
]
| Add AccountApiClient to top-level package. | Add AccountApiClient to top-level package.
| Python | bsd-3-clause | praekelt/go-http-api,praekelt/go-http-api | ---
+++
@@ -1,9 +1,11 @@
"""Vumi Go HTTP API client library."""
from .send import HttpApiSender, LoggingSender
+from .account import AccountApiClient
__version__ = "0.3.1a0"
__all__ = [
'HttpApiSender', 'LoggingSender',
+ 'AccountApiClient',
] |
e37e964bf9d2819c0234303d31ed2839c317be04 | openquake/engine/tests/export/core_test.py | openquake/engine/tests/export/core_test.py |
# Copyright (c) 2010-2014, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenQuake is distr... |
# Copyright (c) 2010-2014, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenQuake is distr... | Fix a broken export test | Fix a broken export test
| Python | agpl-3.0 | gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine | ---
+++
@@ -26,7 +26,7 @@
return the number of occurrences of the element in a given XML document.
"""
expr = '//%s' % elem_name
- return len(tree.xpath(expr, namespaces=nrml.PARSE_NS_MAP))
+ return len(tree.xpath(expr, namespaces={'nrml': nrml.NRML05}))
class BaseExportTestCase(unittest.Tes... |
546a4681aa54ba183e956d220e98ef67ae6de691 | user/decorators.py | user/decorators.py | from django.conf import settings
from django.contrib.auth import get_user
from django.shortcuts import redirect
def custom_login_required(view):
# view argument must be a function
def new_view(request, *args, **kwargs):
user = get_user(request)
if user.is_authenticated():
return v... | from functools import wraps
from django.conf import settings
from django.contrib.auth import get_user
from django.shortcuts import redirect
from django.utils.decorators import \
available_attrs
def custom_login_required(view):
# view argument must be a function
@wraps(view, assigned=available_attrs(view... | Use functools.wraps to copy view signature. | Ch20: Use functools.wraps to copy view signature.
| Python | bsd-2-clause | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | ---
+++
@@ -1,11 +1,16 @@
+from functools import wraps
+
from django.conf import settings
from django.contrib.auth import get_user
from django.shortcuts import redirect
+from django.utils.decorators import \
+ available_attrs
def custom_login_required(view):
# view argument must be a function
+ @... |
7fc3867e7b8a01854116b43d9961e1063c051006 | mmmpaste/helpers.py | mmmpaste/helpers.py | from flask import request
def get_ip():
if not request.headers.get("X-Forwarded-For"):
return request.remote_addr
return request.headers.get("X-Forwarded-For")
| from flask import request
def get_ip():
if not request.headers.get("X-Forwarded-For"):
return request.remote_addr
return request.headers.get("X-Forwarded-For")[0]
| Select the first IP address from the X-Forwarded-For list. | Select the first IP address from the X-Forwarded-For list.
| Python | bsd-2-clause | ryanc/mmmpaste,ryanc/mmmpaste | ---
+++
@@ -4,4 +4,4 @@
if not request.headers.get("X-Forwarded-For"):
return request.remote_addr
- return request.headers.get("X-Forwarded-For")
+ return request.headers.get("X-Forwarded-For")[0] |
a778a41c8deb6fd9812e405143e34679122c18db | website/addons/base/utils.py | website/addons/base/utils.py | from os.path import basename
from website import settings
def serialize_addon_config(config, user):
lookup = config.template_lookup
return {
'addon_short_name': config.short_name,
'addon_full_name': config.full_name,
'node_settings_template': lookup.get_template(basename(config.node_s... | from os.path import basename
from website import settings
def serialize_addon_config(config, user):
lookup = config.template_lookup
user_addon = user.get_addon(config.short_name)
ret = {
'addon_short_name': config.short_name,
'addon_full_name': config.full_name,
'node_settings_tem... | Add user_settings to serialized addon settings | Add user_settings to serialized addon settings
| Python | apache-2.0 | ZobairAlijan/osf.io,leb2dg/osf.io,doublebits/osf.io,mluo613/osf.io,jolene-esposito/osf.io,alexschiller/osf.io,mattclark/osf.io,laurenrevere/osf.io,jolene-esposito/osf.io,SSJohns/osf.io,billyhunt/osf.io,pattisdr/osf.io,samanehsan/osf.io,DanielSBrown/osf.io,cslzchen/osf.io,caseyrygt/osf.io,zachjanicki/osf.io,Nesiehr/osf.... | ---
+++
@@ -5,27 +5,17 @@
def serialize_addon_config(config, user):
lookup = config.template_lookup
- return {
+ user_addon = user.get_addon(config.short_name)
+ ret = {
'addon_short_name': config.short_name,
'addon_full_name': config.full_name,
'node_settings_template': lo... |
13774b20f18d23dfb69c65dd151e3aed9734a88f | website/core/settings/loc.py | website/core/settings/loc.py | """Local settings and globals."""
import sys
from os.path import normpath, join
from .base import *
# Import secrets
sys.path.append(
abspath(join(PROJECT_ROOT, '../secrets/buzz/stg'))
)
from secrets import *
# Set static URL
STATIC_URL = '/static' | """Local settings and globals."""
import sys
from os.path import normpath, join
from .base import *
# Import secrets -- not needed
#sys.path.append(
# abspath(join(PROJECT_ROOT, '../secrets/TimelineJS/stg'))
#)
#from secrets import *
# Set static URL
STATIC_URL = '/static' | Comment out secrets import (not needed for this project) | Comment out secrets import (not needed for this project)
| Python | mpl-2.0 | stea4lth/TimelineJS,noikiy/TimelineJS,azeemmufti/TimelineJS,ryekee/TimelineJS,djaney/TimelineJS,1modm/TimelineJS,zstao/TimelineJS,wangjun/TimelineJS,1modm/TimelineJS,stea4lth/TimelineJS,matt-edgedesign/Timelinejs,LauraHilliger/TimelineJS,djaney/TimelineJS,ycaihua/TimelineJS,deenjohn/TimelineJS,ryekee/TimelineJS,deenjoh... | ---
+++
@@ -3,12 +3,12 @@
from os.path import normpath, join
from .base import *
-# Import secrets
-sys.path.append(
- abspath(join(PROJECT_ROOT, '../secrets/buzz/stg'))
-)
+# Import secrets -- not needed
+#sys.path.append(
+# abspath(join(PROJECT_ROOT, '../secrets/TimelineJS/stg'))
+#)
-from secrets impo... |
1cb7581f63d0d9d4e6eca69316930912c41a4fb5 | Instanssi/admin_upload/models.py | Instanssi/admin_upload/models.py | # -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
class UploadedFile(models.Model):
user = models.ForeignKey(User, verbose_name=u'Käyttäjä')
description = models.TextField(u'Kuvaus', help_text=u'Lyhyt kuvaus siitä, mihin/missä tie... | # -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
import os.path
class UploadedFile(models.Model):
user = models.ForeignKey(User, verbose_name=u'Käyttäjä')
description = models.TextField(u'Kuvaus', help_text=u'Lyhyt kuvaus siitä, ... | Add helper function for getting name from UploadedFile, add model to admin. | admin_upload: Add helper function for getting name from UploadedFile, add model to admin.
| Python | mit | Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org | ---
+++
@@ -3,14 +3,25 @@
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
+import os.path
class UploadedFile(models.Model):
user = models.ForeignKey(User, verbose_name=u'Käyttäjä')
description = models.TextField(u'Kuvaus', help_text=u'Lyhyt kuv... |
140ff37058eefe4ab79932d96cff4a90aa7b113e | contrib/tests/test_bind_provider.py | contrib/tests/test_bind_provider.py | import unittest
from mock import patch, Mock, MagicMock
import os
import sys
from bind.provider import Provider
class TestBindProvider(unittest.TestCase):
@patch('subprocess.check_output')
@patch('bind.provider.unit_get')
def test_first_setup(self, ugm, spcom):
spcom.return_value = '10.0.0.1'
... | import unittest
from mock import patch, Mock, MagicMock
import os
import sys
from bind.provider import Provider
class TestBindProvider(unittest.TestCase):
@patch('subprocess.check_output')
@patch('bind.provider.unit_get')
def test_first_setup(self, ugm, spcom):
ugm.return_value = '10.0.0.1'
... | Correct bind provider mock in tests | Correct bind provider mock in tests
| Python | mit | chuckbutler/DNS-Charm,chuckbutler/DNS-Charm | ---
+++
@@ -12,7 +12,7 @@
@patch('subprocess.check_output')
@patch('bind.provider.unit_get')
def test_first_setup(self, ugm, spcom):
- spcom.return_value = '10.0.0.1'
+ ugm.return_value = '10.0.0.1'
bp = Provider('example.com')
parser = MagicMock()
bp.first_setu... |
d213aa242b6293a67ba13859a81af4354d81f522 | h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7798_overlapped_knots.py | h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7798_overlapped_knots.py | import h2o
import numpy as np
from h2o.estimators.gam import H2OGeneralizedAdditiveEstimator
from tests import pyunit_utils
def knots_error():
# load and prepare California housing dataset
np.random.seed(1234)
data = h2o.H2OFrame(
python_obj={'C1': list(np.random.randint(0, 9, size=1000)),
... | import h2o
import numpy as np
from h2o.estimators.gam import H2OGeneralizedAdditiveEstimator
from tests import pyunit_utils
def knots_error():
# load and prepare California housing dataset
np.random.seed(1234)
data = h2o.H2OFrame(
python_obj={'C1': list(np.random.randint(0, 9, size=1000)),
... | Add assert to num knots validation unit test | Add assert to num knots validation unit test
| Python | apache-2.0 | h2oai/h2o-3,h2oai/h2o-3,michalkurka/h2o-3,michalkurka/h2o-3,h2oai/h2o-3,michalkurka/h2o-3,michalkurka/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,michalkurka/h2o-3,h2oai/h2o-3,michalkurka/h2o-3,michalkurka/h2o-3,h2oai/h2o-3 | ---
+++
@@ -23,6 +23,7 @@
)
try:
h2o_model.train(x=feature_names, y='target', training_frame=train)
+ assert False, "Number of knots validation should have failed"
except:
print("Error correctly raised when cardinality < num_knots")
... |
380baa34af7e8a704780f0ec535b626f4a286e23 | deflect/admin.py | deflect/admin.py | from django.contrib import admin
from .models import RedirectURL
class RedirectURLAdmin(admin.ModelAdmin):
list_display = ('url', 'short_url', 'hits', 'last_used', 'creator', 'campaign', 'medium',)
list_filter = ('creator__username', 'campaign', 'medium',)
ordering = ('-last_used',)
readonly_fields =... | from django.contrib import admin
from .models import RedirectURL
class RedirectURLAdmin(admin.ModelAdmin):
list_display = ('url', 'short_url', 'hits', 'last_used', 'creator', 'campaign', 'medium',)
list_filter = ('creator__username', 'campaign', 'medium',)
ordering = ('-last_used',)
readonly_fields =... | Fix model creator updating on change event | Fix model creator updating on change event
| Python | bsd-3-clause | jbittel/django-deflect | ---
+++
@@ -16,7 +16,8 @@
('Short URL Usage', {'fields': ('hits', 'created', 'last_used',)}),)
def save_model(self, request, obj, form, change):
- obj.user = request.user
+ if not change:
+ obj.creator = request.user
obj.save()
|
cc48ad87026b57b02530322b3c27f2d60e94f2e4 | packages/mono_crypto.py | packages/mono_crypto.py | from mono_master import MonoMasterPackage
from bockbuild.util.util import *
class MonoMasterEncryptedPackage (MonoMasterPackage):
def __init__(self):
MonoMasterPackage.__init__ (self)
self.configure_flags.extend(['--enable-extension-module=crypto --enable-native-types'])
def prep(self):
... | from mono_master import MonoMasterPackage
from bockbuild.util.util import *
class MonoMasterEncryptedPackage (MonoMasterPackage):
def __init__(self):
MonoMasterPackage.__init__ (self)
self.configure_flags.extend(['--enable-extension-module=crypto --enable-native-types'])
def prep(self):
... | Add a git reset to trigger a possible 'error: unable to read sha1 file...' error and cause a fresh checkout to resolve | Add a git reset to trigger a possible 'error: unable to read sha1 file...' error and cause a fresh checkout to resolve
| Python | mit | mono/bockbuild,mono/bockbuild | ---
+++
@@ -28,6 +28,7 @@
self.sh('%' + '{git} checkout origin/%s' % self.git_branch)
else:
self.sh('%{git} checkout origin/master')
+ self.sh ('%{git} reset --hard')
except Exception as e:
self.rm_if_exists (dirname)
raise |
1cda84c7f23c6a5e89c9f871dba5d12c00789d1a | extract_contamination.py | extract_contamination.py | import sys
import os
header = ['Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']
print '\t'.join(header)
for fi in sys.argv[1:]:
sample = os.path.basename(fi).split('.')[0]
with open(fi) as screen_results:
results = {}
for line in screen_results:
fields = line.strip().... | import sys
import os
header = ['Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']
print '\t'.join(header)
for fi in sys.argv[1:]:
sample = os.path.basename(fi).split('.')[0]
with open(fi) as screen_results:
results = {}
for line in screen_results:
fields = line.strip().... | Handle empty fastq_screen files properly. | Handle empty fastq_screen files properly.
| Python | apache-2.0 | pombo-lab/gamtools,pombo-lab/gamtools | ---
+++
@@ -16,16 +16,22 @@
results[fields[0] + '_single'] = int(fields[4])
results[fields[0] + '_multiple'] = int(fields[6])
results['no_reads'] = int(fields[1])
+
+ if not len(results):
+ data = ['0'] * 5
- try:
- data = [results['Mous... |
d9ab07c9c984d50ff93040d0220e4a3997e29f79 | fluent_comments/email.py | fluent_comments/email.py | from django.conf import settings
from django.core.mail import send_mail
from django.template.loader import render_to_string
try:
from django.contrib.sites.shortcuts import get_current_site # Django 1.9+
except ImportError:
from django.contrib.sites.models import get_current_site
def send_comment_posted(comm... | from django.conf import settings
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.utils.encoding import force_text
try:
from django.contrib.sites.shortcuts import get_current_site # Django 1.9+
except ImportError:
from django.contrib.sites.models import ge... | Use force_text() to get page title | Use force_text() to get page title
Some models might handle __unicode__/__str__ badly
| Python | apache-2.0 | edoburu/django-fluent-comments,django-fluent/django-fluent-comments,edoburu/django-fluent-comments,django-fluent/django-fluent-comments,django-fluent/django-fluent-comments,django-fluent/django-fluent-comments,edoburu/django-fluent-comments | ---
+++
@@ -1,6 +1,7 @@
from django.conf import settings
from django.core.mail import send_mail
from django.template.loader import render_to_string
+from django.utils.encoding import force_text
try:
from django.contrib.sites.shortcuts import get_current_site # Django 1.9+
@@ -19,7 +20,7 @@
recipient_... |
815c246f1ef185e24991efc4075b2358c7955c6c | onadata/libs/utils/storage.py | onadata/libs/utils/storage.py | # coding: utf-8
import os
import shutil
from django.core.files.storage import get_storage_class
def delete_user_storage(username):
storage = get_storage_class()()
def _recursive_delete(path):
directories, files = storage.listdir(path)
for file_ in files:
storage.delete(os.path.j... | # coding: utf-8
import os
import shutil
from django.core.files.storage import FileSystemStorage, get_storage_class
def delete_user_storage(username):
storage = get_storage_class()()
def _recursive_delete(path):
directories, files = storage.listdir(path)
for file_ in files:
stora... | Use `isinstance()` at the cost of an extra import | Use `isinstance()` at the cost of an extra import
| Python | bsd-2-clause | kobotoolbox/kobocat,kobotoolbox/kobocat,kobotoolbox/kobocat,kobotoolbox/kobocat | ---
+++
@@ -2,7 +2,7 @@
import os
import shutil
-from django.core.files.storage import get_storage_class
+from django.core.files.storage import FileSystemStorage, get_storage_class
def delete_user_storage(username):
@@ -16,7 +16,7 @@
for directory in directories:
_recursive_delete(os.pa... |
736388eaf2b408ec28c2948aa412411067f8346d | tests/helper.py | tests/helper.py | import logging
import shutil
import os
opsutils_logger = logging.getLogger('opsutils')
opsutils_logger.setLevel(logging.DEBUG)
opsutils_logger.addHandler(logging.StreamHandler())
PATH = os.path.join(os.path.realpath(os.path.dirname(__file__)), '.tmp')
class Workspace(object):
def __init__(self, name='default', ... | import logging
import shutil
import os
if os.environ.get('OPSUTILS_TEST_LOGGING'):
opsutils_logger = logging.getLogger('opsutils')
opsutils_logger.setLevel(logging.DEBUG)
opsutils_logger.addHandler(logging.StreamHandler())
PATH = os.path.join(os.path.realpath(os.path.dirname(__file__)), '.tmp')
class Wor... | Make test logging a configurable setting | Make test logging a configurable setting
| Python | mit | silas/ops | ---
+++
@@ -2,9 +2,10 @@
import shutil
import os
-opsutils_logger = logging.getLogger('opsutils')
-opsutils_logger.setLevel(logging.DEBUG)
-opsutils_logger.addHandler(logging.StreamHandler())
+if os.environ.get('OPSUTILS_TEST_LOGGING'):
+ opsutils_logger = logging.getLogger('opsutils')
+ opsutils_logger.set... |
b242de3217ad9cf6a98ca2513ed1e4f66d2537ad | tests/NongeneratingSymbolsRemove/SimpleTest.py | tests/NongeneratingSymbolsRemove/SimpleTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy-transforms
"""
from unittest import TestCase, main
from grammpy import *
from grammpy_transforms import ContextFree
class SimpleTest(TestCase):
pass
if __name__ == '__main__':
main()
| #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy-transforms
"""
from unittest import TestCase, main
from grammpy import *
from grammpy_transforms import ContextFree
class A(Nonterminal):
pass
class B(Nonterminal):
pass
class C(Nonterminal):
p... | Add simple test of removing nongenerating symbols | Add simple test of removing nongenerating symbols
| Python | mit | PatrikValkovic/grammpy | ---
+++
@@ -12,8 +12,37 @@
from grammpy_transforms import ContextFree
+class A(Nonterminal):
+ pass
+
+
+class B(Nonterminal):
+ pass
+
+
+class C(Nonterminal):
+ pass
+
+
+class RuleAto0B(Rule):
+ fromSymbol = A
+ right = [0, B]
+
+
+class RuleBto1(Rule):
+ fromSymbol = B
+ toSymbol = 1
+
+... |
dd8c4843b7872023e276247a4d8de052b42fa9a6 | token_stream.py | token_stream.py | # '2+3' -> {type:num, value: 2}, {type:op, value:'+'}, {type:num, value: 3}
class TokenStream:
def __init__(self, input_stream):
self.input_stream = input_stream
def is_whitespace(self, char):
return char in ' \t'
def is_digit(self, char):
return char.isdigit()
def is_operator... | # '2+3' -> {type:num, value: 2}, {type:op, value:'+'}, {type:num, value: 3}
operators = {
'+': {'prec': 10, 'assoc': 'left'},
'*': {'prec': 20, 'assoc': 'left'}
}
class TokenStream:
def __init__(self, input_stream):
self.input_stream = input_stream
def is_whitespace(self, char):
return... | Define precedence and associativity for operators | Define precedence and associativity for operators
| Python | mit | babu-thomas/calculator-parser | ---
+++
@@ -1,4 +1,9 @@
# '2+3' -> {type:num, value: 2}, {type:op, value:'+'}, {type:num, value: 3}
+operators = {
+ '+': {'prec': 10, 'assoc': 'left'},
+ '*': {'prec': 20, 'assoc': 'left'}
+}
+
class TokenStream:
def __init__(self, input_stream):
self.input_stream = input_stream
@@ -10,7 +15,7 ... |
b834f553501d4c9ba47bcad6497555aacc06249c | gavel/controllers/api.py | gavel/controllers/api.py | from gavel import app
from gavel.models import *
import gavel.utils as utils
from flask import Response
@app.route('/api/items.csv')
@utils.requires_auth
def item_dump():
items = Item.query.order_by(desc(Item.mu)).all()
data = [['Mu', 'Sigma Squared', 'Name', 'Location', 'Description', 'Active']]
data += [... | from gavel import app
from gavel.models import *
import gavel.utils as utils
from flask import Response
@app.route('/api/items.csv')
@utils.requires_auth
def item_dump():
items = Item.query.order_by(desc(Item.mu)).all()
data = [['Mu', 'Sigma Squared', 'Name', 'Location', 'Description', 'Active']]
data += [... | Add API endpoint for getting decisions | Add API endpoint for getting decisions
| Python | agpl-3.0 | atagh/gavel-clone,anishathalye/gavel,atagh/gavel-clone,anishathalye/gavel,anishathalye/gavel | ---
+++
@@ -23,5 +23,23 @@
def annotator_dump():
annotators = Annotator.query.all()
data = [['Name', 'Email', 'Description', 'Secret']]
- data += [[str(a.name), a.email, a.description, a.secret] for a in annotators]
+ data += [[
+ str(a.name),
+ a.email,
+ a.description,
+ ... |
31d0af7d5f3a984d4f6c7be62d599553a3bc7c08 | opps/articles/utils.py | opps/articles/utils.py | # -*- coding: utf-8 -*-
from django.utils import timezone
from opps.articles.models import ArticleBox, Article
def set_context_data(self, SUPER, **kwargs):
context = super(SUPER, self).get_context_data(**kwargs)
article = Article.objects.filter(
site=self.site,
channel_long_slug__in=self.cha... | # -*- coding: utf-8 -*-
from django.utils import timezone
from opps.articles.models import ArticleBox, Article
def set_context_data(self, SUPER, **kwargs):
context = super(SUPER, self).get_context_data(**kwargs)
article = Article.objects.filter(
site=self.site,
channel_long_slug__in=self.cha... | Add channel root on set context data, sent to template | Add channel root on set context data, sent to template
| Python | mit | YACOWS/opps,opps/opps,YACOWS/opps,williamroot/opps,opps/opps,jeanmask/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,williamroot/opps,williamroot/opps,opps/opps,YACOWS/opps,YACOWS/opps,jeanmask/opps,opps/opps | ---
+++
@@ -19,6 +19,7 @@
context['channel']['long_slug'] = self.long_slug
if self.channel:
context['channel']['level'] = self.channel.get_level()
+ context['channel']['root'] = self.channel.get_root()
context['articleboxes'] = ArticleBox.objects.filter(
channel__long_slug=se... |
eb8884ce0c7dec3433d76c49942f0531cc96d915 | plugin/main.py | plugin/main.py | #!/usr/bin/env python
"""
Deploy builds to a Rancher orchestrated stack using rancher-compose
"""
import os
import drone
import subprocess
def main():
"""The main entrypoint for the plugin."""
payload = drone.plugin.get_input()
vargs = payload["vargs"]
# Required fields should raise an error
url... | #!/usr/bin/env python
"""
Deploy builds to a Rancher orchestrated stack using rancher-compose
"""
import os
import drone
import subprocess
def main():
"""The main entrypoint for the plugin."""
payload = drone.plugin.get_input()
vargs = payload["vargs"]
# Required fields should raise an error
os.... | Set environmental vars for rancher-compose to work | Set environmental vars for rancher-compose to work
| Python | apache-2.0 | dangerfarms/drone-rancher | ---
+++
@@ -14,7 +14,9 @@
vargs = payload["vargs"]
# Required fields should raise an error
- url, key, secret = vargs['url'], vargs['access_key'], vargs['secret_key']
+ os.environ["RANCHER_URL"] = vargs['url']
+ os.environ["RANCHER_ACCESS_KEY"] = vargs['access_key']
+ os.environ["RANCHER_SECRE... |
a7028ca3d3dea5a9f8891dfd2947b671bbe02b7e | pentai/gui/my_button.py | pentai/gui/my_button.py |
from kivy.uix.button import Button
import audio as a_m
class MyButton(Button):
def on_touch_up(self, touch, *args, **kwargs):
if self.collide_point(*touch.pos):
if not hasattr(self, "silent"):
a_m.instance.click()
super(MyButton, self).on_touch_up(touch, *args, **kwargs... |
from kivy.uix.button import Button
import audio as a_m
from pentai.base.defines import *
class MyButton(Button):
def __init__(self, *args, **kwargs):
super(MyButton, self).__init__(*args, **kwargs)
self.silent = False
def on_touch_up(self, touch, *args, **kwargs):
if self.collide_poin... | Make "silent" an attribute from __init__ | Make "silent" an attribute from __init__
| Python | mit | cropleyb/pentai,cropleyb/pentai,cropleyb/pentai | ---
+++
@@ -1,11 +1,16 @@
from kivy.uix.button import Button
import audio as a_m
+from pentai.base.defines import *
class MyButton(Button):
+ def __init__(self, *args, **kwargs):
+ super(MyButton, self).__init__(*args, **kwargs)
+ self.silent = False
+
def on_touch_up(self, touch, *args, ... |
ad07405ca877d65f30c9acd19abb4e782d854eaa | workshops/views.py | workshops/views.py | from django.views.generic import ListView, DetailView
from config.utils import get_active_event
from workshops.models import Workshop
class WorkshopListView(ListView):
template_name = 'workshops/list_workshops.html'
model = Workshop
context_object_name = 'workshops'
def get_queryset(self):
ev... | from django.views.generic import ListView, DetailView
from config.utils import get_active_event
from workshops.models import Workshop
class WorkshopListView(ListView):
template_name = 'workshops/list_workshops.html'
model = Workshop
context_object_name = 'workshops'
def get_queryset(self):
ev... | Order workshops by start date before title | Order workshops by start date before title
| Python | bsd-3-clause | WebCampZg/conference-web,WebCampZg/conference-web,WebCampZg/conference-web | ---
+++
@@ -14,7 +14,7 @@
return (super().get_queryset()
.filter(event=event)
.prefetch_related('applicants__user', 'skill_level')
- .order_by('title'))
+ .order_by('starts_at', 'title'))
class WorkshopDetailView... |
a39a7eb7d43282337d3e3df10921a1b0d9f0e3e4 | odeintw/__init__.py | odeintw/__init__.py | # Copyright (c) 2014, Warren Weckesser
# All rights reserved.
# See the LICENSE file for license information.
from numpy.testing import Tester as _Tester
from ._odeintw import odeintw
__version__ = "0.1.2.dev3"
test = _Tester().test
| # Copyright (c) 2014, Warren Weckesser
# All rights reserved.
# See the LICENSE file for license information.
from ._odeintw import odeintw
__version__ = "0.1.2.dev3"
| Remove some unused test infrastructure | MAINT: Remove some unused test infrastructure
| Python | bsd-3-clause | WarrenWeckesser/odeintw | ---
+++
@@ -2,11 +2,8 @@
# All rights reserved.
# See the LICENSE file for license information.
-from numpy.testing import Tester as _Tester
from ._odeintw import odeintw
__version__ = "0.1.2.dev3"
-
-test = _Tester().test |
73df211afe212124a69f8585e30d03332b20767c | migrate/__init__.py | migrate/__init__.py | """
SQLAlchemy migrate provides two APIs :mod:`migrate.versioning` for
database schema version and repository management and
:mod:`migrate.changeset` that allows to define database schema changes
using Python.
"""
from migrate.versioning import *
from migrate.changeset import *
__version__ = '0.7.3.dev'
| """
SQLAlchemy migrate provides two APIs :mod:`migrate.versioning` for
database schema version and repository management and
:mod:`migrate.changeset` that allows to define database schema changes
using Python.
"""
from migrate.versioning import *
from migrate.changeset import *
__version__ = '0.8.1'
| Fix the version number to match the last release. | Fix the version number to match the last release.
** NOTE: our release process really should do this
ahead of time.
Change-Id: Ic0cce0d57b4f05092417c4cf1a4ca5a74812ec3c
| Python | mit | rcherrueau/sqlalchemy-migrate,rcherrueau/sqlalchemy-migrate,andras-tim/sqlalchemy-migrate,dannon/sqlalchemy-migrate,stackforge/sqlalchemy-migrate,openstack/sqlalchemy-migrate,openstack/sqlalchemy-migrate | ---
+++
@@ -8,4 +8,4 @@
from migrate.versioning import *
from migrate.changeset import *
-__version__ = '0.7.3.dev'
+__version__ = '0.8.1' |
a116b22a76b0f833aa9f7f2e2ce4b36a95bc9ba0 | freight/tasks/send_pending_notifications.py | freight/tasks/send_pending_notifications.py | from __future__ import absolute_import
import logging
from freight import notifiers
from freight.config import celery, redis
from freight.models import Task
from freight.notifiers import queue
from freight.utils.redis import lock
@celery.task(name='freight.send_pending_notifications', max_retries=None)
def send_pen... | from __future__ import absolute_import
import logging
from freight import notifiers
from freight.config import celery, redis
from freight.models import Task
from freight.notifiers import queue
from freight.utils.redis import lock
@celery.task(name='freight.send_pending_notifications', max_retries=None)
def send_pen... | Add logging when no notifications due | Add logging when no notifications due
| Python | apache-2.0 | getsentry/freight,klynton/freight,rshk/freight,rshk/freight,rshk/freight,klynton/freight,rshk/freight,getsentry/freight,klynton/freight,klynton/freight,getsentry/freight,getsentry/freight,getsentry/freight | ---
+++
@@ -16,6 +16,7 @@
data = queue.get()
if data is None:
+ logging.info('No due notifications found')
return
task = Task.query.get(data['task']) |
83a517ad963e08e0200e4eeb3a817acc069ba7a4 | jacquard/cli.py | jacquard/cli.py | import sys
import pathlib
import argparse
import pkg_resources
from jacquard.config import load_config
def argument_parser():
parser = argparse.ArgumentParser(description="Split testing server")
parser.add_argument(
'-v',
'--verbose',
help="enable verbose output",
action='stor... | import sys
import pathlib
import argparse
import pkg_resources
from jacquard.config import load_config
def argument_parser():
parser = argparse.ArgumentParser(description="Split testing server")
parser.add_argument(
'-v',
'--verbose',
help="enable verbose output",
action='stor... | Print help when invoked with no arguments | Print help when invoked with no arguments
This is more useful.
| Python | mit | prophile/jacquard,prophile/jacquard | ---
+++
@@ -48,7 +48,7 @@
options = parser.parse_args(args)
if options.func is None:
- parser.print_usage()
+ parser.print_help()
return
# Parse options |
882fc867ab115f2b84f2f185bcebf3eb4a1d2fc8 | core/forms.py | core/forms.py | from django.forms import ModelForm
from django.forms.fields import CharField
from models import UserProfile
class UserProfileForm(ModelForm):
first_name = CharField(label='First name', required=False)
last_name = CharField(label='Last name', required=False)
class Meta:
model = UserProfile
... | from django.forms import ModelForm
from django.forms.fields import CharField
from models import UserProfile
class UserProfileForm(ModelForm):
first_name = CharField(label='First name', required=False)
last_name = CharField(label='Last name', required=False)
class Meta:
model = UserProfile
... | Fix profile creation. (Need tests badly). | Fix profile creation. (Need tests badly). | Python | mit | kenwang76/readthedocs.org,soulshake/readthedocs.org,nyergler/pythonslides,gjtorikian/readthedocs.org,tddv/readthedocs.org,kenshinthebattosai/readthedocs.org,ojii/readthedocs.org,LukasBoersma/readthedocs.org,mhils/readthedocs.org,sid-kap/readthedocs.org,michaelmcandrew/readthedocs.org,michaelmcandrew/readthedocs.org,oji... | ---
+++
@@ -5,16 +5,16 @@
class UserProfileForm(ModelForm):
first_name = CharField(label='First name', required=False)
last_name = CharField(label='Last name', required=False)
-
+
class Meta:
model = UserProfile
# Don't allow users edit someone else's user page,
# or to ... |
0874b3e5d5316c53d1d941e4e337bec45469bf6d | core/hybra.py | core/hybra.py | import data_loader
import descriptives
import network as module_network
import timeline as module_timeline
import wordclouds as module_wordclouds
__sources = dir( data_loader )
__sources = filter( lambda x: x.startswith('load_') , __sources )
__sources = map( lambda x: x[5:], __sources )
def data_sources():
retur... | import data_loader
import re
import descriptives
import network as module_network
import timeline as module_timeline
import wordclouds as module_wordclouds
__sources = dir( data_loader )
__sources = filter( lambda x: x.startswith('load_') , __sources )
__sources = map( lambda x: x[5:], __sources )
def data_sources():... | Add method for filtering from text | Add method for filtering from text
| Python | mit | HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core,HIIT/hybra-core | ---
+++
@@ -1,4 +1,5 @@
import data_loader
+import re
import descriptives
import network as module_network
import timeline as module_timeline
@@ -20,6 +21,20 @@
return load( **kwargs )
+def filter_from_text( data, text = [], substrings = True ):
+ filtered_data = []
+
+ for d in data:
+ if s... |
28ee229284459402d73f41e756dc95fe99f0227b | pybot/resources/urls.py | pybot/resources/urls.py | FACEBOOK_MESSAGES_POST_URL = "https://graph.facebook.com/v2.6/me/messages" | FACEBOOK_MESSAGES_POST_URL = "https://graph.facebook.com/v2.6/" | Update URL for generic graph api url | Update URL for generic graph api url
| Python | mit | ben-cunningham/python-messenger-bot,ben-cunningham/pybot | ---
+++
@@ -1 +1 @@
-FACEBOOK_MESSAGES_POST_URL = "https://graph.facebook.com/v2.6/me/messages"
+FACEBOOK_MESSAGES_POST_URL = "https://graph.facebook.com/v2.6/" |
ed45016c7319d2df1f894ec17971d0d1c4d8abe1 | museum_site/base.py | museum_site/base.py | from django.db import models
class BaseModel(models.Model):
model_name = None
#title
#description
#preview
#table_fields = []
def admin_url(self):
name = self.model_name.replace("-", "_").lower()
return "/admin/museum_site/{}/{}/change/".format(name, self.id)
def url(self)... | from django.db import models
from django.utils.safestring import mark_safe
class BaseModel(models.Model):
model_name = None
#title
#description
#preview
#table_fields = []
def admin_url(self):
name = self.model_name.replace("-", "_").lower()
return "/admin/museum_site/{}/{}/cha... | Add specific error messages for mandatory subclass methods | Add specific error messages for mandatory subclass methods
| Python | mit | DrDos0016/z2,DrDos0016/z2,DrDos0016/z2 | ---
+++
@@ -1,4 +1,5 @@
from django.db import models
+from django.utils.safestring import mark_safe
class BaseModel(models.Model):
model_name = None
@@ -17,28 +18,28 @@
def preview_url(self):
return "Preview url"
- def as_block(self):
- return "AB"
+ def as_block(self, view="deta... |
6c19a46f4ef146a67c43ca46c3e71dd2a05358fc | api/caching/tasks.py | api/caching/tasks.py | import urlparse
import celery
import requests
from celery.utils.log import get_task_logger
from django.conf import settings
from framework.tasks import app as celery_app
logger = get_task_logger(__name__)
class VarnishTask(celery.Task):
abstract = True
max_retries = 5
def get_varnish_servers():
# TODO... | import urlparse
import celery
import requests
from celery.utils.log import get_task_logger
from django.conf import settings
from framework.tasks import app as celery_app
logger = get_task_logger(__name__)
class VarnishTask(celery.Task):
abstract = True
max_retries = 5
def get_varnish_servers():
# TODO... | Remove commented out logged decorator | Remove commented out logged decorator
| Python | apache-2.0 | adlius/osf.io,billyhunt/osf.io,baylee-d/osf.io,GageGaskins/osf.io,caneruguz/osf.io,doublebits/osf.io,mluke93/osf.io,felliott/osf.io,asanfilippo7/osf.io,icereval/osf.io,billyhunt/osf.io,emetsger/osf.io,saradbowman/osf.io,doublebits/osf.io,mluke93/osf.io,zamattiac/osf.io,chennan47/osf.io,doublebits/osf.io,acshi/osf.io,cs... | ---
+++
@@ -18,7 +18,6 @@
return settings.VARNISH_SERVERS
@celery_app.task(base=VarnishTask, name='caching_tasks.ban_url')
-# @logged('ban_url')
def ban_url(url):
if settings.ENABLE_VARNISH:
parsed_url = urlparse.urlparse(url) |
0ad53b5dc887ab4b81e3cf83bfb897340880c3a2 | launch_control/models/test_case.py | launch_control/models/test_case.py | """
Module with the TestCase model.
"""
from launch_control.utils.json.pod import PlainOldData
class TestCase(PlainOldData):
"""
TestCase model.
Currently contains just two fields:
- test_case_id (test-case specific ID)
- name (human readable)
"""
__slots__ = ('test_case_id', 'd... | """
Module with the TestCase model.
"""
from launch_control.utils.json.pod import PlainOldData
class TestCase(PlainOldData):
"""
TestCase model.
Currently contains just two fields:
- test_case_id (test-case specific ID)
- name (human readable)
"""
__slots__ = ('test_case_id', 'n... | Fix TestCase definition to have a slot 'name' instead of 'desc' | Fix TestCase definition to have a slot 'name' instead of 'desc'
| Python | agpl-3.0 | Linaro/lava-server,Linaro/lava-server,Linaro/lava-server,OSSystems/lava-server,OSSystems/lava-server,OSSystems/lava-server,Linaro/lava-server | ---
+++
@@ -14,7 +14,7 @@
- name (human readable)
"""
- __slots__ = ('test_case_id', 'desc')
+ __slots__ = ('test_case_id', 'name')
def __init__(self, test_case_id, desc):
self.test_case_id = test_case_id |
149c56ba2285d42d319b525c04fea6e4a8ea0ec5 | ldaptor/protocols/ldap/__init__.py | ldaptor/protocols/ldap/__init__.py | # Twisted, the Framework of Your Internet
# Copyright (C) 2001 Matthew W. Lefkowitz
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in t... | # Twisted, the Framework of Your Internet
# Copyright (C) 2001 Matthew W. Lefkowitz
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in t... | Remove ldaptor.protocols.ldap.__all__, it's unnecessary and had wrong content. | Remove ldaptor.protocols.ldap.__all__, it's unnecessary and had wrong content.
git-svn-id: 554337001ebd49d78cdf0a90d762fa547a80d337@203 373aa48d-36e5-0310-bb30-ae74d9883905
| Python | lgpl-2.1 | antong/ldaptor,antong/ldaptor | ---
+++
@@ -15,14 +15,3 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""LDAP protocol logic"""
-
-__all__ = [
- "ldapclient",
- "ldaperrors",
- "schema",
- "ldapfilter",
- "ldif",
- "ldapsyntax",
- "distinguishedname",
- "ldapconnector",
- ] |
996e862befb339165a801673754343fc643ffa86 | source/services/rotten_tomatoes_service.py | source/services/rotten_tomatoes_service.py | import requests
from bs4 import BeautifulSoup
from source.models.rt_rating import RTRating
class RottenTomatoesService:
__URL = 'http://www.rottentomatoes.com/m/'
__SEPERATOR = '_'
def __init__(self, title):
self.title = title
def get_rt_rating(self):
search_url = self.__URL + self... | import requests
from bs4 import BeautifulSoup
from source.models.rt_rating import RTRating
class RottenTomatoesService:
__URL = 'http://www.rottentomatoes.com/m/'
__SEPERATOR = '_'
def __init__(self, title):
self.title = title
def get_rt_rating(self):
search_url = self.__URL + self... | Fix typo from previous commit | Fix typo from previous commit
| Python | mit | jeremyrea/caterblu,jeremyrea/caterblu,jeremyrea/caterblu,jeremyrea/caterblu | ---
+++
@@ -30,7 +30,7 @@
if formatted_title.startswith('The '):
formatted_title = formatted_title.replace('The ', '', 1)
if "'s" in formatted_title:
- formatted_title = formatted_title.replace("'", 's')
+ formatted_title = formatted_title.replace("'s", 's')
... |
5dcdfa510e62d754bce6270286e42a76b37c23c4 | inpassing/worker/util.py | inpassing/worker/util.py | # Copyright (c) 2017 Luke San Antonio Bialecki
# All rights reserved.
from datetime import datetime, timezone
DATE_FMT = '%Y-%m-%d'
def date_to_str(day):
return day.strftime(DATE_FMT)
def str_to_date(s):
return datetime.strptime(s, DATE_FMT).replace(tzinfo=timezone.utc)
| # Copyright (c) 2017 Luke San Antonio Bialecki
# All rights reserved.
from datetime import datetime, timezone
DATE_FMT = '%Y-%m-%d'
def date_to_str(day):
return day.strftime(DATE_FMT)
def str_to_date(s, tz=None):
ret = datetime.strptime(s, DATE_FMT)
if tz:
return tz.localize(ret)
else:
... | Support use of local timezones when parsing date strings | Support use of local timezones when parsing date strings
| Python | mit | lukesanantonio/inpassing-backend,lukesanantonio/inpassing-backend | ---
+++
@@ -10,5 +10,9 @@
return day.strftime(DATE_FMT)
-def str_to_date(s):
- return datetime.strptime(s, DATE_FMT).replace(tzinfo=timezone.utc)
+def str_to_date(s, tz=None):
+ ret = datetime.strptime(s, DATE_FMT)
+ if tz:
+ return tz.localize(ret)
+ else:
+ return ret |
cd9048f64c6a2184e148daf0baa7bb3be51b3268 | vol/__init__.py | vol/__init__.py | # coding: utf-8
from __future__ import unicode_literals, print_function
from sys import platform
if platform == 'darwin':
from .osx import OSXVolumeController as VolumeController
else:
raise NotImplementedError(
'VolumeController for {} platform has not been implemented yet'.format(platform)
)
| # coding: utf-8
'''
A cross platform implementation of volume control
'''
from __future__ import unicode_literals, print_function
from sys import platform
if platform == 'darwin':
from .osx import OSXVolumeController as VolumeController
else:
raise NotImplementedError(
'VolumeController for {} platform... | Update doc for vol pkg | Update doc for vol pkg
| Python | bsd-3-clause | Microcore/AGT,Microcore/YAS | ---
+++
@@ -1,4 +1,7 @@
# coding: utf-8
+'''
+A cross platform implementation of volume control
+'''
from __future__ import unicode_literals, print_function
from sys import platform
|
6aea2f1c3a478be0c6926f442924e1f263955430 | pip_run/__init__.py | pip_run/__init__.py | import sys
from . import deps
from . import commands
from . import launch
from . import scripts
def run(args=None):
if args is None:
args = sys.argv[1:]
pip_args, params = commands.parse_script_args(args)
commands.intercept(pip_args)
pip_args.extend(scripts.DepsReader.search(params))
with deps.load(*deps.not_... | import sys
from . import deps
from . import commands
from . import launch
from . import scripts
def run(args=None):
"""
Main entry point for pip-run.
"""
if args is None:
args = sys.argv[1:]
pip_args, params = commands.parse_script_args(args)
commands.intercept(pip_args)
pip_args.extend(scripts.DepsReader.s... | Add docstring to run function. | Add docstring to run function.
| Python | mit | jaraco/rwt | ---
+++
@@ -7,6 +7,9 @@
def run(args=None):
+ """
+ Main entry point for pip-run.
+ """
if args is None:
args = sys.argv[1:]
pip_args, params = commands.parse_script_args(args) |
1e0ac4612937583dec22a81db833c7962e91edc8 | registries/views.py | registries/views.py | from django.shortcuts import render
from django.conf import settings
from django.http import HttpResponse
from rest_framework.generics import ListAPIView
from registries.models import Organization
from registries.serializers import DrillerListSerializer
class APIDrillerListView(ListAPIView):
queryset = Organizatio... | from django.shortcuts import render
from django.conf import settings
from django.http import HttpResponse
from rest_framework.generics import ListAPIView
from registries.models import Organization
from registries.serializers import DrillerListSerializer
class APIDrillerListView(ListAPIView):
queryset = Organizatio... | Add prefetch to reduce queries on province_state | Add prefetch to reduce queries on province_state
| Python | apache-2.0 | rstens/gwells,bcgov/gwells,bcgov/gwells,rstens/gwells,rstens/gwells,bcgov/gwells,rstens/gwells,bcgov/gwells | ---
+++
@@ -6,7 +6,7 @@
from registries.serializers import DrillerListSerializer
class APIDrillerListView(ListAPIView):
- queryset = Organization.objects.all()
+ queryset = Organization.objects.all().select_related('province_state')
serializer_class = DrillerListSerializer
# Create your views here. |
d74908f5acb5c1a88965ed086d41435e0041d85b | pyluos/modules/l0_dc_motor.py | pyluos/modules/l0_dc_motor.py | from __future__ import division
from .module import Module
class DCMotor(object):
def __init__(self, name, delegate):
self._name = name
self._delegate = delegate
self._speed = None
@property
def name(self):
return self._name
@property
def speed(self):
sel... | from __future__ import division
from .module import Module
class DCMotor(object):
def __init__(self, name, delegate):
self._name = name
self._delegate = delegate
self._speed = None
@property
def name(self):
return self._name
@property
def speed(self):
sel... | Fix l0 dc field name. | Fix l0 dc field name.
| Python | mit | pollen/pyrobus | ---
+++
@@ -23,7 +23,8 @@
if s != self._speed:
self._speed = s
- self._delegate._push_value(self.name, self._speed)
+ field = self.name.replace('m', 's')
+ self._delegate._push_value(field, self._speed)
class L0DCMotor(Module): |
7f863c30f7e49da29530d141a76c1976e0a679ee | massa/domain.py | massa/domain.py | # -*- coding: utf-8 -*-
from sqlalchemy import (
Column,
Date,
Integer,
MetaData,
Numeric,
String,
Table,
create_engine,
)
metadata = MetaData()
measurement = Table('measurement', metadata,
Column('id', Integer, primary_key=True),
Column('weight', Numeric(4, 1), nullable=Fals... | # -*- coding: utf-8 -*-
from sqlalchemy import (
Column,
Date,
Integer,
MetaData,
Numeric,
String,
Table,
create_engine,
)
metadata = MetaData()
measurement = Table('measurement', metadata,
Column('id', Integer, primary_key=True),
Column('weight', Numeric(4, 1), nullable=Fals... | Add a function do make db tables. | Add a function do make db tables. | Python | mit | jaapverloop/massa | ---
+++
@@ -28,3 +28,6 @@
)
metadata.bind = engine
+
+def make_tables():
+ metadata.create_all() |
e58688d87ba1c4af718ea3e427d94f68c3df3b16 | qipipe/interfaces/__init__.py | qipipe/interfaces/__init__.py | from .compress import Compress
from .copy import Copy
from .fix_dicom import FixDicom
from .group_dicom import GroupDicom
from .map_ctp import MapCTP
from .move import Move
from .glue import Glue
from .uncompress import Uncompress
from .xnat_upload import XNATUpload
from .xnat_download import XNATDownload
| from .compress import Compress
from .copy import Copy
from .fix_dicom import FixDicom
from .group_dicom import GroupDicom
from .map_ctp import MapCTP
from .move import Move
from .unpack import Unpack
from .uncompress import Uncompress
from .xnat_upload import XNATUpload
from .xnat_download import XNATDownload
from .fas... | Replace Glue interface by more restrictive Unpack. | Replace Glue interface by more restrictive Unpack.
| Python | bsd-2-clause | ohsu-qin/qipipe | ---
+++
@@ -4,7 +4,9 @@
from .group_dicom import GroupDicom
from .map_ctp import MapCTP
from .move import Move
-from .glue import Glue
+from .unpack import Unpack
from .uncompress import Uncompress
from .xnat_upload import XNATUpload
from .xnat_download import XNATDownload
+from .fastfit import Fastfit
+from .m... |
b2e537c2d054854d0b36ccee7567c9ba9c2a5516 | modulation_test.py | modulation_test.py | import pygame
import random
from demodulate.cfg import *
from gen_tone import *
if __name__ == "__main__":
pygame.mixer.pre_init(frequency = int(SAMPLE_FREQ), channels = 1)
pygame.mixer.init()
WPM = random.uniform(2,20)
pattern = [1,0,1,1,1,0,0,0,0,0,0,0] # morse code 'A'
#gen_test_data()
data = gen_tone(pattern... | import pygame
import random
import time
from demodulate.cfg import *
from modulate import *
from gen_tone import *
if __name__ == "__main__":
pygame.mixer.pre_init(frequency = int(SAMPLE_FREQ), channels = 1)
pygame.mixer.init()
WPM = random.uniform(2,20)
pattern = chars_to_elements.letters_to_sequence("NA NA NA NA... | Make modulation test wait for sound to stop playing before exiting | Make modulation test wait for sound to stop playing before exiting
| Python | mit | nickodell/morse-code | ---
+++
@@ -1,14 +1,18 @@
import pygame
import random
+import time
from demodulate.cfg import *
+from modulate import *
from gen_tone import *
if __name__ == "__main__":
pygame.mixer.pre_init(frequency = int(SAMPLE_FREQ), channels = 1)
pygame.mixer.init()
WPM = random.uniform(2,20)
- pattern = [1,0,1,1,1... |
e0c07b4078caaa4220040d0e8c4ed86e3a2bf087 | lextoumbourou/fabfile.py | lextoumbourou/fabfile.py | import os
from fabric.api import run, env, settings, cd, put, sudo
from fabric.contrib import files
import private
def prod():
env.hosts = list(private.PROD_SERVERS)
def local():
env.hosts = ['localhost']
def deploy():
"""
Deploy code to production
"""
git_repo = 'git://github.com/lextoum... | import os
from fabric.api import run, env, settings, cd, put, sudo
from fabric.contrib import files
import private
GIT_REPO = 'git://github.com/lextoumbourou/lextoumbourou.com.git'
def prod():
env.hosts = list(private.PROD_SERVERS)
def local():
env.hosts = ['localhost']
def initial_build():
"""
... | Move inital_build task into own function | Move inital_build task into own function
| Python | mit | lextoumbourou/lextoumbourou.com-old,lextoumbourou/lextoumbourou.com-old | ---
+++
@@ -4,6 +4,8 @@
from fabric.contrib import files
import private
+
+GIT_REPO = 'git://github.com/lextoumbourou/lextoumbourou.com.git'
def prod():
env.hosts = list(private.PROD_SERVERS)
@@ -13,18 +15,27 @@
env.hosts = ['localhost']
+def initial_build():
+ """
+ Clone project and set p... |
70efbd90d9d5601d368ddb5ea20a3b9910539b78 | members/urls.py | members/urls.py | from django.conf.urls import patterns, url
from django.contrib import auth
urlpatterns = patterns('',
url(r'^login/$', 'django.contrib.auth.views.login',{'template_name': 'members/login_form.html'}, name='login'),
url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='logout'),
url... | from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^login/$', 'django.contrib.auth.views.login',{'template_name': 'members/login_form.html'}, name='login'),
url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='logout'),
url(r'^search/(?P<name>.*)/$', 'mem... | Change url and views for login/logout to django Defaults | Change url and views for login/logout to django Defaults
| Python | mit | Hackfmi/Diaphanum,Hackfmi/Diaphanum | ---
+++
@@ -1,5 +1,4 @@
from django.conf.urls import patterns, url
-from django.contrib import auth
urlpatterns = patterns('',
url(r'^login/$', 'django.contrib.auth.views.login',{'template_name': 'members/login_form.html'}, name='login'), |
1aa050f2d50fb206ffb1a7d06e75cc2ba27cc91b | 1.py | 1.py | i = input()
floor = 0
for x in range(0, len(i)):
if i[x] == '(':
floor +=1;
elif i[x] == ')':
floor -=1;
print(floor) | i = input()
floor = 0
instruction = 0
for x in range(0, len(i)):
if i[x] == '(':
floor +=1
elif i[x] == ')':
floor -=1
if (floor < 0 and instruction == 0):
instruction = x+1
print("floor: %s" % floor)
print("basement entry: %s" % instruction) | Add second part of puzzle | Add second part of puzzle
| Python | mit | Walther/adventofcode,Walther/adventofcode,Walther/adventofcode | ---
+++
@@ -1,8 +1,12 @@
i = input()
floor = 0
+instruction = 0
for x in range(0, len(i)):
if i[x] == '(':
- floor +=1;
+ floor +=1
elif i[x] == ')':
- floor -=1;
-print(floor)
+ floor -=1
+ if (floor < 0 and instruction == 0):
+ instruction = x+1
+print("floor: %s" ... |
6bc6a07ee60f68e2003b5afcc752c3820a176541 | astropy/conftest.py | astropy/conftest.py | # this contains imports plugins that configure py.test for astropy tests.
# by importing them here in conftest.py they are discoverable by py.test
# no matter how it is invoked within the astropy tree.
from .tests.pytest_plugins import *
try:
import matplotlib
except ImportError:
pass
else:
matplotlib.use... | # this contains imports plugins that configure py.test for astropy tests.
# by importing them here in conftest.py they are discoverable by py.test
# no matter how it is invoked within the astropy tree.
from .tests.pytest_plugins import *
try:
import matplotlib
except ImportError:
pass
else:
matplotlib.use... | Add Cython to py.test header | Add Cython to py.test header | Python | bsd-3-clause | kelle/astropy,tbabej/astropy,lpsinger/astropy,joergdietrich/astropy,pllim/astropy,MSeifert04/astropy,AustereCuriosity/astropy,saimn/astropy,aleksandr-bakanov/astropy,StuartLittlefair/astropy,tbabej/astropy,mhvk/astropy,DougBurke/astropy,pllim/astropy,StuartLittlefair/astropy,astropy/astropy,kelle/astropy,AustereCuriosi... | ---
+++
@@ -12,3 +12,5 @@
matplotlib.use('Agg')
enable_deprecations_as_exceptions(include_astropy_deprecations=False)
+
+PYTEST_HEADER_MODULES['Cython'] = 'cython' |
ad0f4e793ea010df243b87f42fff94037432e7b2 | mla_game/apps/transcript/management/commands/fake_game_one_gameplay.py | mla_game/apps/transcript/management/commands/fake_game_one_gameplay.py | import random
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from mla_game.apps.accounts.models import Profile
from ...models import (
Transcript, TranscriptPhraseDownvote
)
class Command(BaseCommand):
help = 'Creates random votes for all phrases in a random... | import random
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from mla_game.apps.accounts.models import Profile
from ...models import (
Transcript, TranscriptPhraseDownvote
)
class Command(BaseCommand):
help = 'Creates random votes for all phrases in a random... | Fix fake game one script again | Fix fake game one script again
| Python | mit | WGBH/FixIt,WGBH/FixIt,WGBH/FixIt | ---
+++
@@ -15,7 +15,7 @@
def handle(self, *args, **options):
users = User.objects.all()
- transcript = Transcript.objects.random_transcript()
+ transcript = Transcript.objects.random_transcript().first()
for phrase in transcript.phrases.all():
for user in users:
... |
1056bb70699f2c480f887b13dd28b412a7aeb6c5 | 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', 'date_available', 'published']... | #!/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', 'date_available', 'published']
list_f... | Remove channel (list_display, list_filter and search_fields) on PublishableAdmin core | Remove channel (list_display, list_filter and search_fields) on PublishableAdmin core
| Python | mit | YACOWS/opps,jeanmask/opps,williamroot/opps,williamroot/opps,opps/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,opps/opps,williamroot/opps,YACOWS/opps,opps/opps,YACOWS/opps,opps/opps | ---
+++
@@ -8,11 +8,10 @@
Overrides standard admin.ModelAdmin save_model method
It sets user (author) based on data from requet.
"""
- list_display = ['title', 'channel', 'date_available', 'published']
- list_filter = ['date_available', 'published', 'channel']
- search_fields = ['title', 'slug... |
84eb438c966d5c2794a0842dccaefea726c0dbb9 | organizer/views.py | organizer/views.py | from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = template.render(c... | from django.http.response import HttpResponse
from django.template import Context, loader
from .models import Tag
def homepage(request):
tag_list = Tag.objects.all()
template = loader.get_template(
'organizer/tag_list.html')
context = Context({'tag_list': tag_list})
output = template.render(c... | Tag Detail: get slug from URL pattern. | Ch05: Tag Detail: get slug from URL pattern.
| Python | bsd-2-clause | jambonrose/DjangoUnleashed-1.8,jambonrose/DjangoUnleashed-1.8 | ---
+++
@@ -13,8 +13,7 @@
return HttpResponse(output)
-def tag_detail(request):
- # slug = ?
+def tag_detail(request, slug):
tag = Tag.objects.get(slug__iexact=slug)
template = loader.get_template(
'organizer/tag_detail.html') |
d9d0af04ea76c6c6bd346ce417e9feb61580c90e | nuitka/plugins/commercial/__init__.py | nuitka/plugins/commercial/__init__.py | # Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | # Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | Make it easier to integrate commercial plugins. | Plugins: Make it easier to integrate commercial plugins.
| Python | apache-2.0 | kayhayen/Nuitka,kayhayen/Nuitka,kayhayen/Nuitka,kayhayen/Nuitka | ---
+++
@@ -15,4 +15,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-""" Dummy file to make this directory a package. """
+""" Commercial plugins package.
+
+This may load code from places indicated by a heuristics.
+"""
+
+
+# Auto extend to ... |
badda02f6cc81a8c5670b6f53e67009a3cb8b66f | rmake/core/constants.py | rmake/core/constants.py | #
# Copyright (c) 2010 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permanent/... | #
# Copyright (c) 2010 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permanent/... | Relocate core status codes to the 450-499 range | Relocate core status codes to the 450-499 range
| Python | apache-2.0 | sassoftware/rmake3,sassoftware/rmake3,sassoftware/rmake3 | ---
+++
@@ -14,13 +14,17 @@
# Status codes for a job
+# Generic success
JOB_OK = 200
-JOB_FAILED = 400
+# Generic failure. Core failure codes will be in the range 450-499 and 550-599.
+# All others are reserved for plugins.
+JOB_FAILED = 450
# Status cod... |
cb408af79e46f32eca7337545f87fa169b32cba5 | n6/run_tests.py | n6/run_tests.py | #!/usr/bin/env python3
#
# Affero GPL
#
import unittest
def alltests():
return unittest.TestSuite([
])
unittest.TextTestRunner(verbosity = 2).run(alltests())
| Set up run tests file. | Set up run tests file.
| Python | agpl-3.0 | JasonCozens/en | ---
+++
@@ -0,0 +1,11 @@
+#!/usr/bin/env python3
+#
+# Affero GPL
+#
+import unittest
+
+def alltests():
+ return unittest.TestSuite([
+ ])
+
+unittest.TextTestRunner(verbosity = 2).run(alltests()) | |
ce67500ec566784f6f8883e1ffcaef6ad768d810 | 2018/05/solve.py | 2018/05/solve.py | data = open("input.txt").read().strip()
import re
from collections import Counter
def solve1(data):
prevData = None
while data != prevData:
prevData = data
for a,b in zip(data, data[1:]):
if (a != b and a == b.lower()) or (a != b and a.lower() == b):
data = data.rep... | data = open("input.txt").read().strip()
import re
import string
from collections import Counter
def solve1(data):
prevData = None
while data != prevData:
prevData = data
for a,b in zip(data, data[1:]):
if (a != b and a == b.lower()) or (a != b and a.lower() == b):
d... | Fix bug with omitting v | Fix bug with omitting v
| Python | mit | lamperi/aoc,lamperi/aoc,lamperi/aoc,lamperi/aoc,lamperi/aoc | ---
+++
@@ -1,6 +1,7 @@
data = open("input.txt").read().strip()
import re
+import string
from collections import Counter
def solve1(data):
@@ -20,13 +21,11 @@
def solve2(data):
min_len = len(data)
- min_chr = None
- for c in 'abcdefghijklmnopqrstubwxyz':
+ for c in string.ascii_lowercase:
... |
640f54d769a01b3707591f76914c8e4cf5394eaa | micro/process_options.py | micro/process_options.py | import help_formatter
import argparse
def process_options():
parser = _make_options_parser()
return parser.parse_args()
def _make_options_parser():
parser = argparse.ArgumentParser(
prog='micro',
add_help=False,
formatter_class=help_formatter.HelpFormatter
)
parser.add_argu... | import help_formatter
import argparse
def process_options():
parser = _make_options_parser()
return parser.parse_args()
def _make_options_parser():
parser = argparse.ArgumentParser(
prog='micro',
add_help=False,
formatter_class=help_formatter.HelpFormatter
)
parser.add_argu... | Update copyright years of the interpreter | Update copyright years of the interpreter
| Python | mit | thewizardplusplus/micro,thewizardplusplus/micro,thewizardplusplus/micro | ---
+++
@@ -16,7 +16,7 @@
'--version',
action='version',
help='- show the version message and exit',
- version='Micro interpreter, v2.1\nCopyright (c) 2016 thewizardplusplus'
+ version='Micro interpreter, v2.1\nCopyright (c) 2016, 2017 thewizardplusplus'
)
parser.add... |
c43ddf1f36535604167e496508d242a15c813496 | roamer/main.py | roamer/main.py | #!/usr/bin/env python
"""
argh
"""
import os
from roamer.python_edit import file_editor
from roamer.directory import Directory
from roamer.edit_directory import EditDirectory
from roamer.engine import Engine
from roamer.record import Record
from roamer.constant import TRASH_DIR
def main():
"""
argh
"""
... | #!/usr/bin/env python
"""
argh
"""
import os
from roamer.python_edit import file_editor
from roamer.directory import Directory
from roamer.edit_directory import EditDirectory
from roamer.engine import Engine
from roamer.record import Record
from roamer.constant import TRASH_DIR
def main():
"""
argh
"""
... | Fix references not available after pulling up two instances of roamer | Fix references not available after pulling up two instances of roamer
| Python | mit | abaldwin88/roamer | ---
+++
@@ -24,6 +24,7 @@
raw_entries = os.listdir(cwd)
directory = Directory(cwd, raw_entries)
+ Record().add_dir(directory)
output = file_editor(directory.text())
edit_directory = EditDirectory(cwd, output)
engine = Engine(directory, edit_directory) |
0fa565b79a2776cb2878d6a44299b25764150f15 | pywind/__init__.py | pywind/__init__.py | """ pywind module.
For more information visit https://github.com/zathras777/pywind
"""
__version__ = '1.1.0'
| """ pywind module.
For more information visit https://github.com/zathras777/pywind
"""
__version__ = '1.1.1'
| Update to next version number following release of 1.1.0 | Update to next version number following release of 1.1.0
| Python | unlicense | zathras777/pywind,zathras777/pywind | ---
+++
@@ -3,4 +3,4 @@
For more information visit https://github.com/zathras777/pywind
"""
-__version__ = '1.1.0'
+__version__ = '1.1.1' |
2aef43fcd44f075ff718475ea57ae23711de02aa | event/models.py | event/models.py | from django.db import models
class Artist(models.Model):
name = models.CharField(max_length=100)
image_url = models.URLField(blank=True)
thumb_url = models.URLField(blank=True)
events = models.ManyToManyField(
'event.Event',
related_name='artists',
blank=True,
)
def _... | from django.db import models
class Artist(models.Model):
name = models.CharField(max_length=100)
image_url = models.URLField(blank=True)
thumb_url = models.URLField(blank=True)
events = models.ManyToManyField(
'event.Event',
related_name='artists',
blank=True,
)
class... | Add Artist ordering by name | Add Artist ordering by name
| Python | mit | FedorSelitsky/eventrack,FedorSelitsky/eventrack,FedorSelitsky/eventrack,FedorSelitsky/eventrack | ---
+++
@@ -11,6 +11,9 @@
related_name='artists',
blank=True,
)
+
+ class Meta:
+ ordering = ['name']
def __str__(self):
return self.name |
aebc3440c98ee2b4cc5f880d648e106e1f9d6b9d | source/urls.py | source/urls.py | from django.conf.urls import url, include
from django.contrib import admin
from rest_framework import routers
from task.views import *
from userprofile.views import *
router = routers.DefaultRouter()
router.register(r'tasks', TaskListViewSet)
router.register(r'tolausers', TolaUserViewset)
router.register(r'countries'... | from django.conf.urls import url, include
from django.contrib import admin
from rest_framework import routers
from task.views import *
from userprofile.views import *
router = routers.DefaultRouter()
router.register(r'tasks', TaskListViewSet, base_name="my_task")
router.register(r'tolausers', TolaUserViewset)
router.... | Add the base_name to the API routers for the custom query_set | Add the base_name to the API routers for the custom query_set
| Python | apache-2.0 | toladata/TolaProfile,toladata/TolaProfile,toladata/TolaProfile,toladata/TolaProfile | ---
+++
@@ -6,7 +6,7 @@
router = routers.DefaultRouter()
-router.register(r'tasks', TaskListViewSet)
+router.register(r'tasks', TaskListViewSet, base_name="my_task")
router.register(r'tolausers', TolaUserViewset)
router.register(r'countries', CountryViewSet)
router.register(r'organizations', OrganizationViews... |
a099eab75245005527e03fb5278a49a6d565c8f9 | wagtailstartproject/project_template/tests/test_selenium/test_pages.py | wagtailstartproject/project_template/tests/test_selenium/test_pages.py | from wagtail.wagtailcore.models import Page
from .base import SeleniumTestCase
class PagesTest(SeleniumTestCase):
fixtures = ['basic_site.json']
def test_wagtail_pages(self):
"""Check if all Wagtail pages can be retrieved"""
pages = Page.objects.live()
for page in pages:
... | from wagtail.wagtailcore.models import Page
from .base import SeleniumTestCase
class PagesTest(SeleniumTestCase):
def test_wagtail_pages(self):
"""Check if all Wagtail pages can be retrieved"""
pages = Page.objects.live()
for page in pages:
url = page.relative_url(page.get_s... | Remove unnecessary fixtures attribute, already set by base class. | Remove unnecessary fixtures attribute, already set by base class.
| Python | mit | leukeleu/wagtail-startproject,leukeleu/wagtail-startproject | ---
+++
@@ -4,7 +4,6 @@
class PagesTest(SeleniumTestCase):
- fixtures = ['basic_site.json']
def test_wagtail_pages(self):
"""Check if all Wagtail pages can be retrieved""" |
104da4df7e0cd09d32457cf56fc00dc96fcdbdac | euler/p005.py | euler/p005.py | """Solution to Project Euler Problem 5
https://projecteuler.net/problem=5
"""
from fractions import gcd
from functools import reduce
MAXIMUM = 20
def compute(maximum=MAXIMUM):
"""Compute the LCM of all integers from 1 to `maximum`."""
return int(reduce(lambda x, y: (x*y)/gcd(x, y), range(1, maximum + 1)))
| """Solution to Project Euler Problem 5
https://projecteuler.net/problem=5
gcd, lcm, and lcmm functions by J.F. Sebastian.
http://stackoverflow.com/a/147539/6119465
"""
from functools import reduce
MAXIMUM = 20
def gcd(num1, num2):
"""Return greatest common divisor using Euclid's Algorithm."""
while num2:
... | Replace deprecated fractions.gcd with Euclid's Algorithm | Replace deprecated fractions.gcd with Euclid's Algorithm
| Python | mit | 2Cubed/ProjectEuler | ---
+++
@@ -1,14 +1,33 @@
"""Solution to Project Euler Problem 5
https://projecteuler.net/problem=5
+
+gcd, lcm, and lcmm functions by J.F. Sebastian.
+http://stackoverflow.com/a/147539/6119465
"""
-from fractions import gcd
from functools import reduce
MAXIMUM = 20
+def gcd(num1, num2):
+ """Return g... |
740762be1565690f78111861afe3152bdab4fadc | tests/test_soi.py | tests/test_soi.py | import os
import numpy as np
import pandas as pd
import unittest
from urllib2 import urlopen
from bom_data_parser import read_soi_html
class SOITest(unittest.TestCase):
def setUp(self):
self.test_soi_file = os.path.join(os.path.dirname(__file__), 'data', 'SOI', 'soiplaintext.html')
def test_soi(self)... | import os
import numpy as np
import pandas as pd
import unittest
from urllib2 import urlopen
from bom_data_parser import read_soi_html
class SOITest(unittest.TestCase):
def setUp(self):
self.test_soi_file = os.path.join(os.path.dirname(__file__), 'data', 'SOI', 'soiplaintext.html')
def test_soi(self)... | Change unit test syntax for pandas > 0.12.0 compat | Change unit test syntax for pandas > 0.12.0 compat
| Python | bsd-3-clause | amacd31/bom_data_parser,amacd31/bom_data_parser | ---
+++
@@ -15,6 +15,6 @@
soi_data = read_soi_html(soi_file)
self.assertTrue('soi' in soi_data.columns)
- self.assertEqual(soi_data.ix['1876-01'], 11.3)
- self.assertEqual(soi_data.ix['1984-12'], -1.4)
- self.assertEqual(soi_data.ix['2015-01'], 7.8)
+ self.assertEqu... |
638e6a0f5b906e9cf63d95728da328b24f506173 | ananas/default/__init__.py | ananas/default/__init__.py | __all__ = ["roll", "tracery"]
from .roll import DiceBot
from .tracery import TraceryBot
| __all__ = ["roll", "tracery"]
from .roll import DiceBot
from .tracery import TraceryBot
from .announce import AnnounceBot
| Add announcebot to default module root for ease of import | Add announcebot to default module root for ease of import
| Python | mit | Chronister/ananas | ---
+++
@@ -1,3 +1,4 @@
__all__ = ["roll", "tracery"]
from .roll import DiceBot
from .tracery import TraceryBot
+from .announce import AnnounceBot |
de96fab9b84c66b1d3bc3c200713bb595bce81b3 | examples/chart_maker/my_chart.py | examples/chart_maker/my_chart.py | from seleniumbase import BaseCase
class MyChartMakerClass(BaseCase):
def test_chart_maker(self):
self.create_pie_chart(title="Automated Tests")
self.add_data_point("Passed", 7, color="#95d96f")
self.add_data_point("Untested", 2, color="#eaeaea")
self.add_data_point("Failed", 1, co... | from seleniumbase import BaseCase
class MyChartMakerClass(BaseCase):
def test_chart_maker(self):
self.create_presentation()
self.create_pie_chart(title="Automated Tests")
self.add_data_point("Passed", 7, color="#95d96f")
self.add_data_point("Untested", 2, color="#eaeaea")
... | Expand on the Chart Maker example tests | Expand on the Chart Maker example tests
| Python | mit | mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase | ---
+++
@@ -4,10 +4,24 @@
class MyChartMakerClass(BaseCase):
def test_chart_maker(self):
+ self.create_presentation()
+
self.create_pie_chart(title="Automated Tests")
self.add_data_point("Passed", 7, color="#95d96f")
self.add_data_point("Untested", 2, color="#eaeaea")
... |
e4d271011ff352d4fa83c252739a71dc74a6c0d8 | packages/Python/lldbsuite/test/lang/swift/protocols/class_protocol/TestClassConstrainedProtocolArgument.py | packages/Python/lldbsuite/test/lang/swift/protocols/class_protocol/TestClassConstrainedProtocolArgument.py | """
Test that variables passed in as a class constrained protocol type
are correctly printed.
"""
import lldbsuite.test.lldbinline as lldbinline
lldbinline.MakeInlineTest(__file__, globals())
| """
Test that variables passed in as a class constrained protocol type
are correctly printed.
"""
import lldbsuite.test.lldbinline as lldbinline
import lldbsuite.test.decorators as decorators
lldbinline.MakeInlineTest(
__file__, globals(), decorators=[decorators.skipUnlessDarwin])
| Mark a test relying on foundation as darwin only. | [SwiftLanguageRuntime] Mark a test relying on foundation as darwin only.
| Python | apache-2.0 | apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb | ---
+++
@@ -3,5 +3,7 @@
are correctly printed.
"""
import lldbsuite.test.lldbinline as lldbinline
+import lldbsuite.test.decorators as decorators
-lldbinline.MakeInlineTest(__file__, globals())
+lldbinline.MakeInlineTest(
+ __file__, globals(), decorators=[decorators.skipUnlessDarwin]) |
01ed98138f9be1f55c5f46e5e073dde4271cc277 | useraudit/urls.py | useraudit/urls.py | from django.conf.urls import include, url
from .views import reactivate_user
app_name = "useraudit"
urlpatterns = [
url(r'/reactivate/(?P<user_id>\d+)[/]?$', reactivate_user, name="reactivate_user"),
]
| from django.conf.urls import include, url
from .views import reactivate_user
app_name = "useraudit"
urlpatterns = [
url(r'reactivate/(?P<user_id>\d+)[/]?$', reactivate_user, name="reactivate_user"),
]
| Remove / from the beginning of the '/reactivate' url | Remove / from the beginning of the '/reactivate' url
Fixes #10
| Python | bsd-3-clause | muccg/django-useraudit,muccg/django-useraudit,muccg/django-useraudit | ---
+++
@@ -4,5 +4,5 @@
app_name = "useraudit"
urlpatterns = [
- url(r'/reactivate/(?P<user_id>\d+)[/]?$', reactivate_user, name="reactivate_user"),
+ url(r'reactivate/(?P<user_id>\d+)[/]?$', reactivate_user, name="reactivate_user"),
] |
2ba4e34af7a1078d4c19d5f964df42d291f9862a | slaveapi/clients/pdu.py | slaveapi/clients/pdu.py | class PDU(object):
def __init__(self, fqdn, port):
self.fqdn = fqdn
self.port = port
def off(self):
pass
def on(self):
pass
def powercycle(self, delay=None):
pass
| class PDU(object):
def __init__(self, fqdn, port):
self.fqdn = fqdn
self.port = port
def off(self):
pass
def on(self):
pass
def powercycle(self, delay=None):
raise NotImplementedError()
| Mark PDUs as not implemented to avoid false positives in reboots. | Mark PDUs as not implemented to avoid false positives in reboots.
| Python | mpl-2.0 | lundjordan/slaveapi | ---
+++
@@ -8,5 +8,5 @@
def on(self):
pass
def powercycle(self, delay=None):
- pass
+ raise NotImplementedError()
|
4115cee1aa913346d5495230a98a5e723de9f5ab | bilgisayfam/utils/encoding.py | bilgisayfam/utils/encoding.py | # -*- coding: utf-8 -*-
"""
Provides a translation method that strips Turkish characters and replaces
them with ASCII equivalents.
"""
translate_table = {
ord(u"ğ"): u"g",
ord(u"ü"): u"u",
ord(u"ş"): u"s",
ord(u"ı"): u"i",
ord(u"ö"): u"o",
ord(u"ç"): u"c",
ord(u"Ğ"): u"G",
ord(u"Ü"): u... | # -*- coding: utf-8 -*-
"""
Provides a translation method that strips Turkish characters and replaces
them with ASCII equivalents.
"""
translate_table = {
ord(u"ğ"): u"g",
ord(u"ü"): u"u",
ord(u"ş"): u"s",
ord(u"ı"): u"i",
ord(u"ö"): u"o",
ord(u"ç"): u"c",
ord(u"Ğ"): u"G",
ord(u"Ü"): u... | Make normalize lower case as well. | Make normalize lower case as well.
| Python | mit | tayfun/bilgisayfam,tayfun/bilgisayfam,tayfun/bilgisayfam | ---
+++
@@ -22,4 +22,16 @@
def normalize(s):
+ """
+ Transforms a unicode string so that it can be searched and found even when
+ it is not exactly the same. So for example a user can search for "Oğlak"
+ and we can find "oğlak" by normalizing both to "oglak".
+
+ Lowercases all the letters and an... |
18545c519c23e9463fa7558191552e69304dfef7 | blog/myblog/tests.py | blog/myblog/tests.py | import datetime
from django.test import TestCase
from django.utils import timezone
from myblog.models import Article, Author
class ArticleMethodTest(TestCase):
"""docstring for ArticleMethodTest - it shoult return False
if it was published in past or future"""
def setUp(self):
self.joe = Auth... | import datetime
from django.test import TestCase
from django.utils import timezone
from django.core.urlresolvers import reverse
from myblog.models import Article, Author
class ArticleMethodTest(TestCase):
"""docstring for ArticleMethodTest - it shoult return False
if it was published in past or future"""... | Add test for article view | Add test for article view
| Python | mit | mileto94/Django-tutorial,mileto94/Django-tutorial | ---
+++
@@ -1,6 +1,7 @@
import datetime
from django.test import TestCase
from django.utils import timezone
+from django.core.urlresolvers import reverse
from myblog.models import Article, Author
@@ -13,7 +14,7 @@
def test_was_published_with_future_date(self):
future_article = Article("21255", ... |
897bbe8b4d70ca68fb0336774b8c549ed2fe4c3e | buildtools/cleanup-ghpages.py | buildtools/cleanup-ghpages.py | #! python
import sys
import requests
import urllib3
from os import listdir
from shutil import rmtree
from json import loads
urllib3.disable_warnings()
def main():
url = "https://api.github.com/repos/{}/ngeo/branches?per_page=100".format(sys.argv[1])
try:
json = requests.get(url).json()
expec... | #! python
import sys
import requests
import urllib3
from os import listdir
from shutil import rmtree
from json import loads
urllib3.disable_warnings()
def main():
url = "https://api.github.com/repos/{}/ngeo/branches?per_page=100".format(sys.argv[1])
try:
json = requests.get(url).json()
expec... | Remove greenkeeper directories from gh-pages | Remove greenkeeper directories from gh-pages
| Python | mit | camptocamp/ngeo,camptocamp/ngeo,camptocamp/ngeo,camptocamp/ngeo,camptocamp/ngeo | ---
+++
@@ -20,7 +20,7 @@
expected.append("index.html")
expected.append(".git")
for path in listdir(sys.argv[2]):
- if path not in expected:
+ if path not in expected or path.startswith("greenkeeper/"):
print("Remove: {}".format(path))
... |
7c7aa833dd79c53dbd921f5ed59cf2620342dbe3 | python/ShortenUrl.py | python/ShortenUrl.py |
# This is fairly specific to using a Yourls server: see http://yourls.org/
import urllib
import urllib2
import Util
SHORTEN_PART = 'yourls-api.php'
def shorten(url, config):
def shortenerUrl(part):
return '%s/%s' % (config.shortenUrl, part)
index = Util.getAndIncrementIndexFile(config.indexFile)
shortu... |
# This is fairly specific to using a Yourls server: see http://yourls.org/
import urllib
import urllib2
import Util
SHORTEN_PART = 'yourls-api.php'
def shorten(url, config):
def shortenerUrl(part):
return '%s/%s' % (config.shortenUrl, part)
index = Util.getAndIncrementIndexFile(config.indexFile)
shortu... | Fix tiny errors in Python code | Fix tiny errors in Python code
| Python | mit | rec/echomesh,rec/echomesh,rec/echomesh,rec/echomesh,rec/echomesh,rec/echomesh | ---
+++
@@ -13,7 +13,7 @@
return '%s/%s' % (config.shortenUrl, part)
index = Util.getAndIncrementIndexFile(config.indexFile)
- shorturl = config.shortenPrefix +
+ shorturl = config.shortenPrefix + index
data = urllib.urlencode(dict(signature=config.auth['yourls'],
action... |
0e68fd50428ceaf53e00e22c11a45ec98185e738 | avocado/export/__init__.py | avocado/export/__init__.py | from avocado.core import loader
from avocado.conf import OPTIONAL_DEPS
from _base import BaseExporter # noqa
from _csv import CSVExporter
from _sas import SASExporter
from _r import RExporter
from _json import JSONExporter
from _html import HTMLExporter # noqa
registry = loader.Registry(register_instance=False)
... | from avocado.core import loader
from avocado.conf import OPTIONAL_DEPS
from _base import BaseExporter # noqa
from _csv import CSVExporter
from _sas import SASExporter
from _r import RExporter
from _json import JSONExporter
from _html import HTMLExporter # noqa
registry = loader.Registry(register_instance=False)
reg... | Replace exporter registry keys with short_name derivative | Replace exporter registry keys with short_name derivative
Fix #203
Signed-off-by: Byron Ruth <e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98@devel.io>
| Python | bsd-2-clause | murphyke/avocado,murphyke/avocado,murphyke/avocado,murphyke/avocado | ---
+++
@@ -5,18 +5,18 @@
from _sas import SASExporter
from _r import RExporter
from _json import JSONExporter
-from _html import HTMLExporter # noqa
+from _html import HTMLExporter # noqa
registry = loader.Registry(register_instance=False)
-registry.register(CSVExporter, 'csv')
-registry.register(SASEx... |
d55389580160c4585c131537c04c4045a38ea134 | fluxghost/http_server_base.py | fluxghost/http_server_base.py |
from select import select
import logging
import socket
logger = logging.getLogger("HTTPServer")
from fluxghost.http_handlers.websocket_handler import WebSocketHandler
from fluxghost.http_handlers.file_handler import FileHandler
class HttpServerBase(object):
def __init__(self, assets_path, address, backlog=10):... |
from select import select
import logging
import socket
logger = logging.getLogger("HTTPServer")
from fluxghost.http_handlers.websocket_handler import WebSocketHandler
from fluxghost.http_handlers.file_handler import FileHandler
class HttpServerBase(object):
def __init__(self, assets_path, address, backlog=10):... | Add auto select port function | Add auto select port function
| Python | agpl-3.0 | flux3dp/fluxghost,flux3dp/fluxghost,flux3dp/fluxghost,flux3dp/fluxghost | ---
+++
@@ -18,6 +18,13 @@
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(address)
s.listen(backlog)
+
+ if address[1] == 0:
+ from sys import stdout
+ address = s.getsockname()
+ stdout.write("LISTEN ON %i\n" % address[1])
+ ... |
ffdd11e7aeed179868618dd7b4666e5e149962b0 | solar/solar/core/handlers/__init__.py | solar/solar/core/handlers/__init__.py | # -*- coding: utf-8 -*-
from solar.core.handlers.ansible_template import AnsibleTemplate
from solar.core.handlers.ansible_playbook import AnsiblePlaybook
from solar.core.handlers.base import Empty
from solar.core.handlers.puppet import Puppet
from solar.core.handlers.shell import Shell
HANDLERS = {'ansible': AnsibleT... | # -*- coding: utf-8 -*-
from solar.core.handlers.ansible_template import AnsibleTemplate
from solar.core.handlers.ansible_playbook import AnsiblePlaybook
from solar.core.handlers.base import Empty
from solar.core.handlers.puppet import Puppet
from solar.core.handlers.shell import Shell
HANDLERS = {'ansible': AnsibleT... | Add lost handler for puppet | Add lost handler for puppet
| Python | apache-2.0 | loles/solar,openstack/solar,zen/solar,dshulyak/solar,loles/solar,loles/solar,CGenie/solar,torgartor21/solar,pigmej/solar,Mirantis/solar,torgartor21/solar,zen/solar,Mirantis/solar,pigmej/solar,loles/solar,openstack/solar,pigmej/solar,zen/solar,Mirantis/solar,Mirantis/solar,zen/solar,openstack/solar,CGenie/solar,dshulyak... | ---
+++
@@ -9,6 +9,7 @@
HANDLERS = {'ansible': AnsibleTemplate,
'ansible_playbook': AnsiblePlaybook,
'shell': Shell,
+ 'puppet': Puppet,
'none': Empty}
def get(handler_name): |
d3beb067abca8a2c014ca8039556181881310392 | app/groups/utils.py | app/groups/utils.py | from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.template.loader import get_template
from django.template import Context
def send_group_mail(request, to_email, subject, email_text_template, email_html_template):
"""Sends a email to a group of people using a standard ... | from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.template.loader import get_template
from django.template import Context
def send_group_mail(request, to_email, subject, email_text_template, email_html_template):
"""Sends a email to a group of people using a standard ... | Switch to default mail from variable | Switch to default mail from variable
| Python | bsd-3-clause | nikdoof/test-auth | ---
+++
@@ -9,7 +9,7 @@
# Mail the admins to inform them of a new request
ctx = Context({'request': obj})
to_email = group.admins.values_list('email', flat=True)
- msg = EmailMultiAlternatives(subject, get_template(email_text_template).render(ctx), getattr(settings, 'SERVER_EMAIL', 'auth@pleaseignor... |
f3803452c669aa35ca71f00c18f613e276a70ca2 | scripts/add_users.py | scripts/add_users.py | #!/usr/bin/env python
"""
Add a series of users from a file of JSON objects, one per line.
The JSON user object lines can have the following fields:
{"name": "A. Non", "password": "pass12345", 'emailAddress': "email@email.com", "role": "supplier", "supplierId": 12345}
Usage:
add-users.py <data_api_endpoint> <dat... | #!/usr/bin/env python
"""
Add a series of users from a file of JSON objects, one per line.
The JSON user object lines can have the following fields:
{"name": "A. Non", "password": "pass12345", "emailAddress": "email@email.com", "role": "supplier", "supplierId": 12345}
Usage:
add-users.py <data_api_endpoint> <dat... | Fix example of how to run script, and make it executable | Fix example of how to run script, and make it executable
| Python | mit | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | ---
+++
@@ -4,7 +4,7 @@
The JSON user object lines can have the following fields:
-{"name": "A. Non", "password": "pass12345", 'emailAddress': "email@email.com", "role": "supplier", "supplierId": 12345}
+{"name": "A. Non", "password": "pass12345", "emailAddress": "email@email.com", "role": "supplier", "supplierI... |
0ffd3699fc696bca7d7bd1b35870aa66fb0598ef | lms/djangoapps/instructor_task/admin.py | lms/djangoapps/instructor_task/admin.py | """
Basic admin screens to search and edit InstructorTasks.
This will mostly involve searching by course_id or task_id and manually failing
a task.
"""
from config_models.admin import ConfigurationModelAdmin
from django.contrib import admin
from .config.models import GradeReportSetting
from .models import Instruct... | """
Basic admin screens to search and edit InstructorTasks.
This will mostly involve searching by course_id or task_id and manually failing
a task.
"""
from config_models.admin import ConfigurationModelAdmin
from django.contrib import admin
from .config.models import GradeReportSetting
from .models import Instructor... | Add ability to manually fail instructor tasks in batches. | Add ability to manually fail instructor tasks in batches.
When an InstructorTask is stuck in QUEUING (say if there was a
problem with celery), the support team needs to manually intervene
and mark the task as "FAILED" so that new tasks of that type can
be created for that course. This is usually done one at a time,
bu... | Python | agpl-3.0 | EDUlib/edx-platform,eduNEXT/edunext-platform,stvstnfrd/edx-platform,arbrandes/edx-platform,stvstnfrd/edx-platform,angelapper/edx-platform,arbrandes/edx-platform,eduNEXT/edx-platform,edx/edx-platform,eduNEXT/edx-platform,EDUlib/edx-platform,eduNEXT/edunext-platform,eduNEXT/edunext-platform,angelapper/edx-platform,edx/ed... | ---
+++
@@ -5,8 +5,6 @@
a task.
"""
-
-
from config_models.admin import ConfigurationModelAdmin
from django.contrib import admin
@@ -14,9 +12,21 @@
from .models import InstructorTask
+def mark_tasks_as_failed(modeladmin, request, queryset):
+ queryset.update(
+ task_state='FAILURE',
+ ta... |
7e50594c47ff0f8fdaaa3c6fb3a7b6ec222fc9fa | hgallpaths.py | hgallpaths.py | # hgallpaths.py - pull and push too all paths
#
# Copyright 2012 Keegan Carruthers-Smith <keegan.csmith@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''push and pull too all paths'''
from mercurial import commands
... | # hgallpaths.py - pull and push to all paths
#
# Copyright 2012 Keegan Carruthers-Smith <keegan.csmith@gmail.com>
#
# Released under the terms of the BSD License. See LICENSE.txt for details.
'''push and pull to all paths'''
from mercurial import commands
cmdtable = {}
def do_command(command, path_kw, ui, *args, *... | Update license header to reference BSD. | Update license header to reference BSD.
| Python | bsd-2-clause | keegancsmith/hgallpaths | ---
+++
@@ -1,11 +1,10 @@
-# hgallpaths.py - pull and push too all paths
+# hgallpaths.py - pull and push to all paths
#
# Copyright 2012 Keegan Carruthers-Smith <keegan.csmith@gmail.com>
#
-# This software may be used and distributed according to the terms of the
-# GNU General Public License version 2 or any lat... |
d7b5cd3c3ef51aef5264542fae03322955bd5ca8 | appengine_config.py | appengine_config.py | """Configuration."""
import logging
import os
import re
from google.appengine.ext.appstats import recording
logging.info('Loading %s from %s', __name__, __file__)
# Custom webapp middleware to add Appstats.
def webapp_add_wsgi_middleware(app):
app = recording.appstats_wsgi_middleware(app)
return app
# Appstats... | """Configuration."""
import logging
import os
import re
from google.appengine.ext.appstats import recording
logging.info('Loading %s from %s', __name__, __file__)
# Custom webapp middleware to add Appstats.
def webapp_add_wsgi_middleware(app):
app = recording.appstats_wsgi_middleware(app)
return app
# Appstats... | Switch Django version from 1.0 to 1.1 | Switch Django version from 1.0 to 1.1
| Python | apache-2.0 | ligthyear/quick-check,ligthyear/quick-check | ---
+++
@@ -31,7 +31,7 @@
# Declare the Django version we need.
from google.appengine.dist import use_library
-use_library('django', '1.0')
+use_library('django', '1.1')
# Fail early if we can't import Django 1.x. Log identifying information.
import django |
ca8263ecf33798acc01bb4a5f5aeb3d8005da026 | karmaworld/apps/users/views.py | karmaworld/apps/users/views.py | #!/usr/bin/env python
# -*- coding:utf8 -*-
# Copyright (C) 2013 FinalsClub Foundation
from django.contrib.auth.models import User
from django.views.generic import TemplateView
from django.views.generic.detail import SingleObjectMixin
class ProfileView(TemplateView, SingleObjectMixin):
model = User
context_... | #!/usr/bin/env python
# -*- coding:utf8 -*-
# Copyright (C) 2013 FinalsClub Foundation
from django.contrib.auth.models import User
from django.views.generic import TemplateView
from django.views.generic.detail import SingleObjectMixin
class ProfileView(TemplateView, SingleObjectMixin):
model = User
context_... | Fix to make user profile display | Fix to make user profile display
| Python | agpl-3.0 | FinalsClub/karmaworld,FinalsClub/karmaworld,FinalsClub/karmaworld,FinalsClub/karmaworld | ---
+++
@@ -11,8 +11,8 @@
model = User
context_object_name = 'user' # name passed to template
template_name = 'user_profile.html'
+ object = None
def get_object(self, queryset=None):
- u = self.request.user
return self.request.user
|
b0904677e9687932099406a38cc7cd8f7ba67573 | examples/cifar-autoencoder.py | examples/cifar-autoencoder.py | #!/usr/bin/env python
import climate
import matplotlib.pyplot as plt
import theanets
from utils import load_cifar, plot_layers, plot_images
g = climate.add_arg_group('CIFAR Example')
g.add_argument('--features', type=int, default=32, metavar='N',
help='train a model using N^2 hidden-layer features')
... | #!/usr/bin/env python
import climate
import matplotlib.pyplot as plt
import theanets
from utils import load_cifar, plot_layers, plot_images
g = climate.add_arg_group('CIFAR Example')
g.add_argument('--features', type=int, default=32, metavar='N',
help='train a model using N^2 hidden-layer features')
... | Access weights using new interface. | Access weights using new interface.
| Python | mit | chrinide/theanets,lmjohns3/theanets,devdoer/theanets | ---
+++
@@ -20,7 +20,7 @@
e.train(train, valid)
- plot_layers(e.network.weights, channels=3)
+ plot_layers([e.network.get_weights(1), e.network.get_weights('out')], channels=3)
plt.tight_layout()
plt.show()
|
c99c275e1304335d210054c3838dc4bfe1618ac9 | stl/__init__.py | stl/__init__.py |
import stl.ascii
import stl.binary
def read_ascii_file(file):
return stl.ascii.parse(file)
def read_binary_file(file):
return stl.binary.parse(file)
def read_ascii_string(data):
from StringIO import StringIO
return parse_ascii_file(StringIO(data))
def read_binary_string(data):
from StringIO... |
import stl.ascii
import stl.binary
from stl.types import Solid, Facet, Vector3d
def read_ascii_file(file):
return stl.ascii.parse(file)
def read_binary_file(file):
return stl.binary.parse(file)
def read_ascii_string(data):
from StringIO import StringIO
return parse_ascii_file(StringIO(data))
d... | Make the types available in the main "stl" module. | Make the types available in the main "stl" module.
| Python | mit | ng110/python-stl,apparentlymart/python-stl,zachwick/python-stl | ---
+++
@@ -1,6 +1,8 @@
import stl.ascii
import stl.binary
+
+from stl.types import Solid, Facet, Vector3d
def read_ascii_file(file): |
43e6a2e3bf90f5edee214d1511a6805a67f79595 | stl/__init__.py | stl/__init__.py |
import stl.ascii
import stl.binary
def parse_ascii_file(file):
return stl.ascii.parse(file)
def parse_binary_file(file):
return stl.binary.parse(file)
def parse_ascii_string(data):
from StringIO import StringIO
return parse_ascii_file(StringIO(data))
def parse_binary_string(data):
from Stri... |
import stl.ascii
import stl.binary
def read_ascii_file(file):
return stl.ascii.parse(file)
def read_binary_file(file):
return stl.binary.parse(file)
def read_ascii_string(data):
from StringIO import StringIO
return parse_ascii_file(StringIO(data))
def read_binary_string(data):
from StringIO... | Rename the reading functions "read_" rather than "parse_". | Rename the reading functions "read_" rather than "parse_".
"Parsing" is what they do internally, but "read" is a better opposite to
"write" and matches the name of the underlying raw file operation.
| Python | mit | apparentlymart/python-stl,zachwick/python-stl,ng110/python-stl | ---
+++
@@ -3,19 +3,19 @@
import stl.binary
-def parse_ascii_file(file):
+def read_ascii_file(file):
return stl.ascii.parse(file)
-def parse_binary_file(file):
+def read_binary_file(file):
return stl.binary.parse(file)
-def parse_ascii_string(data):
+def read_ascii_string(data):
from Strin... |
dbe8d7a4f43521e7aeba8f2670e70ac91f40ec3c | enthought/mayavi/tests/test_mlab_scene_model.py | enthought/mayavi/tests/test_mlab_scene_model.py | """
Testing the MlabSceneModel
"""
import unittest
from enthought.traits.api import HasTraits, Instance
from enthought.mayavi.tools.mlab_scene_model import MlabSceneModel
from enthought.mayavi import mlab
from test_mlab_integration import TestMlabNullEngine
###########################################################... | """
Testing the MlabSceneModel
"""
import unittest
import numpy as np
from enthought.traits.api import HasTraits, Instance
from enthought.mayavi.tools.mlab_scene_model import MlabSceneModel
from enthought.mayavi import mlab
from test_mlab_integration import TestMlabNullEngine
#######################################... | Fix a failing test due to refactor | BUG: Fix a failing test due to refactor
| Python | bsd-3-clause | dmsurti/mayavi,liulion/mayavi,alexandreleroux/mayavi,dmsurti/mayavi,alexandreleroux/mayavi,liulion/mayavi | ---
+++
@@ -2,6 +2,8 @@
Testing the MlabSceneModel
"""
import unittest
+
+import numpy as np
from enthought.traits.api import HasTraits, Instance
from enthought.mayavi.tools.mlab_scene_model import MlabSceneModel
@@ -26,17 +28,16 @@
scene1 = Instance(MlabSceneModel, ())
scene2 = Insta... |
2c4c527e6bb63f7db7a1c2d32f71b76fad65f92a | src/core/tests/test_callexplorer.py | src/core/tests/test_callexplorer.py | # Copyright (c) 2013 The SAYCBridge Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest2
from core.callexplorer import *
class CallExplorerTest(unittest2.TestCase):
def _assert_histories(self, glob_string, histories):... | # Copyright (c) 2013 The SAYCBridge Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest2
from core.callexplorer import *
class CallExplorerTest(unittest2.TestCase):
def _assert_histories(self, glob_string, histories):... | Add another test for CallExplorer.history_glob | Add another test for CallExplorer.history_glob
| Python | bsd-3-clause | abortz/saycbridge,eseidel/saycbridge,eseidel/saycbridge,abortz/saycbridge,abortz/saycbridge,eseidel/saycbridge,abortz/saycbridge,abortz/saycbridge | ---
+++
@@ -19,6 +19,7 @@
self._assert_histories("P 1C", ["P 1C"])
self._assert_histories("* 1C", ["P 1C"])
self._assert_histories("1C * 1H", ["1C 1D 1H", "1C X 1H", "1C P 1H"])
+ self._assert_histories("* 1C * 1D", ["P 1C X 1D", "P 1C P 1D"])
if __name__ == '__main__': |
a9b22b76203467ec63ce0592e32498cfecdedca3 | tests/config.py | tests/config.py | from ideascaly.auth import AuthNonSSO
from ideascaly.api import API
import ConfigParser
import unittest
config = ConfigParser.ConfigParser()
config.read('config')
class IdeascalyTestCase(unittest.TestCase):
def setUp(self):
self.auth = create_auth()
self.api = API(self.auth)
self.api.co... | import sys
sys.path.append("../ideascaly")
from ideascaly.auth import AuthNonSSO
from ideascaly.api import API
import ConfigParser
import unittest
config = ConfigParser.ConfigParser()
config.read('config')
class IdeascalyTestCase(unittest.TestCase):
def setUp(self):
self.auth = create_auth()
s... | Add the directory of the project module to system path | Add the directory of the project module to system path
| Python | mit | joausaga/ideascaly | ---
+++
@@ -1,3 +1,6 @@
+import sys
+sys.path.append("../ideascaly")
+
from ideascaly.auth import AuthNonSSO
from ideascaly.api import API
|
4f5b171b972b2255dfc3cdb8eea8b4a2745ae437 | centinel/backend.py | centinel/backend.py | import requests
import config
def request(slug):
url = "%s%s" % (config.server_url, slug)
req = requests.get(url)
if req.status_code != requests.codes.ok:
raise req.raise_for_status()
return req.json()
def get_recommended_versions():
return request("/versions")
def get_experiments():
... | import os
import glob
import requests
import config
def request(slug):
url = "%s%s" % (config.server_url, slug)
req = requests.get(url)
req.raise_for_status()
return req.json()
def get_recommended_versions():
return request("/versions")
def get_experiments():
return request("/experiments")
... | Send results to the server | Send results to the server
| Python | mit | rpanah/centinel,rpanah/centinel,lianke123321/centinel,JASONews/centinel,iclab/centinel,iclab/centinel,lianke123321/centinel,rpanah/centinel,iclab/centinel,Ashish1805/centinel,ben-jones/centinel,lianke123321/centinel | ---
+++
@@ -1,13 +1,14 @@
+import os
+import glob
import requests
+
import config
def request(slug):
url = "%s%s" % (config.server_url, slug)
req = requests.get(url)
- if req.status_code != requests.codes.ok:
- raise req.raise_for_status()
-
+ req.raise_for_status()
return req.json(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.