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 |
|---|---|---|---|---|---|---|---|---|
1d269506eab765a70bd7a59cd1806d86146ebabc | Fix outdated comment. | RKrahl/photo-tools | photo/idxitem.py | photo/idxitem.py | """Provide the class IdxItem which represents an item in the index.
"""
import os.path
import hashlib
from photo.exif import Exif
from photo.geo import GeoPosition
def _checksum(fname, hashalg):
"""Calculate hashes for a file.
"""
if not hashalg:
return {}
m = { h:hashlib.new(h) for h in hash... | """Provide the class IdxItem which represents an item in the index.
"""
import os.path
import hashlib
from photo.exif import Exif
from photo.geo import GeoPosition
def _checksum(fname, hashalg):
"""Calculate the md5 hash for a file.
"""
if not hashalg:
return {}
m = { h:hashlib.new(h) for h i... | apache-2.0 | Python |
4a526c061dd3e171c587890bf945f9b235eaa638 | bump version | pulilab/django-medialibrary | medialibrary/__init__.py | medialibrary/__init__.py | "A pluggable django app for media management."
__version__ = '1.4.8'
| "A pluggable django app for media management."
__version__ = '1.4.7'
| bsd-3-clause | Python |
d21ff98f92180497d1175b72bbf4343823c16732 | Update Bob.py | eshook/Forest,eshook/Forest | forest/bobs/Bob.py | forest/bobs/Bob.py | """
Copyright (c) 2017 Eric Shook. All rights reserved.
Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
@author: eshook (Eric Shook, eshook@gmail.edu)
@contributors: <Contribute and add your name here!>
"""
# TODO: Replace individual variables with numpy arrays
# ... | """
Copyright (c) 2017 Eric Shook. All rights reserved.
Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
@author: eshook (Eric Shook, eshook@gmail.edu)
@contributors: <Contribute and add your name here!>
"""
# TODO: Replace individual variables with numpy arrays
# ... | bsd-3-clause | Python |
9f7ecf5b575625cf5d18687d12b79b2e21d59fb0 | Increase coverage | geotagx/pybossa,proyectos-analizo-info/pybossa-analizo-info,geotagx/pybossa,harihpr/tweetclickers,OpenNewsLabs/pybossa,jean/pybossa,proyectos-analizo-info/pybossa-analizo-info,jean/pybossa,Scifabric/pybossa,inteligencia-coletiva-lsd/pybossa,inteligencia-coletiva-lsd/pybossa,PyBossa/pybossa,PyBossa/pybossa,OpenNewsLabs/... | test/test_uploader/test_generic_uploader.py | test/test_uploader/test_generic_uploader.py | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2014 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2014 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | agpl-3.0 | Python |
718b7cdad91c22a5359c35a53a41a04caedb0017 | create schedule add data to soar script | elixirhub/events-portal-scraping-scripts | ScheduleAddData.py | ScheduleAddData.py | __author__ = 'chuqiao'
from apscheduler.schedulers.blocking import BlockingScheduler
import EventsPortal
import sys
def scheduleUpdateSolr(sourceUrl,patternUrl,solrUrl):
"""
"""
# logger.info('***Starting update every hour***')
sched = BlockingScheduler()
sched.add_job(EventsPortal.addDataTo... | __author__ = 'chuqiao'
from apscheduler.schedulers.blocking import BlockingScheduler
import logging
logging.basicConfig()
import EventsPortal
import sys
def scheduleUpdateSolr(sourceUrl,patternUrl,solrUrl):
"""
"""
# logger.info('***Starting update every hour***')
sched = BlockingScheduler()
... | mit | Python |
43582e2ce55e374622d68d3a9ef8b0ab2e66a5fb | Update prod config | voer-platform/vp.web,voer-platform/vp.web,voer-platform/vp.web,voer-platform/vp.web | voer/settings/prod.py | voer/settings/prod.py | '''
Created on 16 Dec 2013
@author: huyvq
'''
from base import *
# FOR DEBUG
DEBUG = True
DEVELOPMENT = True
TEMPLATE_DEBUG = DEBUG
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'voer_django',
... | '''
Created on 16 Dec 2013
@author: huyvq
'''
from base import *
# FOR DEBUG
DEBUG = True
DEVELOPMENT = True
TEMPLATE_DEBUG = DEBUG
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'voer_django',
... | agpl-3.0 | Python |
90284acf9490d239bf5ca9e82337b191022c48a0 | build bump | tb0hdan/voiceplay,tb0hdan/voiceplay,tb0hdan/voiceplay,tb0hdan/voiceplay | voiceplay/__init__.py | voiceplay/__init__.py | #-*- coding: utf-8 -*-
""" get version, etc """
__title__ = 'VoicePlay'
__description__ = 'Client-side first music centered voice controlled player'
__version__ = '0.2.3.1'
__author__ = 'Bohdan Turkynewych'
__author_email__ = 'tb0hdan@gmail.com'
__license__ = 'UNLICENSE'
__copyright__ = 'public domain'
__website__ = ... | #-*- coding: utf-8 -*-
""" get version, etc """
__title__ = 'VoicePlay'
__description__ = 'Client-side first music centered voice controlled player'
__version__ = '0.2.3.0'
__author__ = 'Bohdan Turkynewych'
__author_email__ = 'tb0hdan@gmail.com'
__license__ = 'UNLICENSE'
__copyright__ = 'public domain'
__website__ = ... | unlicense | Python |
615643365eac1592867d03834e094247d33467dc | Update common utilities. | MKLab-ITI/reveal-user-annotation | reveal_user_annotation/common/config_package.py | reveal_user_annotation/common/config_package.py | __author__ = 'Georgios Rizos (georgerizos@iti.gr)'
import os
import inspect
import multiprocessing
import reveal_user_annotation
########################################################################################################################
# Configure path related functions.
##############################... | __author__ = 'Georgios Rizos (georgerizos@iti.gr)'
import os
import inspect
import multiprocessing
import reveal_user_annotation
from reveal_user_annotation.common.datarw import get_file_row_generator
###################################################################################################################... | apache-2.0 | Python |
1b4ba2b5dbfa6889d063d73c48d325f670623846 | Set broker URL | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | ukrdc_importer/radar_ukrdc_importer/app.py | ukrdc_importer/radar_ukrdc_importer/app.py | from flask import Flask
from sqlalchemy import event
from radar.database import db
from radar_ukrdc_importer.utils import get_import_user
def create_app():
app = Flask(__name__)
app.config.from_envvar('RADAR_SETTINGS')
# noinspection PyUnresolvedReferences
from radar import models # noqa
db.in... | from flask import Flask
from sqlalchemy import event
from radar.database import db
from radar_ukrdc_importer.utils import get_import_user
def create_app():
app = Flask(__name__)
app.config.from_envvar('RADAR_SETTINGS')
# noinspection PyUnresolvedReferences
from radar import models # noqa
db.in... | agpl-3.0 | Python |
221d0d39edfbf693a509d942e77143520afd314a | Add permissions to groups | MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api | data/management/commands/load_groups.py | data/management/commands/load_groups.py | from django.core.management import BaseCommand
from django.contrib.auth.models import Group, Permission
from users.models import MflUser
class Command(BaseCommand):
def handle(self, *args, **options):
chrio, created = Group.objects.get_or_create(
name="County Health Records Information Office... | from django.core.management import BaseCommand
from django.contrib.auth.models import Group
from users.models import MflUser
class Command(BaseCommand):
def handle(self, *args, **options):
chrio, created = Group.objects.get_or_create(
name="County Health Records Information Officer")
... | mit | Python |
2a742af0fd1b9f33b2b78901a1a4b9a5db4df4c8 | change TableTop.board to be a flat list | IanDCarroll/xox | source/game_table.py | source/game_table.py | class TableTop(object):
def __init__(self):
self.board = [0,0,0,0,0,0,0,0,0]
| class TableTop(object):
def __init__(self):
self.board = [[0,0,0],[0,0,0],[0,0,0]]
| mit | Python |
129e7f300a9356be59860ea93534a57220563a4b | test relies on syminfo.py, which needs CLIBD | xia2/xia2,xia2/xia2 | Handlers/test_CommandLine.py | Handlers/test_CommandLine.py | from __future__ import absolute_import, division, print_function
import pytest
from xia2.Handlers.CommandLine import validate_project_crystal_name
from dials.util import Sorry
def test_validate_project_crystal_name(ccp4):
for value in ("foo_001", "_foo_001", "foo", "_foo_", "_1foo"):
assert validate_pro... | from __future__ import absolute_import, division, print_function
import pytest
from xia2.Handlers.CommandLine import validate_project_crystal_name
from dials.util import Sorry
def test_validate_project_crystal_name():
for value in ("foo_001", "_foo_001", "foo", "_foo_", "_1foo"):
assert validate_project... | bsd-3-clause | Python |
6b7260e717129c08a1e44a42a9468d2003a1b7e3 | Structure update | DarkmatterVale/Blockly-Frame-Generator,DarkmatterVale/Blockly-Frame-Generator | frame_generator.py | frame_generator.py | __author__ = 'Vale Tolpegin'
# Importing relevant classes
import sys, os, re
class frame_generator:
# Initialization method
def init( self, *args, **kwargs ):
pass
# Function that delegates frame file generation for every language that was requested
def generate_frame_files( self, base_di... | __author__ = 'Vale Tolpegin'
import sys, os, re
class frame_generator:
def init( self, *args, **kwargs ):
pass
if __name__ == '__main__':
pass
| apache-2.0 | Python |
ab952b47561edc901efeafd63838c589ee2da2b8 | Fix #578 -- Sputnik had been purging all files on --force, not just the relevant one. | explosion/spaCy,banglakit/spaCy,oroszgy/spaCy.hu,recognai/spaCy,recognai/spaCy,oroszgy/spaCy.hu,aikramer2/spaCy,Gregory-Howard/spaCy,explosion/spaCy,Gregory-Howard/spaCy,oroszgy/spaCy.hu,spacy-io/spaCy,spacy-io/spaCy,aikramer2/spaCy,honnibal/spaCy,banglakit/spaCy,recognai/spaCy,raphael0202/spaCy,explosion/spaCy,banglak... | spacy/download.py | spacy/download.py | from __future__ import print_function
import sys
import sputnik
from sputnik.package_list import (PackageNotFoundException,
CompatiblePackageNotFoundException)
from . import about
from . import util
def download(lang, force=False, fail_on_exist=True):
try:
pkg = sputni... | from __future__ import print_function
import sys
import sputnik
from sputnik.package_list import (PackageNotFoundException,
CompatiblePackageNotFoundException)
from . import about
from . import util
def download(lang, force=False, fail_on_exist=True):
if force:
sputnik... | mit | Python |
9cae7682a8a74f52de1ab44d30f604334416ddb8 | implement eightball (#122) | GLolol/PyLink | plugins/games.py | plugins/games.py | """
games.py: Create a bot that provides game functionality (dice, 8ball, etc).
"""
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import random
import utils
from log import log
import world
gameclient = utils.registerService("Games", manipulatable=True)
reply = gam... | """
games.py: Create a bot that provides game functionality (dice, 8ball, etc).
"""
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import random
import utils
from log import log
import world
gameclient = utils.registerService("Games", manipulatable=True)
reply = gam... | mpl-2.0 | Python |
1f8014a68ac8d0b10c990405370edeaf369cb674 | Update the description | rahulbohra/Python-Basic | 32_filtering_the_number.py | 32_filtering_the_number.py | # Looking for a needle in hackstack, in a loop
data = [12,4,21,56,01,42,76,93]
print data
print '\nScript starts\n'
for number in data:
if number > 50:
print 'Number greater then 50 is ', number
print '\nScript Ends'
| data = [12,4,21,56,01,42,76,93]
print data
print '\nScript starts\n'
for number in data:
if number > 50:
print 'Number greater then 50 is ', number
print '\nScript Ends'
| mit | Python |
73553a2c6817addccff5a0e90cd32993ee1ea69b | Update ngrokwebhook.py | jbogarin/ciscosparkapi | examples/ngrokwebhook.py | examples/ngrokwebhook.py | #sample script that reads ngrok info from localhost:4040 and create Cisco Spark Webhook
#typicall ngrok is called "ngrok http 8080" to redirect localhost:8080 to Internet
#accesible ngrok url
#
#To use script simply launch ngrok, then launch this script. After ngrok is killed, run this
#script a second time to re... | #sample script that reads ngrok info from localhost:4040 and create Cisco Spark Webhook
#typicall ngrok is called "ngrok http 8080" to redirect localhost:8080 to Internet
#accesible ngrok url
#
#To use script simply launch ngrok, then launch this script. After ngrok is killed, run this
#script a second time to re... | mit | Python |
1cbbd3fe890afdeb3f0df7104ba151d7c5f33ef9 | bump version number | laowantong/mocodo,laowantong/mocodo,laowantong/mocodo,laowantong/mocodo,laowantong/mocodo | mocodo/version_number.py | mocodo/version_number.py | version = u"2.0.19" | version = u"2.0.18" | mit | Python |
eccf8d2d9784554b85b5d446fe8737eb29600efb | Switch test_example_hdf_io to pytest | ericdill/databroker,ericdill/databroker | databroker/tests/test_example_hdf_io.py | databroker/tests/test_example_hdf_io.py | from ..examples.hdf_io import hdf_data_io
from metadatastore.test.utils import mds_setup, mds_teardown
from filestore.test.utils import fs_setup, fs_teardown
from databroker import DataBroker as db, get_events
from numpy.testing.utils import assert_array_equal
def setup_module(module):
fs_setup()
mds_setup()
... | from ..examples.hdf_io import hdf_data_io
from metadatastore.test.utils import mds_setup, mds_teardown
from filestore.test.utils import fs_setup, fs_teardown
from databroker import DataBroker as db, get_events
from numpy.testing.utils import assert_array_equal
def setup_module():
fs_setup()
mds_setup()
def ... | bsd-3-clause | Python |
d297cb7435f94ab6e086f83c09faeafb6f8cf86e | allow hyphens and underscores in form urls | dimagi/commcare-hq,SEL-Columbia/commcare-hq,dimagi/commcare-hq,SEL-Columbia/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttara... | couchforms/urls.py | couchforms/urls.py | from django.conf.urls.defaults import *
urlpatterns = patterns('',
url(r'^post/?$', 'couchforms.views.post', name='xform_post'),
url(r'^download/(?P<instance_id>[\w_-]+)/(?P<attachment>[\w.-_]+)?$',
'couchforms.views.download_attachment', name='xform_attachment'),
)
| from django.conf.urls.defaults import *
urlpatterns = patterns('',
url(r'^post/?$', 'couchforms.views.post', name='xform_post'),
url(r'^download/(?P<instance_id>\w+)/(?P<attachment>[\w.-_]+)?$',
'couchforms.views.download_attachment', name='xform_attachment'),
)
| bsd-3-clause | Python |
27e6b067aea3cc969911d5c0071e4accfd77b7a1 | Update main.py | Python-IoT/Smart-IoT-Planting-System,Python-IoT/Smart-IoT-Planting-System | device/src/main.py | device/src/main.py | #This is the file executing while STM32 MCU bootup, and in this file,
#it will call other functions to fullfill the project.
#Communication module: LoRa.
#Communication method with gateway via LoRa.
#Uart port drive LoRa module.
#Parse JSON between device and gateway via LoRa channel.
#LoRa module: E32-TTL-100
#Pin s... | #This is the file executing while STM32 MCU bootup, and in this file,
#it will call other functions to fullfill the project.
#Communication module: LoRa.
#Communication method with gateway via LoRa.
#Uart port drive LoRa module.
#Parse JSON between device and gateway via LoRa channel.
#LoRa module: E32-TTL-100
#Pin s... | mit | Python |
be5263d7aef7651bfe0b0992998bdb67655b051f | Remove an unused helper | Meerkov/fireplace,smallnamespace/fireplace,butozerca/fireplace,beheh/fireplace,smallnamespace/fireplace,Ragowit/fireplace,Meerkov/fireplace,butozerca/fireplace,jleclanche/fireplace,oftc-ftw/fireplace,liujimj/fireplace,Ragowit/fireplace,amw2104/fireplace,liujimj/fireplace,amw2104/fireplace,oftc-ftw/fireplace,NightKev/fi... | fireplace/cards/utils.py | fireplace/cards/utils.py | import random
import fireplace.cards
from ..actions import *
from ..enums import CardClass, CardType, GameTag, Race, Rarity, Zone
from ..events import *
from ..targeting import *
def hand(func):
"""
@hand helper decorator
The decorated event listener will only listen while in the HAND Zone
"""
func.zone = Zone.H... | import random
import fireplace.cards
from ..actions import *
from ..enums import CardClass, CardType, GameTag, Race, Rarity, Zone
from ..events import *
from ..targeting import *
def hand(func):
"""
@hand helper decorator
The decorated event listener will only listen while in the HAND Zone
"""
func.zone = Zone.H... | agpl-3.0 | Python |
f080b9b05dc36fd1ef30c32f870f6233db728d84 | Add assets file. | jledbetter/openhatch,openhatch/oh-mainline,mzdaniel/oh-mainline,vipul-sharma20/oh-mainline,ojengwa/oh-mainline,ehashman/oh-mainline,sudheesh001/oh-mainline,nirmeshk/oh-mainline,heeraj123/oh-mainline,vipul-sharma20/oh-mainline,ojengwa/oh-mainline,moijes12/oh-mainline,willingc/oh-mainline,willingc/oh-mainline,heeraj123/o... | mysite/assets.py | mysite/assets.py | import django_assets
# Django Assets <http://github.com/miracle2k/django-assets>
# helps us bundle our assets, i.e., JavaScript and CSS,
# so they load faster.
# So django_assets doesn't feel bad creating files
ASSETS_AUTO_CREATE=True
# See documentation at <http://elsdoerfer.name/docs/django-assets/settings.html#a... | import django_assets
# Django Assets <http://github.com/miracle2k/django-assets>
# helps us bundle our assets, i.e., JavaScript and CSS,
# so they load faster.
# So django_assets doesn't feel bad creating files
ASSETS_AUTO_CREATE=True
# See documentation at <http://elsdoerfer.name/docs/django-assets/settings.html#a... | agpl-3.0 | Python |
a8795d77d3f1a3586de83b92541848d2f12e161f | Clean example script. | alexis-roche/niseg,arokem/nipy,alexis-roche/register,arokem/nipy,alexis-roche/register,alexis-roche/nipy,alexis-roche/nipy,bthirion/nipy,bthirion/nipy,nipy/nipy-labs,nipy/nireg,bthirion/nipy,arokem/nipy,alexis-roche/nireg,nipy/nipy-labs,alexis-roche/register,alexis-roche/nireg,nipy/nireg,arokem/nipy,bthirion/nipy,alexi... | examples/neurospin/onesample_group.py | examples/neurospin/onesample_group.py | import numpy as np
import nipy.neurospin.statistical_mapping as sm
from nipy.io.imageformats import Nifti1Image as Image
def remake_images():
# Get group data
f = np.load('data/offset_002.npz')
data, vardata, xyz = f['mat'], f['var'], f['xyz']
dX = xyz[0,:].max() + 1
dY = xyz[1,:].max() + 1
... | import numpy as np
import nipy.neurospin.statistical_mapping as sm
from nipy.io.imageformats import Nifti1Image as Image
def remake_images():
# Get group data
f = np.load('data/offset_002.npz')
data, vardata, xyz = f['mat'], f['var'], f['xyz']
dX = xyz[0,:].max() + 1
dY = xyz[1,:].max() + 1
... | bsd-3-clause | Python |
9da42e47effc1d61a36c7936ea9fe31adb1c1033 | raise version to dev | trichter/qopen | qopen/__init__.py | qopen/__init__.py | from qopen.core import run, __doc__
__version__ = '1.4-dev'
| from qopen.core import run, __doc__
__version__ = '1.3'
| mit | Python |
0b534c54e4fa5b7d0d558159b63a7cc0bf7f5393 | Bump @graknlabs | lolski/grakn,graknlabs/grakn,graknlabs/grakn,graknlabs/grakn,graknlabs/grakn,lolski/grakn,lolski/grakn,lolski/grakn | dependencies/graknlabs/dependencies.bzl | dependencies/graknlabs/dependencies.bzl | #
# Licensed to the Apache Software Foundation (ASF) 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... | #
# Licensed to the Apache Software Foundation (ASF) 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... | agpl-3.0 | Python |
8deccaa046832afbe8c43ea38d179dd8706754ef | use 'b' prefix, six.b not required | simudream/spec,frol/spec,bitprophet/spec | spec/trap.py | spec/trap.py | """
Test decorator for capturing stdout/stderr/both.
Based on original code from Fabric 1.x, specifically:
* fabric/tests/utils.py
* as of Git SHA 62abc4e17aab0124bf41f9c5f9c4bc86cc7d9412
Though modifications have been made since.
"""
import sys
from functools import wraps
import six
from six import BytesIO as IO
... | """
Test decorator for capturing stdout/stderr/both.
Based on original code from Fabric 1.x, specifically:
* fabric/tests/utils.py
* as of Git SHA 62abc4e17aab0124bf41f9c5f9c4bc86cc7d9412
Though modifications have been made since.
"""
import sys
from functools import wraps
import six
from six import BytesIO as IO
... | mit | Python |
d0fc327eb7b3ed798b02a654bb527d299b0245c9 | add unicode type | jlutz777/FreeStore,jlutz777/FreeStore,jlutz777/FreeStore | run_freestore.py | run_freestore.py | import bottle
from bottle import HTTPError
from bottle.ext import sqlalchemy
from sqlalchemy import create_engine, Column, Integer, Sequence, String, Unicode
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
#engine = create_engine('postgresql://postgres:passw0rd@localhost:5432/freestor... | import bottle
from bottle import HTTPError
from bottle.ext import sqlalchemy
from sqlalchemy import create_engine, Column, Integer, Sequence, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
#engine = create_engine('postgresql://postgres:passw0rd@localhost:5432/freestore', echo=... | mit | Python |
1595b20d09576e2b686b376884e45b82c2018006 | Update test cases (#463) | exercism/xpython,exercism/xpython,N-Parsons/exercism-python,N-Parsons/exercism-python,behrtam/xpython,jmluy/xpython,jmluy/xpython,mweb/python,mweb/python,behrtam/xpython,pheanex/xpython,exercism/python,smalley/python,smalley/python,pheanex/xpython,exercism/python | exercises/allergies/allergies_test.py | exercises/allergies/allergies_test.py | import unittest
from allergies import Allergies
# Python 2/3 compatibility
if not hasattr(unittest.TestCase, 'assertCountEqual'):
unittest.TestCase.assertCountEqual = unittest.TestCase.assertItemsEqual
# test cases adapted from `x-common//canonical-data.json` @ version: 1.0.0
class AllergiesTests():
def te... | import unittest
from allergies import Allergies
class AllergiesTests(unittest.TestCase):
def test_no_allergies_means_not_allergic(self):
allergies = Allergies(0)
self.assertFalse(allergies.is_allergic_to('peanuts'))
self.assertFalse(allergies.is_allergic_to('cats'))
self.assertFal... | mit | Python |
c0d71164e1a659008426d53dae384e83bbcdabb6 | Use instance.summary in description | whiskyechobravo/pelican-open_graph | open_graph.py | open_graph.py | # -*- coding: utf-8 -*- #
"""
Open Graph
==========
This plugin adds Open Graph Protocol tags to articles.
Use like this in your template:
.. code-block:: jinja2
{% for tag in article.ogtags %}
<meta property="{{tag[0]}}" content="{{tag[1]|striptags|e}}" />
{% endfor %}
"""
from __future__ import u... | # -*- coding: utf-8 -*- #
"""
Open Graph
==========
This plugin adds Open Graph Protocol tags to articles.
Use like this in your template:
.. code-block:: jinja2
{% for tag in article.ogtags %}
<meta property="{{tag[0]}}" content="{{tag[1]|striptags|e}}" />
{% endfor %}
"""
from __future__ import u... | agpl-3.0 | Python |
79500a7cefbbb25454284586a20ab0e7bb61d195 | Update sphinx Directive reference | dials/dials,dials/dials,dials/dials,dials/dials,dials/dials | doc/sphinx/button.py | doc/sphinx/button.py | from __future__ import absolute_import, division
from docutils import nodes
import jinja2
from docutils.parsers.rst import Directive
from docutils.parsers.rst.directives import unchanged
BUTTON_TEMPLATE = jinja2.Template(u"""
<a href="{{ link }}">
<span class="button">{{ text }}</span... | from __future__ import absolute_import, division
from docutils import nodes
import jinja2
from sphinx.util.compat import Directive
from docutils.parsers.rst.directives import unchanged
BUTTON_TEMPLATE = jinja2.Template(u"""
<a href="{{ link }}">
<span class="button">{{ text }}</span>
... | bsd-3-clause | Python |
054f057bfe08505096f8735d462a9ba23e2d889c | increase verbosity | dhardtke/pyEncode,dhardtke/pyEncode,dhardtke/pyEncode | run_tests.py | run_tests.py | import os
import sys
import unittest
sys.path.append(os.path.realpath(__file__) + "/app")
suite = unittest.TestLoader().discover("tests")
results = unittest.TextTestRunner(verbosity=3).run(suite)
if len(results.errors) > 0 or len(results.failures) > 0:
sys.exit(1)
sys.exit()
| import os
import sys
import unittest
sys.path.append(os.path.realpath(__file__) + "/app")
suite = unittest.TestLoader().discover("tests")
results = unittest.TextTestRunner(verbosity=2).run(suite)
if len(results.errors) > 0 or len(results.failures) > 0:
sys.exit(1)
sys.exit()
| mit | Python |
c52e55dfc739fe78b9fe36d257fcb154528de27c | Fix space. | ulule/django-safety,ulule/django-safety | safety/mixins.py | safety/mixins.py | # -*- coding: utf-8 -*-
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.utils.timezone import now
from .models import Session
class SessionMixin(object):
def get_queryset(self):
qs = Session.objects.filter(expire_date__gt=now(), u... |
# -*- coding: utf-8 -*-
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.utils.timezone import now
from .models import Session
class SessionMixin(object):
def get_queryset(self):
qs = Session.objects.filter(expire_date__gt=now(), ... | mit | Python |
ed58091b7adb2a1d75c34ae961f75ef70c62d1d9 | Update testHardware.py close #51 | oSoc17/code9000,oSoc17/code9000,oSoc17/code9000,oSoc17/code9000,oSoc17/code9000,oSoc17/code9000 | hardware/testHardware.py | hardware/testHardware.py | # Libraries
import RPi.GPIO as GPIO
import requests
import picamera
from time import gmtime, strftime, sleep
#Constants
PIR_SENSOR = 13
BOUNCE_TIME = 100
LATITUDE = 50.8503 # Change this to real location
LONGITUDE = 4.3517
API_URL = "develop.birds.today/api/observations"
camera = picamera.PiCamera()
def getTime():
... | # Libraries
import RPi.GPIO as GPIO
import requests
import picamera
from time import gmtime, strftime
#Constants
PIR_SENSOR = 13
LATITUDE = 50.8503 # Change this to real location
LONGITUDE = 4.3517
def getTime():
return strftime('%Y-%m-%d %H:%M:%S', gmtime())
# Triggered when interrupt detected from the PIR sensor
... | mit | Python |
aa2e72e5a6d9f9626cc9876c3b5b15adae293569 | add plot points | 4bic-attic/data_viz | rw_visual.py | rw_visual.py | import matplotlib.pyplot as plt
from random_walk import RandomWalk
#keep making random walks as long as the program is active
while True:
#make arandom walk and plt the points
rw = RandomWalk(50000)
rw.fill_walk()
#Plot points and show the plot
point_numbers = list(range(rw.num_points))
plt.s... | import matplotlib.pyplot as plt
from random_walk import RandomWalk
#keep making random walks as long as the program is active
while True:
#make arandom walk and plt the points
rw = RandomWalk()
rw.fill_walk()
point_numbers = list(range(rw.num_points))
plt.scatter(rw.x_values, rw.y_values, c=point... | mit | Python |
b822c91fa9c3228e9f6b3bff2a122bfc07fc89cb | improve spectrogram test | Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide | timeside/tests/api/test_pipe_spectrogram.py | timeside/tests/api/test_pipe_spectrogram.py | # -*- coding: utf-8 -*-
import os
from timeside.core import *
from timeside.api import *
from timeside.decoder import *
from timeside.grapher import *
sample_dir = '../samples'
img_dir = '../results/img'
if not os.path.exists(img_dir):
os.mkdir(img_dir)
test_dict = {'sweep.wav': 'spec_wav.png',
'swee... | # -*- coding: utf-8 -*-
import os
from timeside.core import *
from timeside.api import *
from timeside.decoder import *
from timeside.grapher import *
image_file = '../results/img/spectrogram.png'
source = os.path.join(os.path.dirname(__file__), "../samples/sweep.wav")
decoder = FileDecoder(source)
spectrogram = Sp... | agpl-3.0 | Python |
632ef6f1f1a8382e757459ed98fc8beb0a2e9eb9 | use python3 from virtualenv | hronecviktor/twmail,hronecviktor/twmail | twmail.py | twmail.py | #!python3
from flask import Flask
from flask import request
app = Flask(__name__)
@app.route('/', methods=['GET'])
def hello_world():
return 'Hi there'
if __name__ == '__main__':
app.run()
| #!/usr/bin/env python3
from flask import Flask
from flask import request
app = Flask(__name__)
@app.route('/', methods=['GET'])
def hello_world():
return 'Hi there'
if __name__ == '__main__':
app.run()
| mit | Python |
e0f442e34ecd7e006679d2520f426e88ccc3b626 | add factories for meal application | savoirfairelinux/santropol-feast,madmath/sous-chef,savoirfairelinux/sous-chef,savoirfairelinux/sous-chef,savoirfairelinux/santropol-feast,madmath/sous-chef,madmath/sous-chef,savoirfairelinux/santropol-feast,savoirfairelinux/sous-chef | django/santropolFeast/meal/factories.py | django/santropolFeast/meal/factories.py | # coding=utf-8
import factory
from meal.model import Meal, Ingredient, Allergy
class MealFactory(factory.DjangoModelFactory):
class Meta:
model = Meal
name = "Tomato Soupe"
description = "A Simple Tomato Soupe"
size = "R"
@classmethod
def __init__(self, **kwargs):
name = kwa... | # coding=utf-8
import factory
from meal.model import Meal, Ingredient, Allergy
class MealFactory(factory.DjangoModelFactory):
class Meta:
model = Meal
nom = "Tomato Soupe"
description = "A Simple Tomato Soupe"
Ingredients = "Tomato"
class IngredientFactory(factory.DjangoModelFactory):
... | agpl-3.0 | Python |
84c47634c9ef7d5021d549da7704863e69615c60 | Add put() method in BinarySearchTree class | bowen0701/algorithms_data_structures | ds_binary_search_tree.py | ds_binary_search_tree.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
class TreeNode(object):
"""Tree node class collects helper functions for BinarySearchTree."""
def __init__(self, key, value,
left=None, right=None, parent=None):
self.key = ke... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
class TreeNode(object):
"""Tree node class collects helper functions for BinarySearchTree."""
def __init__(self, key, value,
left=None, right=None, parent=None):
self.key = ke... | bsd-2-clause | Python |
356ed840925cb2bf63bc03092e4989b97dd61bdb | Remove superfluous `print` | claymation/django-zendesk | djzendesk/views.py | djzendesk/views.py | import base64
import logging
from django.conf import settings
from django.http import HttpResponse, HttpResponseNotAllowed, HttpResponseBadRequest, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from djzendesk.signals import target_callback_received
def is_authenticated(request, username... | import base64
import logging
from django.conf import settings
from django.http import HttpResponse, HttpResponseNotAllowed, HttpResponseBadRequest, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from djzendesk.signals import target_callback_received
def is_authenticated(request, username... | bsd-3-clause | Python |
47ba50d73dbaae2818fb177d9c2417e182d2b53d | Fix mistake in implementation of Board squares | djshuckerow/GameOfPebbles | PebbleGame/src/Board.py | PebbleGame/src/Board.py | '''
The Board class represents a board game containing n columns,
p pebbles per square, and one row per player. It provides functions
necessary for moving pebbles and copying the current game state.
'''
__author__ = "Carlos Lemus, David Shuckerow"
__license__ = "MIT"
class Board(object):
"""
:param n: number ... | '''
The Board class represents a board game containing n columns,
p pebbles per square, and one row per player. It provides functions
necessary for moving pebbles and copying the current game state.
'''
__author__ = "Carlos Lemus, David Shuckerow"
__license__ = "MIT"
class Board(object):
"""
:param n: number ... | mit | Python |
e7eab95e6739b25e5b2fe3d2358ae1aaaa543854 | save "CRUDDII/CRUDDII_ALL_n100_p91_th.txt" to sparseData | ameenetemady/DeepPep,ameenetemady/DeepPep,ameenetemady/DeepPep | DeepPep/mySprsInput.py | DeepPep/mySprsInput.py | #!/usr/bin/env python3.5
# run parameters: CRUDDII/CRUDDII_ALL_n100_p91_th.txt CRUDDII/CRUDDII_ALL_n100_p91.1n.txt
import os
import sys
import numpy as np
import csv
#X=np.zeros((400,50104), dtype=np.int_)
def sparseWriteLineToFiles(strLine, bfList, lineId):
currProtId=0
currProtStart=0
isCurrProtEmpty=Tr... | #!/usr/bin/env python3.5
# run parameters: CRUDDII/CRUDDII_ALL_n100_p91_th.txt CRUDDII/CRUDDII_ALL_n100_p91.1n.txt
import os
import sys
import numpy as np
import csv
#X=np.zeros((400,50104), dtype=np.int_)
def sparseWriteLineToFiles(strLine, bfList, lineId):
currProtId=0
currProtStart=0
isCurrProtEmpty=Tr... | apache-2.0 | Python |
59eac0d8dba2f0aca43cd3df2777897079a2368e | Use 4chan's api | Exceen/4chan-downloader | thread-watcher.py | thread-watcher.py | #!/usr/bin/python
from itertools import chain
from urllib import request
import argparse
import json
import logging
import os
# TODO
# add argument to have something like vg/monster-hunter/ and inside that dir all threads separated by their id
# ./thread-watcher.py -b vg -q mhg -f queue.txt -n "Monster Hunter"
log ... | #!/usr/bin/python
from urllib import request
import argparse
import logging
import os
import re
# TODO
# add argument to have something like vg/monster-hunter/ and inside that dir all threads separated by their id
# ./thread-watcher.py -b vg -q mhg -f queue.txt -n "Monster Hunter"
log = logging.getLogger('thread-wa... | mit | Python |
2ce24f423ac1573c6c4b1a7a19672a84620042b5 | Remove old docstring | mopidy/mopidy-beets | mopidy_beets/__init__.py | mopidy_beets/__init__.py | from __future__ import unicode_literals
import os
from mopidy import ext, config
from mopidy.exceptions import ExtensionError
__version__ = '1.0.2'
class BeetsExtension(ext.Extension):
dist_name = 'Mopidy-Beets'
ext_name = 'beets'
version = __version__
def get_default_config(self):
conf_... | from __future__ import unicode_literals
import os
from mopidy import ext, config
from mopidy.exceptions import ExtensionError
__doc__ = """A extension for playing music from Beets.
This extension handles URIs starting with ``beets:`` and enables you,
to play music from Beets web service.
See https://github.com/dz0... | mit | Python |
d27a1e98662b1731def649e936395c9e50979125 | Update crop.py | TheNathanBlack/moviepy,Zulko/moviepy,misterbisson/moviepy,carlodri/moviepy,deniszgonjanin/moviepy,bertyhell/moviepy,ssteo/moviepy,mcanthony/moviepy,Vicaris/ModPro,benroeder/moviepy,LunarLanding/moviepy,kerstin/moviepy | moviepy/video/fx/crop.py | moviepy/video/fx/crop.py | def crop(clip, x1=None, y1=None, x2=None, y2=None,
width = None, height=None,
x_center= None, y_center=None):
"""
Returns a new clip in which just a rectangular subregion of the
original clip is conserved. x1,y1 indicates the top left corner and
x2,y2 is the lower right corner of the c... | def crop(clip, x1=None, y1=None, x2=None, y2=None,
width = None, height=None,
x_center= None, y_center=None):
"""
Returns a new clip in which just a rectangular subregion of the
original clip is conserved. x1,y1 indicates the top left corner and
x2,y2 is the lower right corner of the c... | mit | Python |
832163eca4b723e8c66b93108de71809a1a944cc | Remove hardcoded start and end dates | AlexFridman/visits-detector | visits_detector/scripts/mr_emulator_demo.py | visits_detector/scripts/mr_emulator_demo.py | import argparse
import datetime
import json
import sys
from visits_detector.core import FilterAndMapToIndexMapper, ExtractEventsReducer
from visits_detector.core.components.params import EventExtractionStageParams
from visits_detector.core.helpers.geo_index import build_geo_index_from_point_index
from visits_detector.... | import argparse
import datetime
import json
import sys
from visits_detector.core import FilterAndMapToIndexMapper, ExtractEventsReducer
from visits_detector.core.components.params import EventExtractionStageParams
from visits_detector.core.helpers.geo_index import build_geo_index_from_point_index
from visits_detector.... | mit | Python |
3fd6886ace3756c9e05ae798a6d1252e31d35c94 | Adjust tolerandce of sampling tests | poliastro/poliastro | tests/tests_twobody/test_sampling.py | tests/tests_twobody/test_sampling.py | from functools import partial
import numpy as np
from astropy import units as u
from astropy.tests.helper import assert_quantity_allclose
from hypothesis import example, given, settings, strategies as st
from poliastro.twobody.sampling import sample_closed
angles = partial(st.floats, min_value=-2 * np.pi, max_value=... | from functools import partial
import numpy as np
from astropy import units as u
from astropy.tests.helper import assert_quantity_allclose
from hypothesis import example, given, settings, strategies as st
from poliastro.twobody.sampling import sample_closed
angles = partial(st.floats, min_value=-2 * np.pi, max_value=... | mit | Python |
7c3ac5adc33d2048f28a96d8145e71a4c12518cc | Set base version to 1.6 | etalab/udata,opendatateam/udata,opendatateam/udata,opendatateam/udata,etalab/udata,etalab/udata | udata/__init__.py | udata/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
uData
'''
from __future__ import unicode_literals
__version__ = '1.6.0.dev'
__description__ = 'Open data portal'
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
uData
'''
from __future__ import unicode_literals
__version__ = '1.5.1.dev'
__description__ = 'Open data portal'
| agpl-3.0 | Python |
0e20f9fe0dd239cb2fd0c55e7b901861a61d18ad | simplify and remove unnecessary code | stoewer/nixpy,stoewer/nixpy | nix/util/find.py | nix/util/find.py | # Copyright (c) 2014, German Neuroinformatics Node (G-Node)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of the Project.
from __future__ import absolute_import
import nix... | # Copyright (c) 2014, German Neuroinformatics Node (G-Node)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of the Project.
from __future__ import absolute_import
import nix... | bsd-3-clause | Python |
8a553df5d6e11b346a4cabf9ac137ce5c2910fa7 | install just with `python -m jupyterdrive` | jupyter/jupyter-drive,jupyter/jupyter-drive,jupyter/jupyter-drive,Carreau/jupyter-drive,Carreau/jupyter-drive | jupyterdrive/__init__.py | jupyterdrive/__init__.py |
import IPython
import IPython.html.nbextensions as nbe
from IPython.utils.path import locate_profile
import sys
import os
import os.path
import json
import io
from IPython.config import Config, JSONFileConfigLoader, ConfigFileNotFound
def install(profile='default', symlink=False):
dname = os.path.dirname(__fi... |
import IPython
import IPython.html.nbextensions as nbe
import sys
import os
import os.path
def install(profile='default', symlink=False):
dname = os.path.dirname(__file__)
nbe.install_nbextension(os.path.join(dname,'gdrive'), symlink=symlink)
if __name__ == '__main__':
install()
| bsd-2-clause | Python |
2c1fe59f793ce6acfcf1cf85901d49739af10534 | fix typo in crashtest security parser | rackerlabs/django-DefectDojo,OWASP/django-DefectDojo,OWASP/django-DefectDojo,rackerlabs/django-DefectDojo,OWASP/django-DefectDojo,rackerlabs/django-DefectDojo,OWASP/django-DefectDojo,rackerlabs/django-DefectDojo,OWASP/django-DefectDojo | dojo/tools/crashtest_security/parser.py | dojo/tools/crashtest_security/parser.py | __author__ = "phylu"
from defusedxml import ElementTree as ET
from dojo.models import Finding
class CrashtestSecurityXmlParser(object):
"""
The objective of this class is to parse an xml file generated by the crashtest security suite.
@param xml_output A proper xml generated by the crashtest security su... | __auther__ = "phylu"
from defusedxml import ElementTree as ET
from dojo.models import Finding
class CrashtestSecurityXmlParser(object):
"""
The objective of this class is to parse an xml file generated by the crashtest security suite.
@param xml_output A proper xml generated by the crashtest security su... | bsd-3-clause | Python |
a021f279341eb15c17597200d4bbe97a98034c54 | Remove sensitive information from the example | FederatedAI/FATE,FederatedAI/FATE,FederatedAI/FATE | fate_flow/examples/test_inference.py | fate_flow/examples/test_inference.py | # -*-coding:utf8 -*-
import json
import requests
import time
import uuid
import datetime
import time
ids = ["18576635456", "13512345432"]
url1 = "http://127.0.0.1:8059/federation/1.0/inference"
for i in range(2):
request_data_tmp = {
"head": {
"serviceId": "test_model_service",
"... | # -*-coding:utf8 -*-
import json
import requests
import time
import uuid
import datetime
import time
ids = ["18576635456", "13512345432"]
url1 = "http://172.16.153.71:8059/federation/1.0/inference"
for i in range(2):
request_data_tmp = {
"head": {
"serviceId": "test_model_service",
... | apache-2.0 | Python |
5b8e2d975962220ce4908a39607ac4d9a51d7545 | update project url in comment | Uname-a/knife_scraper,Uname-a/knife_scraper,Uname-a/knife_scraper | pytest_run.py | pytest_run.py | #!/usr/bin/env python
# coding=utf-8
"""This is a script for running pytest from the command line.
This script exists so that the project directory gets added to sys.path, which
prevents us from accidentally testing the globally installed willie version.
pytest_run.py
Copyright 2013, Ari Koivula, <ari@koivu.la>
Licen... | #!/usr/bin/env python
# coding=utf-8
"""This is a script for running pytest from the command line.
This script exists so that the project directory gets added to sys.path, which
prevents us from accidentally testing the globally installed willie version.
pytest_run.py
Copyright 2013, Ari Koivula, <ari@koivu.la>
Licen... | mit | Python |
e9ce3ed024cd12a89200498aab7bc4920e7100b9 | change Admin model registrations to newer way using decorators | arturtamborski/arturtamborskipl,arturtamborski/arturtamborskipl | blog/admin.py | blog/admin.py | from django.contrib import admin
from .models import Tag, Category, Article
@admin.register(Tag)
class TagAdmin(admin.ModelAdmin):
ordering = ('name',)
list_display = ('id', 'name',)
search_fields = ('id', 'name',)
@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
ordering = ('name',)
... | from django.contrib import admin
from . import models as blog
class TagAdmin(admin.ModelAdmin):
ordering = ('name',)
list_display = ('id', 'name',)
search_fields = ('id', 'name',)
class CategoryAdmin(admin.ModelAdmin):
ordering = ('name',)
list_display = ('id', 'name',)
search_fields = ('id',... | mit | Python |
fa29356863f7912cdf84bb884719923155de7d94 | Update descitption of Accuracy | RobertKleinkauf/pyVienna | vienna.py | vienna.py | import RNA
def getBPPM(sequence, structure = "", bppm_cutoff = 0.00001):
"""
Requires ViennaRNAtools Python module
Returns the base pair probability matrix using Vienna pf_fold, get_pr and free_pf_arrays functions.
returns upper triangular matrix, whose entries exceed a threshold
"""
... | import RNA
def getBPPM(sequence, structure = "", bppm_cutoff = 0.00001):
"""
Requires ViennaRNAtools Python module
Returns the base pair probability matrix using Vienna pf_fold, get_pr and free_pf_arrays functions.
returns upper triangular matrix, whose entries exceed a threshold
"""
... | mit | Python |
aefd70ce490d3a0673b6b82c6efb1dd046bcf46a | Add admin interface for StockItemLabel | SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree | InvenTree/label/admin.py | InvenTree/label/admin.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from .models import StockItemLabel
class StockItemLabelAdmin(admin.ModelAdmin):
list_display = ('name', 'description', 'label')
admin.site.register(StockItemLabel, StockItemLabelAdmin)
| from django.contrib import admin
# Register your models here.
| mit | Python |
31e5d9874d1376ce7732dc5bd5271433f9160684 | Remove unnecessary comment | jacebrowning/gitman | gitman/__init__.py | gitman/__init__.py | """Package for GitMan."""
from pkg_resources import DistributionNotFound, get_distribution
from .commands import delete as uninstall
from .commands import display as list
from .commands import init, install, lock, update
try:
__version__ = get_distribution("gitman").version
except DistributionNotFound:
__ver... | """Package for GitMan."""
from pkg_resources import DistributionNotFound, get_distribution
from .commands import delete as uninstall # pylint: disable=redefined-builtin
from .commands import display as list
from .commands import init, install, lock, update
try:
__version__ = get_distribution("gitman").version
e... | mit | Python |
0416a0af4cc090a04df535f736f8efae8a113144 | remove obsolete default kwarg from migration | dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | custom/ilsgateway/migrations/0005_add_pending_reporting_data_recalculation.py | custom/ilsgateway/migrations/0005_add_pending_reporting_data_recalculation.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('locations', '0001_initial'),
('ilsgateway', '0004_merge'),
]
operations = [
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('locations', '0001_initial'),
('ilsgateway', '0004_merge'),
]
operations = [
... | bsd-3-clause | Python |
914ed1a63bf19ed45dc4c79378d4424b8ace84f6 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/2b1dc458cc7cecee7f8b19b178f726a751f62943. | tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,paolodedios/tensorflow,Intel-Corporation/tensorflow,yongtang/tensorflow,Intel-tensorflow/tensorflow,tensor... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "2b1dc458cc7cecee7f8b19b178f726a751f62943"
TFRT_SHA256 = "6355f78c948bb5d55be21003008e... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "68930096839ac6c0c53eec900503ff1e572156e9"
TFRT_SHA256 = "d1c7db16fd9fbd89ce6e0e527a52... | apache-2.0 | Python |
f0fa5e30b94ecfef8d5c86946e94587c604e2315 | Fix PEP8 in app_with_config.py | rnixx/kivy,akshayaurora/kivy,inclement/kivy,kivy/kivy,Cheaterman/kivy,kivy/kivy,rnixx/kivy,Cheaterman/kivy,matham/kivy,bionoid/kivy,LogicalDash/kivy,KeyWeeUsr/kivy,LogicalDash/kivy,akshayaurora/kivy,bionoid/kivy,rnixx/kivy,LogicalDash/kivy,kivy/kivy,KeyWeeUsr/kivy,Cheaterman/kivy,KeyWeeUsr/kivy,inclement/kivy,bionoid/k... | examples/application/app_with_config.py | examples/application/app_with_config.py | from kivy.app import App
from kivy.lang import Builder
from kivy.properties import ConfigParserProperty
KV = '''
FloatLayout:
BoxLayout:
size_hint: .5, .5
pos_hint: {'center': (.5, .5)}
orientation: 'vertical'
TextInput:
text: app.text
on_text: app.text = s... | from kivy.app import App
from kivy.lang import Builder
from kivy.properties import ConfigParserProperty
KV = '''
FloatLayout:
BoxLayout:
size_hint: .5, .5
pos_hint: {'center': (.5, .5)}
orientation: 'vertical'
TextInput:
text: app.text
on_text: app.text = s... | mit | Python |
a1581c6f819506b8c2827c8f768bf0bd058d2305 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/de022dcbf35e3119c933a5c345b8b582a9a3cb18. | tensorflow/tensorflow,karllessard/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,tensorflow/tensorflow,karllessard/tensorflow,paolodedios/te... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "de022dcbf35e3119c933a5c345b8b582a9a3cb18"
TFRT_SHA256 = "dc9efd26b883c026354a071a733a7e002a04dd9ae601b5... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "a3dc93d984dd761c539304b21ea64324e30ef217"
TFRT_SHA256 = "7ff10fa3a2213d25e5aa46e20b783c6f96d94772b9fd1c... | apache-2.0 | Python |
a986d114a1f35e8e85c6b5a5235d6f1bf700f549 | Make the Connected Components operator use the utility function | mathturtle/tomviz,mathturtle/tomviz,thewtex/tomviz,cjh1/tomviz,OpenChemistry/tomviz,mathturtle/tomviz,cryos/tomviz,cryos/tomviz,cjh1/tomviz,thewtex/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,cjh1/tomviz,OpenChemistry/tomviz,cryos/tomviz,thewtex/tomviz | tomviz/python/ConnectedComponents.py | tomviz/python/ConnectedComponents.py | def transform_scalars(dataset, background_value=0):
"""Converts a label map of connected components of foreground-valued
voxels in the input image to a label map where each connected component
has a unique label. Foreground voxels have any value other than the
background value. Input images are expected... | def transform_scalars(dataset, background_value=0):
"""Converts a label map of connected components of foreground-valued
voxels in the input image to a label map where each connected component
has a unique label. Foreground voxels have any value other than the
background value. Input images are expected... | bsd-3-clause | Python |
fdaa5df7ef2fa6fb9936ce202a8e40f3d201ce59 | Fix test compilation issue | dhiaayachi/dynx,dhiaayachi/dynx | test/test_integration.py | test/test_integration.py | import unittest
import http.client
class TestStringMethods(unittest.TestCase):
def test_404NoConfig(self):
connRouter = http.client.HTTPConnection("localhost", 8666)
connRouter.request("GET", "/google")
response = connRouter.getresponse()
connRouter.close()
self.assertEqual... | import unittest
import http.client
class TestStringMethods(unittest.TestCase):
def test_404NoConfig(self):
connRouter = http.client.HTTPConnection("localhost", 8666)
connRouter.request("GET", "/google")
response = connRouter.getresponse()
self.assertEqual(response.status, 404)
... | apache-2.0 | Python |
9122042377a9b622aafa2a77d7f46d46331427eb | Adjust util.Track.__repr__ | ViKomprenas/nsndswap,ViKomprenas/nsndswap,ViKomprenas/nsndswap | nsndswap/util.py | nsndswap/util.py | #!/usr/bin/env python3
# nsndswap/util.py
# copyright 2017 ViKomprenas, 2-clause BSD license (LICENSE.md)
class Track(object):
# encapsulation? what encapsulation? just use the properties
def __init__(self, title, references=None):
self.title = title
self.references = references or []
def... | #!/usr/bin/env python3
# nsndswap/util.py
# copyright 2017 ViKomprenas, 2-clause BSD license (LICENSE.md)
class Track(object):
# encapsulation? what encapsulation? just use the properties
def __init__(self, title, references=None):
self.title = title
self.references = references or []
def... | bsd-2-clause | Python |
9f6168bcd27716588e7dec49b5aae50794ead5e7 | Add --hostname argument. | rchekaluk/cloudbiolinux,heuermh/cloudbiolinux,AICIDNN/cloudbiolinux,chapmanb/cloudbiolinux,kdaily/cloudbiolinux,elkingtonmcb/cloudbiolinux,elkingtonmcb/cloudbiolinux,joemphilips/cloudbiolinux,kdaily/cloudbiolinux,rchekaluk/cloudbiolinux,pjotrp/cloudbiolinux,AICIDNN/cloudbiolinux,lpantano/cloudbiolinux,averagehat/cloudb... | cloudbio/deploy/main.py | cloudbio/deploy/main.py | from argparse import ArgumentParser
import yaml
from cloudbio.deploy import deploy
DESC = "Creates an on-demand cloud instance, sets up applications, and transfer files to it."
## Properties that may be specified as args or in settings file,
## argument takes precedence.
ARG_PROPERTIES = [
# VM launcher options
... | from argparse import ArgumentParser
import yaml
from cloudbio.deploy import deploy
DESC = "Creates an on-demand cloud instance, sets up applications, and transfer files to it."
## Properties that may be specified as args or in settings file,
## argument takes precedence.
ARG_PROPERTIES = [
# VM launcher options
... | mit | Python |
eb60962da42d0d197d320fdeaba5e8a2058a6454 | debug auto template name | Krozark/Kraggne,Krozark/Kraggne,Krozark/Kraggne | Kraggne/contrib/flatblocks/utils.py | Kraggne/contrib/flatblocks/utils.py | from django.template.loader import select_template
def GetTemplatesPath(appname,modelname,type,template_path=None):
template_paths = []
if template_path:
template_paths.append(template_path)
template_paths.append('%s/%s/%s.html' % (appname,modelname,type))
return template_paths
def GetBlockCon... | from django.template.loader import select_template
def GetTemplatesPath(modelname,type,template_path=None):
template_paths = []
if template_path:
template_paths.append(template_path)
var = modelname.lower().split(".")
template_paths.append('%s/%s/%s.html' % (var[0],var[1],type))
return temp... | bsd-2-clause | Python |
e320a01cb35447906e92cff63d6bbeefe2029e39 | Fix JSON serialisation tests (widget format and file format) | ricklupton/sankeyview | test/test_sankey_data.py | test/test_sankey_data.py | import pytest
from floweaver.sankey_data import SankeyData, SankeyNode, SankeyLink
def test_sankey_data():
nodes = {}
links = {}
groups = {}
data = SankeyData(nodes, links, groups)
assert data.nodes is nodes
assert data.links is links
assert data.groups is groups
def test_sankey_data_js... | import pytest
from floweaver.sankey_data import SankeyData, SankeyNode, SankeyLink
def test_sankey_data():
nodes = {}
links = {}
groups = {}
data = SankeyData(nodes, links, groups)
assert data.nodes is nodes
assert data.links is links
assert data.groups is groups
def test_sankey_data_js... | mit | Python |
71dcf2ee99389a15055c8884aef77b71808a1e13 | Clean up metainfo_imdb_url plugin | JorisDeRieck/Flexget,LynxyssCZ/Flexget,thalamus/Flexget,lildadou/Flexget,offbyone/Flexget,xfouloux/Flexget,antivirtel/Flexget,LynxyssCZ/Flexget,spencerjanssen/Flexget,crawln45/Flexget,dsemi/Flexget,LynxyssCZ/Flexget,malkavi/Flexget,malkavi/Flexget,ratoaq2/Flexget,patsissons/Flexget,Pretagonist/Flexget,sean797/Flexget,t... | flexget/plugins/metainfo/imdb_url.py | flexget/plugins/metainfo/imdb_url.py | from __future__ import unicode_literals, division, absolute_import
import re
import logging
from flexget import plugin
from flexget.event import event
from flexget.utils.imdb import extract_id, make_url
log = logging.getLogger('metainfo_imdb_url')
class MetainfoImdbUrl(object):
"""
Scan entry informatio... | from __future__ import unicode_literals, division, absolute_import
import re
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('metainfo_imdb_url')
class MetainfoImdbUrl(object):
"""
Scan entry information for imdb url.
"""
schema = {'type': 'bool... | mit | Python |
8e2930e1582df7270853691db0d6cd9f68f6929f | set default workers=1 | artefactual/archivematica-storage-service,artefactual/archivematica-storage-service,artefactual/archivematica-storage-service,artefactual/archivematica-storage-service | install/storage-service.gunicorn-config.py | install/storage-service.gunicorn-config.py | # Documentation: http://docs.gunicorn.org/en/stable/configure.html
# Example: https://github.com/benoitc/gunicorn/blob/master/examples/example_config.py
import os
# http://docs.gunicorn.org/en/stable/settings.html#user
user = os.environ.get('SS_GUNICORN_USER', 'archivematica')
# http://docs.gunicorn.org/en/stable/se... | # Documentation: http://docs.gunicorn.org/en/stable/configure.html
# Example: https://github.com/benoitc/gunicorn/blob/master/examples/example_config.py
import os
# http://docs.gunicorn.org/en/stable/settings.html#user
user = os.environ.get('SS_GUNICORN_USER', 'archivematica')
# http://docs.gunicorn.org/en/stable/se... | agpl-3.0 | Python |
3cbf8d5f89cd46eadb47806d605b2d4a5381ccb2 | Update syncthing-discovery build server | firecat53/dockerfiles,firecat53/dockerfiles | syncthing_discovery/update_release.py | syncthing_discovery/update_release.py | #!/usr/bin/env python
"""Updates stdiscosrv Dockerfile with the latest TeamCity linux-amd64 build.
Python 2/3 compatible.
"""
import xml.etree.cElementTree as ET
try:
from urllib2 import urljoin, urlopen
except ImportError:
from urllib.request import urljoin, urlopen
BASE_URL = "https://build2.syncthing.net"... | #!/usr/bin/env python
"""Updates stdiscosrv Dockerfile with the latest Jenkins linux-amd64 build.
Python 2/3 compatible.
"""
import json
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
def get_release():
"""Get stdiscosrv latest linux-amd64 release version from th... | mit | Python |
c9392a6578b0894dff7a5407410e8892e9f3ae6d | Fix bad refactor of is_valid_unc_path | nithinphilips/py_win_unc,CovenantEyes/py_win_unc | win_unc/validators.py | win_unc/validators.py | from win_unc.internal.utils import take_while
from win_unc.sanitizors import sanitize_username, sanitize_unc_path
def is_valid_drive_letter(string):
"""
Drive letters are one character in length and between "A" and "Z". Case does not matter.
"""
return (len(string) == 1
and string[0].isalp... | from win_unc.sanitizors import sanitize_username, sanitize_unc_path
def is_valid_drive_letter(string):
"""
Drive letters are one character in length and between "A" and "Z". Case does not matter.
"""
return (len(string) == 1
and string[0].isalpha())
def is_valid_unc_path(string):
"""... | mit | Python |
ba2574c1b86f1f9b030a9d572149b8f49c4513aa | Update version. | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/idlelib/idlever.py | Lib/idlelib/idlever.py | IDLE_VERSION = "0.9b1+"
| IDLE_VERSION = "0.9b1"
| mit | Python |
81092dc7a755ce5065f2decc22b7d203b648eac2 | update LOGIN_SIGN_UP_MESSAGE email subject | lafranceinsoumise/api-django,lafranceinsoumise/api-django,lafranceinsoumise/api-django,lafranceinsoumise/api-django | agir/authentication/tasks.py | agir/authentication/tasks.py | from django.conf import settings
from django.utils import timezone
from django.utils.http import urlencode
from agir.authentication.tokens import subscription_confirmation_token_generator
from agir.lib.celery import emailing_task
from agir.lib.mailing import send_mosaico_email
from agir.lib.utils import front_url
from... | from django.conf import settings
from django.utils import timezone
from django.utils.http import urlencode
from agir.authentication.tokens import subscription_confirmation_token_generator
from agir.lib.celery import emailing_task
from agir.lib.mailing import send_mosaico_email
from agir.lib.utils import front_url
from... | agpl-3.0 | Python |
1d13bd71ff105d540c3af166056cb0b8731a3417 | Add reverse to data migration | wooey/Wooey,wooey/Wooey,wooey/Wooey,wooey/Wooey | wooey/migrations/0037_populate-jsonfield.py | wooey/migrations/0037_populate-jsonfield.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-04 23:14
from __future__ import unicode_literals
import json
from django.db import migrations
def populate_default(apps, schema_editor):
ScriptParameter = apps.get_model('wooey', 'ScriptParameter')
for obj in ScriptParameter.objects.all():
... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-04 23:14
from __future__ import unicode_literals
import json
from django.db import migrations
def populate_default(apps, schema_editor):
ScriptParameter = apps.get_model('wooey', 'ScriptParameter')
for obj in ScriptParameter.objects.all():
... | bsd-3-clause | Python |
b02fda823a4a4598254d465996ca53361bdfd421 | Load robot in simulator | anassinator/dqn-obstacle-avoidance | simulator.py | simulator.py | # -*- coding: utf-8 -*-
from robot import Robot
from world import World
from PythonQt import QtGui
from director import applogic
from director import objectmodel as om
from director import visualization as vis
from director.consoleapp import ConsoleApp
class Simulator(object):
"""Simulator."""
def __init__... | # -*- coding: utf-8 -*-
from world import World
from PythonQt import QtGui
from director import applogic
from director import objectmodel as om
from director import visualization as vis
from director.consoleapp import ConsoleApp
class Simulator(object):
"""Simulator."""
def __init__(self, world):
"... | mit | Python |
13a0ad8e65929d2b477891c4d1c37e93862ea156 | update to 2.58.2 | DeadSix27/python_cross_compile_script | packages/dependencies/glib2.py | packages/dependencies/glib2.py | {
'repo_type' : 'archive',
'download_locations' : [
{ 'url' : 'https://download.gnome.org/sources/glib/2.58/glib-2.58.2.tar.xz', 'hashes' : [ { 'type' : 'sha256', 'sum' : 'c7b24ed6536f1a10fc9bce7994e55c427b727602e78342821f1f07fb48753d4b' }, ], },
{ 'url' : 'https://fossies.org/linux/misc/glib-2.58.2.tar.xz/', 'ha... | {
'repo_type' : 'archive',
'download_locations' : [
{ 'url' : 'https://download.gnome.org/sources/glib/2.58/glib-2.58.1.tar.xz', 'hashes' : [ { 'type' : 'sha256', 'sum' : '97d6a9d926b6aa3dfaadad3077cfb43eec74432ab455dff14250c769d526d7d6' }, ], },
{ 'url' : 'https://fossies.org/linux/misc/glib-2.58.1.tar.xz/', 'ha... | mpl-2.0 | Python |
fea2c0bc02a8323ad6c759ca63663499a538186e | Undo BC-breaking change, restore 'import onnx' providing submodules. | onnx/onnx,onnx/onnx,onnx/onnx,onnx/onnx | onnx/__init__.py | onnx/__init__.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .onnx_ml_pb2 import * # noqa
from .version import version as __version__ # noqa
# Import common subpackages so they're available when you 'import onnx'
import onn... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .onnx_ml_pb2 import * # noqa
from .version import version as __version__ # noqa
import sys
def load(obj):
'''
Loads a binary protobuf that stores onnx gr... | apache-2.0 | Python |
17685a78457a996a0ebdf6b69b2b9f2761bfafb3 | Delete GenerateCover() | fan-jiang/Dujing | PythonScript/GenerateBook.py | PythonScript/GenerateBook.py | import subprocess
import os
def GenerateBook():
Books = ["DaXue", "ZhongYong", "LunYu", "MengZi"]
prefaceCommand = "pandoc ..\\Source\\Preface.md -o Preface.html --standalone"
with open("Dujing.log", 'w') as trace:
subprocess.call(prefaceCommand, stdin=None, stdout=trace, stderr=None, shell=True)
os.chdir("..\... | import subprocess
import os
def GenerateCover():
#Cover = "Cover"
#BookName = "BookName"
#BookCover = BookName + Cover
#BookCoverHTML = BookCover + ".html"
#CSS = "CSS_"
#CSSExt = "CSSExt"
#pandocCommand = "pandoc ..\\source\\" + BookCover + ".txt -o "
#+ BookCoverHTML + " -standalone " + CSS_ + Cover + ".css... | mit | Python |
05f37b396dbfafac1ab5ec25a777e5067a00e2c4 | support curl -i param | h2rd/ppxml | pxml/__init__.py | pxml/__init__.py | #!/usr/bin/env python
# unicode: utf-8
import sys
from pygments import highlight
from pygments.formatters import TerminalFormatter
from pygments.lexers import XmlLexer
from xml.dom.minidom import parseString
INDENT=' '*2
def format_code(data):
body = ''
if data.startswith('HTTP'):
end = data.find("\r\n\r\... | #!/usr/bin/env python
# unicode: utf-8
import sys
from pygments import highlight
from pygments.formatters import TerminalFormatter
from pygments.lexers import XmlLexer
import xml.dom.minidom as xml
import argparse
INDENT=' '*2
def format_code(data):
return xml.parseString(data).toprettyxml(indent=INDENT)
def co... | mit | Python |
0cf4f846e4359396362fa9e13d0cca2bf4221aca | change version code | 7sDream/zhihu-py3 | zhihu/__init__.py | zhihu/__init__.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = '7sDream'
__version__ = '0.3.1'
from .client import ZhihuClient
from .question import Question
from .author import Author
from .activity import Activity
from .acttype import ActType
from .answer import Answer
from .collection import Collection
from .column i... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = '7sDream'
__version__ = '0.3.0'
from .client import ZhihuClient
from .question import Question
from .author import Author
from .activity import Activity
from .acttype import ActType
from .answer import Answer
from .collection import Collection
from .column i... | mit | Python |
28cab7063328f02abc5f31c0ef79017c3127ee57 | use atomic modesetting | tomba/kmsxx,tomba/kmsxx,tomba/kmsxx,tomba/kmsxx | py/tests/test.py | py/tests/test.py | #!/usr/bin/python3
import sys
import pykms
# draw test pattern via dmabuf?
dmabuf = False
# Use omap?
omap = False
if omap:
card = pykms.OmapCard()
else:
card = pykms.Card()
if len(sys.argv) > 1:
conn_name = sys.argv[1]
else:
conn_name = ""
res = pykms.ResourceManager(card)
conn = res.reserve_connector(... | #!/usr/bin/python3
import pykms
# draw test pattern via dmabuf?
dmabuf = False
# Use omap?
omap = False
if omap:
card = pykms.OmapCard()
else:
card = pykms.Card()
res = pykms.ResourceManager(card)
conn = res.reserve_connector()
crtc = res.reserve_crtc(conn)
mode = conn.get_default_mode()
if omap:
origfb = pykm... | mpl-2.0 | Python |
296cb1f198584ea350b7861cfab9b607ed449270 | Rework to POST form. Validation temporarily commented out | ronaldbradford/cli_explorer,ronaldbradford/cli_explorer | api/api.py | api/api.py | #!/usr/bin/env python
from flask import Flask, jsonify, request, abort
from subprocess import Popen, PIPE
import sys
from crossdomain import crossdomain
# Define the web container
api = Flask(__name__)
api.config['SERVER_NAME'] = 'cli_explorer.ronaldbradford.com:4242';
# Ensure the API has endpoint discovery
@api.rou... | #!/usr/bin/env python
from flask import Flask, jsonify, request, abort
from subprocess import Popen, PIPE
import sys
from crossdomain import crossdomain
# Define the web container
api = Flask(__name__)
api.config['SERVER_NAME'] = 'localhost:4242';
# Ensure the API has endpoint discovery
@api.route('/')
@crossdomain(o... | apache-2.0 | Python |
d290b2e1e75b60da6e9b36acf7ef9c62e670ee6e | fix raise class | sim0nx/python-openhab,sim0nx/python-openhab | openhab/types.py | openhab/types.py | from __future__ import absolute_import, division, print_function, unicode_literals
# -*- coding: utf-8 -*-
'''python library for accessing the openHAB REST API'''
#
# Georges Toth (c) 2016 <georges@trypill.org>
#
# python-openhab is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | from __future__ import absolute_import, division, print_function, unicode_literals
# -*- coding: utf-8 -*-
'''python library for accessing the openHAB REST API'''
#
# Georges Toth (c) 2016 <georges@trypill.org>
#
# python-openhab is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | agpl-3.0 | Python |
81faa7704fb355dd16674d4ed089e0ced34c24c6 | Add router to the behaviors lookup | thatch45/rflo | rflo/start.py | rflo/start.py | import ioflo.app.run
import os
class Manager(object):
'''
Manage the main ioflo process
'''
def __init__(self):
self.behaviors = ['rflo.config', 'rflo.roads', 'rflo.router']
self.floscript = os.path.join(os.path.dirname(__file__), 'raft.flo')
def start(self):
ioflo.app.run... | import ioflo.app.run
import os
class Manager(object):
'''
Manage the main ioflo process
'''
def __init__(self):
self.behaviors = ['rflo.config', 'rflo.roads']
self.floscript = os.path.join(os.path.dirname(__file__), 'raft.flo')
def start(self):
ioflo.app.run.start(
... | apache-2.0 | Python |
e379b89ab5f012ac9ad6f6f0a058fbe3098791a6 | Add docstring to pipe.process_images | jni/skan | skan/pipe.py | skan/pipe.py | from . import pre, csr
import imageio
from tqdm import tqdm
import numpy as np
from skimage import morphology
import pandas as pd
def process_images(filenames, image_format, threshold_radius,
smooth_radius, brightness_offset, scale_metadata_path):
"""Full pipeline from images to skeleton stats ... | from . import pre, csr
import imageio
from tqdm import tqdm
import numpy as np
from skimage import morphology
import pandas as pd
def process_images(filenames, image_format, threshold_radius,
smooth_radius, brightness_offset, scale_metadata_path):
image_format = None if image_format == 'auto' e... | bsd-3-clause | Python |
28181d9bcf7aa597b88507871ffb31f4028eb67c | Enable DEBUG when running the test suite | Flamacue/pretix,Flamacue/pretix,Flamacue/pretix,Flamacue/pretix | src/pretix/testutils/settings.py | src/pretix/testutils/settings.py | import atexit
import os
import tempfile
tmpdir = tempfile.TemporaryDirectory()
os.environ.setdefault('DATA_DIR', tmpdir.name)
from pretix.settings import * # NOQA
DATA_DIR = tmpdir.name
LOG_DIR = os.path.join(DATA_DIR, 'logs')
MEDIA_ROOT = os.path.join(DATA_DIR, 'media')
atexit.register(tmpdir.cleanup)
EMAIL_BACK... | import atexit
import os
import tempfile
tmpdir = tempfile.TemporaryDirectory()
os.environ.setdefault('DATA_DIR', tmpdir.name)
from pretix.settings import * # NOQA
DATA_DIR = tmpdir.name
LOG_DIR = os.path.join(DATA_DIR, 'logs')
MEDIA_ROOT = os.path.join(DATA_DIR, 'media')
atexit.register(tmpdir.cleanup)
EMAIL_BACK... | apache-2.0 | Python |
efceebba734228b9def014e98c039b774e0dd572 | Fix path to ckeditor | geelweb/django-customflatpages | src/geelweb/django/customflatpages/admin.py | src/geelweb/django/customflatpages/admin.py | from django.contrib import admin
from django import forms
from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.db import models
from geelweb.django.customflatpages.models import CustomFlatPage
class CustomFlatPageForm(FlatpageForm):
... | from django.contrib import admin
from django import forms
from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.db import models
from geelweb.django.customflatpages.models import CustomFlatPage
class CustomFlatPageForm(FlatpageForm):
... | mit | Python |
88b2cfaac40cdd9e06994fb8104ace6740399564 | set new version 0.2.9 | jeanmask/opps,YACOWS/opps,YACOWS/opps,jeanmask/opps,opps/opps,williamroot/opps,YACOWS/opps,opps/opps,YACOWS/opps,opps/opps,williamroot/opps,williamroot/opps,williamroot/opps,jeanmask/opps,opps/opps,jeanmask/opps | opps/__init__.py | opps/__init__.py | # -*- coding: utf-8 -*-
import pkg_resources
pkg_resources.declare_namespace(__name__)
VERSION = (0, 2, 9)
__version__ = ".".join(map(str, VERSION))
__status__ = "Development"
__description__ = u"Open Source Content Management Platform - CMS for the "
u"magazines, newspappers websites and portals with "
u"high-traff... | # -*- coding: utf-8 -*-
import pkg_resources
pkg_resources.declare_namespace(__name__)
VERSION = (0, 2, 8, 3)
__version__ = ".".join(map(str, VERSION))
__status__ = "Development"
__description__ = u"Open Source Content Management Platform - CMS for the "
u"magazines, newspappers websites and portals with "
u"high-tr... | mit | Python |
2a531f331ef5fe4d42e92460257d650ce481a2be | set empty prefix instead of None | mihau/labDNS | labDNS/storages.py | labDNS/storages.py | try:
import redis
except ImportError:
redis = None
try:
import consul
except ImportError:
consul = None
class BaseStorage:
DEFAULT_CONFIG = dict()
def __init__(self, config):
self.config = self.DEFAULT_CONFIG
self._configure(config)
def get(self, key):
raise NotIm... | try:
import redis
except ImportError:
redis = None
try:
import consul
except ImportError:
consul = None
class BaseStorage:
DEFAULT_CONFIG = dict()
def __init__(self, config):
self.config = self.DEFAULT_CONFIG
self._configure(config)
def get(self, key):
raise NotIm... | bsd-3-clause | Python |
dd65eb488f2e683a77ccb0609e2cc3f4b58473e6 | Update 0.9 | Deavelleye/dj-CerberusAC,Deavelleye/dj-CerberusAC,Deavelleye/dj-CerberusAC,Deavelleye/dj-CerberusAC | src/cerberus_ac/admin.py | src/cerberus_ac/admin.py | # -*- coding: utf-8 -*-
"""Admin module."""
from django.contrib import admin
from django.contrib.admin.sites import AdminSite
from cerberus_ac.views import EditUserPermissions
from .models import *
class SecurityAdmin(AdminSite):
pass
class DataAdmin(AdminSite):
pass
class AuditAdmin(AdminSite):
pass... | # -*- coding: utf-8 -*-
"""Admin module."""
from django.contrib import admin
from django.contrib.admin.sites import AdminSite
from cerberus_ac.views import EditUserPermissions
from .models import *
class SecurityAdmin(AdminSite):
pass
class DataAdmin(AdminSite):
pass
class AuditAdmin(AdminSite):
pass... | isc | Python |
32935c32ae592e84cfb5d8e1c1988e5e96659be3 | fix tests | appi147/Jarvis,sukeesh/Jarvis,sukeesh/Jarvis,appi147/Jarvis,sukeesh/Jarvis,sukeesh/Jarvis | Jarvis/tests/test_brain.py | Jarvis/tests/test_brain.py | import unittest
from packages.aiml.brain import Brain
class BrainTest(unittest.TestCase):
def test_memory(self):
b = Brain()
response = b.respond("What are you")
self.assertEqual(str(response), "I'm a bot, silly!")
if __name__ == '__main__':
unittest.main()
| import unittest
from packages.aiml.brain import Brain
class BrainTest(unittest.TestCase):
def test_memory(self):
b = Brain()
response = b.respond("TEST")
self.assertEqual(str(response), 'TEST')
if __name__ == '__main__':
unittest.main()
| mit | Python |
056c7aa5bd80d629191840543636da33f303a5f1 | Remove unicode test. | lasote/django-geoposition,Teino1978-Corp/Teino1978-Corp-django-geoposition,mativs/django-geoposition,mbwk/django-geoposition,RamezIssac/django-geoposition,akiokio/django-geoposition,rmoorman/django-geoposition,lasote/django-geoposition,Teino1978-Corp/Teino1978-Corp-django-geoposition,mativs/django-geoposition,akiokio/d... | geoposition/tests/test_geoposition.py | geoposition/tests/test_geoposition.py | from decimal import Decimal
from django.test import SimpleTestCase
from geoposition import Geoposition
class GeopositionTestCase(SimpleTestCase):
def test_init_with_decimals(self):
gp = Geoposition(Decimal('52.5'), Decimal('13.4'))
self.assertEqual(gp.latitude, Decimal('52.5'))
self.assert... | from decimal import Decimal
from django.test import SimpleTestCase
from geoposition import Geoposition
class GeopositionTestCase(SimpleTestCase):
def test_init_with_decimals(self):
gp = Geoposition(Decimal('52.5'), Decimal('13.4'))
self.assertEqual(gp.latitude, Decimal('52.5'))
self.assert... | mit | Python |
916b4e25f163456b1f6869fb431fe4280be0bb6b | Fix YAML config reading. | praekelt/vumi-dashboard,praekelt/vumi-dashboard | twisted/plugins/graphite2holodeck.py | twisted/plugins/graphite2holodeck.py | from zope.interface import implements
import yaml
from twisted.python import usage
from twisted.plugin import IPlugin
from twisted.application.service import IServiceMaker
from vumidash.graphite_client import GraphiteClient
from vumidash.dummy_client import DummyClient
from vumidash.holodeck_pusher import HolodeckPu... | from zope.interface import implements
import yaml
from twisted.python import usage
from twisted.plugin import IPlugin
from twisted.application.service import IServiceMaker
from vumidash.graphite_client import GraphiteClient
from vumidash.dummy_client import DummyClient
from vumidash.holodeck_pusher import HolodeckPu... | bsd-3-clause | Python |
c1efaefbe6a098e3f74bed20ff55a4307ec90ddd | Use new version of Dockets | gamechanger/deferrable | dynamic_requirements.py | dynamic_requirements.py | install_requires = [
'Dockets>=0.4.0,<0.5.0',
'boto>=2.26.0',
]
test_requires = [
'nose>=1.3.0,<2.0.0',
'mock>=1.0.0,<2.0.0',
'redis>=2.10.0,<3.0.0',
'moto>=0.4.1',
]
| install_requires = [
'Dockets>=0.3.4,<0.4.0',
'boto>=2.26.0',
]
test_requires = [
'nose>=1.3.0,<2.0.0',
'mock>=1.0.0,<2.0.0',
'redis>=2.10.0,<3.0.0',
'moto>=0.4.1',
]
| mit | Python |
291d64efef1f8d464a86fb822c0b82910f406d2c | Fix path | otsaloma/docsets,otsaloma/docsets | Dataiter.docset/Contents/Resources/index.py | Dataiter.docset/Contents/Resources/index.py | #!/usr/bin/env python3
import util
db = util.create_database()
root = "https://dataiter.readthedocs.io/en/latest/"
for soup in util.soups_from_files("Documents/*.html"):
for tag in soup.select('a[href*="#dataiter."]'):
name = tag.attrs["href"].split("#")[-1]
path = root + tag.attrs["href"]
... | #!/usr/bin/env python3
import util
db = util.create_database()
root = "https://dataiter.readthedocs.io/en/latest/"
for soup in util.soups_from_files("Documents/*.html"):
for tag in soup.select('a[href*="#dataiter."]'):
name = tag.attrs["href"].split("#")[-1]
path = root + name
util.insert(... | mit | Python |
879deef448c2d06053d5e848b414d5e2ab2754bd | Update brain.py | kankiri/pabiana | pabiana/brain.py | pabiana/brain.py | import importlib
import os
from os import path
import pip
from . import load_interfaces, repo
def main(module_name, area_name):
req_path = path.join(os.getcwd(), module_name, 'requirements.txt')
if path.isfile(req_path):
pip.main(['install', '--upgrade', '-r', req_path])
intf_path = path.join(os.... | import importlib
import os
from os import path
import pip
from . import load_interfaces, repo
def main(module_name, area_name):
req_path = path.join(os.getcwd(), module_name, 'requirements.txt')
if path.isfile(req_path):
pip.main(['install', '--upgrade', '-r', req_path])
intf_path = path.join(os.... | mit | Python |
5ff4e4187ab73ca02ed86b06010ca7cd1e8528a9 | change description for customized invoice module | optima-ict/odoo,optima-ict/odoo,optima-ict/odoo,optima-ict/odoo,optima-ict/odoo,optima-ict/odoo | customized_invoice/__openerp__.py | customized_invoice/__openerp__.py | # -*- coding: utf-8 -*-
{
'name': "Professional Invoice Templates - Odoo9.0",
'summary': """
Make your Invoice reports look professional by branding them. Choose from three professional Invoice templates and unlimited colors """,
'description': """
This module will install a customized cli... | # -*- coding: utf-8 -*-
{
'name': "Professional Invoice Report Templates - Odoo9.0",
'summary': """
Make your Odoo Invoice reports look professional by branding them. Choose from Five professional Invoice templates and customize the colors and logo on the invoice to look professional ans appealing to ... | agpl-3.0 | Python |
a0831cbe30cc3f487d683138eefb43ff56b3c687 | Allow for passing through URL arguments | leifdenby/django-pyroven | pyroven/views.py | pyroven/views.py | import urllib
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth import authenticate, login, logout
from django.core.urlresolvers import reverse
from pyroven.utils import setting, HttpResponseSeeOther
import pyroven
def raven_return(request):
# Get the token which the Raven serve... | import urllib
from django.http import HttpResponseRedirect
from django.contrib.auth import authenticate, login, logout
from django.core.urlresolvers import reverse
from pyroven.utils import setting, HttpResponseSeeOther
def raven_return(request):
# Get the token which the Raven server sent us - this should reall... | mit | Python |
48111f5f94ddbc05c48fb84ef51b28d17864ca35 | Update pysam version | kyleabeauchamp/pysam,pysam-developers/pysam,kyleabeauchamp/pysam,pysam-developers/pysam,pysam-developers/pysam,kyleabeauchamp/pysam,kyleabeauchamp/pysam,kyleabeauchamp/pysam,pysam-developers/pysam | pysam/version.py | pysam/version.py | # pysam versioning information
__version__ = "0.15.0"
# TODO: upgrade number
__samtools_version__ = "1.9"
# TODO: upgrade code and number
__bcftools_version__ = "1.9"
__htslib_version__ = "1.9"
| # pysam versioning information
__version__ = "0.14.1"
# TODO: upgrade number
__samtools_version__ = "1.7"
# TODO: upgrade code and number
__bcftools_version__ = "1.6"
__htslib_version__ = "1.7"
| mit | Python |
a6d84000b8738d8a10f95f53ea71c78f837095aa | Use len since it is sufficient for list comparison | kyle-long/pyshelf,kyle-long/pyshelf,not-nexus/shelf,not-nexus/shelf | pyshelf/utils.py | pyshelf/utils.py | import os.path
import json
import jsonschema
def create_path(*args):
"""
Gets the full absolute path based on the arguments provided. The part
it adds at the beginning is the path to the root of this repository.
WARNING: Do not start one of your path sections with a "/" otherwise that
... | import os.path
import json
import jsonschema
import collections
def create_path(*args):
"""
Gets the full absolute path based on the arguments provided. The part
it adds at the beginning is the path to the root of this repository.
WARNING: Do not start one of your path sections with a "/... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.