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
edebc05d3df68faadc6c0547de7cc06f1469915e
make click example do stuff
tylerdave/FOSSCON-2015-Example
fosscon2015/cli_click.py
fosscon2015/cli_click.py
#!/usr/bin/env python import click import json try: from collections import Counter except ImportError: # backport_collections needed for python 2.6 compatibility from backport_collections import Counter @click.command() @click.argument('infile', type=click.File('r'), default='-') @click.argument('outfi...
import click @click.command() def cli(): click.echo("I'm a click CLI.") if __name__ == '__main__': cli()
mit
Python
514c6c145e6e2f2c327fb89cfe780eb196508f79
change absolute site url
3-strand-code/3sc-blog,3-strand-code/3sc-blog,3-strand-code/3sc-blog,3-strand-code/3sc-blog
publishconf.py
publishconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = 'http://blog.3strandcode.com/' RELATIVE_URLS =...
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = 'http://3-strand-code.github.io/3sc-blog/' REL...
mit
Python
ca863134d20cda67c6e7f4abf1df595d5d549952
Fix agent changelog command (#3233)
DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core,DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/commands/agent/common.py
datadog_checks_dev/datadog_checks/dev/tooling/commands/agent/common.py
# (C) Datadog, Inc. 2019 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from semver import parse_version_info from ...git import git_tag_list def get_agent_tags(since, to): """ Return a list of tags from integrations-core representing an Agent release, sorted by more re...
# (C) Datadog, Inc. 2019 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from ...git import git_tag_list def get_agent_tags(since, to): """ Return a list of tags from integrations-core representing an Agent release, sorted by more recent first. """ agent_tags = gi...
bsd-3-clause
Python
07e12dd0942329aadc8fb3ed47b6f088779800b9
fix logcollector
sch3m4/intelmq,robcza/intelmq,robcza/intelmq,certtools/intelmq,robcza/intelmq,aaronkaplan/intelmq,sch3m4/intelmq,certtools/intelmq,pkug/intelmq,robcza/intelmq,sch3m4/intelmq,pkug/intelmq,pkug/intelmq,aaronkaplan/intelmq,sch3m4/intelmq,aaronkaplan/intelmq,pkug/intelmq,certtools/intelmq
src/bots/outputs/logcollector/logcollector.py
src/bots/outputs/logcollector/logcollector.py
import sys import time import socket from lib.bot import * from lib.utils import * from lib.event import * class LogCollectorBot(Bot): def process(self): event = self.receive_message() if event: data = '' for key, value in event.items(): data...
import sys import time import socket from lib.bot import * from lib.utils import * from lib.event import * try: import simplejson as json except ImportError: import json class LogCollectorBot(Bot): def process(self): event = self.receive_message() if event: dat...
agpl-3.0
Python
d451814584318ac45cdefa9702c72eb5c15fe690
Fix Flakes Errors: openspending/ui/controllers/home.py
openspending/spendb,johnjohndoe/spendb,spendb/spendb,openspending/spendb,pudo/spendb,spendb/spendb,CivicVision/datahub,openspending/spendb,pudo/spendb,nathanhilbert/FPA_Core,pudo/spendb,johnjohndoe/spendb,spendb/spendb,CivicVision/datahub,USStateDept/FPA_Core,nathanhilbert/FPA_Core,USStateDept/FPA_Core,USStateDept/FPA_...
openspending/ui/controllers/home.py
openspending/ui/controllers/home.py
import logging import os import subprocess from pylons import request, tmpl_context as c from pylons.controllers.util import redirect from pylons.i18n import _ from openspending.model import Dataset from openspending.lib.solr_util import dataset_entries from openspending.ui.i18n import set_session_locale from openspe...
import logging import os import random import subprocess from datetime import datetime from pylons import request, response, tmpl_context as c, url, config from pylons.controllers.util import redirect from pylons.decorators.cache import beaker_cache from pylons.i18n import _ from openspending.model import Dataset fro...
agpl-3.0
Python
7db11fa7aad4b53a1f50988e83de2abfbae61dde
Fix the senddeletionnotices command to take into account the new default SMS limit.
iphoting/healthchecks,healthchecks/healthchecks,iphoting/healthchecks,healthchecks/healthchecks,iphoting/healthchecks,healthchecks/healthchecks,iphoting/healthchecks,healthchecks/healthchecks
hc/accounts/management/commands/senddeletionnotices.py
hc/accounts/management/commands/senddeletionnotices.py
from datetime import timedelta import time from django.conf import settings from django.core.management.base import BaseCommand from django.utils.timezone import now from hc.accounts.models import Profile, Member from hc.api.models import Ping from hc.lib import emails class Command(BaseCommand): help = """Send ...
from datetime import timedelta import time from django.conf import settings from django.core.management.base import BaseCommand from django.utils.timezone import now from hc.accounts.models import Profile, Member from hc.api.models import Ping from hc.lib import emails class Command(BaseCommand): help = """Send ...
bsd-3-clause
Python
43ab753c4a9892c55f115a4dd5345e94c4bb5d41
Fix auth initialization logging
ascoderu/opwen-cloudserver,ascoderu/opwen-cloudserver
opwen_email_server/services/auth.py
opwen_email_server/services/auth.py
from ast import literal_eval from os import environ from typing import Callable from typing import Mapping from opwen_email_server.utils.log import LogMixin class EnvironmentAuth(LogMixin): def __init__(self, client_to_domain: Mapping[str, str]=None, envgetter: Callable[[str, str], str]=environ...
from ast import literal_eval from os import environ from typing import Callable from typing import Mapping from opwen_email_server.utils.log import LogMixin class EnvironmentAuth(LogMixin): def __init__(self, client_to_domain: Mapping[str, str]=None, envgetter: Callable[[str, str], str]=environ...
apache-2.0
Python
5118104dad921128e4dec0cd1ea00aa7d854c0a9
fix token create params to match new keystone - this change will need to be ported to novaclient
ntt-pf-lab/backup_openstackx
openstackx/auth/tokens.py
openstackx/auth/tokens.py
from openstackx.api import base class Tenant(base.Resource): def __repr__(self): return "<Tenant %s>" % self._info @property def id(self): return self._info['id'] @property def description(self): return self._info['description'] @property def enabled(self): ...
from openstackx.api import base class Tenant(base.Resource): def __repr__(self): return "<Tenant %s>" % self._info @property def id(self): return self._info['id'] @property def description(self): return self._info['description'] @property def enabled(self): ...
bsd-3-clause
Python
180b7810cdc9a2a17a13c184fc2143f9a5f10cd6
change var name article to container (opps 0.2) in sitemap generator class
williamroot/opps,opps/opps,YACOWS/opps,opps/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,opps/opps
opps/sitemaps/sitemaps.py
opps/sitemaps/sitemaps.py
# -*- coding: utf-8 -*- from django.contrib.sitemaps import GenericSitemap as DjangoGenericSitemap from django.contrib.sitemaps import Sitemap as DjangoSitemap from django.utils import timezone from opps.containers.models import Container def InfoDisct(googlenews=False): container = Container.objects.filter(date...
# -*- coding: utf-8 -*- from django.contrib.sitemaps import GenericSitemap as DjangoGenericSitemap from django.contrib.sitemaps import Sitemap as DjangoSitemap from django.utils import timezone from opps.containers.models import Container def InfoDisct(googlenews=False): article = Container.objects.filter(date_a...
mit
Python
ba92d4b5854f31b97255c98b83d8dfb8874c8668
Fix arg list for thumbnailpath override
findvid/main,findvid/main,findvid/main,findvid/main,findvid/main
frontend/src/indexing.py
frontend/src/indexing.py
#!/usr/bin/env python from pymongo import MongoClient #from subprocess import Popen, PIPE import FindVid as fv from sys import argv, exit import hashlib import os def hashFile(filename, blocksize): hash = hashlib.sha1() with open(filename, 'rb') as f: buffer = f.read(blocksize) while len(buffer) > 0: hash.upd...
#!/usr/bin/env python from pymongo import MongoClient #from subprocess import Popen, PIPE import FindVid as fv from sys import argv, exit import hashlib import os def hashFile(filename, blocksize): hash = hashlib.sha1() with open(filename, 'rb') as f: buffer = f.read(blocksize) while len(buffer) > 0: hash.upd...
mit
Python
f127f0e9bb0b8778feafbdbc1fa68e79a923d639
Update product listing test to use product ids rather than index
osu-cass/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api
whats_fresh/whats_fresh_api/tests/views/entry/test_list_products.py
whats_fresh/whats_fresh_api/tests/views/entry/test_list_products.py
from django.test import TestCase from django.core.urlresolvers import reverse from whats_fresh_api.models import * from django.contrib.gis.db import models import json class ListProductTestCase(TestCase): fixtures = ['test_fixtures'] def test_url_endpoint(self): url = reverse('entry-list-products') ...
from django.test import TestCase from django.core.urlresolvers import reverse from whats_fresh_api.models import * from django.contrib.gis.db import models import json class ListProductTestCase(TestCase): fixtures = ['test_fixtures'] def test_url_endpoint(self): url = reverse('entry-list-products') ...
apache-2.0
Python
266ee5a6798c1fe09e9c6b36ee5831a1060b4624
Fix lust.py
juricapapak/git-tutorial-code,juricapapak/git-tutorial-code
python/lust.py
python/lust.py
#!/usr/bin/env python class LustObject(object): # executes the command def handle(self, arguments): pass def print_help(self): pass class FactorialCommand(LustObject): def handle(self, arguments): try: argument = int(arguments[0]) except (ValueError, IndexError): print("fact: could not read inte...
#!/usr/bin/env python class LustObject(object): # executes the command def handle(self, arguments): pass def print_help(self): pass class FactorialCommand(LustObject): def handle(self, arguments): try: argument = int(arguments[0]) except (ValueError, IndexError): print("fact: could not read inte...
apache-2.0
Python
12b34fc09baa5060495e25e57680d1f6170559c5
Enable estimation reports for FPBŻ
KamilWo/bestja,EE/bestja,ludwiktrammer/bestja,KrzysiekJ/bestja,ludwiktrammer/bestja,KrzysiekJ/bestja,KrzysiekJ/bestja,ludwiktrammer/bestja,EE/bestja,KamilWo/bestja,EE/bestja,KamilWo/bestja
addons/bestja_configuration_fpbz/__openerp__.py
addons/bestja_configuration_fpbz/__openerp__.py
# -*- coding: utf-8 -*- { 'name': "Bestja: FBŻ", 'summary': "Installation configuration for FPBŻ", 'description': "Installation configuration for Federacja Polskich Banków Żywności", 'author': "Laboratorium EE", 'website': "http://www.laboratorium.ee", 'version': '0.1', 'category': 'Specific...
# -*- coding: utf-8 -*- { 'name': "Bestja: FBŻ", 'summary': "Installation configuration for FPBŻ", 'description': "Installation configuration for Federacja Polskich Banków Żywności", 'author': "Laboratorium EE", 'website': "http://www.laboratorium.ee", 'version': '0.1', 'category': 'Specific...
agpl-3.0
Python
2dc3e7eb3e6e5b32347d24d5353f9a5f0f6915c2
Create app.py
rajeshrao04/news-api
app.py
app.py
#!/usr/bin/env python import urllib import json import os import time from flask import Flask from flask import request from flask import make_response from datetime import datetime # Flask app should start in global layout app = Flask(__name__) @app.route('/webhook', methods=['POST']) def webhook(): req = req...
#!/usr/bin/env python import urllib import json import os import time from flask import Flask from flask import request from flask import make_response from datetime import datetime # Flask app should start in global layout app = Flask(__name__) @app.route('/webhook', methods=['POST']) def webhook(): req = req...
apache-2.0
Python
cb5aa965254c6abe3a865747e823fbe90f894a2c
return addresses as 'items'
colorado-code-for-communities/denver_streets,colorado-code-for-communities/denver_streets
app.py
app.py
from flask import Flask, Response, url_for, request, json import os import urllib2 import datetime app = Flask(__name__) @app.route('/hello') def hello(): return 'Hello world' @app.route('/') def index(): response_data = json.dumps({ 'closures_href': url_for('closures') }) response = Response(response_data, st...
from flask import Flask, Response, url_for, request, json import os import urllib2 import datetime app = Flask(__name__) @app.route('/hello') def hello(): return 'Hello world' @app.route('/') def index(): response_data = json.dumps({ 'closures_href': url_for('closures') }) response = Response(response_data, st...
apache-2.0
Python
070589ee7dba86dd3d0a8928ebdd331d4faaa0c6
Remove pdf_file field from plugin
n0m4dz/odoo,slevenhagen/odoo,funkring/fdoo,BT-rmartin/odoo,Grirrane/odoo,hassoon3/odoo,srimai/odoo,stephen144/odoo,alexcuellar/odoo,aviciimaxwell/odoo,OpenUpgrade-dev/OpenUpgrade,florian-dacosta/OpenUpgrade,sv-dev1/odoo,Ernesto99/odoo,slevenhagen/odoo,patmcb/odoo,havt/odoo,OSSESAC/odoopubarquiluz,apanju/GMIO_Odoo,incas...
addons/plugin_thunderbird/plugin_thunderbird.py
addons/plugin_thunderbird/plugin_thunderbird.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
Python
052dc22a82267d381636f5f5fbbf4b5149ffb518
check if the values are empty before adding the data
rrpg/world-editor,rrpg/world-editor
gui/specieslistdialog.py
gui/specieslistdialog.py
# -*- coding: utf8 -*- from PyQt4 import QtGui, QtCore class speciesListDialog(QtGui.QDialog): _tableview = None def __init__(self, parent, app): QtGui.QDialog.__init__(self, parent) self._app = app self._parent = parent self.initUI() self.setWindowTitle('List species') self.show() def initUI(self):...
# -*- coding: utf8 -*- from PyQt4 import QtGui, QtCore class speciesListDialog(QtGui.QDialog): _tableview = None def __init__(self, parent, app): QtGui.QDialog.__init__(self, parent) self._app = app self._parent = parent self.initUI() self.setWindowTitle('List species') self.show() def initUI(self):...
mit
Python
ffe23433056e0a710f81bb22a9161cdaf3ff2c12
fix format call for python 2.6
chfw/moban,chfw/moban
moban/filters/repr.py
moban/filters/repr.py
from moban.extensions import JinjaFilter @JinjaFilter('repr') def repr_function(string): if isinstance(string, list): return ["'{0}'".format(str(element)) for element in string] else: return "'{0}'".format(str(string))
from moban.extensions import JinjaFilter @JinjaFilter('repr') def repr_function(string): if isinstance(string, list): return ["'{}'".format(str(element)) for element in string] else: return "'{}'".format(str(string))
mit
Python
9255fd2c34a403b14b423628f47b7a7419c0d526
update language lexer translations
AppVentus/AvTime-client,sachintaware/sublime-wakatime,sachintaware/sublime-wakatime,jinie/sublime-wakatime,jinie/sublime-wakatime,sachintaware/sublime-wakatime,AppVentus/AvTime-client,wakatime/sublime-wakatime,jinie/sublime-wakatime
packages/wakatime/wakatime/stats.py
packages/wakatime/wakatime/stats.py
# -*- coding: utf-8 -*- """ wakatime.stats ~~~~~~~~~~~~~~ Stats about files :copyright: (c) 2013 Alan Hamlett. :license: BSD, see LICENSE for more details. """ import logging import os import sys if sys.version_info[0] == 2: sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__f...
# -*- coding: utf-8 -*- """ wakatime.stats ~~~~~~~~~~~~~~ Stats about files :copyright: (c) 2013 Alan Hamlett. :license: BSD, see LICENSE for more details. """ import logging import os import sys if sys.version_info[0] == 2: sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__f...
bsd-3-clause
Python
324cae7bc3d8d758205a0760dffd8d78ce611d48
Increase tweet length
julians/zcraper,julians/zcraper,julians/zcraper
bot.py
bot.py
#!/usr/bin/python # -*- coding: utf-8 -*- import tweepy import datetime import os import os.path import requests import json from models import Aufmacher, Author, Image, TweetJob from config import db from playhouse.shortcuts import model_to_dict from secrets import twitter_secrets def tweet(tweetjob): href = t...
#!/usr/bin/python # -*- coding: utf-8 -*- import tweepy import datetime import os import os.path import requests import json from models import Aufmacher, Author, Image, TweetJob from config import db from playhouse.shortcuts import model_to_dict from secrets import twitter_secrets def tweet(tweetjob): href = t...
apache-2.0
Python
3d52eca5b9a7cddcd1d2b67547c22c28847aa085
fix print format for python3
donnadionne/grpc,ctiller/grpc,jtattermusch/grpc,sreecha/grpc,jtattermusch/grpc,pszemus/grpc,grpc/grpc,jboeuf/grpc,pszemus/grpc,nicolasnoble/grpc,grpc/grpc,donnadionne/grpc,jtattermusch/grpc,grpc/grpc,jtattermusch/grpc,firebase/grpc,grpc/grpc,stanley-cheung/grpc,nicolasnoble/grpc,firebase/grpc,grpc/grpc,stanley-cheung/g...
tools/run_tests/start_port_server.py
tools/run_tests/start_port_server.py
#!/usr/bin/env python2.7 # Copyright 2017 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
#!/usr/bin/env python2.7 # Copyright 2017 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
Python
6561ea0b329b2f42126dc23eab59676de305dd73
remove unused imports
simonz05/flask-wtf,simonz05/flask-wtf
flask_wtf/forms.py
flask_wtf/forms.py
from __future__ import absolute_import import jinja2 from flask import request, session, current_app from wtforms.ext.csrf.session import SessionSecureForm from wtforms.fields import HiddenField class Form(SessionSecureForm): "Implements a SessionSecureForm using app.SECRET_KEY and flask.session obj" def __i...
from __future__ import absolute_import import jinja2 import wtforms from flask import request, session, current_app from wtforms.ext.csrf.session import SessionSecureForm from wtforms.fields import HiddenField class Form(SessionSecureForm): "Implements a SessionSecureForm using app.SECRET_KEY and flask.session o...
bsd-3-clause
Python
413057374d55d851fa4717a66a0975f29b131f4f
Fix bytes output
martindurant/libhdfs3-ctypes,martindurant/libhdfs3-ctypes,blaze/hdfs3,blaze/hdfs3
cli.py
cli.py
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Created on Wed Dec 30 13:58:24 2015 @author: mdurant """ import argparse import hdfs import sys import inspect parser = argparse.ArgumentParser(description='HDFS commands') parser.add_argument("command", help="filesystem command to run") parser.add_argument("par1", ...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Created on Wed Dec 30 13:58:24 2015 @author: mdurant """ import argparse import hdfs import sys import inspect parser = argparse.ArgumentParser(description='HDFS commands') parser.add_argument("command", help="filesystem command to run") parser.add_argument("par1", ...
unknown
Python
72fa091716e1e0d40a8219701da94bee6d49c58b
remove debugging
kevinpdavies/pycsw,ricardogsilva/pycsw,ingenieroariel/pycsw,ckan-fcd/pycsw-fcd,bukun/pycsw,tomkralidis/pycsw,tomkralidis/pycsw,benhowell/pycsw,benhowell/pycsw,rouault/pycsw,ricardogsilva/pycsw,kevinpdavies/pycsw,PublicaMundi/pycsw,rouault/pycsw,ocefpaf/pycsw,kalxas/pycsw,geopython/pycsw,mwengren/pycsw,kalxas/pycsw,geop...
csw.py
csw.py
#!/usr/bin/python -u # -*- coding: iso-8859-15 -*- # ================================================================= # # $Id$ # # Authors: Tom Kralidis <tomkralidis@hotmail.com> # # Copyright (c) 2010 Tom Kralidis # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and ...
#!/usr/bin/python -u # -*- coding: iso-8859-15 -*- # ================================================================= # # $Id$ # # Authors: Tom Kralidis <tomkralidis@hotmail.com> # # Copyright (c) 2010 Tom Kralidis # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and ...
mit
Python
b666228405e9b23e65d6d631968a7f6f334b6b46
change string for utf8 translation (#48)
GoogleCloudPlatform/python-docs-samples,GoogleCloudPlatform/python-docs-samples,GoogleCloudPlatform/python-docs-samples,GoogleCloudPlatform/python-docs-samples
translation/samples/snippets/snippets_test.py
translation/samples/snippets/snippets_test.py
# -*- coding: utf-8 -*- # Copyright 2016 Google, 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 ...
# -*- coding: utf-8 -*- # Copyright 2016 Google, 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 ...
apache-2.0
Python
833cd8342385fc095181afc3306ce04414bfd447
Add work around for destroying models too quickly.
mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju
perfscale_mass_model_destruction.py
perfscale_mass_model_destruction.py
#!/usr/bin/env python """Perfscale test measuring adding and destroying a large number of models. Steps taken in this test: - Bootstraps a provider - Creates x amount of models and waits for them to be ready - Delete all the models at once. """ import argparse from datetime import datetime import logging import...
#!/usr/bin/env python """Perfscale test measuring adding and destroying a large number of models. Steps taken in this test: - Bootstraps a provider - Creates x amount of models and waits for them to be ready - Delete all the models at once. """ import argparse from datetime import datetime import logging import...
agpl-3.0
Python
f29ff5eaa24b0671066f145d76b53e534a574119
Set "text/javascript" type if given a callback
Endika/freegeoip,stea4lth/freegeoip,NickTaporuk/freegeoip,danielstreit/freegeoip,wackadoo/freegeoip,mavelar/freegeoip,thebakeryio/freegeoip,btsantos/freegeoip,btsantos/freegeoip,NickTaporuk/freegeoip,pocket-playlab/freegeoip,btsantos/freegeoip,wackadoo/freegeoip,mcdelaney/freegeoip,My-Sign/freegeoip,GhaziTriki/freegeoi...
freegeoip/geoip.py
freegeoip/geoip.py
#!/usr/bin/env python # coding: utf-8 # # Copyright 2010 Alexandre Fiori # freegeoip.net # # 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 # #...
#!/usr/bin/env python # coding: utf-8 # # Copyright 2010 Alexandre Fiori # freegeoip.net # # 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 # #...
bsd-3-clause
Python
c9917b3dc54290bb3fc7c977e8c1db76ac60cf82
Update project queries
polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon
polyaxon/api/projects/queries.py
polyaxon/api/projects/queries.py
from django.db.models import Count, Q from db.models.projects import Project projects = Project.objects.select_related('user') projects_details = projects.select_related('repo').annotate( Count('experiments', distinct=True), Count('jobs', distinct=True), Count('build_jobs', distinct=True), Count('exp...
from django.db.models import Count, Q from db.models.projects import Project projects = Project.objects.select_related('user') projects_details = projects.select_related('repo').annotate( Count('experiments', distinct=True), Count('jobs', distinct=True), Count('build_jobs', distinct=True), Count('expe...
apache-2.0
Python
086b7a7de994e30d2e5defa214eca846862aec59
update default configuration in config
mahak/nova,phenoxim/nova,hanlind/nova,mikalstill/nova,rajalokan/nova,jianghuaw/nova,jianghuaw/nova,Juniper/nova,mahak/nova,rajalokan/nova,klmitch/nova,jianghuaw/nova,rajalokan/nova,openstack/nova,rahulunair/nova,gooddata/openstack-nova,mikalstill/nova,Juniper/nova,vmturbo/nova,vmturbo/nova,mahak/nova,mikalstill/nova,ji...
nova/common/config.py
nova/common/config.py
# Copyright 2016 Hewlett Packard Enterprise Development Company, L.P. # # 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 b...
# Copyright 2016 Hewlett Packard Enterprise Development Company, L.P. # # 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 b...
apache-2.0
Python
bc224499e2f4f663a1fe5e41cbfad691e7c04de4
Drop unused import
swift-lang/swift-t,swift-lang/swift-t,swift-lang/swift-t,swift-lang/swift-t,swift-lang/swift-t,swift-lang/swift-t,swift-lang/swift-t
turbine/code/py/turbine_helpers.py
turbine/code/py/turbine_helpers.py
# Copyright 2013 University of Chicago and Argonne National Laboratory # # 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 b...
# Copyright 2013 University of Chicago and Argonne National Laboratory # # 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 b...
apache-2.0
Python
63cb9a8b3acb78be155bbc770cdd1d06170eccc1
Fix customer filter field.
opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind
src/nodeconductor_assembly_waldur/invoices/filters.py
src/nodeconductor_assembly_waldur/invoices/filters.py
import django_filters from django.conf import settings from django.core import exceptions from django.db.models import Q from django import forms from django.utils import timezone from nodeconductor.core import filters as core_filters from nodeconductor.structure import filters as structure_filters from . import model...
import django_filters from django.conf import settings from django.core import exceptions from django.db.models import Q, BooleanField from django.utils import timezone from nodeconductor.core import filters as core_filters from nodeconductor.structure import filters as structure_filters from . import models class I...
mit
Python
77301c29c0f5db1e132b01a883eadcb79df5fd3f
Reduce timeout value
stopstalk/stopstalk-deployment,stopstalk/stopstalk-deployment,stopstalk/stopstalk-deployment,stopstalk/stopstalk-deployment,stopstalk/stopstalk-deployment
models/000_config.py
models/000_config.py
""" Configure StopStalk as required """ """ Copyright (c) 2015-2017 Raj Patel(raj454raj@gmail.com), StopStalk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restricti...
""" Configure StopStalk as required """ """ Copyright (c) 2015-2017 Raj Patel(raj454raj@gmail.com), StopStalk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restricti...
mit
Python
fc75f5843af70c09e0d63284277bf88689cbb06d
Add apidoc to doc building
mrjmad/invocations,pyinvoke/invocations,alex/invocations,singingwolfboy/invocations
invocations/docs.py
invocations/docs.py
import os from invoke.tasks import task from invoke.runner import run docs_dir = 'docs' build = os.path.join(docs_dir, '_build') @task def clean_docs(): run("rm -rf %s" % build) @task def browse_docs(): run("open %s" % os.path.join(build, 'index.html')) @task def api_docs(target, output="api", exclude=...
import os from invoke.tasks import task from invoke.runner import run docs_dir = 'docs' build = os.path.join(docs_dir, '_build') @task def clean_docs(): run("rm -rf %s" % build) @task def browse_docs(): run("open %s" % os.path.join(build, 'index.html')) @task def docs(clean=False, browse=False): if...
bsd-2-clause
Python
0a07f6ac82f099d836eb5276063adab245979258
rename `recall` to `call`
okuta/chainer,chainer/chainer,niboshi/chainer,tkerola/chainer,wkentaro/chainer,wkentaro/chainer,keisuke-umezawa/chainer,chainer/chainer,hvy/chainer,pfnet/chainer,okuta/chainer,hvy/chainer,wkentaro/chainer,niboshi/chainer,wkentaro/chainer,niboshi/chainer,hvy/chainer,okuta/chainer,okuta/chainer,chainer/chainer,chainer/ch...
chainer/training/triggers/once_trigger.py
chainer/training/triggers/once_trigger.py
class OnceTrigger(object): """Trigger based on the starting point of the iteration. This trigger accepts only once at starting point of the iteration. There are two ways to specify the starting point: only starting point in whole iteration or called again when training resumed. Args: call...
class OnceTrigger(object): """Trigger based on the starting point of the iteration. This trigger accepts only once at starting point of the iteration. There are two ways to specify the starting point: only starting point in whole iteration or recalled when training resumed. Args: recall_o...
mit
Python
2d6906bc58275b18102b4523a4faa5078a6e74f1
fix wrong description (all?)
chainer/chainercv,yuyu2172/chainercv,chainer/chainercv,pfnet/chainercv,yuyu2172/chainercv
chainercv/transforms/image/random_crop.py
chainercv/transforms/image/random_crop.py
import random import six def random_crop(img, output_shape, return_slices=False, copy=False): """Crop array randomly into `output_shape`. The input image is cropped by a randomly selected region whose shape is :obj:`output_shape`. Args: img (~numpy.ndarray): An image array to be cropped. Thi...
import random import six def random_crop(img, output_shape, return_slices=False, copy=False): """Crop array randomly into `output_shape`. All arrays will be cropped by the same region randomly selected. The output will all be in shape :obj:`output_shape`. Args: img (~numpy.ndarray): An image...
mit
Python
57e177e47bcc54683654e5d0de81af6e0cbd803d
update version
jorgensoares/pimat,jorgensoares/pimat,jorgensoares/pimat,jorgensoares/pimat
pimat_web/version.py
pimat_web/version.py
__version__ = '0.6.18'
__version__ = '0.6.17'
mit
Python
e3b6b9864376f2dabe42b6d80d4a5db65cb85d30
Update docs for 'prep_command()'
sid-kap/pants,UnrememberMe/pants,wisechengyi/pants,sid-kap/pants,di0spyr0s/pants,15Dkatz/pants,gmalmquist/pants,megaserg/pants,lahosken/pants,digwanderlust/pants,foursquare/pants,digwanderlust/pants,foursquare/pants,15Dkatz/pants,twitter/pants,mateor/pants,cevaris/pants,pombredanne/pants,gmalmquist/pants,dturner-tw/pan...
src/python/pants/backend/core/targets/prep_command.py
src/python/pants/backend/core/targets/prep_command.py
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.base.payl...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.base.payl...
apache-2.0
Python
a9ac098ec492739f37005c9bd6278105df0261c5
Add fields to save question url and annexure links
mthipparthi/parliament-search
parliamentsearch/items.py
parliamentsearch/items.py
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class MemberofParliament(scrapy.Item): """ Data structure to define Member of Parliament information """ mp_id = scrapy.Field() mp_name = scrapy.F...
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class MemberofParliament(scrapy.Item): """ Data structure to define Member of Parliament information """ mp_id = scrapy.Field() mp_name = scrapy.F...
mit
Python
20e63fb5b5a02966acbe66f3cda19bc59ff89934
Set a default value for a default_roles
stackforge/monasca-log-api,openstack/monasca-log-api,openstack/monasca-log-api,stackforge/monasca-log-api,stackforge/monasca-log-api,openstack/monasca-log-api
monasca_log_api/conf/role_middleware.py
monasca_log_api/conf/role_middleware.py
# Copyright 2017 FUJITSU LIMITED # # 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 writ...
# Copyright 2017 FUJITSU LIMITED # # 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 writ...
apache-2.0
Python
dd725349e0613461bdbe75a0c32115b323e9ccc3
change settings import in wsgi for Travis CI
whitews/ReFlow,whitews/ReFlow,whitews/ReFlow
reflow/wsgi.py
reflow/wsgi.py
""" WSGI config for reflow project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` s...
""" WSGI config for reflow project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` s...
bsd-3-clause
Python
c41f589a24108562b6dcc5eb303a183b2686f8e0
Adjust hashkey afterr php example
onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle
bluebottle/payments_telesom/gateway.py
bluebottle/payments_telesom/gateway.py
import hashlib from bluebottle.payments.exception import PaymentException from django.utils import timezone from suds.client import Client from suds.plugin import MessagePlugin class NameSpacePlugin(MessagePlugin): def sending(self, context): print context.envelope return context class Teleso...
import hashlib from django.utils import timezone import ipgetter from suds.client import Client from suds.plugin import MessagePlugin class NameSpacePlugin(MessagePlugin): def sending(self, context): print context.envelope return context class TelesomClient(object): """ API Client for...
bsd-3-clause
Python
6fb1b24a3cf1a4cdb3bd35c6f575d96cb2da9415
Add binding for DSA_size
skeuomorf/cryptography,Hasimir/cryptography,sholsapp/cryptography,skeuomorf/cryptography,dstufft/cryptography,kimvais/cryptography,kimvais/cryptography,Hasimir/cryptography,skeuomorf/cryptography,dstufft/cryptography,sholsapp/cryptography,kimvais/cryptography,dstufft/cryptography,sholsapp/cryptography,bwhmather/cryptog...
cryptography/hazmat/bindings/openssl/dsa.py
cryptography/hazmat/bindings/openssl/dsa.py
# 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, software # distributed under the...
# 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, software # distributed under the...
bsd-3-clause
Python
9bff4e9ed59d2c15b2da681476385274f5ef9059
Fix create_sample_event
kevinlondon/sentry,imankulov/sentry,JTCunning/sentry,kevinastone/sentry,JTCunning/sentry,felixbuenemann/sentry,boneyao/sentry,argonemyth/sentry,zenefits/sentry,ewdurbin/sentry,jean/sentry,camilonova/sentry,vperron/sentry,imankulov/sentry,drcapulet/sentry,llonchj/sentry,JamesMura/sentry,mvaled/sentry,wujuguang/sentry,rd...
src/sentry/management/commands/create_sample_event.py
src/sentry/management/commands/create_sample_event.py
""" sentry.management.commands.create_sample_event ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from django.core.management.base import BaseCommand, CommandError, make_option class Command(BaseC...
""" sentry.management.commands.create_sample_event ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from django.core.management.base import BaseCommand, CommandError, make_option class Command(BaseC...
bsd-3-clause
Python
893e05540c640c4598477a39688a773556bebad9
Update HDF5 to 1.8.16
LLNL/spack,LLNL/spack,tmerrick1/spack,lgarren/spack,TheTimmy/spack,EmreAtes/spack,mfherbst/spack,TheTimmy/spack,iulian787/spack,tmerrick1/spack,iulian787/spack,LLNL/spack,matthiasdiener/spack,lgarren/spack,skosukhin/spack,lgarren/spack,EmreAtes/spack,LLNL/spack,EmreAtes/spack,iulian787/spack,mfherbst/spack,TheTimmy/spa...
var/spack/packages/hdf5/package.py
var/spack/packages/hdf5/package.py
from spack import * class Hdf5(Package): """HDF5 is a data model, library, and file format for storing and managing data. It supports an unlimited variety of datatypes, and is designed for flexible and efficient I/O and for high volume and complex data. """ homepage = "http://www.hdfgroup.or...
from spack import * class Hdf5(Package): """HDF5 is a data model, library, and file format for storing and managing data. It supports an unlimited variety of datatypes, and is designed for flexible and efficient I/O and for high volume and complex data. """ homepage = "http://www.hdfgroup.or...
lgpl-2.1
Python
f28daad980dd95584dabe83a102ecdd0e1cac517
remove reference to unused summaries file
magenta/music-spectrogram-diffusion
music_spectrogram_diffusion/__init__.py
music_spectrogram_diffusion/__init__.py
# Copyright 2022 The Music Spectrogram Diffusion Authors. # # 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 ...
# Copyright 2022 The Music Spectrogram Diffusion Authors. # # 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 ...
apache-2.0
Python
376b8aa5b77066e06c17f41d65fe32a3c2bdef1f
Add a default value to the header limit
a2ohm/geo
geo.py
geo.py
#! /usr/bin/python3 # -*- coding-utf-8 -*- """ This script transform a md into a plain html in the context of a documentation for Kit&Pack. """ import mmap import yaml print("---------------------------- geo --") print("-- by antoine.delhomme@espci.org --") print("-----------------------------------") doc_in = "./0...
#! /usr/bin/python3 # -*- coding-utf-8 -*- """ This script transform a md into a plain html in the context of a documentation for Kit&Pack. """ import mmap import yaml print("---------------------------- geo --") print("-- by antoine.delhomme@espci.org --") print("-----------------------------------") doc_in = "./0...
mit
Python
8f3ff0cfd70bfe4eaa9e017323971bad453c93f5
set edit as bot
legoktm/legobot-old,legoktm/legobot-old
trunk/toolserver/pui.py
trunk/toolserver/pui.py
#!usr/bin/python # -*- coding: utf-8 -* # # (C) Legoktm 2008-2009, MIT License # import re, sys, os sys.path.append(os.environ['HOME'] + '/pythonwikibot') #sys.path.append('/Users/kman/projects/pywikibot') import wiki wiki.setUser('Legobot') page = wiki.Page('Wikipedia:Possibly unfree images') try: wikitext = st...
#!usr/bin/python # -*- coding: utf-8 -* # # (C) Legoktm 2008-2009, MIT License # import re, sys, os sys.path.append(os.environ['HOME'] + '/pythonwikibot') #sys.path.append('/Users/kman/projects/pywikibot') import wiki wiki.setUser('Legobot') page = wiki.Page('Wikipedia:Possibly unfree images') try: wikitext = st...
mit
Python
fb51b056ce909028ee4b0cc3e790ae202d8711af
Update P06_factorialLog disable logging
JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials
books/AutomateTheBoringStuffWithPython/Chapter10/P06_factorialLog.py
books/AutomateTheBoringStuffWithPython/Chapter10/P06_factorialLog.py
# This program calculates factorial and logs debug messages import logging logging.basicConfig(level=logging.DEBUG, format=" %(asctime)s - %(levelname)s - %(message)s") logging.disable(logging.CRITICAL) # Stop logging, comment out to debug logging.debug("Start of program") def factorial(n): logging.debug("Start...
# This program calculates factorial and logs debug messages import logging logging.basicConfig(level=logging.DEBUG, format=" %(asctime)s - %(levelname)s - %(message)s") logging.debug("Start of program") def factorial(n): logging.debug("Start of factorial(%s%%)" % n) total = 1 for i in range(1, n + 1): ...
mit
Python
6facb0f33a8cf53041d9fa1562376e43e6d6194f
add init for smiles2graph
snap-stanford/ogb
ogb/utils/__init__.py
ogb/utils/__init__.py
try: from .mol import smiles2graph except ImportError: pass
mit
Python
fdae17a50223c2f9b8ba4a665fc24726e2c2ce14
Add auth header to the fixture loader
matthewfranglen/postgres-elasticsearch-fdw
tests/lib/es_tools.py
tests/lib/es_tools.py
""" Commands for interacting with Elastic Search """ # pylint: disable=broad-except from os.path import join import requests from lib.tools import TEST_FOLDER def es_is_available(): """ Test if Elastic Search is running """ try: return ( requests.get("http://localhost:9200", auth=("ela...
""" Commands for interacting with Elastic Search """ # pylint: disable=broad-except from os.path import join import requests from lib.tools import TEST_FOLDER def es_is_available(): """ Test if Elastic Search is running """ try: return ( requests.get("http://localhost:9200").json()["ta...
mit
Python
19e347716b5efcbaaf857a2805bd5f7ed5d5ec04
Patch waagent unit to kill process instead of entire control group
soumyanishan/azure-linux-extensions,krkhan/azure-linux-extensions,Azure/azure-linux-extensions,Azure/azure-linux-extensions,Azure/azure-linux-extensions,vityagi/azure-linux-extensions,vityagi/azure-linux-extensions,andyliuliming/azure-linux-extensions,varunkumta/azure-linux-extensions,jasonzio/azure-linux-extensions,bp...
VMEncryption/main/oscrypto/encryptstates/PrereqState.py
VMEncryption/main/oscrypto/encryptstates/PrereqState.py
#!/usr/bin/env python # # VM Backup extension # # Copyright 2015 Microsoft Corporation # # 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 # # U...
#!/usr/bin/env python # # VM Backup extension # # Copyright 2015 Microsoft Corporation # # 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 # # U...
apache-2.0
Python
455874cae74a34e610650e5b5618b64fe808ea1c
fix docstring syntax error
ncareol/ncharts,ncareol/ncharts,ncareol/ncharts,ncareol/ncharts,ncareol/ncharts
ncharts/ncharts/templatetags/filters.py
ncharts/ncharts/templatetags/filters.py
from django import template from ncharts import models as nc_models register = template.Library() @register.filter def get_long_name(vs, v): """Get 'long_name' value of vs[v] """ try: return vs[v]['long_name'] except: return '' @register.filter def get_item(dictionary, key): return di...
from django import template from ncharts import models as nc_models register = template.Library() @register.filter def get_long_name(vs, v): """Get 'long_name' value of vs[v] """ try: return vs[v]['long_name'] except: return '' @register.filter def get_item(dictionary, key): return di...
bsd-2-clause
Python
f7d4be60dd246193fe269dc1caaf8208bd4dba22
improve output of compare_dfa.py.
Lind-Project/native_client,Lind-Project/native_client,Lind-Project/native_client,Lind-Project/native_client,Lind-Project/native_client,Lind-Project/native_client
src/trusted/validator_ragel/unreviewed/compare_dfa.py
src/trusted/validator_ragel/unreviewed/compare_dfa.py
#!/usr/bin/python # Copyright (c) 2013 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import dfa_parser visited_pairs = set() de...
#!/usr/bin/python # Copyright (c) 2013 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import dfa_parser visited_pairs = set() de...
bsd-3-clause
Python
7331fa69c6cd2f09b1711272278a9684af5cf9c1
fix attachfilename
Phantasus/intelmq,aaronkaplan/intelmq-old,aaronkaplan/intelmq-old,aaronkaplan/intelmq-old,s4n7h0/intelmq
intelmq/bots/collectors/mail/mail-attach.py
intelmq/bots/collectors/mail/mail-attach.py
import re import imbox import zipfile from intelmq.lib.bot import Bot, sys from intelmq.bots.collectors.mail.lib import Mail class MailAttachCollectorBot(Bot): def process(self): mailbox = imbox.Imbox(self.parameters.mail_host, self.parameters.mail_user, self.parameters.mail_password, self.parameters.mail...
import re import imbox import zipfile from intelmq.lib.bot import Bot, sys from intelmq.bots.collectors.mail.lib import Mail class MailAttachCollectorBot(Bot): def process(self): mailbox = imbox.Imbox(self.parameters.mail_host, self.parameters.mail_user, self.parameters.mail_password, self.parameters.mail...
agpl-3.0
Python
b481426e52661b702fa014a86c68b015f46feb1f
remove deprecated test suite declarations
OCA/account-financial-tools,OCA/account-financial-tools
account_invoice_constraint_chronology/tests/__init__.py
account_invoice_constraint_chronology/tests/__init__.py
# -*- coding: utf-8 -*- # # # Authors: Adrien Peiffer # Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) # All Rights Reserved # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsibility of assessing all potential # consequences result...
# -*- coding: utf-8 -*- # # # Authors: Adrien Peiffer # Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu) # All Rights Reserved # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsibility of assessing all potential # consequences result...
agpl-3.0
Python
7fef3fbd8f4a68a2cf584721930c276eb49b16ee
Fix issue in infer_android_package_name with tests in //javatests
android/android-test,android/android-test,android/android-test,android/android-test,android/android-test
build_extensions/infer_android_package_name.bzl
build_extensions/infer_android_package_name.bzl
"""A rule for inferring an android package name.""" def infer_android_package_name(): """Infer an android package name based on current path below 'javatests'""" path = native.package_name() javatests_index = path.rindex("javatests/") + len("javatests/") return path[javatests_index:].replace("/", ".")
"""A rule for inferring an android package name.""" def infer_android_package_name(): """Infer an android package name based on current path below 'javatests'""" path = native.package_name() javatests_index = path.rindex("/javatests/") + len("/javatests/") return path[javatests_index:].replace("/", "."...
apache-2.0
Python
c2f668b6b403bde09485595c2ac2852220739c93
Fix docstring.
taschini/morepath,faassen/morepath,morepath/morepath
morepath/toposort.py
morepath/toposort.py
from .error import TopologicalSortError def topological_sort(l, get_depends): result = [] marked = set() temporary_marked = set() def visit(n): if n in marked: return if n in temporary_marked: raise TopologicalSortError("Not a DAG") temporary_marked.add...
from .error import TopologicalSortError def topological_sort(l, get_depends): result = [] marked = set() temporary_marked = set() def visit(n): if n in marked: return if n in temporary_marked: raise TopologicalSortError("Not a DAG") temporary_marked.add...
bsd-3-clause
Python
da8b7471ee773c835edae6f333938caa34e17cbd
Update wrap.py
davidone/misc,davidone/misc
tesco-delivery-bot/wrap.py
tesco-delivery-bot/wrap.py
#!/usr/local/bin/python3.7 import subprocess import os import http.client, urllib PO_API_TOKEN = "" PO_USER_KEY = "" NODE_BIN = "/usr/local/bin/node" class cd: """Context manager for changing the current working directory""" def __init__(self, newPath): self.newPath = os.path.expanduser(newPath) ...
import subprocess import os import http.client, urllib PO_API_TOKEN = "" PO_USER_KEY = "" class cd: """Context manager for changing the current working directory""" def __init__(self, newPath): self.newPath = os.path.expanduser(newPath) def __enter__(self): self.savedPath = os.getcwd() ...
mit
Python
577a526284236cf9a31b3b339902bbeed4991b63
work on profile tests, part-baked
obsoleter/petl,alimanfoo/petl,rs/petl,rs/petl,thatneat/petl,Marketing1by1/petl,obsoleter/petl,obsoleter/petl,psnj/petl,rs/petl
petl/test/test_profile.py
petl/test/test_profile.py
""" TODO doc me """ from petl.profile import * def test_profile(): """ TODO doc me """ table = [['foo', 'bar'], ['A', 1], ['B', 2], ['B', '3', True], ['D', 'xyz'], ['E']] profiler = Profiler(table) # profile the table with...
""" TODO doc me """ from petl.profile import * def test_profile(): """ TODO doc me """ table = [['foo', 'bar'], ['A', 1], ['B', 2], ['B', '3', True], ['D', 'xyz'], ['E']] profiler = Profiler(table) profile = profiler.profi...
mit
Python
87244598ed08e790835818656ecba0178bb7ca89
Upgrade to a better version
leosartaj/fsplit
fsplit/__init__.py
fsplit/__init__.py
#!/usr/bin/env python2 ## # fsplit # https://github.com/leosartaj/fsplit.git # # Copyright (c) 2014 Sartaj Singh # Licensed under the MIT license. ## from .info import __version__ # define __version__ variable from .info import __desc__ # define __desc__ variable for description
#!/usr/bin/env python2 ## # fsplit # https://github.com/leosartaj/fsplit.git # # Copyright (c) 2014 Sartaj Singh # Licensed under the MIT license. ## from info import __version__ # define __version__ variable from info import __desc__ # define __desc__ variable for description
mit
Python
85124382cd3f90b439b27c8dd5a82f47925ddab7
fix settings print
jblance/mpp-solar
mppsolar/__init__.py
mppsolar/__init__.py
# -*- coding: utf-8 -*- # !/usr/bin/python import logging from argparse import ArgumentParser # import mppcommands import mpputils logger = logging.getLogger() # if __name__ == '__main__': def main(): parser = ArgumentParser(description='MPP Solar Command Utility') parser.add_argument('-c', '--command', hel...
# -*- coding: utf-8 -*- # !/usr/bin/python import logging from argparse import ArgumentParser # import mppcommands import mpputils logger = logging.getLogger() # if __name__ == '__main__': def main(): parser = ArgumentParser(description='MPP Solar Command Utility') parser.add_argument('-c', '--command', hel...
mit
Python
bafdbd28e35d80d28bfb82c23532533cb2915066
Add docs for MissingInputFiles 'message' arg.
hantek/fuel,rodrigob/fuel,dmitriy-serdyuk/fuel,codeaudit/fuel,udibr/fuel,mjwillson/fuel,dribnet/fuel,capybaralet/fuel,aalmah/fuel,glewis17/fuel,glewis17/fuel,vdumoulin/fuel,dmitriy-serdyuk/fuel,dwf/fuel,bouthilx/fuel,mila-udem/fuel,chrishokamp/fuel,udibr/fuel,janchorowski/fuel,dwf/fuel,dribnet/fuel,markusnagel/fuel,aal...
fuel/exceptions.py
fuel/exceptions.py
class AxisLabelsMismatchError(ValueError): """Raised when a pair of axis labels tuples do not match.""" class ConfigurationError(Exception): """Error raised when a configuration value is requested but not set.""" class MissingInputFiles(Exception): """Exception raised by a converter when input files are...
class AxisLabelsMismatchError(ValueError): """Raised when a pair of axis labels tuples do not match.""" class ConfigurationError(Exception): """Error raised when a configuration value is requested but not set.""" class MissingInputFiles(Exception): """Exception raised by a converter when input files are...
mit
Python
0da95bdfc184614edca41b41ac3409295352fff6
Update days_between.py
JsWatt/Free-Parking,JsWatt/Free-Parking,JsWatt/Free-Parking,JsWatt/Free-Parking,JsWatt/Free-Parking,JsWatt/Free-Parking,JsWatt/Free-Parking,JsWatt/Free-Parking
checkio/python/oreilly/days_between.py
checkio/python/oreilly/days_between.py
import datetime def days_diff(date1, date2): d1 = datetime.datetime(*date1) d2 = datetime.datetime(*date2) return abs((d2-d1).days) if __name__ == '__main__': #These "asserts" using only for self-checking and not necessary for auto-testing assert days_diff((1982, 4, 19), (1982, 4, 22)) ==...
mit
Python
e35649188f10e99381926318192c856e85245ef9
update apk version to support toast
openatx/uiautomator2,openatx/uiautomator2,openatx/uiautomator2
uiautomator2/version.py
uiautomator2/version.py
# coding: utf-8 # __apk_version__ = '1.0.12' # 1.0.12 add toast support # 1.0.11 add auto install support # 1.0.10 fix service not started bug # 1.0.9 fix apk version code and version name # ERR: 1.0.8 bad version number. show ip on notification # ERR: 1.0.7 bad version number. new input method, some bug fix __atx_ag...
# coding: utf-8 # __apk_version__ = '1.0.11' # 1.0.11 add auto install support # 1.0.10 fix service not started bug # 1.0.9 fix apk version code and version name # ERR: 1.0.8 bad version number. show ip on notification # ERR: 1.0.7 bad version number. new input method, some bug fix __atx_agent_version__ = '0.2.1' # 0...
mit
Python
28c6e6747a6d0bd924f838ed4f846b01c247012b
Remove unused tempproject and tempscene
Previz-app/previz-python-api
previz/testsutils.py
previz/testsutils.py
import functools from . import PrevizProject class Decorators(object): def __init__(self, api_token, api_root, new_project_prefix = 'cf-'): self.api_root = api_root self.api_token = api_token self.new_project_prefix = new_project_prefix def project(self, project_id): def decor...
import functools from . import PrevizProject class Decorators(object): def __init__(self, api_token, api_root, new_project_prefix = 'cf-'): self.api_root = api_root self.api_token = api_token self.new_project_prefix = new_project_prefix def project(self, project_id): def decor...
mit
Python
1b16467c9d24c770578d5f94e9715d754885de98
correct output at switch on
coolchip/amp-switch
printStatusChange.py
printStatusChange.py
import re def readStatus(): status = '' f = open('/proc/asound/card0/pcm0p/sub0/status', 'r') for line in f: matchObj = re.match(r'state.*', line) if matchObj: status = matchObj.group() break matchObj = re.match(r'closed', line) if matchObj: ...
import re def readStatus(): status = '' f = open('/proc/asound/card0/pcm0p/sub0/status', 'r') for line in f: matchObj = re.match(r'state.*', line) if matchObj: status = matchObj.group() break matchObj = re.match(r'closed', line) if matchObj: ...
mit
Python
f54802514b6d3ba66269c4e09640d2de7a7dade2
Fix regression in filesystem watcher
raxod502/straight.el,raxod502/straight.el
watcher/straight_watch_callback.py
watcher/straight_watch_callback.py
#!/usr/bin/env -S python3 -u import os import pathlib import sys WATCHEXEC_VAR_COMMON = "WATCHEXEC_COMMON_PATH" WATCHEXEC_VARS = [ "WATCHEXEC_CREATED_PATH", "WATCHEXEC_REMOVED_PATH", "WATCHEXEC_RENAMED_PATH", "WATCHEXEC_WRITTEN_PATH", "WATCHEXEC_META_CHANGED_PATH", ] def die(message): print...
#!/usr/bin/env python3 -u import os import pathlib import sys WATCHEXEC_VAR_COMMON = "WATCHEXEC_COMMON_PATH" WATCHEXEC_VARS = [ "WATCHEXEC_CREATED_PATH", "WATCHEXEC_REMOVED_PATH", "WATCHEXEC_RENAMED_PATH", "WATCHEXEC_WRITTEN_PATH", "WATCHEXEC_META_CHANGED_PATH", ] def die(message): print(me...
mit
Python
ee1f59a8a61709bebc4f08adce520ab251576148
Use a single query to fetch the guardian and hub.
us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite
us_ignite/hubs/views.py
us_ignite/hubs/views.py
from django.db.models import Q from django.contrib import messages from django.contrib.auth.decorators import login_required from django.http import Http404 from django.template.response import TemplateResponse from django.shortcuts import get_object_or_404, redirect from us_ignite.hubs.models import Hub, HubRequest f...
from django.db.models import Q from django.contrib import messages from django.contrib.auth.decorators import login_required from django.http import Http404 from django.template.response import TemplateResponse from django.shortcuts import get_object_or_404, redirect from us_ignite.hubs.models import Hub, HubRequest f...
bsd-3-clause
Python
0fdb93fb73142315fe404b9a161ef19af0d920cd
Add simple test for config builder
beezz/pg_bawler,beezz/pg_bawler
tests/test_bawlerd.py
tests/test_bawlerd.py
import io import os from textwrap import dedent from pg_bawler import bawlerd class TestBawlerdConfig: def test_build_config_location_list(self): assert not bawlerd.conf.build_config_location_list(locations=()) user_conf = os.path.join( os.path.expanduser('~'), bawlerd.c...
import io import os from textwrap import dedent from pg_bawler import bawlerd class TestBawlerdConfig: def test_build_config_location_list(self): assert not bawlerd.conf.build_config_location_list(locations=()) user_conf = os.path.join( os.path.expanduser('~'), bawlerd.c...
bsd-3-clause
Python
e62b62107ef44fec414a3a932a3e3e7bad211f34
add django-extensions for easier local view debugging
coffeestats/coffeestats-django,coffeestats/coffeestats-django,coffeestats/coffeestats-django,coffeestats/coffeestats-django
coffeestats/coffeestats/settings/local.py
coffeestats/coffeestats/settings/local.py
# -*- python -*- # pymode:lint_ignore=W0401,E501 """Development settings and globals.""" from __future__ import absolute_import from .base import * # noqa # ######### DEBUG CONFIGURATION # See: https://docs.djangoproject.com/en/dev/ref/settings/#debug DEBUG = True # ######### END DEBUG CONFIGURATION # ######### ...
# -*- python -*- # pymode:lint_ignore=W0401,E501 """Development settings and globals.""" from __future__ import absolute_import from .base import * # noqa # ######### DEBUG CONFIGURATION # See: https://docs.djangoproject.com/en/dev/ref/settings/#debug DEBUG = True # ######### END DEBUG CONFIGURATION # ######### ...
mit
Python
4b0902e960f08f9ef99ce211b98e211b1685f68b
Update walletchangepass.py
bhok/PPYK,bhok/PPYK,bhok/PPYK,bhok/PPYK,bhok/PPYK
contrib/wallettools/walletchangepass.py
contrib/wallettools/walletchangepass.py
from jsonrpc import ServiceProxy access = ServiceProxy("http://127.0.0.1:6647") pwd = raw_input("Enter old wallet passphrase: ") pwd2 = raw_input("Enter new wallet passphrase: ") access.walletpassphrasechange(pwd, pwd2)
from jsonrpc import ServiceProxy access = ServiceProxy("http://127.0.0.1:46393") pwd = raw_input("Enter old wallet passphrase: ") pwd2 = raw_input("Enter new wallet passphrase: ") access.walletpassphrasechange(pwd, pwd2)
mit
Python
af0a932e8097701179310501d75888d7d4617dac
verifica codice con Schema dello SdI per fatturapa
OCA/l10n-italy,OCA/l10n-italy,OCA/l10n-italy
l10n_it_payment_reason/tests/test_reason.py
l10n_it_payment_reason/tests/test_reason.py
from odoo.exceptions import ValidationError from odoo.tests.common import TransactionCase from odoo.addons.l10n_it_account.tools.account_tools import fpa_schema_get_enum class TestReasons(TransactionCase): def setUp(self): super(TestReasons, self).setUp() self.reason_model = self.env["payment.rea...
from odoo.exceptions import ValidationError from odoo.tests.common import TransactionCase class TestReasons(TransactionCase): def setUp(self): super(TestReasons, self).setUp() self.reason_model = self.env["payment.reason"] self.reason_b = self.env.ref("l10n_it_payment_reason.b") def t...
agpl-3.0
Python
c59a2ce0a6b164e7af26d73a553349937642c370
write frozen graph instead of just the graph def
astromme/classify-handwritten-characters,astromme/classify-handwritten-characters
write_pb_file.py
write_pb_file.py
#!/usr/bin/env python3 from gnt_model import model, error_rate, IMAGE_HEIGHT, IMAGE_WIDTH, PIXEL_DEPTH import os import sys import tensorflow as tf from tensorflow.python.platform import gfile from tensorflow.python.framework import graph_util def main(): if len(sys.argv) != 3: print('Usage: {} checkpoi...
#!/usr/bin/env python3 from gnt_model import model, error_rate, IMAGE_HEIGHT, IMAGE_WIDTH, PIXEL_DEPTH import sys import tensorflow as tf def main(): if len(sys.argv) != 3: print('Usage: {} modelpath outputdir'.format(sys.argv[0])) sys.exit() _, model_path, output_dir = sys.argv node_im...
mit
Python
6ecccc9d5600f46e4810ab3fdf82d29268105abc
use watchdog instead of bare inotifyx for recursive file system monitoring
bbiskup/pytest-purkinje,bbiskup/pytest-purkinje
purkinje_pytest/testrunner.py
purkinje_pytest/testrunner.py
# -*- coding: utf-8 -*- """Automatic test execution""" from __future__ import print_function from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler import logging import time logger = logging.getLogger(__file__) #WATCH_MASK = inotify.IN_CLOSE_WRITE | inotify.IN_DELETE # Extensio...
# -*- coding: utf-8 -*- """Automatic test execution""" from __future__ import print_function from watchdog.observers import Observer from watchdog.events import LoggingEventHandler import logging import time logger = logging.getLogger(__file__) #WATCH_MASK = inotify.IN_CLOSE_WRITE | inotify.IN_DELETE # Extensions ...
mit
Python
c052aaca11f8fdcd465ee986548db8141b27a197
bump to 0.7.2
martin-hunt/hublib
hublib/__init__.py
hublib/__init__.py
from pint import UnitRegistry ureg = UnitRegistry() ureg.autoconvert_offset_to_baseunit = True Q_ = ureg.Quantity __version__ = "0.7.2"
from pint import UnitRegistry ureg = UnitRegistry() ureg.autoconvert_offset_to_baseunit = True Q_ = ureg.Quantity __version__ = "0.7.1"
mit
Python
8959801a293fa33cb7625b524c6e9226af7253b2
Use separate HITTypeIds for live vs. sandbox
suchow/judicious,suchow/judicious,suchow/judicious
recruiters.py
recruiters.py
"""Recruiters of judicious humans.""" import logging import os import boto3 # Set up logging. logger = logging.getLogger(__name__) handler = logging.StreamHandler() formatter = logging.Formatter( '%(asctime)s [recruiter.1]: %(message)s') handler.setFormatter(formatter) logger.addHandler(handler) logger.setLe...
"""Recruiters of judicious humans.""" import logging import os import boto3 # Set up logging. logger = logging.getLogger(__name__) handler = logging.StreamHandler() formatter = logging.Formatter( '%(asctime)s [recruiter.1]: %(message)s') handler.setFormatter(formatter) logger.addHandler(handler) logger.setLe...
mit
Python
3ca6affb630f0dea9b414f5405acae7a20f213d2
add request apis
ryerh/py-crawler,ryerh/py-crawler,ryerh/py-crawler
crawler/spiders/movies_spider.py
crawler/spiders/movies_spider.py
# -*- coding: utf-8 -*- import scrapy import json from core.models import db, Movie from crawler.spiders.subjects_spider import save_subject_detail class MoviesSpider(scrapy.Spider): name = 'MoviesSpider' allowed_domains = ['douban.com'] start_urls = [ 'https://frodo.douban.com/jsonp/subject_coll...
# -*- coding: utf-8 -*- import scrapy import json from core.models import db, Movie from crawler.spiders.subjects_spider import save_subject_detail class MoviesSpider(scrapy.Spider): name = 'MoviesSpider' allowed_domains = ['douban.com'] start_urls = [ 'https://frodo.douban.com/jsonp/subject_coll...
apache-2.0
Python
ac7090293c4686b071ca314c37304b2eeddec766
Fix isort problems
pretix/pretix-cartshare,pretix/pretix-cartshare,pretix/pretix-cartshare
pretix_cartshare/migrations/0002_auto_20161008_1047.py
pretix_cartshare/migrations/0002_auto_20161008_1047.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-10-08 10:47 from __future__ import unicode_literals import pretix_cartshare.models from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pretix_cartshare', '0001_initial'), ] operations = [...
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-10-08 10:47 from __future__ import unicode_literals from django.db import migrations, models import pretix_cartshare.models class Migration(migrations.Migration): dependencies = [ ('pretix_cartshare', '0001_initial'), ] operations = [...
apache-2.0
Python
1b7289dd8b72cb67fe5c369e99b60e5cd0e85958
Fix neovim support
prashanthellina/follow-markdown-links
ftplugin/markdown/follow_markdown_links.py
ftplugin/markdown/follow_markdown_links.py
import os import re try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse import vim DEFAULT_EXTENSION = 'md' MAX_LINE_LEN = 1024 def _extract_link_under_cursor(): _, col = vim.current.window.cursor line = vim.current.line # skip long lines to stop hogging CPU ...
import re try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse from vim import * DEFAULT_EXTENSION = 'md' MAX_LINE_LEN = 1024 def _extract_link_under_cursor(): _, col = current.window.cursor line = current.line # skip long lines to stop hogging CPU in vim ...
mit
Python
44532322f4a183bd535de22374d149a6e2f8176a
Fix pep8 errors
ivoire/RandoAmisSecours,ivoire/RandoAmisSecours
RandoAmisSecours/views/reporting.py
RandoAmisSecours/views/reporting.py
# -*- coding: utf-8 -*- # vim: set ts=4 # Copyright 2014 Rémi Duraffort # This file is part of RandoAmisSecours. # # RandoAmisSecours 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...
# -*- coding: utf-8 -*- # vim: set ts=4 # Copyright 2014 Rémi Duraffort # This file is part of RandoAmisSecours. # # RandoAmisSecours 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...
agpl-3.0
Python
b8e7b9d9316e84fec4c8524eab6839e82b8534c1
Fix typo in add_subset
PennyQ/glue-3d-viewer,astrofrog/glue-3d-viewer,glue-viz/glue-3d-viewer,astrofrog/glue-vispy-viewers,glue-viz/glue-vispy-viewers,PennyQ/astro-vispy
glue_vispy_viewers/volume/volume_viewer.py
glue_vispy_viewers/volume/volume_viewer.py
from ..common.vispy_data_viewer import BaseVispyViewer from .layer_artist import VolumeLayerArtist from .layer_style_widget import VolumeLayerStyleWidget class VispyVolumeViewer(BaseVispyViewer): LABEL = "3D Volume Rendering" _layer_style_widget_cls = VolumeLayerStyleWidget def add_data(self, data): ...
from ..common.vispy_data_viewer import BaseVispyViewer from .layer_artist import VolumeLayerArtist from .layer_style_widget import VolumeLayerStyleWidget class VispyVolumeViewer(BaseVispyViewer): LABEL = "3D Volume Rendering" _layer_style_widget_cls = VolumeLayerStyleWidget def add_data(self, data): ...
bsd-2-clause
Python
872e008b3986b18a7c01cd47e91a7ef39e21006b
Remove unused parameter in test (#5423)
quantumlib/Cirq,quantumlib/Cirq,quantumlib/Cirq,quantumlib/Cirq,quantumlib/Cirq
cirq-core/cirq/contrib/paulistring/pauli_string_dag_test.py
cirq-core/cirq/contrib/paulistring/pauli_string_dag_test.py
# Copyright 2018 The Cirq Developers # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# Copyright 2018 The Cirq Developers # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
Python
d7a665a3947e04c4689db67f35827db2cc3a6842
Update randrect.pyde
kantel/processingpy,kantel/processingpy,kantel/processingpy
sketches/randrect/randrect.pyde
sketches/randrect/randrect.pyde
from random import randint, choice a = 220 colors = [color(155, 46, 105, a), color(217, 55, 80, a), color(226, 114, 79, a), color(243, 220, 123, a), color(78, 147, 151, a)] def setup(): size(600, 600) rectMode(CENTER) strokeWeight(5) # noStroke() background(255) def draw(): for _ in...
from random import randint, choice a = 220 colors = [color(155, 46, 105, a), color(217, 55, 80, a), color(226, 114, 79, a), color(243, 220, 123, a), color(78, 147, 151, a)] def setup(): size(940, 300) rectMode(CENTER) strokeWeight(2) # noStroke() background(255) def draw(): for _ in...
mit
Python
4ff146a7e81fe4b065a551e29f42ef9b2a973823
document title edit
servee/django-servee-document,servee/django-servee-document
servee_document/views.py
servee_document/views.py
import json from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST from django.contrib.auth.decorators import login_required from .models import Document @csrf_exempt @require_POST @login_required def upload_documents(request)...
import json from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST from django.contrib.auth.decorators import login_required from .models import Document @csrf_exempt @require_POST @login_required def upload_documents(request)...
bsd-3-clause
Python
4aad6aa1b50f8b0c86c49867bc75081b03b03086
remove unused import
fedora-conary/conary,fedora-conary/conary,fedora-conary/conary,fedora-conary/conary,fedora-conary/conary
repository/shimclient.py
repository/shimclient.py
# # Copyright (c) 2005 rpath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.opensource.org/licen...
# # Copyright (c) 2005 rpath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.opensource.org/licen...
apache-2.0
Python
c36282a41c248ad3d2405a0461195c679ef5327c
disable socket timeout, set heartbeat to 10 from 30
hiidef/hiispider,hiidef/hiispider
hiispider/amqp/amqp.py
hiispider/amqp/amqp.py
import specs from twisted.internet.protocol import ClientCreator from twisted.internet import reactor from txamqp.client import TwistedDelegate from txamqp.protocol import AMQClient import txamqp.spec def createClient(amqp_host, amqp_vhost, amqp_port=5672): amqp_spec = txamqp.spec.loadString(specs.v0_8) amqp_...
import specs from twisted.internet.protocol import ClientCreator from twisted.internet import reactor from txamqp.client import TwistedDelegate from txamqp.protocol import AMQClient import txamqp.spec def createClient(amqp_host, amqp_vhost, amqp_port=5672): amqp_spec = txamqp.spec.loadString(specs.v0_8) amqp_d...
mit
Python
1198d398fc8051142c700991c1360750b0857dc4
Update mp3test.py
sstocker46/pyrobotlab,MyRobotLab/pyrobotlab,mecax/pyrobotlab,mecax/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,sstocker46/pyrobotlab,sstocker46/pyrobotlab
home/Markus/mp3test.py
home/Markus/mp3test.py
# this is a test script from java.lang import String from org.myrobotlab.service import Speech from org.myrobotlab.service import Sphinx from org.myrobotlab.service import Runtime import random mouth = Runtime.createAndStart("mouth","Speech") music = 1 # add python as a listener of the "stopped" event from audioFi...
# this is a test script # i have a folder with the mp3 files named from music1 to music8. # it random choses the files . no problem # but i want to change the sleep(120) so the next starts when the previous is finished from java.lang import String from org.myrobotlab.service import Speech from org.myrobotlab.servi...
apache-2.0
Python
7388de0439913a8a33ac47a3cec14546e2860737
Add code example with loggable quantities in _CustomAction
joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue
hoomd/custom_action.py
hoomd/custom_action.py
from abc import ABC, abstractmethod from hoomd.parameterdicts import ParameterDict from hoomd.operation import _HOOMDGetSetAttrBase class _CustomAction(ABC): """Base class for all Python ``Action``s. This class must be the parent class for all Python ``Action``s. This class requires all subclasses to imp...
from abc import ABC, abstractmethod from hoomd.parameterdicts import ParameterDict from hoomd.operation import _HOOMDGetSetAttrBase class _CustomAction(ABC): """Base class for all Python ``Action``s. This class must be the parent class for all Python ``Action``s. This class requires all subclasses to imp...
bsd-3-clause
Python
94ecbdc67dd72c671862aea29fd5525ea92650d8
Update model.py
wfclark/hamlet,wfclark/hamlet
hurricane/model.py
hurricane/model.py
import sys import os import urllib2 import datetime import time import psycopg2 import pandas from subprocess import call, Popen # pull the 6 hr forecast track forecast from NHC #os.system("wget http://www.srh.noaa.gov/ridge2/Precip/qpehourlyshape/latest/last_1_hours.tar.gz -O last_1_hours.tar.gz") #os.system("mv l...
bsd-3-clause
Python
c78cb26ff07712027b3ae340d6209482e8708641
implement single-length tuple
tlevine/vlermv
vlermv/transformers/raw.py
vlermv/transformers/raw.py
import posixpath error_msg = '''The index must be a string.''' def to_path(key): if isinstance(key, tuple) and len(key) == 1: key = key[0] if hasattr(key, 'strip') and hasattr(key, 'split'): return tuple(key.strip('/').split('/')) else: raise TypeError('Key must be string-like or ...
import posixpath error_msg = '''The index must be a string.''' def to_path(key): return tuple(key.strip('/').split('/')) def from_path(path): return posixpath.join(*path)
agpl-3.0
Python
edb6a027aae1656d07112c0dcb455d6891a44992
split around nan test is passing
moorepants/BicycleDataProcessor,moorepants/BicycleDataProcessor
test_data_processor.py
test_data_processor.py
import DataProcessor as dp import numpy as np def test_unsize_vector(): n = 3 a = np.ones(n) b = np.append(a, np.array([np.nan, np.nan])) c = dp.unsize_vector(a, n) assert (a == c).all() def test_time_vector(): numSamples = 100 sampleRate = 50 time = dp.time_vector(numSamples, sampleRa...
import DataProcessor as dp import numpy as np def test_unsize_vector(): n = 3 a = np.ones(n) b = np.append(a, np.array([np.nan, np.nan])) c = dp.unsize_vector(a, n) assert (a == c).all() def test_time_vector(): numSamples = 100 sampleRate = 50 time = dp.time_vector(numSamples, sampleRa...
bsd-2-clause
Python
e5c3ece6ebad2b7ab524e074fd982e7fc11497b1
set better filter
rrooij/sitewatcher_telegram
watcher/tweakerswatcher.py
watcher/tweakerswatcher.py
import requests import json import os.path from watcher.watcher import Watcher class TweakersWatcher(Watcher): watcher_name = 'Tweakers Pricewatch' filename = 'site_tweakers.txt' def parse_site(self): url = 'https://tweakers.net/xmlhttp/xmlHttp.php?application=tweakbase&type=filter&action=deals&d...
import requests import json import os.path from watcher.watcher import Watcher class TweakersWatcher(Watcher): watcher_name = 'Tweakers Pricewatch' filename = 'site_tweakers.txt' def parse_site(self): url = 'https://tweakers.net/xmlhttp/xmlHttp.php?application=tweakbase&type=filter&action=deals&f...
agpl-3.0
Python
c0566ab5f4dabdf0c366d6b6a32cbd8ca3fb4a75
use idle_add callback for animation
jswhit/pygrib,jswhit/pygrib
test/animate.py
test/animate.py
import matplotlib matplotlib.use('GTKAgg') import pygrib, time ,gobject import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.basemap import Basemap # animation example. grbs = pygrib.open('../sampledata/safrica.grib2') # grab all "brightness temp" grib messages. btemps = [grb for grb in grbs if grb['n...
import matplotlib matplotlib.use('GTKAgg') import pygrib import matplotlib.pyplot as plt import numpy as np import time from mpl_toolkits.basemap import Basemap # animation example. grbs = pygrib.open('../sampledata/safrica.grib2') # grab all "brightness temp" grib messages. btemps = [grb for grb in grbs if grb['name...
mit
Python
65f5695b90054f73d7119f0c50be51f61de777fa
Print the time of checking status at github.
kaushik94/tardis,orbitfold/tardis,kaushik94/tardis,orbitfold/tardis,orbitfold/tardis,kaushik94/tardis,orbitfold/tardis,kaushik94/tardis
tardis/tests/tests_slow/runner.py
tardis/tests/tests_slow/runner.py
import argparse import datetime import json import os import time import requests from tardis import __githash__ as tardis_githash parser = argparse.ArgumentParser(description="Run slow integration tests") parser.add_argument("--yaml", dest="yaml_filepath", help="Path to YAML config file for inte...
import argparse import json import os import time import requests from tardis import __githash__ as tardis_githash parser = argparse.ArgumentParser(description="Run slow integration tests") parser.add_argument("--yaml", dest="yaml_filepath", help="Path to YAML config file for integration tests.")...
bsd-3-clause
Python
08a65747d608fcc530adf6291a95104d4348eae6
apply RatingTargetMixin to test model
hzy/django-polarize,pombredanne/django-polarize
tests/models.py
tests/models.py
from __future__ import unicode_literals from django.db import models from generic_ratings.model_mixins import RatingTargetMixin class TextSnippet(RatingTargetMixin, models.Model): text = models.TextField() user = models.ForeignKey('auth.User')
from __future__ import unicode_literals from django.db import models class TextSnippet(models.Model): text = models.TextField() user = models.ForeignKey('auth.User')
mit
Python
5935a9f0ec35774f95b32465134d88d3e087fd1b
Use newer sphinx if available.
salilab/saliweb,salilab/saliweb,salilab/saliweb,salilab/saliweb,salilab/saliweb
tools/sphinx.py
tools/sphinx.py
# Simple Sphinx tool and builder. import os from SCons.Script import * # Build sphinx documentation: def _action_sphinx(target, source, env): sourcedir = os.path.dirname(source[0].path) outdir = os.path.dirname(target[0].path) app = "%s %s %s %s" % (env['SPHINX_BUILD'], env['SPHINX_OPTS'], ...
# Simple Sphinx tool and builder. import os from SCons.Script import * # Build sphinx documentation: def _action_sphinx(target, source, env): sourcedir = os.path.dirname(source[0].path) outdir = os.path.dirname(target[0].path) app = "%s %s %s %s" % (env['SPHINX_BUILD'], env['SPHINX_OPTS'], ...
lgpl-2.1
Python
0f02210e4f57f0023a2be6b11059bc5754f4d467
Update version.py
mbakker7/ttim,mbakker7/ttim
ttim/version.py
ttim/version.py
__version__='0.4.1' #__build__='4.0.0.0'
__version__='0.4.0' #__build__='4.0.0.0'
mit
Python
1df785d6f337fa2dc9e42c808fab79a5a2827258
remove line to run tests
RENCI/xDCIShare,hydroshare/hydroshare,RENCI/xDCIShare,FescueFungiShare/hydroshare,ResearchSoftwareInstitute/MyHPOM,FescueFungiShare/hydroshare,hydroshare/hydroshare,RENCI/xDCIShare,FescueFungiShare/hydroshare,hydroshare/hydroshare,ResearchSoftwareInstitute/MyHPOM,hydroshare/hydroshare,RENCI/xDCIShare,hydroshare/hydrosh...
hs_modflow_modelinstance/tests/__init__.py
hs_modflow_modelinstance/tests/__init__.py
from test_modflow_modelinstance_metadata import *
bsd-3-clause
Python
40a98808da485edeaa87bb30f0e0749401c500da
update documentation configuration
sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs
_doc/sphinxdoc/source/conf3/conf.py
_doc/sphinxdoc/source/conf3/conf.py
import sys import os import datetime import re import sphinx_bootstrap_theme source_path = os.path.normpath( os.path.join( os.path.abspath( os.path.split(__file__)[0]), "..")) try: from conf_base import * except ImportError: sys.path.append(source_path) from conf_base impo...
import sys import os import datetime import re import sphinx_bootstrap_theme source_path = os.path.normpath( os.path.join( os.path.abspath( os.path.split(__file__)[0]), "..")) try: from conf_base import * except ImportError: sys.path.append(source_path) from conf_base impo...
mit
Python
e4942c16322829d37f780d539517fe10e50e0e39
Fix bad var
basepi/hubble,basepi/hubble
hubblestack/extmods/grains/splunkconfig.py
hubblestack/extmods/grains/splunkconfig.py
# -*- coding: utf-8 -*- ''' Attempt to load alternate splunk config from the hubble.d/ directory and store in grains for use by the splunk returners. This way splunk config changes don't require a hubble restart. ''' import os import yaml def splunkconfig(): ''' Walk the hubble.d/ directory and read in any .c...
# -*- coding: utf-8 -*- ''' Attempt to load alternate splunk config from the hubble.d/ directory and store in grains for use by the splunk returners. This way splunk config changes don't require a hubble restart. ''' import os import yaml def splunkconfig(): ''' Walk the hubble.d/ directory and read in any .c...
apache-2.0
Python