commit stringlengths 40 40 | old_file stringlengths 4 236 | new_file stringlengths 4 236 | old_contents stringlengths 1 3.26k | new_contents stringlengths 16 4.43k | subject stringlengths 16 624 | message stringlengths 17 3.29k | lang stringclasses 5
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
08581be11f891e21014a7863ab102d4586388d47 | packs/docker/actions/build_image.py | packs/docker/actions/build_image.py | import os
from lib.base import DockerBasePythonAction
__all__ = [
'DockerBuildImageAction'
]
class DockerBuildImageAction(DockerBasePythonAction):
def run(self, dockerfile_path, tag):
if os.path.isdir(dockerfile_path):
return self.wrapper.build(path=dockerfile_path, tag=tag)
els... | import os
from lib.base import DockerBasePythonAction
__all__ = [
'DockerBuildImageAction'
]
class DockerBuildImageAction(DockerBasePythonAction):
def run(self, dockerfile_path, tag):
if os.path.isdir(dockerfile_path):
return self.wrapper.build(path=dockerfile_path, tag=tag)
els... | Expand user in the path. | Expand user in the path.
| Python | apache-2.0 | StackStorm/st2contrib,jtopjian/st2contrib,armab/st2contrib,Aamir-raza-1/st2contrib,tonybaloney/st2contrib,StackStorm/st2contrib,pearsontechnology/st2contrib,digideskio/st2contrib,meirwah/st2contrib,tonybaloney/st2contrib,dennybaa/st2contrib,jtopjian/st2contrib,armab/st2contrib,tonybaloney/st2contrib,digideskio/st2contr... |
02fad660afbb6b5ca1fc4f1c3a1fcf3c95f9fd0d | pypeerassets/providers/node.py | pypeerassets/providers/node.py |
'''Communicate with local or remote peercoin-daemon via JSON-RPC'''
from operator import itemgetter
try:
from peercoin_rpc import Client
except:
raise EnvironmentError("peercoin_rpc library is required for this to work,\
use pip to install it.")
def select_inputs(cls, total_amoun... |
'''Communicate with local or remote peercoin-daemon via JSON-RPC'''
from operator import itemgetter
try:
from peercoin_rpc import Client
except:
raise EnvironmentError("peercoin_rpc library is required for this to work,\
use pip to install it.")
def select_inputs(cls, total_amoun... | Refactor unspent utxo data gathering | Refactor unspent utxo data gathering | Python | bsd-3-clause | PeerAssets/pypeerassets,backpacker69/pypeerassets |
c881dbef22ac7ca26ad6abceb3c2e02d0b759040 | yutu/bot.py | yutu/bot.py | import discord
from discord.ext import commands
from pony import orm
DESCRIPTION = """
Hi, I'm Yutu!
I'm the bot for the Velvet fan discord.
I'm still learning so sorry if I do something wrong.
You can ask my programmer @Harkonen if you want to know more about me.
"""
class Yutu(commands.Bot):
def __init__(self)... | import discord
from discord.ext import commands
from pony import orm
DESCRIPTION = """
Hi, I'm Yutu!
I'm the bot for the Velvet fan discord.
I'm still learning so sorry if I do something wrong.
You can ask my programmer @Harkonen if you want to know more about me.
"""
class Yutu(commands.Bot):
def __init__(self)... | Make Yutu acknowledge pm'ed help commands | Make Yutu acknowledge pm'ed help commands
| Python | mit | HarkonenBade/yutu |
e412a68afe691913525245d2a8a3a8e9e3ba532d | python/xicore.py | python/xicore.py | #!/usr/bin/env python
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | #!/usr/bin/env python
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | Replace tab indentation with 4 spaces | Replace tab indentation with 4 spaces | Python | apache-2.0 | google/xi-editor,google/xi-editor,fuchsia-mirror/third_party-xi-editor,modelorganism/xi-editor,modelorganism/xi-editor,fuchsia-mirror/third_party-xi-editor,fuchsia-mirror/third_party-xi-editor,google/xi-editor,google/xi-editor,fuchsia-mirror/third_party-xi-editor,modelorganism/xi-editor |
481df944700297300892bd14783310aad14c093c | test/selenium/src/lib/page/modal/delete_object.py | test/selenium/src/lib/page/modal/delete_object.py | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Modals for deleting objects"""
from lib import base
from lib import decorator
from lib.constants import locator
class DeleteObjectModal(base.Modal):
"""A generic modal for deleting an object"""
_p... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Modals for deleting objects"""
from lib import base
from lib.constants import locator
class DeleteObjectModal(base.Modal):
"""A generic modal for deleting an object"""
_page_model_cls_after_redire... | Remove redirect from delete modal page object | Remove redirect from delete modal page object
(cherry picked from commit 480ecdb)
| Python | apache-2.0 | VinnieJohns/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core,josthkko/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,VinnieJohns/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,kr41/ggrc-core,p... |
9358b83c1dc0c6e0306416705d28a48f478878db | test/tests/python-imports/container.py | test/tests/python-imports/container.py | import curses
import dbm
import readline
import bz2
assert(bz2.decompress(bz2.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
import platform
if platform.python_implementation() != 'PyPy' and platform.python_version_tuple()[0] != '2':
# PyPy and Python 2 don't support lzma
import lz... | import curses
import readline
import bz2
assert(bz2.decompress(bz2.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
import platform
isNotPypy = platform.python_implementation() != 'PyPy'
isCaveman = platform.python_version_tuple()[0] == '2'
if isCaveman:
import gdbm
else:
import db... | Reorder python import test to use gnu dbm imports instead of generic dbm | Reorder python import test to use gnu dbm imports instead of generic dbm
| Python | apache-2.0 | nodejs-docker-bot/official-images,robfrank/official-images,mattrobenolt/official-images,mattrobenolt/official-images,infosiftr/stackbrew,infosiftr/stackbrew,neo-technology/docker-official-images,chorrell/official-images,nodejs-docker-bot/official-images,pesho/docker-official-images,chorrell/official-images,pesho/docker... |
5420d368c064953842023ccc07b531b071ec3514 | src/tests/test_login_page.py | src/tests/test_login_page.py | from src.lib.page.login import LoginPage
from src.lib.base import BaseTest
class TestLoginPage(BaseTest):
def test_login_as_admin(self):
login_page = LoginPage(self.driver)
login_page.login()
self.driver.find_element_by_css_selector("li.user.user-dropdown.dropdown")
| from src.lib.page.login import LoginPage
from src.lib.base import BaseTest
from src.lib.constants import selector
class TestLoginPage(BaseTest):
def test_login_as_admin(self):
login_page = LoginPage(self.driver)
login_page.login()
self.driver.find_element_by_css_selector(selector.LoginPag... | Modify login page test to use selectors defined in the module constants. | Modify login page test to use selectors defined in the module constants.
| Python | apache-2.0 | edofic/ggrc-core,kr41/ggrc-core,jmakov/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,josthkko/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core,plamut/ggrc-core,edofic/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,j0gurt/ggrc-core,prasan... |
541d4080821692ed879bfee47eb0ce1a8b278dac | Python/reverse-words-in-a-string-iii.py | Python/reverse-words-in-a-string-iii.py | # Time: O(n)
# Space: O(1)
# Given a string, you need to reverse the order of characters in each word within a sentence
# while still preserving whitespace and initial word order.
#
# Example 1:
# Input: "Let's take LeetCode contest"
# Output: "s'teL ekat edoCteeL tsetnoc"
# Note: In the string, each word is separate... | # Time: O(n)
# Space: O(1)
# Given a string, you need to reverse the order of characters in each word within a sentence
# while still preserving whitespace and initial word order.
#
# Example 1:
# Input: "Let's take LeetCode contest"
# Output: "s'teL ekat edoCteeL tsetnoc"
# Note: In the string, each word is separate... | Add alternative solution for 'Reverse words in string III' | Add alternative solution for 'Reverse words in string III'
| Python | mit | kamyu104/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015 |
92759e9df89664ae515e51825982141750921ce3 | src/sample_xblocks/basic/test/test_view_counter.py | src/sample_xblocks/basic/test/test_view_counter.py | """ Simple test for the view counter that verifies that it is updating properly """
from collections import namedtuple
from mock import Mock
from xblock.runtime import KvsFieldData, DictKeyValueStore
from xblock.view_counter import ViewCounter
from xblock.test.tools import assert_in, assert_equals
TestUsage = nam... | """ Simple test for the view counter that verifies that it is updating properly """
from collections import namedtuple
from mock import Mock
from xblock.runtime import KvsFieldData, DictKeyValueStore
from sample_xblocks.basic.view_counter import ViewCounter
from xblock.test.tools import assert_in, assert_equals
T... | Use the correct location of view_counter in test | Use the correct location of view_counter in test
| Python | apache-2.0 | stvstnfrd/xblock-sdk,dcadams/xblock-sdk,edx/xblock-sdk,jamiefolsom/xblock-sdk,edx/xblock-sdk,stvstnfrd/xblock-sdk,nagyistoce/edx-xblock-sdk,lovehhf/xblock-sdk,edx-solutions/xblock-sdk,Pilou81715/hackathon_edX,Pilou81715/hackathon_edX,edx-solutions/xblock-sdk,lovehhf/xblock-sdk,lovehhf/xblock-sdk,nagyistoce/edx-xblock-s... |
08718ce949e7f80b0cbe39c3eba4446133c6d72d | code/marv-api/marv_api/deprecation.py | code/marv-api/marv_api/deprecation.py | # Copyright 2020 Ternaris.
# SPDX-License-Identifier: AGPL-3.0-only
import warnings
from dataclasses import dataclass
from typing import Any
@dataclass
class Info:
module: str
version: str
obj: Any
msg: str = None
def make_getattr(module, dct):
assert all(x.module == module for x in dct.values... | # Copyright 2020 Ternaris.
# SPDX-License-Identifier: AGPL-3.0-only
import functools
import warnings
from dataclasses import dataclass
from typing import Any
@dataclass
class Info:
module: str
version: str
obj: Any
msg: str = None
def make_getattr(module, dct):
assert all(x.module == module fo... | Add decorator to declare function deprecated | Add decorator to declare function deprecated
| Python | agpl-3.0 | ternaris/marv-robotics,ternaris/marv-robotics |
700fa0144c5276d8e31c01a243340f6cbac07e8f | sentry/client/handlers.py | sentry/client/handlers.py | import logging
class SentryHandler(logging.Handler):
def emit(self, record):
from sentry.client.models import get_client
get_client().create_from_record(record) | import logging
import sys
class SentryHandler(logging.Handler):
def emit(self, record):
from sentry.client.models import get_client
# Avoid typical config issues by overriding loggers behavior
if record.name == 'sentry.errors':
print >> sys.stderr, record.message
re... | Add a safety net for recursive logging | Add a safety net for recursive logging
| Python | bsd-3-clause | ewdurbin/sentry,hongliang5623/sentry,Photonomie/raven-python,ewdurbin/raven-python,daevaorn/sentry,NickPresta/sentry,dcramer/sentry-old,looker/sentry,NickPresta/sentry,chayapan/django-sentry,Kryz/sentry,BuildingLink/sentry,gencer/sentry,boneyao/sentry,danriti/raven-python,imankulov/sentry,nikolas/raven-python,mvaled/se... |
529d72ff62f3d4b8ab18a26beadd20322a118a28 | client/scripts/osutil.py | client/scripts/osutil.py | import sys
class OSUtil():
def __init__(self):
pass
def platform(self):
platform = sys.platform # Map from python platform name to ue4 platform name
names = {
'cygwin': 'Win', # could be win32 also
'win32': 'Win',
'win64': 'Win',
'linux2'... | import sys, platform
class OSUtil():
def __init__(self):
pass
def platform(self):
win = 'Win'
mac = 'Mac'
linux = 'Linux'
if platform.release().endswith('Microsoft'):
# This is a hacky way to check whether I am running Ubuntu on Windows
return wi... | Fix the platform check for windows. | Fix the platform check for windows.
| Python | mit | qiuwch/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv |
4e90a2fd424eeb078957b779a211d9643c516566 | tests/commands/test_settings.py | tests/commands/test_settings.py | # Copyright 2014-2015 Ivan Kravets <me@ikravets.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | # Copyright 2014-2015 Ivan Kravets <me@ikravets.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Fix test for settings command | Fix test for settings command
| Python | apache-2.0 | platformio/platformio-core,eiginn/platformio,platformio/platformio-core,ZachMassia/platformio,platformio/platformio,valeros/platformio |
c86f915e324d7e66cb07cbcc9fb827c2dcdeda29 | rst2pdf/utils.py | rst2pdf/utils.py | # -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
import shlex
from reportlab.platypus import Spacer
from flowables import *
def parseRaw(data):
"""Parse and process a simple DSL to handle creation of flowables.
Supported (ca... | # -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
import shlex
from reportlab.platypus import Spacer
from flowables import *
from styles import adjustUnits
def parseRaw(data):
"""Parse and process a simple DSL to handle creation of f... | Add unit support for spacers | Add unit support for spacers
git-svn-id: 305ad3fa995f01f9ce4b4f46c2a806ba00a97020@779 3777fadb-0f44-0410-9e7f-9d8fa6171d72
| Python | mit | aquavitae/rst2pdf,aquavitae/rst2pdf,sychen/rst2pdf,aquavitae/rst2pdf-py3-dev,tonioo/rst2pdf,tonioo/rst2pdf,openpolis/rst2pdf-patched-docutils-0.8,aquavitae/rst2pdf-py3-dev,sychen/rst2pdf,openpolis/rst2pdf-patched-docutils-0.8 |
f71045f6bef5c8b9f7274ec41a965ccbe1044a01 | examples/test_markers.py | examples/test_markers.py | """ These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 # Runs B, C
... | """ These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 # Runs B, C
... | Update pytest marker test suite | Update pytest marker test suite
| Python | mit | mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase |
9b9582a1b7226ceb9cc65657ffb7fd7d51c8ea2a | lib/exp/featx/__init__.py | lib/exp/featx/__init__.py | __all__ = []
from lib.exp.featx.base import Featx
from lib.exp.tools.slider import Slider
class SlideFeatx(Featx, Slider):
def __init__(self, root, name):
Featx.__init__(self, root, name)
Slider.__init__(self, root, name)
def get_feats(self):
imgl = self.get_slides(None, gray=True, r... | __all__ = []
from lib.exp.featx.base import Feats
from lib.exp.tools.slider import Slider
from lib.exp.tools.video import Video
from lib.exp.prepare import Prepare
class Featx(Feats):
def __init__(self, root, name):
Feats.__init__(self, root, name)
def get_slide_feats(self):
ss = Slider(self... | Change to use `featx` in package | Change to use `featx` in package
| Python | agpl-3.0 | speed-of-light/pyslider |
f0e180387a37437fe7e8d37fa2806e7d47736bfc | pyheufybot/bothandler.py | pyheufybot/bothandler.py | import os
from twisted.internet import reactor
from heufybot import HeufyBot, HeufyBotFactory
from config import Config
class BotHandler(object):
factories = {}
globalConfig = None
def __init__(self):
print "--- Loading configs..."
self.globalConfig = Config("globalconfig.yml")
sel... | import os
from twisted.internet import reactor
from heufybot import HeufyBot, HeufyBotFactory
from config import Config
class BotHandler(object):
factories = {}
globalConfig = None
def __init__(self):
print "--- Loading configs..."
self.globalConfig = Config("globalconfig.yml")
... | Make sure the application doesn't continue without a config | Make sure the application doesn't continue without a config
| Python | mit | Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot |
22df7a89020cbbcf80a88bcf3572dea591884861 | avatar/urls.py | avatar/urls.py | from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('avatar.views',
url('^add/$', 'add', name='avatar_add'),
url('^change/$', 'change', name='avatar_change'),
url('^delete/$', 'delete', name='avatar_delete'),
url('^render_primary/(?P<user>[\+\w]+)/(?P<size>[\d]+)/$', 'render_prim... | from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('avatar.views',
url('^add/$', 'add', name='avatar_add'),
url('^change/$', 'change', name='avatar_change'),
url('^delete/$', 'delete', name='avatar_delete'),
url('^render_primary/(?P<user>[\w\d\.\-_]{3,30})/(?P<size>[\d]+)/$', 'r... | Support for username with extra chars. | Support for username with extra chars.
| Python | bsd-3-clause | tbabej/django-avatar,Brendtron5000/django-avatar,Nuevosmedios/django-avatar,stellalie/django-avatar,barbuza/django-avatar,allenling/django-avatar,allenling/django-avatar,tbabej/django-avatar,z4r/django-avatar,imgmix/django-avatar,hexenxp14/django-avatar,MachineandMagic/django-avatar,brajeshvit/avatarmodule,integricho/d... |
3c613bc1b729904883bca77924d892012b93cdc3 | powerline/renderers/pango_markup.py | powerline/renderers/pango_markup.py | # vim:fileencoding=utf-8:noet
from powerline.renderer import Renderer
from powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, ATTR_UNDERLINE
class PangoMarkupRenderer(Renderer):
'''Powerline Pango markup segment renderer.'''
@staticmethod
def hlstyle(*args, **kwargs):
# We don't need to explicitly reset attr... | # vim:fileencoding=utf-8:noet
from powerline.renderer import Renderer
from powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, ATTR_UNDERLINE
from xmlrpclib import escape as _escape
class PangoMarkupRenderer(Renderer):
'''Powerline Pango markup segment renderer.'''
@staticmethod
def hlstyle(*args, **kwargs):
... | Use xmlrpclib.escape for escaping in PangoMarkupRenderer | Use xmlrpclib.escape for escaping in PangoMarkupRenderer
| Python | mit | dragon788/powerline,cyrixhero/powerline,blindFS/powerline,QuLogic/powerline,magus424/powerline,areteix/powerline,dragon788/powerline,keelerm84/powerline,lukw00/powerline,xfumihiro/powerline,prvnkumar/powerline,magus424/powerline,s0undt3ch/powerline,dragon788/powerline,bartvm/powerline,bezhermoso/powerline,wfscheper/pow... |
62c24f6edaa91834d4a7b2a3f9b99b8b96322230 | nova/policies/hide_server_addresses.py | nova/policies/hide_server_addresses.py | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | Add policy description for 'os-hide-server-addresses' | Add policy description for 'os-hide-server-addresses'
This commit adds policy doc for 'os-hide-server-addresses' policies.
Partial implement blueprint policy-docs
Change-Id: I98edbd8579f052c74283bde2ec4f85d301a0807a
| Python | apache-2.0 | rahulunair/nova,gooddata/openstack-nova,mikalstill/nova,mahak/nova,Juniper/nova,mahak/nova,mikalstill/nova,Juniper/nova,rahulunair/nova,gooddata/openstack-nova,vmturbo/nova,openstack/nova,Juniper/nova,jianghuaw/nova,openstack/nova,gooddata/openstack-nova,klmitch/nova,gooddata/openstack-nova,jianghuaw/nova,klmitch/nova,... |
91e7a4f36637e7706dd17f1e093fe029f031bc3d | API/chat/migrations/0001_squashed_0002_auto_20150707_1647.py | API/chat/migrations/0001_squashed_0002_auto_20150707_1647.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
replaces = [(b'chat', '0001_squashed_0008_auto_20150702_1437'), (b'chat', '0002_auto_20150707_1647')]
dependencies = [
]
operations = [
migrations... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Channel',
fields=[
('id', models.AutoField(verb... | Remove replaces line on 0001_squashed | [HOTFIX] Remove replaces line on 0001_squashed
| Python | mit | gtklocker/ting,sirodoht/ting,gtklocker/ting,odyvarv/ting-1,VitSalis/ting,mbalamat/ting,VitSalis/ting,gtklocker/ting,sirodoht/ting,odyvarv/ting-1,gtklocker/ting,dionyziz/ting,mbalamat/ting,VitSalis/ting,odyvarv/ting-1,dionyziz/ting,mbalamat/ting,VitSalis/ting,odyvarv/ting-1,dionyziz/ting,mbalamat/ting,sirodoht/ting,dion... |
1124da4ea6c30f0c36854ec938aa9ea60cca73d4 | djangoappengine/db/expressions.py | djangoappengine/db/expressions.py | from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.expressions import ExpressionNode
OPERATION_MAP = {
ExpressionNode.ADD: lambda x, y: x + y,
ExpressionNode.SUB: lambda x, y: x - y,
ExpressionNode.MUL: lambda x, y: x * y,
ExpressionNode.DIV: lambda x, y: x / y,
Expres... | from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.expressions import ExpressionNode
OPERATION_MAP = {
ExpressionNode.ADD: lambda x, y: x + y,
ExpressionNode.SUB: lambda x, y: x - y,
ExpressionNode.MUL: lambda x, y: x * y,
ExpressionNode.DIV: lambda x, y: x / y,
Expres... | Fix ExpressionEvalutator for Django 1.5 changes to cols property | Fix ExpressionEvalutator for Django 1.5 changes to cols property
| Python | bsd-3-clause | django-nonrel/djangoappengine,Implisit/djangoappengine,dwdraju/djangoappengine |
7c4cf25868a907eb3ac718b2d4dbef2966fbe806 | ext/dcos-installer/dcos_installer/util/__init__.py | ext/dcos-installer/dcos_installer/util/__init__.py | import logging
import os
CONFIG_PATH = '/genconf/config.yaml'
SSH_KEY_PATH = '/genconf/ssh_key'
IP_DETECT_PATH = '/genconf/ip-detect'
SERVE_DIR = '/genconf/serve'
STATE_DIR = '/genconf/state'
GENCONF_DIR = '/genconf'
log = logging.getLogger(__name__)
def write_file(data, path):
try:
with open(path, 'w')... | CONFIG_PATH = '/genconf/config.yaml'
SSH_KEY_PATH = '/genconf/ssh_key'
IP_DETECT_PATH = '/genconf/ip-detect'
SERVE_DIR = '/genconf/serve'
STATE_DIR = '/genconf/state'
GENCONF_DIR = '/genconf'
| Remove dead code in dcos_installer.util | Remove dead code in dcos_installer.util
| Python | apache-2.0 | lingmann/dcos,xinxian0458/dcos,amitaekbote/dcos,branden/dcos,dcos/dcos,xinxian0458/dcos,surdy/dcos,lingmann/dcos,mesosphere-mergebot/dcos,jeid64/dcos,surdy/dcos,mesosphere-mergebot/mergebot-test-dcos,darkonie/dcos,mnaboka/dcos,mnaboka/dcos,dcos/dcos,jeid64/dcos,vishnu2kmohan/dcos,GoelDeepak/dcos,darkonie/dcos,asridhara... |
3771d3165d4873592f53d8b2401806297fe2989f | door/models.py | door/models.py | from django.db import models
from django.utils import timezone
from datetime import datetime
# Create your models here.
class DoorStatus(models.Model):
datetime = models.DateTimeField(default=timezone.now)
status = models.BooleanField(default=False)
name = models.CharField(max_length=20)
def __str__... | from django.db import models
from django.utils import timezone
from datetime import datetime
# Create your models here.
class DoorStatus(models.Model):
datetime = models.DateTimeField()
status = models.BooleanField(default=False)
name = models.CharField(max_length=20)
def __str__(self):
retu... | Remove default datetime in door | Remove default datetime in door
| Python | mit | hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website |
61b36218cc0cf74e90ac7ee8d7f02b1ffffe3890 | blues/wkhtmltopdf.py | blues/wkhtmltopdf.py | """
wkhtmltopdf Blueprint
blueprints:
- blues.wkhtmltopdf
"""
from fabric.decorators import task
from refabric.context_managers import sudo
from refabric.contrib import blueprints
from . import debian
__all__ = ['setup', 'configure']
blueprint = blueprints.get(__name__)
@task
def setup():
"""
Install... | """
wkhtmltopdf Blueprint
.. code-block:: yaml
blueprints:
- blues.wkhtmltopdf
settings:
wkhtmltopdf:
# wkhtmltopdf_version: 0.12.2.1
"""
from fabric.decorators import task
from refabric.context_managers import sudo, settings
from refabric.contrib import blueprints
from refabric... | Install wkhtmltox from the pkgs on sourceforge | Install wkhtmltox from the pkgs on sourceforge
They're compiled with patched QT. This version doesn't need X/Xvfb to run.
| Python | mit | gelbander/blues,andreif/blues,chrippa/blues,5monkeys/blues,adisbladis/blues,5monkeys/blues,Sportamore/blues,adisbladis/blues,andreif/blues,gelbander/blues,chrippa/blues,Sportamore/blues,jocke-l/blues,jocke-l/blues,andreif/blues,Sportamore/blues,adisbladis/blues,gelbander/blues,chrippa/blues,5monkeys/blues,jocke-l/blues |
63ff6313c1200910b749dc8d8488d6c7f2cd9c5f | axelrod/tests/unit/test_classification.py | axelrod/tests/unit/test_classification.py | """Tests for the classification"""
import unittest
import axelrod
class TestClassification(unittest.TestCase):
def test_known_classifiers(self):
# Grabbing all the strategies: this will be changed to just be `axelrod.strategies`
strategies = axelrod.basic_strategies
strategies += axelrod... | """Tests for the classification"""
import unittest
import axelrod
class TestClassification(unittest.TestCase):
def test_known_classifiers(self):
# Grabbing all the strategies: this will be changed to just be
# `axelrod.strategies`
strategies = axelrod.basic_strategies
strategies ... | Add a test that checks that different instances can have different behaviour. | Add a test that checks that different instances can have different
behaviour.
| Python | mit | emmagordon/Axelrod,emmagordon/Axelrod,risicle/Axelrod,kathryncrouch/Axelrod,bootandy/Axelrod,uglyfruitcake/Axelrod,mojones/Axelrod,uglyfruitcake/Axelrod,bootandy/Axelrod,mojones/Axelrod,kathryncrouch/Axelrod,risicle/Axelrod |
039afd96fd66844e3d0ac031458c976d74aca325 | infra/bots/recipe_modules/flavor/__init__.py | infra/bots/recipe_modules/flavor/__init__.py | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
'builder_name_schema',
'depot_tools/bot_update',
'depot_tools/cipd',
'depot_tools/gclient',
'depot_tools/git',
'docker',
'env',
'inf... | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
'builder_name_schema',
'docker',
'env',
'infra',
'recipe_engine/context',
'recipe_engine/file',
'recipe_engine/json',
'recipe_engine... | Remove unnecessary depot_tools dependency in flavor module | [recipes] Remove unnecessary depot_tools dependency in flavor module
Change-Id: Ic1f3896a450bd81bb8c4859d3998c9873af821f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263016
Reviewed-by: Ravi Mistry <9fa2e7438b8cb730f96b74865492597170561628@google.com>
Commit-Queue: Eric Boren <0e499112533c8544f0505ea0d0... | Python | bsd-3-clause | HalCanary/skia-hc,google/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,HalCanary/skia-hc,google/skia,aosp-mirror/platform_external_skia,HalCanary/ski... |
44023406197bd9271afd60405e323503ce6963a1 | tests/test_nova_api_docs_tracker.py | tests/test_nova_api_docs_tracker.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_nova_api_docs_tracker
----------------------------------
Tests for `nova_api_docs_tracker` module.
"""
import unittest
from nova_api_docs_tracker import nova_api_docs_tracker
class TestNova_api_docs_tracker(unittest.TestCase):
def setUp(self):
pa... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_nova_api_docs_tracker
----------------------------------
Tests for `nova_api_docs_tracker` module.
"""
import unittest
from nova_api_docs_tracker import main
class TestNova_api_docs_tracker(unittest.TestCase):
def setUp(self):
pass
def tearD... | Fix stub unit test for main.py rename | Fix stub unit test for main.py rename
| Python | apache-2.0 | missaugustina/nova-api-docs-tracker,missaugustina/nova-api-docs-tracker,missaugustina/nova-api-docs-tracker,missaugustina/nova-api-docs-tracker |
b612c3703a3b1581bfc7826f1e29a3b6053f0f4e | pal/services/joke_service.py | pal/services/joke_service.py | import re
from os import path
from pal.services.service import Service
from pal.services.service import wrap_response
def get_jokes():
file_path = path.realpath(path.join(path.dirname(__file__),
"jokes.txt"))
with open(file_path, 'rb') as joke_file:
for line in... | import re
from os import path
from pal.services.service import Service
from pal.services.service import wrap_response
def get_jokes():
file_path = path.realpath(path.join(path.dirname(__file__),
"jokes.txt"))
with open(file_path, 'rb') as joke_file:
for line in... | Make joke parsing more robust | Make joke parsing more robust
| Python | bsd-3-clause | Machyne/pal,Machyne/pal,Machyne/pal,Machyne/pal |
66cdb36231ff1192a8a2e6b15c4b8d524cfbff6d | powerline/renderers/pango_markup.py | powerline/renderers/pango_markup.py | # vim:fileencoding=utf-8:noet
from powerline.renderer import Renderer
from powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, ATTR_UNDERLINE
from xmlrpclib import escape as _escape
class PangoMarkupRenderer(Renderer):
'''Powerline Pango markup segment renderer.'''
@staticmethod
def hlstyle(*args, **kwargs):
... | # vim:fileencoding=utf-8:noet
from powerline.renderer import Renderer
from powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, ATTR_UNDERLINE
from xml.sax.saxutils import escape as _escape
class PangoMarkupRenderer(Renderer):
'''Powerline Pango markup segment renderer.'''
@staticmethod
def hlstyle(*args, **kwa... | Use xml.sax.saxutils.escape in place of xmlrpclib.escape | Use xml.sax.saxutils.escape in place of xmlrpclib.escape
The latter is not available in python 3 | Python | mit | dragon788/powerline,xxxhycl2010/powerline,cyrixhero/powerline,s0undt3ch/powerline,S0lll0s/powerline,EricSB/powerline,prvnkumar/powerline,blindFS/powerline,QuLogic/powerline,lukw00/powerline,dragon788/powerline,firebitsbr/powerline,Liangjianghao/powerline,DoctorJellyface/powerline,wfscheper/powerline,wfscheper/powerline... |
9564848e61df038396fbab95995a40f2e5a5970a | l10n_br_zip/__openerp__.py | l10n_br_zip/__openerp__.py | # -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localisation ZIP Codes',
'license': 'AGPL-3',
'author': 'Akretion, Odoo Community Association (OCA)',
'version': '8.0.1.0.1',
'depends': [
... | # -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Brazilian Localisation ZIP Codes',
'license': 'AGPL-3',
'author': 'Akretion, Odoo Community Association (OCA)',
'version': '9.0.1.0.0',
'depends': [
... | Change the version of module. | [MIG] Change the version of module.
| Python | agpl-3.0 | kmee/l10n-brazil,kmee/l10n-brazil |
c0f7dc1dcfdbabff116f8d7132b191397fd9007f | src/sentry/api/serializers/models/filechange.py | src/sentry/api/serializers/models/filechange.py | from __future__ import absolute_import
import six
from sentry.api.serializers import Serializer, register
from sentry.models import Commit, CommitFileChange
from sentry.api.serializers.models.release import get_users_for_commits
@register(CommitFileChange)
class CommitFileChangeSerializer(Serializer):
def get_a... | from __future__ import absolute_import
import six
from sentry.api.serializers import Serializer, register
from sentry.models import Commit, CommitFileChange
from sentry.api.serializers.models.release import get_users_for_commits
@register(CommitFileChange)
class CommitFileChangeSerializer(Serializer):
def get_a... | Use dictionary lookup only once | Use dictionary lookup only once
| Python | bsd-3-clause | looker/sentry,JackDanger/sentry,mvaled/sentry,gencer/sentry,beeftornado/sentry,jean/sentry,jean/sentry,BuildingLink/sentry,ifduyue/sentry,mvaled/sentry,ifduyue/sentry,BuildingLink/sentry,looker/sentry,JamesMura/sentry,looker/sentry,jean/sentry,gencer/sentry,JamesMura/sentry,ifduyue/sentry,JamesMura/sentry,BuildingLink/... |
befadd8fc0482adb55f63ac51166f2330c897d7a | src/diamond/handler/httpHandler.py | src/diamond/handler/httpHandler.py | #!/usr/bin/env python
# coding=utf-8
from Handler import Handler
import urllib2
class HttpPostHandler(Handler):
# Inititalize Handler with url and batch size
def __init__(self, config=None):
Handler.__init__(self, config)
self.metrics = []
self.batch_size = int(self.config.get('batch', 1... | #!/usr/bin/env python
# coding=utf-8
"""
Send metrics to a http endpoint via POST
#### Dependencies
* urllib2
#### Configuration
Enable this handler
* handers = diamond.handler.httpHandler.HttpPostHandler
* url = http://www.example.com/endpoint
"""
from Handler import Handler
import urllib2
class HttpPo... | Add in basic HttpPostHandler docs | Add in basic HttpPostHandler docs
| Python | mit | szibis/Diamond,sebbrandt87/Diamond,TinLe/Diamond,datafiniti/Diamond,Ssawa/Diamond,ramjothikumar/Diamond,signalfx/Diamond,codepython/Diamond,mfriedenhagen/Diamond,thardie/Diamond,works-mobile/Diamond,cannium/Diamond,eMerzh/Diamond-1,actmd/Diamond,Netuitive/Diamond,jriguera/Diamond,TinLe/Diamond,bmhatfield/Diamond,hvnswe... |
edd8ac2d77b747cffbcf702e71f2633a148d64c6 | wagtail/wagtailcore/hooks.py | wagtail/wagtailcore/hooks.py | from django.conf import settings
try:
from importlib import import_module
except ImportError:
# for Python 2.6, fall back on django.utils.importlib (deprecated as of Django 1.7)
from django.utils.importlib import import_module
_hooks = {}
def register(hook_name, fn=None):
"""
Register hook for ``... | from django.conf import settings
try:
from importlib import import_module
except ImportError:
# for Python 2.6, fall back on django.utils.importlib (deprecated as of Django 1.7)
from django.utils.importlib import import_module
_hooks = {}
def register(hook_name, fn=None):
"""
Register hook for ``... | Return the function again from the hook decorator | Return the function again from the hook decorator
The decorator variant of hook registration did not return anything,
meaning that the decorated function would end up being `None`. This was
not noticed, as the functions are rarely called manually, as opposed to
being invoked via the hook.
| Python | bsd-3-clause | kaedroho/wagtail,willcodefortea/wagtail,JoshBarr/wagtail,takeshineshiro/wagtail,torchbox/wagtail,dresiu/wagtail,m-sanders/wagtail,jnns/wagtail,bjesus/wagtail,jorge-marques/wagtail,nilnvoid/wagtail,timorieber/wagtail,rsalmaso/wagtail,Toshakins/wagtail,tangentlabs/wagtail,nimasmi/wagtail,WQuanfeng/wagtail,timorieber/wagt... |
a6f291a3beb7ecb7d67b81fe92e7cca6db2139dc | example_scraper.py | example_scraper.py | #!/usr/bin/env python
import json
import requests
API = 'http://localhost:8000/api/1.0'
AUTH_PARAMS = {
'email': 'panda@pandaproject.net',
'api_key': 'edfe6c5ffd1be4d3bf22f69188ac6bc0fc04c84b'
}
# Create dataset
dataset = {
'name': 'Test Dataset from API',
'schema': [{
'column': 'A',
... | #!/usr/bin/env python
import json
import requests
API = 'http://localhost:8000/api/1.0'
AUTH_PARAMS = {
'email': 'panda@pandaproject.net',
'api_key': 'edfe6c5ffd1be4d3bf22f69188ac6bc0fc04c84b'
}
DATASET_SLUG = 'test-dataset'
# Check if dataset exists
response = requests.get(API + '/dataset/%s/' % DATASET_SL... | Update example scraper to use known slug. | Update example scraper to use known slug.
| Python | mit | PalmBeachPost/panda,pandaproject/panda,PalmBeachPost/panda,newsapps/panda,ibrahimcesar/panda,pandaproject/panda,NUKnightLab/panda,ibrahimcesar/panda,NUKnightLab/panda,datadesk/panda,PalmBeachPost/panda,PalmBeachPost/panda,NUKnightLab/panda,ibrahimcesar/panda,datadesk/panda,ibrahimcesar/panda,pandaproject/panda,newsapps... |
2c3281754bd0e57a263a85f518eb49fbe6a8d72b | corehq/apps/importer/management/commands/import_cases.py | corehq/apps/importer/management/commands/import_cases.py | import json
from datetime import datetime
from django.core.management import BaseCommand, CommandError
from corehq.apps.importer.tasks import do_import
from corehq.apps.importer.util import ImporterConfig, ExcelFile
from corehq.apps.users.models import WebUser
class Command(BaseCommand):
help = "import cases from... | import json
from datetime import datetime
from django.core.management import BaseCommand, CommandError
from dimagi.utils.web import json_handler
from corehq.apps.importer.tasks import do_import
from corehq.apps.importer.util import ImporterConfig, ExcelFile
from corehq.apps.users.models import WebUser
class Command(B... | Use json_handler to force ugettext_lazy | Use json_handler to force ugettext_lazy
| Python | bsd-3-clause | dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq |
f81a2f9e3f1123ec474bce3278107a94c70e0dc3 | python/helpers/pydev/_pydev_bundle/_pydev_filesystem_encoding.py | python/helpers/pydev/_pydev_bundle/_pydev_filesystem_encoding.py | def __getfilesystemencoding():
'''
Note: there's a copy of this method in interpreterInfo.py
'''
import sys
try:
ret = sys.getfilesystemencoding()
if not ret:
raise RuntimeError('Unable to get encoding.')
return ret
except:
try:
#Handle Jyt... | import sys
def __getfilesystemencoding():
'''
Note: there's a copy of this method in interpreterInfo.py
'''
try:
ret = sys.getfilesystemencoding()
if not ret:
raise RuntimeError('Unable to get encoding.')
return ret
except:
try:
#Handle Jytho... | Fix deadlock in remote debugger (PY-18546) | Fix deadlock in remote debugger (PY-18546)
| Python | apache-2.0 | salguarnieri/intellij-community,ThiagoGarciaAlves/intellij-community,allotria/intellij-community,semonte/intellij-community,idea4bsd/idea4bsd,semonte/intellij-community,da1z/intellij-community,ThiagoGarciaAlves/intellij-community,mglukhikh/intellij-community,allotria/intellij-community,xfournet/intellij-community,salgu... |
8a72eff36b66492e17cfeb0383164a34dbf75ce0 | addons/purchase/report/__init__.py | addons/purchase/report/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | Fix useless import following the removal of rml purchase reports | [FIX] Fix useless import following the removal of rml purchase reports
bzr revid: openerp-sle@openerp-sle.home-20140214150700-2zuukk4ahs4q1zhs | Python | agpl-3.0 | odoousers2014/odoo,nuncjo/odoo,markeTIC/OCB,oasiswork/odoo,andreparames/odoo,nexiles/odoo,Endika/odoo,Danisan/odoo-1,spadae22/odoo,0k/OpenUpgrade,grap/OpenUpgrade,bealdav/OpenUpgrade,abstract-open-solutions/OCB,mustafat/odoo-1,papouso/odoo,provaleks/o8,OpusVL/odoo,odooindia/odoo,sinbazhou/odoo,slevenhagen/odoo-npg,rdeh... |
b196d5e58c611508bbc0bf891752d6abf135b67d | generic/example/manage.py | generic/example/manage.py | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| Make sure sys.path is setup correctly | Make sure sys.path is setup correctly
| Python | apache-2.0 | texastribune/tt_app_templates,texastribune/tt_app_templates |
43d5041c09caadd7bd67195ba7519e8ef006f506 | corehq/pillows/group.py | corehq/pillows/group.py | from corehq.apps.groups.models import Group
from corehq.pillows.mappings.group_mapping import GROUP_INDEX, GROUP_MAPPING
from dimagi.utils.decorators.memoized import memoized
from pillowtop.listener import AliasedElasticPillow
from django.conf import settings
class GroupPillow(AliasedElasticPillow):
"""
Simpl... | from corehq.apps.groups.models import Group
from corehq.pillows.mappings.group_mapping import GROUP_INDEX, GROUP_MAPPING
from dimagi.utils.decorators.memoized import memoized
from pillowtop.listener import AliasedElasticPillow
from django.conf import settings
class GroupPillow(HQPillow):
"""
Simple/Common Cas... | Switch over to extend HQPillow | Switch over to extend HQPillow
| Python | bsd-3-clause | qedsoftware/commcare-hq,puttarajubr/commcare-hq,gmimano/commcaretest,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,SEL-Columbia/commcare-hq,gmimano/commcaretest,SEL-Columbia/commcare-hq,puttarajubr/commcare-hq,gmi... |
9eb265fa2142b559b15063bc9322fc60b46a300b | mezzanine/project_template/deploy/gunicorn.conf.py | mezzanine/project_template/deploy/gunicorn.conf.py | from __future__ import unicode_literals
import os
bind = "127.0.0.1:%(gunicorn_port)s"
workers = (os.sysconf("SC_NPROCESSORS_ONLN") * 2) + 1
loglevel = "error"
proc_name = "%(proj_name)s"
| from __future__ import unicode_literals
import multiprocessing
bind = "127.0.0.1:%(gunicorn_port)s"
workers = multiprocessing.cpu_count() * 2 + 1
loglevel = "error"
proc_name = "%(proj_name)s"
| Update to use multiprocessing library | Update to use multiprocessing library | Python | bsd-2-clause | promil23/mezzanine,damnfine/mezzanine,Cajoline/mezzanine,stephenmcd/mezzanine,agepoly/mezzanine,damnfine/mezzanine,mush42/mezzanine,eino-makitalo/mezzanine,mush42/mezzanine,stephenmcd/mezzanine,stephenmcd/mezzanine,emile2016/mezzanine,frankier/mezzanine,promil23/mezzanine,readevalprint/mezzanine,webounty/mezzanine,dovy... |
ebfe1254ea11112689fa606cd6c29100a26e058d | acme/acme/__init__.py | acme/acme/__init__.py | """ACME protocol implementation.
This module is an implementation of the `ACME protocol`_. Latest
supported version: `v02`_.
.. _`ACME protocol`: https://github.com/letsencrypt/acme-spec
.. _`v02`:
https://github.com/letsencrypt/acme-spec/commit/d328fea2d507deb9822793c512830d827a4150c4
"""
| """ACME protocol implementation.
This module is an implementation of the `ACME protocol`_. Latest
supported version: `draft-ietf-acme-01`_.
.. _`ACME protocol`: https://github.com/ietf-wg-acme/acme/
.. _`draft-ietf-acme-01`:
https://github.com/ietf-wg-acme/acme/tree/draft-ietf-acme-acme-01
"""
| Update the ACME github repository URL. | Update the ACME github repository URL.
| Python | apache-2.0 | jsha/letsencrypt,letsencrypt/letsencrypt,mitnk/letsencrypt,stweil/letsencrypt,bsmr-misc-forks/letsencrypt,stweil/letsencrypt,letsencrypt/letsencrypt,VladimirTyrin/letsencrypt,lmcro/letsencrypt,lmcro/letsencrypt,DavidGarciaCat/letsencrypt,DavidGarciaCat/letsencrypt,twstrike/le_for_patching,brentdax/letsencrypt,mitnk/let... |
dac411035f12f92f336d6c42aa3103b3c04f01ab | backend/populate_dimkarakostas.py | backend/populate_dimkarakostas.py | from string import ascii_lowercase
import django
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
django.setup()
from breach.models import Target, Victim
endpoint = 'https://dimkarakostas.com/rupture/test.php?ref=%s'
prefix = 'imper'
alphabet = ascii_lowercase
secretlength = 9
target_1 ... | from string import ascii_lowercase
import django
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
django.setup()
from breach.models import Target, Victim
endpoint = 'https://dimkarakostas.com/rupture/test.php?ref=%s'
prefix = 'imper'
alphabet = ascii_lowercase
secretlength = 9
target_1 ... | Add method comment to population script for easy deploy | Add method comment to population script for easy deploy
| Python | mit | dionyziz/rupture,dimkarakostas/rupture,esarafianou/rupture,dionyziz/rupture,dimriou/rupture,dimkarakostas/rupture,dionyziz/rupture,dimriou/rupture,dimkarakostas/rupture,dimkarakostas/rupture,dionyziz/rupture,esarafianou/rupture,dimriou/rupture,dimriou/rupture,esarafianou/rupture,esarafianou/rupture,dimkarakostas/ruptur... |
1eb2d3b9fa773455e9c69921b58529241e59b00e | thezombies/management/commands/report_invalid_urls.py | thezombies/management/commands/report_invalid_urls.py | from __future__ import division
from django.core.management.base import BaseCommand
from django.utils import timezone
from thezombies.models import (Agency, Probe)
REPORT_DATE_FORMATTER = u"{:%Y-%m-%d %I:%M%p %Z}\n"
class Command(BaseCommand):
"""Show some information on invalid/bad urls"""
def handle(self,... | from __future__ import division
from django.core.management.base import BaseCommand
from django.utils import timezone
from thezombies.models import (Agency, Probe)
REPORT_DATE_FORMATTER = u"{:%Y-%m-%d %I:%M%p %Z}\n"
class Command(BaseCommand):
"""Show some information on invalid/bad urls"""
def handle(self,... | Add url count per agency to the invalid url report | Add url count per agency to the invalid url report
| Python | bsd-3-clause | sunlightlabs/thezombies,sunlightlabs/thezombies,sunlightlabs/thezombies,sunlightlabs/thezombies |
462b8e53c8a1add0f471f53d31718816939f1372 | cineapp/utils.py | cineapp/utils.py | # -*- coding: utf-8 -*-
def frange(start, end, step):
tmp = start
while(tmp <= end):
yield tmp
tmp += step
| # -*- coding: utf-8 -*-
from cineapp import db
from cineapp.models import Movie, Mark
from sqlalchemy.sql.expression import literal, desc
def frange(start, end, step):
tmp = start
while(tmp <= end):
yield tmp
tmp += step
def get_activity_list(start, length):
"""
Returns an array containing activity records ... | Move activity SQL query into a dedicated function | Move activity SQL query into a dedicated function
The SQL query based on the UNION predicate is now into a function which takes as
parameters the number of record we want to have in the result. This function
will be used for the activity dashboard and also for the new global activity
page using the datatable plugin.
... | Python | mit | ptitoliv/cineapp,ptitoliv/cineapp,ptitoliv/cineapp |
2280624b54ec8f1ebae656336fab13d032f504ad | antevents/__init__.py | antevents/__init__.py | # Copyright 2016 by MPI-SWS and Data-Ken Research.
# Licensed under the Apache 2.0 License.
"""
This is the main package for antevents. Directly within this package you fill
find the following modules:
* `base` - the core abstractions and classes of the system.
* `sensor` - defines data types and functions specifica... | # Copyright 2016 by MPI-SWS and Data-Ken Research.
# Licensed under the Apache 2.0 License.
"""
This is the main package for antevents. Directly within this package you fill
find the following module:
* `base` - the core abstractions and classes of the system.
The rest of the functionality is in sub-packages:
* `a... | Update doc string on location of sensors | Update doc string on location of sensors
| Python | apache-2.0 | mpi-sws-rse/thingflow-python,mpi-sws-rse/antevents-python,mpi-sws-rse/thingflow-python,mpi-sws-rse/antevents-python |
d36053764e8a5776d3c37a7e35beb9ba5cb67386 | dask/diagnostics/__init__.py | dask/diagnostics/__init__.py | from .profile import Profiler, ResourceProfiler
from .progress import ProgressBar
| from .profile import Profiler, ResourceProfiler
from .progress import ProgressBar
try:
from .profile_visualize import visualize
except ImportError:
pass
| Add visualize to diagnostics import | Add visualize to diagnostics import
| Python | bsd-3-clause | PhE/dask,mraspaud/dask,vikhyat/dask,dask/dask,jcrist/dask,vikhyat/dask,mrocklin/dask,mrocklin/dask,cpcloud/dask,pombredanne/dask,ContinuumIO/dask,ContinuumIO/dask,dask/dask,gameduell/dask,blaze/dask,blaze/dask,jakirkham/dask,chrisbarber/dask,jcrist/dask,PhE/dask,mikegraham/dask,jakirkham/dask,cowlicks/dask,mraspaud/das... |
6c417f49ebd0f466ebf8100a28006e7c5ea2ff3d | tests/lib/__init__.py | tests/lib/__init__.py | from os.path import abspath, dirname, join
import sh
import psycopg2
import requests
PROJECT_FOLDER=dirname(dirname(abspath(__file__)))
DOCKER_FOLDER=join(PROJECT_FOLDER, 'docker')
def docker_compose(version, *args):
sh.docker_compose('-f', 'docker/{version}/docker-compose.yml'.format(version=version), *args)
d... | from os.path import abspath, dirname, join
import sh
import psycopg2
import requests
PROJECT_FOLDER=dirname(dirname(abspath(__file__)))
DOCKER_FOLDER=join(PROJECT_FOLDER, 'docker')
def docker_compose(version, *args):
sh.docker_compose('-f', 'docker/{version}/docker-compose.yml'.format(version=version), *args)
d... | Create somewhat questionable sql function | Create somewhat questionable sql function
| Python | mit | matthewfranglen/postgres-elasticsearch-fdw |
b69301c57076f86e99f738d5434dd75fd912753d | tests/test_preview.py | tests/test_preview.py | import pytest
from web_test_base import *
class TestIATIPreview(WebTestBase):
requests_to_load = {
'IATI Preview': {
'url': 'http://preview.iatistandard.org/'
}
}
def test_contains_links(self, loaded_request):
"""
Test that each page contains links to the define... | import pytest
from web_test_base import *
class TestIATIPreview(WebTestBase):
requests_to_load = {
'IATI Preview': {
'url': 'http://preview.iatistandard.org/'
}
}
def test_contains_links(self, loaded_request):
"""
Test that each page contains links to the define... | Add test for form on Preview Tool | Add test for form on Preview Tool
Test to see that the form to enter a URL to use the Preview Tool
exists, has the correct action and has the correct elements.
| Python | mit | IATI/IATI-Website-Tests |
1b0d153b0f08e0ca5b962b0b9d839f745a035c62 | tests/test_stock.py | tests/test_stock.py | import unittest
from datetime import datetime
from stock import Stock
class StockTest(unittest.TestCase):
def test_price_of_a_new_stock_class_should_be_None(self):
stock = Stock("GOOG")
self.assertIsNone(stock.price)
def test_stock_update(self):
"""An update should set the price on t... | import unittest
from datetime import datetime
from stock import Stock
class StockTest(unittest.TestCase):
def test_new_stock_price(self):
"""A new stock should have a price that is None.
"""
stock = Stock("GOOG")
self.assertIsNone(stock.price)
def test_stock_update(self):
... | Add comment and clean up code. | Add comment and clean up code.
| Python | mit | bsmukasa/stock_alerter |
9138112f3abef61a96485ade7e0b484a43429b81 | tests/unit/actions.py | tests/unit/actions.py | """Unit tests for `pycall.actions`."""
class TestActions(TestCase):
"""Test all `pycall.actions` classes to ensure they are actual
`pycall.actions.Action` subclasses.
"""
pass
| """Unit tests for `pycall.actions`."""
| Revert "Adding test case stub." | Revert "Adding test case stub."
This reverts commit 6c6b08a63b308690144d73f54b98000e3b1b5672.
| Python | unlicense | rdegges/pycall |
ec6099421bad222595be15f4f0b2596952d8c9cc | username_to_uuid.py | username_to_uuid.py | """ Username to UUID
Converts a Minecraft username to it's UUID equivalent.
Uses the official Mojang API to fetch player data.
"""
import http.client
import json
class UsernameToUUID:
def __init__(self, username):
self.username = username
def get_uuid(self, timestamp=None):
"""
Ge... | """ Username to UUID
Converts a Minecraft username to it's UUID equivalent.
Uses the official Mojang API to fetch player data.
"""
import http.client
import json
class UsernameToUUID:
def __init__(self, username):
self.username = username
def get_uuid(self, timestamp=None):
"""
Ge... | Improve robustness: surround the 'id' fetch from result array with a try clause. | Improve robustness: surround the 'id' fetch from result array with a try clause.
| Python | mit | mrlolethan/MinecraftUsernameToUUID |
88bd75c4b0e039c208a1471d84006cdfb4bbaf93 | starbowmodweb/site/templatetags/bbformat.py | starbowmodweb/site/templatetags/bbformat.py | """
This module defines all of our bbcode capabilities.
To add a new bbcode tag do the following:
def bbcode_<tag_name>(tag_name, value, options, parent, context):
return formatted_html
bbcode_parser.add_formatter("<tag_name>", func_name, **tag_options)
For more information on the different argumnen... | """
This module defines all of our bbcode capabilities.
To add a new bbcode tag do the following:
def bbcode_<tag_name>(tag_name, value, options, parent, context):
return formatted_html
bbcode_parser.add_formatter("<tag_name>", func_name, **tag_options)
For more information on the different argumnen... | Add support for email and font bbcode tags. | Add support for email and font bbcode tags.
| Python | mit | Starbow/StarbowWebSite,Starbow/StarbowWebSite,Starbow/StarbowWebSite |
4594ed6599d98f1773a6e393c617c3230a1d8bec | django_evolution/__init__.py | django_evolution/__init__.py | """Django Evolution version and package information.
These variables and functions can be used to identify the version of
Review Board. They're largely used for packaging purposes.
"""
from __future__ import unicode_literals
# The version of Django Evolution
#
# This is in the format of:
#
# (Major, Minor, Micro,... | """Django Evolution version and package information.
These variables and functions can be used to identify the version of
Review Board. They're largely used for packaging purposes.
"""
from __future__ import unicode_literals
# The version of Django Evolution
#
# This is in the format of:
#
# (Major, Minor, Micro,... | Remove a deprecation warning when computing the package version. | Remove a deprecation warning when computing the package version.
In pretty much all of our Python packages, we generate a package version
using legacy identifiers of "alpha" and "beta". These get turned into
"a" and "b" by `pkg_resources`, and a warning is thrown to inform us
that we're doing it wrong.
To reduce thos... | Python | bsd-3-clause | beanbaginc/django-evolution |
14c872b3405326079ba01f9309622bb0188bf8ce | Install/toolbox/scripts/utils.py | Install/toolbox/scripts/utils.py | import sys
import collections
def parameters_from_args(defaults_tuple=None, sys_args):
"""Provided a set of tuples for default values, return a list of mapped
variables."""
defaults = collections.OrderedDict(defaults_tuple)
if defaults_tuple is not None:
args = len(sys_args) - 1
... | # -*- coding: utf-8 -*-
import csv
import collections
import sys
import re
import os
import binascii
def parameters_from_args(defaults_tuple=None, sys_args):
"""Provided a set of tuples for default values, return a list of mapped
variables."""
defaults = collections.OrderedDict(defaults_tuple... | Update includes; set encoding for file. | Update includes; set encoding for file.
| Python | mpl-2.0 | genegis/genegis,genegis/genegis,genegis/genegis |
d4c9603e4c5913b02746af3dec21f682d906e001 | nn/file/__init__.py | nn/file/__init__.py | import functools
import tensorflow as tf
from . import cnn_dailymail_rc
from .. import collections
from ..flags import FLAGS
from ..util import func_scope, dtypes
from .util import batch_queue, add_queue_runner
READERS = { "cnn_dailymail_rc": cnn_dailymail_rc.read_files }
@func_scope()
def read_files(file_pattern... | import functools
import tensorflow as tf
from . import cnn_dailymail_rc
from .. import collections
from ..flags import FLAGS
from ..util import func_scope, dtypes
from .util import batch_queue, add_queue_runner
READERS = { "cnn_dailymail_rc": cnn_dailymail_rc.read_files }
@func_scope()
def read_files(file_pattern... | Make metric_name option of monitored_batch_queue | Make metric_name option of monitored_batch_queue
| Python | unlicense | raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten |
02f8f992aca37d21b9ae119f13b46de8eb1541ae | gsl/utils.py | gsl/utils.py | #!/usr/bin/env python
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger()
def yield_packages(handle, meta=False, retcode=None):
for lineno, line in enumerate(handle):
if line.startswith('#'):
continue
try:
data = line.split('\t')
keys... | #!/usr/bin/env python
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger()
def yield_packages(handle, meta=False, retcode=None):
for lineno, line in enumerate(handle):
if line.startswith('#'):
continue
try:
data = line.split('\t')
keys... | Return retcode properly iff erroring | Return retcode properly iff erroring
fixes #13
| Python | mit | erasche/community-package-cache,erasche/community-package-cache,gregvonkuster/cargo-port,erasche/community-package-cache,galaxyproject/cargo-port,galaxyproject/cargo-port,gregvonkuster/cargo-port,gregvonkuster/cargo-port |
508167ee3c289258857aee0963d4917c39201d9a | tailor/listeners/mainlistener.py | tailor/listeners/mainlistener.py | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import isUpperCamelCase
class MainListener(SwiftListener):
def enterClassName(self, ctx):
className = ctx.getText()
if not isUpperCamelCase(className):
print('Line', str(ctx.start.line) + ':', 'Class nam... | from tailor.swift.swiftlistener import SwiftListener
from tailor.utils.charformat import isUpperCamelCase
class MainListener(SwiftListener):
def enterClassName(self, ctx):
self.__verify_upper_camel_case(ctx, 'Class names should be in UpperCamelCase')
def enterEnumName(self, ctx):
pass
d... | Add method to handle UpperCamelCase verification | Add method to handle UpperCamelCase verification
| Python | mit | sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor,sleekbyte/tailor |
a9abf8361f8728dfb1ef18a27c5eaad84ca2f054 | accounting/apps/clients/forms.py | accounting/apps/clients/forms.py | from django.forms import ModelForm
from .models import Client
class ClientForm(ModelForm):
class Meta:
model = Client
fields = (
"name",
"address_line_1",
"address_line_2",
"city",
"postal_code",
"country",
)
| from django.forms import ModelForm
from .models import Client
class ClientForm(ModelForm):
class Meta:
model = Client
fields = (
"name",
"address_line_1",
"address_line_2",
"city",
"postal_code",
"country",
"organ... | Add the relationship field to the Client form | Add the relationship field to the Client form
| Python | mit | kenjhim/django-accounting,dulaccc/django-accounting,kenjhim/django-accounting,kenjhim/django-accounting,dulaccc/django-accounting,dulaccc/django-accounting,kenjhim/django-accounting,dulaccc/django-accounting |
a485998447ffbe5a19ce8f9b49e61ac313c8241a | glitter_events/search_indexes.py | glitter_events/search_indexes.py | # -*- coding: utf-8 -*-
from haystack import indexes
from .models import Event
class EventIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
def get_model(self):
return Event
def index_queryset(self, using=None):
return self.get_mo... | # -*- coding: utf-8 -*-
import datetime
from django.conf import settings
from django.utils import timezone
from haystack import indexes
from .models import Event
class EventIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
def get_model(self):
... | Add option to ignore expired events for the search index | Add option to ignore expired events for the search index
| Python | bsd-3-clause | blancltd/django-glitter-events,blancltd/django-glitter-events |
cccd6e8fe76fc96b39791912ecfd07f867d8dacc | cms/djangoapps/export_course_metadata/management/commands/export_course_metadata_for_all_courses.py | cms/djangoapps/export_course_metadata/management/commands/export_course_metadata_for_all_courses.py | """
Export course metadata for all courses
"""
from django.core.management.base import BaseCommand
from xmodule.modulestore.django import modulestore
from cms.djangoapps.export_course_metadata.signals import export_course_metadata
class Command(BaseCommand):
"""
Export course metadata for all courses
"... | """
Export course metadata for all courses
"""
from django.core.management.base import BaseCommand
from xmodule.modulestore.django import modulestore
from cms.djangoapps.export_course_metadata.signals import export_course_metadata
from cms.djangoapps.export_course_metadata.tasks import export_course_metadata_task
... | Call celery task directly from management command instead of calling the signal | Call celery task directly from management command instead of calling the signal
AA-461
| Python | agpl-3.0 | eduNEXT/edunext-platform,EDUlib/edx-platform,arbrandes/edx-platform,edx/edx-platform,angelapper/edx-platform,edx/edx-platform,eduNEXT/edx-platform,eduNEXT/edx-platform,EDUlib/edx-platform,eduNEXT/edunext-platform,eduNEXT/edunext-platform,angelapper/edx-platform,EDUlib/edx-platform,eduNEXT/edx-platform,angelapper/edx-pl... |
e04cec6c4260a181c773371406323758d9f162bf | examples/adaptive_scan_demo.py | examples/adaptive_scan_demo.py | import matplotlib.pyplot as plt
from bluesky import RunEngine, Mover, SynGauss
from bluesky.examples import adaptive_scan
RE = RunEngine()
RE.verbose = False
motor = Mover('motor', ['pos'])
det = SynGauss('det', motor, 'pos', center=0, Imax=1, sigma=1)
def live_scalar_plotter(ax, y, x):
x_data, y_data = [], []... | import matplotlib.pyplot as plt
from bluesky import RunEngine
from bluesky.scans import AdaptiveAscan
from bluesky.examples import Mover, SynGauss
from bluesky.callbacks import LivePlot, LiveTable
from bluesky.tests.utils import setup_test_run_engine
#plt.ion()
RE = setup_test_run_engine()
motor = Mover('motor', ['p... | Fix adaptive example with LivePlot | WIP: Fix adaptive example with LivePlot
| Python | bsd-3-clause | dchabot/bluesky,sameera2004/bluesky,ericdill/bluesky,klauer/bluesky,ericdill/bluesky,sameera2004/bluesky,dchabot/bluesky,klauer/bluesky |
c3ed431f97e4ca24a00ff979a5204d65b251dd87 | greenlight/views/__init__.py | greenlight/views/__init__.py | from .base import APIView
from django.http import Http404
from three import Three
class QCThree(Three):
def __init__(self):
self.endpoint = "http://dev-api.ville.quebec.qc.ca/open311/v2/"
self.format = "json"
self.jurisdiction = "ville.quebec.qc.ca"
QC_three = QCThree()
class ServicesView(APIView):
def get(... | from three import Three
from django.http import Http404
from .base import APIView
QC_three = Three(
endpoint = "http://dev-api.ville.quebec.qc.ca/open311/v2/",
format = "json",
jurisdiction = "ville.quebec.qc.ca",
)
class ServicesView(APIView):
def get(self, request):
return self.OkAPIResponse(QC_three.servic... | Initialize the three API wrapper differently to fix a bug. | Initialize the three API wrapper differently to fix a bug.
| Python | mit | ironweb/lesfeuxverts-backend |
9c11fa9d0a26d1e4caa47d2b3f0f1bf92cf8e965 | examples/enable/gadgets/vu_demo.py | examples/enable/gadgets/vu_demo.py |
from traits.api import HasTraits, Instance
from traitsui.api import View, UItem, Item, RangeEditor, Group, VGroup, HGroup
from enable.api import ComponentEditor
from enable.gadgets.vu_meter import VUMeter
class Demo(HasTraits):
vu = Instance(VUMeter)
traits_view = \
View(
HGroup(
... |
from traits.api import HasTraits, Instance
from traitsui.api import View, UItem, Item, RangeEditor, Group, VGroup
from enable.api import ComponentEditor
from enable.gadgets.vu_meter import VUMeter
class Demo(HasTraits):
vu = Instance(VUMeter)
traits_view = \
View(
VGroup(
... | Remove extraneous Groups from the View in the VU Meter demo. | Remove extraneous Groups from the View in the VU Meter demo.
| Python | bsd-3-clause | tommy-u/enable,tommy-u/enable,tommy-u/enable,tommy-u/enable |
8e8986a17b7fa38417fe39ec8fbf4e1d3ee43f64 | arduino_flasher/reset_arduino.py | arduino_flasher/reset_arduino.py | #!/usr/local/bin/python
import mraa
import time
resetPin = mraa.Gpio(8)
resetPin.dir(mraa.DIR_OUT)
resetPin.write(0)
time.sleep(0.2)
resetPin.write(1)
| #!/usr/local/bin/python
import mraa
import time
resetPin = mraa.Gpio(8)
resetPin.dir(mraa.DIR_OUT)
resetPin.write(1)
time.sleep(0.2)
resetPin.write(0)
time.sleep(0.2)
resetPin.write(1)
| Reset script first pulls pin high | Reset script first pulls pin high
| Python | bsd-3-clause | Pavlos1/SensoringJMSS,Pavlos1/SensoringJMSS,Pavlos1/SensoringJMSS,Pavlos1/SensoringJMSS |
1371f1a1b2914a7f2e328f69bdc599c1eada54db | Python-practice/fy_print_seq_len_in_fasta.py | Python-practice/fy_print_seq_len_in_fasta.py | #!/usr/bin/env python
'''
Script: fy_print_seq_len_in_fasta.py
Function: Print sequence length to STDOUT in fasta file
Note: Python3 is not default installed for most computer,
and the extra-installed module like Biopython could
not be directly used by python3. So, it's not the
righ time to use Pyth... | #!/usr/bin/env python
'''
Script: fy_print_seq_len_in_fasta.py
Function: Print sequence length to STDOUT in fasta file
Note: Python3 is not default installed for most computer,
and the extra-installed module like Biopython could
not be directly used by python3. So, it's not the
righ time to use Pyth... | Add the statistics information of sequence length | Add the statistics information of sequence length
Include number of sequences, total length, maximum length, and minimum
length
| Python | bsd-2-clause | lileiting/gfat |
24c6e2852e319ec0d0f4e8d0539bc69a9915c3e7 | tests/server/test_server.py | tests/server/test_server.py | import logging
import mock
import oauth2u
import oauth2u.server.log
def test_should_have_optional_port():
server = oauth2u.Server()
assert 8000 == server.port
def test_should_accept_custom_port():
server = oauth2u.Server(8888)
assert 8888 == server.port
def test_should_configure_log_with_default... | import logging
import mock
import oauth2u
import oauth2u.server.log
def teardown_function(func):
logging.disable(logging.INFO)
def test_should_have_optional_port():
server = oauth2u.Server()
assert 8000 == server.port
def test_should_accept_custom_port():
server = oauth2u.Server(8888)
assert 8... | Disable logging on test runner process | Disable logging on test runner process
| Python | mit | globocom/oauth2u,globocom/oauth2u |
1e29540ee08ca8faaed5e3a8ab1ac9def290155b | fileconversions/file_converter.py | fileconversions/file_converter.py | from . import conversions
from .file_formats import FileFormats
class FileConverter(object):
def get_conversion(self, source_format, target_format):
return {
'application/pdf': conversions.NoOp,
'image/jpeg': conversions.JpegToPdf,
'image/png': conversions.PngToPdf,
... | from . import conversions
from .file_formats import FileFormats
class FileConverter(object):
def get_conversion(self, source_format, target_format):
return {
FileFormats.PDF: conversions.NoOp,
FileFormats.JPEG: conversions.JpegToPdf,
FileFormats.PNG: conversions.PngTo... | Fix how we find conversion to use file formats | Fix how we find conversion to use file formats
| Python | mit | wilbertom/fileconversions |
5aad2212340a5eba4bbf4615d58ed6b3c205bc7f | fabtools/tests/fabfiles/python.py | fabtools/tests/fabfiles/python.py | from __future__ import with_statement
from fabric.api import *
from fabtools import require
import fabtools
@task
def python():
"""
Check Python package installation
"""
require.python.virtualenv('/tmp/venv')
assert fabtools.files.is_dir('/tmp/venv')
assert fabtools.files.is_file('/tmp/venv/b... | from __future__ import with_statement
from fabric.api import task
@task
def python_virtualenv():
"""
Test Python virtualenv creation
"""
from fabtools import require
import fabtools
require.python.virtualenv('/tmp/venv')
assert fabtools.files.is_dir('/tmp/venv')
assert fabtools.file... | Speed up Python tests by caching pip downloads | Speed up Python tests by caching pip downloads
| Python | bsd-2-clause | prologic/fabtools,ahnjungho/fabtools,ronnix/fabtools,davidcaste/fabtools,pombredanne/fabtools,pahaz/fabtools,badele/fabtools,AMOSoft/fabtools,wagigi/fabtools-python,fabtools/fabtools,hagai26/fabtools,n0n0x/fabtools-python,sociateru/fabtools,bitmonk/fabtools |
c27a1fc4c0251b896667e21a0a88fb44a403242f | cistern/migrations.py | cistern/migrations.py | import os
from playhouse.migrate import *
cistern_folder = os.getenv('CISTERNHOME', os.path.join(os.environ['HOME'], '.cistern'))
db = SqliteDatabase(os.path.join(cistern_folder, 'cistern.db'))
migrator = SqliteMigrator(db)
date_added = DateTimeField(default=None)
migrate(
migrator.add_column('torrent', 'date_a... | import datetime
import os
from playhouse.migrate import *
def update():
cistern_folder = os.getenv('CISTERNHOME', os.path.join(os.environ['HOME'], '.cistern'))
db = SqliteDatabase(os.path.join(cistern_folder, 'cistern.db'))
migrator = SqliteMigrator(db)
date_added = DateTimeField(default=datetime.dat... | Move migration to a function | Move migration to a function
| Python | mit | archangelic/cistern |
5e6d52277e34c254bad6b386cf05f490baf6a6f2 | webapp-django/accounts/models.py | webapp-django/accounts/models.py | from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
class UserProfile(models.Model):
user = models.OneToOneField(User)
bio = models.TextField(max_length=256, blank=True)
solvedChallenges=models.CharFie... | from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from challenges.models import Challenge
from questionnaire.models import Question
class UserProfile(models.Model):
user = models.OneToOneField(User)
bio... | Update accounts model with scoring system | Update accounts model with scoring system
| Python | mit | super1337/Super1337-CTF,super1337/Super1337-CTF,super1337/Super1337-CTF |
39e03951ec882f4dbff1ef4c42a71339d2a5d4fa | gaphor/UML/tests/test_activity.py | gaphor/UML/tests/test_activity.py | import pytest
from gaphor import UML
from gaphor.ui.diagrampage import tooliter
from gaphor.UML.toolbox import uml_toolbox_actions
@pytest.fixture
def action_factory():
return next(
t for t in tooliter(uml_toolbox_actions) if t.id == "toolbox-action"
).item_factory
def test_create_action_should_cre... | import pytest
from gaphor import UML
from gaphor.ui.diagrampage import tooliter
from gaphor.UML.toolbox import uml_toolbox_actions
activity_node_names = [
"action",
"initial-node",
"activity-final-node",
"flow-final-node",
"decision-node",
"fork-node",
"object-node",
"send-signal-actio... | Test all activity nodes for namespacing | Test all activity nodes for namespacing
| Python | lgpl-2.1 | amolenaar/gaphor,amolenaar/gaphor |
862301e319be09d3c163c8248f18ed23c3b1fab5 | mla_game/apps/transcript/urls.py | mla_game/apps/transcript/urls.py | from django.conf.urls import url
urlpatterns = [
url(r'^upload-batch/', 'mla_game.apps.transcript.views.upload_batch', name='upload-batch'),
]
| from django.conf.urls import url
urlpatterns = [
]
| Remove unused URL, will revisit later | Remove unused URL, will revisit later
| Python | mit | WGBH/FixIt,WGBH/FixIt,WGBH/FixIt |
2a843e46fabf616517847a304170fbce75afd167 | zeus/api/resources/auth_index.py | zeus/api/resources/auth_index.py | import json
from zeus import auth
from zeus.api import client
from zeus.exceptions import ApiError
from zeus.models import Email, Identity
from .base import Resource
from ..schemas import EmailSchema, IdentitySchema, UserSchema
emails_schema = EmailSchema(many=True, strict=True)
identities_schema = IdentitySchema(ma... | import json
from zeus import auth
from zeus.api import client
from zeus.exceptions import ApiError
from zeus.models import Email, Identity
from .base import Resource
from ..schemas import EmailSchema, IdentitySchema, UserSchema
emails_schema = EmailSchema(many=True, strict=True)
identities_schema = IdentitySchema(ma... | Raise non-auth errors from GitHub | fix: Raise non-auth errors from GitHub
| Python | apache-2.0 | getsentry/zeus,getsentry/zeus,getsentry/zeus,getsentry/zeus |
9174de810bc4be3376521eecdb82a84486591e73 | oslo_utils/_i18n.py | oslo_utils/_i18n.py | # Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Update Oslo imports to remove namespace package | Update Oslo imports to remove namespace package
Change-Id: I4ec9b2a310471e4e07867073e9577731ac34027d
Blueprint: drop-namespace-packages
| Python | apache-2.0 | magic0704/oslo.utils,varunarya10/oslo.utils,openstack/oslo.utils |
6a15b33d69d8d66643bb8886f9916fa28ecaedea | molo/yourwords/templatetags/competition_tag.py | molo/yourwords/templatetags/competition_tag.py | from django import template
from copy import copy
from molo.yourwords.models import (YourWordsCompetition, ThankYou,
YourWordsCompetitionIndexPage)
from molo.core.templatetags.core_tags import get_pages
register = template.Library()
@register.inclusion_tag(
'yourwords/your_word... | from django import template
from copy import copy
from molo.yourwords.models import (YourWordsCompetition, ThankYou,
YourWordsCompetitionIndexPage)
from molo.core.templatetags.core_tags import get_pages
register = template.Library()
@register.inclusion_tag(
'yourwords/your_word... | Return None if there is no competition | Return None if there is no competition
| Python | bsd-2-clause | praekelt/molo.yourwords,praekelt/molo.yourwords |
8c07012e423d592a4638d6dac58ca5e67d9dd5a6 | apps/cowry/views.py | apps/cowry/views.py | from rest_framework import generics
from .permissions import IsOrderCreator
from .serializers import PaymentSerializer
from .models import Payment
class PaymentDetail(generics.RetrieveUpdateAPIView):
"""
View for working with Payments. Payments can be retrieved and the payment method and submethod can updated... | from rest_framework import generics
from rest_framework import response
from rest_framework import status
from . import payments
from .exceptions import PaymentException
from .models import Payment
from .permissions import IsOrderCreator
from .serializers import PaymentSerializer
class PaymentDetail(generics.Retrieve... | Add payment cancel (delete) to Payment REST API. | Add payment cancel (delete) to Payment REST API.
| Python | bsd-3-clause | onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site |
b434c8dd697b4aa5c2d6daa345c0d9de27e7c05a | apps/survey/urls.py | apps/survey/urls.py | from django.conf.urls.defaults import *
from . import views
urlpatterns = patterns('',
url(r'^profile/$', views.profile_index, name='survey_profile'),
url(r'^profile/electric/$', views.profile_electric, name='survey_profile_electric'),
url(r'^profile/surveys/$', views.survey_management, name='survey_manag... | from django.conf.urls.defaults import *
from . import views
urlpatterns = patterns('',
url(r'^profile/$', views.profile_index, name='survey_profile'),
url(r'^profile/electric/$', views.profile_electric, name='survey_profile_electric'),
#url(r'^profile/intake/$', views.survey_intake, name='survey_profile_i... | Add new decorator for suvery_data | Add new decorator for suvery_data
| Python | agpl-3.0 | chispita/epiwork,chispita/epiwork,chispita/epiwork,chispita/epiwork,chispita/epiwork,chispita/epiwork,chispita/epiwork |
1f6c1a4f596222b424d9f51ca30f5eb4d80f9942 | mopidy_alsamixer/__init__.py | mopidy_alsamixer/__init__.py | import os
from mopidy import config, ext
__version__ = "1.1.1"
class Extension(ext.Extension):
dist_name = "Mopidy-ALSAMixer"
ext_name = "alsamixer"
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__), "ext.conf")
return config.re... | import pathlib
from mopidy import config, ext
__version__ = "1.1.1"
class Extension(ext.Extension):
dist_name = "Mopidy-ALSAMixer"
ext_name = "alsamixer"
version = __version__
def get_default_config(self):
return config.read(pathlib.Path(__file__).parent / "ext.conf")
def get_config_... | Use pathlib to read ext.conf | Use pathlib to read ext.conf
| Python | apache-2.0 | mopidy/mopidy-alsamixer |
641b2d07a4250a779ad6ff31f579968f69362cc0 | numscons/numdist/__init__.py | numscons/numdist/__init__.py | from numdist_copy import default_lib_dirs, default_include_dirs, \
default_src_dirs, get_standard_file
from numdist_copy import msvc_runtime_library
from conv_template import process_file as process_c_file
from from_template import process_file as process_f_file
| from numdist_copy import default_lib_dirs, default_include_dirs, \
default_src_dirs, get_standard_file
from numdist_copy import msvc_runtime_library
from conv_template import process_file as process_c_file, process_str as process_c_str
from from_template import process_file as process_f_file
| Add process_c_str function to the numdist API | Add process_c_str function to the numdist API | Python | bsd-3-clause | cournape/numscons,cournape/numscons,cournape/numscons |
d792679461357fa17b1f852d7a72921aed2fe271 | bermann/rdd_test.py | bermann/rdd_test.py | import unittest
from bermann import RDD
class TestRDD(unittest.TestCase):
def test_cache_is_noop(self):
rdd = RDD([1, 2, 3])
cached = rdd.cache()
self.assertEqual(rdd, cached)
# collect
# count
# countByKey
# conntByValue
# distinct
# filter
# first
... | import unittest
from bermann import RDD
class TestRDD(unittest.TestCase):
def test_cache_is_noop(self):
rdd = RDD([1, 2, 3])
cached = rdd.cache()
self.assertEqual(rdd, cached)
def test_collect_empty_rdd_returns_empty_list(self):
rdd = RDD()
self.assertEqual([], rd... | Add tests for count and collect | Add tests for count and collect
| Python | mit | oli-hall/bermann |
bcc79588e5e49c928210d6830fbe1a7386fcf5bb | apps/search/tasks.py | apps/search/tasks.py | import logging
from django.conf import settings
from django.db.models.signals import pre_delete
from elasticutils.contrib.django.tasks import index_objects, unindex_objects
from wiki.signals import render_done
def render_done_handler(**kwargs):
if not settings.ES_LIVE_INDEX or 'instance' not in kwargs:
... | import logging
import warnings
from django.conf import settings
from django.db.models.signals import pre_delete
# ignore a deprecation warning from elasticutils until the fix is released
# refs https://github.com/mozilla/elasticutils/pull/160
warnings.filterwarnings("ignore",
category=Deprecat... | Stop a deprecation warning that is thrown in elasticutils. | Stop a deprecation warning that is thrown in elasticutils.
This is not going to be needed once https://github.com/mozilla/elasticutils/pull/160
has been released.
| Python | mpl-2.0 | jezdez/kuma,whip112/Whip112,FrankBian/kuma,YOTOV-LIMITED/kuma,SphinxKnight/kuma,jgmize/kuma,RanadeepPolavarapu/kuma,ollie314/kuma,nhenezi/kuma,FrankBian/kuma,surajssd/kuma,YOTOV-LIMITED/kuma,yfdyh000/kuma,cindyyu/kuma,SphinxKnight/kuma,openjck/kuma,MenZil/kuma,RanadeepPolavarapu/kuma,yfdyh000/kuma,whip112/Whip112,carne... |
6155cfa0d16bfde8b412a3b2c68983ef939d518c | synapse/tests/test_init.py | synapse/tests/test_init.py | import os
import imp
import synapse
from synapse.tests.common import *
class InitTest(SynTest):
def test_init_modules(self):
os.environ['SYN_MODULES'] = 'fakenotrealmod , badnothere,math'
msg = 'SYN_MODULES failed: badnothere (NoSuchDyn: name=\'badnothere\')'
with self.getLoggerStream('sy... | import os
import imp
import synapse
from synapse.tests.common import *
class InitTest(SynTest):
pass
'''
def test_init_modules(self):
os.environ['SYN_MODULES'] = 'fakenotrealmod , badnothere,math'
msg = 'SYN_MODULES failed: badnothere (NoSuchDyn: name=\'badnothere\')'
with self.ge... | Comment out broken init test | Comment out broken init test
| Python | apache-2.0 | vertexproject/synapse,vertexproject/synapse,vivisect/synapse,vertexproject/synapse |
5f70d83408d177e803ce8edfb0ebd2b909722a64 | troposphere/certificatemanager.py | troposphere/certificatemanager.py | # Copyright (c) 2012-2019, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 15.1.0
from . import AWSObject
from . import AWSProperty
from troposphere import Tags
class DomainValidationOpti... | # Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 31.1.0
from . import AWSObject
from . import AWSProperty
from troposphere import Tags
from .validators import inte... | Update CertificateManager per 2021-03-11 changes | Update CertificateManager per 2021-03-11 changes
| Python | bsd-2-clause | cloudtools/troposphere,cloudtools/troposphere |
c947ecffd771117ce531f5058356a17b7db82fdb | mockaioredis/commands/__init__.py | mockaioredis/commands/__init__.py | from mockredis import MockRedis as _MockRedis
from .generic import GenericCommandsMixin
from .hash import HashCommandsMixin
from .list import ListCommandsMixin
from .set import SetCommandsMixin
__all__ = ['MockRedis']
class MockRedis(GenericCommandsMixin, HashCommandsMixin, ListCommandsMixin, SetCommandsMixin):
... | from mockredis import MockRedis as _MockRedis
from .generic import GenericCommandsMixin
from .hash import HashCommandsMixin
from .list import ListCommandsMixin
from .set import SetCommandsMixin
__all__ = ['MockRedis']
class MockRedis(GenericCommandsMixin, HashCommandsMixin, ListCommandsMixin, SetCommandsMixin):
... | Add close comands to MockRedis class | chore: Add close comands to MockRedis class
This closes #15
Signed-off-by: Kai Blin <ad3597797f6179d503c382b2627cc19939309418@biosustain.dtu.dk>
| Python | apache-2.0 | kblin/mockaioredis,kblin/mockaioredis |
022d8b992a88fd4c489c068ba57b4b2fcf6dde98 | cloudsizzle/studyplanner/completedstudies/models.py | cloudsizzle/studyplanner/completedstudies/models.py | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class CompletedCourse(models.Model):
"""
Model for completed studies
"""
student = models.ForeignKey(User, related_name='completed_courses')
code = models.CharField(max_length=11)
name = model... | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class CompletedCourse(models.Model):
"""
Model for completed studies
"""
student = models.ForeignKey(User, related_name='completed_courses')
code = models.CharField(max_length=11)
name = models... | Allow null values for ocr and cr fields of CompletedCourse | Allow null values for ocr and cr fields of CompletedCourse
| Python | mit | jpvanhal/cloudsizzle,jpvanhal/cloudsizzle |
8dbcd07e0db34d39ad8f79067282d4359d79439d | usr/bin/graphical-app-launcher.py | usr/bin/graphical-app-launcher.py | #!/usr/bin/env python
import os
import subprocess
if __name__ == '__main__':
if os.environ.has_key('APP'):
graphical_app = os.environ['APP']
process = subprocess.Popen(graphical_app, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdoutdata... | #!/usr/bin/env python
import os
import subprocess
if __name__ == '__main__':
if os.environ.has_key('APP'):
graphical_app = os.environ['APP']
if os.environ.has_key('ARGS'):
extra_args = os.environ['ARGS']
command = graphical_app + ' ' + extra_args
else:
c... | Support an ARGS enviromental variable for extra command arguments. | Support an ARGS enviromental variable for extra command arguments.
| Python | apache-2.0 | thewtex/docker-opengl,thewtex/docker-opengl |
830c73beafa359e01fb839901bcb91360c1de365 | web/thesaurus_template_generators.py | web/thesaurus_template_generators.py | import json
from web.MetaInfo import MetaInfo
def generate_language_template(language_id, structure_id, version=None):
meta_info = MetaInfo()
if structure_id not in meta_info.data_structures:
raise ValueError
language_name = meta_info.languages.get(
language_id,
{'name': 'Human-Rea... | """Generator functions for thesaurus files"""
import json
from web.MetaInfo import MetaInfo
def generate_language_template(language_id, structure_id, version=None):
"""Generate a template for the given language and structure"""
meta_info = MetaInfo()
if structure_id not in meta_info.data_structures:
... | Add name fields to generated templates | Add name fields to generated templates
| Python | agpl-3.0 | codethesaurus/codethesaur.us,codethesaurus/codethesaur.us |
fe9e11af28e2ffe2b3da5ebb0971cd712136284c | nodeconductor/iaas/migrations/0011_cloudprojectmembership_availability_zone.py | nodeconductor/iaas/migrations/0011_cloudprojectmembership_availability_zone.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('iaas', '0010_auto_20150118_1834'),
]
operations = [
migrations.AddField(
model_name='cloudprojectmembership',
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('iaas', '0010_auto_20150118_1834'),
]
operations = [
migrations.AddField(
model_name='cloudprojectmembership',
... | Add help_text to availability_zone field (nc-327) | Add help_text to availability_zone field (nc-327)
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor |
1187deb4140ad0c7d66f0f25ae6d019f8ffb6168 | bluebottle/homepage/views.py | bluebottle/homepage/views.py | from django.utils import translation
from rest_framework import response
from bluebottle.utils.views import GenericAPIView
from .models import HomePage
from .serializers import HomePageSerializer
# Instead of serving all the objects separately we combine Slide, Quote and Stats into a dummy object
class HomePageDeta... | from django.utils import translation
from rest_framework import response
from bluebottle.utils.views import GenericAPIView
from .models import HomePage
from .serializers import HomePageSerializer
# Instead of serving all the objects separately we combine Slide, Quote and Stats into a dummy object
class HomePageDeta... | Add proper context to homepage serializer | Add proper context to homepage serializer
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle |
424980a48e451d1b99397843001bd75fa58e474e | tests/test_fullqualname.py | tests/test_fullqualname.py | """Tests for fullqualname."""
import nose
import sys
from fullqualname import fullqualname
def test_builtin_function():
# Test built-in function object.
obj = len
# Type is 'builtin_function_or_method'.
assert type(obj).__name__ == 'builtin_function_or_method'
# Object is a function.
asse... | """Tests for fullqualname."""
import inspect
import nose
import sys
from fullqualname import fullqualname
def test_builtin_function():
# Test built-in function object.
obj = len
# Type is 'builtin_function_or_method'.
assert type(obj).__name__ == 'builtin_function_or_method'
# Object is a fun... | Add built-in method object test | Add built-in method object test
| Python | bsd-3-clause | etgalloway/fullqualname |
c259e42ea95fdc43ad9345d702d3cab901d88f93 | rx/core/__init__.py | rx/core/__init__.py | # flake8: noqa
from .typing import Observer, Scheduler
from .disposable import Disposable
from .anonymousobserver import AnonymousObserver
from . import observerextensions
from .pipe import pipe
from .observable import Observable
from .observable import AnonymousObservable, ConnectableObservable
from .observable imp... | # flake8: noqa
from .typing import Observer, Scheduler
from .disposable import Disposable
from .anonymousobserver import AnonymousObserver
from .pipe import pipe
from .observable import Observable
from .observable import AnonymousObservable, ConnectableObservable
from .observable import GroupedObservable, BlockingOb... | Remove observer extension from init | Remove observer extension from init
| Python | mit | ReactiveX/RxPY,ReactiveX/RxPY |
4068605116cb04b999c66d29056c88cf2c4ab46c | scripts/analytics/addon_count.py | scripts/analytics/addon_count.py | import sys
import logging
from datetime import datetime
from dateutil.parser import parse
from website.settings import ADDONS_AVAILABLE
from website.app import init_app
from website.settings import KEEN as keen_settings
from keen.client import KeenClient
logger = logging.getLogger(__name__)
logging.basicConfig(level=... | import logging
from website.settings import ADDONS_AVAILABLE
from website.app import init_app
from website.settings import KEEN as keen_settings
from keen.client import KeenClient
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
def count():
counts = []
for addon in ADDONS_AVAILA... | Remove date from addon count script | Remove date from addon count script
| Python | apache-2.0 | pattisdr/osf.io,saradbowman/osf.io,binoculars/osf.io,caneruguz/osf.io,HalcyonChimera/osf.io,mattclark/osf.io,cslzchen/osf.io,chrisseto/osf.io,acshi/osf.io,mfraezz/osf.io,acshi/osf.io,CenterForOpenScience/osf.io,monikagrabowska/osf.io,sloria/osf.io,aaxelb/osf.io,caseyrollins/osf.io,monikagrabowska/osf.io,Johnetordoff/os... |
9995a3bb8b95caddc6319e68f405c70fd2a15d09 | aldryn_faq/search_indexes.py | aldryn_faq/search_indexes.py | from aldryn_search.base import AldrynIndexBase
from aldryn_search.utils import strip_tags
from django.template import RequestContext
from haystack import indexes
from .models import Question
class QuestionIndex(AldrynIndexBase, indexes.Indexable):
INDEX_TITLE = True
def get_title(self, obj):
return... | from aldryn_search.base import AldrynIndexBase
from aldryn_search.utils import strip_tags
from django.template import RequestContext
from haystack import indexes
from .models import Question, Category
class QuestionIndex(AldrynIndexBase, indexes.Indexable):
INDEX_TITLE = True
def get_title(self, obj):
... | Add search index for faq categories | Add search index for faq categories
| Python | bsd-3-clause | czpython/aldryn-faq,czpython/aldryn-faq,mkoistinen/aldryn-faq,czpython/aldryn-faq,czpython/aldryn-faq |
082bcfefddb4ba566e35e827d9e726aacdfb80d6 | collection_pipelines/core.py | collection_pipelines/core.py | import functools
def coroutine(fn):
def wrapper(*args, **kwargs):
generator = fn(*args, **kwargs)
next(generator)
return generator
return wrapper
class CollectionPipelineProcessor:
sink = None
start_source = None
receiver = None
def process(self, item):
rais... | import functools
def coroutine(fn):
def wrapper(*args, **kwargs):
generator = fn(*args, **kwargs)
next(generator)
return generator
return wrapper
class CollectionPipelineProcessor:
sink = None
start_source = None
receiver = None
def process(self, item):
rais... | Allow to overwrite the pipeline processor return value | Allow to overwrite the pipeline processor return value
| Python | mit | povilasb/pycollection-pipelines |
2d05ede4db8bf80834e04ffb5f9d0ec11982851d | normandy/recipes/validators.py | normandy/recipes/validators.py | import json
import jsonschema
from django.core.exceptions import ValidationError
# Add path to required validator so we can get property name
def _required(validator, required, instance, schema):
'''Validate 'required' properties.'''
if not validator.is_type(instance, 'object'):
return
for index... | import json
import jsonschema
from django.core.exceptions import ValidationError
# Add path to required validator so we can get property name
def _required(validator, required, instance, schema):
'''Validate 'required' properties.'''
if not validator.is_type(instance, 'object'):
return
for index... | Check for empty strings in required validator | Check for empty strings in required validator
| Python | mpl-2.0 | Osmose/normandy,mozilla/normandy,Osmose/normandy,mozilla/normandy,Osmose/normandy,mozilla/normandy,Osmose/normandy,mozilla/normandy |
fe8221e398bb9a1ddabf08002441acb37dfef515 | scripts/release_test/arguments.py | scripts/release_test/arguments.py | import argparse, common, sys, tests
from features import check_features, get_features
def arguments(argv=sys.argv[1:]):
parser = argparse.ArgumentParser()
parser.add_argument(
'tests', nargs='*', help='The list of tests to run')
parser.add_argument(
'--features', '-f', default=[], action... | import argparse, common, sys, tests
from features import check_features, get_features, FEATURES
def arguments(argv=sys.argv[1:]):
parser = argparse.ArgumentParser()
names = [t.__name__.split('.')[1] for t in tests.__all__]
names = ', '.join(names)
parser.add_argument(
'tests', nargs='*',
... | Improve help messages from release_test | Improve help messages from release_test
| Python | mit | ManiacalLabs/BiblioPixel,rec/BiblioPixel,ManiacalLabs/BiblioPixel,rec/BiblioPixel,rec/BiblioPixel,ManiacalLabs/BiblioPixel,ManiacalLabs/BiblioPixel,rec/BiblioPixel |
95d1bf068ebf2f57eaf44accbe15aa30d236d8ea | astropy/coordinates/tests/test_distance.py | astropy/coordinates/tests/test_distance.py | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import print_function
from numpy import testing as npt
from ... import units as u
"""
This includes tests for distances/cartesian points that are *not* in the API
tests. Right now that's just regression tests.
"... | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import print_function
from numpy import testing as npt
from ... import units as u
"""
This includes tests for distances/cartesian points that are *not* in the API
tests. Right now that's just regression tests.
"... | Add test for applying a distance to a coordinate via a quantity | Add test for applying a distance to a coordinate via a quantity
| Python | bsd-3-clause | pllim/astropy,astropy/astropy,dhomeier/astropy,dhomeier/astropy,bsipocz/astropy,pllim/astropy,astropy/astropy,pllim/astropy,tbabej/astropy,aleksandr-bakanov/astropy,larrybradley/astropy,larrybradley/astropy,joergdietrich/astropy,aleksandr-bakanov/astropy,tbabej/astropy,StuartLittlefair/astropy,kelle/astropy,MSeifert04/... |
1975aeb06a85d8983a3815ffd89076af66d61561 | payments/urls.py | payments/urls.py | from django.conf.urls import patterns, url
try:
from account.decorators import login_required
except ImportError:
from django.contrib.auth.decorators import login_required
from .views import (
CancelView,
ChangeCardView,
ChangePlanView,
HistoryView,
SubscribeView
)
urlpatterns = patterns... | from django.conf.urls import patterns, url
try:
from account.decorators import login_required
except ImportError:
from django.contrib.auth.decorators import login_required
from .views import (
CancelView,
ChangeCardView,
ChangePlanView,
HistoryView,
SubscribeView,
webhook,
subscrib... | Use imported views instead of lazy import | Use imported views instead of lazy import
| Python | mit | pinax/django-stripe-payments |
d85a288cbacf6bc31b1d544dd269d392aed4a1ec | openquake/hazardlib/general.py | openquake/hazardlib/general.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2014, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, ... | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2014, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, ... | Add stderr redirect to git_suffix to get more clean messages | Add stderr redirect to git_suffix to get more clean messages
| Python | agpl-3.0 | larsbutler/oq-hazardlib,rcgee/oq-hazardlib,gem/oq-engine,silviacanessa/oq-hazardlib,rcgee/oq-hazardlib,gem/oq-hazardlib,gem/oq-engine,g-weatherill/oq-hazardlib,larsbutler/oq-hazardlib,silviacanessa/oq-hazardlib,silviacanessa/oq-hazardlib,silviacanessa/oq-hazardlib,vup1120/oq-hazardlib,g-weatherill/oq-hazardlib,g-weathe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.