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 |
|---|---|---|---|---|---|---|---|---|
5a33d1c5e52bf26eb90e53381a58ed89c9a1185e | Make 0.3.1 | simplefin/siloscript,simplefin/siloscript,simplefin/siloscript | siloscript/version.py | siloscript/version.py | # Copyright (c) The SimpleFIN Team
# See LICENSE for details.
__version__ = "0.3.1"
| # Copyright (c) The SimpleFIN Team
# See LICENSE for details.
__version__ = "0.4.0-dev"
| apache-2.0 | Python |
87c7899f7ed14d64f2015ce6363bf50e7d5b5008 | Update yle_articles collector | HIIT/mediacollection | sites/yle_articles.py | sites/yle_articles.py | import requests
def parse(api_request):
app_id = ""
app_key = ""
example_request = "https://articles.api.yle.fi/v2/articles.json?published_after=2016-12-20T12:00:00%2b0300&offset=0&limit=10"
#r = requests.get( api_request )
r = requests.get( example_request + "&app_id=" + app_id + "&app_key=" + ... | import requests
def parse(api_request):
app_id = "f3365695"
app_key = "7010dcef0cf2393423e747473b6068c"
example_request = "https://articles.api.yle.fi/v2/articles.json?published_after=2016-12-20T12:00:00%2b0300&offset=0&limit=10"
#r = requests.get( api_request )
r = requests.get( example_request... | mit | Python |
8913a1ca25b51fc52b08187ab67a1e8763015d07 | handle ndarray to matrix conversion | scikit-multilearn/scikit-multilearn | skmultilearn/utils.py | skmultilearn/utils.py | import numpy as np
import scipy.sparse as sp
SPARSE_FORMAT_TO_CONSTRUCTOR = {
"bsr": sp.bsr_matrix,
"coo": sp.coo_matrix,
"csc": sp.csc_matrix,
"csr": sp.csr_matrix,
"dia": sp.dia_matrix,
"dok": sp.dok_matrix,
"lil": sp.lil_matrix
}
def get_matrix_in_format(original_matrix, matrix_format):... | import scipy.sparse as sp
def get_matrix_in_format(original_matrix, matrix_format):
if original_matrix.getformat() == matrix_format:
return original_matrix
return original_matrix.asformat(matrix_format)
def matrix_creation_function_for_format(sparse_format):
SPARSE_FORMAT_TO_CONSTRUCTOR = {
... | bsd-2-clause | Python |
ae70fccdc7fe5348e3729283866df4ed0c256beb | Fix tabs. | jettan/boot_wisp5,jettan/boot_wisp5,jettan/boot_wisp5,jettan/boot_wisp5,jettan/boot_wisp5 | sllurp/sllurp/host.py | sllurp/sllurp/host.py | #!/usr/bin/python
from twisted.internet import reactor, defer
index = 0
# Read the hex file.
f = open("wisp_app.hex", 'r')
lines = f.readlines()
class Getter:
def processLine(self, line):
if self.d is None:
print "No callback given!"
return
d = self.d
self.d = None
global lines
global inde... | #!/usr/bin/python
from twisted.internet import reactor, defer
index = 0
# Read the hex file.
f = open("wisp_app.hex", 'r')
lines = f.readlines()
class Getter:
def processLine(self, line):
"""
The Deferred mechanism provides a mechanism to signal error
conditions. In this case, odd numb... | bsd-2-clause | Python |
374981fd60c0116e861d598eec763cc2b8165189 | Add -- to git log call | StoDevX/cs251-toolkit,StoDevX/cs251-toolkit,StoDevX/cs251-toolkit,StoDevX/cs251-toolkit | cs251tk/common/check_submit_date.py | cs251tk/common/check_submit_date.py | import os
from dateutil.parser import parse
from ..common import run, chdir
def check_dates(spec_id, username, spec, basedir):
""" Port of the CheckDates program from C++
Finds the first submission date for an assignment
by comparing first commits for all files in the spec
and ret... | import os
from dateutil.parser import parse
from ..common import run, chdir
def check_dates(spec_id, username, spec, basedir):
""" Port of the CheckDates program from C++
Finds the first submission date for an assignment
by comparing first commits for all files in the spec
and ret... | mit | Python |
30d9d45612b760e2ce6c2d90e516ba8de58a0c12 | put start_date back in ordering fields | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | api/v2/views/instance_history.py | api/v2/views/instance_history.py | from django.db.models import Q
from rest_framework import filters
import django_filters
from core.models import InstanceStatusHistory
from api.v2.serializers.details import InstanceStatusHistorySerializer
from api.v2.views.base import AuthReadOnlyViewSet
from api.v2.views.mixins import MultipleFieldLookup
class Ins... | from django.db.models import Q
from rest_framework import filters
import django_filters
from core.models import InstanceStatusHistory
from api.v2.serializers.details import InstanceStatusHistorySerializer
from api.v2.views.base import AuthReadOnlyViewSet
from api.v2.views.mixins import MultipleFieldLookup
class Ins... | apache-2.0 | Python |
a6ab9d8af09eace392a3d9320eb46af4ec6394c9 | add test_report_progress() | alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl | tests/unit/loop/test_EventLoop.py | tests/unit/loop/test_EventLoop.py | # Tai Sakuma <tai.sakuma@gmail.com>
import sys
import pytest
try:
import unittest.mock as mock
except ImportError:
import mock
from alphatwirl.loop import EventLoop
from alphatwirl import progressbar
##__________________________________________________________________||
@pytest.fixture()
def events():
ev... | # Tai Sakuma <tai.sakuma@gmail.com>
import logging
import pytest
try:
import unittest.mock as mock
except ImportError:
import mock
from alphatwirl.loop import EventLoop
##__________________________________________________________________||
@pytest.fixture()
def events():
event1 = mock.Mock(name='event1')... | bsd-3-clause | Python |
042f005b8e22f9d8844e0c16329598ca13eb4567 | Update formatting for better compatibility with unit tests. | stdweird/aquilon,stdweird/aquilon,stdweird/aquilon,guillaume-philippon/aquilon,quattor/aquilon,quattor/aquilon,guillaume-philippon/aquilon,quattor/aquilon,guillaume-philippon/aquilon | lib/python2.5/aquilon/aqdb/utils/table_admin.py | lib/python2.5/aquilon/aqdb/utils/table_admin.py | #!/ms/dist/python/PROJ/core/2.5.0/bin/python
""" A collection of table level functions for maintenance """
from confirm import confirm
import sys
import os
if __name__ == '__main__':
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.realpath(os.path.join(DIR, '..', '..', '..')))
... | #!/ms/dist/python/PROJ/core/2.5.0/bin/python
""" A collection of table level functions for maintenance """
from confirm import confirm
import sys
import os
if __name__ == '__main__':
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.realpath(os.path.join(DIR, '..', '..', '..')))
... | apache-2.0 | Python |
1c7b881b62f9d1931957322874f6c38d610c2cf4 | Rename setting to match name of app | Perkville/django-append-url-to-sql,playfire/django-append-url-to-sql,lamby/django-append-url-to-sql | append_url_to_sql/models.py | append_url_to_sql/models.py | """
:mod:`django-append-url-to-sql` --- Appends the request URL to SQL statements in Django
=======================================================================================
Whilst the `Django Debug Toolbar
<https://github.com/robhudson/django-debug-toolbar>`_ is invaluable for
development in a local environment... | """
:mod:`django-append-url-to-sql` --- Appends the request URL to SQL statements in Django
=======================================================================================
Whilst the `Django Debug Toolbar
<https://github.com/robhudson/django-debug-toolbar>`_ is invaluable for
development in a local environment... | bsd-3-clause | Python |
8f3b16e23bc29465d9b6cfc5e9afbe9c7e8727df | Bump to 1.2.0 | kivy/pyjnius,kivy/pyjnius,kivy/pyjnius | jnius/__init__.py | jnius/__init__.py | '''
Pyjnius
=======
Accessing Java classes from Python.
All the documentation is available at: http://pyjnius.readthedocs.org
'''
__version__ = '1.2.0'
from .jnius import * # noqa
from .reflect import * # noqa
from six import with_metaclass
# XXX monkey patch methods that cannot be in cython.
# Cython doesn't al... | '''
Pyjnius
=======
Accessing Java classes from Python.
All the documentation is available at: http://pyjnius.readthedocs.org
'''
__version__ = '1.1.5.dev0'
from .jnius import * # noqa
from .reflect import * # noqa
from six import with_metaclass
# XXX monkey patch methods that cannot be in cython.
# Cython doesn... | mit | Python |
d4479df64a2fd7a53327bc3ce79e48ec4cc30efc | Update course forum url | Kaggle/learntools,Kaggle/learntools | notebooks/feature_engineering_new/track_meta.py | notebooks/feature_engineering_new/track_meta.py | track = dict(
author_username="ryanholbrook",
course_name="Feature Engineering",
course_url="https://www.kaggle.com/learn/feature-engineering",
course_forum_url="https://www.kaggle.com/learn-forum/221677",
)
TOPICS = [
"What is Feature Engineering", # 1
"Mutual Information", # 2
"Creating... | track = dict(
author_username="ryanholbrook",
course_name="Feature Engineering",
course_url="https://www.kaggle.com/learn/feature-engineering",
course_forum_url="https://www.kaggle.com/learn-forum/161443",
)
TOPICS = [
"What is Feature Engineering", # 1
"Mutual Information", # 2
"Creating... | apache-2.0 | Python |
8de0c35cccc316a6e9bc6dc9cff04d37e6c975a9 | Update track_meta | Kaggle/learntools,Kaggle/learntools | notebooks/feature_engineering_new/track_meta.py | notebooks/feature_engineering_new/track_meta.py | track = dict(
author_username='',
course_name="Feature Engineering",
course_url='https://www.kaggle.com/learn/feature-engineering',
course_forum_url='https://www.kaggle.com/learn-forum/',
)
TOPICS = ["What is Feature Engineering?", # 1
"Polynomial and Interaction Features", # 2
... | # See also examples/example_track/track_meta.py for a longer, commented example
track = dict(
author_username='',
)
lessons = [
dict(
# By convention, this should be a lowercase noun-phrase.
topic='exemplar examples',
),
]
notebooks = [
dict(
filename='tut1.... | apache-2.0 | Python |
957a381f81baf8cb9f7f4e3cbd8f437f1dbf858c | Use 'config' instead 'device' to speficy device type for session creation | tqchen/tinyflow,tqchen/tinyflow,tqchen/tinyflow | example/mnist_mlp_auto_shape_inference.py | example/mnist_mlp_auto_shape_inference.py | """TinyFlow Example code.
Automatic variable creation and shape inductions.
The network structure is directly specified via forward node numbers
The variables are automatically created, and their shape infered by tf.infer_variable_shapes
"""
import tinyflow as tf
from tinyflow.datasets import get_mnist
# Create the m... | """TinyFlow Example code.
Automatic variable creation and shape inductions.
The network structure is directly specified via forward node numbers
The variables are automatically created, and their shape infered by tf.infer_variable_shapes
"""
import tinyflow as tf
from tinyflow.datasets import get_mnist
# Create the m... | apache-2.0 | Python |
b483522f8af1d58a8ca8e25eb0ba44a98acf1df7 | Fix Client call | TwilioDevEd/airtng-flask,TwilioDevEd/airtng-flask,TwilioDevEd/airtng-flask | airtng_flask/models/reservation.py | airtng_flask/models/reservation.py | from airtng_flask.models import app_db, auth_token, account_sid, phone_number
from flask import render_template
from twilio.rest import Client
db = app_db()
class Reservation(db.Model):
__tablename__ = "reservations"
id = db.Column(db.Integer, primary_key=True)
message = db.Column(db.String, nullable=Fa... | from airtng_flask.models import app_db, auth_token, account_sid, phone_number
from flask import render_template
from twilio.rest import Client
db = app_db()
class Reservation(db.Model):
__tablename__ = "reservations"
id = db.Column(db.Integer, primary_key=True)
message = db.Column(db.String, nullable=Fa... | mit | Python |
95249bb773c57daa15e1b85765e5e75254f8ba6e | Update __init__.py | weijia/djangoautoconf,weijia/djangoautoconf | djangoautoconf/__init__.py | djangoautoconf/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Richard Wang'
__email__ = 'richardwangwang@gmail.com'
__version__ = '2.0.2'
# from .django_autoconf import DjangoAutoConf
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Richard Wang'
__email__ = 'richardwangwang@gmail.com'
__version__ = '2.0.1'
# from .django_autoconf import DjangoAutoConf
| bsd-3-clause | Python |
05190c5dc6fc680bea245184b74f46f781ce998c | Prepare for inital release | frague59/wagtailpolls,takeflight/wagtailpolls,frague59/wagtailpolls,frague59/wagtailpolls,takeflight/wagtailpolls,takeflight/wagtailpolls | wagtailpolls/__init__.py | wagtailpolls/__init__.py | __version__ = '0.1.0'
| __version__ = '0.1'
| bsd-3-clause | Python |
7b80fdfe3487d3f5f32c69b03707963d3f8e1e3a | Update cpuinfo from b40bae2 to 9fa6219 | tensorflow/tensorflow-pywrap_tf_optimizer,karllessard/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow... | third_party/cpuinfo/workspace.bzl | third_party/cpuinfo/workspace.bzl | """Loads the cpuinfo library, used by XNNPACK."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
tf_http_archive(
name = "cpuinfo",
strip_prefix = "cpuinfo-9fa621933fc6080b96fa0f037cdc7cd2c69ab272",
sha256 = "810708948128be2da882a5a3ca61eb6db40186bac9180d20... | """Loads the cpuinfo library, used by XNNPACK."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
tf_http_archive(
name = "cpuinfo",
strip_prefix = "cpuinfo-b40bae27785787b6dd70788986fd96434cf90ae2",
sha256 = "5794c7b37facc590018eddffec934c60aeb71165b59a375b... | apache-2.0 | Python |
adafee9ea64501632331d2681f93ada9b24d05da | Fix publish with dict | amm0nite/unicornclient,amm0nite/unicornclient | unicornclient/mission.py | unicornclient/mission.py |
import json
from . import message
class Mission():
def __init__(self, manager):
self.manager = manager
def send(self, msg: message.Message):
self.manager.sender.send(msg)
def publish(self, topic, data):
self.manager.mqtt_sender.publish(topic, self.serialize(data))
def post(... |
import json
from . import message
class Mission():
def __init__(self, manager):
self.manager = manager
def send(self, msg):
self.manager.sender.send(msg)
def publish(self, topic, msg):
self.manager.mqtt_sender.publish(topic, msg)
def post(self, name, data):
msg = me... | mit | Python |
83b30e9e911ae71512c48a4e54c924d79fb7c9d7 | adjust inherit relation | note35/sinon,note35/sinon | lib/sinon/SinonStub.py | lib/sinon/SinonStub.py | import sys
sys.path.insert(0, '../')
from lib.sinon.util import ErrorHandler, Wrapper, CollectionHandler
from lib.sinon.SinonSpy import SinonSpy
class SinonStub(SinonSpy):
def __init__(self, obj=None, prop=None, func=None):
super(SinonStub, self).__init__(obj, prop)
self._prepare(func)
def _... | import sys
sys.path.insert(0, '../')
from lib.sinon.util import ErrorHandler, Wrapper, CollectionHandler
from lib.sinon.SinonBase import SinonBase
class SinonStub(SinonBase):
def __init__(self, obj=None, prop=None, func=None):
super(SinonStub, self).__init__(obj, prop)
self.stubfunc = func if fun... | bsd-2-clause | Python |
803a6e495966b5281b376b4e28f0bcb04f44ee50 | Change args to api | johnbachman/indra,johnbachman/belpy,pvtodorov/indra,sorgerlab/indra,johnbachman/belpy,pvtodorov/indra,bgyori/indra,sorgerlab/belpy,johnbachman/belpy,bgyori/indra,pvtodorov/indra,sorgerlab/indra,pvtodorov/indra,sorgerlab/belpy,sorgerlab/belpy,johnbachman/indra,bgyori/indra,sorgerlab/indra,johnbachman/indra | indra/sources/sofia/sofia_api.py | indra/sources/sofia/sofia_api.py | import openpyxl
from .processor import SofiaProcessor
def process_table(fname):
"""Return processor by processing a given sheet of a spreadsheet file.
Parameters
----------
fname : str
The name of the Excel file (typically .xlsx extension) to process
Returns
-------
sp : indra.sou... | import openpyxl
from .processor import SofiaProcessor
def process_table(fname, sheet_name):
"""Return processor by processing a given sheet of a spreadsheet file.
Parameters
----------
fname : str
The name of the Excel file (typically .xlsx extension) to process
Returns
-------
sp... | bsd-2-clause | Python |
124cef21de78c84aa32808d4287733e616df4095 | Update colorbars test. | openmv/openmv,kwagyeman/openmv,openmv/openmv,kwagyeman/openmv,iabdalkader/openmv,iabdalkader/openmv,kwagyeman/openmv,iabdalkader/openmv,kwagyeman/openmv,openmv/openmv,openmv/openmv,iabdalkader/openmv | usr/examples/15-Tests/colorbar.py | usr/examples/15-Tests/colorbar.py | # Colorbar Test Example
#
# This example is the color bar test run by each OpenMV Cam before being allowed
# out of the factory. The OMV sensors can output a color bar image which you
# can threshold to check the the camera bus is connected correctly.
import sensor, time
sensor.reset()
# Set sensor settings
sensor.se... | # Colorbar Test Example
#
# This example is the color bar test run by each OpenMV Cam before being allowed
# out of the factory. The OMV sensors can output a color bar image which you
# can threshold to check the the camera bus is connected correctly.
import sensor, time
sensor.reset()
# Set sensor settings
sensor.se... | mit | Python |
60fe51f3e193dd42c24001cf5a01e689df12730b | support the limit on the max number of points | maxim5/hyper-engine | hyperengine/model/hyper_tuner.py | hyperengine/model/hyper_tuner.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'maxim'
import numpy as np
import time
from ..base import *
from ..spec import ParsedSpec
from ..bayesian.sampler import DefaultSampler
from ..bayesian.strategy import BayesianStrategy, BayesianPortfolioStrategy
strategies = {
'bayesian': lambda sampler... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'maxim'
import numpy as np
import time
from ..base import *
from ..spec import ParsedSpec
from ..bayesian.sampler import DefaultSampler
from ..bayesian.strategy import BayesianStrategy, BayesianPortfolioStrategy
strategies = {
'bayesian': lambda sampler... | apache-2.0 | Python |
f0e29748ff899d7e65d1f4169e890d3e3c4bda0e | Update instead of overriding `DATABASES` setting in `test` settings. | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | icekit/project/settings/_test.py | icekit/project/settings/_test.py | from ._base import *
# DJANGO ######################################################################
DATABASE_NAME = 'test_%s' % DATABASES['default']['NAME']
DATABASES['default'].update({
'NAME': DATABASE_NAME,
'TEST': {
'NAME': DATABASE_NAME,
# See: https://docs.djangoproject.com/en/1.7/ref/... | from ._base import *
# DJANGO ######################################################################
DATABASE_NAME = 'test_%s' % DATABASES['default']['NAME']
DATABASES = {
'default': {
'NAME': DATABASE_NAME,
'TEST': {
'NAME': DATABASE_NAME,
# See: https://docs.djangoprojec... | mit | Python |
b34315f4b4c77dfcc4bc83901ca8786af1a3f12a | Add more content | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | ideascube/conf/kb_gin_conakry.py | ideascube/conf/kb_gin_conakry.py | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
from django.utils.translation import ugettext_lazy as _
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'Conakry'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'bsfcampus',
... | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'CONAKRY'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'koombookedu',
},
{
'id': 'bsfcampus',
},
]
| agpl-3.0 | Python |
e4abc4dbde81b21d1d66439a482249887bfd56a7 | Fix TypeError on callback | hasegaw/IkaLog,deathmetalland/IkaLog,deathmetalland/IkaLog,hasegaw/IkaLog,hasegaw/IkaLog,deathmetalland/IkaLog | ikalog/scenes/game/kill_combo.py | ikalog/scenes/game/kill_combo.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 Takeshi HASEGAWA, Shingo MINAMIYAMA
#
# 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... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 Takeshi HASEGAWA, Shingo MINAMIYAMA
#
# 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... | apache-2.0 | Python |
bafa26c28399b43d15e23d1fca66bf98938f329d | fix treasury yield bugs | johntut/MongoDisco,dcrosta/mongo-disco,sajal/MongoDisco,10genNYUITP/MongoDisco,mongodb/mongo-disco | examples/treasury_yield/treasury_yield.py | examples/treasury_yield/treasury_yield.py | #!/usr/bin/env python
# encoding: utf-8
import datetime
#from app.MongoSplitter import calculate_splits
#from disco.core import Job, result_iterator
#from mongodb_io import mongodb_output_stream, mongodb_input_stream
from job import DiscoJob
"""
Description: calculate the average 10 year treasury bond yield for given... | #!/usr/bin/env python
# encoding: utf-8
import datetime
from app.MongoSplitter import calculate_splits
from disco.core import Job, result_iterator
from mongodb_io import mongodb_output_stream, mongodb_input_stream
"""
Description: calculate the average 10 year treasury bond yield for given data.
Note: run parse_yield... | apache-2.0 | Python |
e637e5f53990709ed654b661465685ad9d05a182 | Update cluster config map key format | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | api/spawner/templates/constants.py | api/spawner/templates/constants.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from django.conf import settings
JOB_NAME = 'plxjob-{task_type}{task_idx}-{experiment_uuid}'
DEFAULT_PORT = 2222
ENV_VAR_TEMPLATE = '{name: "{var_name}", value: "{var_value}"}'
VOLUME_NAME = 'pv-{vol_name}'
VOLUME_CLAIM_NAME = 'p... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from django.conf import settings
JOB_NAME = 'plxjob-{task_type}{task_idx}-{experiment_uuid}'
DEFAULT_PORT = 2222
ENV_VAR_TEMPLATE = '{name: "{var_name}", value: "{var_value}"}'
VOLUME_NAME = 'pv-{vol_name}'
VOLUME_CLAIM_NAME = 'p... | apache-2.0 | Python |
8171af80ab1bff2ffac4b85642217a37fb485d74 | Rewrite serializer | manhg/django-rest-framework-gis,arjenvrielink/django-rest-framework-gis,djangonauts/django-rest-framework-gis,barseghyanartur/django-rest-framework-gis,illing2005/django-rest-framework-gis,nmandery/django-rest-framework-gis,bopo/django-rest-framework-gis,pglotov/django-rest-framework-gis,sh4wn/django-rest-framework-gis... | rest_framework_gis/serializers.py | rest_framework_gis/serializers.py | # rest_framework_gis/serializers.py
from django.contrib.gis.db import models
from rest_framework.serializers import ModelSerializer
from .fields import GeometryField
class GeoModelSerializer(ModelSerializer):
pass
GeoModelSerializer.field_mapping.update({
models.GeometryField: GeometryField,
models.Po... | # rest_framework_gis/serializers.py
from django.contrib.gis.db import models
from rest_framework.serializers import ModelSerializer
from .fields import GeometryField
class GeoModelSerializer(ModelSerializer):
def get_field(self, model_field):
"""
Creates a default instance of a basic non-rel... | mit | Python |
70d009834123cb5a10788763fed3193017cc8162 | Add a default null logger per python recommendations. | pebble/libpebble2 | libpebble2/__init__.py | libpebble2/__init__.py | __author__ = 'katharine'
import logging
from .exceptions import *
logging.getLogger('libpebble2').addHandler(logging.NullHandler())
| __author__ = 'katharine'
from .exceptions import *
| mit | Python |
eb9d297d14741f311cb4bf27c384077ba98cc789 | Add missing slot. | marrow/mongo,djdduty/mongo,djdduty/mongo | web/db/mongo/__init__.py | web/db/mongo/__init__.py | # encoding: utf-8
"""MongoDB database connection extension."""
import re
from pymongo import MongoClient
from pymongo.errors import ConfigurationError
from .model import Model
from .resource import MongoDBResource
from .collection import MongoDBCollection
__all__ = ['Model', 'MongoDBResource', 'MongoDBCollection'... | # encoding: utf-8
"""MongoDB database connection extension."""
import re
from pymongo import MongoClient
from pymongo.errors import ConfigurationError
from .model import Model
from .resource import MongoDBResource
from .collection import MongoDBCollection
__all__ = ['Model', 'MongoDBResource', 'MongoDBCollection'... | mit | Python |
bf24abb4ffba4f63f641cc61e22357253cdca956 | Fix migration script | DanielNeugebauer/adhocracy,alkadis/vcv,DanielNeugebauer/adhocracy,phihag/adhocracy,DanielNeugebauer/adhocracy,alkadis/vcv,alkadis/vcv,DanielNeugebauer/adhocracy,phihag/adhocracy,liqd/adhocracy,alkadis/vcv,liqd/adhocracy,phihag/adhocracy,liqd/adhocracy,SysTheron/adhocracy,alkadis/vcv,SysTheron/adhocracy,liqd/adhocracy,p... | src/adhocracy/migration/versions/053_add_newsservice.py | src/adhocracy/migration/versions/053_add_newsservice.py | from datetime import datetime
from sqlalchemy import MetaData, Column, ForeignKey, Table
from sqlalchemy import Boolean, DateTime, Integer, Unicode, UnicodeText
metadata = MetaData()
message_table = Table(
'message', metadata,
Column('id', Integer, primary_key=True),
Column('subject', Unicode(140), nulla... | from datetime import datetime
from sqlalchemy import MetaData, Column, ForeignKey, Table
from sqlalchemy import Boolean, DateTime, Integer, Unicode, UnicodeText
metadata = MetaData()
message_table = Table(
'message', metadata,
Column('id', Integer, primary_key=True),
Column('subject', Unicode(140), nulla... | agpl-3.0 | Python |
307d866bb6538a78effcc44e005a4dcb90a2a4b5 | Increment to 0.5.4 | ashleysommer/sanic,lixxu/sanic,yunstanford/sanic,Tim-Erwin/sanic,lixxu/sanic,jrocketfingers/sanic,yunstanford/sanic,lixxu/sanic,ashleysommer/sanic,r0fls/sanic,yunstanford/sanic,Tim-Erwin/sanic,channelcat/sanic,ashleysommer/sanic,lixxu/sanic,channelcat/sanic,r0fls/sanic,yunstanford/sanic,channelcat/sanic,jrocketfingers/... | sanic/__init__.py | sanic/__init__.py | from sanic.app import Sanic
from sanic.blueprints import Blueprint
__version__ = '0.5.4'
__all__ = ['Sanic', 'Blueprint']
| from sanic.app import Sanic
from sanic.blueprints import Blueprint
__version__ = '0.5.3'
__all__ = ['Sanic', 'Blueprint']
| mit | Python |
5fd62098bd2f2722876a0873d5856d70046d3889 | Increment to 0.5.2 | r0fls/sanic,ashleysommer/sanic,yunstanford/sanic,channelcat/sanic,lixxu/sanic,yunstanford/sanic,lixxu/sanic,lixxu/sanic,jrocketfingers/sanic,yunstanford/sanic,lixxu/sanic,yunstanford/sanic,ashleysommer/sanic,channelcat/sanic,Tim-Erwin/sanic,jrocketfingers/sanic,channelcat/sanic,channelcat/sanic,ashleysommer/sanic,r0fls... | sanic/__init__.py | sanic/__init__.py | from sanic.app import Sanic
from sanic.blueprints import Blueprint
__version__ = '0.5.2'
__all__ = ['Sanic', 'Blueprint']
| from sanic.app import Sanic
from sanic.blueprints import Blueprint
__version__ = '0.5.1'
__all__ = ['Sanic', 'Blueprint']
| mit | Python |
035938d8c0f3cc2cda353286c0089ee02ffe3b87 | Use dj six | kelvinwong-ca/django-likert-field,kelvinwong-ca/django-likert-field | likert_field/models.py | likert_field/models.py | #-*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.six import string_types
from django.utils.translation import ugettext_lazy as _
import likert_field.forms as forms
@python_2_unicode... | #-*- coding: utf-8 -*-
from __future__ import unicode_literals
from six import string_types
from django.db import models
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
import likert_field.forms as forms
@python_2_unicode_compatible
... | bsd-3-clause | Python |
60156236836944205f3993badcf179aaa6e7ae54 | Add an (unexposed) ResourceHandler so inheriting objects serialise better | mikesname/ehri-collections,mikesname/ehri-collections,mikesname/ehri-collections | ehriportal/portal/api/handlers.py | ehriportal/portal/api/handlers.py | """
Piston handlers for notable resources.
"""
from piston.handler import BaseHandler
from portal import models
class ResourceHandler(BaseHandler):
model = models.Resource
class RepositoryHandler(BaseHandler):
model = models.Repository
class CollectionHandler(BaseHandler):
model = models.Collection
... | """
Piston handlers for notable resources.
"""
from piston.handler import BaseHandler
from portal import models
class RepositoryHandler(BaseHandler):
model = models.Repository
class CollectionHandler(BaseHandler):
model = models.Collection
class PlaceHandler(BaseHandler):
model = models.Place
clas... | mit | Python |
488e5dd9bcdcba26de98fdbcaba1e23e8b4a8188 | use csv writer for listing scraper | ClintonKing/band-scraper,ClintonKing/band-scraper,ClintonKing/band-scraper | scrape_listing.py | scrape_listing.py | #!/usr/bin/env python
import csv
import sys
import requests
from models.listing import Listing
def scrape_listing(url):
writer = csv.writer(sys.stdout)
response = requests.get(url)
listing = Listing(response.content)
# print('Title: ' + listing.title)
# print('Price: ' + listing.price)
# prin... | #!/usr/bin/env python
import sys
import requests
from models.listing import Listing
def scrape_listing(url):
response = requests.get(url)
listing = Listing(response.content)
# print('Title: ' + listing.title)
# print('Price: ' + listing.price)
# print('Image URLs: ' + listing.imgs)
# print('L... | mit | Python |
ca356ae7b85c9d88f42c5adc6227d0125ff49399 | Update settings.py | BFriedland/UserDataBase,defzzd/UserDataBase | udbproject/settings.py | udbproject/settings.py | """
Django settings for udbproject project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)... | """
Django settings for udbproject project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)... | mit | Python |
844e1917e971e834f7c95064dc7ea31fc7cc0947 | Make build_plugins.py bail on error | marianocarrazana/anticontainer,downthemall/anticontainer,marianocarrazana/anticontainer,marianocarrazana/anticontainer,downthemall/anticontainer,downthemall/anticontainer | build/build_plugins.py | build/build_plugins.py | from __future__ import print_function
import glob, os.path, sys
from mergeex import mergeex
try:
import simplejson as json
except ImportError:
import json
plugins = []
filters = []
for fileName in sorted(glob.glob('../plugins/*.json')):
try:
with open(fileName, 'rb') as f:
content = f... | from __future__ import print_function
import glob, os.path, sys
from mergeex import mergeex
try:
import simplejson as json
except ImportError:
import json
plugins = []
filters = []
for fileName in sorted(glob.glob('../plugins/*.json')):
try:
with open(fileName, 'rb') as f:
content = f.read().decode('utf-8')
... | mpl-2.0 | Python |
6aa7acba495648b710635b465d5b7cd955d9f476 | remove tmp line | viraintel/OWASP-Nettacker,viraintel/OWASP-Nettacker,viraintel/OWASP-Nettacker,viraintel/OWASP-Nettacker | api/__database.py | api/__database.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sqlite3
import os
from core.config import _core_config
from core.config_builder import _core_default_config
from core.config_builder import _builder
from core.alert import warn
from core.alert import messages
def create_connection(language):
try:
retur... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sqlite3
import os
from core.config import _core_config
from core.config_builder import _core_default_config
from core.config_builder import _builder
from core.alert import warn
from core.alert import messages
def create_connection(language):
try:
retur... | apache-2.0 | Python |
591b0550e0724f3e515974fee02d8d40e070e52a | Bump version | markstory/lint-review,markstory/lint-review,markstory/lint-review | lintreview/__init__.py | lintreview/__init__.py | __version__ = '2.25.1'
| __version__ = '2.25.0'
| mit | Python |
c0b3a1b40149e939e91c5483383f1a1c715a9b9c | Update ipc_lista1.7.py | any1m1c/ipc20161 | lista1/ipc_lista1.7.py | lista1/ipc_lista1.7.py | #ipc_lista1.7
#Professor: Jucimar Junior
#Any Mendes Carvalho
#
#
#
#
#Faça um programa que calcule a área de um quadrado, em seguida mostre o dobro desta área para o #usuário.
altura = input("Digite a altura do quadrado em metros: ")
largura = input("Digite a largura em
| #ipc_lista1.7
#Professor: Jucimar Junior
#Any Mendes Carvalho
#
#
#
#
#Faça um programa que calcule a área de um quadrado, em seguida mostre o dobro desta área para o #usuário.
altura = input("Digite a altura do quadrado em metros: ")
largura = input("Digite a largura
| apache-2.0 | Python |
4fb6112552ab7969bddca7193dd51910be51d8b2 | Update ipc_lista1.7.py | any1m1c/ipc20161 | lista1/ipc_lista1.7.py | lista1/ipc_lista1.7.py | #ipc_lista1.7
#Professor: Jucimar Junior
#Any Mendes Carvalho
#
#
#
#
#Faça um programa que calcule a área de um quadrado, em seguida mostre o dobro desta área para o #usuário.
altura = input("Digite a altura do quadrado em metros: ")
largura = input("Digite a largura do quadrado em
| #ipc_lista1.7
#Professor: Jucimar Junior
#Any Mendes Carvalho
#
#
#
#
#Faça um programa que calcule a área de um quadrado, em seguida mostre o dobro desta área para o #usuário.
altura = input("Digite a altura do quadrado em metros: ")
largura = input("Digite a largura do em
| apache-2.0 | Python |
360ef0dec991d4486ec51f23ffb065d0225347fa | Update ipc_lista1.8.py | any1m1c/ipc20161 | lista1/ipc_lista1.8.py | lista1/ipc_lista1.8.py | #ipc_lista1.8
#Professor: Jucimar
| #ipc_lista1.8
#Professor:
| apache-2.0 | Python |
93a91ac118ab4e7280562bd0cfac0ea964ae0a7e | remove auth_check import | wathsalav/xos,xmaruto/mcord,wathsalav/xos,open-cloud/xos,zdw/xos,cboling/xos,cboling/xos,cboling/xos,open-cloud/xos,opencord/xos,jermowery/xos,wathsalav/xos,zdw/xos,opencord/xos,zdw/xos,xmaruto/mcord,xmaruto/mcord,cboling/xos,opencord/xos,zdw/xos,jermowery/xos,cboling/xos,xmaruto/mcord,wathsalav/xos,jermowery/xos,jermo... | plstackapi/core/api/sites.py | plstackapi/core/api/sites.py | from types import StringTypes
from django.contrib.auth import authenticate
from plstackapi.openstack.manager import OpenStackManager
from plstackapi.core.models import Site
def _get_sites(filter):
if isinstance(filter, StringTypes) and filter.isdigit():
filter = int(filter)
if isinstance(filter, i... | from types import StringTypes
from django.contrib.auth import authenticate
from plstackapi.openstack.manager import OpenStackManager
from plstackapi.core.api.auth import auth_check
from plstackapi.core.models import Site
def _get_sites(filter):
if isinstance(filter, StringTypes) and filter.isdigit():
... | apache-2.0 | Python |
273aeda221aa12aac7fe1eea51e0aed859cd9098 | move fixme to right pos | obestwalter/mau-mau | sim.py | sim.py | import logging
from cardroom import Game, Table, Player, Stock, Waste, Card
log = logging.getLogger(__name__)
def play_game(players=3, cardsPerPlayer=5):
game = start_new_game(players, cardsPerPlayer)
while not game.over:
game.next_turn()
play_turn(game.player, game.table)
return game
... | import logging
from cardroom import Game, Table, Player, Stock, Waste, Card
log = logging.getLogger(__name__)
def play_game(players=3, cardsPerPlayer=5):
game = start_new_game(players, cardsPerPlayer)
while not game.over:
game.next_turn()
play_turn(game.player, game.table)
return game
... | mit | Python |
51f4d40cf6750d35f10f37d939a2c30c5f26d300 | Update script to write results to the database. | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | backend/scripts/updatedf.py | backend/scripts/updatedf.py | #!/usr/bin/env python
import hashlib
import os
import rethinkdb as r
def main():
conn = r.connect('localhost', 28015, db='materialscommons')
for root, dirs, files in os.walk("/mcfs/data/materialscommons"):
for f in files:
path = os.path.join(root, f)
with open(path) as fd:
... | #!/usr/bin/env python
#import hashlib
import os
def main():
for root, dirs, files in os.walk("/mcfs/data/materialscommons"):
for f in files:
print f
if __name__ == "__main__":
main()
| mit | Python |
599672acbf925cab634bc15ab47055aabb131efd | Fix xkcd text regex. Closes #46 | webcomics/dosage,blade2005/dosage,peterjanes/dosage,wummel/dosage,wummel/dosage,mbrandis/dosage,peterjanes/dosage,mbrandis/dosage,blade2005/dosage,Freestila/dosage,Freestila/dosage,webcomics/dosage | dosagelib/plugins/x.py | dosagelib/plugins/x.py | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2013 Bastian Kleineidam
from re import compile
from ..scraper import _BasicScraper
from ..helpers import bounceStarter
from ..util import tagre
class xkcd(_BasicScraper):
url = 'http://xkcd.com/'
... | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2013 Bastian Kleineidam
from re import compile
from ..scraper import _BasicScraper
from ..helpers import bounceStarter
from ..util import tagre
class xkcd(_BasicScraper):
url = 'http://xkcd.com/'
... | mit | Python |
f0593b2d69730441b5a486e27ed6eb7001939bf4 | Include unlimited features for enterprise | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/apps/accounting/bootstrap/config/user_buckets_august_2018.py | corehq/apps/accounting/bootstrap/config/user_buckets_august_2018.py | from __future__ import absolute_import
from __future__ import unicode_literals
from decimal import Decimal
from corehq.apps.accounting.models import (
FeatureType,
SoftwarePlanEdition,
UNLIMITED_FEATURE_USAGE
)
BOOTSTRAP_CONFIG = {
(SoftwarePlanEdition.COMMUNITY, False, False): {
'role': 'comm... | from __future__ import absolute_import
from __future__ import unicode_literals
from decimal import Decimal
from corehq.apps.accounting.models import (
FeatureType,
SoftwarePlanEdition,
)
BOOTSTRAP_CONFIG = {
(SoftwarePlanEdition.COMMUNITY, False, False): {
'role': 'community_plan_v1',
'pro... | bsd-3-clause | Python |
205f3fb2f36f33c6d13b4541ad49522b799d358d | simplify the call to make file list | derwolfe/teiler,derwolfe/teiler | src/actions/server.py | src/actions/server.py | import sys
from twisted.python import log
from twisted.web.server import Site
from twisted.web.static import File
from twisted.internet import task
from twisted.internet.protocol import DatagramProtocol
from . import utils
class Broadcaster(DatagramProtocol):
"""
Broadcast the ip to all of the listeners on ... | import sys
from twisted.python import log
from twisted.web.server import Site
from twisted.web.static import File
from twisted.internet import task
from twisted.internet.protocol import DatagramProtocol
from . import utils
class Broadcaster(DatagramProtocol):
"""
Broadcast the ip to all of the listeners on ... | mit | Python |
923d49c753acf7d8945d6b79efbdb08363e130a2 | Bring test_frame_of_test_null_file up to date with new signature of frame_of_test(). | pmclanahan/pytest-progressive,erikrose/nose-progressive,veo-labs/nose-progressive,olivierverdier/nose-progressive | noseprogressive/tests/test_utils.py | noseprogressive/tests/test_utils.py | from os import chdir, getcwd
from os.path import dirname, basename
from unittest import TestCase
from nose.tools import eq_
from noseprogressive.utils import human_path, frame_of_test
class UtilsTests(TestCase):
"""Tests for independent little bits and pieces"""
def test_human_path(self):
chdir(dir... | from os import chdir, getcwd
from os.path import dirname, basename
from unittest import TestCase
from nose.tools import eq_
from noseprogressive.utils import human_path, frame_of_test
class UtilsTests(TestCase):
"""Tests for independent little bits and pieces"""
def test_human_path(self):
chdir(dir... | mit | Python |
d9800c562b81f4e118e9db96a68e301396af46f9 | Add abstract job serializer | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | polyaxon/jobs/serializers.py | polyaxon/jobs/serializers.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from rest_framework import serializers, fields
from jobs.models import JobResources
class JobResourcesSerializer(serializers.ModelSerializer):
class Meta:
model = JobResources
exclude = ('id',)
class JobS... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from rest_framework import serializers
from jobs.models import JobResources
class JobResourcesSerializer(serializers.ModelSerializer):
class Meta:
model = JobResources
exclude = ('id',)
| apache-2.0 | Python |
77c4b5a72ddad68717b6fb1291ce643f20a63e2d | Update SeleniumBase exceptions | seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase | seleniumbase/common/exceptions.py | seleniumbase/common/exceptions.py | """ SeleniumBase Exceptions
NoSuchFileException => Called when self.assert_downloaded_file(...) fails.
NotUsingChromeException => Used by Chrome-only methods if not using Chrome.
OutOfScopeException => Used by BaseCase methods when setUp() is skipped.
TextNotVisibleException => Called when expected text... | """ SeleniumBase Exceptions
NoSuchFileException => Used by self.assert_downloaded_file(...)
NotUsingChromeException => Used by Chrome-only methods if not using Chrome
OutOfScopeException => Used by BaseCase methods when setUp() is skipped
TimeLimitExceededException => Used by "--time-limit=SECONDS"
"""
... | mit | Python |
e6af9d901f26fdf779a6a13319face483fe48a3b | Disable clickjacking protection on demos to display them in iframes | lionleaf/dwitter,lionleaf/dwitter,lionleaf/dwitter | dwitter/dweet/views.py | dwitter/dweet/views.py | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from dwitter.models import Dweet
from django.views.decorators.clickjacking import xframe_opti... | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from dwitter.models import Dweet
def fullscreen_dweet(request, dweet_id):
dweet = get_obje... | apache-2.0 | Python |
4d5a15a4a087ea8bcf458243da947f5e0934013b | Fix html not loading the initial value (#569) | UTNkar/moore,UTNkar/moore,UTNkar/moore,UTNkar/moore | src/blocks/widgets.py | src/blocks/widgets.py | from django import forms
from wagtail.utils.widgets import WidgetWithScript
class CodeMirrorWidget(WidgetWithScript, forms.Textarea):
def render_js_init(self, id, name, value):
js = """
document.addEventListener('DOMContentLoaded', function(){{
CodeMirror.fromTextArea(
... | from django import forms
from wagtail.utils.widgets import WidgetWithScript
class CodeMirrorWidget(WidgetWithScript, forms.Textarea):
def render_js_init(self, id, name, value):
js = """
CodeMirror.fromTextArea(
document.getElementById("{id}"),
{{
lineWrapping: true,
... | agpl-3.0 | Python |
e77d142d73945bc55e893d0d6ca87c657f838558 | hide top level import (#12353) | bokeh/bokeh,bokeh/bokeh,bokeh/bokeh,bokeh/bokeh,bokeh/bokeh | src/bokeh/__init__.py | src/bokeh/__init__.py | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause | Python |
c358f467bbab9bd0366347f9a1bd10cb2e027bb8 | use moksha widget template | fedora-infra/fedora-packages,Fale/fedora-packages,Fale/fedora-packages,fedora-infra/fedora-packages,Fale/fedora-packages,fedora-infra/fedora-packages,fedora-infra/fedora-packages | fedoracommunity/mokshaapps/packagemaintresource/controllers/root.py | fedoracommunity/mokshaapps/packagemaintresource/controllers/root.py | from moksha.lib.base import Controller
from moksha.lib.helpers import MokshaApp
from tg import expose, tmpl_context
from fedoracommunity.widgets import SubTabbedContainer
class TabbedNav(SubTabbedContainer):
tabs= (MokshaApp('Overview', 'fedoracommunity.packagemaint.overview'),
MokshaApp('Builds', 'fedo... | from moksha.lib.base import Controller
from moksha.lib.helpers import MokshaApp
from tg import expose, tmpl_context
from fedoracommunity.widgets import SubTabbedContainer
class TabbedNav(SubTabbedContainer):
tabs= (MokshaApp('Overview', 'fedoracommunity.packagemaint.overview'),
MokshaApp('Builds', 'fedo... | agpl-3.0 | Python |
5b6aa3f6cca7ea83a53178be7b9e58892597ac0b | Add some logging to Auth | ascoderu/opwen-cloudserver,ascoderu/opwen-cloudserver | opwen_email_server/services/auth.py | opwen_email_server/services/auth.py | from abc import ABCMeta
from abc import abstractmethod
from functools import lru_cache
from typing import Callable
from typing import Optional
from azure.storage.table import TableService
from opwen_email_server.utils.log import LogMixin
class Auth(metaclass=ABCMeta):
@abstractmethod
def domain_for(self, cl... | from abc import ABCMeta
from abc import abstractmethod
from functools import lru_cache
from typing import Callable
from typing import Optional
from azure.storage.table import TableService
class Auth(metaclass=ABCMeta):
@abstractmethod
def domain_for(self, client_id: str) -> Optional[str]:
raise NotIm... | apache-2.0 | Python |
4b2a29c484ddd5e2dfb4ad91bb0ae5c7681553c1 | Bump version to 0.1.5 | HighMileage/lacrm | lacrm/_version.py | lacrm/_version.py | __version_info__ = (0, 1, 5)
__version__ = '.'.join(map(str, __version_info__))
| __version_info__ = (0, 1, 4)
__version__ = '.'.join(map(str, __version_info__))
| mit | Python |
0cdac10ee51cc3e812ae9188606301e6be0644ee | Fix default url bug | CornellProjects/hlthpal,CornellProjects/hlthpal,CornellProjects/hlthpal,CornellProjects/hlthpal | web/project/main/urls.py | web/project/main/urls.py | from django.conf.urls import url, include
from rest_framework.authtoken import views as authviews
from rest_framework_jwt import views as jwt_views
from . import views
urlpatterns = [
url(r'^home/', views.index, name='index'),
# Authentication APIs
url(r'^api/auth', jwt_views.obtain_jwt_token, name="auth")... | from django.conf.urls import url, include
from rest_framework.authtoken import views as authviews
from rest_framework_jwt import views as jwt_views
from . import views
urlpatterns = [
url(r'', views.index, name='index'),
url(r'^home/', views.index, name='index'),
# Authentication APIs
url(r'^api/auth',... | apache-2.0 | Python |
9e0c83e751e72e3396a4729392b972834b25c8b7 | Add TODO | jonhadfield/ansible-lookups | v2/aws_secgroup_ids_from_names.py | v2/aws_secgroup_ids_from_names.py | # (c) 2015, Jon Hadfield <jon@lessknown.co.uk>
"""
Description: This lookup takes an AWS region and a list of one or more
security Group Names and returns a list of matching security Group IDs.
Example Usage:
{{ lookup('aws_secgroup_ids_from_names', ('eu-west-1', ['nginx_group', 'mysql_group'])) }}
"""
from __future_... | # (c) 2015, Jon Hadfield <jon@lessknown.co.uk>
"""
Description: This lookup takes an AWS region and a list of one or more
security Group Names and returns a list of matching security Group IDs.
Example Usage:
{{ lookup('aws_secgroup_ids_from_names', ('eu-west-1', ['nginx_group', 'mysql_group'])) }}
"""
from __future_... | mit | Python |
1337c5269d97dc6f1cd47aed838cf26c6b488be2 | bump version | houqp/shell.py | shell/__init__.py | shell/__init__.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
__title__ = 'shell'
__version__ = '0.0.7'
__author__ = 'Qingping Hou'
__license__ = 'MIT'
from .run_cmd import RunCmd
from .input_stream import InputStream
from .api import instream, cmd, pipe_all, ex, p, ex_all
| #!/usr/bin/env python
# -*- coding:utf-8 -*-
__title__ = 'shell'
__version__ = '0.0.6'
__author__ = 'Qingping Hou'
__license__ = 'MIT'
from .run_cmd import RunCmd
from .input_stream import InputStream
from .api import instream, cmd, pipe_all, ex, p, ex_all
| mit | Python |
21ab430368ee262377c77f1ecc24b645377dd520 | Revert "Bug Fix: sort keys when creating json data to send" | imtapps/generic-request-signer,imtapps/generic-request-signer | generic_request_signer/client.py | generic_request_signer/client.py | import six
from datetime import date
import json
import decimal
if six.PY3:
import urllib.request as urllib
else:
import urllib2 as urllib
from generic_request_signer import response, factory
def json_encoder(obj):
if isinstance(obj, date):
return str(obj.isoformat())
if isinstance(obj, deci... | import six
from datetime import date
import json
import decimal
from apysigner import DefaultJSONEncoder
if six.PY3:
import urllib.request as urllib
else:
import urllib2 as urllib
from generic_request_signer import response, factory
def json_encoder(obj):
if isinstance(obj, date):
return str(ob... | bsd-2-clause | Python |
b28ca4abf8a6986b96bfb89cf8737c8f737fee4e | update boto import to use boto3 (#1000) | openstax/openstax-cms,openstax/openstax-cms,Connexions/openstax-cms,openstax/openstax-cms,Connexions/openstax-cms,openstax/openstax-cms | global_settings/wagtail_hooks.py | global_settings/wagtail_hooks.py | import boto3
import wagtail.admin.rich_text.editors.draftail.features as draftail_features
from wagtail.admin.rich_text.converters.html_to_contentstate import InlineStyleElementHandler
from wagtail.core import hooks
from django.urls import reverse
from wagtail.admin.menu import MenuItem
from .models import CloudfrontD... | import boto
import wagtail.admin.rich_text.editors.draftail.features as draftail_features
from wagtail.admin.rich_text.converters.html_to_contentstate import InlineStyleElementHandler
from wagtail.core import hooks
from django.urls import reverse
from wagtail.admin.menu import MenuItem
from .models import CloudfrontDi... | agpl-3.0 | Python |
009ab26737923cfff97ba37a035dcff7639135b1 | Replace all_pages_in_directory with concat_pdf_pages | shunghsiyu/pdf-processor | Util.py | Util.py | """Collection of Helper Functions"""
import os
from fnmatch import fnmatch
from PyPDF2 import PdfFileReader
def pdf_file(filename):
"""Test whether or the the filename ends with '.pdf'."""
return fnmatch(filename, '*.pdf')
def all_pdf_files_in_directory(path):
"""Return a list of of PDF files in a dire... | """Collection of Helper Functions"""
import os
from fnmatch import fnmatch
from PyPDF2 import PdfFileReader
def pdf_file(filename):
"""Test whether or the the filename ends with '.pdf'."""
return fnmatch(filename, '*.pdf')
def all_pdf_files_in_directory(path):
"""Return a list of of PDF files in a dire... | mit | Python |
d16373609b2f30c6ffa576c1269c529f12c9622c | Switch to fast method for personal timetable | uclapi/uclapi,uclapi/uclapi,uclapi/uclapi,uclapi/uclapi | backend/uclapi/timetable/urls.py | backend/uclapi/timetable/urls.py | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^personal$', views.get_personal_timetable_fast),
url(r'^bymodule$', views.get_modules_timetable),
]
| from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^personal_fast$', views.get_personal_timetable_fast),
url(r'^personal$', views.get_personal_timetable),
url(r'^bymodule$', views.get_modules_timetable),
]
| mit | Python |
22785c709956365ac51bc3b79135e6debc6418ae | Exclude legacy objc API tests properly. | ShiftMediaProject/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,TimothyGu/libilbc | all.gyp | all.gyp | # Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | # Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | bsd-3-clause | Python |
e89e721225e916f4c2514f4a6568571abfc2acc0 | Add slides frame simibar | speed-of-light/pyslider | lib/plotter/matching/__init__.py | lib/plotter/matching/__init__.py | __all__ = ["core", "single_matching_plotter"]
from lib.exp.evaluator.ground_truth import GroundTruth as GT
from core import MatchingPlotterBase
class MatchingPlotter(MatchingPlotterBase):
def __init__(self, root, name):
"""
Try to show one matching pairs
use set_data to set matched result... | __all__ = ["core", "single_matching_plotter"]
from core import MatchingPlotterBase
class MatchingPlotter(MatchingPlotterBase):
def __init__(self, root, name):
"""
Try to show one matching pairs
use set_data to set matched results:
array of `sid`, `fid`, `matches`
"""
... | agpl-3.0 | Python |
cd59979ab446d7613ec7df5d5737539464918edf | Fix span boundary handling in Spanish noun_chunks (#5860) | explosion/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy | spacy/lang/es/syntax_iterators.py | spacy/lang/es/syntax_iterators.py | # coding: utf8
from __future__ import unicode_literals
from ...symbols import NOUN, PROPN, PRON, VERB, AUX
from ...errors import Errors
def noun_chunks(doclike):
doc = doclike.doc
if not doc.is_parsed:
raise ValueError(Errors.E029)
if not len(doc):
return
np_label = doc.vocab.string... | # coding: utf8
from __future__ import unicode_literals
from ...symbols import NOUN, PROPN, PRON, VERB, AUX
from ...errors import Errors
def noun_chunks(doclike):
doc = doclike.doc
if not doc.is_parsed:
raise ValueError(Errors.E029)
if not len(doc):
return
np_label = doc.vocab.string... | mit | Python |
db67db3cea880e40d1982149fea86699c15b5f75 | change append to add (for the set in part 1) | robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions | day3.py | day3.py | #!/usr/local/bin/python3
from collections import namedtuple
with open('day3_input.txt') as f:
instructions = f.read().rstrip()
Point = namedtuple('Point', ['x', 'y'])
location = Point(0, 0)
visited = {location}
def new_loc(current_loc, instruction):
if instruction == '^':
xy = current_loc.x, curren... | #!/usr/local/bin/python3
from collections import namedtuple
with open('day3_input.txt') as f:
instructions = f.read().rstrip()
Point = namedtuple('Point', ['x', 'y'])
location = Point(0, 0)
visited = {location}
def new_loc(current_loc, instruction):
if instruction == '^':
xy = current_loc.x, curren... | mit | Python |
db713e62eafb29c1a968e16b997a4e8f49156c78 | Correct config for touchscreen | sumpfgottheit/pdu1800 | config.py | config.py | __author__ = 'Florian'
from util import get_lan_ip
#################
# CONFIGURATION #
#################
# CHANGE FROM HERE
#
UDP_PORT = 18877
IP = get_lan_ip()
BUF_SIZE = 4096
TIMEOUT_IN_SECONDS = 0.1
#
SCREEN_WIDTH = 320
SCREEN_HEIGHT = 240
SCREEN_DEEP = 32
#
LABEL_RIGHT = 0
LABEL_LEFT = 1
ALIGN_CENTER = 0
ALIG... | __author__ = 'Florian'
from util import get_lan_ip
#################
# CONFIGURATION #
#################
# CHANGE FROM HERE
#
UDP_PORT = 18877
IP = get_lan_ip()
BUF_SIZE = 4096
TIMEOUT_IN_SECONDS = 0.1
#
SCREEN_WIDTH = 320
SCREEN_HEIGHT = 240
SCREEN_DEEP = 32
#
LABEL_RIGHT = 0
LABEL_LEFT = 1
ALIGN_CENTER = 0
ALIG... | mit | Python |
68593e359d5bb79c096d584c83df1ff55262a686 | use with | victorhaggqvist/ledman | config.py | config.py | # coding=utf-8
from configparser import ConfigParser
import os
__author__ = 'Victor Häggqvist'
class Config:
confdir = os.path.dirname(os.path.realpath(__file__))
config_file = os.path.join(confdir, 'ledman.conf')
default = """
[gpio]
red=22
green=27
blue=17
[default_level]
red=0
green=0.3
blue=0.5
[se... | # coding=utf-8
from configparser import ConfigParser
import os
__author__ = 'Victor Häggqvist'
class Config:
confdir = os.path.dirname(os.path.realpath(__file__))
config_file = os.path.join(confdir, 'ledman.conf')
default = """
[gpio]
red=22
green=27
blue=17
[default_level]
red=0
green=0.3
blue=0.5
[se... | mit | Python |
0812ec319291b709613152e9e1d781671047a428 | Make server ignore missing environment variables | Stark-Mountain/meetup-facebook-bot,Stark-Mountain/meetup-facebook-bot | config.py | config.py | import os
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', 'sqlite://')
ACCESS_TOKEN = os.environ.get('ACCESS_TOKEN')
PAGE_ID = os.environ.get('PAGE_ID')
APP_ID = os.environ.get('APP_ID')
VERIFY_TOKEN = os.environ.get('VERIFY_TOKEN')
| import os
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
ACCESS_TOKEN = os.environ['ACCESS_TOKEN']
PAGE_ID = os.environ['PAGE_ID']
APP_ID = os.environ['APP_ID']
VERIFY_TOKEN = os.environ['VERIFY_TOKEN']
| mit | Python |
d7e03596f8bf1e886e984c0ea98334af878a15e2 | Use __future__.print_function so syntax is valid on Python 3 | enthought/Meta,gutomaia/Meta | meta/bytecodetools/print_code.py | meta/bytecodetools/print_code.py | '''
Created on May 10, 2012
@author: sean
'''
from __future__ import print_function
from .bytecode_consumer import ByteCodeConsumer
from argparse import ArgumentParser
class ByteCodePrinter(ByteCodeConsumer):
def generic_consume(self, instr):
print(instr)
def main():
parser = ArgumentParser()
... | '''
Created on May 10, 2012
@author: sean
'''
from .bytecode_consumer import ByteCodeConsumer
from argparse import ArgumentParser
class ByteCodePrinter(ByteCodeConsumer):
def generic_consume(self, instr):
print instr
def main():
parser = ArgumentParser()
parser.add_argument()
if __name__ ==... | bsd-3-clause | Python |
1f343e52abb67ab2f85836b10dadb3cb34a95379 | fix login issue with django 1.7: check_for_test_cookie is deprecated and removed in django 1.7. | AndyHelix/django-xadmin,Keleir/django-xadmin,huaishan/django-xadmin,vincent-fei/django-xadmin,tvrcopgg/edm_xadmin,t0nyren/django-xadmin,huaishan/django-xadmin,cupen/django-xadmin,alexsilva/django-xadmin,cupen/django-xadmin,marguslaak/django-xadmin,sshwsfc/xadmin,merlian/django-xadmin,t0nyren/django-xadmin,hochanh/djang... | xadmin/forms.py | xadmin/forms.py | from django import forms
from django.contrib.auth import authenticate
from django.contrib.auth.forms import AuthenticationForm
from django.utils.translation import ugettext_lazy, ugettext as _
from xadmin.util import User
ERROR_MESSAGE = ugettext_lazy("Please enter the correct username and password "
... | from django import forms
from django.contrib.auth import authenticate
from django.contrib.auth.forms import AuthenticationForm
from django.utils.translation import ugettext_lazy, ugettext as _
from xadmin.util import User
ERROR_MESSAGE = ugettext_lazy("Please enter the correct username and password "
... | bsd-3-clause | Python |
7b6542d58bbe788587b47e282ef393eda461f267 | add get method in UserAPI | hexa4313/velov-companion-server,hexa4313/velov-companion-server | api/route/user.py | api/route/user.py | from flask import request
from flask.ext import restful
from flask.ext.restful import marshal_with
from route.base import api
from flask.ext.bcrypt import generate_password_hash
from model.base import db
from model.user import User, user_marshaller
class UserAPI(restful.Resource):
@marshal_with(user_marshaller)
... | from flask import request
from flask.ext import restful
from flask.ext.restful import marshal_with
from route.base import api
from flask.ext.bcrypt import generate_password_hash
from model.base import db
from model.user import User, user_marshaller
class UserAPI(restful.Resource):
@marshal_with(user_marshaller)
... | mit | Python |
346a7d18ef6dc063e2802a0347709700a1543902 | update 影视列表 | wangtai/us-show-time-table,wangtai/us-show-time-table | 1/showics/models.py | 1/showics/models.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Last modified: Wang Tai (i@wangtai.me)
"""docstring
"""
__revision__ = '0.1'
from django.db import models
class ShowTableIcs(models.Model):
uid = models.CharField(max_length=255, unique=True, primary_key=True)
title = models.CharField(max_length=255, null=Fal... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Last modified: Wang Tai (i@wangtai.me)
"""docstring
"""
__revision__ = '0.1'
from django.db import models
class ShowTableIcs(models.Model):
# uid
uid = models.CharField(max_length=255, unique=True, primary_key=True)
# title
title = models.CharField(ma... | apache-2.0 | Python |
5b2cc6ed06045bbe219f9cf81317c1c1a5bac714 | add missing docstring in ttls | iksaif/biggraphite,criteo/biggraphite,iksaif/biggraphite,Thib17/biggraphite,criteo/biggraphite,Thib17/biggraphite,criteo/biggraphite,Thib17/biggraphite,iksaif/biggraphite,iksaif/biggraphite,criteo/biggraphite,Thib17/biggraphite | biggraphite/drivers/ttls.py | biggraphite/drivers/ttls.py | #!/usr/bin/env python
# Copyright 2016 Criteo
#
# 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 agree... | #!/usr/bin/env python
# Copyright 2016 Criteo
#
# 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 agree... | apache-2.0 | Python |
c1d35c37bb51943c28f58b4dc8005b775b7076c4 | Clean the terp file | gisce/openobject-server,xrg/openerp-server,splbio/openobject-server,vnc-biz/openerp-server,MarkusTeufelberger/openobject-server,MarkusTeufelberger/openobject-server,vnc-biz/openerp-server,splbio/openobject-server,xrg/openerp-server,ovnicraft/openerp-server,gisce/openobject-server,MarkusTeufelberger/openobject-server,ov... | bin/addons/base/__terp__.py | bin/addons/base/__terp__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 | Python |
ca5c3648ad5f28090c09ecbbc0e008c51a4ce708 | Add a new dev (optional) parameter and use it | sunil07t/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server | bin/push/silent_ios_push.py | bin/push/silent_ios_push.py | import json
import logging
import argparse
import emission.net.ext_service.push.notify_usage as pnu
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
parser = argparse.ArgumentParser(prog="silent_ios_push")
parser.add_argument("interval",
help="specify the sync interval that the ... | import json
import logging
import argparse
import emission.net.ext_service.push.notify_usage as pnu
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
parser = argparse.ArgumentParser(prog="silent_ios_push")
parser.add_argument("interval",
help="specify the sync interval that the ... | bsd-3-clause | Python |
a33b8222959cc14a4c89658e6d7aa6ff07f27c0c | remove commented code | neuropycon/ephypype | ephypype/import_ctf.py | ephypype/import_ctf.py | """Import ctf."""
# -------------------- nodes (Function)
def convert_ds_to_raw_fif(ds_file):
"""CTF .ds to .fif and save result in pipeline folder structure."""
import os
import os.path as op
from nipype.utils.filemanip import split_filename as split_f
from mne.io import read_raw_ctf
_, bas... | """Import ctf."""
# -------------------- nodes (Function)
def convert_ds_to_raw_fif(ds_file):
"""CTF .ds to .fif and save result in pipeline folder structure."""
import os
import os.path as op
from nipype.utils.filemanip import split_filename as split_f
from mne.io import read_raw_ctf
_, bas... | bsd-3-clause | Python |
697d3c4c80574d82e8aa37e2a13cbaeefdad255c | bump version | cenkalti/kuyruk,cenkalti/kuyruk | kuyruk/__init__.py | kuyruk/__init__.py | from __future__ import absolute_import
import logging
from kuyruk.kuyruk import Kuyruk
from kuyruk.worker import Worker
from kuyruk.task import Task
from kuyruk.config import Config
__version__ = '0.13.2'
try:
# not available in python 2.6
from logging import NullHandler
except ImportError:
class NullHan... | from __future__ import absolute_import
import logging
from kuyruk.kuyruk import Kuyruk
from kuyruk.worker import Worker
from kuyruk.task import Task
from kuyruk.config import Config
__version__ = '0.13.1'
try:
# not available in python 2.6
from logging import NullHandler
except ImportError:
class NullHan... | mit | Python |
50b189888a0ff68f1cc4db1615991d1afe364854 | Update cigar_party.py | RCoon/CodingBat,RCoon/CodingBat | Python/Logic_1/cigar_party.py | Python/Logic_1/cigar_party.py | # When squirrels get together for a party, they like to have cigars. A squirrel
# party is successful when the number of cigars is between 40 and 60, inclusive.
# Unless it is the weekend, in which case there is no upper bound on the number
# of cigars. Return True if the party with the given values is successful, or
#... | # When squirrels get together for a party, they like to have cigars. A squirrel
# party is successful when the number of cigars is between 40 and 60, inclusive.
# Unless it is the weekend, in which case there is no upper bound on the number
# of cigars. Return True if the party with the given values is successful, or
#... | mit | Python |
4d3d4e457c5886ace69250de1c5f4f696604d43b | Fix cal_seqs with no delay | BBN-Q/QGL,BBN-Q/QGL | QGL/BasicSequences/helpers.py | QGL/BasicSequences/helpers.py | # coding=utf-8
from itertools import product
import operator
from ..PulsePrimitives import Id, X, MEAS
from ..ControlFlow import qwait
from functools import reduce
def create_cal_seqs(qubits, numRepeats, measChans=None, waitcmp=False, delay=None):
"""
Helper function to create a set of calibration sequences.
P... | # coding=utf-8
from itertools import product
import operator
from ..PulsePrimitives import Id, X, MEAS
from ..ControlFlow import qwait
from functools import reduce
def create_cal_seqs(qubits, numRepeats, measChans=None, waitcmp=False, delay=None):
"""
Helper function to create a set of calibration sequences.
P... | apache-2.0 | Python |
fc975bd573d439490a65bb72ff5f6c69b2b0a771 | Update loudness_zwicker_lowpass_intp.py | Eomys/MoSQITo | mosqito/functions/loudness_zwicker/loudness_zwicker_lowpass_intp.py | mosqito/functions/loudness_zwicker/loudness_zwicker_lowpass_intp.py | # -*- coding: utf-8 -*-
"""
@date Created on Fri May 22 2020
@author martin_g for Eomys
"""
# Standard library imports
import math
import numpy as np
#Needed for the loudness_zwicker_lowpass_intp_ea function
from scipy import signal
def loudness_zwicker_lowpass_intp(loudness, tau, sample_rate):
"""1st order low-p... | # -*- coding: utf-8 -*-
"""
@date Created on Fri May 22 2020
@author martin_g for Eomys
"""
# Standard library imports
import math
import numpy as np
def loudness_zwicker_lowpass_intp(loudness, tau, sample_rate):
"""1st order low-pass with linear interpolation of signal for
increased precision
Parameter... | apache-2.0 | Python |
4748fd514fcafd9a0536b24069bf3365cb60a926 | Bump development version number | lpomfrey/django-debreach,lpomfrey/django-debreach | debreach/__init__.py | debreach/__init__.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from distutils import version
__version__ = '1.3.1'
version_info = version.StrictVersion(__version__).version
default_app_config = 'debreach.apps.DebreachConfig'
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from distutils import version
__version__ = '1.3.0'
version_info = version.StrictVersion(__version__).version
default_app_config = 'debreach.apps.DebreachConfig'
| bsd-2-clause | Python |
6e3cd31c7efbea71b5f731429c24e946ce6fc476 | Bump version | lpomfrey/django-debreach,lpomfrey/django-debreach | debreach/__init__.py | debreach/__init__.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from distutils import version
__version__ = '0.2.0'
version_info = version.StrictVersion(__version__).version
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from distutils import version
__version__ = '0.1.1'
version_info = version.StrictVersion(__version__).version
| bsd-2-clause | Python |
21149eb8d128c405d0b69991d1855e99ced951c7 | Test fixed: WorkbenchUser is auto created by signal, so creating it separately is not required | MOOCworkbench/MOOCworkbench,MOOCworkbench/MOOCworkbench,MOOCworkbench/MOOCworkbench | ExperimentsManager/tests.py | ExperimentsManager/tests.py | from django.test import TestCase
from .models import Experiment
from UserManager.models import WorkbenchUser
from django.contrib.auth.models import User
from django.test import Client
class ExperimentTestCase(TestCase):
def setUp(self):
self.user = User.objects.create_user('test', 'test@test.nl', 'test')
... | from django.test import TestCase
from .models import Experiment
from UserManager.models import WorkbenchUser
from django.contrib.auth.models import User
from django.test import Client
class ExperimentTestCase(TestCase):
def setUp(self):
self.user = User.objects.create_user('test', 'test@test.nl', 'test')
... | mit | Python |
f149baa8ca7a401f8d2d390d84fc85960edd743d | Work in progress | petrveprek/dius | dius.py | dius.py | #!python3
# Copyright (c) 2016 Petr Veprek
"""Disk Usage"""
import math
import operator
import os
import string
import sys
import time
TITLE = "Disk Usage"
VERSION = "0.0.0"
VERBOSE = False
WIDTH = 80
COUNT = 20
def now(on="on", at="at"):
return "{}{} {}{}".format(on + " " if on != "" else "", time.strftime("%Y-... | #!python3
# Copyright (c) 2016 Petr Veprek
"""Disk Usage"""
import math
import operator
import os
import string
import sys
import time
TITLE = "Disk Usage"
VERSION = "0.0.0"
VERBOSE = False
def now(on="on", at="at"):
return "{}{} {}{}".format(on + " " if on != "" else "", time.strftime("%Y-%m-%d"), at + " " if a... | mit | Python |
9ec49083879831d7b2cfd863ea139e0e86d42c36 | Bump release version | lpomfrey/django-debreach,lpomfrey/django-debreach | debreach/__init__.py | debreach/__init__.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from distutils import version
__version__ = '1.4.0'
version_info = version.StrictVersion(__version__).version
default_app_config = 'debreach.apps.DebreachConfig'
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from distutils import version
__version__ = '1.3.1'
version_info = version.StrictVersion(__version__).version
default_app_config = 'debreach.apps.DebreachConfig'
| bsd-2-clause | Python |
206e8c2da4677532add03deadac03e88a7cd0da8 | update __init__ | cleverhans-lab/cleverhans,cleverhans-lab/cleverhans,cleverhans-lab/cleverhans,openai/cleverhans | cleverhans/__init__.py | cleverhans/__init__.py | """The CleverHans adversarial example library"""
from cleverhans.devtools.version import append_dev_version
# If possible attach a hex digest to the version string to keep track of
# changes in the development branch
__version__ = append_dev_version('3.0.0')
| """The CleverHans adversarial example library"""
from cleverhans.devtools.version import append_dev_version
# If possible attach a hex digest to the version string to keep track of
# changes in the development branch
__version__ = append_dev_version('2.0.0')
| mit | Python |
878db5485946935f8784c6c9f15decbe15c0dfbc | Remove catchall redirect | DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange | democracylab/urls.py | democracylab/urls.py | """democracylab URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | """democracylab URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cla... | mit | Python |
a82b3b5ba8d6fba12df1a3c1993325955da893b6 | Fix a typo in comment. Thanks for tmm1 for watching after me. | xadjmerripen/carbon,criteo-forks/carbon,JeanFred/carbon,mleinart/carbon,benburry/carbon,graphite-project/carbon,protochron/carbon,graphite-server/carbon,obfuscurity/carbon,iain-buclaw-sociomantic/carbon,benburry/carbon,piotr1212/carbon,mleinart/carbon,lyft/carbon,pratX/carbon,deniszh/carbon,criteo-forks/carbon,pratX/ca... | lib/carbon/util.py | lib/carbon/util.py | import os
import pwd
from os.path import abspath, basename, dirname, join
from twisted.python.util import initgroups
from twisted.scripts.twistd import runApp
from twisted.scripts._twistd_unix import daemonize
daemonize = daemonize # Backwards compatibility
def dropprivs(user):
uid, gid = pwd.getpwnam(user)[2:4... | import os
import pwd
from os.path import abspath, basename, dirname, join
from twisted.python.util import initgroups
from twisted.scripts.twistd import runApp
from twisted.scripts._twistd_unix import daemonize
daemonize = daemonize # Backwards compatibility
def dropprivs(user):
uid, gid = pwd.getpwnam(user)[2:4... | apache-2.0 | Python |
e611e9518945fa38165e8adf7103561f438b70b1 | Add subcommand to process directory | gsong/interdiagram | interdiagram/bin/interdiagram.py | interdiagram/bin/interdiagram.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pathlib import Path
from typing import Iterable, List, TypeVar
from typing.io import IO
import click
import yaml
from ..models import Diagram
click.disable_unicode_literals_warning = True
FileType = TypeVar('FileType', IO, Path)
def _is_file_obj(
f: File... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from typing import List
import click
import yaml
from ..models import Diagram
click.disable_unicode_literals_warning = True
# TODO: Correct documentation schema once it's frozen
@click.command()
@click.argument('yaml-file', nargs=-1, type=click.File())
@click.argument... | mit | Python |
2163478d2d927c4e50fcef65a88ca9c81b9d245b | Remove print from tests | jabooth/menpodetect,yuxiang-zhou/menpodetect,yuxiang-zhou/menpodetect,jabooth/menpodetect | menpodetect/tests/opencv_test.py | menpodetect/tests/opencv_test.py | from menpodetect.opencv import (load_opencv_frontal_face_detector,
load_opencv_eye_detector)
import menpo.io as mio
takeo = mio.import_builtin_asset.takeo_ppm()
def test_frontal_face_detector():
takeo_copy = takeo.copy()
opencv_detector = load_opencv_frontal_face_detector()
... | from menpodetect.opencv import (load_opencv_frontal_face_detector,
load_opencv_eye_detector)
import menpo.io as mio
takeo = mio.import_builtin_asset.takeo_ppm()
def test_frontal_face_detector():
takeo_copy = takeo.copy()
opencv_detector = load_opencv_frontal_face_detector()
... | bsd-3-clause | Python |
e8ad2ca0fc2ddec71645bef31686d9de2001dd88 | add translate type | sloria/modular-odm,chrisseto/modular-odm,icereval/modular-odm,CenterForOpenScience/modular-odm | modularodm/fields/StringField.py | modularodm/fields/StringField.py | from . import Field
from ..validators import StringValidator
class StringField(Field):
# default = ''
translate_type = str
validate = StringValidator()
def __init__(self, *args, **kwargs):
super(StringField, self).__init__(*args, **kwargs) | from . import Field
from ..validators import StringValidator
class StringField(Field):
# default = ''
validate = StringValidator()
def __init__(self, *args, **kwargs):
super(StringField, self).__init__(*args, **kwargs) | apache-2.0 | Python |
df5ac0a7f2246e5fbbb5f7d87903a5232e94fe87 | Test deprecation. | faassen/morepath,taschini/morepath,morepath/morepath | morepath/tests/test_autosetup.py | morepath/tests/test_autosetup.py | from collections import namedtuple
from morepath.autosetup import (
caller_module, caller_package, autoscan,
morepath_packages, import_package)
from base.m import App
import morepath
import pytest
def setup_module(module):
with pytest.deprecated_call():
morepath.disable_implicit()
def test_impor... | from collections import namedtuple
from morepath.autosetup import (
caller_module, caller_package, autoscan,
morepath_packages, import_package)
from base.m import App
import morepath
import pytest
def setup_module(module):
morepath.disable_implicit()
def test_import():
import base
import sub
... | bsd-3-clause | Python |
e1184f70abd477ae2d0c304321231c908c67882b | add comment to authorize() that uname and pw are saved in plain text | MSLNZ/msl-package-manager | msl/package_manager/authorize.py | msl/package_manager/authorize.py | """
Create the GitHub authorization file.
"""
import getpass
from .utils import log, get_username, _get_input, _GITHUB_AUTH_PATH
WARNING_MESSAGE = """
Your username and password are saved in plain text in the file that
is created. You should set the file permissions provided by your
operating system to ensure that y... | """
Create the GitHub authorization file.
"""
import getpass
from .utils import log, get_username, _get_input, _GITHUB_AUTH_PATH
WARNING_MESSAGE = """
Your username and password are saved in plain text in the file that
is created. You should set the file permissions provided by your
operating system to ensure that y... | mit | Python |
47b97cf311c36b993b59235dedc06993a6d58b6f | make TestVecSim subclass object | 12yujim/pymtl,cfelton/pymtl,tj93/pymtl,jck/pymtl,tj93/pymtl,12yujim/pymtl,tj93/pymtl,jjffryan/pymtl,jck/pymtl,cornell-brg/pymtl,cornell-brg/pymtl,Glyfina-Fernando/pymtl,jck/pymtl,jjffryan/pymtl,jjffryan/pymtl,Glyfina-Fernando/pymtl,12yujim/pymtl,cornell-brg/pymtl,Glyfina-Fernando/pymtl,cfelton/pymtl,cfelton/pymtl | new_pmlib/TestVectorSimulator.py | new_pmlib/TestVectorSimulator.py | #=========================================================================
# TestVectorSimulator
#=========================================================================
# This class simplifies creating unit tests which simply set certain
# inputs and then check certain outputs every cycle. A user simply needs
# to i... | #=========================================================================
# TestVectorSimulator
#=========================================================================
# This class simplifies creating unit tests which simply set certain
# inputs and then check certain outputs every cycle. A user simply needs
# to i... | bsd-3-clause | Python |
0cd4862062bbe19aec5bb2a23563e03eb8ca8cb7 | Fix stable release script | Omenia/robotframework-whitelibrary,Omenia/robotframework-whitelibrary | make_stable_release.py | make_stable_release.py | from robot.libdoc import libdoc
from src.WhiteLibrary.version import VERSION
import git
import sys
VERSION_FILE = './src/WhiteLibrary/version.py'
def change_stable(from_stable, to_stable):
with open(VERSION_FILE, 'r') as file:
filedata = file.read()
filedata = filedata.replace('STABLE = {0}'.format(... | from robot.libdoc import libdoc
from src.WhiteLibrary.version import VERSION
import git
import sys
VERSION_FILE = './src/WhiteLibrary/version.py'
def change_stable(from_stable, to_stable):
with open(VERSION_FILE, 'r') as file :
filedata = file.read()
filedata = filedata.replace('STABLE = {0}'.format... | apache-2.0 | Python |
58bab9291c85edc3f13d3dc0659eff3c17201eb1 | Improve pixelcnn namings and comments | israelg99/eva | eva/models/pixelcnn.py | eva/models/pixelcnn.py | from keras.models import Model
from keras.layers import Input, Convolution2D, Activation, Flatten, Dense, Reshape, Lambda
from keras.layers.advanced_activations import PReLU
from keras.engine.topology import merge
from keras.optimizers import Nadam
import keras.backend.tensorflow_backend as K
from eva.layers.residual_... | from keras.models import Model
from keras.layers import Input, Convolution2D, Activation, Flatten, Dense, Reshape, Lambda
from keras.layers.advanced_activations import PReLU
from keras.engine.topology import merge
from keras.optimizers import Nadam
import keras.backend.tensorflow_backend as K
from eva.layers.residual_... | apache-2.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.