commit
stringlengths
40
40
old_file
stringlengths
4
236
new_file
stringlengths
4
236
old_contents
stringlengths
1
3.26k
new_contents
stringlengths
16
4.43k
subject
stringlengths
16
624
message
stringlengths
17
3.29k
lang
stringclasses
5 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
ea633b9cf062e28525910f5659b6b8f2ddbb74e3
accelerator/migrations/0099_update_program_model.py
accelerator/migrations/0099_update_program_model.py
# Generated by Django 2.2.28 on 2022-04-20 13:05 from django.db import ( migrations, models, ) class Migration(migrations.Migration): dependencies = [ ('accelerator', '0098_update_startup_update_20220408_0441'), ] operations = [ migrations.AddField( model_name='progr...
# Generated by Django 2.2.28 on 2022-04-20 13:05 import sorl.thumbnail.fields from django.db import ( migrations, models, ) class Migration(migrations.Migration): dependencies = [ ('accelerator', '0098_update_startup_update_20220408_0441'), ] operations = [ migrations.AddField( ...
Fix image field import and migration
[AC-9452] Fix image field import and migration
Python
mit
masschallenge/django-accelerator,masschallenge/django-accelerator
5c5e0c7809d8db77327dc259df0547579e515a54
server-side/Judge.py
server-side/Judge.py
import sys sys.path.append('../audio2tokens') from audio2tokens import * download_dir='/home/michele/Downloads' from rhyme import get_score import time def retrieve_tokens(audiofile): #time.sleep(3) audio_path_raw = raw_audio(audiofile.replace(':','-')) tokens = get_text(audio_path_raw) print(tokens) return token...
import sys sys.path.append('../audio2tokens') from audio2tokens import * download_dir='/home/michele/Downloads' from rhyme import get_score import time def remove_audiofiles(audio_path): audio_path_16k = audio_path.replace('.wav','_16k.wav') audio_path_raw = audio_path.replace('.wav','.raw') os.remove(a...
Add some functions to remove wave files
Add some functions to remove wave files
Python
mit
hajicj/HAMR_2016,hajicj/HAMR_2016,hajicj/HAMR_2016
693dc9d8448740e1a1c4543cc3a91e3769fa7a3e
pySPM/utils/plot.py
pySPM/utils/plot.py
import numpy as np import matplotlib.pyplot as plt def plotMask(ax, mask, color, **kargs): import copy m = np.ma.masked_array(mask, ~mask) palette = copy.copy(plt.cm.gray) palette.set_over(color, 1.0) ax.imshow(m, cmap=palette, vmin=0, vmax=0.5, **kargs) def Xdist(ax,left, right, y, color='r',...
import numpy as np import matplotlib.pyplot as plt def plotMask(ax, mask, color, **kargs): import copy m = np.ma.masked_array(mask, ~mask) palette = copy.copy(plt.cm.gray) palette.set_over(color, 1.0) ax.imshow(m, cmap=palette, vmin=0, vmax=0.5, **kargs) def Xdist(ax,left, right, y, color='r',...
Add helper function to create a DualPlot
Add helper function to create a DualPlot
Python
apache-2.0
scholi/pySPM
2bd551d7fa8da9d7641998a5515fba634d65bc56
comics/feedback/views.py
comics/feedback/views.py
from django.conf import settings from django.core.mail import mail_admins from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from comics.feedback.forms import FeedbackForm def feedback(request): """Mail feedback to ADMINS""" if reques...
from django.conf import settings from django.core.mail import mail_admins from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import render from comics.feedback.forms import FeedbackForm def feedback(request): """Mail feedback to ADMINS""" if reques...
Add user information to feedback emails
Add user information to feedback emails
Python
agpl-3.0
jodal/comics,datagutten/comics,jodal/comics,datagutten/comics,datagutten/comics,jodal/comics,datagutten/comics,jodal/comics
c7ab4bc8e0b3dbdd305a7a156ef58dddaa37296c
pystorm/__init__.py
pystorm/__init__.py
from .component import Component, Tuple from .bolt import BatchingBolt, Bolt, TicklessBatchingBolt from .spout import Spout __all__ = [ 'BatchingBolt', 'Bolt', 'Component', 'Spout', 'TicklessBatchingBolt', 'Tuple', ]
''' pystorm is a production-tested Storm multi-lang implementation for Python It is mostly intended to be used by other libraries (e.g., streamparse). ''' from .component import Component, Tuple from .bolt import BatchingBolt, Bolt, TicklessBatchingBolt from .spout import Spout from .version import __version__, VERSI...
Add VERSION and __version__ directly to pystorm namespace
Add VERSION and __version__ directly to pystorm namespace
Python
apache-2.0
pystorm/pystorm
eb0aeda225cc7c0aef85559857de4cca35b77efd
ratemyflight/urls.py
ratemyflight/urls.py
from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template urlpatterns = patterns("ratemyflight.views", url("^api/airport/list/(?P<south>.*)/(?P<west>.*)/(?P<north>.*)/(?P<east>.*)/$", "airports_for_boundary", name="airports_for_boundary"), url("^api/flight/l...
from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template urlpatterns = patterns("ratemyflight.views", url("^api/airport/boundary/(?P<south>.*)/(?P<west>.*)/(?P<north>.*)/(?P<east>.*)/$", "airports_for_boundary", name="airports_for_boundary"), url("^api/flig...
Clean up URLS for API and point final URLS to views.
Clean up URLS for API and point final URLS to views.
Python
bsd-2-clause
stephenmcd/ratemyflight,stephenmcd/ratemyflight
1775782f100f9db9ad101a19887ba95fbc36a6e9
backend/project_name/celerybeat_schedule.py
backend/project_name/celerybeat_schedule.py
from celery.schedules import crontab CELERYBEAT_SCHEDULE = { # Internal tasks "clearsessions": {"schedule": crontab(hour=3, minute=0), "task": "users.tasks.clearsessions"}, }
from celery.schedules import crontab # pylint:disable=import-error,no-name-in-module CELERYBEAT_SCHEDULE = { # Internal tasks "clearsessions": {"schedule": crontab(hour=3, minute=0), "task": "users.tasks.clearsessions"}, }
Disable prospector on celery.schedules import
Disable prospector on celery.schedules import
Python
mit
vintasoftware/django-react-boilerplate,vintasoftware/django-react-boilerplate,vintasoftware/django-react-boilerplate,vintasoftware/django-react-boilerplate
691e3581f1602714fba33f6dcb139f32e0507d23
packages/syft/src/syft/core/node/common/node_table/setup.py
packages/syft/src/syft/core/node/common/node_table/setup.py
# third party from sqlalchemy import Column from sqlalchemy import Integer from sqlalchemy import String # relative from . import Base class SetupConfig(Base): __tablename__ = "setup" id = Column(Integer(), primary_key=True, autoincrement=True) domain_name = Column(String(255), default="") node_id =...
# third party from sqlalchemy import Column from sqlalchemy import Integer from sqlalchemy import String from sqlalchemy import Boolean # relative from . import Base class SetupConfig(Base): __tablename__ = "setup" id = Column(Integer(), primary_key=True, autoincrement=True) domain_name = Column(String(...
ADD description / contact / daa fields
ADD description / contact / daa fields
Python
apache-2.0
OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft
7fc81e93ea44e52ab7c29087a01eac65a145db09
qiprofile_rest/server/settings.py
qiprofile_rest/server/settings.py
"""This ``settings`` file specifies the Eve configuration.""" import os # The run environment default is production. # Modify this by setting the NODE_ENV environment variable. env = os.getenv('NODE_ENV') or 'production' # The MongoDB database. if env == 'production': MONGO_DBNAME = 'qiprofile' else: MONGO_DB...
"""This ``settings`` file specifies the Eve configuration.""" import os # The run environment default is production. # Modify this by setting the NODE_ENV environment variable. env = os.getenv('NODE_ENV') or 'production' # The MongoDB database. if env == 'production': MONGO_DBNAME = 'qiprofile' else: MONGO_DB...
Add Mongo env var overrides.
Add Mongo env var overrides.
Python
bsd-2-clause
ohsu-qin/qiprofile-rest,ohsu-qin/qirest
b5e368437a600d78e22a53abe53c0103b20daa24
_python/main/migrations/0003_auto_20191029_2015.py
_python/main/migrations/0003_auto_20191029_2015.py
# Generated by Django 2.2.6 on 2019-10-29 20:15 from django.db import migrations, models import main.models class Migration(migrations.Migration): dependencies = [ ('main', '0002_auto_20191007_1639'), ] operations = [ migrations.AlterField( model_name='contentnode', ...
# Generated by Django 2.2.6 on 2019-10-29 20:15 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0002_auto_20191007_1639'), ] operations = [ migrations.AlterField( model_name='default', name='url', ...
Repair migration, which was a no-op in SQL and was 'faked' anyway.
Repair migration, which was a no-op in SQL and was 'faked' anyway.
Python
agpl-3.0
harvard-lil/h2o,harvard-lil/h2o,harvard-lil/h2o,harvard-lil/h2o
f87b979443bd4a578884bdb327dbd72616d07533
changes/backends/jenkins/generic_builder.py
changes/backends/jenkins/generic_builder.py
from .builder import JenkinsBuilder class JenkinsGenericBuilder(JenkinsBuilder): def __init__(self, *args, **kwargs): self.script = kwargs.pop('script') self.cluster = kwargs.pop('cluster') super(JenkinsGenericBuilder, self).__init__(*args, **kwargs) def get_job_parameters(self, job, ...
from .builder import JenkinsBuilder class JenkinsGenericBuilder(JenkinsBuilder): def __init__(self, *args, **kwargs): self.script = kwargs.pop('script') self.cluster = kwargs.pop('cluster') self.path = kwargs.pop('path', '') super(JenkinsGenericBuilder, self).__init__(*args, **kwar...
Support fixed path in generic builder
Support fixed path in generic builder
Python
apache-2.0
wfxiang08/changes,bowlofstew/changes,dropbox/changes,dropbox/changes,dropbox/changes,bowlofstew/changes,wfxiang08/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes,wfxiang08/changes
ba0334459b8318a62014ec945a753fc36fc7d519
account_verification_flask/models/models.py
account_verification_flask/models/models.py
#from flask.ext.login import UserMixin from account_verification_flask import db, bcrypt class User(db.Model): __tablename__ = "users" id = db.Column(db.Integer, primary_key = True) name = db.Column(db.String, nullable = False) email = db.Column(db.String, nullable = False) password = db.Column(d...
#from flask.ext.login import UserMixin from account_verification_flask import db, bcrypt class User(db.Model): __tablename__ = "users" id = db.Column(db.Integer, primary_key = True) name = db.Column(db.String, nullable = False) email = db.Column(db.String, nullable = False) password = db.Column(d...
Remove confirm_phone_number method from model
Remove confirm_phone_number method from model
Python
mit
TwilioDevEd/account-verification-flask,TwilioDevEd/account-verification-flask,TwilioDevEd/account-verification-flask
1dc2856368e5e6852b526d86a0c78c5fe10b1550
myhronet/models.py
myhronet/models.py
# -*- coding: utf-8 -*- import string from django.db import models class Blacklist(models.Model): domain = models.CharField(max_length=255, unique=True, null=True) def __unicode__(self): return self.domain class URL(models.Model): hashcode = models.CharField(max_length=10, unique=True, ...
# -*- coding: utf-8 -*- import string from django.db import models class Blacklist(models.Model): domain = models.CharField(max_length=255, unique=True, null=True) def __unicode__(self): return self.domain class URL(models.Model): hashcode = models.CharField(max_length=10, unique=True, ...
Fix hashcode generation for existing URLs
Fix hashcode generation for existing URLs
Python
mit
myhro/myhronet,myhro/myhronet
1cad9ab61148173b0f61971805b3e6203da3050d
faker/providers/en_CA/ssn.py
faker/providers/en_CA/ssn.py
# coding=utf-8 from __future__ import unicode_literals from ..ssn import Provider as SsnProvider class Provider(SsnProvider): ssn_formats = ("### ### ###",) @classmethod def ssn(cls): return cls.bothify(cls.random_element(cls.ssn_formats))
# coding=utf-8 from __future__ import unicode_literals from ..ssn import Provider as SsnProvider import random class Provider(SsnProvider): #in order to create a valid SIN we need to provide a number that passes a simple modified Luhn Algorithmn checksum #this function essentially reverses the checksum st...
Update Canada SSN/SIN provider to create a valid number
Update Canada SSN/SIN provider to create a valid number The first revision generated a random number in the correct format. This commit creates a SIN number that passes the checksum as described here http://http://en.wikipedia.org/wiki/Social_Insurance_Number
Python
mit
jaredculp/faker,trtd/faker,xfxf/faker-python,HAYASAKA-Ryosuke/faker,johnraz/faker,joke2k/faker,joke2k/faker,venmo/faker,ericchaves/faker,xfxf/faker-1,GLMeece/faker,danhuss/faker,beetleman/faker,thedrow/faker,meganlkm/faker,yiliaofan/faker,MaryanMorel/faker
dd1ed907532526a4a70694c46918136ca6d93277
nqueens/nqueens.py
nqueens/nqueens.py
from nqueens.chessboard import Chessboard from nqueens.printer import Printer from nqueens.solver import Solver board = Chessboard.create(8) solver = Solver.create(board) solution = solver.solve() if solution is not None: printer = Printer.create(solution) printer.printBoard()
#!/usr/bin/env python3 import os import sys import getopt sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from nqueens.chessboard import Chessboard from nqueens.printer import Printer from nqueens.solver import Solver def main(): try: n = parse_command_line() except ...
Add ability to run problems from command line
Add ability to run problems from command line
Python
mit
stevecshanks/nqueens
c9cc5585e030951a09687c6a61a489ec51f83446
cr2/plotter/__init__.py
cr2/plotter/__init__.py
# $Copyright: # ---------------------------------------------------------------- # This confidential and proprietary software may be used only as # authorised by a licensing agreement from ARM Limited # (C) COPYRIGHT 2015 ARM Limited # ALL RIGHTS RESERVED # The entire notice above must be reproduced on all autho...
# $Copyright: # ---------------------------------------------------------------- # This confidential and proprietary software may be used only as # authorised by a licensing agreement from ARM Limited # (C) COPYRIGHT 2015 ARM Limited # ALL RIGHTS RESERVED # The entire notice above must be reproduced on all autho...
Enable user specified arg forwarding to matplotlib
plotter: Enable user specified arg forwarding to matplotlib This change allows the user to register args for forwarding to matplotlib and also unregister the same. Change-Id: If53dab43dd4a2f530b3d1faf35582206ac925740 Signed-off-by: Kapileshwar Singh <d373e2b6407ea84be359ce4a11e8631121819e79@arm.com>
Python
apache-2.0
JaviMerino/trappy,joelagnel/trappy,bjackman/trappy,derkling/trappy,ARM-software/trappy,sinkap/trappy,JaviMerino/trappy,joelagnel/trappy,ARM-software/trappy,derkling/trappy,bjackman/trappy,sinkap/trappy,ARM-software/trappy,ARM-software/trappy,bjackman/trappy,sinkap/trappy,joelagnel/trappy,sinkap/trappy,JaviMerino/trappy...
38cd50805e080f6613d7e1d5867a84952ec88580
flask_resty/related.py
flask_resty/related.py
from .exceptions import ApiError # ----------------------------------------------------------------------------- class Related(object): def __init__(self, item_class=None, **kwargs): self._item_class = item_class self._view_classes = kwargs def resolve_related(self, data): for field_...
from .exceptions import ApiError # ----------------------------------------------------------------------------- class Related(object): def __init__(self, item_class=None, **kwargs): self._item_class = item_class self._resolvers = kwargs def resolve_related(self, data): for field_nam...
Fix variable names in Related
Fix variable names in Related
Python
mit
taion/flask-jsonapiview,4Catalyzer/flask-jsonapiview,4Catalyzer/flask-resty
8cdbbb52ebe161b0b7fea342e8a3d197ec290ab1
satnogsclient/settings.py
satnogsclient/settings.py
from os import environ DEMODULATION_COMMAND = environ.get('SATNOGS_DEMODULATION_COMMAND', None) ENCODING_COMMAND = environ.get('SATNOGS_ENCODING_COMMAND', None) DECODING_COMMAND = environ.get('SATNOGS_DECODING_COMMAND', None) OUTPUT_PATH = environ.get('SATNOGS_OUTPUT_PATH', None)
from os import environ DEMODULATION_COMMAND = environ.get('SATNOGS_DEMODULATION_COMMAND', 'rtl_fm') ENCODING_COMMAND = environ.get('SATNOGS_ENCODING_COMMAND', 'oggenc') DECODING_COMMAND = environ.get('SATNOGS_DECODING_COMMAND', 'multimon-ng') OUTPUT_PATH = environ.get('SATNOGS_OUTPUT_PATH', '/tmp')
Add default commands for encoding/decoding/demodulation.
Add default commands for encoding/decoding/demodulation.
Python
agpl-3.0
adamkalis/satnogs-client,adamkalis/satnogs-client,cshields/satnogs-client,cshields/satnogs-client
3335c8c9ce8419d9d1d1034903687aa02983280d
tests/rules_tests/NoRuleSpecifiedTest.py
tests/rules_tests/NoRuleSpecifiedTest.py
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """ from unittest import main, TestCase from grammpy import Rule class NoRuleSpecifiedTest(TestCase): pass if __name__ == '__main__': main()
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """ from unittest import main, TestCase from grammpy import Rule from grammpy.exceptions import RuleNotDefinedException class NoRuleSpecifiedTest(TestCase): def test_noRule(self): class tmp(Rule): ...
Add tests when no rules is specified
Add tests when no rules is specified
Python
mit
PatrikValkovic/grammpy
0b3f6ae3b21cd51b99bcecf17d5ea1275c04abfd
statirator/project_template/project_name/settings.py
statirator/project_template/project_name/settings.py
# Generated by statirator import os # directories setup ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) SOURCE_DIR = os.path.join(ROOT_DIR, '{{ source }}') BUILD_DIR = os.path.join(ROOT_DIR, '{{ build }}') # languages setup LANGUAGE_CODE = '{{default_lang}}' _ = lambda s:s LANGUAGES ...
# Generated by statirator import os # directories setup ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) SOURCE_DIR = os.path.join(ROOT_DIR, '{{ source }}') BUILD_DIR = os.path.join(ROOT_DIR, '{{ build }}') # languages setup LANGUAGE_CODE = '{{default_lang}}' _ = lambda s:s LANGUAGES ...
Add taggit and statirator.blog to INSTALLED_APPS
Add taggit and statirator.blog to INSTALLED_APPS
Python
mit
MeirKriheli/statirator,MeirKriheli/statirator,MeirKriheli/statirator
91a7e4ba30c2c455c58b7069015680b7af511cc4
tests/test_get_joke.py
tests/test_get_joke.py
def test_get_joke(): from pyjokes import get_joke for i in range(10): assert get_joke() languages = ['eng', 'de', 'spa'] categories = ['neutral', 'explicit', 'all'] for lang in languages: for cat in categories: for i in range(10): assert get_joke(cat,...
import pytest from pyjokes import get_joke from pyjokes.pyjokes import LanguageNotFoundError, CategoryNotFoundError def test_get_joke(): assert get_joke() languages = ['en', 'de', 'es'] categories = ['neutral', 'explicit', 'all'] for lang in languages: assert get_joke(language=lang) ...
Simplify get_joke test, add raise checks
Simplify get_joke test, add raise checks
Python
bsd-3-clause
borjaayerdi/pyjokes,trojjer/pyjokes,martinohanlon/pyjokes,bennuttall/pyjokes,ElectronicsGeek/pyjokes,pyjokes/pyjokes,gmarkall/pyjokes
67d067fe499ba2ec78d34083640a4bfe9835d62b
tests/test_sequence.py
tests/test_sequence.py
from unittest import TestCase from prudent.sequence import Sequence class SequenceTest(TestCase): def setUp(self): self.seq = Sequence([1, 2, 3]) def test_getitem(self): assert self.seq[0] == 1 self.seq[2] assert self.seq[2] == 3 def test_len(self): assert len(sel...
from unittest import TestCase from prudent.sequence import Sequence class SequenceTest(TestCase): def setUp(self): self.seq = Sequence([1, 2, 3]) def test_getitem(self): assert self.seq[0] == 1 assert self.seq[2] == 3 def test_getitem_raises_indexerror(self): self.assertR...
Test that IndexError is raised when appropriate
Test that IndexError is raised when appropriate
Python
mit
eugene-eeo/prudent
987e3b3387124c9eee7b0d69647fe2eeba40b70d
snippets/list_holidays.py
snippets/list_holidays.py
#!/usr/bin/env python import pandas as pd from datetime import date import holidays def sanitize_holiday_name(name): new_name = [c for c in name if c.isalpha() or c.isdigit() or c == ' '] new_name = "".join(new_name).lower().replace(" ", "_") return new_name def process_holidays(df): # Create a dat...
#!/usr/bin/env python import pandas as pd from datetime import date import holidays def sanitize_holiday_name(name): new_name = [c for c in name if c.isalpha() or c.isdigit() or c == ' '] new_name = "".join(new_name).lower().replace(" ", "_") return new_name def process_holidays(df): # Create a dat...
Update with real train users
Update with real train users
Python
mit
davidgasquez/kaggle-airbnb
4a8aaf3c9e1da5fd10580cc5a3859d801f2c9553
django_docker/django_docker/urls.py
django_docker/django_docker/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^$', 'hello_world.views.hello_world', name='hello_world'), )
from django.conf.urls import include, url from hello_world import views as hello_world_views from django.contrib import admin admin.autodiscover() urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^$', hello_world_views.hello_world, name='hello_world'), ]
Update URLs to be compatible with Django 1.10
Update URLs to be compatible with Django 1.10
Python
mit
morninj/django-docker,morninj/django-docker,morninj/django-docker
caeb76cbcb6cdd49138e41f57144573598b722ba
source/clique/__init__.py
source/clique/__init__.py
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. from ._version import __version__
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import re from collections import defaultdict from ._version import __version__ from .collection import Collection from .error import CollectionError #: Pattern for matching an index with optional padding. DIGITS...
Add top level function to help assemble collections from arbitrary items.
Add top level function to help assemble collections from arbitrary items.
Python
apache-2.0
4degrees/clique
21b97ceea5b2e667940ddd45682313261eba845b
discode_server/notify.py
discode_server/notify.py
import json from discode_server import db from discode_server import fragments connected = set() notified = set() async def feed(request, ws): global connected connected.add(ws) print("Open WebSockets: ", len(connected)) try: while True: if not ws.open: return ...
import asyncio import json from discode_server import db from discode_server import fragments connected = set() notified = set() async def feed(request, ws): global connected connected.add(ws) print("Open WebSockets: ", len(connected)) try: while True: if not ws.open: ...
Add the asyncio wait_for back in
Add the asyncio wait_for back in
Python
bsd-2-clause
d0ugal/discode-server,d0ugal/discode-server,d0ugal/discode-server
c3d03629734abfead5ae1eae83d1b6dcec792b45
iconizer/django_in_iconizer/django_server.py
iconizer/django_in_iconizer/django_server.py
import os class DjangoServer(object): default_django_manage_script = "manage.py" def __init__(self, django_manage_script=None): super(DjangoServer, self).__init__() if django_manage_script is None: self.django_manage_script = self.default_django_manage_script else: ...
import os class DjangoServer(object): default_django_manage_script = "manage.py" def __init__(self, django_manage_script=None): super(DjangoServer, self).__init__() if django_manage_script is None: self.django_manage_script = self.default_django_manage_script else: ...
Enable specify command line processor.
Enable specify command line processor.
Python
bsd-3-clause
weijia/iconizer
fce890ce9046dd055f219ac880ae9734f334f534
greenlight/harness/arguments.py
greenlight/harness/arguments.py
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from marionette import BaseMarionetteOptions from greenlight import tests class ReleaseTestParser(BaseMarionetteOptio...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from marionette import BaseMarionetteOptions from greenlight import tests class ReleaseTestParser(BaseMarionetteOptio...
Make colored terminal output the default log formatter.
Make colored terminal output the default log formatter.
Python
mpl-2.0
myrdd/firefox-ui-tests,gbrmachado/firefox-ui-tests,utvar/firefox-ui-tests,chmanchester/firefox-ui-tests,armenzg/firefox-ui-tests,whimboo/firefox-ui-tests,myrdd/firefox-ui-tests,gbrmachado/firefox-ui-tests,sr-murthy/firefox-ui-tests,armenzg/firefox-ui-tests,Motwani/firefox-ui-tests,galgeek/firefox-ui-tests,armenzg/firef...
63e09b77e3b00a7483249417020fb093f98773a9
infrastructure/tests/helpers.py
infrastructure/tests/helpers.py
from datetime import datetime from django.contrib.staticfiles.testing import LiveServerTestCase from selenium import webdriver from selenium.webdriver import DesiredCapabilities from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support....
from datetime import datetime from django.contrib.staticfiles.testing import LiveServerTestCase from selenium import webdriver from selenium.webdriver import DesiredCapabilities from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support....
Add logging to selector testing
Add logging to selector testing
Python
mit
Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data,Code4SA/municipal-data
d07b6483d110eb4c51f7c631f888d1bf30eacc1c
destroyer-runner.py
destroyer-runner.py
#!/usr/bin/python """destroyer-runner.py - Run the main application""" import sys import subprocess if __name__ == '__main__': subprocess.call(['python', './destroyer/destroyer.py'] + [str(arg) for arg in sys.argv[1:]])
#!/usr/bin/python """destroyer-runner.py - Run the main application""" from destroyer.destroyer import main if __name__ == '__main__': main()
Update with working code to run destroyer
Update with working code to run destroyer
Python
mit
jaredmichaelsmith/destroyer
261c294690427b57d111c777cdc4d13b9c84f9d2
cloudkittydashboard/dashboards/admin/modules/forms.py
cloudkittydashboard/dashboards/admin/modules/forms.py
# Copyright 2017 Objectif Libre # # 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...
# Copyright 2017 Objectif Libre # # 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...
Delete the unused LOG code
Delete the unused LOG code Change-Id: Ief253cdd226f8c2688429b0ff00785151a99759b
Python
apache-2.0
stackforge/cloudkitty-dashboard,openstack/cloudkitty-dashboard,openstack/cloudkitty-dashboard,openstack/cloudkitty-dashboard,stackforge/cloudkitty-dashboard,stackforge/cloudkitty-dashboard
316323387c508c88595f205182ea2436c271621d
src/highdicom/uid.py
src/highdicom/uid.py
import logging import pydicom logger = logging.getLogger(__name__) class UID(pydicom.uid.UID): """Unique DICOM identifier with a highdicom-specific UID prefix.""" def __new__(cls: type) -> str: prefix = '1.2.826.0.1.3680043.10.511.3.' identifier = pydicom.uid.generate_uid(prefix=prefix) ...
import logging from typing import Type, TypeVar import pydicom logger = logging.getLogger(__name__) T = TypeVar('T', bound='UID') class UID(pydicom.uid.UID): """Unique DICOM identifier with a highdicom-specific UID prefix.""" def __new__(cls: Type[T]) -> T: prefix = '1.2.826.0.1.3680043.10.511.3...
Fix typing for UID class
Fix typing for UID class
Python
mit
MGHComputationalPathology/highdicom
ee53ec51d98802bf0bc55e70c39cc0918f2bb274
icekit/plugins/blog_post/content_plugins.py
icekit/plugins/blog_post/content_plugins.py
""" Definition of the plugin. """ from django.apps import apps from django.conf import settings from django.db.models.loading import get_model from django.utils.translation import ugettext_lazy as _ from fluent_contents.extensions import ContentPlugin, plugin_pool default_blog_model = 'blog_tools.BlogPost' icekit_blo...
""" Definition of the plugin. """ from django.apps import apps from django.conf import settings from django.utils.translation import ugettext_lazy as _ from fluent_contents.extensions import ContentPlugin, plugin_pool default_blog_model = 'blog_tools.BlogPost' icekit_blog_model = getattr(settings, 'ICEKIT_BLOG_MODEL'...
Update Blog model and content item matching
Update Blog model and content item matching
Python
mit
ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit
c7143cd725fc829c33ad9f9150e5975deb7be93a
irctest/optional_extensions.py
irctest/optional_extensions.py
import unittest import operator import itertools class OptionalExtensionNotSupported(unittest.SkipTest): def __str__(self): return 'Unsupported extension: {}'.format(self.args[0]) class OptionalSaslMechanismNotSupported(unittest.SkipTest): def __str__(self): return 'Unsupported SASL mechanism:...
import unittest import operator import itertools class NotImplementedByController(unittest.SkipTest): def __str__(self): return 'Not implemented by controller: {}'.format(self.args[0]) class OptionalExtensionNotSupported(unittest.SkipTest): def __str__(self): return 'Unsupported extension: {}'...
Add an exception to tell a controller does not implement something.
Add an exception to tell a controller does not implement something.
Python
mit
ProgVal/irctest
a0ce4d366681f2f62f232f4f952ac18df07667d4
ideascube/conf/idb_fra_cultura.py
ideascube/conf/idb_fra_cultura.py
# -*- coding: utf-8 -*- """Ideaxbox Cultura, France""" from .idb import * # noqa from django.utils.translation import ugettext_lazy as _ IDEASCUBE_NAME = u"Cultura" IDEASCUBE_PLACE_NAME = _("city") COUNTRIES_FIRST = ['FR'] TIME_ZONE = None LANGUAGE_CODE = 'fr' LOAN_DURATION = 14 MONITORING_ENTRY_EXPORT_FIELDS = ['ser...
# -*- coding: utf-8 -*- """Ideaxbox Cultura, France""" from .idb import * # noqa from django.utils.translation import ugettext_lazy as _ IDEASCUBE_NAME = u"Cultura" IDEASCUBE_PLACE_NAME = _("city") COUNTRIES_FIRST = ['FR'] TIME_ZONE = None LANGUAGE_CODE = 'fr' LOAN_DURATION = 14 MONITORING_ENTRY_EXPORT_FIELDS = ['ser...
Remove "software" card from Cultura conf
Remove "software" card from Cultura conf
Python
agpl-3.0
ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube
a977908efcc176e1e5adbd82843033805953c6cb
tools/reago/format_reago_input_files.py
tools/reago/format_reago_input_files.py
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import os import argparse import re reago_dir = '/tools/rna_manipulation/reago/reago/' def add_read_pair_num(input_filepath, output_filepath, read_pair_num): to_add = '.' + str(read_pair_num) with open(input_filepath,'r') as input_file: with open(o...
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import os import argparse import re reago_dir = '/tools/rna_manipulation/reago/reago/' def add_read_pair_num(input_filepath, output_filepath, read_pair_num): to_add = '.' + str(read_pair_num) with open(input_filepath,'r') as input_file: with open(o...
Correct argument name in script to format reago input file
Correct argument name in script to format reago input file
Python
apache-2.0
ASaiM/galaxytools,ASaiM/galaxytools
37c59a8535ac0d68a995af378fcb61f03070e018
kombu_fernet/serializers/__init__.py
kombu_fernet/serializers/__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import os from cryptography.fernet import Fernet, MultiFernet fernet = Fernet(os.environ['KOMBU_FERNET_KEY']) fallback_fernet = None try: fallback_fernet = Fernet(os.environ['OLD_KOMBU_FERNET_KEY']) except KeyError: pass else: ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import os from cryptography.fernet import Fernet, MultiFernet fernet = Fernet(os.environ['KOMBU_FERNET_KEY']) fallback_fernet = None try: fallback_fernet = Fernet(os.environ['KOMBU_FERNET_KEY_PREVIOUS']) except KeyError: pass els...
Make update previous key name
Make update previous key name
Python
mit
heroku/kombu-fernet-serializers
a83dd9bfce43a898cf71c9e66192ad589a02b6c8
macroeco/compare/__init__.py
macroeco/compare/__init__.py
""" ================================= Compare (:mod:`macroeco.compare`) ================================= This module contains functions that compare the goodness of fit of a distribution/curve to data or the fit of two distributions/curves to each other. Comparison Functions ==================== .. autosummary:: ...
""" ================================= Compare (:mod:`macroeco.compare`) ================================= This module contains functions that compare the goodness of fit of a distribution/curve to data or the fit of two distributions/curves to each other. Comparison Functions ==================== .. autosummary:: ...
Remove get_ prefixes from compare docstring
Remove get_ prefixes from compare docstring
Python
bsd-2-clause
jkitzes/macroeco
2015233d252e625419485c269f1f70a7e0edada8
skmisc/__init__.py
skmisc/__init__.py
from ._version import get_versions __version__ = get_versions()['version'] del get_versions __all__ = ['__version__'] # We first need to detect if we're being called as part of the skmisc # setup procedure itself in a reliable manner. try: __SKMISC_SETUP__ except NameError: __SKMISC_SETUP__ = False if __SKM...
from ._version import get_versions __version__ = get_versions()['version'] del get_versions __all__ = ['__version__'] # We first need to detect if we're being called as part of the skmisc # setup procedure itself in a reliable manner. try: __SKMISC_SETUP__ except NameError: __SKMISC_SETUP__ = False if __SKM...
Fix pytest path to root of package
Fix pytest path to root of package Instead of the package init file.
Python
bsd-3-clause
has2k1/onelib,has2k1/onelib,has2k1/onelib
8187591a0f8255487f4b16b653ba5070bfffe739
specs/test_diff.py
specs/test_diff.py
''' This is an example of a python test that compares a diff function (in this case a hardcoded one that doesn't work) to the reference JSON to check compliance. ''' from nose.tools import eq_ import json def diff(before, after): return [] def test_diffs(): test_cases = json.load(open('test_cases.json')) ...
''' This is an example of a python test that compares a diff function (in this case a hardcoded one that doesn't work) to the reference JSON to check compliance. ''' from nose.tools import eq_ import json def diff(before, after): return [] def test_diffs(): test_cases = json.load(open('test_cases_simple.json...
Add code to specs example test
Add code to specs example test
Python
mit
tarmstrong/nbdiff,tarmstrong/nbdiff,tarmstrong/nbdiff,tarmstrong/nbdiff
05151bb3ccd018b37097ddf5288e9984f5b45716
ci/management/commands/cancel_old_jobs.py
ci/management/commands/cancel_old_jobs.py
from __future__ import unicode_literals, absolute_import from django.core.management.base import BaseCommand from ci import models, views, TimeUtils from datetime import timedelta class Command(BaseCommand): help = 'Cancel old Civet jobs. When a specific civet client is no longer running, it can leave jobs lying a...
from __future__ import unicode_literals, absolute_import from django.core.management.base import BaseCommand from ci import models, views, TimeUtils from datetime import timedelta class Command(BaseCommand): help = 'Cancel old Civet jobs. When a specific civet client is no longer running, it can leave jobs lying a...
Update cancel old job message
Update cancel old job message
Python
apache-2.0
idaholab/civet,brianmoose/civet,idaholab/civet,brianmoose/civet,brianmoose/civet,idaholab/civet,idaholab/civet,brianmoose/civet
aef51ce5ece86d054f76d86dafca9667f88d3b1a
ccui/testexecution/templatetags/results.py
ccui/testexecution/templatetags/results.py
# Case Conductor is a Test Case Management system. # Copyright (C) 2011 uTest Inc. # # This file is part of Case Conductor. # # Case Conductor is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3...
# Case Conductor is a Test Case Management system. # Copyright (C) 2011 uTest Inc. # # This file is part of Case Conductor. # # Case Conductor is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3...
Fix result status chiclet links for new-style filter querystrings.
Fix result status chiclet links for new-style filter querystrings.
Python
bsd-2-clause
shinglyu/moztrap,shinglyu/moztrap,bobsilverberg/moztrap,mccarrmb/moztrap,mccarrmb/moztrap,mozilla/moztrap,shinglyu/moztrap,bobsilverberg/moztrap,mozilla/moztrap,bobsilverberg/moztrap,mozilla/moztrap,mccarrmb/moztrap,shinglyu/moztrap,mozilla/moztrap,mccarrmb/moztrap,bobsilverberg/moztrap,mccarrmb/moztrap,shinglyu/moztra...
538acc8a114c9fda8489dc5fe91fed2314a37c9b
src/sentry/web/forms/invite_organization_member.py
src/sentry/web/forms/invite_organization_member.py
from __future__ import absolute_import from django import forms from django.db import transaction, IntegrityError from sentry.models import ( AuditLogEntry, AuditLogEntryEvent, OrganizationMember, OrganizationMemberType ) class InviteOrganizationMemberForm(forms.ModelForm): class Meta: fields = ...
from __future__ import absolute_import from django import forms from django.db import transaction, IntegrityError from sentry.models import ( AuditLogEntry, AuditLogEntryEvent, OrganizationMember, OrganizationMemberType ) class InviteOrganizationMemberForm(forms.ModelForm): class Meta: fields = ...
Handle members with duplicate email addresses
Handle members with duplicate email addresses
Python
bsd-3-clause
ifduyue/sentry,jean/sentry,gg7/sentry,daevaorn/sentry,Kryz/sentry,songyi199111/sentry,felixbuenemann/sentry,vperron/sentry,looker/sentry,jean/sentry,looker/sentry,hongliang5623/sentry,alexm92/sentry,daevaorn/sentry,pauloschilling/sentry,fuziontech/sentry,TedaLIEz/sentry,mvaled/sentry,beeftornado/sentry,pauloschilling/s...
3c7641c3380acab821dcbf2ae274da4fb8fade96
students/psbriant/final_project/test_clean_data.py
students/psbriant/final_project/test_clean_data.py
""" Name: Paul Briant Date: 12/11/16 Class: Introduction to Python Assignment: Final Project Description: Tests for Final Project """ import clean_data as cd import pandas import io def get_data(): """ """ data = pandas.read_csv("data/Residential_Water_Usage_Zip_Code_on_Top.csv") return data def te...
""" Name: Paul Briant Date: 12/11/16 Class: Introduction to Python Assignment: Final Project Description: Tests for Final Project """ import clean_data as cd import pandas def get_data(): """ Retrieve data from csv file to test. """ data = pandas.read_csv("data/Residential_Water_Usage_Zip_Code_on_To...
Add docstrings for get_data and test_rename_columns and remove import io statement.
Add docstrings for get_data and test_rename_columns and remove import io statement.
Python
unlicense
weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016
17ddcb1b6c293197834b3154830b9521769d76fb
linter.py
linter.py
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Hardy Jones # Copyright (c) 2013 # # License: MIT # """This module exports the Hlint plugin class.""" from SublimeLinter.lint import Linter class Hlint(Linter): """Provides an interface to hlint.""" synta...
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Hardy Jones # Copyright (c) 2013 # # License: MIT # """This module exports the Hlint plugin class.""" from SublimeLinter.lint import Linter class Hlint(Linter): """Provides an interface to hlint.""" defau...
Update to new `defaults` configuration
Update to new `defaults` configuration
Python
mit
SublimeLinter/SublimeLinter-hlint
2bab1888b43a9c232b37cc26c37df992ea5df2c5
project/apps/api/signals.py
project/apps/api/signals.py
from django.db.models.signals import ( post_save, ) from django.dispatch import receiver from .models import ( Performance, Session, ) @receiver(post_save, sender=Performance) def performance_post_save(sender, instance=None, created=False, raw=False, **kwargs): """Create sentinels.""" if not raw...
from django.db.models.signals import ( post_save, ) from django.dispatch import receiver from .models import ( Performance, Session, ) @receiver(post_save, sender=Session) def session_post_save(sender, instance=None, created=False, raw=False, **kwargs): """Create sentinels.""" if not raw: ...
Create sentinel rounds on Session creation
Create sentinel rounds on Session creation
Python
bsd-2-clause
barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore-django,dbinetti/barberscore,barberscore/barberscore-api,dbinetti/barberscore-django,dbinetti/barberscore,barberscore/barberscore-api
375b26fbb6e5ba043a1017e28027241c12374207
napalm_logs/transport/zeromq.py
napalm_logs/transport/zeromq.py
# -*- coding: utf-8 -*- ''' ZeroMQ transport for napalm-logs. ''' from __future__ import absolute_import from __future__ import unicode_literals # Import stdlib import json # Import third party libs import zmq # Import napalm-logs pkgs from napalm_logs.transport.base import TransportBase class ZMQTransport(Transpo...
# -*- coding: utf-8 -*- ''' ZeroMQ transport for napalm-logs. ''' from __future__ import absolute_import from __future__ import unicode_literals # Import stdlib import json import logging # Import third party libs import zmq # Import napalm-logs pkgs from napalm_logs.exceptions import BindException from napalm_logs....
Raise bind exception and log
Raise bind exception and log
Python
apache-2.0
napalm-automation/napalm-logs,napalm-automation/napalm-logs
c8ce1315caf762f2c0073ab0ebed8ef627be5581
profile/files/openstack/horizon/overrides.py
profile/files/openstack/horizon/overrides.py
# Disable Floating IPs from openstack_dashboard.dashboards.project.access_and_security import tabs from openstack_dashboard.dashboards.project.instances import tables import horizon NO = lambda *x: False tabs.FloatingIPsTab.allowed = NO tabs.APIAccessTab.allowed = NO tables.AssociateIP.allowed = NO tables.SimpleAssoc...
# Disable Floating IPs from openstack_dashboard.dashboards.project.access_and_security import tabs from openstack_dashboard.dashboards.project.instances import tables import horizon NO = lambda *x: False tabs.FloatingIPsTab.allowed = NO tabs.APIAccessTab.allowed = NO tables.AssociateIP.allowed = NO tables.SimpleAssoc...
Remove volume consistency group tab from horizon in mitaka
Remove volume consistency group tab from horizon in mitaka
Python
apache-2.0
raykrist/himlar,tanzr/himlar,mikaeld66/himlar,raykrist/himlar,norcams/himlar,eckhart/himlar,mikaeld66/himlar,norcams/himlar,mikaeld66/himlar,raykrist/himlar,tanzr/himlar,TorLdre/himlar,tanzr/himlar,TorLdre/himlar,mikaeld66/himlar,tanzr/himlar,eckhart/himlar,norcams/himlar,raykrist/himlar,eckhart/himlar,TorLdre/himlar,n...
88dc672b8797834b03d67b962dda2de2d40ad4f1
demos/minimal.py
demos/minimal.py
#!/usr/bin/env python from gi.repository import GtkClutter GtkClutter.init([]) from gi.repository import GObject, Gtk, GtkChamplain GObject.threads_init() GtkClutter.init([]) window = Gtk.Window(type=Gtk.WindowType.TOPLEVEL) window.connect("destroy", Gtk.main_quit) widget = GtkChamplain.Embed() widget.set_size_req...
#!/usr/bin/env python # To run this example, you need to set the GI_TYPELIB_PATH environment # variable to point to the gir directory: # # export GI_TYPELIB_PATH=$GI_TYPELIB_PATH:/usr/local/lib/girepository-1.0/ from gi.repository import GtkClutter GtkClutter.init([]) from gi.repository import GObject, Gtk, GtkChampl...
Add description how to run the python demo
Add description how to run the python demo
Python
lgpl-2.1
Distrotech/libchamplain,PabloCastellano/libchamplain,PabloCastellano/libchamplain,StanciuMarius/Libchamplain-map-wrapping,PabloCastellano/libchamplain,StanciuMarius/Libchamplain-map-wrapping,StanciuMarius/Libchamplain-map-wrapping,PabloCastellano/libchamplain,GNOME/libchamplain,StanciuMarius/Libchamplain-map-wrapping,D...
0cda8aae3c5a8ad4d110c41007279a3364c6f33a
manage.py
manage.py
__author__ = 'zifnab' from flask_script import Manager, Server from app import app manager=Manager(app) manager.add_command('runserver', Server(host=app.config.get('HOST', '0.0.0.0'), port=app.config.get('PORT', 5000))) @manager.command def print_routes(): for rule in app.url_map.iter_rules(): print rule...
__author__ = 'zifnab' from flask_script import Manager, Server from app import app from database import Paste import arrow manager=Manager(app) manager.add_command('runserver', Server(host=app.config.get('HOST', '0.0.0.0'), port=app.config.get('PORT', 5000))) @manager.command def print_routes(): for rule in app....
Add way to remove old pastes
Add way to remove old pastes
Python
mit
zifnab06/zifb.in,zifnab06/zifb.in
3260594268f19dcfe1ea5613f939c892d609b47e
skimage/filters/tests/test_filter_import.py
skimage/filters/tests/test_filter_import.py
from warnings import catch_warnings, simplefilter def test_filter_import(): with catch_warnings(): simplefilter('ignore') from skimage import filter as F assert('sobel' in dir(F)) assert any(['has been renamed' in w for (w, _, _) in F.__warningregistry__])
from warnings import catch_warnings, simplefilter def test_filter_import(): with catch_warnings(): simplefilter('ignore') from skimage import filter as F assert('sobel' in dir(F)) assert any(['has been renamed' in w for (w, _, _) in F.__warningregistry__]), F.__warningregi...
Add debug print to failing assert
Add debug print to failing assert
Python
bsd-3-clause
Hiyorimi/scikit-image,juliusbierk/scikit-image,dpshelio/scikit-image,chriscrosscutler/scikit-image,Britefury/scikit-image,juliusbierk/scikit-image,vighneshbirodkar/scikit-image,jwiggins/scikit-image,WarrenWeckesser/scikits-image,rjeli/scikit-image,Britefury/scikit-image,youprofit/scikit-image,ajaybhat/scikit-image,benn...
7756236c5e1fa70f1173dbd58b7e57f56214c19f
unitTestUtils/parseXML.py
unitTestUtils/parseXML.py
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function from xml.etree.ElementTree import ParseError import xml.etree.ElementTree as ET import glob import sys def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def parse(): for infile in glob.glob('*.xml'): tr...
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function from xml.etree.ElementTree import ParseError import xml.etree.ElementTree as ET import glob import sys def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def parse(): for infile in glob.glob('*.xml'): tr...
Add a verbose error reporting on Travis
Add a verbose error reporting on Travis
Python
apache-2.0
wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework,wkrzemien/j-pet-framework
0df35e81754f703d1a8164cf0ea5169a53355185
code/python/knub/thesis/word2vec_gaussian_lda_preprocessing.py
code/python/knub/thesis/word2vec_gaussian_lda_preprocessing.py
import argparse import logging import os from gensim.models import Word2Vec logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) if __name__ == "__main__": parser = argparse.ArgumentParser("Prepare model for Gaussian LDA") parser.add_argument("--topic_model", type=str) ...
import argparse from codecs import open import logging import os from gensim.models import Word2Vec logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) if __name__ == "__main__": parser = argparse.ArgumentParser("Prepare model for Gaussian LDA") parser.add_argument("--...
Fix parameter parsing in gaussian lda preprocessing.
Fix parameter parsing in gaussian lda preprocessing.
Python
apache-2.0
knub/master-thesis,knub/master-thesis,knub/master-thesis,knub/master-thesis
ce0be23f554eb9949a3769da1e4a3d3d51b546f1
src/server/datab.py
src/server/datab.py
''' Database module. Get the database, convert it to the built-in data structure and hold a link to it. The module should be initialized before any other modules except mailer and log. Design: Heranort ''' ''' Connect to the database. ''' def connect_to_datab(): pass ''' Get raw data of the database. ''' def data...
''' Database module. Get the database, convert it to the built-in data structure and hold a link to it. The module should be initialized before any other modules except mailer and log. Design: Heranort ''' import sqlite3, os ''' Connect to the database. ''' def connect_to_datab(): path = os.getcwd() pparent_...
Add function of data connection
Add function of data connection
Python
mit
niwtr/map-walker
5d3d47e0fae9ddb9f445972e5186429163aabf40
statirator/core/management/commands/init.py
statirator/core/management/commands/init.py
import os from optparse import make_option from django.core.management.base import BaseCommand class Command(BaseCommand): help = "Init the static site project" args = '[directory]' option_list = ( make_option( '--title', '-t', dest='title', default='Default site', help=...
import os import logging from django.core.management.base import BaseCommand from optparse import make_option class Command(BaseCommand): help = "Init the static site project" args = '[directory]' option_list = ( make_option( '--title', '-t', dest='title', default='Default site', ...
Create the directory before calling the startprojcet command
Create the directory before calling the startprojcet command
Python
mit
MeirKriheli/statirator,MeirKriheli/statirator,MeirKriheli/statirator
2d584531d043804f3dcf3acf132cb60b463e4c1a
azdweb/markdown_serv.py
azdweb/markdown_serv.py
import os from flask import request, render_template from azdweb import app from azdweb.util import gh_markdown root_path = os.path.abspath("markdown") # {filename: (mtime, contents)} cache = {} def load(filename): with open(filename) as file: return gh_markdown.markdown(file.read()) def load_cached...
import codecs import os from flask import render_template from azdweb import app from azdweb.util import gh_markdown root_path = os.path.abspath("markdown") # {filename: (mtime, contents)} cache = {} def load(filename): with codecs.open(filename, encoding="utf-8") as file: return gh_markdown.markdown(...
Add support for a sidebar, and also add a /sw/ alias for /md/skywars/
Add support for a sidebar, and also add a /sw/ alias for /md/skywars/
Python
apache-2.0
daboross/dabo.guru,daboross/dabo.guru,daboross/dabo.guru,daboross/dabo.guru
a4c24372ffcbac656a9879cc2fd705d67a875a3e
prime-factors/prime_factors.py
prime-factors/prime_factors.py
# File: prime_factors.py # Purpose: Compute the prime factors of a given natural number. # Programmer: Amal Shehu # Course: Exercism # Date: Monday 26 September 2016, 12:05 AM
# File: prime_factors.py # Purpose: Compute the prime factors of a given natural number. # Programmer: Amal Shehu # Course: Exercism # Date: Monday 26 September 2016, 12:05 AM def prime(number): if number <= 1: return False else: if number % 1 == 0 and number % range(2,...
Set condition [1 is not a prime]
Set condition [1 is not a prime]
Python
mit
amalshehu/exercism-python
14fb663019038b80d42f212e0ad8169cd0d37e84
neutron_lib/exceptions/address_group.py
neutron_lib/exceptions/address_group.py
# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
# All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
Add address group in use exception
Add address group in use exception Related change: https://review.opendev.org/#/c/751110/ Change-Id: I2a9872890ca4d5e59a9e266c1dcacd3488a3265c
Python
apache-2.0
openstack/neutron-lib,openstack/neutron-lib,openstack/neutron-lib,openstack/neutron-lib
14d51aa701dcc8d1d3f026af947c935abb0eabe3
examples/rune.py
examples/rune.py
import cassiopeia as cass from cassiopeia.core import Summoner def test_cass(): name = "Kalturi" runes = cass.get_runes() for rune in runes: if rune.tier == 3: print(rune.name) if __name__ == "__main__": test_cass()
import cassiopeia as cass def print_t3_runes(): for rune in cass.get_runes(): if rune.tier == 3: print(rune.name) if __name__ == "__main__": print_t3_runes()
Change function name, remove unneeded summoner name
Change function name, remove unneeded summoner name
Python
mit
robrua/cassiopeia,10se1ucgo/cassiopeia,meraki-analytics/cassiopeia
d72df78e0dea27ae93bde52e43cec360a963b32c
openprescribing/frontend/management/commands/delete_measure.py
openprescribing/frontend/management/commands/delete_measure.py
from django.conf import settings from django.core.management import BaseCommand, CommandError from frontend.models import Measure class Command(BaseCommand): def handle(self, measure_id, **options): if not measure_id.startswith(settings.MEASURE_PREVIEW_PREFIX): raise CommandError( ...
from django.conf import settings from django.core.management import BaseCommand, CommandError from frontend.models import Measure from gcutils.bigquery import Client class Command(BaseCommand): def handle(self, measure_id, **options): if not measure_id.startswith(settings.MEASURE_PREVIEW_PREFIX): ...
Delete measures from BigQuery as well
Delete measures from BigQuery as well
Python
mit
ebmdatalab/openprescribing,annapowellsmith/openpresc,ebmdatalab/openprescribing,ebmdatalab/openprescribing,annapowellsmith/openpresc,annapowellsmith/openpresc,ebmdatalab/openprescribing,annapowellsmith/openpresc
9b6ff8eb88084b69190fed24de92eca31f8509d5
palindrome-products/palindrome_products.py
palindrome-products/palindrome_products.py
def largest_palindrome(): pass def smallest_palindrome(): pass
from collections import defaultdict def largest_palindrome(max_factor, min_factor=0): return _palindromes(max_factor, min_factor, max) def smallest_palindrome(max_factor, min_factor=0): return _palindromes(max_factor, min_factor, min) def _palindromes(max_factor, min_factor, minmax): pals = defaultdic...
Add an initial solution that works, but with the wrong output format
Add an initial solution that works, but with the wrong output format
Python
agpl-3.0
CubicComet/exercism-python-solutions
d0df78e9f660b138b5f79d6714312740ebcf1648
fparser/setup.py
fparser/setup.py
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('fparser',parent_package,top_path) return config
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('fparser',parent_package,top_path) config.add_data_files('log.config') return config
Add log.config to data files to fix installed fparser.
Add log.config to data files to fix installed fparser.
Python
bsd-3-clause
pemryan/f2py,travellhyne/f2py,pearu/f2py,pemryan/f2py
fa191537e15dd0729deb94aaa91dbb7fa9295e04
mathdeck/loadproblem.py
mathdeck/loadproblem.py
# -*- coding: utf-8 -*- """ mathdeck.loadproblem ~~~~~~~~~~~~ This module loads a problem file as a module. :copyright: (c) 2015 by Patrick Spencer. :license: Apache 2.0, see ../LICENSE for more details. """ import os import sys # Load problem file as def load_file_as_module(file): """ Load problem file a...
# -*- coding: utf-8 -*- """ mathdeck.loadproblem ~~~~~~~~~~~~~~~~~~~~ This module loads a problem file as a module. :copyright: (c) 2015 by Patrick Spencer. :license: Apache 2.0, see ../LICENSE for more details. """ import os import sys # Load problem file as def load_file_as_module(file_path): """ Load p...
Change package name in loadmodule call
Change package name in loadmodule call Not much reason to do this. It just happened.
Python
apache-2.0
patrickspencer/mathdeck,patrickspencer/mathdeck
6c39f3504dad1cf918189fd46d9e8529a2fc9586
Functions/template-python/lambda_function.py
Functions/template-python/lambda_function.py
"""Created By: Andrew Ryan DeFilippis""" print('Lambda cold-start...') from json import dumps, loads # Disable 'testing_locally' when deploying to AWS Lambda testing_locally = True verbose = True class CWLogs(object): def __init__(self, context): self.context = context def event(self, message, ev...
"""Created By: Andrew Ryan DeFilippis""" print('Lambda cold-start...') from json import dumps, loads # Disable 'testing_locally' when deploying to AWS Lambda testing_locally = True verbose = True class CWLogs(object): """Define the structure of log events to match all other CloudWatch Log Events logged by AWS ...
Add documentation, and modify default return value
Add documentation, and modify default return value
Python
apache-2.0
andrewdefilippis/aws-lambda
e6046cf33af1a4b1f16424740b5093ebd423842e
scipy/spatial/transform/__init__.py
scipy/spatial/transform/__init__.py
""" ======================================================== Spatial Transformations (:mod:`scipy.spatial.transform`) ======================================================== .. currentmodule:: scipy.spatial.transform This package implements various spatial transformations. For now, only rotations are supported. Rot...
""" ======================================================== Spatial Transformations (:mod:`scipy.spatial.transform`) ======================================================== .. currentmodule:: scipy.spatial.transform This package implements various spatial transformations. For now, only rotations are supported. Rot...
Add Slerp class to transform package
BLD: Add Slerp class to transform package
Python
bsd-3-clause
aarchiba/scipy,rgommers/scipy,mdhaber/scipy,grlee77/scipy,vigna/scipy,perimosocordiae/scipy,gertingold/scipy,anntzer/scipy,ilayn/scipy,anntzer/scipy,jamestwebber/scipy,person142/scipy,grlee77/scipy,gfyoung/scipy,e-q/scipy,perimosocordiae/scipy,matthew-brett/scipy,endolith/scipy,person142/scipy,scipy/scipy,jor-/scipy,il...
6db8a9e779031ae97977a49e4edd11d42fb6389d
samples/04_markdown_parse/epub2markdown.py
samples/04_markdown_parse/epub2markdown.py
#!/usr/bin/env python import sys import subprocess import os import os.path from ebooklib import epub # This is just a basic example which can easily break in real world. if __name__ == '__main__': # read epub book = epub.read_epub(sys.argv[1]) # get base filename from the epub base_name = os.path....
#!/usr/bin/env python import os.path import subprocess import sys from ebooklib import epub # This is just a basic example which can easily break in real world. if __name__ == '__main__': # read epub book = epub.read_epub(sys.argv[1]) # get base filename from the epub base_name = os.path.basename(os...
Make `samples/04_markdown_parse` Python 2+3 compatible
Make `samples/04_markdown_parse` Python 2+3 compatible
Python
agpl-3.0
booktype/ebooklib,aerkalov/ebooklib
82696dd76351f8d0bb4fcfe9f173ada652947acc
whacked4/whacked4/ui/dialogs/errordialog.py
whacked4/whacked4/ui/dialogs/errordialog.py
#!/usr/bin/env python #coding=utf8 """ Error dialog interface. """ from whacked4.ui import windows import wx class ErrorDialog(windows.ErrorDialogBase): def __init__(self, parent): windows.ErrorDialogBase.__init__(self, parent) wx.EndBusyCursor() def set_log(self,...
#!/usr/bin/env python #coding=utf8 """ Error dialog interface. """ from whacked4.ui import windows import wx class ErrorDialog(windows.ErrorDialogBase): def __init__(self, parent): windows.ErrorDialogBase.__init__(self, parent) if wx.IsBusy() == True: wx.EndBusyCursor() ...
Fix exceptions not displaying if a busy cursor was set.
Fix exceptions not displaying if a busy cursor was set.
Python
bsd-2-clause
GitExl/WhackEd4,GitExl/WhackEd4
2575946f1b05ac1601a00f8936ab3a701b05bc7e
tests/test_utils.py
tests/test_utils.py
import unittest from utils import TextLoader import numpy as np class TestUtilsMethods(unittest.TestCase): def setUp(self): self.data_loader = TextLoader("tests/test_data", batch_size=2, seq_length=5) def test_init(self): print (self.data_loader.vocab) print (self.data_loader.tensor) ...
import unittest from utils import TextLoader import numpy as np from collections import Counter class TestUtilsMethods(unittest.TestCase): def setUp(self): self.data_loader = TextLoader("tests/test_data", batch_size=2, seq_length=5) def test_init(self): print (self.data_loader.vocab) print...
Generalize method names to be compatible with Python 2.7 and 3.4
Generalize method names to be compatible with Python 2.7 and 3.4
Python
mit
hunkim/word-rnn-tensorflow,bahmanh/word-rnn-tensorflow
52fc9bc79343632a034d2dc51645306f4b58210c
tests/services/conftest.py
tests/services/conftest.py
import pytest from responses import RequestsMock from netvisor import Netvisor @pytest.fixture def netvisor(): kwargs = dict( sender='Test client', partner_id='xxx_yyy', partner_key='E2CEBB1966C7016730C70CA92CBB93DD', customer_id='xx_yyyy_zz', customer_key='7767899D6F5FB33...
import pytest from responses import RequestsMock from netvisor import Netvisor @pytest.fixture def netvisor(): kwargs = dict( sender='Test client', partner_id='xxx_yyy', partner_key='E2CEBB1966C7016730C70CA92CBB93DD', customer_id='xx_yyyy_zz', customer_key='7767899D6F5FB33...
Fix tests to work with responses 0.3.0
Fix tests to work with responses 0.3.0
Python
mit
fastmonkeys/netvisor.py
a92118d7ee6acde57ab9853186c43a5c6748e8a6
tracpro/__init__.py
tracpro/__init__.py
from __future__ import absolute_import # This will make sure the app is always imported when # Django starts so that shared_task will use this app. from .celery import app as celery_app # noqa __version__ = "1.0.0"
from __future__ import absolute_import # This will make sure the app is always imported when # Django starts so that shared_task will use this app. from .celery import app as celery_app # noqa VERSION = (1, 0, 0, "dev") def get_version(version): assert len(version) == 4, "Version must be formatted as (major, ...
Use tuple to represent version
Use tuple to represent version
Python
bsd-3-clause
rapidpro/tracpro,xkmato/tracpro,xkmato/tracpro,xkmato/tracpro,xkmato/tracpro,rapidpro/tracpro,rapidpro/tracpro
2b8674528972655937eff797e61fa6819bfc3ba8
apps/feeds/signals.py
apps/feeds/signals.py
from libs.djpubsubhubbub.signals import updated def update_handler(sender, update, **kwargs): """ Process new content being provided from SuperFeedr """ print sender for entry in update.entries: print entry updated.connect(update_handler, dispatch_uid='superfeedr')
from libs.djpubsubhubbub.signals import updated from .models import Feed def update_handler(sender, update, **kwargs): """ Process new content being provided from SuperFeedr """ print sender.topic users = [] feeds = Feed.objects.filter(feed_url=sender.topic) for feed in feeds: ...
Handle new content from SuperFeedr to Kippt
Handle new content from SuperFeedr to Kippt
Python
mit
jpadilla/feedleap,jpadilla/feedleap
532b0809b040318abbb8e62848f18ad0cdf72547
src/workspace/workspace_managers.py
src/workspace/workspace_managers.py
from workspace.models import GroupPublishedWorkspace, PublishedWorkSpace, WorkSpace def ref_from_workspace(workspace): if isinstance(workspace, WorkSpace): return 'group/' + str(workspace.id) elif isinstance(workspace, PublishedWorkSpace): return 'group_published/' + str(workspace.id) class...
from workspace.models import GroupPublishedWorkspace, PublishedWorkSpace, WorkSpace def ref_from_workspace(workspace): if isinstance(workspace, WorkSpace): return 'group/' + str(workspace.id) elif isinstance(workspace, PublishedWorkSpace): return 'group_published/' + str(workspace.id) class...
Make OrganizationWorkspaceManager ignore the original workspace when sharing workspaces with groups
Make OrganizationWorkspaceManager ignore the original workspace when sharing workspaces with groups
Python
agpl-3.0
rockneurotiko/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud
06e7cf66d37a34a33349e47c374e733b1f3006be
test/functional/feature_shutdown.py
test/functional/feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test bitcoind shutdown.""" from test_framework.test_framework import BitcoinTestFramework from test_framewo...
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test bitcoind shutdown.""" from test_framework.test_framework import BitcoinTestFramework from test_framewo...
Remove race between connecting and shutdown on separate connections
qa: Remove race between connecting and shutdown on separate connections
Python
mit
chaincoin/chaincoin,chaincoin/chaincoin,chaincoin/chaincoin,chaincoin/chaincoin,chaincoin/chaincoin,chaincoin/chaincoin
d73872b8bcc6c7c32fa10d4a8ffdd77fe568a954
pyautotest/cli.py
pyautotest/cli.py
# -*- coding: utf-8 -*- import logging import os import signal import time from optparse import OptionParser from watchdog.observers import Observer from pyautotest.observers import Notifier, ChangeHandler # Configure logging logging.basicConfig(format='%(asctime)s (%(name)s) [%(levelname)s]: %(message)s', datefmt=...
# -*- coding: utf-8 -*- import argparse import logging import os import signal import time from watchdog.observers import Observer from pyautotest.observers import Notifier, ChangeHandler # Configure logging logging.basicConfig(format='%(asctime)s (%(name)s) [%(levelname)s]: %(message)s', datefmt='%m-%d-%Y %H:%M:%S...
Switch from optparase to argparse
Switch from optparase to argparse
Python
mit
ascarter/pyautotest
5e30bd1ae8218a6ad5a2582c15aed99258994d83
tests/tests/test_swappable_model.py
tests/tests/test_swappable_model.py
from django.test import TestCase
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, modify_settings from boardinghouse.schema import get_schema_model class TestSwappableModel(TestCase): @modify_settings() def test_schema_model_app_not_found(self): settings.BOAR...
Write tests for swappable model.
Write tests for swappable model. Resolves #28, #36. --HG-- branch : fix-swappable-model
Python
bsd-3-clause
schinckel/django-boardinghouse,schinckel/django-boardinghouse,schinckel/django-boardinghouse
1b1652053213f3939b50b2ac66a775cd5d4beed9
openpnm/__init__.py
openpnm/__init__.py
r""" ======= OpenPNM ======= OpenPNM is a package for performing pore network simulations of transport in porous materials. OpenPNM consists of several key modules. Each module is consisted of several classes and each class is consisted of a few methods. Here, you'll find a comprehensive documentation of the modules,...
r""" ======= OpenPNM ======= OpenPNM is a package for performing pore network simulations of transport in porous materials. OpenPNM consists of several key modules. Each module is consisted of several classes and each class is consisted of a few methods. Here, you'll find a comprehensive documentation of the modules,...
Fix import order to avoid circular import
Fix import order to avoid circular import
Python
mit
PMEAL/OpenPNM
32bf828445ed897609b908dff435191287f922f4
bookie/views/stats.py
bookie/views/stats.py
"""Basic views with no home""" import logging from pyramid.view import view_config from bookie.bcelery import tasks from bookie.models import BmarkMgr from bookie.models.auth import ActivationMgr from bookie.models.auth import UserMgr LOG = logging.getLogger(__name__) @view_config( route_name="dashboard", ...
"""Basic views with no home""" import logging from pyramid.view import view_config from bookie.models import BmarkMgr from bookie.models.auth import ActivationMgr from bookie.models.auth import UserMgr LOG = logging.getLogger(__name__) @view_config( route_name="dashboard", renderer="/stats/dashboard.mako")...
Clean up old code no longer used
Clean up old code no longer used
Python
agpl-3.0
adamlincoln/Bookie,charany1/Bookie,GreenLunar/Bookie,charany1/Bookie,skmezanul/Bookie,charany1/Bookie,adamlincoln/Bookie,GreenLunar/Bookie,pombredanne/Bookie,wangjun/Bookie,bookieio/Bookie,skmezanul/Bookie,pombredanne/Bookie,bookieio/Bookie,GreenLunar/Bookie,pombredanne/Bookie,teodesson/Bookie,skmezanul/Bookie,bookieio...
c5a2c7e802d89ea17a7f0fd1a9194eaab8eaf61d
wcontrol/src/main.py
wcontrol/src/main.py
from flask import Flask app = Flask(__name__) app.config.from_object("config")
import os from flask import Flask app = Flask(__name__) app.config.from_object(os.environ.get("WCONTROL_CONF"))
Use a env var to get config
Use a env var to get config
Python
mit
pahumadad/weight-control,pahumadad/weight-control,pahumadad/weight-control,pahumadad/weight-control
8d669dc8b09b8d7c8bc9b4c123e2bdd7c3521521
functionaltests/api/base.py
functionaltests/api/base.py
# -*- coding: utf-8 -*- # # Copyright 2013 - Noorul Islam K M # # 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 applic...
# -*- coding: utf-8 -*- # # Copyright 2013 - Noorul Islam K M # # 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 applic...
Fix Tempest tests failing on gate-solum-devstack-dsvm
Fix Tempest tests failing on gate-solum-devstack-dsvm Due to a new commit on tempest, devstack tests are failing. It changed the signature of RestClient constructor. This patch changes the signature of our inherited class to match the change from tempest. Change-Id: Id15682c68de123c0d66c6aa10d889c6304fcbb65
Python
apache-2.0
devdattakulkarni/test-solum,openstack/solum,ed-/solum,openstack/solum,ed-/solum,gilbertpilz/solum,ed-/solum,julienvey/solum,gilbertpilz/solum,stackforge/solum,ed-/solum,stackforge/solum,gilbertpilz/solum,gilbertpilz/solum,devdattakulkarni/test-solum,julienvey/solum
98dfc5569fb1ae58905f8b6a36deeda324dcdd7b
cronos/teilar/models.py
cronos/teilar/models.py
from django.db import models class Departments(models.Model): urlid = models.IntegerField(unique = True) name = models.CharField("Department name", max_length = 200) class Teachers(models.Model): urlid = models.CharField("URL ID", max_length = 30, unique = True) name = models.CharField("Teacher name",...
from django.db import models class Departments(models.Model): urlid = models.IntegerField(unique = True) name = models.CharField("Department name", max_length = 200) deprecated = models.BooleanField(default = False) def __unicode__(self): return self.name class Teachers(models.Model): url...
Add deprecated flag for teachers and departments
Add deprecated flag for teachers and departments
Python
agpl-3.0
LinuxTeam-teilar/cronos.teilar.gr,LinuxTeam-teilar/cronos.teilar.gr,LinuxTeam-teilar/cronos.teilar.gr
2ac94aa922dbf2d07039bc6545e7b1d31c5c9e4e
src/cclib/progress/__init__.py
src/cclib/progress/__init__.py
__revision__ = "$Revision$" from textprogress import TextProgress try: import qt except ImportError: pass # import QtProgress will cause an error else: from qtprogress import QtProgress
__revision__ = "$Revision$" from textprogress import TextProgress import sys if 'qt' in sys.modules.keys(): from qtprogress import QtProgress
Check to see if qt is loaded; if so, export QtProgress class
Check to see if qt is loaded; if so, export QtProgress class
Python
lgpl-2.1
Clyde-fare/cclib,Schamnad/cclib,jchodera/cclib,ghutchis/cclib,gaursagar/cclib,berquist/cclib,andersx/cclib,ben-albrecht/cclib,Schamnad/cclib,cclib/cclib,ATenderholt/cclib,cclib/cclib,langner/cclib,berquist/cclib,Clyde-fare/cclib,langner/cclib,ben-albrecht/cclib,ATenderholt/cclib,ghutchis/cclib,jchodera/cclib,andersx/cc...
32def5f720b5ffb858f604dc360f66fa2a1b946a
pirx/base.py
pirx/base.py
import collections class Settings(object): def __init__(self): self._settings = collections.OrderedDict() def __setattr__(self, name, value): if name.startswith('_'): super(Settings, self).__setattr__(name, value) else: self._settings[name] = value def _se...
import collections class Settings(object): def __init__(self): self._settings = collections.OrderedDict() def __setattr__(self, name, value): if name.startswith('_'): super(Settings, self).__setattr__(name, value) else: self._settings[name] = value def __s...
Replace 'write' method with '__str__'
Replace 'write' method with '__str__'
Python
mit
piotrekw/pirx
d26b9d22363f9763f959332d07445a2a4e7c221c
services/vimeo.py
services/vimeo.py
import foauth.providers class Vimeo(foauth.providers.OAuth1): # General info about the provider provider_url = 'http://vimeo.com/' docs_url = 'http://developer.vimeo.com/apis/advanced' category = 'Videos' # URLs to interact with the API request_token_url = 'https://vimeo.com/oauth/request_tok...
import foauth.providers class Vimeo(foauth.providers.OAuth1): # General info about the provider provider_url = 'http://vimeo.com/' docs_url = 'http://developer.vimeo.com/apis/advanced' category = 'Videos' # URLs to interact with the API request_token_url = 'https://vimeo.com/oauth/request_tok...
Rewrite Vimeo to use the new scope selection system
Rewrite Vimeo to use the new scope selection system
Python
bsd-3-clause
foauth/foauth.org,foauth/foauth.org,foauth/oauth-proxy,foauth/foauth.org
612c393ec4d964fb933ebf5b8f957ae573ae65ba
tests/rules/test_git_push.py
tests/rules/test_git_push.py
import pytest from thefuck.rules.git_push import match, get_new_command from tests.utils import Command @pytest.fixture def stderr(): return '''fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin master ''' ...
import pytest from thefuck.rules.git_push import match, get_new_command from tests.utils import Command @pytest.fixture def stderr(): return '''fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin master ''' ...
Check git_push matches without specifying a branch
Check git_push matches without specifying a branch
Python
mit
nvbn/thefuck,mlk/thefuck,mlk/thefuck,nvbn/thefuck,SimenB/thefuck,Clpsplug/thefuck,scorphus/thefuck,scorphus/thefuck,SimenB/thefuck,Clpsplug/thefuck
e621b9f03b19e38dc6754dd1a4cb7b172e4891e7
tests/test_extended_tests.py
tests/test_extended_tests.py
import pytest import glob from html2kirby import HTML2Kirby files = [] for f in glob.glob("extended_tests/*.html"): html = f txt = f.replace(".html", ".txt") files.append((html, txt)) @pytest.mark.parametrize("html,kirby", files) def test_file(html, kirby): formatter = HTML2Kirby() with open(...
import pytest import glob import os from html2kirby import HTML2Kirby files = [] path = os.path.dirname(os.path.abspath(__file__)) extended_tests_path = os.path.join(path, "extended_tests/*.html") for f in glob.glob(extended_tests_path): html = f txt = f.replace(".html", ".txt") files.append((html, tx...
Fix the extended test search
Fix the extended test search
Python
mit
liip/html2kirby,liip/html2kirby
603aacd06b99326d7dbab28e750b34589c51fa05
tests/test_postgresqlgate.py
tests/test_postgresqlgate.py
# coding: utf-8 """ Unit tests for the base gate. """ from unittest.mock import MagicMock, mock_open, patch import smdba.postgresqlgate class TestPgGt: """ Test suite for base gate. """ @patch("os.path.exists", MagicMock(side_effect=[True, False, False])) @patch("smdba.postgresqlgate.open", new_ca...
# coding: utf-8 """ Unit tests for the base gate. """ from unittest.mock import MagicMock, mock_open, patch import smdba.postgresqlgate class TestPgGt: """ Test suite for base gate. """ @patch("os.path.exists", MagicMock(side_effect=[True, False, False])) @patch("smdba.postgresqlgate.open", new_ca...
Add unit test for database scenario call
Add unit test for database scenario call
Python
mit
SUSE/smdba,SUSE/smdba
2a0b1d070996bfb3d950d4fae70b264ddabc7d2f
sheldon/config.py
sheldon/config.py
# -*- coding: utf-8 -*- """ @author: Seva Zhidkov @contact: zhidkovseva@gmail.com @license: The MIT license Copyright (C) 2015 """ import os class Config: def __init__(self, prefix='SHELDON_'): """ Load config from environment variables. :param prefix: string, all needed environment va...
# -*- coding: utf-8 -*- """ @author: Seva Zhidkov @contact: zhidkovseva@gmail.com @license: The MIT license Copyright (C) 2015 """ import os class Config: def __init__(self, prefix='SHELDON_'): """ Load config from environment variables. :param prefix: string, all needed environment va...
Add function for getting installed plugins
Add function for getting installed plugins
Python
mit
lises/sheldon
2f8ae4d29bd95c298209a0cb93b5354c00186d6b
trackpy/C_fallback_python.py
trackpy/C_fallback_python.py
try: from _Cfilters import nullify_secondary_maxima except ImportError: import numpy as np # Because of the way C imports work, nullify_secondary_maxima # is *called*, as in nullify_secondary_maxima(). # For the pure Python variant, we do not want to call the function, # so we make nullify_secon...
try: from _Cfilters import nullify_secondary_maxima except ImportError: import numpy as np # Because of the way C imports work, nullify_secondary_maxima # is *called*, as in nullify_secondary_maxima(). # For the pure Python variant, we do not want to call the function, # so we make nullify_secon...
Fix and speedup pure-Python fallback for C filter.
BUG/PERF: Fix and speedup pure-Python fallback for C filter.
Python
bsd-3-clause
daniorerio/trackpy,daniorerio/trackpy
0003ef7fe3d59c4bda034dee334d45b6d7a2622d
pyvm_test.py
pyvm_test.py
import pyvm import unittest class PyVMTest(unittest.TestCase): def setUp(self): self.vm = pyvm.PythonVM() def test_load_const_num(self): self.assertEqual( 10, self.vm.eval('10') ) def test_load_const_str(self): self.assertEqual( "hoge", ...
import pyvm import unittest class PyVMTest(unittest.TestCase): def setUp(self): self.vm = pyvm.PythonVM() def test_load_const_num(self): self.assertEqual( 10, self.vm.eval('10') ) def test_load_const_num_float(self): self.assertEqual( 10...
Add test of storing float
Add test of storing float
Python
mit
utgwkk/tiny-python-vm
c4d64672c8c72ca928b354e9cfd35a7d40dbb78f
MROCPdjangoForm/ocpipeline/mrpaths.py
MROCPdjangoForm/ocpipeline/mrpaths.py
# # Code to load project paths # import os, sys MR_BASE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "/Users/dmhembere44/MR-connectome" )) MR_CMAPPER_PATH = os.path.join(MR_BASE_PATH, "cmapper" ) MR_MRCAP_PATH = os.path.join(MR_BASE_PATH, "mrcap" ) sys.path += [ MR_BASE_PATH, MR_CMAPPER_PATH, MR_MR...
# # Code to load project paths # import os, sys MR_BASE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.." )) MR_CMAPPER_PATH = os.path.join(MR_BASE_PATH, "cmapper" ) MR_MRCAP_PATH = os.path.join(MR_BASE_PATH, "mrcap" ) sys.path += [ MR_BASE_PATH, MR_CMAPPER_PATH, MR_MRCAP_PATH ]
Change to path, made relative
Change to path, made relative Former-commit-id: f00bf782fad3f6ddc6d2c97a23ff4f087ad3a22f
Python
apache-2.0
neurodata/ndmg
cba5a3d4928a3ee2e7672ca4a3f766a789d83acf
cupcake/smush/plot.py
cupcake/smush/plot.py
""" User-facing interface for plotting all dimensionality reduction algorithms """ def smushplot(data, smusher='pca', n_components=2, marker='o', marker_order=None, text=False, text_order=None, linewidth=1, linewidth_order=None, edgecolor='k', edgecolor_order=None, smusher_kws=None, ...
""" User-facing interface for plotting all dimensionality reduction algorithms """ def smushplot(data, smusher='PCA', x=1, y=2, n_components=2, marker='o', marker_order=None, text=False, text_order=None, linewidth=1, linewidth_order=None, edgecolor='k', edgecolor_order=None, s...
Add x, y arguments and docstring
Add x, y arguments and docstring
Python
bsd-3-clause
olgabot/cupcake
66ba9aa2172fbed67b67a06acb331d449d32a33c
tests/services/shop/conftest.py
tests/services/shop/conftest.py
""" :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import pytest from byceps.services.shop.cart.models import Cart from byceps.services.shop.sequence import service as sequence_service from byceps.services.shop.shop import service as shop_service from testfixtures.sho...
""" :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import pytest from byceps.services.shop.cart.models import Cart from byceps.services.shop.sequence import service as sequence_service from byceps.services.shop.shop import service as shop_service from testfixtures.sho...
Remove unused fixture from orderer
Remove unused fixture from orderer
Python
bsd-3-clause
homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps
2e897f7dce89d4b52c3507c62e7120ee238b713c
database/database_setup.py
database/database_setup.py
from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy.orm import relationship from sqlalchemy import create_engine from models.base import Base from models.user import User from models.store import Store from models.product import Product engine = create_engine('sqlite:///productcatalog.db') Base...
from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy.orm import relationship from sqlalchemy import create_engine from models.base import Base from models.user import User from models.store import Store from models.product import Product engine = create_engine('postgresql://catalog:catalog123!@l...
Connect database engine to postgresql
feat: Connect database engine to postgresql
Python
mit
caasted/aws-flask-catalog-app,caasted/aws-flask-catalog-app
a8c8b136f081e3a2c7f1fd1f833a85288a358e42
vumi_http_retry/workers/api/validate.py
vumi_http_retry/workers/api/validate.py
import json from functools import wraps from twisted.web import http from jsonschema import Draft4Validator from vumi_http_retry.workers.api.utils import response def validate(*validators): def validator(fn): @wraps(fn) def wrapper(api, req, *a, **kw): errors = [] for v...
import json from functools import wraps from twisted.web import http from jsonschema import Draft4Validator from vumi_http_retry.workers.api.utils import response def validate(*validators): def validator(fn): @wraps(fn) def wrapper(api, req, *a, **kw): errors = [] for v...
Change validators to allow additional arguments to be given to the functions they are wrapping
Change validators to allow additional arguments to be given to the functions they are wrapping
Python
bsd-3-clause
praekelt/vumi-http-retry-api,praekelt/vumi-http-retry-api
370dac353937d73798b4cd2014884b9f1aa95abf
osmaxx-py/osmaxx/contrib/auth/tests/test_frontend_permissions.py
osmaxx-py/osmaxx/contrib/auth/tests/test_frontend_permissions.py
from django.test import TestCase from django.contrib.auth.models import User from osmaxx.contrib.auth.frontend_permissions import user_in_osmaxx_group class TestFrontendPermissions(TestCase): def test_superuser_can_access_frontend_even_if_not_in_osmaxx_group(self): an_admin = User.objects.create_superuser...
from django.test import TestCase from django.contrib.auth.models import User, Group from osmaxx.contrib.auth.frontend_permissions import user_in_osmaxx_group, FRONTEND_USER_GROUP class TestFrontendPermissions(TestCase): def test_superuser_can_access_frontend_even_if_not_in_osmaxx_group(self): an_admin = U...
Test that users can access frontend when in osmaxx group
Test that users can access frontend when in osmaxx group
Python
mit
geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/drf-utm-zone-info,geometalab/osmaxx,geometalab/drf-utm-zone-info,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx,geometalab/osmaxx-frontend
837b767036f580a8c9d523e0f6c175a75d1dc3b2
pi_control_service/gpio_service.py
pi_control_service/gpio_service.py
from rpc import RPCService from pi_pin_manager import PinManager ALLOWED_ACTIONS = ('on', 'off', 'read') class GPIOService(RPCService): def __init__(self, rabbit_url, device_key, pin_config): self.pins = PinManager(config_file=pin_config) super(GPIOService, self).__init__( rabbit_ur...
from rpc import RPCService from pi_pin_manager import PinManager ALLOWED_ACTIONS = ('on', 'off', 'read', 'get_config') class GPIOService(RPCService): def __init__(self, rabbit_url, device_key, pin_config): self.pins = PinManager(config_file=pin_config) super(GPIOService, self).__init__( ...
Add get_config as GPIO action
Add get_config as GPIO action
Python
mit
HydAu/ProjectWeekds_Pi-Control-Service,projectweekend/Pi-Control-Service
6f8b5950a85c79ed33c1d00a35a1def2efc7bff5
tests/conftest.py
tests/conftest.py
from factories import post_factory, post
from factories import post_factory, post import os import sys root = os.path.join(os.path.dirname(__file__)) package = os.path.join(root, '..') sys.path.insert(0, os.path.abspath(package))
Make the tests run just via py.test
Make the tests run just via py.test
Python
mit
kalasjocke/hyp
39c777d6fc5555534628113190bb543c6225c07e
uncurl/bin.py
uncurl/bin.py
from __future__ import print_function import sys from .api import parse def main(): result = parse(sys.argv[1]) print(result)
from __future__ import print_function import sys from .api import parse def main(): if sys.stdin.isatty(): result = parse(sys.argv[1]) else: result = parse(sys.stdin.read()) print(result)
Read from stdin if available.
Read from stdin if available.
Python
apache-2.0
weinerjm/uncurl,spulec/uncurl
899f28e2cd7dbeb6227e8c56eef541cce1a424f4
alertaclient/commands/cmd_heartbeat.py
alertaclient/commands/cmd_heartbeat.py
import os import platform import sys import click prog = os.path.basename(sys.argv[0]) @click.command('heartbeat', short_help='Send a heartbeat') @click.option('--origin', default='{}/{}'.format(prog, platform.uname()[1])) @click.option('--tag', '-T', 'tags', multiple=True) @click.option('--timeout', metavar='EXPIR...
import os import platform import sys import click prog = os.path.basename(sys.argv[0]) @click.command('heartbeat', short_help='Send a heartbeat') @click.option('--origin', default='{}/{}'.format(prog, platform.uname()[1])) @click.option('--tag', '-T', 'tags', multiple=True) @click.option('--timeout', metavar='EXPIR...
Add check that heartbeat timeout is integer
Add check that heartbeat timeout is integer
Python
apache-2.0
alerta/python-alerta-client,alerta/python-alerta-client,alerta/python-alerta
ee8cb600c772e4a0f795a0fe00b1e612cb8a8e37
dirmuncher.py
dirmuncher.py
#!/usr/bin/env python # -*- Coding: utf-8 -*- import os class Dirmuncher: def __init__(self, directory): self.directory = directory def directoryListing(self): for dirname, dirnames, filenames in os.walk(self.directory): # Subdirectories for subdirname in dirnames: ...
#!/usr/bin/env python # -*- Coding: utf-8 -*- import os class Dirmuncher: def __init__(self, directory): self.directory = directory def getFiles(self): result = {} for dirname, dirnames, filenames in os.walk(self.directory): # Subdirectories for subdirname in ...
Sort files into dict with dir as key
[py] Sort files into dict with dir as key
Python
mit
claudemuller/masfir