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 |
|---|---|---|---|---|---|---|---|---|
e884fa6de130efae630f827921345bedc95af276 | Update utils.py | pathakvaidehi2391/WorkSpace,pathakvaidehi2391/WorkSpace | azurecloudify/utils.py | azurecloudify/utils.py | from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
import random
import string
def get_resource_group_name():
if ctx.node.properties['exsisting_resource_group_name']:
return ctx.node.properties['exsisting_resource_group_name']
def get_storage_account_name():
if ctx.no... | from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
import random
import string
def get_resource_group_name():
if ctx.node.properties['exsisting_resource_group_name']:
return ctx.node.properties['exsisting_resource_group_name']
def get_resource_name():
if ctx.node.prop... | apache-2.0 | Python |
d3ee9b6afc1d90f647335e15a4a48c36b84c3037 | add --docker-root option | Netflix/aminator,kvick/aminator,bmoyles/aminator,coryb/aminator | aminator/plugins/volume/docker.py | aminator/plugins/volume/docker.py | # -*- coding: utf-8 -*-
#
#
# Copyright 2014 Netflix, Inc.
#
# 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 ... | # -*- coding: utf-8 -*-
#
#
# Copyright 2014 Netflix, Inc.
#
# 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 ... | apache-2.0 | Python |
c84fb1e8f00f7341234965fcf2a1f7aca9a01cde | Add documentation to utils.stripspecialchars() | 9h37/pompadour-wiki,9h37/pompadour-wiki,9h37/pompadour-wiki | pompadour_wiki/pompadour_wiki/apps/utils/__init__.py | pompadour_wiki/pompadour_wiki/apps/utils/__init__.py | # -*- coding: utf-8 -*-
import os
import re
def urljoin(*args):
""" Like os.path.join but for URLs """
if len(args) == 0:
return ""
if len(args) == 1:
return str(args[0])
else:
args = [str(arg).replace("\\", "/") for arg in args]
work = [args[0]]
for arg in ... | # -*- coding: utf-8 -*-
import os
import re
def urljoin(*args):
""" Like os.path.join but for URLs """
if len(args) == 0:
return ""
if len(args) == 1:
return str(args[0])
else:
args = [str(arg).replace("\\", "/") for arg in args]
work = [args[0]]
for arg in ... | mit | Python |
729a5c2e1276f9789733fc46fb7f48d0ac7e3178 | Use requests to fetch emoji list | le1ia/slackmoji | src/slackmoji.py | src/slackmoji.py | # pylint: disable = C0103, C0111
# Standard Library
import json
import mimetypes
from os import makedirs
# Third Party
import requests
def list_emojis(domain, token):
url = r'https://%s.slack.com/api/emoji.list' % domain
data = [('token', token)]
response = requests.post(url, data=data)
print "\nGot ... | # pylint: disable = C0103, C0111
# Standard Library
import json
import mimetypes
from os import makedirs
from subprocess import check_output
# Third Party
import requests
def list_emojis(domain, token):
script = ['bin/list_emojis.sh {0} {1}'.format(domain, token)]
response = check_output(script, shell=True)
... | mit | Python |
4d3d5c97b9ff49c553cae1900af70c12c2cee83c | adjust responder to python 3 | goFrendiAsgard/chimera-framework,goFrendiAsgard/chimera-framework,goFrendiAsgard/chimera-framework,goFrendiAsgard/chimera-framework,goFrendiAsgard/chimera-framework,goFrendiAsgard/chimera-framework | project-template/chains/programs/sample.responder.py | project-template/chains/programs/sample.responder.py | import sys, json
# get request and config from the framework
req = json.loads(sys.argv[1])
config = json.loads(sys.argv[2])
params = req['params']
# create response
title = 'sample.responder.py'
name = 'Kimi no na wa?'
if 'name' in params:
name = params['name']
response = {'title': title, 'name': name}
# show ti... | import sys, json
# get request and config from the framework
req = json.loads(sys.argv[1])
config = json.loads(sys.argv[2])
params = req['params']
# create response
title = 'sample.responder.py'
name = 'Kimi no na wa?'
if 'name' in params:
name = params['name']
response = {'title': title, 'name': name}
# show ti... | mit | Python |
48b7880fec255c7a021361211e56980be2bd4c6b | Add "since" parameter to this command | HelsinkiHacklab/asylum,HelsinkiHacklab/asylum,HelsinkiHacklab/asylum,HelsinkiHacklab/asylum | project/creditor/management/commands/addrecurring.py | project/creditor/management/commands/addrecurring.py | # -*- coding: utf-8 -*-
import datetime
import itertools
import dateutil.parser
from creditor.models import RecurringTransaction
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
from asylum.utils import datetime_proxy, months
class Command(BaseCommand):
help = ... | # -*- coding: utf-8 -*-
from creditor.models import RecurringTransaction
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = 'Gets all RecurringTransactions and runs conditional_add_transaction()'
def handle(self, *args, **options):
for t in RecurringT... | mit | Python |
65f0520383dcb9a39fa4409b867574832a9c1b4f | Update version.py | mongolab/mongoctl | mongoctl/version.py | mongoctl/version.py | __author__ = 'abdul'
MONGOCTL_VERSION = '0.6.3'
| __author__ = 'abdul'
MONGOCTL_VERSION = '0.6.2' | mit | Python |
debc3f9c21af5666e53b84dd99c6d5c99abc2c66 | Rename entry class | Motoko11/MotoBot | motobot/database.py | motobot/database.py | from pickle import load, dump, HIGHEST_PROTOCOL
from os import replace
class DatabaseEntry:
def __init__(self, database, data={}):
self.__database = database
self.__data = data
def get_val(self, name, default=None):
return self.__data.get(name, default)
def set_val(self, name, va... | from pickle import load, dump, HIGHEST_PROTOCOL
from os import replace
class Entry:
def __init__(self, database, data={}):
self.__database = database
self.__data = data
def get_val(self, name, default=None):
return self.__data.get(name, default)
def set_val(self, name, value):
... | mit | Python |
61454a9e271bf57e54453c9ef50fd8bb7e545b6d | Fix Group.__unicode__. | OddBloke/moore | wrestlers/models.py | wrestlers/models.py | # moore - a wrestling database
# Copyright (C) 2011 Daniel Watkins
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later vers... | # moore - a wrestling database
# Copyright (C) 2011 Daniel Watkins
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later vers... | agpl-3.0 | Python |
e9484f9192ac93209dbdf377adff36f4b314167a | update test settings for djanog_jenkins | caktus/django-pagelets,caktus/django-pagelets,caktus/django-pagelets,caktus/django-pagelets | sample_project/hudson_test_settings.py | sample_project/hudson_test_settings.py | from sample_project.settings import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'pagelets', # Or path to database file if using sqlite3.
'USER': '', ... | from sample_project.settings import *
INSTALLED_APPS += ('test_extensions',)
# COVERAGE_EXCLUDE_MODULES = ('django',)
# COVERAGE_INCLUDE_MODULES = ('pagelets',) | bsd-3-clause | Python |
8d498afc08d01a801044713ae430d85dfef7d8b6 | Fix url mapping | muffins-on-dope/bakery,muffins-on-dope/bakery,muffins-on-dope/bakery | bakery/cookies/urls.py | bakery/cookies/urls.py | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
urlpatterns = patterns('bakery.cookies.views',
url(r'^cookie/(?P<owner_name>[^/]+)/(?P<name>[^/]+)/$', 'detail', name='detail'),
)
| # -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
urlpatterns = patterns('bakery.cookies.views',
url(r'^cookie/(?P<owner_name>[^/]+)/(?P<name>[^/]+)$', 'detail', name='detail'),
)
| bsd-3-clause | Python |
ab97af9e23f5006ae8eaf6273c5c9194fc9d8d5f | Print before running reactor. | denispin/twisted-intro,shankisg/twisted-intro,s0lst1ce/twisted-intro,jdavisp3/twisted-intro,denispin/twisted-intro,shankig/twisted-intro,vaniakov/twisted-intro,leixinstar/twisted-intro,walkinreeds/twisted-intro,vaniakov/twisted-intro,shankig/twisted-intro,jakesyl/twisted-intro,jakesyl/twisted-intro,elenaoat/tests,walki... | basic-twisted/hello.py | basic-twisted/hello.py |
def hello():
print 'Hello from the reactor loop!'
from twisted.internet import reactor
reactor.callWhenRunning(hello)
print 'Starting the reactor.'
reactor.run()
|
def hello():
print 'Hello from the reactor loop!'
from twisted.internet import reactor
reactor.callWhenRunning(hello)
reactor.run()
| mit | Python |
f1cfa2d7e03cbab089e856831d8066434f525c6f | fix timedelta add time error | HakureiClub/hakurei-site,HakureiClub/hakurei-site,HakureiClub/hakurei-site,HakureiClub/hakurei-site | hakureiclub_app/core_model/mongodb.py | hakureiclub_app/core_model/mongodb.py | from pymongo import MongoClient
from xpinyin import Pinyin
from mu_sanic import config
import urllib.request
import datetime
client = MongoClient(config.mongohost)
db = client['Hakurei-Site']
pin = Pinyin()
class BlogInfo:
def __init__(self):
self.blog = db['BlogInfo']
def init(self,title,markdown):
... | from pymongo import MongoClient
from xpinyin import Pinyin
from mu_sanic import config
import urllib.request
import datetime
client = MongoClient(config.mongohost)
db = client['Hakurei-Site']
pin = Pinyin()
class BlogInfo:
def __init__(self):
self.blog = db['BlogInfo']
def init(self,title,markdown):
... | mit | Python |
6e48e1cca6939b63d9391a435d90d439b46743a8 | Check if the url is a playlist | zuik/stuff,zuik/stuff,zuik/stuff,zuik/stuff,zuik/stuff,zuik/stuff | yufonium/youtube.py | yufonium/youtube.py | import json
import re
from youtube_dl import YoutubeDL
from youtube_dl.extractor.youtube import YoutubePlaylistIE
from yufonium.utils import save_test_json
ytplie = YoutubePlaylistIE()
ydl_opts = {
"noplaylist": True # For now, we will separate playlist and singles later
}
def get_info(url):
print("Gettin... | import json
from youtube_dl import YoutubeDL
from yufonium.utils import save_test_json
ydl_opts = {
"noplaylist": True # For now, we will separate playlist and singles later
}
def get_info(url):
print("Getting info for {}".format(url))
with YoutubeDL(ydl_opts) as ydl:
info = ydl.extract_info(u... | mit | Python |
9ca219094458cd2594fcef047090710689919f2c | Fix remaining issues | lindenlab/eventlet,lindenlab/eventlet,tempbottle/eventlet,collinstocks/eventlet,tempbottle/eventlet,collinstocks/eventlet,lindenlab/eventlet | tests/stdlib/all.py | tests/stdlib/all.py | """ Convenience module for running standard library tests with nose. The standard
tests are not especially homogeneous, but they mostly expose a test_main method that
does the work of selecting which tests to run based on what is supported by the
platform. On its own, Nose would run all possible tests and many would ... | """ Convenience module for running standard library tests with nose. The standard tests are not especially homogeneous, but they mostly expose a test_main method that does the work of selecting which tests to run based on what is supported by the platform. On its own, Nose would run all possible tests and many would ... | mit | Python |
f7c75adb7f371bf347f47d984834c6275614ae37 | Remove deprecated random_cmap | astropy/photutils,larrybradley/photutils | photutils/utils/colormaps.py | photutils/utils/colormaps.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides tools for generating matplotlib colormaps.
"""
import numpy as np
from .check_random_state import check_random_state
__all__ = ['make_random_cmap']
def make_random_cmap(ncolors=256, random_state=None):
"""
Make a matpl... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides tools for generating matplotlib colormaps.
"""
from astropy.utils import deprecated
import numpy as np
from .check_random_state import check_random_state
__all__ = ['make_random_cmap']
@deprecated('0.7', alternative='make_rand... | bsd-3-clause | Python |
09bdc51dacfe72597105c468baf356f0b1e81012 | Test modified a second time, to keep Travis happy. | FulcrumIT/skytap,mapledyne/skytap | tests/testLabels.py | tests/testLabels.py | import json
import sys
sys.path.append('..')
from skytap.Labels import Labels # noqa
labels = Labels()
def test_labels():
"""Peform tests relating to labels."""
return
#labels.create("barf", True)
for l in labels:
print l
| import json
import sys
sys.path.append('..')
from skytap.Labels import Labels # noqa
labels = Labels()
def test_labels():
"""Peform tests relating to labels."""
sys.exit()
#labels.create("barf", True)
for l in labels:
print l
| mit | Python |
c5f3f67a661f0614634163704d7ba61d67e59abc | fix the prod logging issue | kencochrane/scorinator,kencochrane/scorinator,kencochrane/scorinator | scorinator/scorinator/settings/prod.py | scorinator/scorinator/settings/prod.py | from .base import *
import dj_database_url
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
)
DATABASES = {'default': dj_database_url.config()}
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}... | from .base import *
import dj_database_url
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
)
DATABASES = {'default': dj_database_url.config()}
LOGGING['root'] = {
'level': 'WARNING',
'handlers': ['opbeat']}
LOGGING['loggers']['opbeat'] = {
'level': 'DEBUG',
'handlers'... | apache-2.0 | Python |
0f6128c3694b08899220a3e2b8d73c27cda7eeee | Format new migration file with black | mociepka/saleor,mociepka/saleor,mociepka/saleor | saleor/product/migrations/0117_auto_20200423_0737.py | saleor/product/migrations/0117_auto_20200423_0737.py | # Generated by Django 3.0.5 on 2020-04-23 12:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("product", "0116_auto_20200225_0237"),
]
operations = [
migrations.AlterField(
model_name="producttranslation",
name=... | # Generated by Django 3.0.5 on 2020-04-23 12:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('product', '0116_auto_20200225_0237'),
]
operations = [
migrations.AlterField(
model_name='producttranslation',
name=... | bsd-3-clause | Python |
9cc85af40d05babbe9fc16e71d7dc2b475f3b5e9 | Remove format option to maintain python 2.6 compatibility | murphyke/avocado,murphyke/avocado,murphyke/avocado,murphyke/avocado | avocado/management/subcommands/cache.py | avocado/management/subcommands/cache.py | import sys
import time
import logging
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from avocado.management.base import DataFieldCommand
log = logging.getLogger(__name__)
_help = """\
Pre-caches data produced by various DataField methods that are data dependent.
... | import sys
import time
import logging
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from avocado.management.base import DataFieldCommand
log = logging.getLogger(__name__)
_help = """\
Pre-caches data produced by various DataField methods that are data dependent.
... | bsd-2-clause | Python |
3aa668460467683f72955cbfd8064a64e4c50b76 | Fix the doc typo | openstack/zaqar,openstack/zaqar,openstack/zaqar,openstack/zaqar | zaqar/common/schemas/flavors.py | zaqar/common/schemas/flavors.py | # Copyright (c) 2013 Rackspace Hosting, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | # Copyright (c) 2013 Rackspace Hosting, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | apache-2.0 | Python |
42c667ab7e1ed9cdfc711a4d5eb815492d8b1e05 | Fix a test with generate_thumbnail | franek/sigal,jdn06/sigal,cbosdo/sigal,jasuarez/sigal,muggenhor/sigal,jdn06/sigal,kontza/sigal,franek/sigal,t-animal/sigal,t-animal/sigal,kontza/sigal,kontza/sigal,muggenhor/sigal,elaOnMars/sigal,cbosdo/sigal,jasuarez/sigal,jdn06/sigal,Ferada/sigal,saimn/sigal,saimn/sigal,cbosdo/sigal,saimn/sigal,xouillet/sigal,elaOnMar... | tests/test_image.py | tests/test_image.py | # -*- coding:utf-8 -*-
import os
from sigal.image import generate_image, generate_thumbnail
CURRENT_DIR = os.path.dirname(__file__)
TEST_IMAGE = 'exo20101028-b-full.jpg'
def test_image(tmpdir):
"Test the Image class."
srcfile = os.path.join(CURRENT_DIR, 'sample', 'dir2', TEST_IMAGE)
dstfile = str(tmpd... | # -*- coding:utf-8 -*-
import os
from sigal.image import generate_image, generate_thumbnail
CURRENT_DIR = os.path.dirname(__file__)
TEST_IMAGE = 'exo20101028-b-full.jpg'
def test_image(tmpdir):
"Test the Image class."
srcfile = os.path.join(CURRENT_DIR, 'sample', 'dir2', TEST_IMAGE)
dstfile = str(tmpd... | mit | Python |
ccfe12391050d598ec32861ed146b66f4e907943 | Use big company list for regex entity extraction | uf6/noodles,uf6/noodles | noodles/entities.py | noodles/entities.py | """
Find all company names in a piece of text
extractor = EntityExtractor()
entities = extractor.entities_from_text(text)
> ['acme incorporated', 'fubar limited', ...]
"""
COMPANY_SOURCE_FILE = '/tmp/companies_dev.csv'
import re
import csv
norm_reqs = (
('ltd.', 'limited'),
(' bv ', 'b.v.'),
)
def norm... | """
Find all company names in a piece of text
extractor = EntityExtractor()
entities = extractor.entities_from_text(text)
> ['acme incorporated', 'fubar limited', ...]
TODO:
- work out a standard form to normalize company names to
- import company names into the massive regex
"""
import re
norm_reqs = (
('lt... | mit | Python |
f46f149783694a97919cd1cc372d848bd2a8dc74 | set default 300 max_size. | soasme/blackgate | blackgate/component.py | blackgate/component.py | # -*- coding: utf-8 -*-
import tornado.ioloop
from blackgate.http_proxy import HTTPProxy
from blackgate.executor import ExecutorPools
class Component(object):
def __init__(self):
self.urls = []
self.pools = ExecutorPools()
self.configurations = {}
@property
def config(self):
... | # -*- coding: utf-8 -*-
import tornado.ioloop
from blackgate.http_proxy import HTTPProxy
from blackgate.executor import ExecutorPools
class Component(object):
def __init__(self):
self.urls = []
self.pools = ExecutorPools()
self.configurations = {}
@property
def config(self):
... | mit | Python |
351cd20955a88567888f7c4c4876d2758c0ce9d1 | fix for posti test | aapa/pyfibot,huqa/pyfibot,aapa/pyfibot,huqa/pyfibot,EArmour/pyfibot,lepinkainen/pyfibot,rnyberg/pyfibot,lepinkainen/pyfibot,rnyberg/pyfibot,EArmour/pyfibot | tests/test_posti.py | tests/test_posti.py | # -*- coding: utf-8 -*-
# from nose.tools import eq_
import bot_mock
from pyfibot.modules.module_posti import command_posti
from utils import check_re
bot = bot_mock.BotMock()
def test_posti():
'''11d 1h 45m ago - Item delivered to the recipient. - TAALINTEHDAS 25900'''
regex = u'(\d+d\ )?(\d+h\ )?(\d+m )?a... | # -*- coding: utf-8 -*-
# from nose.tools import eq_
import bot_mock
from pyfibot.modules.module_posti import command_posti
from utils import check_re
bot = bot_mock.BotMock()
def test_posti():
'''11d 1h 45m ago - Item delivered to the recipient. - TAALINTEHDAS 25900'''
regex = '(\d+d\ )?(\d+h\ )?(\d+m)? ag... | bsd-3-clause | Python |
fc47d6083a85a615a342b6d1596d73808e5c42e2 | Fix tests | Mark-Shine/django-qiniu-storage,glasslion/django-qiniu-storage,jeffrey4l/django-qiniu-storage,jackeyGao/django-qiniu-storage | tests/test_qiniu.py | tests/test_qiniu.py | import os
from os.path import dirname, join
import uuid
import qiniu.conf
import qiniu.io
import qiniu.rs
import qiniu.rsf
QINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY')
QINIU_SECRET_KEY = os.environ.get('QINIU_SECRET_KEY')
QINIU_BUCKET_NAME = os.environ.get('QINIU_BUCKET_NAME')
QINIU_BUCKET_DOMAIN = os.envir... | import os
from os.path import dirname, join
import uuid
import qiniu.conf
import qiniu.io
import qiniu.rs
import qiniu.rsf
QINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY')
QINIU_SECRET_KEY = os.environ.get('QINIU_SECRET_KEY')
QINIU_BUCKET_NAME = os.environ.get('QINIU_BUCKET_NAME')
QINIU_BUCKET_DOMAIN = os.envir... | mit | Python |
0f17c8d3438b910c2fa6db7c588487b591fc3d77 | Test utils | eiginn/passpie,scorphus/passpie,marcwebbie/passpie,scorphus/passpie,marcwebbie/passpie,eiginn/passpie | tests/test_utils.py | tests/test_utils.py | try:
from mock import mock_open
except:
from unittest.mock import mock_open
import yaml
from passpie.utils import genpass, mkdir_open, load_config, get_version
from .helpers import MockerTestCase
class UtilsTests(MockerTestCase):
def test_genpass_generates_a_password_with_length_32(self):
passw... | from .helpers import MockerTestCase
from passpie.utils import genpass, mkdir_open
class UtilsTests(MockerTestCase):
def test_genpass_generates_a_password_with_length_32(self):
password = genpass()
self.assertEqual(len(password), 32)
def test_mkdir_open_makedirs_on_path_dirname(self):
... | mit | Python |
3dc6df3aa399fb403a0acbc494c5338e7be7f76c | clean up tests | danpoland/pyramid-restful-framework | tests/test_views.py | tests/test_views.py | from pyramid import testing
from pyramid.response import Response
from unittest import TestCase
from pyramid_restful.views import APIView
class TestView(APIView):
def get(self, request, *args, **kwargs):
return Response({'method': 'GET'})
def post(self, request, *args, **kwargs):
return Re... | import pytest
from pyramid import testing
from pyramid.response import Response
from unittest import TestCase
from pyramid_restful.views import APIView
class GetView(APIView):
def get(self, request, *args, **kwargs):
return Response({'method': 'GET'})
class PostView(APIView):
def post(self, req... | bsd-2-clause | Python |
bd53fe8df0642fd85d655994619fedaf4347e826 | Test create admission (database) with collection date and admission date | gems-uff/labsys,gems-uff/labsys,gems-uff/labsys | tests/test_views.py | tests/test_views.py | import unittest
import datetime
from flask import current_app, url_for, get_flashed_messages
from app import create_app, db
from app.models import *
class TestCreateAdmissionView(unittest.TestCase):
def setUp(self):
self.app = create_app('testing')
self.app_context = self.app.app_context()
... | import unittest
from flask import current_app, url_for, get_flashed_messages
from app import create_app, db
from app.models import *
class TestCreateAdmissionView(unittest.TestCase):
def setUp(self):
self.app = create_app('testing')
self.app_context = self.app.app_context()
self.app_contex... | mit | Python |
6a4a3388c39115982019a6581a6f0393e33d92e1 | patch the daily coupons url to only accept integers | rapidsms/rapidsms-legacy,rapidsms/rapidsms-legacy,rapidsms/rapidsms-legacy | apps/nigeria/urls.py | apps/nigeria/urls.py | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import os
from django.conf.urls.defaults import *
import apps.nigeria.views as views
urlpatterns = patterns('',
url(r'^locgen/?$', views.generate),
url(r'^reports/?$', views.index),
url(r'^reports/summary/(?P<locid>\d*)/?$', views.index),
url(r'^repor... | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import os
from django.conf.urls.defaults import *
import apps.nigeria.views as views
urlpatterns = patterns('',
url(r'^locgen/?$', views.generate),
url(r'^reports/?$', views.index),
url(r'^reports/summary/(?P<locid>\d*)/?$', views.index),
url(r'^repor... | bsd-3-clause | Python |
354ee85623b948ec3a439caa35b9646be081762d | Add some maths | Py101/py101-assignments-marcosco,Py101/py101-assignments-marcosco | 01/myfirstprogram.py | 01/myfirstprogram.py | '''
my first program in python
'''
import sys
numbers = sys.argv[1:]
a,b = int(numbers[0]),int(numbers[1])
print("the number you've passed are:")
print(a,b)
print("a+b=", a+b)
print("a**b=", a**b)
print("a/b=", a/b)
print("a//b=", a//b)
print("a%b=", a%b)
| '''
my first program in python
'''
import sys
numbers = sys.argv[1:]
a,b = int(numbers[0]),int(numbers[1])
print("the number you've passed are:")
print(a,b)
print("a+b=", a+b) | mit | Python |
b700e45dba6e6f4341fbe3b2a7ae08d5052c5f1f | Revert "weird json object settings notation" | BowdoinOrient/bongo,BowdoinOrient/bongo,BowdoinOrient/bongo,BowdoinOrient/bongo | bongo/settings/prod.py | bongo/settings/prod.py | from os import environ
from common import *
# See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': SITE_NAME,
'USER': SITE_NAME,
'PASSWORD': environ.get("{}_POSTGRES_PASS".format(SIT... | from os import environ
from common import *
from logentries import LogentriesHandler
import logging
# See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': SITE_NAME,
'USER': SITE_NAME,
... | mit | Python |
dafcb40078e78c03fd2938cf9a31818301830bce | Fix tweeting. | ChattanoogaPublicLibrary/booksforcha | booksforcha/twitter.py | booksforcha/twitter.py | # -*- coding: utf-8 -*-
import tweepy
import os
from entry import get_next_to_run, remove_from_runner, send_runner_to_queue
CONSUMER_KEY = os.environ['CONSUMER_KEY']
CONSUMER_SECRET = os.environ['CONSUMER_SECRET']
ACCESS_TOKEN = os.environ['ACCESS_TOKEN']
ACCESS_TOKEN_SECRET = os.environ['ACCESS_TOKEN_SECRET']
def ... | # -*- coding: utf-8 -*-
import tweepy
import os
from entry import get_next_to_run, remove_from_runner, send_runner_to_queue
CONSUMER_KEY = os.environ['CONSUMER_KEY']
CONSUMER_SECRET = os.environ['CONSUMER_SECRET']
ACCESS_TOKEN = os.environ['ACCESS_TOKEN']
ACCESS_TOKEN_SECRET = os.environ['ACCESS_TOKEN_SECRET']
def ... | mit | Python |
a4fd67c068954aae11c2eee4d71ccf578404cfee | update admin interface, http://bugzilla.pculture.org/show_bug.cgi?id=15311 | ReachingOut/unisubs,wevoice/wesub,norayr/unisubs,ujdhesa/unisubs,pculture/unisubs,ReachingOut/unisubs,norayr/unisubs,norayr/unisubs,eloquence/unisubs,ujdhesa/unisubs,ofer43211/unisubs,wevoice/wesub,wevoice/wesub,pculture/unisubs,ofer43211/unisubs,pculture/unisubs,eloquence/unisubs,pculture/unisubs,ujdhesa/unisubs,Reach... | apps/videos/admin.py | apps/videos/admin.py | # Universal Subtitles, universalsubtitles.org
#
# Copyright (C) 2010 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License... | # Universal Subtitles, universalsubtitles.org
#
# Copyright (C) 2010 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License... | agpl-3.0 | Python |
a25dcc43dbebd91c845431a850c73f36b998ad6e | Increase version for release 0.3.1 | TissueMAPS/TmServer | tmserver/version.py | tmserver/version.py | # TmServer - TissueMAPS server application.
# Copyright (C) 2016 Markus D. Herrmann, University of Zurich and Robin Hafen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version... | # TmServer - TissueMAPS server application.
# Copyright (C) 2016 Markus D. Herrmann, University of Zurich and Robin Hafen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version... | agpl-3.0 | Python |
93e2ff0dd32a72efa90222988d4289c70bb55b98 | Add summary to book listing | c2corg/v6_api,c2corg/v6_api,c2corg/v6_api | c2corg_api/models/common/fields_book.py | c2corg_api/models/common/fields_book.py | DEFAULT_FIELDS = [
'locales.title',
'locales.summary',
'locales.description',
'locales.lang',
'author',
'editor',
'activities',
'url',
'isbn',
'book_types',
'publication_date',
'langs',
'nb_pages'
]
DEFAULT_REQUIRED = [
'locales',
'locales.title',
'book_t... | DEFAULT_FIELDS = [
'locales.title',
'locales.summary',
'locales.description',
'locales.lang',
'author',
'editor',
'activities',
'url',
'isbn',
'book_types',
'publication_date',
'langs',
'nb_pages'
]
DEFAULT_REQUIRED = [
'locales',
'locales.title',
'book_t... | agpl-3.0 | Python |
4683d651c1ed93d0813bffae5df34ca309ca099d | Update calc_inst_hr.py | MounikaVanka/bme590hrm,MounikaVanka/bme590hrm | Code/calc_inst_hr.py | Code/calc_inst_hr.py | import numpy as np
import scipy.signal
def calc_inst_hr(time, voltage):
""" calculate instantaneous HR from ECG data input
:param time: numpy array, seconds
:param voltage: numpy array, mV
:return: heart rate in bpm
"""
""" indices = peakutils.indexes(voltage,
... | import numpy as np
import scipy.signal
def calc_inst_hr(time, voltage):
""" calculate instantaneous HR from ECG data input
:param time: numpy array, seconds
:param voltage: numpy array, mV
:return: heart rate in bpm
"""
# indices = peakutils.indexes(voltage, thres = 0.95*np.max(voltage), min... | mit | Python |
51831743ab915eccd6144fdac16a9483fea84012 | Fix search in local dev | uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam | dev_settings.py | dev_settings.py | """
Extra Development settings
Will override any default settings if a 'development_mode' file exists.
"""
from default_settings import *
DEBUG = True
TEMPLATE_DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or ... | """
Extra Development settings
Will override any default settings if a 'development_mode' file exists.
"""
from default_settings import *
DEBUG = True
TEMPLATE_DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or ... | bsd-3-clause | Python |
4008824b7b7bf8338b057bc0b594774cb055c794 | Decrease pattern timebase to 0.01 sec now that slow-mo bug is fixed | jonspeicher/blinkyfun | blinkylib/patterns/blinkypattern.py | blinkylib/patterns/blinkypattern.py | class BlinkyPattern(object):
def __init__(self, blinkytape):
self._blinkytape = blinkytape
self._animated = False
self._timebase_sec = 0.01
@property
def animated(self):
return self._animated
@property
def timebase_sec(self):
return self._timebase_sec
d... | class BlinkyPattern(object):
def __init__(self, blinkytape):
self._blinkytape = blinkytape
self._animated = False
self._timebase_sec = 0.05
@property
def animated(self):
return self._animated
@property
def timebase_sec(self):
return self._timebase_sec
d... | mit | Python |
38845ecae177635b98a2e074355227f0c9f9834d | Add Widget and WidgetList to namespace | CartoDB/cartoframes,CartoDB/cartoframes | cartoframes/viz/widgets/__init__.py | cartoframes/viz/widgets/__init__.py | """
Widget functions to generate widgets faster.
"""
from __future__ import absolute_import
from .animation_widget import animation_widget
from .category_widget import category_widget
from .default_widget import default_widget
from .formula_widget import formula_widget
from .histogram_widget import histogram_widget
f... | """
Widget functions to generate widgets faster.
"""
from __future__ import absolute_import
from .animation_widget import animation_widget
from .category_widget import category_widget
from .default_widget import default_widget
from .formula_widget import formula_widget
from .histogram_widget import histogram_widget
f... | bsd-3-clause | Python |
3640a5b1976ea6c5b21617cda11324d73071fb9f | Fix for whitespace.py so that Windows will save Unix EOLs. | GoogleCloudPlatform/datastore-ndb-python,GoogleCloudPlatform/datastore-ndb-python | trimwhitespace.py | trimwhitespace.py | """Remove trailing whitespace from files in current path and sub directories."""
import os, glob
def scanpath(path):
for filepath in glob.glob(os.path.join(path, '*')):
if os.path.isdir(filepath):
scanpath(filepath)
else:
trimwhitespace(filepath)
def trimwhitespace(filepath):
handle = open(fi... | """Remove trailing whitespace from files in current path and sub directories."""
import os, glob
def scanpath(path):
for filepath in glob.glob(os.path.join(path, '*')):
if os.path.isdir(filepath):
scanpath(filepath)
else:
trimwhitespace(filepath)
def trimwhitespace(filepath):
handle = open(fi... | apache-2.0 | Python |
23584ddb3c598365f299f76b68ea7f5e9985be75 | fix current_roles contains a dict (#248) | vimalloc/flask-jwt-extended | examples/tokens_from_complex_objects.py | examples/tokens_from_complex_objects.py | from flask import Flask, jsonify, request
from flask_jwt_extended import (
JWTManager, jwt_required, create_access_token,
get_jwt_identity, get_jwt_claims
)
app = Flask(__name__)
app.config['JWT_SECRET_KEY'] = 'super-secret' # Change this!
jwt = JWTManager(app)
# This is an example of a complex object that... | from flask import Flask, jsonify, request
from flask_jwt_extended import (
JWTManager, jwt_required, create_access_token,
get_jwt_identity, get_jwt_claims
)
app = Flask(__name__)
app.config['JWT_SECRET_KEY'] = 'super-secret' # Change this!
jwt = JWTManager(app)
# This is an example of a complex object that... | mit | Python |
d98d6a83c666d18c959286f0e8d052d262ed3f5b | Allow editing preferred articles in Django admin | ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend | cla_backend/apps/knowledgebase/admin.py | cla_backend/apps/knowledgebase/admin.py | from django.contrib import admin
from .models import Article, ArticleCategoryMatrix
class ArticleCategoryMatrixInline(admin.TabularInline):
model = ArticleCategoryMatrix
class ArticleAdmin(admin.ModelAdmin):
actions = None
inlines = [ArticleCategoryMatrixInline]
ordering = ['service_name']
fie... | from django.contrib import admin
from .models import Article, ArticleCategoryMatrix
class ArticleCategoryMatrixInline(admin.TabularInline):
model = ArticleCategoryMatrix
class ArticleAdmin(admin.ModelAdmin):
actions = None
inlines = [ArticleCategoryMatrixInline]
ordering = ['service_name']
fie... | mit | Python |
51d5c78471b2605225106166b6fc480be61cbbd9 | remove extra return | andrewlehmann/autoweather | auto_weather/main.py | auto_weather/main.py | import schedule
import time
import sendmessage
import location
import getweather
import mongo
def job():
lat, lon = location.get_location()
weather = getweather.get_weather(lat, lon) # retrieve weather info
mongo.insert(weather) # put info in database
msg = sendmessage.create_message(we... | import schedule
import time
import sendmessage
import location
import getweather
import mongo
def job():
lat, lon = location.get_location()
weather = getweather.get_weather(lat, lon) # retrieve weather info
mongo.insert(weather) # put info in database
msg = sendmessage.create_message(we... | mit | Python |
5eebad6ffa7ed125d3d42710ca6d93b9457f8587 | Fix checkpointer and save model json file as well | theislab/dca,theislab/dca,theislab/dca | autoencoder/train.py | autoencoder/train.py | # Copyright 2016 Goekcen Eraslan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | # Copyright 2016 Goekcen Eraslan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | apache-2.0 | Python |
144b716eb321fb05458613a4a448dc3786445083 | Handle new users in suggestion module | DirkHoffmann/indico,pferreir/indico,OmeGak/indico,DirkHoffmann/indico,ThiefMaster/indico,mvidalgarcia/indico,pferreir/indico,pferreir/indico,indico/indico,mic4ael/indico,ThiefMaster/indico,mvidalgarcia/indico,mic4ael/indico,DirkHoffmann/indico,mvidalgarcia/indico,indico/indico,OmeGak/indico,mic4ael/indico,mvidalgarcia/... | indico/util/redis/suggestions.py | indico/util/redis/suggestions.py | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | mit | Python |
f08c465c7d3f096cdd468d681dad899355ef52b5 | Remove debug messages | karel-brinda/prophyle,karel-brinda/prophyle,karel-brinda/prophyle,karel-brinda/prophyle | bin/read_assignment.py | bin/read_assignment.py | #! /usr/bin/env python3
import os
import shutil
import datetime
import sys
import argparse
import operator
from ete3 import Tree
import logging
DEFAULT_FORMAT = 1
class TreeIndex:
def __init__(self,tree_newick_fn,format=DEFAULT_FORMAT):
self.tree_newick_fn=tree_newick_fn
self.tree=Tree(tree_newick_fn,format... | #! /usr/bin/env python3
import os
import shutil
import datetime
import sys
import argparse
import operator
from ete3 import Tree
import logging
DEFAULT_FORMAT = 1
class TreeIndex:
def __init__(self,tree_newick_fn,format=DEFAULT_FORMAT):
self.tree_newick_fn=tree_newick_fn
self.tree=Tree(tree_newick_fn,format... | mit | Python |
a4ceb78b6189ecb352099840ff32fc1b213e7b6b | Add toggling check products | stormaaja/csvconverter,stormaaja/csvconverter,stormaaja/csvconverter | stock_updater.py | stock_updater.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from multiple_products_found_error import MultipleProductsFoundError
from product_not_found_error import ProductNotFoundError
class StockUpdater:
def __init__(self, db_connection):
self.db_connection = db_connection
self.perform_check_product = True
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from multiple_products_found_error import MultipleProductsFoundError
from product_not_found_error import ProductNotFoundError
class StockUpdater:
def __init__(self, db_connection):
self.db_connection = db_connection
def set_items(self, items):
se... | mit | Python |
294eca830f1252057461dec6840303fca7760da3 | add published to Article | armstrong/armstrong.apps.articles,armstrong/armstrong.apps.articles | armstrong/apps/articles/models.py | armstrong/apps/articles/models.py | from armstrong.apps.content.models import Content
from armstrong.core.arm_content.mixins.publication import PublishedManager
from django.db import models
class Article(Content):
body = models.TextField()
published = PublishedManager()
| from armstrong.apps.content.models import Content
from django.db import models
class Article(Content):
body = models.TextField()
| apache-2.0 | Python |
13675da66f389759d405922f4771ad200f263a50 | fix filter check | legacysurvey/rapala,legacysurvey/rapala,imcgreer/rapala | bokrmpipe/bokrmpipe.py | bokrmpipe/bokrmpipe.py | #!/usr/bin/env python
import os
import re
import glob
from copy import copy
import multiprocessing
import numpy as np
from numpy.core.defchararray import add as char_add
import fitsio
from astropy.table import Table
from bokpipe import bokpl
from bokpipe import __version__ as pipeVersion
def load_darksky_frames(filt... | #!/usr/bin/env python
import os
import re
import glob
from copy import copy
import multiprocessing
import numpy as np
from numpy.core.defchararray import add as char_add
import fitsio
from astropy.table import Table
from bokpipe import bokpl
from bokpipe import __version__ as pipeVersion
def load_darksky_frames(filt... | bsd-3-clause | Python |
ec62d4f439299f20b7321e83a49e585aca644aab | refactor __main__.cli and __main__.main | Thor77/TeamspeakStats,Thor77/TeamspeakStats | tsstats/__main__.py | tsstats/__main__.py | import argparse
import json
import logging
from os.path import abspath, exists
from tsstats.config import parse_config
from tsstats.exceptions import InvalidConfig
from tsstats.log import parse_logs
from tsstats.template import render_template
logger = logging.getLogger('tsstats')
def cli():
parser = argparse.A... | import argparse
import json
import logging
from os.path import abspath, exists
from tsstats.config import parse_config
from tsstats.exceptions import ConfigNotFound
from tsstats.log import parse_logs
from tsstats.template import render_template
logger = logging.getLogger('tsstats')
def cli():
parser = argparse.... | mit | Python |
d510ae8c08e5fd34d9bd73e23af1d6762e05e0fd | Bump version | basepair/basepair-python,basepair/basepair-python | basepair/__init__.py | basepair/__init__.py | '''set up basepair package'''
from __future__ import print_function
import sys
import requests
from .utils import colors
# from .api import basepair
__title__ = 'basepair'
__version__ = '1.6.6'
__copyright__ = 'Copyright [2017] - [2020] Basepair INC'
JSON_URL = 'https://pypi.python.org/pypi/{}/json'.format(__title... | '''set up basepair package'''
from __future__ import print_function
import sys
import requests
from .utils import colors
# from .api import basepair
__title__ = 'basepair'
__version__ = '1.6.5'
__copyright__ = 'Copyright [2017] - [2020] Basepair INC'
JSON_URL = 'https://pypi.python.org/pypi/{}/json'.format(__title... | mit | Python |
a7799346a5f2ce5c9fdb276e2957d3ed1f8efc7f | Fix for RHESSI sample image header parsing | dpshelio/sunpy,mjm159/sunpy,dpshelio/sunpy,Alex-Ian-Hamilton/sunpy,Alex-Ian-Hamilton/sunpy,mjm159/sunpy,Alex-Ian-Hamilton/sunpy,dpshelio/sunpy | sunpy/io/fits.py | sunpy/io/fits.py | """
FITS File Reader
Notes
-----
PyFITS
[1] Due to the way PyFITS works with images the header dictionary may
differ depending on whether is accessed before or after the fits[0].data
is requested. If the header is read before the data then the original
header will be returned. If the header is read aft... | """
FITS File Reader
Notes
-----
PyFITS
[1] Due to the way PyFITS works with images the header dictionary may
differ depending on whether is accessed before or after the fits[0].data
is requested. If the header is read before the data then the original
header will be returned. If the header is read aft... | bsd-2-clause | Python |
ff3ea3b00bc7819abd6adac92ddb574b547f9ba3 | remove PyJWT deprecation warning by adding algorithms (#8267) | conan-io/conan,conan-io/conan,conan-io/conan | conans/server/crypto/jwt/jwt_manager.py | conans/server/crypto/jwt/jwt_manager.py | from datetime import datetime
import jwt
class JWTManager(object):
"""
Handles the JWT token generation and encryption.
"""
def __init__(self, secret, expire_time):
"""expire_time is a timedelta
secret is a string with the secret encoding key"""
self.secret = secret
... | from datetime import datetime
import jwt
class JWTManager(object):
"""
Handles the JWT token generation and encryption.
"""
def __init__(self, secret, expire_time):
"""expire_time is a timedelta
secret is a string with the secret encoding key"""
self.secret = secret
... | mit | Python |
326a0a1af140e3a57ccf31c3c9c5e17a5775c13d | Bump to v0.5.2 | onecodex/onecodex,refgenomics/onecodex,refgenomics/onecodex,onecodex/onecodex | onecodex/version.py | onecodex/version.py | __version__ = "0.5.2"
| __version__ = "0.5.1"
| mit | Python |
4c3d5c357f39699b82ed609fbcc0f62d59a00093 | bump version in __init__.py | WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow,1flow/1flow,1flow/1flow,WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow,1flow/1flow | oneflow/__init__.py | oneflow/__init__.py |
VERSION = '0.20.5.1'
|
VERSION = '0.20.5'
| agpl-3.0 | Python |
5ae32d659b7eacc52b91b53e8f8809814e9478aa | allow users to configure check layout | ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo | addons/account_check_printing/models/res_config_settings.py | addons/account_check_printing/models/res_config_settings.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
country_code = fields.Char(string="Company Country code", related='company_id.country_id.code', ... | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
country_code = fields.Char(string="Company Country code", related='company_id.country_id.code', ... | agpl-3.0 | Python |
d31d2a73127a79566651e644d105cbe2063a6e2a | Fix for the new cloudly APi. | hdemers/webapp-template,hdemers/webapp-template,hdemers/webapp-template | webapp/publish.py | webapp/publish.py | from cloudly.pubsub import Pusher
from cloudly.tweets import Tweets, StreamManager, keep
from webapp import config
pubsub = Pusher.open(config.pubsub_channel)
def processor(tweets):
pubsub.publish(keep(['coordinates'], tweets), "tweets")
return len(tweets)
def start():
streamer = StreamManager('locate... | from cloudly.pubsub import Pusher
from cloudly.tweets import Tweets
from cloudly.twitterstream import Streamer
from webapp import config
class Publisher(Pusher):
def publish(self, tweets, event):
"""Keep only relevant fields from the given tweets."""
stripped = []
for tweet in tweets:
... | mit | Python |
0370e765f635edf670508ee09be9bd9139967543 | Upgrade to v0.2.28 | biolink/ontobio,biolink/ontobio | ontobio/__init__.py | ontobio/__init__.py | from __future__ import absolute_import
__version__ = '0.2.28'
from .ontol_factory import OntologyFactory
from .ontol import Ontology, Synonym, TextDefinition
from .assoc_factory import AssociationSetFactory
from .io.ontol_renderers import GraphRenderer
| from __future__ import absolute_import
__version__ = '0.2.27'
from .ontol_factory import OntologyFactory
from .ontol import Ontology, Synonym, TextDefinition
from .assoc_factory import AssociationSetFactory
from .io.ontol_renderers import GraphRenderer
| bsd-3-clause | Python |
4ed1e969082046d7e92c5f311820c518930976c5 | add some doc strings | openaps/openaps,openaps/openaps | openaps/uses/use.py | openaps/uses/use.py |
"""
use - module for openaps devices to re-use
"""
from openaps.cli.subcommand import Subcommand
class Use (Subcommand):
"""A no-op base use.
A Use is a mini well-behaved linux application.
openaps framework will initialize your Use with a `method` and
`parent` objects, which are contextual objects wit... |
from openaps.cli.subcommand import Subcommand
class Use (Subcommand):
"""A no-op base use."""
pass
def __init__ (self, method=None, parent=None):
self.method = method
self.name = self.__class__.__name__.split('.').pop( )
self.parent = parent
self.device = parent.device
def main (self, args, ap... | mit | Python |
74e24981c31445a16734d921ef4781dab8070d3a | Add static paths | westerncapelabs/uopbmoh-hub,westerncapelabs/uopboh-hub,westerncapelabs/uopbmoh-hub,westerncapelabs/uopbmoh-hub | uopbmoh_hub/urls.py | uopbmoh_hub/urls.py | import os
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
admin.site.site_header = os.environ.get('UOPBMOH_HUB_TITLE', 'UoPBMoH Admin')
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls... | import os
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.site.site_header = os.environ.get('UOPBMOH_HUB_TITLE', 'UoPBMoH Admin')
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls)),
url(r'^', include('hub.urls')),
)
| bsd-3-clause | Python |
9de6956c6732d403916bf33702c16d75b5be1cff | add iterator to the log output on port-creation | CiscoSystems/os-sqe,CiscoSystems/os-sqe,CiscoSystems/os-sqe | lab/scenarios/net_subnet_port.py | lab/scenarios/net_subnet_port.py | def once(command, log):
net_id = command('neutron net-create')
command('neutron subnet-create {net_id} 10.0.100.0/24'.format(net_id=net_id))
command('neutron port-create {net_id}'.format(net_id=net_id))
def start(lab, log, args):
import time
import re
how_many = args['how_many']
unique_p... | def once(command, log):
net_id = command('neutron net-create')
command('neutron subnet-create {net_id} 10.0.100.0/24'.format(net_id=net_id))
command('neutron port-create {net_id}'.format(net_id=net_id))
log.info('net-subnet-port created')
def start(lab, log, args):
import time
import re
... | apache-2.0 | Python |
4a7b548511fa0651aa0bc526302d13947941dacc | Return status code 200 when Device instance already exists | willandskill/django-parse-push | parse_push/views.py | parse_push/views.py | from django.db import IntegrityError
from rest_framework.permissions import IsAuthenticated
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from .serializers import DeviceSerializer
class DeviceTokenSetter(APIView):
"""
Set a push token... | from django.db import IntegrityError
from rest_framework.permissions import IsAuthenticated
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from .serializers import DeviceSerializer
class DeviceTokenSetter(APIView):
"""
Set a push token... | bsd-3-clause | Python |
8d28f866109223abedf6cac88c44234061bcd7f5 | Fix missing PLC pips | gatecat/prjoxide,gatecat/prjoxide,gatecat/prjoxide | fuzzers/LIFCL/001-plc-routing/fuzzer.py | fuzzers/LIFCL/001-plc-routing/fuzzer.py | from fuzzconfig import FuzzConfig
from interconnect import fuzz_interconnect
import re
cfg = FuzzConfig(job="PLCROUTE", device="LIFCL-40", sv="../shared/route_40.v", tiles=["R16C22:PLC"])
def main():
cfg.setup()
r = 16
c = 22
nodes = ["R{}C{}_J*".format(r, c)]
extra_sources = []
extra_sources ... | from fuzzconfig import FuzzConfig
from interconnect import fuzz_interconnect
import re
cfg = FuzzConfig(job="PLCROUTE", device="LIFCL-40", sv="../shared/route_40.v", tiles=["R16C22:PLC"])
def main():
cfg.setup()
r = 16
c = 22
nodes = ["R{}C{}_J*".format(r, c)]
fuzz_interconnect(config=cfg, nodenam... | isc | Python |
5415fff9e51e02512d2d5e42ce22824670c83024 | Change writelines approach | ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools,ubtue/ub_tools | cronjobs/fetch_interlibraryloan_ppns.py | cronjobs/fetch_interlibraryloan_ppns.py | #!/bin/python2
# -*- coding: utf-8 -*-
import datetime
import json
import os
import re
import sys
import time
import traceback
import urllib
import util
GVI_URL = 'http://gvi.bsz-bw.de/solr/GVI/select?rows=50000&wt=json&indent=true&fl=id&q=material_media_type:Book+AND+(ill_flag:Loan+OR+ill_flag:Copy+OR+ill... | #!/bin/python2
# -*- coding: utf-8 -*-
import datetime
import json
import os
import re
import sys
import time
import traceback
import urllib
import util
GVI_URL = 'http://gvi.bsz-bw.de/solr/GVI/select?rows=50000&wt=json&indent=true&fl=id&q=material_media_type:Book+AND+(ill_flag:Loan+OR+ill_flag:Copy+OR+ill... | agpl-3.0 | Python |
c42acd3e6d8e9371be84b9f94aa6c151b80ff123 | update to the app launcher locator for summer '19 | SalesforceFoundation/CumulusCI,SalesforceFoundation/CumulusCI | cumulusci/robotframework/locators_46.py | cumulusci/robotframework/locators_46.py | from cumulusci.robotframework import locators_45
lex_locators = locators_45.lex_locators.copy()
# oof. This is gnarly.
# Apparently, in 45 all modal buttons are in a class named 'modal-footer'
# but in 46 some are in a class named 'actionsContainer' instead.
lex_locators["modal"]["button"] = "{}{}{}".format(
"//d... | from cumulusci.robotframework import locators_45
lex_locators = locators_45.lex_locators.copy()
# oof. This is gnarly.
# Apparently, in 45 all modal buttons are in a class named 'modal-footer'
# but in 46 some are in a class named 'actionsContainer' instead.
lex_locators["modal"]["button"] = "{}{}{}".format(
"//d... | bsd-3-clause | Python |
f18dd0a73738db0e20a2f3c0e81151d4383ea860 | Bump to 0.8.4 | alexmojaki/birdseye,alexmojaki/birdseye,alexmojaki/birdseye,alexmojaki/birdseye | birdseye/__init__.py | birdseye/__init__.py | import sys
from importlib import import_module
__version__ = '0.8.4'
# birdseye has so many dependencies that simply importing them can be quite slow
# Sometimes you just want to leave an import sitting around without actually using it
# These proxies ensure that if you do, program startup won't be slowed down
# In ... | import sys
from importlib import import_module
__version__ = '0.8.3'
# birdseye has so many dependencies that simply importing them can be quite slow
# Sometimes you just want to leave an import sitting around without actually using it
# These proxies ensure that if you do, program startup won't be slowed down
# In ... | mit | Python |
53883178d786173d227d5e6062ab5b03fa087068 | Change version to 1.9.3.2 | Elec/django-bitfield | bitfield/__init__.py | bitfield/__init__.py | """
django-bitfield
~~~~~~~~~~~~~~~
"""
from __future__ import absolute_import
from bitfield.models import Bit, BitHandler, CompositeBitField, BitField # NOQA
default_app_config = 'bitfield.apps.BitFieldAppConfig'
VERSION = '1.9.3.2'
| """
django-bitfield
~~~~~~~~~~~~~~~
"""
from __future__ import absolute_import
from bitfield.models import Bit, BitHandler, CompositeBitField, BitField # NOQA
default_app_config = 'bitfield.apps.BitFieldAppConfig'
VERSION = '1.9.3'
| apache-2.0 | Python |
bfd516db001ef5a208be2d1c60764587d2609d1a | Add status column to order payment administration | armicron/plata,armicron/plata,armicron/plata,stefanklug/plata,allink/plata | plata/shop/admin.py | plata/shop/admin.py | from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from . import models
class OrderItemInline(admin.TabularInline):
model = models.OrderItem
raw_id_fields = ('variation',)
class AppliedDiscountInline(admin.TabularInline):
model = models.AppliedDiscount
class OrderS... | from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from . import models
class OrderItemInline(admin.TabularInline):
model = models.OrderItem
raw_id_fields = ('variation',)
class AppliedDiscountInline(admin.TabularInline):
model = models.AppliedDiscount
class OrderS... | bsd-3-clause | Python |
f683291c406d9ad9e1a331f4e01ade335d78193e | Set the DJANGO_HOSTNAME in the wsgi file based on the servername options | mark0978/deployment | deployment/templates/deployment/wsgi.py | deployment/templates/deployment/wsgi.py | import os, sys
sys.path = [
{% for part in sys.path %} "{{ part }}",
{% endfor %}
]
from django.core.handlers.wsgi import WSGIHandler
#import pinax.env
#setup the environment for Django and Pinax
#pinax.env.setup_environ(__file__, settings_path=os.path.abspath(os.path.join()
{% if options.servername %}
os.enviro... | import os, sys
sys.path = [
{% for part in sys.path %} "{{ part }}",
{% endfor %}
]
from django.core.handlers.wsgi import WSGIHandler
#import pinax.env
#setup the environment for Django and Pinax
#pinax.env.setup_environ(__file__, settings_path=os.path.abspath(os.path.join()
os.environ["DJANGO_SETTINGS_MODULE"] ... | mit | Python |
77d4651231e6980ccc0b96109fc8033d277f5752 | Update Place Model | folse/MTS,folse/MTS,folse/MTS | Management/models.py | Management/models.py | from django.db import models
class Place(models.Model):
name = models.CharField(max_length=64)
photo = models.CharField(max_length=512)
latitude = models.FloatField(max_length=32)
longitude = models.FloatField(max_length=32)
phone = models.CharField(max_length=32)
open_hour = models.CharField(m... | from django.db import models
class Place(models.Model):
name = models.CharField(max_length=64)
photo = models.CharField(max_length=512)
latitude = models.FloatField(max_length=32)
longitude = models.FloatField(max_length=32)
phone = models.CharField(max_length=32)
news = models.CharField(max_le... | mit | Python |
c1f5b9e3bfa96762fdbe9f4ca54b3851b38294da | Add versioned path for dynamic library lookup | badboy/hiredis-py-win,charsyam/hiredis-py,badboy/hiredis-py-win,redis/hiredis-py,charsyam/hiredis-py,badboy/hiredis-py-win,redis/hiredis-py | test/__init__.py | test/__init__.py | import glob, os.path, sys
version = sys.version.split(" ")[0]
majorminor = version[0:3]
# Add path to hiredis.so load path
path = glob.glob("build/lib*-%s/hiredis/*.so" % majorminor)[0]
sys.path.insert(0, os.path.dirname(path))
from unittest import *
from . import reader
def tests():
suite = TestSuite()
suite.a... | import glob, os.path, sys
# Add path to hiredis.so load path
path = glob.glob("build/lib*/hiredis/*.so")[0]
sys.path.insert(0, os.path.dirname(path))
from unittest import *
from . import reader
def tests():
suite = TestSuite()
suite.addTest(makeSuite(reader.ReaderTest))
return suite
| bsd-3-clause | Python |
9e80b368b01cb11a7ac0d97143ea69aa6dd2eef0 | fix skipping tests on OSX | gardner/urllib3,silveringsea/urllib3,Disassem/urllib3,luca3m/urllib3,Geoion/urllib3,asmeurer/urllib3,mikelambert/urllib3,tutumcloud/urllib3,sigmavirus24/urllib3,matejcik/urllib3,boyxuper/urllib3,tutumcloud/urllib3,denim2x/urllib3,asmeurer/urllib3,matejcik/urllib3,Disassem/urllib3,sornars/urllib3,gardner/urllib3,sileht/... | test/__init__.py | test/__init__.py | import errno
import functools
import socket
from nose.plugins.skip import SkipTest
from urllib3.exceptions import MaxRetryError
from urllib3.packages import six
def onlyPY3(test):
"""Skips this test unless you are on Python3.x"""
@functools.wraps(test)
def wrapper(*args, **kwargs):
msg = "{name}... | import errno
import functools
import socket
from nose.plugins.skip import SkipTest
from urllib3.exceptions import MaxRetryError
from urllib3.packages import six
def onlyPY3(test):
"""Skips this test unless you are on Python3.x"""
@functools.wraps(test)
def wrapper(*args, **kwargs):
msg = "{name}... | mit | Python |
4a854b68588cbc943fdf0145daa3552587894202 | fix import for CentOS | cdr-stats/cdr-stats,Star2Billing/cdr-stats,areski/cdr-stats,cdr-stats/cdr-stats,Star2Billing/cdr-stats,areski/cdr-stats,Star2Billing/cdr-stats,cdr-stats/cdr-stats,areski/cdr-stats,cdr-stats/cdr-stats,Star2Billing/cdr-stats,areski/cdr-stats | cdr_stats/cdr/admin.py | cdr_stats/cdr/admin.py | from cdr.models import *
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.db.models import Q
from cdr.models import Customer, Staff
class UserProfileInline(admin.StackedInline):
model = UserProfile
class StaffAdmin(UserAdmin... | from cdr.models import *
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.db.models import Q
from .models import Customer, Staff
class UserProfileInline(admin.StackedInline):
model = UserProfile
class StaffAdmin(UserAdmin):
... | mpl-2.0 | Python |
e8e14e04903b8e81782b0818a80fecb14bbd202c | update a test for HTCondorJobSubmitter | alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl | tests/unit/concurrently/test_HTCondorJobSubmitter.py | tests/unit/concurrently/test_HTCondorJobSubmitter.py | # Tai Sakuma <tai.sakuma@gmail.com>
import os
import sys
import logging
import textwrap
import pytest
try:
import unittest.mock as mock
except ImportError:
import mock
from alphatwirl.concurrently import HTCondorJobSubmitter
##__________________________________________________________________||
job_desc_tem... | # Tai Sakuma <tai.sakuma@gmail.com>
import os
import sys
import logging
import textwrap
import pytest
try:
import unittest.mock as mock
except ImportError:
import mock
from alphatwirl.concurrently import HTCondorJobSubmitter
##__________________________________________________________________||
job_desc_tem... | bsd-3-clause | Python |
7ff95411cf999d074b7ae8496ea33f083ac78de6 | Add test for push --ship command | cloudControl/cctrl,cloudControl/cctrl | test/app_test.py | test/app_test.py | import unittest
from mock import patch, call, Mock
from cctrl.error import InputErrorException
from cctrl.app import AppController
from cctrl.settings import Settings
class AppControllerTestCase(unittest.TestCase):
def test_get_size_from_memory_1gb(self):
self.assertEqual(8, AppController(None, Settings(... | import unittest
from mock import patch, call, Mock
from cctrl.error import InputErrorException
from cctrl.app import AppController
from cctrl.settings import Settings
class AppControllerTestCase(unittest.TestCase):
def test_get_size_from_memory_1gb(self):
self.assertEqual(8, AppController(None, Settings(... | apache-2.0 | Python |
ec94b6b15cabc3a190ec59ab822330d9410af56f | Update tag search | ping/instagram_private_api | instagram_private_api/endpoints/tags.py | instagram_private_api/endpoints/tags.py | import json
class TagsEndpointsMixin(object):
"""For endpoints in ``/tags/``."""
def tag_info(self, tag):
"""
Get tag info
:param tag:
:return:
"""
endpoint = 'tags/{tag!s}/info/'.format(**{'tag': tag})
res = self._call_api(endpoint)
return res... | import json
class TagsEndpointsMixin(object):
"""For endpoints in ``/tags/``."""
def tag_info(self, tag):
"""
Get tag info
:param tag:
:return:
"""
endpoint = 'tags/{tag!s}/info/'.format(**{'tag': tag})
res = self._call_api(endpoint)
return res... | mit | Python |
ae9ba3c6bfdb5f9e47a16e8d8f8585d73fd2edce | format code | phodal/growth-code,phodal/growth-code,phodal/growth-code | chapter5/blog/tests.py | chapter5/blog/tests.py | from datetime import datetime
from django.core.urlresolvers import resolve
from django.test import TestCase
from blog.models import Blog
from blog.views import blog_detail
class BlogpostTest(TestCase):
def test_blogpost_url_resolves_to_blog_post_view(self):
found = resolve('/blog/this_is_a_test.html')
... | from datetime import datetime
from django.core.urlresolvers import resolve
from django.test import TestCase
from blog.models import Blog
from blog.views import blog_detail
class BlogpostTest(TestCase):
def test_blogpost_url_resolves_to_blog_post_view(self):
found = resolve('/blog/this_is_a_test.html')
... | mit | Python |
b03e993c8d9ecf344b3f05432b0c07ecaba6fe89 | Fix pip example for latest CentOS 8 Docker image. | Fizzadar/pyinfra,Fizzadar/pyinfra | examples/pip.py | examples/pip.py | from pyinfra import host
from pyinfra.operations import apk, apt, files, pip, python, yum
SUDO = True
if host.fact.linux_name in ['Alpine']:
apk.packages(
name='Install packages for python virtual environments',
packages=[
'gcc',
'libffi-dev',
'make',
... | from pyinfra import host
from pyinfra.operations import apk, apt, files, pip, python, yum
SUDO = True
if host.fact.linux_name in ['Alpine']:
apk.packages(
name='Install packages for python virtual environments',
packages=[
'gcc',
'libffi-dev',
'make',
... | mit | Python |
6a22a5c7429b66010eb023643d838c7f0beb31b8 | use argparse for robust parsing | andrewSC/checkthat | checkthat/checkthat.py | checkthat/checkthat.py | import datetime
import os
import sys
import smtplib
import argparse
from .models import BuildFailure
from .builders import PackageBuilder
from .views import EmailView
def gather_pkgbuild_paths(root_pkgs_dir):
pkgbuild_paths = []
for root, dirs, files in os.walk(root_pkgs_dir):
if 'PKGBUILD' in files... | import datetime
import os
import sys
import smtplib
from .models import BuildFailure
from .builders import PackageBuilder
from .views import EmailView
def gather_pkgbuild_paths(root_pkgs_dir):
pkgbuild_paths = []
for root, dirs, files in os.walk(root_pkgs_dir):
if 'PKGBUILD' in files:
pk... | mit | Python |
2950cc7c2cccdf32a7494299158dee31316c3248 | Choose SPW | e-koch/canfar_scripts,e-koch/canfar_scripts | cal_pipe/plot_scans.py | cal_pipe/plot_scans.py |
import numpy as np
import re
import os
ms_active = raw_input("MS? : ")
field_str = raw_input("Field? : ")
spw_str = raw_input("SPW? : ")
tb.open(ms_active+"/FIELD")
names = tb.getcol('NAME')
matches = [string for string in names if re.match(field_str, string)]
posn_matches = \
[i for i, string in enumerate(nam... |
import numpy as np
import re
import os
ms_active = raw_input("MS? : ")
field_str = raw_input("Field? : ")
tb.open(ms_active+"/FIELD")
names = tb.getcol('NAME')
matches = [string for string in names if re.match(field_str, string)]
posn_matches = \
[i for i, string in enumerate(names) if re.match(field_str, stri... | mit | Python |
fec2f62104a37f703341e4732e0a4f094f0d6750 | Bump version | brynpickering/calliope,calliope-project/calliope,brynpickering/calliope | calliope/_version.py | calliope/_version.py | __version__ = '0.4.0-dev'
| __version__ = '0.3.8-dev'
| apache-2.0 | Python |
34c71dc8914fe753010e94b0cb0779418846c99f | Use apt-get instead of aptitude | fabtools/fabtools,pombredanne/fabtools,ahnjungho/fabtools,bitmonk/fabtools,prologic/fabtools,AMOSoft/fabtools,pahaz/fabtools,sociateru/fabtools,n0n0x/fabtools-python,ronnix/fabtools,hagai26/fabtools,badele/fabtools,wagigi/fabtools-python,davidcaste/fabtools | fabtools/deb.py | fabtools/deb.py | """
Fabric tools for managing Debian/Ubuntu packages
"""
from fabric.api import *
MANAGER = 'apt-get'
def update_index():
"""
Quietly update package index
"""
sudo("%s -q -q update" % MANAGER)
def upgrade(safe=True):
"""
Upgrade all packages
"""
manager = MANAGER
cmds = {'apt-g... | """
Fabric tools for managing Debian/Ubuntu packages
"""
from fabric.api import *
def update_index():
"""
Quietly update package index
"""
sudo("aptitude -q -q update")
def upgrade():
"""
Upgrade all packages
"""
sudo("aptitude --assume-yes safe-upgrade")
def is_installed(pkg_name)... | bsd-2-clause | Python |
b2e471813a27150b28071dc3caa4e4f3e41401c3 | Remove dory reference | openstack/poppy,obulpathi/cdn1,amitgandhinz/cdn,openstack/poppy,obulpathi/poppy,stackforge/poppy,openstack/poppy,obulpathi/cdn1,amitgandhinz/cdn,obulpathi/poppy,stackforge/poppy,obulpathi/poppy,stackforge/poppy | cdn/transport/app.py | cdn/transport/app.py | # Copyright (c) 2014 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | # Copyright (c) 2014 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 | Python |
3e30737c98a4a9e890d362ba4cbbb2315163bc29 | Remove unused Python 2 support | kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh | cfgov/v1/__init__.py | cfgov/v1/__init__.py | from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.urlresolvers import reverse
from django.template.defaultfilters import slugify
from wagtail.wagtailcore.templatetags import wagtailcore_tags
from wagtail.wagtailadmin.templatetags import wagtailuserbar
from jinja2 import Environment
fr... | from __future__ import absolute_import # Python 2 only
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.urlresolvers import reverse
from django.template.defaultfilters import slugify
from wagtail.wagtailcore.templatetags import wagtailcore_tags
from wagtail.wagtailadmin.templatetags... | cc0-1.0 | Python |
28e7f68022f17657f91ba30feffae49ddefe5227 | Update version to 0.8.6 | vkosuri/ChatterBot,gunthercox/ChatterBot | chatterbot/__init__.py | chatterbot/__init__.py | """
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '0.8.6'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
| """
ChatterBot is a machine learning, conversational dialog engine.
"""
from .chatterbot import ChatBot
__version__ = '0.8.5'
__author__ = 'Gunther Cox'
__email__ = 'gunthercx@gmail.com'
__url__ = 'https://github.com/gunthercox/ChatterBot'
__all__ = (
'ChatBot',
)
| bsd-3-clause | Python |
a2d3e7113dcda7c5f4ebaff96bdb9ac39ed434f9 | fix import error | arokem/nipy,nipy/nipy-labs,alexis-roche/nipy,alexis-roche/register,nipy/nireg,arokem/nipy,alexis-roche/nipy,bthirion/nipy,bthirion/nipy,alexis-roche/register,bthirion/nipy,alexis-roche/register,alexis-roche/nireg,alexis-roche/niseg,arokem/nipy,nipy/nipy-labs,nipy/nireg,alexis-roche/nipy,alexis-roche/nipy,alexis-roche/n... | nipy/algorithms/registration/__init__.py | nipy/algorithms/registration/__init__.py | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from .resample import resample
from .histogram_registration import (HistogramRegistration, clamp,
ideal_spacing, interp_methods)
from .affine import (threshold, rotation_... | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from .resample import resample
from .histogram_registration import (HistogramRegistration, clamp,
ideal_spacing, interp_methods)
from .affine import (threshold, rotation_... | bsd-3-clause | Python |
39e30520ce6c1cf01fc35f18f8b01f8668af55ed | add v2.4.1 (#22172) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/bpp-core/package.py | var/spack/repos/builtin/packages/bpp-core/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 BppCore(CMakePackage):
"""Bio++ core library."""
homepage = "http://biopp.univ-montp2... | # 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 BppCore(CMakePackage):
"""Bio++ core library."""
homepage = "http://biopp.univ-montp2... | lgpl-2.1 | Python |
8d052a48b2fc8dfe2110c006aec886b163ba9a55 | fix python3 comp., metric ordering | loadimpact/loadimpact-cli | loadimpactcli/metric_commands.py | loadimpactcli/metric_commands.py | # coding=utf-8
"""
Copyright 2016 Load Impact
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writi... | # coding=utf-8
"""
Copyright 2016 Load Impact
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writi... | apache-2.0 | Python |
ed050be8138c14428184cb99d19a3422ff2956fc | set version to 1.0.0 | simonsdave/clair-database,simonsdave/clair-cicd,simonsdave/clair-database,simonsdave/clair-cicd,simonsdave/clair-cicd | clair_cicd/__init__.py | clair_cicd/__init__.py | #
# this is the package version number
#
__version__ = '1.0.0'
#
# a few different components in this project need to make
# sure they use the same version of Clair and hence the
# motivation for having __clair_version__
#
# see https://quay.io/repository/coreos/clair?tab=tags
#
__clair_version__ = 'v2.1.2'
| #
# this is the package version number
#
__version__ = '0.6.0'
#
# a few different components in this project need to make
# sure they use the same version of Clair and hence the
# motivation for having __clair_version__
#
# see https://quay.io/repository/coreos/clair?tab=tags
#
__clair_version__ = 'v2.1.2'
| mit | Python |
f2d1d08ac3c0437c1649af90d699dd5e283b0948 | Add SK_IGNORE_UNDERLINE_POSITION_FIX to stage underline position fix. | primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs | public/blink_skia_config.gyp | public/blink_skia_config.gyp | #
# Copyright (C) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions an... | #
# Copyright (C) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions an... | bsd-3-clause | Python |
f7cd2a6a70ac0eda24f57d328273b9ff146b4f4a | make this a bit more useable and interesting | rdkit/rdkit-orig,rdkit/rdkit-orig,rdkit/rdkit-orig,rdkit/rdkit-orig,rdkit/rdkit-orig,rdkit/rdkit-orig,rdkit/rdkit-orig,rdkit/rdkit-orig | Code/Demos/RDKit/MPI/rdkpympi.py | Code/Demos/RDKit/MPI/rdkpympi.py | # $Id$
#
# Copyright (C) 2009 Greg Landrum
# All rights reserved
#
# Demo for using boost.mpi with the RDKit
#
# run this with : mpirun -n 4 python rdkpympi.py
#
from boost import mpi
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.RDLogger import logger
logger = logger()
def dividetask(data,task,sil... | # $Id$
#
# Copyright (C) 2009 Greg Landrum
# All rights reserved
#
# Demo for using boost.mpi with the RDKit
#
# run this with : mpirun -n 4 python rdkpympi.py
#
from boost import mpi
from rdkit import Chem
import sys
if mpi.world.rank==0:
data = [Chem.MolFromSmiles('C'*x) for x in range(1,100)]
else:
data=No... | bsd-3-clause | Python |
94a4d09c1a484602070b06760581ad02ee01639e | update link | Pinaute/OctoPrint_FreeMobile-Notifier,Pinaute/OctoPrint_FreeMobile-Notifier | octoprint_freemobilenotifier/__init__.py | octoprint_freemobilenotifier/__init__.py | # coding=utf-8
from __future__ import absolute_import
import os
import octoprint.plugin
import urllib2
class FreemobilenotifierPlugin(octoprint.plugin.EventHandlerPlugin,
octoprint.plugin.SettingsPlugin,
octoprint.plugin.AssetPlugin,
... | # coding=utf-8
from __future__ import absolute_import
import os
import octoprint.plugin
import urllib2
class FreemobilenotifierPlugin(octoprint.plugin.EventHandlerPlugin,
octoprint.plugin.SettingsPlugin,
octoprint.plugin.AssetPlugin,
... | agpl-3.0 | Python |
cb4b7ce7cbb9e7e951dacc5e4f38a31c045038cd | Fix ResourcePath ctor (to restore Python 2.7 compatibility) #473 | vgrem/Office365-REST-Python-Client | office365/runtime/paths/resource_path.py | office365/runtime/paths/resource_path.py | from office365.runtime.client_path import ClientPath
class ResourcePath(ClientPath):
"""OData resource path"""
def __init__(self, name, parent=None):
"""
:param str name: entity or property name
:type parent: office365.runtime.client_path.ClientPath or None
"""
super(... | from office365.runtime.client_path import ClientPath
class ResourcePath(ClientPath):
"""OData resource path"""
def __init__(self, name, parent=None):
"""
:param str name: entity or property name
:type parent: office365.runtime.client_path.ClientPath or None
"""
super(... | mit | Python |
0cbbc0eac7ea87e6a7c2c92599ed9d37fd22a477 | move some globals | mattsmart/biomodels,mattsmart/biomodels,mattsmart/biomodels | oncogenesis_dynamics/python/constants.py | oncogenesis_dynamics/python/constants.py | """
Comments
- current implementation for bifurcation along VALID_BIFURCATION_PARAMS only
- no stability calculation implemented (see matlab code for that)
Conventions
- params is 7-vector of the form: params[0] -> alpha_plus
params[1] -> alpha_minus
... | mit | Python | |
f20c0b650da2354f3008c7a0933eb32a1409fbf0 | Add domain or and ilike | KarenKawaii/openacademy-project | openacademy/model/openacademy_session.py | openacademy/model/openacademy_session.py | # -*- coding: utf-8 -*-
from openerp import fields, models
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
in... | # -*- coding: utf-8 -*-
from openerp import fields, models
class Session(models.Model):
_name = 'openacademy.session'
name = fields.Char(required=True)
start_date = fields.Date()
duration = fields.Float(digits=(6, 2), help="Duration in days")
seats = fields.Integer(string="Number of seats")
in... | apache-2.0 | Python |
42ef885c1da9f181608bc5d1715d09837a06db62 | Tag new release: 2.7.1 | Floobits/floobits-sublime,Floobits/floobits-sublime | floo/version.py | floo/version.py | PLUGIN_VERSION = '2.7.1'
# The line above is auto-generated by tag_release.py. Do not change it manually.
try:
from .common import shared as G
assert G
except ImportError:
from common import shared as G
G.__VERSION__ = '0.11'
G.__PLUGIN_VERSION__ = PLUGIN_VERSION
| PLUGIN_VERSION = '2.7.0'
# The line above is auto-generated by tag_release.py. Do not change it manually.
try:
from .common import shared as G
assert G
except ImportError:
from common import shared as G
G.__VERSION__ = '0.11'
G.__PLUGIN_VERSION__ = PLUGIN_VERSION
| apache-2.0 | Python |
da4a497e8cd73df40830388faedc589deff756c5 | Refactor to use the validation API. | back-to/streamlink,fishscene/streamlink,bastimeyer/streamlink,wlerin/streamlink,intact/livestreamer,Feverqwe/livestreamer,hmit/livestreamer,blxd/livestreamer,lyhiving/livestreamer,okaywit/livestreamer,hmit/livestreamer,jtsymon/livestreamer,wlerin/streamlink,melmorabity/streamlink,okaywit/livestreamer,gtmanfred/livestre... | src/livestreamer/plugins/chaturbate.py | src/livestreamer/plugins/chaturbate.py | import re
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.stream import HLSStream
_url_re = re.compile("http://chaturbate.com/[^/?&]+")
_playlist_url_re = re.compile("html \+= \"src='(?P<url>[^']+)'\";")
_schema = validate.Schema(
validate.transform(_pla... | from livestreamer.exceptions import NoStreamsError
from livestreamer.plugin import Plugin
from livestreamer.stream import HLSStream
from livestreamer.plugin.api import http
import re
class Chaturbate(Plugin):
_reSrc = re.compile(r'html \+= \"src=\'([^\']+)\'\";')
@classmethod
def can_handle_url(self,... | bsd-2-clause | Python |
6288dac2fd91d41b27006ea7d546ed90a88e3b39 | Fix inheritance error | pysv/djep,EuroPython/djep,pysv/djep,EuroPython/djep,pysv/djep,EuroPython/djep,EuroPython/djep,pysv/djep,pysv/djep | pyconde/sponsorship/views.py | pyconde/sponsorship/views.py | # -*- encoding: utf-8 -*-
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.template.response import TemplateResponse
from django.utils.translation import ugettext_lazy as _
from django.views import generic as generic_views
from .forms import JobOfferForm
from .models import... | # -*- encoding: utf-8 -*-
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.template.response import TemplateResponse
from django.utils.translation import ugettext_lazy as _
from django.views import generic as generic_views
from .forms import JobOfferForm
from .models import... | bsd-3-clause | Python |
410207e4c0a091e7b4eca9cedd08f381095f50a9 | Revert "change from string to int" | PeerAssets/pypeerassets | pypeerassets/card_parsers.py | pypeerassets/card_parsers.py | '''parse cards according to deck issue mode'''
from .pautils import exponent_to_amount
def none_parser(cards):
'''parser for NONE [0] issue mode'''
return None
def custom_parser(cards, parser=None):
'''parser for CUSTOM [1] issue mode,
please provide your custom parser as argument'''
if not p... | '''parse cards according to deck issue mode'''
from .pautils import exponent_to_amount
def none_parser(cards):
'''parser for NONE [0] issue mode'''
return None
def custom_parser(cards, parser=None):
'''parser for CUSTOM [1] issue mode,
please provide your custom parser as argument'''
if not p... | bsd-3-clause | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.