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 |
|---|---|---|---|---|---|---|---|---|
a5826e3ae46722531186587418c9ab136574fd74 | add o metodo index | romeubertho/USP-IntroPython,romeubertho/USP-IntroPython | 03-Listas/lista.py | 03-Listas/lista.py | bike=["lala","lala2","lala3"]
print(bike)
print(bike[1])
bike.insert(4,"a")
print(bike)
bike.insert(5,"c")
print(bike)
bike.insert(6,"b")
print(bike)
bike.append("ajkdhaiudqwiehjkzchiuzxuciadqiwe")
print(bike)
bike.sort()
print(bike)
bike.remove("lala2")
print(bike)
del bike[1]
print(bike)
bikePoped=bi... | bike=["lala","lala2","lala3"]
print(bike)
print(bike[1])
bike.insert(4,"a")
print(bike)
bike.insert(5,"c")
print(bike)
bike.insert(6,"b")
print(bike)
bike.append("ajkdhaiudqwiehjkzchiuzxuciadqiwe")
print(bike)
bike.sort()
print(bike)
bike.remove("lala2")
print(bike)
del bike[1]
print(bike)
bikePoped=bi... | mit | Python |
4610fd8931a502e8e9875e0cfb17736f47312617 | add test of delta method | nltk/nltk,nltk/nltk,nltk/nltk | nltk/test/unit/test_aline.py | nltk/test/unit/test_aline.py | # -*- coding: utf-8 -*-
"""
Unit tests for nltk.metrics.aline
"""
from __future__ import unicode_literals
import unittest
from nltk.metrics import aline
class TestAline(unittest.TestCase):
"""
Test Aline algorithm for aligning phonetic sequences
"""
def test_aline(self):
result = aline.alig... | # -*- coding: utf-8 -*-
"""
Unit tests for nltk.metrics.aline
"""
from __future__ import unicode_literals
import unittest
from nltk.metrics import aline
class TestAline(unittest.TestCase):
"""
Test Aline algorithm for aligning phonetic sequences
"""
def test_aline(self):
result = aline.alig... | apache-2.0 | Python |
f1b75e35defa9be925fec049ee4b0742bc65c53c | Add sentiment analysis. | musalbas/listentotwitter,musalbas/listentotwitter,musalbas/listentotwitter | noisytweets/tweetanalyser.py | noisytweets/tweetanalyser.py | from textblob import TextBlob
class TweetAnalyser:
def __init__(self, socketio):
self._socketio = socketio
self._keywords_tracking = []
def incoming_tweet(self, tweet):
for keyword in self._keywords_tracking:
if keyword in tweet:
sentiment = int(TextBlob(... | class TweetAnalyser:
def __init__(self, socketio):
self._socketio = socketio
self._keywords_tracking = []
def incoming_tweet(self, tweet):
for keyword in self._keywords_tracking:
if keyword in tweet:
self._socketio.emit('tweet', {'tweet': tweet}, room=keywo... | agpl-3.0 | Python |
5812c496c5c230bca6a4fe4477f41f39fb94fcc1 | Add a file header. | RaoUmer/distarray,enthought/distarray,RaoUmer/distarray,enthought/distarray | distarray/__version__.py | distarray/__version__.py | # encoding: utf-8
# ---------------------------------------------------------------------------
# Copyright (C) 2008-2014, IPython Development Team and Enthought, Inc.
# Distributed under the terms of the BSD License. See COPYING.rst.
# ---------------------------------------------------------------------------
__s... | __short_version__ = "0.5"
__version__ = "0.5.0-dev"
| bsd-3-clause | Python |
5262ef4f97b2a07de12b8a84333deb3398593144 | fix simplejson deprecation message | freelancersunion/djangocms-table,divio/djangocms-table,freelancersunion/djangocms-table,divio/djangocms-table,divio/djangocms-table,freelancersunion/djangocms-table | djangocms_table/forms.py | djangocms_table/forms.py |
from django import forms
from django.forms.models import ModelForm
from djangocms_table.widgets import TableWidget
from djangocms_table.models import Table
from django.utils.translation import ugettext_lazy as _
import csv
import json
class TableForm(ModelForm):
table_data = forms.CharField(widget=TableWidget)
... |
from django import forms
from django.forms.models import ModelForm
from djangocms_table.widgets import TableWidget
from djangocms_table.models import Table
from django.utils.translation import ugettext_lazy as _
import csv
from django.utils import simplejson
class TableForm(ModelForm):
table_data = forms.CharFie... | bsd-3-clause | Python |
965b618aa3b1d645f68b27298a8db456c7b0c89b | Remove redundant documentation | data-tsunami/django-mercadopago,data-tsunami/django-mercadopago | djmercadopago/signals.py | djmercadopago/signals.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import dispatch
checkout_preferences_created = dispatch.Signal(providing_args=["checkout_preferences",
"user_checkout_identifier",
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import dispatch
checkout_preferences_created = dispatch.Signal(providing_args=["checkout_preferences",
"user_checkout_identifier",
... | bsd-3-clause | Python |
b662135a9ababfaaeb7a7878f912e1509974e428 | Fix MissingBinary message | UrLab/DocHub,UrLab/DocHub,UrLab/beta402,UrLab/DocHub,UrLab/beta402,UrLab/DocHub,UrLab/beta402 | documents/exceptions.py | documents/exceptions.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
class MissingBinary(EnvironmentError):
def __repr__(self):
message = self.args[0] if self.args else ""
return "MissingBinary: %s" % message
__str__ = __repr__
class DocumentProcessingError(Exception):
def __init__(self, do... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
class MissingBinary(EnvironmentError):
def __repr__(self):
return "MissingBinary: %s" % self.message
__str__ = __repr__
class DocumentProcessingError(Exception):
def __init__(self, document, exc=None, message=None):
super(... | agpl-3.0 | Python |
efd6fad89131c4d3070c68013ace77f11647bd68 | Move Opal.core.search plugin into a plugins.py ahead of full plugin 2.0 refactor | khchine5/opal,khchine5/opal,khchine5/opal | opal/core/search/__init__.py | opal/core/search/__init__.py | """
OPAL core search package
"""
from opal.core import celery # NOQA
from opal.core.search import plugin
| """
OPAL core search package
"""
from opal.core.search import urls
from opal.core import plugins
from opal.core import celery # NOQA
class SearchPlugin(plugins.OpalPlugin):
"""
The plugin entrypoint for OPAL's core search functionality
"""
urls = urls.urlpatterns
javascripts = {
'opal.s... | agpl-3.0 | Python |
d0d837cbd3242506ef874ccb05dde7a44357b77a | normalize diacritics when indexing and searching | hoover/snoop,hoover/snoop | maldini/management/commands/resetindex.py | maldini/management/commands/resetindex.py | from django.core.management.base import BaseCommand
from django.conf import settings
from elasticsearch import Elasticsearch
es = Elasticsearch(settings.ELASTICSEARCH_URL)
MAPPINGS = {
"doc": {
"properties": {
"id": {"type": "string", "index": "not_analyzed"},
"path": {"type": "str... | from django.core.management.base import BaseCommand
from django.conf import settings
from elasticsearch import Elasticsearch
es = Elasticsearch(settings.ELASTICSEARCH_URL)
MAPPINGS = {
"doc": {
"properties": {
"id": {"type": "string", "index": "not_analyzed"},
"path": {"type": "str... | mit | Python |
a09b86e41981539274ce37b68ff1fc1428298553 | Use local variable for a mock, not urlopen in another module. | isagalaev/sm-openid | openid/test/test_fetchers.py | openid/test/test_fetchers.py | import unittest
from unittest import mock
import urllib.error
from openid import fetchers
from . import support
@mock.patch('urllib.request.urlopen', support.urlopen)
class Fetcher(unittest.TestCase):
def test_success(self):
url = 'http://%s/200' % support.TEST_HOST
result = fetchers.fetch(url)
... | import unittest
from unittest import mock
import urllib.error
from openid import fetchers
from . import support
@mock.patch('urllib.request.urlopen', support.urlopen)
class Fetcher(unittest.TestCase):
def test_success(self):
url = 'http://%s/200' % support.TEST_HOST
result = fetchers.fetch(url)
... | apache-2.0 | Python |
0a4f9a1c080169af3fbe3943b1e20239ae7470f2 | remove middleware in favour of decorators | qoneci/notify | notify/app.py | notify/app.py | #!/usr/bin/env python3
import falcon
from notify.core import handlers
api = falcon.API()
api.add_route('/health', handlers.GetHealth())
api.add_route('/api/notify', handlers.NotifyEvent())
| #!/usr/bin/env python3
import falcon
from notify.core import handlers
from notify.core.middleware import JSONTranslator, RequireJSON
api = falcon.API(middleware=[
RequireJSON(),
JSONTranslator(),
])
api = falcon.API()
api.add_route('/health', handlers.GetHealth())
api.add_route('/api/notify', handlers.Notif... | mit | Python |
ce24022689f28b5168e39537d6806a725dcd86c9 | change resolution for Windows camera | BogyMitutoyoCTL/CalculatorCV | Camera.py | Camera.py | import platform
import time
import cv2
import numpy
systemIsWindows = platform.system()[0:5] != "Linux"
if not systemIsWindows:
from picamera.array import PiRGBArray
from picamera import PiCamera
LITTLE_COLOR = 10
class Camera:
def __init__(self):
if systemIsWindows:
self.ca... | import platform
import time
import cv2
import numpy
systemIsWindows = platform.system()[0:5] != "Linux"
if not systemIsWindows:
from picamera.array import PiRGBArray
from picamera import PiCamera
LITTLE_COLOR = 10
class Camera:
def __init__(self):
if systemIsWindows:
self.ca... | mit | Python |
70e8724f5f42c17f157de1effc657d13ce4fe5a9 | Revert "Use .get function, so works in tests (thanks Matthew)" | MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg,MorusAB/commonlib-fmg | pylib/djangoapps/emailconfirmation/utils.py | pylib/djangoapps/emailconfirmation/utils.py | from django.template import loader, Context
from django.core.mail import send_mail
from django.conf import settings
def send_email(request, subject, template, context, to):
t = loader.get_template(template)
if request:
context.update({
'host': request.META['HTTP_HOST'],
})
mail ... | from django.template import loader, Context
from django.core.mail import send_mail
from django.conf import settings
def send_email(request, subject, template, context, to):
t = loader.get_template(template)
if request:
context.update({
'host': request.META.get('HTTP_HOST'),
})
m... | agpl-3.0 | Python |
841d3775aeb7da0754f67ae41ab5503a90f16381 | remove jsmin filter | hypebeast/etapi,hypebeast/etapi,hypebeast/etapi,hypebeast/etapi | etapi/assets.py | etapi/assets.py | # -*- coding: utf-8 -*-
from flask_assets import Bundle, Environment
css = Bundle(
"libs/bootstrap/dist/css/bootstrap.css",
"libs/metisMenu/dist/metisMenu.css",
"libs/startbootstrap-sb-admin-2/dist/css/sb-admin-2.css",
"css/style.css",
filters="cssmin",
output="public/css/common.css"
)
js = Bu... | # -*- coding: utf-8 -*-
from flask_assets import Bundle, Environment
css = Bundle(
"libs/bootstrap/dist/css/bootstrap.css",
"libs/metisMenu/dist/metisMenu.css",
"libs/startbootstrap-sb-admin-2/dist/css/sb-admin-2.css",
"css/style.css",
filters="cssmin",
output="public/css/common.css"
)
js = Bu... | bsd-3-clause | Python |
e782f849fe9ab9d6d517e7f213e0cda500782e14 | return err message | CompBio-TDU-Japan/nsdm | nsdm/shell.py | nsdm/shell.py | #!/usr/bin/env python3
# coding: utf-8
import subprocess
import sys
def run(command):
if isinstance(command, str):
command = [command]
elif isinstance(command, list):
command = [*command]
# pout = subprocess.run(["/bin/bash", "-c"] + [command],
pout = subprocess.run(command,
... | #!/usr/bin/env python3
# coding: utf-8
import subprocess
import sys
def run(command):
if isinstance(command, str):
command = [command]
elif isinstance(command, list):
command = [*command]
# pout = subprocess.run(["/bin/bash", "-c"] + [command],
pout = subprocess.run(command,
... | mit | Python |
531e6e44f750e34c789b1d86cc6f4de3c2c3829b | Fix bug with post_save signal for NewBuilding model. | Dybov/real_estate_agency,Dybov/real_estate_agency,Dybov/real_estate_agency | real_estate_agency/new_buildings/signals.py | real_estate_agency/new_buildings/signals.py | from django.db.models.signals import post_save, m2m_changed
from django.dispatch import receiver
from .models import NewBuilding, NewApartment, ResidentalComplex
@receiver(
post_save,
sender=NewBuilding,
dispatch_uid="save_apartment_after_building_saved"
)
def newbuilding_post_saver(sender, instance, crea... | from django.db.models.signals import post_save, m2m_changed
from django.dispatch import receiver
from .models import NewBuilding, NewApartment, ResidentalComplex
@receiver(
post_save,
sender=NewBuilding,
dispatch_uid="save_apartment_after_building_saved"
)
def newbuilding_post_saver(sender, instance, crea... | mit | Python |
03e0b48ff8c5d695b394a7dc4c9fd21f313a9cb8 | Test with group list | Videl/absentees-blackboard,Videl/absentees-blackboard | ADECommunicator.py | ADECommunicator.py | __author__ = 'Mael Beuget, Pierre Monnin & Thibaut Smith'
from XMLAnalyser import *
from google.appengine.api import memcache
class ADECommunicator():
parser = None
def __init__(self):
self.parser = XMLAnalyser()
def get_students_groups(self):
groups = memcache.get("group_list")
... | __author__ = 'Mael Beuget, Pierre Monnin & Thibaut Smith'
from XMLAnalyser import *
from google.appengine.api import memcache
class ADECommunicator():
parser = None
def __init__(self):
self.parser = XMLAnalyser()
def get_students_groups(self):
groups = memcache.get("group_list")
... | mit | Python |
56a8b900570200e63ee460dd7e2962cba2450b16 | Fix bug with 'all' argument | hatbot-team/hatbot_resources | preparation/tools/build_assets.py | preparation/tools/build_assets.py | from copy import copy
import argparse
from preparation.resources.Resource import names_registered, resource_by_name
from hb_res.storage import get_storage, ExplanationStorage
def generate_asset(resource, out_storage: ExplanationStorage):
out_storage.clear()
for explanation in resource:
r = copy(expla... | from copy import copy
import argparse
from preparation.resources.Resource import names_registered, resource_by_name
from hb_res.storage import get_storage, ExplanationStorage
def generate_asset(resource, out_storage: ExplanationStorage):
out_storage.clear()
for explanation in resource:
r = copy(expla... | mit | Python |
3c1645d417b5fc7f8c7fa4c69db43de699ea9de3 | add the tests directory to setup.py | zxsted/scipy,haudren/scipy,gertingold/scipy,maniteja123/scipy,e-q/scipy,aeklant/scipy,tylerjereddy/scipy,chatcannon/scipy,kalvdans/scipy,jsilter/scipy,Srisai85/scipy,vberaudi/scipy,ogrisel/scipy,befelix/scipy,arokem/scipy,nonhermitian/scipy,felipebetancur/scipy,fredrikw/scipy,jamestwebber/scipy,Shaswat27/scipy,dch312/s... | Lib/sandbox/models/setup.py | Lib/sandbox/models/setup.py | def configuration(parent_package='',top_path=None, package_name='models'):
from numpy.distutils.misc_util import Configuration
config = Configuration(package_name,parent_package,top_path)
config.add_subpackage('*')
config.add_data_dir('tests')
return config
if __name__ == '__main__':
fr... | def configuration(parent_package='',top_path=None, package_name='models'):
from numpy.distutils.misc_util import Configuration
config = Configuration(package_name,parent_package,top_path)
config.add_subpackage('*')
return config
if __name__ == '__main__':
from numpy.distutils.core import setu... | bsd-3-clause | Python |
b399016f700b90b6d505b7ab4b3c95b96a314ad4 | remove unused methods | peccu/find-duplicates-from-bookmarks.plist | Folder.py | Folder.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import bookmark
def getPath(item):
if 'path' in item:
return item['path']
return ''
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
import bookmark
def getPath(item):
if 'path' in item:
return item['path']
return ''
def walk_folder(parent):
print 'path ' + getPath(parent)
# 戻りがなんか変
def walk_folder_sub(item):
if bookmark.isFolder(item):
return map(walk_folder(item), bookmark.g... | mit | Python |
aae01cdcbd239397dad46b2d5fac91eb4219479f | Add siblings to forum serializer | ellmetha/machina-singlepageapp,ellmetha/machina-singlepageapp | project/apps/forum/serializers.py | project/apps/forum/serializers.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from machina.core.db.models import get_model
from rest_framework import serializers
Forum = get_model('forum', 'Forum')
class ForumSerializer(serializers.ModelSerializer):
description = serializers.SerializerMethodField()
previous_sibling = se... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from machina.core.db.models import get_model
from rest_framework import serializers
Forum = get_model('forum', 'Forum')
class ForumSerializer(serializers.ModelSerializer):
description = serializers.SerializerMethodField()
class Meta:
... | mit | Python |
439ad95e9a4e38b3d1182fa7b0854a9270d6a7c0 | Revert "bumped version to 1.5.1" | siovene/easy-thumbnails,SmileyChris/easy-thumbnails,Mactory/easy-thumbnails,jaddison/easy-thumbnails,sandow-digital/easy-thumbnails-cropman,sandow-digital/easy-thumbnails-cropman | easy_thumbnails/__init__.py | easy_thumbnails/__init__.py | VERSION = '1.5'
| VERSION = '1.5.1'
| bsd-3-clause | Python |
5cebef952937379af410453593de56854f19a11f | Update build.py | mriehl/pybuilder_jedi_plugin | build.py | build.py | from pybuilder.core import use_plugin, init, Author
use_plugin("python.core")
use_plugin("python.install_dependencies")
use_plugin("python.flake8")
use_plugin("python.distutils")
use_plugin('pypi:pybuilder_header_plugin')
use_plugin('pypi:pybuilder_release_plugin')
name = "pybuilder_jedi_plugin"
default_task = ["ana... | from pybuilder.core import use_plugin, init, Author
use_plugin("python.core")
use_plugin("python.install_dependencies")
use_plugin("python.flake8")
use_plugin("python.distutils")
use_plugin('pypi:pybuilder_header_plugin')
use_plugin('pypi:pybuilder_release_plugin')
name = "pybuilder_jedi_plugin"
default_task = ["ana... | apache-2.0 | Python |
4e48c031564339c6741a9fcca1ccf8d76582ae9e | make it work in colab | probml/pyprobml,probml/pyprobml,probml/pyprobml,probml/pyprobml | scripts/iris_sklearn.py | scripts/iris_sklearn.py | import numpy as np
import matplotlib.pyplot as plt
import os
#figdir = os.path.join(os.environ["PYPROBML"], "figures")
#def save_fig(fname): plt.savefig(os.path.join(figdir, fname))
def save_fig(fname):
root = os.getenv('PYPROBML') # None if key does not exist
if root:
plt.savefig(os.path.join(root, 'f... | import numpy as np
import matplotlib.pyplot as plt
import os
figdir = os.path.join(os.environ["PYPROBML"], "figures")
def save_fig(fname): plt.savefig(os.path.join(figdir, fname))
from sklearn.datasets import load_iris
iris = load_iris()
# show attributes
dir(iris)
# ['DESCR', 'data', 'feature_names', 'filename', 'ta... | mit | Python |
ec225b7557b277c93fa196a39f84f7b2b94bd8dd | Fix websocket example | KeepSafe/aiohttp,rutsky/aiohttp,arthurdarcet/aiohttp,rutsky/aiohttp,arthurdarcet/aiohttp,KeepSafe/aiohttp,KeepSafe/aiohttp,arthurdarcet/aiohttp,rutsky/aiohttp | examples/web_ws.py | examples/web_ws.py | #!/usr/bin/env python3
"""Example for aiohttp.web websocket server
"""
import asyncio
import os
from aiohttp.web import (Application, Response, WebSocketResponse, WSMsgType,
run_app)
WS_FILE = os.path.join(os.path.dirname(__file__), 'websocket.html')
async def wshandler(request):
resp... | #!/usr/bin/env python3
"""Example for aiohttp.web websocket server
"""
import asyncio
import os
from aiohttp.web import (Application, Response, WebSocketResponse, WSMsgType,
run_app)
WS_FILE = os.path.join(os.path.dirname(__file__), 'websocket.html')
async def wshandler(request):
resp... | apache-2.0 | Python |
894c7e4572d3a994105fceca8dd990889201682f | Support calling from outside | vitasdk/vita-headers,Rinnegatamante/vita-headers,Rinnegatamante/vita-headers,Rinnegatamante/vita-headers,vitasdk/vita-headers,Rinnegatamante/vita-headers,vitasdk/vita-headers,vitasdk/vita-headers | build.py | build.py | import os
import glob
DEFAULT_BUILD_OUTDIR = 'build'
CURR_DIR = os.path.dirname(os.path.realpath(__file__))
def execute(cmd, force_print=False):
with os.popen(cmd) as r:
for line in iter(r.readline, ""):
if os.environ.get('VERBOSE') or force_print:
print(line)
return r... | import os
import glob
DEFAULT_BUILD_OUTDIR = 'build'
def execute(cmd, force_print=False):
with os.popen(cmd) as r:
for line in iter(r.readline, ""):
if os.environ.get('VERBOSE') or force_print:
print(line)
return r.close()
def vita_libs_gen(yml, out):
cmd = os.env... | mit | Python |
e25bcb6651997548b69fa69092943e0cf2ec269c | Fix logo paths | alisaifee/flask-limiter,alisaifee/flask-limiter | doc/source/conf.py | doc/source/conf.py | # -*- coding: utf-8 -*-
#
import sys
import os
sys.path.insert(0, os.path.abspath('../../'))
sys.path.append(os.path.abspath('_themes'))
import flask_limiter
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
]
templates_path = ['_templates']
sou... | # -*- coding: utf-8 -*-
#
import sys
import os
sys.path.insert(0, os.path.abspath('../../'))
sys.path.append(os.path.abspath('_themes'))
import flask_limiter
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
]
templates_path = ['_templates']
sou... | mit | Python |
ce9af4521a266e3622fecc111b0840939eaef7ea | Bump version to 0.5.0.dev1 | team23/django_backend,team23/django_backend,team23/django_backend,team23/django_backend,team23/django_backend | django_backend/__init__.py | django_backend/__init__.py | from .backend.renderable import Renderable # noqa
from .group import Group # noqa
from .sitebackend import SiteBackend
__version__ = '0.5.0.dev1'
default_app_config = 'django_backend.apps.DjangoBackendConfig'
site = SiteBackend(id='backend')
| from .backend.renderable import Renderable # noqa
from .group import Group # noqa
from .sitebackend import SiteBackend
__version__ = '0.4.4.dev1'
default_app_config = 'django_backend.apps.DjangoBackendConfig'
site = SiteBackend(id='backend')
| bsd-3-clause | Python |
2cf78424615c140d482d0657048c262318a8d681 | Add user delete | Bensk1/EcoSafeServer,Bensk1/EcoSafeServer,Bensk1/EcoSafeServer | user.py | user.py | import database
import json
def getUser(username):
user = database.queryDb("select * from user where username=?;", (username,), True)
return json.dumps({"username": user[0], "password": user[1]})
def createUser(username, jsonPayload):
password = jsonPayload['password']
database.queryDbWithCommit("i... | import database
import json
def getUser(username):
user = database.queryDb("select * from user where username=?;", (username,), True)
return json.dumps({"username": user[0], "password": user[1]})
def createUser(username, jsonPayload):
password = jsonPayload['password']
database.queryDbWithCommit("i... | mit | Python |
57dfd53d5576e0aeb7c3c109e47b3b817b4327e2 | Bump version number | applegrew/django-select2,applegrew/django-select2,applegrew/django-select2 | django_select2/__init__.py | django_select2/__init__.py | # -*- coding: utf-8 -*-
"""
This is a Django_ integration of Select2_.
The app includes Select2 driven Django Widgets and Form Fields.
.. _Django: https://www.djangoproject.com/
.. _Select2: http://ivaynberg.github.com/select2/
"""
__version__ = "5.8.5"
| # -*- coding: utf-8 -*-
"""
This is a Django_ integration of Select2_.
The app includes Select2 driven Django Widgets and Form Fields.
.. _Django: https://www.djangoproject.com/
.. _Select2: http://ivaynberg.github.com/select2/
"""
__version__ = "5.8.4"
| mit | Python |
afaabe6eeb98d550d3d7294fc40c16bc1d287c03 | bump version | marco-hoyer/cfn-sphere,cfn-sphere/cfn-sphere,ImmobilienScout24/cfn-sphere,cfn-sphere/cfn-sphere,cfn-sphere/cfn-sphere | build.py | build.py | from pybuilder.core import use_plugin, init, Author
use_plugin("python.core")
use_plugin("python.unittest")
use_plugin("python.integrationtest")
use_plugin("python.install_dependencies")
use_plugin("python.flake8")
use_plugin("python.coverage")
use_plugin("python.distutils")
name = "cfn-sphere"
authors = [Author('Ma... | from pybuilder.core import use_plugin, init, Author
use_plugin("python.core")
use_plugin("python.unittest")
use_plugin("python.integrationtest")
use_plugin("python.install_dependencies")
use_plugin("python.flake8")
use_plugin("python.coverage")
use_plugin("python.distutils")
name = "cfn-sphere"
authors = [Author('Ma... | apache-2.0 | Python |
32febad861d4c4e0cf66f4ba405350a3036420b3 | Bump version number | jrsmith3/tec,jrsmith3/tec | electrode/__init__.py | electrode/__init__.py | # -*- coding: utf-8 -*-
"""
=========================
Base Library (:mod:`electrode`)
=========================
.. currentmodule:: electrode
"""
from physicalproperty import *
from electrode import *
from semiconductor import *
__version__ = "1.2.1"
| # -*- coding: utf-8 -*-
"""
=========================
Base Library (:mod:`electrode`)
=========================
.. currentmodule:: electrode
"""
from physicalproperty import *
from electrode import *
from semiconductor import *
__version__ = "1.2.0"
| mit | Python |
4a1363de76658093b0454d3610c122a7e5e4b9ed | use lambda in untracked_hardlinks_files() | dataversioncontrol/dvc,efiop/dvc,dmpetrov/dataversioncontrol,dmpetrov/dataversioncontrol,efiop/dvc,dataversioncontrol/dvc | dvc/command/checkout.py | dvc/command/checkout.py | import os
from dvc.command.common.base import CmdBase
from dvc.logger import Logger
from dvc.system import System
class CmdCheckout(CmdBase):
def run(self):
self.remove_untracked_hardlinks()
self.project.checkout()
return 0
def remove_untracked_hardlinks(self):
untracked_cach... | import os
from dvc.command.common.base import CmdBase
from dvc.logger import Logger
from dvc.system import System
class CmdCheckout(CmdBase):
def run(self):
self.remove_untracked_hardlinks()
self.project.checkout()
return 0
def remove_untracked_hardlinks(self):
untracked_cach... | apache-2.0 | Python |
c67d7327b7ed87e10e0af02a017992706f07ef25 | update build.py | kratos7/hydra,lake-lerna/hydra,kratos7/hydra,tahir24434/hydra,sushilks/hydra,tahir24434/hydra,lake-lerna/hydra,sushilks/hydra,tahir24434/hydra,kratos7/hydra,sushilks/hydra,lake-lerna/hydra | build.py | build.py | from pybuilder.core import use_plugin, init, Author, task, description, depends
from pybuilder.plugins.exec_plugin import run_command
use_plugin("python.core")
use_plugin("copy_resources")
use_plugin("filter_resources")
use_plugin("python.unittest")
#use_plugin("python.integrationtest")
use_plugin("python.install_depe... | from pybuilder.core import use_plugin, init, Author, task, description, depends
from pybuilder.plugins.exec_plugin import run_command
use_plugin("python.core")
use_plugin("copy_resources")
use_plugin("filter_resources")
use_plugin("python.unittest")
#use_plugin("python.integrationtest")
use_plugin("python.install_depe... | apache-2.0 | Python |
d4104df6442da9c69e17f4d3257a170a83a6ea11 | Use skip flag on main build | clburlison/vendored,clburlison/vendored | build.py | build.py | #!/usr/bin/python
"""
build.py - main program for vendored
"""
import os
import sys
import subprocess
from vendir import config
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
def build_openssl():
"""Build the openssl project locally and optionally package the binary."""
openssl_dir = os.path.join... | #!/usr/bin/python
"""
build.py - main program for vendored
"""
import os
import sys
import subprocess
from vendir import config
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
def build_openssl():
"""Build the openssl project locally and optionally package the binary."""
openssl_dir = os.path.join... | mit | Python |
e9f359b79740f5a95dc6c163026def78dfe1a7b0 | Add build script for including external markdown. | Darchangel/git-presentation,Darchangel/git-presentation | build.py | build.py | import distutils.core
from os import path
import re
include_folder = 'slides'
include_template = '{}.md'
include_regex = re.compile('@@([a-zA-Z0-9-_]+)')
in_file = 'index.html'
out_folder = '../dist'
out_file_name = 'index.html'
dirs_to_copy = ['css', 'js', 'lib', 'plugin']
def main():
print('Copying static dire... | mit | Python | |
332048c26faa13cde0faf5d951366ea1460d2afa | fix build for python 3 | ImmobilienScout24/aws-deployment-notifier | build.py | build.py | import sys
from pybuilder.core import use_plugin, init, Author
use_plugin('python.core')
use_plugin('python.install_dependencies')
use_plugin('python.distutils')
use_plugin('python.flake8')
use_plugin('python.unittest')
use_plugin('python.coverage')
use_plugin('copy_resources')
use_plugin('python.pytddmon')
default_... | import sys
from pybuilder.core import use_plugin, init, Author
use_plugin('python.core')
use_plugin('python.install_dependencies')
use_plugin('python.distutils')
use_plugin('python.flake8')
use_plugin('python.unittest')
use_plugin('python.coverage')
use_plugin('copy_resources')
use_plugin('python.pytddmon')
default_t... | apache-2.0 | Python |
b172c0e36c1bd60dc8f440b32b1577d2c6f4ceef | bump version | marco-hoyer/ktail | build.py | build.py | from pybuilder.core import use_plugin, init, Author
use_plugin("python.core")
use_plugin("python.unittest")
use_plugin("python.install_dependencies")
use_plugin("python.flake8")
use_plugin("python.coverage")
use_plugin("python.distutils")
use_plugin('filter_resources')
name = "ktail"
authors = [Author('Marco Hoyer'... | from pybuilder.core import use_plugin, init, Author
use_plugin("python.core")
use_plugin("python.unittest")
use_plugin("python.install_dependencies")
use_plugin("python.flake8")
use_plugin("python.coverage")
use_plugin("python.distutils")
use_plugin('filter_resources')
name = "ktail"
authors = [Author('Marco Hoyer'... | apache-2.0 | Python |
6f0049ed8a0caf49d2bfc72dcd315916166ff0e6 | Bump app version to 2017.3 | kernelci/kernelci-backend,kernelci/kernelci-backend | app/handlers/__init__.py | app/handlers/__init__.py | __version__ = "2017.3"
__versionfull__ = __version__
| __version__ = "2017.1"
__versionfull__ = __version__
| lgpl-2.1 | Python |
573cc073b49dc2e8f0a4965690b867af9205217f | Bump app version number. | kernelci/kernelci-backend,joyxu/kernelci-backend,joyxu/kernelci-backend,joyxu/kernelci-backend,kernelci/kernelci-backend | app/handlers/__init__.py | app/handlers/__init__.py | __version__ = "2015.1.4"
__versionfull__ = __version__
| __version__ = "2015.1.3"
__versionfull__ = __version__
| lgpl-2.1 | Python |
b0df925fab4a8297334f70145c929b4bf226fc63 | return proper curl call message | wing3s/flask-chatterbot | flaskchatterbot/connectors/curl_connector.py | flaskchatterbot/connectors/curl_connector.py | from flask import request
class CurlConnector(object):
def __init__(self, bot):
self.bot = bot
self.bot.app.add_url_rule(
'/' + 'webhook',
'receive_call',
self.receive_call,
methods=['GET', 'POST']
)
def receive_call(self):
if re... | from flask import request
class CurlConnector(object):
def __init__(self, bot):
self.bot = bot
self.bot.app.add_url_rule(
'/' + 'webhook',
'receive_call',
self.receive_call,
methods=['GET', 'POST']
)
def receive_call(self):
if re... | bsd-3-clause | Python |
2fd6e4c83bc208eab71a56dee544d84231d826cc | Update example app | alexandermendes/Flask-Z3950,alexandermendes/Flask-Z3950 | example.py | example.py | # -*- coding: utf8 -*-
"""Example of using Flask-Z3950 to set up the default Z39.50 gateway."""
from flask import Flask
from flask.ext.z3950 import Z3950Manager
import settings_test as settings
# Setup Flask
app = Flask(__name__)
app.config.from_object(settings)
# Setup Flask-Z3950
z3950_manager = Z3950Manager(app)
... | # -*- coding: utf8 -*-
"""Example of using Flask-Z3950 to set up a Z39.50 gateway."""
from flask import Flask
from flask.ext.z3950 import Z3950Manager
import settings_test as settings
# Setup Flask
app = Flask(__name__)
app.config.from_object(settings)
# Setup Flask-Z3950
z3950_manager = Z3950Manager(app)
z3950_mana... | bsd-3-clause | Python |
4e123ba91c33c216066835a2e4baaf4f9f2ab21d | update worker | ojengwa/gfe | worker.py | worker.py | import os
from dateutil.tz import gettz
from dateutil.parser import parse
from datetime import timedelta
import redis
from rq import Queue, Connection
from rq_scheduler import Scheduler
from scraper import scraper
if os.getenv('DEBUG'):
from rq import Worker
else:
from rq.worker import HerokuWorker as Worker... | import os
import redis
from rq import Queue, Connection
from rq.worker import HerokuWorker as Worker
listen = ['high', 'default', 'low']
redis_url = os.getenv('REDIS_URL', 'redis://localhost:6379')
if not redis_url:
raise RuntimeError('Set up Redis To Go first.')
conn = redis.from_url(redis_url)
if __name__ ... | mit | Python |
6167215e4ed49e8a4300f327d5b4ed4540d1a420 | Fix the parallel env variable test to reset the env correctly | seibert/numba,seibert/numba,stonebig/numba,cpcloud/numba,sklam/numba,gmarkall/numba,stuartarchibald/numba,numba/numba,stonebig/numba,seibert/numba,stuartarchibald/numba,sklam/numba,gmarkall/numba,sklam/numba,sklam/numba,stonebig/numba,IntelLabs/numba,IntelLabs/numba,stuartarchibald/numba,cpcloud/numba,numba/numba,stuar... | numba/tests/npyufunc/test_parallel_env_variable.py | numba/tests/npyufunc/test_parallel_env_variable.py | from numba.np.ufunc.parallel import get_thread_count
from os import environ as env
from numba.core import config
import unittest
class TestParallelEnvVariable(unittest.TestCase):
"""
Tests environment variables related to the underlying "parallel"
functions for npyufuncs.
"""
_numba_parallel_test... | from numba.np.ufunc.parallel import get_thread_count
from os import environ as env
from numba.core import config
import unittest
class TestParallelEnvVariable(unittest.TestCase):
"""
Tests environment variables related to the underlying "parallel"
functions for npyufuncs.
"""
_numba_parallel_test... | bsd-2-clause | Python |
09f56a9af02dd128893ebdf1d1416202b8ba7428 | Make it actually work | fmoo/python-filedes,fmoo/python-filedes | fdinfo.py | fdinfo.py | import stat
import os
import platform
_USE_EXTENSION = set([
'Darwin',
])
_TYPE_LOOKUP = {
stat.S_IFBLK: "block",
stat.S_IFCHR: "character",
stat.S_IFDIR: "directory",
stat.S_IFIFO: "fifo",
stat.S_IFLNK: "symlink",
stat.S_IFREG: "regular",
stat.S_IFSOCK: "socket",
0160000: "whiteo... | import stat
import os
import platform
_USE_EXTENSION = set([
'Darwin',
])
_TYPE_LOOKUP = {
stat.S_IFBLK: "block",
stat.S_IFCHR: "character",
stat.S_IFDIR: "directory",
stat.S_IFIFO: "fifo",
stat.S_IFLNK: "symlink",
stat.S_IFREG: "regular",
stat.S_IFSOCK: "socket",
0160000: "whiteo... | isc | Python |
3681660935d77d392a7ed470a8e85470e33aaca0 | Add min_price and max_price fields | earlwlkr/POICrawler | extract_options.py | extract_options.py | from pymongo import MongoClient
def main():
client = MongoClient()
db = client.cityhotspots
db.drop_collection('dineroptions')
diners_collection = db.diners
doc = {}
diner_options_collection = db.dineroptions
doc['categories'] = diners_collection.distinct('category')
doc['cuisines'] =... | from pymongo import MongoClient
def main():
client = MongoClient()
db = client.cityhotspots
db.drop_collection('dineroptions')
diners_collection = db.diners
doc = {}
diner_options_collection = db.dineroptions
doc['categories'] = diners_collection.distinct('category')
doc['cuisines'] =... | mit | Python |
8117db1ba20c0d912fb5f44f5435a46cf60c82ca | add deploy bop to daemon | nprapps/elections14,nprapps/elections14,nprapps/elections14,nprapps/elections14 | fabfile/daemons.py | fabfile/daemons.py | #!/usr/bin/env python
from time import sleep, time
from fabric.api import execute, task, env
import app_config
import sys
import traceback
def safe_execute(*args, **kwargs):
"""
Wrap execute() so that all exceptions are caught and logged.
"""
try:
execute(*args, **kwargs)
except:
... | #!/usr/bin/env python
from time import sleep, time
from fabric.api import execute, task, env
import app_config
import sys
import traceback
def safe_execute(*args, **kwargs):
"""
Wrap execute() so that all exceptions are caught and logged.
"""
try:
execute(*args, **kwargs)
except:
... | mit | Python |
504205d02ef2f5b66da225390fdb34b8b736ce57 | Load user from migration registry when creating system user | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | ideascube/migrations/0009_add_a_system_user.py | ideascube/migrations/0009_add_a_system_user.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def add_user(apps, *args):
User = apps.get_model('ideascube', 'User')
User(serial='__system__', full_name='System', password='!!').save()
class Migration(migrations.Migration):
dependencies = [
('i... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.db import migrations
def add_user(*args):
User = get_user_model()
User(serial='__system__', full_name='System', password='!!').save()
class Migration(migrations.Migration):
depend... | agpl-3.0 | Python |
a6620071755ec2f60dc04c7ce6cb0c75ed34ae94 | truncate status, try preventing console bloating | mahiso/poloniexlendingbot,Mikadily/poloniexlendingbot,yura-pakhuchiy/poloniexlendingbot,Mikadily/poloniexlendingbot,laxdog/poloniexlendingbot,yura-pakhuchiy/poloniexlendingbot,BitBotFactory/poloniexlendingbot,mahiso/poloniexlendingbot,laxdog/poloniexlendingbot,BitBotFactory/poloniexlendingbot,BitBotFactory/poloniexlend... | Logger.py | Logger.py | import sys
import time
import datetime
import atexit
class ConsoleOutput(object):
def __init__(self):
self._status = ''
atexit.register(self._exit)
def _exit(self):
self._status += ' ' # In case the shell added a ^C
self.status('')
def status(self, status):
update = '\r'... | import sys
import time
import datetime
import atexit
class ConsoleOutput(object):
def __init__(self):
self._status = ''
atexit.register(self._exit)
def _exit(self):
self._status += ' ' # In case the shell added a ^C
self.status('')
def status(self, status):
update = '\r'... | mit | Python |
5e6ef056da441e2363231c81d1204f79276b5964 | FIX __openerp__.py | csrocha/account_check,csrocha/account_check | adhoc_base_website/__openerp__.py | adhoc_base_website/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | agpl-3.0 | Python |
d8d2e4b763fbd7cedc42046f6f45395bf15caa79 | Fix the scenario plugin sample | group-policy/rally,eayunstack/rally,openstack/rally,amit0701/rally,paboldin/rally,eonpatapon/rally,cernops/rally,afaheem88/rally,yeming233/rally,vganapath/rally,gluke77/rally,aforalee/RRally,yeming233/rally,openstack/rally,gluke77/rally,gluke77/rally,eayunstack/rally,openstack/rally,aforalee/RRally,cernops/rally,group-... | samples/plugins/scenario/scenario_plugin.py | samples/plugins/scenario/scenario_plugin.py | # Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | # Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 | Python |
6c0a4441c61e462cead651e7a4a1fce90f25ab87 | Document IDF_MSequence | jamiebull1/eppy,jamiebull1/eppy,santoshphilip/eppy,jamiebull1/eppy,santoshphilip/eppy,santoshphilip/eppy | eppy/idf_msequence.py | eppy/idf_msequence.py | """
Subclass from collections.MutableSequence to get finer control over a list like
object.
This is to work with issue 40 in github:
idf1.idfobjects['BUILDING'] is a list and is not connected to
idf1.model.dt['BUILDING']
List has to be subclassed to solve this problem.
# Alex Martelli describes how to use collectio... | """
Subclass from collections.MutableSequence to get finer control over a list like
object.
This is to work with issue 40 in github:
idf1.idfobjects['BUILDING'] is a list and is not connected to
idf1.model.dt['BUILDING']
List has to be subclassed to solve this problem
# Alex Martelli describes how to use collection... | mit | Python |
643fa7d9a65827275081e4199249c5998d3f6ca2 | Fix parameter name | AdaptivePELE/AdaptivePELE,AdaptivePELE/AdaptivePELE,AdaptivePELE/AdaptivePELE,AdaptivePELE/AdaptivePELE | AdaptivePELE/analysis/dehidratate_and_align.py | AdaptivePELE/analysis/dehidratate_and_align.py | from __future__ import print_function
import argparse
import mdtraj as md
import multiprocessing as mp
import AdaptivePELE.analysis.trajectory_processing as tp
def parseArguments():
desc = "Program that extracts residue coordinates for a posterior MSM analysis."
parser = argparse.ArgumentParser(description=de... | from __future__ import print_function
import argparse
import mdtraj as md
import multiprocessing as mp
import AdaptivePELE.analysis.trajectory_processing as tp
def parseArguments():
desc = "Program that extracts residue coordinates for a posterior MSM analysis."
parser = argparse.ArgumentParser(description=de... | mit | Python |
9d85c7f32b12177161f7a499e0ae8617e88b10b4 | make output more informative | enkidulan/slidelint,timvideos/slidelint | src/slidelint/checkers/edges_danger_zone.py | src/slidelint/checkers/edges_danger_zone.py | """ Checker for determining text in danger zones around edges """
from slidelint.utils import help_wrapper
from slidelint.pdf_utils import document_pages_layouts, layout_characters
MESSAGES = (
dict(id='C1003',
msg_name='too-close-to-edges',
msg='Too close to edges',
help='Too close to e... | """ Checker for determining text in danger zones around edges """
from slidelint.utils import help_wrapper
from slidelint.pdf_utils import document_pages_layouts, layout_characters
MESSAGES = (
dict(id='C1003',
msg_name='too-close-to-edges',
msg='Too close to edges',
help="Too close to e... | apache-2.0 | Python |
346bbbc8830dbd0cad41606239528c5af3b6e3cc | Fix shape error in test_iterables | nipy/nipy-labs,alexis-roche/nipy,alexis-roche/nipy,arokem/nipy,nipy/nipy-labs,arokem/nipy,nipy/nireg,arokem/nipy,alexis-roche/register,alexis-roche/nireg,nipy/nireg,bthirion/nipy,alexis-roche/nipy,alexis-roche/register,alexis-roche/nipy,alexis-roche/register,bthirion/nipy,bthirion/nipy,bthirion/nipy,alexis-roche/niseg,... | neuroimaging/modalities/fmri/fmristat/tests/test_iterables.py | neuroimaging/modalities/fmri/fmristat/tests/test_iterables.py | import numpy as np
from numpy.random import standard_normal as noise
from neuroimaging.testing import funcfile, anatfile
from neuroimaging.core.api import load_image
from neuroimaging.modalities.fmri.api import fromimage, fmri_generator
from neuroimaging.core.image.generators import *
from neuroimaging.fixes.scipy.sta... | import numpy as np
from numpy.random import standard_normal as noise
from neuroimaging.testing import funcfile, anatfile
from neuroimaging.core.api import load_image
from neuroimaging.modalities.fmri.api import fromimage, fmri_generator
from neuroimaging.core.image.generators import *
from neuroimaging.fixes.scipy.sta... | bsd-3-clause | Python |
3988992941b8abd2526596bbd548f540bae8704f | remove sysout | dimagi/commcare-core,dimagi/commcare-core,dimagi/commcare,dimagi/javarosa,dimagi/commcare,dimagi/javarosa,dimagi/javarosa,dimagi/commcare,dimagi/commcare-core | application/postjadnew/utilities/submit_build.py | application/postjadnew/utilities/submit_build.py | #!/usr/bin/python
# requires an ApiUser (corehq.apps.api.models.ApiUser) on the remote_host with username/password given
import os
import shlex
import subprocess
from subprocess import PIPE
import sys
def submit_build(environ, host):
target_url= host + "/builds/post/"
command = (
'curl -v '
... | #!/usr/bin/python
# requires an ApiUser (corehq.apps.api.models.ApiUser) on the remote_host with username/password given
import os
import shlex
import subprocess
from subprocess import PIPE
import sys
def submit_build(environ, host):
target_url= host + "/builds/post/"
command = (
'curl -v '
... | apache-2.0 | Python |
a51c829d59311cd02c916a5e046a60d8f8c4f761 | Add rotation to flycam. | gnfrazier/YardCam | flycam.py | flycam.py | import capture
from picamera import PiCamera
import time
def image_cap_loop(camera, status=None):
"""Set image parameters, capture image, set wait time, repeat"""
resolution = (854, 480)
camera.rotation = 180
latest = capture.cap(camera, resolution, status)
status = latest[0]
size = capture.i... | import capture
from picamera import PiCamera
import time
def image_cap_loop(camera, status=None):
"""Set image parameters, capture image, set wait time, repeat"""
resolution = (854, 480)
latest = capture.cap(camera, resolution, status)
status = latest[0]
size = capture.image_size(latest[1])
... | mit | Python |
24e1ea5dcc72c9985e786a896842bd4eec92c1bb | update signature | missionpinball/mpf,missionpinball/mpf | mpf/config_players/random_event_player.py | mpf/config_players/random_event_player.py | import random
import copy
from mpf.core.config_player import ConfigPlayer
from mpf.core.utility_functions import Util
class RandomEventPlayer(ConfigPlayer):
config_file_section = 'random_event_player'
show_section = 'random_events'
device_collection = None
def play(self, settings, context, priority=0... | import random
import copy
from mpf.core.config_player import ConfigPlayer
from mpf.core.utility_functions import Util
class RandomEventPlayer(ConfigPlayer):
config_file_section = 'random_event_player'
show_section = 'random_events'
device_collection = None
def play(self, settings, key=None, priority=... | mit | Python |
106e283e454e2d9fa10bdf7c7d6f318fb0cf4118 | refactor swift config script | zerovm/zerocloud,zerovm/zerocloud,zerovm/zerocloud | contrib/vagrant/configure_swift.py | contrib/vagrant/configure_swift.py | from ConfigParser import ConfigParser
def inject_before(some_list, item, target):
# make a copy
some_list = list(some_list)
for i, each in enumerate(some_list):
if each == target:
some_list.insert(i, item)
break
else:
# just append to the list:
some_list... | from ConfigParser import ConfigParser
def inject_before(some_list, item, target):
for i, each in enumerate(some_list):
if each == target:
some_list.insert(i, item)
break
else:
# just append to the list:
some_list.append(item)
if __name__ == '__main__':
cp ... | apache-2.0 | Python |
68a621005c5a520b7a97c4cad462d43fb7f3aaed | Break out dispatch, and drop prepare. Easier testing | funkybob/paws | paws/views.py | paws/views.py |
from .request import Request
from .response import Response, response
import logging
log = logging.getLogger()
class View:
def __call__(self, event, context):
kwargs = event.get('pathParameters') or {}
self.dispatch(request, **kwargs)
def dispatch(self, request, **kwargs):
func = g... |
from .request import Request
from .response import Response, response
import logging
log = logging.getLogger()
class View:
def __call__(self, event, context):
request = Request(event, context)
resp = self.prepare(request)
if resp:
return resp
kwargs = event.get('path... | bsd-3-clause | Python |
81fed3d61663e34df7d51f67d48bc8a2fa9b1af6 | Clean up | b-mueller/mythril,b-mueller/mythril,b-mueller/mythril,b-mueller/mythril | mythril/laser/ethereum/strategy/custom.py | mythril/laser/ethereum/strategy/custom.py | from mythril.laser.ethereum.state.global_state import GlobalState
from mythril.laser.ethereum.strategy.basic import BreadthFirstSearchStrategy
from mythril.laser.ethereum.state.annotation import StateAnnotation
from mythril.laser.ethereum import util
from typing import Dict, cast, List
from copy import copy
import logg... | from mythril.laser.ethereum.state.global_state import GlobalState
from mythril.laser.ethereum.strategy.basic import BreadthFirstSearchStrategy
from mythril.laser.ethereum.state.annotation import StateAnnotation
from mythril.laser.ethereum import util
from typing import Dict, cast, List
from copy import copy
import logg... | mit | Python |
9ed059f4cc28cc1a01a1a92bbc768b4a44eaeaf1 | Bump server python lib version to 0.6.4 #204 | CartoDB/dataservices-api,CartoDB/dataservices-api,CartoDB/geocoder-api,CartoDB/geocoder-api,CartoDB/dataservices-api,CartoDB/geocoder-api,CartoDB/geocoder-api,CartoDB/dataservices-api | server/lib/python/cartodb_services/setup.py | server/lib/python/cartodb_services/setup.py | """
CartoDB Services Python Library
See:
https://github.com/CartoDB/geocoder-api
"""
from setuptools import setup, find_packages
setup(
name='cartodb_services',
version='0.6.4',
description='CartoDB Services API Python Library',
url='https://github.com/CartoDB/dataservices-api',
author='Data ... | """
CartoDB Services Python Library
See:
https://github.com/CartoDB/geocoder-api
"""
from setuptools import setup, find_packages
setup(
name='cartodb_services',
version='0.6.3',
description='CartoDB Services API Python Library',
url='https://github.com/CartoDB/dataservices-api',
author='Data ... | bsd-3-clause | Python |
9c18fff119dc1be597f13ec9d57c0bc2815da409 | add garmin as option | geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/drf-utm-zone-info,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/drf-utm-zone-info,geometalab/osmaxx,geometalab/osmaxx-frontend | osmaxx-py/osmaxx/excerptexport/forms/temporary_form_helper.py | osmaxx-py/osmaxx/excerptexport/forms/temporary_form_helper.py | from django.utils.translation import gettext as _
# TODO: get these from the conversion_api
available_format_choices = (
('fgdb', _('fgdb')),
('shp', _('shp')),
('gpkg', _('gpkg')),
('spatialite', _('spatialite')),
('garmin', _('garmin')),
)
def get_export_options(selected_options):
return {
... | from django.utils.translation import gettext as _
# TODO: get these from the conversion_api
available_format_choices = (
('fgdb', _('fgdb')),
('shp', _('shp')),
('gpkg', _('gpkg')),
('spatialite', _('spatialite')),
)
def get_export_options(selected_options):
return {
'gis_options': {
... | mit | Python |
977ad8955585b3a1a22f62c2f6117f5babc2a9ea | Update Keras.py | paperrune/Neural-Networks,paperrune/Neural-Networks | History/Nesterov-Accelerated-Gradient/Keras.py | History/Nesterov-Accelerated-Gradient/Keras.py | import keras
from keras.datasets import mnist
from keras.initializers import RandomUniform
from keras.layers import Dense
from keras.models import Sequential
from keras.optimizers import SGD
batch_size = 128
epochs = 30
learning_rate = 0.1
momentum = 0.9
num_classes = 10
(x_train, y_train), (x_test, y_te... | import keras
from keras.datasets import mnist
from keras.initializers import RandomUniform
from keras.layers import Dense
from keras.models import Sequential
from keras.optimizers import SGD
batch_size = 128
epochs = 30
num_classes = 10
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train = ... | mit | Python |
1f76fb87ea5cbd9dddb1bd793bfec337d55095e8 | fix style problem | PaddlePaddle/Paddle,yu239/Paddle,yu239/Paddle,livc/Paddle,luotao1/Paddle,cxysteven/Paddle,lispc/Paddle,putcn/Paddle,pengli09/Paddle,livc/Paddle,emailweixu/Paddle,tensor-tang/Paddle,pkuyym/Paddle,cxysteven/Paddle,tensor-tang/Paddle,lcy-seso/Paddle,hedaoyuan/Paddle,pkuyym/Paddle,jacquesqiao/Paddle,pengli09/Paddle,pengli0... | python/paddle/v2/plot/tests/test_ploter.py | python/paddle/v2/plot/tests/test_ploter.py | # Copyright (c) 2016 PaddlePaddle 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 applic... | # Copyright (c) 2016 PaddlePaddle 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 applic... | apache-2.0 | Python |
70eb6caed1fba2beecf3ce6c9166ab153dd32133 | Remove xrange for Py 3 compatibility | suchow/judicious,suchow/judicious,suchow/judicious | clock.py | clock.py | from datetime import datetime, timedelta
import logging
import os
from apscheduler.schedulers.blocking import BlockingScheduler
from pq import PQ
from psycopg2 import connect
from app import db, Task
import recruiters
# Set up connection to queue.
DB_URL_DEFAULT = 'postgresql://postgres@localhost/judicious'
DB_URL =... | from datetime import datetime, timedelta
import logging
import os
from apscheduler.schedulers.blocking import BlockingScheduler
from pq import PQ
from psycopg2 import connect
from app import db, Task
import recruiters
# Set up connection to queue.
DB_URL_DEFAULT = 'postgresql://postgres@localhost/judicious'
DB_URL =... | mit | Python |
3713419c6f4d5e742bce6855981f40119e119a47 | support multiple markups with urwid.Text | f-cap/sen,TomasTomecek/sen | sen/tui/widgets/util.py | sen/tui/widgets/util.py | import logging
import urwid
from sen.tui.constants import MAIN_LIST_FOCUS
logger = logging.getLogger(__name__)
class AdHocAttrMap(urwid.AttrMap):
"""
Ad-hoc attr map change
taken from https://github.com/pazz/alot/
"""
def __init__(self, w, maps, init_map='normal'):
self.maps = maps
... | import urwid
class AdHocAttrMap(urwid.AttrMap):
"""
Ad-hoc attr map change
taken from https://github.com/pazz/alot/
"""
def __init__(self, w, maps, init_map='normal'):
self.maps = maps
urwid.AttrMap.__init__(self, w, maps[init_map])
def set_map(self, attrstring):
self... | mit | Python |
9bba62086d3e2106007ff43cbc4e22019133959e | Allow attrs in template tag. Close #16 | kevinmickey/django-prettyjson,kevinmickey/django-prettyjson,kevinmickey/django-prettyjson | prettyjson/templatetags/prettyjson.py | prettyjson/templatetags/prettyjson.py | # -*- coding: utf-8 -*-
import json
from django.template import Library
from django.utils.safestring import mark_safe
import six
from ..widgets import PrettyJSONWidget
from standardjson import StandardJSONEncoder
register = Library()
@register.simple_tag
def prettyjson_setup(jquery=True):
widget = PrettyJSON... | # -*- coding: utf-8 -*-
import json
from django.template import Library
from django.utils.safestring import mark_safe
import six
from ..widgets import PrettyJSONWidget
from standardjson import StandardJSONEncoder
register = Library()
@register.simple_tag
def prettyjson_setup(jquery=True):
widget = PrettyJSON... | bsd-3-clause | Python |
4ccead3c28af6540b5eaacc8c5cf96c94312a813 | use join() for script path | idleberg/sublime-makensis | chmod.py | chmod.py | # https://gist.github.com/idleberg/03bc3766c760bb4b81e3
import os, stat, sublime, sublime_plugin
# Package name, must match directory name
p = 'makensis'
# Array of files, relative to package directory
files = [
'build.sh'
]
def plugin_loaded():
from os.path import join
from package_control import event... | # https://gist.github.com/idleberg/03bc3766c760bb4b81e3
import os, stat, sublime, sublime_plugin
# Package name, must match directory name
p = 'makensis'
# Array of files, relative to package directory
files = [
'build.sh'
]
def plugin_loaded():
from package_control import events
if (events.install(p) ... | mit | Python |
aab973c0f26a5ef175b41eda7cb11f18aa895050 | fix flake8 warning | Rahul91/junction,NabeelValapra/junction,NabeelValapra/junction,akshayaurora/junction,praba230890/junction,nava45/junction,Rahul91/junction,farhaanbukhsh/junction,ChillarAnand/junction,Rahul91/junction,Rahul91/junction,nava45/junction,pythonindia/junction,farhaanbukhsh/junction,hTrap/junction,hTrap/junction,nava45/junct... | wsgi.py | wsgi.py | """
WSGI config for junction project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.wsgi imp... | """
WSGI config for junction project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.wsgi imp... | mit | Python |
5c14c82701ecadde26df20dd1df3a12013e9ca8c | Update __openerp__.py | Elico-Corp/openerp-7.0,Elico-Corp/openerp-7.0,Elico-Corp/openerp-7.0 | procurement_supply_ext/__openerp__.py | procurement_supply_ext/__openerp__.py | # -*- coding: utf-8 -*-
# © 2014 Elico corp(www.elico-corp.com)
# Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html)
{
'name' : 'Procurement Supply Ext',
'version' : '7.0.1.0.0',
'author': 'Elico Corp',
'website': 'www.elico-corp.com',
'category' : 'Generic Modules/Production',
... | # -*- coding: utf-8 -*-
# © 2014 Elico corp(www.elico-corp.com)
# Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html)
{
'name' : 'Procurement Supply Ext',
'version' : '7.0.1.0.0',
'author': 'Elico Corp',
'website': 'www.openerp.net.cn',
'category' : 'Generic Modules/Production',
... | agpl-3.0 | Python |
230443d3e035252f7f1d56c556f8ae2b701a41cc | Improve problem 27 | cryvate/project-euler,cryvate/project-euler | project_euler/solutions/problem_27.py | project_euler/solutions/problem_27.py | from itertools import count
from ..library.number_theory.primes import is_prime, prime_sieve
def consecutive(a: int, b: int, sieve) -> int:
# assume b prime
for n in count(1):
if not is_prime(n ** 2 + a * n + b, sieve):
return n
def solve(a_bound: int=1_000, b_bound: int=1_000, sieve_b... | from itertools import count
from ..library.number_theory.primes import is_prime
def consecutive(a: int, b: int, sieve) -> int:
for n in count():
if not is_prime(n ** 2 + a * n + b, sieve):
return n
def solve(a_bound: int=1_000, b_bound: int=1_000, sieve_bound: int=100) -> int:
maximum =... | mit | Python |
b8578ebb82e66d0f64dc22f9b72135005c42536d | Use wait() function (from tests.test_sockets). Start and stop each manager | nizox/circuits,treemo/circuits,eriol/circuits,treemo/circuits,eriol/circuits,treemo/circuits,eriol/circuits | circuits/tests/test_bridge.py | circuits/tests/test_bridge.py | # Module: test_bridge
# Date: 5th November 2008
# Author: James Mills, prologic at shortcircuit dot net dot au
"""Debugger Test Suite
Test all functionality of the bridge module.
"""
import unittest
from circuits import Bridge
from circuits import listener, Event, Component, Manager
def wait():
for x ... | # Module: test_bridge
# Date: 5th November 2008
# Author: James Mills, prologic at shortcircuit dot net dot au
"""Debugger Test Suite
Test all functionality of the bridge module.
"""
import unittest
from circuits import Bridge
from circuits import listener, Event, Component, Manager
class Foo(Component):
... | mit | Python |
1f9a2221a8b50a22a527b7e05f7fcb6d029579eb | Undo last commit | simphony/simphony-remote,simphony/simphony-remote,simphony/simphony-remote,simphony/simphony-remote | selenium_tests/test_start_stop_container.py | selenium_tests/test_start_stop_container.py | # -*- coding: utf-8 -*-
from selenium.webdriver.common.action_chains import ActionChains
from selenium_tests.selenium_test_base import SeleniumTestBase
class TestContainerInteraction(SeleniumTestBase):
def test_start_stop_container(self):
driver = self.driver
with self.login():
self.wa... | # -*- coding: utf-8 -*-
from selenium.webdriver.common.action_chains import ActionChains
from selenium_tests.selenium_test_base import SeleniumTestBase
class TestContainerInteraction(SeleniumTestBase):
def test_start_stop_container(self):
driver = self.driver
with self.login():
self.wa... | bsd-3-clause | Python |
126c0eab74406bc5e6c30f9054587fa5f0a26bb0 | Change azure-mgmt-compute/version.py to 0.31.0 | Azure/azure-sdk-for-python,Azure/azure-sdk-for-python,lmazuel/azure-sdk-for-python,SUSE/azure-sdk-for-python,Azure/azure-sdk-for-python,v-iam/azure-sdk-for-python,rjschwei/azure-sdk-for-python,Azure/azure-sdk-for-python,AutorestCI/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/version.py | azure-mgmt-compute/azure/mgmt/compute/version.py | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit | Python |
3b96979a839371a96ecd996e12e5cc161bf7b83b | Remove more stuff | n2o/pi-dashboard,n2o/pi-dashboard | flask/app/views.py | flask/app/views.py | from flask import render_template, Response
from jinja2 import Environment, FileSystemLoader
from app import app
from pygments import highlight
from pygments.lexers import BashLexer
from pygments.formatters import HtmlFormatter
import subprocess
@app.route('/')
@app.route('/index')
def index():
return render_te... | from flask import render_template, Response
from jinja2 import Environment, FileSystemLoader
from app import app
from pygments import highlight
from pygments.lexers import BashLexer
from pygments.formatters import HtmlFormatter
import subprocess
@app.route('/')
@app.route('/index')
def index():
return render_te... | mit | Python |
bae7885b261e99da0d73c3e7dd9e9bd66d45fa30 | rebase skel | gotche/django-basic-project | project_name/project_name/settings.py | project_name/project_name/settings.py | import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'r%@lxgh=%8$ijhp25tet#+1o&5a0)+n=5+!sam7^qw+ys489xk'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []... | import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'r%@lxgh=%8$ijhp25tet#+1o&5a0)+n=5+!sam7^qw+ys489xk'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []... | apache-2.0 | Python |
1588b70ea8db3619498835c431ff56ccfa65b2a5 | Revert "Wrapping/unwrapping Record namedtuple" | bleib1dj/neomodel,robinedwards/neomodel,wcooley/neomodel,cristigociu/neomodel_dh,robinedwards/neomodel,fpieper/neomodel,andrefsp/neomodel,bleib1dj/neomodel,pombredanne/neomodel | neomodel/relationship.py | neomodel/relationship.py | from .properties import Property, PropertyManager, AliasProperty
class RelationshipMeta(type):
def __new__(mcs, name, bases, dct):
inst = super(RelationshipMeta, mcs).__new__(mcs, name, bases, dct)
for key, value in dct.items():
if issubclass(value.__class__, Property):
... | from .properties import Property, PropertyManager, AliasProperty
class RelationshipMeta(type):
def __new__(mcs, name, bases, dct):
inst = super(RelationshipMeta, mcs).__new__(mcs, name, bases, dct)
for key, value in dct.items():
if issubclass(value.__class__, Property):
... | mit | Python |
510468b34e41148d463852f4d9ecabc2731ae3df | add a reverse relation for releases on PackageResource | crate-archive/crate-site,crate-archive/crate-site,crateio/crate.pypi | crate_project/apps/packages/api.py | crate_project/apps/packages/api.py | from tastypie import fields
from tastypie.resources import ModelResource
from packages.models import Package, Release
class PackageResource(ModelResource):
releases = fields.ToManyField("packages.api.ReleaseResource", "releases")
class Meta:
queryset = Package.objects.all()
resource_name = "... | from tastypie import fields
from tastypie.resources import ModelResource
from packages.models import Package, Release
class PackageResource(ModelResource):
class Meta:
queryset = Package.objects.all()
resource_name = "package"
class ReleaseResource(ModelResource):
package = fields.ForeignKe... | bsd-2-clause | Python |
09bb710433a7806b04cd8b7474bcf2f039ca4346 | remove the eager settings for celery | crate-archive/crate-site,crateio/crate.pypi,crate-archive/crate-site | crate_project/settings/dev/base.py | crate_project/settings/dev/base.py | from ..base import *
DEBUG = True
TEMPLATE_DEBUG = True
SERVE_MEDIA = DEBUG
SITE_ID = 1
MIDDLEWARE_CLASSES += [
"debug_toolbar.middleware.DebugToolbarMiddleware",
]
INSTALLED_APPS += [
"debug_toolbar",
]
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
# Configure Celery
BROKER_TRANSPORT ... | from ..base import *
DEBUG = True
TEMPLATE_DEBUG = True
SERVE_MEDIA = DEBUG
SITE_ID = 1
MIDDLEWARE_CLASSES += [
"debug_toolbar.middleware.DebugToolbarMiddleware",
]
INSTALLED_APPS += [
"debug_toolbar",
]
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
#CELERY_ALWAYS_EAGER = True # When ... | bsd-2-clause | Python |
7bfd7b9c33eee6368e4660f9ff49e7da5608fa89 | Fix mypy issues at core.node.domain.service source file | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | packages/syft/src/syft/core/node/domain/service.py | packages/syft/src/syft/core/node/domain/service.py | # stdlib
from typing import Optional
# third party
from nacl.signing import VerifyKey
# relative
from ....core.node.abstract.node_service_interface import NodeServiceInterface
from ....core.node.common.node_service.auth import service_auth
from ....core.node.common.node_service.generic_payload.syft_message import Syf... | # stdlib
from typing import Optional
# third party
from nacl.signing import VerifyKey
# relative
from ....core.node.abstract.node_service_interface import NodeServiceInterface
from ....core.node.common.node_service.auth import service_auth
from ....core.node.common.node_service.generic_payload.syft_message import Syf... | apache-2.0 | Python |
af118bcc539b5db0b6daa9cf74777176df413e32 | Check stdout with --debug for actual ddl | analyst-collective/dbt,analyst-collective/dbt | test/integration/022_bigquery_test/test_bigquery_adapter_specific.py | test/integration/022_bigquery_test/test_bigquery_adapter_specific.py | """"Test adapter specific config options."""
from test.integration.base import DBTIntegrationTest, use_profile
import textwrap
import yaml
class TestBigqueryAdapterSpecific(DBTIntegrationTest):
@property
def schema(self):
return "bigquery_test_022"
@property
def models(self):
return ... | """"Test adapter specific config options."""
from test.integration.base import DBTIntegrationTest, use_profile
import textwrap
import yaml
class TestBigqueryAdapterSpecific(DBTIntegrationTest):
@property
def schema(self):
return "bigquery_test_022"
@property
def models(self):
return ... | apache-2.0 | Python |
18345e468ea44f34e8df96c1b70727c0a2aff7c9 | Fix issue #4 | NicoSantangelo/sublime-text-i18n-rails,NicoSantangelo/sublime-text-i18n-rails | yaml.py | yaml.py | from . import pyyaml
class Yaml():
def __init__(self, locales_path):
self.locales_path = locales_path
self.setup()
def move_to(self, selected_text):
# Find the full paths file name key on the dict inside
keys = [ self.locales_path.locale_name() ] # root: es|en|...
if ... | from . import pyyaml
class Yaml():
def __init__(self, locales_path):
self.locales_path = locales_path
self.setup()
def move_to(self, selected_text):
# Find the full paths file name key on the dict inside
keys = [ self.locales_path.locale_name() ] # root: es|en|...
if ... | mit | Python |
b04a2c91d359de9ece816d783f8d34e8ca2c4919 | Disable wifi after testing in comm_wifi_connect.py | daweiwu/meta-iotqa-1,wanghongjuan/meta-iotqa-1,wanghongjuan/meta-iotqa-1,ostroproject/meta-iotqa,daweiwu/meta-iotqa-1,wanghongjuan/meta-iotqa-1,wanghongjuan/meta-iotqa-1,ostroproject/meta-iotqa,wanghongjuan/meta-iotqa-1,ostroproject/meta-iotqa,ostroproject/meta-iotqa,daweiwu/meta-iotqa-1,daweiwu/meta-iotqa-1,daweiwu/me... | lib/oeqa/runtime/sanity/comm_wifi_connect.py | lib/oeqa/runtime/sanity/comm_wifi_connect.py | import time
from oeqa.oetest import oeRuntimeTest
class CommWiFiTest(oeRuntimeTest):
'''WiFi test by connmanctl'''
def test_wifi_connect_nopassword(self):
'''connmanctl to connect a no-password wifi AP'''
# un-block software rfkill lock
self.target.run('rfkill unblock all')
# En... | import time
from oeqa.oetest import oeRuntimeTest
class CommWiFiTest(oeRuntimeTest):
'''WiFi test by connmanctl'''
def test_wifi_connect_nopassword(self):
'''connmanctl to connect a no-password wifi AP'''
# un-block software rfkill lock
self.target.run('rfkill unblock all')
# En... | mit | Python |
c8c673a73288bff031f244955161cc44cb3a70af | Fix missing and redundand imports in __init__ | python-visualization/folium,python-visualization/folium,ocefpaf/folium,ocefpaf/folium | folium/__init__.py | folium/__init__.py | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
import sys
import warnings
import branca
from branca.colormap import (ColorMap, LinearColormap, StepColormap)
from branca.element import (
CssLink,
Div,
Element,
Figure,
Html,
IFrame,
JavascriptLink... | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
import sys
import warnings
import branca
from branca.colormap import (ColorMap, LinearColormap, StepColormap)
from branca.element import (
CssLink,
Div,
Element,
Figure,
Html,
IFrame,
JavascriptLink... | mit | Python |
95356f65e1b33bf5e64c19cd92540dc038a7be33 | Bump version 0.9.5.post5 | Yelp/kafka-python,Yelp/kafka-python | kafka/version.py | kafka/version.py | __version__ = '0.9.5.post5'
| __version__ = '0.9.5.post4'
| apache-2.0 | Python |
47b9950ebfda3737f1a21714cc2db5c857d7483b | Add hash function to BaseDiagnosis. | michaelherold/pyIsEmail,michaelherold/pyIsEmail | pyisemail/diagnosis/base_diagnosis.py | pyisemail/diagnosis/base_diagnosis.py | from pyisemail.reference import Reference
class BaseDiagnosis(object):
CATEGORIES = {
'VALID': 1,
'DNSWARN': 7,
'RFC5321': 15,
'THRESHOLD': 16,
'CFWS': 31,
'DEPREC': 63,
'RFC5322': 127,
'ERR': 255,
}
DESCRIPTION = ""
ERROR_CODES = {}
... | from pyisemail.reference import Reference
class BaseDiagnosis(object):
CATEGORIES = {
'VALID': 1,
'DNSWARN': 7,
'RFC5321': 15,
'THRESHOLD': 16,
'CFWS': 31,
'DEPREC': 63,
'RFC5322': 127,
'ERR': 255,
}
DESCRIPTION = ""
ERROR_CODES = {}
... | mit | Python |
412ced111b7e104e570c923e21cc636ca94b9d65 | Write all the functions for the user database table | heiskr/sagefy,heiskr/sagefy,heiskr/sagefy,heiskr/sagefy | server/database/user.py | server/database/user.py | from schemas.user import schema as user_schema
import urllib
import hashlib
from passlib.hash import bcrypt
from database.util import insert_document, update_document, delete_document, \
get_document, deliver_fields
from framework.elasticsearch import es
import json
from framework.redis import redis
from modules.ut... | # get_user
# list_user
# create_user
# validate_user
| apache-2.0 | Python |
14ad76659d87a363a2bf63522b6a319ec84c73e9 | Fix verify_util to support RSA keys. | eranmes/certificate-transparency,eranmes/certificate-transparency,grandamp/certificate-transparency,lexibrent/certificate-transparency,pphaneuf/certificate-transparency,eranmes/certificate-transparency,google/certificate-transparency,katjoyce/certificate-transparency,google/certificate-transparency,katjoyce/certificate... | python/ct/crypto/tools/verify_util.py | python/ct/crypto/tools/verify_util.py | #!/usr/bin/env python
"""verify_util.py: CT signature verification utility.
Usage:
verify_util.py <command> [flags] [cert_file]
Known commands:
verify_sct: Verify Signed Certificate Timestamp over X.509 certificate.
The cert_file must contain one or more PEM-encoded certificates.
For example:
verify_ut... | #!/usr/bin/env python
"""verify_util.py: CT signature verification utility.
Usage:
verify_util.py <command> [flags] [cert_file]
Known commands:
verify_sct: Verify Signed Certificate Timestamp over X.509 certificate.
The cert_file must contain one or more PEM-encoded certificates.
For example:
verify_ut... | apache-2.0 | Python |
b20e7317ab654250faab7f38e25237c21ccbe40c | Add version 0.2.0 (#26487) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/py-backcall/package.py | var/spack/repos/builtin/packages/py-backcall/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyBackcall(PythonPackage):
"""Specifications for callback functions passed in to an API"""... | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyBackcall(PythonPackage):
"""Specifications for callback functions passed in to an API"""... | lgpl-2.1 | Python |
678fb7e879326380c5bd9795d81beb21efe4d30c | Fix imports for prototype example | asydorchuk/robotics,asydorchuk/robotics | python/robotics/examples/prototype.py | python/robotics/examples/prototype.py | import time
from RPi import GPIO as gpio
from robotics.actors.redbot_motor_actor import RedbotMotorActor
from robotics.interfaces.spi.mcp3008_spi_interface import MCP3008SpiInterface
from robotics.sensors.redbot_wheel_encoder_sensor import RedbotWheelEncoderSensor
from robotics.sensors.sharp_ir_distance_sensor import... | import time
from RPi import GPIO as gpio
from actors.redbot_motor_actor import RedbotMotorActor
from interfaces.spi.mcp3008_spi_interface import MCP3008SpiInterface
from sensors.redbot_wheel_encoder_sensor import RedbotWheelEncoderSensor
from sensors.sharp_ir_distance_sensor import SharpIrDistanceSensor
def check_m... | mit | Python |
901ebb52f82c518c11285e6a282e18ad6954cd96 | Fix tf session not being set as default | scanner-research/scanner,scanner-research/scanner,scanner-research/scanner,scanner-research/scanner | python/scannerpy/stdlib/tensorflow.py | python/scannerpy/stdlib/tensorflow.py | from ..kernel import Kernel
from scannerpy import DeviceType
import tensorflow as tf
class TensorFlowKernel(Kernel):
def __init__(self, config):
# If this is a CPU kernel, tell TF that it should not use
# any GPUs for its graph operations
cpu_only = True
visible_device_list = []
... | from ..kernel import Kernel
from scannerpy import DeviceType
import tensorflow as tf
class TensorFlowKernel(Kernel):
def __init__(self, config):
# If this is a CPU kernel, tell TF that it should not use
# any GPUs for its graph operations
cpu_only = True
visible_device_list = []
... | apache-2.0 | Python |
e0782258d18229dc9b08e6682bd7778c27a51716 | remove debugging output | yippeecw/sfa,yippeecw/sfa,onelab-eu/sfa,yippeecw/sfa,onelab-eu/sfa,onelab-eu/sfa | sfa/util/nodemanager.py | sfa/util/nodemanager.py | import tempfile
import commands
import os
class NodeManager:
method = None
def __init__(self, config):
self.config = config
def __getattr__(self, method):
self.method = method
return self.__call__
def __call__(self, *args):
method = self.method
### WARNIN... | import tempfile
import commands
import os
class NodeManager:
method = None
def __init__(self, config):
self.config = config
def __getattr__(self, method):
self.method = method
return self.__call__
def __call__(self, *args):
method = self.method
### WARNIN... | mit | Python |
6dd3372dbe69912cc20217be808cd4e5c34b94b1 | Remove the now obsolete `KEY_STORE'. | isislovecruft/scramblesuit,isislovecruft/scramblesuit | const.py | const.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module defines constant values for the ScrambleSuit protocol.
While some values can be changed, in general they should not. If you do not
obey, be at least careful because the protocol could easily break.
"""
# Length of the HMAC used to authenticate the ticket... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module defines constant values for the ScrambleSuit protocol.
While some values can be changed, in general they should not. If you do not
obey, be at least careful because the protocol could easily break.
"""
# Length of the HMAC used to authenticate the ticket... | bsd-3-clause | Python |
db78fecbf899b9d82e1e81b91db5bfa1aa2e4ca4 | Fix Seat inline causing trouble for SeatingGroupAdmin | Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet | karspexet/venue/admin.py | karspexet/venue/admin.py | from django.contrib import admin
from django.contrib.admin.options import IncorrectLookupParameters
from django.shortcuts import redirect
from django.urls import reverse
from django.utils.html import format_html
from karspexet.ticket.models import PricingModel
from karspexet.utils import admin_change_url
from karspexe... | from django.contrib import admin
from django.contrib.admin.options import IncorrectLookupParameters
from django.shortcuts import redirect
from django.utils.html import format_html
from karspexet.ticket.models import PricingModel
from karspexet.utils import admin_change_url
from karspexet.venue.models import Seat, Seat... | mit | Python |
48be4358bb784b20beb419d48734d7ab32e57110 | implement sorting and proper formatting | morgenst/PyAnalysisTools,morgenst/PyAnalysisTools,morgenst/PyAnalysisTools | PyAnalysisTools/AnalysisTools/DatasetPrinter.py | PyAnalysisTools/AnalysisTools/DatasetPrinter.py | import numpy as np
from tabulate import tabulate
from itertools import chain
from PyAnalysisTools.base.YAMLHandle import YAMLLoader
from PyAnalysisTools.AnalysisTools.XSHandle import XSHandle
class DatasetPrinter(object):
def __init__(self, **kwargs):
self.datasets = list(chain.from_iterable(filter(lambda... | import itertools
import numpy as np
from tabulate import tabulate
from PyAnalysisTools.base.YAMLHandle import YAMLLoader
from PyAnalysisTools.AnalysisTools.XSHandle import XSHandle
class DatasetPrinter(object):
def __init__(self, **kwargs):
self.datasets = list(itertools.chain.from_iterable(filter(lambda ... | mit | Python |
7e45b25283f5567dc041fd9008560331c4717765 | create a hierarchically sorted list of downloads | praekelt/jmbo-downloads,praekelt/jmbo-downloads | downloads/views.py | downloads/views.py | from mimetypes import guess_type
from django.http import HttpResponse
from django.utils.encoding import smart_str
from django.utils.translation import ugettext as _
from django.contrib.auth.decorators import login_required
from jmbo.generic.views import GenericObjectList
from downloads.models import Download
def d... | from mimetypes import guess_type
from django.http import HttpResponse
from django.utils.encoding import smart_str
from django.utils.translation import ugettext as _
from django.contrib.auth.decorators import login_required
from jmbo.generic.views import GenericObjectList
from downloads.models import Download
def d... | bsd-3-clause | Python |
51ba4a86c5fa54b16ab85881dcffeb863b1e6499 | Revert "Remove field from model" | dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4 | apps/companyprofile/models.py | apps/companyprofile/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
from filebrowser.fields import FileBrowseField
import reversion
from apps.gallery.models import ResponsiveImage
class Company(models.Model):
IMAGE_FOLDER = "images/companies"
IMAGE_EXTENSIONS = ['.jpg', '.jpeg', '.gif', '... | from django.db import models
from django.utils.translation import ugettext_lazy as _
from filebrowser.fields import FileBrowseField
import reversion
from apps.gallery.models import ResponsiveImage
class Company(models.Model):
IMAGE_FOLDER = "images/companies"
IMAGE_EXTENSIONS = ['.jpg', '.jpeg', '.gif', '... | mit | Python |
5e1c9cf9047d025ee82a56b2b149825349bcded6 | fix on search-index; we should find stuff now | ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website | apps/search/search_indexes.py | apps/search/search_indexes.py | import datetime
from haystack.indexes import *
from haystack import site
from cms.models import Page, Placeholder
class PageIndex(SearchIndex):
text = CharField(document=True)
def prepare(self, obj):
self.prepared_data = super(PageIndex, self).prepare(obj)
placeholders = obj.placeholders.all... | import datetime
from haystack.indexes import *
from haystack import site
from cms.models import Page, Placeholder
class PageIndex(SearchIndex):
text = CharField(document=True)
def prepare(self, obj):
self.prepared_data = super(PageIndex, self).prepare(obj)
placeholders = Placeholder.objects.... | agpl-3.0 | Python |
84dd6785fdcc6c83e1b0969fdeea4359f20e883d | use abs ref to _client | sqlbyme/python-slackclient,slackapi/python-slackclient,piranha/python-slackclient,nosman/python-slackclient,slackhq/python-slackclient,asmithdigital/slack-sounds,llimllib/slackrtm,slackapi/python-slackclient,caseyfw/slack-sounds,mathieu-wang/python-slackclient,caseyfw/slack-sounds,Tolsadus/python-slackclient,asmithdigi... | slackclient/__init__.py | slackclient/__init__.py | from ._client import SlackClient
| from _client import SlackClient
| mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.