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 |
|---|---|---|---|---|---|---|---|---|
f707f14c7fcad90e9c3f7b5365ad49390d7bc389 | rename scaler channels | NSLS-II-XPD/ipython_ophyd,NSLS-II-XPD/ipython_ophyd | profile_collection/startup/20-scalers.py | profile_collection/startup/20-scalers.py | from ophyd import EpicsScaler
em = EpicsScaler('XF:28IDC-BI:1{IM:02}', name='em')
em.channels.read_attrs = ['chan%d' % i for i in [20, 21, 22, 23]]
for ch_name in em.channels.signal_names:
ch = getattr(em.channels, ch_name)
ch.name = ch.name.replace('_channels_', '_')
# Energy Calibration Scintillator
det_sc... | from ophyd import EpicsScaler
em = EpicsScaler('XF:28IDC-BI:1{IM:02}', name='em')
em.channels.read_attrs = ['chan%d' % i for i in [20, 21, 22, 23]]
# Energy Calibration Scintillator
det_sc2 = EpicsScaler('XF:28IDC-ES:1{Det:SC2}', name='det_sc2')
| bsd-2-clause | Python |
6f3f27772aa73a9a2ae07b868c6719ff2960525a | Remove incorrect settings. | weijia/webmanager,weijia/webmanager,weijia/webmanager | webmanager/default_settings.py | webmanager/default_settings.py | INSTALLED_APPS += (
'bootstrap3',
'django_admin_bootstrapped',
'django.contrib.admin',
'django.contrib.admindocs',
# 'south', # Do not work in SAE
# 'mptt',
# 'treenav',
# 'background_task',
# 'django_cron', # Do not work in SAE
'jquery_ui',
# 'provider',
# 'provider.oa... | INSTALLED_APPS += (
'bootstrap3',
'django_admin_bootstrapped',
'django.contrib.admin',
'django.contrib.admindocs',
# 'south', # Do not work in SAE
# 'mptt',
# 'treenav',
# 'background_task',
# 'django_cron', # Do not work in SAE
'jquery_ui',
# 'provider',
# 'provider.oa... | bsd-3-clause | Python |
797eec7bf554e013ac1ffc01025a7da60986fc92 | convert to non-query-string API | mozilla/ichnaea,mozilla/ichnaea,mozilla/ichnaea,therewillbecode/ichnaea,therewillbecode/ichnaea,therewillbecode/ichnaea,mozilla/ichnaea | ichnaea/views.py | ichnaea/views.py | from cornice import Service
import pyramid.httpexceptions as exc
from statsd import StatsdTimer
from ichnaea.db import Cell
cell_location = Service(
name='cell_location',
path='/v1/cell/{mcc}/{mnc}/{lac}/{cid}',
description="Get cell location information.",
cors_policy={'origins': ('*',), 'credential... | from cornice import Service
from statsd import StatsdTimer
from ichnaea.db import Cell
cell_location = Service(
name='cell_location',
path='/v1/cell',
description="Get cell location information.",
cors_policy={'origins': ('*',), 'credentials': True})
@cell_location.get(renderer='json')
def get_cell... | apache-2.0 | Python |
2faba4035043d5744c24161d6511c5fc4bcece1d | Use python3 compatible print | dahlia/wand | wand/display.py | wand/display.py | """:mod:`wand.display` --- Displaying images
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The :func:`display()` functions shows you the image. It is useful for
debugging.
If you are in Mac, the image will be opened by your default image application
(:program:`Preview.app` usually).
If you are in Windows, the image ... | """:mod:`wand.display` --- Displaying images
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The :func:`display()` functions shows you the image. It is useful for
debugging.
If you are in Mac, the image will be opened by your default image application
(:program:`Preview.app` usually).
If you are in Windows, the image ... | mit | Python |
5248280ad89ae1dc3ff72d216bb12d1cdacaf09b | Check in SNPService if connection intialized | tsnik/SkyNet | snp/SNPService.py | snp/SNPService.py | from twisted.application import service
class SNPService(service.Service):
def __init__(self):
self.peers = {}
def handleRequest(self, request, reqid, protocol):
ip = protocol.transport.getPeer().host
if "Type" in request:
reqtype = request["Type"]
if ip in se... | from twisted.application import service
class SNPService(service.Service):
def handleRequest(self, request, reqid, protocol):
if "Type" in request:
reqtype = request["Type"]
thunk = getattr(self, 'type_%s' % reqtype.lower(), None)
if thunk is None:
retu... | mit | Python |
b0eabb9b18ae16f21e40bfc8a2bfeacf53718a3e | fix test, user is now created with an assoc. profile, not need to manually create profile in setUp anymore | steventhan/django-imager,steventhan/django-imager | imagersite/imager_images/tests.py | imagersite/imager_images/tests.py | """Tests for the Photo and Album models."""
from django.test import TestCase
from imager_images.models import Photo, Album
from imager_profile.models import ImagerProfile
from django.contrib.auth.models import User
import factory
class PhotoFactory(factory.django.DjangoModelFactory):
class Meta:
model = P... | """Tests for the Photo and Album models."""
from django.test import TestCase
from imager_images.models import Photo, Album
from imager_profile.models import ImagerProfile
from django.contrib.auth.models import User
import factory
class PhotoFactory(factory.django.DjangoModelFactory):
class Meta:
model = P... | mit | Python |
cbca1e02c256234c94d40aeffc1afdeb47c09e5e | add photos and cover to album add view | gatita/django-imager,gatita/django-imager,gatita/django-imager | imagersite/imager_images/views.py | imagersite/imager_images/views.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.urlresolvers import reverse_lazy
from django.views.generic import DetailView
from django.views.generic.edit import CreateView, UpdateView
from django.core.exceptions import PermissionDenied
from models import Photo, Album
class AlbumView... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.urlresolvers import reverse_lazy
from django.views.generic import DetailView
from django.views.generic.edit import CreateView, UpdateView
from django.core.exceptions import PermissionDenied
from models import Photo, Album
class AlbumView... | mit | Python |
1dfbe495972a5f4d02ce374131f40d4474f24cc6 | Revert "Use namedtuple's getattr rather than indexing" | Johnetordoff/osf.io,adlius/osf.io,aaxelb/osf.io,felliott/osf.io,mfraezz/osf.io,mfraezz/osf.io,HalcyonChimera/osf.io,icereval/osf.io,cslzchen/osf.io,Johnetordoff/osf.io,mattclark/osf.io,CenterForOpenScience/osf.io,saradbowman/osf.io,mattclark/osf.io,aaxelb/osf.io,pattisdr/osf.io,CenterForOpenScience/osf.io,caseyrollins/... | website/ember_osf_web/views.py | website/ember_osf_web/views.py | # -*- coding: utf-8 -*-
import os
import json
import requests
from flask import send_from_directory, Response, stream_with_context
from framework.sessions import session
from website.settings import EXTERNAL_EMBER_APPS, PROXY_EMBER_APPS, EXTERNAL_EMBER_SERVER_TIMEOUT
ember_osf_web_dir = os.path.abspath(os.path.join(o... | # -*- coding: utf-8 -*-
import os
import json
import requests
from flask import send_from_directory, Response, stream_with_context
from framework.sessions import session
from website.settings import EXTERNAL_EMBER_APPS, PROXY_EMBER_APPS, EXTERNAL_EMBER_SERVER_TIMEOUT
ember_osf_web_dir = os.path.abspath(os.path.join(o... | apache-2.0 | Python |
76c815f40d86243ee27b8fac8318a8641ed35ca6 | Fix spacy.load | spacy-io/spaCy,banglakit/spaCy,recognai/spaCy,raphael0202/spaCy,explosion/spaCy,raphael0202/spaCy,spacy-io/spaCy,aikramer2/spaCy,aikramer2/spaCy,honnibal/spaCy,honnibal/spaCy,banglakit/spaCy,oroszgy/spaCy.hu,aikramer2/spaCy,banglakit/spaCy,Gregory-Howard/spaCy,Gregory-Howard/spaCy,banglakit/spaCy,explosion/spaCy,raphae... | spacy/__init__.py | spacy/__init__.py | import pathlib
from .util import set_lang_class, get_lang_class
from . import en
from . import de
from . import zh
try:
basestring
except NameError:
basestring = str
set_lang_class(en.English.lang, en.English)
set_lang_class(de.German.lang, de.German)
set_lang_class(zh.Chinese.lang, zh.Chinese)
def loa... | import pathlib
from .util import set_lang_class, get_lang_class
from . import en
from . import de
from . import zh
try:
basestring
except NameError:
basestring = str
set_lang_class(en.English.lang, en.English)
set_lang_class(de.German.lang, de.German)
set_lang_class(zh.Chinese.lang, zh.Chinese)
def bla... | mit | Python |
1124372397750028b2216a57f61896cb29d70a48 | add robots file | shaunokeefe/gigs,shaunokeefe/gigs | gigs/urls.py | gigs/urls.py |
from django.conf.urls.defaults import *
from django.http import HttpResponse
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from gigs.portal import urls as portal_urls
from gigs.search import urls as search_urls
from gigs.gig_registry.models import Gig, Venue, Location
admin.aut... |
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from gigs.portal import urls as portal_urls
from gigs.search import urls as search_urls
from gigs.gig_registry.models import Gig, Venue, Location
admin.autodiscover()
urlpatterns = patterns(
... | bsd-3-clause | Python |
537ca8daadd9c53ff91ab806caaac895b42396ca | allow services to attach address pools | zdw/xos,open-cloud/xos,zdw/xos,opencord/xos,open-cloud/xos,opencord/xos,open-cloud/xos,cboling/xos,cboling/xos,cboling/xos,zdw/xos,zdw/xos,cboling/xos,opencord/xos,cboling/xos | xos/tosca/resources/service.py | xos/tosca/resources/service.py | import os
import pdb
import sys
import tempfile
sys.path.append("/opt/tosca")
from translator.toscalib.tosca_template import ToscaTemplate
import pdb
from core.models import Service,User,CoarseTenant,AddressPool
from xosresource import XOSResource
class XOSService(XOSResource):
provides = "tosca.nodes.Service"
... | import os
import pdb
import sys
import tempfile
sys.path.append("/opt/tosca")
from translator.toscalib.tosca_template import ToscaTemplate
import pdb
from core.models import Service,User,CoarseTenant
from xosresource import XOSResource
class XOSService(XOSResource):
provides = "tosca.nodes.Service"
xos_model... | apache-2.0 | Python |
a83890668b58aad1d92ab0ce30ecb18b4cec8060 | Put russian phone number convertion from applications.forms to own function and mixin for using in another apps. | Dybov/real_estate_agency,Dybov/real_estate_agency,Dybov/real_estate_agency | real_estate_agency/applications/forms.py | real_estate_agency/applications/forms.py | from django import forms
from django.utils.translation import ugettext as _
from django.core.exceptions import ValidationError
from phonenumber_field.formfields import PhoneNumberField
class RussianPhoneNumberFormMixin(object):
PHONE_NUMBER_FIELD = 'phone_number'
def is_valid(self, *args, **kwargs):
v... | from django import forms
from django.utils.translation import ugettext as _
from django.core.exceptions import ValidationError
from phonenumber_field.formfields import PhoneNumberField
class CallbackForm(forms.Form):
name = forms.CharField(
label=_('Имя'),
max_length=127,
widget=forms.Text... | mit | Python |
218c9b71977120e3c9d0189c6333977f1cf4f297 | Fix attribute name | mrphlip/lrrbot,andreasots/lrrbot,mrphlip/lrrbot,andreasots/lrrbot,andreasots/lrrbot,mrphlip/lrrbot | utils.py | utils.py | import functools
import time
import logging
import irc.client
import urllib.request, urllib.parse
import sys
log = logging.getLogger('utils')
DEFAULT_THROTTLE = 15
class throttle(object):
"""Prevent a function from being called more often than once per period
Usage:
@throttle(period)
def func(...):
...
"""
... | import functools
import time
import logging
import irc.client
import urllib.request, urllib.parse
import sys
log = logging.getLogger('utils')
DEFAULT_THROTTLE = 15
class throttle(object):
"""Prevent a function from being called more often than once per period
Usage:
@throttle(period)
def func(...):
...
"""
... | apache-2.0 | Python |
0ca6f6980b1ac5e9460a55716451c52b06ef8ed6 | use minimum memory mode on ARM | neno1978/xbmctorrent | resources/site-packages/xbmctorrent/torrent2http.py | resources/site-packages/xbmctorrent/torrent2http.py | import os
import sys
import stat
import subprocess
import requests
from xbmctorrent.common import BIN_PATH
from xbmctorrent.platform import PLATFORM
def ensure_exec_perms(file_):
st = os.stat(file_)
os.chmod(file_, st.st_mode | stat.S_IEXEC)
return file_
TORRENT2HTTP_BINARY = ensure_exec_perms(os.path.jo... | import os
import sys
import stat
import subprocess
import requests
from xbmctorrent.common import BIN_PATH
def ensure_exec_perms(file_):
st = os.stat(file_)
os.chmod(file_, st.st_mode | stat.S_IEXEC)
return file_
TORRENT2HTTP_BINARY = ensure_exec_perms(os.path.join(BIN_PATH, "torrent2http%s" % (sys.platf... | apache-2.0 | Python |
926c91baebe3e595757bfc1f3c4bce55aa9f033c | test testing | OKFNat/offenewahlen-nrw17,OKFNat/offenewahlen-nrw17,OKFNat/offenewahlen-nrw17,OKFNat/offenewahlen-nrw17 | src/offenewahlen_api/settings_testing.py | src/offenewahlen_api/settings_testing.py | import os
from offenewahlen_api.settings import *
TESTING = True
SQLALCHEMY_ECHO = True
if 'TRAVIS' in os.environ:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'travisci',
'USER': 'postgres',
'PASSWORD': '',
... | import os
from offenewahlen_api.settings import *
TESTING = True
SQLALCHEMY_ECHO = True
if 'TRAVIS' in os.environ:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'travisci',
'USER': 'postgres',
'PASSWORD': '',
... | mit | Python |
25f9f38f177c193210251c2ff79f3c4f51349768 | Remove a debugging statement. Closes #539. | grengojbo/satchmo,grengojbo/satchmo | satchmo/shop/templatetags/satchmo_adminsite_tags.py | satchmo/shop/templatetags/satchmo_adminsite_tags.py | from django import template
from satchmo.shop.utils import is_multihost_enabled
from satchmo.shop.models import Config
from satchmo.utils import url_join
from django.core import urlresolvers
register = template.Library()
def admin_site_views(view):
"""Returns a formatted list of sites, rendering for view, if any"... | from django import template
from satchmo.shop.utils import is_multihost_enabled
from satchmo.shop.models import Config
from satchmo.utils import url_join
from django.core import urlresolvers
register = template.Library()
def admin_site_views(view):
"""Returns a formatted list of sites, rendering for view, if any"... | bsd-3-clause | Python |
6e1b5ee0ab723d1e34326bb7140249f41c573497 | use couch user on request if available | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/hqwebapp/signals.py | corehq/apps/hqwebapp/signals.py | from __future__ import absolute_import
from datetime import date
from django.contrib.auth.signals import user_logged_in, user_login_failed
from django.dispatch import receiver
from corehq.apps.users.models import CouchUser
def clear_login_attempts(user):
if user and user.is_web_user() and user.login_attempts > ... | from __future__ import absolute_import
from datetime import date
from django.contrib.auth.signals import user_logged_in, user_login_failed
from django.dispatch import receiver
from corehq.apps.users.models import CouchUser
def clear_login_attempts(user):
if user and user.is_web_user() and user.login_attempts > ... | bsd-3-clause | Python |
3de5120a60f10af7161743321dc6d0abe13b86c5 | fix typo in rerun_paper_analysis.py | phbradley/tcr-dist | rerun_paper_analysis.py | rerun_paper_analysis.py | from basic import *
with Parser(locals()) as p:
p.flag('from_pair_seqs').described_as('Restart from the nucleotide sequences (default is to start from parsed clones file)')
p.flag('multicore').described_as('Allow the pipeline to start multiple processes for motif finding; also run mouse and human analyses simu... | from basic import *
with Parser(locals()) as p:
p.flag('from_pair_seqs').described_as('Restart from the nucleotide sequences (default is to start from parsed clones file)')
for organism in ['mouse','human']:
if from_pairseqs:
pair_seqs_file = 'datasets/{}_pairseqs_v1.tsv'.format(organism)
a... | mit | Python |
bd4582cc39eecf7eb35d8ca4582b3350a57d62fd | remove SurveyDesign from init | simpeg/simpeg | SimPEG/EM/Static/Utils/__init__.py | SimPEG/EM/Static/Utils/__init__.py | from .StaticUtils import *
| from .StaticUtils import *
from .SurveyDesign import SurveyDesign
| mit | Python |
3f6ed81f9b769bd91485f18b86eccb449bc03512 | Simplify test: we don't need to kill, normal exit also "works". | zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb | sql/test/BugTracker-2014/Tests/acidity-fail.Bug-3635.py | sql/test/BugTracker-2014/Tests/acidity-fail.Bug-3635.py | try:
from MonetDBtesting import process
except ImportError:
import process
import sys, time, monetdb.sql, os
def connect(autocommit):
return monetdb.sql.connect(database = os.getenv('TSTDB'),
hostname = '127.0.0.1',
port = int(os.getenv('MAPIPO... | try:
from MonetDBtesting import process
except ImportError:
import process
import sys, time, monetdb.sql, os
def connect(autocommit):
return monetdb.sql.connect(database = os.getenv('TSTDB'),
hostname = '127.0.0.1',
port = int(os.getenv('MAPIPO... | mpl-2.0 | Python |
8bb0749834a5620f5c833fd17825db00c87b8584 | Update example wsgi app | yuyuyu101/wheatserver,yuyuyu101/wheatserver,yuyuyu101/wheatserver | example/app/wsgi.py | example/app/wsgi.py | HELLO_WORLD = b"Hello world!\n"
COMPLEX = b"Hello world!\n" * 20000
def application(environ, start_response):
"""Simplest possible application object"""
status = '200 OK'
post = environ['wsgi.input'].read(1000)
ret = HELLO_WORLD
if environ['PATH_INFO'] == '/complex':
ret = COMPLEX
elif ... | HELLO_WORLD = b"Hello world!\n"
COMPLEX = b"Hello world!\n" * 20000
def application(environ, start_response):
"""Simplest possible application object"""
status = '200 OK'
while environ['wsgi.input'].read(1000):
pass
ret = HELLO_WORLD
if (environ['PATH_INFO'] == '/complex'):
ret = CO... | bsd-3-clause | Python |
3bd1adfadb3a6963c0b9cfc220229e314c15429f | add fixtures | guoqiao/django-nzpower | example/settings.py | example/settings.py | import sys
from path import path
from os.path import dirname, abspath
HERE = path(dirname(abspath(__file__)))
BASE_DIR = PROJ_ROOT = HERE
# so python can find the app
sys.path.insert(0, PROJ_ROOT.parent)
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/de... | import sys
from path import path
from os.path import dirname, abspath
HERE = path(dirname(abspath(__file__)))
BASE_DIR = PROJ_ROOT = HERE
# so python can find the app
sys.path.insert(0, PROJ_ROOT.parent)
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/de... | mit | Python |
38e213b04ae574988da5c19440eec0f8af75bc3c | Support new Cloudflare anti-bot page | AtVirus/cloudflare-scrape,Anorov/cloudflare-scrape,nico202/cloudflare-scrape,Muhammad-Farghaly/cloudflare-scrape,Thor77/cloudflare-scrape | cfscrape.py | cfscrape.py | import re
import time
import requests
import PyV8
def grab_cloudflare(url, *args, **kwargs):
sess = requests.session()
sess.headers["User-Agent"] = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:17.0) Gecko/20100101 Firefox/17.0"
resp = sess.get(url, *args, **kwargs)
page = resp.content
if "a = docum... | import re
import requests
import lxml.html
def grab_cloudflare(url, *args, **kwargs):
sess = requests.session()
sess.headers = {"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:17.0) Gecko/20100101 Firefox/17.0"}
safe_eval = lambda s: eval(s, {"__builtins__": {}}) if "#" not in s and "__"... | mit | Python |
069cfbb89b983005eaa9e6906404564852d8b12b | rework server command handling | sorki/hacked_cnc,hackerspace/hacked_cnc,sorki/hacked_cnc,hackerspace/hacked_cnc | hc/server.py | hc/server.py | from twisted.python import log
from twisted.internet import reactor
from twisted.internet.protocol import Factory
from twisted.protocols.basic import LineReceiver
from . import config
from . import command
from . import util
class HcServer(LineReceiver):
delimiter = '\n'
def connectionMade(self):
pr... | from twisted.python import log
from twisted.internet import reactor
from twisted.internet.protocol import Factory
from twisted.protocols.basic import LineReceiver
from . import config
from . import util
class HcServer(LineReceiver):
delimiter = '\n'
def connectionMade(self):
print('Got new client')
... | bsd-3-clause | Python |
d6f97d719f335474a0f54e5fc17b1f189f1e15d0 | check if there are addresses | codexgigassys/codex-backend,codexgigassys/codex-backend | src/Utils/mailSender.py | src/Utils/mailSender.py | import smtplib
from email.mime.text import MIMEText
from db_pool import *
def send_mail(toaddrs,subject,text):
if toaddrs is None or len(toaddrs)==0:
return
fromaddr = env.get('mailsender').get('fromaddr')
msg = MIMEText(text)
msg['Subject'] = subject
msg['From'] = fromaddr
msg['To'] ... | import smtplib
from email.mime.text import MIMEText
from db_pool import *
def send_mail(toaddrs,subject,text):
fromaddr = env.get('mailsender').get('fromaddr')
msg = MIMEText(text)
msg['Subject'] = subject
msg['From'] = fromaddr
msg['To'] = toaddrs
# Credentials (if needed)
username = e... | mit | Python |
6a8068942d985f0c125749d5f58ad7cb9cd189be | Add extra point to include start | dls-controls/scanpointgenerator | scanpointgenerator/linegenerator_step.py | scanpointgenerator/linegenerator_step.py | from linegenerator import LineGenerator
class StepLineGenerator(LineGenerator):
def __init__(self, name, units, start, end, step):
num = int((end - start)/step) + 1
super(StepLineGenerator, self).__init__(name, units, start, step, num)
| from linegenerator import LineGenerator
import math as m
class StepLineGenerator(LineGenerator):
def __init__(self, name, units, start, end, step):
num = int(m.floor((end - start)/step))
super(StepLineGenerator, self).__init__(name, units, start, step, num)
| apache-2.0 | Python |
28939a38154e0fa24e9b5898afab69338e3bfa71 | Remove header line from csvs before reducing | iDigBio/idb-spark,iDigBio/idb-spark,iDigBio/idb-spark | unique-csvline.py | unique-csvline.py | from __future__ import print_function
import os
import sys
import unicodecsv
from pyspark import SparkContext
from operator import add
from lib.csvline import Csvline
def get_headers(fn):
csvline = Csvline()
with open(fn, "r") as f:
return csvline.parse(f.readline())
if __name__ == "__main__":
r... | from __future__ import print_function
import os
import sys
import unicodecsv
from pyspark import SparkContext
from operator import add
from lib.csvline import Csvline
def get_headers(fn):
csvline = Csvline()
with open(fn, "r") as f:
return csvline.parse(f.readline())
if __name__ == "__main__":
r... | mit | Python |
acd5a676b08e070c804bdae78abba266b47c67b5 | Add pypi + github to metadata | tony/libvcs | libvcs/__about__.py | libvcs/__about__.py | __title__ = 'libvcs'
__package_name__ = 'libvcs'
__description__ = 'vcs abstraction layer'
__version__ = '0.3.0'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/vcs-python/libvcs'
__pypi__ = 'https://pypi.org/project/libvcs/'
__email__ = 'tony@git-pull.com'
__license__ = 'MIT'
__copyright__ = 'Copyright 20... | __title__ = 'libvcs'
__package_name__ = 'libvcs'
__description__ = 'vcs abstraction layer'
__version__ = '0.3.0'
__author__ = 'Tony Narlock'
__email__ = 'tony@git-pull.com'
__license__ = 'MIT'
__copyright__ = 'Copyright 2016 Tony Narlock'
| mit | Python |
d4ee06a18f867d234dc608a4f9e9aca64b19be8f | tag v0.2.3 | tony/libvcs | libvcs/__about__.py | libvcs/__about__.py | __title__ = 'libvcs'
__package_name__ = 'libvcs'
__description__ = 'vcs abstraction layer'
__version__ = '0.2.3'
__author__ = 'Tony Narlock'
__email__ = 'tony@git-pull.com'
__license__ = 'BSD'
__copyright__ = 'Copyright 2016 Tony Narlock'
| __title__ = 'libvcs'
__package_name__ = 'libvcs'
__description__ = 'vcs abstraction layer'
__version__ = '0.2.2'
__author__ = 'Tony Narlock'
__email__ = 'tony@git-pull.com'
__license__ = 'BSD'
__copyright__ = 'Copyright 2016 Tony Narlock'
| mit | Python |
c45ff10a4c259570ffc8c840f825bae43114865f | fix min max norm | rafaelolg/salienpy | salienpy/signature.py | salienpy/signature.py | #!/usr/bin/env python2
import cv2
import numpy as np
def signature_saliency(img):
"""
Signature Saliency.
X. Hou, J. Harel, and C. Koch, "Image Signature: Highlighting Sparse Salient
Regions." IEEE Trans. Pattern Anal. Mach. Intell. 34(1): 194-201 (2012)
"""
old_shape = (img.shape[0],img.shap... | #!/usr/bin/env python2
import cv2
import numpy as np
def signature_saliency(img):
"""
Signature Saliency.
X. Hou, J. Harel, and C. Koch, "Image Signature: Highlighting Sparse Salient
Regions." IEEE Trans. Pattern Anal. Mach. Intell. 34(1): 194-201 (2012)
"""
old_shape = (img.shape[0],img.shap... | mit | Python |
74c141d6efc23ca136511bcad92deea5a6d5bcb0 | bump version > 0.2.1-dev.1 | wolcomm/rptk,wolcomm/rptk | rptk/__meta__.py | rptk/__meta__.py | #!/usr/bin/env python
# Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved.
#
# The contents of this file are licensed under the Apache License version 2.0
# (the "License"); you may not use this file except in compliance with the
# License.
#
# Unless required by applicable law or agreed to in... | #!/usr/bin/env python
# Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved.
#
# The contents of this file are licensed under the Apache License version 2.0
# (the "License"); you may not use this file except in compliance with the
# License.
#
# Unless required by applicable law or agreed to in... | apache-2.0 | Python |
35f41f996500f69f930876cbba88650c16a1e466 | remove sleep | jsayles/piradio | rotary/rotary_thread.py | rotary/rotary_thread.py | import RPi.GPIO as GPIO
import threading
import time
import os
GPIO.setmode(GPIO.BCM)
class RotaryThread(threading.Thread):
def __init__(self, aPin, bPin, sPin, logger=None):
threading.Thread.__init__(self)
self.deamon = True
self.logger = logger
self._flag = 0
self._la... | import RPi.GPIO as GPIO
import threading
import time
import os
GPIO.setmode(GPIO.BCM)
class RotaryThread(threading.Thread):
def __init__(self, aPin, bPin, sPin, logger=None):
threading.Thread.__init__(self)
self.deamon = True
self.logger = logger
self._flag = 0
self._la... | apache-2.0 | Python |
c3ea49a3b040dd1e5252ead1a2ae577e037b8b32 | Add a b1 version tag | stackforge/wsme | wsme/release.py | wsme/release.py | name = "WSME"
version = "0.4b1"
description = """Web Services Made Easy makes it easy to \
implement multi-protocol webservices."""
author = "Christophe de Vienne"
email = "python-wsme@googlegroups.com"
url = "http://bitbucket.org/cdevienne/wsme"
license = "MIT"
| name = "WSME"
version = "0.4"
description = """Web Services Made Easy makes it easy to \
implement multi-protocol webservices."""
author = "Christophe de Vienne"
email = "python-wsme@googlegroups.com"
url = "http://bitbucket.org/cdevienne/wsme"
license = "MIT"
| mit | Python |
1af24e7ae73c21bdbe7564b1e0c69de2c44288de | Add processing rate counter | FXIhub/hummingbird,SPIhub/hummingbird,FXIhub/hummingbird | src/analysis/event.py | src/analysis/event.py | import collections
import datetime
def printKeys(evt):
print evt.keys()
def printNativeKeys(evt):
print evt.nativeKeys()
def printID(eventID):
for k,v in eventID.iteritems():
print "%s = %s" %(k, v.data)
try:
print "datetime64 = %s" %(v.datetime64)
except Attribute... |
def printKeys(evt):
print evt.keys()
def printNativeKeys(evt):
print evt.nativeKeys()
def printID(eventID):
for k,v in eventID.iteritems():
print "%s = %s" %(k, v.data)
try:
print "datetime64 = %s" %(v.datetime64)
except AttributeError:
pass
try... | bsd-2-clause | Python |
a0c14001e84f6633d4598d4f4e00973b990b676c | fix url | matplotlib/basemap,matplotlib/basemap,guziy/basemap,guziy/basemap | examples/plotsst.py | examples/plotsst.py | from mpl_toolkits.basemap import Basemap, NetCDFFile
import numpy as np
import matplotlib.pyplot as plt
import sys
# read in sea-surface temperature and ice data
# can be a local file, a URL for a remote opendap dataset,
# or (if PyNIO is installed) a GRIB or HDF file.
if len(sys.argv) == 1:
date = '20071215'
else:... | from mpl_toolkits.basemap import Basemap, NetCDFFile
import numpy as np
import matplotlib.pyplot as plt
import sys
# read in sea-surface temperature and ice data
# can be a local file, a URL for a remote opendap dataset,
# or (if PyNIO is installed) a GRIB or HDF file.
if len(sys.argv) == 1:
date = '20071215'
else:... | mit | Python |
17e2cc92a44ccacd8f5d550352f077cf24383d62 | use DenyAll instead because BasePermissions will throw error for undefined api methods | jayoshih/kolibri,aronasorman/kolibri,aronasorman/kolibri,MingDai/kolibri,whitzhu/kolibri,whitzhu/kolibri,jamalex/kolibri,jamalex/kolibri,jtamiace/kolibri,christianmemije/kolibri,ralphiee22/kolibri,benjaoming/kolibri,DXCanas/kolibri,lyw07/kolibri,aronasorman/kolibri,learningequality/kolibri,mrpau/kolibri,jtamiace/kolibr... | kolibri/auth/permissions/auth.py | kolibri/auth/permissions/auth.py | """
The permissions classes in this module define the specific permissions that govern access to the models in the auth app.
"""
from ..constants.collection_kinds import FACILITY
from ..constants.role_kinds import ADMIN, COACH
from .base import RoleBasedPermissions
from .general import DenyAll
class CollectionSpecif... | """
The permissions classes in this module define the specific permissions that govern access to the models in the auth app.
"""
from ..constants.collection_kinds import FACILITY
from ..constants.role_kinds import ADMIN, COACH
from .base import BasePermissions, RoleBasedPermissions
class CollectionSpecificRoleBasedP... | mit | Python |
5680a23d77738118e1c7eb6d2c8cbb8c0487f1a9 | Bump to rc1.dev | CartoDB/cartoframes,CartoDB/cartoframes | cartoframes/_version.py | cartoframes/_version.py | __version__ = '1.0rc1.dev'
| __version__ = '1.0b7'
| bsd-3-clause | Python |
88f6e94415732a0850dc8f9ca36d756b4d2a3735 | Update the pine64 bootstrapping to make it run (again) | grunskis/senic-hub,grunskis/nuimo-hub-backend,getsenic/senic-hub,grunskis/nuimo-hub-backend,grunskis/nuimo-hub-backend,grunskis/senic-hub,grunskis/senic-hub,grunskis/senic-hub,grunskis/senic-hub,grunskis/nuimo-hub-backend,grunskis/senic-hub,getsenic/senic-hub,grunskis/nuimo-hub-backend | deployment/fab_pine64.py | deployment/fab_pine64.py | # coding: utf-8
from os import path
from fabric import api as fab
from fabric.api import task, env
eth_interface = """auto {eth_iface}
iface {eth_iface} inet static
address {eth_ip}
netmask {eth_netmask}
gateway {eth_gateway}
"""
eth_resolvconf = """nameserver {eth_dns}
"""
@task
def bootstrap(boot_ip=None, a... | # coding: utf-8
from os import path
from fabric import api as fab
from fabric.api import task, env
eth_interface = """auto {eth_iface}
iface {eth_iface} inet static
address {eth_ip}
netmask {eth_netmask}
gateway {eth_gateway}
"""
eth_resolvconf = """nameserver {eth_dns}
"""
@task
def bootstrap(boot_ip=None, a... | mit | Python |
4a0598fb5119659760654c76dccf80e0f8adda93 | move heroku config to main conf | pudo/kompromatron,pudo/kompromatron | kompromatron/default_settings.py | kompromatron/default_settings.py | DEBUG = True
ASSETS_DEBUG = True
GRANO_HOST = os.environ.get('GRANO_HOST', 'http://beta.grano.cc/')
GRANO_APIKEY = os.environ.get('GRANO_APIKEY')
GRANO_PROJECT = os.environ.get('GRANO_PROJECT', 'kompromatron')
| DEBUG = True
ASSETS_DEBUG = True
GRANO_HOST = 'http://localhost:5000'
GRANO_APIKEY = '9f0657d55a44469d94145a2100cca492'
GRANO_PROJECT = 'kompromatron_C'
| mit | Python |
160d25533a12332af8fae456b668dbbbc662e597 | Support Unicode output for grains. | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/output/grains.py | salt/output/grains.py | # -*- coding: utf-8 -*-
'''
Special outputter for grains
============================
This outputter is a more condensed version of the :mod:`nested
<salt.output.nested>` outputter, used by default to display grains when the
following functions are invoked:
* :mod:`grains.item <salt.modules.grains.item>`
* :mod:`grai... | # -*- coding: utf-8 -*-
'''
Special outputter for grains
============================
This outputter is a more condensed version of the :mod:`nested
<salt.output.nested>` outputter, used by default to display grains when the
following functions are invoked:
* :mod:`grains.item <salt.modules.grains.item>`
* :mod:`grai... | apache-2.0 | Python |
7594e2c1d336bc3f3c8b44ca01d53686e08c0490 | Bump version for pypi to 0.2018.07.08.0343 | oduwsdl/ipwb,oduwsdl/ipwb,oduwsdl/ipwb,oduwsdl/ipwb | ipwb/__init__.py | ipwb/__init__.py | __version__ = '0.2018.07.08.0343'
| __version__ = '0.2018.07.08.0248'
| mit | Python |
f64679b8c35c24d3b6df532b44eb55ec955b924b | Fix tests in Python 3. | chbrown/pybtex,andreas-h/pybtex,chbrown/pybtex,andreas-h/pybtex | pybtex/tests/bibtex_engine_test.py | pybtex/tests/bibtex_engine_test.py | import os
import pkgutil
import posixpath
from contextlib import contextmanager
from shutil import rmtree
from tempfile import mkdtemp
from pybtex import io
from pybtex import errors
from pybtex import bibtex
from pybtex.tests import diff
@contextmanager
def cd_tempdir():
current_workdir = os.getcwd()
tempd... | import os
import pkgutil
import posixpath
from contextlib import contextmanager
from shutil import rmtree
from tempfile import mkdtemp
from pybtex import errors
from pybtex import bibtex
from pybtex.tests import diff
@contextmanager
def cd_tempdir():
current_workdir = os.getcwd()
tempdir = mkdtemp(prefix='p... | mit | Python |
f4754242524d76333a695a43599cb5e84df5b15f | Bump new development version number | mardiros/pyramid_filterwarnings | pyramid_filterwarnings/__init__.py | pyramid_filterwarnings/__init__.py | # -*- coding: utf-8 -*-
import logging
import warnings
from pyramid.exceptions import ConfigurationError
__version__ = '0.3~dev'
def get_category(settings, key):
category = settings.get(key, 'Warning')
warnings_cls = {'Warning': Warning,
'UserWarning': UserWarning,
'De... | # -*- coding: utf-8 -*-
import logging
import warnings
from pyramid.exceptions import ConfigurationError
__version__ = '0.2'
def get_category(settings, key):
category = settings.get(key, 'Warning')
warnings_cls = {'Warning': Warning,
'UserWarning': UserWarning,
'Deprec... | bsd-3-clause | Python |
acb715f21351923f0b1f1d33983f555051253964 | Fix None comparison | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/modules/sqlite3.py | salt/modules/sqlite3.py | '''
Support for SQLite3
'''
try:
import sqlite3
has_sqlite3 = True
except ImportError:
has_sqlite3 = False
def __virtual__():
if not has_sqlite3:
return False
return 'sqlite3'
def _connect(db=None):
if db is None:
return False
con = sqlite3.connect(db)
cur = con.curso... | '''
Support for SQLite3
'''
try:
import sqlite3
has_sqlite3 = True
except ImportError:
has_sqlite3 = False
def __virtual__():
if not has_sqlite3:
return False
return 'sqlite3'
def _connect(db=None):
if db == None:
return False
con = sqlite3.connect(db)
cur = con.curso... | apache-2.0 | Python |
f13dc3054ad6b9eddbd616bf43a4544cfe356601 | Fix multiline | hgl888/leapcast,dz0ny/leapcast,lastowl/leapcast,willemneal/leapcast,hectoruelo/leapcast | leapcast/environment.py | leapcast/environment.py | from __future__ import unicode_literals
import argparse
import logging
import uuid
logger = logging.getLogger('Environment')
class Environment(object):
channels = dict()
global_status = dict()
friendlyName = 'leapcast'
user_agent = 'Mozilla/5.0 (CrKey - 0.9.3) AppleWebKit/537.36 (KHTML, like Gecko) C... | from __future__ import unicode_literals
import argparse
import logging
import uuid
logger = logging.getLogger('Environment')
class Environment(object):
channels = dict()
global_status = dict()
friendlyName = 'leapcast'
user_agent = 'Mozilla/5.0 (CrKey - 0.9.3) AppleWebKit/537.36 '
+ '(KHTML, like... | mit | Python |
fbe59805802fb222295cec5f9306662ea9c2f3d1 | Add default administrator to provisioner. | saylua/SayluaV2,LikeMyBread/Saylua,LikeMyBread/Saylua,LikeMyBread/Saylua,saylua/SayluaV2,saylua/SayluaV2,LikeMyBread/Saylua | saylua/provisioner.py | saylua/provisioner.py | from saylua.models.role import Role
from saylua.utils import is_devserver
from saylua.modules.forums.models.db import Board, BoardCategory, ForumThread, ForumPost
from saylua.models.user import User
from saylua.modules.pets.soulnames import soulname
# To run this import setup in the interactive console and run it as s... | from saylua.models.role import Role
from saylua.utils import is_devserver
from saylua.modules.forums.models.db import Board, BoardCategory, ForumThread, ForumPost
from saylua.models.user import User
from saylua.modules.pets.soulnames import soulname
# To run this import setup in the interactive console and run it as s... | agpl-3.0 | Python |
c0fef828f5a7b8fbc5ad691353e3a3521037db07 | set the output dtype to the input dtype. | marcecj/faust_python | FAUSTPy/python_dsp.py | FAUSTPy/python_dsp.py | import numpy as np
import ctypes
class FAUSTDsp(object):
def __init__(self, C, ffi, fs, faust_ui):
self.__C = C
self.__ffi = ffi
self.__dsp = C.newmydsp()
# calls both classInitmydsp() and instanceInitmydsp()
C.initmydsp(self.__dsp, fs)
UI = faust_ui(self.__ffi,... | import numpy as np
import ctypes
class FAUSTDsp(object):
def __init__(self, C, ffi, fs, faust_ui):
self.__C = C
self.__ffi = ffi
self.__dsp = C.newmydsp()
# calls both classInitmydsp() and instanceInitmydsp()
C.initmydsp(self.__dsp, fs)
UI = faust_ui(self.__ffi,... | mit | Python |
61755794afaeda35155d689e06b637ee0ba8a440 | Bump fireant version | kayak/fireant,mikeengland/fireant | fireant/__init__.py | fireant/__init__.py | # coding: utf-8
__version__ = '{major}.{minor}.{patch}'.format(major=0, minor=10, patch=1)
| # coding: utf-8
__version__ = '{major}.{minor}.{patch}'.format(major=0, minor=10, patch=0)
| apache-2.0 | Python |
7efcc9987f827eec56677d95bc7ad873208b392f | Optimize from 5-6s to 2.9-3.0 | diNard/Saw | saw/parser/sentences.py | saw/parser/sentences.py | import base
from blocks import Blocks
import re
class Sentences(base.Base):
_type = 'sentences'
child_class = Blocks
@staticmethod
def parse(text):
_len = len(text)
result = []
prev = 0
# we allow .09 as not end of sentences
for m in re.finditer('[\!\?\.]+', te... | import base
from blocks import Blocks
import re
class Sentences(base.Base):
_type = 'sentences'
child_class = Blocks
@staticmethod
def parse(text):
#re.split('\!|\?|\. | \.',text)
result = []
prev = 0
# we allow .09 as not end of sentences
#for m in re.finditer... | mit | Python |
0a3511060cf8faa31519d95c08cba1c5ed739e30 | Update __init__.py | open2bizz/odoo-addons,open2bizz/odoo-addons | git_info/controllers/__init__.py | git_info/controllers/__init__.py | # -*- coding: utf-8 -*-
from . import main
| # -*- coding: utf-8 -*-
import main
| agpl-3.0 | Python |
8ed6bcd1c459ff1996841050d2917be52d65ca33 | fix -N default value handling | semanticize/semanticizest | semanticizest/parse_wikidump/__main__.py | semanticizest/parse_wikidump/__main__.py | """parse_wikidump
Usage:
parse_wikidump [options] <dump> <model-filename>
Options:
--download=wikiname Download dump from dumps.wikimedia.org first
--ngram=<order>, -N <order>
Maximum order of ngrams, set to None to disable
[default: 7]
--hel... | """parse_wikidump
Usage:
parse_wikidump [options] <dump> <model-filename>
Options:
--download=wikiname Download dump from dumps.wikimedia.org first
--ngram=order, -N order Maximum order of ngrams, set to None to disable [default: 7]
--help, -h This help
"""
from __future__ import prin... | apache-2.0 | Python |
59d4ff18a091b4ceb8d514baf72a517bb3dedf9f | Test building with bogus (or empty) Dockerfile | redkyn/grader,redkyn/grader,grade-it/grader | grader/grader/test/test_build.py | grader/grader/test/test_build.py | import os
import pytest
import shutil
from grader.models import Grader
hasdocker = pytest.mark.skipif(shutil.which("docker") is None,
reason="Docker must be installed.")
"""A decorator to skip a test if docker is not installed."""
@hasdocker
def test_build(parse_and_run):
"""Test... | import os
import pytest
import shutil
from grader.models import Grader
hasdocker = pytest.mark.skipif(shutil.which("docker") is None,
reason="Docker must be installed.")
"""A decorator to skip a test if docker is not installed."""
@hasdocker
def test_build(parse_and_run):
"""Test... | mit | Python |
cfa8dc065809bf1e6c0b0e6a0299ab262bf65584 | Add using of argparse module. | PytLab/VASPy,PytLab/VASPy | scripts/create_xsd.py | scripts/create_xsd.py | '''
Script to create .xyz file.
'''
import sys
import re
import commands
import argparse
from vaspy import atomco, matstudio
if "__main__" == __name__:
# Set argument parser.
parser = argparse.ArgumentParser()
parser.add_argument("-s", "--step",
help="step number on which the ... | '''
Script to create .xyz file.
'''
import sys
import re
import commands
import vaspy
if len(sys.argv) > 1:
# extract certain step data to .xyz file
step = sys.argv[1]
step_regex = re.compile(r'^STEP\s+=\s+' + step + r'$')
with open('OUT.ANI', 'r') as f:
natom = int(f.readline().strip())
... | mit | Python |
e1ed0e8393180f3c467b23aa34f9848a7922505c | FIX // CModules Setup File (.py) | alejandrobernardis/python-slot-machines | src/cmodules/setup.py | src/cmodules/setup.py | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Asumi Kamikaze Inc.
# Licensed under the MIT License.
# Author: Alejandro M. Bernardis
# Email: alejandro (dot) bernardis (at) asumikamikaze (dot) com
# Created: 25/Sep/2014 9:23 PM
import os
import shutil
from distutils.core import setup, Extension... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Asumi Kamikaze Inc.
# Copyright (c) 2013 The Octopus Apps Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
# Author: Alejandro M. Bernardis
# Email: alejandro.bernardis at gmail.com
# Created: 12/Jun/2014 16:18
import os
import shu... | mit | Python |
1f1acb81cba48e35820c4a88b4c39ab5ff40db42 | Fix py3 ImportError by using relative import | bitIO/powerline-shell,milkbikis/powerline-shell,ceholden/powerline-shell,torbjornvatn/powerline-shell,paulhybryant/powerline-shell,Menci/powerline-shell,paulhybryant/powerline-shell,banga/powerline-shell,banga/powerline-shell,b-ryan/powerline-shell,iKrishneel/powerline-shell,rbanffy/powerline-shell,LeonardoGentile/powe... | lib/color_compliment.py | lib/color_compliment.py | #! /usr/bin/env python
from colorsys import hls_to_rgb, rgb_to_hls
# md5 deprecated since Python 2.5
try:
from md5 import md5
except ImportError:
from hashlib import md5
from sys import argv
# Original, non-relative import errors on Python3
from .colortrans import *
def getOppositeColor(r,g,b):
hls = rgb... | #! /usr/bin/env python
from colortrans import *
from colorsys import hls_to_rgb, rgb_to_hls
# md5 deprecated since Python 2.5
try:
from md5 import md5
except ImportError:
from hashlib import md5
from sys import argv
def getOppositeColor(r,g,b):
hls = rgb_to_hls(r,g,b)
#print "hls is"
#print hls
... | mit | Python |
277abe89023c23fa0fd8b0c3294ea8585dc47bfd | Update form validators | gr1d99/shopping-list,gr1d99/shopping-list,gr1d99/shopping-list | shopping_app/forms.py | shopping_app/forms.py | from wtforms import Form, DecimalField, IntegerField, StringField, PasswordField, validators, ValidationError
from wtforms.validators import DataRequired, InputRequired
from .utils.helpers import check_duplicate_item_name
class LoginForm(Form):
username = StringField('username', validators=[DataRequired()])
p... | from wtforms import Form, DecimalField, IntegerField, StringField, PasswordField, validators, ValidationError
from wtforms.validators import DataRequired, InputRequired
from .utils.helpers import check_duplicate_item_name
class LoginForm(Form):
username = StringField('username', validators=[InputRequired(), DataR... | mit | Python |
bc5a54036e8c94b8f81cc24ed3ccb72f461c72a6 | simplify FocusPanel, rely on use Applier to call setWidget. | jaredly/pyjamas,jaredly/pyjamas,jaredly/pyjamas,jaredly/pyjamas | library/pyjamas/ui/FocusPanel.py | library/pyjamas/ui/FocusPanel.py | # Copyright 2006 James Tauber and contributors
# Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
#
# 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/... | # Copyright 2006 James Tauber and contributors
# Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
#
# 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/... | apache-2.0 | Python |
9c23f06b2174b428171f55b8c39a38d23641b68b | debug information | ImmobilienScout24/status-cake-custom-resource | src/main/python/statuscake_customresource/create.py | src/main/python/statuscake_customresource/create.py | import requests
import json
def create_status_cake(event):
properties = event['ResourceProperties']
parameters = {'WebsiteName': properties['WebsiteName'], 'WebsiteURL': properties['WebsiteUrl'], 'CheckRate': properties['CheckRate']}
headers = {'API': properties['ApiKey'], 'Username': properties['UserNam... | import requests
import json
def create_status_cake(event):
properties = event['ResourceProperties']
parameters = {'WebsiteName': properties['WebsiteName'], 'WebsiteURL': properties['WebsiteUrl'], 'CheckRate': properties['CheckRate']}
headers = {'API': properties['ApiKey'], 'Username': properties['UserNam... | apache-2.0 | Python |
929122b865dfdba5226d80b85af664b272f7f000 | add knight_rider demo :) | mithro/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware | software/test_leds.py | software/test_leds.py | from litex.soc.tools.remote import RemoteClient
import time
class PWM:
def __init__(self, regs, name):
for reg in ["enable", "period", "width"]:
setattr(self, "_" + reg, getattr(regs, name + "_" + reg))
def enable(self):
self._enable.write(1)
def disable(self):
self.... | from litex.soc.tools.remote import RemoteClient
import time
class PWM:
def __init__(self, regs, name):
for reg in ["enable", "period", "width"]:
setattr(self, "_" + reg, getattr(regs, name + "_" + reg))
def enable(self):
self._enable.write(1)
def disable(self):
self.... | bsd-2-clause | Python |
4f1279ee16f5f853a3224bb1c0631fadb93add78 | bump version | realms-team/solmanager,realms-team/solmanager,realms-team/solmanager,realms-team/solmanager,realms-team/basestation-fw | solmanager_version.py | solmanager_version.py | VERSION = (1, 2, 3, 0)
| VERSION = (1, 2, 2, 0)
| bsd-3-clause | Python |
0bc0af9b50dd68a60ee6cdfa30153ff74f561128 | bump version to 1.5.7 | pysal/spaghetti | spaghetti/__init__.py | spaghetti/__init__.py | __version__ = "1.5.7"
"""
# `spaghetti` --- Spatial Graphs: Networks, Topology, & Inference
"""
from .network import Network, PointPattern, SimulatedPointPattern
from .network import extract_component, spanning_tree
from .network import element_as_gdf, regular_lattice
| __version__ = "1.5.6"
"""
# `spaghetti` --- Spatial Graphs: Networks, Topology, & Inference
"""
from .network import Network, PointPattern, SimulatedPointPattern
from .network import extract_component, spanning_tree
from .network import element_as_gdf, regular_lattice
| bsd-3-clause | Python |
0a2ab634a6e8e30d505ee70cd44b65373ec2f9f8 | Set unique for User.email field | madssj/django-longer-username-and-email | longerusernameandemail/models.py | longerusernameandemail/models.py | from django.core.validators import MaxLengthValidator
from django.db.models.signals import class_prepared
from django.utils.translation import ugettext as _
from longerusernameandemail import MAX_USERNAME_LENGTH
def longer_username_and_email_signal(sender, *args, **kwargs):
if (sender.__name__ == "User" and
... | from django.core.validators import MaxLengthValidator
from django.db.models.signals import class_prepared
from django.utils.translation import ugettext as _
from longerusernameandemail import MAX_USERNAME_LENGTH
def longer_username_and_email_signal(sender, *args, **kwargs):
if (sender.__name__ == "User" and
... | bsd-3-clause | Python |
7bc171498f6e66bdc7f665bccf2f4201243a8e07 | Fix issues with diacritics in MEP names. | yohanboniface/memopol-core,yohanboniface/memopol-core,yohanboniface/memopol-core | memopol/search/search_indexes.py | memopol/search/search_indexes.py | # -*- coding: utf-8 -*-
from haystack import indexes
from memopol.meps.models import MEP
import unicodedata
def _stripdiacritics(s):
return ''.join(c for c in unicodedata.normalize('NFD', s)
if unicodedata.category(c) != 'Mn')
class MEPIndex(indexes.SearchIndex, indexes.Indexable):
fulltex... | # -*- coding: utf-8 -*-
from haystack import indexes
from memopol.meps.models import MEP
class MEPIndex(indexes.SearchIndex, indexes.Indexable):
fulltext = indexes.CharField(document=True, model_attr="content")
last_name = indexes.CharField(model_attr="last_name")
group = indexes.CharField(model_attr="gr... | agpl-3.0 | Python |
9e6e36e7912f2bbedee6e9eb6b7db74ed9267a65 | Add __sprinter_remove_path function to utils.sh. | toumorokoshi/sprinter,toumorokoshi/sprinter | sprinter/templates.py | sprinter/templates.py | """
A storage area for templates as strings
"""
# utils.sh is the same for every namespace, only sourced once
shell_utils_template = """
# don't add paths repeatedly to env vars
# __sprinter_prepend_path "/foo" => "/foo:$PATH"
# __sprinter_prepend_path "/foo" MANPATH => "/foo:$MANPATH"
__sprinter_prepend_path(... | """
A storage area for templates as strings
"""
# utils.sh is the same for every namespace, only sourced once
shell_utils_template = """
# don't add paths repeatedly to env vars
# __sprinter_prepend_path "/foo" => "/foo:$PATH"
# __sprinter_prepend_path "/foo" MANPATH => "/foo:$MANPATH"
__sprinter_prepend_path(... | mit | Python |
03076bc639c8dc3e15a6fb4509fdb611042e7b9a | Update to match suggestion by Art | 0xPoly/ooni-probe,lordappsec/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,0xPoly/ooni-probe,0xPoly/ooni-probe,kdmurray91/ooni-probe,lordappsec/ooni-probe,Karthikeyan-kkk/ooni-probe,Karthikeyan-kkk/ooni-probe,lordappsec/ooni-probe,kdmurray91/ooni-probe,kdmurray91/ooni-probe,kdmurray91/ooni-probe,juga0/ooni-pr... | nettests/third_party/netalyzr.py | nettests/third_party/netalyzr.py | # -*- encoding: utf-8 -*-
#
# This is a wrapper around the Netalyzer Java command line client
#
# :authors: Jacob Appelbaum <jacob@appelbaum.net>
# Arturo "hellais" Filastò <art@fuffa.org>
# :licence: see LICENSE
from ooni import nettest
from ooni.utils import log
import time
import os
from twisted.internet ... | # -*- encoding: utf-8 -*-
#
# This is a wrapper around the Netalyzer Java command line client
#
# :authors: Jacob Appelbaum <jacob@appelbaum.net>
# Arturo "hellais" Filastò <art@fuffa.org>
# :licence: see LICENSE
from ooni import nettest
from ooni.utils import log
import time
import os
from twisted.internet ... | bsd-2-clause | Python |
136a517c71310a613710ec80cec32edf88a53323 | Add more events | mehanig/scrapi,felliott/scrapi,mehanig/scrapi,jeffreyliu3230/scrapi,felliott/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi,CenterForOpenScience/scrapi,alexgarciac/scrapi,fabianvf/scrapi,icereval/scrapi,ostwald/scrapi,fabianvf/scrapi,erinspace/scrapi | scrapi/events.py | scrapi/events.py | from fluent import event
from scrapi import settings
# Events
PROCESSING = 'processing'
CONSUMER_RUN = 'runConsumer'
CHECK_ARCHIVE = 'checkArchive'
NORMALIZATION = 'normalization'
# statuses
FAILED = 'failed'
SKIPPED = 'skipped'
CREATED = 'created'
STARTED = 'started'
COMPLETED = 'completed'
# Ues _index here as t... | from fluent import event
from scrapi import settings
# Events
CONSUMER_RUN = 'runConsumer'
NORMALIZATION = 'normalization'
# statuses
FAILED = 'failed'
SKIPPED = 'skipped'
CREATED = 'created'
STARTED = 'started'
COMPLETED = 'completed'
# Ues _index here as to not clutter the namespace for kwargs
def dispatch(_even... | apache-2.0 | Python |
7fd3af15b9c17494131be62122b6496f3df0b40f | Remove unused var. | gillibrand/MakeBookmarklet,gillibrand/MakeBookmarklet | make_bookmarklet.py | make_bookmarklet.py | import sublime, sublime_plugin, re, urllib
EXISTING_JS_COMMENT_RE = re.compile(r'^// ?javascript:.+', re.M)
KILL_COMMENTS_RE = re.compile('^\s*//.+\n', re.M)
TABS_TO_SPACES_RE = re.compile('\t', re.M)
SPACE_RUNS_TO_ONE_SPACE_RE = re.compile('[ ]{2,}', re.M)
KILL_LINE_LEADING... | import sublime, sublime_plugin, re, urllib
EXISTING_JS_COMMENT_RE = re.compile(r'^// ?javascript:.+', re.M)
KILL_COMMENTS_RE = re.compile('^\s*//.+\n', re.M)
TABS_TO_SPACES_RE = re.compile('\t', re.M)
SPACE_RUNS_TO_ONE_SPACE_RE = re.compile('[ ]{2,}', re.M)
KILL_LINE_LEADING... | mit | Python |
bf17e1f51506eb6185d6c07a918e93a83463d85b | improve text example when comparing PAC methods | EtienneCmb/tensorpac,EtienneCmb/tensorpac | examples/pac/plot_pac_methods.py | examples/pac/plot_pac_methods.py | """
=========================================
Comparison of the implemented PAC methods
=========================================
This script offers a comparison between all of the implemented PAC methods, in
particular the methods that are computed across times-points.
"""
from tensorpac import Pac
from tensorpac.sig... | """
===================
Compare PAC methods
===================
Compute PAC on multiple datasets and compare implemented methods.
"""
from __future__ import print_function
from tensorpac import Pac
from tensorpac.signals import pac_signals_tort
import matplotlib.pyplot as plt
plt.style.use('seaborn-paper')
# First,... | bsd-3-clause | Python |
f234c52f8a5f296ac2a589552f2d5b54fd7936eb | allow to run a script without python install in distribute package | try-dash-now/gDasH,try-dash-now/gDasH | script_runner.py | script_runner.py | print('''script_runner.exe/py script_name [arg1, arg2 ...argN]
script_runner.exe/py reads src_path/lib_path/log_path from file ./gDasH.ini to set PYTHONPATH''')
if __name__ == "__main__":
import os
import sys
import ConfigParser
ini_file = './gDasH.ini'
ini_setting = ConfigParser.ConfigParser()
... | print('''script_runner.exe/py script_name [arg1, arg2 ...argN]
script_runner.exe/py reads src_path/lib_path/log_path from file ./gDasH.ini to set PYTHONPATH''')
if __name__ == "__main__":
import os
import sys
import ConfigParser
ini_file = './gDasH.ini'
ini_setting = ConfigParser.ConfigParser()
... | mit | Python |
3751022ef1789f931d73444a5d3a039be0d9432b | fix algo | fwilson42/dchacks2015,fwilson42/dchacks2015,fwilson42/dchacks2015 | scripts/algo2.py | scripts/algo2.py | __author__ = 'claudia'
from config import wmata
import csv
csvdata = []
with open('stops.csv', 'r') as csvfile:
reader = csv.reader(csvfile)
rlist = list(reader)
rlist.pop(0)
for x in rlist:
csvdata.append([float(x[5]),float(x[6]),1/30])
for s in wmata.lines.all:
for staa in wmata.lines[s].s... | __author__ = 'claudia'
from config import wmata
import csv
csvdata = []
with open('stops.csv', 'rb') as csvfile:
reader = csv.reader(csvfile)
for x in reader:
csvdata.append(float(x[5]),float(x[6]),1/30)
for s in wmata.lines.all:
for staa in wmata.lines[s].stations:
if s == 'RD':
... | mit | Python |
ccd5f0cf4b658867ed22b6840daa5c94cc5470b4 | Add another constant. | Plexxi/st2,alfasin/st2,Plexxi/st2,armab/st2,dennybaa/st2,peak6/st2,grengojbo/st2,pixelrebel/st2,tonybaloney/st2,tonybaloney/st2,nzlosh/st2,Plexxi/st2,emedvedev/st2,punalpatel/st2,emedvedev/st2,pixelrebel/st2,StackStorm/st2,punalpatel/st2,nzlosh/st2,punalpatel/st2,tonybaloney/st2,Itxaka/st2,dennybaa/st2,Itxaka/st2,denny... | st2common/st2common/constants/runners.py | st2common/st2common/constants/runners.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | apache-2.0 | Python |
e9f69e314fd1ed896edf57182de1f766df7e6ee2 | Refactor build.py a bit to use more iterators. | SSheldon/rust-objc,SSheldon/rust-objc,ngrewe/rust-objc,ngrewe/rust-objc | xtests/build.py | xtests/build.py | import os
import re
TEST_DIR = os.path.dirname(__file__)
SRC_DIR = os.path.join(TEST_DIR, os.pardir, 'src')
TEST_REGEX = '#\[test\]\n( fn ([^{]*)\(\) {(?:(?!#\[test\]).)*\n }\n)'
TEMPLATE = """
use objc::*;
use objc::declare::*;
use objc::runtime::*;
use test_utils;
{0}
pub static TESTS: &'static [(&'static ... | import os
import re
TEST_DIR = os.path.dirname(__file__)
SRC_DIR = os.path.join(TEST_DIR, os.pardir, 'src')
TEST_REGEX = '#\[test\]\n( fn ([^{]*)\(\) {(?:(?!#\[test\]).)*\n }\n)'
TEMPLATE = """
use objc::*;
use objc::declare::*;
use objc::runtime::*;
use test_utils;
{0}
pub static TESTS: &'static [(&'static ... | mit | Python |
665f18d5a4e7e742983cb6daa1c79f332f90ef5f | Bump version | Sense-API/sense-python-client | sense/version.py | sense/version.py | VERSION = "0.0.8" # Add User-Agent and optional token encoding with sense.app_secret key.
#"0.0.7": Fix a bug in Feed instance_url (case of adressing a feed by type on a retrieved feed)
# 0.0.6: Allow addressing feed by node uid + feed type
# 0.0.5: Enable Node update
# 0.0.4: Add method to post event
# 0.0.3: Allow No... | VERSION = "0.0.7" # Fix a bug in Feed instance_url (case of adressing a feed by type on a retrieved feed)
# 0.0.6: Allow addressing feed by node uid + feed type
# 0.0.5: Enable Node update
# 0.0.4: Add method to post event
# 0.0.3: Allow Node creation and update
# 0.0.2: Add install requires to setup.py
# 0.0.1: Allow ... | mit | Python |
40e643b49f51a884e6f6d16531152b801efe6921 | update with sample route | project-em/ns3-sentiment | sentiment/app.py | sentiment/app.py | import os, logging, json
from flask import Flask, request, render_template, jsonify
from flask_restplus import Api, Resource, fields
app = Flask(__name__)
logging.getLogger('flask_ask').setLevel(logging.DEBUG)
ROOT_URL = os.getenv('ROOT_URL', 'localhost')
VERSION_NO = os.getenv('VERSION_NO', '1.0')
APP_NAME = os.gete... | import os, logging
from flask import Flask, request, render_template, jsonify
from flask_restplus import Api, Resource
app = Flask(__name__)
logging.getLogger('flask_ask').setLevel(logging.DEBUG)
ROOT_URL = os.getenv('ROOT_URL', 'localhost')
VERSION_NO = os.getenv('VERSION_NO', '1.0')
APP_NAME = os.getenv('APP_NAME',... | mit | Python |
eee68ea023b4ae2b461c2e9581ebc5aa6c7680fd | put simplify on hold for now | ipapusha/amnet,ipapusha/amnet | amnet/tree.py | amnet/tree.py | import numpy as np
from scipy.linalg import norm
import amnet
import copy
"""
Contains routines for manipulating and simplifying Amn trees
"""
FPTOL=1e-8
def simplify(phi):
"""
Returns a new Amn that is equivalent to phi from the
perspective of phi.eval(..), but potentially has
* fewer nodes (e.g., ... | import numpy as np
import amnet
import copy
"""
Contains routines for manipulating and simplifying Amn trees
"""
def simplify(phi):
"""
Returns a new Amn that is equivalent to phi from the
perspective of phi.eval(..), but potentially has
* fewer nodes (e.g., fewer Mu's)
* affine simplifications
... | bsd-3-clause | Python |
69c87ae5e2384bc4b59554800706baa66f371a78 | use DuplicatedCommand instead of CommandExists | fespino/climate | climate.py | climate.py | from functools import wraps
class Command(object):
def __init__(self, name, func, arg_names):
self.name = name
self.func = func
self.arg_names = arg_names
def __call__(self, arg_dict):
values = []
for name in self.arg_names:
if name == '*':
... | from functools import wraps
class Command(object):
def __init__(self, name, func, arg_names):
self.name = name
self.func = func
self.arg_names = arg_names
def __call__(self, arg_dict):
values = []
for name in self.arg_names:
if name == '*':
... | mit | Python |
7d311c115178426c53908c486dacc937ce4e0107 | Use state attr name from workflow in allowed.py | freevoid/yawf | yawf/allowed.py | yawf/allowed.py | # -*- coding: utf-8 -*-
from yawf import get_workflow_by_instance
def get_allowed(sender, obj):
workflow = get_workflow_by_instance(obj)
obj_state = getattr(obj, workflow.state_attr_name)
check_result = dict(
(c, c(obj, sender))
for c in workflow.get_checkers_by_state(obj_state))
me... | # -*- coding: utf-8 -*-
from yawf import get_workflow_by_instance
def get_allowed(sender, obj):
workflow = get_workflow_by_instance(obj)
check_result = dict(
(c, c(obj, sender))
for c in workflow.get_checkers_by_state(obj.state))
messages = []
for checker, message in workflow.get_ava... | mit | Python |
f67e47fd900de3953ee8abb45e5ea56851c10dee | Revert "Switch to tuple for pref set data key list" | caleb531/youversion-suggest,caleb531/youversion-suggest | yvs/set_pref.py | yvs/set_pref.py | # yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data_str(pref_set_data_str):
pref_set_data = json.loads(
pref_set_data_str)['alfredworkflow']['variables']
re... | # yvs.set_pref
# coding=utf-8
from __future__ import unicode_literals
import json
import sys
import yvs.shared as shared
# Parse pref set data from the given JSON string
def parse_pref_set_data_str(pref_set_data_str):
pref_set_data = json.loads(
pref_set_data_str)['alfredworkflow']['variables']
re... | mit | Python |
9dc76dfaff57b8d8b026bf87d5e57f49418be444 | Add method. (#20) | rushter/MLAlgorithms | mla/knn.py | mla/knn.py | from collections import Counter
import numpy as np
from scipy.spatial.distance import euclidean
from mla.base import BaseEstimator
class KNNBase(BaseEstimator):
def __init__(self, k=5, distance_func=euclidean):
"""Base for Nearest neighbors classifier and regressor.
Parameters
--------... | from collections import Counter
import numpy as np
from scipy.spatial.distance import euclidean
from mla.base import BaseEstimator
class KNNBase(BaseEstimator):
def __init__(self, k=5, distance_func=euclidean):
"""Base for Nearest neighbors classifier and regressor.
Parameters
--------... | mit | Python |
f9d1bd9471196d5706c063a5ba3d3ca0531fbd1e | Disable vSTATIC version during DEBUG | NProfileAnalysisComputationalTool/npact,NProfileAnalysisComputationalTool/npact,NProfileAnalysisComputationalTool/npact,NProfileAnalysisComputationalTool/npact,NProfileAnalysisComputationalTool/npact | npactflask/npactflask/helpers.py | npactflask/npactflask/helpers.py |
from flask import url_for
from npactflask import app
@app.template_global()
def vSTATIC(filename):
if app.config['DEBUG']:
return url_for('static', filename=filename)
else:
return url_for('static',
filename=filename, vnum=app.config['VERSION'])
| import os.path
from flask import url_for
from npactflask import app
# TODO: I think this is more simply a template_global:
# http://flask.pocoo.org/docs/0.10/api/#flask.Flask.template_global
@app.context_processor
def vSTATIC():
def STATICV(filename):
if app.config['DEBUG']:
vnum = os.path.... | bsd-3-clause | Python |
b6c74dc3ed20e0c994b3a10e34b50fd4b743364f | Add a command to put a decent number of entries into the database. | stblassitude/vvmroster,stblassitude/vvmroster,stblassitude/vvmroster | manage.py | manage.py | #!/usr/bin/env python
# -*- coding: utf8 -*-
import os
import locale
import random
from flask import Flask
from flask.ext.script import Manager
from flask.ext.mail import Mail, Message
prod = '/var/www/dienstplan.vvm.zs64.net/wsgi/vvmroster/production.cfg'
dev = os.getcwd() + '/dev.cfg'
os.environ['VVMROSTER_APPLIC... | #!/usr/bin/env python
# -*- coding: utf8 -*-
import os
import locale
from flask import Flask
from flask.ext.script import Manager
from flask.ext.mail import Mail, Message
prod = '/var/www/dienstplan.vvm.zs64.net/wsgi/vvmroster/production.cfg'
dev = os.getcwd() + '/dev.cfg'
os.environ['VVMROSTER_APPLICATION_SETTINGS... | mit | Python |
6e921cc586b6deba27831cd8504f3fc741d1feb6 | Prepare v2.9.13.dev | ianstalk/Flexget,LynxyssCZ/Flexget,JorisDeRieck/Flexget,jawilson/Flexget,OmgOhnoes/Flexget,crawln45/Flexget,malkavi/Flexget,Flexget/Flexget,poulpito/Flexget,LynxyssCZ/Flexget,qk4l/Flexget,tobinjt/Flexget,Danfocus/Flexget,ianstalk/Flexget,OmgOhnoes/Flexget,sean797/Flexget,sean797/Flexget,gazpachoking/Flexget,Danfocus/Fl... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
3da89d05d1157798aa8c5a56e330b76f78bae47b | raise errors with panels subclass loading to help in debugging | binarydud/django-debug-toolbar,seperman/django-debug-toolbar,seperman/django-debug-toolbar,pevzi/django-debug-toolbar,jazzband/django-debug-toolbar,guilhermetavares/django-debug-toolbar,peap/django-debug-toolbar,sidja/django-debug-toolbar,jazzband/django-debug-toolbar,lamby/pkg-python-django-debug-toolbar,alex/django-d... | debug_toolbar/toolbar/loader.py | debug_toolbar/toolbar/loader.py | """
The main DebugToolbar class that loads and renders the Toolbar.
"""
from django.template.loader import render_to_string
class DebugToolbar(object):
def __init__(self, request):
self.request = request
self.panels = []
self.panel_list = []
self.content_list = []
def load... | """
The main DebugToolbar class that loads and renders the Toolbar.
"""
from django.template.loader import render_to_string
class DebugToolbar(object):
def __init__(self, request):
self.request = request
self.panels = []
self.panel_list = []
self.content_list = []
def load... | bsd-3-clause | Python |
f167d36d7fa3959b48491e5a844106912b3ce34d | Prepare v3.1.28.dev | crawln45/Flexget,ianstalk/Flexget,ianstalk/Flexget,crawln45/Flexget,malkavi/Flexget,Flexget/Flexget,crawln45/Flexget,Flexget/Flexget,malkavi/Flexget,ianstalk/Flexget,crawln45/Flexget,malkavi/Flexget,Flexget/Flexget,malkavi/Flexget,Flexget/Flexget | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
358222ad7b6d08ea40fff210efed5d807a78aa3d | Fix sunrise and sunset times in weather calculation | SPARLab/BikeMaps,SPARLab/BikeMaps,SPARLab/BikeMaps | mapApp/utils/weather.py | mapApp/utils/weather.py | # Alex Goudine
# GEOG 490 - Webscraping and Database Design
# Scrapes weather data from forecast.io and returns a dict of the relevant information
# Modified by Taylor Denouden
# Shortened script and made into a simple function in which geom and date data can be passed
# Added more efficient and robust cardinal direct... | # Alex Goudine
# GEOG 490 - Webscraping and Database Design
# Scrapes weather data from forecast.io and returns a dict of the relevant information
# Modified by Taylor Denouden
# Shortened script and made into a simple function in which geom and date data can be passed
# Added more efficient and robust cardinal direct... | mit | Python |
946a9a5ed6e32259070edef499afecfe9ae41f43 | Prepare v2.20.29.dev | malkavi/Flexget,gazpachoking/Flexget,crawln45/Flexget,JorisDeRieck/Flexget,ianstalk/Flexget,malkavi/Flexget,crawln45/Flexget,ianstalk/Flexget,Flexget/Flexget,Flexget/Flexget,Flexget/Flexget,malkavi/Flexget,malkavi/Flexget,crawln45/Flexget,JorisDeRieck/Flexget,ianstalk/Flexget,crawln45/Flexget,gazpachoking/Flexget,Flexg... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
d7cedb3f5610b2fa84ab0e5e2b1d1517e5155dde | Bump version -> 0.5.2 | Bachmann1234/marshmallow,0xDCA/marshmallow,maximkulkin/marshmallow,quxiaolong1504/marshmallow,etataurov/marshmallow,xLegoz/marshmallow,jmcarp/marshmallow,dwieeb/marshmallow,Tim-Erwin/marshmallow,VladimirPal/marshmallow,bartaelterman/marshmallow,daniloakamine/marshmallow,marshmallow-code/marshmallow,0xDCA/marshmallow,mw... | marshmallow/__init__.py | marshmallow/__init__.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
__version__ = '0.5.2'
__author__ = 'Steven Loria'
__license__ = "MIT"
from marshmallow.serializer import Serializer
from marshmallow.utils import pprint
| # -*- coding: utf-8 -*-
from __future__ import absolute_import
__version__ = '0.5.2-dev'
__author__ = 'Steven Loria'
__license__ = "MIT"
from marshmallow.serializer import Serializer
from marshmallow.utils import pprint
| mit | Python |
87fa5184b55c0573c558ad5ceb93516e991c756e | Prepare v2.8.16.dev | tobinjt/Flexget,tobinjt/Flexget,jawilson/Flexget,jacobmetrick/Flexget,jawilson/Flexget,malkavi/Flexget,Flexget/Flexget,ianstalk/Flexget,LynxyssCZ/Flexget,Danfocus/Flexget,poulpito/Flexget,tobinjt/Flexget,drwyrm/Flexget,ianstalk/Flexget,drwyrm/Flexget,LynxyssCZ/Flexget,JorisDeRieck/Flexget,malkavi/Flexget,LynxyssCZ/Flex... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
dceb7b2cf641f0ab4d0968b4b34634dfccb6197c | Prepare v2.8.21.dev | malkavi/Flexget,OmgOhnoes/Flexget,jawilson/Flexget,Danfocus/Flexget,OmgOhnoes/Flexget,JorisDeRieck/Flexget,crawln45/Flexget,crawln45/Flexget,jacobmetrick/Flexget,malkavi/Flexget,tobinjt/Flexget,Flexget/Flexget,qk4l/Flexget,poulpito/Flexget,Flexget/Flexget,malkavi/Flexget,OmgOhnoes/Flexget,JorisDeRieck/Flexget,poulpito/... | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | mit | Python |
2f397281f96b606001efc4961b240c1e859b49b6 | test against Arielle's signals | simpace/simpace,simpace/simpace,simpace/simpace | simpace/tests/test_smpce_data_to_corr.py | simpace/tests/test_smpce_data_to_corr.py | from __future__ import print_function, division
from nose.tools import raises
import numpy as np
import scipy.io as sio
from numpy.testing import assert_allclose #, assert_array_equal
import os.path as osp
from ..smpce_data_to_corr import get_params, process_all
BASEDIR_JB = '/home/jb/data/simpace/data/rename_files'
... | from __future__ import print_function, division
from nose.tools import raises
import numpy as np
from numpy.testing import assert_allclose
import os.path as osp
from ..smpce_data_to_corr import get_params, process_all
BASEDIR_JB = '/home/jb/data/simpace/data/rename_files'
BASEDIR_NX = '/home/despo/simpace/subject_1_d... | bsd-2-clause | Python |
ec5396d646bb76cab99642df49bab32c03fa7098 | Update XenVif to #7 14946e13a50e0250c8d067ebf854d718695a95cb | kostaslamda/win-installer,benchalmers/win-installer,benchalmers/win-installer,cheng--zhang/win-installer,xenserver/win-installer,xenserver/win-installer,kostaslamda/win-installer,kostaslamda/win-installer,cheng--zhang/win-installer,benchalmers/win-installer,cheng--zhang/win-installer,kostaslamda/win-installer,kostaslam... | manifestspecific.py | manifestspecific.py |
# Copyright (c) Citrix Systems Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of... |
# Copyright (c) Citrix Systems Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of... | bsd-2-clause | Python |
1c21c56b4b6ed73e4346b234a08bec10188050cd | Update views.py | rpiotti/Flask-AppBuilder,zhounanshu/Flask-AppBuilder,rpiotti/Flask-AppBuilder,dpgaspar/Flask-AppBuilder,zhounanshu/Flask-AppBuilder,qpxu007/Flask-AppBuilder,qpxu007/Flask-AppBuilder,qpxu007/Flask-AppBuilder,dpgaspar/Flask-AppBuilder,dpgaspar/Flask-AppBuilder,dpgaspar/Flask-AppBuilder,zhounanshu/Flask-AppBuilder,rpiotti... | examples/quickfiles/app/views.py | examples/quickfiles/app/views.py | from flask import Markup
from flask.ext.appbuilder.baseapp import BaseApp
from flask.ext.appbuilder.models.datamodel import SQLAModel
from flask.ext.appbuilder.views import GeneralView
from app.models import Project, ProjectFiles
from flask.ext.appbuilder import Base
from app import app, db
class ProjectFilesGeneralV... | from flask.ext.appbuilder.baseapp import BaseApp
from flask.ext.appbuilder.models.datamodel import SQLAModel
from flask.ext.appbuilder.views import GeneralView
from app.models import Project, ProjectFiles
from flask.ext.appbuilder import Base
from app import app, db
class ProjectFilesGeneralView(GeneralView):
dat... | bsd-3-clause | Python |
98785ea32c938da5edf1896e6df7cb4a3260a922 | change the experiment name | daStrauss/subsurface | src/expts/allinCTX.py | src/expts/allinCTX.py | '''
Created on Jan 3, 2013
@author: dstrauss
'''
import numpy as np
D = {'solverType':'contrastX', 'flavor':'TE', 'numRuns':100, 'expt':'goBig', 'numProcs':16}
def getMyVars(parseNumber, D):
'''routine to return the parameters to test at the current iteration.'''
# noFreqs,noPhis,bkg = np.meshgrid(range(1,... | '''
Created on Jan 3, 2013
@author: dstrauss
'''
import numpy as np
D = {'solverType':'contrastX', 'flavor':'TE', 'numRuns':100, 'expt':'noSense', 'numProcs':16}
def getMyVars(parseNumber, D):
'''routine to return the parameters to test at the current iteration.'''
# noFreqs,noPhis,bkg = np.meshgrid(range(... | apache-2.0 | Python |
32807c4d3b96655e08684504f43ac2abeacc3dd0 | Add `exclude` meta attribute for `SocialAppForm`. | janusnic/django-allauth,ZachLiuGIS/django-allauth,sih4sing5hong5/django-allauth,pranjalpatil/django-allauth,bittner/django-allauth,erueloi/django-allauth,JshWright/django-allauth,patricio-astudillo/django-allauth,payamsm/django-allauth,rsalmaso/django-allauth,avsd/django-allauth,erueloi/django-allauth,nangia/django-all... | allauth/socialaccount/admin.py | allauth/socialaccount/admin.py | from django.contrib import admin
from django import forms
from .models import SocialApp, SocialAccount, SocialToken
from ..account import app_settings
from ..utils import get_user_model
User = get_user_model()
class SocialAppForm(forms.ModelForm):
class Meta:
model = SocialApp
exclude = []
... | from django.contrib import admin
from django import forms
from .models import SocialApp, SocialAccount, SocialToken
from ..account import app_settings
from ..utils import get_user_model
User = get_user_model()
class SocialAppForm(forms.ModelForm):
class Meta:
model = SocialApp
widgets = {
... | mit | Python |
6f796d093064ec1c73edff611db5eaf62e2361d3 | Add docstrings. | oleg-golovanov/unilog | unilog/unilog.py | unilog/unilog.py | # -*- coding: utf-8 -*-
import convert
def as_unicode(obj, encoding=convert.LOCALE):
"""
Representing any object to unicode string.
:param obj: any object
:type encoding: str
:param encoding: codec for encoding unicode strings
(locale.getpreferredencoding() by default)
... | # -*- coding: utf-8 -*-
import misc
def as_unicode(object_):
return misc.convert(object_)
def as_str(object_, encoding=misc.LOCALE):
return as_unicode(object_).encode(encoding)
if __name__ == '__main__':
import datetime
data = [
[
{
'dict1': 'dict1',
... | mit | Python |
4b80ed629292cf25fff9b683e6a15b6b75751876 | drop -dev from 1.3.0 | tonycpsu/urwid,inducer/urwid,foreni-packages/urwid,wardi/urwid,urwid/urwid,rndusr/urwid,foreni-packages/urwid,drestebon/urwid,tonycpsu/urwid,hkoof/urwid,urwid/urwid,inducer/urwid,rndusr/urwid,douglas-larocca/urwid,inducer/urwid,drestebon/urwid,hkoof/urwid,douglas-larocca/urwid,hkoof/urwid,foreni-packages/urwid,urwid/ur... | urwid/version.py | urwid/version.py |
VERSION = (1, 3, 0)
__version__ = ''.join(['-.'[type(x) == int]+str(x) for x in VERSION])[1:]
|
VERSION = (1, 3, 0, 'dev')
__version__ = ''.join(['-.'[type(x) == int]+str(x) for x in VERSION])[1:]
| lgpl-2.1 | Python |
9cc918aca7db3639264184e5266e8e508a08a7dd | update version | Mozu/mozu-python-sdk | mozurestsdk/config.py | mozurestsdk/config.py | __baseUrl__ = "https://home.mozu.com"
__basePciUrl__ = "https://pmts.mozu.com"
__version__="1.2.0"
| __baseUrl__ = "https://home.mozu.com"
__basePciUrl__ = "https://pmts.mozu.com"
__version__="1.1.0" | apache-2.0 | Python |
6cf3baed6e5f707e5c307388018f4bb3121327f9 | Access the conf like a object | walkr/nanoservice | nanoservice/config.py | nanoservice/config.py | """ Read configuration for a service from a json file """
import io
import json
from .client import Client
from .error import ConfigError
class DotDict(dict):
""" Access a dictionary like an object """
def __getattr__(self, key):
return self[key]
def __setattr__(self, key, value):
self... | """ Read configuration for a service from a json file """
import io
import json
from .client import Client
from .error import ConfigError
def load(filepath=None, filecontent=None, clients=True):
""" Read the json file located at `filepath`
If `filecontent` is specified, its content will be json decoded
... | mit | Python |
1fb34b960f10d362fbc436c47fafc127be59584e | Enable the SmartyPants filter; need to document it later | clones/django-template-utils | template_utils/templatetags/generic_markup.py | template_utils/templatetags/generic_markup.py | """
Filters for converting plain text to HTML and enhancing the
typographic appeal of text on the Web.
"""
from django.conf import settings
from django.template import Library
from template_utils.markup import formatter
def apply_markup(value, arg=None):
"""
Applies text-to-HTML conversion.
Takes an... | """
Filters for converting plain text to HTML and enhancing the
typographic appeal of text on the Web.
"""
from django.conf import settings
from django.template import Library
from template_utils.markup import formatter
def apply_markup(value, arg=None):
"""
Applies text-to-HTML conversion.
Takes an... | bsd-3-clause | Python |
c92a65b3cfedfbe895dcf7118fb70ee1d1ce8777 | Use naclports library in update_diff tools | yeyus/naclports,yeyus/naclports,dtkav/naclports,Schibum/naclports,yeyus/naclports,dtkav/naclports,Schibum/naclports,Schibum/naclports,Schibum/naclports,dtkav/naclports,dtkav/naclports,yeyus/naclports,Schibum/naclports,dtkav/naclports,yeyus/naclports,yeyus/naclports,Schibum/naclports | build_tools/update_diff.py | build_tools/update_diff.py | #!/usr/bin/env python
# Copyright (c) 2014 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A script to update the nacl.patch file to match the git checkout.
This encapsulates a step in the naclports workflow.
Chan... | #!/usr/bin/env python
# Copyright (c) 2014 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A script to update the nacl.patch file to match the git checkout.
This encapsulates a step in the naclports workflow.
Chan... | bsd-3-clause | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.