commit
stringlengths
40
40
subject
stringlengths
4
1.73k
repos
stringlengths
5
127k
old_file
stringlengths
2
751
new_file
stringlengths
2
751
new_contents
stringlengths
1
8.98k
old_contents
stringlengths
0
6.59k
license
stringclasses
13 values
lang
stringclasses
23 values
da98b79f9d8b35ea2d5b503b2b50ecb985c3a966
Fix building on Python 3
graingert/dockhand,6si/shipwright
shipwright/build.py
shipwright/build.py
from . import fn from .fn import compose, curry, maybe, flat_map, merge from .tar import mkcontext from .compat import json_loads # (container->(str -> None)) # -> (container -> stream) # -> [targets] # -> [(container, docker_image_id)] def do_build(client, git_rev, targets): """ Generic function for...
import json from . import fn from .fn import compose, curry, maybe, flat_map, merge from .tar import mkcontext # (container->(str -> None)) # -> (container -> stream) # -> [targets] # -> [(container, docker_image_id)] def do_build(client, git_rev, targets): """ Generic function for building multiple ...
apache-2.0
Python
e5c2fbdaf574d1200e5c96fa25a5b0a67d24e656
Tweak virtualenv paths method
praekelt/sideloader2,praekelt/sideloader2,praekelt/sideloader2
sideloader/utils.py
sideloader/utils.py
import os import shutil from collections import namedtuple def rmtree_if_exists(tree_path): """ Delete a directory and its contents if the directory exists. :param: tree_path: The path to the directory. :returns: True if the directory existed and was deleted. False otherwise. """ if...
import os import shutil from collections import namedtuple def rmtree_if_exists(tree_path): """ Delete a directory and its contents if the directory exists. :param: tree_path: The path to the directory. :returns: True if the directory existed and was deleted. False otherwise. """ if...
mit
Python
65ab61af27aeea3ed82e842cd62f6493d55abfc1
Add TalkType to admin pages.
CTPUG/wafer,CTPUG/wafer,CarlFK/wafer,CTPUG/wafer,CarlFK/wafer,CTPUG/wafer,CarlFK/wafer,CarlFK/wafer
wafer/talks/admin.py
wafer/talks/admin.py
from django.contrib import admin from wafer.talks.models import TalkType, Talk, TalkUrl class TalkUrlInline(admin.TabularInline): model = TalkUrl class TalkAdmin(admin.ModelAdmin): list_display = ('title', 'get_author_name', 'get_author_contact', 'status') list_editable = ('status',)...
from django.contrib import admin from wafer.talks.models import Talk, TalkUrl class TalkUrlInline(admin.TabularInline): model = TalkUrl class TalkAdmin(admin.ModelAdmin): list_display = ('title', 'get_author_name', 'get_author_contact', 'status') list_editable = ('status',) inli...
isc
Python
db9b999a39d8b04d9b25c5ee1e50cfa510cf2b7d
Add the talk submitter as an initial author
CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer
wafer/talks/forms.py
wafer/talks/forms.py
from django import forms from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from crispy_forms.bootstrap import FormActions from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, HTML from markitup.widgets import MarkItUpWidget from easy_select2.w...
from django import forms from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from crispy_forms.bootstrap import FormActions from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, HTML from markitup.widgets import MarkItUpWidget from easy_select2.w...
isc
Python
28b6e711da7470aadce9a1362c5a60227fc7268a
Add category datamanager setup
potzenheimer/meetshaus,potzenheimer/meetshaus,potzenheimer/meetshaus,potzenheimer/meetshaus
src/meetshaus.blog/meetshaus/blog/categories.py
src/meetshaus.blog/meetshaus/blog/categories.py
# -*- coding: UTF-8 -*- """ Module listing available and asigned blog categories """ import json import time import urllib2 from Products.CMFCore.interfaces import IContentish from five import grok from plone import api from plone.app.layout.navigation.interfaces import INavigationRoot from zope.component import getUt...
# -*- coding: UTF-8 -*- """ Module listing available and asigned blog categories """ import urllib2 from plone import api from five import grok from Products.CMFCore.interfaces import IContentish from meetshaus.blog.blogentry import IBlogEntry class BlogCategories(grok.View): grok.context(IContentish) grok.r...
mit
Python
be0e05187044e08ede722ae224ca59895edd0f46
Add version 1.7.1 for cub. (#5164)
EmreAtes/spack,matthiasdiener/spack,iulian787/spack,lgarren/spack,mfherbst/spack,tmerrick1/spack,tmerrick1/spack,tmerrick1/spack,tmerrick1/spack,mfherbst/spack,LLNL/spack,skosukhin/spack,iulian787/spack,TheTimmy/spack,LLNL/spack,LLNL/spack,EmreAtes/spack,TheTimmy/spack,skosukhin/spack,mfherbst/spack,lgarren/spack,matth...
var/spack/repos/builtin/packages/cub/package.py
var/spack/repos/builtin/packages/cub/package.py
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Python
8680dbb71e323df9d34e99b6e118014b3289ad7c
add missing imports to agent CLI
earaujoassis/watchman,earaujoassis/watchman,earaujoassis/watchman,earaujoassis/watchman,earaujoassis/watchman
agents/utils.py
agents/utils.py
# -*- coding: utf-8 -*- import os import sys import subprocess import shlex import socket import fcntl import struct DEPLOYMENT_TYPE_STATIC = 0 DEPLOYMENT_TYPE_CONTAINERS = 1 DEPLOYMENT_TYPE_COMPOSE = 2 class ConsoleColors: HEADER = '\033[95m' BLUE = '\033[94m' GREEN = '\033[92m' WARNING = '...
# -*- coding: utf-8 -*- import os import sys import subprocess import shlex import socket DEPLOYMENT_TYPE_STATIC = 0 DEPLOYMENT_TYPE_CONTAINERS = 1 DEPLOYMENT_TYPE_COMPOSE = 2 class ConsoleColors: HEADER = '\033[95m' BLUE = '\033[94m' GREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[...
mit
Python
9ee3423a8be12c5b14d6f317d4fc535f1fa309b5
Switch to development version.
igordejanovic/parglare,igordejanovic/parglare
parglare/__init__.py
parglare/__init__.py
# -*- coding: utf-8 -*- # flake8: NOQA from parglare.parser import Parser, Token, pos_to_line_col, \ Node, NodeTerm, NodeNonTerm from parglare.tables import LALR, SLR, SHIFT, REDUCE, ACCEPT from parglare.glr import GLRParser from parglare.grammar import Grammar, NonTerminal, Terminal, \ RegExRecognizer, StringR...
# -*- coding: utf-8 -*- # flake8: NOQA from parglare.parser import Parser, Token, pos_to_line_col, \ Node, NodeTerm, NodeNonTerm from parglare.tables import LALR, SLR, SHIFT, REDUCE, ACCEPT from parglare.glr import GLRParser from parglare.grammar import Grammar, NonTerminal, Terminal, \ RegExRecognizer, StringR...
mit
Python
845b5deb17a088e8dc7e899b294d6b821d3896a3
Remove unused import
galaxy-iuc/parsec
parsec/decorators.py
parsec/decorators.py
import json import wrapt from .io import error @wrapt.decorator def bioblend_exception(wrapped, instance, args, kwargs): try: return wrapped(*args, **kwargs) except Exception, e: try: error(json.loads(e.body)['err_msg']) except Exception, e: print e @wrapt.decor...
import json import pprint import wrapt from .io import error @wrapt.decorator def bioblend_exception(wrapped, instance, args, kwargs): try: return wrapped(*args, **kwargs) except Exception, e: try: error(json.loads(e.body)['err_msg']) except: print e @wrapt.deco...
apache-2.0
Python
c70cb13c1f54e5e64bb3b6e8be761ad86ee3926f
Update urls.py
funkybob/antfarm
antfarm/urls.py
antfarm/urls.py
''' Django-style URL dispatcher view. App(root_url=url_dispatcher([ (r'^/$', views.index), (re.compile(r'^/(?P<foo>\d+)/'), views.detail, {'bar': True}), ]) The view will be called with the request, and any matched _named_ groups. Extra kwargs can be passed as a 3rd positional argument. There...
''' Django-style URL dispatcher view. App(root_url=url_dispatcher([ (r'^/$', views.index), (re.compile(r'^/(?P<foo>\d+)/'), views.detail, {'bar': True}), ]) The view will be called with the request, and any matched _named_ groups. Extra kwargs can be passed as a 3rd positional argument. Ther...
mit
Python
cc683963bb5e9215aab3c7aefe35f9f483cdefef
Update scoring_engine version to 1.0.0
pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine,pwnbus/scoring_engine
scoring_engine/version.py
scoring_engine/version.py
import os from scoring_engine.config import config version = "1.0.0" # If we specify the version specifically then use that one if 'SCORINGENGINE_VERSION' in os.environ: version = os.environ['SCORINGENGINE_VERSION'] # If we're in debug mode, just say dev if config.debug is True: version += '-dev'
import os from scoring_engine.config import config version = "0.1.0" # If we specify the version specifically then use that one if 'SCORINGENGINE_VERSION' in os.environ: version = os.environ['SCORINGENGINE_VERSION'] # If we're in debug mode, just say dev if config.debug is True: version += '-dev'
mit
Python
42f27447a5aa51f6de55e62c75222052679e59ad
Terminate Celery when exiting
amcat/amcat,amcat/amcat,amcat/amcat,amcat/amcat,amcat/amcat,amcat/amcat
run_celery.py
run_celery.py
#!/usr/bin/env python """Runs a celery worker, and reloads on a file change. Run as ./run_celery [directory]. If directory is not given, default to cwd.""" import os import sys import signal import time import multiprocessing import subprocess import threading import inotify.adapters CELERY_CMD = tuple("celery -A a...
#!/usr/bin/env python """Runs a celery worker, and reloads on a file change. Run as ./run_celery [directory]. If directory is not given, default to cwd.""" import os import sys import signal import time import multiprocessing import subprocess import threading import inotify.adapters CELERY_CMD = tuple("celery -A a...
agpl-3.0
Python
cde48bca684e225b2f99be6637380f4ef3365f17
Update version 1.0.0.dev3 -> 1.0.0.dev4
dwavesystems/dimod,dwavesystems/dimod
dimod/package_info.py
dimod/package_info.py
__version__ = '1.0.0.dev4' __author__ = 'D-Wave Systems Inc.' __authoremail__ = 'acondello@dwavesys.com' __description__ = 'A shared API for binary quadratic model samplers.'
__version__ = '1.0.0.dev3' __author__ = 'D-Wave Systems Inc.' __authoremail__ = 'acondello@dwavesys.com' __description__ = 'A shared API for binary quadratic model samplers.'
apache-2.0
Python
c813f2e9540a9399cf41f0c17e272761243dd1e0
Convert print to LOG in let.py
lperkin1/schemepy,perkinslr/schemepy
scheme/let.py
scheme/let.py
from scheme.environment import Environment from scheme.procedure import SimpleProcedure __author__ = 'perkins' from scheme.macro import Macro, MacroSymbol from scheme.Globals import Globals from zope.interface import implements class let(object): implements(Macro) def __init__(self): pass def _...
from scheme.environment import Environment from scheme.procedure import SimpleProcedure __author__ = 'perkins' from scheme.macro import Macro, MacroSymbol from scheme.Globals import Globals from zope.interface import implements class let(object): implements(Macro) def __init__(self): pass def _...
lgpl-2.1
Python
58daab07ab9cebb83ce54c932e1bfe7c9b6eaada
fix the team code review
allmightyspiff/softlayer-python,softlayer/softlayer-python
SoftLayer/CLI/hardware/credentials.py
SoftLayer/CLI/hardware/credentials.py
"""List server credentials.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers from SoftLayer import exceptions @click.command(cls=SoftLayer.CLI.command.SLCommand, ) @click.argum...
"""List server credentials.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers from SoftLayer import exceptions @click.command(cls=SoftLayer.CLI.command.SLCommand, ) @click.argum...
mit
Python
6b0198b3fce3d4fffb01ede08e1cad08d4d4e5a9
Fix options check for --disabled option
skraghu/softlayer-python,underscorephil/softlayer-python,Neetuj/softlayer-python,allmightyspiff/softlayer-python,nanjj/softlayer-python,softlayer/softlayer-python,kyubifire/softlayer-python
SoftLayer/CLI/loadbal/service_edit.py
SoftLayer/CLI/loadbal/service_edit.py
"""Edit the properties of a service group.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import loadbal @click.command() @click.argument('identifier') @click.option('--enabled / --disabled...
"""Edit the properties of a service group.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import loadbal @click.command() @click.argument('identifier') @click.option('--enabled / --disabled...
mit
Python
f29536ab98eb49a962141535d29866dcdd29a99f
Convert to int when assigning values, slight optimization
james9909/IntroCTF,james9909/IntroCTF,james9909/IntroCTF,james9909/IntroCTF,james9909/IntroCTF,james9909/IntroCTF
scoreboard.py
scoreboard.py
#!/usr/bin/env python import os print "Content-Type: text/html\n" print "" def gen_scoreboard(team_data): if len(team_data) == 0: print "There are no teams!" else: print "<br>" print "<div class='container'>" print "<table class='responsive-table bordered hoverable centered'>" ...
#!/usr/bin/env python import os print "Content-Type: text/html\n" print "" def gen_scoreboard(team_data): if len(team_data) == 0: print "There are no teams!" else: print "<br>" print "<div class='container'>" print "<table class='responsive-table bordered hoverable centered'>" ...
mit
Python
ae1dacd8870c314ace48f497342c5a286f9fc492
fix manifest code. close #143
mgorny/django-pipeline,chipx86/django-pipeline,joshkehn/django-pipeline,demux/django-pipeline,beedesk/django-pipeline,lydell/django-pipeline,mgorny/django-pipeline,almost/django-pipeline,floppym/django-pipeline,almost/django-pipeline,vstoykov/django-pipeline,Kami/django-pipeline,jensenbox/django-pipeline,tayfun/django-...
pipeline/manifest.py
pipeline/manifest.py
try: from staticfiles.finders import DefaultStorageFinder except ImportError: from django.contrib.staticfiles.finders import DefaultStorageFinder # noqa from django.conf import settings from manifesto import Manifest from pipeline.packager import Packager class PipelineManifest(Manifest): def __init__(...
try: from staticfiles.finders import DefaultStorageFinder except ImportError: from django.contrib.staticfiles.storage import DefaultStorageFinder # noqa from django.conf import settings from manifesto import Manifest from pipeline.packager import Packager class PipelineManifest(Manifest): def __init__(...
mit
Python
d5999505ee00767dca85667c04cd24bccde42eb6
use _write to solve a problem when the order is blocked and set qty to 0.0
ingadhoc/sale,ingadhoc/sale,ingadhoc/sale,ingadhoc/sale
sale_delivery_ux/models/sale_order.py
sale_delivery_ux/models/sale_order.py
############################################################################## # For copyright and license notices, see __manifest__.py file in module root # directory ############################################################################## from odoo import models class SaleOrder(models.Model): _inherit = '...
############################################################################## # For copyright and license notices, see __manifest__.py file in module root # directory ############################################################################## from odoo import models class SaleOrder(models.Model): _inherit = '...
agpl-3.0
Python
34359ce6a0bda6ec061782f743f73fb528446553
Support py3
toslunar/chainerrl,toslunar/chainerrl
replay_buffer.py
replay_buffer.py
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import dict from future import standard_library standard_library.install_aliases() from collections import deque import random import six.moves.cPickle as p...
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import dict from future import standard_library standard_library.install_aliases() from collections import deque import random import cPickle as pickle cla...
mit
Python
c25c9de19369467116714eadff86984f716d9b90
Change fields order
Hackfmi/Diaphanum,Hackfmi/Diaphanum
reports/admin.py
reports/admin.py
# coding: utf-8 from django.contrib import admin from .models import Report class ReportAdmin(admin.ModelAdmin): list_display = ('addressed_to', 'reported_from', 'content', 'signed_from', 'get_copies', 'created_at') list_filter = ['created_at'] search_fields = ['addressed_to', 'reported_from', 'content', '...
# coding: utf-8 from django.contrib import admin from .models import Report class ReportAdmin(admin.ModelAdmin): #Определя кои полета да се показват в заявката за извлизачне на анкети list_display = ('addressed_to', 'reported_from', 'content', 'created_at', 'signed_from', 'get_copies') #Добавя поле за филт...
mit
Python
418af7f4c1cfae730d96ad26e0d22860a9c4df1e
Update ReConnect.py
txomon/SpockBot,nickelpro/SpockBot,OvercastNetwork/spock,Gjum/SpockBot,MrSwiss/SpockBot,guineawheek/spock,SpockBotMC/SpockBot,gamingrobot/SpockBot,luken/SpockBot
plugins/ReConnect.py
plugins/ReConnect.py
""" Hilariously out of date, I'll update this when it's not 3:30 in the morning In the meantime, go look at plugins in spock.net.plugins for more up-to-date plugin examples """ import threading from spock.mcp.mcpacket import Packet from spock.net.cflags import cflags from spock.net.timer import EventTimer #Will relen...
import threading from spock.mcp.mcpacket import Packet from spock.net.cflags import cflags from spock.net.timer import EventTimer #Will relentlessly try to reconnect to a server class ReConnectPlugin: def __init__(self, client, settings): self.client = client self.lock = False self.kill = False self.delay = 0...
mit
Python
1806316e91eb98232424936f6bba16772861872b
Fix W605 warning
coala/corobo,coala/corobo
plugins/pitchfork.py
plugins/pitchfork.py
import re import string import textwrap from errbot import BotPlugin, botcmd class Pitchfork(BotPlugin): """ To pitchfork users down to ... """ @botcmd def pitchfork(self, msg, arg): """ To pitchfork user down to ... """ match = re.match(r'@?([\w-]+)(?:\s+(?:down\...
import re import string import textwrap from errbot import BotPlugin, botcmd class Pitchfork(BotPlugin): """ To pitchfork users down to ... """ @botcmd def pitchfork(self, msg, arg): """ To pitchfork user down to ... """ match = re.match(r'@?([\w-]+)(?:\s+(?:down\...
mit
Python
fcf1371162753b30597850487339b74e77f43b62
set epsilon to 1
dvav/dgeclust
DGEclust/viz/plotRA.py
DGEclust/viz/plotRA.py
## Copyright (C) 2012-2013 Dimitrios V. Vavoulis ## Computational Genomics Group (http://bioinformatics.bris.ac.uk/) ## Department of Computer Science ## University of Bristol ################################################################################ import pylab as pl import numpy as np ######################...
## Copyright (C) 2012-2013 Dimitrios V. Vavoulis ## Computational Genomics Group (http://bioinformatics.bris.ac.uk/) ## Department of Computer Science ## University of Bristol ################################################################################ import pylab as pl import numpy as np ######################...
mit
Python
34a2fac19b9711ce341fec31c1e09370bfb34bec
convert string to bytes before writing to file
houqp/shell.py
shell/util.py
shell/util.py
#!/usr/bin/env python # -*- coding:utf-8 -*- import tempfile def str_to_pipe(s): input_pipe = tempfile.SpooledTemporaryFile() if isinstance(s, str): s = s.encode('utf-8') input_pipe.write(s) input_pipe.seek(0) return input_pipe
#!/usr/bin/env python # -*- coding:utf-8 -*- import tempfile def str_to_pipe(s): input_pipe = tempfile.SpooledTemporaryFile() input_pipe.write(s) input_pipe.seek(0) return input_pipe
mit
Python
a8eea42f1462ac1c83eb0d16195b7c546a907e7b
revert wikipedia namespace
Teino1978-Corp/Teino1978-Corp-skybot,jmgao/skybot,Jeebeevee/DouweBot_JJ15,olslash/skybot,Jeebeevee/DouweBot,elitan/mybot,craisins/wh2kbot,ddwo/nhl-bot,rmmh/skybot,TeamPeggle/ppp-helpdesk,cmarguel/skybot,craisins/nascarbot,crisisking/skybot,callumhogsden/ausbot,andyeff/skybot,SophosBlitz/glacon,df-5/skybot,isislab/botbo...
plugins/wikipedia.py
plugins/wikipedia.py
'''Searches wikipedia and returns first sentence of article Scaevolus 2009''' import re from util import hook, http api_prefix = "http://en.wikipedia.org/w/api.php" search_url = api_prefix + "?action=opensearch&format=xml" paren_re = re.compile('\s*\(.*\)$') @hook.command('w') @hook.command def wiki(inp): ''...
'''Searches wikipedia and returns first sentence of article Scaevolus 2009''' import re from util import hook, http api_prefix = "http://en.wikipedia.org/w/api.php" search_url = api_prefix + "?action=opensearch&format=xml" paren_re = re.compile('\s*\(.*\)$') @hook.command('w') @hook.command def wiki(inp): ''...
unlicense
Python
7c4124b3e21702a730b8bc454bad2a62c7a797c5
Add lighting schedule for lighting model.
VOLTTRON/volttron-applications,VOLTTRON/volttron-applications,VOLTTRON/volttron-applications,VOLTTRON/volttron-applications,VOLTTRON/volttron-applications
pnnl/models/light.py
pnnl/models/light.py
import logging import importlib import pandas as pd from volttron.platform.agent import utils from datetime import timedelta as td from volttron.pnnl.models.utils import clamp _log = logging.getLogger(__name__) utils.setup_logging() class Light(object): DOL = "dol" OCC = "occ" def __init__(self, config...
import logging import importlib import pandas as pd from volttron.platform.agent import utils from datetime import timedelta as td from volttron.pnnl.models.utils import clamp _log = logging.getLogger(__name__) utils.setup_logging() class Light(object): DOL = "dol" OCC = "occ" def __init__(self, config...
bsd-3-clause
Python
c737cf939ef9e028ada0ae3087d45b7a0dc8710c
Tweak script that gets test list in xdist builds
EDUlib/edx-platform,jolyonb/edx-platform,eduNEXT/edx-platform,EDUlib/edx-platform,arbrandes/edx-platform,mitocw/edx-platform,jolyonb/edx-platform,stvstnfrd/edx-platform,cpennington/edx-platform,cpennington/edx-platform,ESOedX/edx-platform,mitocw/edx-platform,mitocw/edx-platform,eduNEXT/edx-platform,edx-solutions/edx-pl...
scripts/xdist/get_worker_test_list.py
scripts/xdist/get_worker_test_list.py
""" This script strips the console log of a pytest-xdist Jenkins run into the test lists of each pytest worker. Assumes the following format: [test-suite] [worker] RESULT test """ import click import io import re import os import shutil @click.command() @click.option( '--log-file', help="File name of console ...
""" This script strips the console log of a pytest-xdist Jenkins run into the test lists of each pytest worker. Assumes the following format: [test-suite] [worker] RESULT test """ import click import io import re import os import shutil @click.command() @click.option( '--log-file', help="File name of console ...
agpl-3.0
Python
72e0b78ea1578df68f95f97f6080f5c011371753
Return None if there are no results for a resource
ckan/ckanext-deadoralive,ckan/ckanext-deadoralive,ckan/ckanext-deadoralive
ckanext/deadoralive/logic/action/get.py
ckanext/deadoralive/logic/action/get.py
import datetime import ckanext.deadoralive.model.results as results import ckanext.deadoralive.config as config def get_resources_to_check(context, data_dict): """Return a list of up to ``n`` resource IDs to be checked. Returns up to ``n`` resource IDs to be checked for broken links. Resources that hav...
import datetime import ckanext.deadoralive.model.results as results import ckanext.deadoralive.config as config def get_resources_to_check(context, data_dict): """Return a list of up to ``n`` resource IDs to be checked. Returns up to ``n`` resource IDs to be checked for broken links. Resources that hav...
agpl-3.0
Python
bf0986f2b404b97d30b047a55b4914a8c71975a7
set sort on list view
bhoggard/nurtureart,bhoggard/nurtureart,bhoggard/nurtureart
benefit/urls.py
benefit/urls.py
from django.conf.urls import patterns, url from django.views.generic import DetailView, ListView, TemplateView from .models import Artwork urlpatterns = patterns('', url(r'^$', 'benefit.views.index', name='index'), url(r'^artworks$', ListView.as_view( model=Artwork, paginate_by=24, queryset=Art...
from django.conf.urls import patterns, url from django.views.generic import DetailView, ListView, TemplateView from .models import Artwork urlpatterns = patterns('', url(r'^$', 'benefit.views.index', name='index'), url(r'^artworks$', ListView.as_view( model=Artwork, paginate_by=24), name='artwo...
mit
Python
858d0ba40131787940a71204a12b509e873c4fba
Normalize version number
dreispt/project,acsone/project,OCA/project-service,NeovaHealth/project-service,xpansa/project-service,ddico/project,dreispt/project-service,acsone/project-service,eezee-it/project-service
project_stage_state_issue/__openerp__.py
project_stage_state_issue/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # Daniel Reis, 2014 # # This program 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, eith...
# -*- coding: utf-8 -*- ############################################################################## # # Daniel Reis, 2014 # # This program 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, eith...
agpl-3.0
Python
26da8d4ee15ccdb3338c0ad0ca8096d8da455050
add `adapt2cuds` in the simphony plugin
simphony/simphony-mayavi
simphony_mayavi/plugin.py
simphony_mayavi/plugin.py
from simphony_mayavi._version import full_version as __version__ from simphony_mayavi.api import show, snapshot, adapt2cuds from simphony_mayavi.cuds.api import VTKParticles, VTKLattice, VTKMesh __all__ = [ 'show', 'snapshot', 'adapt2cuds', '__version__', 'VTKParticles', 'VTKLattice', 'VTKMesh']
from simphony_mayavi._version import full_version as __version__ from simphony_mayavi.show import show from simphony_mayavi.snapshot import snapshot from simphony_mayavi.cuds.api import VTKParticles, VTKLattice, VTKMesh __all__ = [ 'show', 'snapshot', '__version__', 'VTKParticles', 'VTKLattice', 'VTKMesh']
bsd-2-clause
Python
fab28d49551012e2db97a109ae78f87c6d9d9a68
Fix bug. Cannot do sudo.
svenkreiss/databench_examples,svenkreiss/databench_examples,svenkreiss/databench_examples,svenkreiss/databench_examples
.ebextensions/01rewrite_nginx_config.py
.ebextensions/01rewrite_nginx_config.py
#! /usr/bin/python """Modifies nginx configuration file on AWS Elastic Beanstalk to support WebSocket connections.""" __author__ = "Sven Kreiss <me@svenkreiss.com>" __version__ = "0.0.2" import os NGINX_CONF_FILE = '/etc/nginx/sites-enabled/elasticbeanstalk-nginx-docker.conf' NGINX_CONFIG = """ location /socket...
#! /usr/bin/python """Modifies nginx configuration file on AWS Elastic Beanstalk to support WebSocket connections.""" __author__ = "Sven Kreiss <me@svenkreiss.com>" __version__ = "0.0.2" import os NGINX_CONF_FILE = '/etc/nginx/sites-enabled/elasticbeanstalk-nginx-docker.conf' NGINX_CONFIG = """ location /socket...
mit
Python
e02abe17b521508a6fb90a628c5c6dd59f7d3186
Allow customizations of user-config.py
yuvipanda/paws,yuvipanda/paws
singleuser/user-config.py
singleuser/user-config.py
import os mylang = 'test' family = 'wikipedia' custom_path = os.path.expanduser('~/user-config.py') if os.path.exists(custom_path): with open(custom_path, 'r') as f: exec(compile(f.read(), custom_path, 'exec'), globals()) # Things that should be non-easily-overridable usernames['*']['*'] = os.environ['J...
import os mylang = 'test' family = 'wikipedia' usernames['wikipedia']['test'] = os.environ['JPY_USER']
mit
Python
fdab958fe17747e5a0a869dd367b2c9c277b4462
Bump slybot version
hanicker/portia,anjuncc/portia,hanicker/portia,livepy/portia,NoisyText/portia,Suninus/portia,anjuncc/portia,Suninus/portia,SouthStar/portia,chennqqi/portia,NicoloPernigo/portia,pombredanne/portia,chennqqi/portia,chennqqi/portia,amikey/portia,nju520/portia,pombredanne/portia,naveenvprakash/portia,livepy/portia,livepy/po...
slybot/slybot/__init__.py
slybot/slybot/__init__.py
__version__ = '0.11.1'
__version__ = '0.11'
bsd-3-clause
Python
bba5011432e484a906f0008c46f4d049492b2643
change location of computenode.txt
ElofssonLab/web_common_backend,ElofssonLab/web_common_backend,ElofssonLab/web_common_backend,ElofssonLab/web_common_backend,ElofssonLab/web_common_backend
proj/pro_settings.py
proj/pro_settings.py
""" Django settings for proj project in production For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_...
""" Django settings for proj project in production For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_...
mit
Python
71ea6816eea95e8bf750563718b0dd39114a3c49
Add a cookie based authentication source
usingnamespace/pyramid_authsanity
pyramid_authsanity/sources.py
pyramid_authsanity/sources.py
from webob.cookies ( SignedCookieProfile, SignedSerializer, ) from zope.interface import implementer from .interfaces ( IAuthSourceService, ) @implementer(IAuthSourceService) class SessionAuthSource(object): """ An authentication source that uses the current session """ ...
from zope.interface import implementer from .interfaces ( IAuthSourceService, ) @implementer(IAuthSourceService) class SessionAuthSource(object): """ An authentication source that uses the current session """ vary = () value_key = 'sanity.value' def __init__(self, context, request): ...
isc
Python
494f14a69d08e9bfd556fccc6b4e2319db129a38
Add created and modified fields to Receipt
trimailov/finance,trimailov/finance,trimailov/finance
books/models.py
books/models.py
from django.contrib.auth.models import User from django.db import models from django.db.models import fields from django.utils import timezone class Receipt(models.Model): title = fields.CharField(max_length=255) price = fields.DecimalField(max_digits=10, decimal_places=2) created = fields.DateTimeField(a...
from django.contrib.auth.models import User from django.db import models from django.db.models import fields class Receipt(models.Model): title = fields.CharField(max_length=255) price = fields.DecimalField(max_digits=10, decimal_places=2) user = models.ForeignKey(User) def __str__(self): ret...
mit
Python
b2c185ee6f02584b8a3e3c512cf62c5943cbbde5
work this time
akhilari7/pa-dude,neerajvashistha/pa-dude,akhilari7/pa-dude,neerajvashistha/pa-dude,neerajvashistha/pa-dude,akhilari7/pa-dude,neerajvashistha/pa-dude,akhilari7/pa-dude,neerajvashistha/pa-dude,neerajvashistha/pa-dude
spellcheck.py
spellcheck.py
import re, collections #import enchant import sys sys.path.append('pyenchant-1.6.6/enchant') sys.path.append('pyenchant-1.6.6/enchant/checker/') from enchant.checker import SpellChecker def words(text): return re.findall('[a-z]+', text.lower()) def train(features): model = collections.defaultdict(lambda: 1) ...
import re, collections import enchant import sys #sys.path.append('pyenchant-1.6.6/enchant') from enchant.checker import SpellChecker def words(text): return re.findall('[a-z]+', text.lower()) def train(features): model = collections.defaultdict(lambda: 1) for f in features: model[f] += 1 retu...
mit
Python
b1547647deec6c1edf54c497fa4ed20235ea6902
Add missing egun.bias in init
lnls-fac/sirius
pymodels/middlelayer/devices/__init__.py
pymodels/middlelayer/devices/__init__.py
from .dcct import DCCT from .li_llrf import LiLLRF from .rf import RF from .sofb import SOFB from .kicker import Kicker from .septum import Septum from .screen import Screen from .bpm import BPM from .ict import ICT from .ict import TranspEff from .egun import Bias from .egun import Filament from .egun import HVPS
from .dcct import DCCT from .li_llrf import LiLLRF from .rf import RF from .sofb import SOFB from .kicker import Kicker from .septum import Septum from .screen import Screen from .bpm import BPM from .ict import ICT from .ict import TranspEff from .egun import HVPS from .egun import Filament
mit
Python
83799d81fe734938024aa1f5d4a438fba3cc1807
Add uploading to AWS machinery
jasonsbrooks/ysniff-software,jasonsbrooks/ysniff-software
ysniff.py
ysniff.py
#!/usr/bin/env python import boto.rds import fileinput import sys import os mac_index = 12 time_index = 1 start_t_us = 0 start_u_us = 0 MAC_LEN = 17 SAMPLE_PERIOD = 30 # Seconds. PUSH_TO_AWS_PERIOD = 3600 # Seconds. One hour. maclist = set() buffer = {} conn=boto.connect_sdb() domain=conn.get_domain('tmp_ysniff') #...
#!/usr/bin/env python import boto.rds import fileinput import sys mac_index = 12 time_index = 1 start_t_us = 0 start_u_us = 0 MAC_LEN = 17 SAMPLE_PERIOD = 30 # Seconds. PUSH_TO_AWS_PERIOD = 3600 # Seconds. One hour. maclist = set() buffer = {} conn = boto.rds.connect_to_region("us-west-2",aws_access_key_id=sys.argv[...
mit
Python
6df951062e73559f0d3cca50370969617c415d6e
make imports local
erm0l0v/python_wrap_cases
python_wrap_cases/__init__.py
python_wrap_cases/__init__.py
# -*- coding: utf-8 -*- __author__ = 'Kirill Ermolov' __email__ = 'erm0l0v@ya.ru' __version__ = '0.1.2' from python_wrap_cases.wrap_cases import *
# -*- coding: utf-8 -*- __author__ = 'Kirill Ermolov' __email__ = 'erm0l0v@ya.ru' __version__ = '0.1.2' from python_wrap_cases import generators as g from python_wrap_cases.wrap_cases import *
bsd-3-clause
Python
4b3475eec6cb174c78fe6c8ec7d8495500e7bef3
Remove reference to OHSU.
ohsu-qin/qipipe
qipipe/staging/collections.py
qipipe/staging/collections.py
from .staging_error import StagingError extent = {} """The {name: collection} dictionary.""" def add(*collections): """ Adds the given :class:`qipipe.staging.collection.Collection`s to the list of known collections. :param collections: the collection objects to add """ for coll in collect...
from .staging_error import StagingError extent = {} """The {name: collection} dictionary.""" def add(*collections): """ Adds the given :class:`qipipe.staging.collection.Collection`s to the list of known collections. :param collections: the collection objects to add """ for coll in collect...
bsd-2-clause
Python
cff0599bbc891ec690f818cb85bffce3e78212df
Fix pep8
lxc/pylxd,lxc/pylxd
pylxd/deprecation.py
pylxd/deprecation.py
import warnings warnings.simplefilter('once', DeprecationWarning) class deprecated(): """A decorator for warning about deprecation warnings. The decorator takes an optional message argument. This message can be used to direct the user to a new API or specify when it will be removed. """ DEF...
import warnings warnings.simplefilter('once', DeprecationWarning) class deprecated(): """A decorator for warning about deprecation warnings. The decorator takes an optional message argument. This message can be used to direct the user to a new API or specify when it will be removed. """ def...
apache-2.0
Python
9435e211e3e54184946a66c5f59edfc20ff17c9f
Change default TB version
lnls-fac/sirius
pymodels/__init__.py
pymodels/__init__.py
"""PyModels package.""" import os as _os from . import LI_V01_01 from . import TB_V03_02 from . import BO_V05_04 from . import TS_V03_03 from . import SI_V24_04 from . import coordinate_system with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f: __version__ = _f.read().strip() __all__ = ('LI_V01_01', 'T...
"""PyModels package.""" import os as _os from . import LI_V01_01 from . import TB_V02_01 from . import BO_V05_04 from . import TS_V03_03 from . import SI_V24_04 from . import coordinate_system with open(_os.path.join(__path__[0], 'VERSION'), 'r') as _f: __version__ = _f.read().strip() __all__ = ('LI_V01_01', 'T...
mit
Python
58b88ac1b6612f4bb3b78c09de0616fcc71fa0b9
add remove blank lines
przemyslawjanpietrzak/pyMonet
pymonet/test_lazy.py
pymonet/test_lazy.py
from pymonet.lazy import Lazy from random import random class LazySpy: def mapper(self, input): return input + 1 def fn(self): return 42 def fold_function(self, value): return value + 1 def fn(): return 42 def fn1(): return 43 def test_applicative_should_call_stor...
from pymonet.lazy import Lazy from random import random class LazySpy: def mapper(self, input): return input + 1 def fn(self): return 42 def fold_function(self, value): return value + 1 def fn(): return 42 def fn1(): return 43 def test_applicative_should_call_stor...
mit
Python
371aed8cc93d1903f7d20b114054aade9bdc72cd
update version
Pythonicos/qdict
qdict/__version__.py
qdict/__version__.py
__version__ = '1.1.0'
__version__ = '1.0.0'
mit
Python
d78b3476a3244ba62df4df2e4c6b6840fbb34c67
Update version to 0.13.2
quantumlib/qsim,quantumlib/qsim,quantumlib/qsim,quantumlib/qsim
qsimcirq/_version.py
qsimcirq/_version.py
"""The version number defined here is read automatically in setup.py.""" __version__ = "0.13.2"
"""The version number defined here is read automatically in setup.py.""" __version__ = "0.13.1"
apache-2.0
Python
70ae79d1704279a92af9406e2717b8847c22024d
Use raw_id_field for users in admin.
istresearch/readthedocs.org,attakei/readthedocs-oauth,ojii/readthedocs.org,royalwang/readthedocs.org,hach-que/readthedocs.org,nyergler/pythonslides,kdkeyser/readthedocs.org,sid-kap/readthedocs.org,emawind84/readthedocs.org,attakei/readthedocs-oauth,rtfd/readthedocs.org,kdkeyser/readthedocs.org,sils1297/readthedocs.org,...
readthedocs/projects/admin.py
readthedocs/projects/admin.py
"""Django administration interface for `~projects.models.Project` and related models. """ from builds.models import Version from django.contrib import admin from projects.models import Project, File, ImportedFile class VersionInline(admin.TabularInline): model = Version class ProjectAdmin(admin.ModelAdmin): ...
"""Django administration interface for `~projects.models.Project` and related models. """ from builds.models import Version from django.contrib import admin from projects.models import Project, File, ImportedFile class VersionInline(admin.TabularInline): model = Version class ProjectAdmin(admin.ModelAdmin): ...
mit
Python
5856e4daaf141e5bf9cdef438378a3757297f9c0
Add wrapper methods for clarity.
hhursev/recipe-scraper
recipe_scrapers/wholefoods.py
recipe_scrapers/wholefoods.py
from ._abstract import AbstractScraper class WholeFoods(AbstractScraper): @classmethod def host(self, domain="com"): return f"www.wholefoodsmarket.{domain}" def title(self): return self.schema.title() def total_time(self): return self.schema.total_time() def yields(self)...
from ._abstract import AbstractScraper class WholeFoods(AbstractScraper): @classmethod def host(self, domain="com"): return f"www.wholefoodsmarket.{domain}"
mit
Python
873d42ddccc5f1fe2c8234ff6da3e00cf4beb8aa
Update setup.py
phac-nml/bioconda-recipes,peterjc/bioconda-recipes,rob-p/bioconda-recipes,joachimwolff/bioconda-recipes,matthdsm/bioconda-recipes,martin-mann/bioconda-recipes,xguse/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,zachcp/bioconda-recipes,phac-nml/bioconda-recipes,matthdsm/bioconda-recipes,ostrokach/bioconda-recipes,ivirs...
recipes/python-omero/setup.py
recipes/python-omero/setup.py
#!/usr/bin/python # -*- coding: iso-8859-15 -*- from distutils.core import setup import os setup(name='Omero Python', version=os.environ['OMERO_VERSION'], description='OME (Open Microscopy Environment) develops open-source software and data format standards for the storage and manipulation of biological light micro...
#!/usr/bin/python # -*- coding: latin-1 -*- from distutils.core import setup import os setup(name='Omero Python', version=os.environ['OMERO_VERSION'], description='OME (Open Microscopy Environment) develops open-source software and data format standards for the storage and manipulation of biological light microscop...
mit
Python
35346bc78d18009cddf19e39c8ea7e70c6647f7b
Use assertRaises in test_wipe_no_params (#2309)
safwanrahman/readthedocs.org,safwanrahman/readthedocs.org,davidfischer/readthedocs.org,pombredanne/readthedocs.org,pombredanne/readthedocs.org,pombredanne/readthedocs.org,rtfd/readthedocs.org,tddv/readthedocs.org,tddv/readthedocs.org,tddv/readthedocs.org,safwanrahman/readthedocs.org,rtfd/readthedocs.org,davidfischer/re...
readthedocs/rtd_tests/tests/test_urls.py
readthedocs/rtd_tests/tests/test_urls.py
from django.core.urlresolvers import reverse from django.core.urlresolvers import NoReverseMatch from django.test import TestCase class WipeUrlTests(TestCase): def test_wipe_no_params(self): with self.assertRaises(NoReverseMatch): reverse('wipe_version') def test_wipe_alphabetic(self): ...
from django.core.urlresolvers import reverse from django.core.urlresolvers import NoReverseMatch from django.test import TestCase class WipeUrlTests(TestCase): def test_wipe_no_params(self): try: reverse('wipe_version') self.fail('reverse with no parameters should fail') e...
mit
Python
3acee896fccfc2a99c8d38d432635b09a7d56d7d
remove unused future import in file script
luci/recipes-py,luci/recipes-py
recipe_modules/file/resources/symlink.py
recipe_modules/file/resources/symlink.py
#!/usr/bin/env python # Copyright 2018 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Simple script for creating symbolic links for an arbitrary number of path pairs.""" import argparse import errno import ...
#!/usr/bin/env python # Copyright 2018 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Simple script for creating symbolic links for an arbitrary number of path pairs.""" import argparse import errno import ...
apache-2.0
Python
b4e8dd76e3095941c9837151b263365f08426ea1
Fix privileges of package frontend.
82Flex/DCRM,82Flex/DCRM,82Flex/DCRM,82Flex/DCRM
WEIPDCRM/styles/DefaultStyle/views/chart.py
WEIPDCRM/styles/DefaultStyle/views/chart.py
# coding=utf-8 """ DCRM - Darwin Cydia Repository Manager Copyright (C) 2017 WU Zheng <i.82@me.com> & 0xJacky <jacky-943572677@qq.com> This program 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 ...
# coding=utf-8 """ DCRM - Darwin Cydia Repository Manager Copyright (C) 2017 WU Zheng <i.82@me.com> & 0xJacky <jacky-943572677@qq.com> This program 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 ...
agpl-3.0
Python
56dde1833dd61f6210a37d819a3df4d6a5e2db51
Update download Sector help description
makhidkarun/traveller_pyroute
PyRoute/downloadsec.py
PyRoute/downloadsec.py
''' Created on Jun 3, 2014 @author: tjoneslo ''' import urllib2 import urllib import codecs import string import time import os import argparse def get_url (url, sector, suffix): f = urllib2.urlopen(url) encoding=f.headers['content-type'].split('charset=')[-1] content = f.read() if encoding == 't...
''' Created on Jun 3, 2014 @author: tjoneslo ''' import urllib2 import urllib import codecs import string import time import os import argparse def get_url (url, sector, suffix): f = urllib2.urlopen(url) encoding=f.headers['content-type'].split('charset=')[-1] content = f.read() if encoding == 't...
mit
Python
93b4357e4438d9c63e6f09ba4c3e534e0a03386e
add ComputeMolShape and ComputeMolVolume convenience functions
greglandrum/rdkit,adalke/rdkit,jandom/rdkit,strets123/rdkit,rvianello/rdkit,strets123/rdkit,strets123/rdkit,rvianello/rdkit,bp-kelley/rdkit,greglandrum/rdkit,AlexanderSavelyev/rdkit,rdkit/rdkit,soerendip42/rdkit,ptosco/rdkit,rdkit/rdkit,ptosco/rdkit,soerendip42/rdkit,bp-kelley/rdkit,bp-kelley/rdkit,adalke/rdkit,rvianel...
Python/Chem/AllChem.py
Python/Chem/AllChem.py
# $Id$ # # Copyright (C) 2006 greg Landrum and Rational Discovery LLC # # @@ All Rights Reserved @@ # """ Import all RDKit chemistry modules """ import rdBase import RDConfig import Numeric import DataStructs from Geometry import rdGeometry from Chem import * from rdPartialCharges import * from r...
# $Id$ # # Copyright (C) 2006 greg Landrum and Rational Discovery LLC # # @@ All Rights Reserved @@ # """ Import all RDKit chemistry modules """ import rdBase import RDConfig import Numeric import DataStructs from Geometry import rdGeometry from Chem import * from rdPartialCharges import * from r...
bsd-3-clause
Python
61cad8665fe84c74ade0c30f7935f064dafea0d2
add imports section
mylokin/redisext,mylokin/redisext
redisext/__init__.py
redisext/__init__.py
''' Introduction ------------ Redisext is a tool for data modeling. Its primary goal is to provide light interface to well-known data models based on Redis such as queues, hashmaps, counters, pools and stacks. Redisext could be treated as a ORM for Redis. Tutorial -------- Counter Model allows you to build counters ...
''' Introduction ------------ Redisext is a tool for data modeling. Its primary goal is to provide light interface to well-known data models based on Redis such as queues, hashmaps, counters, pools and stacks. Redisext could be treated as a ORM for Redis. Tutorial -------- Counter Model allows you to build counters ...
mit
Python
5026b687f74f351c17fbaa1d219d4cad34b77eb6
Add missing space
mphe/pychatbot,mphe/pychatbot
chatbot/main.py
chatbot/main.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import logging import argparse import chatbot.bot def main(): parser = argparse.ArgumentParser( description="Run the bot using a given profile and/or a given API.", epilog="At least one of -p/--profile or -a/--api has to be specified." )...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import logging import argparse import chatbot.bot def main(): parser = argparse.ArgumentParser( description="Run the bot using a given profile and/or a given API.", epilog="At least one of -p/--profile or -a/--api has to be specified." )...
mit
Python
20328fd50002af69eb441e68b89a85dbda4ab43a
fix django 1.11.1
simon-db/django-cked,simon-db/django-cked,simon-db/django-cked,simon-db/django-cked
cked/widgets.py
cked/widgets.py
from django import forms from django.conf import settings from django.core.urlresolvers import reverse from django.template.loader import render_to_string from django.utils.encoding import force_unicode from django.utils.html import conditional_escape from django.utils.safestring import mark_safe from django.core.urlre...
from django import forms from django.conf import settings from django.core.urlresolvers import reverse from django.template.loader import render_to_string from django.utils.encoding import force_unicode from django.utils.html import conditional_escape from django.utils.safestring import mark_safe from django.core.urlre...
bsd-2-clause
Python
2f67d775600bce74e1f4cc59b63d63f4f0dc5dc7
Update pion.py
Niceboy5275/PythonChess,Niceboy5275/PythonChess
classes/pion.py
classes/pion.py
from piece import piece class pion(piece): def move(self, pos_x, pos_y, tableau, possible): if (self.getColor() == piece._players['NOIR']): if tableau.getPion(pos_x, pos_y + 1) == None: tableau.setPossible(pos_x, pos_y + 1, piece._players['NOIR'], possible) if p...
from piece import piece from tkinter import * class pion(piece): def move(self, pos_x, pos_y, tableau, possible): if (self.getColor() == piece._players['NOIR']): if tableau.getPion(pos_x, pos_y + 1) == None: tableau.setPossible(pos_x, pos_y + 1, piece._players['NOIR'], possible...
mit
Python
c680852e6c2c378bf00bd6ff12d72bd6ecd3376d
Save email
SYNHAK/spiff,SYNHAK/spiff,SYNHAK/spiff
spiff/membership/views.py
spiff/membership/views.py
from django.template import RequestContext from django.core.exceptions import PermissionDenied from django.contrib import messages from django.contrib.auth.models import User from django.shortcuts import render_to_response import models import forms def index(request): users = User.objects.filter(is_active=True) r...
from django.template import RequestContext from django.core.exceptions import PermissionDenied from django.contrib import messages from django.contrib.auth.models import User from django.shortcuts import render_to_response import models import forms def index(request): users = User.objects.filter(is_active=True) r...
agpl-3.0
Python
54e0d90fd1682d3aa7e87d83c9a19495190b718b
read sequence from ctm and audacity
ynop/spych,ynop/spych
spych/scoring/sequence.py
spych/scoring/sequence.py
from spych.assets import ctm from spych.assets import audacity class SequenceItem(object): """ Represents an item in a sequence. An item at least consists of a label. It may has start time and duration in seconds. """ def __init__(self, label, start=-1.0, duration=-1.0): """ Create in...
class SequenceItem(object): """ Represents an item in a sequence. An item at least consists of a label. It may has start time and duration in seconds. """ def __init__(self, label, start=-1.0, duration=-1.0): """ Create instance. :param label: Label :param start: Start t...
mit
Python
e9bd104dfdbaae815d1dc96907b51cac0a6baefa
Update test_cryptorandom.py to match changes
statlab/cryptorandom
cryptorandom/tests/test_cryptorandom.py
cryptorandom/tests/test_cryptorandom.py
from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from nose.tools import assert_raises, raises from ..cryptorandom import BaseRandom, SHA256 def test_SHA256(): r = SHA256(5) assert(repr(r) == 'SHA256 PRNG with seed 5 and counter 0') ...
from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from nose.tools import assert_raises, raises from ..cryptorandom import BaseRandom, SHA256 def test_SHA256(): r = SHA256(5) assert(repr(r) == 'SHA256 PRNG with seed 5') assert(str...
bsd-2-clause
Python
2dfbe90d3282f033d4ee24d1955aa1fd9838a6b7
fix python syntax error
bigfootproject/sahara,bigfootproject/sahara,bigfootproject/sahara
savanna/tests/integration/tests/spark.py
savanna/tests/integration/tests/spark.py
''' Created on Jan 1, 2014 @author: DO Huy-Hoang ''' from savanna.openstack.common import excutils from savanna.tests.integration.tests import base class SparkTest(base.ITestCase): def __run_RL_job(self, masternode_ip, masternode_port): self.execute_command( './spark/run-example org.apa...
''' Created on Jan 1, 2014 @author: DO Huy-Hoang ''' from savanna.openstack.common import excutils from savanna.tests.integration.tests import base class SparkTest(base.ITestCase): def __run_RL_job(self, hostname, port): self.execute_command( './spark/run-example org.apache.spark.exampl...
apache-2.0
Python
5f42f76ffd11e82d51a334b91d64723388ca4a0d
Add RSS Feed Provider docs
michaelkuty/django-newswall,registerguard/django-newswall,matthiask/django-newswall,HerraLampila/django-newswall,registerguard/django-newswall,HerraLampila/django-newswall,michaelkuty/django-newswall,matthiask/django-newswall
newswall/providers/feed.py
newswall/providers/feed.py
""" RSS Feed Provider ================= Required configuration keys:: { "provider": "newswall.providers.feed", "source": "http://twitter.com/statuses/user_timeline/feinheit.rss" } """ from datetime import datetime import feedparser import time from newswall.providers.base import ProviderBase class ...
from datetime import datetime import feedparser import time from newswall.providers.base import ProviderBase class Provider(ProviderBase): def update(self): feed = feedparser.parse(self.config['source']) for entry in feed['entries']: self.create_story(entry.link, titl...
bsd-3-clause
Python
bd5b7001e38fbabf5bfee18747c0d192289e2284
Bump to 3.2.2 proper
timgraham/django-cms,jproffitt/django-cms,FinalAngel/django-cms,czpython/django-cms,bittner/django-cms,mkoistinen/django-cms,datakortet/django-cms,benzkji/django-cms,FinalAngel/django-cms,rsalmaso/django-cms,mkoistinen/django-cms,bittner/django-cms,jsma/django-cms,czpython/django-cms,jproffitt/django-cms,yakky/django-c...
cms/__init__.py
cms/__init__.py
# -*- coding: utf-8 -*- __version__ = '3.2.2' default_app_config = 'cms.apps.CMSConfig'
# -*- coding: utf-8 -*- __version__ = '3.2.2.dev1' default_app_config = 'cms.apps.CMSConfig'
bsd-3-clause
Python
02f82308f83ab9803bc80e195a257075837ea096
Update @graknlabs_build_tools dependency to latest 'master' branch
lolski/grakn,graknlabs/grakn,graknlabs/grakn,lolski/grakn,lolski/grakn,graknlabs/grakn,lolski/grakn,graknlabs/grakn
dependencies/graknlabs/dependencies.bzl
dependencies/graknlabs/dependencies.bzl
# # GRAKN.AI - THE KNOWLEDGE GRAPH # Copyright (C) 2018 Grakn Labs Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later v...
# # GRAKN.AI - THE KNOWLEDGE GRAPH # Copyright (C) 2018 Grakn Labs Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later v...
agpl-3.0
Python
d4195ff992bb4776e5c0927b6e2eac254b214968
Add missing return True to proposal conversion
rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son
app/soc/mapreduce/convert_proposal.py
app/soc/mapreduce/convert_proposal.py
#!/usr/bin/python2.5 # # Copyright 2011 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
#!/usr/bin/python2.5 # # Copyright 2011 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
Python
c6362677dd8703cf9934ada5cfdcebf5a7dd7d94
Add comment for new `testsetup` directive [skip ci]
bsipocz/astropy-helpers,Cadair/astropy-helpers,bsipocz/astropy-helpers,bsipocz/astropy-helpers,Cadair/astropy-helpers,dpshelio/astropy-helpers,astropy/astropy-helpers,dpshelio/astropy-helpers,astropy/astropy-helpers
astropy_helpers/sphinx/ext/doctest.py
astropy_helpers/sphinx/ext/doctest.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This is a set of three directives that allow us to insert metadata about doctests into the .rst files so the testing framework knows which tests to skip. This is quite different from the doctest extension in Sphinx itself, which actually does somethin...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This is a set of three directives that allow us to insert metadata about doctests into the .rst files so the testing framework knows which tests to skip. This is quite different from the doctest extension in Sphinx itself, which actually does somethin...
bsd-3-clause
Python
603dbd5deb9c1008a8149308d7edd9aacc34d28c
Update test_pypi_helper.py
sdpython/pyquickhelper,sdpython/pyquickhelper,sdpython/pyquickhelper,sdpython/pyquickhelper
_unittests/ut_loghelper/test_pypi_helper.py
_unittests/ut_loghelper/test_pypi_helper.py
""" @brief test log(time=42s) """ import sys import os import unittest import datetime if "temp_" in os.path.abspath(__file__): raise ImportError( "this file should not be imported in that location: " + os.path.abspath(__file__)) from pyquickhelper.pycode import ExtTestCase, skipif_circleci ...
""" @brief test log(time=42s) """ import sys import os import unittest import datetime if "temp_" in os.path.abspath(__file__): raise ImportError( "this file should not be imported in that location: " + os.path.abspath(__file__)) from pyquickhelper.loghelper import fLOG from pyquickhelper.lo...
mit
Python
c47279b32af2fac33ef50ed9cad454896951e0f1
update notrebooks
sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs
_unittests/ut_notebooks/test_1A_notebook.py
_unittests/ut_notebooks/test_1A_notebook.py
#-*- coding: utf-8 -*- """ @brief test log(time=50s) """ import sys import os import unittest try: import src except ImportError: path = os.path.normpath( os.path.abspath( os.path.join( os.path.split(__file__)[0], "..", ".."))) if p...
#-*- coding: utf-8 -*- """ @brief test log(time=60s) """ import sys import os import unittest try: import src except ImportError: path = os.path.normpath( os.path.abspath( os.path.join( os.path.split(__file__)[0], "..", ".."))) if p...
mit
Python
931e2d1e8ba3fd6b129a6d74e3a1ad9984c1938a
Add benchmark tests for numpy.random.randint.
shoyer/numpy,Dapid/numpy,jakirkham/numpy,WarrenWeckesser/numpy,chatcannon/numpy,WarrenWeckesser/numpy,b-carter/numpy,anntzer/numpy,ssanderson/numpy,simongibbons/numpy,nbeaver/numpy,SiccarPoint/numpy,numpy/numpy,Eric89GXL/numpy,kiwifb/numpy,seberg/numpy,rgommers/numpy,ESSS/numpy,shoyer/numpy,anntzer/numpy,utke1/numpy,dw...
benchmarks/benchmarks/bench_random.py
benchmarks/benchmarks/bench_random.py
from __future__ import absolute_import, division, print_function from .common import Benchmark import numpy as np from numpy.lib import NumpyVersion class Random(Benchmark): params = ['normal', 'uniform', 'weibull 1', 'binomial 10 0.5', 'poisson 10'] def setup(self, name): items = nam...
from __future__ import absolute_import, division, print_function from .common import Benchmark import numpy as np class Random(Benchmark): params = ['normal', 'uniform', 'weibull 1', 'binomial 10 0.5', 'poisson 10'] def setup(self, name): items = name.split() name = items.pop(...
bsd-3-clause
Python
343eea168bfa0e84e173dd053f4740c42a58e3d4
Upgrade BeautifulSoup
camptocamp/ngeo,kalbermattenm/ngeo,Jenselme/ngeo,camptocamp/ngeo,ger-benjamin/ngeo,camptocamp/ngeo,ger-benjamin/ngeo,adube/ngeo,camptocamp/ngeo,adube/ngeo,adube/ngeo,kalbermattenm/ngeo,adube/ngeo,Jenselme/ngeo,ger-benjamin/ngeo,camptocamp/ngeo,Jenselme/ngeo,kalbermattenm/ngeo,Jenselme/ngeo
buildtools/generate-examples-index.py
buildtools/generate-examples-index.py
import os import bs4 from mako.template import Template from argparse import ArgumentParser if __name__ == '__main__': examples = [] parser = ArgumentParser() parser.add_argument( '--app', action='append', nargs=3, metavar=('TITLE', 'HREF', 'DESC'), help='Add an application', default=[], ...
import os import bs4 from mako.template import Template from argparse import ArgumentParser if __name__ == '__main__': examples = [] parser = ArgumentParser() parser.add_argument( '--app', action='append', nargs=3, metavar=('TITLE', 'HREF', 'DESC'), help='Add an application', default=[], ...
mit
Python
ca8e15d50b816c29fc2a0df27d0266826e38b5b8
Update serializer to deal with new model
cellcounter/cellcounter,haematologic/cellcounter,cellcounter/cellcounter,cellcounter/cellcounter,haematologic/cellcounter,haematologic/cellcounter,cellcounter/cellcounter
cellcounter/statistics/serializers.py
cellcounter/statistics/serializers.py
from rest_framework.serializers import ModelSerializer from .models import CountInstance class CountInstanceSerializer(ModelSerializer): class Meta: model = CountInstance fields = ('count_total',)
from rest_framework.serializers import ModelSerializer from .models import CountInstance class CountInstanceSerializer(ModelSerializer): class Meta: model = CountInstance
mit
Python
56b11241909758f41ec924d761db3762c14698a6
Correct source filtering
wfxiang08/changes,bowlofstew/changes,dropbox/changes,bowlofstew/changes,dropbox/changes,bowlofstew/changes,wfxiang08/changes,wfxiang08/changes,dropbox/changes,dropbox/changes,bowlofstew/changes,wfxiang08/changes
changes/api/project_commit_details.py
changes/api/project_commit_details.py
from __future__ import absolute_import, division, unicode_literals from sqlalchemy.orm import joinedload, contains_eager from changes.api.base import APIView from changes.models import Build, Project, Revision, Source class ProjectCommitDetailsAPIView(APIView): def get(self, project_id, commit_id): proj...
from __future__ import absolute_import, division, unicode_literals from sqlalchemy.orm import joinedload from changes.api.base import APIView from changes.models import Build, Project, Revision, Source class ProjectCommitDetailsAPIView(APIView): def get(self, project_id, commit_id): project = Project.ge...
apache-2.0
Python
b2f9f5ec0894fcba54efdc6f8e188b77ef2bedf7
Make modules uninstallable
OCA/server-tools,OCA/server-tools,OCA/server-tools,YannickB/server-tools,YannickB/server-tools,YannickB/server-tools
base_report_auto_create_qweb/__openerp__.py
base_report_auto_create_qweb/__openerp__.py
# -*- encoding: utf-8 -*- ############################################################################## # # This program 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...
# -*- encoding: utf-8 -*- ############################################################################## # # This program 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...
agpl-3.0
Python
cbdf70bff1078a80167cfc54caab6b621907ceb6
migrate to pyiem and improve plotting some
akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem
scripts/current/today_high.py
scripts/current/today_high.py
# Output the 12z morning low temperature import sys import matplotlib.cm as cm import numpy as np import datetime from pyiem.plot import MapPlot now = datetime.datetime.now() import psycopg2 IEM = psycopg2.connect(database='iem', host='iemdb', user='nobody') icursor = IEM.cursor() sql = """ select s.id, x(s.geo...
# Output the 12z morning low temperature import sys import os, random import iemdb import iemplot import mx.DateTime now = mx.DateTime.now() IEM = iemdb.connect('iem', bypass=True) icursor = IEM.cursor() sql = """ select s.id, x(s.geom) as lon, y(s.geom) as lat, max_tmpf as high, s.network from summary_%s ...
mit
Python
6f4758b39c257dcabcabc6405cf400e8f6a358ea
Update develop version to 0.36.0
conan-io/conan-package-tools
cpt/__init__.py
cpt/__init__.py
__version__ = '0.36.0-dev' def get_client_version(): from conans.model.version import Version from conans import __version__ as client_version from os import getenv # It is a mess comparing dev versions, lets assume that the -dev is the further release return Version(client_version.replace("-dev"...
__version__ = '0.35.0-dev' def get_client_version(): from conans.model.version import Version from conans import __version__ as client_version from os import getenv # It is a mess comparing dev versions, lets assume that the -dev is the further release return Version(client_version.replace("-dev"...
mit
Python
f052ff59e99534c1e19559c4234a7916d40e606a
test against stories, nlu, domain
RasaHQ/rasa_nlu,RasaHQ/rasa_nlu,RasaHQ/rasa_nlu
tests/docs/test_docs_training_data.py
tests/docs/test_docs_training_data.py
from pathlib import Path from typing import List, Text import re import pytest import rasa.shared.utils.validation from rasa.shared.core.training_data.story_reader.yaml_story_reader import ( CORE_SCHEMA_FILE, ) from rasa.shared.nlu.training_data.formats.rasa_yaml import NLU_SCHEMA_FILE from rasa.shared.constants ...
from pathlib import Path from typing import List, Text import re import pytest from rasa.shared.nlu.training_data.formats import RasaYAMLReader DOCS_BASE_DIR = Path("docs/") MDX_DOCS_FILES = list((DOCS_BASE_DIR / "docs").glob("**/*.mdx")) # we're matching codeblocks with either `yaml-rasa` or `yml-rasa` types # we ...
apache-2.0
Python
3245946ff25889149dc60cf6b1364bd09c953809
Change url from relative to internal service endpoint
klmcwhirter/huntwords,klmcwhirter/huntwords,klmcwhirter/huntwords,klmcwhirter/huntwords
faas/puzzleboard-pop/puzzleboard_pop.py
faas/puzzleboard-pop/puzzleboard_pop.py
import json from datetime import datetime import requests from .model.puzzleboard import pop_puzzleboard class HuntwordsPuzzleBoardPopCommand(object): '''Command class that processes puzzleboard-pop message''' def run(self, jreq): '''Command that processes puzzleboard-pop message''' req = ...
import json from datetime import datetime import requests from .model.puzzleboard import pop_puzzleboard class HuntwordsPuzzleBoardPopCommand(object): '''Command class that processes puzzleboard-pop message''' def run(self, jreq): '''Command that processes puzzleboard-pop message''' req = ...
mit
Python
2c58fd815faae7e6b2aeb02a0d0b4aff9131c201
Bring more data into the test failure
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
tests/integration/states/test_cron.py
tests/integration/states/test_cron.py
""" Tests for the cron state """ import logging import pprint import salt.utils.platform from tests.support.case import ModuleCase from tests.support.helpers import skip_if_binaries_missing, slowTest from tests.support.unit import skipIf log = logging.getLogger(__name__) @skipIf(salt.utils.platform.is_windows(), "...
""" Tests for the cron state """ import logging import salt.utils.platform from tests.support.case import ModuleCase from tests.support.helpers import slowTest from tests.support.unit import skipIf log = logging.getLogger(__name__) @skipIf(salt.utils.platform.is_windows(), "minion is windows") class CronTest(Modul...
apache-2.0
Python
190c1a8b436f5ead14eddb1d2669c1ef7301159b
Test class for transformer
rsk-mind/rsk-mind-framework
tests/transformer/test_transformer.py
tests/transformer/test_transformer.py
import os from nose.tools import assert_equals, assert_items_equal from rsk_mind.dataset import Dataset from rsk_mind.transformer import * class CustomTransformer(Transformer): class Feats: a1 = Feat() a2 = Feat() f1 = CompositeFeat(['a1', 'a2']) def get_a1(self, feat): retu...
import os from nose.tools import assert_equals, assert_items_equal from rsk_mind.dataset import Dataset from rsk_mind.transformer import * class CustomTransformer(Transformer): class Feats(): a1 = Feat() a2 = Feat() f1 = CompositeFeat(['a1', 'a2']) def get_a1(self, feat): ret...
mit
Python
608dc0db688be1dabe3c6ba7647807f6697fcefe
Test image definition in SADL
chipster/chipster-tools,chipster/chipster-tools,chipster/chipster-tools,chipster/chipster-tools
tools/misc/python/test-data-in-out.py
tools/misc/python/test-data-in-out.py
# TOOL test-data-in-out.py: "Test data input and output in Python" (Data input output test.) # INPUT input TYPE GENERIC # OUTPUT output # OUTPUT OPTIONAL missing_output.txt # IMAGE chipster-tools-python import shutil shutil.copyfile('input', 'output')
# TOOL test-data-in-out.py: "Test data input and output in Python" (Data input output test.) # INPUT input TYPE GENERIC # OUTPUT output # OUTPUT OPTIONAL missing_output.txt import shutil shutil.copyfile('input', 'output')
mit
Python
52b1fa1edd1804945e0810369cf785d91a055710
Fix typo in vis/__init__.py
tensorflow/docs,tensorflow/docs,tensorflow/docs
tools/tensorflow_docs/vis/__init__.py
tools/tensorflow_docs/vis/__init__.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Python
5548e32a32bd1cd5951ce50e74c0fad944a1cf04
Stop using the extra field for Colombia
ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube
ideascube/conf/idb_col_llavedelsaber.py
ideascube/conf/idb_col_llavedelsaber.py
"""Configuration for Llave Del Saber, Colombia""" from .idb import * # noqa from django.utils.translation import ugettext_lazy as _ LANGUAGE_CODE = 'es' DOMAIN = 'bibliotecamovil.lan' ALLOWED_HOSTS = ['.bibliotecamovil.lan', 'localhost'] USER_FORM_FIELDS = USER_FORM_FIELDS + ( (_('Personal informations'), ['...
"""Configuration for Llave Del Saber, Colombia""" from .idb import * # noqa from django.utils.translation import ugettext_lazy as _ LANGUAGE_CODE = 'es' DOMAIN = 'bibliotecamovil.lan' ALLOWED_HOSTS = ['.bibliotecamovil.lan', 'localhost'] USER_FORM_FIELDS = USER_FORM_FIELDS + ( (_('Personal informations'), ['...
agpl-3.0
Python
c1b433e5ed4c06b956b4d27f6da4e8b1dab54aaf
Fix issue in cloudwacth service credentials
rolandovillca/aws_samples_boto3_sdk
services/cloudwatch/sample.py
services/cloudwatch/sample.py
''' =================================== Boto 3 - CloudWatch Service Example =================================== This application implements the CloudWatch service that lets you gets information from Amazon Cloud Watch. See the README for more details. ''' import boto3 ''' Define your AWS credentials: ''' AWS_ACCESS_KE...
''' =================================== Boto 3 - CloudWatch Service Example =================================== This application implements the CloudWatch service that lets you gets information from Amazon Cloud Watch. See the README for more details. ''' import boto3 ''' Define your AWS credentials: ''' AWS_ACCESS_KE...
mit
Python
a05a05f24c29dcf039e02b55c18c476dc69757df
Update repo entrypoint and remote_update stub.
RitwikGupta/picoCTF-shell-manager,cganas/picoCTF-shell-manager,RitwikGupta/picoCTF-shell-manager,cganas/picoCTF-shell-manager,picoCTF/picoCTF-shell-manager,cganas/picoCTF-shell-manager,cganas/picoCTF-shell-manager,RitwikGupta/picoCTF-shell-manager,picoCTF/picoCTF-shell-manager,picoCTF/picoCTF-shell-manager,picoCTF/pico...
shell_manager/problem_repo.py
shell_manager/problem_repo.py
""" Problem repository management for the shell manager. """ import spur, gzip from shutil import copy2 from os.path import join def update_repo(args): """ Main entrypoint for repo update operations. """ if args.repo_type == "local": local_update(args.repository, args.package_paths) else...
""" Problem repository management for the shell manager. """ import spur, gzip from shutil import copy2 from os.path import join def local_update(repo_path, deb_paths=[]): """ Updates a local deb repository by copying debs and running scanpackages. Args: repo_path: the path to the local reposito...
mit
Python
f04291ad54e345f2265fda886326d3a6c4bd3438
Update Meh.py
kallerdaller/Cogs-Yorkfield
Meh/Meh.py
Meh/Meh.py
import discord from discord.ext import commands class Mycog: """Tells a user that you said meh""" def __init__(self, bot): self.bot = bot @commands.command(pass_context=True) async def meh(self, ctx, user : discord.Member): """Tags a person and tells them meh""" #Your code wi...
import discord from discord.ext import commands class Mycog: """Tells a user that you said meh""" def __init__(self, bot): self.bot = bot @commands.command(pass_context=True) async def meh(self, ctx, user : discord.Member): """Tags a person and tells them meh""" #Your code wi...
mit
Python
8cd8e0ecc3f878c13d1d3a8aac85798ecac11afb
remove tfidfpredicate from tfidf.py, its in blocking.py now
neozhangthe1/dedupe,tfmorris/dedupe,pombredanne/dedupe,nmiranda/dedupe,nmiranda/dedupe,datamade/dedupe,neozhangthe1/dedupe,datamade/dedupe,01-/dedupe,dedupeio/dedupe,davidkunio/dedupe,davidkunio/dedupe,01-/dedupe,tfmorris/dedupe,dedupeio/dedupe,pombredanne/dedupe
dedupe/tfidf.py
dedupe/tfidf.py
#!/usr/bin/python # -*- coding: utf-8 -*- import logging from collections import defaultdict from zope.index.text.parsetree import ParseError logger = logging.getLogger(__name__) #@profile def makeCanopy(index, token_vector, threshold) : canopies = {} seen = set([]) corpus_ids = set(token_vector.keys()...
#!/usr/bin/python # -*- coding: utf-8 -*- import logging from collections import defaultdict from zope.index.text.parsetree import ParseError logger = logging.getLogger(__name__) class TfidfPredicate(object): type = "TfidfPredicate" def __init__(self, threshold, field): self.__name__ = 'TF-IDF:' + st...
mit
Python
8282434f913e80bdf2467e130f0c727853651911
Use new debug statement
bwc126/MLND-Subvocal
svr_record.py
svr_record.py
from tkinter import * from pcf8591read import * import threading root = Tk() def testytesty(): print ('oh look we used a callback') # words from https://www.randomlists.com/random-words words = ['dusty','march','direful','complete','superb','poised','wait','quaint','save','copy','interest','separate','bright','ut...
from tkinter import * from pcf8591read import * import threading root = Tk() def testytesty(): print ('oh look we used a callback') # words from https://www.randomlists.com/random-words words = ['dusty','march','direful','complete','superb','poised','wait','quaint','save','copy','interest','separate','bright','ut...
mit
Python
b77b573a9b89aafdfdf321d6867f3891b5ed73be
Remove todo
wintoncode/winton-kafka-streams
winton_kafka_streams/state/in_memory_key_value_store.py
winton_kafka_streams/state/in_memory_key_value_store.py
class InMemoryKeyValueStore: def __init__(self, name): self.name = name self.dict = {} def initialise(self, context, root): pass def __setitem__(self, key, value): self.dict[key] = value def __getitem__(self, key): return self.dict[key] def get(self, key, ...
class InMemoryKeyValueStore: def __init__(self, name): self.name = name self.dict = {} def initialise(self, context, root): pass # TODO: register with context, passing restore callback def __setitem__(self, key, value): self.dict[key] = value def __getitem__(se...
apache-2.0
Python
e0f77da5acfacb95c8899f46f5847ff636bac3b3
fix AttributeError when user is None
ResolveWang/WeiboSpider,ResolveWang/WeiboSpider,yzsz/weibospider,yzsz/weibospider
tasks/user.py
tasks/user.py
# coding:utf-8 from tasks.workers import app from page_get import user as user_get from db.seed_ids import ( get_seed_ids, get_seed_by_id, insert_seeds, set_seed_other_crawled ) @app.task(ignore...
# coding:utf-8 from tasks.workers import app from page_get import user as user_get from db.seed_ids import ( get_seed_ids, get_seed_by_id, insert_seeds, set_seed_other_crawled ) @app.task(ignore...
mit
Python
ce9931b15aa4bc3986f36e8cfeae9dc8191eff48
add some redirects for fun
sunlightlabs/tcamp,sunlightlabs/tcamp,sunlightlabs/tcamp,sunlightlabs/tcamp
tcamp/urls.py
tcamp/urls.py
from django.conf.urls import patterns, include, url from django.views.generic.base import RedirectView from django.contrib import admin from sked.views import RedirectFromPk admin.autodiscover() urlpatterns = patterns( '', url(r'^logistics/$', RedirectView.as_view(url="/about/logistics/")), url(r'^sessions...
from django.conf.urls import patterns, include, url from django.views.generic.base import RedirectView from django.contrib import admin from sked.views import RedirectFromPk admin.autodiscover() urlpatterns = patterns( '', url(r'^logistics/$', RedirectView.as_view(url="/about/logistics/")), url(r'^sessions...
bsd-3-clause
Python
0f9b394a88ca68f2b8b43da0acf22840e1e97330
Add height to arm_controller_test
ufieeehw/IEEE2016,ufieeehw/IEEE2016,ufieeehw/IEEE2016,ufieeehw/IEEE2016
Simulator/scripts/arm_controller_test.py
Simulator/scripts/arm_controller_test.py
#!/usr/bin/env python import tf import rospy from geometry_msgs.msg import Point from geometry_msgs.msg import PointStamped import geometry_msgs.msg import math import numpy as np #THIS IS MEANT FOR THE SIMULATOR ONLY! #THE COMMANDS SENT TO THE CONTROLLER ARE NOT REALIZABLE AND WILL BREAK THINGS! '''This publisher sen...
#!/usr/bin/env python import tf import rospy from geometry_msgs.msg import Point from geometry_msgs.msg import PointStamped import geometry_msgs.msg import math import numpy as np #THIS IS MEANT FOR THE SIMULATOR ONLY! #THE COMMANDS SENT TO THE CONTROLLER ARE NOT REALIZABLE AND WILL BREAK THINGS! '''This publisher sen...
mit
Python
9b6ed295cd8c3dbba1b88ce0fdccb497fe45d0b7
Add TODO for cleaning out GitLab AMI lookup
gogoair/foremast,gogoair/foremast
src/foremast/utils/lookups.py
src/foremast/utils/lookups.py
# Foremast - Pipeline Tooling # # Copyright 2016 Gogo, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
# Foremast - Pipeline Tooling # # Copyright 2016 Gogo, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
Python
36dedd5c1aa8dd36a323990cd2a9d131b845dbed
Add unit tests (incomplete coverage)
mrestko/img-dl
test/tests.py
test/tests.py
from imgdl import img_dl class TestCreateFolderName(object): def sub_title_and_key(self, title, album_key): return '{0} ({1})'.format(title, album_key) def test_no_change_to_valid_title(self): album_key = 'XbUFk' title_1 = 'A Valid title' name_1 = img_dl.create_folder_name(titl...
from imgdl import img_dl class TestCreateFolderName(object): def sub_title_and_key(self, title, album_key): return '{0} ({1})'.format(title, album_key) def test_no_change_to_valid_title(self): album_key = 'XbUFk' title_1 = 'A Valid title' name_1 = img_dl.create_folder_name(titl...
mit
Python
6f7dba3beccca655b84879ccd0f3071d15536b2f
Add word_count parameter for lorem_ipsum generator
sarutobi/Rynda,sarutobi/flowofkindness,sarutobi/ritmserdtsa,sarutobi/ritmserdtsa,sarutobi/flowofkindness,sarutobi/Rynda,sarutobi/ritmserdtsa,sarutobi/ritmserdtsa,sarutobi/Rynda,sarutobi/flowofkindness,sarutobi/flowofkindness,sarutobi/Rynda
test/utils.py
test/utils.py
# coding: utf-8 import string import random def generate_string(str_len=6, src=string.ascii_lowercase): return "".join(random.choice(src) for x in xrange(str_len)) def lorem_ipsum(words_count=30): lorem = list([]) for i in xrange(words_count): word_length = random.randint(4, 8) lorem.app...
# coding: utf-8 import string import random def generate_string(str_len=6, src=string.ascii_lowercase): return "".join(random.choice(src) for x in xrange(str_len)) def lorem_ipsum(): words_count = random.randint(20, 50) lorem = list([]) for i in xrange(words_count): word_length = random.randin...
mit
Python
d80f7a89b5bc23802ad5ec9bb8cc6ad523976718
Add rename branch locally test
eteq/gitnl,eteq/gitnl
test_gitnl.py
test_gitnl.py
from __future__ import print_function, division, absolute_import import unittest import gitnl class GitnlTestCase(unittest.TestCase): """Tests from 'gitnl.py'.""" def test_push_remotename_branchfrom(self): desired = 'push remotename branchfrom' actual = gitnl.parse_to_git('push my branch bra...
from __future__ import print_function, division, absolute_import import unittest import gitnl class GitnlTestCase(unittest.TestCase): """Tests from 'gitnl.py'.""" def test_push_remotename_branchfrom(self): desired = 'push remotename branchfrom' actual = gitnl.parse_to_git('push my branch bra...
mit
Python
81ce69335caaef6920853c85b5801355374c9eeb
add test to test the accessing of a static file
axelhodler/notesdude,axelhodler/notesdude
test_notes.py
test_notes.py
from webtest import TestApp import os import re import notes import dbaccessor DB = 'notes.db' class TestWebserver(): def setUp(self): self.bottle = TestApp(notes.app) def test_route_index(self): dba = dbaccessor.DbAccessor(DB) dba.addNote('eins', 'lorem ipsum') dba.addNote('...
from webtest import TestApp import os import re import notes import dbaccessor DB = 'notes.db' class TestWebserver(): def setUp(self): self.bottle = TestApp(notes.app) def test_route_index(self): dba = dbaccessor.DbAccessor(DB) dba.addNote('eins', 'lorem ipsum') dba.addNote('...
mit
Python
7b5132af5ababe3ec454b2b3c092d8e95ba5af2b
Increment port in tests so that tests can be parallelized
kiip/statsite
tests/base.py
tests/base.py
""" Contains the basic classes for test classes. """ import socket import time import threading from graphite import GraphiteServer, GraphiteHandler class IntegrationBase(object): """ This is the base class for integration tests of Statsite. """ DEFAULT_INTERVAL = 1 "The default flush interval fo...
""" Contains the basic classes for test classes. """ import socket import time import threading from graphite import GraphiteServer, GraphiteHandler class IntegrationBase(object): """ This is the base class for integration tests of Statsite. """ DEFAULT_INTERVAL = 1 def pytest_funcarg__client(se...
bsd-3-clause
Python