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 |
|---|---|---|---|---|---|---|---|---|
21e7ca90dc1ff684b77829705b07f43fed5e4667 | Update data.py | chiangf/flask-boiler | flaskboiler/users/data.py | flaskboiler/users/data.py | from flaskboiler.data import Data, db
from flaskboiler.users.model import User
class UserData(Data):
def __init__(self):
super(UserData, self).__init__(User)
def some_complicated_query(self, username):
"""
Not actually a complicated query but this shows how we might want to mix raw SQ... | from flaskboiler.data import Data, db
from flaskboiler.users.model import User
class UserData(Data):
def __init__(self):
super(UserData, self).__init__(User)
def some_complicated_query(self, username):
results = db.session.query(User).from_statement(
"""SELECT * FROM users WHERE u... | apache-2.0 | Python |
f204206f1371fce967c3d4f4174c737a18aef2f2 | add __enter__ and __exit__ | apdavison/python-neo,NeuralEnsemble/python-neo,INM-6/python-neo,samuelgarcia/python-neo,rgerkin/python-neo,JuliaSprenger/python-neo | neo/io/nixio_fr.py | neo/io/nixio_fr.py | from neo.io.basefromrawio import BaseFromRaw
from neo.rawio.nixrawio import NIXRawIO
# This class subjects to limitations when there are multiple asymmetric blocks
class NixIO(NIXRawIO, BaseFromRaw):
name = 'NIX IO'
_prefered_signal_group_mode = 'group-by-same-units'
_prefered_units_group_mode = 'all-i... | from neo.io.basefromrawio import BaseFromRaw
from neo.rawio.nixrawio import NIXRawIO
# This class subjects to limitations when there are multiple asymmetric blocks
class NixIO(NIXRawIO, BaseFromRaw):
name = 'NIX IO'
_prefered_signal_group_mode = 'group-by-same-units'
_prefered_units_group_mode = 'all-i... | bsd-3-clause | Python |
e07d6d0db7dfed8013f6b1b058167aa16070fc35 | Update server endpoint from dev to production | messente/verigator-python | messente/verigator/routes.py | messente/verigator/routes.py | URL = "https://api.verigator.com"
CREATE_SERVICE = "v1/service/service"
GET_SERVICE = "v1/service/service/{}"
DELETE_SERVICE = "v1/service/service/{}"
GET_USERS = "v1/service/service/{}/users"
GET_USER = "v1/service/service/{}/users/{}"
CREATE_USER = "v1/service/service/{}/users"
DELETE_USER = "v1/service/service/{}/u... | URL = "https://api.dev.verigator.com"
CREATE_SERVICE = "v1/service/service"
GET_SERVICE = "v1/service/service/{}"
DELETE_SERVICE = "v1/service/service/{}"
GET_USERS = "v1/service/service/{}/users"
GET_USER = "v1/service/service/{}/users/{}"
CREATE_USER = "v1/service/service/{}/users"
DELETE_USER = "v1/service/service/... | apache-2.0 | Python |
9959e9814a72b4912fb90a28c592043584cba46b | switch from unicode to str | arnehilmann/netkraken,arnehilmann/netkraken,netkraken/minion,netkraken/minion | src/unittest/python/counterdb_tests.py | src/unittest/python/counterdb_tests.py | from __future__ import print_function
import unittest
from mock import patch
import io
from counterdb import CountDB
class CountDBTests(unittest.TestCase):
def setUp(self):
self.dummy_countdb = CountDB("///invalid/filename///")
self.dummy_countdb.data = {"foo": 42}
self.dummy_countdb.co... | from __future__ import print_function
import unittest
from mock import patch
import io
from counterdb import CountDB
class CountDBTests(unittest.TestCase):
def setUp(self):
self.dummy_countdb = CountDB("///invalid/filename///")
self.dummy_countdb.data = {"foo": 42}
self.dummy_countdb.co... | apache-2.0 | Python |
e6f299d0c5587d7338601b9ffe6b331c35251cfd | Rename "channel" to "channels" | mineo/lala,mineo/lala | run-lala.py | run-lala.py | #!/usr/bin/python2
import ConfigParser
import sys
import os
import socket
import logging
from lala import Bot
from time import sleep
from os.path import join
def main():
"""Main method"""
config = ConfigParser.SafeConfigParser()
try:
configfile = os.path.join(os.getenv("XDG_CONFIG_HOME"),"lala","c... | #!/usr/bin/python2
import ConfigParser
import sys
import os
import socket
import logging
from lala import Bot
from time import sleep
from os.path import join
def main():
"""Main method"""
config = ConfigParser.SafeConfigParser()
try:
configfile = os.path.join(os.getenv("XDG_CONFIG_HOME"),"lala","c... | mit | Python |
9223ba0c110fe8a876888322bfd044eb78727eee | Bump version | kk6/mammut | mammut/__init__.py | mammut/__init__.py | # -*- coding: utf-8 -*-
"""
Mammut - Mastodon API for Python
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
__version__ = '0.2.0'
__author__ = 'kk6'
__license__ = 'MIT'
| # -*- coding: utf-8 -*-
"""
Mammut - Mastodon API for Python
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
__version__ = '0.1.1'
__author__ = 'kk6'
__license__ = 'MIT'
| mit | Python |
9e8795f8d04686563c8a57d0f22ba34a66e84382 | remove unneeded call to PyMySQL | JBKahn/django-watchman,mwarkentin/django-watchman,mwarkentin/django-watchman,JBKahn/django-watchman | runtests.py | runtests.py | import sys
import traceback
try:
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
},
},
TEMPLATES=[
{
'BACK... | import sys
import traceback
try:
from django.conf import settings
from pymysql import install_as_MySQLdb
install_as_MySQLdb()
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
... | bsd-3-clause | Python |
ff763b275b326525db86d997471ed94616d5bffd | use simpler runtests.py script | edoburu/django-template-analyzer,edoburu/django-template-analyzer | runtests.py | runtests.py | #!/usr/bin/env python
import sys
from django.conf import settings
from django.core.management import execute_from_command_line
if not settings.configured:
settings.configure(
DEBUG = True,
TEMPLATE_DEBUG = True,
DATABASES = {
'default': {
'ENGINE': 'django.db.bac... | #!/usr/bin/env python
# Django environment setup:
from django.conf import settings
from os.path import abspath, basename, dirname, exists, isdir, join, realpath
import sys, os
# Detect location and available modules
module_root = dirname(realpath(__file__))
module_names = [name for name in os.listdir(module_root) if ... | bsd-3-clause | Python |
a68de5eb6100f47adeb099fbc09b7a4d341fd706 | change DJANGO_SETTINGS_MODULE to lbworkflow.tests.settings | vicalloy/django-lb-workflow,vicalloy/django-lb-workflow,vicalloy/django-lb-workflow | runtests.py | runtests.py | #!/usr/bin/env python
import os
import sys
import django
from django.conf import settings
from django.test.utils import get_runner
if __name__ == "__main__":
os.environ['DJANGO_SETTINGS_MODULE'] = "lbworkflow.tests.settings"
django.setup()
TestRunner = get_runner(settings)
test_runner = TestRunner()
... | #!/usr/bin/env python
import os
import sys
import django
from django.conf import settings
from django.test.utils import get_runner
if __name__ == "__main__":
sys.path.append('./testproject')
os.environ['DJANGO_SETTINGS_MODULE'] = "testproject.settings"
django.setup()
TestRunner = get_runner(settings)
... | mit | Python |
6281da3b846bfea26ea68e3fe480c738a5181506 | Add test-runner option to run zpop* tests. | coleifer/walrus | runtests.py | runtests.py | #!/usr/bin/env python
import optparse
import os
import sys
import unittest
def runtests(verbose=False, failfast=False, names=None):
if names:
suite = unittest.TestLoader().loadTestsFromNames(names, tests)
else:
suite = unittest.TestLoader().loadTestsFromModule(tests)
runner = unittest.Text... | #!/usr/bin/env python
import optparse
import sys
import unittest
from walrus import tests
def runtests(verbose=False, failfast=False, names=None):
if names:
suite = unittest.TestLoader().loadTestsFromNames(names, tests)
else:
suite = unittest.TestLoader().loadTestsFromModule(tests)
runner... | mit | Python |
25cea8e766b3b825d67e377226a3c05e4e8f2f3a | Fix nick's regex fail :) | honza/nigel | matchers/points.py | matchers/points.py | import os
import re
import redis
import urlparse
from base import BaseMatcher
redis_url = os.environ.get('MYREDIS_URL', None)
if redis_url:
urlparse.uses_netloc.append('redis')
url = urlparse.urlparse(redis_url)
r = redis.StrictRedis(host=url.hostname, port=url.port, db=0,
password=url.passw... | import os
import re
import redis
import urlparse
from base import BaseMatcher
redis_url = os.environ.get('MYREDIS_URL', None)
if redis_url:
urlparse.uses_netloc.append('redis')
url = urlparse.urlparse(redis_url)
r = redis.StrictRedis(host=url.hostname, port=url.port, db=0,
password=url.passw... | bsd-2-clause | Python |
b76b4d8d2303778a834aef81056d1a7100fe96b7 | Add `types` and `same_as` mappings to topics in ES | editorsnotes/editorsnotes,editorsnotes/editorsnotes | editorsnotes/search/items/mappings.py | editorsnotes/search/items/mappings.py | from django.conf import settings
from elasticsearch_dsl import Date, String, Nested, DocType, Object
def base_serialized_field():
mapping = Object()
mapping.field('last_updated', Date())
mapping.field('last_updater', String(index='not_analyzed'))
mapping.field('created', Date())
mapping.field('c... | from django.conf import settings
from elasticsearch_dsl import Date, String, Nested, DocType, Object
def base_serialized_field():
mapping = Object()
mapping.field('last_updated', Date())
mapping.field('last_updater', String(index='not_analyzed'))
mapping.field('created', Date())
mapping.field('c... | agpl-3.0 | Python |
6a4aa049a51a3649a09652c34a7c577262219d07 | Remove rest import from test_project urls | Alwnikrotikz/marinemap,Alwnikrotikz/marinemap,Alwnikrotikz/marinemap,google-code-export/marinemap,google-code-export/marinemap,google-code-export/marinemap,Alwnikrotikz/marinemap,google-code-export/marinemap | example_projects/test_project/urls.py | example_projects/test_project/urls.py | from django.conf.urls.defaults import *
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^marinemap/', 'django.views.generic.simple.redirect_to', {'url': '/'}),
url(r'^$', 'lingcod.co... | from django.conf.urls.defaults import *
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from lingcod import rest
admin.autodiscover()
urlpatterns = patterns('',
url(r'^marinemap/', 'django.views.generic.simple.redirect_to', {'url': '/'}),
... | bsd-3-clause | Python |
8d98672e65bf97dbb72c70f79bf73ca6e082627d | remove unused variable | adnedelcu/SyncSettings,mfuentesg/SyncSettings | sync_settings/sync_settings_manager.py | sync_settings/sync_settings_manager.py | # -*- coding: utf-8 -*-
import sublime, sys, os
class SyncSettingsManager:
settingsFilename = 'SyncSettings.sublime-settings'
files = [
"Package Control.merged-ca-bundle",
"Package Control.system-ca-bundle",
"Package Control.user-ca-bundle",
"Package Control.sublime-settings",
"Preferences.sublime-setting... | # -*- coding: utf-8 -*-
from .gistapi import *
import sublime, sys, os
class SyncSettingsManager:
settingsFilename = 'SyncSettings.sublime-settings'
gistapi = None
files = [
"Package Control.merged-ca-bundle",
"Package Control.system-ca-bundle",
"Package Control.user-ca-bundle",
"Package Control.sublime-se... | mit | Python |
d2061ba2942f0866bf346b259598a69bda529ba0 | update template paths | sunlightlabs/billy,openstates/billy,sunlightlabs/billy,mileswwatkins/billy,mileswwatkins/billy,mileswwatkins/billy,loandy/billy,sunlightlabs/billy,openstates/billy,loandy/billy,loandy/billy,openstates/billy | billy/web/public/templatetags/sitebase.py | billy/web/public/templatetags/sitebase.py | from operator import itemgetter
from django import template
from billy import db
from billy.web.public.forms import StateSelectForm
from billy.models import Metadata
register = template.Library()
@register.inclusion_tag('billy/web/public/sitebase/states_selection.html')
def states_selection():
form = StateSel... | from operator import itemgetter
from django import template
from billy import db
from billy.web.public.forms import StateSelectForm
from billy.models import Metadata
register = template.Library()
@register.inclusion_tag('billy/www/sitebase/states_selection.html')
def states_selection():
form = StateSelectForm... | bsd-3-clause | Python |
8fde0ae614466485384b465fadd4f674560290e1 | simplify strict_slashes syntax | teslaworksumn/teslaworks.net,teslaworksumn/teslaworks.net | server_dev.py | server_dev.py | import projects
from flask import Flask, render_template, abort
app = Flask(__name__)
app.url_map.strict_slashes = False
@app.errorhandler(404)
def page_not_found(e):
return render_template('404.html'), 404
@app.route('/')
def index():
project_list = projects.get_projects()
return render_template('index.h... | import projects
from flask import Flask, render_template, abort
app = Flask(__name__)
def route(*a, **kw):
kw['strict_slashes'] = kw.get('strict_slashes', False)
return app.route(*a, **kw)
@app.errorhandler(404)
def page_not_found(e):
return render_template('404.html'), 404
@route('/')
def index():
... | mit | Python |
dbb6fdaaa58302343be245c43e6f89f9d5635368 | 修复分类不能包含 '.' 的问题 | D6C92FE5/oucfeed.server,D6C92FE5/oucfeed.server | oucfeed/server/datastore/mongodb.py | oucfeed/server/datastore/mongodb.py | # -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function, unicode_literals
import json
import pymongo
from oucfeed.server import config
from oucfeed.server.datastore.base import BaseDatastore
class MongodbDatastore(BaseDatastore):
# noinspection PyMissingConstructor
def __... | # -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function, unicode_literals
import os
import pymongo
from oucfeed.server import config
from oucfeed.server.datastore.base import BaseDatastore
class MongodbDatastore(BaseDatastore):
# noinspection PyMissingConstructor
def __in... | mit | Python |
6d99c520d0524e4a4cd6d69d6f9367ca5302d8f3 | update trans time for concurrent h2d | 3upperm2n/trans_kernel_model | mem_mem/df_util.py | mem_mem/df_util.py | import pandas as pd
import numpy as np
import operator
import sys
#------------------------------------------------------------------------------
# Update Cell Function.
#
# Example (old)
# df_all_api.iloc[0, df_all_api.columns.get_loc('time_left')] = current_predict_time_left
# (now)
# df_all_api = updateCell(df_... | import pandas as pd
import numpy as np
import operator
import sys
#------------------------------------------------------------------------------
# Update Cell Function.
# Example:
# (old)
# df_all_api.iloc[0, df_all_api.columns.get_loc('time_left')] = current_predict_time_left
# (now)
# df_all_api = updateCell(df_... | mit | Python |
3ade0a3d3bd586f15d2ce0fe79034d555efc09c6 | update its2D_1.py example - use refine_mesh() | RexFuzzle/sfepy,lokik/sfepy,RexFuzzle/sfepy,lokik/sfepy,BubuLK/sfepy,vlukes/sfepy,BubuLK/sfepy,BubuLK/sfepy,sfepy/sfepy,lokik/sfepy,RexFuzzle/sfepy,vlukes/sfepy,rc/sfepy,sfepy/sfepy,rc/sfepy,sfepy/sfepy,RexFuzzle/sfepy,lokik/sfepy,rc/sfepy,vlukes/sfepy | examples/linear_elasticity/its2D_1.py | examples/linear_elasticity/its2D_1.py | r"""
Diametrically point loaded 2-D disk. See :ref:`sec-primer`.
Find :math:`\ul{u}` such that:
.. math::
\int_{\Omega} D_{ijkl}\ e_{ij}(\ul{v}) e_{kl}(\ul{u})
= 0
\;, \quad \forall \ul{v} \;,
where
.. math::
D_{ijkl} = \mu (\delta_{ik} \delta_{jl}+\delta_{il} \delta_{jk}) +
\lambda \ \delta_{ij... | r"""
Diametrically point loaded 2-D disk. See :ref:`sec-primer`.
Find :math:`\ul{u}` such that:
.. math::
\int_{\Omega} D_{ijkl}\ e_{ij}(\ul{v}) e_{kl}(\ul{u})
= 0
\;, \quad \forall \ul{v} \;,
where
.. math::
D_{ijkl} = \mu (\delta_{ik} \delta_{jl}+\delta_{il} \delta_{jk}) +
\lambda \ \delta_{ij... | bsd-3-clause | Python |
cec58d65fa5606770e41ab4b8fc213dd377cbf37 | Add bool attr "timeout" to NS.tendrl.objects.Job | r0h4n/commons,Tendrl/commons | tendrl/commons/objects/job/__init__.py | tendrl/commons/objects/job/__init__.py | from tendrl.commons import objects
class Job(objects.BaseObject):
def __init__(self, job_id=None, payload=None,
status=None, errors=None, children=None,
locked_by=None, output=None, timeout=None,
*args, **kwargs):
super(Job, self).__init__(*args, **kwargs... | from tendrl.commons import objects
class Job(objects.BaseObject):
def __init__(self, job_id=None, payload=None,
status=None, errors=None, children=None,
locked_by=None, output=None, timeout=True,
*args, **kwargs):
super(Job, self).__init__(*args, **kwargs... | lgpl-2.1 | Python |
fada5baba3262ea0a8b4848f4758ced99c3ea3de | Add TLS wrapper | dlecocq/nsq-py,dlecocq/nsq-py | nsq/sockets/tls.py | nsq/sockets/tls.py | '''Wraps a socket in TLS'''
import ssl
class TLSSocket(object):
'''Provide a way to return a TLS socket'''
@classmethod
def wrap_socket(cls, socket):
return ssl.wrap_socket(socket, ssl_version=ssl.PROTOCOL_TLSv1)
| '''Wraps a socket in TLS'''
raise ImportError('TLS not supported')
| mit | Python |
f31cb45339c0e2aff80a07f77de21521da0dfbaa | add one more test case of jinja2 | ssato/python-anytemplate,ssato/python-anytemplate | anytemplate/tests/api.py | anytemplate/tests/api.py | #
# Copyright (C). 2015 Satoru SATOH <ssato at redhat.com>
#
import unittest
import anytemplate.api as TT
import anytemplate.engines.jinja2
import anytemplate.compat
class Test_00(unittest.TestCase):
def test_10_find_engine_class(self):
if anytemplate.engines.jinja2.SUPPORTED:
cls = TT.find_... | #
# Copyright (C). 2015 Satoru SATOH <ssato at redhat.com>
#
import unittest
import anytemplate.api as TT
import anytemplate.engines.jinja2
import anytemplate.compat
class Test_00(unittest.TestCase):
def test_10_find_engine_class(self):
if anytemplate.engines.jinja2.SUPPORTED:
cls = TT.find_... | mit | Python |
cf0110f2b1adc8fbf4b8305841961d67da33f8c7 | Fix Thompson to pay attention to the RNG. | mwhoffman/pybo,jhartford/pybo | pybo/bayesopt/policies/thompson.py | pybo/bayesopt/policies/thompson.py | """
Implementation of Thompson sampling for continuous spaces.
"""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from collections import deque
from ..utils import params
__all__ = ['Thompson']
@params('n')
def Thompson(model, n=100, rng=None):
"""
... | """
Acquisition functions based on (GP) UCB.
"""
# future imports
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
# use this to simplify (slightly) the Thompson implementation with sampled
# models.
from collections import deque
# local imports
from ..util... | bsd-2-clause | Python |
e4cf2e4feb2f2cb29cec55070febd74ba8fa28cc | use f-strings in libpath.py (#4137) | henry0312/LightGBM,microsoft/LightGBM,microsoft/LightGBM,henry0312/LightGBM,microsoft/LightGBM,henry0312/LightGBM,microsoft/LightGBM,henry0312/LightGBM,henry0312/LightGBM,microsoft/LightGBM | python-package/lightgbm/libpath.py | python-package/lightgbm/libpath.py | # coding: utf-8
"""Find the path to LightGBM dynamic library files."""
import os
from platform import system
from typing import List
def find_lib_path() -> List[str]:
"""Find the path to LightGBM library files.
Returns
-------
lib_path: list of strings
List of all found library paths to LightG... | # coding: utf-8
"""Find the path to LightGBM dynamic library files."""
import os
from platform import system
from typing import List
def find_lib_path() -> List[str]:
"""Find the path to LightGBM library files.
Returns
-------
lib_path: list of strings
List of all found library paths to LightG... | mit | Python |
edce986cb3cdb8ca01a9b2dc125069d90d656291 | use compat module to check python version | houqp/shell.py | shell/util.py | shell/util.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import tempfile
from .compat import is_py2, is_py3
def str_to_pipe(s):
input_pipe = tempfile.SpooledTemporaryFile()
if (is_py2 and isinstance(s, unicode)) or (is_py3 and isinstance(s, str)):
s = s.encode('utf-8')
input_pipe.write(s)
input_pipe.see... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import tempfile
from .compat import is_py3
def str_to_pipe(s):
input_pipe = tempfile.SpooledTemporaryFile()
try:
# py2
if isinstance(s, unicode):
s = s.encode('utf-8')
except NameError:
# py3
if isinstance(s, str):
... | mit | Python |
1be03a0ddc45d1f144602160ffb9bdb4525b1975 | Fix doctest in __init__.py | blink1073/oct2py,blink1073/oct2py | oct2py/__init__.py | oct2py/__init__.py | # -*- coding: utf-8 -*-
"""
Oct2py is a means to seemlessly call m-files and Octave functions from python.
It manages the Octave session for you, sharing data behind the scenes using
MAT files. Usage is as simple as:
.. code-block:: python
>>> import oct2py
>>> oc = oct2py.Oct2Py()
>>> x = oc.... | # -*- coding: utf-8 -*-
"""
Oct2py is a means to seemlessly call m-files and Octave functions from python.
It manages the Octave session for you, sharing data behind the scenes using
MAT files. Usage is as simple as:
.. code-block:: pycon
>>> oc = oct2py.Oct2Py()
>>> x = oc.zeros(3,3)
>>> prin... | mit | Python |
e391f18d9fe2b366f8f1a1ac581c8ce7d5b06681 | Make removal | antmicro/distant-rec,antmicro/distant-rec | distantrec/vtr2yaml.py | distantrec/vtr2yaml.py | #!/usr/bin/env python
import sys, yaml
def yaml_section(execc, deps=[]):
section = {}
section["exec"] = execc
section["deps"] = deps
return section
def mangle_from_list(scripts):
for script in scripts:
mangle = ScriptMangler(script)
mangle.abs_to_rel()
mangle.temporary_fol... | #!/usr/bin/env python
import sys, yaml
def yaml_section(execc, deps=[]):
section = {}
section["exec"] = execc
section["deps"] = deps
return section
def mangle_from_list(scripts):
for script in scripts:
mangle = ScriptMangler(script)
mangle.abs_to_rel()
mangle.temporary_fol... | apache-2.0 | Python |
a3ee255012394744fedf1043be2fa733269e8d55 | refactor cli a bit | kmike/opencorpora-tools | opencorpora/cli.py | opencorpora/cli.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import sys
import bz2
import argparse
from opencorpora.compat import urlopen
FULL_CORPORA_URL_BZ2 = 'http://opencorpora.org/files/export/annot/annot.opcorpora.xml.bz2'
DISAMBIGUATED_CORPORA_URL_BZ2 = 'http://... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import sys
import bz2
import argparse
from opencorpora.compat import urlopen
FULL_CORPORA_URL_BZ2 = 'http://opencorpora.org/files/export/annot/annot.opcorpora.xml.bz2'
DISAMBIGUATED_CORPORA_URL_BZ2 = 'http://... | mit | Python |
196ba4e0222f00afbdfebfa99c9407ae58384216 | Update redirect URL | odero/django-pesapal,odero/django-pesapal | django_pesapal/conf.py | django_pesapal/conf.py | '''
Settings file for django-pesapal
'''
from django.conf import settings
if settings.configured:
PESAPAL_DEMO = getattr(settings, 'PESAPAL_DEMO', True)
if PESAPAL_DEMO:
PESAPAL_IFRAME_LINK = getattr(settings, 'PESAPAL_IFRAME_LINK', 'http://demo.pesapal.com/api/PostPesapalDirectOrderV4')
PESAP... | '''
Settings file for django-pesapal
'''
from django.conf import settings
if settings.configured:
PESAPAL_DEMO = getattr(settings, 'PESAPAL_DEMO', True)
if PESAPAL_DEMO:
PESAPAL_IFRAME_LINK = getattr(settings, 'PESAPAL_IFRAME_LINK', 'http://demo.pesapal.com/api/PostPesapalDirectOrderV4')
PESAP... | bsd-3-clause | Python |
698aeddc1b25c57598aa790e010767fc62f498a1 | Bump version | thombashi/pathvalidate | pathvalidate/__version__.py | pathvalidate/__version__.py | from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "2.0.1"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "2.0.0"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| mit | Python |
2f3d688b216d601ff5d1e074463781a5fafa6282 | fix deserialization of None values | iXioN/django-money,iXioN/django-money,tsouvarev/django-money,tsouvarev/django-money,recklessromeo/django-money,recklessromeo/django-money,rescale/django-money,AlexRiina/django-money | djmoney/serializers.py | djmoney/serializers.py | # coding=utf-8
import json
from decimal import Decimal
from django.core.serializers.python import Deserializer as PythonDeserializer
from django.core.serializers.json import Serializer as JSONSerializer
from django.core.serializers.python import _get_model
from django.utils import six
from djmoney.models.fields impo... | # coding=utf-8
import json
from decimal import Decimal
from django.core.serializers.python import Deserializer as PythonDeserializer
from django.core.serializers.json import Serializer as JSONSerializer
from django.core.serializers.python import _get_model
from django.utils import six
from djmoney.models.fields impo... | bsd-3-clause | Python |
fe2a0e54ea47284e5d4100ed5ae8aa2c3e93355f | fix error detection (new django-pipline uses stderr for that) | mila-labs/django-pipeline-compass-rubygem | pipeline_compass/compass.py | pipeline_compass/compass.py | from os.path import dirname
from django.conf import settings
from pipeline.compilers import SubProcessCompiler
class CompassCompiler(SubProcessCompiler):
output_extension = 'css'
def match_file(self, filename):
return filename.endswith(('.scss', '.sass'))
def compile_file(self, infile, outfile, ... | from os.path import dirname
from django.conf import settings
from pipeline.compilers import SubProcessCompiler
class CompassCompiler(SubProcessCompiler):
output_extension = 'css'
def match_file(self, filename):
return filename.endswith(('.scss', '.sass'))
def compile_file(self, infile, outfile, ... | mit | Python |
c96a2f636b48b065e8404af6d67fbae5986fd34a | Expand test cases for equality of subclasses. | pramasoul/micropython,adafruit/circuitpython,henriknelson/micropython,MrSurly/micropython,bvernoux/micropython,tobbad/micropython,kerneltask/micropython,kerneltask/micropython,tobbad/micropython,tobbad/micropython,pramasoul/micropython,selste/micropython,adafruit/circuitpython,henriknelson/micropython,pozetroninc/micro... | tests/basics/subclass_native2_tuple.py | tests/basics/subclass_native2_tuple.py | class Base1:
def __init__(self, *args):
print("Base1.__init__", args)
class Ctuple1(Base1, tuple):
pass
a = Ctuple1()
print(len(a))
a = Ctuple1([1, 2, 3])
print(len(a))
print("---")
class Ctuple2(tuple, Base1):
pass
a = Ctuple2()
print(len(a))
a = Ctuple2([1, 2, 3])
print(len(a))
a = tuple([1,... | class Base1:
def __init__(self, *args):
print("Base1.__init__", args)
class Ctuple1(Base1, tuple):
pass
a = Ctuple1()
print(len(a))
a = Ctuple1([1, 2, 3])
print(len(a))
print("---")
class Ctuple2(tuple, Base1):
pass
a = Ctuple2()
print(len(a))
a = Ctuple2([1, 2, 3])
print(len(a))
| mit | Python |
b77e11bd4dca5060b5294c3475e388c07d31ba6d | Consolidate url/view names | getnikola/nikola-users,getnikola/nikola-users,getnikola/nikola-users | sites/urls.py | sites/urls.py | from django.conf.urls import url
from . import views
app_name = 'sites'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^add/?$', views.add, name='add'),
url(r'^edit/?$', views.edit, name='edit'),
url(r'^remove/?$', views.remove, name='remove'),
url(r'^check/?$', views.check, name='che... | from django.conf.urls import url
from . import views
app_name = 'sites'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^add/?$', views.add, name='add'),
url(r'^edit/?$', views.edit, name='edit'),
url(r'^remove/?$', views.remove, name='remove'),
url(r'^check/?$', views.check, name='che... | mit | Python |
0413756164f7c3bd19ae3f194cabd79bcd81a125 | Use args and logger | evanccnyc/chef-solo-cup,josegonzalez/chef-solo-cup,josegonzalez/chef-solo-cup | chef_solo_cup/commands/bootstrap.py | chef_solo_cup/commands/bootstrap.py | from __future__ import with_statement
from fabric.api import hide, settings
from chef_solo_cup.helpers import sudo_dry
from chef_solo_cup.log import setup_custom_logger
from chef_solo_cup.commands.gem import gem
from chef_solo_cup.commands.ruby import ruby
def bootstrap(args, config, logger=None):
if logger is N... | from __future__ import with_statement
from fabric.api import hide, settings
from chef_solo_cup.helpers import sudo_dry
from chef_solo_cup.log import setup_custom_logger
from chef_solo_cup.commands.gem import gem
from chef_solo_cup.commands.ruby import ruby
def bootstrap(args, config, logger=None):
if logger is N... | mit | Python |
56906920f97f061fe7129343dc02179cb2aa7dbd | fix a type in engine | minggli/chatbot,minggli/chatbot | app/engine/naivebayes.py | app/engine/naivebayes.py | import random
from nltk.tokenize import word_tokenize
from nltk.classify import NaiveBayesClassifier
from . import NHSTextMiner, NLPProcessor, NLP, raw_data, labels
def train_model(input_data, label, n=100, sample_size=.8):
# TODO investigate different algorithm e.g. TF-IDF and Reinforcement NN
print('start... | import random
from nltk.tokenize import word_tokenize
from nltk.classify import NaiveBayesClassifier
from . import NHSTextMiner, NLPProcessor, NLP, raw_data, labels
def train_model(input_data, label, n=100, sample_size=.8):
# TODO investigate different algorithm e.g. TF-IDF and Reinforcement NN
print('start... | mit | Python |
644517f7dc9bc795a4f5616c5fa77819071946ea | Use the function instead of repeating the same code. | getnikola/nikola,okin/nikola,okin/nikola,okin/nikola,getnikola/nikola,getnikola/nikola,okin/nikola,getnikola/nikola | tests/integration/test_archive_full.py | tests/integration/test_archive_full.py | """Check that full archives build and are correct."""
import io
import os
import shutil
import pytest
import nikola.plugins.command.init
from nikola import __main__
from ..base import cd
from .helper import add_post_without_text, patch_config
@pytest.mark.parametrize("path", [
['archive.html'],
['2012', '... | """Check that full archives build and are correct."""
import io
import os
import shutil
import pytest
import nikola.plugins.command.init
from nikola import __main__
from ..base import cd
from .helper import patch_config
@pytest.mark.parametrize("path", [
['archive.html'],
['2012', 'index.html'],
['201... | mit | Python |
b1c399d2f4321bb21df1a5ea1f818638054fa41f | Make modules uninstallable | OCA/l10n-italy,dcorio/l10n-italy,OCA/l10n-italy,dcorio/l10n-italy,dcorio/l10n-italy,OCA/l10n-italy | l10n_it_split_payment/__openerp__.py | l10n_it_split_payment/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Abstract (http://www.abstract.it)
# Author: Davide Corio <davide.corio@abstract.it>
# Copyright 2015 Lorenzo Battistini - Agile Business Group
#
# This program is free software: you ... | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Abstract (http://www.abstract.it)
# Author: Davide Corio <davide.corio@abstract.it>
# Copyright 2015 Lorenzo Battistini - Agile Business Group
#
# This program is free software: you ... | agpl-3.0 | Python |
520f044aa8cfd992c88388dbcf4203b6f71d0378 | Refactor DB session logic | owtf/owtf,owtf/owtf,owtf/owtf,owtf/owtf,owtf/owtf | owtf/db/session.py | owtf/db/session.py | """
owtf.db.session
~~~~~~~~~~~~~~~
This file handles all the database transactions.
"""
import functools
import sys
import logging
from sqlalchemy import create_engine, exc, func
from sqlalchemy.orm import scoped_session, sessionmaker
from owtf.db.model_base import Model
from owtf.settings import DATABASE_IP, DATAB... | """
owtf.db.session
~~~~~~~~~~~~~~~
This file handles all the database transactions.
"""
import functools
import sys
import logging
from sqlalchemy import create_engine, exc, func
from sqlalchemy.orm import Session as _Session
from sqlalchemy.orm import sessionmaker
from owtf.db.model_base import Model
from owtf.set... | bsd-3-clause | Python |
228711f229d051477a53cbfa2444241054f46005 | Add some types | RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline | tests/rnacentral/precompute/helpers.py | tests/rnacentral/precompute/helpers.py | # -*- coding: utf-8 -*-
"""
Copyright [2009-2018] EMBL-European Bioinformatics Institute
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... | # -*- coding: utf-8 -*-
"""
Copyright [2009-2018] EMBL-European Bioinformatics Institute
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... | apache-2.0 | Python |
6434568074400035fbddc8c282e2c530ef511fec | add debug mode in manage.py | catatnight/docker-freeradius,catatnight/docker-freeradius,catatnight/docker-freeradius | v2/manage.py | v2/manage.py | #!/usr/bin/python
import argparse
import shlex
import subprocess
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
app_name = 'freeradius'
parser = argparse.ArgumentParser(description='Manage %s container' % app_name)
parser.add... | #!/usr/bin/python
import argparse
import shlex
import subprocess
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
app_name = 'freeradius'
parser = argparse.ArgumentParser(description='Manage %s container' % app_name)
parser.add... | mit | Python |
5758af2309c63c811c6792db9a8d37ae04c10e47 | use pass instead of empty return | jackjennings/unicodeset | unicodeset.py | unicodeset.py | __version__ = "0.1.0"
__all__ = ["UnicodeSet", "FrozenUnicodeSet"]
def _encode(iterable):
if iterable is None:
iterable = []
return [_encode_char(c) for c in iterable]
def _encode_char(char):
if isinstance(char, int):
try:
return unichr(char)
except Exception:
... | __version__ = "0.1.0"
__all__ = ["UnicodeSet", "FrozenUnicodeSet"]
def _encode(iterable):
if iterable is None:
iterable = []
return [_encode_char(c) for c in iterable]
def _encode_char(char):
if isinstance(char, int):
try:
return unichr(char)
except Exception:
... | mit | Python |
82800715df901329b91b9a799f8a612c00d048a4 | add a couple more tests | dit/dit,chebee7i/dit,Autoplectic/dit,dit/dit,chebee7i/dit,Autoplectic/dit,dit/dit,chebee7i/dit,dit/dit,dit/dit,Autoplectic/dit,Autoplectic/dit,chebee7i/dit,Autoplectic/dit | dit/tests/test_npscalardist.py | dit/tests/test_npscalardist.py | from __future__ import division
from nose.tools import assert_almost_equal, assert_equal, assert_raises, \
assert_true
from numpy.testing import assert_array_almost_equal
from dit import ScalarDistribution
from dit.exceptions import ditException, InvalidDistribution
def test_init1():
dist ... | from __future__ import division
from nose.tools import assert_equal, assert_raises, assert_true
from numpy.testing import assert_array_almost_equal
from dit import ScalarDistribution
from dit.exceptions import ditException, InvalidDistribution
def test_init1():
dist = {0: 1/2, 1: 1/2}
d = ScalarDistribution(... | bsd-3-clause | Python |
cf2f571a97474a948797f9ebd6cef2bbd71552c5 | use string formatting instead of the + operator | Uname-a/knife_scraper,Uname-a/knife_scraper,Uname-a/knife_scraper | willie/modules/ip.py | willie/modules/ip.py | # coding=utf-8
"""
ip.py - Willie IP Lookup Module
Copyright 2011, Dimitri Molenaars, TyRope.nl,
Copyright © 2013, Elad Alfassa <elad@fedoraproject.org>
Licensed under the Eiffel Forum License 2.
http://willie.dftba.net
"""
import re
import pygeoip
import socket
from willie.module import commands, example
@commands(... | # coding=utf-8
"""
ip.py - Willie IP Lookup Module
Copyright 2011, Dimitri Molenaars, TyRope.nl,
Copyright © 2013, Elad Alfassa <elad@fedoraproject.org>
Licensed under the Eiffel Forum License 2.
http://willie.dftba.net
"""
import re
import pygeoip
import socket
from willie.module import commands, example
@commands(... | mit | Python |
a1ff98ce3f0a714162e506a584fb3d6547e4e778 | Define hpd function to compute credibility value beta | nicholasmalaya/paleologos,nicholasmalaya/arcanus,nicholasmalaya/arcanus,nicholasmalaya/paleologos,nicholasmalaya/paleologos,nicholasmalaya/arcanus,nicholasmalaya/arcanus,nicholasmalaya/paleologos | uq/ps3/hpd.py | uq/ps3/hpd.py | #
#
#
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.mlab as mlab
from scipy.integrate import simps
from copy import copy
def hpd(x, pdf, obs):
""" Compute credibility interval (beta) """
assert (abs(simps(pdf,x) - 1.0) < 1e-12) , 'hpd(x, pdf, obs): pdf must integrate to 1'
assert (x[0] < o... | #
#
#
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.mlab as mlab
def hpd(pdf, obs):
""" Returns beta"""
beta = 0.0
return beta
#
# main function
#
if __name__ == '__main__':
mean = 0
variance = 1
sigma = np.sqrt(variance)
x = np.linspace(-3,3,100)
pdf ... | mit | Python |
4d3a0dc3b3b8a11a066f52bc78b1160e194ad64f | Add 'server-url' command line argument | csdms/wmt-exe,csdms/wmt-exe,csdms/wmt-exe,csdms/wmt-exe | wmtexe/cmd/script.py | wmtexe/cmd/script.py | """Launch a WMT simulation using `bash` or `qsub`."""
from __future__ import print_function
import sys
import os
from ..launcher import BashLauncher, QsubLauncher
_LAUNCHERS = {
'bash': BashLauncher,
'qsub': QsubLauncher,
}
def main():
import argparse
parser = argparse.ArgumentParser(description=... | """Launch a WMT simulation using `bash` or `qsub`."""
from __future__ import print_function
import sys
import os
from ..launcher import BashLauncher, QsubLauncher
_LAUNCHERS = {
'bash': BashLauncher,
'qsub': QsubLauncher,
}
def main():
import argparse
parser = argparse.ArgumentParser(description=... | mit | Python |
9a2cee73ac99fc3aa21a2550dedf83697cd83bd1 | Implement more TGT Neutral Commons | Meerkov/fireplace,NightKev/fireplace,jleclanche/fireplace,liujimj/fireplace,amw2104/fireplace,Ragowit/fireplace,smallnamespace/fireplace,amw2104/fireplace,oftc-ftw/fireplace,liujimj/fireplace,oftc-ftw/fireplace,beheh/fireplace,smallnamespace/fireplace,Ragowit/fireplace,Meerkov/fireplace | fireplace/cards/tgt/neutral_common.py | fireplace/cards/tgt/neutral_common.py | from ..utils import *
##
# Minions
# Lowly Squire
class AT_082:
inspire = Buff(SELF, "AT_082e")
# Dragonhawk Rider
class AT_083:
inspire = Buff(SELF, "AT_083e")
# Lance Carrier
class AT_084:
play = Buff(TARGET, "AT_084e")
# Maiden of the Lake
class AT_085:
update = Refresh(FRIENDLY_HERO_POWER, {GameTag.COS... | from ..utils import *
##
# Minions
# Lowly Squire
class AT_082:
inspire = Buff(SELF, "AT_082e")
# Lance Carrier
class AT_084:
play = Buff(TARGET, "AT_084e")
# Boneguard Lieutenant
class AT_089:
inspire = Buff(SELF, "AT_089e")
# Mukla's Champion
class AT_090:
inspire = Buff(FRIENDLY_MINIONS, "AT_090e")
# ... | agpl-3.0 | Python |
f5408c02202a07a1b45019eefb505eb8a0d21852 | Fix crash when URL is provided. | moigagoo/swagger2markdown | swagger2markdown.py | swagger2markdown.py | import argparse, json, os.path
import jinja2, requests
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"-i", "--input",
default="swagger.json",
help="path to or URL of the Swagger JSON file (default: swagger.json)",
metavar="SWAGGER_LOCATION"
)
par... | import argparse, json, os.path
import jinja2, requests
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"-i", "--input",
default="swagger.json",
help="path to or URL of the Swagger JSON file (default: swagger.json)",
metavar="SWAGGER_LOCATION"
)
par... | mit | Python |
f46e980341846ba1983cc22f8a948433d7b9b944 | use struct format | cyphar/devgibson,cyphar/devgibson | utils/parser.py | utils/parser.py | #!/usr/bin/env python2
import sys
with open(sys.argv[1], "rb") as f:
person = None
text = ""
for line in f:
if person is None and not line.startswith(" "*32):
# Not even start of dialogue
continue
if line.startswith(" "*32 + "("):
# Skip scene direction.
continue
if line.startswith(" "*32) and ... | #!/usr/bin/env python2
import sys
with open(sys.argv[1], "rb") as f:
person = None
text = ""
for line in f:
if person is None and not line.startswith(" "*32):
# Not even start of dialogue
continue
if line.startswith(" "*32 + "("):
# Skip scene direction.
continue
if line.startswith(" "*32) and ... | mit | Python |
0cd1401f8ddaaef56301940b4d81c2b626380389 | Bump version | TribeMedia/synapse,iot-factory/synapse,rzr/synapse,howethomas/synapse,howethomas/synapse,matrix-org/synapse,TribeMedia/synapse,matrix-org/synapse,illicitonion/synapse,iot-factory/synapse,iot-factory/synapse,rzr/synapse,TribeMedia/synapse,illicitonion/synapse,howethomas/synapse,matrix-org/synapse,iot-factory/synapse,rzr... | synapse/__init__.py | synapse/__init__.py | # -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# 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 applica... | # -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# 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 applica... | apache-2.0 | Python |
8de8babbd440e267acf86452e8529cd43261ce65 | Add Sentry support to cronjobs | leprikon-cz/leprikon,leprikon-cz/leprikon,leprikon-cz/leprikon,leprikon-cz/leprikon | leprikon/cronjobs.py | leprikon/cronjobs.py | from datetime import date
from itertools import chain
from django.conf import settings
from django.db.models import Q
from django_cron import CronJobBase, Schedule
from sentry_sdk import capture_exception
from .models.courses import CourseRegistration
from .models.events import EventRegistration
class SentryCronJob... | from datetime import date
from itertools import chain
from django.conf import settings
from django.db.models import Q
from django_cron import CronJobBase, Schedule
from .models.courses import CourseRegistration
from .models.events import EventRegistration
class SendPaymentRequest(CronJobBase):
schedule = Schedu... | bsd-3-clause | Python |
d0b7c60201d8558a0ee878c10e15f9dd3aa1e142 | print list of list as table | shashikiranrp/tabulate.py | tabulate/t_print.py | tabulate/t_print.py | #!/usr/bin/python
from model import Table
def t_print(table, \
table_name = None, \
footer_str = None, \
corner = '+', \
column_sep = '|', \
row_sep = '-', \
box_width = 0, \
col_width_adjust = 2, \
title_row_sep = '=', \
... | #!/usr/bin/python
def t_print(table, table_name = None, footer_str = None, corner = '+', column_sep = '|', row_sep = '-', box_width = 0, col_width_adjust = 2, title_row_sep = '=', show_col = False):
col_keys = table.column_keys()
# calulate max width per column
col_min_width_map = dict(((col, max(reduce(max, ta... | apache-2.0 | Python |
89ae791192a9fd289f5ec262c111a6b4e0b53083 | Add tests for echonest.models | FreeMusicNinja/freemusic.ninja,FreeMusicNinja/freemusic.ninja | django/echonest/tests.py | django/echonest/tests.py | import json
from unittest import TestCase
from mock import patch
from .models import SimilarResponse
class SimilarResponseModelTest(TestCase):
"""Tests for SimilarResponse model."""
def test_save(self):
name = "Brad Sucks"
similar_response = SimilarResponse(name=name)
with patch('e... | from django.test import TestCase
# Create your tests here.
| bsd-3-clause | Python |
75ae022a615d51850e5c8766b1a300207489559d | Increment version number to 0.3 | akx/django-jinja,glogiotatidis/django-jinja,niwinz/django-jinja,akx/django-jinja,glogiotatidis/django-jinja,akx/django-jinja,glogiotatidis/django-jinja,niwinz/django-jinja,niwinz/django-jinja,glogiotatidis/django-jinja,akx/django-jinja | django_jinja/__init__.py | django_jinja/__init__.py | # -*- coding: utf-8 -*-
__version__ = (0, 3, 0, 'final', 0)
| # -*- coding: utf-8 -*-
__version__ = (0, 2, 0, 'final', 0)
| bsd-3-clause | Python |
69595a9617ce83e04c5de5f4d8cd6185765f3697 | Increase size of category field. | mozilla/django-jobvite | django_jobvite/models.py | django_jobvite/models.py | from django.db import models
class Position(models.Model):
job_id = models.CharField(max_length=25, unique=True)
title = models.CharField(max_length=100)
requisition_id = models.PositiveIntegerField()
category = models.CharField(max_length=50)
job_type = models.CharField(max_length=10)
locatio... | from django.db import models
class Position(models.Model):
job_id = models.CharField(max_length=25, unique=True)
title = models.CharField(max_length=100)
requisition_id = models.PositiveIntegerField()
category = models.CharField(max_length=35)
job_type = models.CharField(max_length=10)
locatio... | bsd-3-clause | Python |
2feb86551602f072658007b477cb25f89ade54aa | add configurable value editable in settings | joke2k/django-options,joke2k/django-options | django_options/models.py | django_options/models.py | # -*- coding: utf-8 -*-s
from django.db import models
from django.utils.translation import ugettext as _
from django.contrib.sites.models import Site
from django.conf import settings
from picklefield import PickledObjectField
from .managers import OptionManager
VALUE_EDITABLE = getattr(settings, 'OPTION_VALUE_EDITABLE... | # -*- coding: utf-8 -*-s
from django.db import models
from django.utils.translation import ugettext as _
from django.contrib.sites.models import Site
from picklefield import PickledObjectField
from .managers import OptionManager
class Option(models.Model):
site = models.ForeignKey(Site, related_name='options',
... | bsd-3-clause | Python |
357699f0b72c234b8a23731bba90b841cd7ba02e | Test fix. | jperelli/django-settings,jrutila/django-settings,jperelli/django-settings,jperelli/django-settings,jrutila/django-settings,jperelli/django-settings,jrutila/django-settings,jrutila/django-settings | django_settings/tests.py | django_settings/tests.py | # -*- coding: utf-8 -*-
from django.conf import settings
from django.test import TestCase
from django_settings.models import Setting
DJANGO_SETTINGS = settings.DJANGO_SETTINGS
class SettingDefaults(TestCase):
def test_settings(self):
"""Test assumes that a properly formatted DJANGO_SETTINGS dict is in y... | # -*- coding: utf-8 -*-
from django.conf import settings
from django.test import TestCase
from django_settings.models import Setting
DJANGO_SETTINGS = settings.DJANGO_SETTINGS
class SettingDefaults(TestCase):
def test_default_settings(self):
"""
Test assuemes that following dict is in your sett... | bsd-3-clause | Python |
c02cf5abf2e86bbb6fbf69d7ce202a8fa621ffd7 | Fix deploy command docstring | alphagov/digitalmarketplace-aws,alphagov/digitalmarketplace-aws,alphagov/digitalmarketplace-aws | dmaws/commands/deploy.py | dmaws/commands/deploy.py | import sys
import click
from ..cli import cli_command
from ..stacks import StackPlan
from ..build import get_application_name
@click.argument('repository_path', nargs=1, type=click.Path(exists=True))
@cli_command('deploy', max_apps=0)
def deploy_cmd(ctx, repository_path):
"""Deploy a new application version to ... | import sys
import click
from ..cli import cli_command
from ..stacks import StackPlan
from ..build import get_application_name
@click.argument('repository_path', nargs=1, type=click.Path(exists=True))
@cli_command('deploy', max_apps=0)
def deploy_cmd(ctx, repository_path):
"""Deploy a new application version to ... | mit | Python |
0fb47a91d7d61732e8873a46f2410977aa619e37 | Bump version number. | playpauseandstop/tddspry,playpauseandstop/tddspry | tddspry/__init__.py | tddspry/__init__.py | """
``tddspry`` provides ``NoseTestCase`` class to base functional testing.
.. autoclass :: tddspry.NoseTestCase
:members:
"""
from tddspry.cases import *
VERSION = (0, 4, 'beta')
def get_version():
"""
Returns human-readable version of your **tddspry** installation.
"""
intjoin = lambda data,... | """
``tddspry`` provides ``NoseTestCase`` class to base functional testing.
.. autoclass :: tddspry.NoseTestCase
:members:
"""
from tddspry.cases import *
VERSION = (0, 4, 'alpha')
def get_version():
"""
Returns human-readable version of your **tddspry** installation.
"""
intjoin = lambda data... | bsd-3-clause | Python |
2117f8f54b4f52a3f298f0d5fb5d6b00829855c2 | Update to v1.19.1 | LonamiWebs/Telethon,LonamiWebs/Telethon,LonamiWebs/Telethon,LonamiWebs/Telethon | telethon/version.py | telethon/version.py | # Versions should comply with PEP440.
# This line is parsed in setup.py:
__version__ = '1.19.1'
| # Versions should comply with PEP440.
# This line is parsed in setup.py:
__version__ = '1.19.0'
| mit | Python |
025326590e081b703829f4141bacc79f28947f35 | Fix typo | andychu/webpipe,andychu/webpipe,andychu/webpipe,andychu/webpipe,andychu/webpipe | webpipe/recv.py | webpipe/recv.py | #!/usr/bin/python
"""
recv.py
Receive file contents from stdin, write to the base directory, and print
filename on stdout.
A main use case is to emulate the print-events (inotifywait) interface, but
on a remote machine. webpipe send takes the filename stdin, the file is
transferred from remote to local, and webpipe ... | #!/usr/bin/python
"""
recv.py
Receive file contents from stdin, write to the base directory, and print
filename on stdout.
A main use case is to emulate the print-events (inotifywait) interface, but
on a remote machine. webpipe send takes the filename stdin, the file is
transferred from remote to local, and webpipe ... | bsd-3-clause | Python |
3a41b304ca7a5e66aaa6880418dfdf5bf812f69a | Remove vim header from source files | idegtiarov/ceilometer,ityaptin/ceilometer,openstack/ceilometer,ityaptin/ceilometer,idegtiarov/ceilometer,openstack/ceilometer | ceilometer/tests/unit/api/test_app.py | ceilometer/tests/unit/api/test_app.py | # Copyright 2014 IBM Corp.
# 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 app... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 IBM Corp.
# 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/licen... | apache-2.0 | Python |
a559246cc8cda6462ebc70b5cdf60874dc10ce55 | Update .vocab -> .counts in word2vec. | knub/master-thesis,knub/master-thesis,knub/master-thesis,knub/master-thesis | code/python/knub/thesis/word2vec.py | code/python/knub/thesis/word2vec.py | import argparse
import codecs
import logging
from gensim.models import Word2Vec
from gensim.models.phrases import Phrases
from gensim.models.word2vec import LineSentence
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
def bigrams():
logging.info("Training bigrams")
... | import argparse
import codecs
import logging
from gensim.models import Word2Vec
from gensim.models.phrases import Phrases
from gensim.models.word2vec import LineSentence
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
def bigrams():
logging.info("Training bigrams")
... | apache-2.0 | Python |
5655875749f963aa4f54830a37b0f499bf21e9f4 | fix duplicate arg | planetlabs/color_balance,planetlabs/color_balance | color_balance/histogram_distance.py | color_balance/histogram_distance.py |
import numpy as np
from color_balance import colorimage as ci
def image_distances(distance_function, image1, image2):
"""
Measures the distance between the histogram of corresponding bands in
two images.
"""
shape1 = image1.shape
shape2 = image2.shape
assert shape1[2] == shape2[... |
import numpy as np
from color_balance import colorimage as ci
def image_distances(distance_function, image1, image2):
"""
Measures the distance between the histogram of corresponding bands in
two images.
"""
shape1 = image1.shape
shape2 = image2.shape
assert shape1[2] == shape2[... | apache-2.0 | Python |
033f90b9c42835e1b97eddceb4d9203faee7a04f | add exception to log package | tsuru/hm | hm/log.py | hm/log.py | # Copyright 2014 hm authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import logging
_log = logging.getLogger('tsuru.hm')
def debug(*args):
_log.debug(*args)
def error(*args):
_log.error(*args)
def exception(*args):
_... | # Copyright 2014 hm authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import logging
_log = logging.getLogger('tsuru.hm')
def debug(*args):
_log.debug(*args)
def error(*args):
_log.error(*args)
def set_handler(handler):
... | bsd-3-clause | Python |
62d64762f0115c64006c9e3eb492e9d39d903e49 | Bump to 0.3 version as next version is not backward compatible | totem/cluster-deployer,totem/cluster-deployer,totem/cluster-deployer | deployer/__init__.py | deployer/__init__.py | from __future__ import absolute_import
import deployer.logger
from celery.signals import setup_logging
__version__ = '0.3'
__author__ = 'sukrit'
deployer.logger.init_logging('root')
setup_logging.connect(deployer.logger.init_celery_logging)
| from __future__ import absolute_import
import deployer.logger
from celery.signals import setup_logging
__version__ = '0.2.3'
__author__ = 'sukrit'
deployer.logger.init_logging('root')
setup_logging.connect(deployer.logger.init_celery_logging)
| mit | Python |
adbb8673dd2d63f14b1f049e8186af263a5927e5 | Fix default command option of dodo docker | mnieber/dodo_commands | dodo_commands/extra/standard_commands/docker.py | dodo_commands/extra/standard_commands/docker.py | from argparse import ArgumentParser
from dodo_commands.framework import Dodo
from dodo_commands.extra.standard_commands.decorators.docker import (
Decorator as DockerDecorator
)
def _args():
parser = ArgumentParser(
description='Opens a bash shell in the docker container.'
)
parser.add_argumen... | from argparse import ArgumentParser
from dodo_commands.framework import Dodo
from dodo_commands.extra.standard_commands.decorators.docker import (
Decorator as DockerDecorator
)
def _args():
parser = ArgumentParser(
description='Opens a bash shell in the docker container.'
)
parser.add_argumen... | mit | Python |
1cb837b2627ffb83f6aba12b5ac936385924434b | update tests to v1.1.0 (#1293) | jmluy/xpython,jmluy/xpython,behrtam/xpython,N-Parsons/exercism-python,smalley/python,smalley/python,exercism/xpython,N-Parsons/exercism-python,exercism/xpython,exercism/python,behrtam/xpython,exercism/python | exercises/scrabble-score/scrabble_score_test.py | exercises/scrabble-score/scrabble_score_test.py | import unittest
from scrabble_score import score
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
class WordTest(unittest.TestCase):
def test_lowercase_letter(self):
self.assertEqual(score("a"), 1)
def test_uppercase_letter(self):
self.assertEqual(score("A"), 1)
... | import unittest
from scrabble_score import score
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0
class WordTest(unittest.TestCase):
def test_lowercase_letter(self):
self.assertEqual(score("a"), 1)
def test_uppercase_letter(self):
self.assertEqual(score("A"), 1)
... | mit | Python |
e1a7112d861be08458d5f07e52ea74f7423635cc | test cases for contacts | saurabh6790/frappe,vjFaLk/frappe,almeidapaulopt/frappe,almeidapaulopt/frappe,adityahase/frappe,frappe/frappe,adityahase/frappe,saurabh6790/frappe,adityahase/frappe,saurabh6790/frappe,mhbu50/frappe,almeidapaulopt/frappe,StrellaGroup/frappe,vjFaLk/frappe,vjFaLk/frappe,frappe/frappe,yashodhank/frappe,yashodhank/frappe,vjF... | frappe/contacts/doctype/contact/test_contact.py | frappe/contacts/doctype/contact/test_contact.py | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.exceptions import ValidationError
class TestContact(unittest.TestCase):
def test_check_default_email(self):
emails = [
{"email":... | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.exceptions import ValidationError
class TestContact(unittest.TestCase):
def test_check_default_email(self):
emails = [
{"email":... | mit | Python |
ec2478509ee91616b77b253a4391125795a36606 | fix flake8 errors | JTFouquier/ghost-tree,pombredanne/ghost-tree | ghosttree/silva/filter.py | ghosttree/silva/filter.py | import skbio
def fungi_from_fasta(fasta_fh, accession_fh, taxonomy_fh):
"""Filter SILVA sequences to keep only fungi.
Filters a fasta file of aligned or unaligned sequences to include only
fungi. Only keeps sequences that have accession numbers that can be mapped
to a fungal taxonomy string that ends... | import skbio
def fungi_from_fasta(fasta_fh, accession_fh, taxonomy_fh):
"""Filter SILVA sequences to keep only fungi.
Filters a fasta file of aligned or unaligned sequences to include only
fungi. Only keeps sequences that have accession numbers that can be mapped
to a fungal taxonomy string that ends... | bsd-3-clause | Python |
a352a0e5936b10ee9fce4184c0f41e751522f206 | Add girder_jobs to setup.py | OpenChemistry/mongochemserver | girder/molecules/setup.py | girder/molecules/setup.py | from setuptools import setup, find_packages
setup(
name='openchemistry-molecules',
version='0.1.0',
description='Molecular data, containers and RESTful API.',
packages=find_packages(),
install_requires=[
'girder>=3.0.0a5',
'girder_jobs',
'jsonpath-rw==1.4.0',
'avogadro==1.92... | from setuptools import setup, find_packages
setup(
name='openchemistry-molecules',
version='0.1.0',
description='Molecular data, containers and RESTful API.',
packages=find_packages(),
install_requires=[
'girder>=3.0.0a5',
'jsonpath-rw==1.4.0',
'avogadro==1.92.1',
'openbabel... | bsd-3-clause | Python |
87083950cc3906d6a5cd66292078d3ee8b182bdf | Fix a bug that would prevent Groups being displayed in the admin | martinogden/djangae,SiPiggles/djangae,armirusco/djangae,chargrizzle/djangae,chargrizzle/djangae,grzes/djangae,leekchan/djangae,wangjun/djangae,nealedj/djangae,kirberich/djangae,grzes/djangae,armirusco/djangae,asendecka/djangae,trik/djangae,martinogden/djangae,stucox/djangae,kirberich/djangae,stucox/djangae,chargrizzle/... | djangae/contrib/gauth/admin.py | djangae/contrib/gauth/admin.py | from django.contrib import admin
from django.contrib.auth import get_user_model
# DJANGAE
from djangae.contrib.gauth.models import (
GaeUser,
GaeDatastoreUser,
Group,
PermissionsMixin,
)
user_model = get_user_model()
# Only register the user model with the admin if it is a Djangae model. If a differ... | from django.contrib import admin
from django.contrib.auth import get_user_model
# DJANGAE
from djangae.contrib.gauth.models import (
GaeUser,
GaeDatastoreUser,
Group,
PermissionsMixin,
)
user_model = get_user_model()
# Only register the user model with the admin if it is a Djangae model. If a differ... | bsd-3-clause | Python |
9045b8e7f87e8ab627078f362d24121d7b0f3f61 | fix run_tests.py using installed_solvers | hoburg/gpfit,convexopt/gpfit,hoburg/gpfit,hoburg/gpfit,convexopt/gpfit,convexopt/gpfit | gpfit/tests/t_examples.py | gpfit/tests/t_examples.py | "Unit testing of tests in docs/source/examples"
import unittest
import os
from gpkit.tests.helpers import generate_example_tests
from gpkit import settings
class TestExamples(unittest.TestCase):
"""
To test a new example, add a function called `test_$EXAMPLENAME`, where
$EXAMPLENAME is the name of your ex... | "Unit testing of tests in docs/source/examples"
import unittest
import os
from gpkit.tests.helpers import generate_example_tests
class TestExamples(unittest.TestCase):
"""
To test a new example, add a function called `test_$EXAMPLENAME`, where
$EXAMPLENAME is the name of your example in docs/source/exampl... | mit | Python |
ac78be39f59b7a12fa1145654ba04126cc4603ca | fix for new API | ddwo/nhl-bot,Jeebeevee/DouweBot,Teino1978-Corp/Teino1978-Corp-skybot,isislab/botbot,andyeff/skybot,craisins/nascarbot,TeamPeggle/ppp-helpdesk,crisisking/skybot,jmgao/skybot,df-5/skybot,parkrrr/skybot,cmarguel/skybot,olslash/skybot,elitan/mybot,craisins/wh2kbot,rmmh/skybot,Jeebeevee/DouweBot_JJ15,SophosBlitz/glacon,call... | plugins/suggest.py | plugins/suggest.py | import random
import re
from util import hook, http
@hook.command
def suggest(inp, inp_unstripped=None):
".suggest [#n] <phrase> -- gets a random/the nth suggested google search"
if inp_unstripped is not None:
inp = inp_unstripped
m = re.match('^#(\d+) (.+)$', inp)
num = 0
if m:
... | import json
import random
import re
from util import hook, http
@hook.command
def suggest(inp, inp_unstripped=''):
".suggest [#n] <phrase> -- gets a random/the nth suggested google search"
inp = inp_unstripped
m = re.match('^#(\d+) (.+)$', inp)
if m:
num, inp = m.groups()
num = int(n... | unlicense | Python |
c9f729c813d87be95c2e7b8437cc323f0ca49089 | Add icecream parlour solution | lemming52/white_pawn,lemming52/white_pawn | hackerrank/queueTwoStacks/solution.py | hackerrank/queueTwoStacks/solution.py | """
A queue is an abstract data type that maintains the order in which elements were added to it, allowing the oldest elements to be removed from the front and new elements to be added to the rear. This is called a First-In-First-Out (FIFO) data structure because the first element added to the queue (i.e., the one tha... | """
A queue is an abstract data type that maintains the order in which elements were added to it, allowing the oldest elements to be removed from the front and new elements to be added to the rear. This is called a First-In-First-Out (FIFO) data structure because the first element added to the queue (i.e., the one tha... | mit | Python |
2715c9accc8e8abaad72cd9afcec914dda0c6b46 | Fix travis error with SQLITE_LIMIT_VARIABLE_NUMBER | Kynarth/pokediadb | pokediadb/utils.py | pokediadb/utils.py | import sqlite3
def max_sql_variables():
"""Get the maximum number of arguments allowed in a query by the current
sqlite3 implementation.
Returns:
int: SQLITE_MAX_VARIABLE_NUMBER
"""
db = sqlite3.connect(':memory:')
cur = db.cursor()
cur.execute('CREATE TABLE t (test)')
low, h... | import sqlite3
def max_sql_variables():
"""Get the maximum number of arguments allowed in a query by the current
sqlite3 implementation.
Returns:
int: SQLITE_MAX_VARIABLE_NUMBER
"""
db = sqlite3.connect(':memory:')
cur = db.cursor()
cur.execute('CREATE TABLE t (test)')
low, h... | mit | Python |
7ee3999c65d7e5754380ff857c7e16d44117bad1 | Bump version 0.0.6 | portfoliome/postpy | postpy/_version.py | postpy/_version.py | version_info = (0, 0, 6)
__version__ = '.'.join(map(str, version_info))
| version_info = (0, 0, 5)
__version__ = '.'.join(map(str, version_info))
| mit | Python |
9a49111fb1130f316f57fd421773e3ab51a9a258 | remove a bug in GS call create | artreven/pp_api | pp_api/gs_calls.py | pp_api/gs_calls.py | from requests.exceptions import HTTPError
from pp_api import utils as u
def create(id_, title, author, server, auth_data=None, session=None, **kwargs):
suffix = '/GraphSearch/api/content/create'
data = {
'identifier': id_,
'title': title,
'author': author
}
data.update(kwargs)... | from requests.exceptions import HTTPError
from pp_api import utils as u
def create(id_, title, author, server, auth_data=None, session=None, **kwargs):
suffix = '/GraphSearch/api/content/create'
data = {
'identifier': id_,
'title': title,
'author': author,
'facets': {"dyn_txt_... | mit | Python |
afcac79e5559ba2613da48717c9fe07d6ba45ace | Update header | Axostic/Collections | src/Tables.py | src/Tables.py | import sys
from prettytable import from_csv
# This file uses a third party library. PrettyTable: Display data in tables using a beautiful ASCII format.
# Thank you luke@maurits.id.au (code.google.com) for providing the prettytable library.
# TODO: Add filter functionality (ex. filter search engines with genre: google... | import sys
from prettytable import from_csv
# This file uses a third party library. PrettyTable: Display data in tables using a beautiful ASCII format.
# Thank you luke@maurits.id.au (code.google.com) for providing the prettytable library.
# TODO: Add filter functionality (ex. filter search engines with genre: google... | mit | Python |
23041af2568ce6ed2e49b10c462a917ccce39930 | Remove commented out main | owainkenwayucl/utils,owainkenwayucl/utils,owainkenwayucl/utils | src/addate.py | src/addate.py | #!/usr/bin/env python3
# This short program converts AD dates into real dates.
# "The Active Directory stores date/time values as the number of 100-nanosecond
# intervals that have elapsed since the 0 hour on January 1, 1601 until the
# date/time that is being stored. The time is always stored in Greenwich Mean
# ... | #!/usr/bin/env python3
# This short program converts AD dates into real dates.
# "The Active Directory stores date/time values as the number of 100-nanosecond
# intervals that have elapsed since the 0 hour on January 1, 1601 until the
# date/time that is being stored. The time is always stored in Greenwich Mean
# ... | mit | Python |
42415481c7087559cb4f2f829eb1745781b54cf7 | Change db set up | iwi/linkatos,iwi/linkatos | linkatos/firebase.py | linkatos/firebase.py | import pyrebase
def initialise(api_key, project_name):
config = {
"apiKey": api_key,
"authDomain": "{}.firebaseapp.com".format(project_name),
"databaseURL": "https://{}.firebaseio.com".format(project_name),
"storageBucket": "{}.appspot.com".format(project_name),
}
return pyrebase.... | import pyrebase
def initialise(api_key, project_name):
config = {
"apiKey": api_key,
"authDomain": "{}.firebaseapp.com".format(project_name),
"databaseURL": "https://{}.firebaseio.com".format(project_name),
"storageBucket": "{}.appspot.com".format(project_name),
}
return pyrebase.... | mit | Python |
d9b378f8c202de0149b7d51a6a35c9551c5b1379 | Sort agent counts by date when showing graph | pyfarm/pyfarm-master,pyfarm/pyfarm-master,pyfarm/pyfarm-master | pyfarm/master/user_interface/statistics/agent_counts.py | pyfarm/master/user_interface/statistics/agent_counts.py | # No shebang line, this module is meant to be imported
#
# Copyright 2015 Ambient Entertainment GmbH & Co. KG
#
# 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/lice... | # No shebang line, this module is meant to be imported
#
# Copyright 2015 Ambient Entertainment GmbH & Co. KG
#
# 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/lice... | apache-2.0 | Python |
b7a806882f1d3ce23b7d835f914ab0911f41e7b6 | Fix remaining module caps. | synapse-wireless/pyduino-includes | pyduinoincludes/__init__.py | pyduinoincludes/__init__.py | from io import *
| from IO import *
| apache-2.0 | Python |
3c3d5f2a112e411bd3749a24290fe09362fe5c31 | Fix issues with allergies plugin | jk0/pyhole,jk0/pyhole,jk0/pyhole | pyhole/plugins/allergies.py | pyhole/plugins/allergies.py | # Copyright 2010-2012 Josh Kearney
#
# 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 agre... | # Copyright 2010-2012 Josh Kearney
#
# 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 agre... | apache-2.0 | Python |
0b808a136e952e2e47149f2cfd2881b31fa1e7d3 | Add time competence for menu select | weshack/FoodyCall,weshack/FoodyCall,barca/FoodyCall,barca/FoodyCall,barca/FoodyCall | FoodyCall/lib/menu/menu.py | FoodyCall/lib/menu/menu.py | from flask import Blueprint
from flask import json
from flask import jsonify
from flask import make_response
from flask import request
from pymongo import MongoClient
import csv
import sys
from datetime import datetime
# Create Blueprint
menu = Blueprint('menu', __name__, template_folder='templates')
# Initialize co... | from flask import Blueprint
from flask import json
from flask import jsonify
from flask import make_response
from flask import request
from pymongo import MongoClient
import csv
# Create Blueprint
menu = Blueprint('menu', __name__, template_folder='templates')
# Initialize connection with mongo :^)
# This connects ... | mit | Python |
74e7562ba75a2a635ee4ce393d7aed8dd2bbbaee | remove unnecessary files | philanthropy-u/edx-platform,philanthropy-u/edx-platform,philanthropy-u/edx-platform,philanthropy-u/edx-platform | common/lib/discovery_client/client.py | common/lib/discovery_client/client.py | """Client to communicate with discovery service from lms"""
import json
import logging
from django.conf import settings
from django.core.exceptions import PermissionDenied, ValidationError
from django.http import Http404
from django.shortcuts import get_object_or_404
from edx_rest_api_client.client import OAuthAPICli... | """Client to communicate with discovery service from lms"""
import json
import logging
from django.conf import settings
from django.core.exceptions import PermissionDenied, ValidationError
from django.http import Http404
from django.shortcuts import get_object_or_404
from edx_rest_api_client.client import OAuthAPICli... | agpl-3.0 | Python |
ad5a7fce36ceb29e9bd3d48be51634f094e95e32 | add a line register function to overwrite default value of profile | PNNutkung/Coursing-Field,PNNutkung/Coursing-Field,PNNutkung/Coursing-Field | mockaccount/views.py | mockaccount/views.py | from django.shortcuts import render, redirect
from django.contrib.auth.models import User
import django.contrib.auth as auth
from mainmodels.models import Profile
from django.urls import reverse
from datetime import datetime
# Create your views here.
def index(request):
if request.user.is_authenticated:
us... | from django.shortcuts import render, redirect
from django.contrib.auth.models import User
import django.contrib.auth as auth
from mainmodels.models import Profile
from django.urls import reverse
from datetime import datetime
# Create your views here.
def index(request):
if request.user.is_authenticated:
us... | apache-2.0 | Python |
da0478a48329ac79092a4603f4026434af26f032 | Use multi arg option too | yourcelf/btb,yourcelf/btb,yourcelf/btb,yourcelf/btb,yourcelf/btb | scanblog/scanning/management/commands/fixuploadperms.py | scanblog/scanning/management/commands/fixuploadperms.py | import os
from django.core.management.base import BaseCommand
from django.conf import settings
class Command(BaseCommand):
args = ''
help = "Set all permissions in the uploads directory for deploy."
def handle(self, *args, **kwargs):
for dirname in (os.path.join(settings.MEDIA_ROOT, settings.UPLO... | import os
from django.core.management.base import BaseCommand
from django.conf import settings
class Command(BaseCommand):
args = ''
help = "Set all permissions in the uploads directory for deploy."
def handle(self, *args, **kwargs):
for dirname in (os.path.join(settings.MEDIA_ROOT, settings.UPLO... | agpl-3.0 | Python |
c5bb523d19ef73eddbf7c1ebe97d91b051cc0bcf | Update __init__.py | kajic/django-model-changes | django_model_changes/__init__.py | django_model_changes/__init__.py | from .changes import ChangesMixin
from .signals import post_change
| from changes import ChangesMixin
from signals import post_change
| mit | Python |
a7cb6f4d0beaf52057b247e1335e2d17bd5a4969 | Fix test code | truongdq/chainer,jnishi/chainer,hvy/chainer,niboshi/chainer,niboshi/chainer,ronekko/chainer,okuta/chainer,keisuke-umezawa/chainer,chainer/chainer,hvy/chainer,cupy/cupy,niboshi/chainer,okuta/chainer,ktnyt/chainer,AlpacaDB/chainer,ysekky/chainer,kashif/chainer,anaruse/chainer,ktnyt/chainer,muupan/chainer,delta2323/chaine... | tests/chainer_tests/functions_tests/array_tests/test_getitem.py | tests/chainer_tests/functions_tests/array_tests/test_getitem.py | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
class TestGetItem(unittest.TestCase):
in_shape = (10, 5)
out_shape = (10,)
def setUp(self):
self.x_d... | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer.testing import attr
class TestGetItem(unittest.TestCase):
in_shape = (10, 5)
out_shape = (10,)
def setUp(self):
self.x_data = numpy.random.uniform(
... | mit | Python |
da88e347f7e1b828f6ebee2753117c666f4dd97d | Update __init__.py | disconnect3d/pwndbg,disconnect3d/pwndbg,chubbymaggie/pwndbg,anthraxx/pwndbg,disconnect3d/pwndbg,0xddaa/pwndbg,0xddaa/pwndbg,anthraxx/pwndbg,pwndbg/pwndbg,cebrusfs/217gdb,anthraxx/pwndbg,zachriggle/pwndbg,chubbymaggie/pwndbg,bj7/pwndbg,anthraxx/pwndbg,zachriggle/pwndbg,cebrusfs/217gdb,pwndbg/pwndbg,pwndbg/pwndbg,pwndbg/... | pwndbg/__init__.py | pwndbg/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import gdb
import pwndbg.arch
import pwndbg.arguments
import pwndbg.disasm
import pwndbg.disasm.arm
import pwndbg.disasm.jump
import pwndbg.disasm.mips
import pwndbg.disasm.ppc
import pwndbg.disasm.sparc
import pwndbg.disasm.x86
import pwndbg.vmmap
import pwndbg.dt
import ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import gdb
import pwndbg.arch
import pwndbg.arguments
import pwndbg.disasm
import pwndbg.disasm.arm
import pwndbg.disasm.jump
import pwndbg.disasm.mips
import pwndbg.disasm.ppc
import pwndbg.disasm.sparc
import pwndbg.disasm.x86
import pwndbg.vmmap
import pwndbg.dt
import ... | mit | Python |
7fba5b2541300b76cea8c8932097a353d2d5a688 | Remove unused imports | Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3 | geoportal/geoportailv3_geoportal/lib/lux_authentication.py | geoportal/geoportailv3_geoportal/lib/lux_authentication.py | from pyramid.authentication import BasicAuthAuthenticationPolicy, AuthTktAuthenticationPolicy
from pyramid_multiauth import MultiAuthenticationPolicy
from pyramid.interfaces import IAuthenticationPolicy
from c2cgeoportal_geoportal.resources import defaultgroupsfinder
from zope.interface import implementer
import log... | from pyramid.authentication import CallbackAuthenticationPolicy, AuthTktCookieHelper, \
BasicAuthAuthenticationPolicy, AuthTktAuthenticationPolicy
from pyramid_multiauth import MultiAuthenticationPolicy
from pyramid.interfaces import IAuthenticationPolicy
from c2cgeoportal_geoportal.resources import defaultgroups... | mit | Python |
1899e7d999a1d249dc3f7bb9a413518dd65ca918 | add class insertion | doc212/theros,doc212/theros,doc212/theros,doc212/theros,doc212/theros | import.py | import.py | #!/usr/bin/env python
"""
A script to import initial data from ProEco into Theros
"""
import logging
import argparse
import sys
import re
parser=argparse.ArgumentParser(description=__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("worksFile", help="the csv file containing the raw w... | #!/usr/bin/env python
"""
A script to import initial data from ProEco into Theros
"""
import logging
import argparse
import sys
import re
parser=argparse.ArgumentParser(description=__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("worksFile", help="the csv file containing the raw w... | mit | Python |
f23a136d83ca01066faa43c60ed33638d6a56f53 | Update AWS ParallelCluster to 2.5.1 (#14571) | LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/aws-parallelcluster/package.py | var/spack/repos/builtin/packages/aws-parallelcluster/package.py | # Copyright 2013-2020 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 AwsParallelcluster(PythonPackage):
"""AWS ParallelCluster is an AWS supported Open Source ... | # Copyright 2013-2020 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 AwsParallelcluster(PythonPackage):
"""AWS ParallelCluster is an AWS supported Open Source ... | lgpl-2.1 | Python |
c67432780d30bbb278ab681c4292af5f1e5fdd29 | Add TODO | israelg99/eva | models/pixelcnn.py | models/pixelcnn.py | from keras.models import Model
from keras.layers import Input, Convolution2D, Activation, Flatten, Dense
from keras.layers.advanced_activations import PReLU
from keras.optimizers import Nadam
from eva.models.residual_block import ResidualBlockList
from eva.layers.masked_convolution2d import MaskedConvolution2D
def Pi... | from keras.models import Model
from keras.layers import Input, Convolution2D, Activation, Flatten, Dense
from keras.layers.advanced_activations import PReLU
from keras.optimizers import Nadam
from eva.models.residual_block import ResidualBlockList
from eva.layers.masked_convolution2d import MaskedConvolution2D
def Pi... | apache-2.0 | Python |
b817ee79a3ca680565d6cf3e158d924197a86cc3 | use SELECT RSTREAM LIMIT syntax in peeker | kmaehashi/sensorbee-python | pysensorbee/tools/peeker.py | pysensorbee/tools/peeker.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
class Peeker(object):
def __init__(self, api):
self._api = api
def peek(self, topology, stream, count):
limit = ''
if count != 0:
limit = '[LIMIT {0}]'.format(count)... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
class Peeker(object):
def __init__(self, api):
self._api = api
def peek(self, topology, stream, count):
query = 'SELECT RSTREAM * FROM {0} [RANGE 1 TUPLES];'.format(stream)
rece... | mit | Python |
3f07c6cc7868a753408c90d5dd2ffbed861d88cb | put plugin before conftest in fixture lookup | krya/pydjango | pydjango/plugin.py | pydjango/plugin.py | """A py.test plugin which helps testing Django applications
This plugin handles creating and destroying the test environment and
test database and provides some useful text fixtues.
"""
import os
import pytest
try:
from django.conf import ENVIRONMENT_VARIABLE, settings
DJANGO_INSTALLED = True
except ImportE... | """A py.test plugin which helps testing Django applications
This plugin handles creating and destroying the test environment and
test database and provides some useful text fixtues.
"""
import os
import pytest
try:
from django.conf import ENVIRONMENT_VARIABLE, settings
DJANGO_INSTALLED = True
except ImportE... | mit | Python |
15ab4f01dc8b1ecb5a8a32da6b12c6a7a9919719 | add rotation_matrix to public interface | nschloe/python4gmsh | pygmsh/__init__.py | pygmsh/__init__.py | # -*- coding: utf-8 -*-
#
from __future__ import print_function
from .__about__ import __version__, __author__, __author_email__, __website__
from . import built_in
from . import opencascade
from .helpers import generate_mesh, get_gmsh_major_version, rotation_matrix
__all__ = [
"built_in",
"opencascade",
... | # -*- coding: utf-8 -*-
#
from __future__ import print_function
from .__about__ import __version__, __author__, __author_email__, __website__
from . import built_in
from . import opencascade
from .helpers import generate_mesh, get_gmsh_major_version
__all__ = [
"built_in",
"opencascade",
"generate_mesh",... | bsd-3-clause | Python |
b74ddc02c4314bb7806b9399c4ef66d9c6a89f39 | update version to sync with pypi. | alejandroautalan/pygubu,alejandroautalan/pygubu | pygubu/__init__.py | pygubu/__init__.py | # encoding: utf-8
__all__ = [
"Builder",
"TkApplication",
"BuilderObject",
"register_widget",
"register_property",
"register_custom_property",
"remove_binding",
"ApplicationLevelBindManager",
]
import warnings
from pygubu.binding import ApplicationLevelBindManager, remove_binding
from... | # encoding: utf-8
__all__ = [
"Builder",
"TkApplication",
"BuilderObject",
"register_widget",
"register_property",
"register_custom_property",
"remove_binding",
"ApplicationLevelBindManager",
]
import warnings
from pygubu.binding import ApplicationLevelBindManager, remove_binding
from... | mit | Python |
5a653d0a6f0c97109254b043e9697675b5863218 | Set version back to dev | rigetticomputing/pyquil | pyquil/__init__.py | pyquil/__init__.py | __version__ = "2.0.0b2.dev0"
from pyquil.quil import Program
from pyquil.api import list_quantum_computers, get_qc
| __version__ = "2.0.0b1"
from pyquil.quil import Program
from pyquil.api import list_quantum_computers, get_qc
| apache-2.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.