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
9ea6e8b456a62b671eef38f8a21409c58e4b4566
remove io and change to EROFS
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
tests/unit/fileclient_test.py
tests/unit/fileclient_test.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email: `Bo Maryniuk <bo@suse.de>` ''' # Import Python libs from __future__ import absolute_import import errno from mock import Mock # Import Salt Testing libs from salttesting import TestCase from salttesting.helpers import ensure_in_syspath from salttesting.mock import ...
# -*- coding: utf-8 -*- ''' :codeauthor: :email: `Bo Maryniuk <bo@suse.de>` ''' # Import Python libs from __future__ import absolute_import import errno from mock import Mock # Import Salt Testing libs from salttesting import TestCase from salttesting.helpers import ensure_in_syspath from salttesting.mock import ...
apache-2.0
Python
7dd17cc10f7e0857ab3017177d6c4abeb115ff07
Add explicit version check for Django 1.7 or above
smartfile/django-south,smartfile/django-south
south/models.py
south/models.py
from django.db import models from south.db import DEFAULT_DB_ALIAS # If we detect Django 1.7 or higher, then exit # Placed here so it's guaranteed to be imported on Django start import django if django.VERSION[0] > 1 or (django.VERSION[0] == 1 and django.VERSION[1] > 6): raise RuntimeError("South does not support ...
from django.db import models from south.db import DEFAULT_DB_ALIAS class MigrationHistory(models.Model): app_name = models.CharField(max_length=255) migration = models.CharField(max_length=255) applied = models.DateTimeField(blank=True) @classmethod def for_migration(cls, migration, database): ...
apache-2.0
Python
b4cd58a9c5c27fb32b4f13cfc2d41206bb6b86a1
Use range instead of xrange
gabber12/slides.vim
lib/presenter.py
lib/presenter.py
import os import tempfile from subprocess import call class SlidePresenter(object): def __init__(self): pass def present(self, slides): for sno, slide in enumerate(slides): with open(os.path.join(tempfile.gettempdir(), str(sno)+".md"), 'w') as f: f.write(slide) ...
import os import tempfile from subprocess import call class SlidePresenter(object): def __init__(self): pass def present(self, slides): for sno, slide in enumerate(slides): with open(os.path.join(tempfile.gettempdir(), str(sno)+".md"), 'w') as f: f.write(slide) ...
mit
Python
d3c67e77c4a026ce2bf5759b4bd5bcd9265cf505
use .rebased_addr instead of deprecated .addr
axt/bingraphvis
examples/cfg/cfg.py
examples/cfg/cfg.py
#! /usr/bin/env python from bingraphvis import DotOutput from bingraphvis.angr import * from bingraphvis.openreil import * from bingraphvis.angr.x86 import * samples_dir = "../../samples/cfg/" import angr def angr_cfg(sample): proj = angr.Project(samples_dir + sample, load_options={'auto_load_libs':False}) ...
#! /usr/bin/env python from bingraphvis import DotOutput from bingraphvis.angr import * from bingraphvis.openreil import * from bingraphvis.angr.x86 import * samples_dir = "../../samples/cfg/" import angr def angr_cfg(sample): proj = angr.Project(samples_dir + sample, load_options={'auto_load_libs':False}) ...
bsd-2-clause
Python
fe85f1f135d2a7831afee6c8ab0bad394beb8aba
Add throwing item usage to test AI
MoyTW/RL_Arena_Experiment
src/ais.py
src/ais.py
from src.constants import * class MonsterAI(object): def __init__(self, level): self.owner = None self.level = level def take_turn(self): self.owner.log.log_begin_turn(self.owner.oid) self._take_turn() def _take_turn(self): raise NotImplementedError('Subclass this...
class MonsterAI(object): def __init__(self, level): self.owner = None self.level = level def take_turn(self): self.owner.log.log_begin_turn(self.owner.oid) self._take_turn() def _take_turn(self): raise NotImplementedError('Subclass this before usage please.') clas...
mit
Python
795de63d3093bd281a33982fa08b60bdc1acaec3
Use gifsicle to optimise gif
martinmcbride/sympl
pyanimate/gif.py
pyanimate/gif.py
# Author: Martin McBride # Created: 2018-09-22 # Copyright (C) 2018, Martin McBride # License: MIT import imageio import subprocess def save_animated_gif(filepath, frames, delay, loop=0): if not filepath.lower().endswith('.gif'): filepath += '.gif' images = list(frames) imageio.mimsave(filepath...
# Author: Martin McBride # Created: 2018-09-22 # Copyright (C) 2018, Martin McBride # License: MIT import imageio def save_animated_gif(filepath, frames, delay, loop=0): if not filepath.lower().endswith('.gif'): filepath += '.gif' images = list(frames) imageio.mimsave(filepath, images, duration=...
mit
Python
ca17cb88aeb6d6017e8b9e4944ce87d1554e8ceb
Increase connection backlog for better performance.
kdart/pycopia,kdart/pycopia,kdart/pycopia,kdart/pycopia,kdart/pycopia
net/pycopia/httpserver.py
net/pycopia/httpserver.py
#!/usr/bin/python2 # -*- coding: utf-8 -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab:fenc=utf-8 # # Copyright (C) 2010 Keith Dart <keith@dartworks.biz> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published...
#!/usr/bin/python2 # -*- coding: utf-8 -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab:fenc=utf-8 # # Copyright (C) 2010 Keith Dart <keith@dartworks.biz> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published...
apache-2.0
Python
c0b2f89ee7cbf3a594e1a2cf0d264d25d37f0a45
Convert to unicode before encoding.
TkTech/pytextql
pytextql/util.py
pytextql/util.py
# -*- coding: utf-8 -*- import csv import itertools def grouper(iterable, n): """ Slice up `iterable` into iterables of `n` items. :param iterable: Iterable to splice. :param n: Number of items per slice. :returns: iterable of iterables """ it = iter(iterable) while True: chun...
# -*- coding: utf-8 -*- import csv import itertools def grouper(iterable, n): """ Slice up `iterable` into iterables of `n` items. :param iterable: Iterable to splice. :param n: Number of items per slice. :returns: iterable of iterables """ it = iter(iterable) while True: chun...
mit
Python
c5e8c4f773a348400d6ec658efd61710074fd1c1
remove outdated API query.
micrypt/atlas-client
examples/example.py
examples/example.py
from atlas.api import API import pprint '''API examples''' atlas_client = API() ''' Inadvertently discovered that there are a TON of results when the publisher is set to the BBC Needless to say, remember to set a limit when uncertain how many results to expect. ''' items = atlas_client.schedule(from_='now', to='...
from atlas.api import API import pprint '''API examples''' atlas_client = API() ''' Inadvertently discovered that there are a TON of results when the publisher is set to the BBC Needless to say, remember to set a limit when uncertain how many results to expect. ''' items = atlas_client.playlists(publisher='bbc.c...
mit
Python
f2f834a0c3bf6e0bc600056ac6dd5a5c4a524389
Update subpackage imports
larrybradley/photutils,astropy/photutils
photutils/psf/building/__init__.py
photutils/psf/building/__init__.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This subpackage contains modules and packages to build point spread functions. """ from .epsf import * from .epsf_fitter import * from .models import * from .psfstars import *
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This subpackage contains modules and packages to build point spread functions. """ from .catalogs import * # noqa from .centroid import * from .core import * from .epsf import * from .epsf_fitter import * from .models import * from .psf import * fr...
bsd-3-clause
Python
769670fd7e66a91f83929a591d1087f38a8a0fcd
add incr readcount
PegasusWang/articles,PegasusWang/articles,PegasusWang/articles
rest/articles.py
rest/articles.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import _env from bson.objectid import ObjectId from bson.json_util import dumps from jsonp import JsonpHandler from tornado import gen from tornado.web import RequestHandler, HTTPError, addslash class ArticlesHandler(JsonpHandler): def initialize(self, coll): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import _env from bson.objectid import ObjectId from bson.json_util import dumps from jsonp import JsonpHandler from tornado import gen from tornado.web import RequestHandler, HTTPError, addslash class ArticlesHandler(JsonpHandler): def initialize(self, coll): ...
mit
Python
a52d23369f2a231c7cc9b8f3d5b19df6f7b59c4a
bump version
timxx/gitc,timxx/gitc
qgitc/version.py
qgitc/version.py
# -*- coding: utf-8 -*- VERSION_MAJOR = 3 VERSION_MINOR = 2 VERSION_PATCH = 0 VERSION = "{}.{}.{}".format(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
# -*- coding: utf-8 -*- VERSION_MAJOR = 3 VERSION_MINOR = 1 VERSION_PATCH = 5 VERSION = "{}.{}.{}".format(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
apache-2.0
Python
82d95beedd5eb67ed2e20ea4ab3c1914bb0bd930
Fix typos resulted from wrong file added
NeutronUfscarDatacom/DriverDatacom
mech_datacom.py
mech_datacom.py
from neutron.plugins.ml2 import driver_api as api class DatacomMechanismDriver(api.MechanismDriver): """ """ def __init__(self, rpc=None): pass def initialize(self): pass def create_network_precommit(self, context): """Within transaction.""" pass def create_n...
from neutron.plugins.ml2 import driver_api as api class DatacomMechanismDriver(driver_api.MechanismDriver): """ """ def __init__(self, rpc=None): pass def initialize(self): pass def create_network_precommit(self, context): """Remember the tenant, and network information."...
apache-2.0
Python
ca150a4b7745ae64252e11c414aa4ee646038518
Fix broken tests
dreardon/megamillions-group,dreardon/megamillions-group,dreardon/megamillions-group
results/tests.py
results/tests.py
from django.test import TestCase from .models import MegaNumbers, Drawing class ResultsTestCase(TestCase): def setUp(self): Drawing.objects.create(numbers='01,02,03,04,05',megaBall=6, multiplier=4,drawingDate='2016-07-22') Drawing.objects.create(numbers='02,03,04,05,06',megaBall=7, multiplier=3,dra...
from django.test import TestCase from .models import MegaNumbers, Drawing class ResultsTestCase(TestCase): def setUp(self): a = MegaNumbers(numbers='01,02,03,04,05',megaBall=6) a.save() b = MegaNumbers(numbers='02,03,04,05,06',megaBall=7) b.save() Drawing.objects.create(mega...
mit
Python
3db0d12163d839c00965338c4f8efe29a85b3de7
Remove user from db connection string
lfritts/learning_journal,lfritts/learning_journal
journal.py
journal.py
# -*- coding: utf-8 -*- from flask import Flask import os import psycopg2 from contextlib import closing DB_SCHEMA = """ DROP TABLE IF EXISTS entries; CREATE TABLE entries ( id serial PRIMARY KEY, title VARCHAR (127) NOT NULL, text TEXT NOT NULL, created TIMESTAMP NOT NULL ) """ app = Flask(__name__) ...
# -*- coding: utf-8 -*- from flask import Flask import os import psycopg2 from contextlib import closing DB_SCHEMA = """ DROP TABLE IF EXISTS entries; CREATE TABLE entries ( id serial PRIMARY KEY, title VARCHAR (127) NOT NULL, text TEXT NOT NULL, created TIMESTAMP NOT NULL ) """ app = Flask(__name__) ...
mit
Python
0ce4506c9ef736ec214709aaff48735f0a755a8a
fix bug
sotetsuk/memozo
memozo/utils.py
memozo/utils.py
import os import codecs import inspect import hashlib from datetime import datetime MEMOZO_FILE_NAME = '.memozo' ENCODING = 'utf-8' def get_memozo_filename(base_path): return os.path.join(base_path, MEMOZO_FILE_NAME) def get_args_str(args): args_list = sorted(args.items()) args_str = ', '.join(['{!r}:...
import os import codecs import inspect import hashlib from datetime import datetime MEMOZO_FILE_NAME = '.memozo' ENCODING = 'utf-8' def get_memozo_filename(base_path): return os.path.join(base_path, MEMOZO_FILE_NAME) def get_args_str(args): args_list = sorted(args.items()) args_str = ', '.join(['{!r}:...
mit
Python
3628e340738a5a7e3b66d783eb5171653b554eb0
change variable names
hrahadiant/mini_py_project
minitodolist.py
minitodolist.py
import os # initialize a list task = [] # check current python file path currentpath = os.path.dirname(os.path.realpath(__file__)) # set name of the file filename = "my_todo.txt" # set directory to save the file filepath = os.path.join(currentpath, filename) # function for check the file is exist and is empty or not...
import os # initialize a list task = [] # check current python file path currentpath = os.path.dirname(os.path.realpath(__file__)) # set name of the file filename = "my_todo.txt" # set directory to save the file filepath = os.path.join(currentpath, filename) # function for check the file is exist and is empty or not...
apache-2.0
Python
0971863ae87d7b2e5bc8484dec1f192be355b1c0
remove that last debug. should be good now.
MinnPost/salesforce-stripe,MinnPost/salesforce-stripe,MinnPost/salesforce-stripe
plaid.py
plaid.py
from datetime import datetime, timedelta import json import redis #from flask import jsonify import requests from salesforce import SalesforceConnection from config import PLAID_CLIENT_ID from config import PLAID_SECRET from config import PLAID_PUBLIC_KEY from config import PLAID_ENVIRONMENT from check_response im...
from datetime import datetime, timedelta import json import redis #from flask import jsonify import requests from salesforce import SalesforceConnection from config import PLAID_CLIENT_ID from config import PLAID_SECRET from config import PLAID_PUBLIC_KEY from config import PLAID_ENVIRONMENT from check_response im...
mit
Python
77e4b27226f43f9fa99c803c8350580fc896158a
fix error reporting on bad cmd args
tuxofil/Gps2Udp,tuxofil/Gps2Udp,tuxofil/Gps2Udp
misc/gps2udp.py
misc/gps2udp.py
#!/usr/bin/env python """ Receive Geo location data from the Gps2Udp Android application and forward them to the stdout line by line. """ import getopt import os.path import socket import sys DEFAULT_PORT = 5000 def usage(exitcode = 1): """ Show usage info and exit. """ argv0 = os.path.basename(sys...
#!/usr/bin/env python """ Receive Geo location data from the Gps2Udp Android application and forward them to the stdout line by line. """ import getopt import os.path import socket import sys DEFAULT_PORT = 5000 def usage(exitcode = 1): """ Show usage info and exit. """ argv0 = os.path.basename(sys...
bsd-2-clause
Python
d09430109d5276096b95390f5176844c7b809be6
Fix typo in docstring.
CTPUG/wafer,CarlFK/wafer,CTPUG/wafer,CarlFK/wafer,CTPUG/wafer,CTPUG/wafer,CarlFK/wafer,CarlFK/wafer
wafer/context_processors.py
wafer/context_processors.py
from django.conf import settings from django.contrib.sites.models import get_current_site from wafer.menu import get_cached_menus def site_info(request): '''Expose the site's info to templates''' site = get_current_site(request) context = { 'WAFER_CONFERENCE_NAME': site.name, 'WAFER_BASE_U...
from django.conf import settings from django.contrib.sites.models import get_current_site from wafer.menu import get_cached_menus def site_info(request): '''Expose the site's info to templates''' site = get_current_site(request) context = { 'WAFER_CONFERENCE_NAME': site.name, 'WAFER_BASE_U...
isc
Python
8f0a3419b71c2abd3518222fec006dbd93ab6361
save wm keybindings
Zaspire/.dotrc,Zaspire/.dotrc
install.py
install.py
#!/usr/bin/python3 import os import sys import subprocess PARENT = os.path.abspath(os.path.dirname(__file__)) def install_file(name, dest_dir = os.path.expanduser('~'), dot = True): if not os.path.isdir(dest_dir): os.makedirs(dest_dir) if dot: dest = os.path.join(dest_dir, '.' + name) else: dest = ...
#!/usr/bin/python3 import os import sys import subprocess PARENT = os.path.abspath(os.path.dirname(__file__)) def install_file(name, dest_dir = os.path.expanduser('~'), dot = True): if not os.path.isdir(dest_dir): os.makedirs(dest_dir) if dot: dest = os.path.join(dest_dir, '.' + name) else: dest = ...
apache-2.0
Python
ca317034a6c582838190165165d3f4e882c9baa5
Allow direct execution
hhucn/netsec-uebungssystem,hhucn/netsec-uebungssystem,hhucn/netsec-uebungssystem
netsecus/__main__.py
netsecus/__main__.py
from __future__ import unicode_literals import netsecus if __package__ is None: # direct call of __main__.py import os.path path = os.path.realpath(os.path.abspath(__file__)) sys.path.append(os.path.dirname(os.path.dirname(path))) if __name__ == '__main__': netsecus.main()
from __future__ import unicode_literals import __init__ as netsecus if __name__ == '__main__': netsecus.main()
mit
Python
e693c426392c6281dec7207d4249b79853cd2ddc
Add ipdb example
ifosch/europython2015,asvetlov/europython2015,hguemar/europython2015
testing.py
testing.py
import asyncio import ipdb import unittest class Test(unittest.TestCase): def setUp(self): self.loop = asyncio.new_event_loop() asyncio.set_event_loop(None) def tearDown(self): self.loop.close() def test_sleep(self): @asyncio.coroutine def go(): t0 = se...
import asyncio import unittest class Test(unittest.TestCase): def setUp(self): self.loop = asyncio.new_event_loop() asyncio.set_event_loop(None) def tearDown(self): self.loop.close() def test_sleep(self): @asyncio.coroutine def go(): t0 = self.loop.time...
apache-2.0
Python
6bf825daca27212b0fe4745e10c863dbfc092ae9
add view set for subscription model
byteweaver/django-newsletters
newsletters/views.py
newsletters/views.py
from django.views.generic import CreateView, DeleteView from rest_framework import viewsets from newsletters.models import Subscription from newsletters.forms import SubscriptionForm from newsletters.serializers import SubscriptionSerializer class SubscriptionViewSet(viewsets.ModelViewSet): queryset = Subscript...
from django.views.generic import CreateView, DeleteView from newsletters.models import Subscription from newsletters.forms import SubscriptionForm class SubscriptionCreateView(CreateView): form_class = SubscriptionForm class SubscriptionDeleteView(DeleteView): model = Subscription
bsd-3-clause
Python
82b1df2ca9bf3282c7de79f4450238adcca742d1
Add run_commands
abaldwin88/roamer
roamer/engine.py
roamer/engine.py
""" argh """ import os class Engine(object): def __init__(self, original_dir, edit_dir): self.commands = [] for digest, original_entry in original_dir.entries.iteritems(): new_entry = edit_dir.find(digest) if new_entry is None: self.commands.append('rm %s' % ...
""" argh """ class Engine(object): def __init__(self, original_dir, edit_dir): self.commands = [] for digest, original_entry in original_dir.entries.iteritems(): new_entry = edit_dir.find(digest) if new_entry is None: self.commands.append('rm %s' % original_en...
mit
Python
a77e972bf35eab37c6131e3a8e36d970627ea0f9
Rename "data" to "special_cases" to more clearly indicate what they are
pculture/mirocommunity,pculture/mirocommunity,pculture/mirocommunity,pculture/mirocommunity
localtv/tiers.py
localtv/tiers.py
## These "CHOICES" are used in the SiteLocation model. ## They describe the different account types. CHOICES = [ ('free', 'Free account'), ('plus', 'Plus account'), ('premium', 'Premium account'), ('executive', 'Executive account')] class Tier(object): def __init__(self, tier_name): self.ti...
## These "CHOICES" are used in the SiteLocation model. ## They describe the different account types. CHOICES = [ ('free', 'Free account'), ('plus', 'Plus account'), ('premium', 'Premium account'), ('executive', 'Executive account')] class Tier(object): def __init__(self, tier_name): self.ti...
agpl-3.0
Python
2c5b990d33232f1a351b194037212c7ec022dbd3
revert change to srv resolution; had old dnspython installed locally
MMTObservatory/mmtwfs
mmtwfs/utils.py
mmtwfs/utils.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst # coding=utf-8 """ Misc. utility routines """ import dns.resolver as resolver import logging import logging.handlers log = logging.getLogger("DNSresolver") log.setLevel(logging.INFO) __all__ = ['srvlookup'] def srvlookup(server): """ Perform...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # coding=utf-8 """ Misc. utility routines """ import dns.resolver as resolver import logging import logging.handlers log = logging.getLogger("DNSresolver") log.setLevel(logging.INFO) __all__ = ['srvlookup'] def srvlookup(server): """ Perform...
bsd-3-clause
Python
b34254a01fe116b973d4289925c3d4d14cb4d5ee
Fix string continuation problem in dlltool.
cournape/numscons,cournape/numscons,cournape/numscons
numscons/tools/dlltool.py
numscons/tools/dlltool.py
"""SCons.Tool.dlltool Tool-specific initialization for dlltool. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007 The SCons Foundation # # Permission ...
"""SCons.Tool.dlltool Tool-specific initialization for dlltool. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007 The SCons Foundation # # Permission ...
bsd-3-clause
Python
28d7cd7f70e11a5bb6cc9b092a4411e398a14ce5
bump version for pypi
jld23/saspy,jld23/saspy
saspy/version.py
saspy/version.py
__version__ = '2.2.8'
__version__ = '2.2.7'
apache-2.0
Python
904c83e5eb373c4d07c7311e19b86dfec1d4fce7
fix for logic
shortdudey123/gbot
modules/help.py
modules/help.py
#!/usr/bin/env python # ============================================================================= # file = help.py # description = gbot module # author = GR <https://github.com/shortdudey123> # create_date = 2014-07-12 # mod_date = 2014-07-12 # version = 0.1 # usage = loaded by gbot # notes = # python_ver = 2.7.6 #...
#!/usr/bin/env python # ============================================================================= # file = help.py # description = gbot module # author = GR <https://github.com/shortdudey123> # create_date = 2014-07-12 # mod_date = 2014-07-12 # version = 0.1 # usage = loaded by gbot # notes = # python_ver = 2.7.6 #...
apache-2.0
Python
39067a7b92aa63c55e4a091cbeffe97b003a2aca
bump version to 0.23
andrhamm/Singularity,grepsr/Singularity,HubSpot/Singularity,grepsr/Singularity,andrhamm/Singularity,hs-jenkins-bot/Singularity,hs-jenkins-bot/Singularity,HubSpot/Singularity,HubSpot/Singularity,andrhamm/Singularity,HubSpot/Singularity,HubSpot/Singularity,hs-jenkins-bot/Singularity,hs-jenkins-bot/Singularity,hs-jenkins-...
scripts/setup.py
scripts/setup.py
from setuptools import setup, find_packages requirements = [ 'argparse==1.3.0', 'ConfigParser==3.5.0b2', 'grequests==0.2.0', 'gevent==1.1b5', 'requests==2.5.0', 'termcolor==1.1.0' ] setup( name='singularity-logfetch', version='0.23.0', description='Singularity log fetching and searching', ...
from setuptools import setup, find_packages requirements = [ 'argparse==1.3.0', 'ConfigParser==3.5.0b2', 'grequests==0.2.0', 'gevent==1.1b5', 'requests==2.5.0', 'termcolor==1.1.0' ] setup( name='singularity-logfetch', version='0.22.1', description='Singularity log fetching and searching', ...
apache-2.0
Python
96c6be134510625ae22a8b466b4c8ce1b5c83094
Update tw_ip.py
lijunxyz/llpi,lijunxyz/llpi
scripts/tw_ip.py
scripts/tw_ip.py
""" Push basic system info (hostname, IP address, etc.) to Twitter """ import sys sys.path.append("/home/pi/llpi/pylib") import socket import llnet as net tw = net.Twitter('twitter_app1') time_ntp = net.get_time_ntp() hostname = socket.gethostname() msg = "[%s] %s: active at %s" % (time_ntp, hostname, net.get_ip_...
import sys sys.path.append("/home/pi/llpi/pylib") import socket import llnet as net tw = net.Twitter('twitter_app1') time_ntp = net.get_time_ntp() hostname = socket.gethostname() msg = "[%s] %s: active at %s" % (time_ntp, hostname, net.get_ip_address()) tw.update_status(msg)
mit
Python
fe78335e4f469e22f9a1de7a1e5ddd52021a7f0f
Use three public functions instead of one
jwodder/linesep
linesep.py
linesep.py
def read_begun(fp, sep, retain=True, size=512): # Omits empty leading entry entries = read_separated(fp, sep, size=size) e = next(entries) if e: yield e for e in entries: if retain: e = sep + e yield e def read_separated(fp, sep, size=512): buff = '' for ...
STARTER = -1 SEPARATOR = 0 TERMINATOR = 1 def readlines(fp, sep, mode=TERMINATOR, retain=True, size=512): if mode < 0: return _readlines_start(fp, sep, retain, size) elif mode == 0: return _readlines_sep(fp, sep, size) else: return _readlines_term(fp, sep, retain, size) def _readli...
mit
Python
5731f40789537567a4ea1443f7bda58d86100e8a
remove torrents link
kbatten/linkssd
linkssd.py
linkssd.py
#!/usr/bin/env python from __future__ import print_function import time import os import sys import ntfsutils.junction def list_directories(base): try: directories = os.walk(base).next()[1] except StopIteration: directories = [] return directories def create_junction(directory, junctio...
#!/usr/bin/env python from __future__ import print_function import time import os import sys import ntfsutils.junction def list_directories(base): try: directories = os.walk(base).next()[1] except StopIteration: directories = [] return directories def create_junction(directory, junctio...
mit
Python
0709f631cbf6c28e30641367830bc4498bb59022
Add mean and std parameters to white_noise
kohr-h/odl,odlgroup/odl,odlgroup/odl,aringh/odl,kohr-h/odl,aringh/odl
odl/phantom/noise.py
odl/phantom/noise.py
# Copyright 2014-2016 The ODL development group # # This file is part of ODL. # # ODL is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
# Copyright 2014-2016 The ODL development group # # This file is part of ODL. # # ODL is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
mpl-2.0
Python
a55b9d64571429d2bd205e5b23b2bd821d6022fe
simplify dask.array to numpy route
blaze/odo,alexmojaki/odo,cpcloud/odo,cowlicks/odo,cowlicks/odo,Dannnno/odo,ContinuumIO/odo,Dannnno/odo,ContinuumIO/odo,ywang007/odo,quantopian/odo,quantopian/odo,alexmojaki/odo,ywang007/odo,blaze/odo,cpcloud/odo
odo/backends/dask.py
odo/backends/dask.py
from __future__ import absolute_import, division, print_function from collections import Iterator import numpy as np from toolz import keyfilter from datashape.dispatch import dispatch from datashape import DataShape from dask.array.core import Array, from_array from dask.bag.core import Bag import dask.bag as db fro...
from __future__ import absolute_import, division, print_function from collections import Iterator import numpy as np from toolz import keyfilter from datashape.dispatch import dispatch from datashape import DataShape from dask.array.core import rec_concatenate, Array, get, from_array from dask.bag.core import Bag imp...
bsd-3-clause
Python
67a4422f1bcbb91c98b8edea7788a7f4deffd47d
Add logs to proxy.py. Caleydo/targid2#68
Caleydo/ordino,datavisyn/tdp_core,datavisyn/tdp_core,datavisyn/tdp_core,Caleydo/ordino,Caleydo/ordino,datavisyn/tdp_core,Caleydo/ordino
proxy.py
proxy.py
__author__ = 'Samuel Gratzl' from flask import Flask, Response, request, abort import requests app = Flask(__name__) def _to_site_url(site): import caleydo_server.plugin proxy_defs = caleydo_server.plugin.list('targid_proxy') for p in proxy_defs: if p.id == site: return p.url.format(**request.args.t...
__author__ = 'Samuel Gratzl' from flask import Flask, Response, request, abort import requests app = Flask(__name__) def _to_site_url(site): import caleydo_server.plugin proxy_defs = caleydo_server.plugin.list('targid_proxy') for p in proxy_defs: if p.id == site: return p.url.format(**request.args.t...
mpl-2.0
Python
ee955d9a327af0cf68b8602d93ebc130e2e4f81b
Update capture_image.py
duboviy/study_languages
image_translate/capture_image.py
image_translate/capture_image.py
import argparse def take_selfie_using_pygame(image_filename): # to capture a screen from camera, need to install pygame import pygame import pygame.camera pygame.camera.init() #Camera detected or not if not pygame.camera.list_cameras(): raise RuntimeError("No camera detected. Can't t...
import argparse def take_selfie_using_pygame(image_filename): # to capture a screen from camera, need to install pygame import pygame import pygame.camera pygame.camera.init() #Camera detected or not if not pygame.camera.list_cameras(): raise RuntimeError("No camera detected. Can't t...
mit
Python
f9aafeb310b391b1e07ae0cf4353ddfea393a466
switch to server_envvar
NVBots/ResinDemo
src/run.py
src/run.py
from server_envvar import app app.run('0.0.0.0', port=80)
from server import app app.run('0.0.0.0', port=80)
mit
Python
19374047dd8a92a829e4c57332e1ce61bdb85ad4
Set version in init
pritunl/pritunl-node,pritunl/pritunl-node
pritunl_node/__init__.py
pritunl_node/__init__.py
from constants import * __title__ = APP_NAME __version__ = '0.10.1' __author__ = 'Zachary Huff' __license__ = 'AGPL' __copyright__ = 'Copyright 2013 Zachary Huff' from app_server import run_server
from constants import * __title__ = APP_NAME __version__ = '0.0.0' __author__ = 'Zachary Huff' __license__ = 'AGPL' __copyright__ = 'Copyright 2013 Zachary Huff' from app_server import run_server
agpl-3.0
Python
93650252e195b036698ded99d271d6249f0bd80f
Make sure epoch return type is int
googleinterns/sgonks,googleinterns/sgonks,googleinterns/sgonks,googleinterns/sgonks
project/scripts/dates.py
project/scripts/dates.py
# For now I am assuming the investment date will be returned from the db # as a string yyyy-mm-dd, representing the day the trend was purchased in UTC time #!/usr/bin/env python3 from datetime import datetime, timedelta import pytz def get_start_times(date): """ date: an epoch integer representing the date...
# For now I am assuming the investment date will be returned from the db # as a string yyyy-mm-dd, representing the day the trend was purchased in UTC time #!/usr/bin/env python3 from datetime import datetime, timedelta import pytz def get_start_times(date): """ date: an epoch integer representing the date...
apache-2.0
Python
e8787bca0373ce8d1cf8ac3a9930d63377b635d3
Fix flake8 F401 warnings
ryu22e/django_template,ryu22e/django_template
project_name/__init__.py
project_name/__init__.py
# This will make sure the app is always imported when # Django starts so that shared_task will use this app. from .celery import app as celery_app # NOQA
# This will make sure the app is always imported when # Django starts so that shared_task will use this app. from .celery import app as celery_app
mit
Python
753a0e06c203feb74769b997c3659af2bcc04032
Bump magenta.music version
magenta/magenta,magenta/magenta
magenta-music/magenta/music/version.py
magenta-music/magenta/music/version.py
# Copyright 2019 The Magenta 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 law or agreed to in ...
# Copyright 2019 The Magenta 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 law or agreed to in ...
apache-2.0
Python
c3f81a479cfc041f711683f96c84014450a186f4
exclude geolocation and user from admin
huguesmayolle/famille,huguesmayolle/famille
famille/admin/models.py
famille/admin/models.py
from django.contrib import admin from django.contrib.flatpages.admin import FlatPageAdmin from django.contrib.flatpages.models import FlatPage from famille.admin import forms from famille.models import Prestataire, Famille from famille.utils import admin_display class TinyMCEFlatPageAdmin(FlatPageAdmin): form = ...
from django.contrib import admin from django.contrib.flatpages.admin import FlatPageAdmin from django.contrib.flatpages.models import FlatPage from famille.admin import forms from famille.models import Prestataire, Famille from famille.utils import admin_display class TinyMCEFlatPageAdmin(FlatPageAdmin): form = ...
apache-2.0
Python
c3fdb62ff099bde7f86bbc65bd7dc132bc8c69af
Remove redundant current node
bowen0701/algorithms_data_structures
lc0144_binary_tree_preorder_traversal.py
lc0144_binary_tree_preorder_traversal.py
"""Leetcode 144. Binary Tree Preorder Traversal Medium URL: https://leetcode.com/problems/binary-tree-preorder-traversal/ Given a binary tree, return the preorder traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,2,3] Follow up: Recursive solution is trivial, could...
"""Leetcode 144. Binary Tree Preorder Traversal Medium URL: https://leetcode.com/problems/binary-tree-preorder-traversal/ Given a binary tree, return the preorder traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,2,3] Follow up: Recursive solution is trivial, could...
bsd-2-clause
Python
16086463bf5dd4b78270340b44c1703e089cdb12
Update models.py
overcastsoftware/wagtail-tinify
wagtail_tinify/models.py
wagtail_tinify/models.py
from __future__ import unicode_literals import os, threading, tinify from urlparse import urlparse from django.db.models.signals import post_save from django.templatetags.static import StaticNode from django.conf import settings aws_key_id = os.getenv('AWS_ACCESS_KEY_ID') aws_secret = os.getenv('AWS_SECRET_ACCESS_KEY...
from __future__ import unicode_literals import os, threading, tinify from urlparse import urlparse from django.db.models.signals import post_save from django.templatetags.static import StaticNode from django.conf import settings aws_key_id = os.getenv('AWS_ACCESS_KEY_ID') aws_secret = os.getenv('AWS_SECRET_ACCESS_KEY...
mit
Python
8d692622c9466fcf3d7d4c1c190c7aaf84267c1e
Tweak monkeypatch code
msabramo/requests-unixsocket,esben/requests-unixsocket
requests_unixsocket/__init__.py
requests_unixsocket/__init__.py
import requests import sys from .adapters import UnixAdapter __all__ = ['monkeypatch', 'Session'] DEFAULT_SCHEME = 'http+unix://' class Session(requests.Session): def __init__(self, url_scheme=DEFAULT_SCHEME, *args, **kwargs): super(Session, self).__init__(*args, **kwargs) self.mount(url_scheme...
import requests from .adapters import UnixAdapter __all__ = ['monkeypatch', 'Session', 'UnixAdapter'] DEFAULT_SCHEME = 'http+unix://' class Session(requests.Session): def __init__(self, url_scheme=DEFAULT_SCHEME, *args, **kwargs): super(Session, self).__init__(*args, **kwargs) self.mount(url_sc...
apache-2.0
Python
f335866c7dc69527280ace857124eb8472ffddc2
support new camera protocol
flux3dp/fluxghost,flux3dp/fluxghost,flux3dp/fluxghost,flux3dp/fluxghost
fluxghost/api/camera.py
fluxghost/api/camera.py
import logging from fluxclient.utils.version import StrictVersion from .control_base import control_base_mixin CRITICAL_VERSION = StrictVersion("1.3a1") logger = logging.getLogger("API.CAMERA") """ Control printer Javascript Example: ws = new WebSocket("ws://localhost:8000/ws/control/RLFPAPI7E8KXG64KG5NOWWY3T");...
import logging from .control_base import control_base_mixin logger = logging.getLogger("API.CAMERA") """ Control printer Javascript Example: ws = new WebSocket("ws://localhost:8000/ws/control/RLFPAPI7E8KXG64KG5NOWWY3T"); ws.onmessage = function(v) { console.log(v.data);} ws.onclose = function(v) { console.log("C...
agpl-3.0
Python
53f2f96ab2879c99a3605c727a6fd38805fd773b
Fix arg instantiation
aurule/rolldembones
rolldembones.py
rolldembones.py
#!/usr/bin/python3 import argparse import dice def main(): roller = dice.Roller(args) if args.target is None: # repeat as requested repeats = args.repeats or 1 for repeat in range(repeats): roller.do_roll() for result in roller: if i...
#!/usr/bin/python3 import argparse import dice def main(): roller = dice.Roller(args) if args.target is None: # repeat as requested repeats = args.repeats or 1 for repeat in range(repeats): roller.do_roll() print(roller.get_results()) fo...
mit
Python
5621eaa5dd145c2d3f9a4101b13ab3e32968245a
Split artfiles script into functions
innogames/igcollect
src/artfiles.py
src/artfiles.py
#!/usr/bin/env python # # igcollect - Artfiles hosting # # Copyright (c) 2016, InnoGames GmbH # from time import time from urllib import urlopen from argparse import ArgumentParser def parse_args(): parser = ArgumentParser() parser.add_argument( "-u", "--user", dest="http_user", ...
#!/usr/bin/env python # # igcollect - Artfiles hosting # # Copyright (c) 2016, InnoGames GmbH # import time import sys import urllib import argparse from socket import gethostname parser = argparse.ArgumentParser() parser.add_argument( "-u", "--user", dest="http_user", type=str, required=True, ...
mit
Python
5b6a920da4f634f7de2480660b359eb3d1f130d0
add list columns to admin site
D8TM/railtracker,D8TM/railtracker,D8TM/railtracker
mapfeed/admin.py
mapfeed/admin.py
from mapfeed.models import MapPath, MapCity, MapLine, MapStation, Incident from django.contrib import admin class MapCityAdmin(admin.ModelAdmin): list_display = ('city_name', 'rail_name') class MapLineAdmin(admin.ModelAdmin): list_display = ('line_name', 'line_code') class MapPathAdmin(admin.ModelAdmin): ...
from mapfeed.models import MapPath, MapCity, MapLine, MapStation, Incident from django.contrib import admin admin.site.register(MapCity) admin.site.register(MapLine) admin.site.register(MapPath) admin.site.register(MapStation) admin.site.register(Incident)
apache-2.0
Python
c35334cba5d5411519cdfd53ed66eb25cc610e7e
Set unusable password for deleted users
fin/froide,stefanw/froide,fin/froide,fin/froide,stefanw/froide,stefanw/froide,stefanw/froide,stefanw/froide,CodeforHawaii/froide,fin/froide,CodeforHawaii/froide,CodeforHawaii/froide,CodeforHawaii/froide,CodeforHawaii/froide
froide/account/utils.py
froide/account/utils.py
import datetime from django.utils import timezone from django.contrib.sessions.models import Session def merge_accounts(old_user, new_user): from froide.foirequest.models import (FoiRequest, PublicBodySuggestion, FoiMessage, FoiEvent) from froide.foirequestfollower.models import FoiRequestFollowe...
import datetime from django.utils import timezone from django.contrib.sessions.models import Session def merge_accounts(old_user, new_user): from froide.foirequest.models import (FoiRequest, PublicBodySuggestion, FoiMessage, FoiEvent) from froide.foirequestfollower.models import FoiRequestFollowe...
mit
Python
af2ac1b0d1b01187422f0332fdec5fc4a95f57bb
Simplify code a little bit Remove useexisting, it's not necessary since this is the first table (and deprecated in latest sqlalchemy) Remove InnoDB declaration, it's taken care of elsewhere
rackerlabs/Tempo
tempo/db/migrate_repo/versions/001_add_tasks_table.py
tempo/db/migrate_repo/versions/001_add_tasks_table.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Rackspace # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licen...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Rackspace # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licen...
apache-2.0
Python
0eb6d8b2d20fa454da42afcf236032b9fd191a1d
Add (future) lab endpoint.
kernelci/kernelci-frontend,kernelci/kernelci-frontend,kernelci/kernelci-frontend,kernelci/kernelci-frontend
app/dashboard/default_settings.py
app/dashboard/default_settings.py
# Copyright (C) 2014 Linaro Ltd. # # 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 3 of the # License, or (at your option) any later version. # # This program is distribute...
# Copyright (C) 2014 Linaro Ltd. # # 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 3 of the # License, or (at your option) any later version. # # This program is distribute...
lgpl-2.1
Python
0b3e6afb679fe34cbdbcb3a47cda18e4deeeaa5f
Make Sponsor the scope_logic for the GSoC timeline model.
SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange
app/gsoc/logic/models/timeline.py
app/gsoc/logic/models/timeline.py
#!/usr/bin/python2.5 # # Copyright 2008 the Melange 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...
#!/usr/bin/python2.5 # # Copyright 2008 the Melange 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
d9e5f4a9273a6b61ad54f3ebf38adf6c66681d5d
Add `as_group` parameter.
liwushuo/fapistrano
fapistrano/utils.py
fapistrano/utils.py
# -*- coding: utf-8 -*- from functools import wraps from fabric.api import env, show, hide, abort from fabric.colors import green, red, white def red_alert(msg, bold=True): print red('===>', bold=bold), white(msg, bold=bold) def green_alert(msg, bold=True): print green('===>', bold=bold), white(msg, bold=...
# -*- coding: utf-8 -*- from functools import wraps from fabric.api import env, show, hide, abort from fabric.colors import green, red, white def red_alert(msg, bold=True): print red('===>', bold=bold), white(msg, bold=bold) def green_alert(msg, bold=True): print green('===>', bold=bold), white(msg, bold=...
mit
Python
f3745f13946509324f6ad9907b8be8a1c5669a68
bump repo version
omry/omegaconf
omegaconf/version.py
omegaconf/version.py
import sys # pragma: no cover __version__ = "2.0.0rc28" msg = """OmegaConf 2.0 and above is compatible with Python 3.6 and newer. You have the following options: 1. Upgrade to Python 3.6 or newer. This is highly recommended. new features will not be added to OmegaConf 1.4. 2. Continue using OmegaConf 1.4: You...
import sys # pragma: no cover __version__ = "2.0.0rc27" msg = """OmegaConf 2.0 and above is compatible with Python 3.6 and newer. You have the following options: 1. Upgrade to Python 3.6 or newer. This is highly recommended. new features will not be added to OmegaConf 1.4. 2. Continue using OmegaConf 1.4: You...
bsd-3-clause
Python
bac2d456991d915324adfaee1670a49a40a1d907
bump repo version
omry/omegaconf
omegaconf/version.py
omegaconf/version.py
import sys # pragma: no cover __version__ = "2.1.0dev4" msg = """OmegaConf 2.0 and above is compatible with Python 3.6 and newer. You have the following options: 1. Upgrade to Python 3.6 or newer. This is highly recommended. new features will not be added to OmegaConf 1.4. 2. Continue using OmegaConf 1.4: You...
import sys # pragma: no cover __version__ = "2.1.0dev3" msg = """OmegaConf 2.0 and above is compatible with Python 3.6 and newer. You have the following options: 1. Upgrade to Python 3.6 or newer. This is highly recommended. new features will not be added to OmegaConf 1.4. 2. Continue using OmegaConf 1.4: You...
bsd-3-clause
Python
ddd582195b52e3d1d617615ae7915220aca4d211
fix stupidhead
braams/shtoom,braams/shtoom,braams/shtoom
shtoom/doug/source.py
shtoom/doug/source.py
from shtoom.doug.events import * class Source(object): "A Source object is a source and sink of audio data" def __init__(self): self.app = None def getVoiceApp(self): return self.app class SilenceSource(Source): "A SilenceSource generates silence and eats all audio given to it" de...
class Source(object): "A Source object is a source and sink of audio data" def __init__(self): self.app = None def getVoiceApp(self): return self.app class SilenceSource(Source): "A SilenceSource generates silence and eats all audio given to it" def __init__(self): super(Si...
lgpl-2.1
Python
0df5161adb20f606aa597f24aad2760f8cdd1954
Disable Flask reloader
onyb/dune
runapiserver.py
runapiserver.py
from core.api import API from core.exceptions import * from core.utils.Colorize import Colorize from core.utils.check_sanity import * def main(): # Order of checks is important checks = [ ( check_environment, 'Checking current shell environment', OPAMConfigurationError ), (...
from core.api import API from core.exceptions import * from core.utils.Colorize import Colorize from core.utils.check_sanity import * def main(): # Order of checks is important checks = [ ( check_environment, 'Checking current shell environment', OPAMConfigurationError ), (...
apache-2.0
Python
95ea4021cc26a1a5c7423335d33e845cab221ed2
modify the ci generation script
tz70s/pro-sy-kuo,tz70s/pro-sy-kuo,tz70s/pro-sy-kuo,tz70s/pro-sy-kuo
scripts/sgen.py
scripts/sgen.py
#!/usr/bin/python # Generate original static file to another with new prefix # ./sgen index.html old_prefix static_index.html new_prefix import sys from os import walk, path, environ # File lists # The two file lists should be aligned. root = environ['TRAVIS_BUILD_DIR'] files = [] for (dirpath, dirname, filenames)...
#!/usr/bin/python # Generate original static file to another with new prefix # ./sgen index.html old_prefix static_index.html new_prefix import sys from os import walk, path, environ # File lists # The two file lists should be aligned. root = environ['TRAVIS_BUILD_DIR'] files = [] for (dirpath, dirname, filenames)...
mit
Python
933d6bab53fdff1e3263471c0d8876f43a019d42
remove django-admin entirely, using only local admin site
mprefer/findingaids,mprefer/findingaids,emory-libraries/findingaids,emory-libraries/findingaids
findingaids/urls.py
findingaids/urls.py
from django.conf.urls.defaults import * from django.conf import settings urlpatterns = patterns('', url(r'^admin/', include('findingaids.admin.urls', namespace='admin')), url(r'^$', 'findinga...
from django.conf.urls.defaults import * from django.conf import settings from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # for now, everything is in main app url(r'^admin/', include('findingaids.admin.urls', namespace='admin')), ...
apache-2.0
Python
3f8a30c1b3d2dd8e97e24caa11cbd7471101dbdb
Fix wsgi
grouan/udata,jphnoel/udata,jphnoel/udata,jphnoel/udata,davidbgk/udata,davidbgk/udata,etalab/udata,opendatateam/udata,grouan/udata,opendatateam/udata,opendatateam/udata,davidbgk/udata,etalab/udata,grouan/udata,etalab/udata
udata/wsgi.py
udata/wsgi.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from udata.app import standalone, create_app app = standalone(create_app())
# -*- coding: utf-8 -*- from __future__ import unicode_literals from udata.app import standalone, create_app application = standalone(create_app())
agpl-3.0
Python
6b7169e6b7f113ca920d379c9f4a199763caff89
Prepare v2.0.52.dev
Danfocus/Flexget,LynxyssCZ/Flexget,dsemi/Flexget,oxc/Flexget,ianstalk/Flexget,LynxyssCZ/Flexget,tarzasai/Flexget,drwyrm/Flexget,ianstalk/Flexget,OmgOhnoes/Flexget,jawilson/Flexget,Flexget/Flexget,JorisDeRieck/Flexget,jawilson/Flexget,tobinjt/Flexget,OmgOhnoes/Flexget,oxc/Flexget,Flexget/Flexget,ianstalk/Flexget,gazpach...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
795faa318c5ea3ea9f794f034a190dc8a8a70e7e
Prepare v2.6.1.dev
qk4l/Flexget,ianstalk/Flexget,malkavi/Flexget,jawilson/Flexget,drwyrm/Flexget,Flexget/Flexget,Danfocus/Flexget,JorisDeRieck/Flexget,drwyrm/Flexget,jawilson/Flexget,LynxyssCZ/Flexget,OmgOhnoes/Flexget,OmgOhnoes/Flexget,tobinjt/Flexget,malkavi/Flexget,drwyrm/Flexget,qk4l/Flexget,sean797/Flexget,JorisDeRieck/Flexget,poulp...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
20f54ffb80e18e9e8d1bc86e92eb40b530bb5151
Update version
the01/python-flotils
flotils/__init__.py
flotils/__init__.py
# -*- coding: UTF-8 -*- """ An utility package """ __author__ = "the01" __email__ = "jungflor@gmail.com" __copyright__ = "Copyright (C) 2013-16, Florian JUNG" __license__ = "MIT" __version__ = "0.3.2b0" __date__ = "2016-11-25" import logging from .loadable import Loadable, loadJSON, saveJSON, loadJSONFile, saveJSONF...
# -*- coding: UTF-8 -*- """ An utility package """ __author__ = "the01" __email__ = "jungflor@gmail.com" __copyright__ = "Copyright (C) 2013-16, Florian JUNG" __license__ = "MIT" __version__ = "0.3.2a0" __date__ = "2016-08-14" import logging from .loadable import Loadable, loadJSON, saveJSON, loadJSONFile, saveJSONF...
mit
Python
2d47a27cfc4cc5146b571c703564434034c84856
Fix course-rankings when you have emty courses
rcoup/yachter,rcoup/yachter
yachter/courses/views.py
yachter/courses/views.py
import StringIO from django.contrib.gis import admin from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext from django.utils import simplejson from django import forms from django.http import HttpResponse from yachter.courses.models import Course from yachter.co...
import StringIO from django.contrib.gis import admin from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext from django.utils import simplejson from django import forms from django.http import HttpResponse from yachter.courses.models import Course from yachter.co...
apache-2.0
Python
75ea28622a65ea8f75bb84a8e6506d2ab5dd020f
create log folder in not exist.
GeoscienceAustralia/sifra
sifra/logger.py
sifra/logger.py
import datetime import logging import os class Logger(): def __init__(self): # formate to display log messages self.logFormatter = logging.Formatter("%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s] %(message)s") # define logger object to reference in modules and display logs ...
import datetime import logging import os class Logger(): def __init__(self): # formate to display log messages self.logFormatter = logging.Formatter("%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s] %(message)s") # define logger object to reference in modules and display logs ...
apache-2.0
Python
4a51bbc0cf7cfd5b18bfa2394960d8fc9d9f6aac
augment version number
SiftScience/sift-python
sift/version.py
sift/version.py
VERSION = '1.1.2.6' API_VERSION = '203'
VERSION = '1.1.2.5' API_VERSION = '203'
mit
Python
e9ae6b7f92ee0a4585adc11e695cc15cbe425e23
Remove root that wasn't used.
faassen/morepath,morepath/morepath,taschini/morepath
morepath/app.py
morepath/app.py
from .interfaces import IRoot, IApp from .publish import publish from .request import Request from .traject import Traject from comparch import ClassRegistry, Lookup, ChainClassLookup known_apps = {} class App(IApp, ClassRegistry): def __init__(self, name='', parent=None): super(App, self).__init__() ...
from .interfaces import IRoot, IApp from .publish import publish from .request import Request from .traject import Traject from comparch import ClassRegistry, Lookup, ChainClassLookup known_apps = {} class App(IApp, ClassRegistry): def __init__(self, name='', parent=None): super(App, self).__init__() ...
bsd-3-clause
Python
a7938ed9ec814fa9cf53272ceb65e84d11d50dc1
Fix s3 url regex to ensure path-based bucket and key does not catch.
william-richard/moto,kefo/moto,botify-labs/moto,2rs2ts/moto,dbfr3qs/moto,im-auld/moto,william-richard/moto,william-richard/moto,Affirm/moto,kefo/moto,botify-labs/moto,Brett55/moto,ZuluPro/moto,ZuluPro/moto,okomestudio/moto,spulec/moto,whummer/moto,william-richard/moto,kefo/moto,kefo/moto,ZuluPro/moto,dbfr3qs/moto,heddl...
moto/s3/urls.py
moto/s3/urls.py
from __future__ import unicode_literals from .responses import S3ResponseInstance url_bases = [ "https?://s3(.*).amazonaws.com", "https?://(?P<bucket_name>[a-zA-Z0-9\-_.]*)\.?s3(.*).amazonaws.com" ] url_paths = { # subdomain bucket '{0}/$': S3ResponseInstance.bucket_response, # subdomain key of ...
from __future__ import unicode_literals from moto.compat import OrderedDict from .responses import S3ResponseInstance url_bases = [ "https?://s3(.*).amazonaws.com", "https?://(?P<bucket_name>[a-zA-Z0-9\-_.]*)\.?s3(.*).amazonaws.com" ] url_paths = OrderedDict([ # subdomain bucket ('{0}/$', S3ResponseI...
apache-2.0
Python
429c2548835aef1cb1655229ee11f42ccf189bd1
Add an item to the shopping list.
adityatrivedi/shopping-list
shopping_list.py
shopping_list.py
shopping_list = [] def show_help(): print("What should we pick up at the store?") print("Enter DONE to stop. Enter HELP for this help. Enter SHOW to see your current list.") def add_to_list(item): shopping_list.append(item) print("Added! List has {} items.".format(len(shopping_list)))
shopping_list = [] def show_help(): print("What should we pick up at the store?") print("Enter DONE to stop. Enter HELP for this help. Enter SHOW to see your current list.")
mit
Python
afe2efbe5dcbda99438dffc958787f14c9516a2e
include the date in the fetched fields to prevent massive amounts of queries
crateio/crate.web,crateio/crate.web
crate_project/apps/packages/stats/views.py
crate_project/apps/packages/stats/views.py
import collections import json import time import isoweek from django.http import HttpResponse from django.views.decorators.cache import cache_page, cache_control from django.shortcuts import get_object_or_404 from packages.models import Package, Release, DownloadDelta def fetch_stats(package): releases = list...
import collections import json import time import isoweek from django.http import HttpResponse from django.views.decorators.cache import cache_page, cache_control from django.shortcuts import get_object_or_404 from packages.models import Package, Release, DownloadDelta def fetch_stats(package): releases = list...
bsd-2-clause
Python
4a331e8e0e5ec77db38878e6762ef64a16f25d61
add RingCube to main namespace
michaelaye/pyciss
pyciss/__init__.py
pyciss/__init__.py
__version__ = "0.11.0" import logging # this prevents messages sent to sys.stderr if no logging was configured on application-side logging.getLogger("pyciss").addHandler(logging.NullHandler()) from .ringcube import RingCube
__version__ = '0.11.0' import logging # this prevents messages sent to sys.stderr if no logging was configured on application-side logging.getLogger('pyciss').addHandler(logging.NullHandler())
isc
Python
003121b5a7a1b47bc1d67d7fbdde95442613fad1
Bump version to 0.1.8.
foliant-docs/foliant
foliant/__init__.py
foliant/__init__.py
""" **Foliant** is a documentation generator that builds PDF, Docx, and TeX output from a single Markdown source. It also uploads Docx files to Google Drive as Google Documents. """ __name__ = "foliant" __description__ = "Documentation generator that builds PDF, Docx, and TeX from a single Markdown source." __author__...
""" **Foliant** is a documentation generator that builds PDF, Docx, and TeX output from a single Markdown source. It also uploads Docx files to Google Drive as Google Documents. """ __name__ = "foliant" __description__ = "Documentation generator that builds PDF, Docx, and TeX from a single Markdown source." __author__...
mit
Python
bee6043a2c770bbaa3ffde7530d8be87c9ca468a
Bump version to 0.3.8.
foliant-docs/foliant
foliant/__init__.py
foliant/__init__.py
""" **Foliant** is a documentation generator that builds PDF, Docx, and TeX output from a single Markdown source. It also uploads Docx files to Google Drive as Google Documents. """ __name__ = "foliant" __description__ = "Documentation generator that builds PDF, Docx, and TeX from\ a single Markdown source." __aut...
""" **Foliant** is a documentation generator that builds PDF, Docx, and TeX output from a single Markdown source. It also uploads Docx files to Google Drive as Google Documents. """ __name__ = "foliant" __description__ = "Documentation generator that builds PDF, Docx, and TeX from\ a single Markdown source." __aut...
mit
Python
39ce4e74a6b7115a35260fa2722ace1792cb1780
Remove debug output and pycodestyle
rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank
python/count_triplets.py
python/count_triplets.py
#!/bin/python3 import math import os import random import re import sys from collections import Counter def countTriplets(arr, r): potential_triplets_with_middle = Counter() potential_triplets_with_end = Counter() total_triplets = 0 for num in arr: # num completed potential_triplets_with_end[...
#!/bin/python3 import math import os import random import re import sys from collections import Counter def countTriplets(arr, r): potential_triplets_with_middle = Counter() potential_triplets_with_end = Counter() total_triplets = 0 for num in arr: # num completed potential_triplets_with_end[n...
mit
Python
3191eee29bc9677968de42cd94e1ba5beba3d9ad
Update info.py
DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe,DistributedSystemsGroup/zoe
zoe_api/rest_api/info.py
zoe_api/rest_api/info.py
# Copyright (c) 2016, Daniele Venzano # # 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 w...
# Copyright (c) 2016, Daniele Venzano # # 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 w...
apache-2.0
Python
087454823bc9e7af223196f65fac8dfa71082c28
move arg validations outside of helper
mfraezz/modular-file-renderer,TomBaxter/modular-file-renderer,CenterForOpenScience/modular-file-renderer,CenterForOpenScience/modular-file-renderer,AddisonSchiller/modular-file-renderer,felliott/modular-file-renderer,erinspace/modular-file-renderer,haoyuchen1992/modular-file-renderer,rdhyee/modular-file-renderer,Center...
mfr/installer.py
mfr/installer.py
#!/usr/bin/env python import os import pip import sys import argparse HERE = os.path.dirname(os.path.abspath(__file__)) ROOT_PATH = os.path.join(HERE, "..") def pip_install(path, filename): """Use pip to install from a requirements file :param path: location of file :param filename: name of requirements ...
#!/usr/bin/env python import os import pip import sys import argparse HERE = os.path.dirname(os.path.abspath(__file__)) ROOT_PATH = os.path.join(HERE, "..") def pip_install(path, filename): """Use pip to install from a requirements file :param path: location of file :param filename: name of requirements ...
apache-2.0
Python
41513ead103bb03875b9aea4648804ddfeabe28d
create slug source (prepopulated fields) based name
jeanmask/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,jeanmask/opps,williamroot/opps,opps/opps,opps/opps,YACOWS/opps,YACOWS/opps,opps/opps,opps/opps,williamroot/opps,jeanmask/opps,williamroot/opps
opps/core/admin/source.py
opps/core/admin/source.py
# -*- coding: utf-8 -*- from django.contrib import admin from opps.core.models import Source class SourceAdmin(admin.ModelAdmin): prepopulated_fields = {"slug": ("name",)} admin.site.register(Source, SourceAdmin)
# -*- coding: utf-8 -*- from django.contrib import admin from opps.core.models import Source class SourceAdmin(admin.ModelAdmin): pass admin.site.register(Source, SourceAdmin)
mit
Python
e8b547379fcc6fecd61f203f901082cddd248ba7
Fix nn.mlmc.util
raviqqe/tensorflow-extenteten,raviqqe/tensorflow-extenteten
nn/mlmc/util.py
nn/mlmc/util.py
import tensorflow as tf from ..util import static_shape, static_rank def split_by_labels(tensor, num_of_labels): assert len(tensor.get_shape()) >= 2 #assert tensor.get_shape()[0] == (batch size) #assert tensor.get_shape()[1] == (values concatenated by labels) return tf.split(1, num_of_labels, tensor) def...
import tensorflow as tf def split_by_labels(tensor, num_of_labels): assert len(tensor.get_shape()) >= 2 #assert tensor.get_shape()[0] == (batch size) #assert tensor.get_shape()[1] == (values concatenated by labels) return tf.split(1, num_of_labels, tensor) def concat_by_labels(tensors): assert len(tenso...
unlicense
Python
47a7af06298f869db035fab0d80271a2b35f07fd
Update LDA.py
mostafa-mahmoud/sahwaka,mostafa-mahmoud/HyPRec
lib/LDA.py
lib/LDA.py
#!/usr/bin/env python import numpy from lib.content_based import ContentBased from sklearn.decomposition import LatentDirichletAllocation from sklearn.feature_extraction.text import CountVectorizer class LDARecommender(ContentBased): def __init__(self, abstracts, n_factors, n_iterations=5): self.n_factors...
#!/usr/bin/env python import numpy from lib.content_based import ContentBased from sklearn.decomposition import LatentDirichletAllocation from sklearn.feature_extraction.text import CountVectorizer class LDARecommender(ContentBased): def __init__(self, abstracts, n_factors, n_iterations=5): self.n_factors...
apache-2.0
Python
f3442db3f0155a32c8bc0ca3bc943d4b0039897f
Fix comments for metrics_to_scalars (#8782)
williamFalcon/pytorch-lightning,williamFalcon/pytorch-lightning
pytorch_lightning/utilities/metrics.py
pytorch_lightning/utilities/metrics.py
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
apache-2.0
Python
db6804ecaca37b10d470e785b6e8c5f2a809b2ee
Fix lint.
StackStorm/st2,pixelrebel/st2,emedvedev/st2,nzlosh/st2,lakshmi-kannan/st2,emedvedev/st2,peak6/st2,peak6/st2,lakshmi-kannan/st2,Plexxi/st2,StackStorm/st2,nzlosh/st2,tonybaloney/st2,tonybaloney/st2,StackStorm/st2,emedvedev/st2,Plexxi/st2,punalpatel/st2,Plexxi/st2,punalpatel/st2,punalpatel/st2,lakshmi-kannan/st2,nzlosh/st...
st2api/tests/unit/controllers/v1/test_jsexpose_decorator.py
st2api/tests/unit/controllers/v1/test_jsexpose_decorator.py
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
apache-2.0
Python
5e07338ada4e36f3feb4d43a13c02160a00ced01
Update socket_server.py
valdergallo/controle_de_estacionamento_pyserial
socket_server.py
socket_server.py
# coding=utf-8 import serial import sqlite3 # carrega o banco de dados SQLite con = sqlite3.connect('site.db') def update_content(con, line_value): # remove Linhas 1 do texto da serial vagas = line_value.replace('Linha 1: ', '').strip() # remove Linhas 2 do texto da serial vagas = vagas.replace('Lin...
# coding=utf-8 import serial import sqlite3 # carrega o banco de dados SQLite con = sqlite3.connect('site.db') def update_content(con, line_value): # remove Linhas 1 do texto da serial vagas = line_value.replace('Linha 1: ', '').strip() # remove Linhas 2 do texto da serial vagas = vagas.replace('Lin...
mit
Python
800e38adb960f00fb7ed89c48937f23f6175656a
fix mongodb
shmiko/big-fat-python-tests,shmiko/big-fat-python-tests
mongodb_query.py
mongodb_query.py
db.schedule.find("bookings" : {"$elemMatch" : { "date" : new ISODate("2016-08-09T10:00:00.000Z")}}) >> { "bookings" : [ { "event" : "MongoDB On Site Interveiw", "date": ISODate("2016-08-09T10:00:00.000Z") } ] } db.schedule.insert( { "bookings" : [ { "event" : "MongoDB On Site Interveiw", ...
db.schedule.find("bookings" : {"$elemMatch" : { "date" : new ISODate("2016-08-09T10:00:00.000Z")}}) >> { "bookings" : [ { "event" : "MongoDB On Site Interveiw", "date": ISODate("2016-08-09T10:00:00.000Z") } ] } db.schedule.insert( { "bookings" : [ { "event" : "MongoDB On Site Interveiw", ...
apache-2.0
Python
87a74d2bf61e0190dfd9e2996023a1feca43522a
rename quantum circuit constructor args
cjwfuller/quantum-circuits
quantum_circuit.py
quantum_circuit.py
import numpy as np # TODO having a conceptual circuit and quantum circuit is unnecessary - refactor class QuantumCircuit: """Quantum Circuit. Low-level 2D array of complex-valued quantum gates and associated operations """ def __init__(self, num_qubits, num_steps): self.num_bases = pow(2, ...
import numpy as np # TODO having a conceptual circuit and quantum circuit is unnecessary - refactor class QuantumCircuit: """Quantum Circuit. Low-level 2D array of complex-valued quantum gates and associated operations """ def __init__(self, num_qubits, num_steps): size = pow(2, num_qubits...
mit
Python
bc77c07740f9a4a33cbd0f6c1cef46c1704b0b42
Add more functional tests (thanks Moof); Clarify failing test docs
python-mechanize/mechanize,python-mechanize/mechanize
functional_tests.py
functional_tests.py
#!/usr/bin/env python import os from unittest import TestCase import mechanize def sanepathname2url(path): import urllib urlpath = urllib.pathname2url(path) if os.name == "nt" and urlpath.startswith("///"): urlpath = urlpath[2:] # XXX don't ask me about the mac... return urlpath class Si...
#!/usr/bin/env python from unittest import TestCase import mechanize class ResponseTests(TestCase): def test_close_pickle_load(self): print ("This test is expected to fail unless Python standard library " "patch http://python.org/sf/1144636 has been applied") import pickle ...
bsd-3-clause
Python
1b653e6aea4da2cd0b6b323b24aa60a4852c3966
Verify `test.support` is present
jjhelmus/python-feedstock,jjhelmus/python-feedstock
recipe/run_test.py
recipe/run_test.py
import platform import sys import subprocess armv6l = bool(platform.machine() == 'armv6l') armv7l = bool(platform.machine() == 'armv7l') ppc64le = bool(platform.machine() == 'ppc64le') if sys.platform == 'darwin': osx105 = b'10.5.' in subprocess.check_output('sw_vers') else: osx105 = False print('sys.version:...
import platform import sys import subprocess armv6l = bool(platform.machine() == 'armv6l') armv7l = bool(platform.machine() == 'armv7l') ppc64le = bool(platform.machine() == 'ppc64le') if sys.platform == 'darwin': osx105 = b'10.5.' in subprocess.check_output('sw_vers') else: osx105 = False print('sys.version:...
bsd-3-clause
Python
b3d7d2cce58cf30ebc3db8d7286d9dff944c3b2e
print driver name
conda-forge/gdal-feedstock,conda-forge/gdal-feedstock
recipe/run_test.py
recipe/run_test.py
from osgeo import gdal from osgeo import ogr from osgeo import osr # Avoid the regressing from https://github.com/conda-forge/gdal-feedstock/pull/129 # See https://github.com/conda-forge/gdal-feedstock/issues/131 from osgeo.gdal_array import * drivers = ['netCDF', 'HDF4', 'HDF5', 'GTiff', 'PNG', 'JPEG', 'GPKG', 'KEA'...
from osgeo import gdal from osgeo import ogr from osgeo import osr # Avoid the regressing from https://github.com/conda-forge/gdal-feedstock/pull/129 # See https://github.com/conda-forge/gdal-feedstock/issues/131 from osgeo.gdal_array import * driver = gdal.GetDriverByName("netCDF") assert driver is not None driver ...
bsd-3-clause
Python
bfc9f3ad20aabc7b20f8ca5bff3a68ed7d53308a
fix print for python3
zhihu/redis-shard
redis_shard/url.py
redis_shard/url.py
try: # python2 from urllib import unquote from urlparse import urlparse from urlparse import parse_qsl except ImportError: # python3 from urllib.parse import unquote from urllib.parse import urlparse from cgi import parse_qsl # noqa def _parse_url(url): scheme = urlparse(url).sche...
try: # python2 from urllib import unquote from urlparse import urlparse from urlparse import parse_qsl except ImportError: # python3 from urllib.parse import unquote from urllib.parse import urlparse from cgi import parse_qsl # noqa def _parse_url(url): scheme = urlparse(url).sche...
bsd-2-clause
Python
5dd78f614e5882bc2a3fcae24117a26ee34371ac
Fix mistake with socket constructor
panubo/docker-monitor,panubo/docker-monitor,panubo/docker-monitor
register-result.py
register-result.py
#!/usr/bin/env python import json import socket import sys if len(sys.argv) < 4: print("Error: Usage <register-result> <client> <name> <output> <status> <ttl>") sys.exit(128) check_client = sys.argv[1] check_name = sys.argv[2] check_output = sys.argv[3] check_status = int(sys.argv[4]) check_ttl = int(sys.arg...
#!/usr/bin/env python import json import socket import sys if len(sys.argv) < 4: print("Error: Usage <register-result> <client> <name> <output> <status> <ttl>") sys.exit(128) check_client = sys.argv[1] check_name = sys.argv[2] check_output = sys.argv[3] check_status = int(sys.argv[4]) check_ttl = int(sys.arg...
mit
Python
0456ab4d8e4393c1da5aade6f687e6f3781d70cf
Prepare the version for a new potential pre-release
itsmemattchung/github3.py,balloob/github3.py,degustaf/github3.py,icio/github3.py,h4ck3rm1k3/github3.py,sigmavirus24/github3.py,krxsky/github3.py,jim-minter/github3.py,agamdua/github3.py,ueg1990/github3.py,wbrefvem/github3.py,christophelec/github3.py
github3/__init__.py
github3/__init__.py
# -*- coding: utf-8 -*- """ github3 ======= See http://github3py.rtfd.org/ for documentation. :copyright: (c) 2012-2014 by Ian Cordasco :license: Modified BSD, see LICENSE for more details """ __title__ = 'github3' __author__ = 'Ian Cordasco' __license__ = 'Modified BSD' __copyright__ = 'Copyright 2012-2014 Ian Cor...
# -*- coding: utf-8 -*- """ github3 ======= See http://github3py.rtfd.org/ for documentation. :copyright: (c) 2012-2014 by Ian Cordasco :license: Modified BSD, see LICENSE for more details """ __title__ = 'github3' __author__ = 'Ian Cordasco' __license__ = 'Modified BSD' __copyright__ = 'Copyright 2012-2014 Ian Cor...
bsd-3-clause
Python
7124d56b3edd85c64dcc7f3ff0fa172102fe8358
Disable the check for the initial versions push
andrrizzi/yank,andrrizzi/yank,choderalab/yank,andrrizzi/yank,choderalab/yank
devtools/travis-ci/update_versions_json.py
devtools/travis-ci/update_versions_json.py
import json try: # Only works in Python 3.5 from urllib.request import urlopen except ImportError: from urllib2 import urlopen from yank import version #if not version.release: # print("This is not a release.") # exit(0) URL = 'http://www.getyank.org' try: data = urlopen(URL + '/versions.json')....
import json try: # Only works in Python 3.5 from urllib.request import urlopen except ImportError: from urllib2 import urlopen from yank import version if not version.release: print("This is not a release.") exit(0) URL = 'http://www.getyank.org' try: data = urlopen(URL + '/versions.json').re...
mit
Python
a10ae819179fcc812e877d57f2692a2bc9b73e95
check in fix to lnkifiers
Prachigarg1/Prachi,Prachigarg1/Prachi,nanaze/jsdoctor,Prachigarg1/Prachi,nanaze/jsdoctor,nanaze/jsdoctor
linkify.py
linkify.py
import re _WEB_URL_RE = re.compile('https?://[^\s]*') def _ReplaceWebUrl(url_match): url = url_match.group(0) link = '<a href="%s">%s</a>' % (url, url) return link def LinkifyWebUrls(content): return _WEB_URL_RE.sub(_ReplaceWebUrl, content) _SYMBOL_RE = re.compile('(\w+(?:\.\w+)*)(#\w+)?') def _ReplaceSymb...
import re _WEB_URL_RE = re.compile('https?://[^\s]*') def _ReplaceWebUrl(url_match): url = url_match.group(0) link = '<a href="%s">%s</a>' % (url, url) return link def LinkifyWebUrls(str): return _WEB_URL_RE.sub(_ReplaceWebUrl, 'aaa http://google.com bbb') _SYMBOL_RE = re.compile('(\w+(?:\.\w+)*)(#\w+)?') ...
apache-2.0
Python
6438b15b743fc8fdbab1fd70d45409149753e573
disable logging of sending static files
Caleydo/caleydo_server,phovea/phovea_server,phovea/phovea_server,phovea/phovea_server,Caleydo/caleydo_server,phovea/phovea_server
mainapp.py
mainapp.py
import flask import os import os.path import caleydo_server.plugin import caleydo_server.config app = flask.Flask(__name__) #deliver bower @app.route('/bower_components/<path:path>') def bowercomponents(path): return flask.send_from_directory(os.path.abspath(caleydo_server.config.get('bower_components','caleydo_ser...
import flask import os import os.path import caleydo_server.plugin import caleydo_server.config app = flask.Flask(__name__) #deliver bower @app.route('/bower_components/<path:path>') def bowercomponents(path): return flask.send_from_directory(os.path.abspath(caleydo_server.config.get('bower_components','caleydo_ser...
bsd-3-clause
Python
a38d77110d25e1462516964497b3b4d4f3a4a1b8
save job results from s3
Sotera/GEQE,Sotera/GEQE,Sotera/GEQE,Sotera/GEQE
backend-tangelo-server/awsutil.py
backend-tangelo-server/awsutil.py
import boto3 import os import datetime import json import sys DEFAULT_BUCKET = 'geqebin' def generate_job_name(): """ generate a job id based on the current time """ return 'job_'+str(datetime.datetime.now()).replace(' ','_') def saveBytesToS3(bucket,key,bytes): s3 = boto3.resource('s3') bucket ...
import boto3 import os import datetime import json DEFAULT_BUCKET = 'geqebin' def generate_job_name(): """ generate a job id based on the current time """ return 'job_'+str(datetime.datetime.now()).replace(' ','_') def saveBytesToS3(bucket,key,bytes): s3 = boto3.resource('s3') bucket = s3.Bucket(bu...
unlicense
Python
cf01e6740506f01ced96def3112afa464f8fa63f
bump version to 0.8.0
ivelum/graphql-py
graphql/__init__.py
graphql/__init__.py
__version__ = '0.8.0'
__version__ = '0.7.1'
mit
Python
be62697272f59c24add99032740da14a7fffc2c1
update schema dump to use links
4dn-dcic/fourfront,ENCODE-DCC/snovault,hms-dbmi/fourfront,ENCODE-DCC/snovault,ENCODE-DCC/snovault,kidaa/encoded,philiptzou/clincoded,hms-dbmi/fourfront,T2DREAM/t2dream-portal,ENCODE-DCC/encoded,4dn-dcic/fourfront,ENCODE-DCC/snovault,T2DREAM/t2dream-portal,T2DREAM/t2dream-portal,kidaa/encoded,T2DREAM/t2dream-portal,hms-...
src/encoded/dump_schemas.py
src/encoded/dump_schemas.py
import json import requests import sys from encoded.schema_utils import basic_schema BASE_URL = "http://localhost:6543" '''TYPE_URL = { 'organism': '/organisms/', 'source': '/sources/', 'target': '/targets/', 'antibody_lot': '/antibody-lots/', 'validation': '/validations/', 'antibody_approval'...
import json import requests import sys from encoded.schema_utils import basic_schema BASE_URL = "http://localhost:6543" '''TYPE_URL = { 'organism': '/organisms/', 'source': '/sources/', 'target': '/targets/', 'antibody_lot': '/antibody-lots/', 'validation': '/validations/', 'antibody_approval'...
mit
Python
ae93eb2a7775981404f31c21a8dbaa7cc63f6f5d
Adjust tests for recent SITE_URL change (browser ID patch)
mozilla/funfactory,mozilla/funfactory
tests/test__utils.py
tests/test__utils.py
from django.conf import settings from mock import patch from nose.tools import eq_ from django.test import TestCase import funfactory.utils as utils @patch.object(settings, 'DOMAIN', 'test.mo.com') class AbsolutifyTests(TestCase): ABS_PATH = '/some/absolute/path' def test_basic(self): url = utils.a...
from django.conf import settings from mock import patch from nose.tools import eq_ from django.test import TestCase import funfactory.utils as utils @patch.object(settings, 'DOMAIN', 'test.mo.com') class AbsolutifyTests(TestCase): ABS_PATH = '/some/absolute/path' def test_basic(self): url = utils.a...
bsd-3-clause
Python