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 |
|---|---|---|---|---|---|---|---|---|---|---|
4ad06836e009309c7b5c00f0f932f9db38dff15c | examples/weather/gensvcbind.py | examples/weather/gensvcbind.py | import pyxb.Namespace
import pyxb.xmlschema as xs
import sys
import pyxb.standard.bindings.wsdl as wsdl
import pyxb.standard.bindings.soaphttp as soaphttp
from xml.dom import Node
from xml.dom import minidom
import pyxb.binding.generate
import pyxb.utils.domutils as domutils
doc = minidom.parse('weather.wsdl')
root =... | import pyxb.Namespace
import pyxb.xmlschema as xs
import sys
import pyxb.standard.bindings.wsdl as wsdl
from xml.dom import Node
from xml.dom import minidom
import pyxb.binding.generate
import pyxb.utils.domutils as domutils
doc = minidom.parse('weather.wsdl')
root = doc.documentElement
attribute_map = domutils.Attr... | Update how schema is built | Update how schema is built
| Python | apache-2.0 | balanced/PyXB,CantemoInternal/pyxb,pabigot/pyxb,jonfoster/pyxb-upstream-mirror,jonfoster/pyxb1,CantemoInternal/pyxb,jonfoster/pyxb1,jonfoster/pyxb2,jonfoster/pyxb2,balanced/PyXB,CantemoInternal/pyxb,balanced/PyXB,jonfoster/pyxb-upstream-mirror,jonfoster/pyxb-upstream-mirror,pabigot/pyxb,jonfoster/pyxb2 | ---
+++
@@ -3,7 +3,6 @@
import sys
import pyxb.standard.bindings.wsdl as wsdl
-import pyxb.standard.bindings.soaphttp as soaphttp
from xml.dom import Node
from xml.dom import minidom
import pyxb.binding.generate
@@ -14,17 +13,10 @@
attribute_map = domutils.AttributeMap(root)
-spec = wsdl.definitions.Creat... |
52a4a10d54374b08c5835d02077fd1edcdc547ac | tests/test_union_energy_grids/results.py | tests/test_union_energy_grids/results.py | #!/usr/bin/env python
import sys
# import statepoint
sys.path.insert(0, '../../src/utils')
import statepoint
# read in statepoint file
if len(sys.argv) > 1:
sp = statepoint.StatePoint(sys.argv[1])
else:
sp = statepoint.StatePoint('statepoint.10.binary')
sp.read_results()
# set up output string
outstr = ''
... | #!/usr/bin/env python
import sys
sys.path.insert(0, '../../src/utils')
from openmc.statepoint import StatePoint
# read in statepoint file
if len(sys.argv) > 1:
print(sys.argv)
sp = StatePoint(sys.argv[1])
else:
sp = StatePoint('statepoint.10.binary')
sp.read_results()
# set up output string
outstr = ''
... | Fix import for statepoint for test_union_energy_grids | Fix import for statepoint for test_union_energy_grids
| Python | mit | smharper/openmc,paulromano/openmc,mit-crpg/openmc,bhermanmit/openmc,wbinventor/openmc,paulromano/openmc,samuelshaner/openmc,mit-crpg/openmc,smharper/openmc,samuelshaner/openmc,johnnyliu27/openmc,mit-crpg/openmc,lilulu/openmc,walshjon/openmc,shikhar413/openmc,liangjg/openmc,shikhar413/openmc,walshjon/openmc,paulromano/o... | ---
+++
@@ -2,20 +2,20 @@
import sys
-# import statepoint
sys.path.insert(0, '../../src/utils')
-import statepoint
+from openmc.statepoint import StatePoint
# read in statepoint file
if len(sys.argv) > 1:
- sp = statepoint.StatePoint(sys.argv[1])
+ print(sys.argv)
+ sp = StatePoint(sys.argv[1])
el... |
b9441dd6e41aa8a73ca61df0963e086bb97ab4ef | src/eyeflask/__init__.py | src/eyeflask/__init__.py | from flask import Flask
import os
import os.path
__version__ = "0.1.0"
def create_app(config=None):
app = Flask(__name__, instance_relative_config=True)
config_name = "eyeflask.cfg"
# Use user specified config file if provided.
if config:
config_path = os.path.abspath(config)
# Load fr... | from flask import Flask
import os
import os.path
__version__ = "0.1.0"
def create_app(config=None):
app = Flask(__name__, instance_relative_config=True)
config_name = "eyeflask.cfg"
# Use user specified config file if provided.
if config:
config_path = os.path.abspath(config)
# Load fr... | Add time to debug log format | Add time to debug log format
| Python | mit | n8henrie/eyeflask | ---
+++
@@ -36,6 +36,13 @@
print("Instance folder: {}\n".format(app.instance_path))
raise
+ app.debug_log_format = '\n'.join([
+ 80 * '-',
+ '%(asctime)s %(levelname)s in %(module)s [%(pathname)s:%(lineno)d]:',
+ '%(message)s',
+ 80 * '-'
+ ])
+
from .ser... |
193ef7e8e4f6629e8534083e705826656c908cab | ws-tests/test_amendment_list.py | ws-tests/test_amendment_list.py | #!/usr/bin/env python
import sys, os
from opentreetesting import test_http_json_method, config
DOMAIN = config('host', 'apihost')
SUBMIT_URI = DOMAIN + 'v3/amendments/list_all'
r = test_http_json_method(SUBMIT_URI,
'GET',
expected_status=200,
... | #!/usr/bin/env python
import sys, os
from opentreetesting import test_http_json_method, config
DOMAIN = config('host', 'apihost')
SUBMIT_URI = DOMAIN + '/v3/amendments/list_all'
r = test_http_json_method(SUBMIT_URI,
'GET',
expected_status=200,
... | Use typical domain value (no trailing slash) | Use typical domain value (no trailing slash)
| Python | bsd-2-clause | OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api | ---
+++
@@ -2,7 +2,7 @@
import sys, os
from opentreetesting import test_http_json_method, config
DOMAIN = config('host', 'apihost')
-SUBMIT_URI = DOMAIN + 'v3/amendments/list_all'
+SUBMIT_URI = DOMAIN + '/v3/amendments/list_all'
r = test_http_json_method(SUBMIT_URI,
'GET',
... |
ccaf9cce478c077040a45340b498063ea8b7fc50 | elfi/__init__.py | elfi/__init__.py | # -*- coding: utf-8 -*-
from elfi.core import Transform, Simulator, Summary, Discrepancy
from elfi.distributions import *
from elfi.result import *
from elfi.methods import *
from elfi.storage import *
from elfi.visualization import *
from elfi.inference_task import InferenceTask
from elfi.wrapper import *
from elfi.en... | # -*- coding: utf-8 -*-
from elfi.core import Transform, Simulator, Summary, Discrepancy
from elfi.distributions import *
from elfi.result import *
from elfi.methods import *
from elfi.storage import *
from elfi.visualization import *
from elfi.inference_task import InferenceTask
from elfi.wrapper import *
from elfi.en... | Revert "Change version for dev" | Revert "Change version for dev"
This reverts commit 56a9db4cfeda91235313c5e72cb06420a6110673.
| Python | bsd-3-clause | HIIT/elfi,elfi-dev/elfi,lintusj1/elfi,elfi-dev/elfi,lintusj1/elfi | ---
+++
@@ -12,4 +12,4 @@
__author__ = 'ELFI authors'
__email__ = 'elfi-support@hiit.fi'
-__version__ = '0.3_dev'
+__version__ = '0.3' |
b544361b2e3f7942a82a911a8d6d314a2044be97 | almostfunded/wsgi.py | almostfunded/wsgi.py | """
WSGI config for untitled1 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... | """
WSGI config for untitled1 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from whitenoise.django import Djan... | Add missing import statement for whitenoise | Add missing import statement for whitenoise
| Python | mit | lorenanicole/almost_funded,lorenanicole/almost_funded,lorenanicole/almost_funded | ---
+++
@@ -10,6 +10,7 @@
import os
from django.core.wsgi import get_wsgi_application
+from whitenoise.django import DjangoWhiteNoise
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "almostfunded.settings")
|
b18aa2f4400deab98cc0e27c798ee6d7893232cd | utils/text.py | utils/text.py | def restrict_len(content):
if len(content) > 320:
content = content[:310].strip() + '...'
return content
def detect_language(config, langs, word):
from yandex_translate import YandexTranslate
translator = YandexTranslate(config['yandex_translate_key'])
russian = 'абвгдеёжзийклмнопрстуфхцчш... | def restrict_len(content):
if len(content) > 320:
content = content[:310].strip() + '...'
return content
def detect_language(config, langs, word):
from yandex_translate import YandexTranslate, YandexTranslateException
translator = YandexTranslate(config['yandex_translate_key'])
russian = '... | Add unknown language error catching | Add unknown language error catching
| Python | mit | Elishanto/HarryBotter | ---
+++
@@ -5,14 +5,17 @@
def detect_language(config, langs, word):
- from yandex_translate import YandexTranslate
+ from yandex_translate import YandexTranslate, YandexTranslateException
translator = YandexTranslate(config['yandex_translate_key'])
russian = 'абвгдеёжзийклмнопрстуфхцчшщъыьэюя'
... |
41fe44e99361d9006a8b196e9b886ffdb3e8e460 | functional_tests/test_evexml.py | functional_tests/test_evexml.py | """Functional tests for the xml api part of aniauth project.
This is a temporary app as EVE Online's xml api is deprecated and will be
disabled March 2018.
"""
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test import tag
from django.shortcuts import reverse
from selenium import ... | """Functional tests for the xml api part of aniauth project.
This is a temporary app as EVE Online's xml api is deprecated and will be
disabled March 2018.
"""
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test import tag
from django.shortcuts import reverse
from selenium import ... | Make test get correct url | Make test get correct url
| Python | mit | randomic/aniauth-tdd,randomic/aniauth-tdd | ---
+++
@@ -41,8 +41,8 @@
"""
# They browse to the eve api keys page.
- url = self.live_server_url + reverse('eveapi_submit')
- self.browser.get(self.live_server_url)
+ url = self.live_server_url + reverse('eveapi_add')
+ self.browser.get(url)
# They see input ... |
f468ea8123768a3f66621bfecae20814fa83017b | website_sale_clear_line/controllers/main.py | website_sale_clear_line/controllers/main.py | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp.http import request
from openerp impo... | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp.http import request
from openerp impo... | FIX website sale clear line | FIX website sale clear line
| Python | agpl-3.0 | ingadhoc/website | ---
+++
@@ -4,14 +4,14 @@
# directory
##############################################################################
from openerp.http import request
-from openerp import http
+from openerp import http, SUPERUSER_ID
class pos_website_sale(http.Controller):
@http.route(
['/shop/clear_cart_line'],... |
8efab7ddd356a9b2e2209b668d3ed83a5ac9faf2 | tests/test_logic.py | tests/test_logic.py | from context import core
from context import models
from models import model
from core import logic
import unittest
class test_logic(unittest.TestCase):
def test_create_room_office(self):
new_office = logic.create_room('office', 'orange')
self.assertIsInstance(new_office, model.Office)
def test_create_room_li... | from context import core
from context import models
from models import model
from core import logic
import unittest
class test_logic(unittest.TestCase):
def setUp(self):
self.white_char_in_name = logic.create_room('office', "name ")
self.white_char_in_typr = logic.create_room('livingspace ... | Add test case to test non-standard input | Add test case to test non-standard input
| Python | mit | georgreen/Geoogreen-Mamboleo-Dojo-Project | ---
+++
@@ -7,16 +7,28 @@
import unittest
class test_logic(unittest.TestCase):
- def test_create_room_office(self):
- new_office = logic.create_room('office', 'orange')
- self.assertIsInstance(new_office, model.Office)
+ def setUp(self):
+ self.white_char_in_name = logic.create_room('office', "name ... |
b457ab3abc0dbcfd94b26f7107144af67b8a85f4 | utils/checks.py | utils/checks.py | from discord.ext import commands
def is_owner_or(**perms):
async def predicate(ctx):
owner = ctx.bot.is_owner(ctx.author)
permissions = ctx.channel.permissions_for(ctx.author)
return all(getattr(permissions, perm, None) == value
for perm, value in perms.items()) ... | from discord.ext import commands
def is_owner_or(**perms):
async def predicate(ctx):
owner = await ctx.bot.is_owner(ctx.author)
permissions = ctx.channel.permissions_for(ctx.author)
return all(getattr(permissions, perm, None) == value
for perm, value in perms.ite... | Make is_owner_or not return True always | Make is_owner_or not return True always
| Python | mit | BeatButton/beattie-bot,BeatButton/beattie | ---
+++
@@ -3,7 +3,7 @@
def is_owner_or(**perms):
async def predicate(ctx):
- owner = ctx.bot.is_owner(ctx.author)
+ owner = await ctx.bot.is_owner(ctx.author)
permissions = ctx.channel.permissions_for(ctx.author)
return all(getattr(permissions, perm, None) == value
... |
87881f594836b7cf92ffce69dbb643ee05df88d1 | utils/config_utils.py | utils/config_utils.py | import sys
import yaml
def job_config(args):
try:
config_file = './config/{0}.yml'.format(args[0])
except IndexError:
sys.exit("Job name is a required argument. Example: chicago_cta")
try:
with open(config_file, 'r') as file:
config = yaml.safe_load(file)
except IOError:
sys.exit("Missing config file ... | import sys
import yaml
def main_config():
config_file = './config/.main.yml'
try:
with open(config_file, 'r') as file:
config = yaml.safe_load(file)
except IOError:
sys.exit("Missing main config file: '{0}'".format(config_file))
return config, config_file
def job_config(args):
try:
config_file = './... | Add util for loading main config | Add util for loading main config
| Python | mit | projectweekend/Transit-Stop-Collector | ---
+++
@@ -1,5 +1,17 @@
import sys
import yaml
+
+
+def main_config():
+ config_file = './config/.main.yml'
+
+ try:
+ with open(config_file, 'r') as file:
+ config = yaml.safe_load(file)
+ except IOError:
+ sys.exit("Missing main config file: '{0}'".format(config_file))
+
+ return config, config_file
def... |
f699281496950a10ec59651ed93f61e8ef79c1e7 | admin/__init__.py | admin/__init__.py | from database import User, Paste, ApiKey
from flask import abort, current_app
from flask_login import current_user
from flask_admin import BaseView, Admin
from flask_admin.contrib.mongoengine import ModelView
def is_admin():
if current_user.is_anonymous:
abort(403)
else:
return current_user.ad... | from database import User, Paste, ApiKey
from flask import abort, current_app
from flask_login import current_user
from flask_admin import BaseView, Admin
from flask_admin.contrib.mongoengine import ModelView
def is_admin():
if current_user.is_anonymous():
abort(403)
else:
return current_user.... | Revert "Fix 502 on admin page, is_authenticated() is now a boolean" | Revert "Fix 502 on admin page, is_authenticated() is now a boolean"
This reverts commit 0d9a7f86c1d988b4e0f4617c5e4f0409c0754e19.
| Python | mit | zifnab06/zifb.in,zifnab06/zifb.in | ---
+++
@@ -6,7 +6,7 @@
def is_admin():
- if current_user.is_anonymous:
+ if current_user.is_anonymous():
abort(403)
else:
return current_user.admin |
a8da08a6cf3bff12ce1668c5f4f99710317e42f0 | tests/unit/test_place.py | tests/unit/test_place.py | """Tests for the isort import placement module"""
from functools import partial
from isort import place, sections
from isort.settings import Config
def test_module(src_path):
place_tester = partial(place.module, config=Config(src_paths=[src_path]))
assert place_tester("isort") == sections.FIRSTPARTY
asse... | """Tests for the isort import placement module"""
from functools import partial
from isort import place, sections
from isort.settings import Config
def test_module(src_path):
place_tester = partial(place.module, config=Config(src_paths=[src_path]))
assert place_tester("isort") == sections.FIRSTPARTY
asse... | Add unit test case for desired placement behavior | Add unit test case for desired placement behavior
| Python | mit | PyCQA/isort,PyCQA/isort | ---
+++
@@ -20,3 +20,10 @@
)
assert place_tester("os") == sections.STDLIB
assert place_tester("hug") == sections.STDLIB
+
+
+def test_no_standard_library_placement():
+ assert place.module_with_reason(
+ "pathlib", config=Config(sections=["THIRDPARTY"], default_section="THIRDPARTY")
+ ) ==... |
ad278fdc71140dfb4be27895e747356e668e3b6c | teuthology/lockstatus.py | teuthology/lockstatus.py | import requests
import os
from .config import config
def get_status(name):
uri = os.path.join(config.lock_server, 'nodes', name, '')
response = requests.get(uri)
success = response.ok
if success:
return response.json()
return None
| import requests
import os
from .config import config
from .misc import canonicalize_hostname
def get_status(name):
name = canonicalize_hostname(name, user=None)
uri = os.path.join(config.lock_server, 'nodes', name, '')
response = requests.get(uri)
success = response.ok
if success:
return r... | Remove the 'user@' prefix before checking status | Remove the 'user@' prefix before checking status
Signed-off-by: Zack Cerza <f801c831581d4150a2793939287636221d62131e@inktank.com>
| Python | mit | ceph/teuthology,t-miyamae/teuthology,zhouyuan/teuthology,caibo2014/teuthology,tchaikov/teuthology,dmick/teuthology,robbat2/teuthology,dreamhost/teuthology,ivotron/teuthology,ivotron/teuthology,SUSE/teuthology,robbat2/teuthology,michaelsevilla/teuthology,tchaikov/teuthology,michaelsevilla/teuthology,ceph/teuthology,drea... | ---
+++
@@ -1,9 +1,11 @@
import requests
import os
from .config import config
+from .misc import canonicalize_hostname
def get_status(name):
+ name = canonicalize_hostname(name, user=None)
uri = os.path.join(config.lock_server, 'nodes', name, '')
response = requests.get(uri)
success = respon... |
e1acfc8a05f1a131dc4b146837e007efa58a2ebf | theano/learning_rates.py | theano/learning_rates.py | """ Classes that simplify learning rate modification. """
import theano
import theano.tensor as TT
class _LearningRate(object):
""" Suplerclass for learning rates. """
def __init__(self, initial_rate):
"""
Args:
initial_rate: Initial value of the learning rate. """
self._rate = initial_rate
... | """ Classes that simplify learning rate modification. """
import theano
import theano.tensor as TT
class _LearningRate(object):
""" Suplerclass for learning rates. """
def __init__(self, initial_rate):
"""
Args:
initial_rate: Initial value of the learning rate. """
self._rate = initial_rate
... | Make fixed learning rates not crash. | Make fixed learning rates not crash.
There was a slight bug in this code before, which I fixed.
| Python | mit | djpetti/rpinets,djpetti/rpinets | ---
+++
@@ -20,7 +20,7 @@
cycle: The symbolic global step.
Returns:
The learning rate to use for this cycle. """
- return self.__rate
+ return TT.as_tensor_variable(self._rate, name="lr")
class Fixed(_LearningRate):
""" The simplest type of learning rate. It is just a fixed value. """ |
e469ae00a815b25ab7d0e45c7f8076c56ae834b4 | test/__init__.py | test/__init__.py |
import unittest
class TestCase(unittest.TestCase):
"""
Parent TestCase to use for all tests.
"""
pass
|
import unittest
class TestCase(unittest.TestCase):
"""
Parent TestCase to use for all tests.
"""
pass
def assertGreaterEqual(self, first, second, msg=None):
"""
Test that first is respectively >= than second
depending on the method name. If not, the test will fail.
... | Implement unittest.TestCase.assertGreaterEqual for pythons less than 2.7 | Implement unittest.TestCase.assertGreaterEqual for pythons less than 2.7
| Python | mit | pombredanne/jsonstats,pombredanne/jsonstats,RHInception/jsonstats,RHInception/jsonstats | ---
+++
@@ -7,3 +7,13 @@
Parent TestCase to use for all tests.
"""
pass
+
+ def assertGreaterEqual(self, first, second, msg=None):
+ """
+ Test that first is respectively >= than second
+ depending on the method name. If not, the test will fail.
+ """
+ if first >=... |
5fa20295eadf01e4567d89713e406ce82b738cf5 | ephemeral-cluster.py | ephemeral-cluster.py | #!/usr/bin/env python
import subprocess
import sys
import uuid
usage = """\
Run a command using a temporary docker-compose cluster, removing all containers \
and associated volumes after command completion (regardless of success or \
failure.)
Generally, this would be used with the ``run`` command to provide a clean... | #!/usr/bin/env python
import itertools
import subprocess
import sys
import uuid
def get_images_for_project(project):
"""
Returns a set of image names associated with a project label.
"""
p = subprocess.Popen(['docker', 'images'], stdout=subprocess.PIPE)
images = set()
while p.returncode is Non... | Clean up built images for ephemeral cluster. | Clean up built images for ephemeral cluster.
Reviewers: tail, pi, jeff
Reviewed By: jeff
Differential Revision: http://phabricator.local.disqus.net/D19797
| Python | apache-2.0 | fuziontech/pgshovel,fuziontech/pgshovel,disqus/pgshovel,disqus/pgshovel,fuziontech/pgshovel | ---
+++
@@ -1,7 +1,27 @@
#!/usr/bin/env python
+import itertools
import subprocess
import sys
import uuid
+
+
+def get_images_for_project(project):
+ """
+ Returns a set of image names associated with a project label.
+ """
+ p = subprocess.Popen(['docker', 'images'], stdout=subprocess.PIPE)
+ imag... |
3e2baaed603ef9d904926049414bf51b48898776 | trex/serializers.py | trex/serializers.py | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework.serializers import (
HyperlinkedModelSerializer, HyperlinkedIdentityField,
)
from trex.models.project import Project, Entry, Tag
class ProjectSerializer... | # -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
from rest_framework.serializers import (
HyperlinkedModelSerializer, HyperlinkedIdentityField,
)
from trex.models.project import Project, Entry, Tag
class ProjectSerializer... | Add a TagDetailSerializer for returning more details of a Tag then id and name | Add a TagDetailSerializer for returning more details of a Tag then id and name
| Python | mit | bjoernricks/trex,bjoernricks/trex | ---
+++
@@ -51,3 +51,10 @@
model = Entry
fields = ("url", "id", "date", "duration", "description", "state",
"user_abbr", "user", "created", "project", "tags")
+
+
+class TagDetailSerializer(HyperlinkedModelSerializer):
+
+ class Meta:
+ model = Tag
+ fields = ("id... |
1c16c8e98845550b19f6c75db5253805f656c636 | http_requests.py | http_requests.py | import sublime, sublime_plugin
import requests
from requests import delete, get, head, options, patch, post, put
class RequestCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.import_variables()
request = self.view.substr(self.view.line(self.view.sel()[0]))
response = eval(r... | import sublime, sublime_plugin
import requests
from requests import delete, get, head, options, patch, post, put
class RequestCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.import_variables()
selections = self.get_selections()
for s in selections:
response = e... | Allow multiple requests to be made at once by iterating over selections | Allow multiple requests to be made at once by iterating over selections
| Python | mit | kylebebak/Requester,kylebebak/Requester | ---
+++
@@ -8,10 +8,22 @@
def run(self, edit):
self.import_variables()
- request = self.view.substr(self.view.line(self.view.sel()[0]))
- response = eval(request)
- print(response.text)
+ selections = self.get_selections()
+ for s in selections:
+ response... |
8d99b27125af58aacbb9556c68774bdaf27fdda5 | tests/helpers.py | tests/helpers.py |
import asana
import requests
import responses
import unittest
import json
from six import next
from responses import GET, PUT, POST, DELETE
# Define JSON primitives so we can just copy in JSON:
false = False
true = True
null = None
# From https://github.com/dropbox/responses/issues/31#issuecomment-63165210
from ins... | import json
import unittest
import asana
import requests
import responses
from six import add_metaclass, next
from responses import GET, PUT, POST, DELETE
# Define JSON primitives so we can just copy in JSON:
false = False
true = True
null = None
def create_decorating_metaclass(decorators, prefix='test_'):
clas... | Fix broken unittests in Python 2.7. | Fix broken unittests in Python 2.7.
Originally all test classes were decorated by going over the class via
inspection - however, this doesn't work in Python 2.7 because the
methods that are returned from getmembers are all unbound (in Python 3+,
this is fixed as all methods are just function objects).
Now this uses a... | Python | mit | asana/python-asana,Asana/python-asana,asana/python-asana | ---
+++
@@ -1,11 +1,10 @@
+import json
+import unittest
import asana
import requests
import responses
-import unittest
-import json
-
-from six import next
+from six import add_metaclass, next
from responses import GET, PUT, POST, DELETE
# Define JSON primitives so we can just copy in JSON:
@@ -13,25 +12,31 ... |
53234eb1ab0bafe49b8e198336d7958fed3e3f61 | awx/main/managers.py | awx/main/managers.py | # Copyright (c) 2014 Ansible, Inc.
# All Rights Reserved.
from django.conf import settings
from django.db import models
from django.utils.functional import cached_property
class InstanceManager(models.Manager):
"""A custom manager class for the Instance model.
Provides "table-level" methods including gettin... | # Copyright (c) 2014 Ansible, Inc.
# All Rights Reserved.
import sys
from django.conf import settings
from django.db import models
from django.utils.functional import cached_property
class InstanceManager(models.Manager):
"""A custom manager class for the Instance model.
Provides "table-level" methods incl... | Return stub records in testing. | Return stub records in testing.
| Python | apache-2.0 | snahelou/awx,wwitzel3/awx,snahelou/awx,wwitzel3/awx,snahelou/awx,wwitzel3/awx,snahelou/awx,wwitzel3/awx | ---
+++
@@ -1,5 +1,7 @@
# Copyright (c) 2014 Ansible, Inc.
# All Rights Reserved.
+
+import sys
from django.conf import settings
from django.db import models
@@ -14,16 +16,34 @@
"""
def me(self):
"""Return the currently active instance."""
+ # If we are running unit tests, return a stu... |
a0791aeead7eb77ddf1553a3392f1302a1a5acbb | Instanssi/ext_blog/views.py | Instanssi/ext_blog/views.py | # -*- coding: utf-8 -*-
from django.contrib.syndication.views import Feed, FeedDoesNotExist
from django.shortcuts import get_object_or_404
from Instanssi.ext_blog.models import BlogEntry
from Instanssi.kompomaatti.models import Event
class blog_feed(Feed):
title = "Instanssi.org Blogi"
link = "http://instanss... | # -*- coding: utf-8 -*-
from django.contrib.syndication.views import Feed, FeedDoesNotExist
from django.shortcuts import get_object_or_404
from Instanssi.ext_blog.models import BlogEntry
from Instanssi.kompomaatti.models import Event
class blog_feed(Feed):
title = "Instanssi.org Blogi"
link = "http://instanss... | Sort by date, remove post limit. | ext_blog: Sort by date, remove post limit.
| Python | mit | Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org | ---
+++
@@ -15,7 +15,7 @@
def items(self, obj):
entries = []
- for entry in BlogEntry.objects.filter(event=obj, public=True).order_by('-date')[:10]:
+ for entry in BlogEntry.objects.filter(event=obj, public=True).order_by('date'):
entry.event_url = obj.mainurl
e... |
b860372a9e874e8bc06efc9711f7b58591300e81 | tohu/__init__.py | tohu/__init__.py | from distutils.version import StrictVersion
from platform import python_version
min_supported_python_version = '3.6'
if StrictVersion(python_version()) < StrictVersion(min_supported_python_version):
error_msg = (
"Tohu requires Python {min_supported_python_version} or greater to run "
"(currently ... | from distutils.version import LooseVersion
from platform import python_version
min_supported_python_version = '3.6'
if LooseVersion(python_version()) < LooseVersion(min_supported_python_version):
error_msg = (
"Tohu requires Python {min_supported_python_version} or greater to run "
"(currently run... | Use LooseVersion in version check (to avoid errors for e.g. '3.7.2+') | Use LooseVersion in version check (to avoid errors for e.g. '3.7.2+')
| Python | mit | maxalbert/tohu | ---
+++
@@ -1,9 +1,9 @@
-from distutils.version import StrictVersion
+from distutils.version import LooseVersion
from platform import python_version
min_supported_python_version = '3.6'
-if StrictVersion(python_version()) < StrictVersion(min_supported_python_version):
+if LooseVersion(python_version()) < LooseV... |
715dcb62966b5c80544ed9eee79a6c69d3b9d927 | blog/posts/models.py | blog/posts/models.py | from django.db import models
class Post(models.Model):
body = models.TextField()
title = models.CharField(max_length=50)
display_title = models.CharField(max_length=50)
publication_date = models.DateTimeField(auto_now_add=True)
def __unicode__(self):
return self.title
class Comment(models... | from django.db import models
class Post(models.Model):
body = models.TextField()
title = models.CharField(max_length=50)
publication_date = models.DateTimeField(auto_now_add=True)
def __unicode__(self):
return self.title
class Comment(models.Model):
text = models.TextField()
author = ... | Remove display_title field from Post model. | Remove display_title field from Post model.
It wasn't being used anyway.
| Python | mit | Lukasa/minimalog | ---
+++
@@ -3,7 +3,6 @@
class Post(models.Model):
body = models.TextField()
title = models.CharField(max_length=50)
- display_title = models.CharField(max_length=50)
publication_date = models.DateTimeField(auto_now_add=True)
def __unicode__(self): |
d8b4acd0617dc93646e177ac56b0205be1b7ff88 | seaweb_project/seaweb_project/urls.py | seaweb_project/seaweb_project/urls.py | from django.conf.urls import patterns, url, include
from django.views.generic.base import TemplateView
from django.contrib.auth.decorators import login_required
from django.contrib.auth import views as auth_views
from django.contrib import admin
admin.autodiscover()
from rest_framework.routers import DefaultRouter
fro... | from django.conf.urls import patterns, url, include
from django.views.generic.base import TemplateView
from django.contrib.auth.decorators import login_required
from django.contrib.auth import views as auth_views
from django.contrib import admin
admin.autodiscover()
from rest_framework.routers import DefaultRouter
fro... | Disable indexing via robots.txt url. | Disable indexing via robots.txt url. | Python | mit | grollins/sea-web-django | ---
+++
@@ -22,3 +22,8 @@
urlpatterns += patterns('backend.views',
url(r'^admin/', include(admin.site.urls))
)
+
+urlpatterns = patterns('',
+ (r'^robots\.txt$',
+ lambda r: HttpResponse("User-agent: *\nDisallow: /", mimetype="text/plain"))
+) |
88a83ebcfe5a3841db4cf75985a2365df87395f8 | tests/test_create_elb.py | tests/test_create_elb.py | """Test ELB creation functions."""
from foremast.elb.create_elb import SpinnakerELB
def test_splay():
"""Splay should split Health Checks properly."""
health = SpinnakerELB.splay_health('HTTP:80/test')
assert health.path == '/test'
assert health.port == '80'
assert health.proto == 'HTTP'
asser... | """Test ELB creation functions."""
from foremast.elb.splay_health import splay_health
def test_splay():
"""Splay should split Health Checks properly."""
health = splay_health('HTTP:80/test')
assert health.path == '/test'
assert health.port == '80'
assert health.proto == 'HTTP'
assert health.ta... | Update splay_health() test to new module | tests: Update splay_health() test to new module
| Python | apache-2.0 | gogoair/foremast,gogoair/foremast | ---
+++
@@ -1,28 +1,28 @@
"""Test ELB creation functions."""
-from foremast.elb.create_elb import SpinnakerELB
+from foremast.elb.splay_health import splay_health
def test_splay():
"""Splay should split Health Checks properly."""
- health = SpinnakerELB.splay_health('HTTP:80/test')
+ health = splay_h... |
c9e11c04bd5981f810b47a659f0777d1976cb01f | vaux/storage/metadata.py | vaux/storage/metadata.py | import rethinkdb as r
class MetaEngine(object):
def __init__(self, hostname, port, db, table):
self.rdb = r.connect(host=hostname, port=port, db=db, timeout=20)
self.table = table
def get_all(self):
for item in r.table(self.table).run(self.rdb):
yield item
def put(sel... | import rethinkdb as r
class MetaEngine(object):
def __init__(self, hostname, port, db, table):
self.rdb = r.connect(host=hostname, port=port, timeout=20)
try:
self.rdb.db_create(db).run()
except Exception, e:
pass
self.rdb.close()
self.rdb = r.... | Create the database and table if they don't exist | Create the database and table if they don't exist
I think... :/
| Python | mit | VauxIo/core | ---
+++
@@ -3,7 +3,28 @@
class MetaEngine(object):
def __init__(self, hostname, port, db, table):
+ self.rdb = r.connect(host=hostname, port=port, timeout=20)
+
+ try:
+
+ self.rdb.db_create(db).run()
+
+ except Exception, e:
+
+ pass
+
+ self.rdb.close()
+
... |
82aca6b352de3133f1fba454d82e1a20f3da2436 | src/auditlog_tests/test_settings.py | src/auditlog_tests/test_settings.py | """
Settings file for the Auditlog test suite.
"""
SECRET_KEY = 'test'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'auditlog',
'auditlog_tests',
]
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'auditlog.middleware.AuditlogMiddleware',
)
DATA... | """
Settings file for the Auditlog test suite.
"""
SECRET_KEY = 'test'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'auditlog',
'auditlog_tests',
]
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'auditlog.middleware.AuditlogMiddleware',
)
DATA... | Make Django 1.9+ accept the settings file | Make Django 1.9+ accept the settings file
| Python | mit | Zmeylol/auditlog,jjkester/django-auditlog,kbussell/django-auditlog,chris-griffin/django-auditlog | ---
+++
@@ -22,3 +22,5 @@
'NAME': 'auditlog_tests.db',
}
}
+
+ROOT_URLCONF = [] |
3d2a67ab4b46bf389376544fb21341163b57e8fa | mptt/signals.py | mptt/signals.py | import django.dispatch
# Behaves like Djangos normal pre-/post_save signals signals with the
# added arguments ``target`` and ``position`` that matches those of
# ``move_to``.
# If the signal is called from ``save`` it'll not be pass position.
node_moved = django.dispatch.Signal(providing_args=[
'instance',
't... | from django.db.models.signals import ModelSignal as Signal
# Behaves like Djangos normal pre-/post_save signals signals with the
# added arguments ``target`` and ``position`` that matches those of
# ``move_to``.
# If the signal is called from ``save`` it'll not be pass position.
node_moved = Signal(providing_args=[
... | Use ModelSignal over plain Signal | Use ModelSignal over plain Signal | Python | mit | matthiask/django-mptt,matthiask/django-mptt,matthiask/django-mptt,matthiask/django-mptt | ---
+++
@@ -1,10 +1,10 @@
-import django.dispatch
+from django.db.models.signals import ModelSignal as Signal
# Behaves like Djangos normal pre-/post_save signals signals with the
# added arguments ``target`` and ``position`` that matches those of
# ``move_to``.
# If the signal is called from ``save`` it'll not... |
d054180fe1ff5ff7f4a0bc5b62f8dfcbb15a9c09 | winthrop/people/admin.py | winthrop/people/admin.py | from django.contrib import admin
from .models import Person, Residence, RelationshipType, Relationship
admin.site.register(Person)
admin.site.register(Residence)
admin.site.register(RelationshipType)
admin.site.register(Relationship)
| from django.contrib import admin
from .models import Person, Residence, RelationshipType, Relationship
class ResidenceInline(admin.TabularInline):
'''Inline class for Residence'''
model = Residence
class PersonAdmin(admin.ModelAdmin):
inlines = [
ResidenceInline
]
admin.site.register(Pers... | Add residence as an inline to person/people | Add residence as an inline to person/people
| Python | apache-2.0 | Princeton-CDH/winthrop-django,Princeton-CDH/winthrop-django,Princeton-CDH/winthrop-django | ---
+++
@@ -2,8 +2,18 @@
from .models import Person, Residence, RelationshipType, Relationship
-admin.site.register(Person)
-admin.site.register(Residence)
+
+class ResidenceInline(admin.TabularInline):
+ '''Inline class for Residence'''
+ model = Residence
+
+
+class PersonAdmin(admin.ModelAdmin):
+ in... |
26bac2e3f01ed6b7b631f9dec8d2c3156e9ce01a | blog/blog/urls.py | blog/blog/urls.py | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('posts.views',
# Examples:
url(r'^$', 'home', name='blog_home'),
url(r'^blog/(?P<post_year>\d{4})/(?P<post_month>\d{2})/(... | from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('posts.views',
# Examples:
url(r'^$', 'home', name='blog_home'),
url(r'^(?P<post_year>\d{4})/(?P<post_month>\d{2})/(?P<po... | Remove '/blog/' from the post url. | Remove '/blog/' from the post url.
Was pretty unnecessary.
| Python | mit | Lukasa/minimalog | ---
+++
@@ -7,7 +7,7 @@
urlpatterns = patterns('posts.views',
# Examples:
url(r'^$', 'home', name='blog_home'),
- url(r'^blog/(?P<post_year>\d{4})/(?P<post_month>\d{2})/(?P<post_title>\w+)/$',
+ url(r'^(?P<post_year>\d{4})/(?P<post_month>\d{2})/(?P<post_title>\w+)/$',
'post',
name='... |
fc6202425e0c855dc29980904949b60c0ac48bbf | preparation/tools/build_assets.py | preparation/tools/build_assets.py | from copy import copy
from preparation.resources.Resource import names_registered, resource_by_name
from hb_res.storage import get_storage
def rebuild_from_resource(resource_name: str):
resource = resource_by_name(resource_name)()
with get_storage(resource_name.replace('Resource', '')) as out_storage:
... | from copy import copy
from preparation.resources.Resource import names_registered, resource_by_name
from hb_res.storage import get_storage
def rebuild_from_resource(resource_name: str):
resource = resource_by_name(resource_name)()
trunk = resource_name.replace('Resource', '')
with get_storage(trunk) as o... | Add start/finish debug info while generating | Add start/finish debug info while generating
| Python | mit | hatbot-team/hatbot_resources | ---
+++
@@ -6,7 +6,9 @@
def rebuild_from_resource(resource_name: str):
resource = resource_by_name(resource_name)()
- with get_storage(resource_name.replace('Resource', '')) as out_storage:
+ trunk = resource_name.replace('Resource', '')
+ with get_storage(trunk) as out_storage:
+ print("Start... |
248b43bdfe0ad42772bf76f2e64b1624460ce494 | deployer/__init__.py | deployer/__init__.py | from __future__ import absolute_import
import deployer.logger
from celery.signals import setup_logging
__version__ = '0.3.8'
__author__ = 'sukrit'
deployer.logger.init_logging()
setup_logging.connect(deployer.logger.init_celery_logging)
| from __future__ import absolute_import
import deployer.logger
from celery.signals import setup_logging
__version__ = '0.3.9'
__author__ = 'sukrit'
deployer.logger.init_logging()
setup_logging.connect(deployer.logger.init_celery_logging)
| Prepare for next dev version | Prepare for next dev version | Python | mit | totem/cluster-deployer,totem/cluster-deployer,totem/cluster-deployer | ---
+++
@@ -3,7 +3,7 @@
from celery.signals import setup_logging
-__version__ = '0.3.8'
+__version__ = '0.3.9'
__author__ = 'sukrit'
deployer.logger.init_logging() |
52fa13e103b77365acc9769f205d6b92af94b738 | lambda/lambda.py | lambda/lambda.py | from __future__ import print_function
from ses import email_message_from_s3_bucket, event_msg_is_to_command, recipient_destination_overlap
from cnc import handle_command
import boto3
ses = boto3.client('ses')
from config import email_bucket
from listcfg import ListConfiguration
def lambda_handler(event, context):... | from __future__ import print_function
from ses import email_message_from_s3_bucket, event_msg_is_to_command, msg_get_header, recipient_destination_overlap
from cnc import handle_command
import boto3
ses = boto3.client('ses')
from config import email_bucket
from listcfg import ListConfiguration
def lambda_handler(... | Remove any existing DKIM signature and set the Sender: header before sending. | Remove any existing DKIM signature and set the Sender: header before sending.
| Python | mit | ilg/LambdaMLM | ---
+++
@@ -1,6 +1,6 @@
from __future__ import print_function
-from ses import email_message_from_s3_bucket, event_msg_is_to_command, recipient_destination_overlap
+from ses import email_message_from_s3_bucket, event_msg_is_to_command, msg_get_header, recipient_destination_overlap
from cnc import handle_command
... |
40688413e59aaabd4a92dba4d2f402fb42fee143 | 1-multiples-of-3-and-5.py | 1-multiples-of-3-and-5.py | from itertools import chain
def threes_and_fives_gen(num=1000):
for i in range(num):
if i % 3 == 0 or i % 5 == 0:
yield i
def threes_and_fives_fun(n):
return set(chain(range(3, n+1, 3), range(5, n+1, 5)))
def solve(n):
return sum(
filter(lambda x: x%3==0 or x%5==0,
... | from itertools import chain
def threes_and_fives_gen(num=1000):
for i in range(num):
if i % 3 == 0 or i % 5 == 0:
yield i
def threes_and_fives_fun(n):
return set(chain(range(3, n+1, 3), range(5, n+1, 5)))
def solve(n):
return sum(
filter(lambda x: x%3==0 or x%5==0,
... | Add gen exp solution to 1 | Add gen exp solution to 1
| Python | mit | dawran6/project-euler | ---
+++
@@ -15,5 +15,12 @@
)
)
+def solve_2(n):
+ return sum(
+ x
+ for x in range(1, n)
+ if x%3==0 or x%5==0
+ )
+
if __name__ == '__main__':
- print(sum(three_and_fives_gen(10000000)))
+ print(solve_2(1000000)) |
ac8e58e1430ca7418f64bb547e3513032d5b49e8 | tests/lexer_test.py | tests/lexer_test.py | from whitepy.lexerconstants import *
import whitepy.lexer as lexer
import unittest
class TestLexer(unittest.TestCase):
def _get_lexer(self, line):
return lexer.Lexer(line=line)
def _valid_ws(self):
return self._get_lexer(" \t\n")
def test_get_int(self):
lexer = self._valid_ws(... | from nose.tools import *
from whitepy.lexerconstants import *
import unittest
import whitepy.lexer as lexer
class TestLexer(unittest.TestCase):
def _get_lexer(self, line):
return lexer.Lexer(line=line)
def _sample_ws(self, ws_type):
ws_samples = {
'valid': " \t\n",
... | Add test for invalid integer | Add test for invalid integer
A valid integer in Whitesapce ends with '\n', if an invalid integer is found the
code should raise a IntError exception.
As part of this, I have renamed `_valid_ws()` to `_sample_ws()`, which now takes
a argument for the type of whitespace needed.
| Python | apache-2.0 | yasn77/whitepy | ---
+++
@@ -1,6 +1,7 @@
+from nose.tools import *
from whitepy.lexerconstants import *
+import unittest
import whitepy.lexer as lexer
-import unittest
class TestLexer(unittest.TestCase):
@@ -8,22 +9,31 @@
def _get_lexer(self, line):
return lexer.Lexer(line=line)
- def _valid_ws(self):
- ... |
53878700a4da22e80114ef67a4aee340846abf91 | us_ignite/search/urls.py | us_ignite/search/urls.py | from django.conf.urls import patterns, url
urlpatterns = patterns(
'us_ignite.search.views',
url(r'apps/', 'search_apps', name='search_apps'),
url(r'events/', 'search_events', name='search_events'),
url(r'hubs/', 'search_hubs', name='search_hubs'),
url(r'orgs/', 'search_organizations', name='searc... | from django.conf.urls import patterns, url
urlpatterns = patterns(
'us_ignite.search.views',
url(r'^apps/$', 'search_apps', name='search_apps'),
url(r'^events/$', 'search_events', name='search_events'),
url(r'^hubs/$', 'search_hubs', name='search_hubs'),
url(r'^orgs/$', 'search_organizations', nam... | Fix broad regex for the ``search`` URLs. | Fix broad regex for the ``search`` URLs.
| Python | bsd-3-clause | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite | ---
+++
@@ -3,9 +3,9 @@
urlpatterns = patterns(
'us_ignite.search.views',
- url(r'apps/', 'search_apps', name='search_apps'),
- url(r'events/', 'search_events', name='search_events'),
- url(r'hubs/', 'search_hubs', name='search_hubs'),
- url(r'orgs/', 'search_organizations', name='search_organizat... |
1d8fc0e63e5527b6f65da4899b432dcdfa243557 | ava/text_to_speech/__init__.py | ava/text_to_speech/__init__.py | import time
import os
from tempfile import NamedTemporaryFile
from sys import platform as _platform
from gtts import gTTS
from .playsound import playsound
from ..queues import QueueTtS
from ..components import _BaseComponent
class TextToSpeech(_BaseComponent):
def __init__(self):
super().__init__()
... | import time
import os
from tempfile import NamedTemporaryFile
from sys import platform as _platform
from gtts import gTTS
from .playsound import playsound
from ..queues import QueueTtS
from ..components import _BaseComponent
class TextToSpeech(_BaseComponent):
def __init__(self):
super().__init__()
... | Allow user to use ava without TTS on Linux | Allow user to use ava without TTS on Linux
| Python | mit | ava-project/AVA | ---
+++
@@ -21,7 +21,7 @@
sentence = self.queue_tts.get()
print('To say out loud : {}'.format(sentence))
tts = gTTS(text=sentence, lang='en')
- if _platform == "linux" or _platform == "linux2" or _platform == "darwin":
+ if _platform == "darwin":
with NamedTempora... |
f6194866a98dccdb8e1c1a1dfee40b11034461ba | src/nyct-json.py | src/nyct-json.py | #!/usr/bin/env python
import json
import settings
import os
import urllib2
from proto import gtfs_realtime_pb2
message = gtfs_realtime_pb2.FeedMessage()
url = urllib2.urlopen('http://datamine.mta.info/mta_esi.php?key={0}&feed_id={1}'.format(settings.MTA_API_KEY, settings.MTA_FEED_ID))
message.ParseFromString(url.read... | #!/usr/bin/env python
import json
import settings
import os
import urllib2
from proto import gtfs_realtime_pb2
message = gtfs_realtime_pb2.FeedMessage()
url = urllib2.urlopen('http://datamine.mta.info/mta_esi.php?key={0}&feed_id={1}'.format(settings.MTA_API_KEY, settings.MTA_FEED_ID))
message.ParseFromString(url.read... | Use a function to write. | Use a function to write.
| Python | isc | natestedman/nyct-json,natestedman/nyct-json | ---
+++
@@ -25,11 +25,14 @@
temp = os.path.join(settings.JSON_OUT_DIR, 'temp')
-for stop_id, departures in stops.items():
+def write(filename, json):
file = open(temp, 'w+')
- file.write(json.dumps(sorted(departures)))
+ file.write(json.dumps(json))
file.flush()
os.fsync(file)
file.clos... |
e31192cf4989c1cef481eb92d6a91ae99dd8e5f5 | src/pip/_internal/distributions/__init__.py | src/pip/_internal/distributions/__init__.py | from pip._internal.distributions.source import SourceDistribution
from pip._internal.distributions.wheel import WheelDistribution
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from pip._internal.distributions.base import AbstractDistribution
from pip._internal.req.req_instal... | from pip._internal.distributions.source import SourceDistribution
from pip._internal.distributions.wheel import WheelDistribution
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from pip._internal.distributions.base import AbstractDistribution
from pip._internal.req.req_instal... | Simplify conditional for choosing WheelDistribution | Simplify conditional for choosing WheelDistribution
| Python | mit | xavfernandez/pip,pradyunsg/pip,rouge8/pip,rouge8/pip,sbidoul/pip,sbidoul/pip,pypa/pip,pfmoore/pip,pradyunsg/pip,xavfernandez/pip,pfmoore/pip,xavfernandez/pip,pypa/pip,rouge8/pip | ---
+++
@@ -16,7 +16,7 @@
if install_req.editable:
return SourceDistribution(install_req)
- if install_req.link and install_req.is_wheel:
+ if install_req.is_wheel:
return WheelDistribution(install_req)
# Otherwise, a SourceDistribution |
26579d307d44f00fe71853fa6c13957018fe5c0f | capnp/__init__.py | capnp/__init__.py | """A python library wrapping the Cap'n Proto C++ library
Example Usage::
import capnp
addressbook = capnp.load('addressbook.capnp')
# Building
addresses = addressbook.AddressBook.newMessage()
people = addresses.init('people', 1)
alice = people[0]
alice.id = 123
alice.name = 'Ali... | """A python library wrapping the Cap'n Proto C++ library
Example Usage::
import capnp
addressbook = capnp.load('addressbook.capnp')
# Building
addresses = addressbook.AddressBook.newMessage()
people = addresses.init('people', 1)
alice = people[0]
alice.id = 123
alice.name = 'Ali... | Enable import hook by default | Enable import hook by default
| Python | bsd-2-clause | rcrowder/pycapnp,SymbiFlow/pycapnp,jparyani/pycapnp,SymbiFlow/pycapnp,SymbiFlow/pycapnp,tempbottle/pycapnp,tempbottle/pycapnp,jparyani/pycapnp,rcrowder/pycapnp,SymbiFlow/pycapnp,jparyani/pycapnp,jparyani/pycapnp,tempbottle/pycapnp,rcrowder/pycapnp,rcrowder/pycapnp,tempbottle/pycapnp | ---
+++
@@ -35,3 +35,5 @@
from .capnp import *
from .capnp import _DynamicStructReader, _DynamicStructBuilder, _DynamicResizableListBuilder, _DynamicListReader, _DynamicListBuilder, _DynamicOrphan, _DynamicResizableListBuilder, _MallocMessageBuilder, _PackedFdMessageReader, _StreamFdMessageReader, _write_message_to... |
003c7f9b7c6d35e176a9a4d5c56b61b0b4f96281 | webapp/tests/__init__.py | webapp/tests/__init__.py | # -*- coding: utf-8 -*-
from unittest import TestCase
from byceps.application import create_app
from byceps.blueprints.brand.models import Brand
from byceps.blueprints.party.models import Party
from byceps.database import db
class AbstractAppTestCase(TestCase):
def setUp(self):
self.app = create_app('t... | # -*- coding: utf-8 -*-
from unittest import TestCase
from byceps.application import create_app
from byceps.blueprints.brand.models import Brand
from byceps.blueprints.party.models import Party
from byceps.database import db
class AbstractAppTestCase(TestCase):
def setUp(self, env='test'):
self.app = c... | Allow use of a custom environment for tests. | Allow use of a custom environment for tests.
| Python | bsd-3-clause | m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps | ---
+++
@@ -10,8 +10,8 @@
class AbstractAppTestCase(TestCase):
- def setUp(self):
- self.app = create_app('test', initialize=False)
+ def setUp(self, env='test'):
+ self.app = create_app(env, initialize=False)
self.db = db
db.app = self.app |
685365af5126c6e83db468eef24b008fc1526462 | tools/game_utils.py | tools/game_utils.py | import scipy.misc
import scipy.special
def get_num_hole_card_combinations(game):
num_players = game.get_num_players()
num_hole_cards = game.get_num_hole_cards()
num_cards = game.get_num_suits() * game.get_num_ranks()
num_total_hole_cards = num_players * num_hole_cards
return scipy.misc.comb(num_ca... | import numpy as np
import scipy.misc
import scipy.special
from tools.walk_tree import walk_tree
from tools.game_tree.nodes import ActionNode
def get_num_hole_card_combinations(game):
num_players = game.get_num_players()
num_hole_cards = game.get_num_hole_cards()
num_cards = game.get_num_suits() * game.ge... | Add method to verify that all strategy probabilities add to 1 | Add method to verify that all strategy probabilities add to 1
| Python | mit | JakubPetriska/poker-cfr,JakubPetriska/poker-cfr | ---
+++
@@ -1,5 +1,9 @@
+import numpy as np
import scipy.misc
import scipy.special
+
+from tools.walk_tree import walk_tree
+from tools.game_tree.nodes import ActionNode
def get_num_hole_card_combinations(game):
@@ -9,3 +13,15 @@
num_total_hole_cards = num_players * num_hole_cards
return scipy.misc.c... |
4368567e44c144e85fa9fcdb72f2648c13eb8158 | rest_framework_jsonp/renderers.py | rest_framework_jsonp/renderers.py | """
Provides JSONP rendering support.
"""
from __future__ import unicode_literals
from rest_framework.renderers import JSONRenderer
class JSONPRenderer(JSONRenderer):
"""
Renderer which serializes to json,
wrapping the json output in a callback function.
"""
media_type = 'application/javascript'... | """
Provides JSONP rendering support.
"""
from __future__ import unicode_literals
from rest_framework.renderers import JSONRenderer
class JSONPRenderer(JSONRenderer):
"""
Renderer which serializes to json,
wrapping the json output in a callback function.
"""
media_type = 'application/javascript'... | Update for compat w/ djangorestframework 3.2 | Update for compat w/ djangorestframework 3.2
Change request.QUERY_PARAMS to request.query_params | Python | isc | baxrob/django-rest-framework-jsonp | ---
+++
@@ -23,7 +23,7 @@
Determine the name of the callback to wrap around the json output.
"""
request = renderer_context.get('request', None)
- params = request and request.QUERY_PARAMS or {}
+ params = request and request.query_params or {}
return params.get(self.... |
d095277e1d54da6b9fcef7c5a79e86dc3f759e81 | word-count/word_count.py | word-count/word_count.py | def word_count(s):
words = strip_punc(s.lower()).split()
return {word: words.count(word) for word in set(words)}
def strip_punc(s):
return "".join(ch if ch.isalnum() else " " for ch in s)
| def word_count(s):
words = strip_punc(s).lower().split()
return {word: words.count(word) for word in set(words)}
def strip_punc(s):
return "".join(ch if ch.isalnum() else " " for ch in s)
| Move .lower() method call for readability | Move .lower() method call for readability
| Python | agpl-3.0 | CubicComet/exercism-python-solutions | ---
+++
@@ -1,5 +1,5 @@
def word_count(s):
- words = strip_punc(s.lower()).split()
+ words = strip_punc(s).lower().split()
return {word: words.count(word) for word in set(words)}
|
e9c32014093af49edc6a12b6db37b44a04d12892 | test/integration/ggrc_workflows/__init__.py | test/integration/ggrc_workflows/__init__.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
| # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
from integration.ggrc import TestCase
from integration.ggrc_workflows.generator i... | Add WorkflowTestCase to integration tests | Add WorkflowTestCase to integration tests
| Python | apache-2.0 | josthkko/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core,NejcZupec/ggrc-core,VinnieJohns/ggrc-core,edofic/ggrc-core,kr41/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,selahs... | ---
+++
@@ -2,3 +2,18 @@
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
+from integration.ggrc import TestCase
+from integration.ggrc_workflows.generator import WorkflowsGenerator
+from integration.ggrc... |
edae3aa862d6266ee1f2f96a2427e88af994f590 | Nested_list.py | Nested_list.py | '''
Given the names and grades for each student in a Physics class of N students,
store them in a nested list and print the name(s) of any student(s) having the second lowest grade.
Note: If there are multiple students with the same grade, order their names alphabetically and print
each name on a new line.
By HackerR... | '''
Given the names and grades for each student in a Physics class of N students,
store them in a nested list and print the name(s) of any student(s) having the second lowest grade.
Note: If there are multiple students with the same grade, order their names alphabetically and print
each name on a new line.
By HackerR... | Fix indentation for break keyword. | Fix indentation for break keyword.
| Python | unlicense | jasielserra/PythonDevs | ---
+++
@@ -23,12 +23,12 @@
for name,grade in students:
if grade > second_lowest_grade:
second_lowest_grade = grade
- break
+ break
names = []
for name, grade in sorted(students):
if grade == second_lowest_grade:
- names.append(name)
+ names.append(na... |
7d43df8d861b73ffb7c5e11531f3848a248bcc6a | trial_search_app.py | trial_search_app.py | from flask import Flask, render_template
from flask_bootstrap import Bootstrap
from flask_nav import Nav
from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms.validators import DataRequired
class SimpleSearchForm(FlaskForm):
nct_id = StringField('nct_id', validators=[DataRequired()])
impo... | from flask import Flask, render_template, redirect, url_for
from flask_bootstrap import Bootstrap
from flask_nav import Nav
from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms.validators import DataRequired
class SimpleSearchForm(FlaskForm):
nct_id = StringField('nct_id', validators=[Dat... | Correct redirect after search from submission | Correct redirect after search from submission
| Python | apache-2.0 | hniedner/ctrp_rest_client,hniedner/ctrp_rest_client,hniedner/ctrp_rest_client | ---
+++
@@ -1,4 +1,4 @@
-from flask import Flask, render_template
+from flask import Flask, render_template, redirect, url_for
from flask_bootstrap import Bootstrap
from flask_nav import Nav
@@ -29,7 +29,7 @@
return search_form()
-@app.route('/display_trial')
+@app.route('/display_trial/<string:nct_id>')... |
606cb3475e2e4220822f924d13881dfaefb51aa4 | teryt_tree/rest_framework_ext/viewsets.py | teryt_tree/rest_framework_ext/viewsets.py | import django_filters
from django.shortcuts import get_object_or_404
try:
from django_filters import rest_framework as filters
except ImportError: # Back-ward compatible for django-rest-framework<3.7
from rest_framework import filters
from rest_framework import viewsets
from teryt_tree.models import JednostkaA... | import django_filters
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext_lazy as _
try:
from django_filters import rest_framework as filters
except ImportError: # Back-ward compatible for django-rest-framework<3.7
from rest_framework import filters
from rest_framework... | Update JednostkaAdministracyjnaFilter for new django-filters | Update JednostkaAdministracyjnaFilter for new django-filters
| Python | bsd-3-clause | ad-m/django-teryt-tree | ---
+++
@@ -1,12 +1,15 @@
import django_filters
from django.shortcuts import get_object_or_404
+from django.utils.translation import ugettext_lazy as _
+
try:
from django_filters import rest_framework as filters
except ImportError: # Back-ward compatible for django-rest-framework<3.7
from rest_framewor... |
1090acb35ea4ce5c8d17db716539d3354feabc12 | nodeconductor/iaas/migrations/0038_securitygroup_state.py | nodeconductor/iaas/migrations/0038_securitygroup_state.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_fsm
class Migration(migrations.Migration):
dependencies = [
('iaas', '0037_init_security_groups_quotas'),
]
operations = [
migrations.AddField(
model_name='... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_fsm
def mark_security_groups_as_synced(apps, schema_editor):
SecurityGroup = apps.get_model('iaas', 'SecurityGroup')
SecurityGroup.objects.all().update(state=3)
class Migration(migrations.... | Mark all exist security groups as synced | Mark all exist security groups as synced
- itacloud-4843
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | ---
+++
@@ -3,6 +3,11 @@
from django.db import models, migrations
import django_fsm
+
+
+def mark_security_groups_as_synced(apps, schema_editor):
+ SecurityGroup = apps.get_model('iaas', 'SecurityGroup')
+ SecurityGroup.objects.all().update(state=3)
class Migration(migrations.Migration):
@@ -18,4 +23,5... |
3e6e485443a901660a461dbbc8b324bfe4c19c8f | tests/v5/conftest.py | tests/v5/conftest.py | import pytest
from .context import tohu
from tohu.v5.primitive_generators import *
EXEMPLAR_GENERATORS = [
Constant("quux"),
Boolean(p=0.3),
]
@pytest.fixture
def exemplar_generators():
"""
Return a list of generators which contains an example
for each type of generator supported by tohu.
"... | import pytest
from .context import tohu
from tohu.v5.primitive_generators import *
EXEMPLAR_PRIMITIVE_GENERATORS = [
Constant("quux"),
Boolean(p=0.3),
]
@pytest.fixture
def exemplar_generators():
"""
Return a list of generators which contains an example
for each type of generator supported by t... | Add fixture for exemplar primitive generators | Add fixture for exemplar primitive generators
| Python | mit | maxalbert/tohu | ---
+++
@@ -4,7 +4,7 @@
from tohu.v5.primitive_generators import *
-EXEMPLAR_GENERATORS = [
+EXEMPLAR_PRIMITIVE_GENERATORS = [
Constant("quux"),
Boolean(p=0.3),
]
@@ -16,4 +16,13 @@
Return a list of generators which contains an example
for each type of generator supported by tohu.
"""
-... |
5d44a67c1e416f8024bac1cbef5f3b3516ffd42a | cms_shiny/urls.py | cms_shiny/urls.py | from django.conf.urls import patterns, url
from cms_shiny.views import ShinyAppListView, ShinyAppDetailView
urlpatterns = patterns('',
url(r'^$', ShinyAppListView.as_view(), name='shiny_list'),
url(r'^(?P<slug>[^/]+)$', ShinyAppDetailView.as_view(), name='shiny_detail'),
)
| from django.conf.urls import patterns, url
from cms_shiny.views import ShinyAppListView, ShinyAppDetailView
urlpatterns = patterns('',
url(r'^$', ShinyAppListView.as_view(), name='shiny_list'),
url(r'^(?P<slug>[^/]+)/$', ShinyAppDetailView.as_view(), name='shiny_detail'),
)
| Append trailing slash to detail URL | Append trailing slash to detail URL
| Python | bsd-3-clause | mfcovington/djangocms-shiny-app,mfcovington/djangocms-shiny-app,mfcovington/djangocms-shiny-app | ---
+++
@@ -3,5 +3,5 @@
urlpatterns = patterns('',
url(r'^$', ShinyAppListView.as_view(), name='shiny_list'),
- url(r'^(?P<slug>[^/]+)$', ShinyAppDetailView.as_view(), name='shiny_detail'),
+ url(r'^(?P<slug>[^/]+)/$', ShinyAppDetailView.as_view(), name='shiny_detail'),
) |
0d302a13475b4e8ae073cad8c667019419a6a7e8 | vdb/zika_download.py | vdb/zika_download.py | import os,datetime
from download import download
from download import get_parser
class zika_download(download):
def __init__(self, **kwargs):
download.__init__(self, **kwargs)
if __name__=="__main__":
parser = get_parser()
args = parser.parse_args()
fasta_fields = ['strain', 'virus', 'accessio... | import os,datetime
from download import download
from download import get_parser
class zika_download(download):
def __init__(self, **kwargs):
download.__init__(self, **kwargs)
if __name__=="__main__":
parser = get_parser()
args = parser.parse_args()
fasta_fields = ['strain', 'virus', 'accessio... | Remove lat/long from zika download | Remove lat/long from zika download
| Python | agpl-3.0 | nextstrain/fauna,blab/nextstrain-db,blab/nextstrain-db,nextstrain/fauna | ---
+++
@@ -10,8 +10,7 @@
parser = get_parser()
args = parser.parse_args()
fasta_fields = ['strain', 'virus', 'accession', 'collection_date', 'region',
- 'country', 'division', 'location', 'source', 'locus',
- 'authors', 'latitude', 'longitude']
+ ... |
f946ca92b74bb945c3884fcfa3e515132ec56b06 | virtool/processes.py | virtool/processes.py | STEP_COUNTS = {
"import_reference": 0,
"setup_remote_reference": 0,
"update_remote_reference": 0,
"update_software": 0,
"install_hmms": 0
}
FIRST_STEPS = {
"import_reference": "load_file",
"setup_remote_reference": "",
"update_remote_reference": "",
"update_software": "",
"insta... | STEP_COUNTS = {
"import_reference": 0,
"setup_remote_reference": 0,
"update_remote_reference": 0,
"update_software": 0,
"install_hmms": 0
}
FIRST_STEPS = {
"import_reference": "load_file",
"setup_remote_reference": "",
"update_remote_reference": "",
"update_software": "",
"insta... | Add ProgressTracker class for tracking progress in long operations | Add ProgressTracker class for tracking progress in long operations
| Python | mit | virtool/virtool,igboyes/virtool,igboyes/virtool,virtool/virtool | ---
+++
@@ -18,3 +18,32 @@
"update_software",
"install_hmms"
]
+
+
+class ProgressTracker:
+
+ def __init__(self, total, db=None, increment=0.05, factor=1):
+ self.total = total
+ self.db = db
+ self.increment = increment
+ self.factor = factor
+
+ self.count = 0
+ ... |
63c0cd90ff9e9a721b175cdd4af8dc52ed6412ad | flatkeys/__init__.py | flatkeys/__init__.py | # -*- coding: UTF-8 -*-
__version__ = '0.1.0'
def flatkeys(d, sep="."):
"""
Flatten a dictionary: build a new dictionary from a given one where all
non-dict values are left untouched but nested ``dict``s are recursively
merged in the new one with their keys prefixed by their parent key.
>>> flat... | # -*- coding: UTF-8 -*-
import collections
__version__ = '0.1.0'
def flatkeys(d, sep="."):
"""
Flatten a dictionary: build a new dictionary from a given one where all
non-dict values are left untouched but nested ``dict``s are recursively
merged in the new one with their keys prefixed by their parent... | Use isinstance check so library can be used for more types | Use isinstance check so library can be used for more types | Python | mit | bfontaine/flatkeys | ---
+++
@@ -1,4 +1,5 @@
# -*- coding: UTF-8 -*-
+import collections
__version__ = '0.1.0'
@@ -25,7 +26,7 @@
prefix, d = dicts.pop()
for k, v in d.items():
k_s = str(k)
- if type(v) is dict:
+ if isinstance(v, collections.Mapping):
dicts.appen... |
df04444b3932f7481562dde62c7ae1f8ffb8bd7e | webapp/controllers/contact.py | webapp/controllers/contact.py | # -*- coding: utf-8 -*-
### required - do no delete
def user(): return dict(form=auth())
def download(): return response.download(request,db)
def call(): return service()
### end requires
def index():
return dict()
| # -*- coding: utf-8 -*-
from opentreewebapputil import (get_opentree_services_method_urls,
fetch_current_TNRS_context_names)
### required - do no delete
def user(): return dict(form=auth())
def download(): return response.download(request,db)
def call(): return service()
### end requir... | Fix missing search-context list on Contact page. | Fix missing search-context list on Contact page.
| Python | bsd-2-clause | OpenTreeOfLife/opentree,OpenTreeOfLife/opentree,OpenTreeOfLife/opentree,OpenTreeOfLife/opentree,OpenTreeOfLife/opentree,OpenTreeOfLife/opentree | ---
+++
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
+from opentreewebapputil import (get_opentree_services_method_urls,
+ fetch_current_TNRS_context_names)
### required - do no delete
def user(): return dict(form=auth())
@@ -6,6 +8,9 @@
def call(): return service()
### end requires
... |
d4607cec7bc4fb4bcfc601fc8f1c35ea93131d3d | generate_c_arrays.py | generate_c_arrays.py | """Generates color arrays for use in a C project.
This scipt generates a dump of array/color data for use in a A project. This simplifies the need
to hand-create and edit the data in many projects. This is useful, for instance, with Arduino projects.
"""
# Module imports
import glowcolors.encode
import glowcolors.mes... | """Generates color arrays for use in a C project.
This scipt generates a dump of array/color data for use in a A project. This simplifies the need
to hand-create and edit the data in many projects. This is useful, for instance, with Arduino projects.
"""
# Module imports
import glowcolors.encode
import glowcolors.mes... | Fix for generate colors py | Fix for generate colors py
| Python | mit | evilsoapbox/GlowColors | ---
+++
@@ -33,9 +33,9 @@
encoded_data = []
for color in glowcolors.settings.COLORS[side]:
- message = glowcolors.message.generate(color)
+ message = glowcolors.message.generate(color, ear=side)
encoded_data = glowcolors.encode.ir_encode(message, True)
- print "int %s_%s[... |
721f9d02645ba91c542e9eba243ddb617db0975e | Steamworks.NET_CodeGen.py | Steamworks.NET_CodeGen.py | import sys
from SteamworksParser import steamworksparser
import interfaces
import constants
import enums
import structs
def main():
if len(sys.argv) != 2:
print("TODO: Usage Instructions")
return
steamworksparser.Settings.fake_gameserver_interfaces = True
___parser = steamworksparser.parse... | import sys
from SteamworksParser import steamworksparser
import interfaces
import constants
import enums
import structs
import typedefs
def main():
if len(sys.argv) != 2:
print("TODO: Usage Instructions")
return
steamworksparser.Settings.fake_gameserver_interfaces = True
___parser = steamw... | Add typedef generation to the main script | Add typedef generation to the main script
| Python | mit | rlabrecque/Steamworks.NET-CodeGen,rlabrecque/Steamworks.NET-CodeGen,rlabrecque/Steamworks.NET-CodeGen,rlabrecque/Steamworks.NET-CodeGen | ---
+++
@@ -4,6 +4,7 @@
import constants
import enums
import structs
+import typedefs
def main():
if len(sys.argv) != 2:
@@ -17,6 +18,7 @@
constants.main(___parser)
enums.main(___parser)
structs.main(___parser)
+ typedefs.main(___parser)
if __name__ == "__main__":
main() |
555d441053731957f9648e835e4dbbd686f2f7e5 | whack/operations.py | whack/operations.py | import os
from catchy import HttpCacher, DirectoryCacher, NoCachingStrategy
from .installer import Installer
from .sources import PackageSourceFetcher
from .providers import CachingPackageProvider
from .deployer import PackageDeployer
def create(caching):
if not caching.enabled:
cacher = NoCachingStrate... | import os
from catchy import HttpCacher, xdg_directory_cacher, NoCachingStrategy
from .installer import Installer
from .sources import PackageSourceFetcher
from .providers import CachingPackageProvider
from .deployer import PackageDeployer
def create(caching):
if not caching.enabled:
cacher = NoCachingS... | Use XDG directory for caching | Use XDG directory for caching
| Python | bsd-2-clause | mwilliamson/whack | ---
+++
@@ -1,6 +1,6 @@
import os
-from catchy import HttpCacher, DirectoryCacher, NoCachingStrategy
+from catchy import HttpCacher, xdg_directory_cacher, NoCachingStrategy
from .installer import Installer
from .sources import PackageSourceFetcher
@@ -15,7 +15,7 @@
# TODO: add DirectoryCacher in front... |
504bd32e2f91b074595e1b86065eed318a22da8c | gitcommitautosave.py | gitcommitautosave.py | """Git Commit Auto Save.
Sublime Text 3 package to auto save commit messages when the window is closed.
This allows the user to close the window without having to save before,
or having to deal with the "Save File" popup.
"""
import sublime_plugin
class GitCommitAutoSave(sublime_plugin.EventListener):
def on_load(s... | """Git Commit Auto Save.
Sublime Text 3 package to auto save commit messages when the window is closed.
This allows the user to close the window without having to save before,
or having to deal with the "Save File" popup.
"""
import sublime_plugin
class GitCommitAutoSave(sublime_plugin.EventListener):
def on_load(s... | Add file created when using add -p | Add file created when using add -p
When using 'git add -p' or 'git checkout -p', if the user chooses
to manually edit the .diff file, Git creates a file called
'addp-hunk-edit.diff' (same file name for both operations).
| Python | mit | aristidesfl/sublime-git-commit-message-auto-save | ---
+++
@@ -18,6 +18,6 @@
def is_git_file(path):
- git_files = ('COMMIT_EDITMSG', 'git-rebase-todo', 'MERGE_MSG', 'PULLREQ_EDITMSG')
+ git_files = ('COMMIT_EDITMSG', 'git-rebase-todo', 'MERGE_MSG', 'PULLREQ_EDITMSG', 'addp-hunk-edit.diff')
if path and any(path.endswith(name) for name in git_files):
return T... |
ac1f9ab2cb06be4060100fd8c0714e26a9e5c970 | openacademy/model/openacademy_course.py | openacademy/model/openacademy_course.py | from openerp import fields, models
''' ... | from openerp import api,fields, models
''' ... | Modify copy method into inherit | [REF] openacademy: Modify copy method into inherit
| Python | apache-2.0 | hellomoto6/openacademy | ---
+++
@@ -1,4 +1,4 @@
-from openerp import fields, models
+from openerp import api,fields, models
... |
2548ecd64d6a26b09fe79f5a369f731c66410aa0 | dadd/master/admin.py | dadd/master/admin.py | from flask.ext.admin import Admin
from flask.ext.admin.contrib.sqla import ModelView
from dadd.master import models
def admin(app):
admin = Admin(app)
session = models.db.session
admin.add_view(ModelView(models.Process, session))
admin.add_view(ModelView(models.Host, session))
admin.add_view(Mode... | from flask.ext.admin import Admin
from flask.ext.admin.contrib.sqla import ModelView
from dadd.master import models
class ProcessModelView(ModelView):
# Make the latest first
column_default_sort = ('start_time', True)
def __init__(self, session):
super(ProcessModelView, self).__init__(models.Pro... | Sort the processes by start time by default in the Admin. | Sort the processes by start time by default in the Admin.
| Python | bsd-3-clause | ionrock/dadd,ionrock/dadd,ionrock/dadd,ionrock/dadd | ---
+++
@@ -4,9 +4,17 @@
from dadd.master import models
+class ProcessModelView(ModelView):
+ # Make the latest first
+ column_default_sort = ('start_time', True)
+
+ def __init__(self, session):
+ super(ProcessModelView, self).__init__(models.Process, session)
+
+
def admin(app):
admin = A... |
1fdcb2a94f4af2357c24d528ecdba356074d4101 | database_setup.py | database_setup.py | import json
from meetup_facebook_bot import server
from meetup_facebook_bot.models import base, talk, speaker
base.Base.metadata.create_all(bind=server.engine)
session = server.Session()
# This part of the script provides the app with mockup data
# TODO: replace it with actually working method
json_talks = []
with ... | import json
from meetup_facebook_bot import server
from meetup_facebook_bot.models import base, talk, speaker
base.Base.metadata.create_all(bind=server.engine)
session = server.Session()
# This part of the script provides the app with mockup data
# TODO: replace it with actually working method
json_talks = []
with ... | Fix the path to fake database data | Fix the path to fake database data
| Python | mit | Stark-Mountain/meetup-facebook-bot,Stark-Mountain/meetup-facebook-bot | ---
+++
@@ -10,7 +10,7 @@
# This part of the script provides the app with mockup data
# TODO: replace it with actually working method
json_talks = []
-with open('app/example_talks.json') as json_file:
+with open('meetup_facebook_bot/example_talks.json') as json_file:
json_talks = json.load(json_file)
for f... |
f5c5c9297bb5c7dfa0ee6c3077329c8e7fa00b06 | talon_one/exceptions.py | talon_one/exceptions.py | import json
import requests
class TalonOneAPIError(Exception):
"""
TalonOne API Exceptions
"""
def __init__(self, message, *args):
self.message = message
# try to enhance with detailed error from API
if len(args) > 0 and isinstance(args[0], requests.exceptions.HTTPError):
... | import json
import requests
class TalonOneAPIError(Exception):
"""
TalonOne API Exceptions
"""
def __init__(self, message, *args):
self.message = message
# try to enhance with detailed error from API
if len(args) > 0 and isinstance(args[0], requests.exceptions.HTTPError):
... | Include API validation response into `TalonOneAPIError` details | Include API validation response into `TalonOneAPIError` details
| Python | mit | talon-one/talon_one.py,talon-one/talon_one.py | ---
+++
@@ -11,7 +11,11 @@
# try to enhance with detailed error from API
if len(args) > 0 and isinstance(args[0], requests.exceptions.HTTPError):
hints = json.loads(args[0].response.text)
+
if "errors" in hints:
self.message += " - %s" % hints["errors"][0][... |
30e050b836a4e8df3f918738b78552a070a1a176 | jarbas/core/views.py | jarbas/core/views.py | from django.shortcuts import get_object_or_404
from rest_framework.generics import RetrieveAPIView
from jarbas.core.models import Company
from jarbas.core.serializers import CompanySerializer
from jarbas.chamber_of_deputies.serializers import format_cnpj
class CompanyDetailView(RetrieveAPIView):
lookup_field = '... | from django.shortcuts import get_object_or_404
from rest_framework.generics import RetrieveAPIView
from jarbas.core.models import Company
from jarbas.core.serializers import CompanySerializer
from jarbas.chamber_of_deputies.serializers import format_cnpj
class CompanyDetailView(RetrieveAPIView):
lookup_field = ... | Add blank line - pep8 | Add blank line - pep8
| Python | mit | datasciencebr/serenata-de-amor,marcusrehm/serenata-de-amor,marcusrehm/serenata-de-amor,datasciencebr/jarbas,marcusrehm/serenata-de-amor,datasciencebr/jarbas,datasciencebr/serenata-de-amor,datasciencebr/jarbas,marcusrehm/serenata-de-amor,datasciencebr/jarbas | ---
+++
@@ -4,6 +4,7 @@
from jarbas.core.models import Company
from jarbas.core.serializers import CompanySerializer
from jarbas.chamber_of_deputies.serializers import format_cnpj
+
class CompanyDetailView(RetrieveAPIView):
|
6fecc53b63023e6d25722aa66038285be3b4d46b | arcutils/response.py | arcutils/response.py | from django.contrib.auth import REDIRECT_FIELD_NAME
from django.utils.http import is_safe_url
def get_redirect_location(request, redirect_field_name=REDIRECT_FIELD_NAME, default='/'):
"""Attempt to choose an optimal redirect location.
If a location is specified via a request parameter, that location
will... | from urllib.parse import urlparse, urlunparse
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.utils.http import is_safe_url
def get_redirect_location(request, redirect_field_name=REDIRECT_FIELD_NAME, default='/'):
"""Attempt to choose an optimal redirect location.
If a location is specified ... | Return just path when getting redirect location from REFERER | Return just path when getting redirect location from REFERER
In response.get_redirect_location(). There's no need to include the
scheme and host in a redirect back to the same site. Removing them makes
redirect URLs more concise.
| Python | mit | PSU-OIT-ARC/django-arcutils,wylee/django-arcutils,PSU-OIT-ARC/django-arcutils,wylee/django-arcutils | ---
+++
@@ -1,3 +1,5 @@
+from urllib.parse import urlparse, urlunparse
+
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.utils.http import is_safe_url
@@ -26,14 +28,25 @@
"""
host = request.get_host()
- location = (
- request.GET.get(redirect_field_name) or
- request.P... |
9d8b648163ede522eed6d9b742e8e7393dc2f6dc | vispy/testing/__init__.py | vispy/testing/__init__.py | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from ._testing import (SkipTest, requires_application, requires_img_lib, # noqa
has_backend, requires_pyopengl, # noqa
requires_s... | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Testing
=======
This module provides functions useful for running tests in vispy.
Tests can be run in a few ways:
* From Python, you can import ``vispy`` and do ``vis... | Document test system a bit | DOC: Document test system a bit
| Python | bsd-3-clause | Eric89GXL/vispy,michaelaye/vispy,Eric89GXL/vispy,drufat/vispy,dchilds7/Deysha-Star-Formation,bollu/vispy,jdreaver/vispy,jdreaver/vispy,bollu/vispy,sbtlaarzc/vispy,jay3sh/vispy,inclement/vispy,sh4wn/vispy,drufat/vispy,hronoses/vispy,bollu/vispy,julienr/vispy,ghisvail/vispy,sbtlaarzc/vispy,kkuunnddaannkk/vispy,sh4wn/visp... | ---
+++
@@ -1,6 +1,44 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
+"""
+Testing
+=======
+This module provides functions useful for running tests in vispy.
+
+Tests can be run in a few ways:
+
+ * From Python,... |
92a44ab657cf56dc6effd4fa841187d88ead879b | piper/__init__.py | piper/__init__.py | import sys
from piper.core import Piper
def main():
# TODO: dat argparse
env_key = sys.argv[1]
set_key = sys.argv[2]
piper = Piper(env_key, set_key)
piper.setup()
piper.execute()
| import sys
import jsonschema
from piper.core import Piper
def main():
# TODO: dat argparse
env_key = sys.argv[1]
set_key = sys.argv[2]
piper = Piper(env_key, set_key)
try:
piper.setup()
piper.execute()
except jsonschema.exceptions.ValidationError as e:
print(e)
... | Implement very simple main executor | Implement very simple main executor
| Python | mit | thiderman/piper | ---
+++
@@ -1,5 +1,6 @@
import sys
+import jsonschema
from piper.core import Piper
@@ -9,5 +10,9 @@
set_key = sys.argv[2]
piper = Piper(env_key, set_key)
- piper.setup()
- piper.execute()
+ try:
+ piper.setup()
+ piper.execute()
+ except jsonschema.exceptions.ValidationEr... |
e4297f0f7149763f6e93536746e3c87f9d1fa699 | tests/test_watchmedo.py | tests/test_watchmedo.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from watchdog import watchmedo
import pytest
import yaml
import os
def test_load_config_valid(tmpdir):
"""Verifies the load of a valid yaml file"""
yaml_file = os.path.join(tmpdir, 'config_file.yaml')
with open(yaml_file, 'w') as f:
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from watchdog import watchmedo
import pytest
from yaml.constructor import ConstructorError
from yaml.scanner import ScannerError
import os
def test_load_config_valid(tmpdir):
"""Verifies the load of a valid yaml file"""
yaml_file = os.path.join... | Fix watchmedo tests in Windows | Fix watchmedo tests in Windows
Unexpectedly, but on test_load_config_invalid running, PyYAML get_single_data() raises different execptions for Linux and Windows. This PR adds ScannerError for passing tests under Windows. | Python | apache-2.0 | gorakhargosh/watchdog,gorakhargosh/watchdog | ---
+++
@@ -3,7 +3,8 @@
from watchdog import watchmedo
import pytest
-import yaml
+from yaml.constructor import ConstructorError
+from yaml.scanner import ScannerError
import os
@@ -36,7 +37,8 @@
).format(critical_dir)
f.write(content)
- with pytest.raises(yaml.constructor.ConstructorE... |
5076055b54d18ea2441abaf604a4ea4dd79353c5 | cybox/test/objects/__init__.py | cybox/test/objects/__init__.py | import cybox.utils
class ObjectTestCase(object):
"""A base class for testing all subclasses of ObjectProperties.
Each subclass of ObjectTestCase should subclass both unittest.TestCase
and ObjectTestCase, and defined two class-level fields:
- klass: the ObjectProperties subclass being tested
- obj... | import cybox.utils
class ObjectTestCase(object):
"""A base class for testing all subclasses of ObjectProperties.
Each subclass of ObjectTestCase should subclass both unittest.TestCase
and ObjectTestCase, and defined two class-level fields:
- klass: the ObjectProperties subclass being tested
- obj... | Expand default testing on new object types | Expand default testing on new object types
| Python | bsd-3-clause | CybOXProject/python-cybox | ---
+++
@@ -12,11 +12,22 @@
"""
def test_type_exists(self):
- # Verify that the correct class has been added to the OBJECTS
- # dictionary in cybox.utils
- print(type(self))
+ # Verify that the correct class has been added to the OBJECT_TYPES_DICT
+ # dictionary in cybox... |
7aff5878747c000c5868e3a5ddd8b205d74770b0 | thinc/extra/load_nlp.py | thinc/extra/load_nlp.py | import numpy
try:
import spacy
except ImportError:
spacy = None
SPACY_MODELS = {}
VECTORS = {}
def get_spacy(lang, **kwargs):
global SPACY_MODELS
if spacy is None:
raise ImportError("Could not import spacy. Is it installed?")
if lang not in SPACY_MODELS:
SPACY_MODELS[lang] = spacy... | import numpy
SPACY_MODELS = {}
VECTORS = {}
def get_spacy(lang, **kwargs):
global SPACY_MODELS
import spacy
if lang not in SPACY_MODELS:
SPACY_MODELS[lang] = spacy.load(lang, **kwargs)
return SPACY_MODELS[lang]
def get_vectors(ops, lang):
global VECTORS
key = (ops.device, lang)
... | Improve import of spaCy, to prevent cycles | Improve import of spaCy, to prevent cycles
| Python | mit | explosion/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc | ---
+++
@@ -1,8 +1,4 @@
import numpy
-try:
- import spacy
-except ImportError:
- spacy = None
SPACY_MODELS = {}
VECTORS = {}
@@ -10,8 +6,7 @@
def get_spacy(lang, **kwargs):
global SPACY_MODELS
- if spacy is None:
- raise ImportError("Could not import spacy. Is it installed?")
+ import ... |
486e2fc3f2db9afabaf0dd279be0675439304d83 | app/__init__.py | app/__init__.py | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.socketio import SocketIO
import os
# The main application folder
_basedir = os.path.abspath(os.path.dirname('..'))
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(_basedir, 'test.db')
app = Flask(__name__)
app.debug = True
app.co... | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.socketio import SocketIO
import os
# The main application folder
_basedir = os.path.abspath(os.path.dirname('..'))
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(_basedir, 'test.db')
app = Flask(__name__)
app.debug = True
app.co... | Add secret key for session use | Add secret key for session use
| Python | mit | jawrainey/healthchat,jawrainey/healthchat | ---
+++
@@ -9,6 +9,7 @@
app = Flask(__name__)
app.debug = True
+app.config['SECRET_KEY'] = 'supersectetsessionrequiredkeyforsecurityreasons'
app.config['SQLALCHEMY_DATABASE_URI'] = SQLALCHEMY_DATABASE_URI
socketio = SocketIO(app) |
0cf18a615ef671e6bee44da386016d8ab1b8b012 | Generator.py | Generator.py | import random
def generateWord(meaning, form, categories, settings, formrules=None):
'''Takes an English string, desired form, generation
categories, settings, and optional form-specific rules.
Returns a generated word.
'''
word = ""
minS = settings["minS"]
maxS = settings["maxS"]
def... | import random
import re
def generateWord(meaning, form, categories, settings, phonotactics,
formrules=None):
'''Takes an English string, desired form, generation
categories, settings, and optional form-specific rules.
Returns a generated word.
'''
word = ""
minS = settings["m... | Add applyPhonotactics() and use it in generation | Add applyPhonotactics() and use it in generation
| Python | mit | kdelwat/Lexeme | ---
+++
@@ -1,7 +1,9 @@
import random
+import re
-def generateWord(meaning, form, categories, settings, formrules=None):
+def generateWord(meaning, form, categories, settings, phonotactics,
+ formrules=None):
'''Takes an English string, desired form, generation
categories, settings, and... |
f97b5ec83601430ae63ac6c0a6e651cc7a0cf90d | project/encode.py | project/encode.py | from msgpack import packb, Unpacker
from snappy import compress, decompress # noqa
from btree import Tree, Node, Leaf, LazyNode
def encode_btree(obj):
if isinstance(obj, (Tree, Node, Leaf)):
return {'__class__': obj.__class__.__name__,
'data': obj.to_json()}
elif isinstance(obj, LazyN... | from msgpack import packb, unpackb, Unpacker
from snappy import compress, decompress # noqa
from btree import Tree, Node, Leaf, LazyNode
from checksum import add_integrity, check_integrity
def encode_btree(obj):
if isinstance(obj, (Tree, Node, Leaf)):
return {'__class__': obj.__class__.__name__,
... | Add compression and integrity checks | Add compression and integrity checks
| Python | mit | Snuggert/moda | ---
+++
@@ -1,6 +1,7 @@
-from msgpack import packb, Unpacker
+from msgpack import packb, unpackb, Unpacker
from snappy import compress, decompress # noqa
from btree import Tree, Node, Leaf, LazyNode
+from checksum import add_integrity, check_integrity
def encode_btree(obj):
@@ -13,7 +14,7 @@
def encode(d... |
7cc968f90407745b84bd2f663e5f64b9c0923605 | project/manage.py | project/manage.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import environ
if __name__ == "__main__":
if os.path.isfile('.env'):
environ.Env.read_env('.env')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
from django.core.management import execute_from_command_lin... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import environ
ROOT_DIR = environ.Path(__file__) - 1
if __name__ == "__main__":
if os.path.isfile(str(ROOT_DIR + '.env')):
environ.Env.read_env(str(ROOT_DIR + '.env'))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.lo... | Use full path in case the working dir is not the same | Use full path in case the working dir is not the same
| Python | mit | hacklab-fi/asylum,hacklab-fi/asylum,HelsinkiHacklab/asylum,jautero/asylum,hacklab-fi/asylum,HelsinkiHacklab/asylum,jautero/asylum,hacklab-fi/asylum,rambo/asylum,jautero/asylum,rambo/asylum,rambo/asylum,rambo/asylum,jautero/asylum,HelsinkiHacklab/asylum,HelsinkiHacklab/asylum | ---
+++
@@ -4,10 +4,11 @@
import sys
import environ
+ROOT_DIR = environ.Path(__file__) - 1
if __name__ == "__main__":
- if os.path.isfile('.env'):
- environ.Env.read_env('.env')
+ if os.path.isfile(str(ROOT_DIR + '.env')):
+ environ.Env.read_env(str(ROOT_DIR + '.env'))
os.environ.setde... |
fff1312d506b4268be2e2ce7c333d9f25babdd59 | fuzzyfinder/main.py | fuzzyfinder/main.py | # -*- coding: utf-8 -*-
import re
from . import export
@export
def fuzzyfinder(text, collection):
"""
Args:
text (str): A partial string which is typically entered by a user.
collection (iterable): A collection of strings which will be filtered
based on the input ... | # -*- coding: utf-8 -*-
import re
from . import export
@export
def fuzzyfinder(text, collection):
"""
Args:
text (str): A partial string which is typically entered by a user.
collection (iterable): A collection of strings which will be filtered
based on the input ... | Remove the unnecessary capturing group. | Remove the unnecessary capturing group.
| Python | bsd-3-clause | harrisonfeng/fuzzyfinder,amjith/fuzzyfinder,adammenges/fuzzyfinder | ---
+++
@@ -17,7 +17,7 @@
"""
suggestions = []
regex = '.*?'.join(map(re.escape, text))
- pat = re.compile('(%s)' % regex)
+ pat = re.compile('%s' % regex)
for item in sorted(collection):
r = pat.search(item)
if r: |
d33d791a5e90ab1a389d85b5e93df7f07167eb5b | tests/integration/test_home_page.py | tests/integration/test_home_page.py | from flask import url_for
import pytest
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from tests.helpers import slow
@pytest.mark.usefixtures('live_server')
@slow
def test_home_page_accessible(selenium)... | from flask import url_for
import pytest
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from tests.helpers import slow
@pytest.mark.usefixtures('live_server')
@slow
def test_home_page_accessible(selenium)... | Update tests to reflect title change | Update tests to reflect title change
| Python | isc | textbook/flash,textbook/flash,textbook/flash | ---
+++
@@ -12,7 +12,7 @@
def test_home_page_accessible(selenium):
go_to_home_page(selenium)
WebDriverWait(selenium, 5).until(expected_conditions.title_is(
- 'Flash - Flask Dashboard'
+ 'Flask + Dashboard = Flash'
))
assert selenium.find_element(By.CLASS_NAME, 'headline').text == 'P... |
c28f0313a96be4f4095f542ba2a9524c129c88f7 | luigi_td/__init__.py | luigi_td/__init__.py | from luigi_td.bulk_import import BulkImport
from luigi_td.client import ResultProxy
from luigi_td.config import Config, get_config
from luigi_td.task import DatabaseTask, TableTask, Query
from luigi_td.targets.result import ResultTarget
from luigi_td.targets.s3 import S3ResultTarget
from luigi_td.targets.tableau import... | from luigi_td.bulk_import import BulkImport
from luigi_td.client import ResultProxy
from luigi_td.config import Config, get_config
from luigi_td.task import DatabaseTask, TableTask, Query
from luigi_td.targets.result import ResultTarget
from luigi_td.targets.s3 import S3ResultTarget
from luigi_td.targets.tableau import... | Fix variable names in __all__ | Fix variable names in __all__
| Python | apache-2.0 | treasure-data/luigi-td | ---
+++
@@ -14,13 +14,13 @@
'ResultProxy',
# config
'Config',
- 'get_config'
+ 'get_config',
# task
'DatabaseTask',
'TableTask',
'Query',
# targets.result
- 'ResultTarget'
+ 'ResultTarget',
# targets.s3
'S3ResultTarget',
# targets.tableau |
24d148e33218a3f08a56a95052b0cfe8ecb0cecd | pykka/__init__.py | pykka/__init__.py | """
Pykka is a concurrency abstraction which makes actors look like regular
objects.
See http://jodal.github.com/pykka/ for more information.
"""
from pykka.actor import Actor
from pykka.future import Future, get_all, wait_all
from pykka.proxy import ActorProxy, CallableProxy
from pykka.registry import ActorRegistry
... | from pykka.actor import Actor
from pykka.future import Future, get_all, wait_all
from pykka.proxy import ActorProxy, CallableProxy
from pykka.registry import ActorRegistry
__all__ = ['Actor', 'ActorProxy', 'ActorRegistry', 'CallableProxy', 'Future',
'get_all', 'wait_all']
VERSION = (0, 4)
def get_version():
... | Remove docstring which only repeats the readme | Remove docstring which only repeats the readme
| Python | apache-2.0 | jodal/pykka,tamland/pykka,tempbottle/pykka | ---
+++
@@ -1,10 +1,3 @@
-"""
-Pykka is a concurrency abstraction which makes actors look like regular
-objects.
-
-See http://jodal.github.com/pykka/ for more information.
-"""
-
from pykka.actor import Actor
from pykka.future import Future, get_all, wait_all
from pykka.proxy import ActorProxy, CallableProxy |
b74971eaf180c14fef68142bffc689b1bc7340f4 | approvaltests/Namer.py | approvaltests/Namer.py | import inspect
import os
class Namer(object):
ClassName = ''
MethodName = ''
Directory = ''
def setForStack(self, caller):
stackFrame = caller[self.frame]
self.MethodName = stackFrame[3]
self.ClassName = stackFrame[0].f_globals["__name__"]
self.Directory = os.path.dirn... | import inspect
import os
class Namer(object):
ClassName = ''
MethodName = ''
Directory = ''
def setForStack(self, caller):
stackFrame = caller[self.frame]
self.MethodName = stackFrame[3]
self.ClassName = stackFrame[0].f_globals["__name__"]
self.Directory = os.path.dirn... | Create approval file path that works on Linux and Windows. | Create approval file path that works on Linux and Windows.
| Python | apache-2.0 | approvals/ApprovalTests.Python,approvals/ApprovalTests.Python,approvals/ApprovalTests.Python,tdpreece/ApprovalTests.Python | ---
+++
@@ -27,4 +27,4 @@
return self.Directory
def get_basename(self):
- return self.Directory + "\\" + self.ClassName + "." + self.MethodName
+ return os.path.join(self.Directory, self.ClassName + "." + self.MethodName) |
832256925a08c0bbfe3f507ef613d51e11ac8103 | feature_extraction/extraction.py | feature_extraction/extraction.py | import numpy as np
def extract_features(image, measurements):
"""
Given an image as a Numpy array and a set of measurement objects
implementing a compute method returning a feature vector, return a combined
feature vector.
"""
# TODO(liam): parallelize multiple measurements on an image by using Celery
return... | import numpy as np
def extract_features(image, measurements):
"""
Given an image as a Numpy array and a set of measurement objects
implementing a compute method returning a feature vector, return a combined
feature vector.
"""
# TODO(liam): parallelize multiple measurements on an image by using Celery
return... | Add a function to normalize the feature vectors | Add a function to normalize the feature vectors
| Python | apache-2.0 | widoptimization-willett/feature-extraction | ---
+++
@@ -10,3 +10,13 @@
# TODO(liam): parallelize multiple measurements on an image by using Celery
return np.hstack([m.compute(image) for m in measurements])
+
+def normalize_features(X):
+ # recenter features and normalize over the dataset
+ X -= np.mean(X, axis=0)
+ X /= np.linalg.norm(X, axis=0)
+
+ # n... |
9ea35a99c30f2ec7ed3946e71a286e689d2a50a3 | api/tests/test_signup.py | api/tests/test_signup.py | from django.test import TestCase
from api.views.signup import signup
from rest_framework.test import APIRequestFactory
from api import factories, serializers
from api.models import User
from api.serializers import UserSerializer
class SignupTest(TestCase):
PASSWORD = 'test'
def setUp(self):
self.fac... | from django.test import TestCase
from api.views.signup import signup
from rest_framework.test import APIRequestFactory
from api import factories
from api.serializers import UserSerializer
class SignupTest(TestCase):
PASSWORD = 'test'
REQUIRED_FIELD_ERROR = 'This field is required.'
def setUp(self):
... | Add test for errors, but User fields need to become required first | Add test for errors, but User fields need to become required first
| Python | mit | frostblooded/kanq,frostblooded/kanq,frostblooded/kanq,frostblooded/kanq,frostblooded/kanq | ---
+++
@@ -2,13 +2,13 @@
from api.views.signup import signup
from rest_framework.test import APIRequestFactory
-from api import factories, serializers
-from api.models import User
+from api import factories
from api.serializers import UserSerializer
class SignupTest(TestCase):
PASSWORD = 'test'
+ R... |
de9e8ab1a91e2a0e69971f9c23377f97e717b048 | app/__init__.py | app/__init__.py | from app.main import bundle_app # noqa
# NOTE: uncomment out while genrating migration
# app = bundle_app({'MIGRATION': True})
| import os
from app.main import bundle_app # noqa
# NOTE: uncomment out while genrating migration
# app = bundle_app({'MIGRATION': True})
application = bundle_app({
'CLI_OR_DEPLOY': True,
'GUNICORN': 'gunicorn' in os.environ.get('SERVER_SOFTWARE', '')}) # noqa
| Add additional application for gunicorn. | Add additional application for gunicorn.
| Python | mpl-2.0 | mrf345/FQM,mrf345/FQM,mrf345/FQM,mrf345/FQM | ---
+++
@@ -1,4 +1,9 @@
+import os
from app.main import bundle_app # noqa
# NOTE: uncomment out while genrating migration
# app = bundle_app({'MIGRATION': True})
+
+application = bundle_app({
+ 'CLI_OR_DEPLOY': True,
+ 'GUNICORN': 'gunicorn' in os.environ.get('SERVER_SOFTWARE', '')}) # noqa |
4bd4c209862db759102c869da324db3e74347880 | gold_digger/settings/__init__.py | gold_digger/settings/__init__.py | # -*- coding: utf-8 -*-
from os import environ, path
from ._settings_default import *
from ..exceptions import ImproperlyConfigured
PROFILE = environ.get("GOLD_DIGGER_PROFILE", "local")
if PROFILE == "master":
from ._settings_master import *
elif PROFILE == "local":
try:
from ._settings_local import... | # -*- coding: utf-8 -*-
from os import environ, path
from ._settings_default import *
from ..exceptions import ImproperlyConfigured
PROFILE = environ.get("GOLD_DIGGER_PROFILE", "local")
if PROFILE == "master":
from ._settings_master import *
elif PROFILE == "local":
try:
from ._settings_local import... | Remove staging from supported profiles | Remove staging from supported profiles
| Python | apache-2.0 | business-factory/gold-digger | ---
+++
@@ -17,4 +17,4 @@
f"Local configuration not found. Create file _settings_local.py in {path.abspath(path.join(__file__, path.pardir))} directory according to README."
)
else:
- raise ValueError(f"Unsupported settings profile. Got: {PROFILE}. Use one of: master, staging, local.")
+ ... |
60f666a7d3aac09b5fa8e3df29d0ff08b67eac3c | tools/gyp/find_mac_gcc_version.py | tools/gyp/find_mac_gcc_version.py | #!/usr/bin/env python
# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import re
import subprocess
import sys
def main():
job = subprocess.Popen(['xcode... | #!/usr/bin/env python
# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import re
import subprocess
import sys
def main():
job = subprocess.Popen(['xcode... | Revert "Revert "Use clang on mac if XCode >= 4.5"" | Revert "Revert "Use clang on mac if XCode >= 4.5""
The V8 dependency has been removed, so we should be able to enable clang on mac
again.
R=ricow@google.com
Review URL: https://codereview.chromium.org//14751012
git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@22304 260f80e4-7a28-3924-810f-c04153c831b5
| Python | bsd-3-clause | dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dartino/dart-sdk... | ---
+++
@@ -21,10 +21,13 @@
major = int(matches[0][0])
minor = int(matches[0][1])
- if major >= 4:
+ if major == 3 and minor >= 1:
+ return '4.2'
+ elif major == 4 and minor < 5:
return 'com.apple.compilers.llvmgcc42'
- elif major == 3 and minor >= 1:
- return '4.2'
+ elif ... |
2206b4b96805e35a612f471fb8f843b35fe45021 | code/dstruct/Word.py | code/dstruct/Word.py | #! /usr/bin/env python3
""" A Word class
Originally obtained from the 'pharm' repository, but modified.
"""
class Word(object):
doc_id = None
sent_id = None
insent_idx = None
word = None
pos = None
ner = None
lemma = None
dep_path = None
dep_parent = None
sent_id = None
... | #! /usr/bin/env python3
""" A Word class
Originally obtained from the 'pharm' repository, but modified.
"""
class Word(object):
doc_id = None
sent_id = None
in_sent_idx = None
word = None
pos = None
ner = None
lemma = None
dep_path = None
dep_parent = None
sent_id = None
... | Fix name of an attribute and PEP8-ify | Fix name of an attribute and PEP8-ify
| Python | apache-2.0 | HazyResearch/dd-genomics,HazyResearch/dd-genomics,HazyResearch/dd-genomics,amwenger/dd-genomics,HazyResearch/dd-genomics,rionda/dd-genomics,rionda/dd-genomics,amwenger/dd-genomics,amwenger/dd-genomics,HazyResearch/dd-genomics | ---
+++
@@ -4,11 +4,12 @@
Originally obtained from the 'pharm' repository, but modified.
"""
+
class Word(object):
-
+
doc_id = None
sent_id = None
- insent_idx = None
+ in_sent_idx = None
word = None
pos = None
ner = None
@@ -18,10 +19,11 @@
sent_id = None
box = None
... |
85a047ce00f86727b2d260c609049f82927825ff | byteaccess/__init__.py | byteaccess/__init__.py | from byteaccess.byteaccess import ByteAccess, access_over_file
from byteaccess.winmemaccess import access_over_process
| from byteaccess.byteaccess import ByteAccess, access_over_file
from byteaccess.winmemaccess import access_over_process
__version__ = 'TODO: Figure out Python 3 version conventions'
| Add version placeholder for now | Add version placeholder for now
| Python | bsd-2-clause | ChadSki/byteaccess,ChadSki/halolib | ---
+++
@@ -1,2 +1,4 @@
from byteaccess.byteaccess import ByteAccess, access_over_file
from byteaccess.winmemaccess import access_over_process
+
+__version__ = 'TODO: Figure out Python 3 version conventions' |
2d1c8a62295ed5150f31e11cdbbf98d4d74498d8 | bin/cgroup-limits.py | bin/cgroup-limits.py | #!/usr/bin/python
env_vars = {}
def read_file(path):
try:
with open(path, 'r') as f:
return f.read().strip()
except IOError:
return None
def get_memory_limit():
limit = read_file('/sys/fs/cgroup/memory/memory.limit_in_bytes')
if limit:
env_vars['MEMORY_LIMIT_IN_B... | #!/usr/bin/python
env_vars = {}
def read_file(path):
try:
with open(path, 'r') as f:
return f.read().strip()
except IOError:
return None
def get_memory_limit():
limit = read_file('/sys/fs/cgroup/memory/memory.limit_in_bytes')
if limit:
env_vars['MEMORY_LIMIT_IN_B... | Set MAX_MEMORY_LIMIT_IN_BYTES to number returned by cgroups where there is no limit | Set MAX_MEMORY_LIMIT_IN_BYTES to number returned by cgroups where there is no limit
| Python | apache-2.0 | openshift/sti-base,hhorak/sti-base,soltysh/sti-base,openshift/sti-base,bparees/sti-base,sclorg/s2i-base-container,mfojtik/sti-base,mfojtik/sti-base,bparees/sti-base | ---
+++
@@ -36,5 +36,6 @@
get_memory_limit()
get_number_of_cores()
+print("MAX_MEMORY_LIMIT_IN_BYTES=9223372036854775807")
for item in env_vars.items():
print("=".join(item)) |
911c79f8f76187601ac2df835541d6d76f172b3b | decorators.py | decorators.py | from django.db.models.signals import pre_save
from django.dispatch import receiver
def cleans_field(field_ref):
"""Decorator to registers a field cleaning methods on the pre_save signal.
Args:
field_ref (str): a label for the model field to clean, following the
convention `app_name.ModelN... | from django.db.models.signals import pre_save
from django.dispatch import receiver
class NoValue(object):
"""Empty class for disambiguating calls to getattr"""
pass
def cleans_field(field_ref):
"""Decorator to registers a field cleaning methods on the pre_save signal.
Args:
field_ref (str):... | Create NoValue class to disambiguate getattr calls | Create NoValue class to disambiguate getattr calls
| Python | mit | lamarmeigs/django-clean-fields | ---
+++
@@ -1,5 +1,10 @@
from django.db.models.signals import pre_save
from django.dispatch import receiver
+
+
+class NoValue(object):
+ """Empty class for disambiguating calls to getattr"""
+ pass
def cleans_field(field_ref):
@@ -18,8 +23,8 @@
@receiver(pre_save, sender=model_label, weak=False... |
25dfc009b380b2a63619651dbcba2c7d7ade929c | deep_parse.py | deep_parse.py | #!/usr/bin/env python
"""Simple library for parsing deeply nested structure (dict, json)
into regular object. You can specify fields to extract, and argument
names in created object.
Example
content = {
'name': 'Bob',
'details': {
'email': 'bob@email.com',
}
}
fields = ... | #!/usr/bin/env python
"""Simple library for parsing deeply nested structure (dict, json)
into regular object. You can specify fields to extract, and argument
names in created object.
Example
content = {
'name': 'Bob',
'details': {
'email': 'bob@email.com',
}
}
fields = ... | Add __repr__ and __str__ methods to dummy object. | Add __repr__ and __str__ methods to dummy object.
| Python | mit | bradojevic/deep-parse | ---
+++
@@ -24,7 +24,12 @@
class DeepParseObject(object):
"""Simple dummy object to hold content."""
- pass
+
+ def __str__(self):
+ return 'DeepParseObject: %s' % self.__dict__
+
+ def __repr__(self):
+ return 'DeepParseObject: %r' % self.__dict__
def deep_parse_dict(content, fiel... |
905b7849d319e5147653754ceaead333873bd401 | packager/rpm/test/test_build.py | packager/rpm/test/test_build.py | #! /usr/bin/python
from build_rpm import BuildModelRPM
from nose.tools import *
@raises(TypeError)
def test_fail_with_no_parameters():
BuildModelRPM(None)
@raises(TypeError)
def test_fail_with_one_parameter():
BuildModelRPM("hydrotrend")
def test_hydrotrend_version_none():
BuildModelRPM("hydrotrend", No... | #! /usr/bin/python
from packager.rpm.build import BuildRPM
from nose.tools import *
@raises(TypeError)
def test_fail_with_no_parameters():
BuildRPM(None)
@raises(TypeError)
def test_fail_with_one_parameter():
BuildRPM("hydrotrend")
def test_hydrotrend_version_none():
BuildRPM("hydrotrend", None)
def te... | Update unit tests for packager.rpm.build.py | Update unit tests for packager.rpm.build.py
| Python | mit | csdms/packagebuilder | ---
+++
@@ -1,33 +1,33 @@
#! /usr/bin/python
-from build_rpm import BuildModelRPM
+from packager.rpm.build import BuildRPM
from nose.tools import *
@raises(TypeError)
def test_fail_with_no_parameters():
- BuildModelRPM(None)
+ BuildRPM(None)
@raises(TypeError)
def test_fail_with_one_parameter():
- ... |
cbcd4ebcc01646382595ce9ee10d278120ce00ce | pets/common/views.py | pets/common/views.py | from django.db.models import Count
from django.shortcuts import render
from django.views.generic import TemplateView
from django.views.generic.base import ContextMixin
from meupet import models
def get_adoption_kinds():
return get_kind_list([models.Pet.FOR_ADOPTION, models.Pet.ADOPTED])
def get_lost_kinds():
... | from django.db.models import Count
from django.shortcuts import render
from django.views.generic import TemplateView
from django.views.generic.base import ContextMixin
from meupet import models
def get_adoption_kinds():
return get_kind_list([models.Pet.FOR_ADOPTION, models.Pet.ADOPTED])
def get_lost_kinds():
... | Remove useless code from the home view | Remove useless code from the home view
| Python | mit | dirtycoder/pets,dirtycoder/pets,dirtycoder/pets | ---
+++
@@ -39,5 +39,4 @@
def home(request):
- pets = models.Pet.objects.select_related('city').order_by('-id')[:6]
- return render(request, 'common/home.html', {'pets': pets})
+ return render(request, 'common/home.html') |
a8c824741ac0c4bd9a12c2fa62050b2608e7ad22 | kqml/kqml_string.py | kqml/kqml_string.py | from io import BytesIO
from kqml import KQMLObject
from .util import safe_decode
class KQMLString(object):
def __init__(self, data=None):
if data is None:
self.data = ''
else:
self.data = safe_decode(data)
def __len__(self):
return len(self.data)
def char_a... | from io import BytesIO
from kqml import KQMLObject
from .util import safe_decode
class KQMLString(KQMLObject):
def __init__(self, data=None):
if data is None:
self.data = ''
else:
self.data = safe_decode(data)
def __len__(self):
return len(self.data)
def c... | Make KQMLString subclass of KQMLObject. | Make KQMLString subclass of KQMLObject.
| Python | bsd-2-clause | bgyori/pykqml | ---
+++
@@ -2,7 +2,8 @@
from kqml import KQMLObject
from .util import safe_decode
-class KQMLString(object):
+
+class KQMLString(KQMLObject):
def __init__(self, data=None):
if data is None:
self.data = ''
@@ -47,4 +48,3 @@
def __getitem__(self, *args):
return self.data._... |
736d4b8207cb63bda86f4338c08cc8719416fbe7 | gauge/__init__.py | gauge/__init__.py | # -*- coding: utf-8 -*-
"""
gauge
~~~~~
Deterministic linear gauge library.
:copyright: (c) 2013-2017 by What! Studio
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from gauge.__about__ import __version__ # noqa
from gauge.constants import CLAMP, ERROR, OK, O... | # -*- coding: utf-8 -*-
"""
gauge
~~~~~
Deterministic linear gauge library.
:copyright: (c) 2013-2017 by What! Studio
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from gauge.__about__ import __version__ # noqa
from gauge.constants import CLAMP, ERROR, OK, O... | Fix pickle failure in PyPy | Fix pickle failure in PyPy
| Python | bsd-3-clause | what-studio/gauge | ---
+++
@@ -17,3 +17,16 @@
__all__ = ['Gauge', 'Momentum', 'ERROR', 'OK', 'ONCE', 'CLAMP']
+
+
+try:
+ import __pypy__
+except ImportError:
+ pass
+else:
+ # Here's a workaround which makes :class:`Gauge` be picklable in PyPy.
+ # ``Gauge.__module__`` and ``__name__`` should be ``'gauge.core'`` and
+... |
cfcd3aa71001f74915a938aa0ec1ae58c4db3e06 | src/oscar_accounts/__init__.py | src/oscar_accounts/__init__.py | # Setting for template directory not found by app_directories.Loader. This
# allows templates to be identified by two paths which enables a template to be
# extended by a template with the same identifier.
TEMPLATE_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'templates/accounts')
default_... | import os
# Setting for template directory not found by app_directories.Loader. This
# allows templates to be identified by two paths which enables a template to be
# extended by a template with the same identifier.
TEMPLATE_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'templates/accounts'... | Undo removing `import os` statement | Undo removing `import os` statement
| Python | bsd-3-clause | django-oscar/django-oscar-accounts,django-oscar/django-oscar-accounts | ---
+++
@@ -1,3 +1,6 @@
+import os
+
+
# Setting for template directory not found by app_directories.Loader. This
# allows templates to be identified by two paths which enables a template to be
# extended by a template with the same identifier. |
9a239c993502e3f317edd478a5d8b5f225c24b18 | globus_cli/run.py | globus_cli/run.py | from globus_cli.parsing import globus_main_func
from globus_cli.login import login_command
from globus_cli.list_commands import list_commands
from globus_cli.config_command import config_command
from globus_cli.helpers import common_options
from globus_cli.services.auth import auth_command
from globus_cli.services.tr... | from globus_cli.parsing import globus_main_func
from globus_cli.login import login_command
from globus_cli.list_commands import list_commands
from globus_cli.config_command import config_command
from globus_cli.services.auth import auth_command
from globus_cli.services.transfer import transfer_command
@globus_main_... | Fix doubled-help on main command | Fix doubled-help on main command
Main command was being doubly decorated with the common options. As a
result, it had funky looking helptext.
| Python | apache-2.0 | globus/globus-cli,globus/globus-cli | ---
+++
@@ -3,14 +3,12 @@
from globus_cli.login import login_command
from globus_cli.list_commands import list_commands
from globus_cli.config_command import config_command
-from globus_cli.helpers import common_options
from globus_cli.services.auth import auth_command
from globus_cli.services.transfer import ... |
d406aa60f31f5e318a46e84539546a4452574ce6 | src/rtruffle/source_section.py | src/rtruffle/source_section.py | class SourceCoordinate(object):
_immutable_fields_ = ['_start_line', '_start_column', '_char_idx']
def __init__(self, start_line, start_column, char_idx):
self._start_line = start_line
self._start_column = start_column
self._char_idx = char_idx
def get_start_line(self):
... | class SourceCoordinate(object):
_immutable_fields_ = ['_start_line', '_start_column', '_char_idx']
def __init__(self, start_line, start_column, char_idx):
self._start_line = start_line
self._start_column = start_column
self._char_idx = char_idx
def get_start_line(self):
... | Initialize char_length with a number | Initialize char_length with a number
And make var name `file` less ambiguous by using `file_name` instead.
Signed-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>
| Python | mit | SOM-st/RPySOM,smarr/RTruffleSOM,SOM-st/RTruffleSOM,smarr/PySOM,SOM-st/PySOM,SOM-st/RPySOM,smarr/RTruffleSOM,SOM-st/RTruffleSOM,smarr/PySOM,SOM-st/PySOM | ---
+++
@@ -19,7 +19,7 @@
_immutable_fields_ = ['_source', '_identifier', '_coord', '_char_length']
def __init__(self, source = None, identifier = None, coord = None,
- char_length = None, file = None, source_section = None):
+ char_length = 0, file_name = None, source_sect... |
321a0cea6a71e29a3f00116c52c1056d7dcfef7e | daskfunk/__init__.py | daskfunk/__init__.py | from __future__ import absolute_import, division, print_function
from .core import compile
from ._info import __version__
| from __future__ import absolute_import, division, print_function
from .core import compile
| Remove import of deleted file | Remove import of deleted file
| Python | mit | Savvysherpa/dask-funk | ---
+++
@@ -1,4 +1,3 @@
from __future__ import absolute_import, division, print_function
from .core import compile
-from ._info import __version__ |
aff8945aef3f10fa9d1243b25301e84611c27422 | aleph/views/status_api.py | aleph/views/status_api.py | import logging
from flask import Blueprint, request
from aleph.model import Collection
from aleph.queues import get_active_collection_status
from aleph.views.util import jsonify
from aleph.logic import resolver
from aleph.views.util import require
log = logging.getLogger(__name__)
blueprint = Blueprint('status_api',... | import logging
from flask import Blueprint, request
from aleph.model import Collection
from aleph.queues import get_active_collection_status
from aleph.views.util import jsonify
from aleph.views.util import require
log = logging.getLogger(__name__)
blueprint = Blueprint('status_api', __name__)
@blueprint.route('/a... | Load only the active collections instead of all accessible collections | Load only the active collections instead of all accessible collections
| Python | mit | alephdata/aleph,alephdata/aleph,pudo/aleph,alephdata/aleph,pudo/aleph,pudo/aleph,alephdata/aleph,alephdata/aleph | ---
+++
@@ -4,7 +4,6 @@
from aleph.model import Collection
from aleph.queues import get_active_collection_status
from aleph.views.util import jsonify
-from aleph.logic import resolver
from aleph.views.util import require
@@ -19,18 +18,14 @@
active_collections = status.pop('datasets')
active_foreign_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.