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
3d1f56bd608aedb13517629d3878739bed62c67b
Fix the bidict tests
tom-mi/pyrad,GIC-de/pyrad
pyrad/tests/testBidict.py
pyrad/tests/testBidict.py
import operator import unittest from pyrad.bidict import BiDict class BiDictTests(unittest.TestCase): def setUp(self): self.bidict=BiDict() def testStartEmpty(self): self.assertEqual(len(self.bidict), 0) self.assertEqual(len(self.bidict.forward), 0) self.assertEqual(len(self....
import operator import unittest from pyrad.bidict import BiDict class BiDictTests(unittest.TestCase): def setUp(self): self.bidict=BiDict() def testStartEmpty(self): self.assertEqual(len(self.bidict), 0) self.assertEqual(len(self.bidict.forward), 0) self.assertEqual(len(self....
bsd-3-clause
Python
261328507e494683a33b74c3218788cb31cb4fab
update document __init__
mylokin/mongoext
mongoext/document.py
mongoext/document.py
from __future__ import absolute_import import mongoext.collection import mongoext.fields import mongoext.exc class MetaDocument(type): def __new__(cls, name, bases, attrs): fields = {} for base in bases: for attr, obj in vars(base).iteritems(): if issubclass(type(obj),...
from __future__ import absolute_import import mongoext.collection import mongoext.fields import mongoext.exc class MetaDocument(type): def __new__(cls, name, bases, attrs): fields = {} for base in bases: for attr, obj in vars(base).iteritems(): if issubclass(type(obj),...
mit
Python
06a8fdf72b2ad99797a60f282338d5a983e7dbcf
add ilb hc to tested resource count
apigee/terraform-modules,apigee/terraform-modules
tests/samples/test_ilb_mtls.py
tests/samples/test_ilb_mtls.py
# Copyright 2021 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, ...
# Copyright 2021 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, ...
apache-2.0
Python
94307da339d586aca85af975cbd49d6f46d35f8a
add security
iw3hxn/LibrERP,iw3hxn/LibrERP,iw3hxn/LibrERP,iw3hxn/LibrERP,iw3hxn/LibrERP
control_dashboard/__openerp__.py
control_dashboard/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # by Bortolatto Ivan (ivan.bortolatto at didotech.com) # Copyright (C) 2013 Didotech Inc. (<http://www.didotech.com>) # All Rights Reserved. # # WARNING: This program as such is intend...
# -*- coding: utf-8 -*- ############################################################################## # # by Bortolatto Ivan (ivan.bortolatto at didotech.com) # Copyright (C) 2013 Didotech Inc. (<http://www.didotech.com>) # All Rights Reserved. # # WARNING: This program as such is intend...
agpl-3.0
Python
8ae35fc63bd2cc7e6e07b68ace455147e1b2e1f1
clean code
Neurita/darwin
tests/test_binaryclassifier.py
tests/test_binaryclassifier.py
import numpy as np from sklearn import svm, datasets from darwin.pipeline import ClassificationPipeline def test_binary_classification_with_classification_pipeline(): # generate the dataset n_samples = 100 n_features = 20 x, y = datasets.make_gaussian_quantiles(mean=None, cov=1.0, n_samples=n_sample...
import numpy as np from sklearn import svm, datasets from darwin.pipeline import ClassificationPipeline def test_binary_classification_with_classification_pipeline(): # generate the dataset n_samples=100 n_features=20 x, y = datasets.make_gaussian_quantiles(mean=None, cov=1.0, n_samples=n_samples, ...
bsd-3-clause
Python
1036199d2d886d85cdf2c77477332d7f2f66f505
Handle rename
mcronce/rabbitmq_stats
rabbitmqStats/__init__.py
rabbitmqStats/__init__.py
from RabbitMQStats import *
from rabbitmqStats import *
mit
Python
e3f4b2f66e55c293c20296b8857adb46c93cd46d
fix cron cmd
teemuhirsikangas/magicaespeculo,teemuhirsikangas/magicaespeculo,teemuhirsikangas/magicaespeculo,teemuhirsikangas/magicaespeculo
scripts/send_waterleak.py
scripts/send_waterleak.py
#!/usr/bin/python #run this script on reboot, add it to the cron job #@reboot sudo nohup python /home/pi/magicaespeculo/scripts/send_waterleak.py > /dev/null 2>&1 import sys import RPi.GPIO as GPIO import time import datetime import schedule import paho.mqtt.publish as publish import json import requests import config ...
#!/usr/bin/python #run this script on reboot, add it to the cron job # nohup #@reboot sudo nohup python /home/pi/magicaespeculo/scripts/send_waterleak.py import sys import RPi.GPIO as GPIO import time import datetime import schedule import paho.mqtt.publish as publish import json import requests import config GPIO.set...
mit
Python
1dc1bb91fffd8175898ff920cc9497c7b45c912a
Make sure the `type hints` support is working for FastAPI
rollbar/pyrollbar
rollbar/test/test_fastapi.py
rollbar/test/test_fastapi.py
import sys try: from unittest import mock except ImportError: import mock import unittest2 from rollbar.test import BaseTest ALLOWED_PYTHON_VERSION = sys.version_info[0] >= 3 and sys.version_info[1] >= 6 @unittest2.skipUnless(ALLOWED_PYTHON_VERSION, "FastAPI requires Python3.6+") class FastAPIMiddlewareTe...
import sys try: from unittest import mock except ImportError: import mock import unittest2 from rollbar.test import BaseTest ALLOWED_PYTHON_VERSION = sys.version_info[0] >= 3 and sys.version_info[1] >= 6 @unittest2.skipUnless(ALLOWED_PYTHON_VERSION, "FastAPI requires Python3.6+") class FastAPIMiddlewareTe...
mit
Python
c3b1f8c97f89e5b9e8b8e74992631bac33bdde5f
Implement a test if read_user_choice raises on invalid options
lucius-feng/cookiecutter,foodszhang/cookiecutter,tylerdave/cookiecutter,atlassian/cookiecutter,kkujawinski/cookiecutter,Vauxoo/cookiecutter,sp1rs/cookiecutter,pjbull/cookiecutter,dajose/cookiecutter,benthomasson/cookiecutter,luzfcb/cookiecutter,stevepiercy/cookiecutter,luzfcb/cookiecutter,foodszhang/cookiecutter,vintas...
tests/test_read_user_choice.py
tests/test_read_user_choice.py
# -*- coding: utf-8 -*- import click import pytest from cookiecutter.compat import read_user_choice OPTIONS = ['hello', 'world', 'foo', 'bar'] EXPECTED_PROMPT = """Select varname: 1 - hello 2 - world 3 - foo 4 - bar Choose from 1, 2, 3, 4!""" @pytest.mark.parametrize('user_choice, expected_value', enumerate(OPTI...
# -*- coding: utf-8 -*- import click import pytest from cookiecutter.compat import read_user_choice OPTIONS = ['hello', 'world', 'foo', 'bar'] EXPECTED_PROMPT = """Select varname: 1 - hello 2 - world 3 - foo 4 - bar Choose from 1, 2, 3, 4!""" @pytest.mark.parametrize('user_choice, expected_value', enumerate(OPTI...
bsd-3-clause
Python
08d83f6999d8e5442acf8683bd8348baca386331
Revert wsgi keep alive as well
craigcook/bedrock,flodolo/bedrock,flodolo/bedrock,alexgibson/bedrock,MichaelKohler/bedrock,flodolo/bedrock,MichaelKohler/bedrock,alexgibson/bedrock,sylvestre/bedrock,mozilla/bedrock,MichaelKohler/bedrock,sylvestre/bedrock,craigcook/bedrock,alexgibson/bedrock,craigcook/bedrock,pascalchevrel/bedrock,alexgibson/bedrock,pa...
wsgi/config.py
wsgi/config.py
# see http://docs.gunicorn.org/en/latest/configure.html#configuration-file from os import getenv bind = f'0.0.0.0:{getenv("PORT", "8000")}' workers = getenv('WEB_CONCURRENCY', 2) accesslog = '-' errorlog = '-' loglevel = getenv('LOGLEVEL', 'info') # Larger keep-alive values maybe needed when directly talking to ELB...
# see http://docs.gunicorn.org/en/latest/configure.html#configuration-file from os import getenv bind = f'0.0.0.0:{getenv("PORT", "8000")}' workers = getenv('WEB_CONCURRENCY', 2) accesslog = '-' errorlog = '-' loglevel = getenv('LOGLEVEL', 'info') # Larger keep-alive values maybe needed when directly talking to ELB...
mpl-2.0
Python
a428a64ec6c84d58b85d443e2b881545a5d0e6f1
increase version to 0.9.3
byteweaver/django-referral,Chris7/django-referral
referral/__init__.py
referral/__init__.py
__version__ = '0.9.3'
__version__ = '0.9.2'
mit
Python
9b7326637e0318d546657489c4bd18d5a2d80794
Use transform accessors
elemel/drillion
drillion/physics_component.py
drillion/physics_component.py
from drillion.component import Component from drillion.maths import Transform2, Vector2 class PhysicsComponent(Component): def __init__(self, transform_component, update_phase, position=(0.0, 0.0), velocity=(0.0, 0.0), acceleration=(0.0, 0.0), angle=0.0, angular_velocity=0.0, angu...
from drillion.component import Component from drillion.maths import Vector2 class PhysicsComponent(Component): def __init__(self, transform_component, update_phase, position=(0.0, 0.0), velocity=(0.0, 0.0), acceleration=(0.0, 0.0), angle=0.0, angular_velocity=0.0, angular_accelera...
mit
Python
e9ef64a037ecc1329f3d4f7885ee0ac1f5d1fd37
make test_MassAnalysis use airfoilcoords fixture
helo9/wingstructure
tests/test_structuresection.py
tests/test_structuresection.py
import pytest from wingstructure.structure import section, material, MassAnalysis @pytest.fixture def airfoilcoords(): import numpy as np # load airfoil coordinates return np.loadtxt('docs/usage/FX 61-184.dat', skiprows=1, delimiter=',') def test_structurecreation(airfoilcoords): # create material ...
import pytest from wingstructure.structure import section, material, MassAnalysis @pytest.fixture def airfoilcoords(): import numpy as np # load airfoil coordinates return np.loadtxt('docs/usage/FX 61-184.dat', skiprows=1, delimiter=',') def test_structurecreation(airfoilcoords): # create material ...
mit
Python
7ef6ed7c8ad66f08ca69c767a2a4bdbaf1088fdf
update script to be runnalbe in prod env
codeforamerica/westsac-urban-land-locator,codeforamerica/westsac-urban-land-locator,codeforamerica/westsac-urban-land-locator,codeforamerica/westsac-urban-land-locator
reset-dev-farmland.py
reset-dev-farmland.py
import os import json import execjs import urllib2 from sqlalchemy import create_engine from farmsList.settings import DevConfig if os.environ.get("FARMSLIST_ENV") == 'prod': engine = create_engine(ProdConfig().SQLALCHEMY_DATABASE_URI) else: engine = create_engine(DevConfig().SQLALCHEMY_DATABASE_URI) conn = engine....
import os import json import execjs import urllib2 from sqlalchemy import create_engine from farmsList.settings import DevConfig engine = create_engine(DevConfig().SQLALCHEMY_DATABASE_URI) conn = engine.connect() parcels = [{ 'geometry': '{"type":"Polygon","coordinates":[[[-121.51367978210449,38.58853235229309],[-12...
bsd-3-clause
Python
e4ab382aa9463cc0fed49a6fc7e2af6f61a3557b
Use single quotes consistently
mesonbuild/wrapweb,mesonbuild/wrapweb,mesonbuild/wrapweb
wrapweb/app.py
wrapweb/app.py
# Copyright 2015 The Meson development team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
# Copyright 2015 The Meson development team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
apache-2.0
Python
47e79b3a01ca4541d79412cdab856f84871e68f8
Add auth protocol for keystone connection in vnc_api
Juniper/contrail-provisioning,Juniper/contrail-provisioning
templates/vnc_api_lib_ini_template.py
templates/vnc_api_lib_ini_template.py
import string template = string.Template(""" [global] ;WEB_SERVER = 127.0.0.1 ;WEB_PORT = 9696 ; connection through quantum plugin WEB_SERVER = 127.0.0.1 WEB_PORT = 8082 ; connection to api-server directly BASE_URL = / ;BASE_URL = /tenants/infra ; common-prefix for all URLs ; Authentication settings (optional) [aut...
import string template = string.Template(""" [global] ;WEB_SERVER = 127.0.0.1 ;WEB_PORT = 9696 ; connection through quantum plugin WEB_SERVER = 127.0.0.1 WEB_PORT = 8082 ; connection to api-server directly BASE_URL = / ;BASE_URL = /tenants/infra ; common-prefix for all URLs ; Authentication settings (optional) [aut...
apache-2.0
Python
24d7e3ae08c8f81e95a6292bcc8668a1a3a0ece2
Add homo-binning
FederatedAI/FATE,FederatedAI/FATE,FederatedAI/FATE
python/fate_client/pipeline/component/__init__.py
python/fate_client/pipeline/component/__init__.py
from pipeline.component.column_expand import ColumnExpand from pipeline.component.data_statistics import DataStatistics from pipeline.component.dataio import DataIO from pipeline.component.data_transform import DataTransform from pipeline.component.evaluation import Evaluation from pipeline.component.hetero_data_split...
from pipeline.component.column_expand import ColumnExpand from pipeline.component.data_statistics import DataStatistics from pipeline.component.dataio import DataIO from pipeline.component.data_transform import DataTransform from pipeline.component.evaluation import Evaluation from pipeline.component.hetero_data_split...
apache-2.0
Python
02f4597f83b5bc515b5d583fa737863ba314f8ff
fix typo
genegis/genegis,genegis/genegis,genegis/genegis
Install/toolbox/scripts/utils.py
Install/toolbox/scripts/utils.py
# -*- coding: utf-8 -*- import csv import collections import sys import re import os import binascii def parameters_from_args(defaults_tuple=None, sys_args=None): """Provided a set of tuples for default values, return a list of mapped variables.""" defaults = collections.OrderedDict(defaults_...
# -*- coding: utf-8 -*- import csv import collections import sys import re import os import binascii def parameters_from_args(defaults_tuple=None, sys_args=None): """Provided a set of tuples for default values, return a list of mapped variables.""" defaults = collections.OrderedDict(defaults_...
mpl-2.0
Python
6afd022e784ecf6069542c796bbf53ccca05bdc1
Fix deprecation warning
springload/madewithwagtail,springload/madewithwagtail,springload/madewithwagtail,springload/madewithwagtail
core/tests/test_template_tags.py
core/tests/test_template_tags.py
from django.template import Context, Template from bs4 import BeautifulSoup from core.tests.utils import * from core.models import * class TemplateTagsTestCase(WagtailTest): def setUp(self): super(TemplateTagsTestCase, self).setUp() self.home_page = HomePage.objects.all()[0] def test_set_v...
from django.template import Context, Template from bs4 import BeautifulSoup from core.tests.utils import * from core.models import * class TemplateTagsTestCase(WagtailTest): def setUp(self): super(TemplateTagsTestCase, self).setUp() self.home_page = HomePage.objects.all()[0] def test_set_v...
mit
Python
20717a44fce087103dd92aa4e333fde4c9187f0e
Increment minor version to 0.4
myint/cppclean,myint/cppclean,myint/cppclean,myint/cppclean
cpp/__init__.py
cpp/__init__.py
__version__ = '0.4'
__version__ = '0.3'
apache-2.0
Python
e3a994bff7a43968fcea53eee49b540b57c6e7f6
Update supply_systems_database.py
architecture-building-systems/CEAforArcGIS,architecture-building-systems/CEAforArcGIS
cea/technologies/supply_systems_database.py
cea/technologies/supply_systems_database.py
""" This module provides an interface to the "supply_systems.xls" file (locator.get_database_supply_systems()) - the point is to avoid reading this data (which is constant during the lifetime of a script) again and again. """ from __future__ import print_function from __future__ import division import pandas as pd imp...
""" This module provides an interface to the "supply_systems.xls" file (locator.get_database_supply_systems()) - the point is to avoid reading this data (which is constant during the lifetime of a script) again and again. """ from __future__ import print_function from __future__ import division import pandas as pd imp...
mit
Python
e8b50a70fc7de1842ebe8bc796736459bf154432
Add the new cluster validity methods in the module.
makism/dyfunconn
dyconnmap/cluster/__init__.py
dyconnmap/cluster/__init__.py
# -*- coding: utf-8 -*- """ """ # Author: Avraam Marimpis <avraam.marimpis@gmail.com> from .ng import NeuralGas from .mng import MergeNeuralGas from .rng import RelationalNeuralGas from .gng import GrowingNeuralGas from .som import SOM from .umatrix import umatrix from .validity import ray_turi, davies_bouldin __a...
# -*- coding: utf-8 -*- """ """ # Author: Avraam Marimpis <avraam.marimpis@gmail.com> from .ng import NeuralGas from .mng import MergeNeuralGas from .rng import RelationalNeuralGas from .gng import GrowingNeuralGas from .som import SOM from .umatrix import umatrix __all__ = [ "NeuralGas", "MergeNeuralGas",...
bsd-3-clause
Python
bfb26e4704dc5303593936eec3c33c56e88334ed
test new sharedMemory feature
jcarpent/eigenpy,stack-of-tasks/eigenpy,stack-of-tasks/eigenpy,jcarpent/eigenpy,jcarpent/eigenpy
unittest/python/test_return_by_ref.py
unittest/python/test_return_by_ref.py
import return_by_ref from return_by_ref import Matrix, RowMatrix, Vector import numpy as np def test_shared(mat): m_ref = mat.ref() m_ref.fill(0) m_copy = mat.copy() assert np.array_equal(m_ref,m_copy) m_const_ref = mat.const_ref() assert np.array_equal(m_const_ref,m_copy) assert np.array_equal(m_const...
from return_by_ref import Matrix, RowMatrix, Vector import numpy as np def test(mat): m_ref = mat.ref() m_ref.fill(0) m_copy = mat.copy() assert np.array_equal(m_ref,m_copy) m_const_ref = mat.const_ref() assert np.array_equal(m_const_ref,m_copy) assert np.array_equal(m_const_ref,m_ref) m_ref.fill(1)...
bsd-2-clause
Python
3e92aac756581de951259d20f08c1dec14e86ecd
Add test capturing expectation. Ref #372.
jaraco/keyring
tests/backends/test_chainer.py
tests/backends/test_chainer.py
import pytest import keyring.backends.chainer from keyring import backend @pytest.fixture def two_keyrings(monkeypatch): def get_two(): class Keyring1(backend.KeyringBackend): priority = 1 def get_password(self, system, user): return 'ring1-{system}-{user}'.format...
import pytest import keyring.backends.chainer from keyring import backend @pytest.fixture def two_keyrings(monkeypatch): def get_two(): class Keyring1(backend.KeyringBackend): priority = 1 def get_password(self, system, user): return 'ring1-{system}-{user}'.format...
mit
Python
8eaaa4e480ab4b771a51dbe46016fa186e860e22
fix bug in nbio.django.views
nbio/nbio-django
nbio/django/views.py
nbio/django/views.py
__license__ = "Apache 2.0" __copyright__ = "Copyright 2008 nb.io" __author__ = "Randy Reddig - ydnar@nb.io" from nbio.django.shortcuts import render_response from django.http import Http404 DEFAULT_CONTENT_TYPE = 'text/html' def null(): return def auto(request, **kwargs): try: t = kwargs['te...
__license__ = "Apache 2.0" __copyright__ = "Copyright 2008 nb.io" __author__ = "Randy Reddig - ydnar@nb.io" from nbio.django.shortcuts import render_response from django.http import Http404 DEFAULT_CONTENT_TYPE = 'text/html' def null(): return def auto(request, **kwargs): try: t = kwargs['te...
apache-2.0
Python
eca2cf86ca180b2f32f2e305649bec8161fc8d54
fix #366
luis-rr/saga-python,mehdisadeghi/saga-python,telamonian/saga-python,mehdisadeghi/saga-python,luis-rr/saga-python,telamonian/saga-python,luis-rr/saga-python
saga/utils/pty_exceptions.py
saga/utils/pty_exceptions.py
__author__ = "Andre Merzky" __copyright__ = "Copyright 2013, The SAGA Project" __license__ = "MIT" import saga.exceptions as se # ---------------------------------------------------------------- # def translate_exception (e, msg=None) : """ In many cases, we should be able to roughly infer the exceptio...
__author__ = "Andre Merzky" __copyright__ = "Copyright 2013, The SAGA Project" __license__ = "MIT" import saga.exceptions as se # ---------------------------------------------------------------- # def translate_exception (e, msg=None) : """ In many cases, we should be able to roughly infer the exceptio...
mit
Python
ef21a9aacc305df069635399bfd6dcb9a9da25b6
Integrate LLVM at llvm/llvm-project@7dde2a59e61a
google/tsl,google/tsl,google/tsl
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "7dde2a59e61ad669b52a93b0259ce2ad20d642fa" LLVM_SHA256 = "9710cf0d5a3076036c86a452b5f4e71812e4d9e0d8cd72f7bcb73db6b723216f" tf_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "674729813e3be02af7bda02cfe577398763f58b9" LLVM_SHA256 = "4abe4c3617c12b35db6b00c870bc5438c9f9cb487a79caa15cccb9a0fc029424" tf_http_archive( ...
apache-2.0
Python
a3715ffe1d54d33abefad6266c64814d5e3c75ac
Integrate LLVM at llvm/llvm-project@c6013f71a455
tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "c6013f71a4555f6d9ef9c60e6bc4376ad63f1c47" LLVM_SHA256 = "644a1f9db6e55ba28fba1e03fe6c2d28514d47e1e02210b4b281868d7a7af70c" tfrt_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "43d6991c2a4cc2ac374e68c029634f2b59ffdfdf" LLVM_SHA256 = "6be97e134eab943941bbb06ad0c714070dc24cb4418a104813c1e9a2ca6655f7" tfrt_http_archive( ...
apache-2.0
Python
f1099e777d2e14fa1429f72352dfd90fc08250e6
Fix newlines to match formatting in the rest of project.
reactiveops/pentagon,reactiveops/pentagon,reactiveops/pentagon
pentagon/filters.py
pentagon/filters.py
import re def register_filters(): """Register a function with decorator""" registry = {} def registrar(func): registry[func.__name__] = func return func registrar.all = registry return registrar filter = register_filters() def get_jinja_filters(): """Return all registered custom jinja filters""" retur...
import re def register_filters(): """Register a function with decorator""" registry = {} def registrar(func): registry[func.__name__] = func return func registrar.all = registry return registrar filter = register_filters() def get_jinja_filters(): """Return all registered custom jinja filters""" ret...
apache-2.0
Python
f359b1feb5567dd3627eba0c03701177355c48a4
Improve coverage in dakota.methods.base module
csdms/dakota,csdms/dakota
dakota/tests/test_dakota_base.py
dakota/tests/test_dakota_base.py
#!/usr/bin/env python # # Tests for dakota.methods.base module. # # Call with: # $ nosetests -sv # # Mark Piper (mark.piper@colorado.edu) from nose.tools import raises, assert_true, assert_is_none from dakota.methods.base import DakotaBase from . import start_dir, data_dir # Helpers --------------------------------...
#!/usr/bin/env python # # Tests for dakota.methods.base module. # # Call with: # $ nosetests -sv # # Mark Piper (mark.piper@colorado.edu) from nose.tools import raises, assert_true, assert_is_none from dakota.methods.base import DakotaBase from . import start_dir, data_dir # Helpers --------------------------------...
mit
Python
52ba0bccca023eb480eecfe9a5448eb97c1656d5
correct id
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/userreports/management/commands/rebuild_tables_by_domain.py
corehq/apps/userreports/management/commands/rebuild_tables_by_domain.py
from django.core.management.base import BaseCommand, CommandError from corehq.apps.userreports import tasks from corehq.apps.userreports.models import DataSourceConfiguration, StaticDataSourceConfiguration class Command(BaseCommand): help = "Rebuild all user configurable reporting tables in domain" args = 'do...
from django.core.management.base import BaseCommand, CommandError from corehq.apps.userreports import tasks from corehq.apps.userreports.models import DataSourceConfiguration, StaticDataSourceConfiguration class Command(BaseCommand): help = "Rebuild all user configurable reporting tables in domain" args = 'do...
bsd-3-clause
Python
fe2e2825021ffd64d1c96608b8e789785d935e04
put correct type in row descriptions
josh-mckenzie/cassandra-dbapi2,EnigmaCurry/cassandra-dbapi2,mshuler/cassandra-dbapi2,iflatness/cql,iGivefirst/cassandra-dbapi2,pcmanus/python-cql,maraca/cassandra-dbapi2,stanhu/cassandra-dbapi2,flowroute/cassandra-dbapi2,pandu-rao/cassandra-dbapi2,diezguerra/cassandra-dbapi2,CanWeStudio/cassandra-dbapi2
cql/decoders.py
cql/decoders.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not ...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not ...
apache-2.0
Python
ae1f3f182a2095b0f1607a8e8e0653cdb5b5f2e2
Remove use of f-string in setup.py #3650 (#3662)
parrt/antlr4,parrt/antlr4,ericvergnaud/antlr4,ericvergnaud/antlr4,ericvergnaud/antlr4,antlr/antlr4,ericvergnaud/antlr4,parrt/antlr4,ericvergnaud/antlr4,parrt/antlr4,antlr/antlr4,ericvergnaud/antlr4,antlr/antlr4,ericvergnaud/antlr4,antlr/antlr4,ericvergnaud/antlr4,antlr/antlr4,parrt/antlr4,parrt/antlr4,antlr/antlr4,eric...
runtime/Python3/setup.py
runtime/Python3/setup.py
from setuptools import setup v = '4.10.1' setup( name='antlr4-python3-runtime', version=v, packages=['antlr4', 'antlr4.atn', 'antlr4.dfa', 'antlr4.tree', 'antlr4.error', 'antlr4.xpath'], package_dir={'': 'src'}, install_requires=[ "typing ; python_version<'3.5'", ], url='http://www...
from setuptools import setup v = '4.10.1' setup( name='antlr4-python3-runtime', version=v, packages=['antlr4', 'antlr4.atn', 'antlr4.dfa', 'antlr4.tree', 'antlr4.error', 'antlr4.xpath'], package_dir={'': 'src'}, install_requires=[ "typing ; python_version<'3.5'", ], url='http://www...
bsd-3-clause
Python
45d9b9716e57e979ac35619c2508093a775b555d
add comment in sql
HirokiUmatani/PearPackage
PearPyPac/DB.py
PearPyPac/DB.py
# -*- coding: utf-8 -*- import MySQLdb import configparser class PearMySQL(object): def __init__(self): """ initialize """ self.conf = None self.connector = None self.cursor = None def setConfig(self, conf_path): """ set configure """ self.conf = configparser...
# -*- coding: utf-8 -*- import MySQLdb import configparser class PearMySQL(object): def __init__(self): """ initialize """ self.conf = None self.connector = None self.cursor = None def setConfig(self, conf_path): """ set configure """ self.conf = configparser...
mit
Python
42758d9c709b9842242904c59e9be116958f0357
Handle non-ascii characters better.
DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python
d1_client_cli/src/d1_client_cli/print_level.py
d1_client_cli/src/d1_client_cli/print_level.py
def print_level(level, msg): ''' Print the information in as Unicode safe manner as possible. ''' for l in unicode(msg).split(u'\n'): msg = u'%s%s' % (u'{0: <8s}'.format(level), unicode(l)) print msg.encode('utf-8') def print_debug(msg): print_level(u'DEBUG', unicode(msg)) def print_error(msg): pr...
def print_level(level, msg): for l in str(msg).split('\n'): print('{0: <8s}{1}'.format(level, l)) def print_debug(msg): print_level('DEBUG', msg) def print_error(msg): print_level('ERROR', msg) def print_warn(msg): print_level('WARN', msg) def print_info(msg): print_level('', msg)
apache-2.0
Python
1917557f0a7f63184beedcad7276d717278561fc
convert timestamp to string in contrib
aureooms/sak,aureooms/sak
sake/contributions.py
sake/contributions.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import lib.git, lib.args, lib.json, lib.time def commit ( message, duration, authors = None ) : authors = lib.args.listify( authors ) with lib.json.proxy( "contributions.json", mode = "w", default = [] ) as ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import lib.git, lib.args, lib.json, lib.time def commit ( message, duration, authors = None ) : authors = lib.args.listify( authors ) with lib.json.proxy( "contributions.json", mode = "w", default = [] ) as ...
agpl-3.0
Python
6c0397c369ab9d6b9a4f6cbab27b490ef26ee728
Fix TestConstVariables.py
llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb
packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
"""Check that compiler-generated constant values work correctly""" from __future__ import print_function import os, time import lldb from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil class ConstVariableTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @expectedFa...
"""Check that compiler-generated constant values work correctly""" from __future__ import print_function import os, time import lldb from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil class ConstVariableTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @expectedFa...
apache-2.0
Python
8724a598b7d08d9cd6cb77541625a80b53e96882
Simplify `map_indexed` by building it from `starmap()` and `zip_with_iterable()`. @jcafhe
ReactiveX/RxPY,ReactiveX/RxPY
rx/core/operators/map.py
rx/core/operators/map.py
from typing import Callable, Any from rx.internal.basic import identity from rx.internal.utils import infinite from rx import operators as ops from rx.core import Observable, pipe from rx.core.typing import Mapper, MapperIndexed, Observer, Disposable, Scheduler # pylint: disable=redefined-builtin def _map(mapper: M...
from typing import Callable, Any from rx.internal.basic import identity from rx.core import Observable from rx.core.typing import Mapper, MapperIndexed, Observer, Disposable, Scheduler # pylint: disable=redefined-builtin def _map(mapper: Mapper = None) -> Callable[[Observable], Observable]: _mapper = mapper or ...
mit
Python
3d38848287b168cfbe3c9fe5297e7f322027634d
Delete excess code in the latest test scenario.
gnott/elife-poa-xml-generation,gnott/elife-poa-xml-generation
tests/test_parsePoaXml_test.py
tests/test_parsePoaXml_test.py
import unittest import os import re os.sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import parsePoaXml import generatePoaXml # Import test settings last in order to override the regular settings import poa_test_settings as settings class TestParsePoaXml(unittest.TestCase): d...
import unittest import os import re os.sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import parsePoaXml import generatePoaXml # Import test settings last in order to override the regular settings import poa_test_settings as settings def override_settings(): # For now need to ov...
mit
Python
2369cb9f3f94a979d48cd645b38c8b1ea0827ef9
Set version as 1.16.0
atztogo/phono3py,atztogo/phono3py,atztogo/phono3py,atztogo/phono3py
phono3py/version.py
phono3py/version.py
# Copyright (C) 2013 Atsushi Togo # All rights reserved. # # This file is part of phonopy. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notic...
# Copyright (C) 2013 Atsushi Togo # All rights reserved. # # This file is part of phonopy. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
Python
cd46a099b0af34125fcbd7ce1de1ae20ad002264
Test minor modification
Sparkier/inviwo,Sparkier/inviwo,Sparkier/inviwo,inviwo/inviwo,Sparkier/inviwo,inviwo/inviwo,inviwo/inviwo,inviwo/inviwo,inviwo/inviwo,inviwo/inviwo,Sparkier/inviwo
tools/ivwpy/regression/test.py
tools/ivwpy/regression/test.py
#********************************************************************************* # # Inviwo - Interactive Visualization Workshop # # Copyright (c) 2013-2015 Inviwo Foundation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the f...
#********************************************************************************* # # Inviwo - Interactive Visualization Workshop # # Copyright (c) 2013-2015 Inviwo Foundation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the f...
bsd-2-clause
Python
2c85ba795b9b3334f217fa9978634a4708efbe7d
Make new directory when extracting.
Arsey/keras-transfer-learning-for-oxford102
create_caffe_splits.py
create_caffe_splits.py
#!/usr/bin/env python import glob import numpy as np from scipy.io import loadmat # Read .mat file containing training, testing, and validation sets. setid = loadmat('data/setid.mat') # The .mat file is 1-indexed, so we subtract one to match Caffe's convention. idx_train = setid['trnid'][0] - 1 idx_test = setid['tsti...
#!/usr/bin/env python import glob import numpy as np from scipy.io import loadmat # Read .mat file containing training, testing, and validation sets. setid = loadmat('data/setid.mat') # The .mat file is 1-indexed, so we subtract one to match Caffe's convention. idx_train = setid['trnid'][0] - 1 idx_test = setid['tsti...
mit
Python
02d266b6e34b84d4cca5bcfc05d78490a1d10dec
Print import error when plugin import fails (#6748)
mociepka/saleor,mociepka/saleor,mociepka/saleor
saleor/plugins/checks.py
saleor/plugins/checks.py
from typing import TYPE_CHECKING, List from django.conf import settings from django.core.checks import Error, register from django.utils.module_loading import import_string if TYPE_CHECKING: from .base_plugin import BasePlugin @register() def check_plugins(app_configs, **kwargs): """Confirm a correct import...
from typing import TYPE_CHECKING, List from django.conf import settings from django.core.checks import Error, register from django.utils.module_loading import import_string if TYPE_CHECKING: from .base_plugin import BasePlugin @register() def check_plugins(app_configs, **kwargs): """Confirm a correct import...
bsd-3-clause
Python
7ccf28f42896367862612a3fd5ffbcb0cf53f671
fix bug
windprog/requestspool
requestspool/http.py
requestspool/http.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Copyright (c) 2014 windpro Author : windpro E-mail : windprog@gmail.com Date : 14/12/26 Desc : 发起http请求的相关方法和http信息 """ import requests from wsgiref.util import is_hop_by_hop from . import config from . import httpinfo from .interface import BaseHttpInfo ...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Copyright (c) 2014 windpro Author : windpro E-mail : windprog@gmail.com Date : 14/12/26 Desc : 发起http请求的相关方法和http信息 """ import requests from wsgiref.util import is_hop_by_hop from . import config from . import httpinfo from .interface import BaseHttpInfo ...
mit
Python
dd896a3baabb7f6eb9cc24845b5842dd5a25c6d0
Bump version to 0.1.2.
audreyr/design,audreyr/design
design/__init__.py
design/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- __version__ = '0.1.2'
#!/usr/bin/env python # -*- coding: utf-8 -*- __version__ = '0.1.1'
bsd-3-clause
Python
c15db53c4accf690f88392bca5aaa42ade97ea5e
Add trailing slash to app's website URL when generating previously shortened URLs
chezmix/cuenco,chezmix/cuenco
cuenco/views.py
cuenco/views.py
import md5 from cuenco import app, db from cuenco.models import WebLink from flask import request, url_for, render_template, redirect, jsonify from urlparse import urlparse from sqlalchemy import func from datetime import datetime #base-62 encode a number def encode(num): if num < 1: raise Exception("encode: Numb...
import md5 from cuenco import app, db from cuenco.models import WebLink from flask import request, url_for, render_template, redirect, jsonify from urlparse import urlparse from sqlalchemy import func from datetime import datetime #base-62 encode a number def encode(num): if num < 1: raise Exception("encode: Numb...
mit
Python
a97c41f568ca2f3b66e748c4da3c5b283036bdaf
save iteratively
Neurosim-lab/netpyne,Neurosim-lab/netpyne
examples/asdEvol/netParams.py
examples/asdEvol/netParams.py
from netpyne import specs, sim try: from __main__ import cfg except: from simConfig import cfg # Network parameters netParams = specs.NetParams() # -------------------------------------------------------- # Simple network # -------------------------------------------------------- # Population parameters netParams...
from netpyne import specs, sim try: from __main__ import cfg except: from simConfig import cfg # Network parameters netParams = specs.NetParams() # -------------------------------------------------------- # Simple network # -------------------------------------------------------- # Population parameters netParams...
mit
Python
3ae086aff4ac24792c026e49775dc8feca2aa4eb
Add filename sanitiser
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/utils/general.py
salt/utils/general.py
# -*- coding: utf-8 -*- # # Copyright 2016 SUSE 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 agr...
# -*- coding: utf-8 -*- # # Copyright 2016 SUSE 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 agr...
apache-2.0
Python
bcfe1bafd8e28d5be0cc551930d0d43149282e71
Fix url
NovelTorpedo/noveltorpedo,NovelTorpedo/noveltorpedo,NovelTorpedo/noveltorpedo,NovelTorpedo/noveltorpedo
noveltorpedo/urls.py
noveltorpedo/urls.py
from django.conf.urls import include, url from . import views app_name = 'noveltorpedo' urlpatterns = [ url(r'^', include('haystack.urls')), ]
from django.conf.urls import include, url from . import views app_name = 'noveltorpedo' urlpatterns = [ url(r'^$', include('haystack.urls')), ]
mit
Python
4ee2986eb12ff06e6e31c362ac2fa873eb3429b9
use os.makedirs to create the full STATIC_PATH/directory if needed
boblefrag/django-bower-app,levkowetz/django-bower-app
djangobwr/management/commands/bower_install.py
djangobwr/management/commands/bower_install.py
import os import json import tempfile import shutil from subprocess import call from django.core.management.base import BaseCommand from django.conf import settings from djangobwr.finders import AppDirectoriesFinderBower class Command(BaseCommand): def handle(self, *args, **options): temp_dir = tempfil...
import os import json import tempfile import shutil from subprocess import call from django.core.management.base import BaseCommand from django.conf import settings from djangobwr.finders import AppDirectoriesFinderBower class Command(BaseCommand): def handle(self, *args, **options): temp_dir = tempfil...
bsd-3-clause
Python
500253425b2ea0dd79359378f8c6fc41e191d52c
Integrate LLVM at llvm/llvm-project@a617ff0ba001
google/tsl,google/tsl,google/tsl
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "a617ff0ba0017b1df010d480eceb13066ecd122e" LLVM_SHA256 = "019068664d4e73d1d3b4bdd56237d1e19251858eafc88d108428f9df98b6d074" tf_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "163bb6d64e5f1220777c3ec2a8b58c0666a74d91" LLVM_SHA256 = "f36211d9e34dcdd364bdef02efeadacca7e21c3e1b2ee73a2e60286bcd67db7e" tf_http_archive( ...
apache-2.0
Python
3414a8320153c8ae850c5382c35bd2b6c1a0b9a6
Integrate LLVM at llvm/llvm-project@f2b94bd7eaa8
tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "f2b94bd7eaa83d853dc7568fac87b1f8bf4ddec6" LLVM_SHA256 = "ac53a2a6516f84031d9a61d35700b0e6ba799292cfb54cfc17ed48958de8ff49" tfrt_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "bc432c96349c1b0a381b824f11b057ff0de0b571" LLVM_SHA256 = "a49bb4d643f35f63d72ccea0d3fe09cf374908a2400197ce5391f60596be0701" tfrt_http_archive( ...
apache-2.0
Python
7b92eaec3eefc4c839fee3323fb7a970a5b72f64
Integrate LLVM at llvm/llvm-project@4be3fc35aa8b
tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime
third_party/llvm/workspace.bzl
third_party/llvm/workspace.bzl
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "4be3fc35aa8b27494968e9a52eb0afa0672d98e7" LLVM_SHA256 = "fdc350e798d8870496bd8aa4e6de6b76ae2423f1d0a4e88ff238ad9542683c00" tfrt_http_archive( ...
"""Provides the repository macro to import LLVM.""" load("//third_party:repo.bzl", "tfrt_http_archive") def repo(name): """Imports LLVM.""" LLVM_COMMIT = "8e82bc840de5b2264875a5f0967845867833ccfb" LLVM_SHA256 = "683e8d615013efe0abafd3098c05e7f348d829fd0adfcdcf441236780bdff074" tfrt_http_archive( ...
apache-2.0
Python
2db334e452e2ee2d5f0cbc516dc6cb04b61e598d
Check for `GNdr` grammeme in `gender-match` label
bureaucratic-labs/yargy
yargy/labels.py
yargy/labels.py
GENDERS = ("masc", "femn", "neut", "Ms-f", "GNdr") def gram_label(token, value, stack): return value in token.grammemes def gram_not_label(token, value, stack): return not value in token.grammemes def gender_match_label(token, index, stack, genders=GENDERS): results = ((g in t.grammemes for g in genders)...
GENDERS = ("masc", "femn", "neut", "Ms-f") def gram_label(token, value, stack): return value in token.grammemes def gram_not_label(token, value, stack): return not value in token.grammemes def gender_match_label(token, index, stack, genders=GENDERS): results = ((g in t.grammemes for g in genders) for t i...
mit
Python
0a722c29be0c3bb5c84a3579717e6042e365fdad
Bump version to 3.1.2-dev
DirkHoffmann/indico,DirkHoffmann/indico,DirkHoffmann/indico,indico/indico,DirkHoffmann/indico,indico/indico,indico/indico,indico/indico
indico/__init__.py
indico/__init__.py
# This file is part of Indico. # Copyright (C) 2002 - 2022 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from indico.util.mimetypes import register_custom_mimetypes __version__ = '3.1.2-dev' PREFERRED_PYTHON_V...
# This file is part of Indico. # Copyright (C) 2002 - 2022 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from indico.util.mimetypes import register_custom_mimetypes __version__ = '3.1.1' PREFERRED_PYTHON_VERSI...
mit
Python
7d7cde3f6d77291ecb6ac4fa4a941b1fad60a03b
Fix setup.py
pymfony/pymfony
src/pymfony/component/system/setup.py
src/pymfony/component/system/setup.py
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of the pymfony package. # # (c) Alexandre Quercia <alquerci@email.com> # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. from __future__ import absolute_import; import os; from dis...
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of the pymfony package. # # (c) Alexandre Quercia <alquerci@email.com> # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. from __future__ import absolute_import; import os; from dis...
mit
Python
dbcb69100795d8ac00dd3ceb91b06b94e2596c7f
upgrade spectrum simu
Koheron/lase
lase/drivers/spectrum_simu.py
lase/drivers/spectrum_simu.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np from .base_simu import BaseSimu class SpectrumSimu(BaseSimu): def __init__(self): n = 4096 super(SpectrumSimu, self).__init__(n) self.waveform_size = n self.spectrum = np.zeros(self.sampling.n, dtype=np.float32) ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np from .base_simu import BaseSimu class SpectrumSimu(BaseSimu): def __init__(self): n = 4096 super(SpectrumSimu, self).__init__(n) self.waveform_size = n self.spectrum = np.zeros(self.sampling.n, dtype=np.float32) ...
mit
Python
4db1bcf44bb2f3cc9621d9a58739029721a31f14
add wildcards to bundled libzmq glob
caidongyun/pyzmq,dash-dash/pyzmq,ArvinPan/pyzmq,caidongyun/pyzmq,yyt030/pyzmq,swn1/pyzmq,yyt030/pyzmq,Mustard-Systems-Ltd/pyzmq,dash-dash/pyzmq,dash-dash/pyzmq,swn1/pyzmq,caidongyun/pyzmq,Mustard-Systems-Ltd/pyzmq,Mustard-Systems-Ltd/pyzmq,yyt030/pyzmq,ArvinPan/pyzmq,ArvinPan/pyzmq,swn1/pyzmq
zmq/__init__.py
zmq/__init__.py
"""Python bindings for 0MQ.""" #----------------------------------------------------------------------------- # Copyright (C) 2010-2012 Brian Granger, Min Ragan-Kelley # # This file is part of pyzmq # # Distributed under the terms of the New BSD License. The full license is in # the file COPYING.BSD, distributed ...
"""Python bindings for 0MQ.""" #----------------------------------------------------------------------------- # Copyright (C) 2010-2012 Brian Granger, Min Ragan-Kelley # # This file is part of pyzmq # # Distributed under the terms of the New BSD License. The full license is in # the file COPYING.BSD, distributed ...
bsd-3-clause
Python
a44ec4543fc6951cd45ba3c1696e428e36a9c161
Make sure the target of Say isn't in Unicode, otherwise Twisted complains
Didero/DideRobot
commands/say.py
commands/say.py
from CommandTemplate import CommandTemplate from IrcMessage import IrcMessage class Command(CommandTemplate): triggers = ['say', 'do', 'notice'] helptext = "Makes the bot say the provided text in the provided channel (format 'say [channel/user] text')" adminOnly = True showInCommandList = False def execute(sel...
from CommandTemplate import CommandTemplate from IrcMessage import IrcMessage class Command(CommandTemplate): triggers = ['say', 'do', 'notice'] helptext = "Makes the bot say the provided text in the provided channel (format 'say [channel/user] text')" adminOnly = True showInCommandList = False def execute(sel...
mit
Python
42c2389c88fc52e186079df1c426af429537ed0e
Update blender plugin version to the next release number
ndevenish/Blender_ioEDM,ndevenish/Blender_ioEDM
io_EDM/__init__.py
io_EDM/__init__.py
bl_info = { 'name': "Import: .EDM model files", 'description': "Importing of .EDM model files", 'author': "Nicholas Devenish", 'version': (0,3,0), 'blender': (2, 78, 0), 'location': "File > Import/Export > .EDM Files", 'category': 'Import-Export', } try: import bpy def register(): from .io_oper...
bl_info = { 'name': "Import: .EDM model files", 'description': "Importing of .EDM model files", 'author': "Nicholas Devenish", 'version': (0,0,1), 'blender': (2, 78, 0), 'location': "File > Import/Export > .EDM Files", 'category': 'Import-Export', } try: import bpy def register(): from .io_oper...
mit
Python
a2d9b2e9aa0e1b3cdfd3db20d3b62eab74be5408
comment only
cropleyb/pentai,cropleyb/pentai,cropleyb/pentai
evaluator.py
evaluator.py
from utility_stats import * from null_filter import * class Evaluator(): """ This is to help with debugging bad moves. """ def __init__(self, calculator, state): self.state = state self.calculator = calculator calculator.set_rules(self.get_rules()) self.utility_stats = U...
from utility_stats import * from null_filter import * class Evaluator(): """ This is for help with debugging bad moves. """ def __init__(self, calculator, state): self.state = state self.calculator = calculator calculator.set_rules(self.get_rules()) self.utility_stats = ...
mit
Python
fd6039e920643e09cbc60a8ddcfb7bf51a05dbbf
test commit
nchah/inf1340_2015_asst1
exercise1.py
exercise1.py
#!/usr/bin/env python """ Assignment 1, Exercise 1, INF1340, Fall, 2014. Grade to gpa conversion This module prints the amount of money that Lakshmi has remaining after the stock transactions """ __author__ = 'Susan Sim' __email__ = "ses@drsusansim.org" __copyright__ = "2015 Susan Sim" __license__ = "MIT License" ...
#!/usr/bin/env python """ Assignment 1, Exercise 1, INF1340, Fall, 2014. Grade to gpa conversion This module prints the amount of money that Lakshmi has remaining after the stock transactions """ __author__ = 'Susan Sim' __email__ = "ses@drsusansim.org" __copyright__ = "2015 Susan Sim" __license__ = "MIT License" ...
mit
Python
5882fbdba87a26d3cdb7ae3f29d8af2140d83d2d
Use new cab URLs.
django/djangosnippets.org,django/djangosnippets.org,django/djangosnippets.org,django-de/djangosnippets.org,django-de/djangosnippets.org,django/djangosnippets.org,django-de/djangosnippets.org,django/djangosnippets.org,django-de/djangosnippets.org
djangosnippets/urls.py
djangosnippets/urls.py
from django.conf.urls.defaults import url, patterns, include from django.conf.urls.static import static from django.conf import settings from django.contrib import admin from django.shortcuts import render admin.autodiscover() urlpatterns = patterns('', url(r'^captcha/', include('captcha.urls')), url(r'^accou...
from django.conf.urls.defaults import url, patterns, include from django.conf.urls.static import static from django.conf import settings from django.contrib import admin from django.shortcuts import render from haystack.views import SearchView, search_view_factory from cab import feeds from cab.forms import AdvancedS...
bsd-3-clause
Python
0ad39c6a0415d997a433ddc828c180154e9c257d
Print 404 to chan
jasuka/pyBot,jasuka/pyBot
modules/syscmd.py
modules/syscmd.py
import urllib.request import os import re ## Get HTML for given url def getHtml( self, url, useragent): try: if useragent == True: user_agent = "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)" headers = { 'User-Agent' : user_agent } req = urllib.request.Request(url, None, headers) else:...
import urllib.request import os import re ## Get HTML for given url def getHtml( self, url, useragent): try: if useragent == True: user_agent = "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)" headers = { 'User-Agent' : user_agent } req = urllib.request.Request(url, None, headers) else:...
mit
Python
d8cfd9218ce6b9b341020c934c9102d4c776ebc7
Allow empty --exclude
jeff-allen-mongo/mut,jeff-allen-mongo/mut
mut/index/main.py
mut/index/main.py
''' Usage: mut-index <root> -o <output> -u <url> [-g -s --exclude <paths>] mut-index upload [-b <bucket> -p <prefix> --no-backup] <root> -o <output> -u <url> [-g -s --exclude <paths>] -h, --help List CLI prototype, arguments, and options. <root> Path to the directory contain...
''' Usage: mut-index <root> -o <output> -u <url> [-g -s --exclude <paths>] mut-index upload [-b <bucket> -p <prefix> --no-backup] <root> -o <output> -u <url> [-g -s --exclude <paths>] -h, --help List CLI prototype, arguments, and options. <root> Path to the directory contain...
apache-2.0
Python
10d7e64b33089597c1f3977e6611304ec783aaf0
add matching pattern to pdb code in list
normcyr/fetch-pdb
fetch-pdb.py
fetch-pdb.py
#!/usr/bin/python3 from urllib.request import urlopen from re import match, compile def downloading(filename): with open(filename) as pdb_list: for structure in pdb_list: if match(pdbPattern, structure): pdb_url = base_url + structure[:4] out_file_name = stru...
#!/usr/bin/python3 import urllib.request def downloading(filename): with open(filename) as pdb_list: for structure in pdb_list: pdb_url = base_url + structure[:4] out_file_name = structure[:4] + '.pdb' with urllib.request.urlopen(pdb_url) as response, open(out_file_name,...
mit
Python
2f617c6fb331f4e9247a1c04635460e55581d837
add info to nodepy.runtime.scripts that it can also holds an 'args' member
nodepy/nodepy
nodepy/runtime.py
nodepy/runtime.py
import os import sys #: This value is set automatically before the Node.py entry point is invoked #: from scripts that are installed via the Node.py package manager. It will be #: a dictionary with the following keys: #: #: * location: Either `system`, `global` or `local` #: * original_path: The original value of `sy...
import os import sys #: This value is set automatically before the Node.py entry point is invoked #: from scripts that are installed via the Node.py package manager. It will be #: a dictionary with the following keys: #: #: * location: Either `system`, `global` or `local` #: * original_path: The original value of `sy...
mit
Python
b50cd7e7a06fe19b6bc68aa9815d33e27d8b9751
Bump version for dev release.
openxc/openxc-python,openxc/openxc-python,openxc/openxc-python
openxc/version.py
openxc/version.py
""" Current OpenXC version constant. This functionality is contained in its own module to prevent circular import problems with ``__init__.py`` (which is loaded by setup.py during installation, which in turn needs access to this version information.) """ VERSION = (0, 11, 2) __version__ = '.'.join(map(str, VERSION))...
""" Current OpenXC version constant. This functionality is contained in its own module to prevent circular import problems with ``__init__.py`` (which is loaded by setup.py during installation, which in turn needs access to this version information.) """ VERSION = (0, 11, 1) __version__ = '.'.join(map(str, VERSION))...
bsd-3-clause
Python
3c2b0e061721c592c68fa253bedc5da8ecaf806a
Add function to check old pipeline
alexandreleroux/mayavi,liulion/mayavi,dmsurti/mayavi,alexandreleroux/mayavi,liulion/mayavi,dmsurti/mayavi
tvtk/common.py
tvtk/common.py
"""Common functions and classes that do not require any external dependencies (apart from the standard library of course). """ # Author: Prabhu Ramachandran <prabhu_r@users.sf.net> # Copyright (c) 2005-2007, Enthought, Inc. # License: BSD Style. import string import re import vtk ####################################...
"""Common functions and classes that do not require any external dependencies (apart from the standard library of course). """ # Author: Prabhu Ramachandran <prabhu_r@users.sf.net> # Copyright (c) 2005-2007, Enthought, Inc. # License: BSD Style. import string import re ###############################################...
bsd-3-clause
Python
96465f47e82b6f57b34cd993fb6518771a836113
bump version
brentp/combined-pvalues,brentp/combined-pvalues
cpv/__init__.py
cpv/__init__.py
# __version__ = "0.50.6"
# __version__ = "0.50.5"
mit
Python
621337bd685a200a37bcbbd5fe3441d2090aab54
Add PYTHON_ARGCOMPLETE_OK to enable completion for argcomplete users
mikethebeer/cr8,mfussenegger/cr8
cr8/__main__.py
cr8/__main__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # PYTHON_ARGCOMPLETE_OK import argh import argparse from cr8 import __version__ from cr8.timeit import timeit from cr8.insert_json import insert_json from cr8.insert_fake_data import insert_fake_data from cr8.insert_blob import insert_blob from cr8.run_spec import run_spe...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argh import argparse from cr8 import __version__ from cr8.timeit import timeit from cr8.insert_json import insert_json from cr8.insert_fake_data import insert_fake_data from cr8.insert_blob import insert_blob from cr8.run_spec import run_spec from cr8.run_crate imp...
mit
Python
3c151b93f0c122f098642cabf97f755133e41a63
Document --config and make it required.
bnkr/craftrun,bnkr/craftrun
craftrun/cli.py
craftrun/cli.py
import argparse, sys, yaml, os, logging from craftrun import command class Settings(object): """Cli and config file settings.""" def __init__(self, cli): self.cli = cli with open(cli.config, 'r') as io: self.config = yaml.load(io.read()) @property def base_dir(self): ...
import argparse, sys, yaml, os, logging from craftrun import command class Settings(object): """Cli and config file settings.""" def __init__(self, cli): self.cli = cli with open(cli.config, 'r') as io: self.config = yaml.load(io.read()) @property def base_dir(self): ...
mit
Python
e09551ed8fef6c53acb5faab4a0165b61f98eab3
Delete unneeded absolute_import
albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com
app/tests.py
app/tests.py
import tempfile import unittest import serve import utils class PageCase(unittest.TestCase): def setUp(self): serve.app.config['TESTING'] = True self.app = serve.app.test_client() def test_index_load(self): self.page_test('/', b'Albert Wang') def test_resume_load(self): ...
from __future__ import absolute_import import tempfile import unittest import serve import utils class PageCase(unittest.TestCase): def setUp(self): serve.app.config['TESTING'] = True self.app = serve.app.test_client() def test_index_load(self): self.page_test('/', b'Albert Wang') ...
mit
Python
1cb49fc209fb4aca854db732588003b704e3ef56
Change resize button label
globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service
dbaas/logical/widgets/database_offering_field.py
dbaas/logical/widgets/database_offering_field.py
from django import forms from django.utils.safestring import mark_safe class DatabaseOfferingWidget(forms.widgets.TextInput): def render(self, name, value, attrs=None): html = super(DatabaseOfferingWidget, self).render(name, value,attrs) resize_link = """ </br><a id="resizeDatabase"...
from django import forms from django.utils.safestring import mark_safe class DatabaseOfferingWidget(forms.widgets.TextInput): def render(self, name, value, attrs=None): html = super(DatabaseOfferingWidget, self).render(name, value,attrs) resize_link = """ </br><a id="resizeDatabase"...
bsd-3-clause
Python
398cacda0209459217271d025115776864fd2d6a
Fix a bug where type comparison is case-sensitive for TIF
CenterForOpenScience/modular-file-renderer,CenterForOpenScience/modular-file-renderer,felliott/modular-file-renderer,CenterForOpenScience/modular-file-renderer,felliott/modular-file-renderer,felliott/modular-file-renderer,felliott/modular-file-renderer,CenterForOpenScience/modular-file-renderer
mfr/extensions/pdf/render.py
mfr/extensions/pdf/render.py
import logging import os import furl from mako.lookup import TemplateLookup from mfr.core import extension from mfr.extensions.pdf import settings from mfr.extensions.utils import munge_url_for_localdev logger = logging.getLogger(__name__) class PdfRenderer(extension.BaseRenderer): TEMPLATE = TemplateLookup( ...
import logging import os import furl from mako.lookup import TemplateLookup from mfr.core import extension from mfr.extensions.pdf import settings from mfr.extensions.utils import munge_url_for_localdev logger = logging.getLogger(__name__) class PdfRenderer(extension.BaseRenderer): TEMPLATE = TemplateLookup( ...
apache-2.0
Python
c804b5753f4805cf3d129fa4e7febef5c032b6ca
Update version to 1.1.0
matrix-org/python-unpaddedbase64
unpaddedbase64.py
unpaddedbase64.py
# 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 applicable law or agreed to in ...
# 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 applicable law or agreed to in ...
apache-2.0
Python
4b3c24dfce6f430d42ce9f24b72de54d34c9d79e
Fix for Numeric Overflow of `softplus` implementation (#30)
rushter/MLAlgorithms
mla/neuralnet/activations.py
mla/neuralnet/activations.py
import autograd.numpy as np """ References: https://en.wikipedia.org/wiki/Activation_function """ def sigmoid(z): return 1.0 / (1.0 + np.exp(-z)) def softmax(z): # Avoid numerical overflow by removing max e = np.exp(z - np.amax(z, axis=1, keepdims=True)) return e / np.sum(e, axis=1, keepdims=True) ...
import autograd.numpy as np """ References: https://en.wikipedia.org/wiki/Activation_function """ def sigmoid(z): return 1.0 / (1.0 + np.exp(-z)) def softmax(z): # Avoid numerical overflow by removing max e = np.exp(z - np.amax(z, axis=1, keepdims=True)) return e / np.sum(e, axis=1, keepdims=True) ...
mit
Python
93de55a62a88cba979c9d5e979b26f41546e2105
fix bug. use f-string format (#2681)
open-mmlab/mmdetection,open-mmlab/mmdetection
mmdet/datasets/wider_face.py
mmdet/datasets/wider_face.py
import os.path as osp import xml.etree.ElementTree as ET import mmcv from .builder import DATASETS from .xml_style import XMLDataset @DATASETS.register_module() class WIDERFaceDataset(XMLDataset): """ Reader for the WIDER Face dataset in PASCAL VOC format. Conversion scripts can be found in https://...
import os.path as osp import xml.etree.ElementTree as ET import mmcv from .builder import DATASETS from .xml_style import XMLDataset @DATASETS.register_module() class WIDERFaceDataset(XMLDataset): """ Reader for the WIDER Face dataset in PASCAL VOC format. Conversion scripts can be found in https://...
apache-2.0
Python
0a76529251c44a694c6a8f2d6fa3d6c2bf6e2de3
Add TODO items inline
missaugustina/nova-api-docs-tracker,missaugustina/nova-api-docs-tracker,missaugustina/nova-api-docs-tracker,missaugustina/nova-api-docs-tracker
nova_api_docs_tracker/main.py
nova_api_docs_tracker/main.py
# -*- coding: utf-8 -*- import glob import os import re SPLIT_FILE_RE = re.compile(r'\n([\w\s]+)\n\=+\n', re.MULTILINE) def main(): # TODO(auggy): args: inc files path path = '' output = {} # get inc files inc_files = get_inc_files(path) for filename in inc_files: contents = inc_fil...
# -*- coding: utf-8 -*- import glob import os import re SPLIT_FILE_RE = re.compile(r'\n([\w\s]+)\n\=+\n', re.MULTILINE) def main(): # TODO(auggy): args: inc files path path = '' output = {} # get inc files inc_files = get_inc_files(path) for filename in inc_files: contents = inc_fil...
apache-2.0
Python
60d923433aa34dcdd1ce7bafd2431d4778c4d394
remove old config
timwaizenegger/swift-bluebox,timwaizenegger/swift-bluebox
appConfig.py
appConfig.py
""" Project Bluebox 2015, University of Stuttgart, IPVS/AS """ """ Project Bluebox Copyright (C) <2015> <University of Stuttgart> This software may be modified and distributed under the terms of the MIT license. See the LICENSE file for details. """ #swift_type = "BluemixV1Auth" #swift_url = "https://swift...
""" Project Bluebox 2015, University of Stuttgart, IPVS/AS """ """ Project Bluebox Copyright (C) <2015> <University of Stuttgart> This software may be modified and distributed under the terms of the MIT license. See the LICENSE file for details. """ """ this is the current config file for bluebox. define...
mit
Python
c97d4cce296e9505633404790847183122638cd7
Revert crippling of test_old_api
jaberg/nengo,jaberg/nengo
nengo/test/test_old_api.py
nengo/test/test_old_api.py
import numpy as np from nengo.old_api import Network from matplotlib import pyplot as plt def rmse(a, b): return np.sqrt(np.mean((a - b) ** 2)) def test_basic_1(show=False): """ Create a network with sin(t) being represented by a population of spiking neurons. Assert that the decoded value from t...
import numpy as np from nengo.old_api import Network from matplotlib import pyplot as plt def rmse(a, b): return np.sqrt(np.mean((a - b) ** 2)) def test_basic_1(show=False): """ Create a network with sin(t) being represented by a population of spiking neurons. Assert that the decoded value from ...
mit
Python
c2bca21718295b6400471395f5da3ca9d42e8a84
Check if error available on output
modoboa/modoboa-dmarc,modoboa/modoboa-dmarc
modoboa_dmarc/tests/mixins.py
modoboa_dmarc/tests/mixins.py
"""Test mixins.""" import os import sys import six from django.core.management import call_command from django.utils.six import StringIO class CallCommandMixin(object): """A mixin to provide command execution shortcuts.""" def setUp(self): """Replace stdin""" super(CallCommandMixin, self)....
"""Test mixins.""" import os import sys import six from django.core.management import call_command class CallCommandMixin(object): """A mixin to provide command execution shortcuts.""" def setUp(self): """Replace stdin""" super(CallCommandMixin, self).setUp() self.stdin = sys.stdin...
mit
Python
8c858df942af961ec475461814c32e2769ac310a
Remove unused class
controversial/ui2
ui2/animate.py
ui2/animate.py
from objc_util import * import time def animate(animation, duration=0.25, delay=0.0, completion=None): """A drop-in replacement for ui.animate which supports easings.""" if completion is not None: def c(cmd, success): completion(success) release_global(ObjCInstance(cmd)) ...
from objc_util import * import time CATransaction = ObjCClass("CATransaction") def animate(animation, duration=0.25, delay=0.0, completion=None): """A drop-in replacement for ui.animate which supports easings.""" if completion is not None: def c(cmd, success): completion(success) ...
mit
Python
c2822ddb0297600c1b70c543f97b719b03d9b202
update routes : /api
buildbuild/buildbuild,buildbuild/buildbuild,buildbuild/buildbuild
buildbuild/buildbuild/urls.py
buildbuild/buildbuild/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin from users import views admin.autodiscover() from users.views import Login from users.views import Logout from buildbuild.views import Home urlpatterns = patterns('', # Examples: # url(r'^$', 'buildbuild.views.home', name='...
from django.conf.urls import patterns, include, url from django.contrib import admin from users import views admin.autodiscover() from users.views import Login from users.views import Logout from buildbuild.views import Home urlpatterns = patterns('', # Examples: # url(r'^$', 'buildbuild.views.home', name='...
bsd-3-clause
Python
bdef19ef909fe3d7b8e90fb4b470bbe56765e25d
Bump to 12 gunicorn workers for 8GB linode
jonafato/vim-awesome,vim-awesome/vim-awesome,vim-awesome/vim-awesome,vim-awesome/vim-awesome,divad12/vim-awesome,divad12/vim-awesome,shaialon/vim-awesome,starcraftman/vim-awesome,shaialon/vim-awesome,jonafato/vim-awesome,vim-awesome/vim-awesome,divad12/vim-awesome,shaialon/vim-awesome,jonafato/vim-awesome,starcraftman/...
conf/gunicorn.py
conf/gunicorn.py
# Paths are relative to $HOME pythonpath = 'vim-awesome/web' pidfile = '.gunicorn.pid' daemon = True accesslog = 'logs/gunicorn/access.log' errorlog = 'logs/gunicorn/error.log' # Recommendation is 2 * NUM_CORES + 1. See # http://gunicorn-docs.readthedocs.org/en/latest/design.html#how-many-workers workers = 12
# Paths are relative to $HOME pythonpath = 'vim-awesome/web' pidfile = '.gunicorn.pid' daemon = True accesslog = 'logs/gunicorn/access.log' errorlog = 'logs/gunicorn/error.log' # Recommendation is 2 * NUM_CORES + 1. See # http://gunicorn-docs.readthedocs.org/en/latest/design.html#how-many-workers workers = 2
mit
Python
44f026d434aa4cfe08d1bf0871d28f303b63add8
bump version because of PyPI rules
scikit-hep/uproot,scikit-hep/uproot,scikit-hep/uproot,scikit-hep/uproot
uproot/version.py
uproot/version.py
#!/usr/bin/env python # Copyright (c) 2017, DIANA-HEP # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list ...
#!/usr/bin/env python # Copyright (c) 2017, DIANA-HEP # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list ...
bsd-3-clause
Python
c9ccb83f196f3b4e431fd5778233de7e3d6b7624
Make has_hashes a prop
hanjae/upstream,Storj/upstream
upstream/chunk.py
upstream/chunk.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from upstream.exc import ChunkError class Chunk(object): def __init__(self, filehash=None, decryptkey=None, filename=None, filepath=None): """ Stores information about an encryted chunk. Allows for format conversions. ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from upstream.exc import ChunkError class Chunk(object): def __init__(self, filehash=None, decryptkey=None, filename=None, filepath=None): """ Stores information about an encryted chunk. Allows for format conversions. ...
mit
Python
ee28ede60ad70c0e23edd743fc9b4ff83c13dfaa
use parameterized test
cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy
tests/cupy_tests/math_tests/test_window.py
tests/cupy_tests/math_tests/test_window.py
import unittest from cupy import testing @testing.parameterize( *testing.product({ 'm': [0, 1, -1, 1024], 'name': ['blackman', 'hamming', 'hanning'], }) ) class TestWindow(unittest.TestCase): _multiprocess_can_split_ = True @testing.numpy_cupy_allclose(atol=1e-5) def test_window...
import unittest from cupy import testing @testing.gpu class TestWindow(unittest.TestCase): _multiprocess_can_split_ = True @testing.numpy_cupy_allclose(atol=1e-5) def check_0(self, name, xp): a = 0 return getattr(xp, name)(a) @testing.numpy_cupy_allclose(atol=1e-5) def check_1(...
mit
Python
864e567cc36d6c303eeac546738fb6c7e2619ecc
Update the file_inject command so that it automatically creates directories.
coreos/openstack-guest-agents-unix,prometheanfire/openstack-guest-agents-unix,joejulian/openstack-guest-agents-unix,rackerlabs/openstack-guest-agents-unix,joejulian/openstack-guest-agents-unix,rackerlabs/openstack-guest-agents-unix,coreos/openstack-guest-agents-unix,rackerlabs/openstack-guest-agents-unix,prometheanfire...
unix/commands/file_inject.py
unix/commands/file_inject.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2011 Openstack, LLC. # 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...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2011 Openstack, LLC. # 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-2.0
Python
3cafa831a5c13a119943dbbf03df5b6820d07abb
Update ada_boost_all_features.py
archonren/project
algorithms/ada_boost_all_features.py
algorithms/ada_boost_all_features.py
import os from scipy.io import loadmat from numpy import array, vstack, reshape, delete from sklearn.metrics import precision_recall_fscore_support from sklearn.ensemble import AdaBoostClassifier from sklearn import preprocessing from sklearn.feature_selection import VarianceThreshold from sklearn.svm import SVC ...
import os from scipy.io import loadmat from numpy import array, vstack, reshape, delete from sklearn.metrics import precision_recall_fscore_support from sklearn.ensemble import AdaBoostClassifier from sklearn import preprocessing from sklearn.feature_selection import VarianceThreshold from sklearn.svm import SVC ...
mit
Python
59cca2c867998a936405a87b704f674a271a13d8
Add required dependencies (#9427)
mociepka/saleor,mociepka/saleor,mociepka/saleor
saleor/checkout/migrations/0040_add_handle_checkouts_permission.py
saleor/checkout/migrations/0040_add_handle_checkouts_permission.py
# Generated by Django 3.2.12 on 2022-03-08 10:35 from django.core.management.sql import emit_post_migrate_signal from django.db import migrations def assing_permissions(apps, schema_editor): # force post signal as permissions are created in post migrate signals # related Django issue https://code.djangoproje...
# Generated by Django 3.2.12 on 2022-03-08 10:35 from django.core.management.sql import emit_post_migrate_signal from django.db import migrations def assing_permissions(apps, schema_editor): # force post signal as permissions are created in post migrate signals # related Django issue https://code.djangoproje...
bsd-3-clause
Python
48f8f1b1e322f8e3fc8b738312e780645211d3e8
Revert "piratebay: New URL"
laurent-george/weboob,frankrousseau/weboob,Boussadia/weboob,Boussadia/weboob,willprice/weboob,RouxRC/weboob,laurent-george/weboob,Boussadia/weboob,frankrousseau/weboob,Boussadia/weboob,nojhan/weboob-devel,Konubinix/weboob,sputnick-dev/weboob,RouxRC/weboob,yannrouillard/weboob,willprice/weboob,Konubinix/weboob,RouxRC/we...
modules/piratebay/browser.py
modules/piratebay/browser.py
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Julien Veyssier # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Julien Veyssier # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
agpl-3.0
Python
781addf1e2ee5eb5cff71ee7b4da14671e208c3a
Fix for #57
nccgroup/featherduster,nccgroup/featherduster
feathermodules/classical/columnar_transposition.py
feathermodules/classical/columnar_transposition.py
import cryptanalib as ca import feathermodules def break_columnar_transposition(ciphertexts): arguments=feathermodules.current_options results = [] for ciphertext in ciphertexts: result = ca.break_columnar_transposition(ciphertext, num_answers=int(arguments['num_answers'])) result = '\n'.join(resu...
import cryptanalib as ca import feathermodules def break_columnar_transposition(ciphertexts): arguments=feathermodules.current_options results = [] for ciphertext in ciphertexts: results.append(ca.break_columnar_transposition(ciphertext, num_answers=int(arguments['num_answers']))) print 'Best results...
bsd-3-clause
Python
53a2a514500aa19a8fbdcaa5701774d6983ff76d
add some initial email templates
Edmonton-Public-Library/centennial,Edmonton-Public-Library/centennial,Edmonton-Public-Library/centennial
util/email/email_template.py
util/email/email_template.py
REGISTRATION_NOTIFICATION = """Thank you {%username} for registering with EPL. To activate your account, you will need to verify your account by navigating to the following URL: {%registration_url}""" PASSWORD_RESET_EMAIL = """To reset your password, please click on the following link: {%forgot_password_url}"""
mit
Python
98552a4cb683e25ec9af53024e58644c04b55872
Handle missing external files gracefully
mollyproject/mollyproject,mollyproject/mollyproject,mollyproject/mollyproject
molly/external_media/views.py
molly/external_media/views.py
from email.utils import formatdate from datetime import datetime, timedelta from time import mktime from django.shortcuts import get_object_or_404 from django.http import HttpResponse, Http404 from molly.utils.views import BaseView from molly.utils.breadcrumbs import NullBreadcrumb from models import ExternalImageSi...
from email.utils import formatdate from datetime import datetime, timedelta from time import mktime from django.shortcuts import get_object_or_404 from django.http import HttpResponse, Http404 from molly.utils.views import BaseView from molly.utils.breadcrumbs import NullBreadcrumb from models import ExternalImageSi...
apache-2.0
Python
630908ea370ee863f70bbe60a425c825ee5f9d62
Test fix
nick-bulleid/mopidy-frontpanel
mopidy_frontpanel/frontend.py
mopidy_frontpanel/frontend.py
from __future__ import unicode_literals import logging from mopidy.core import CoreListener # pylint: disable=import-error import pykka # pylint: disable=import-error from .menu import MenuModel from .painter import Painter from .input import Input logger = logging.getLogger(__name__) class FrontPanel(pykka.Threa...
from __future__ import unicode_literals import logging from mopidy.core import CoreListener # pylint: disable=import-error import pykka # pylint: disable=import-error from .menu import BrowseMenu from .painter import Painter from .input import Input logger = logging.getLogger(__name__) class FrontPanel(pykka.Thre...
apache-2.0
Python
e41c947bd4ce3fdee3793467373fbeba693ca5bd
bump version number
kapteyn-astro/kapteyn,kapteyn-astro/kapteyn,kapteyn-astro/kapteyn,kapteyn-astro/kapteyn,kapteyn-astro/kapteyn,kapteyn-astro/kapteyn
DISTRIBUTION/kapteyn/__init__.py
DISTRIBUTION/kapteyn/__init__.py
"""Kapteyn package. """ from os import path package_dir = path.abspath(path.dirname(__file__)) __all__=['celestial', 'wcs', 'wcsgrat', 'tabarray', 'maputils', 'mplutil', 'positions', 'shapes', 'rulers', 'filters', 'interpolation'] __version__='2.0.3b13'
"""Kapteyn package. """ from os import path package_dir = path.abspath(path.dirname(__file__)) __all__=['celestial', 'wcs', 'wcsgrat', 'tabarray', 'maputils', 'mplutil', 'positions', 'shapes', 'rulers', 'filters', 'interpolation'] __version__='2.0.3b11'
bsd-3-clause
Python
ff8f63b755664d4970577d7ae1ee96316767d52c
remove redundant signal
theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs,theonion/django-bulbs
bulbs/contributions/signals.py
bulbs/contributions/signals.py
from django.dispatch import receiver from django.db.models.signals import m2m_changed, post_save from bulbs.content.models import Content, FeatureType from .models import ContributorRole, FeatureTypeRate from .tasks import update_role_rates from .utils import update_content_contributions @receiver(post_save, sender...
from django.core.exceptions import ObjectDoesNotExist from django.dispatch import receiver from django.db.models.signals import m2m_changed, post_save from bulbs.content.models import Content, FeatureType from .models import Contribution, ContributorRole, FeatureTypeRate, ReportContent from .tasks import update_role_...
mit
Python
6af0cedc4a060d6015f44d90c2f0552957d38a14
read Niancat Slack config from environment
dandeliondeathray/niancat-micro,dandeliondeathray/niancat-micro
niancat-slack/niancatslack.py
niancat-slack/niancatslack.py
from slackrest.app import SlackrestApp from slackrest.command import Visibility, Method import json import os class GetPuzzle: pattern = '!nian' url_format = '/puzzle' visibility = Visibility.Any body = None method = Method.GET class SetPuzzle: pattern = '!sättnian {nian}' url_format = '...
from slackrest.app import SlackrestApp from slackrest.command import Visibility, Method import json class GetPuzzle: pattern = '!nian' url_format = '/puzzle' visibility = Visibility.Any body = None method = Method.GET class SetPuzzle: pattern = '!sättnian {nian}' url_format = '/puzzle' ...
apache-2.0
Python
083c555dd73431ce8ff2b2479193807742836c1a
Remove explicit unnecessary variable init
alexpilotti/cloudbase-init,stefan-caraiman/cloudbase-init,cmin764/cloudbase-init,ader1990/cloudbase-init,chialiang-8/cloudbase-init,openstack/cloudbase-init,stackforge/cloudbase-init
cloudbaseinit/plugins/common/fileexecutils.py
cloudbaseinit/plugins/common/fileexecutils.py
# Copyright 2014 Cloudbase Solutions Srl # # 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 2014 Cloudbase Solutions Srl # # 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