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
954e8b979fcb5a0a276c6dc56cce96904cb0198f
fix imports in token_sender
genome/flow-core,genome/flow-core,genome/flow-core
flow/commands/token_sender.py
flow/commands/token_sender.py
import logging from flow.commands.base import CommandBase from flow.petri.netbase import Token, SetTokenMessage LOG = logging.getLogger(__name__) class TokenSenderCommand(CommandBase): def __init__(self, broker=None, storage=None, routing_key=None, exchange=None): self.broker = broker self.storag...
import logging from flow.commands.base import CommandBase from flow.petri.safenet import Token, SetTokenMessage LOG = logging.getLogger(__name__) class TokenSenderCommand(CommandBase): def __init__(self, broker=None, storage=None, routing_key=None, exchange=None): self.broker = broker self.storag...
agpl-3.0
Python
bec5402ed810bb2a0c8e432096e26f4a17405b8c
refactor to use RequestFactory
sounay/flaminggo-test,ehealthafrica-ci/onadata,SEL-Columbia/formhub,wesley1001/formhub,qlands/onadata,mainakibui/kobocat,wesley1001/formhub,kobotoolbox/kobocat,GeoODK/onadata,awemulya/fieldsight-kobocat,eHealthAfrica/onadata,spatialdev/onadata,eHealthAfrica/formhub,ultimateprogramer/formhub,makinacorpus/formhub,kobotoo...
api/tests/test_users_api.py
api/tests/test_users_api.py
import json from api.tests.test_api import TestAPICase from api.views import UserViewSet class TestUsersAPI(TestAPICase): def setUp(self): super(TestUsersAPI, self).setUp() def test_user_list(self): view = UserViewSet.as_view({'get': 'list'}) request = self.factory.get('/', **self.ext...
import json from api.tests.test_api import IntegrationTestAPICase class IntegrationTestUserAPI(IntegrationTestAPICase): def test_user_list(self): self._login_user_and_profile() response = self.client.get('/api/v1/users') data = [{'username': u'bob', 'first_name': u'Bob', 'last_name': u''}...
bsd-2-clause
Python
991dc8c75433f2c94950b55fbafc284d31c9b6c0
Change section name
openchordcharts/web-api,openchordcharts/openchordcharts-api
mongoshell.py
mongoshell.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import bson from paste.deploy import loadapp import pymongo # noqa from openchordcharts_api import environment from openchordcharts_api.model import Account, Chart # noqa base_dir = os.path.abspath(os.path.dirname(__file__)) conf_file_name = 'production.i...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import bson from paste.deploy import loadapp import pymongo # noqa from openchordcharts_api import environment from openchordcharts_api.model import Account, Chart # noqa base_dir = os.path.abspath(os.path.dirname(__file__)) conf_file_name = 'production.i...
agpl-3.0
Python
7df49846779392fef9bbb9f5387cfe5bc53b73ec
Update individual.py
atallah-lab/simple_simulation,atallah-lab/simple_simulation
src/individual.py
src/individual.py
# -*- coding: utf-8 -*- import src.constants as c from src.allele import Allele class Individual(object): def __init__(self, loci): self.alleles = loci.alleles def get_genotype(self): result = '' for a in self.alleles: result = result + a.name return result d...
import src.constants as c from src.allele import Allele class Individual(object): def __init__(self, loci): self.alleles = loci.alleles def get_genotype(self): result = '' for a in self.alleles: result = result + a.name return result def get_fitness(self): ...
mit
Python
069ff878186ef20767dc580a34c16ab54eeda147
Adjust reinv_bad_ack test case now that we send ACK before we call final response handler.
sippy/voiptests,sippy/voiptests
test_cases/reinv_bad_ack.py
test_cases/reinv_bad_ack.py
# Copyright (c) 2018 Sippy Software, Inc. All rights reserved. # # All rights reserved. # # 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, this ...
# Copyright (c) 2018 Sippy Software, Inc. All rights reserved. # # All rights reserved. # # 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, this ...
bsd-2-clause
Python
78a03f0b0cbc948a6c9fb215e9051d099c528a82
Change page title and heading
devinit/grand-bargain-monitoring,devinit/grand-bargain-monitoring,devinit/grand-bargain-monitoring
src/app.py
src/app.py
from flask import Flask from flask import render_template, url_for import parse_data app = Flask(__name__) @app.route("/dashboard") def dashboard(): data = parse_data.load_and_format_data() title = 'Grand Bargain Transparency Dashboard' return render_template('dashboard.html', data=data, heading=title...
from flask import Flask from flask import render_template, url_for import parse_data app = Flask(__name__) @app.route("/dashboard") def dashboard(): data = parse_data.load_and_format_data() title = 'Grand Bargain Monitoring' return render_template('dashboard.html', data=data, heading=title, page_title...
mit
Python
fa3626c0dab4befc217ef4c5558ff0b37390a8bc
Update contrib/linux/actions/service.py to work for CentOS Stream
nzlosh/st2,StackStorm/st2,nzlosh/st2,StackStorm/st2,StackStorm/st2,Plexxi/st2,Plexxi/st2,nzlosh/st2,nzlosh/st2,Plexxi/st2,Plexxi/st2,StackStorm/st2
contrib/linux/actions/service.py
contrib/linux/actions/service.py
#!/usr/bin/env python # Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
#!/usr/bin/env python # Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
apache-2.0
Python
a3feca50082d190eb39969b6494f651d9c0e58a8
remove link to private documentation
quora/asynq,manannayak/asynq
asynq/__init__.py
asynq/__init__.py
# Copyright 2016 Quora, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
# Copyright 2016 Quora, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
apache-2.0
Python
e97dc71511edc9f835a183ad3d674ca7e15d55b6
Add initial argparser entry point
Phelimb/atlas,Phelimb/atlas
atlas/__init__.py
atlas/__init__.py
from version import __version__
mit
Python
b100474ff7cf229f43e1bec314dc6ad548553841
decrease verbosity
altai/focus,altai/focus,altai/focus
C4GD_web/flask_memcache_session.py
C4GD_web/flask_memcache_session.py
# credits to https://github.com/unk2k/ import os import flask class SessionData(dict, flask.sessions.SessionMixin): pass class Session(flask.sessions.SessionInterface): session_class = SessionData def open_session(self, app, request): self.cookie_session_id = request.cookies.get( a...
# credits to https://github.com/unk2k/ import os import flask class SessionData(dict, flask.sessions.SessionMixin): pass class Session(flask.sessions.SessionInterface): session_class = SessionData def open_session(self, app, request): self.cookie_session_id = request.cookies.get( a...
lgpl-2.1
Python
c9ebc3556572e1fa905949c48ac74e58d3a71521
fix quickstart
ArneBab/gamification-engine,ActiDoo/gamification-engine,ActiDoo/gamification-engine,ArneBab/gamification-engine,ActiDoo/gamification-engine,ActiDoo/gamification-engine,ArneBab/gamification-engine
gengine/scripts/quickstart.py
gengine/scripts/quickstart.py
# -*- coding: utf-8 -*- import os import sys import gengine import shutil def usage(argv): cmd = os.path.basename(argv[0]) print('usage: %s <directory>\n' % (cmd,)) sys.exit(1) def copyDirectory(src, dest): try: shutil.copytree(src, dest) except shutil.Error as e: print('Error: %s...
# -*- coding: utf-8 -*- import os import sys import gengine import shutil def usage(argv): cmd = os.path.basename(argv[0]) print('usage: %s <directory>\n' % (cmd,)) sys.exit(1) def copyDirectory(src, dest): try: shutil.copytree(src, dest) except shutil.Error as e: print('Error: %s...
mit
Python
15f51604f82b88ba5a25f04e9c610971f55d0b5a
Fix use of deprecated pandas.core.common
has2k1/plotnine,has2k1/plotnine
ggplotx/stats/stat_boxplot.py
ggplotx/stats/stat_boxplot.py
from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import pandas as pd import pandas.api.types as pdtypes from matplotlib.cbook import boxplot_stats from ..utils import resolution from ..utils.doctools import document from .stat import stat ...
from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import pandas as pd import pandas.core.common as com from matplotlib.cbook import boxplot_stats from ..utils import resolution from ..utils.doctools import document from .stat import stat ...
mit
Python
a7f79a984f632bd39dd7bc820f6e51943da42f3f
remove pdb
fatrix/django-golive,fatrix/django-golive
golive/management/__init__.py
golive/management/__init__.py
from django.core.management import BaseCommand from fabric.state import output import sys from golive.stacks.stack import StackFactory import yaml class CoreCommand(BaseCommand): env_id = '<env_id>' help = 'Manage the given environment' output['stdout'] = False def get_config_value(self, key): ...
from django.core.management import BaseCommand from fabric.state import output import sys from golive.stacks.stack import StackFactory import yaml class CoreCommand(BaseCommand): env_id = '<env_id>' help = 'Manage the given environment' output['stdout'] = False def get_config_value(self, key): ...
bsd-2-clause
Python
ab273079a494827e085fed2f6fdf548992df3183
Update population.py
atallah-lab/simple_simulation,atallah-lab/simple_simulation
src/population.py
src/population.py
# -*- coding: utf-8 -*- import src.constants as c from src.allele import Allele from src.locus import Locus from src.individual import Individual class Population(object): def __init__(self, size=10): self.size = size def create_population(self): individuals = [] for i in range(0, se...
# -*- coding: utf-8 -*- import src.constants as c from src.allele import Allele from src.locus import Locus from src.individual import Individual class Population(object): def __init__(self, size=10): self.size = size def create_population(self): individuals = [] for i in range(0, se...
mit
Python
82eacf3c8ebfbe4185768e54fc443f088336747b
Use commit time, not author time.
qwhelan/asv,ericdill/asv,edisongustavo/asv,ericdill/asv,pv/asv,airspeed-velocity/asv,edisongustavo/asv,cpcloud/asv,mdboom/asv,spacetelescope/asv,mdboom/asv,waylonflinn/asv,edisongustavo/asv,giltis/asv,spacetelescope/asv,airspeed-velocity/asv,waylonflinn/asv,airspeed-velocity/asv,qwhelan/asv,pv/asv,cpcloud/asv,cpcloud/a...
asv/repo.py
asv/repo.py
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import datetime import os from .console import console from . import util class Repo(object): def __init__(self, ...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import datetime import os from .console import console from . import util class Repo(object): def __init__(self, ...
bsd-3-clause
Python
9172bea5e6698e7c1848111b703656e12ee475f0
fix coding style : add newlines
buildtimetrend/python-lib
buildtimetrend/settings.py
buildtimetrend/settings.py
# vim: set expandtab sw=4 ts=4: ''' Manages settings of buildtime trend Copyright (C) 2014 Dieter Adriaenssens <ruleant@users.sourceforge.net> This file is part of buildtime-trend <https://github.com/ruleant/buildtime-trend/> This program is free software: you can redistribute it and/or modify it under the terms of ...
# vim: set expandtab sw=4 ts=4: ''' Manages settings of buildtime trend Copyright (C) 2014 Dieter Adriaenssens <ruleant@users.sourceforge.net> This file is part of buildtime-trend <https://github.com/ruleant/buildtime-trend/> This program is free software: you can redistribute it and/or modify it under the terms of ...
agpl-3.0
Python
242b0cdcdfa3ebb5a5691b964cbb256de09534ee
Add CLI function for illumination correction
jni/microscopium,microscopium/microscopium,Don86/microscopium,jni/microscopium,Don86/microscopium,microscopium/microscopium,starcalibre/microscopium
husc/main.py
husc/main.py
#!/bin/env python # standard library import os import sys import argparse # dependencies from skimage import io as skimio # local imports from . import preprocess as pre from . import io parser = argparse.ArgumentParser(description="Run the HUSC functions.") subpar = parser.add_subparsers() stitch = subpar.add_pa...
import argparse parser = argparse.ArgumentParser(description="Run the HUSC functions.") subpar = parser.add_subparsers() stitch = subpar.add_parser('stitch', help="Stitch four quadrants into one image.") stitch.add_argument('quadrant_image', nargs=4, metavar='IM', hel...
bsd-3-clause
Python
56a653806f72d701132a930d7583397aba152120
Add hosts to the admin.
bryanveloso/avalonstar-tv,bryanveloso/avalonstar-tv,bryanveloso/avalonstar-tv
avalonstar/apps/broadcasts/admin.py
avalonstar/apps/broadcasts/admin.py
# -*- coding: utf-8 -*- from django.contrib import admin from .models import Broadcast, Highlight, Host, Raid, Series class HighlightInline(admin.StackedInline): extra = 1 model = Highlight class HostInline(admin.TabularInline): extra = 1 model = Host class RaidInline(admin.TabularInline): ex...
# -*- coding: utf-8 -*- from django.contrib import admin from .models import Broadcast, Highlight, Raid, Series class HighlightInline(admin.StackedInline): extra = 1 model = Highlight class RaidInline(admin.TabularInline): extra = 1 model = Raid class BroadcastAdmin(admin.ModelAdmin): inlines...
apache-2.0
Python
6b7e32c98fa8a11dcd7bbbadaa2a057e4ff0ce90
Add function to create name strings with random characters
F5Networks/f5-openstack-test,pjbreaux/f5-openstack-test
f5_os_test/__init__.py
f5_os_test/__init__.py
# Copyright 2016 F5 Networks Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
# Copyright 2016 F5 Networks Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
apache-2.0
Python
5136de58efd0a8cef7802926d2076e00d9372b99
change python interpreter to linux
Jailman/RaspberryPiRobot,Jailman/RaspberryPiRobot,Jailman/RaspberryPiRobot,Jailman/RaspberryPiRobot
Modules/mailman.py
Modules/mailman.py
#!/usr/bin/python # coding:utf-8 __author__ = 'Jailman' import smtplib from email.mime.text import MIMEText class MailToWarn(): def __init__(self, mailto_list, mail_host, mail_user, mail_pass): self.mailto_list = mailto_list self.mail_host = mail_host self.mail_user = mail_user s...
#!C:\Python27\python.exe # coding:utf-8 __author__ = 'Jailman' import smtplib from email.mime.text import MIMEText class MailToWarn(): def __init__(self, mailto_list, mail_host, mail_user, mail_pass): self.mailto_list = mailto_list self.mail_host = mail_host self.mail_user = mail_user ...
apache-2.0
Python
28df33d6383c680673351ea8fc8136bfef75c3f5
Add a test for `identity_wrapper`.
nanshe-org/nanshe,nanshe-org/nanshe,jakirkham/nanshe,DudLab/nanshe,DudLab/nanshe,jakirkham/nanshe
tests/test_generic_decorators.py
tests/test_generic_decorators.py
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>" __date__ = "$Mar 25, 2015 13:30:52 EDT$" import functools import nanshe.nanshe.generic_decorators class TestGenericDecorators(object): def test_update_wrapper(self): def wrapper(a_callable): def wrapped(*args, **kwargs): ...
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>" __date__ = "$Mar 25, 2015 13:30:52 EDT$" import functools import nanshe.nanshe.generic_decorators class TestGenericDecorators(object): def test_update_wrapper(self): def wrapper(a_callable): def wrapped(*args, **kwargs): ...
bsd-3-clause
Python
37a3ddcb4366e94e0ca78675e2545f889138c11f
Update fastai/_pytorch_doc.py
fastai/fastai
fastai/_pytorch_doc.py
fastai/_pytorch_doc.py
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/99_pytorch_doc.ipynb (unless otherwise specified). __all__ = ['PYTORCH_URL', 'pytorch_doc_link'] # Cell from types import ModuleType # Cell PYTORCH_URL = 'https://pytorch.org/docs/stable/' # Cell def _mod2page( mod:ModuleType, # A PyTorch module ) -> str: "Get...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/99_pytorch_doc.ipynb (unless otherwise specified). __all__ = ['PYTORCH_URL', 'pytorch_doc_link'] # Cell from types import ModuleType # Cell PYTORCH_URL = 'https://pytorch.org/docs/stable/' # Cell def _mod2page( mod:ModuleType, # A PyTorch module ) -> str: "Get...
apache-2.0
Python
cde3547d7492049a40858a02b85b054accc6da61
save image to temp file
NerdHerd91/Spacewalls,NerdHerd91/Spacewalls,NerdHerd91/Spacewalls
background_changer/setbackground.py
background_changer/setbackground.py
#! /usr/bin/python import ctypes import os from os.path import expanduser import platform import subprocess import sys import tempfile import time from threading import Thread import urllib image_url = "http://lorempixel.com/1920/1080/"; PLATFORM_LINUX = "Linux" PLATFORM_OSX = "Darwin" PLATFORM_WINDOWS = "Windows" ...
#! /usr/bin/python import ctypes import os from os.path import expanduser import platform import subprocess import sys import time from threading import Thread import urllib image_url = "http://lorempixel.com/1920/1080/"; dest_path = expanduser("~") + "/image.jpg" PLATFORM_LINUX = "Linux" PLATFORM_OSX = "Darwin" PL...
mit
Python
7bdc81f8fc1fd069c81eea622ae4f9bc31dcb8d5
Remove long flag
Encrylize/EasyEuler
EasyEuler/commands/list.py
EasyEuler/commands/list.py
import click from EasyEuler import data @click.command() @click.option('--sort', '-s', type=click.Choice(['id', 'difficulty']), default='id', help='Sort the list by problem attribute.') def cli(sort): """ Lists all available problems. """ problem_list = [] for problem in sorted(data.proble...
import click from EasyEuler import data @click.command() @click.option('--long', '-l', is_flag=True, help='Include problem descriptions.') @click.option('--sort', '-s', type=click.Choice(['id', 'difficulty']), default='id', help='Sort the list by problem attribute.') def cli(long, sort): ...
mit
Python
f9ded788d74c18cec6e41b3258f83d5ecc20e49a
Fix newLine in gDrive
TomasBedrnik/Meteo-Backend,TomasBedrnik/Meteo-Backend,TomasBedrnik/Meteo-Backend
getTemperatures.py
getTemperatures.py
#!/usr/bin/python2 #should be executed each minute with cron #*/1 * * * * /path/getTemperatures.py #system time has tobe rigt -> start after NTP time sync import datetime import os import glob import time #Adafruit_DHT has to be installed -> https://github.com/adafruit/Adafruit_Python_DHT.git import Adafruit_DHT #Ada...
#!/usr/bin/python2 #should be executed each minute with cron #*/1 * * * * /path/getTemperatures.py #system time has tobe rigt -> start after NTP time sync import datetime import os import glob import time #Adafruit_DHT has to be installed -> https://github.com/adafruit/Adafruit_Python_DHT.git import Adafruit_DHT #Ada...
lgpl-2.1
Python
b761ce959f512ce391a2a073462d00e9c90ab1f3
Migrate phase example to cartopy.
atmtools/typhon,atmtools/typhon
doc/pyplots/plot_phase.py
doc/pyplots/plot_phase.py
# -*- coding: utf-8 -*- """Plot to demonstrate the phase colormap. """ import matplotlib.pyplot as plt import netCDF4 import numpy as np import cartopy.crs as ccrs from cartopy.mpl.gridliner import (LONGITUDE_FORMATTER, LATITUDE_FORMATTER) from matplotlib.ticker import FuncFormatter from typhon.plots.maps import get_...
# -*- coding: utf-8 -*- """Plot to demonstrate the phase colormap. """ import numpy as np import matplotlib.pyplot as plt from netCDF4 import Dataset from mpl_toolkits.basemap import Basemap from matplotlib.ticker import FuncFormatter import typhon @FuncFormatter def degree_formatter(x, pos): """Create degree...
mit
Python
8cdea69e51241497f90c576ee386e9d7a2b011af
Update hyper-parameters to test the script for training
quqixun/BrainTumorClassification,quqixun/BrainTumorClassification
src/btc_parameters.py
src/btc_parameters.py
# Brain Tumor Classification # Script for Hyper Parameters # Author: Qixun Qu # Create on: 2017/10/14 # Modify on: 2017/10/14 # ,,, ,,, # ;" '; ;' ", # ; @.ss$$$$$$s.@ ; # `s$$$$$$$$$$$$$$$' # $$$$$$$$$$$$$$$$$$ # $$$$P""Y$$$Y""W$$$$$ # $$$$ p"$$$"q $$$$$ # $$$$ .$$$$$. $$$$' # $...
# Brain Tumor Classification # Script for Hyper Parameters # Author: Qixun Qu # Create on: 2017/10/14 # Modify on: 2017/10/14 # ,,, ,,, # ;" '; ;' ", # ; @.ss$$$$$$s.@ ; # `s$$$$$$$$$$$$$$$' # $$$$$$$$$$$$$$$$$$ # $$$$P""Y$$$Y""W$$$$$ # $$$$ p"$$$"q $$$$$ # $$$$ .$$$$$. $$$$' # $...
mit
Python
454b04d8426803f6e1d4fffd0ad5b2bfb3d41531
remove unneeded line
jmercouris/NeXT,jmercouris/NeXT
ports/pyqt-webengine/minibuffer.py
ports/pyqt-webengine/minibuffer.py
from PyQt5.QtWebEngineWidgets import QWebEngineView import core_interface class Minibuffer(QWebEngineView): """Documentation for Minibuffer """ scripts = {} callback_count = 0 window_identifier = 0 def __init__(self, window_identifier, parent=None): super(Minibuffer, self).__init__(p...
from PyQt5.QtWebEngineWidgets import QWebEngineView import core_interface class Minibuffer(QWebEngineView): """Documentation for Minibuffer """ scripts = {} callback_count = 0 window_identifier = 0 def __init__(self, window_identifier, parent=None): super(Minibuffer, self).__init__(p...
bsd-3-clause
Python
724e8770487bddaacbb8a36aca4c5299c0d64474
clean core urls
ioO/billjobs
core/urls.py
core/urls.py
from django.conf.urls import include, url from django.contrib import admin admin.site.site_header = 'Coworking space administration' urlpatterns = [ url(r'^billing/', include('billing.urls')), url(r'^admin/', include(admin.site.urls)), ]
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() admin.site.site_header = 'Coworking space administration' urlpatterns = patterns('', # Examples: # url(r'^$', 'billjobs.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^$...
mit
Python
ddd508257a03e7a138720a9b4b2090fd231a626d
add a filename token.
abadger/Bento,cournape/Bento,abadger/Bento,cournape/Bento,cournape/Bento,abadger/Bento,abadger/Bento,cournape/Bento
toydist/config_parser/grammar.py
toydist/config_parser/grammar.py
import os from toydist.compat.pyparsing import \ Literal, WordStart, CharsNotIn, LineEnd, alphas, Word, \ indentedBlock, OneOrMore, ZeroOrMore, OnlyOnce, \ Group, empty, lineEnd, FollowedBy, col, alphanums, \ Forward, Optional, delimitedList, \ ParseException, ParseFatalExceptio...
from toydist.compat.pyparsing import \ Literal, WordStart, CharsNotIn, LineEnd, alphas, Word, \ indentedBlock, OneOrMore, ZeroOrMore, OnlyOnce, \ Group, empty, lineEnd, FollowedBy, col, alphanums, \ Forward, Optional, delimitedList, \ ParseException, ParseFatalException #-------...
bsd-3-clause
Python
cd45860f68002145dd7bcd04d201b38bff4cd501
Bump version
xtrinch/fcm-django
fcm_django/__init__.py
fcm_django/__init__.py
__author__ = "xTrinch" __email__ = "mojca.rojko@gmail.com" __version__ = "1.0.12" class NotificationError(Exception): pass try: from django import VERSION as DJANGO_VERSION if DJANGO_VERSION < (3, 2): default_app_config = "fcm_django.apps.FcmDjangoConfig" except ImportError: pass
__author__ = "xTrinch" __email__ = "mojca.rojko@gmail.com" __version__ = "1.0.11" class NotificationError(Exception): pass try: from django import VERSION as DJANGO_VERSION if DJANGO_VERSION < (3, 2): default_app_config = "fcm_django.apps.FcmDjangoConfig" except ImportError: pass
mit
Python
5114973846b90a51155233b2472bfb7b25bcae14
Update typo in GCE service
fedora-infra/fedimg,fedora-infra/fedimg
fedimg/services/gce.py
fedimg/services/gce.py
# This file is part of fedimg. # Copyright (C) 2014 Red Hat, Inc. # # fedimg is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # #...
# This file is part of fedimg. # Copyright (C) 2014 Red Hat, Inc. # # fedimg is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # #...
agpl-3.0
Python
10cd33aba58d59e0e44f32b1ffaf5d50e15a33b0
prepare release 0.9.44
SEMAFORInformatik/femagtools,SEMAFORInformatik/femagtools
femagtools/__init__.py
femagtools/__init__.py
# -*- coding: utf-8 -*- """ femagtools ~~~~~~~~~~ Python bindings for FEMAG """ __title__ = 'femagtools' __version__ = '0.9.44' __author__ = 'Ronald Tanner' __license__ = 'BSD' __copyright__ = 'Copyright 2016-2018 SEMAFOR Informatik & Energie AG' from .bch import Reader from .model import MachineModel ...
# -*- coding: utf-8 -*- """ femagtools ~~~~~~~~~~ Python bindings for FEMAG """ __title__ = 'femagtools' __version__ = '0.9.44-snapshot' __author__ = 'Ronald Tanner' __license__ = 'BSD' __copyright__ = 'Copyright 2016-2018 SEMAFOR Informatik & Energie AG' from .bch import Reader from .model import Mach...
bsd-2-clause
Python
c7d86d7dd82421fb1f189d15718eb9a55c5574cf
Add maybe_make_pardir()
ronrest/convenience_py,ronrest/convenience_py
file/maybe_make_dir.py
file/maybe_make_dir.py
import os # ============================================================================== # MAYBE_MAKE_DIR # ============================================================================== def maybe_make_dir(path): """ Checks if a directory path exist...
import os # ============================================================================== # MAYBE_MAKE_DIR # ============================================================================== def maybe_make_dir(path): """ Checks if a directory path exist...
apache-2.0
Python
cd7d7d6843e0159b8d272b8cfc572884d061b89a
Add test for equality between tuple and namedtuple.
pfalcon/micropython,pfalcon/micropython,pfalcon/micropython,pfalcon/micropython,pfalcon/micropython
tests/basics/namedtuple1.py
tests/basics/namedtuple1.py
try: try: from ucollections import namedtuple except ImportError: from collections import namedtuple except ImportError: print("SKIP") raise SystemExit T = namedtuple("Tup", ["foo", "bar"]) # CPython prints fully qualified name, what we don't bother to do so far #print(T) for t in T(1, ...
try: try: from ucollections import namedtuple except ImportError: from collections import namedtuple except ImportError: print("SKIP") raise SystemExit T = namedtuple("Tup", ["foo", "bar"]) # CPython prints fully qualified name, what we don't bother to do so far #print(T) for t in T(1, ...
mit
Python
d4effa0749734293075b28a739affde55be52727
add some unit tests for bedpetobed12
abelhj/svtools,ernfrid/svtools,hall-lab/svtools,ernfrid/svtools,abelhj/svtools,hall-lab/svtools,hall-lab/svtools,abelhj/svtools,abelhj/svtools
tests/bedpetobed12_tests.py
tests/bedpetobed12_tests.py
from unittest import TestCase, main import os import sys import tempfile import difflib import svtools.bedpetobed12 class TestBedpeToBlockedBedConverter(TestCase): def setUp(self): self.converter = svtools.bedpetobed12.BedpetoBlockedBedConverter('TESTCONV', 20) def test_track_name(self): self...
from unittest import TestCase, main import os import sys import tempfile import difflib import svtools.bedpetobed12 class IntegrationTest_bedpetobed12(TestCase): def run_integration_test(self): test_directory = os.path.dirname(os.path.abspath(__file__)) test_data_dir = os.path.join(test_directory, ...
mit
Python
28d5bd2c00e5d3c3dfcb5198e45407568828a67f
Remove extension from config
bravesheep/dogmatist
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- # import os import sys from sphinx.highlighting import lexers from pygments.lexers.web import PhpLexer extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx' ] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'Dogmatist' copyright = u'2015, B...
# -*- coding: utf-8 -*- # import os import sys from sphinx.highlighting import lexers from pygments.lexers.web import PhpLexer extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx_http_domain' ] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'Dogmat...
mit
Python
4bf1ee120b2a660f9599fdd7589be1181179a28d
Fix import path for docs
mdomke/python-ulid
docs/conf.py
docs/conf.py
import os import sys sys.path.insert(0, os.path.abspath("..")) project = "" copyright = "2020, Martin Domke" author = "Martin Domke" # The full version, including alpha/beta/rc tags release = "1.0.0" # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx...
import os import sys sys.path.insert(0, os.path.abspath(".")) project = "" copyright = "2020, Martin Domke" author = "Martin Domke" # The full version, including alpha/beta/rc tags release = "1.0.0" # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx....
mit
Python
3f6cab19825fa3bd573f325738ce113a3eb2695f
Fix sorting.
Robpol86/sphinxcontrib-disqus,Robpol86/sphinxcontrib-disqus
docs/conf.py
docs/conf.py
"""Sphinx configuration file.""" import os import sys import time import sphinx_rtd_theme sys.path.append(os.path.abspath('..')) # General configuration. author = 'Robpol86' copyright = '{}, {}'.format(time.strftime('%Y'), author) exclude_patterns = ['_build'] extensions = ['sphinxcontrib.disqus'] master_doc = 'in...
"""Sphinx configuration file.""" import os import sys import time import sphinx_rtd_theme sys.path.append(os.path.abspath('..')) # General configuration. author = 'Robpol86' exclude_patterns = ['_build'] copyright = '{}, {}'.format(time.strftime('%Y'), author) extensions = ['sphinxcontrib.disqus'] master_doc = 'in...
mit
Python
77ccd056487a4ad5d58bef50fa10c1ac1a080888
Update function to optionally keep original extension
WhatWorksWhenForWhom/nlppln,WhatWorksWhenForWhom/nlppln,WhatWorksWhenForWhom/nlppln
nlppln/utils.py
nlppln/utils.py
"""NLP pipeline utility functionality""" import os import shutil import glob from nlppln import CWL_PATH DEFAULT_DATA_DIR = '{}/.local/share/'.format(os.environ.get('HOME')) CWL_DATA_DIR_PREFIX = 'commonwl' def remove_ext(fname): """Removes the extension from a filename """ bn = os.path.basename(fname) ...
"""NLP pipeline utility functionality""" import os import shutil import glob from nlppln import CWL_PATH DEFAULT_DATA_DIR = '{}/.local/share/'.format(os.environ.get('HOME')) CWL_DATA_DIR_PREFIX = 'commonwl' def remove_ext(fname): """Removes the extension from a filename """ bn = os.path.basename(fname) ...
apache-2.0
Python
bc5038c98d9107215b1c11716ba7f465f2f139d8
fix pep8 issue
mtiny/pyroute2,nazarewk/pyroute2,vodik/pyroute2,drzaeus77/pyroute2,little-dude/pyroute2,simudream/pyroute2,roolebo/pyroute2,mtiny/pyroute2,little-dude/pyroute2,little-dude/pyroute2,roolebo/pyroute2,drzaeus77/pyroute2,vodik/pyroute2,simudream/pyroute2,nazarewk/pyroute2,tomislacker/python-iproute2,nazarewk/pyroute2,tomis...
examples/create_vlan.py
examples/create_vlan.py
''' Example: python ./examples/create_vlan.py [master] Master is an interface to add VLAN to, e.g. eth0 or tap0 or whatever else. Without parameters use tap0 as the default. ''' import sys from pyroute2 import IPDB ip = IPDB() try: if len(sys.argv) == 2: # Get master interface from the command line ...
''' Example: python ./examples/create_vlan.py [master] Master is an interface to add VLAN to, e.g. eth0 or tap0 or whatever else. Without parameters use tap0 as the default. ''' import sys from pyroute2 import IPDB ip = IPDB() try: if len(sys.argv) == 2: # Get master interface from the command line ...
apache-2.0
Python
b559134bf980dc4f2410d8c94667205ad306ecd5
Change Sphinx theme
xolox/python-npm-accel,xolox/python-npm-accel
docs/conf.py
docs/conf.py
# Accelerator for npm, the Node.js package manager. # # Author: Peter Odding <peter@peterodding.com> # Last Change: June 28, 2017 # URL: https://github.com/xolox/python-npm-accel """Sphinx documentation configuration for the `npm-accel` project.""" import os import sys # Add the npm-accel source distribution's root ...
# Accelerator for npm, the Node.js package manager. # # Author: Peter Odding <peter@peterodding.com> # Last Change: June 28, 2017 # URL: https://github.com/xolox/python-npm-accel """Sphinx documentation configuration for the `npm-accel` project.""" import os import sys # Add the npm-accel source distribution's root ...
mit
Python
371f69ae2861c04bef9a4942427ad26bf431c72b
Update docs conf.
thedrow/pytest-benchmark,aldanor/pytest-benchmark,ionelmc/pytest-benchmark,SectorLabs/pytest-benchmark
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', 'sphinxcontrib.napoleon' ] if os.getenv('SPELLCHECK'): exten...
# -*- coding: utf-8 -*- import re import os extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', 'sphinxcontrib.napoleon' ] if os.getenv('SPELLCHECK'): extensions +...
bsd-2-clause
Python
c199f571440626ac05cdc0c34f831c3b0f8a2b25
Use MathJax.
memmett/PyWENO,memmett/PyWENO,memmett/PyWENO
docs/conf.py
docs/conf.py
# # PyWENO documentation build configuration file # import os import sys # path to autogen'ed modules sys.path.append(os.path.abspath('..')) # mock out some extension modules class Mock(object): def __init__(self, *args, **kwargs): pass def __call__(self, *args, **kwargs): return Mock() ...
# # PyWENO documentation build configuration file # import os import sys # path to autogen'ed modules sys.path.append(os.path.abspath('..')) # mock out some extension modules class Mock(object): def __init__(self, *args, **kwargs): pass def __call__(self, *args, **kwargs): return Mock() ...
bsd-3-clause
Python
49fd49e7ee9fbb9dc8fdc785bc022ca26dd6ff16
Fix dirty-flag removal in docs/conf.py
tuturto/hy,freezas/hy,kartikm/hy,adamfeuer/hy
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing dir. import re, os, sys, time, cgi sys.path.append(os.path.abspath("..")) from get_version import __version__ as hy_version # Read the Docs might dirty its checkout, so strip the dirty flag. hy_version = re.sub('[+.]...
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing dir. import os, sys, time, cgi sys.path.append(os.path.abspath("..")) from get_version import __version__ as hy_version if hy_version.endswith(".dirty"): # Read the Docs might dirty its checkout, so ignore this. ...
mit
Python
1a98b29293ccfab6534a48402414e89726d8e5bb
Set icon, summary for notification
familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG,familug/FAMILUG
Python/pomodoro.py
Python/pomodoro.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import subprocess as spr import time def main(): start = datetime.datetime.now() start_str = start.strftime("%H:%M:%S") spr.call(['notify-send', '--app-name', 'POMODORO', '--icon', 'dialog-information', ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import subprocess as spr import time def main(): start = datetime.datetime.now() spr.call(['notify-send', 'Started new pomodoro']) time.sleep(30 * 60) end = datetime.datetime.now() duration = (end - start).total_seconds() // 60 fo...
bsd-2-clause
Python
d65e58f108d6060166319b89686dea31e25b058d
Update wiki.py
RgTqUg/lamia
lamia/wiki.py
lamia/wiki.py
import requests import urllib from requests.auth import HTTPBasicAuth class entry(object): def __init__(self, page, auther): self.user = auther.user self.key = auther.key self.id_number = page["id"] self.created_at = page["created_at"] self.last_update = page["updated_at"] self.title = page["title"] ...
import requests import urllib from requests.auth import HTTPBasicAuth class entry(object): def __init__(self, page, auther): self.user = auther.user self.key = auther.key self.id_number = page["id"] self.created_at = page["created_at"] self.last_update = page["updated_at"] self.title = page["title"] ...
mit
Python
cba5d8b152093612eee929f0d07d088e17d74cc1
Bump of version to 1.0.0 to make it compatible with Firefox 4 https://github.com/darwin/firepython/issues/13
binaryage/firelogger.py
firepython/__init__.py
firepython/__init__.py
# -*- mode: python; coding: utf-8 -*- """ FireLogger_ server-side support library for Python. For usage see ``README.txt`` or visit the `github homepage`_. .. _FireLogger: https://addons.mozilla.org/en-US/firefox/addon/11090 .. _github homepage: http://github.com/darwin/firepython """ __api_version__ = '1.0' # ^--- c...
# -*- mode: python; coding: utf-8 -*- """ FireLogger_ server-side support library for Python. For usage see ``README.txt`` or visit the `github homepage`_. .. _FireLogger: https://addons.mozilla.org/en-US/firefox/addon/11090 .. _github homepage: http://github.com/darwin/firepython """ __api_version__ = '0.9' # ^--- c...
bsd-3-clause
Python
a2d575aa64da07fb4d40d38b7404c63bbb8a1cd2
Add on_delete to ForeignKey
wq/django-swappable-models
tests/default_app/models.py
tests/default_app/models.py
from django.db import models import swapper class BaseType(models.Model): name = models.CharField(max_length=255) class Meta: abstract = True class Type(BaseType): class Meta: swappable = swapper.swappable_setting("default_app", "Type") class Item(models.Model): type = models.Fore...
from django.db import models import swapper class BaseType(models.Model): name = models.CharField(max_length=255) class Meta: abstract = True class Type(BaseType): class Meta: swappable = swapper.swappable_setting("default_app", "Type") class Item(models.Model): type = models.Fore...
mit
Python
2627e2b7ef516a9be2b453e4c216ef7a163e0673
Bump version to 0.6.1.post1
oddbird/gurtel,oddbird/gurtel
gurtel/__init__.py
gurtel/__init__.py
__version__ = '0.6.1.post1'
__version__ = '0.6.1'
bsd-3-clause
Python
52ea3c736178a6a7a693a7a6a819e7c24b29454f
Revert back VariantDirWrap for Simba framework (compatibility)
yanbe/platform-espressif8266
builder/frameworks/simba.py
builder/frameworks/simba.py
# Copyright 2014-present PlatformIO <contact@platformio.org> # # 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 applicabl...
# Copyright 2014-present PlatformIO <contact@platformio.org> # # 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 applicabl...
apache-2.0
Python
8f1cf7f71cae44967a4fe260d149eb6c49c40d17
Add test for successive traffic entries
agdsn/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,agdsn/pycroft
tests/model/test_traffic.py
tests/model/test_traffic.py
from pycroft.model.traffic import PmacctTrafficEgress, PmacctTrafficIngress, TrafficVolume from tests import FactoryDataTestBase from tests.factories.traffic import PMAcctTrafficEgressFactory, PMAcctTrafficIngressFactory from tests.factories.user import UserWithHostFactory class PMAcctPseudoTableTest(FactoryDataTestB...
from pycroft.model.traffic import PmacctTrafficEgress, PmacctTrafficIngress, TrafficVolume from tests import FactoryDataTestBase from tests.factories.traffic import PMAcctTrafficEgressFactory, PMAcctTrafficIngressFactory from tests.factories.user import UserWithHostFactory class PMAcctPseudoTableTest(FactoryDataTestB...
apache-2.0
Python
ebd2fc847336d5e1497b57987c255f9d2965339e
Add number days argument
dbinetti/barberscore,dbinetti/barberscore-django,dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore
project/api/management/commands/sync_groups.py
project/api/management/commands/sync_groups.py
# Standard Libary import datetime # Django from django.core.management.base import BaseCommand # First-Party from api.models import Group from bhs.models import Structure from bhs.updaters import update_or_create_group_from_structure from django.utils import ( timezone, ) class Command(BaseCommand): help =...
# Standard Libary import datetime # Django from django.core.management.base import BaseCommand # First-Party from api.models import Group from bhs.models import Structure from bhs.updaters import update_or_create_group_from_structure from django.utils import ( timezone, ) class Command(BaseCommand): help = ...
bsd-2-clause
Python
d9a6071674857ceae566d29c7c77a31a5ed5214d
Return proper WWW-Authenticate header if API authentication fails
homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps
byceps/blueprints/api/decorators.py
byceps/blueprints/api/decorators.py
""" byceps.blueprints.api.decorators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from functools import wraps from typing import Optional from flask import abort, request from werkzeug.datastructures import WWWAuthenticate fro...
""" byceps.blueprints.api.decorators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from functools import wraps from typing import Optional from flask import abort, request from ...services.authentication.api import service as a...
bsd-3-clause
Python
b5653ac28ac8358127943bd1f40c22dfd8a274f3
Make Python example output identical to C++ and Java by removing redundant spaces.
malthe/google-protobuf,malthe/google-protobuf,malthe/google-protobuf,malthe/google-protobuf,malthe/google-protobuf
examples/list_people.py
examples/list_people.py
#! /usr/bin/python # See README.txt for information and build instructions. import addressbook_pb2 import sys # Iterates though all people in the AddressBook and prints info about them. def ListPeople(address_book): for person in address_book.person: print "Person ID:", person.id print " Name:", person.na...
#! /usr/bin/python # See README.txt for information and build instructions. import addressbook_pb2 import sys # Iterates though all people in the AddressBook and prints info about them. def ListPeople(address_book): for person in address_book.person: print "Person ID:", person.id print " Name:", person.na...
bsd-3-clause
Python
ff4dd944335f2469cb26bbb5234e0ee377c68a18
refactor example maurer_rose.py
mozman/ezdxf,mozman/ezdxf,mozman/ezdxf,mozman/ezdxf,mozman/ezdxf
examples/maurer_rose.py
examples/maurer_rose.py
# Copyright (c) 2019-2022, Manfred Moitzi # License: MIT License from typing import Iterable, Tuple import pathlib import math import ezdxf from ezdxf import zoom CWD = pathlib.Path("~/Desktop/Outbox").expanduser() if not CWD.exists(): CWD = pathlib.Path(".") # ----------------------------------------------------...
# Purpose: draw a maurer rose with polylines # https://en.wikipedia.org/wiki/Maurer_rose # Copyright (c) 2019-2021, Manfred Moitzi # License: MIT License from typing import Iterable, Tuple import pathlib import math import ezdxf from ezdxf import zoom DIR = pathlib.Path("~/Desktop/Outbox").expanduser() N = 6 # The ro...
mit
Python
b0fff7ee5b587213da1b76df0907ee0e9e3746ab
Print out last gameID after all tasks completed.
lanyudhy/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite,lanyudhy/Halite-II,HaliteChallenge/Halite,lanyudhy/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite,HaliteChallenge/Halite,HaliteChallenge/Halite-II,HaliteChallenge/Halite,HaliteChallenge/Halite-II...
admin/checkTaskCompletion.py
admin/checkTaskCompletion.py
#!/usr/bin/env python3 import configparser import time from datetime import datetime import pymysql parser = configparser.ConfigParser() parser.read("../halite.ini") DB_CONFIG = parser["database"] def check_compiles(db): db.begin() with db.cursor() as cursor: cursor.execute("SELECT COUNT(*) FROM Us...
#!/usr/bin/env python3 import configparser import time from datetime import datetime import pymysql parser = configparser.ConfigParser() parser.read("../halite.ini") DB_CONFIG = parser["database"] def check_compiles(db): db.begin() with db.cursor() as cursor: cursor.execute("SELECT COUNT(*) FROM Us...
mit
Python
40ed344eab49427cee04859d1ba3136d4211ebee
Return [] if the video's chunks object doesn't contain "live".
ArchiveTeam/twitchtv-discovery-grab,ArchiveTeam/twitchtv-discovery-grab
getflv.py
getflv.py
'''Given video id, output the FLV URLs A video ID should look something like a12345. ''' import requests import re import gzip import json import sys CHUNK_URL = 'http://api.twitch.tv/api/videos/{0}?as3=t' default_headers = {'User-Agent': 'ArchiveTeam'} def main(): video_id = sys.argv[1] output_filename = ...
'''Given video id, output the FLV URLs A video ID should look something like a12345. ''' import requests import re import gzip import json import sys CHUNK_URL = 'http://api.twitch.tv/api/videos/{0}?as3=t' default_headers = {'User-Agent': 'ArchiveTeam'} def main(): video_id = sys.argv[1] output_filename = ...
unlicense
Python
504d2d6ed54620c3a8b988566f2cef74503b4adf
modify import statement in online_check.py
misterlihao/network-programming-project
online_check.py
online_check.py
import wait_socket_messages as wsm import socket_handler as sh import socket def ReceivingOnlineChecks(ready_socket): while(1): check, from_who = ready_socket.recvfrom(10) ready_socket.sendto(b'Online',(from_who, check_online_port)) ready_socket.close() pass def CheckSomeoneOnline(...
import wait_socket_messages as wsm import socket_handler as sh import socket def ReceivingOnlineChecks(ready_socket): while(1): check, from_who = ready_socket.recvfrom(10) ready_socket.sendto(b'Online',(from_who, check_online_port)) ready_socket.close() pass def CheckSomeoneOnline(...
mit
Python
8de8da05bb9461aaa48d3058f5b1e2caab6191f1
Use dict() syntax that works in Python 2.6 onward
OpenMath/py-openmath
openmath/xml.py
openmath/xml.py
from . import openmath as om openmath_ns = "http://www.openmath.org/OpenMath" omtags = { "OMOBJ": om.OMObject, "OMR": om.OMReference, "OMI": om.OMInteger, "OMF": om.OMFloat, "OMSTR": om.OMString, "OMB": om.OMBytes, "OMS": om.OMSymbol, "OMV": om.OMVariable, "OMFOREIGN": om.OMForeign...
from . import openmath as om openmath_ns = "http://www.openmath.org/OpenMath" omtags = { "OMOBJ": om.OMObject, "OMR": om.OMReference, "OMI": om.OMInteger, "OMF": om.OMFloat, "OMSTR": om.OMString, "OMB": om.OMBytes, "OMS": om.OMSymbol, "OMV": om.OMVariable, "OMFOREIGN": om.OMForeign...
mit
Python
ab4ae040895c50da6cb0827f6461d1733c7fe30a
Add real plugin state tests for plugins that always work (meta, containers, services).
Oxygem/canaryd,Oxygem/canaryd
tests/test_plugin_states.py
tests/test_plugin_states.py
from contextlib import contextmanager from os import path from unittest import TestCase from dictdiffer import diff from jsontest import JsonTest from mock import patch from canaryd_packages import six from canaryd.plugin import get_plugin_by_name class TestPluginRealStates(TestCase): def run_plugin(self, plug...
from contextlib import contextmanager from os import path from unittest import TestCase from canaryd_packages import six from dictdiffer import diff from jsontest import JsonTest from mock import patch from canaryd.plugin import get_plugin_by_name @six.add_metaclass(JsonTest) class TestPluginStates(TestCase): j...
mit
Python
9472e9670da6d8b3e7ff7cb0ffd23b8362f7985c
remove extra print
pavlov99/jsonapi,pavlov99/jsonapi
tests/testapp/middleware.py
tests/testapp/middleware.py
from django.http import HttpResponse from django.conf import settings import json class NonHtmlDebugToolbarMiddleware(object): """ The Django Debug Toolbar usually only works for views that return HTML. This middleware wraps any non-HTML response in HTML if the request has a 'debug' query parameter (e.g...
from django.http import HttpResponse from django.conf import settings import json class NonHtmlDebugToolbarMiddleware(object): """ The Django Debug Toolbar usually only works for views that return HTML. This middleware wraps any non-HTML response in HTML if the request has a 'debug' query parameter (e.g...
mit
Python
3c572d213cdab91449427e76fc13ae5ef796b5a4
Fix #15 in ansible >= 2.3.0
h-hirokawa/atom-autocomplete-ansible,h-hirokawa/atom-autocomplete-ansible
lib/parse_ansible.py
lib/parse_ansible.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import os from ansible.cli.doc import DocCLI from ansible.playbook import Play from ansible.playbook.block import Block from ansible.playbook.role import Role from ansible.playbook.task import Task from ansible.plugins import lookup_loader, module_loader from a...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import os from ansible.cli.doc import DocCLI from ansible.playbook import Play from ansible.playbook.block import Block from ansible.playbook.role import Role from ansible.playbook.task import Task from ansible.plugins import lookup_loader, module_loader from a...
mit
Python
02696b462a4ca40c0df1051f721cbba7822854f7
Remove stray blank line
Duke-GCB/DukeDSHandoverService,Duke-GCB/DukeDSHandoverService,Duke-GCB/DukeDSHandoverService
d4s2/urls.py
d4s2/urls.py
from django.conf.urls import url, include from django.contrib import admin from django.views.generic.base import RedirectView from django.contrib.auth import views as auth_views from rest_framework.authtoken import views as authtoken_views urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^ownership/', i...
from django.conf.urls import url, include from django.contrib import admin from django.views.generic.base import RedirectView from django.contrib.auth import views as auth_views from rest_framework.authtoken import views as authtoken_views urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^ownership/', ...
mit
Python
698b29a82b94d9d819fa515e7593082abfccbc69
Add environment update needed for issue #510 test
jenisys/behave,jenisys/behave
issue.features/environment.py
issue.features/environment.py
# -*- coding: UTF-8 -*- # FILE: features/environment.py """ Functionality: * active tags """ from __future__ import print_function from behave.tag_matcher import ActiveTagMatcher, setup_active_tag_values from behave4cmd0.setup_command_shell import setup_command_shell_processors4behave import six import sys import p...
# -*- coding: UTF-8 -*- # FILE: features/environment.py """ Functionality: * active tags """ from behave.tag_matcher import ActiveTagMatcher, setup_active_tag_values from behave4cmd0.setup_command_shell import setup_command_shell_processors4behave import six import sys import platform # -- MATCHES ANY TAGS: @use.w...
bsd-2-clause
Python
102374c49da1f2384dd9a7422b9e5463f24c2d54
Update gmp to 6.0.0a and enable building on both darwin-32 and darwin-64
BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild
packages/gmp.py
packages/gmp.py
class GmpPackage (Package): def __init__ (self): Package.__init__ (self, 'gmp', '6.0.0a', sources = [ 'https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz' ], configure_flags = ['--enable-cxx', '--disable-dependency-tracking'] ) self.source_dir_name = 'gmp-6.0.0' def arch_build (self, arch): if ...
class GmpPackage (Package): def __init__ (self): Package.__init__ (self, 'gmp', '5.0.4', sources = [ 'ftp://ftp.gmplib.org/pub/%{name}-%{version}/%{name}-%{version}.tar.bz2' ], configure_flags = ['--enable-cxx --disable-dependency-tracking']) if Package.profile.name == 'darwin': self.configure_flags.ext...
mit
Python
e78adec9a36c6279b9258f53e075a39bcfbb1dc0
replace callbacks with coroutines
LearnProgramming/lpmc-site,LearnProgramming/lpmc-site,LearnProgramming/lpmc-site
github.py
github.py
import config import tornado.auth import tornado.escape import tornado.gen import tornado.httpclient import tornado.httputil class GithubMixin(tornado.auth.OAuth2Mixin): _OAUTH_AUTHORIZE_URL = 'https://github.com/login/oauth/authorize' _OAUTH_ACCESS_TOKEN_URL = 'https://github.com/login/oauth/access_token' def au...
import config import tornado.auth import tornado.concurrent import tornado.httpclient import tornado.escape import tornado.httputil class GithubMixin(tornado.auth.OAuth2Mixin): _OAUTH_AUTHORIZE_URL = 'https://github.com/login/oauth/authorize' _OAUTH_ACCESS_TOKEN_URL = 'https://github.com/login/oauth/access_token' ...
mit
Python
2ae440b9bcc6f6d322e5be72382eeb5218bec217
remove spaces
openprocurement/restkit,benoitc/restkit
examples/test_gevent.py
examples/test_gevent.py
import timeit from gevent import monkey; monkey.patch_all() import gevent from restkit import * from restkit.globals import set_manager, get_manager from restkit.manager.mgevent import GeventManager #set_logging("debug") print "Manager was: %s" % type(get_manager()) set_manager(GeventManager()) print"Manager is set...
import timeit from gevent import monkey; monkey.patch_all() import gevent from restkit import * from restkit.globals import set_manager, get_manager from restkit.manager.mgevent import GeventManager #set_logging("debug") print "Manager was: %s" % type(get_manager()) set_manager(GeventManager()) print"Manager is se...
apache-2.0
Python
53ca3d984213436199879eae0b79a87fd5d97fa7
Fix error HTTP 414 Request URI Too Long
valdur55/py3status,valdur55/py3status,tobes/py3status,Spirotot/py3status,Andrwe/py3status,ultrabug/py3status,valdur55/py3status,alexoneill/py3status,guiniol/py3status,ultrabug/py3status,Shir0kamii/py3status,docwalter/py3status,ultrabug/py3status,vvoland/py3status,tobes/py3status,Andrwe/py3status,guiniol/py3status
py3status/modules/icinga_simple.py
py3status/modules/icinga_simple.py
# -*- coding: utf-8 -*- """ Display Icinga2 service status information Configuration Parameters: - cache_timeout: how often the data should be updated - base_url: the base url to the icinga-web2 services list - disable_acknowledge: enable or disable counting of acknowledged service problems - user: use...
# -*- coding: utf-8 -*- """ Display Icinga2 service status information Configuration Parameters: - cache_timeout: how often the data should be updated - base_url: the base url to the icinga-web2 services list - disable_acknowledge: enable or disable counting of acknowledged service problems - user: use...
bsd-3-clause
Python
4f6bdfd2e32fc0cfa80ce2a6b81dce83ee5cdaf8
support namespaced JSON objects
wq/wq.io,wq/wq.io
parsers/text.py
parsers/text.py
import csv, json from lxml import etree as xml class CsvParser(object): def parse(self): self.csvdata = csv.DictReader(self.file) self.data = [row for row in self.csvdata] def dump(self, file=None): if file is None: file = self.file csvout = csv.DictWriter(file, sel...
import csv, json from lxml import etree as xml class CsvParser(object): def parse(self): self.csvdata = csv.DictReader(self.file) self.data = [row for row in self.csvdata] def dump(self, file=None): if file is None: file = self.file csvout = csv.DictWriter(file, sel...
mit
Python
1b010ae76dae7e45d835b2e160df81f67e5349ce
Fix pep8 issue
pyQode/pyqode.python,mmolero/pyqode.python,zwadar/pyqode.python,pyQode/pyqode.python
pyqode/python/frontend/__init__.py
pyqode/python/frontend/__init__.py
# -*- coding: utf-8 -*- """ The frontend packages contains classes and functions related to tge gui side application. This is where you will find the python specific modes and panels and an already configured CodeEdit made for python programming. """ import re import sys from pyqode.core.frontend import open_file as _...
# -*- coding: utf-8 -*- """ The frontend packages contains classes and functions related to tge gui side application. This is where you will find the python specific modes and panels and an already configured CodeEdit made for python programming. """ import re import sys from pyqode.core.frontend import open_file as _...
mit
Python
27e1cfef33841bffe7dde4a1d6f28a1c7e9c93fe
add noreorder for message MessageHandle because of circular dependency
tilezen/tilequeue
tilequeue/queue/__init__.py
tilequeue/queue/__init__.py
from message import MessageHandle # noreorder from file import OutputFileQueue from memory import MemoryQueue from redis_queue import make_redis_queue from sqs import JobProgressException from sqs import make_sqs_queue from sqs import make_visibility_manager from sqs import SqsQueue __all__ = [ JobProgressExcepti...
from file import OutputFileQueue from memory import MemoryQueue from message import MessageHandle from redis_queue import make_redis_queue from sqs import JobProgressException from sqs import make_sqs_queue from sqs import make_visibility_manager from sqs import SqsQueue __all__ = [ JobProgressException, make_...
mit
Python
127c80a48a1e69885e73c3819d5780e33ea816d4
Add bloom-filter-cpp lib target
bbondy/bloom-filter-cpp,bbondy/bloom-filter-cpp,bbondy/bloom-filter-cpp,bbondy/bloom-filter-cpp
binding.gyp
binding.gyp
{ "targets": [{ "target_name": "bloom-filter-cpp", "type": "lib", "sources": [ "BloomFilter.cpp", "BloomFilter.h" ], "include_dirs": [ ".", ], "conditions": [ ['OS=="win"', { }, { 'cflags_cc': [ '-fexceptions' ] } ] ], "xcode_...
{ "targets": [{ "target_name": "sample", "type": "executable", "sources": [ "main.cpp", "BloomFilter.cpp", "BloomFilter.h" ], "include_dirs": [ ".", ], "conditions": [ ['OS=="win"', { }, { 'cflags_cc': [ '-fexceptions' ] } ] ...
mpl-2.0
Python
0ad3efcbc10f11195727532d515d5adb3640ed6b
add fibonacci demo
gopro/gopro-lib-node.gl,gopro/gopro-lib-node.gl,gopro/gopro-lib-node.gl,gopro/gopro-lib-node.gl
pynodegl-utils/pynodegl_utils/examples/misc.py
pynodegl-utils/pynodegl_utils/examples/misc.py
import math from pynodegl import Texture, Shader, TexturedShape, Rotate, AnimKeyFrameScalar, Triangle from pynodegl import Quad, UniformVec4, Camera, Group from pynodegl_utils.misc import scene @scene({'name': 'size', 'type': 'range', 'range': [0,1.5], 'unit_base': 1000}) def triangle(cfg, size=0.5): frag_data =...
import math from pynodegl import Texture, Shader, TexturedShape, Rotate, AnimKeyFrameScalar, Triangle from pynodegl_utils.misc import scene @scene({'name': 'size', 'type': 'range', 'range': [0,1.5], 'unit_base': 1000}) def triangle(cfg, size=0.5): frag_data = ''' #version 100 precision mediump float; varying vec...
apache-2.0
Python
4be2123258dd1184f3b105435cff53cf3af40d68
fix encoding
yanne/webride,yanne/webride
webride/webride.py
webride/webride.py
# # Copyright 2014 Janne Harkonen # Distributed under the MIT License: http://opensource.org/licenses/MIT # import os from flask import Flask, render_template, request app = Flask(__name__) @app.route("/") def init(): names = os.listdir('testdata') return render_template('main.html', suite_names=names) @a...
# # Copyright 2014 Janne Härkönen # Distributed under the MIT License: http://opensource.org/licenses/MIT # import os from flask import Flask, render_template, request app = Flask(__name__) @app.route("/") def init(): names = os.listdir('testdata') return render_template('main.html', suite_names=names) @a...
mit
Python
be370e6c13ef7db287c9fb5198f16f262d2c86e7
add VumiBackend to __init__ so rapidsms.backends.vumi.VumiBackend works
peterayeni/rapidsms,eHealthAfrica/rapidsms,lsgunth/rapidsms,caktus/rapidsms,peterayeni/rapidsms,catalpainternational/rapidsms,lsgunth/rapidsms,catalpainternational/rapidsms,lsgunth/rapidsms,ehealthafrica-ci/rapidsms,ehealthafrica-ci/rapidsms,lsgunth/rapidsms,peterayeni/rapidsms,caktus/rapidsms,eHealthAfrica/rapidsms,eh...
rapidsms/backends/vumi/__init__.py
rapidsms/backends/vumi/__init__.py
from rapidsms.backends.vumi.outgoing import VumiBackend __all__ = ('VumiBackend',)
bsd-3-clause
Python
a26b88cd6b2034b7048d5b4729d3fa90ddfb255d
Update docs with actual MariaDB JSON support
j5int/sqlalchemy,sqlalchemy/sqlalchemy,monetate/sqlalchemy,zzzeek/sqlalchemy,j5int/sqlalchemy,monetate/sqlalchemy
lib/sqlalchemy/dialects/mysql/json.py
lib/sqlalchemy/dialects/mysql/json.py
# mysql/json.py # Copyright (C) 2005-2020 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from __future__ import absolute_import from ... import types as sqltypes class JSON...
# mysql/json.py # Copyright (C) 2005-2020 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from __future__ import absolute_import from ... import types as sqltypes class JSON...
mit
Python
7e97722354f1b59eb97f29aa99102ff1212e33ce
Use parse_qsl instead of urldecode because facebook sends a pipe character in its output for client_credential grants.
lucidbard/requests-oauthlib,dongguangming/requests-oauthlib,elafarge/requests-oauthlib,abhi931375/requests-oauthlib,jayvdb/requests-oauthlib,jayvdb/requests-oauthlib,gras100/asks-oauthlib,jsfan/requests-oauthlib,sigmavirus24/requests-oauthlib,requests/requests-oauthlib,singingwolfboy/requests-oauthlib
requests_oauthlib/compliance_fixes/facebook.py
requests_oauthlib/compliance_fixes/facebook.py
from json import dumps from oauthlib.common import urldecode from urllib import parse_qsl def facebook_compliance_fix(session): def _compliance_fix(r): # if Facebook claims to be sending us json, let's trust them. if r.headers['content-type'] == 'application/json': return r #...
from json import dumps from oauthlib.common import urldecode def facebook_compliance_fix(session): def _compliance_fix(r): # if Facebook claims to be sending us json, let's trust them. if r.headers['content-type'] == 'application/json': return r # Facebook returns a content-t...
isc
Python
2f48c53dbe8bafcaca596ce454ba8e7d987d86b1
Create test within input
ForestPride/rail-problem
station.py
station.py
"""Creates the station class""" class Station: """ Each train station is an instance of the Station class. Methods: __init__: creates a new stations total_station_pop: calculates total station population """ def __init__(self): while True: self.capacity = int(eval(inpu...
"""Creates the station class""" class Station: """ Each train station is an instance of the Station class. Methods: __init__: creates a new stations total_station_pop: calculates total station population """ def __init__(self): while True: self.capacity = int(eval(inpu...
mit
Python
f2a961332ef25e21d2d8b96616edd30eaa8bd622
Make sure DOIs are matched in a case-insensitive way
dissemin/dissemin,wetneb/dissemin,dissemin/dissemin,Lysxia/dissemin,wetneb/dissemin,dissemin/dissemin,dissemin/dissemin,Lysxia/dissemin,wetneb/dissemin,Lysxia/dissemin,wetneb/dissemin,Lysxia/dissemin,dissemin/dissemin
papers/doi.py
papers/doi.py
# -*- encoding: utf-8 -*- # Dissemin: open access policy enforcement tool # Copyright (C) 2014 Antonin Delpeuch # # This program 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 2 # of th...
# -*- encoding: utf-8 -*- # Dissemin: open access policy enforcement tool # Copyright (C) 2014 Antonin Delpeuch # # This program 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 2 # of th...
agpl-3.0
Python
1c6fb9e30b2b39af76d2a32066d45f142c598f65
Fix call to call
petebachant/UNH-RVAT-turbinesFoam,petebachant/UNH-RVAT-turbinesFoam
paramsweep.py
paramsweep.py
#!/usr/bin/env python """ Run multiple simulations varying a single parameter. """ import foampy from foampy.dictionaries import replace_value import numpy as np from subprocess import call import os import pandas as pd from modules import processing as pr def zero_tsr_fluc(): """Set TSR fluctuation amplitude to...
#!/usr/bin/env python """ Run multiple simulations varying a single parameter. """ import foampy from foampy.dictionaries import replace_value import numpy as np from subprocess import call import os import pandas as pd from modules import processing as pr def zero_tsr_fluc(): """Set TSR fluctuation amplitude to...
mit
Python
baf9c5a6523a9b90db7572330d04e3e199391273
bump version
tlatsas/wigiki
wigiki/__init__.py
wigiki/__init__.py
"""A static site generator which uses Github's gists as pages""" __author__ = "Tasos Latsas" __version__ = "0.6.4"
"""A static site generator which uses Github's gists as pages""" __author__ = "Tasos Latsas" __version__ = "0.6.2"
mit
Python
b0c1c660a3629bfc7103d00c502e02e2d5bbed60
fix linting
masschallenge/django-accelerator,masschallenge/django-accelerator
accelerator/utils.py
accelerator/utils.py
from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import Permission from bullet_train import BulletTrain BULLET_TRAIN_ENVIRONMENT_ID = "aX45EUqSsAqhTvv5nW7WEL" def create_mc_permission(permission): ct, _ = ContentType.objects.get_or_create( app_label="mc", ...
from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import Permission from bullet_train import BulletTrain BULLET_TRAIN_ENVIRONMENT_ID ="aX45EUqSsAqhTvv5nW7WEL" def create_mc_permission(permission): ct, _ = ContentType.objects.get_or_create( app_label="mc", m...
mit
Python
61be34225ae617d43cf7ca8c93c021523d93d8ca
fix #34 - use Session.evaluated_env_list to respect TOX_SKIP_ENV
tox-dev/detox
detox/cli.py
detox/cli.py
from __future__ import print_function import sys from tox.session import prepare as tox_prepare from detox import __version__ from detox.proc import Detox def main(args=None): args = sys.argv[1:] if args is None else args if args and args[0] == "--version": print("detox {} running as plugin in tox:...
from __future__ import print_function import sys from tox.session import prepare as tox_prepare from detox import __version__ from detox.proc import Detox def main(args=None): args = sys.argv[1:] if args is None else args if args and args[0] == "--version": print("detox {} running as plugin in tox:...
mit
Python
1513c99d7bd7c06825cea757cbd292547c4c8350
Exclude anything starting with '::' or '__'
James-Yu/LaTeX-Workshop,James-Yu/LaTeX-Workshop,James-Yu/LaTeX-Workshop,James-Yu/LaTeX-Workshop,James-Yu/LaTeX-Workshop
dev/func3.py
dev/func3.py
from pathlib import Path import re import json dtx_files = Path('/usr/local/texlive/2019/texmf-dist/source/latex/l3kernel/').glob('*.dtx') def exclude(entry: str) -> bool: return not re.match(r'\\(?!(?:::)|(?:__))', entry) def parse_doc_block(block_content, _type): objs = [] for match in re.findall(rf'\...
from pathlib import Path import re import json dtx_files = Path('/usr/local/texlive/2019/texmf-dist/source/latex/l3kernel/').glob('*.dtx') def parse_doc_block(block_content, _type): objs = [] for match in re.findall(rf'\\begin{{{_type}}}(?:\[[^\]]*\])?[\s\n%]*{{([^}}]*)}}', block_content, flags=re.M): ...
mit
Python
f46b655ed924ff5238d08e4aa0a660879976507e
Bump version.
wido/libcloud,t-tran/libcloud,Scalr/libcloud,samuelchong/libcloud,JamesGuthrie/libcloud,sergiorua/libcloud,thesquelched/libcloud,wido/libcloud,mbrukman/libcloud,lochiiconnectivity/libcloud,watermelo/libcloud,vongazman/libcloud,carletes/libcloud,MrBasset/libcloud,carletes/libcloud,mathspace/libcloud,smaffulli/libcloud,m...
libcloud/__init__.py
libcloud/__init__.py
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
Python
d7fe1ef2ec3cc19c234d228cbdbd3a0067801e46
Fix typo in addExpense
Zillolo/mana-vault,Zillolo/mana-vault,Zillolo/mana-vault
app/mod_budget/controller.py
app/mod_budget/controller.py
from flask import Blueprint, flash, redirect, render_template, request, session, \ url_for from wtforms.fields.html5 import DecimalRangeField from bson.objectid import ObjectId from app import logger from app.mod_budget.form import AddEntryForm, EditBudgetForm from app.mod_budget.model import Category, CategoryBud...
from flask import Blueprint, flash, redirect, render_template, request, session, \ url_for from wtforms.fields.html5 import DecimalRangeField from bson.objectid import ObjectId from app import logger from app.mod_budget.form import AddEntryForm, EditBudgetForm from app.mod_budget.model import Category, CategoryBud...
mit
Python
7906532576d13f28a353ca3ac628a9ff69bf6fcd
Kill unused import statement
MagicStack/MagicPython,MagicStack/MagicPython,MagicStack/MagicPython
sublime.py
sublime.py
"""A plugin for Sublime Text to enhance f-string editing experience. Specifically, this plugin simplifies typing of escaped curly braces in an f-string: {|}, where | is for cursir, gets replaced with {{|, when '{' is typed again. """ import sublime_plugin class FstringbraceCommand(sublime_plugin.WindowComman...
"""A plugin for Sublime Text to enhance f-string editing experience. Specifically, this plugin simplifies typing of escaped curly braces in an f-string: {|}, where | is for cursir, gets replaced with {{|, when '{' is typed again. """ import sublime import sublime_plugin class FstringbraceCommand(sublime_plug...
mit
Python
b3041b7aab663b8d02c08826142922e938d05341
Update news
kuastw/AP-API,JohnSounder/AP-API,kuastw/AP-API,JohnSounder/AP-API
kuas/news.py
kuas/news.py
# -*- coding: utf-8 -*- ENABLE = 1 NEWS_ID = 25 NEWS_TITLE = "高應盃籃球錦標賽" NEWS_IMAGE = "http://i.imgur.com/NAxVxbV.jpg" NEWS_URL = "http://goo.gl/Yh1iIF" NEWS_CONTENT = """ """ def news_status(): return [ENABLE, NEWS_ID] def news(): """ News for kuas. return [enable, news_id, news_title, news_templat...
# -*- coding: utf-8 -*- ENABLE = 1 NEWS_ID = 25 NEWS_TITLE = "高應盃籃球錦標賽" NEWS_IMAGE = "http://i.imgur.com/NAxVxbV.jpg" NEWS_URL = "http://goo.gl/Yh1iIF" NEWS_CONTENT = """ """ def news_status(): return [ENABLE, NEWS_ID] def news(): """ News for kuas. return [enable, news_id, news_title, news_templat...
mit
Python
6f88063fae644bd55d3dbe7688d6f4f19aa9115d
bump version to 7.0.1.dev0
praw-dev/praw,praw-dev/praw
praw/const.py
praw/const.py
"""PRAW constants.""" from .endpoints import API_PATH # noqa: F401 __version__ = "7.0.1.dev0" USER_AGENT_FORMAT = "{} PRAW/" + __version__ MAX_IMAGE_SIZE = 512000 MIN_JPEG_SIZE = 128 MIN_PNG_SIZE = 67 JPEG_HEADER = b"\xff\xd8\xff" PNG_HEADER = b"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a"
"""PRAW constants.""" from .endpoints import API_PATH # noqa: F401 __version__ = "7.0.0" USER_AGENT_FORMAT = "{} PRAW/" + __version__ MAX_IMAGE_SIZE = 512000 MIN_JPEG_SIZE = 128 MIN_PNG_SIZE = 67 JPEG_HEADER = b"\xff\xd8\xff" PNG_HEADER = b"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a"
bsd-2-clause
Python
2746e85066c0bf7c2f62b7f384a9a0ccd1179eb1
indent the json in pre-commit hook so diffs look nice
NYUDataBootcamp/Materials
pre-commit.py
pre-commit.py
#!/usr/bin/env python import os import json import fnmatch import subprocess def strip_output_cell(fn): changed = False with open(fn, "r") as f: js = json.load(f) for cell in js["cells"]: if cell["cell_type"] == "code": if len(cell["outputs"]) != 0: ...
#!/usr/bin/env python import os import json import fnmatch import subprocess def strip_output_cell(fn): changed = False with open(fn, "r") as f: js = json.load(f) for cell in js["cells"]: if cell["cell_type"] == "code": if len(cell["outputs"]) != 0: ...
mit
Python
20809c17d6e7cb4e71f52b9cdc2755d2ce7b0ac1
bump version to 0.8.0
CamDavidsonPilon/lifelines,jstoxrocky/lifelines,wavelets/lifelines,nerdless/lifelines
lifelines/version.py
lifelines/version.py
from __future__ import unicode_literals __version__ = '0.8.0.0'
from __future__ import unicode_literals __version__ = '0.7.1.0'
mit
Python
94a91f128b046a818acb873579c8aadd41aa5c3a
Fix remaining load_suparsers typo instance
msmakhlouf/streamparse,codywilbourn/streamparse,petchat/streamparse,petchat/streamparse,Parsely/streamparse,msmakhlouf/streamparse,petchat/streamparse,petchat/streamparse,msmakhlouf/streamparse,msmakhlouf/streamparse,codywilbourn/streamparse,eric7j/streamparse,petchat/streamparse,crohling/streamparse,hodgesds/streampar...
test/streamparse/cli/test_sparse.py
test/streamparse/cli/test_sparse.py
from __future__ import absolute_import, unicode_literals import argparse import unittest from streamparse.cli import sparse from nose.tools import ok_ class SparseTestCase(unittest.TestCase): def test_load_subparsers(self): parser = argparse.ArgumentParser() subparsers = parser.add_subparsers(...
from __future__ import absolute_import, unicode_literals import argparse import unittest from streamparse.cli import sparse from nose.tools import ok_ class SparseTestCase(unittest.TestCase): def test_load_subparsers(self): parser = argparse.ArgumentParser() subparsers = parser.add_subparsers(...
apache-2.0
Python
e0a0d4e8d403fec54cf9dae6c22c63c5fe21b9c0
Modify description of replication()
kolyat/chainsyn,kolyat/chainsyn
processing.py
processing.py
# Copyright (c) 2016 Kirill 'Kolyat' Kiselnikov # This file is the part of chainsyn, released under modified MIT license # See the file LICENSE.txt included in this distribution """ Module "processing" with processing functions replication() - function of DNA replication """ def replication(dna_chain): """ F...
# Copyright (c) 2016 Kirill 'Kolyat' Kiselnikov # This file is the part of chainsyn, released under modified MIT license # See the file LICENSE.txt included in this distribution """ Module "processing" with processing functions replication() - function of DNA replication """ def replication(dna_chain): """ F...
mit
Python
26dcd1ce43864de77c1cd26065c09cc2b4c4788e
Make use of chained comparisons
akosthekiss/fuzzinator,akosthekiss/fuzzinator,akosthekiss/fuzzinator,renatahodovan/fuzzinator,renatahodovan/fuzzinator,renatahodovan/fuzzinator,akosthekiss/fuzzinator,renatahodovan/fuzzinator
tests/fuzzer/test_random_content.py
tests/fuzzer/test_random_content.py
# Copyright (c) 2016-2021 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>. # This file may not be copied, modified, or distributed except # according to those terms. import pytest import fuzzinator @pytest.mark.parametrize('fuzze...
# Copyright (c) 2016 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>. # This file may not be copied, modified, or distributed except # according to those terms. import pytest import fuzzinator @pytest.mark.parametrize('fuzzer_kwa...
bsd-3-clause
Python
c2d3a3a4a6ad43115459977d0d88a4878d0fb33a
Increase pylons.url testing to 100%
moreati/pylons,Pylons/pylons,Pylons/pylons,moreati/pylons,moreati/pylons,Pylons/pylons
pylons/url.py
pylons/url.py
from repoze.bfg.encode import urlencode from repoze.bfg.threadlocal import get_current_registry from repoze.bfg.url import _join_elements from pylons.interfaces import IRoutesMapper def route_url(route_name, request, *elements, **kw): try: reg = request.registry except AttributeError: reg = ge...
from repoze.bfg.threadlocal import get_current_registry from pylons.interfaces import IRoutesMapper def route_url(route_name, request, *elements, **kw): try: reg = request.registry except AttributeError: reg = get_current_registry() # b/c mapper = reg.getUtility(IRoutesMapper) route = ...
bsd-3-clause
Python
5edc773be179ebc21d65e8b06e8d66804b8f6b5f
Use 1 as default first index
pearsonlab/thunder,zhwa/thunder,broxtronix/thunder,poolio/thunder,broxtronix/thunder,thunder-project/thunder,pearsonlab/thunder,jwittenbach/thunder,j-friedrich/thunder,oliverhuangchao/thunder,kcompher/thunder,j-friedrich/thunder,oliverhuangchao/thunder,zhwa/thunder,kunallillaney/thunder,kcompher/thunder,poolio/thunder,...
python/ref.py
python/ref.py
# ref <master> <inputFile> <inds> <outputFile> # # compute summary statistics on an xyz stack # each row is (x,y,z,timeseries) # import sys import os from numpy import * from scipy.linalg import * from scipy.sparse import * from scipy.io import * from pyspark import SparkContext import logging if len(sys.argv) < 4:...
# ref <master> <inputFile> <inds> <outputFile> # # compute summary statistics on an xyz stack # each row is (x,y,z,timeseries) # import sys import os from numpy import * from scipy.linalg import * from scipy.sparse import * from scipy.io import * from pyspark import SparkContext import logging if len(sys.argv) < 4:...
apache-2.0
Python
21017b79184459a6a2c0076d6cb1a60d3b1d3c12
Fix errors in sim harness
PinPinIre/Final-Year-Project,PinPinIre/Final-Year-Project,PinPinIre/Final-Year-Project
src/run_similarity.py
src/run_similarity.py
import argparse import datetime from os import getcwd from os.path import isdir, exists from project import corpus, knn_corpus, lda_corpus, word2vec_corpus algorithms = {"lda": lda_corpus.LDACorpus, "knn": knn_corpus.KNNCorpus, "w2v": word2vec_corpus.W2VCorpus} base_dir = getcwd() output_l...
import argparse import datetime from os import getcwd from os.path import isdir, exists from project import corpus, knn_corpus, lda_corpus, word2vec_corpus algorithms = {"lda": lda_corpus.LDACorpus, "knn": knn_corpus.KNNCorpus, "w2v": word2vec_corpus.W2VCorpus} base_dir = getcwd() output_l...
mit
Python
f256048258d7a7cb6cd34248db922e69e5b51a0b
add ophyd-olog hooks
NSLS-II-CHX/ipython_ophyd,NSLS-II-CHX/ipython_ophyd
profile_collection/startup/00-startup.py
profile_collection/startup/00-startup.py
import logging from bluesky.standard_config import * # gs, etc. import matplotlib.pyplot as plt plt.ion() from bluesky import qt_kicker qt_kicker.install_qt_kicker() from databroker import DataBroker as db, get_events, get_images, get_table from epics import caput, caget # connect olog # gs.RE.logbook = olog_wrapper...
import logging from bluesky.standard_config import * # gs, etc. import matplotlib.pyplot as plt plt.ion() from bluesky import qt_kicker qt_kicker.install_qt_kicker() from databroker import DataBroker as db, get_events, get_images, get_table from epics import caput, caget # connect olog # gs.RE.logbook = olog_wrapper...
bsd-2-clause
Python
27d8919b151c5dad92f081e0cee9722650db7bae
Add rectification tests
mnhrdt/s2p,carlodef/s2p,mnhrdt/s2p,carlodef/s2p
tests/rectification_test.py
tests/rectification_test.py
import os import numpy as np import pytest from rpcm import rpc_from_geotiff import s2p from tests_utils import data_path @pytest.fixture(name='matches') def fixture_matches(): matches = np.loadtxt( data_path(os.path.join('expected_output', 'units', 'unit_matches_from_rpc.txt')) ) return matches...
import os import numpy as np import s2p from tests_utils import data_path def test_rectification_homographies(): """ Test for rectification.rectification_homographies(). """ matches = np.loadtxt(data_path(os.path.join('expected_output', 'units', 'unit_m...
agpl-3.0
Python