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
cd7b72e67a3af4184ccaf3e3dce231c227392f45
Update Keras.py
paperrune/Neural-Networks,paperrune/Neural-Networks
History/Nesterov-Accelerated-Gradient/Keras.py
History/Nesterov-Accelerated-Gradient/Keras.py
import keras from keras.datasets import mnist from keras.initializers import RandomUniform from keras.layers import Dense from keras.models import Sequential from keras.optimizers import SGD batch_size = 128 epochs = 30 num_classes = 10 (x_train, y_train), (x_test, y_test) = mnist.load_data() x_train = ...
import keras from keras.datasets import mnist from keras.initializers import RandomUniform from keras.layers import Dense from keras.models import Sequential from keras.optimizers import SGD batch_size = 128 epochs = 30 num_classes = 10 (x_train, y_train), (x_test, y_test) = mnist.load_data() x_train = ...
mit
Python
b8c18068c2cc2afe169c750f25318c6ba92e2763
use Spack compilers and remove x86_64 opts from Makefile (#13877)
iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack
var/spack/repos/builtin/packages/prank/package.py
var/spack/repos/builtin/packages/prank/package.py
# Copyright 2013-2019 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 Prank(Package): """A powerful multiple sequence alignment browser.""" homepage = "htt...
# Copyright 2013-2019 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 Prank(Package): """A powerful multiple sequence alignment browser.""" homepage = "htt...
lgpl-2.1
Python
26933550f7a3c195669c61539151c5fedf26aaad
add version 1.0.0 to r-hms (#21045)
LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/r-hms/package.py
var/spack/repos/builtin/packages/r-hms/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RHms(RPackage): """Pretty Time of Day Implements an S3 class for storing and formatti...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RHms(RPackage): """Implements an S3 class for storing and formatting time-of-day values, ...
lgpl-2.1
Python
91cb70a94cd41bb6404fb6f21361bb8a7f01c9d5
Rework thread model
job/irrexplorer,job/irrexplorer,job/irrexplorer,job/irrexplorer
irrexplorer.py
irrexplorer.py
#!/usr/bin/env python # Copyright (c) 2015, Job Snijders # # This file is part of IRR Explorer # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice...
#!/usr/bin/env python # Copyright (c) 2015, Job Snijders # # This file is part of IRR Explorer # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice...
bsd-2-clause
Python
03f33b099ec9adc480f599338b61214e870fedf6
Update iypm_domain export name to use a valid format
MinnSoe/ifyoupayme,MinnSoe/ifyoupayme,MinnSoe/ifyoupayme
iypm_domain.py
iypm_domain.py
import sys try: from troposphere import Join, Sub, Output, Export from troposphere import Parameter, Ref, Template from troposphere.route53 import HostedZone from troposphere.certificatemanager import Certificate except ImportError: sys.exit('Unable to import troposphere. ' 'Try "pip i...
import sys try: from troposphere import Join, Sub, Output, Export from troposphere import Parameter, Ref, Template from troposphere.route53 import HostedZone from troposphere.certificatemanager import Certificate except ImportError: sys.exit('Unable to import troposphere. ' 'Try "pip i...
mpl-2.0
Python
0665beccbca954df9a477119bb976441c29dd5eb
fix test
sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana
test/sphinxext/test_sphinxext.py
test/sphinxext/test_sphinxext.py
import tempfile import os from sequana.sphinxext import snakemakerule from sphinx.application import Sphinx def test_doc(): res = snakemakerule.get_rule_doc("dag") res = snakemakerule.get_rule_doc("fastqc_dynamic") try: res = snakemakerule.get_rule_doc("dummy") assert False except F...
import tempfile import os from sequana.sphinxext import snakemakerule from sphinx.application import Sphinx def test_doc(): res = snakemakerule.get_rule_doc("dag") res = snakemakerule.get_rule_doc("fastqc") try: res = snakemakerule.get_rule_doc("dummy") assert False except FileNotFo...
bsd-3-clause
Python
30e1f6ca2224cba216c2e08f2600ae55ba43cebb
update comment
amplifylitco/asiaq,amplifylitco/asiaq,amplifylitco/asiaq
test/unit/test_disco_aws_util.py
test/unit/test_disco_aws_util.py
""" Tests of disco_aws_util """ from unittest import TestCase from disco_aws_automation import disco_aws_util class DiscoAWSUtilTests(TestCase): '''Test disco_aws_util.py''' def test_size_as_rec_map_with_none(self): """size_as_recurrence_map works with None""" self.assertEqual(disco_aws_util...
""" Tests of disco_aws_util """ from unittest import TestCase from disco_aws_automation import disco_aws_util class DiscoAWSUtilTests(TestCase): '''Test disco_aws_util.py''' def test_size_as_rec_map_with_none(self): """_size_as_recurrence_map works with None""" self.assertEqual(disco_aws_uti...
bsd-2-clause
Python
0df416d66ee6c28512295de297f44597b45acf7a
Bump version for release
pfmoore/pip,sbidoul/pip,pypa/pip,sbidoul/pip,xavfernandez/pip,rouge8/pip,pradyunsg/pip,pfmoore/pip,rouge8/pip,rouge8/pip,pypa/pip,pradyunsg/pip,xavfernandez/pip,xavfernandez/pip
src/pip/__init__.py
src/pip/__init__.py
__version__ = "19.2"
__version__ = "19.2.dev0"
mit
Python
e2ce9caa84d0932b72894f17dc2c4884cc285bb0
update test case for jaccard
thongdong7/subfind,thongdong7/subfind,thongdong7/subfind,thongdong7/subfind
tests/TestReleaseScoringAlice.py
tests/TestReleaseScoringAlice.py
from pprint import pprint from subfind.release.alice import ReleaseScoringAlice __author__ = 'hiepsimu' import logging import unittest logging.basicConfig(level=logging.DEBUG) class ReleaseScoringAliceTestCase(unittest.TestCase): def test_01(self): """ Release which match the movie title should...
from subfind.release.alice import ReleaseScoringAlice __author__ = 'hiepsimu' import logging import unittest logging.basicConfig(level=logging.DEBUG) class ReleaseScoringAliceTestCase(unittest.TestCase): def test_01(self): """ Release which match the movie title should be the higher priority ...
mit
Python
c535c22884dbb0df227d4ad142e4d4515415ca29
Switch to wav test files for gstreamer tests
dbrgn/mopidy,jcass77/mopidy,woutervanwijk/mopidy,jcass77/mopidy,tkem/mopidy,kingosticks/mopidy,ali/mopidy,diandiankan/mopidy,hkariti/mopidy,bacontext/mopidy,rawdlite/mopidy,jcass77/mopidy,bacontext/mopidy,pacificIT/mopidy,ZenithDK/mopidy,adamcik/mopidy,mopidy/mopidy,dbrgn/mopidy,mokieyue/mopidy,hkariti/mopidy,woutervan...
tests/backends/gstreamer_test.py
tests/backends/gstreamer_test.py
import unittest import os from mopidy.models import Playlist, Track from mopidy.backends.gstreamer import GStreamerBackend from tests.backends.base import (BasePlaybackControllerTest, BaseCurrentPlaylistControllerTest) folder = os.path.dirname(__file__) folder = os.path.join(folder, ...
import unittest import os from mopidy.models import Playlist, Track from mopidy.backends.gstreamer import GStreamerBackend from tests.backends.base import (BasePlaybackControllerTest, BaseCurrentPlaylistControllerTest) folder = os.path.dirname(__file__) folder = os.path.join(folder, ...
apache-2.0
Python
9e0725483e80a4e98d2635b90a268d00e4eae9f3
Update insertion-sort-1.py
manasRK/algorithms-practice
hackerrank/insertion-sort-1.py
hackerrank/insertion-sort-1.py
''' https://www.hackerrank.com/challenges/insertionsort1 Sorting One common task for computers is to sort data. For example, people might want to see all their files on a computer sorted by size. Since sorting is a simple problem with many different possible solutions, it is often used to introduce the study of algor...
''' https://www.hackerrank.com/challenges/insertionsort1 Sorting One common task for computers is to sort data. For example, people might want to see all their files on a computer sorted by size. Since sorting is a simple problem with many different possible solutions, it is often used to introduce the study of algor...
mit
Python
4d1fa4bee77eba19cb0a4c80032f30dcc89e6b98
Fix date check
DHTC-Tools/logstash-confs,DHTC-Tools/logstash-confs,DHTC-Tools/logstash-confs
dcache-billing/python/download_billing_logs.py
dcache-billing/python/download_billing_logs.py
#!/usr/bin/env python import sys import urllib2 import argparse FAXBOX_PROCESSED_CSV_URL = "http://login.usatlas.org/logs/mwt2/dcache-billing/processed/" FAXBOX_RAW_CSV_URL = "http://login.usatlas.org/logs/mwt2/dcache-billing/raw/" def download_log(date_string): """ Download job log files from Amazon EC2 ma...
#!/usr/bin/env python import sys import urllib2 import argparse FAXBOX_PROCESSED_CSV_URL = "http://login.usatlas.org/logs/mwt2/dcache-billing/processed/" FAXBOX_RAW_CSV_URL = "http://login.usatlas.org/logs/mwt2/dcache-billing/raw/" def download_log(date_string): """ Download job log files from Amazon EC2 ma...
apache-2.0
Python
6ed3d0d8f554e578b65db89e5c5f88cd14bfaea4
Update tools/hcluster_sg_parser/hcluster_sg_parser.py
TGAC/earlham-galaxytools,TGAC/earlham-galaxytools,anilthanki/tgac-galaxytools,anilthanki/tgac-galaxytools,TGAC/earlham-galaxytools,anilthanki/tgac-galaxytools,anilthanki/tgac-galaxytools,TGAC/earlham-galaxytools,TGAC/earlham-galaxytools,anilthanki/tgac-galaxytools
tools/hcluster_sg_parser/hcluster_sg_parser.py
tools/hcluster_sg_parser/hcluster_sg_parser.py
""" A simple parser to convert the hcluster_sg output into lists of IDs, one list for each cluster. When a minimum and/or maximum number of cluster elements are specified, the IDs contained in the filtered-out clusters are collected in the "discarded IDS" output dataset. Usage: python hcluster_sg_parser.py [-m <N>] ...
""" A simple parser to convert the hcluster_sg output into lists of IDs, one list for each cluster. When a minimum and/or maximum number of cluster elements are specified, the IDs contained in the filtered-out clusters are collected in the "discarded IDS" output dataset. Usage: python hcluster_sg_parser.py [-m <N>] ...
mit
Python
0f7cb25ea5a3fbb3c88f4fd7207144f29140f69c
Change happy_numbers to check for number 4.
bm5w/codeeval
happy_numbers/happy_numbers.py
happy_numbers/happy_numbers.py
""" Happy numbers solution, code eval. https://www.codeeval.com/open_challenges/39/ A happy number is defined by the following process. Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endle...
""" Happy numbers solution, code eval. https://www.codeeval.com/open_challenges/39/ A happy number is defined by the following process. Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endle...
mit
Python
5af16432976f72de1d86f1d725205c4ec6a6caa2
Add warning when entity not found in reproduce_state
xifle/home-assistant,oandrew/home-assistant,tinloaf/home-assistant,home-assistant/home-assistant,nugget/home-assistant,emilhetty/home-assistant,Julian/home-assistant,Duoxilian/home-assistant,tchellomello/home-assistant,mikaelboman/home-assistant,Duoxilian/home-assistant,ewandor/home-assistant,keerts/home-assistant,ma31...
homeassistant/helpers/state.py
homeassistant/helpers/state.py
""" homeassistant.helpers.state ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Helpers that help with state related things. """ import logging from homeassistant.core import State import homeassistant.util.dt as dt_util from homeassistant.const import ( STATE_ON, STATE_OFF, SERVICE_TURN_ON, SERVICE_TURN_OFF, ATTR_ENTITY_ID) _LOGGE...
""" homeassistant.helpers.state ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Helpers that help with state related things. """ import logging from homeassistant.core import State import homeassistant.util.dt as dt_util from homeassistant.const import ( STATE_ON, STATE_OFF, SERVICE_TURN_ON, SERVICE_TURN_OFF, ATTR_ENTITY_ID) _LOGGE...
mit
Python
a2cbf6a4b500fa657a83f0504dc777603590372b
Reduce logging severity
phil-lopreiato/the-blue-alliance,phil-lopreiato/the-blue-alliance,verycumbersome/the-blue-alliance,bdaroz/the-blue-alliance,bdaroz/the-blue-alliance,tsteward/the-blue-alliance,the-blue-alliance/the-blue-alliance,phil-lopreiato/the-blue-alliance,bdaroz/the-blue-alliance,synth3tk/the-blue-alliance,nwalters512/the-blue-al...
helpers/notification_sender.py
helpers/notification_sender.py
import hashlib import json import logging import urllib2 from controllers.gcm.gcm import GCMConnection class NotificationSender(object): WEBHOOK_VERSION = 1 @classmethod def send_gcm(cls, notification): gcm_connection = GCMConnection() gcm_connection.notify_device(notification) @cl...
import hashlib import json import logging import urllib2 from controllers.gcm.gcm import GCMConnection class NotificationSender(object): WEBHOOK_VERSION = 1 @classmethod def send_gcm(cls, notification): gcm_connection = GCMConnection() gcm_connection.notify_device(notification) @cl...
mit
Python
0efb8c4347b944c692e3352382bf36de1c9f5ef4
Fix test_client with no webpack manifest
DirkHoffmann/indico,indico/indico,DirkHoffmann/indico,ThiefMaster/indico,ThiefMaster/indico,indico/indico,DirkHoffmann/indico,indico/indico,pferreir/indico,ThiefMaster/indico,pferreir/indico,DirkHoffmann/indico,pferreir/indico,pferreir/indico,indico/indico,ThiefMaster/indico
indico/testing/fixtures/app.py
indico/testing/fixtures/app.py
# This file is part of Indico. # Copyright (C) 2002 - 2021 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. import os import pytest from flask_webpackext.ext import _FlaskWebpackExtState from indico.web.flask.app...
# This file is part of Indico. # Copyright (C) 2002 - 2021 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. import os import pytest from indico.web.flask.app import make_app from indico.web.flask.wrappers import ...
mit
Python
6102f840c68e98a6c09aeb30055d6e58fa9c5006
Put temporary files in system's tempdir
atmtools/typhon,atmtools/typhon
typhon/tests/files/test_utils.py
typhon/tests/files/test_utils.py
from tempfile import gettempdir, NamedTemporaryFile from typhon.files import compress, decompress class TestCompression: data = "ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678910" def create_file(self, filename): with open(filename, "w") as file: file.write(self.data) def check_file(self, filen...
from tempfile import NamedTemporaryFile from typhon.files import compress, decompress class TestCompression: data = "ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678910" def create_file(self, filename): with open(filename, "w") as file: file.write(self.data) def check_file(self, filename): ...
mit
Python
cfbe7778e441f5851dc0efbacdfebd5209c31742
bump version
cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy
cupy/_version.py
cupy/_version.py
__version__ = '11.0.0rc1'
__version__ = '11.0.0b3'
mit
Python
eac2f296e855f92d040321edee943ad5f8a8fb39
Add filtering to view (nc-463)
opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor
nodeconductor/events/views.py
nodeconductor/events/views.py
from rest_framework import generics, response from nodeconductor.events import elasticsearch_client class EventListView(generics.GenericAPIView): def list(self, request, *args, **kwargs): order_by = request.GET.get('o', '-@timestamp') event_types = request.GET.getlist('event_type') searc...
from rest_framework import generics, response from nodeconductor.events import elasticsearch_client class EventListView(generics.GenericAPIView): def list(self, request, *args, **kwargs): order_by = request.GET.get('o', '-@timestamp') elasticsearch_list = elasticsearch_client.ElasticsearchResult...
mit
Python
d62f3bc97bd318ebaf68e97ccc2629d9f8f246b5
Correct the pyproj minimum version.
girder/large_image,DigitalSlideArchive/large_image,DigitalSlideArchive/large_image,DigitalSlideArchive/large_image,girder/large_image,girder/large_image
sources/mapnik/setup.py
sources/mapnik/setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from setuptools import setup, find_packages def prerelease_local_scheme(version): """ Return local scheme version unless building on master in CircleCI. This function returns the local scheme version number (e.g. 0.0.0.dev<N>+g<HASH>) unless bu...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from setuptools import setup, find_packages def prerelease_local_scheme(version): """ Return local scheme version unless building on master in CircleCI. This function returns the local scheme version number (e.g. 0.0.0.dev<N>+g<HASH>) unless bu...
apache-2.0
Python
f70421a0c3143648f7dd2491ad031e62ca92792a
increment version for password rest admin form fix
foundertherapy/django-users-plus,foundertherapy/django-users-plus
accountsplus/__init__.py
accountsplus/__init__.py
__version__ = '1.3.2' default_app_config = 'accountsplus.apps.AccountsConfig'
__version__ = '1.3.1' default_app_config = 'accountsplus.apps.AccountsConfig'
mit
Python
bb165b4f8fc88ab3de26b0b52f07ada612e87f2b
Fix test cases related to getting tags and fields
amancevice/influxalchemy
tests/client_test.py
tests/client_test.py
""" InfluxAlchemy client tests. """ import mock import influxdb from influxalchemy.client import InfluxAlchemy from influxalchemy.measurement import Measurement from influxalchemy.query import InfluxDBQuery @mock.patch("influxdb.InfluxDBClient") def test_query(mock_flux): db = influxdb.InfluxDBClient(database="f...
""" InfluxAlchemy client tests. """ import mock import influxdb from influxalchemy.client import InfluxAlchemy from influxalchemy.measurement import Measurement from influxalchemy.query import InfluxDBQuery @mock.patch("influxdb.InfluxDBClient") def test_query(mock_flux): db = influxdb.InfluxDBClient(database="f...
mit
Python
499a74ff3256b3c6fb6a0ca4e2fd9578f2948cc8
correct variable names
tmthydvnprt/eugene,tmthydvnprt/eugene
tests/eguene_test.py
tests/eguene_test.py
""" eugene_test.py """ import os import sys import numpy as np import pandas as pd sys.path.append(os.path.expanduser('~/GitHub/eugene')) import eugene.Config from eugene.Population import Population # Setup up variable and truth configuration eugene.Config.VAR['x'] = np.linspace(0, 8.0 * np.pi, 1024) eugene.Config...
""" eugene_test.py """ import os import sys import numpy as np import pandas as pd sys.path.append('~/GitHub/eugene') import eugene.Config from eugene.Population import Population # Setup up variable and truth configuration eugene.Config.var['x'] = np.linspace(0, 8.0 * np.pi, 1024) eugene.Config.truth = eugene.Conf...
mit
Python
b4439ef76148f73581e6df0bf593504ae796578a
correct a bug in geo to country code.
mpetyx/DarwinsMusic,mpetyx/DarwinsMusic,mpetyx/DarwinsMusic
dbpedia/geoToCountry.py
dbpedia/geoToCountry.py
from urllib2 import urlopen def getCountry(lat, lng): url = "http://ws.geonames.org/countryCode?lng=" + str(lng) + "&lat=" + str(lat) country = urlopen(url).read().strip() if len(country) != 2: return "Unknown" return country
from urllib2 import urlopen def getCountry(lat, lng): url = "http://ws.geonames.org/countryCode?lng=" + str(lng) + "&lat=" + str(lat) country = urlopen(url).read().strip() return country
agpl-3.0
Python
9c8bfff17254cf88e11517a278bb60ad4c83e41b
Add revised alg_strongly_connected_components.py
bowen0701/algorithms_data_structures
alg_strongly_connected_components.py
alg_strongly_connected_components.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division def strongly_connected_components(): pass def main(): # 3 strongly connected graphs: {A, B, D, E, G}, {C}, {F, H, I}. adj_dict = { 'A': ['B'], 'B': ['C', 'E'], 'C': ['C', ...
from __future__ import absolute_import from __future__ import print_function from __future__ import division def dfs_recur(adj_dict, start_vertex, visited_set, discover_ls, finish_ls): visited_set.add(start_vertex) discover_ls.append(start_vertex) for neighbor_vertex in adj_dict[start_verte...
bsd-2-clause
Python
687bb616deca1372d69ba0781c61a8ea62112426
Allow RO commands in oq workers
gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine
openquake/commands/workers.py
openquake/commands/workers.py
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2017-2019 GEM Foundation # # OpenQuake 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 Licen...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2017-2019 GEM Foundation # # OpenQuake 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 Licen...
agpl-3.0
Python
19b0b1ed7e94ae4bb05f57baf3163850a64df8f9
test exports
oscarlorentzon/OpenSfM,oscarlorentzon/OpenSfM,oscarlorentzon/OpenSfM,oscarlorentzon/OpenSfM,oscarlorentzon/OpenSfM,mapillary/OpenSfM,mapillary/OpenSfM,mapillary/OpenSfM,mapillary/OpenSfM,mapillary/OpenSfM
opensfm/test/test_commands.py
opensfm/test/test_commands.py
import argparse from opensfm import commands from opensfm.test import data_generation def run_command(command, args): parser = argparse.ArgumentParser() command.add_arguments(parser) parsed_args = parser.parse_args(args) command.run(parsed_args) def test_run_all(tmpdir): data = data_generation....
import argparse from opensfm import commands from opensfm.test import data_generation def run_command(command, args): parser = argparse.ArgumentParser() command.add_arguments(parser) parsed_args = parser.parse_args(args) command.run(parsed_args) def test_run_all(tmpdir): data = data_generation....
bsd-2-clause
Python
0c30226cf6037ce6a3938cfb1e8b98fe5ef4d767
Test for miss configured skeletor cfg
krak3n/Facio,krak3n/Facio,krak3n/Facio,krak3n/Facio,krak3n/Facio
tests/test_config.py
tests/test_config.py
import sys from skeletor.config import Config from .base import BaseTestCase from .helpers import nostdout class ConfigTests(BaseTestCase): """ Argument Passing & Config Tests. """ base_args = ['-n', 'test_skeleton'] def _set_cli_args(self, args): with nostdout(): sys.argv = sys.ar...
import sys from skeletor.config import Config from .base import BaseTestCase from .helpers import nostdout class ConfigTests(BaseTestCase): """ Argument Passing & Config Tests. """ base_args = ['-n', 'test_skeleton'] def _set_cli_args(self, args): with nostdout(): sys.argv = sys.ar...
bsd-3-clause
Python
b3e7bfab5920c45a19ba0ca67a8c0119714579ad
Update dtruss() tests
rodionovd/cuckoo-osx-analyzer,cuckoobox/cuckoo,cuckoobox/cuckoo,cuckoobox/cuckoo,cuckoobox/cuckoo,cuckoobox/cuckoo,rodionovd/cuckoo-osx-analyzer,rodionovd/cuckoo-osx-analyzer
tests/test_dtrace.py
tests/test_dtrace.py
#!/usr/bin/env python # Copyright (C) 2015 Dmitry Rodionov # This file is part of my GSoC'15 project for Cuckoo Sandbox: # http://www.cuckoosandbox.org # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE file for details. import os import sys import unittest import sub...
#!/usr/bin/env python # Copyright (C) 2015 Dmitry Rodionov # This file is part of my GSoC'15 project for Cuckoo Sandbox: # http://www.cuckoosandbox.org # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE file for details. import os import sys import unittest import sub...
mit
Python
52d8442068af3fbd848c32334327e48e623769c2
Change test class name
rafaellott/python_utils
tests/test_helper.py
tests/test_helper.py
# -*- coding: utf-8 -*- """Tests for _Helper class.""" # from python_utils.helper import _Helper # from python_utils import helper import unittest from python_utils.helper import _Helper class TestPythonUtils(unittest.TestCase): """Add documentation here.""" def setUp(self): """Add documentation he...
# -*- coding: utf-8 -*- # from python_utils.helper import _Helper #from python_utils import helper import unittest import python_utils class TestPprint(unittest.TestCase): def setUp(self): pass def tearDown(self): pass
mit
Python
6b2f403ce33205ec681ba1a511c2d52db02f6a36
Use pipelines for cache busting scans for better performance
dailymuse/oz,dailymuse/oz,dailymuse/oz
oz/plugins/aws_cdn/actions.py
oz/plugins/aws_cdn/actions.py
from __future__ import absolute_import, division, print_function, with_statement, unicode_literals # Module for generating hashes for files that match a glob, and putting that # hash in redis to allow us to generate cache-busting URLs later import os import oz import oz.app import oz.plugins.redis import oz.plugins.a...
from __future__ import absolute_import, division, print_function, with_statement, unicode_literals # Module for generating hashes for files that match a glob, and putting that # hash in redis to allow us to generate cache-busting URLs later import os import oz import oz.app import oz.plugins.redis import oz.plugins.a...
bsd-3-clause
Python
b587557ab27598d7b1d273fbc445f27b40613a29
Update production bucket name.
us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite
us_ignite/settings/production.py
us_ignite/settings/production.py
# Production settings for us_ignite import datetime import os import urlparse from us_ignite.settings import * # Sensitive values are saved as env variables: env = os.getenv PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__)) # settings is one directory up now here = lambda *x: os.path.join(PROJECT_ROOT, '..',...
# Production settings for us_ignite import datetime import os import urlparse from us_ignite.settings import * # Sensitive values are saved as env variables: env = os.getenv PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__)) # settings is one directory up now here = lambda *x: os.path.join(PROJECT_ROOT, '..',...
bsd-3-clause
Python
9c61b0d27873c8c1ea2ba2311f547625a83bf7be
Add cached_function to API
Lodifice/mfnf-pdf-export,Lodifice/mfnf-pdf-export,Lodifice/mfnf-pdf-export
tests/test_parser.py
tests/test_parser.py
import shelve from unittest import TestCase import requests import yaml from mfnf.api import HTTPMediaWikiAPI from mfnf.parser import HTML2JSONParser, ArticleContentParser from mfnf.utils import CachedFunction class TestParser(TestCase): @classmethod def setUpClass(cls): cls.database = shelve.open(...
import requests import yaml from unittest import TestCase from mfnf.api import HTTPMediaWikiAPI from mfnf.parser import HTML2JSONParser, ArticleContentParser class TestParser(TestCase): def setUp(self): self.api = HTTPMediaWikiAPI(requests.Session()) self.title = "Mathe für Nicht-Freaks: Analysis...
apache-2.0
Python
6ddaf77adb3a3d1ad42eee06aae657fe15f77fa7
revert to assertions
delgadom/clatter
tests/test_readme.py
tests/test_readme.py
import doctest def test_readme(): errs, _ = doctest.testfile('../README.rst', report=True) assert not errs
import doctest def test_readme(): errs, _ = doctest.testfile('../README.rst', report=True) if errs > 0: raise ValueError( '{} errors encountered in README.rst'.format( errs))
mit
Python
7ef0fe9f1a2b91c72c2709ed025780547e329403
Update test
gatechzhu/ricker
tests/test_ricker.py
tests/test_ricker.py
import pytest from ricker.ricker import ricker class TestRicker: def test_default_output(self): dt = 0.002 length = 1 s = ricker(len=length, dt=dt) assert len(s) == int(length / dt) def test_input_check_f(self): with pytest.raises(ValueError): ricker(f=0) ...
import pytest from ricker.ricker import ricker class TestRicker: def test_output_number(self): assert len(ricker()) == 2 def test_default_output(self): t, s = ricker() assert len(t) == len(s) def test_error(self): with pytest.raises(ValueError): ricker(f=0)
mit
Python
298b85a7c36e536a985b7ccffc8fefa135baa187
Fix TestRunner test case
bosondata/badwolf,bosondata/badwolf,bosondata/badwolf
tests/test_runner.py
tests/test_runner.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import os import tempfile from multiprocessing import Lock import git import mock import pytest from badwolf.runner import TestContext, TestRunner from badwolf.bitbucket import PullRequest, Changesets @pytest.fixture(scope='function') ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from multiprocessing import Lock import git import mock import pytest from badwolf.runner import TestContext, TestRunner @pytest.fixture(scope='function') def push_context(): return TestContext( 'deepanalyzer/badwolf', ...
mit
Python
050e6ee000e89fb0ebeff5dcb2b6d79b10e92069
Fix monkeypatching for older scipy versions
audiolabs/stft
tests/test_things.py
tests/test_things.py
from __future__ import division import stft import numpy import pytest @pytest.fixture(params=[1, 2]) def channels(request): return request.param @pytest.fixture(params=[0, 1, 4]) def padding(request): return request.param @pytest.fixture(params=[2048]) def length(request): return request.param @pyt...
from __future__ import division import stft import numpy import pytest @pytest.fixture(params=[1, 2]) def channels(request): return request.param @pytest.fixture(params=[0, 1, 4]) def padding(request): return request.param @pytest.fixture(params=[2048]) def length(request): return request.param @pyt...
mit
Python
893e09b14eabff3a6ec2ff87db0499bc3fd2a213
fix tests to use forced aligner
lowerquality/gentle,lowerquality/gentle,lowerquality/gentle,lowerquality/gentle
tests/transcriber.py
tests/transcriber.py
import os import unittest class Aligner(unittest.TestCase): audio = 'examples/data/lucier.mp3' transcript = "i am sitting in a room" def test_resources(self): from gentle import Resources from gentle.util.paths import get_binary resources = Resources() k3 = get_binary("ext...
import os import unittest class Transcriber(unittest.TestCase): audio = 'examples/data/lucier.mp3' def test_resources(self): from gentle import Resources from gentle.util.paths import get_binary resources = Resources() k3 = get_binary("ext/k3") self.assertEqual(os.pat...
mit
Python
72e948719145579eb7dfb9385b921f8eb6ea1384
Add more exemplar primitive generators
maxalbert/tohu
tests/v4/conftest.py
tests/v4/conftest.py
from .context import tohu from tohu.v4.primitive_generators import * from tohu.v4.derived_generators import * __all__ = ['EXEMPLAR_GENERATORS', 'EXEMPLAR_PRIMITIVE_GENERATORS', 'EXEMPLAR_DERIVED_GENERATORS'] def add(x, y): return x + y EXEMPLAR_PRIMITIVE_GENERATORS = [ Boolean(p=0.3), Constant("quux"), ...
from .context import tohu from tohu.v4.primitive_generators import * from tohu.v4.derived_generators import * __all__ = ['EXEMPLAR_GENERATORS', 'EXEMPLAR_PRIMITIVE_GENERATORS', 'EXEMPLAR_DERIVED_GENERATORS'] def add(x, y): return x + y EXEMPLAR_PRIMITIVE_GENERATORS = [ Constant("quux"), Integer(100, 200...
mit
Python
e6305725a57bd6daca24e66699a8e3b0ead8d866
Split long line
cgeoffroy/son-analyze,cgeoffroy/son-analyze
utils/ci/topology_integration.py
utils/ci/topology_integration.py
#!/usr/bin/env python2 # pylint: disable=missing-docstring import time import signal import threading from emuvim.dcemulator.net import DCNetwork from mininet.node import RemoteController from emuvim.api.sonata import SonataDummyGatekeeperEndpoint class SigTermCatcher: def __init__(self, net): self.net =...
#!/usr/bin/env python2 # pylint: disable=missing-docstring import time import signal import threading from emuvim.dcemulator.net import DCNetwork from mininet.node import RemoteController from emuvim.api.sonata import SonataDummyGatekeeperEndpoint class SigTermCatcher: def __init__(self, net): self.net =...
apache-2.0
Python
d49997058c54bfeabe21a7284bdf3cf07c76075b
add doc
tencentyun/Cloud-Image-Migration-Tool,tencentyun/Cloud-Image-Migration-Tool,JamisHoo/Cloud-Image-Migration-Tool,JamisHoo/Cloud-Image-Migration-Tool
usr/sbin/local_fs_job_manager.py
usr/sbin/local_fs_job_manager.py
#!/usr/bin/env python ############################################################################### # Copyright (c) 2015 Tencent Inc. # Distributed under the MIT license # (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT) # # Project: Cloud Image Migration Tool # Filename: lo...
#!/usr/bin/env python ############################################################################### # Copyright (c) 2015 Tencent Inc. # Distributed under the MIT license # (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT) # # Project: Cloud Image Migration Tool # Filename: lo...
mit
Python
12d22221df5786caee510cc167c9ef29f9155488
Correct name of output file
DanielAndreasen/FASMA-web,DanielAndreasen/FASMA-web,DanielAndreasen/FASMA-web,DanielAndreasen/FASMA-web
var/www/cgi-bin/abundanceConf.py
var/www/cgi-bin/abundanceConf.py
#!/home/daniel/Software/anaconda3/bin/python # Import modules for CGI handling import cgi, cgitb from abundanceDriver import abundancedriver from emailSender import sendEmail def cgi2dict(form): """Convert the form from cgi.FieldStorage to a python dictionary""" params = {} for key in form.keys(): ...
#!/home/daniel/Software/anaconda3/bin/python # Import modules for CGI handling import cgi, cgitb from abundanceDriver import abundancedriver from emailSender import sendEmail def cgi2dict(form): """Convert the form from cgi.FieldStorage to a python dictionary""" params = {} for key in form.keys(): ...
mit
Python
ced3fd5fc8945fbb0ac79b3e90833173b1c72e93
disable not callable
djaodjin/djaodjin-pages,djaodjin/djaodjin-pages,smirolo/djaodjin-pages,smirolo/djaodjin-pages,djaodjin/djaodjin-pages
pages/tasks.py
pages/tasks.py
from celery import task from pages.models import UploadedImage from pages.settings import IMG_PATH # XXX - not callable on pylint! @task()#pylint: disable=not-callable def upload_to_s3(img, account, tags, filename): img_obj = UploadedImage( img=img, account=account, ...
from celery import task from pages.models import UploadedImage from pages.settings import IMG_PATH @task() def upload_to_s3(img, account, tags, filename): img_obj = UploadedImage( img=img, account=account, tags=tags ) img_obj.save() print filen...
bsd-2-clause
Python
08b5ccc5ff94ced8d582d1f023901d2ea25aca53
Disable timeout on reindex
davidbgk/udata,grouan/udata,davidbgk/udata,grouan/udata,davidbgk/udata,jphnoel/udata,etalab/udata,jphnoel/udata,etalab/udata,opendatateam/udata,jphnoel/udata,opendatateam/udata,opendatateam/udata,etalab/udata,grouan/udata
udata/core/search/commands.py
udata/core/search/commands.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from udata.commands import manager from udata.search import es, adapter_catalog log = logging.getLogger(__name__) @manager.option('-t', '--type', dest='doc_type', default=None, help='Only reindex a given type') def reindex(doc_type=None...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from udata.commands import manager from udata.search import es, adapter_catalog log = logging.getLogger(__name__) @manager.option('-t', '--type', dest='doc_type', default=None, help='Only reindex a given type') def reindex(doc_type=None...
agpl-3.0
Python
f577ff84c7231dff4fe01e7e9b73f1b497993b41
remove commented out code and debug statements.
openxc/openxc-python,openxc/openxc-python,openxc/openxc-python
openxc/tools/obd2scanner.py
openxc/tools/obd2scanner.py
""" This module contains the methods for the ``openxc-obd2scanner`` command line program. `main` is executed when ``openxc-obd2scanner`` is run, and all other callables in this module are internal only. """ import argparse from .common import device_options, configure_logging, select_device import json def scan(co...
""" This module contains the methods for the ``openxc-obd2scanner`` command line program. `main` is executed when ``openxc-obd2scanner`` is run, and all other callables in this module are internal only. """ import argparse from .common import device_options, configure_logging, select_device import json def scan(co...
bsd-3-clause
Python
24b8e2f7440926d6d1c384a7289dfb5d1124e82f
Add article on core admin
YACOWS/opps,opps/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,opps/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,opps/opps,jeanmask/opps,opps/opps,williamroot/opps
opps/core/admin/__init__.py
opps/core/admin/__init__.py
# -*- coding: utf-8 -*- from opps.core.admin.article import * from opps.core.admin.channel import * from opps.core.admin.profile import * from opps.core.admin.source import *
# -*- coding: utf-8 -*- from opps.core.admin.channel import * from opps.core.admin.profile import * from opps.core.admin.source import *
mit
Python
cf096184562d723d321f179732aa25f03be35c6d
build graphs without saving the dents
thammi/digger
auto_fetch.py
auto_fetch.py
#!/usr/bin/env python ############################################################################### ## ## digger - Digging into some data mines ## Copyright (C) 2010 Thammi ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU Affero General Public License as pu...
#!/usr/bin/env python ############################################################################### ## ## digger - Digging into some data mines ## Copyright (C) 2010 Thammi ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU Affero General Public License as pu...
agpl-3.0
Python
ea416504c287bc5a3716289b57ebfd15bb770b9d
Use a string instead of a file
eXcomm/gratipay.com,studio666/gratipay.com,eXcomm/gratipay.com,gratipay/gratipay.com,eXcomm/gratipay.com,mccolgst/www.gittip.com,mccolgst/www.gittip.com,studio666/gratipay.com,mccolgst/www.gittip.com,gratipay/gratipay.com,eXcomm/gratipay.com,mccolgst/www.gittip.com,gratipay/gratipay.com,studio666/gratipay.com,studio666...
sql/branch.py
sql/branch.py
import sys from gratipay import wireup env = wireup.env() db = wireup.db(env) # Temporary, will fill with actual values when running script email_txt = """ rohitpaulk@live.com abcd@gmail.com """ emails = [email.strip() for email in email_txt.split()] assert len(emails) == 176 participants = [] participan...
from gratipay import wireup env = wireup.env() db = wireup.db(env) participants = [] with open('./sql/emails.txt') as f: emails = [line.rstrip() for line in f] participants = db.all(""" SELECT p.*::participants FROM participants p WHERE email_address IN %s """, (tuple(emails), ...
mit
Python
36e3ee242098f1768e009fca320c5d94142529d1
set debug to false
tmthyjames/Achoo,tmthyjames/Achoo,tmthyjames/Achoo,tmthyjames/Achoo,tmthyjames/Achoo
ui/app.py
ui/app.py
from flask import Flask, redirect, url_for, flash, g, config, session from flask_restful import Api from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager, UserMixin, current_user, login_user from werkzeug.security import generate_password_hash, check_password_hash from flask_restful import Resour...
from flask import Flask, redirect, url_for, flash, g, config, session from flask_restful import Api from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager, UserMixin, current_user, login_user from werkzeug.security import generate_password_hash, check_password_hash from flask_restful import Resour...
mit
Python
6f155538c02a25fcdd038c703d78f8785dfc9da8
Add most cache functionality
bewt85/genbankfs
genbankfs/cache.py
genbankfs/cache.py
import hashlib import os import socket import urllib from Queue import Queue, Full, Empty from StringIO import StringIO from threading import Lock, Thread # Set download timeout socket.setdefaulttimeout(600) class DownloadError(Exception): pass class DownloadWithExceptions(urllib.FancyURLopener): def error(self...
class GenbankCache(object): pass
mit
Python
bd1ae8fbcbcdfc649c765259f543f52a5a21c303
Reset root logger before setting up logging
agdsn/hades,agdsn/hades,agdsn/hades,agdsn/hades,agdsn/hades
src/hades/common/cli.py
src/hades/common/cli.py
import argparse import logging import os import sys from gettext import gettext as _ from hades import constants class ArgumentParser(argparse.ArgumentParser): """ ArgumentParser subclass that exists with os.EX_USAGE exit code if parsing fails. """ def error(self, message): self.print_usa...
import argparse import logging import os import sys from gettext import gettext as _ from hades import constants class ArgumentParser(argparse.ArgumentParser): """ ArgumentParser subclass that exists with os.EX_USAGE exit code if parsing fails. """ def error(self, message): self.print_usa...
mit
Python
e0280150917934e9ba051966e8aa966d4cd43a6d
fix flake warning try 2
persandstrom/python-verisure
verisure/devices/smartplug.py
verisure/devices/smartplug.py
""" Smartplug device """ import time from .overview import Overview OVERVIEW_URL = '/overview/smartplug' COMMAND_URL = '/smartplugs/onoffplug.cmd' DETAILS_URL = '/smarthome/{}/details' class Smartplug(object): """ Smartplug device Args: session (verisure.session): Current session """ def _...
""" Smartplug device """ import time from .overview import Overview OVERVIEW_URL = '/overview/smartplug' COMMAND_URL = '/smartplugs/onoffplug.cmd' DETAILS_URL = '/smarthome/{}/details' class Smartplug(object): """ Smartplug device Args: session (verisure.session): Current session """ def _...
mit
Python
ec2dfafd0501b29c7ab70489349dd0d0cf048328
cover exception case
thatcr/knowed
src/area51/nowd/test/test_args_fib.py
src/area51/nowd/test/test_args_fib.py
from pytest import raises from .. import nowd, NowdObject, LoggingScope class FibThing(NowdObject): @nowd def Fib(self, x): if x < 0: raise ValueError('cannot calculate fib < 0') if x == 0 or x == 1: return 1 return self.Fib(x-1) + self.Fib(x-2) def test_args_f...
from .. import nowd, NowdObject, LoggingScope class FibThing(NowdObject): @nowd def Fib(self, x): if x < 0: raise ValueError('cannot calculate fib < 0') if x == 0 or x == 1: return 1 return self.Fib(x-1) + self.Fib(x-2) def test_args_fib(): thing = FibThing...
mit
Python
d301cfc0e8f76c94f8f3bcd1b0263f9bd6e1604c
Add call_decorator to RedisManager.
vishwaprakashmishra/xmatrix,harrissoerja/vumi,TouK/vumi,vishwaprakashmishra/xmatrix,TouK/vumi,harrissoerja/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,TouK/vumi
vumi/persist/redis_manager.py
vumi/persist/redis_manager.py
# -*- test-case-name: vumi.persist.tests.test_redis_manager -*- import redis from vumi.persist.redis_base import Manager from vumi.persist.fake_redis import FakeRedis from vumi.persist.riak_manager import flatten_generator class RedisManager(Manager): call_decorator = staticmethod(flatten_generator) @clas...
# -*- test-case-name: vumi.persist.tests.test_redis_manager -*- import redis from vumi.persist.redis_base import Manager from vumi.persist.fake_redis import FakeRedis class RedisManager(Manager): @classmethod def _fake_manager(cls, key_prefix, client=None): if client is None: client = Fa...
bsd-3-clause
Python
8320b81b7355c0158231b4a3c7ac40c49872f7b1
handle partial pbuttons in ss tab
murrayo/yape,murrayo/yape,murrayo/yape
scripts/ss_tab.py
scripts/ss_tab.py
# pandas and numpy for data manipulation import pandas as pd import numpy as np import sqlite3 import holoviews as hv hv.extension('bokeh') from bokeh.plotting import Figure from bokeh.models import (CategoricalColorMapper, HoverTool, ColumnDataSource, Panel, FuncTickFormatter, SingleIntervalTicker, L...
# pandas and numpy for data manipulation import pandas as pd import numpy as np import sqlite3 import holoviews as hv hv.extension('bokeh') from bokeh.plotting import Figure from bokeh.models import (CategoricalColorMapper, HoverTool, ColumnDataSource, Panel, FuncTickFormatter, SingleIntervalTicker, L...
mit
Python
64967f3d262a1823a5d0cd22fb096f9529e6aa98
resolve flake8 linting errors
watsonpy/watson-validators
watson/validators/__init__.py
watson/validators/__init__.py
# -*- coding: utf-8 -*- __version__ = '1.0.6' try: # Fix for setup.py version import from watson.validators.numeric import Range from watson.validators.string import Length, Required, RegEx, Csrf __all__ = ['Range', 'Length', 'Required', 'RegEx', 'Csrf'] except: # noqa, pragma: no cover pass # p...
# -*- coding: utf-8 -*- __version__ = '1.0.6' try: # Fix for setup.py version import from watson.validators.numeric import Range from watson.validators.string import Length, Required, RegEx, Csrf __all__ = ['Range', 'Length', 'Required', 'RegEx', 'Csrf'] except: # pragma: no cover pass # pragma:...
bsd-3-clause
Python
5aa594d02bfcdfe5eefe90fad1e464070b6ae9b5
Update common.py
suzannerohrback/somaticCNVpipeline,suzannerohrback/somaticCNVpipeline
bin/common.py
bin/common.py
#!/usr/bin/python import os import multiprocessing as mp import subprocessing as sub import shlex def fixDirName(dirpath): if dirpath[-1] != '/': dirpath += '/' return dirpath def makeDir(dirpath): if not os.path.exists(dirpath): os.mkdir(dirpath) return 0 def importSampleList(infile): ...
#!/usr/bin/python import os import multiprocessing as mp import subprocessing as sub import shlex def fixDirName(dirpath): if dirpath[-1] != '/': dirpath += '/' return dirpath def makeDir(dirpath): if not os.path.exists(dirpath): os.mkdir(dirpath) return 0 def importSampleList(infile): ...
mit
Python
534d66ff92e6fd00ea92a08c76f39614b9977967
make it compatible to python3
crackwitz/uuhash
uuhash.py
uuhash.py
#!/usr/bin/env python3 import os import hashlib import binascii import struct __all__ = ["UUHash"] # https://en.wikipedia.org/wiki/UUHash # MLDonkey source code, file src/utils/lib/fst_hash.c, retrieved 2014-08-20 # http://sourceforge.net/projects/mldonkey/files/mldonkey/3.1.5/mldonkey-3.1.5.tar.bz2 # http://www.o...
#!/usr/bin/env python import os import hashlib import binascii import struct __all__ = ["UUHash"] # https://en.wikipedia.org/wiki/UUHash # MLDonkey source code, file src/utils/lib/fst_hash.c, retrieved 2014-08-20 # http://sourceforge.net/projects/mldonkey/files/mldonkey/3.1.5/mldonkey-3.1.5.tar.bz2 # http://www.op...
mit
Python
ae179cf964939a97184402039574d7ee9b2e62da
Add BlogPost update test
andreagrandi/bloggato,andreagrandi/bloggato
blog/tests.py
blog/tests.py
from django.test import TestCase from .models import BlogPost from django.contrib.auth.models import User class BlogTest(TestCase): def setUp(self): self.user = User.objects.create_user(username = "user001", email = "email@domain.com", password = "password123456") def test_post_creation(self): ...
from django.test import TestCase from .models import BlogPost from django.contrib.auth.models import User class BlogTest(TestCase): def setUp(self): self.user = User.objects.create_user(username = "user001", email = "email@domain.com", password = "password123456") def test_post_creation(self): ...
mit
Python
59851b283b8cb6f92895090ba23e71be48f1a990
remove distinction between sfa aggregate and geni_aggregate
yippeecw/sfa,yippeecw/sfa,onelab-eu/sfa,onelab-eu/sfa,yippeecw/sfa,onelab-eu/sfa
sfa/methods/GetVersion.py
sfa/methods/GetVersion.py
from sfa.util.faults import * from sfa.util.namespace import * from sfa.util.method import Method from sfa.util.parameter import Parameter class GetVersion(Method): """ Returns this GENI Aggregate Manager's Version Information @return version """ interfaces = ['registry','aggregate', 'slicemgr', '...
from sfa.util.faults import * from sfa.util.namespace import * from sfa.util.method import Method from sfa.util.parameter import Parameter class GetVersion(Method): """ Returns this GENI Aggregate Manager's Version Information @return version """ interfaces = ['geni_am','registry'] accepts = [...
mit
Python
7dd344129e2ae30a857f72fdf61dca6e40768983
fix city field duplication (#17919)
ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo
addons/base_address_city/models/res_partner.py
addons/base_address_city/models/res_partner.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from lxml import etree from odoo import api, models, fields class Partner(models.Model): _inherit = 'res.partner' country_enforce_cities = fields.Boolean(related='country_id.enforce_cities') city_id = fiel...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from lxml import etree from odoo import api, models, fields class Partner(models.Model): _inherit = 'res.partner' country_enforce_cities = fields.Boolean(related='country_id.enforce_cities') city_id = fiel...
agpl-3.0
Python
7a105fe9201882749a7415bff580b9588b7f9a46
update version number
scigghia/account-invoicing,archetipo/account-invoicing,acsone/account-invoicing,kmee/account-invoicing,gurneyalex/account-invoicing,brain-tec/account-invoicing,Noviat/account-invoicing,acsone/account-invoicing,open-synergy/account-invoicing,akretion/account-invoicing,kmee/account-invoicing,eezee-it/account-invoicing,br...
account_invoice_line_description/__openerp__.py
account_invoice_line_description/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Agile Business Group sagl # (<http://www.agilebg.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public ...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Agile Business Group sagl # (<http://www.agilebg.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public ...
agpl-3.0
Python
b20d07aa14d3c11d5509e96fd4911de5886afe28
fix order for AttributeViewSet
rdmorganiser/rdmo,DMPwerkzeug/DMPwerkzeug,DMPwerkzeug/DMPwerkzeug,rdmorganiser/rdmo,rdmorganiser/rdmo,DMPwerkzeug/DMPwerkzeug
apps/domain/views.py
apps/domain/views.py
from django.shortcuts import render from django.contrib.auth.decorators import login_required from rest_framework import viewsets, mixins, filters from rest_framework.permissions import DjangoModelPermissions, IsAuthenticated from .models import * from .serializers import * @login_required() def domain(request): ...
from django.shortcuts import render from django.contrib.auth.decorators import login_required from rest_framework import viewsets, mixins, filters from rest_framework.permissions import DjangoModelPermissions, IsAuthenticated from .models import * from .serializers import * @login_required() def domain(request): ...
apache-2.0
Python
34035c4b272e9271834c531990c404940eee8633
Add a link between vote and subproposal
yohanboniface/memopol-core,yohanboniface/memopol-core,yohanboniface/memopol-core
apps/votes/models.py
apps/votes/models.py
from django.db import models from meps.models import MEP class Proposal(models.Model): id = models.CharField(max_length=63, primary_key=True) title = models.CharField(max_length=255, unique=True) class SubProposal(models.Model): datetime = models.DateTimeField() subject = models.CharField(max_length=2...
from django.db import models from meps.models import MEP class Proposal(models.Model): id = models.CharField(max_length=63, primary_key=True) title = models.CharField(max_length=255, unique=True) class SubProposal(models.Model): datetime = models.DateTimeField() subject = models.CharField(max_length=2...
agpl-3.0
Python
a2082e319854f88842e3acf8244d38a81f7046ae
Add secure/insecure reverse helpers.
messense/djsubdomains,ipsosante/django-subdomains,mysociety/django-subdomains,aajtodd/django-subdomains,jangeador/django-subdomains,adi-li/django-subdomains,nanopony/django-subdomains,tkaemming/django-subdomains,larikov/django-subdomains
subdomains/utils.py
subdomains/utils.py
import functools from urlparse import urlunparse from django.conf import settings from django.contrib.sites.models import Site from django.core.urlresolvers import reverse as simple_reverse def urljoin(domain, path=None, scheme=None): if path is None: path = '' if scheme is None: scheme = ge...
from urlparse import urlunparse from django.conf import settings from django.contrib.sites.models import Site from django.core.urlresolvers import reverse as simple_reverse def urljoin(domain, path=None, scheme=None): if path is None: path = '' if scheme is None: scheme = getattr(settings, '...
mit
Python
8315fb3fb1b7ef65b9c1ced4feaeb473863495f5
Remove current_site_domain
messense/djsubdomains
subdomains/utils.py
subdomains/utils.py
import functools try: from urlparse import urlunparse except ImportError: from urllib.parse import urlunparse from django.conf import settings from django.core.urlresolvers import reverse as simple_reverse def get_domain(): domain = getattr(settings, 'BASE_DOMAIN', False) prefix = 'www.' if geta...
import functools try: from urlparse import urlunparse except ImportError: from urllib.parse import urlunparse from django.conf import settings from django.core.urlresolvers import reverse as simple_reverse def current_site_domain(): domain = getattr(settings, 'BASE_DOMAIN', False) prefix = 'www.' ...
mit
Python
496481e3bd6392a44788fadc7cf517fc36143e96
Change to cb_story, clean up TZ handling some more
willkg/douglas,daitangio/pyblosxom,willkg/douglas,daitangio/pyblosxom
contrib/plugins/w3cdate.py
contrib/plugins/w3cdate.py
""" Add a 'w3cdate' key to every entry -- this contains the date in ISO8601 format WARNING: you must have PyXML installed as part of your python installation in order for this plugin to work Place this plugin early in your load_plugins list, so that the w3cdate will be available to subsequent plugins """ __author__ ...
""" Add a 'w3cdate' key to every entry -- this contains the date in ISO8601 format WARNING: you must have PyXML installed as part of your python installation in order for this plugin to work Place this plugin early in your load_plugins list, so that the w3cdate will be available to subsequent plugins """ __author__ ...
mit
Python
b43a70a045ae9efbc06d407dd17fe97804a238a1
Cover art discovery: handle badly encoded files
spl0k/supysonic,spl0k/supysonic,spl0k/supysonic
supysonic/covers.py
supysonic/covers.py
# coding: utf-8 # # This file is part of Supysonic. # Supysonic is a Python implementation of the Subsonic server API. # # Copyright (C) 2018 Alban 'spl0k' Féron # # Distributed under terms of the GNU AGPLv3 license. import os, os.path import re from PIL import Image EXTENSIONS = ('.jpg', '.jpeg', '.png', '.bmp') NA...
# coding: utf-8 # # This file is part of Supysonic. # Supysonic is a Python implementation of the Subsonic server API. # # Copyright (C) 2018 Alban 'spl0k' Féron # # Distributed under terms of the GNU AGPLv3 license. import os, os.path import re from PIL import Image EXTENSIONS = ('.jpg', '.jpeg', '.png', '.bmp') NA...
agpl-3.0
Python
e5e83b75e250ee3c6d8084e23ee777d519293cb6
Fix for keystone / swift 1.8.0
spilgames/swprobe,spilgames/swprobe
swprobe/__init__.py
swprobe/__init__.py
# Copyright (c) 2012 Spil Games # # 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 (c) 2012 Spil Games # # 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
dde25723c845ad4f6df72729e76174210b16e71c
remove redundant code
IMAMBAKS/pyrelatics
test/test_client.py
test/test_client.py
import pytest from pyrelatics.client import * def test_relaticsapi_raise_exception_with_dummy_url(): with pytest.raises(URLError): RelaticsAPI('dummy_company', 'dummy_env_id', 'dummy_wid') def test_relaticsapi_initializes_properties(): relaticsapi = RelaticsAPI('kb', 'dummy_env_id', 'dummy_wid') ...
import pytest from pyrelatics.client import * def test_relaticsapi_raise_exception_with_dummy_url(): with pytest.raises(URLError): relaticsapi = RelaticsAPI('dummy_company', 'dummy_env_id', 'dummy_wid') def test_relaticsapi_initializes_properties(): relaticsapi = RelaticsAPI('kb', 'dummy_env_id', '...
mit
Python
9fa55bc43a3f83a57318799ba8b9f2769676bd44
Include the tags module tests in the full library testsuite.
wulczer/flvlib
test/test_flvlib.py
test/test_flvlib.py
import unittest import test_primitives, test_astypes, test_helpers, test_tags def get_suite(): modules = (test_primitives, test_astypes, test_helpers, test_tags) suites = [unittest.TestLoader().loadTestsFromModule(module) for module in modules] return unittest.TestSuite(suites) def main(): ...
import unittest import test_primitives, test_astypes, test_helpers def get_suite(): modules = (test_primitives, test_astypes, test_helpers) suites = [unittest.TestLoader().loadTestsFromModule(module) for module in modules] return unittest.TestSuite(suites) def main(): unittest.TextTestRu...
mit
Python
1598a865094591cbfd1e4e37eddb905fffd1d9b0
improve and extend unit tests for Logfile
berquist/cclib,berquist/cclib,andersx/cclib,ben-albrecht/cclib,ben-albrecht/cclib,cclib/cclib,gaursagar/cclib,jchodera/cclib,ATenderholt/cclib,berquist/cclib,jchodera/cclib,ghutchis/cclib,cclib/cclib,langner/cclib,langner/cclib,andersx/cclib,cclib/cclib,ATenderholt/cclib,gaursagar/cclib,Schamnad/cclib,Schamnad/cclib,gh...
test/test_parser.py
test/test_parser.py
# This file is part of cclib (http://cclib.github.io), a library for parsing # and interpreting the results of computational chemistry packages. # # Copyright (C) 2015, the cclib development team # # The library is free software, distributed under the terms of # the GNU Lesser General Public version 2.1 or later. You s...
# This file is part of cclib (http://cclib.github.io), a library for parsing # and interpreting the results of computational chemistry packages. # # Copyright (C) 2015, the cclib development team # # The library is free software, distributed under the terms of # the GNU Lesser General Public version 2.1 or later. You s...
bsd-3-clause
Python
2250fcaefc1b69116684c72c559a44ee1d6721b6
change component count back to 4 in dp 2-cluster test
whitews/dpconverge
test_dp_2cluster.py
test_dp_2cluster.py
from dpconverge.data_set import DataSet from sklearn.datasets.samples_generator import make_blobs n_features = 2 points_per_feature = 100 centers = [[2, 2], [4, 4]] ds = DataSet(parameter_count=2) for i, center in enumerate(centers): X, y = make_blobs( n_samples=points_per_feature, n_features=n_...
from dpconverge.data_set import DataSet from sklearn.datasets.samples_generator import make_blobs n_features = 2 points_per_feature = 100 centers = [[2, 2], [4, 4]] ds = DataSet(parameter_count=2) for i, center in enumerate(centers): X, y = make_blobs( n_samples=points_per_feature, n_features=n_...
bsd-3-clause
Python
2ee45754c73a344d2cdbc0007a5a7877ba45288e
improve output, calculate frequencies at non-singletons
mateidavid/nanopolish,mateidavid/nanopolish,jts/nanopolish,jts/nanopolish,jts/nanopolish,mateidavid/nanopolish,mateidavid/nanopolish,jts/nanopolish,jts/nanopolish,mateidavid/nanopolish
scripts/calculate_methylation_frequency.py
scripts/calculate_methylation_frequency.py
#! /usr/bin/env python import math import sys import csv import argparse from collections import namedtuple class SiteStats: def __init__(self, g_size, g_seq): self.num_reads = 0 self.posterior_methylated = 0 self.called_sites = 0 self.called_sites_methylated = 0 self.group...
#! /usr/bin/env python import math import sys import csv import argparse from collections import namedtuple class SiteStats: def __init__(self): self.num_reads = 0 self.posterior_methylated = 0 self.called_sites = 0 self.called_sites_methylated = 0 parser = argparse.ArgumentParser...
mit
Python
6a0c3d0dc5f0106fdc1f7682fa65eabfb5c9d250
Set version as 0.6.12
Alignak-monitoring-contrib/alignak-webui,Alignak-monitoring-contrib/alignak-webui,Alignak-monitoring-contrib/alignak-webui
alignak_webui/version.py
alignak_webui/version.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015-2017: # Frederic Mohier, frederic.mohier@alignak.net # """ Alignak - Web User Interface """ # Package name __pkg_name__ = u"alignak_webui" # Checks types for PyPI keywords # Used for: # - PyPI keywords # - directory where to store files in the ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015-2017: # Frederic Mohier, frederic.mohier@alignak.net # """ Alignak - Web User Interface """ # Package name __pkg_name__ = u"alignak_webui" # Checks types for PyPI keywords # Used for: # - PyPI keywords # - directory where to store files in the ...
agpl-3.0
Python
b4013acd97851b041a47afa87e0da137e556ca3f
sort the output
jmtd/freedoom,CWolfRU/freedoom,jmtd/freedoom,CWolfRU/freedoom,jmtd/freedoom
tools/gen_gallery.py
tools/gen_gallery.py
#!/usr/bin/python import os,sys,re # this sucks patches = [ x for x in os.listdir('.') if re.match(r'.*\.gif$', x) ] patches.sort() print '''<style type="text/css"> div { float: left; width: 20%; } </style> ''' print ''.join(['<div><img src="%s" /><br />%s</div>' % (x,x) for x in patches])
#!/usr/bin/python import os,sys,re # this sucks patches = [ x for x in os.listdir('.') if re.match(r'.*\.gif$', x) ] print '''<style type="text/css"> div { float: left; width: 20%; } </style> ''' print ''.join(['<div><img src="%s" /><br />%s</div>' % (x,x) for x in patches])
bsd-3-clause
Python
35f8ac20ec5ef830f264ba51bcb5df5af72b24d6
mask out HC3N features
adamginsburg/APEX_CMZ_H2CO,keflavich/APEX_CMZ_H2CO,keflavich/APEX_CMZ_H2CO,adamginsburg/APEX_CMZ_H2CO
analysis/masked_cubes.py
analysis/masked_cubes.py
import numpy as np from spectral_cube import SpectralCube,BooleanArrayMask from astropy import units as u from paths import hpath from astropy.io import fits import time from astropy import log t0 = time.time() hc3n_regions = [{'v':(-101,55), 'x':(500,533), 'y':(108,133),}, ...
import numpy as np from spectral_cube import SpectralCube,BooleanArrayMask from astropy import units as u from paths import hpath from astropy.io import fits import time from astropy import log t0 = time.time() cube303 = SpectralCube.read(hpath('APEX_H2CO_303_202_bl.fits')).with_spectral_unit(u.km/u.s, velocity_conve...
bsd-3-clause
Python
79f8f6c922e6f0be3f6bf62c13cbe6dc9c50366a
Remove project_config dependency
hackoregon/team-budget,hackoregon/team-budget,hackoregon/team-budget
budget_proj/budget_proj/settings/production.py
budget_proj/budget_proj/settings/production.py
import requests from .base import * import os # from .. import project_config SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY') # ALLOWED_HOSTS = project_config.ALLOWED_HOSTS ALLOWED_HOSTS = ['*'] # Get the IPV4 address we're working with on AWS # The Loadbalancer uses this ip address for healthchecks # EC2_PRIVATE...
import requests from .base import * from .. import project_config SECRET_KEY = project_config.DJANGO_SECRET_KEY ALLOWED_HOSTS = project_config.ALLOWED_HOSTS # Get the IPV4 address we're working with on AWS # The Loadbalancer uses this ip address for healthchecks EC2_PRIVATE_IP = None try: EC2_PRIVATE_IP = requ...
mit
Python
02360f5251ac308f45cb210a305fa225a056e1be
add travis config for keen public read key
rdhyee/osf.io,chrisseto/osf.io,caneruguz/osf.io,emetsger/osf.io,felliott/osf.io,erinspace/osf.io,CenterForOpenScience/osf.io,aaxelb/osf.io,monikagrabowska/osf.io,binoculars/osf.io,mluo613/osf.io,caneruguz/osf.io,SSJohns/osf.io,crcresearch/osf.io,Johnetordoff/osf.io,crcresearch/osf.io,wearpants/osf.io,baylee-d/osf.io,we...
website/settings/local-travis.py
website/settings/local-travis.py
# -*- coding: utf-8 -*- '''Example settings/local.py file. These settings override what's in website/settings/defaults.py NOTE: local.py will not be added to source control. ''' import inspect from . import defaults import os DB_PORT = 27017 DEV_MODE = True DEBUG_MODE = True # Sets app to debug mode, turns off tem...
# -*- coding: utf-8 -*- '''Example settings/local.py file. These settings override what's in website/settings/defaults.py NOTE: local.py will not be added to source control. ''' import inspect from . import defaults import os DB_PORT = 27017 DEV_MODE = True DEBUG_MODE = True # Sets app to debug mode, turns off tem...
apache-2.0
Python
47c2936e65d00a08896b4e60060ff737b7a2f675
Check that the permission migrations work
comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django
app/tests/workstations_tests/test_migrations.py
app/tests/workstations_tests/test_migrations.py
import pytest from django.db import connection from django.db.migrations.executor import MigrationExecutor from guardian.shortcuts import get_perms from grandchallenge.workstations.models import Workstation from tests.factories import UserFactory @pytest.mark.django_db(transaction=True) def test_workstation_group_mi...
import pytest from django.db import connection from django.db.migrations.executor import MigrationExecutor @pytest.mark.django_db(transaction=True) def test_workstation_group_migration(): executor = MigrationExecutor(connection) app = "workstations" migrate_from = [(app, "0001_initial")] migrate_to = ...
apache-2.0
Python
f92b27c1ea241f381e41ef9b20bc6e75fc03c159
Add OCA as author
bluestar-solutions/account-invoicing,gurneyalex/account-invoicing,akretion/account-invoicing,brain-tec/account-invoicing,raycarnes/account-invoicing,BT-fgarbely/account-invoicing,Trust-Code/account-invoicing,open-synergy/account-invoicing,iDTLabssl/account-invoicing,scigghia/account-invoicing,Elneo-group/account-invoic...
account_invoice_merge_payment/__openerp__.py
account_invoice_merge_payment/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # This file is part of account_invoice_merge_payment, # an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # account_invoice_merge_payment is free software: # you can redi...
# -*- coding: utf-8 -*- ############################################################################## # # This file is part of account_invoice_merge_payment, # an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # account_invoice_merge_payment is free software: # you can redi...
agpl-3.0
Python
ca27ff5efa987ce413d7e7f43c49fad189930aed
Fix missing migration dependency
stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten
entities/migrations/0045_auto_20160922_1330.py
entities/migrations/0045_auto_20160922_1330.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-09-22 11:30 from __future__ import unicode_literals from django.db import migrations def set_groupcontent_group(apps, schema_editor): Group1 = apps.get_model('entities.Group') Group2 = apps.get_model('groups.Group') GroupContent = apps.get_mode...
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-09-22 11:30 from __future__ import unicode_literals from django.db import migrations def set_groupcontent_group(apps, schema_editor): Group1 = apps.get_model('entities.Group') Group2 = apps.get_model('groups.Group') GroupContent = apps.get_mode...
agpl-3.0
Python
72ba3a0401ad08d4df2fdc03b326eab16af47832
Bump version to 0.4.2.dev1
team23/django_backend,team23/django_backend,team23/django_backend,team23/django_backend,team23/django_backend
django_backend/__init__.py
django_backend/__init__.py
from .backend.renderable import Renderable # noqa from .group import Group # noqa from .sitebackend import SiteBackend __version__ = '0.4.2.dev1' default_app_config = 'django_backend.apps.DjangoBackendConfig' site = SiteBackend(id='backend')
from .backend.renderable import Renderable # noqa from .group import Group # noqa from .sitebackend import SiteBackend __version__ = '0.4.1' default_app_config = 'django_backend.apps.DjangoBackendConfig' site = SiteBackend(id='backend')
bsd-3-clause
Python
6dd3b2f7844e670b8774aa0afd25b83f60753703
make sure django is setup before importing
fanout/leaderboard,fanout/leaderboard,fanout/leaderboard
dblistener.py
dblistener.py
import os, django os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'leaderboard.settings') django.setup() import time import logging from rethinkdb.errors import RqlDriverError from leaderboardapp.models import Board, Player from leaderboardapp.views import publish_board logger = logging.getLogger('dblistener') while...
import os import time import logging import django from rethinkdb.errors import RqlDriverError from leaderboardapp.models import Board, Player from leaderboardapp.views import publish_board os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'leaderboard.settings') django.setup() logger = logging.getLogger('dblistener') ...
mit
Python
0eb08689906556951bacf82166d13cda7a8d720b
Update pylsy_test.py
muteness/Pylsy,bcho/Pylsy,gnithin/Pylsy,gnithin/Pylsy,muteness/Pylsy,huiyi1990/Pylsy,huiyi1990/Pylsy,bcho/Pylsy
tests/pylsy_test.py
tests/pylsy_test.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import unittest from pylsy.pylsy import PylsyTable class PylsyTableTests(unittest.TestCase): def setUp(self): attributes=["name","age"] self.table = PylsyTable(attributes) def tearDown(self): self.table = None def tes...
# -*- coding: utf-8 -*- from __future__ import absolute_import __author__ = 'choleraehyq' import unittest from pylsy.pylsy import PylsyTable class PylsyTableTests(unittest.TestCase): def setUp(self): attributes=["name","age"] self.table = PylsyTable(attributes) def tearDown(self): sel...
mit
Python
c4d784f1b478ca80697e9bbe843ebf84fe124f2b
update legacy scripted test to use new syntax
eHealthAfrica/rapidsms,catalpainternational/rapidsms,lsgunth/rapidsms,lsgunth/rapidsms,eHealthAfrica/rapidsms,catalpainternational/rapidsms,peterayeni/rapidsms,ehealthafrica-ci/rapidsms,caktus/rapidsms,eHealthAfrica/rapidsms,catalpainternational/rapidsms,caktus/rapidsms,catalpainternational/rapidsms,peterayeni/rapidsms...
lib/rapidsms/tests/scripted.py
lib/rapidsms/tests/scripted.py
import warnings from rapidsms.tests.harness import TestScript as TestScriptMixin class TestScript(TestScriptMixin): def startRouter(self): warnings.warn("startRouter is deprecated and will be removed in a future " "release. Please, see the release notes.", DeprecationWarning, stac...
import warnings from django.test import TestCase from rapidsms.tests.harness import TestScript as TestScriptMixin class TestScript(TestScriptMixin, TestCase): def startRouter(self): warnings.warn("startRouter is deprecated and will be removed in a future " "release. Please, see th...
bsd-3-clause
Python
8067af0c58ad3815fb15b530708bcb96a1874f3c
Add unit test for removing an element from an Ordering
madman-bob/python-order-maintenance
tests/test_basic.py
tests/test_basic.py
from unittest import TestCase from ordering import Ordering class TestOrderingBasic(TestCase): def test_empty_insert_start(self) -> None: ordering = Ordering[int]() ordering.insert_start(0) self.assertIn(0, ordering) self.assertNotIn(1, ordering) def test_empty_insert_end(se...
from unittest import TestCase from ordering import Ordering class TestOrderingBasic(TestCase): def test_empty_insert_start(self) -> None: ordering = Ordering[int]() ordering.insert_start(0) self.assertIn(0, ordering) self.assertNotIn(1, ordering) def test_empty_insert_end(se...
mit
Python
014184197b6eeede4a8681a446aa1a8e7bdce9fa
Update views.py
agarone-mm/scholastic-demo
demo/views.py
demo/views.py
import flask import sys from flask import request app = flask.Flask(__name__) @app.route('/') def hello_world(): return flask.jsonify({ 'message': 'Hello World!', 'python': sys.version, 'headers': str(request.headers) })
import flask import sys from flask import request app = flask.Flask(__name__) @app.route('/') def hello_world(): return flask.jsonify({ 'message': 'Hello Worlb!', 'python': sys.version, 'headers': str(request.headers) })
mit
Python
2e18e05659e9ba88f2fcce77259792f84b25e5fa
Add ability to disable frame evaluation
Elizaveta239/PyDev.Debugger,Elizaveta239/PyDev.Debugger,fabioz/PyDev.Debugger,fabioz/PyDev.Debugger,fabioz/PyDev.Debugger,Elizaveta239/PyDev.Debugger,Elizaveta239/PyDev.Debugger,fabioz/PyDev.Debugger,Elizaveta239/PyDev.Debugger,fabioz/PyDev.Debugger
_pydevd_frame_eval/pydevd_frame_eval_main.py
_pydevd_frame_eval/pydevd_frame_eval_main.py
import os import sys IS_PY36_OR_OLDER = False if (sys.version_info[0] == 3 and sys.version_info[1] >= 6) or sys.version_info[0] > 3: IS_PY36_OR_OLDER = True set_frame_eval = None stop_frame_eval = None use_frame_eval = os.environ.get('PYDEVD_USE_FRAME_EVAL', None) if use_frame_eval == 'NO': frame_eval_func,...
import os import sys IS_PY36_OR_OLDER = False if (sys.version_info[0] == 3 and sys.version_info[1] >= 6) or sys.version_info[0] > 3: IS_PY36_OR_OLDER = True set_frame_eval = None stop_frame_eval = None if IS_PY36_OR_OLDER: try: from _pydevd_frame_eval.pydevd_frame_evaluator import frame_eval_func, s...
epl-1.0
Python
56675ad39c734993561b47373fa9db39e7f36323
Remove spec_set from mock.patch('os.chdir').
s3rvac/git-branch-viewer,s3rvac/git-branch-viewer
tests/test_utils.py
tests/test_utils.py
# # Unit tests for the viewer.utils module. # # Copyright: (c) 2014 by Petr Zemek <s3rvac@gmail.com> and contributors # License: BSD, see LICENSE for more details # import os import unittest from unittest import mock from viewer.utils import chdir @mock.patch('os.chdir') class ChdirTests(unittest.TestCase): def...
# # Unit tests for the viewer.utils module. # # Copyright: (c) 2014 by Petr Zemek <s3rvac@gmail.com> and contributors # License: BSD, see LICENSE for more details # import os import unittest from unittest import mock from viewer.utils import chdir @mock.patch('os.chdir', spec_set=os.chdir) class ChdirTests(unittest...
bsd-3-clause
Python
ea027e70f94d351fade02a3110135e031b9f52c5
Update botcmd import.
krismolendyke/err-diehardbot
dieHardBot.py
dieHardBot.py
#!/usr/bin/env python """A bot which will respond to various Die Hard character name commands and mentions and respond with a random line spoken by that character in the film. """ from errbot.botplugin import BotPlugin from errbot import botcmd from dieHard import DieHard def generate(character): f = lambda ...
#!/usr/bin/env python """A bot which will respond to various Die Hard character name commands and mentions and respond with a random line spoken by that character in the film. """ from errbot.botplugin import BotPlugin from errbot.jabberbot import botcmd from dieHard import DieHard def generate(character): f...
mit
Python
74286f4d631b09d46a0c9df995aa21e608b99dc2
Update regex_utils
interhui/py-text,PinaeOS/py-text
text/regex_utils.py
text/regex_utils.py
# coding=utf-8 import re def parse_line(regex , line): if line == None: return None if regex == None: return line items = [] pattern = re.compile(regex) match = pattern.match(line) if match: items = match.groups() return items def check_line(r...
# coding=utf-8 import re def parse_line(regex , line): if line == None: return None if regex == None: return line items = [] pattern = re.compile(regex) match = pattern.match(line) if match: items = match.groups() return items def check_line(r...
apache-2.0
Python
f49fc187bc397a56f03217c88fa06b7ef1704b41
Add docstring for `is_landscape()`
shunghsiyu/pdf-processor
Util.py
Util.py
"""Collection of Helper Functions""" import os from fnmatch import fnmatch from PyPDF2 import PdfFileReader def pdf_file(filename): """Test whether or the the filename ends with '.pdf'.""" return fnmatch(filename, '*.pdf') def all_pdf_files_in_directory(path): """Return a list of of PDF files in a dire...
"""Collection of Helper Functions""" import os from fnmatch import fnmatch from PyPDF2 import PdfFileReader def pdf_file(filename): """Test whether or the the filename ends with '.pdf'.""" return fnmatch(filename, '*.pdf') def all_pdf_files_in_directory(path): """Return a list of of PDF files in a dire...
mit
Python
92a57e512e4437b781d7db76587d27092033a49a
remove dead code
rlowrance/re-local-linear,rlowrance/re-local-linear,rlowrance/re-local-linear
chart-02-ols-median-of-root-median-squared-errors.py
chart-02-ols-median-of-root-median-squared-errors.py
# create files for chart-02-ols-median-of-root-mdian-squared-errors # with these choices # metric in median-root-median-squared-errors # model in ols # ndays in 30 60 ... 360 # predictors in act actlog ct ctlog # responses in price logprice # usetax in yes no # year in 2008 # invocations...
# create files for chart-02-ols-median-of-root-mdian-squared-errors # with these choices # metric in median-root-median-squared-errors # model in ols # ndays in 30 60 ... 360 # predictors in act actlog ct ctlog # responses in price logprice # usetax in yes no # year in 2008 # invocations...
mit
Python
3809d9a277412ef7c53905ecdcae55d537e08c95
Fix whitespace in tests file
jstasiak/travis-solo
travis_solo_tests.py
travis_solo_tests.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from nose.tools import eq_, ok_ from travis_solo import Configuration, Loader, Step class TestLoader(object): def setup(self): self.loader = Loader() def test_loading_steps(self): settings = dict( bef...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from nose.tools import eq_, ok_ from travis_solo import Configuration, Loader, Step class TestLoader(object): def setup(self): self.loader = Loader() def test_loading_steps(self): setti...
mit
Python
1e222b72e632e5649d26dc71ab44ef31af7459fe
Fix rendering of groups in sidebar that didn't get all the template context passed into it.
team23/django_backend,team23/django_backend,team23/django_backend,team23/django_backend,team23/django_backend
django_backend/group.py
django_backend/group.py
from django.forms.forms import pretty_name from django.template import Context from django.template.loader import render_to_string from .compat import context_flatten class Group(list): """ A simplistic representation of backends that are related and should be displayed as one "group" in the backend (e.g...
from django.forms.forms import pretty_name from django.template import Context from django.template.loader import render_to_string from .compat import context_flatten class Group(list): """ A simplistic representation of backends that are related and should be displayed as one "group" in the backend (e.g...
bsd-3-clause
Python
bda88dfe6e0a2f16f0c3be74a42cf8783aae1d9e
Fix to support django v1.7
leifdenby/django_enum_js
django_enum_js/views.py
django_enum_js/views.py
from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.safestring import mark_safe from django_enum_js import enum_wrapper def enums_js(request): enums = enum_wrapper.get_json_formatted_enums() return render_to_response('django_enum_js/enums_js.tpl', { 'en...
from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.safestring import mark_safe from django_enum_js import enum_wrapper def enums_js(request): enums = enum_wrapper.get_json_formatted_enums() return render_to_response('django_enum_js/enums_js.tpl', { 'en...
mit
Python
6a9ed8867ccaab1284ae999d752de92174de399e
fix error message rendering failing due to message being a dict
pmclanahan/django-celery-email,pmclanahan/django-celery-email,andresriancho/django-celery-email
djcelery_email/tasks.py
djcelery_email/tasks.py
from django.conf import settings from django.core.mail import get_connection, EmailMessage from celery.task import task CONFIG = getattr(settings, 'CELERY_EMAIL_TASK_CONFIG', {}) BACKEND = getattr(settings, 'CELERY_EMAIL_BACKEND', 'django.core.mail.backends.smtp.EmailBackend') TASK_CONFIG = { '...
from django.conf import settings from django.core.mail import get_connection, EmailMessage from celery.task import task CONFIG = getattr(settings, 'CELERY_EMAIL_TASK_CONFIG', {}) BACKEND = getattr(settings, 'CELERY_EMAIL_BACKEND', 'django.core.mail.backends.smtp.EmailBackend') TASK_CONFIG = { '...
bsd-3-clause
Python
81ff4ede4ea6397e6d54020c56cdf8dddcda1485
add dg sub-package to sfepy/discrete/setup.py
vlukes/sfepy,rc/sfepy,BubuLK/sfepy,rc/sfepy,BubuLK/sfepy,sfepy/sfepy,rc/sfepy,sfepy/sfepy,sfepy/sfepy,BubuLK/sfepy,vlukes/sfepy,vlukes/sfepy
sfepy/discrete/setup.py
sfepy/discrete/setup.py
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration import os.path as op auto_name = op.split(op.dirname(__file__))[-1] config = Configuration(auto_name, parent_package, top_path) subdirs = [ 'common', 'dg', 'fem', ...
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration import os.path as op auto_name = op.split(op.dirname(__file__))[-1] config = Configuration(auto_name, parent_package, top_path) subdirs = [ 'common', 'fem', 'iga', ...
bsd-3-clause
Python