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 |
|---|---|---|---|---|---|---|---|---|
6db5252eefecb73b57de60bb3d03de89e334d844 | Fix flake8 violation | schinckel/django-boardinghouse,schinckel/django-boardinghouse,schinckel/django-boardinghouse | boardinghouse/contrib/demo/apps.py | boardinghouse/contrib/demo/apps.py | import datetime
from django.apps import AppConfig
from django.core.checks import Error, register
class BoardingHouseDemoConfig(AppConfig):
name = 'boardinghouse.contrib.demo'
def ready(self):
# Make sure our required setting exists.
from django.conf import settings
if not hasattr(se... | import datetime
from django.apps import AppConfig
from django.core.checks import Error, register
class BoardingHouseDemoConfig(AppConfig):
name = 'boardinghouse.contrib.demo'
def ready(self):
# Make sure our required setting exists.
from django.apps import apps
from django.conf impor... | bsd-3-clause | Python |
589e1755892de43d792c9e1e2bf9b538fbce2d14 | Update freeze_recursive.py | zelaznik/frozen_dict | freeze_recursive.py | freeze_recursive.py | from frozen_dict import FrozenDict
def freeze(obj):
''' Recursive function which turns dictionaries into
FrozenDict objects, lists into tuples, and sets
into frozensets.
THIS FUNCTION IS IN BETA AND HAS NOT BEEN
EXTENSIVELY TESTED.
'''
try:
#See if the object is h... | from frozen_dict import FrozenDict
def freeze(obj):
''' Recursive function which turns dictionaries into
FrozenDict objects, lists into tuples, and sets
into frozensets.
THIS FUNCTION IS IN BETA AND HAS NOT BEEN
EXTENSIVELY TESTED.
'''
try:
#See if the object is h... | mit | Python |
30f2983e57fa75e0acef8449abe010a7c6b38ef9 | Add coverage to build but it does not break the build | ImmobilienScout24/crassus | build.py | build.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from pybuilder.core import use_plugin, init
use_plugin("python.core")
use_plugin("python.unittest")
use_plugin("python.install_dependencies")
use_plugin("python.flake8")
use_plugin("pypi:pybuilder_aws_lambda_plugin")
use_plugin("python.coverage")
name = 'crass... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from pybuilder.core import use_plugin, init
use_plugin("python.core")
use_plugin("python.unittest")
use_plugin("python.install_dependencies")
use_plugin("python.flake8")
use_plugin("pypi:pybuilder_aws_lambda_plugin")
#use_plugin("python.coverage")
name = 'cras... | apache-2.0 | Python |
cece5c308c3b21d3596d4719a89c3681189c088d | print paths relative to cache dir | efiop/dvc,dataversioncontrol/dvc,dmpetrov/dataversioncontrol,dmpetrov/dataversioncontrol,efiop/dvc,dataversioncontrol/dvc | dvc/command/data_sync.py | dvc/command/data_sync.py | import os
import dvc.cloud.base as cloud
from dvc.command.common.base import CmdBase
from dvc.exceptions import DvcException
class CmdDataBase(CmdBase):
def do_run(self, target):
pass
def run(self):
if not self.args.targets:
return self.do_run()
ret = 0
for targ... | import os
import dvc.cloud.base as cloud
from dvc.command.common.base import CmdBase
from dvc.exceptions import DvcException
class CmdDataBase(CmdBase):
def do_run(self, target):
pass
def run(self):
if not self.args.targets:
return self.do_run()
ret = 0
for targ... | apache-2.0 | Python |
25c3d845a31342a8afa08fd41347470639a524e5 | bump to v 0.2.12 | CENDARI/editorsnotes,CENDARI/editorsnotes,CENDARI/editorsnotes,CENDARI/editorsnotes,CENDARI/editorsnotes | editorsnotes/__init__.py | editorsnotes/__init__.py | __version__ = '0.2.12'
VERSION = __version__
| __version__ = '0.2.11'
VERSION = __version__
| agpl-3.0 | Python |
9c3729de6121e3b6b7a4401e9176ea9d3bcf3d74 | build gtk-sharp from svn, fix up .configs | directhex/banshee-hacks,directhex/banshee-hacks,petejohanson/banshee,petejohanson/banshee,ixfalia/banshee,lamalex/Banshee,babycaseny/banshee,lamalex/Banshee,mono-soc-2011/banshee,ixfalia/banshee,petejohanson/banshee,arfbtwn/banshee,GNOME/banshee,dufoli/banshee,arfbtwn/banshee,Dynalon/banshee-osx,GNOME/banshee,mono-soc-... | build/bundle/packages/gtk-sharp.py | build/bundle/packages/gtk-sharp.py | def svn_co_or_up (package):
os.chdir ('..')
if os.path.isdir ('gtk-sharp-svn'):
os.chdir ('gtk-sharp-svn')
os.system ('svn up')
else:
os.system ('svn co http://anonsvn.mono-project.com/source/trunk/gtk-sharp gtk-sharp-svn')
os.chdir ('gtk-sharp-svn')
os.chdir ('..')
package = {
'name': 'gtk-sharp',
'v... | package = {
'name': 'gtk-sharp',
'version': '2.12.9',
'branch': '212',
'sources': [
'http://ftp.novell.com/pub/mono/sources/%{name}%{branch}/%{name}-%{version}.tar.bz2'
]
}
| mit | Python |
76e0ea2b4dab01bef29e9a18589a32897b49de45 | Remove commented inspection code | teddywing/RoboFont-Equalize-Sidebearings-Key,teddywing/RoboFont-Equalize-Sidebearings-Key | equalize_sidebearings.py | equalize_sidebearings.py | from mojo.events import addObserver
import vanilla
class EqualizeSidebearings(object):
def __init__(self):
addObserver(self, 'center', 'spaceCenterKeyUp')
def center(self, info):
if info['event'].characters() == 'a':
info['glyph'].center()
EqualizeSidebearings() | from mojo.events import addObserver
import vanilla
class EqualizeSidebearings(object):
def __init__(self):
addObserver(self, 'center', 'spaceCenterKeyUp')
def center(self, info):
# print info
# self.w = vanilla.Window((400, 400, 1000, 900))
# self.w.text = vanilla.TextBox((10, ... | mit | Python |
6112bf298dc673d04ff81b6d135e1748478f8be8 | Return all indices in the meta. | grigorescu/es_helpers | es_helpers/es_cleanup.py | es_helpers/es_cleanup.py | #!/usr/bin/env python
import requests
import datetime
import sys
import es_config
elasticsearch_url = "http://%s:%d" % (es_config.elasticsearch_host, es_config.elasticsearch_port)
def delete():
"""Deletes logs older than a specified number of days."""
if len(sys.argv) != 2:
usage()
try:
... | #!/usr/bin/env python
import requests
import datetime
import sys
import es_config
elasticsearch_url = "http://%s:%d" % (es_config.elasticsearch_host, es_config.elasticsearch_port)
def delete():
"""Deletes logs older than a specified number of days."""
if len(sys.argv) != 2:
usage()
try:
... | bsd-2-clause | Python |
b4da1078b04bbc6f3083e796eda63a7aa0b42e3f | Add default branch as well as site for fabfile | theworldbright/mainsite,aspc/mainsite,aspc/mainsite,aspc/mainsite,theworldbright/mainsite,aspc/mainsite,theworldbright/mainsite,theworldbright/mainsite | fabfile/__init__.py | fabfile/__init__.py | from fabric.api import *
try:
from config import host_strings # varies per-user, so not tracked in Git
env.hosts = host_strings
except ImportError:
env.hosts = ["peninsula.pomona.edu"]
env.site = env.branch = "staging" # By default, run all of these tasks on 'staging'
env.origin = "git@github.com:aspc/ma... | from fabric.api import *
try:
from config import host_strings # varies per-user, so not tracked in Git
env.hosts = host_strings
except ImportError:
env.hosts = ["peninsula.pomona.edu"]
env.site = "staging" # By default, run all of these tasks on 'staging'
env.origin = "git@github.com:aspc/mainsite.git"
"... | mit | Python |
f38b6f86cfca8c8516020477bd540d6901efa9a5 | switch the booleans | rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh | fabfile/progress.py | fabfile/progress.py | import fabric
@task
def on():
debug = False
fabric.state.output.debug = debug
fabric.state.output.running = debug
fabric.state.output.status = debug
fabric.state.output.stdout = True
fabric.state.output.stderr = debug
fabric.state.output.warnings = debug
fabric.state.output.... | import fabric
@task
def on():
debug = True
fabric.state.output.debug = debug
fabric.state.output.running = debug
fabric.state.output.status = debug
fabric.state.output.stdout = True
fabric.state.output.stderr = debug
fabric.state.output.warnings = debug
fabric.state.output.a... | apache-2.0 | Python |
a2420acf5866572e7550e2cc752ed4e50d202ece | change title of syndication feed | feedzilla/feedzilla,feedzilla/feedzilla,feedzilla/feedzilla | feed/syndication.py | feed/syndication.py | # -*- coding: utf-8 -*-
import os
from datetime import datetime
from django.contrib.syndication.feeds import FeedDoesNotExist
from django.contrib.syndication.feeds import Feed
from django.utils.feedgenerator import Atom1Feed
from django.conf import settings
from feed.models import Post
class PostFeed(Feed):
feed... | # -*- coding: utf-8 -*-
import os
from datetime import datetime
from django.contrib.syndication.feeds import FeedDoesNotExist
from django.contrib.syndication.feeds import Feed
from django.utils.feedgenerator import Atom1Feed
from django.conf import settings
from feed.models import Post
class PostFeed(Feed):
feed... | bsd-3-clause | Python |
b3c986757eaf8f854b3f1d9d080c6c407ac2c530 | Set version to 0.1.3 | gnotaras/django-postgresql-manager | src/PostgreSQL_manager/__init__.py | src/PostgreSQL_manager/__init__.py | # -*- coding: utf-8 -*-
#
# This file is part of django-postgresql-manager.
#
# django-postgresql-manager - a Django application which can be used to manage
# PostgreSQL users and databases.
#
# Development Web Site:
# - http://www.codetrax.org/projects/django-postgresql-manager
# Public Source Code Repository:... | # -*- coding: utf-8 -*-
#
# This file is part of django-postgresql-manager.
#
# django-postgresql-manager - a Django application which can be used to manage
# PostgreSQL users and databases.
#
# Development Web Site:
# - http://www.codetrax.org/projects/django-postgresql-manager
# Public Source Code Repository:... | apache-2.0 | Python |
c83ccc2fdbfd7536ae990d30bf40130494cfeebb | update version | mongolab/mongoctl | mongoctl/version.py | mongoctl/version.py | __author__ = 'abdul'
MONGOCTL_VERSION = '1.5.1'
| __author__ = 'abdul'
MONGOCTL_VERSION = '1.5.0'
| mit | Python |
7bcd595429c18a38dfcb81e39cbf793dc969136f | Order MongoForm fields according to the Document | pimentech/django-mongoforms,pimentech/django-mongoforms | mongoforms/utils.py | mongoforms/utils.py | from django import forms
from mongoengine.base import ValidationError
from bson.objectid import ObjectId
def mongoengine_validate_wrapper(old_clean, new_clean):
"""
A wrapper function to validate formdata against mongoengine-field
validator and raise a proper django.forms ValidationError if there
are ... | from django import forms
from mongoengine.base import ValidationError
from bson.objectid import ObjectId
def mongoengine_validate_wrapper(old_clean, new_clean):
"""
A wrapper function to validate formdata against mongoengine-field
validator and raise a proper django.forms ValidationError if there
are ... | bsd-3-clause | Python |
44d9f753d181c178de0f0d3bf1874b4cb8e3a945 | Update Route | kkstu/DNStack,kkstu/DNStack,kkstu/DNStack | handler/__init__.py | handler/__init__.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
# Powered By KK Studio
import index
import page
import user
import domain
route = [
(r'/',index.IndexHandler),
(r'/blank',index.BlankHandler),
(r'/sample',index.SampleHandler),
(r'/user/login',user.LoginHandler),
(r'/user/logout',user.LogoutHandler),
(r'... | #!/usr/bin/python
# -*- coding:utf-8 -*-
# Powered By KK Studio
import index
import page
import user
import domain
route = [
(r'/',index.IndexHandler),
(r'/blank',index.BlankHandler),
(r'/sample',index.SampleHandler),
(r'/user/login',user.LoginHandler),
(r'/user/logout',user.LogoutHandler),
(r'... | mit | Python |
4da1f0b9cd6ec130e114043db3d07742835c29a4 | add alternative url path via `DI` to try `SequenceHandler` | cjlee112/socraticqs2,raccoongang/socraticqs2,raccoongang/socraticqs2,cjlee112/socraticqs2,raccoongang/socraticqs2,raccoongang/socraticqs2,cjlee112/socraticqs2,cjlee112/socraticqs2 | mysite/chat/urls.py | mysite/chat/urls.py | import injections
from django.conf.urls import patterns, url, include
from django.views.generic import TemplateView
from rest_framework.routers import SimpleRouter
from .views import ChatInitialView
from .api import MessagesView, HistoryView, ProgressView
from .services import SequenceHandler, FsmHandler
inj = injec... | import injections
from django.conf.urls import patterns, url, include
from django.views.generic import TemplateView
from rest_framework.routers import SimpleRouter
from .views import ChatInitialView
from .api import MessagesView, HistoryView, ProgressView
from .services import SequenceHandler, FsmHandler
inj = injec... | apache-2.0 | Python |
8c8b7d9fb460d8c26fb6e501cd6f01d0c85347c1 | add import of views. | fanglinfang/myuw,fanglinfang/myuw,uw-it-aca/myuw,uw-it-aca/myuw,fanglinfang/myuw,uw-it-aca/myuw,uw-it-aca/myuw | myuw_mobile/urls.py | myuw_mobile/urls.py | from django.conf.urls import patterns, include, url
from myuw_mobile.views import index
urlpatterns = patterns('myuw_mobile.views',
url(r'^$', 'index'),
# url(r'^menu/$', 'menu'),
# url(r'^week/$', 'week'),
)
| from django.conf.urls import patterns, include, url
urlpatterns = patterns('myuw_mobile.views',
url(r'^$', 'index'),
# url(r'^menu/$', 'menu'),
# url(r'^week/$', 'week'),
)
| apache-2.0 | Python |
48b0ffcf123238e406884fbc546dc26f778b2147 | add 'appreciate' function | T620/globe,T620/globe,T620/globe | globe/util/posts.py | globe/util/posts.py | #handles filtering of posts
def filter_by(primaryCriteria, secondaryCriteria):
#marks a post as appreaciated (featured for that location)
def appreciate(post):
#a post is appreciated if it reaches over 200 likes for a particular location
from globe.models import Post
post = Post.query.filter_by(id=postID).first... | #handles filtering of posts
def filter_by(primaryCriteria, secondaryCriteria):
#marks a post as appreaciated (featured for that location)
def appreciate(post):
| mit | Python |
22c759a7a4788e960d1d7342f97deab5cb7bdca2 | patch make_ansible_command in tests | ceph/ceph-installer,ceph/ceph-installer,ceph/ceph-installer,ceph/mariner-installer | ceph_installer/tests/test_tasks.py | ceph_installer/tests/test_tasks.py | from ceph_installer import models, tasks
class TestCallAnsible(object):
def setup(self):
models.Task(
identifier='aaaa',
endpoint='/api/test/',
)
models.commit()
def test_set_exit_code_on_error(self, session, monkeypatch):
monkeypatch.setattr(
... | from ceph_installer import models, tasks
class TestCallAnsible(object):
def setup(self):
models.Task(
identifier='aaaa',
endpoint='/api/test/',
)
models.commit()
def test_set_exit_code_on_error(self, session):
tasks.call_ansible.apply(args=([], 'aaaa')... | mit | Python |
6f4ff665370ddded2816211844de5d077f67570e | raise error if iterator repeats and n == 0 | okuta/chainer,ktnyt/chainer,hvy/chainer,pfnet/chainer,ktnyt/chainer,okuta/chainer,niboshi/chainer,jnishi/chainer,wkentaro/chainer,keisuke-umezawa/chainer,wkentaro/chainer,ktnyt/chainer,niboshi/chainer,niboshi/chainer,hvy/chainer,keisuke-umezawa/chainer,hvy/chainer,okuta/chainer,ktnyt/chainer,okuta/chainer,chainer/chain... | chainer/iterators/_statemachine.py | chainer/iterators/_statemachine.py | import collections
import numpy
IteratorState = collections.namedtuple('IteratorState', (
'current_position', 'epoch', 'is_new_epoch', 'order'))
def iterator_statemachine(state, batch_size, repeat, order_sampler,
dataset_len):
i, epoch, _, order = state
if not repeat and epoc... | import collections
import numpy
IteratorState = collections.namedtuple('IteratorState', (
'current_position', 'epoch', 'is_new_epoch', 'order'))
def iterator_statemachine(state, batch_size, repeat, order_sampler,
dataset_len):
i, epoch, _, order = state
if not repeat and epoc... | mit | Python |
3e8cb1e33850b2496307cc487f8111398a11fa94 | revert django settings | quantmind/pulsar,quantmind/pulsar,dejlek/pulsar,quantmind/pulsar,dejlek/pulsar,quantmind/pulsar,dejlek/pulsar,dejlek/pulsar,quantmind/pulsar,dejlek/pulsar | examples/djchat/djchat/settings.py | examples/djchat/djchat/settings.py | """
Django settings for djchat 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, ...)
imp... | """
Django settings for djchat 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, ...)
imp... | bsd-3-clause | Python |
b219fec75cb14a07c65fd9fac1448b490b4878c3 | Add log output | veegee/guv,veegee/guv | guv/green/socket.py | guv/green/socket.py | import os
import sys
import logging
log = logging.getLogger('guv')
__import__('guv.green._socket_nodns')
__socket = sys.modules['guv.green._socket_nodns']
__all__ = __socket.__all__
__patched__ = __socket.__patched__ + ['gethostbyname', 'getaddrinfo', 'create_connection', ]
from ..patcher import copy_attributes
co... | import os
import sys
__import__('guv.green._socket_nodns')
__socket = sys.modules['guv.green._socket_nodns']
__all__ = __socket.__all__
__patched__ = __socket.__patched__ + ['gethostbyname', 'getaddrinfo', 'create_connection', ]
from ..patcher import copy_attributes
copy_attributes(__socket, globals(), srckeys=dir(... | mit | Python |
851def831232e2277ef941ecce747cb642f72811 | Fix sigmoid function | wiseodd/hipsternet,wiseodd/hipsternet | hipsternet/utils.py | hipsternet/utils.py | import numpy as np
def exp_running_avg(running, new, gamma=.9):
return gamma * running + (1. - gamma) * new
def accuracy(y_true, y_pred):
return np.mean(y_pred == y_true)
def onehot(labels):
y = np.zeros([labels.size, np.max(labels) + 1])
y[range(labels.size), labels] = 1.
return y
def softm... | import numpy as np
def exp_running_avg(running, new, gamma=.9):
return gamma * running + (1. - gamma) * new
def accuracy(y_true, y_pred):
return np.mean(y_pred == y_true)
def onehot(labels):
y = np.zeros([labels.size, np.max(labels) + 1])
y[range(labels.size), labels] = 1.
return y
def softm... | unlicense | Python |
4ff2760f005330e40d465bd78385fdade2b5c37b | Bump version. | goliatone/notario,goliatone/notario,goliatone/notario | notable/__init__.py | notable/__init__.py | VERSION = '0.3.0' | VERSION = '0.2.1' | mit | Python |
7b940f10e117438404db9773b3066bb167740531 | Bump version 0.2.3 -> 0.2.4 | chrisseto/django-include | include/__init__.py | include/__init__.py | from django.apps import AppConfig
from include.query import IncludeQuerySet
from include.manager import IncludeManager
__version__ = '0.2.4'
__all__ = ('IncludeManager', 'IncludeQuerySet', )
default_app_config = 'include.IncludeConfig'
class IncludeConfig(AppConfig):
name = 'include'
| from django.apps import AppConfig
from include.query import IncludeQuerySet
from include.manager import IncludeManager
__version__ = '0.2.3'
__all__ = ('IncludeManager', 'IncludeQuerySet', )
default_app_config = 'include.IncludeConfig'
class IncludeConfig(AppConfig):
name = 'include'
| mit | Python |
178f3b639539d735776c6b0e2f78b131f5d0d890 | fix logic error | sudoguy/instabot,instagrambot/instapro,misisnik/testinsta,AlexBGoode/instabot,instagrambot/instabot,ohld/instabot,vkgrd/instabot,rasperepodvipodvert/instabot,misisnik/testinsta,Diapostrofo/instabot,instagrambot/instabot | examples/subscribe_to_following.py | examples/subscribe_to_following.py | #!/usr/bin/env python
import pandas as pd
import datetime, time
import random
import sys, os
sys.path.append(os.path.join(sys.path[0],'../'))
from instabot import API
def subscribe_to_following(api, username):
""" Subscribes to people that are followed by username. """
print ("Going to subscribe to persons wh... | #!/usr/bin/env python
import pandas as pd
import datetime, time
import random
import sys, os
sys.path.append(os.path.join(sys.path[0],'../'))
from instabot import API
def subscribe_to_following(api, username):
""" Subscribes to people that are followed by username. """
print ("Going to subscribe to persons wh... | apache-2.0 | Python |
a64949422ca4734a0fdbef19ae91f52f50d6953f | change version string to 0.1.4 | lsanomaly/lsanomaly | lsanomaly/version.py | lsanomaly/version.py | __version__ = "0.1.4"
| __version__ = "1.4.0"
| mit | Python |
306f548ebb92ff6824c030352e5fe79fed8d1f55 | Fix spelling in comment | gzuidhof/nn-transfer | nn_transfer/util.py | nn_transfer/util.py | from collections import OrderedDict
_WEIGHT_KEYS = ['kernel', 'beta', 'alpha']
_WEIGHT_KEYS += [key+':0' for key in _WEIGHT_KEYS]
def state_dict_layer_names(state_dict):
layer_names = [".".join(k.split('.')[:-1]) for k in state_dict.keys()]
# Order preserving unique set of names
return list(OrderedDict.f... | from collections import OrderedDict
_WEIGHT_KEYS = ['kernel', 'beta', 'alpha']
_WEIGHT_KEYS += [key+':0' for key in _WEIGHT_KEYS]
def state_dict_layer_names(state_dict):
layer_names = [".".join(k.split('.')[:-1]) for k in state_dict.keys()]
# Order preserving unique set of names
return list(OrderedDict.f... | mit | Python |
bd381e5465ac7cbd591e30d5961397e0afd50100 | Improve code | Fgerthoffert/jira-agile-velocity,Fgerthoffert/jira-agile-velocity,Fgerthoffert/jira-agile-velocity,Fgerthoffert/jira-agile-velocity | jav/core/javTime.py | jav/core/javTime.py | from datetime import timedelta, datetime
import pytz
class Time(object):
"""
Class in charge or handling various time-related functions
"""
def __init__(self, log, config):
self.log = log
self.config = config
@staticmethod
def get_current_date():
return datetime.n... | from datetime import timedelta, datetime
import pytz
class Time(object):
"""
Class in charge or handling various time-related functions
"""
def __init__(self, log, config):
self.log = log
self.config = config
def get_current_date(self):
return datetime.now(pytz.timezo... | lgpl-2.1 | Python |
2c1dec9463ab367c4f60656a93e2124b852dafdd | enable context aware commits (#94) | googleapis/google-cloud-java,googleapis/google-cloud-java,googleapis/google-cloud-java | java-redis/synth.py | java-redis/synth.py | # Copyright 2018 Google LLC
#
# 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 writing, s... | # Copyright 2018 Google LLC
#
# 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 writing, s... | apache-2.0 | Python |
dd762585a4461ffc92e2e70771adab983e2b6d10 | Prepare to load multiple kinds | john2x/appengine-fixture-loader,rbanffy/appengine-fixture-loader,john2x/appengine-fixture-loader,rbanffy/appengine-fixture-loader | appengine_fixture_loader/loader.py | appengine_fixture_loader/loader.py | """
Tools to automate loading of test fixtures
"""
import json
from datetime import datetime, time, date
try:
from google.appengine.ext.ndb.model import (DateTimeProperty, DateProperty,
TimeProperty)
except:
raise ImportError("This library needs the Google App E... | """
Tools to automate loading of test fixtures
"""
import json
from datetime import datetime, time, date
try:
from google.appengine.ext.ndb.model import (DateTimeProperty, DateProperty,
TimeProperty)
except:
raise ImportError("This library needs the Google App E... | apache-2.0 | Python |
6511d74438fda5fcaea6ccddf2853061aaad6e98 | Fix connection error issues | renfredxh/compilebot | compilebot/deploy.py | compilebot/deploy.py | import time
import traceback
from requests import HTTPError, ConnectionError
import compilebot as bot
SLEEP_TIME = 60
def main():
try:
bot.log("Initializing bot")
while True:
try:
bot.main()
except HTTPError as e:
# HTTP Errors may indicate r... | import time
import traceback
from requests import HTTPError
import compilebot as bot
SLEEP_TIME = 60
def main():
try:
bot.log("Initializing bot")
while True:
try:
bot.main()
except HTTPError as e:
# HTTP Errors may indicate reddit is overload... | apache-2.0 | Python |
ef9ff2aa32a939d7bd1a4a68b68eeb8c81fca286 | Use the Github OAuth token provided by the main opentree webapp | OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api | controllers/default.py | controllers/default.py | import os
import time
import json
from github import Github
def index():
def GET():
return locals()
@request.restful()
def api():
response.view = 'generic.json'
def GET(resource,resource_id):
if not resource=='study': raise HTTP(400)
# return the correct nexson of study_id
... | import os
import time
import json
from github import Github
def index():
def GET():
return locals()
@request.restful()
def api():
response.view = 'generic.json'
def GET(resource,resource_id):
if not resource=='study': raise HTTP(400)
# return the correct nexson of study_id
... | bsd-2-clause | Python |
42ede31aef89ebbee1308ce14ca00a0db3cf8762 | bump version (skipping 2.7 to avoid confusion) | imageio/imageio | imageio/__init__.py | imageio/__init__.py | # -*- coding: utf-8 -*-
# Copyright (c) 2014-2020, imageio contributors
# imageio is distributed under the terms of the (new) BSD License.
# This docstring is used at the index of the documentation pages, and
# gets inserted into a slightly larger description (in setup.py) for
# the page on Pypi:
"""
Imageio is a Pyth... | # -*- coding: utf-8 -*-
# Copyright (c) 2014-2020, imageio contributors
# imageio is distributed under the terms of the (new) BSD License.
# This docstring is used at the index of the documentation pages, and
# gets inserted into a slightly larger description (in setup.py) for
# the page on Pypi:
"""
Imageio is a Pyth... | bsd-2-clause | Python |
1ac1a44fc55a7021e5aef358d1af24358dafdb09 | Bump the version to 3.2. | FundedByMe/django-imagekit,tawanda/django-imagekit,tawanda/django-imagekit,FundedByMe/django-imagekit | imagekit/pkgmeta.py | imagekit/pkgmeta.py | __title__ = 'django-imagekit'
__author__ = 'Matthew Tretter, Eric Eldredge, Bryan Veloso, Greg Newman, Chris Drackett, Justin Driscoll'
__version__ = '3.2'
__license__ = 'BSD'
__all__ = ['__title__', '__author__', '__version__', '__license__']
| __title__ = 'django-imagekit'
__author__ = 'Matthew Tretter, Eric Eldredge, Bryan Veloso, Greg Newman, Chris Drackett, Justin Driscoll'
__version__ = '3.1'
__license__ = 'BSD'
__all__ = ['__title__', '__author__', '__version__', '__license__']
| bsd-3-clause | Python |
ea5dc6251f5d149cf2229f0223aa2ce264f153a3 | Switch from get_template to select_template | funkybob/django-email-template,prestontimmons/django-email-template | email_template/email.py | email_template/email.py | from functools import partial
from django.conf import settings
from django.core.mail import EmailMessage, EmailMultiAlternatives
from django.template import Context, RequestContext
from django.template.loader import select_template
from .util import render_node
def send_base(template_name, context_data, send_method... | from functools import partial
from django.conf import settings
from django.core.mail import EmailMessage, EmailMultiAlternatives
from django.template import Context, RequestContext
from django.template.loader import get_template
from .util import render_node
def send_base(template_name, context_data, send_method, r... | mit | Python |
aed9203f4d76e790b50a311905ca81830a832a79 | Add some comments to tests.py | smartchicago/chicago-early-learning,smartchicago/chicago-early-learning,smartchicago/chicago-early-learning,smartchicago/chicago-early-learning | python/ecep/portal/tests.py | python/ecep/portal/tests.py | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from portal.sms import Sms
import pprint
class SimpleTest(TestCase):
def test_basic_addition(self... | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from portal.sms import Sms
import pprint
class SimpleTest(TestCase):
def test_basic_addition(self... | mit | Python |
8abc17b2f4e9d5f583d509fe3ed941f2aff79504 | Bump the lolo version for find_lolo_jar | CitrineInformatics/lolo,CitrineInformatics/lolo | python/lolopy/loloserver.py | python/lolopy/loloserver.py | """Methods related to starting and stopping the Java Gateway"""
from py4j.java_gateway import JavaGateway
from subprocess import STDOUT
import sys
import os
# Used for allowing multiple objects to use the same gateway
_lolopy_gateway = None
# TODO: Auto-detect the version of lolo? [Requires lolo installation (not com... | """Methods related to starting and stopping the Java Gateway"""
from py4j.java_gateway import JavaGateway
from subprocess import STDOUT
import sys
import os
# Used for allowing multiple objects to use the same gateway
_lolopy_gateway = None
# TODO: Auto-detect the version of lolo? [Requires lolo installation (not com... | apache-2.0 | Python |
8ae391d738e3982c9d52b970a653f0b67724dce5 | Tweak old integration test docstring | fabric/fabric | integration/main.py | integration/main.py | from spec import skip, Spec, ok_
from fabric.connection import Connection
class Main(Spec):
def connection_open_generates_real_connection(self):
c = Connection('localhost')
c.open()
ok_(c.client.get_transport().active)
def simple_command_on_host(self):
"""
Run command... | from spec import skip, Spec, ok_
from fabric.connection import Connection
class Main(Spec):
def connection_open_generates_real_connection(self):
c = Connection('localhost')
c.open()
ok_(c.client.get_transport().active)
def simple_command_on_host(self):
"""
Run command... | bsd-2-clause | Python |
093cbcde774d39bd17afbc5384637395f58dabc1 | add TIME_FORMAT to fr. | ZTH1970/alcide,ZTH1970/alcide,ZTH1970/alcide,ZTH1970/alcide,ZTH1970/alcide | calebasse/settings/formats/fr/formats.py | calebasse/settings/formats/fr/formats.py | DATE_FORMAT = 'l d F Y'
SHORT_DATE_FORMAT = 'j/n/Y'
TIME_FORMAT = 'H:i'
DATE_INPUT_FORMATS = ('%d/%m/%Y', '%d/%m/%Y', '%Y-%m-d')
TIME_INPUT_FORMATS = ( '%Hh%M', '%H:%M', '%H%M', '%Hh' )
DECIMAL_SEPARATOR = ','
NUMBER_GROUPING = 3
THOUSAND_SEPARATOR = ' '
| DATE_FORMAT = 'l d F Y'
SHORT_DATE_FORMAT = 'j/n/Y'
DATE_INPUT_FORMATS = ('%d/%m/%Y', '%d/%m/%Y', '%Y-%m-d')
TIME_INPUT_FORMATS = ( '%Hh%M', '%H:%M', '%H%M', '%Hh' )
DECIMAL_SEPARATOR = ','
NUMBER_GROUPING = 3
THOUSAND_SEPARATOR = ' '
| agpl-3.0 | Python |
80962156b74883d660be90e4e8566a74ebb36220 | Remove extra spaces in test_methods module. | ulule/django-linguist | linguist/tests/test_methods.py | linguist/tests/test_methods.py | # -*- coding: utf-8 -*-
from django.test import TestCase
from django.test.utils import override_settings
from ..registry import LinguistRegistry as Registry
from . import settings
from .translations import FooModel, FooTranslation
LANGUAGES = [l[0] for l in settings.LANGUAGES]
@override_settings(DEBUG=True)
class M... | # -*- coding: utf-8 -*-
from django.test import TestCase
from django.test.utils import override_settings
from ..registry import LinguistRegistry as Registry
from . import settings
from .translations import (
FooModel,
FooTranslation
)
LANGUAGES = [l[0] for l in settings.LANGUAGES]
@override_settings(DEBUG... | mit | Python |
a6d4c25cc2a8666891777978f06d9e82dbd47d93 | add some more constants to umath | NextThought/pypy-numpy,NextThought/pypy-numpy,NextThought/pypy-numpy,NextThought/pypy-numpy | numpy/core/umath.py | numpy/core/umath.py | from _numpypy.umath import *
SHIFT_DIVIDEBYZERO = 0
SHIFT_OVERFLOW = 3
SHIFT_UNDERFLOW = 6
SHIFT_INVALID = 9
ERR_IGNORE = 0
ERR_WARN = 1
ERR_RAISE = 2
ERR_CALL = 3
ERR_PRINT = 4
ERR_LOG = 5
ERR_DEFAULT2 = 521
UFUNC_BUFSIZE_DEFAULT = 8192
PZERO = float('0.0')
NZERO = float('-0.0')
PINF = float('inf')
NINF = float('... | from _numpypy.umath import *
SHIFT_DIVIDEBYZERO = 0
SHIFT_OVERFLOW = 3
SHIFT_UNDERFLOW = 6
SHIFT_INVALID = 9
ERR_IGNORE = 0
ERR_WARN = 1
ERR_RAISE = 2
ERR_CALL = 3
ERR_PRINT = 4
ERR_LOG = 5
ERR_DEFAULT2 = 521
UFUNC_BUFSIZE_DEFAULT = 8192
PINF = float('inf')
NAN = float('nan')
from math import pi
def geterrobj():
... | bsd-3-clause | Python |
67dad540bb78b3e8cb24cae8783e8b682aa67792 | Make sure that node.expr points to a Name before calling looks_like_numpy_member | PyCQA/astroid | astroid/brain/brain_numpy_utils.py | astroid/brain/brain_numpy_utils.py | # Copyright (c) 2018-2019 hippo91 <guillaume.peillex@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
"""Different utilities for the numpy brains"""
import astroid
def infer_numpy_member(src... | # Copyright (c) 2018-2019 hippo91 <guillaume.peillex@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
"""Different utilities for the numpy brains"""
import astroid
def infer_numpy_member(src... | lgpl-2.1 | Python |
e5b66723f3d0e3b98a6c4e59c9be13c89dc1099b | Fix missing dependency | croxis/SpaceDrive,croxis/SpaceDrive,croxis/SpaceDrive | Samples/download_samples.py | Samples/download_samples.py | """
RenderPipeline
Copyright (c) 2014-2015 tobspr <tobias.springer1@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... | """
RenderPipeline
Copyright (c) 2014-2015 tobspr <tobias.springer1@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... | mit | Python |
7ca087fd0238b231ff04980e3e24d87de84053a2 | Correct version (typo) | ddico/server-tools,rschnapka/server-tools,markeTIC/server-tools,Benniphx/server-tools,Trust-Code/server-tools,jobiols/server-tools,initOS/server-tools,Sudokeys/server-tools,markeTIC/server-tools,osiell/server-tools,ddico/server-tools,rossasa/server-tools,osiell/server-tools,vauxoo-dev/server-tools,Antiun/server-tools,d... | base_module_doc_rst/__openerp__.py | base_module_doc_rst/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 | Python |
002966f22f18dc3701102af234125905c51b9797 | Upgrade to 1.2.1 | biolink/ontobio,biolink/ontobio | ontobio/__init__.py | ontobio/__init__.py | from __future__ import absolute_import
__version__ = '1.2.1'
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__ = '1.2.0'
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 |
fe8e5721e16197b061c9668a49fa6bddb768b23d | remove deprecated django admin setting | matthiask/feincms-elephantblog,michaelkuty/feincms-elephantblog,matthiask/feincms-elephantblog,feincms/feincms-elephantblog,joshuajonah/feincms-elephantblog,sbaechler/feincms-elephantblog,matthiask/feincms-elephantblog,feincms/feincms-elephantblog,joshuajonah/feincms-elephantblog,michaelkuty/feincms-elephantblog,sbaech... | elephantblog/extensions/translations.py | elephantblog/extensions/translations.py | from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
def register(cls, admin_cls):
primary_language = settings.LANGUAGES[0][0]
cls.add_to_class('language', models.CharField(_('language'), max_length=10,
choices=settings.LANGUAGES))
... | from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
def register(cls, admin_cls):
primary_language = settings.LANGUAGES[0][0]
cls.add_to_class('language', models.CharField(_('language'), max_length=10,
choices=settings.LANGUAGES))
... | bsd-3-clause | Python |
0c8c80e8ed3b420eb3f5a0fda57ce7f5e9e69596 | Bump to minor release 0.7.1 | sveetch/Optimus,sveetch/Optimus,sveetch/Optimus,sveetch/Optimus | optimus/__init__.py | optimus/__init__.py | # -*- coding: utf-8 -*-
"""
A simple building environment to produce static HTML from Jinja templates and
with assets compress managing with webassets
"""
__version__ = "0.7.1"
| # -*- coding: utf-8 -*-
"""
A simple building environment to produce static HTML from Jinja templates and
with assets compress managing with webassets
"""
__version__ = "0.7.0"
| mit | Python |
2a54fdc31be7dcf50d4aba60004f8efc8c0ffb45 | change default setting creation | acdervis/eve-wspace,Unsettled/eve-wspace,proycon/eve-wspace,hybrid1969/eve-wspace,mmalyska/eve-wspace,Zumochi/eve-wspace,Maarten28/eve-wspace,proycon/eve-wspace,Unsettled/eve-wspace,Unsettled/eve-wspace,hybrid1969/eve-wspace,hybrid1969/eve-wspace,Maarten28/eve-wspace,mmalyska/eve-wspace,gpapaz/eve-wspace,proycon/eve-ws... | evewspace/Teamspeak/default_settings.py | evewspace/Teamspeak/default_settings.py | # Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# This program 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
# (at your option... | # Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# This program 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
# (at your option... | apache-2.0 | Python |
31a39f4f1332abe3ea36e28603f76218a71c8c49 | Remove old dependency | MickSandoz/compassion-modules,emgirardin/compassion-modules,eicher31/compassion-modules,CompassionCH/compassion-modules,ndtran/compassion-modules,eicher31/compassion-modules,emgirardin/compassion-modules,eicher31/compassion-modules,maxime-beck/compassion-modules,philippe89/compassion-modules,eicher31/compassion-modules... | contract_compassion/__openerp__.py | contract_compassion/__openerp__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# ______ Releasing children from poverty _
# / ____/___ ____ ___ ____ ____ ___________(_)___ ____
# / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \
# / /___/ /_/ / / / /... | # -*- encoding: utf-8 -*-
##############################################################################
#
# ______ Releasing children from poverty _
# / ____/___ ____ ___ ____ ____ ___________(_)___ ____
# / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \
# / /___/ /_/ / / / /... | agpl-3.0 | Python |
97db108b80e805ca110f974e9e498e1902a9d57e | Clean debug down to essentials | Artanicus/python-cozify,Artanicus/python-cozify | cozify/test/debug.py | cozify/test/debug.py | #!/usr/bin/env python3
"""Set high log level
"""
import logging
logging.basicConfig(level=logging.DEBUG)
| #!/usr/bin/env python3
"""Set high log level and consistent temporary state storage in /tmp/python-cozify-testing.cfg
"""
import logging
from cozify import config
logging.basicConfig(level=logging.DEBUG)
# Disabled due to not wanting to mock the entire auth, so instead we use whatever is the live state.
#conf_file='... | mit | Python |
9257951014880cf8405a3d3a0ea07f2222028b2e | Document profiles unit testing | KittyHawkIrc/modules,KittyHawkIrc/modules | hello.py | hello.py | try:
import encoder
except:
print ''
#Update schema
__url__ = "https://raw.githubusercontent.com/KittyHawkIrc/modules/production/" + __name__ + ".py"
__version__ = 1.0
def declare():
return {"hello": "privmsg", "henlo": "privmsg"}
def callback(self):
if self.channel.startswith('#'):
if 'b64' ... | try:
import encoder
except:
print ''
#Update schema
__url__ = "https://raw.githubusercontent.com/KittyHawkIrc/modules/production/" + __name__ + ".py"
__version__ = 1.0
def declare():
return {"hello": "privmsg", "henlo": "privmsg"}
def callback(self):
if self.channel.startswith('#'):
if 'b64' ... | apache-2.0 | Python |
3f2787b601a37cb849747bab9867ce6b6af7b9a2 | Add option to topic_str to not print opinions | NLeSC/cptm,NLeSC/cptm | cptm/utils/topics.py | cptm/utils/topics.py | import pandas as pd
def get_top_topic_words(topics, opinions, t, top=10):
"""Return dataframe containing top topics and opinions.
Parameters
t : str - index of topic number
top : int - the number of words to store in the dataframe
Returns Pandas DataFrame
The DataFrame contains t... | import pandas as pd
def get_top_topic_words(topics, opinions, t, top=10):
"""Return dataframe containing top topics and opinions.
Parameters
t : str - index of topic number
top : int - the number of words to store in the dataframe
Returns Pandas DataFrame
The DataFrame contains t... | apache-2.0 | Python |
4c1fd4173e1b4e9687c890f8fe9c1b20f973588f | Remove relative import | Astroua/aws_controller,Astroua/aws_controller | create_root_drive.py | create_root_drive.py | # License under the MIT License - see LICENSE
import boto
from launch_instance import launch
def create_root_drive(name, region='us-west-2', key_name='admin_root_maker',
orig_image_id="ami-5189a661"):
'''
Creates the root drive for AstroCompute instances.
'''
kwargs = {"insta... | # License under the MIT License - see LICENSE
import boto
from .launch_instance import launch
def create_root_drive(name, region='us-west-2', key_name='admin_root_maker',
orig_image_id="ami-5189a661"):
'''
Creates the root drive for AstroCompute instances.
'''
kwargs = {"inst... | mit | Python |
3000fcc56ec01ffcf32509e60ebbc61695e4dc9b | Update poll-sensors.py | JeffreyPowell/pi-heating-hub,JeffreyPowell/pi-heating-hub,JeffreyPowell/pi-heating-hub | cron/poll-sensors.py | cron/poll-sensors.py | #!/usr/bin/env python
import MySQLdb
import datetime
import urllib2
servername = "localhost"
username = "pi"
password = "password"
dbname = "pi_heating_db"
cnx = MySQLdb.connect(host=servername, user=username, passwd=password, db=dbname)
cursorread = cnx.cursor()
query = ("SELECT * FROM sensors")
cursorread.exec... | #!/usr/bin/env python
import MySQLdb
import datetime
import urllib2
servername = "localhost"
username = "pi"
password = "password"
dbname = "pi_heating_db"
cnx = MySQLdb.connect(host=servername, user=username, passwd=password, db=dbname)
cursorread = cnx.cursor()
query = ("SELECT * FROM sensors")
cursorread.exec... | apache-2.0 | Python |
aeecf98d27c5319c06b7d032b7eb9dd7da986988 | Add more tests in and fix frink. | reticulatingspline/Assorted | test.py | test.py | ###
# Copyright (c) 2012-2014, spline
# All rights reserved.
#
#
###
from supybot.test import *
class AssortedTestCase(PluginTestCase):
plugins = ('Assorted',)
def testAssorted(self):
# advice, automeme, b64decode, b64encode, bash, bitcoin, bofh, callook
# catfacts, catpix, chucknorris, d... | ###
# Copyright (c) 2012-2014, spline
# All rights reserved.
#
#
###
from supybot.test import *
class AssortedTestCase(PluginTestCase):
plugins = ('Assorted',)
def testAssorted(self):
# advice, automeme, b64decode, b64encode, bash, bitcoin, bofh, callook
# catfacts, catpix, chucknorris, d... | mit | Python |
1a28140e975961093e72c979c3e513b8eee35e86 | rename test to match the function it tests | pmallory/Blues,pmallory/Blues | test.py | test.py | import unittest
import pixelBasedMusic as pbm
import numpy
from numpy.testing import assert_allclose
from math import sqrt
class Test(unittest.TestCase):
def test_euclidean_distance(self):
self.assertEqual(pbm.euclidean_distance((1,1,1),(1,1,1)),0)
self.assertEqual(pbm.euclidean_distance((1,0,0),(... | import unittest
import pixelBasedMusic as pbm
import numpy
from numpy.testing import assert_allclose
from math import sqrt
class Test(unittest.TestCase):
def test_euclidean_distance(self):
self.assertEqual(pbm.euclidean_distance((1,1,1),(1,1,1)),0)
self.assertEqual(pbm.euclidean_distance((1,0,0),(... | mit | Python |
c28234b4742d793fabcc63ba2ad5585a1d906a0c | Fix test | fabianp/minirank | test.py | test.py | import numpy as np
from scipy import stats
from ranking import train
def test_1():
np.random.seed(0)
X = np.random.randn(20, 5)
w = np.random.randn(5)
y = np.dot(X, w)
w_ = train(X, y, 100, np.ones(20))
tau, _ = stats.kendalltau(y, np.dot(X, w_))
assert np.abs(1 - tau) > 1e-3
| import numpy as np
from scipy import stats
from ranking import train
def test_1():
np.random.seed(0)
X = np.random.randn(20, 5)
w = np.random.randn(5)
y = np.dot(X, w)
w_ = train(X, y, 1., np.ones(20))
tau, _ = stats.kendalltau(y, np.dot(X, w))
assert np.abs(1 - tau) > 1e-3
| bsd-3-clause | Python |
348a867c786aaf2d712cb174942e2d2511bbef07 | Update test.py | gfmio/mandrill-markdown-mails | test.py | test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Mandrill Markdown Mails
# Author: Frédérique Mittelstaedt 2014
# License: MIT
# Requires the python modules pypandoc (and installed Pandoc) and mandrill
from mandrillmarkdownmails import sendMandrillMarkdownMail
# Example
# John Doe <john.doe@invalid.com> sends a mail ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Mandrill Markdown Mails
# Author: Frédérique Mittelstaedt 2014
# License: MIT
# Requires the python modules pypandoc (and installed Pandoc) and mandrill
from mandrillmarkdownmails import sendMandrillMarkdownMail
# Example
# John Doe <john.doe@invalid.com> sends a mail ... | mit | Python |
aad289a19959d0e5511a702ac4d8a2c2a36d1083 | Test if reflector yields expected letter | ranisalt/enigma | test.py | test.py | import unittest
from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen
class RotorTestCase(unittest.TestCase):
def test_rotor_encoding(self):
rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q')
self.assertEqual('E', rotor.encode('A'))
def test_rotor_reverse_encoding(self):
... | import unittest
from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen
class RotorTestCase(unittest.TestCase):
def test_rotor_encoding(self):
rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q')
self.assertEqual('E', rotor.encode('A'))
def test_rotor_reverse_encoding(self):
... | mit | Python |
abcb6afb92b8c264b297a3a3d010dc408f113609 | Add time/space complexity | bowen0701/algorithms_data_structures | lc0412_fizz_buzz.py | lc0412_fizz_buzz.py | """Leetcode 412. Fizz Buzz
Easy
URL: https://leetcode.com/problems/fizz-buzz/
Write a program that outputs the string representation of numbers from 1 to n.
But for multiples of three it should output "Fizz" instead of the number and
for the multiples of five output "Buzz".
For numbers which are multiples of both th... | """Leetcode 412. Fizz Buzz
Easy
URL: https://leetcode.com/problems/fizz-buzz/
Write a program that outputs the string representation of numbers from 1 to n.
But for multiples of three it should output "Fizz" instead of the number and
for the multiples of five output "Buzz".
For numbers which are multiples of both th... | bsd-2-clause | Python |
e0a5d82c7d7875ce0b713a5783d3500aecbe57b2 | implement Task log preset exportation | CaptainDesAstres/Blender-Render-Manager,CaptainDesAstres/Simple-Blender-Render-Manager | TaskList/TaskLog/TaskLog.py | TaskList/TaskLog/TaskLog.py | #!/usr/bin/python3.4
# -*-coding:Utf-8 -*
'''module to manage task running log'''
import xml.etree.ElementTree as xmlMod
from TaskList.TaskLog.GroupLog import *
class TaskLog:
'''class to manage task running log'''
def __init__(self, xml = None, pref = None, task = None):
'''initialize task log object'''
if... | #!/usr/bin/python3.4
# -*-coding:Utf-8 -*
'''module to manage task running log'''
import xml.etree.ElementTree as xmlMod
from TaskList.TaskLog.GroupLog import *
class TaskLog:
'''class to manage task running log'''
def __init__(self, xml = None, pref = None, task = None):
'''initialize task log object'''
if... | mit | Python |
f429774d21a4c98439a47783593f9ec79c8e8d8a | add tensordot and transpose to dask.array | PeterDSteinberg/dask,jakirkham/dask,vikhyat/dask,chrisbarber/dask,mrocklin/dask,mrocklin/dask,jayhetee/dask,wiso/dask,dask/dask,clarkfitzg/dask,ContinuumIO/dask,mikegraham/dask,hainm/dask,esc/dask,vikhyat/dask,jcrist/dask,ssanderson/dask,minrk/dask,pombredanne/dask,marianotepper/dask,mraspaud/dask,blaze/dask,dask/dask,... | dask/array/__init__.py | dask/array/__init__.py | from __future__ import absolute_import, division, print_function
from multipledispatch import halt_ordering, restart_ordering
import blaze
halt_ordering()
from .core import Array, stack, concatenate, tensordot, transpose
from .blaze import np # need to go through import process here
from .into import into # Otherwise... | from __future__ import absolute_import, division, print_function
from multipledispatch import halt_ordering, restart_ordering
import blaze
halt_ordering()
from .core import Array, stack, concatenate
from .blaze import np # need to go through import process here
from .into import into # Otherwise someone might import ... | bsd-3-clause | Python |
7b3abc432528f8a6f9a45bc4d91972558038576c | Fix logic error | xolan/til | create_readme.py | create_readme.py | #!/usr/bin/env python3
import glob
HEADER = '''
# TIL
> Today I Learned
A collection of concise write-ups on small things I learn day to day across a
variety of languages and technologies. These are things that don't really
warrant a full blog post.
'''
FOOTER = '''
## About
I shamelessly stole this idea from
[j... | #!/usr/bin/env python3
import glob
HEADER = '''
# TIL
> Today I Learned
A collection of concise write-ups on small things I learn day to day across a
variety of languages and technologies. These are things that don't really
warrant a full blog post.
'''
FOOTER = '''
## About
I shamelessly stole this idea from
[j... | mit | Python |
7a7618b1f3b419f6d70ee819dc654f0341352fd8 | Fix bootstrap logic not to use the run script. | trevor/calendarserver,trevor/calendarserver,trevor/calendarserver | bin/_calendarserver_preamble.py | bin/_calendarserver_preamble.py | ##
# Copyright (c) 2011-2014 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | ##
# Copyright (c) 2011-2014 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 | Python |
1b7edd28bb920be0def46409a6e0bce28ef12e8e | update setup.py | Meddington/TravisExample,Meddington/TravisExample | peachproxy/setup.py | peachproxy/setup.py | from setuptools import setup
setup(
name = 'peachproxy',
version = '4.1.0',
#use_scm_version=True,
description = 'Peach Web Proxy API module',
long_description = "blah blah blah",
author = 'Peach Fuzzer, LLC',
author_email = 'contact@peachfuzzer.com',
url = 'http://peachfuzzer.com',
... | from setuptools import setup
setup(
name = 'peachproxy',
version = '4.1.0',
#use_scm_version=True,
description = 'Peach Web Proxy API module',
long_description = open('README.adoc').read(),
author = 'Peach Fuzzer, LLC',
author_email = 'contact@peachfuzzer.com',
url = 'http://peachfuzzer... | mit | Python |
434f6e7b920d50d08d2cd139b479d5017184a44a | Revert "Skip an x-failed test due to an unexpected assert" | apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb | packages/Python/lldbsuite/test/lang/swift/foundation_value_types/data/TestSwiftFoundationTypeData.py | packages/Python/lldbsuite/test/lang/swift/foundation_value_types/data/TestSwiftFoundationTypeData.py | # TestSwiftFoundationValueTypes.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swif... | # TestSwiftFoundationValueTypes.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swif... | apache-2.0 | Python |
a72825bef751aa5c6785a3a7e50277f2cefa0aa3 | allow quoting paths with spaces | phodge/jerjerrod | jerjerrod/config.py | jerjerrod/config.py | import glob
import os.path
import re
from os.path import join
HOME = os.environ['HOME']
RCFILE = join(HOME, '.config', 'jerjerrod', 'jerjerrod.conf')
def _populateconfig(cache):
if 'WORKSPACES' in cache:
return
cache['WORKSPACES'] = {}
cache['SINGLES'] = []
if not os.path.exists(RCFILE):
... | import os.path
import glob
from os.path import join
HOME = os.environ['HOME']
RCFILE = join(HOME, '.config', 'jerjerrod', 'jerjerrod.conf')
def _populateconfig(cache):
if 'WORKSPACES' in cache:
return
cache['WORKSPACES'] = {}
cache['SINGLES'] = []
if not os.path.exists(RCFILE):
retu... | mit | Python |
b209ff9555d7a1e2dbb6839018da84d5f7cd93ab | fix typo in txradar test.py | jorik041/gateway,eXcomm/gateway,darkwallet/gateway,darkwallet/gateway,CryptArc/gateway,eXcomm/gateway,jorik041/gateway,CryptArc/gateway,CryptArc/gateway,eXcomm/gateway,darkwallet/gateway,jorik041/gateway | daemon/txrad/test.py | daemon/txrad/test.py | from tx_sentinel import *
def started(ec):
print "started:", ec
def newtx(tx_hash):
print "tx:", tx_hash.encode("hex")
sentinel = TxSentinel()
# b.start(number_threads, number_hosts, ...)
# If we set the number of monitoring hosts to N, then when we
# broadcast a tx we expect to hear the tx back N times.
# Y... | from tx_sentinel import *
def started(ec):
print "started:", ec
def newtx(tx_hash):
print "tx:", tx_hash.encode("hex")
sentinel = TxSentinel()
# b.start(number_threads, number_hosts, ...)
# If we set the number of monitoring hosts to N, then when we
# broadcast a tx we expect to hear the tx back N times.
# Y... | agpl-3.0 | Python |
417accf1e21e9c2a085b3f8f91cf1574ab77a0aa | Fix detail view | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/initiatives/views.py | bluebottle/initiatives/views.py | from rest_framework_json_api.exceptions import exception_handler
from rest_framework_json_api.views import AutoPrefetchMixin
from bluebottle.files.views import FileContentView
from bluebottle.initiatives.filters import InitiativeSearchFilter
from bluebottle.initiatives.models import Initiative
from bluebottle.initiati... | from rest_framework_json_api.exceptions import exception_handler
from rest_framework_json_api.views import AutoPrefetchMixin
from bluebottle.files.views import FileContentView
from bluebottle.initiatives.filters import InitiativeSearchFilter
from bluebottle.initiatives.models import Initiative
from bluebottle.initiati... | bsd-3-clause | Python |
6d7d352c3a16bf38b70b4a001839b498fd497ef6 | Fix checkbtcorders script | bspavel/ccvpn,bspavel/ccvpn,bspavel/ccvpn | ccvpn/scripts/checkbtcorders.py | ccvpn/scripts/checkbtcorders.py | import os
import sys
from sqlalchemy import engine_from_config
from pyramid.paster import get_appsettings, setup_logging
import transaction
from ccvpn.models import DBSession, Order
from ccvpn.methods import BitcoinMethod
import logging
log = logging.getLogger(__name__)
def usage(argv, out=sys.stdout):
cmd = o... | import os
import sys
from sqlalchemy import engine_from_config
from pyramid.paster import get_appsettings, setup_logging
from ccvpn.models import DBSession, Order
from ccvpn.methods import BitcoinMethod
import logging
log = logging.getLogger(__name__)
def usage(argv, out=sys.stdout):
cmd = os.path.basename(arg... | mit | Python |
04643b3eee2fcd5c707c6d4785eead042c424ef1 | Fix check for packages files not found | superdump/cerbero,EricssonResearch/cerbero,ikonst/cerbero,brion/cerbero,flexVDI/cerbero,ikonst/cerbero,lubosz/cerbero,ylatuya/cerbero,nzjrs/cerbero,nirbheek/cerbero-old,BigBrother-International/gst-cerbero,ramaxlo/cerbero,nirbheek/cerbero-old,sdroege/cerbero,flexVDI/cerbero,nicolewu/cerbero,BigBrother-International/gst... | cerbero/packages/disttarball.py | cerbero/packages/disttarball.py | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | lgpl-2.1 | Python |
57f5342fad8f2c3fa2988bede3c5aa4857086057 | Use browser default sizing. | natduca/trace_event_viewer,natduca/trace_event_viewer,natduca/trace_event_viewer | src/browser_objc.py | src/browser_objc.py | # Copyright 2011 Google 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 writing,... | # Copyright 2011 Google 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 writing,... | apache-2.0 | Python |
2aa953aa9a8f1ddcfd3879dd48db5fa0b86944a8 | fix flake8 issues for conf/example_apps/outside_lights.py | acockburn/appdaemon,acockburn/appdaemon | conf/example_apps/outside_lights.py | conf/example_apps/outside_lights.py | import hassapi as hass
#
# App to turn lights on and off at sunrise and sunset
#
# Args:
#
# on_scene: scene to activate at sunset
# off_scene: scene to activate at sunrise
class OutsideLights(hass.Hass):
def initialize(self):
# Run at Sunrise
self.run_at_sunrise(self.sunrise_cb)
# Run ... | import hassapi as hass
import globals
#
# App to turn lights on and off at sunrise and sunset
#
# Args:
#
# on_scene: scene to activate at sunset
# off_scene: scene to activate at sunrise
class OutsideLights(hass.Hass):
def initialize(self):
# Run at Sunrise
self.run_at_sunrise(self.sunrise_cb)
... | mit | Python |
9f711844d9ed73ad9f4be87785c874069c6978a7 | remove fieldnames param to use first row as field names instead | ANCIR/siyazana.co.za,ANCIR/siyazana.co.za,ANCIR/siyazana.co.za,ANCIR/siyazana.co.za | connectedafrica/loaders/directorships.py | connectedafrica/loaders/directorships.py | from datetime import datetime
import logging
import os
from pprint import pprint
import unicodecsv as csv
from granoclient.loader import Loader
from connectedafrica.core import grano
log = logging.getLogger(__name__)
DATE_FORMAT = '%m/%d/%Y'
def _parse_date(datestr):
try:
return datetime.strptime(da... | from datetime import datetime
import logging
import os
from pprint import pprint
import unicodecsv as csv
from granoclient.loader import Loader
from connectedafrica.core import grano
log = logging.getLogger(__name__)
DATE_FORMAT = '%m/%d/%Y'
FIELD_NAMES = ('Person Name', 'Organisation Name', 'Org type', 'Address'... | mit | Python |
12b2a9e997716f69c7581e8e4bc817f20fffda4a | remove unnecessary import | onfire73/pypeskg,onfire73/pypeskg,fullscale/pypes,Enucatl/pypes,klyap/pypes,onfire73/pypeskg,rasata/pypes,fullscale/pypes,fullscale/pypes,onfire73/pypeskg,rasata/pypes,klyap/pypes,rasata/pypes,klyap/pypes,rasata/pypes,klyap/pypes | ui/pypesvds/lib/utils.py | ui/pypesvds/lib/utils.py | from webob.exc import status_map
def abort(status_code=None, detail="", headers=None, comment=None):
exc = status_map[status_code](detail=detail, headers=headers,
comment=comment)
exc.content_type = 'application/json'
exc.body = detail
raise exc.exception
de... | import json
from webob.exc import status_map
def abort(status_code=None, detail="", headers=None, comment=None):
exc = status_map[status_code](detail=detail, headers=headers,
comment=comment)
exc.content_type = 'application/json'
exc.body = detail
raise exc.e... | apache-2.0 | Python |
31c7a110d3b132642e72a66db8fd868fa7f73b6a | Add Urls.py | Takeaway-Ordering-System-NJUCS-SE/Takeaway-Ordering-System,Takeaway-Ordering-System-NJUCS-SE/Takeaway-Ordering-System,Takeaway-Ordering-System-NJUCS-SE/Takeaway-Ordering-System,Takeaway-Ordering-System-NJUCS-SE/Takeaway-Ordering-System | urls.py | urls.py | from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from django.http import HttpResponseRedirect
admin.autodiscover()
import accounts.urls
import ajax.urls
import settings
def redirect_to(request):
return HttpResponseRedi... | from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from django.http import HttpResponseRedirect
admin.autodiscover()
import accounts.urls
import ajax.urls
import settings
def redirect_to(request):
return HttpResponseRedi... | agpl-3.0 | Python |
737401be0e35d6bb5ffeeb1743255ac66b69feba | Bump to 4.1.1 release (#574) | mjs7231/python-plexapi,pkkid/python-plexapi | plexapi/__init__.py | plexapi/__init__.py | # -*- coding: utf-8 -*-
import logging
import os
from logging.handlers import RotatingFileHandler
from platform import uname
from uuid import getnode
from plexapi.config import PlexConfig, reset_base_headers
from plexapi.utils import SecretsFilter
# Load User Defined Config
DEFAULT_CONFIG_PATH = os.path.expanduser('~... | # -*- coding: utf-8 -*-
import logging
import os
from logging.handlers import RotatingFileHandler
from platform import uname
from uuid import getnode
from plexapi.config import PlexConfig, reset_base_headers
from plexapi.utils import SecretsFilter
# Load User Defined Config
DEFAULT_CONFIG_PATH = os.path.expanduser('~... | bsd-3-clause | Python |
75a88fcf473373e446c25126a6841b0f05186369 | Update error handling for a result-less query. | SwagKingTenK/VimSearch | plugin/vimSearch.py | plugin/vimSearch.py | try:
import requests
import vim
import json
except Exception:
print("Error occurred while importing dependencies.")
URL = ["http://api.duckduckgo.com/?q=", "&format=json&t=VimSearch"]
def setUrl(query):
URL.insert(1, query)
return ''.join(URL)#Return a string of the final URL (list to str)
d... | try:
import requests
import vim
import json
except Exception:
print("Error occurred while importing dependencies.")
URL = ["http://api.duckduckgo.com/?q=", "&format=json&t=VimSearch"]
def setUrl(query):
URL.insert(1, query)
return ''.join(URL)#Return a string of the final URL (list to str)
d... | mit | Python |
1766b47b81e96f23060e1bb33f64a06a905ddba6 | prepare release 0.5.62 | crate/crate-docs-theme,crate/crate-docs-theme,crate/crate-docs-theme,crate/crate-docs-theme | src/crate/theme/rtd/__init__.py | src/crate/theme/rtd/__init__.py | # -*- coding: utf-8; -*-
#
# Licensed to Crate (https://crate.io) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License");
# yo... | # -*- coding: utf-8; -*-
#
# Licensed to Crate (https://crate.io) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License");
# yo... | apache-2.0 | Python |
f3408b4a0214d8bea1d015cb7e263e294501cf1b | Fix migration | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | bluebottle/collect/migrations/0014_create_defaults.py | bluebottle/collect/migrations/0014_create_defaults.py | # Generated by Django 2.2.24 on 2021-11-08 10:39
from django.db import migrations, connection
DEFAULT_COLLECT_TYPES = [
{
'en': {
'name': 'Clothing',
'unit': 'Bag of clothing',
'unit_plural': 'Bags of clothing'
},
'nl': {
'name': 'Kleding',
... | # Generated by Django 2.2.24 on 2021-11-08 10:39
from django.db import migrations
DEFAULT_COLLECT_TYPES = [
{
'en': {
'name': 'Clothing',
'unit': 'Bag of clothing',
'unit_plural': 'Bags of clothing'
},
'nl': {
'name': 'Kleding',
'... | bsd-3-clause | Python |
ef1c99acda950c33400d7818cec420104b5865a3 | Add `previous_float` to util.py | rstebbing/bspline-regression | util.py | util.py | # util.py
# Imports
import re
# raise_if_not_shape
def raise_if_not_shape(name, A, shape):
"""Raise a `ValueError` if the np.ndarray `A` does not have dimensions
`shape`."""
if A.shape != shape:
raise ValueError('{}.shape != {}'.format(name, shape))
# previous_float
PARSE_FLOAT_RE = ... | # util.py
# raise_if_not_shape
def raise_if_not_shape(name, A, shape):
"""Raise a `ValueError` if the np.ndarray `A` does not have dimensions
`shape`."""
if A.shape != shape:
raise ValueError('{}.shape != {}'.format(name, shape))
| mit | Python |
0900b3bc0792c2ae2ff374dacd7f7a1d136989da | fix a commend in util.py | NoPointExc/ppm | util.py | util.py | def num_to_str(val, num_sys = 10):
result = format(val, {2:'b', 10:'d', 16:'x'}[num_sys])
return result
def get_adjacency(index, arr):
"""
get the adjacency number.
Args:
index: for an 4-bit array, indexs are[0, 1, 2, 3]
arr: 4-bit int array.
"""
result=0
left... | def num_to_str(val, num_sys = 10):
result = format(val, {2:'b', 10:'d', 16:'x'}[num_sys])
return result
def get_adjacency(index, arr):
"""
get the adjacency( number.
Args:
index: for an 4-bit array, indexs are[0, 1, 2, 3]
arr: 4-bit int array.
"""
result=0
lef... | mit | Python |
44773f810c5cbcabe7d47f2cc14a3bc6082677ea | Add more request debug. | lightcrest/kahu-api-demo | util.py | util.py | import sys
import logging
def disable_ssl_warnings():
try:
from requests.packages import urllib3
urllib3.disable_warnings()
except ImportError:
pass
try:
import urllib3
urllib3.disable_warnings()
except ImportError:
pass
def format_cols(cols):
width... | import sys
def disable_ssl_warnings():
try:
from requests.packages import urllib3
urllib3.disable_warnings()
except ImportError:
pass
try:
import urllib3
urllib3.disable_warnings()
except ImportError:
pass
def format_cols(cols):
widths = [0] * len(c... | mit | Python |
fa0300aac67efab4555d71a9b07da354684d8909 | Use correct field reference | rapidpro/tracpro,rapidpro/tracpro,xkmato/tracpro,xkmato/tracpro,xkmato/tracpro,rapidpro/tracpro,xkmato/tracpro | tracpro/orgs_ext/migrations/0002_auto_20150724_1609.py | tracpro/orgs_ext/migrations/0002_auto_20150724_1609.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.conf import settings
from django.db import models, migrations
def add_available_languages(apps, schema_editor):
"""Set default available_languages to all languages defined for this project."""
all_languages = [l[0] for l... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.conf import settings
from django.db import models, migrations
def add_available_languages(apps, schema_editor):
"""Set default available_languages to all languages defined for this project."""
all_languages = [l[0] for l... | bsd-3-clause | Python |
846ab65cc08b2bfe0ada8a8cc508bbdac8f4cead | add new version (#24900) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/py-pythran/package.py | var/spack/repos/builtin/packages/py-pythran/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 PyPythran(PythonPackage):
"""Ahead of Time compiler for numeric kernels."""
homepage ... | # 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 PyPythran(PythonPackage):
"""Ahead of Time compiler for numeric kernels."""
homepage ... | lgpl-2.1 | Python |
1864c63e26a34d35abcf8dfcc45ec0696f6470b9 | Fix date json | BrodaNoel/bropy,BrodaNoel/bropy | modules/gy-gps6mv1/core/get.py | modules/gy-gps6mv1/core/get.py | #! /usr/bin/python
# Written by Dan Mandle http://dan.mandle.me September 2012
# Modified by Broda Noel @brodanoel (in all social networks)
# License: GPL 2.0
from gps import *
from time import *
import time
import threading
import sys
gpsd = None #seting the global variable
class GpsPoller(threading.Thread):
def ... | #! /usr/bin/python
# Written by Dan Mandle http://dan.mandle.me September 2012
# Modified by Broda Noel @brodanoel (in all social networks)
# License: GPL 2.0
from gps import *
from time import *
import time
import threading
import sys
gpsd = None #seting the global variable
class GpsPoller(threading.Thread):
def ... | mit | Python |
f4070c5165c275994533768fafc64b4554fdcccf | Add experiment and dataset to list for upgrading. | hms-dbmi/fourfront,ClinGen/clincoded,ClinGen/clincoded,kidaa/encoded,philiptzou/clincoded,ENCODE-DCC/snovault,ENCODE-DCC/encoded,kidaa/encoded,hms-dbmi/fourfront,T2DREAM/t2dream-portal,4dn-dcic/fourfront,kidaa/encoded,ClinGen/clincoded,philiptzou/clincoded,philiptzou/clincoded,T2DREAM/t2dream-portal,ENCODE-DCC/snovault... | src/encoded/commands/upgrade.py | src/encoded/commands/upgrade.py | """\
Run this to upgrade the site.
Examples
To update on the production server:
%(prog)s production.ini
For the development.ini you must supply the paster app name:
%(prog)s development.ini --app-name app
"""
import logging
import transaction
EPILOG = __doc__
logger = logging.getLogger(__name__)
def i... | """\
Run this to upgrade the site.
Examples
To update on the production server:
%(prog)s production.ini
For the development.ini you must supply the paster app name:
%(prog)s development.ini --app-name app
"""
import logging
import transaction
EPILOG = __doc__
logger = logging.getLogger(__name__)
def i... | mit | Python |
bc95b47aecc8e6c4455f137a1ae800f6a649a265 | Tag 3.0.0 | 115100/untz_manager | untz_manager/__init__.py | untz_manager/__init__.py | __version__ = "3.0.0"
| __version__ = "2.2.1"
| bsd-3-clause | Python |
642a7aeb76045d36ea469cd13e3d97c629f9a7db | Fix zero coordinates error. | alberand/tserver,alberand/tserver,alberand/tserver,alberand/tserver | src/gui/loggers_ui/utils.py | src/gui/loggers_ui/utils.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
def NMEA_to_ll(lat, lon):
'''
Converts NMEA coordinates to decimal degree.
Args:
lat: float, latitude
lon: float, longitude
Returns:
List with latitude and longitude.
'''
result = list()
# Convert to strings... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
def NMEA_to_ll(lat, lon):
'''
Converts NMEA coordinates to decimal degree.
Args:
lat: float, latitude
lon: float, longitude
Returns:
List with latitude and longitude.
'''
result = list()
# Convert to strings... | mit | Python |
9e69e8336463279d559779c5ca79db37a2334cc0 | update gen_weather_rate to use helper | quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot | util/gen_weather_rate.py | util/gen_weather_rate.py | import csv
import coinach
import os
_OUTPUT_FILE = 'weather_rate.js'
def parse_data(csvfile):
all_rates = {}
reader = csv.reader(csvfile)
# skip the first three header lines
next(reader)
next(reader)
next(reader)
for row in reader:
sum = 0
weathers = []
rates = []... | # Generates resources/weather_rate.js
# (1) Download https://github.com/ufx/SaintCoinach/releases/latest
# (2) SaintCoinach.Cmd.exe "C:\Program Files (x86)\SquareEnix\FINAL FANTASY XIV - A Realm Reborn"
# (3) exd TerritoryType WeatherRate
# (4) Run util/gen_weather_rate.py -f path/to/WeatherRate.csv
import argparse
i... | apache-2.0 | Python |
82f60610a23c385c68cb2ca656fe1f85085e453f | Bump version number | brainix/pottery | pottery/__init__.py | pottery/__init__.py | # --------------------------------------------------------------------------- #
# __init__.py #
# #
# Copyright © 2015-2020, Rajiv Bakulesh Shah, original author. #
... | # --------------------------------------------------------------------------- #
# __init__.py #
# #
# Copyright © 2015-2020, Rajiv Bakulesh Shah, original author. #
... | apache-2.0 | Python |
12ed0bdd60b0ab59457c36f43faca731525517fc | update version | pavlov99/json-rpc | jsonrpc/__init__.py | jsonrpc/__init__.py | __version = (1, 1, "rc2")
__version__ = version = '.'.join(map(str, __version))
__project__ = PROJECT = __name__
from .manager import JSONRPCResponseManager
from .dispatcher import Dispatcher
dispatcher = Dispatcher()
# lint_ignore=W0611,W0401
| __version = (1, 1, "rc1")
__version__ = version = '.'.join(map(str, __version))
__project__ = PROJECT = __name__
from .manager import JSONRPCResponseManager
from .dispatcher import Dispatcher
dispatcher = Dispatcher()
# lint_ignore=W0611,W0401
| mit | Python |
1510bc44b8017771e60618d617cfefd4eaf32cde | Convert from pyqt4 to qtpy | neutrons/FastGR,neutrons/FastGR,neutrons/FastGR | addie/initialization/init_step1.py | addie/initialization/init_step1.py | from qtpy.QtWidgets import (QLabel)
from addie.step1_handler.step1_gui_handler import Step1GuiHandler
class InitStep1(object):
def __init__(self, parent=None):
self.parent = parent
self.parent.ui.diamond.setFocus(True)
self.set_statusBar()
self.set_title()
def set_title(self... | from PyQt4 import QtGui
from addie.step1_handler.step1_gui_handler import Step1GuiHandler
class InitStep1(object):
def __init__(self, parent=None):
self.parent = parent
self.parent.ui.diamond.setFocus(True)
self.set_statusBar()
self.set_title()
def set_title(self... | mit | Python |
a665d8959969b7f41a05c3b856d535af8e73b9e3 | add ComplexType | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Lib/types.py | Lib/types.py | # Define names for all type symbols known in the standard interpreter.
# Types that are part of optional modules (e.g. array) are not listed.
import sys
NoneType = type(None)
TypeType = type(NoneType)
IntType = type(0)
LongType = type(0L)
FloatType = type(0.0)
import __builtin__
if vars(__builtin__).has_key('complex... | # Define names for all type symbols known in the standard interpreter.
# Types that are part of optional modules (e.g. array) are not listed.
import sys
NoneType = type(None)
TypeType = type(NoneType)
IntType = type(0)
LongType = type(0L)
FloatType = type(0.0)
StringType = type('')
TupleType = type(())
ListType = ... | mit | Python |
dd6c623814cfbb571c10d421cf57b3092e975f47 | Update wagtailcodeblock_tags.py | FlipperPA/wagtailcodeblock,FlipperPA/wagtailcodeblock,FlipperPA/wagtailcodeblock | wagtailcodeblock/templatetags/wagtailcodeblock_tags.py | wagtailcodeblock/templatetags/wagtailcodeblock_tags.py | from django.template import Library
from django.utils.safestring import mark_safe
from ..settings import (
get_prism_version,
get_theme
)
register = Library()
@register.simple_tag
def load_prism_theme():
prism_version = get_prism_version()
theme = get_theme()
if theme:
script = "<link h... | from django.template import Library
from django.utils.safestring import mark_safe
from ..settings import (
get_prism_version,
get_theme
)
register = Library()
@register.simple_tag
def load_prism_theme():
prism_version = get_prism_version()
theme = get_theme()
if theme:
script = "<link h... | bsd-3-clause | Python |
7dfadde341e9d02fdcb37f70cce10e8b689f36c9 | update logic | rahulbohra/Python-Basic | 69_split_problem_statement_2.py | 69_split_problem_statement_2.py | '''
Open the file sample.txt and read it line by line.
When you find a line that starts with 'From:' like the following line:
From stephen.marquard@uct.ac.za Sat Jan 5 09:14:16 2008
You will parse the From line using split() and print out the second word in the line
(i.e. the entire address of the person who sent ... | '''
Open the file sample.txt and read it line by line.
When you find a line that starts with 'From:' like the following line:
From stephen.marquard@uct.ac.za Sat Jan 5 09:14:16 2008
You will parse the From line using split() and print out the second word in the line
(i.e. the entire address of the person who sent ... | mit | Python |
f863284985296b6529934ae52e65edefd420eea5 | remove old commented out code | mprefer/findingaids,emory-libraries/findingaids,emory-libraries/findingaids,mprefer/findingaids | findingaids/urls.py | findingaids/urls.py | # file findingaids/urls.py
#
# Copyright 2012 Emory University Library
#
# 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
#
# Unles... | # file findingaids/urls.py
#
# Copyright 2012 Emory University Library
#
# 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
#
# Unles... | apache-2.0 | Python |
17d9580571d7416541b101c4d9bc7161c3e7b174 | Update version for release | MGHComputationalPathology/highdicom | src/highdicom/version.py | src/highdicom/version.py | __version__ = '0.7.0'
| __version__ = '0.6.1'
| mit | Python |
34aa53ad32a6bb845216dfc4d61ccde87aad6e73 | Cover task2 in testsuite | cutoffthetop/hireme | src/hireme/testsuite/test_task2.py | src/hireme/testsuite/test_task2.py | # -*- coding: utf-8 -*-
import json
import os
from nose.tools import assert_raises
from werkzeug.exceptions import BadRequest
from ..task2 import solve
from . import ctx_setter
@ctx_setter(method='POST', data={'input': ''})
def test_too_few_cases():
expected = 'You need to enter 0 < T < 6 test cases.'
wit... | # -*- coding: utf-8 -*-
def test_solve():
assert True
| bsd-2-clause | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.