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
fa3bd20210efcfabe72cdc9a10d8900713bb62b9
add method to check thunks
mrtazz/thunkapi.py
thunkapi/thunkapi.py
thunkapi/thunkapi.py
# encoding: utf-8 """ library for the thunk.us API """ import urllib import urllib2 import json class Thunk: """ class for creating an object which can talk to the thunk.us API """ def __init__(self): self.base_url = "http://thunk.us/" def create(self, name=None): """ method ...
# encoding: utf-8 """ library for the thunk.us API """ import urllib import urllib2 import json class Thunk: """ class for creating an object which can talk to the thunk.us API """ def __init__(self): self.base_url = "http://thunk.us/" def create(self, name=None): """ method ...
mit
Python
477426fb800c03b6c4bb250febc71f8bba1f41f0
Update Scale bijector to have forward_min_event_ndims=0.
tensorflow/probability,tensorflow/probability
tensorflow_probability/python/bijectors/shift.py
tensorflow_probability/python/bijectors/shift.py
# Copyright 2019 The TensorFlow Probability 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 o...
# Copyright 2019 The TensorFlow Probability 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 o...
apache-2.0
Python
86acfd665e4cd8ffd3852392627f46e0dbb67993
Add widget model
plamut/ggrc-core,NejcZupec/ggrc-core,kr41/ggrc-core,AleksNeStu/ggrc-core,josthkko/ggrc-core,plamut/ggrc-core,prasannav7/ggrc-core,plamut/ggrc-core,j0gurt/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,selahssea/ggrc-core,prasannav7/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,edofic/ggrc-core,pras...
test/selenium/src/lib/page/widget/admin_roles.py
test/selenium/src/lib/page/widget/admin_roles.py
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com from lib import base from lib import environment from lib.constants import u...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com from lib import base from lib import environment from lib.constants import u...
apache-2.0
Python
bce916c206f43625d06b4f072c53bfb4d729d57e
Update for gensim v2.2.0
zake7749/word2vec-tutorial
wiki_to_txt.py
wiki_to_txt.py
# -*- coding: utf-8 -*- import logging import sys from gensim.corpora import WikiCorpus def main(): if len(sys.argv) != 2: print("Usage: python3 " + sys.argv[0] + " wiki_data_path") exit() logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) wiki_co...
# -*- coding: utf-8 -*- import logging import sys from gensim.corpora import WikiCorpus def main(): if len(sys.argv) != 2: print("Usage: python3 " + sys.argv[0] + " wiki_data_path") exit() logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) wiki_co...
mit
Python
e226f6af98fc0c45487d24f67c91411971ed6e77
Document the reason for accepting only `POST` requests on `/wiki_render`, and allow `GET` requests from `TRAC_ADMIN` for testing purposes.
rbaumg/trac,rbaumg/trac,rbaumg/trac,rbaumg/trac
trac/wiki/web_api.py
trac/wiki/web_api.py
# -*- coding: utf-8 -*- # # Copyright (C) 2009 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consists o...
# -*- coding: utf-8 -*- # # Copyright (C) 2009 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consists o...
bsd-3-clause
Python
82a40ad17f86711c10f1d8f70143ba28dce1011d
add NeuroImage class
Neurita/boyle
boyle/nifti/__init__.py
boyle/nifti/__init__.py
from .neuroimage import NeuroImage
bsd-3-clause
Python
b65f44f1f4d5b5fea061c0d75391c4e771563d12
Fix instantiating the preparation when plug-ins are done loading
Ghostkeeper/Luna
plugins/configuration/preferences/preferences.py
plugins/configuration/preferences/preferences.py
#!/usr/bin/env python #-*- coding: utf-8 -*- #This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software. #The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif...
#!/usr/bin/env python #-*- coding: utf-8 -*- #This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software. #The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif...
cc0-1.0
Python
17861a2315586def9850120882bccd32fa6bed72
add missing values to test_reinit
OParl/validator,OParl/validator
oparlvalidator/tests/test_statistics.py
oparlvalidator/tests/test_statistics.py
# -*- encoding: utf-8 -*- from __future__ import (unicode_literals, absolute_import, division, print_function) import unittest from ..statistics import with_stats class TestSchema(unittest.TestCase): def setUp(self): @with_stats def init(stats=None): # we do no...
# -*- encoding: utf-8 -*- from __future__ import (unicode_literals, absolute_import, division, print_function) import unittest from ..statistics import with_stats class TestSchema(unittest.TestCase): def setUp(self): @with_stats def init(stats=None): # we do no...
mit
Python
58f31424ccb2eda5ee94514bd1305f1b814ab1de
Add simple company form routes
Estmator/EstmatorApp,Estmator/EstmatorApp,Estmator/EstmatorApp
estmator_project/est_client/urls.py
estmator_project/est_client/urls.py
from django.conf.urls import url import views urlpatterns = [ # urls begin with /client/ url(r'^$', views.client_view, name='api_client'), # not sure what the api urls are doing currently url( r'^form$', views.client_form_view, name='client_form' ), url( r'^form/ed...
from django.conf.urls import url import views urlpatterns = [ # urls begin with /client/ url(r'^$', views.client_view, name='api_client'), # not sure what the api urls are doing currently url( r'^form$', views.client_form_view, name='client_form' ), url( r'^form/ed...
mit
Python
6512eafc88c83f625b106ce2d5cd098285abb57c
Bump version 0.3.12
cga-harvard/hypermap,cga-harvard/hypermap,cga-harvard/hypermap,cga-harvard/HHypermap,cga-harvard/hypermap,cga-harvard/HHypermap,cga-harvard/HHypermap,cga-harvard/HHypermap
hypermap/__init__.py
hypermap/__init__.py
from __future__ import absolute_import # This will make sure the app is always imported when # Django starts so that shared_task will use this app. from .celeryapp import app as celery_app # noqa __version__ = '0.3.12' __description__ = 'hhypermap'
from __future__ import absolute_import # This will make sure the app is always imported when # Django starts so that shared_task will use this app. from .celeryapp import app as celery_app # noqa __version__ = '0.3.11' __description__ = 'hhypermap'
mit
Python
945627fb2f0831aa3a763c8c58164031134e9832
update to v0.4.6
hellock/icrawler
icrawler/__init__.py
icrawler/__init__.py
from .feeder import Feeder, SimpleSEFeeder, UrlListFeeder from .parser import Parser from .downloader import Downloader, ImageDownloader from .crawler import Crawler __version__ = '0.4.6' __all__ = [ 'Crawler', 'Downloader', 'ImageDownloader', 'Feeder', 'SimpleSEFeeder', 'UrlListFeeder', 'Parser' ]
from .feeder import Feeder, SimpleSEFeeder, UrlListFeeder from .parser import Parser from .downloader import Downloader, ImageDownloader from .crawler import Crawler __version__ = '0.4.5' __all__ = [ 'Crawler', 'Downloader', 'ImageDownloader', 'Feeder', 'SimpleSEFeeder', 'UrlListFeeder', 'Parser' ]
mit
Python
3c4615c40f7b7124335dc521bc9cd0d8b5c9c125
Rename ``title`` field to ``name``.
us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite
us_ignite/hubs/models.py
us_ignite/hubs/models.py
from django.db import models from django_extensions.db.fields import ( AutoSlugField, CreationDateTimeField, ModificationDateTimeField) from taggit.managers import TaggableManager class Hub(models.Model): """Local communities with Gigabit capabilities.""" APPROVED = 1 PENDING = 2 REMOVED = 3 ...
from django.db import models from django_extensions.db.fields import ( AutoSlugField, CreationDateTimeField, ModificationDateTimeField) from taggit.managers import TaggableManager class Hub(models.Model): """Local communities with Gigabit capabilities.""" APPROVED = 1 PENDING = 2 REMOVED = 3 ...
bsd-3-clause
Python
bf92169fa75edf82d92ff25778db4b0d331866ed
Move docstring to correct location
esplinr/foodcheck,esplinr/foodcheck,esplinr/foodcheck,esplinr/foodcheck
util/download_data_sf.py
util/download_data_sf.py
''' Dowload San Francisco health inspector data. ''' # Copyright (C) 2013 Timothy James Austen, Eileen Qiuhua Lin, # Richard Esplin <richard-oss@esplins.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publ...
import sys import csv import os.path, time import urllib2 ''' Dowload San Francisco health inspector data. ''' # Copyright (C) 2013 Timothy James Austen, Eileen Qiuhua Lin, # Richard Esplin <richard-oss@esplins.org> # # This program is free software: you can redistribute it and/or ...
agpl-3.0
Python
1eafb3336f8781134c40446ff6ed1487cf26015e
add log debugging for offline usage
akrherz/pyWWA,akrherz/pyWWA
util/save_iowa_level3.py
util/save_iowa_level3.py
"""Save our local NEXRAD level 3 RADARs to CyBox""" import datetime import os import subprocess # import logging from pyiem.ftpsession import send2box NEXRADS = "DMX DVN OAX ARX FSD MPX EAX ABR UDX".split() # log = logging.getLogger() # log.setLevel(logging.DEBUG) def run(date): """Process this date please""" ...
"""Save our local NEXRAD level 3 RADARs to CyBox""" import datetime import os import subprocess from pyiem.ftpsession import send2box NEXRADS = "DMX DVN OAX ARX FSD MPX EAX ABR UDX".split() def run(date): """Process this date please""" for nexrad in NEXRADS: os.chdir("/mnt/nexrad3/nexrad/NIDS/%s" % (...
mit
Python
5d07ba6dc28ca5bae88e28c0c246af1c827d9322
Improve docstring
jdgillespie91/trackerSpend,jdgillespie91/trackerSpend
utils/publish_message.py
utils/publish_message.py
import amqp from contextlib import closing def __get_channel(connection): return connection.channel() def __get_message(message_body): return amqp.Message(message_body) def __declare_exchange(channel, exchange, type): channel.exchange_declare(exchange=exchange, type=type, durable=True, auto_delete=False...
import amqp from contextlib import closing def __get_channel(connection): return connection.channel() def __get_message(message_body): return amqp.Message(message_body) def __declare_exchange(channel, exchange, type): channel.exchange_declare(exchange=exchange, type=type, durable=True, auto_delete=False...
mit
Python
4366a23445155832f60cb58138c95386a79abb49
add LengthValidator
encorehu/validators
validators/validators.py
validators/validators.py
class ValidateException(Exception): pass class BaseValidator(object): def __init__(self): self.empty_values = [] def prepare_value(self, value): return value def to_python(self, value): return value def is_valid(self,value): return False def validate(self, v...
class ValidateException(Exception): pass class BaseValidator(object): def __init__(self): self.empty_values = [] def prepare_value(self, value): return value def to_python(self, value): return value def is_valid(self,value): return False def validate(self, v...
mit
Python
c8a372b1f84b7891b9e48b243b09d2fba147660b
Update plot_svm_regression.py
victorbergelin/scikit-learn,JosmanPS/scikit-learn,vigilv/scikit-learn,MatthieuBizien/scikit-learn,chrsrds/scikit-learn,heli522/scikit-learn,wzbozon/scikit-learn,mhue/scikit-learn,maheshakya/scikit-learn,dingocuster/scikit-learn,glemaitre/scikit-learn,AlexRobson/scikit-learn,mikebenfield/scikit-learn,zihua/scikit-learn,...
examples/svm/plot_svm_regression.py
examples/svm/plot_svm_regression.py
""" =================================================================== Support Vector Regression (SVR) using linear and non-linear kernels =================================================================== Toy example of 1D regression using linear, polynomial and RBF kernels. """ print(__doc__) import numpy as np ...
""" =================================================================== Support Vector Regression (SVR) using linear and non-linear kernels =================================================================== Toy example of 1D regression using linear, polynomial and RBF kernels. """ print(__doc__) ###################...
bsd-3-clause
Python
3dcf9c7d9258fd1ef5df96cbc39762791e2dc288
Update af_assemblyPrep.py
aaronfang/personal_scripts
scripts/af_assemblyPrep.py
scripts/af_assemblyPrep.py
import pymel.core as pm # Step1: # Select top group node. Run the following.It will generate a locator. # Send to the current group pivot position. # You can position the locator where you want to represent the final pivot position. curSel = pm.ls(sl=True,type='transform')[0] trans = pm.xform(curSel,ws=1,piv=1,q=1) rot...
import pymel.core as pm # Step1: # Select top group node. Run the following.It will generate a locator. # Send to the current group pivot position. # You can position the locator where you want to represent the final pivot position. curSel = pm.ls(sl=True,type='transform') trans = pm.xform(curSel[0],ws=1,piv=1,q=1) rot...
mit
Python
7f635b40da688a856a859ac321b30b1306d1d27b
remove debugging
sagemathinc/learntheeasyway,sagemathinc/learntheeasyway,sagemathinc/learntheeasyway,sagemathinc/learntheeasyway
scripts/install/install.py
scripts/install/install.py
import os import subprocess import os.path def apt_get_install(fname): with open(fname, 'r') as f: items = f.readlines() for item in items: os.system('sudo apt-get install -y %s' % (item)) def npm_global_install(fname): with open(fname, 'r') as f: items = f.readlines() for item...
import os import subprocess import os.path def apt_get_install(fname): with open(fname, 'r') as f: items = f.readlines() for item in items: os.system('sudo apt-get install -y %s' % (item)) def npm_global_install(fname): with open(fname, 'r') as f: items = f.readlines() for item...
apache-2.0
Python
150ee007fc5d12a262c74dae922b1a6896c729be
Add unicode representation for sponsors files so we know what those look like too.
CTPUG/wafer,CarlFK/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CarlFK/wafer,CarlFK/wafer,CarlFK/wafer
wafer/sponsors/models.py
wafer/sponsors/models.py
from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse from django.core.validators import MinValueValidator from django.db import models from wafer.snippets.markdown_field import MarkdownTextField class File(models.Model): """A file for use in sponsor and sponshorshi...
from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse from django.core.validators import MinValueValidator from django.db import models from wafer.snippets.markdown_field import MarkdownTextField class File(models.Model): """A file for use in sponsor and sponshorshi...
isc
Python
b4ebf0a83ebab0c6c74c36393b0a9f9bbe5105cb
fix for macs
KoinoAoi/meguca,theGaggle/sleepingpizza,alokal/meguca,theGaggle/sleepingpizza,reiclone/doushio,alokal/meguca,reiclone/doushio,theGaggle/sleepingpizza,KoinoAoi/meguca,reiclone/doushio,alokal/meguca,KoinoAoi/meguca,theGaggle/sleepingpizza,alokal/meguca,reiclone/doushio,theGaggle/sleepingpizza,reiclone/doushio,theGaggle/s...
tripcode/binding.gyp
tripcode/binding.gyp
{ 'targets': [{ 'target_name': 'tripcode', "include_dirs" : [ "<!(node -e \"require('nan')\")" ], 'sources': ['tripcode.cc'], 'link_settings': { 'conditions': [ ['OS=="linux"', {'libraries': ['-lcrypt']}], ['OS=="freebsd"', {'libraries': ['-lcrypt']}], ['OS=="mac"', {'libraries': ['-lcrypto...
{ 'targets': [{ 'target_name': 'tripcode', "include_dirs" : [ "<!(node -e \"require('nan')\")" ], 'sources': ['tripcode.cc'], 'link_settings': { 'conditions': [ ['OS=="linux"', {'libraries': ['-lcrypt']}], ['OS=="freebsd"', {'libraries': ['-lcrypt']}], ['OS=="mac"', {'libraries': ['-lcrypto...
mit
Python
de8b35e5c0a3c5f1427bbdcf3b60bd3e915cf0ad
Remove an extra global variable in xorcise package
raviqqe/shakyo
xorcise/__init__.py
xorcise/__init__.py
import curses from .character import Character from .console import Console from .line import Line from .attribute import RenditionAttribute, ColorAttribute from .misc import ESCAPE_CHARS, DELETE_CHARS, BACKSPACE_CHARS, \ is_printable_char, char_with_control_key def turn_on_console(asciize=False, ...
import curses from .character import Character from .console import Console from .line import Line from .attribute import RenditionAttribute, ColorAttribute from .misc import ESCAPE_CHARS, DELETE_CHARS, BACKSPACE_CHARS, \ is_printable_char, char_with_control_key __console = None def turn_on_cons...
unlicense
Python
5caafe6d9e85ed7f7c8314c00dfc0a678712922b
add append/prepend util funcs for environment.
abadger/Bento,cournape/Bento,cournape/Bento,abadger/Bento,cournape/Bento,abadger/Bento,abadger/Bento,cournape/Bento
yaku/environment.py
yaku/environment.py
import re import os from yaku.utils \ import \ ensure_dir, rename re_imp = re.compile('^(#)*?([^#=]*?)\ =\ (.*?)$', re.M) class Environment(dict): def get_flat(self, k): s = self[k] if isinstance(s, str): return s else: return " ".join(s) def store(sel...
import re import os from yaku.utils \ import \ ensure_dir, rename re_imp = re.compile('^(#)*?([^#=]*?)\ =\ (.*?)$', re.M) class Environment(dict): def get_flat(self, k): s = self[k] if isinstance(s, str): return s else: return " ".join(s) def store(sel...
bsd-3-clause
Python
e6198a266f4f128999e8a92c3f0c5531a32f7876
Fix typo in comparison
maxburkhardt/nessus-parser
mutators/exceptions.py
mutators/exceptions.py
def mutate(csv_data, exceptions_file, environ): with open(exceptions_file) as f: for exception in f: try: hostname, id = exception.split() except ValueError: continue # commented lines: if hostname[0] == '#': continue #...
def mutate(csv_data, exceptions_file, environ): with open(exceptions_file) as f: for exception in f: try: hostname, id = exception.split() except ValueError: continue # commented lines: if hostname[0] = '#': continue # ...
mit
Python
bb1ef357e21130c651c85409a3266915c2e99bdc
automate lens reduction process
crawfordsm/zSALT,crawfordsm/zSALT
zsalt/reducelens.py
zsalt/reducelens.py
import os, sys, glob import argparse import string import numpy as np from astropy.io import fits from scipy import signal from pyraf import iraf from iraf import pysalt from specrectify import specrectify from saltobslog import obslog from imred import imred from autoarclens import auto_arc_lens from combine_dith...
import os, sys, glob reddir = '/Users/crawford/programs/zSALT/zsalt/' sys.path.append(reddir) from imred import imred from specred import specred bpmfile = '/Users/crawford/research/kepler/bpm_agn.fits' ddir = sys.argv[1] os.chdir(ddir) if not os.path.isdir('sci'): os.mkdir('sci') os.chdir('sci') #basic image reuc...
bsd-3-clause
Python
0ccb6e971c250048b8f4931b275ce041440ab766
Bump version
walkr/nanoservice
nanoservice/version.py
nanoservice/version.py
VERSION = '0.3.0'
VERSION = '0.2.2'
mit
Python
3e16cfe331a3f369d63584eb151a3a827da8b2cb
make the db reflection code generate code model classes, i.e. with correct column_property attributes for geometries
tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal
c2cgeoportal/lib/dbreflection.py
c2cgeoportal/lib/dbreflection.py
import functools from sqlalchemy import Table, sql, types from sqlalchemy.engine import reflection from geoalchemy import Geometry, GeometryColumn from papyrus.geo_interface import GeoInterface SQL_GEOMETRY_COLUMNS = """ SELECT f_table_schema, f_table_name, f_geometry_column, srid, ...
import functools from sqlalchemy import Table, sql, types from sqlalchemy.engine import reflection from geoalchemy import Geometry from papyrus.geo_interface import GeoInterface SQL_GEOMETRY_COLUMNS = """ SELECT f_table_schema, f_table_name, f_geometry_column, srid, type FROM ...
bsd-2-clause
Python
8263af4b3353e8a4431eef365f7c6ce59a28be96
Bump up version
whalerock/netstorage
netstorage/__init__.py
netstorage/__init__.py
from .netstorage import Netstorage import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) __version__ = '0.0.7'
from .netstorage import Netstorage import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) __version__ = '0.0.6'
mit
Python
2dc460e26bacff7eb0b8768c0db3bbafc9cce0f6
Fix UnboundLocalError in #317
houtianze/bypy,houtianze/bypy
bypy/printer_console.py
bypy/printer_console.py
#!/usr/bin/env python # encoding: utf-8 # PYTHON_ARGCOMPLETE_OK # from __future__ imports must occur at the beginning of the file from __future__ import unicode_literals from __future__ import print_function from __future__ import division import sys import time # unify Python 2 and 3 if sys.version_info[0] == 3: r...
#!/usr/bin/env python # encoding: utf-8 # PYTHON_ARGCOMPLETE_OK # from __future__ imports must occur at the beginning of the file from __future__ import unicode_literals from __future__ import print_function from __future__ import division import sys import time # unify Python 2 and 3 if sys.version_info[0] == 3: r...
mit
Python
0dcf66da7d9ace45f048fe6dbd698edf68cc6496
Add NEWSLETTER_CONFIRM_EMAIL... settings
dsanders11/django-newsletter,dsanders11/django-newsletter,viaregio/django-newsletter,ctxis/django-newsletter,dsanders11/django-newsletter,viaregio/django-newsletter,ctxis/django-newsletter,ctxis/django-newsletter
newsletter/settings.py
newsletter/settings.py
from django.conf import settings as django_settings from django.utils.importlib import import_module from django.core.exceptions import ImproperlyConfigured class NewsletterSettings(object): """ A settings object, that handles newsletter default settings. With instance being instance of NewsletterSetting...
from django.conf import settings as django_settings from django.utils.importlib import import_module from django.core.exceptions import ImproperlyConfigured class NewsletterSettings(object): """ A settings object, that handles newsletter default settings. """ @property def RICHTEXT_WIDGET(self): ...
agpl-3.0
Python
b2f199786ff88b607033b3e6eba8f5380db7b7d6
fix for #12 on windows
pichillilorenzo/JavaScriptEnhancements,pichillilorenzo/JavaScriptEnhancements,pichillilorenzo/JavaScriptEnhancements,pichillilorenzo/JavaScript-Completions
node/node_variables.py
node/node_variables.py
import sublime import platform import os PACKAGE_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) PLATFORM_ARCHITECTURE = "64bit" if platform.architecture()[0] == "64bit" else "32bit" NODE_JS_VERSION = "v6.6.0" # Default value NODE_JS_BINARIES_FOLDER_NAME = "node_binaries" NODE_JS_VERSION_URL_LIST_...
import sublime import platform import os PACKAGE_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) PLATFORM_ARCHITECTURE = "64bit" if platform.architecture()[0] == "64bit" else "32bit" NODE_JS_VERSION = "v6.6.0" # Default value NODE_JS_BINARIES_FOLDER_NAME = "node_binaries" NODE_JS_VERSION_URL_LIST_...
mit
Python
339e5533a5e4c0269955e229031821d4dfb833f3
select which apps to run for cla_public and fix my name in file
ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend
cla_frontend/settings/jenkins.py
cla_frontend/settings/jenkins.py
from .testing import * DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Marco Fucci', 'marco.fucci@digital.justice.co.uk'), ('Ravi Kotecha', 'ravi.kotecha@digital.justice.gov.uk'), ) MANAGERS = ADMINS INSTALLED_APPS += ('django_jenkins',) JENKINS_TASKS = ( 'django_jenkins.tasks.with_coverage', ) DATA...
from .testing import * DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Marco Fucci', 'marco.fucci@digital.justice.co.uk'), ('Rai Kotecha', 'ravi.kotecha@digital.justice.gov.uk'), ) MANAGERS = ADMINS INSTALLED_APPS += ('django_jenkins',) JENKINS_TASKS = ( 'django_jenkins.tasks.with_coverage', ) DATAB...
mit
Python
0fdc50f4805c714826b9c79c8262f78833314f64
Add docstrings to lib/utils.py and pep8 mods
Phantasus/intelmq,s4n7h0/intelmq
intelmq/lib/utils.py
intelmq/lib/utils.py
import logging import hashlib def decode(text, encodings=["utf-8", "ISO-8859-15"], force=False): """Returns the given text with the given encodings, else it raises an exception""" for encoding in encodings: try: return text.decode(encoding) except ValueError as e: ...
import logging import hashlib def decode(text, encodings=["utf-8", "ISO-8859-15"], force=False): for encoding in encodings: try: return text.decode(encoding) except ValueError as e: pass if force: for encoding in encodings: try: ...
agpl-3.0
Python
7e6c814c1a59996e98457c149ac17939c8747610
modify parameters for plot2d method
PytLab/catplot
catplot/data_plotter.py
catplot/data_plotter.py
# -*- coding:utf-8 -*- import numpy as np import matplotlib.pyplot as plt from functions import line2list class DataPlotter(object): def __init__(self, filename, field=' ', dtype=float): self.filename = filename self.field = field self.dtype = dtype #load data self.load() ...
import numpy as np import matplotlib.pyplot as plt from functions import line2list class DataPlotter(object): def __init__(self, filename, field=' ', dtype=float): self.filename = filename self.field = field self.dtype = dtype #load data self.load() def load(self): ...
mit
Python
b1e5aa345ece7d54928486523f2875df456e0f26
Add Parti Laval
opencivicdata/scrapers-ca,opencivicdata/scrapers-ca
ca_qc_laval/__init__.py
ca_qc_laval/__init__.py
from utils import CanadianJurisdiction class Laval(CanadianJurisdiction): classification = 'legislature' division_id = 'ocd-division/country:ca/csd:2465005' division_name = 'Laval' name = 'Conseil municipal de Laval' url = 'http://www.ville.laval.qc.ca' parties = [ {'name': 'Action Lav...
from utils import CanadianJurisdiction class Laval(CanadianJurisdiction): classification = 'legislature' division_id = 'ocd-division/country:ca/csd:2465005' division_name = 'Laval' name = 'Conseil municipal de Laval' url = 'http://www.ville.laval.qc.ca' parties = [ {'name': 'Action Lav...
mit
Python
2a3dcd2cb47fd9e73a48b2a7faa939ace2e7402a
add ordbok to app.extensions in flask helper
eriktaubeneck/ordbok,eriktaubeneck/ordbok
ordbok/flask_helper.py
ordbok/flask_helper.py
from .ordbok import Ordbok class FlaskOrdbok(Ordbok): def __init__(self, app=None, **kwargs): if app: self.init_app(app) return super(FlaskOrdbok, self).__init__(**kwargs) def init_app(self, app): if not hasattr(app, 'extensions'): app.extensions = {} a...
from .ordbok import Ordbok class FlaskOrdbok(Ordbok): def __init__(self, app=None, **kwargs): if app: self.init_app(app) return super(FlaskOrdbok, self).__init__(**kwargs) def init_app(self, app): self._root_path = app.config.root_path def app_run(self, app, *args, **...
mit
Python
18830feb0baafd2f2f99674dfec55b6cb2e0c6e5
Add ArgumentParser to test run file to allow options.
incuna/django-orderable,incuna/django-orderable
orderable/tests/run.py
orderable/tests/run.py
from argparse import ArgumentParser import sys import django from django.conf import settings settings.configure( DATABASES={'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'orderable', 'HOST': 'localhost' }}, INSTALLED_APPS=( 'orderable.tests', ...
import sys import django from django.conf import settings settings.configure( DATABASES={'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'orderable', 'HOST': 'localhost' }}, INSTALLED_APPS=( 'orderable.tests', ), MIDDLEWARE_CLASSES=[], ) ...
bsd-2-clause
Python
b421a0b195ca6722e20458b42a158c42c15b0ba6
sort keys for captured input
bernard357/shellbot
shellbot/commands/input.py
shellbot/commands/input.py
# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Li...
# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Li...
apache-2.0
Python
b9c45d5b6eee641cf212def5f741b0f141143a2a
Apply changes to the config directly to conf
citruspi/ReactIRC
ReactIRC/bot.py
ReactIRC/bot.py
# -*- coding: utf-8 -*- """ ReactIRC.bot ~~~~~~~~~~~~ :copyright: (c) 2014 by Mihir Singh (@citruspi) :license: MIT, see LICENSE for more details. """ from web import Web from irc import IRC from . import conf, connection import pprint class Bot(object): __web = None __irc = None def __init__(self): ...
# -*- coding: utf-8 -*- """ ReactIRC.bot ~~~~~~~~~~~~ :copyright: (c) 2014 by Mihir Singh (@citruspi) :license: MIT, see LICENSE for more details. """ from web import Web from irc import IRC from . import conf, connection class Bot(object): __web = None __irc = None def __init__(self): self.c...
mit
Python
5e4bd58153110477f14178d1ebd35b673fec6f43
Add function wrapper to ignore errors and shorten their messages
EsqWiggles/SLA-bot,EsqWiggles/SLA-bot
SLA_bot/util.py
SLA_bot/util.py
import collections import os import traceback import sys project_dir = os.path.dirname(os.path.dirname(__file__)) async def try_ignore_errors(func, *args, **kwargs): try: await func(*args, **kwargs) except Exception as e: traceback_stack = traceback.extract_tb(sys.exc_info()[2]) stack_...
import collections def two_unit_tdelta(tdelta): total_s = tdelta.total_seconds() week, rem_s = divmod(total_s, 60*60*24*7) day = round(rem_s/(60*60*24)) if week >= 1: return '{}w {:02d}d'.format(int(week), day) day, rem_s = divmod(total_s, 60*60*24) hour = round(rem_s/(60*60)) if ...
mit
Python
3cc39c2925fbd5c221499e67c664cbf408af325d
Update SassBeautify.py
badsyntax/SassBeautify,badsyntax/SassBeautify
SassBeautify.py
SassBeautify.py
# SassBeautify :: Beautify your Sass! (or Scss!) # Author: Richard Willis (willis.rh@gmail.com) # https://github.com/badsyntax/SassBeautify # Depends on the `sass-convert` utility import os, commands, subprocess import sublime, sublime_plugin class SassBeautifyCommand(sublime_plugin.TextCommand): def run...
# SassBeautify :: Beautify your Sass! (or Scss!) # Author: Richard Willis (willis.rh@gmail.com) # https://github.com/badsyntax/SassBeautify # Depends on the `sass-convert` utility import os, commands, subprocess import sublime, sublime_plugin class SassBeautifyCommand(sublime_plugin.TextCommand): def run...
mit
Python
8ca7fbf8aab5f18a355602b9b718cd1209670601
Create Product model
iCHAIT/whats-fresh-api,iCHAIT/whats-fresh-api,osu-cass/whats-fresh-api,osu-cass/whats-fresh-api,osu-cass/whats-fresh-api,osu-cass/whats-fresh-api,iCHAIT/whats-fresh-api,iCHAIT/whats-fresh-api
project_fish/whats_fresh/models.py
project_fish/whats_fresh/models.py
from django.contrib.gis.db import models import os from phonenumber_field.modelfields import PhoneNumberField class Image(models.Model): """ The Image model holds an image and related data. The Created and Modified time fields are created automatically by Django when the object is created or modified,...
from django.contrib.gis.db import models import os from phonenumber_field.modelfields import PhoneNumberField class Image(models.Model): """ The Image model holds an image and related data. The Created and Modified time fields are created automatically by Django when the object is created or modified,...
apache-2.0
Python
e7a48c97e79c43d2366dac0ec68110014e96646d
Change CammelCase to snake_case
Pynitus-Universe/Pynitus,Pynitus-Universe/Pynitus,Pynitus-Universe/Pynitus-Backend,Pynitus-Universe/Pynitus-Backend
src/data/Track/UploadHandler.py
src/data/Track/UploadHandler.py
import os class Attribute(object): def __init__( self, display_name=None, attribute_type=None, required=None, target=None ): self.display_name = display_name self.attributeType = attribute_type self.required = True if required == "required" else...
import os class Attribute(object): def __init__( self, displayName=None, attributeType=None, required=None, target=None ): self.displayName = displayName self.attributeType = attributeType self.required = True if required == "required" else Fals...
agpl-3.0
Python
4a1b35c1480e040cd48539715f8c1876f9e71569
Increase version to 0.30
MGHComputationalPathology/dicomweb-client
src/dicomweb_client/__init__.py
src/dicomweb_client/__init__.py
__version__ = '0.30.0' from dicomweb_client.api import DICOMwebClient
__version__ = '0.22.0rc' from dicomweb_client.api import DICOMwebClient
mit
Python
9e8fd0f092c35b81abaf83c0099c6c8eccbbea25
Increase version for release candidate
MGHComputationalPathology/dicomweb-client
src/dicomweb_client/__init__.py
src/dicomweb_client/__init__.py
__version__ = '0.20.0rc' from dicomweb_client.api import DICOMwebClient
__version__ = '0.14.0' from dicomweb_client.api import DICOMwebClient
mit
Python
04dc4bfab726870bbddee13503edeb970d2709de
test deprecation warning
rstoneback/pysat
pysat/tests/test_methods_cdaweb.py
pysat/tests/test_methods_cdaweb.py
import requests import warnings import pytest import pysat from pysat.instruments.methods import nasa_cdaweb as cdw class TestCDAWeb(): def setup(self): """Runs before every method to create a clean testing setup.""" self.supported_tags = pysat.instruments.cnofs_plp.supported_tags def tear...
import requests import warnings import pytest import pysat from pysat.instruments.methods import nasa_cdaweb as cdw class TestCDAWeb(): def setup(self): """Runs before every method to create a clean testing setup.""" self.supported_tags = pysat.instruments.cnofs_plp.supported_tags def tear...
bsd-3-clause
Python
880baf606a9686623bccf2f939c3c360d18c1915
Add an helper to know if a tag has children
ivoire/DataTag,ivoire/DataTag,ivoire/DataTag
DataTag/models.py
DataTag/models.py
from __future__ import unicode_literals from django.conf import settings from django.contrib.auth.models import Group, User from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.db import models class Media(models.Model): tags = models.ManyToManyField('Tag', ...
from __future__ import unicode_literals from django.conf import settings from django.contrib.auth.models import Group, User from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.db import models class Media(models.Model): tags = models.ManyToManyField('Tag', ...
agpl-3.0
Python
e3032d6c58a1b0b79401664cb89fc2b125bfbc86
update route.py
tomzw11/Pydrone
route.py
route.py
import matplotlib.pyplot as plt import matplotlib.patches as patches def route(root): root_height = root[2] coordinates = [\ [0.42*root_height+root[0],0.42*root_height+root[1],root_height/2],\ [-0.42*root_height+root[0],0.42*root_height+root[1],root_height/2],\ [-0.42*root_height+root[0],-0.15*root_height+root[1]...
import matplotlib.pyplot as plt import matplotlib.patches as patches def route(root): root_height = root[2] coordinates = [\ [0.42*root_height+root[0],0.42*root_height+root[1],root_height/2],\ [-0.42*root_height+root[0],0.42*root_height+root[1],root_height/2],\ [-0.42*root_height+root[0],-0.15*root_height+root[1]...
mit
Python
706cdbf604a89b454a87ac31700355b60bfb65a7
Update F# to 3.0.27.
mono/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild,mono/bockbuild,BansheeMediaPlayer/bockbuild
packages/fsharp-3.0.py
packages/fsharp-3.0.py
class FsharpPackage(GitHubTarballPackage): def __init__(self): GitHubTarballPackage.__init__(self, 'fsharp', 'fsharp', '3.0.27', 'f3c8ea8bf4831ce6dc30581558fa4a45a078cd55', configure = '') def build(self): self.sh ('autoreconf') self.sh ('./configure --prefix="%{prefix}"') self.sh ('make') Fsha...
class FsharpPackage(GitHubTarballPackage): def __init__(self): GitHubTarballPackage.__init__(self, 'fsharp', 'fsharp', '3.0.22', '4ea45bbc75eda522d43ed50ece1f9b8103697116', configure = '') def build(self): self.sh ('autoreconf') self.sh ('./configure --prefix="%{prefix}"') self.sh ('make') Fsha...
mit
Python
7a93f8c3b65409460322dd90ba9011637c4c1c4a
Fix np array issues again
skylander86/ycml
ycml/transformers/base.py
ycml/transformers/base.py
import logging import numpy as np from sklearn.base import BaseEstimator, TransformerMixin from ..utils import Timer __all__ = ['PureTransformer', 'identity'] logger = logging.getLogger(__name__) # Helper class. A transformer that only does transformation and does not need to fit any internal parameters. class ...
import logging import numpy as np from sklearn.base import BaseEstimator, TransformerMixin from ..utils import Timer __all__ = ['PureTransformer', 'identity'] logger = logging.getLogger(__name__) # Helper class. A transformer that only does transformation and does not need to fit any internal parameters. class ...
apache-2.0
Python
06ca1c29d8c4c0ecb61a8679c8610d47516a7aec
Change version to 0.1.1
xsnippet/xsnippet-cli
xsnippet_cli/__init__.py
xsnippet_cli/__init__.py
# coding: utf-8 """ xsnippet_cli ~~~~~~~~~~~~ **xsnippet-cli** is a simple command line interface for interacting with Xsnippet_ service. By means this script, you can easily post and receive Snippets directly from your terminal. Usage ----- It's very easy to use. You can paste the s...
# coding: utf-8 """ xsnippet_cli ~~~~~~~~~~~~ **xsnippet-cli** is a simple command line interface for interacting with Xsnippet_ service. By means this script, you can easily post and receive Snippets directly from your terminal. Usage ----- It's very easy to use. You can paste the s...
bsd-3-clause
Python
6e1d817cadfe377afaaf2a0de6977df180fb3266
update __init__
jbogaardt/chainladder-python,jbogaardt/chainladder-python
chainladder/__init__.py
chainladder/__init__.py
# -*- coding: utf-8 -*- """ Created on Sat Jun 17 07:08:08 2017 @author: jboga """ from pandas import DataFrame, Series, concat, pivot_table, read_pickle import matplotlib.pyplot as plt #import seaborn as sns import os print('Welcome to chainladder') __all__ = ['Triangles', 'ChainLadder', 'MackChainLadderFunctions'...
# -*- coding: utf-8 -*- """ Created on Sat Jun 17 07:08:08 2017 @author: jboga """ from pandas import DataFrame, Series, concat, pivot_table, read_pickle import matplotlib.pyplot as plt import seaborn as sns import os print('Welcome to chainladder') __all__ = ['Triangles', 'ChainLadder', 'MackChainLadderFunctions']...
mit
Python
246376398141a0ccf19b1477460aac11f63f301d
use PYGAME
ciappi/Yaranullin
yaranullin/run_client.py
yaranullin/run_client.py
# yaranullin/run_client.py # # Copyright (c) 2012 Marco Scopesi <marco.scopesi@gmail.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWAR...
# yaranullin/run_client.py # # Copyright (c) 2012 Marco Scopesi <marco.scopesi@gmail.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWAR...
isc
Python
6b9b2942ed15e4dfdc12b493d53a0d4d293bf3f1
rename the event
AppEnlight/channelstream,AppEnlight/channelstream,AppEnlight/channelstream
channelstream/events.py
channelstream/events.py
from pyramid.events import NewRequest from pyramid.events import subscriber @subscriber(NewRequest) def use_prefix(event): # rewrite prefix if X-Script-Name header is present script_name = event.request.headers.get('X_SCRIPT_NAME', '') if script_name: event.request.environ['SCRIPT_NAME'] = script_...
from pyramid.events import NewRequest from pyramid.events import subscriber @subscriber(NewRequest) def mysubscriber(event): # rewrite prefix if X-Script-Name header is present script_name = event.request.headers.get('X_SCRIPT_NAME', '') if script_name: event.request.environ['SCRIPT_NAME'] = scrip...
bsd-3-clause
Python
2f0a1b16103f14d30d633bd2f43b9be602492d86
Update getTeaspoon.py
sunjerry019/photonLauncher,sunjerry019/photonLauncher,sunjerry019/photonLauncher,sunjerry019/photonLauncher,sunjerry019/photonLauncher
helpers/getTeaspoon.py
helpers/getTeaspoon.py
import usbtmc class Teaspoon(): def __init__(self): self.spoon = usbtmc.Instrument(0x1313, 0x80f8) def ping(self,x, output = False): a = self.spoon.ask(x) if output: print(a) return a def test(self): return self.ping("*IDN?") def getTemperatureOnBoard...
import usbtmc class Teaspoon(): def __init__(self): self.spoon = usbtmc.Instrument(0x1313, 0x80f8) def ping(self,x, output = False): a = self.spoon.ask(x) if output: print(a) return a def test(self): return self.ping("*IDN?") def getTemperature(self):...
apache-2.0
Python
1472087702d7b1669a0f1ad71c5e96b7b5edb3c6
Bump version to 0.1.1
tillberg/gut,tillberg/gut,tillberg/gut
setup.py
setup.py
import os from setuptools import setup setup( name = "gut", version = "0.1.1", author = "Dan Tillberg", author_email = "dan@tillberg.us", description = ("Realtime bidirectional folder synchronization via modified git"), license = "ISC", keywords = "", url = "https://github.com/tillberg/...
import os from setuptools import setup setup( name = "gut", version = "0.1.1.dev3", author = "Dan Tillberg", author_email = "dan@tillberg.us", description = ("Realtime bidirectional folder synchronization via modified git"), license = "ISC", keywords = "", url = "https://github.com/till...
isc
Python
c6bdab4b1566eb3f59f8c005c6f623bc891b3d59
update version
brianzq/att-bill-splitter
setup.py
setup.py
# -*- coding:utf-8 -*- """Setup for att-bill-splitter.""" from setuptools import find_packages, setup setup( name='att-bill-splitter', # packages=['att-bill-splitter'], version='0.4', description='Parse AT&T bill and split wireless charges among users.', author='Brian Zhang', author_email='lea...
# -*- coding:utf-8 -*- """Setup for att-bill-splitter.""" from setuptools import find_packages, setup setup( name='att-bill-splitter', # packages=['att-bill-splitter'], version='0.3', description='Parse AT&T bill and split wireless charges among users.', author='Brian Zhang', author_email='lea...
mit
Python
06c7c7f2e4ffa22e3a441fccae627a7c546ec25c
Bump version to 1.2
truthy/botornot-python
setup.py
setup.py
from setuptools import setup setup(name='botometer', version='1.2', description='Check Twitter accounts for bot behavior', url='https://github.com/IUNetSci/botometer-python', download_url='https://github.com/IUNetSci/botometer-python/archive/1.0.zip', author='Clayton A Davis', autho...
from setuptools import setup setup(name='botometer', version='1.1', description='Check Twitter accounts for bot behavior', url='https://github.com/IUNetSci/botometer-python', download_url='https://github.com/IUNetSci/botometer-python/archive/1.0.zip', author='Clayton A Davis', autho...
mit
Python
ec1cbf654d8c280e3094a5917a696c84f1e1264f
Install as a script as well
locusf/PySocksipyChain,locusf/PySocksipyChain
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup VERSION = "2.00" setup( name = "SocksipyChain", version = VERSION, description = "A Python SOCKS/HTTP Proxy module", long_description = """\ This Python module allows you to create TCP connections through a chain of SOCKS or HTTP proxies without a...
#!/usr/bin/env python from distutils.core import setup VERSION = "2.00" setup( name = "SocksipyChain", version = VERSION, description = "A Python SOCKS/HTTP Proxy module", long_description = """\ This Python module allows you to create TCP connections through a chain of SOCKS or HTTP proxies without a...
bsd-3-clause
Python
029d30d15db1e0ecca5ca60f6f339331f686a4a9
change to slask dir before loading plugins
dorian1453/limbo,uilab-github/slask,akatrevorjay/slask,rizaon/limbo,kesre/slask,uilab-github/slask,sentinelleader/limbo,cmyr/debt-bot,serverdensity/sdbot,llimllib/limbo,ruhee/limbo,TetraEtc/limbo,NUKnightLab/slask,kylemsguy/limbo,signalnine/alanabot,joshshadowfax/slask,michaelMinar/limbo,palachu/sdbot,llimllib/limbo,Un...
slask.py
slask.py
from glob import glob import importlib import json import os import re import sys import traceback from flask import Flask, request app = Flask(__name__) curdir = os.path.dirname(os.path.abspath(__file__)) os.chdir(curdir) hooks = {} def init_plugins(): for plugin in glob('plugins/[!_]*.py'): print "plug...
from glob import glob import importlib import json import re import sys import traceback from flask import Flask, request app = Flask(__name__) hooks = {} def init_plugins(): for plugin in glob('plugins/[!_]*.py'): print "plugin: %s" % plugin try: mod = importlib.import_module(plugin.r...
mit
Python
eff3798bd9c8799e407a523ee24a3e0e3ebb6111
Use annoying foreign key to get userprofile
Inboxen/Inboxen,Inboxen/Inboxen,Inboxen/Inboxen,Inboxen/queue,Inboxen/Inboxen
tasks.py
tasks.py
import logging from datetime import datetime, timedelta from celery import task from pytz import utc from django.db import transaction from django.db.models import F from inboxen.models import Email, Inbox, User, Statistic log = logging.getLogger(__name__) @task(ignore_result=True) @transaction.atomic() def statis...
import logging from datetime import datetime, timedelta from celery import task from pytz import utc from django.db import transaction from django.db.models import F from inboxen.models import Email, Inbox, User, UserProfile, Statistic log = logging.getLogger(__name__) @task(ignore_result=True) @transaction.atomic...
agpl-3.0
Python
7e5a3d285e0e0e6561deef45875904ed4b26ae5e
allow wordlists to be specified
sarasafavi/release-namer
release_namer.py
release_namer.py
import random from argparse import ArgumentParser def options(): parser = ArgumentParser() parser.add_argument( '-l', '--letter', dest="letter", required=True, help="What letter should this release name start with?" ) parser.add_argument( '-a', ...
import random from argparse import ArgumentParser def options(): parser = ArgumentParser() parser.add_argument( '-l', '--letter', dest="letter", required=True, help="What letter should this release name start with?" ) return parser.parse_args() def get_sublist...
mit
Python
0398eec4acd732d144b57c3327a1227a4319c1ac
Update MLDB-1364_dataset_cant_be_overwritten.py
mldbai/mldb,mldbai/mldb,mldbai/mldb,mldbai/mldb,mldbai/mldb,mldbai/mldb,mldbai/mldb
testing/MLDB-1364_dataset_cant_be_overwritten.py
testing/MLDB-1364_dataset_cant_be_overwritten.py
# # MLDB-1364_dataset_cant_be_overwritten.py # Francois Maillet, 5 fevrier 2016 # This file is part of MLDB. Copyright 2016 Datacratic. All rights reserved. # import unittest mldb = mldb_wrapper.wrap(mldb) # noqa class MLDB1364Test(MldbUnitTest): @classmethod def setUpClass(self): # create a dummy ...
# # MLDB-1364_dataset_cant_be_overwritten.py # Francois Maillet, 5 fevrier 2016 # This file is part of MLDB. Copyright 2016 Datacratic. All rights reserved. # import unittest mldb = mldb_wrapper.wrap(mldb) # noqa class SampleTest(MldbUnitTest): @classmethod def setUpClass(self): # create a dummy da...
apache-2.0
Python
33922c93c66d236b238863bffd08a520456846b6
Fix the failing dns test on Windows
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
tests/integration/modules/test_win_dns_client.py
tests/integration/modules/test_win_dns_client.py
# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.unit import skipIf from tests.support.helpers import destructiveTest # Import Salt libs import salt.utils.platform @skipIf(not salt.utils.platf...
# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.unit import skipIf from tests.support.helpers import destructiveTest # Import Salt libs import salt.utils.platform @skipIf(not salt.utils.platf...
apache-2.0
Python
3da286b934dcb9da5f06a8e19342f74079e432ef
Make backing up to S3 use a year/month/date structure for backups, for S3 clients that 'fake' directory structures.
duointeractive/django-fabtastic
fabtastic/management/commands/ft_backup_db_to_s3.py
fabtastic/management/commands/ft_backup_db_to_s3.py
import os import datetime from django.core.management.base import BaseCommand from django.conf import settings from fabtastic import db from fabtastic.util.aws import get_s3_connection class Command(BaseCommand): help = 'Backs the DB up to S3. Make sure to run s3cmd --configure.' def handle(self, *args, **o...
import os from django.core.management.base import BaseCommand from django.conf import settings from fabtastic import db from fabtastic.util.aws import get_s3_connection class Command(BaseCommand): help = 'Backs the DB up to S3. Make sure to run s3cmd --configure.' def handle(self, *args, **options): ...
bsd-3-clause
Python
29cfa33e4efa348a463652460bd8a25b4152a671
Update logging
xgfone/pycom,xgfone/xutils
xutils/init_logging.py
xutils/init_logging.py
# encoding: utf-8 from __future__ import print_function, absolute_import, unicode_literals, division import logging def init_logging(logger=None, level="DEBUG", log_file="", init_handler=None, max_count=30, file_config=None, dict_config=None): # Initialize the argument logger with the arguments,...
# encoding: utf-8 from __future__ import print_function, absolute_import, unicode_literals, division import logging def init_logging(logger=None, level="DEBUG", log_file="", init_handler=None, max_count=30, file_config=None, dict_config=None): # Initialize the argument logger with the arguments, ...
mit
Python
d35bd019d99c8ef19012642339ddab1f4a631b8d
Fix broken imports after file namechange
ricomoss/django-fixtureless
fixtureless/tests/test_django_project/test_django_project/test_app/tests/__init__.py
fixtureless/tests/test_django_project/test_django_project/test_app/tests/__init__.py
from test_app.tests.test_generator import * from test_app.tests.test_factory import * from test_app.tests.test_utils import *
from test_app.tests.generator import * from test_app.tests.factory import * from test_app.tests.utils import *
mit
Python
3560fe959cbbe1de6cd4fb717c0e98eb69a66d6a
fix the fix :-D
openmaraude/APITaxi,openmaraude/APITaxi
APITaxi2/commands/hails.py
APITaxi2/commands/hails.py
import datetime import uuid from flask import Blueprint from APITaxi_models2 import db, Hail blueprint = Blueprint('commands_hails', __name__, cli_group=None) @blueprint.cli.command('compute_session_ids') def compute_session_ids(): """Iterate on hails in chronological order to assign them a session ID where m...
import datetime import uuid from flask import Blueprint, current_app from sqlalchemy import func from APITaxi_models2 import db, Hail blueprint = Blueprint('commands_hails', __name__, cli_group=None) @blueprint.cli.command('compute_session_ids') def compute_session_ids(): """Iterate on hails in chronological ...
agpl-3.0
Python
a6a58b0a18767217a43e2787e9dcc0dc33c7a1eb
Fix infrastructure tests
GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek
geotrek/infrastructure/factories.py
geotrek/infrastructure/factories.py
import factory from geotrek.common.utils.testdata import dummy_filefield_as_sequence from geotrek.core.factories import TopologyFactory, PointTopologyFactory from . import models class InfrastructureTypeFactory(factory.django.DjangoModelFactory): class Meta: model = models.InfrastructureType label ...
import factory from geotrek.common.utils.testdata import dummy_filefield_as_sequence from geotrek.core.factories import TopologyFactory, PointTopologyFactory from . import models class InfrastructureTypeFactory(factory.django.DjangoModelFactory): class Meta: model = models.InfrastructureType label ...
bsd-2-clause
Python
8a7928ca833ed5273d8a58cc6ee4f69dc8431fc6
rewrite create_sec_package
msbeta/apollo,msbeta/apollo,msbeta/apollo,msbeta/apollo,msbeta/apollo,msbeta/apollo
modules/tools/ota/create_sec_package.py
modules/tools/ota/create_sec_package.py
#!/usr/bin/env python ############################################################################### # Copyright 2017 The Apollo Authors. 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 ...
#!/usr/bin/env python import secure_upgrade_export as sec_api import os import sys sys.path.append('/home/caros/secure_upgrade/python') root_config_path = "/home/caros/secure_upgrade/config/secure_config.json" returnCode = sec_api.init_secure_upgrade(root_config_path) if returnCode == True: print 'Security enviro...
apache-2.0
Python
1700dd602c8f2df120c11f427f18e07f82ad1c1d
Remove archivaltool
Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org
Instanssi/urls.py
Instanssi/urls.py
# -*- coding: utf-8 -*- from django.conf.urls.defaults import patterns, include, url from django.contrib import admin from Instanssi import settings # Use admin panel admin.autodiscover() # URLS urlpatterns = patterns('', url(r'^2012/', include('Instanssi.main2012.urls')), url(r'^control/', include('Instanss...
# -*- coding: utf-8 -*- from django.conf.urls.defaults import patterns, include, url from django.contrib import admin from Instanssi import settings # Use admin panel admin.autodiscover() # URLS urlpatterns = patterns('', url(r'^2012/', include('Instanssi.main2012.urls')), url(r'^control/', include('Instanss...
mit
Python
4ea70f12aa6d7f86063998611d291ee03b8e727d
Implement database functionality in VirusManager
nsgomez/vboxmanager
VirusManager.py
VirusManager.py
import ManagedMachine import ReferenceMachine import models class VirusManager: def __init__(self, machine_limit = 16): self._reference_machines = {} self._managed_machines = {} self._machine_limit = machine_limit self._last_machine_action_time = -1 def initialize_from_databas...
import ManagedMachine import ReferenceMachine import models class VirusManager: def __init__(self, machine_limit = 16): self._reference_machines = [] self._managed_machines = [] self._machine_limit = machine_limit self._last_machine_action_time = -1 def _get_machine_limit(self...
mit
Python
29339e5098be783746a17306be78467e37c6a54d
Convert the list to a tuple
fitodic/centerline,fitodic/polygon-centerline,fitodic/centerline
centerline/__init__.py
centerline/__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from . import utils from .main import Centerline __all__ = ('utils', 'Centerline')
# -*- coding: utf-8 -*- from __future__ import unicode_literals from . import utils from .main import Centerline __all__ = ['utils', 'Centerline']
mit
Python
be5485c6777fd2bbcc4174960e0bf203a6ab1abe
Make SVM object pickleable
vismantic-ohtuprojekti/image-filtering-suite,vismantic-ohtuprojekti/qualipy
imgfilter/utils/svm.py
imgfilter/utils/svm.py
""" Wrapper for OpenCV's support vector machine implementation. """ import cv2 class StatModel(object): def __init__(self): self.fn = None def load(self, fn): self.fn = fn self.model.load(fn) def save(self, fn): self.model.save(fn) class SVM(StatModel): def __ini...
""" Wrapper for OpenCV's support vector machine implementation. """ import cv2 class StatModel(object): def load(self, fn): self.model.load(fn) def save(self, fn): self.model.save(fn) class SVM(StatModel): def __init__(self): """Initializes an SVM""" self.model = cv2....
mit
Python
1c07dd1adb044b6e399849cccf852a463ab1a30e
Update stand-alone tests to use test stage work directory (#24112)
LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/dssp/package.py
var/spack/repos/builtin/packages/dssp/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Dssp(AutotoolsPackage): """'mkdssp' utility. (dictionary of protein secondary structure)""...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Dssp(AutotoolsPackage): """'mkdssp' utility. (dictionary of protein secondary structure)""...
lgpl-2.1
Python
587426776ec1e3f04f620571477fd7f7cef30dbf
Install system is nearly done.
Nonpython/claw
install.py
install.py
#!/usr/bin/env python from shutil import copy from shutil import Error as CopyError from os import chmod, chown from os import getuid as GetProcessUID from stat import S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IXGRP from sys import exit as di...
#!/usr/bin/env python from shutil import copy from os import chmod, chown from os import getuid as GetProcessUID from stat import S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IXGRP from sys import exit as die from grp import getgrnam as GetGroupStructByName from pwd ...
apache-2.0
Python
c7f2c819a15ca3029731b93f24048fca0a788e09
add 1.18.1 (#9757)
LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack
var/spack/repos/builtin/packages/gdbm/package.py
var/spack/repos/builtin/packages/gdbm/package.py
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) # from spack import * class Gdbm(AutotoolsPackage): """GNU dbm (or GDBM, for short) is a library of database functio...
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) # from spack import * class Gdbm(AutotoolsPackage): """GNU dbm (or GDBM, for short) is a library of database functio...
lgpl-2.1
Python
3b24db92b5ea64814b1294fc6c9c982bbaa9b3c6
Update PAPI to 5.4.3
tmerrick1/spack,EmreAtes/spack,EmreAtes/spack,matthiasdiener/spack,krafczyk/spack,TheTimmy/spack,lgarren/spack,EmreAtes/spack,LLNL/spack,mfherbst/spack,tmerrick1/spack,krafczyk/spack,iulian787/spack,matthiasdiener/spack,lgarren/spack,EmreAtes/spack,mfherbst/spack,skosukhin/spack,lgarren/spack,lgarren/spack,iulian787/sp...
var/spack/repos/builtin/packages/papi/package.py
var/spack/repos/builtin/packages/papi/package.py
from spack import * import os class Papi(Package): """PAPI provides the tool designer and application engineer with a consistent interface and methodology for use of the performance counter hardware found in most major microprocessors. PAPI enables software engineers to see, in near real time,...
from spack import * import os class Papi(Package): """PAPI provides the tool designer and application engineer with a consistent interface and methodology for use of the performance counter hardware found in most major microprocessors. PAPI enables software engineers to see, in near real time,...
lgpl-2.1
Python
5a3dc61ba9a8bd84ca0ede970612b1f1017d08e8
Use contextlib.closing to wrap urllib.request
smspillaz/pubmed-retraction-analysis,smspillaz/pubmed-retraction-analysis,smspillaz/pubmed-retraction-analysis,smspillaz/pubmed-retraction-analysis
importer/downloader.py
importer/downloader.py
import contextlib import json import os import errno import sys from six.moves import urllib searchurl = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=Retracted+Publication&retmax=10&retmode=json" fetchurl = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?&db=pubmed&id=" request =...
import contextlib import json import os import errno import sys from six.moves import urllib searchurl = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=Retracted+Publication&retmax=10&retmode=json" fetchurl = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?&db=pubmed&id=" request =...
mit
Python
1d1a0e3d630358e5479df0b7d74a857717deb864
Update zstd version (#4873)
matthiasdiener/spack,LLNL/spack,skosukhin/spack,mfherbst/spack,skosukhin/spack,tmerrick1/spack,krafczyk/spack,mfherbst/spack,TheTimmy/spack,LLNL/spack,lgarren/spack,tmerrick1/spack,matthiasdiener/spack,lgarren/spack,iulian787/spack,tmerrick1/spack,matthiasdiener/spack,skosukhin/spack,tmerrick1/spack,EmreAtes/spack,LLNL...
var/spack/repos/builtin/packages/zstd/package.py
var/spack/repos/builtin/packages/zstd/package.py
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Python
97417984196fc7a99d2c81626a873669b80793c5
Fix help text
leukeleu/wagtail-startproject,leukeleu/wagtail-startproject
wagtailstartproject/project_template/runtests.py
wagtailstartproject/project_template/runtests.py
#!/usr/bin/env python import argparse import os import sys import django from django.conf import settings from django.test.runner import default_test_processes from django.test.utils import get_runner def runtests(): os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings' django.setup() if args.he...
#!/usr/bin/env python import argparse import os import sys import django from django.conf import settings from django.test.runner import default_test_processes from django.test.utils import get_runner def runtests(): os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings' django.setup() if args.he...
mit
Python
b7f10de6c63820bf0ef30e710c0283504d0464c9
Add tree copy program
paulkramme/backup
client/source/client.py
client/source/client.py
#!/usr/bin/python3 import os import sys import socket import shutil print("CLIENT BACKUP SOFTWARE") src = sys.argv[1] ip = sys.argv[2] dest = sys.argv[3] shutil.copytree(src, dest, symlinks = False, ignore = None)
#!/usr/bin/python3 import os import sys print("THIS IS THE CLIENT SERVER!") if sys.argc == 1: print("YOU DIDN'T GIVE ANY ARGS") elif sys.argc == 2: print(sys.argv[1]) elif sys.argc == 3: print(sys.argv[1], sys.argv[2])
mit
Python
2911b48da6b7e4c0aa7efe3a3c571e91b5ae9725
fix in style settings
Tejal011089/huntercamp_erpnext,pawaranand/phrerp,mbauskar/alec_frappe5_erpnext,indictranstech/focal-erpnext,suyashphadtare/sajil-final-erp,Tejal011089/trufil-erpnext,gangadharkadam/v4_erp,rohitwaghchaure/digitales_erpnext,gangadharkadam/verveerp,gangadharkadam/sher,Tejal011089/osmosis_erpnext,gangadharkadam/vlinkerp,4c...
website/doctype/style_settings/style_settings.py
website/doctype/style_settings/style_settings.py
# ERPNext - web based ERP (http://erpnext.com) # Copyright (C) 2012 Web Notes Technologies Pvt Ltd # # This program 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 yo...
# ERPNext - web based ERP (http://erpnext.com) # Copyright (C) 2012 Web Notes Technologies Pvt Ltd # # This program 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 yo...
agpl-3.0
Python
43682d74723566bdaa341abfd8176b63ba000fd8
Update setup.py
opencb/cellbase,opencb/cellbase,opencb/cellbase,opencb/cellbase,opencb/cellbase,opencb/cellbase,opencb/cellbase
clients/python/setup.py
clients/python/setup.py
try: from setuptools import setup except ImportError: from distutils.core import setup from codecs import open # To use a consistent encoding from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-...
try: from setuptools import setup except ImportError: from distutils.core import setup from codecs import open # To use a consistent encoding from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-...
apache-2.0
Python
4375a0c15993fa07cc53962772d362a4a77822ac
Change the way the event folder is loaded
cgwire/zou
zou/app/api.py
zou/app/api.py
import sys from zou.app.utils import events from .blueprints.assets import blueprint as assets_blueprint from .blueprints.auth import blueprint as auth_blueprint from .blueprints.crud import blueprint as crud_blueprint from .blueprints.files import blueprint as files_blueprint from .blueprints.export import blueprint...
import sys from zou.app.utils import events from .blueprints.assets import blueprint as assets_blueprint from .blueprints.auth import blueprint as auth_blueprint from .blueprints.crud import blueprint as crud_blueprint from .blueprints.files import blueprint as files_blueprint from .blueprints.export import blueprint...
agpl-3.0
Python
ba9d872e7001409cb5ccb53e0a40514cbf935750
Add check for buildbot.tac to make_manhole.py
eunchong/build,eunchong/build,eunchong/build,eunchong/build
scripts/tools/make_manhole.py
scripts/tools/make_manhole.py
#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Generate a .manhole for all masters.""" import getpass import os import optparse import subprocess import sys def check_outpu...
#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Generate a .manhole for all masters.""" import getpass import os import optparse import subprocess import sys def check_outpu...
bsd-3-clause
Python
d5e558bc21b8de360627aae3c7e8a15756c55d36
Update lr.py
konemshad/ML,mahesh-9/ML
ml/GLM/lr.py
ml/GLM/lr.py
""" Linear regression for multiple features """ __author__="Aakash" from ..numc import * class LR(): def fit(self,X,Y): if checkfit(X,Y): if not isinstance(X,np.ndarray):self.a=np.array(X) else:self.a=X inst=nx(self.a) self.feat=inst.add_col(col_no=0,val=1) self.target=Y self.theta=np.zeros(self.fe...
""" Linear regression for multiple features """ __author__="Aakash" from ..numc import * class LR(): def fit(self,X,Y): if checkfit(X,Y): if not isinstance(X,np.ndarray):self.a=np.array(X) else:self.a=X inst=nx(self.a) self.feat=inst.add_col(col_no=0,val=1) self.target=Y self.theta=np.zeros(self.fe...
mit
Python
aa85d9b8f1c04ee17f561f70bbe1b42023fa9f20
Check the result.
ohsu-qin/qipipe
test/unit/pipelines/test_group_dicom.py
test/unit/pipelines/test_group_dicom.py
from nose.tools import * import os, re, glob, shutil import logging logger = logging.getLogger(__name__) # The test parent directory. ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..')) # The test fixture. FIXTURE = os.path.join(ROOT, 'fixtures', 'staging', 'group_dicom') # The test results p...
from nose.tools import * import os, re, glob, shutil import logging logger = logging.getLogger(__name__) # The test parent directory. ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..')) # The test fixture. FIXTURE = os.path.join(ROOT, 'fixtures', 'staging', 'group_dicom') # The test results p...
bsd-2-clause
Python
59301620706265ab2fdbf09e43a2a7d9b26a1470
Rewrite the netstat module for whitelisting
SaltyCharles/Nova,HubbleStack/Nova,avb76/Nova
hubblestack_nova/modules/netstat.py
hubblestack_nova/modules/netstat.py
# -*- encoding: utf-8 -*- ''' Hubble Nova plugin for FreeBSD pkgng audit :maintainer: HubbleStack :maturity: 20160623 :platform: Unix :requires: SaltStack ''' from __future__ import absolute_import import copy import logging import salt.utils log = logging.getLogger(__name__) def __virtual__(): if 'network.ne...
# -*- encoding: utf-8 -*- ''' Hubble Nova plugin for FreeBSD pkgng audit :maintainer: HubbleStack :maturity: 20160428 :platform: Unix :requires: SaltStack ''' from __future__ import absolute_import import salt.utils import logging log = logging.getLogger(__name__) def __virtual__(): return True def audit(data...
apache-2.0
Python
2b0453595ab10a41a5068fc78e1c84f500973dc3
Store last github commit in `events` table
asivokon/mooch-sentinel,asivokon/mooch-sentinel,asivokon/mooch-sentinel,asivokon/mooch-sentinel
mooch/app.py
mooch/app.py
import sqlite3 from flask import Flask, jsonify, request app = Flask(__name__) def init_db(db): db.execute(""" CREATE TABLE if not exists events ( id INTEGER PRIMARY KEY, eventType TEXT, eventTime datetime, data BLOB, insertTime datetime default...
import sqlite3 from flask import Flask, jsonify app = Flask(__name__) def get_db(): return sqlite3.connect(":memory:") @app.route("/status") def status(): return jsonify({"okay": True, "GitHub": {"lastCommitTime": "2013-03-12T08:14:29-07:00"}}) @app.route("/hooks/github", methods=["POST"...
mit
Python
1ad267b7d70841930ff1dd9825bebd75e6b8fd5d
Check jenkins logs for failure text
foursquare/fsqio,foursquare/fsqio,foursquare/fsqio,foursquare/fsqio,foursquare/fsqio
src/python/fsqio/util/influx.py
src/python/fsqio/util/influx.py
# coding=utf-8 # Copyright 2015 Foursquare Labs Inc. All Rights Reserved. from __future__ import absolute_import from datetime import datetime import logging import requests logger = logging.getLogger(__name__) def _backslash_escape(value, to_escape): for char in to_escape: value = value.replace(char, '\\{...
# coding=utf-8 # Copyright 2015 Foursquare Labs Inc. All Rights Reserved. from __future__ import absolute_import from datetime import datetime import logging import requests logger = logging.getLogger(__name__) def _backslash_escape(value, to_escape): for char in to_escape: value = value.replace(char, '\\{...
apache-2.0
Python
7bb3cc0776ebca7bb786092aa63e6fe028c4b815
include pathlib
jpschewe/code-templates,jpschewe/code-templates,jpschewe/code-templates
python3.py
python3.py
#!/usr/bin/env python3 import warnings with warnings.catch_warnings(): import re import sys import argparse import os import os.path import logging import logging.config import json from pathlib import Path script_dir=os.path.abspath(os.path.dirname(__file__)) def get_logger(): ...
#!/usr/bin/env python3 import warnings with warnings.catch_warnings(): import re import sys import argparse import os import os.path import logging import logging.config import json script_dir=os.path.abspath(os.path.dirname(__file__)) def get_logger(): return logging.getLogger(__...
unlicense
Python
ec37eeda8e8491639d20b74c96192ef346cf4a12
Add more nutrients to NutritionFacts
nicksanders/django-usda,11craft/django-usda
usda/facts.py
usda/facts.py
from .models import Nutrient, NutrientData ENERGY = 208 TOTAL_FAT = 204 SATURATED_FAT = 606 TRANS_FAT = 605 CHOLESTEROL = 601 SODIUM = 307 CARBOHYDRATE = 205 DIETARY_FIBER = 291 SUGARS = 269 PROTEIN = 203 class NutritionFacts(object): def __init__(self, food, calories=None, grams=100): self.food = food...
from .models import Nutrient, NutrientData ENERGY = 208 TOTAL_FAT = 204 SATURATED_FAT = 606 TRANS_FAT = 605 class NutritionFacts(object): def __init__(self, food, calories=None, grams=100): self.food = food self._calories = calories self._grams = grams energy_nutrient = Nutrient...
bsd-3-clause
Python
663da62e24ee17f908392da3fafdd305f02e1b57
update todo
yasokada/python-151113-lineMonitor,yasokada/python-151113-lineMonitor
utilUdpCmd.py
utilUdpCmd.py
import time import socket from utilSetting import CSetting g_setting = CSetting() # TODO: 1> error handling > cmd typo etc # TODO: 0c> add utilCom.py > COM relay feature # TODO: 0m> move main() to linemonitor.py # TODO: 1> can recgonize the setting change (e.g. monip was changed to xxx) # TODO: 0z> python > static fu...
import time import socket from utilSetting import CSetting g_setting = CSetting() # TODO: 1> error handling > cmd typo etc # TODO: 0m> add COM relay feature # TODO: 0m> move main() to linemonitor.py # TODO: 1> can recgonize the setting change (e.g. monip was changed to xxx) # TODO: 0z> python > static function in a C...
mit
Python
63c1382f80250ca5df4c438e31a71ddae519a44a
Add list filter for searching
keithhackbarth/clowder_server,keithhackbarth/clowder_server,framewr/clowder_server,framewr/clowder_server,framewr/clowder_server,keithhackbarth/clowder_server,framewr/clowder_server,keithhackbarth/clowder_server
clowder_server/admin.py
clowder_server/admin.py
from django.contrib import admin from clowder_account.models import ClowderUser, ClowderUserAdmin from clowder_server.models import Alert, Ping admin.site.register(Alert) admin.site.register(ClowderUser, ClowderUserAdmin) @admin.register(Ping) class PingAdmin(admin.ModelAdmin): list_filter = ('user',)
from django.contrib import admin from clowder_account.models import ClowderUser, ClowderUserAdmin from clowder_server.models import Alert, Ping admin.site.register(Alert) admin.site.register(ClowderUser, ClowderUserAdmin) admin.site.register(Ping)
agpl-3.0
Python
94b9c664710f22d738368b9210bc9e87cc89eddf
fix the multiproc bug about --device-id
SeanNaren/deepspeech.pytorch
multiproc.py
multiproc.py
import subprocess import sys import torch argslist = list(sys.argv)[1:] world_size = torch.cuda.device_count() device_ids = None if '--device-ids' in argslist: # Manually specified GPU IDs device_ids = argslist[argslist.index('--device-ids') + 1].strip().split(',') world_size = len(device_ids) # Remove G...
import torch import sys import subprocess argslist = list(sys.argv)[1:] world_size = torch.cuda.device_count() device_ids = None if '--device-ids' in argslist: # Manually specified GPU IDs device_ids = argslist[argslist.index('--device-ids') + 1].strip().split(',') world_size = len(device_ids) # Remove GP...
mit
Python
6b698979593f3757d28142c864dd7cc2d3901807
Bump version to 0.7.0
clb6/jarvis-cli
jarvis_cli/__init__.py
jarvis_cli/__init__.py
__version__ = '0.7.0'
__version__ = '0.6.0'
apache-2.0
Python
3e9e220edfa7a68327ead38b49429d041b20b825
add db connectivity
daedaluschan/JinnyReminds
jinny_reminds_cfg.py
jinny_reminds_cfg.py
TOKEN = "" LIST_OF_ADMINS = []
TOKEN = "276751734:AAGKIcezPW046xYc006kWWWaIQgdnIwLhvs" LIST_OF_ADMINS = [161517202, 197627552]
mit
Python
939523f92e7fe74f2cda3908187dba98fbbe1abf
Update exclamation.py
amperser/proselint,jstewmon/proselint,amperser/proselint,jstewmon/proselint,amperser/proselint,amperser/proselint,jstewmon/proselint,amperser/proselint
proselint/checks/leonard/exclamation.py
proselint/checks/leonard/exclamation.py
# -*- coding: utf-8 -*- """Too much yelling. --- layout: post source: ??? source_url: ??? title: yelling date: 2014-06-10 12:31:19 categories: writing --- Too much yelling. """ from tools import existence_check, memoize @memoize def check_repeated_exclamations(text): """Check the text.""" ...
# -*- coding: utf-8 -*- """Too much yelling. --- layout: post source: ??? source_url: ??? title: yelling date: 2014-06-10 12:31:19 categories: writing --- Too much yelling. """ from tools import existence_check, memoize @memoize def check_repeated_exclamations(text): """Check the text.""" ...
bsd-3-clause
Python
5e3ee2d4687bed8afed041f6e26b28b05f2fb6b0
Fix test
dhomeier/astropy,bsipocz/astropy,DougBurke/astropy,MSeifert04/astropy,astropy/astropy,StuartLittlefair/astropy,stargaser/astropy,StuartLittlefair/astropy,bsipocz/astropy,joergdietrich/astropy,AustereCuriosity/astropy,pllim/astropy,dhomeier/astropy,mhvk/astropy,lpsinger/astropy,tbabej/astropy,astropy/astropy,pllim/astro...
astropy/io/votable/tests/exception_test.py
astropy/io/votable/tests/exception_test.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst from ....tests.helper import raises # LOCAL from .. import converters from .. import exceptions from .. import tree def test_reraise(): def fail(): raise RuntimeError("This failed") try: try: fail() except Ru...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from ....tests.helper import raises # LOCAL from .. import converters from .. import exceptions from .. import tree def test_reraise(): def fail(): raise RuntimeError("This failed") try: try: fail() except Ru...
bsd-3-clause
Python