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
7783146e9bae3c63f5b8292df509f862c33881be
Update admin.py
ulule/django-courriers,ulule/django-courriers
courriers/admin.py
courriers/admin.py
from django.contrib import admin from django.conf.urls.defaults import patterns, url from django.shortcuts import get_object_or_404 from django.utils.translation import ugettext as _ from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from .models import Newsletter, NewsletterItem...
from django.contrib import admin from django.conf.urls.defaults import patterns, url from django.shortcuts import get_object_or_404 from django.utils.translation import ugettext as _ from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from .models import Newsletter, NewsletterItem...
mit
Python
c3b9d523301e483c54ede4f519cdd4456ed54fe8
Add message_annotations to Interceptor object
ooici/pyon,scionrep/scioncc,mkl-/scioncc,ooici/pyon,crchemist/scioncc,scionrep/scioncc,mkl-/scioncc,scionrep/scioncc,mkl-/scioncc,crchemist/scioncc,crchemist/scioncc
pyon/core/interceptor/interceptor.py
pyon/core/interceptor/interceptor.py
class Invocation(object): """ Container object for parameters of events/messages passed to internal capability container processes """ # Event outbound processing path PATH_OUT = 'outgoing' # Event inbound processing path PATH_IN = 'incoming' def __init__(self, **kwargs): ...
class Invocation(object): """ Container object for parameters of events/messages passed to internal capability container processes """ # Event outbound processing path PATH_OUT = 'outgoing' # Event inbound processing path PATH_IN = 'incoming' def __init__(self, **kwargs): ...
bsd-2-clause
Python
8795815dd9e1ad1faf36359dc24659db9eebad1f
Update test_mixins.py,test_performance.py, test_dns.py to reflect changes in mixins.py. Added dns functional test, and trust classes
F5Networks/f5-common-python,F5Networks/f5-common-python,wojtek0806/f5-common-python
f5/bigip/sys/test/test_dns.py
f5/bigip/sys/test/test_dns.py
# Copyright 2016 F5 Networks Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
# Copyright 2016 F5 Networks Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
apache-2.0
Python
14b1648b96064363a833c496da38e62ffc9dbbcb
Revert splitString to former value
mpi2/PhenotypeData,mpi2/PhenotypeData,mpi2/PhenotypeData,mpi2/PhenotypeData,mpi2/PhenotypeData,mpi2/PhenotypeData
external_tools/src/main/python/images/common.py
external_tools/src/main/python/images/common.py
#!/usr/bin/python splitString='images/clean/impc/'
#!/usr/bin/python #splitString='images/clean/impc/' splitString='images/holding_area/impc/'
apache-2.0
Python
d6c9e40341b700360164b4f8673dc991e5fc61b5
Update extension
rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org
docs/doc_extensions.py
docs/doc_extensions.py
""" Read the Docs documentation extensions for Sphinx Adds the following roles: djangosetting Output an inline literal of the corresponding setting value. Useful for keeping documentation up to date without editing on settings changes. buildpyversions Output a comma separated list of the supported python...
""" Read the Docs documentation extensions for Sphinx Adds the following roles: djangosetting Output an inline literal of the corresponding setting value. Useful for keeping documentation up to date without editing on settings changes. buildpyversions Output a comma separated list of the supported python...
mit
Python
c81f5f85c30d8ca57b42d82829c36915e7aca605
Allow anyone to be winners
steakholders-tm/bingo-server
src/bingo_server/api/views.py
src/bingo_server/api/views.py
from rest_framework.mixins import CreateModelMixin, ListModelMixin, RetrieveModelMixin from rest_framework.viewsets import GenericViewSet, ModelViewSet from rest_framework.permissions import AllowAny from ..models import Game, GameType, Place, PrimaryCategory, SecondaryCategory, Tile, Winner from .serializers import G...
from rest_framework.mixins import CreateModelMixin, ListModelMixin, RetrieveModelMixin from rest_framework.viewsets import GenericViewSet from rest_framework.permissions import AllowAny from ..models import Game, GameType, Place, PrimaryCategory, SecondaryCategory, Tile, Winner from .serializers import GameSerializer,...
mit
Python
d492f17edc1e7d464242942f2c786337d8687304
Update binary-tree-maximum-path-sum.py
jaredkoontz/leetcode,yiwen-luo/LeetCode,yiwen-luo/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,yiwen-luo/LeetCode,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,jaredkoontz/leetcode,tudennis/LeetCode---kamyu104-11-24-2015,githubutilities/LeetCode,jaredkoontz/leetco...
Python/binary-tree-maximum-path-sum.py
Python/binary-tree-maximum-path-sum.py
# Time: O(n) # Space: O(h), h is height of binary tree # # Given a binary tree, find the maximum path sum. # # The path may start and end at any node in the tree. # # For example: # Given the below binary tree, # # 1 # / \ # 2 3 # Return 6. # # Definition for a binary tree node class TreeNode: ...
# Time: O(n) # Space: O(logn) # # Given a binary tree, find the maximum path sum. # # The path may start and end at any node in the tree. # # For example: # Given the below binary tree, # # 1 # / \ # 2 3 # Return 6. # # Definition for a binary tree node class TreeNode: def __init__(self, x)...
mit
Python
8ca26efbb9224c98c0d4f4e5300491f395c2f51b
use jcommon.*_langdb instead of self
Mstrodl/jose,lnmds/jose,Mstrodl/jose
ext/joselang.py
ext/joselang.py
#!/usr/bin/env python3 import discord import asyncio import sys sys.path.append("..") import jauxiliar as jaux import joseerror as je import josecommon as jcommon class JoseLanguage(jaux.Auxiliar): def __init__(self, cl): jaux.Auxiliar.__init__(self, cl) self.LANGLIST = [ 'pt', 'en' ...
#!/usr/bin/env python3 import discord import asyncio import sys sys.path.append("..") import jauxiliar as jaux import joseerror as je import josecommon as jcommon class JoseLanguage(jaux.Auxiliar): def __init__(self, cl): jaux.Auxiliar.__init__(self, cl) self.LANGLIST = [ 'pt', 'en' ...
mit
Python
011579ec11b97a1d1752bf59c60694019838c309
fix existance call to xml_config
davisd50/sparc.db
sparc/db/zodb/database.py
sparc/db/zodb/database.py
from ZODB import config from zope.component import createObject from zope.component import getUtility from zope.component.factory import Factory from zope.interface import alsoProvides from zope.interface import implements from interfaces import IZODBDatabase from zope.component._api import createObject from sparc.conf...
from ZODB import config from zope.component import createObject from zope.component import getUtility from zope.component.factory import Factory from zope.interface import alsoProvides from zope.interface import implements from interfaces import IZODBDatabase from zope.component._api import createObject from sparc.conf...
mit
Python
30c627c97b14eaecbf4f61a2d3ed01dd5ea1282d
Set version 2.5.0
atztogo/phonopy,atztogo/phonopy,atztogo/phonopy,atztogo/phonopy
phonopy/version.py
phonopy/version.py
# Copyright (C) 2013 Atsushi Togo # All rights reserved. # # This file is part of phonopy. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notic...
# Copyright (C) 2013 Atsushi Togo # All rights reserved. # # This file is part of phonopy. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
Python
29f10624bd398442ab3530215e0a73b362e0559d
Change url+checksums for libpng to official sourceforge archives (#23767)
LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/libpng/package.py
var/spack/repos/builtin/packages/libpng/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 Libpng(AutotoolsPackage): """libpng is the official PNG reference library.""" homepag...
# 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 Libpng(AutotoolsPackage): """libpng is the official PNG reference library.""" homepag...
lgpl-2.1
Python
218e76eab9ffdb3ce1cd0d58e6e8a02bab592251
Add moving wall to materials
mkondratyev85/pgm
gui/materials.py
gui/materials.py
import numpy as np materials = { "default": {"mu": 1, "rho": 1, "eta": 1, "C": 1, "sinphi": 1}, "magma": {"mu": 8 * 10**10, "rho": 2800, "eta": 10**16, "C": 10**7, "sinphi": 45}, "light magma": {"mu": 8 * 10**10, "rho": 2600, "eta": 10**13, "C": 10**7, "sinphi": 45}, "heavy magma": {"mu": 8 * 10**10, "...
import numpy as np materials = { "default": {"mu": 1, "rho": 1, "eta": 1, "C": 1, "sinphi": 1}, "magma": {"mu": 8 * 10**10, "rho": 2800, "eta": 10**16, "C": 10**7, "sinphi": 45}, "light magma": {"mu": 8 * 10**10, "rho": 2600, "eta": 10**13, "C": 10**7, "sinphi": 45}, "heavy magma": {"mu": 8 * 10**10, "...
mit
Python
fb6a2b5cabe284ecac5088c94fb2dba36f4a7e2e
edit prefix in Makefile for macOS (#10606)
LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack
var/spack/repos/builtin/packages/xxhash/package.py
var/spack/repos/builtin/packages/xxhash/package.py
# Copyright 2013-2019 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 Xxhash(MakefilePackage): """xxHash is an Extremely fast Hash algorithm, running at RAM spe...
# Copyright 2013-2019 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 Xxhash(MakefilePackage): """xxHash is an Extremely fast Hash algorithm, running at RAM spe...
lgpl-2.1
Python
abc22134a59318e2d93e67af09e4282a407fea54
Create code skeleton
samuel-phan/mssh-copy-id,samuel-phan/mssh-copy-id
msshcopyid/__init__.py
msshcopyid/__init__.py
from __future__ import print_function import argparse import getpass import os import sys DEFAULT_SSH_RSA = '~/.ssh/id_rsa' DEFAULT_SSH_DSA = '~/.ssh/id_dsa' def main(): mc = Main() mc.main() class Main(object): def __init__(self): self.args = None def main(self): # Parse input ...
# encoding: utf-8 import os import re import sys import paramiko #def main(): # print('mssh-copy-id entry point') # PS : y a pas des cons qui l'ont deja fait ? # https://pypi.python.org/pypi/ssh-deploy-key/0.1.1 # Constants hostFile = '/etc/hosts' # todo: test file exists/readable ? keyfile = os.getenv('HOME')+'/...
mit
Python
877b7de300e7290f555578fab9032456a135a51f
Tag new release: 3.1.17
Floobits/floobits-sublime,Floobits/floobits-sublime
floo/version.py
floo/version.py
PLUGIN_VERSION = '3.1.17' # The line above is auto-generated by tag_release.py. Do not change it manually. try: from .common import shared as G assert G except ImportError: from common import shared as G G.__VERSION__ = '0.11' G.__PLUGIN_VERSION__ = PLUGIN_VERSION
PLUGIN_VERSION = '3.1.16' # The line above is auto-generated by tag_release.py. Do not change it manually. try: from .common import shared as G assert G except ImportError: from common import shared as G G.__VERSION__ = '0.11' G.__PLUGIN_VERSION__ = PLUGIN_VERSION
apache-2.0
Python
5f9cdd3df91a6547d5b776c7f4ae8f23c53dfc48
remove dead line
data-refinery/data_refinery,data-refinery/data_refinery,data-refinery/data_refinery
foreman/data_refinery_foreman/surveyor/utils.py
foreman/data_refinery_foreman/surveyor/utils.py
import collections import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry def requests_retry_session( retries=3, backoff_factor=0.3, status_forcelist=(500, 502, 504), session=None, ): """ Exponential back off for requests. via http...
import collections import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry def requests_retry_session( retries=3, backoff_factor=0.3, status_forcelist=(500, 502, 504), session=None, ): """ Exponential back off for requests. via http...
bsd-3-clause
Python
0573a58f859133959b769a0081eca12121ca409f
Sort by priority in the admin changelist and make it editable.
mlavin/django-ad-code,mlavin/django-ad-code
adcode/admin.py
adcode/admin.py
"Admin customization for adcode models." from django.contrib import admin from adcode.models import Section, Size, Placement class PlacementInline(admin.StackedInline): model = Placement.sections.through class SectionAdmin(admin.ModelAdmin): list_display = ('name', 'pattern', 'priority', ) list_editab...
"Admin customization for adcode models." from django.contrib import admin from adcode.models import Section, Size, Placement class PlacementInline(admin.StackedInline): model = Placement.sections.through class SectionAdmin(admin.ModelAdmin): list_display = ('name', 'pattern', ) inlines = (PlacementInl...
bsd-2-clause
Python
d65a8e09068d66c8e7debeb0469aedc7bf03af13
Bump django.VERSION for RC 1.
kholidfu/django,ericfc/django,monetate/django,Endika/django,nemesisdesign/django,savoirfairelinux/django,Endika/django,dfunckt/django,AndrewGrossman/django,yigitguler/django,TimBuckley/effective_django,willhardy/django,irwinlove/django,vitan/django,runekaagaard/django-contrib-locking,erikr/django,hackerbot/DjangoDev,er...
django/__init__.py
django/__init__.py
VERSION = (1, 1, 0, 'rc', 1) def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) if VERSION[2]: version = '%s.%s' % (version, VERSION[2]) if VERSION[3:] == ('alpha', 0): version = '%s pre-alpha' % version else: version = '%s %s' % (version, VERSION[3]) if VER...
VERSION = (1, 1, 0, 'beta', 1) def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) if VERSION[2]: version = '%s.%s' % (version, VERSION[2]) if VERSION[3:] == ('alpha', 0): version = '%s pre-alpha' % version else: version = '%s %s' % (version, VERSION[3]) if V...
bsd-3-clause
Python
9c1dfaefa9f670abbb04daae5f9e6680c3ba14c6
read ser
cdutsov/meteo,cdutsov/meteo
add_to_files.py
add_to_files.py
from Adafruit_BME280 import * import paho.mqtt.client as paho import veml6070 import time broker = "127.0.0.1" port = 1883 def on_publish(client, userdata, result): # create function for callback print("data published \n") pass def main(): sensor = BME280(p_mode=BME280_OSAMPLE_8, t_mode=BME280_OSAMPLE...
from Adafruit_BME280 import * import paho.mqtt.client as paho import veml6070 import time import os, sys broker = "127.0.0.1" port = 1883 def on_publish(client, userdata, result): # create function for callback print("data published \n") pass def main(): sensor = BME280(p_mode=BME280_OSAMPLE_8, t_mode...
mit
Python
3800ce7132945424016c930a4e90e81dbb0afb37
bump version
aetros/aetros-cli
aetros/const.py
aetros/const.py
__version__ = '0.13.0' __prog__ = "aetros" class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' class JOB_STATUS: PROGRESS_STATUS_CREATED = 0 PROGRESS_STATUS_QU...
__version__ = '0.12.0' __prog__ = "aetros" class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' class JOB_STATUS: PROGRESS_STATUS_CREATED = 0 PROGRESS_STATUS_QU...
mit
Python
c28ca58537102a5caf549ac94bd3a1e49d0b0351
Add missing attributes to Poll and PollOption `__init__`
carpedm20/fbchat
fbchat/_poll.py
fbchat/_poll.py
# -*- coding: UTF-8 -*- from __future__ import unicode_literals import attr @attr.s(cmp=False) class Poll(object): """Represents a poll""" #: Title of the poll title = attr.ib() #: List of :class:`PollOption`, can be fetched with :func:`fbchat.Client.fetchPollOptions` options = attr.ib() #: ...
# -*- coding: UTF-8 -*- from __future__ import unicode_literals import attr @attr.s(cmp=False) class Poll(object): """Represents a poll""" #: ID of the poll uid = attr.ib(None, init=False) #: Title of the poll title = attr.ib() #: List of :class:`PollOption`, can be fetched with :func:`fbcha...
bsd-3-clause
Python
ace4c19a9e97ff74a1ee1f221e417fa95601c2b1
fix bug
wannaphongcom/fbchat,Bankde/fbchat,carpedm20/fbchat,JohnathonNow/fbchat,madsmtm/fbchat
fbchat/utils.py
fbchat/utils.py
import re import json from time import time from random import random, choice USER_AGENTS = [ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/601.1.10 (KHTML, like Gecko) Vers...
import re import json from time import time from random import random, choice USER_AGENTS = [ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/601.1.10 (KHTML, like Gecko) Vers...
bsd-3-clause
Python
bb104ac04e27e3354c4aebee7a0ca7e539232490
Use click.echo() for python 2.7 compatibility
eregs/regulations-parser,tadhg-ohiggins/regulations-parser,eregs/regulations-parser,tadhg-ohiggins/regulations-parser
regparser/commands/outline_depths.py
regparser/commands/outline_depths.py
import logging from regparser.tree.depth import optional_rules from regparser.tree.depth.derive import derive_depths import click logger = logging.getLogger(__name__) @click.command() @click.argument('markers', type=click.STRING, required=True) def outline_depths(markers) -> None: """ Infer an outline's st...
import logging from regparser.tree.depth import optional_rules from regparser.tree.depth.derive import derive_depths import click logger = logging.getLogger(__name__) @click.command() @click.argument('markers', type=click.STRING, required=True) def outline_depths(markers) -> None: """ Infer an outline's st...
cc0-1.0
Python
2bddfb82dde0ca4c9edd0e303a43e95618faf826
Add __hash__ so objects may be used in hashtable based datastructures
xenserver/python-libs,xenserver/python-libs
net/ifrename/macpci.py
net/ifrename/macpci.py
#!/usr/bin/env python # Copyright (c) 2012 Citrix Systems, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation; version 2.1 only. with the special # exception on linking described in fi...
#!/usr/bin/env python # Copyright (c) 2012 Citrix Systems, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation; version 2.1 only. with the special # exception on linking described in fi...
bsd-2-clause
Python
4d18e524f4ad3275492bfa6dfcf2d0a113d6dede
fix validate function not allowing exp, log, sin, ...
Neurosim-lab/netpyne,Neurosim-lab/netpyne,thekerrlab/netpyne
netpyne/specs/utils.py
netpyne/specs/utils.py
""" specs/utils.py Helper functions for high-level specifications Contributors: salvador dura@gmail.com """ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install...
""" specs/utils.py Helper functions for high-level specifications Contributors: salvador dura@gmail.com """ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install...
mit
Python
12bacecd27ecc49bf02567ff4d8404adb1ecd36c
remove API, find HLS via simple regex
bastimeyer/streamlink,streamlink/streamlink,melmorabity/streamlink,chhe/streamlink,gravyboat/streamlink,streamlink/streamlink,melmorabity/streamlink,chhe/streamlink,bastimeyer/streamlink,gravyboat/streamlink
src/streamlink/plugins/tv8.py
src/streamlink/plugins/tv8.py
import logging import re from streamlink.plugin import Plugin, pluginmatcher from streamlink.plugin.api import validate from streamlink.stream import HLSStream log = logging.getLogger(__name__) @pluginmatcher(re.compile( r'https?://www\.tv8\.com\.tr/canli-yayin' )) class TV8(Plugin): _re_hls = re.compile(r"...
import logging import re from streamlink.plugin import Plugin, pluginmatcher from streamlink.plugin.api import validate from streamlink.stream import HLSStream log = logging.getLogger(__name__) @pluginmatcher(re.compile( r'https?://www\.tv8\.com\.tr/canli-yayin' )) class TV8(Plugin): _player_schema = valida...
bsd-2-clause
Python
18c24c724603f443e0d42846696571d9a27c18e7
fix bad help text
dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq
corehq/apps/userreports/management/commands/rebuild_indicator_table.py
corehq/apps/userreports/management/commands/rebuild_indicator_table.py
from django.core.management.base import LabelCommand, CommandError from corehq.apps.userreports import tasks class Command(LabelCommand): help = "Rebuild a user configurable reporting table" args = '<indicator_config_id>' label = "" def handle(self, *args, **options): if len(args) < 1: ...
from django.core.management.base import LabelCommand, CommandError from corehq.apps.userreports import tasks class Command(LabelCommand): help = "Rebuild a user configurable reporting table" args = '<indicator_config_id>' label = "" def handle(self, *args, **options): if len(args) < 1: ...
bsd-3-clause
Python
1af2d7dbb26b4836d2dad2419468c2e1a8ba7c97
Call reload settings on handler init. This prevents an exception if we update status msg too quickly.
Floobits/plugin-common-python
handlers/base.py
handlers/base.py
try: from ... import editor except ValueError: from floo import editor from .. import msg, event_emitter, shared as G, utils BASE_FLOORC = '''# Floobits config # Logs messages to Sublime Text console instead of a special view #log_to_console 1 # Enables debug mode #debug 1 ''' class BaseHandler(event_emi...
try: from ... import editor except ValueError: from floo import editor from .. import msg, event_emitter, shared as G, utils BASE_FLOORC = '''# Floobits config # Logs messages to Sublime Text console instead of a special view #log_to_console 1 # Enables debug mode #debug 1 ''' class BaseHandler(event_emi...
apache-2.0
Python
b1b504ca45a1d685f6c8650f15fc2e907ccdf9f9
Update question_5.py
Nauqcaj/quiz-itp-w1
quiz-questions/question_5.py
quiz-questions/question_5.py
"""Intro to Python - Week 1 - Quiz.""" # Question 5 def calculate_tax(income): """Implement the code required to make this function work. Write a function `calculate_tax` that receives a number (`income`) and calculates how much of Federal taxes is due, according to the following table: | Incom...
"""Intro to Python - Week 1 - Quiz.""" # Question 5 def calculate_tax(income): """Implement the code required to make this function work. Write a function `calculate_tax` that receives a number (`income`) and calculates how much of Federal taxes is due, according to the following table: | Incom...
mit
Python
a50cbf369a1eb17ce5dd23882af96148ea262172
fix imcompatibility between json and model
AllanNozomu/tecsaladeaula,AllanNozomu/tecsaladeaula,mupi/tecsaladeaula,GustavoVS/timtec,AllanNozomu/tecsaladeaula,AllanNozomu/tecsaladeaula,virgilio/timtec,virgilio/timtec,mupi/tecsaladeaula,virgilio/timtec,hacklabr/timtec,mupi/timtec,GustavoVS/timtec,hacklabr/timtec,mupi/tecsaladeaula,GustavoVS/timtec,mupi/escolamupi,...
forum/models.py
forum/models.py
# -*- coding: utf-8 -*- from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings from django.template.defaultfilters import slugify from autoslug import AutoSlugField from core.models import Course, Lesson class Question(models.Model): title = models.Ch...
# -*- coding: utf-8 -*- from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings from django.template.defaultfilters import slugify from autoslug import AutoSlugField from core.models import Course, Lesson class Question(models.Model): title = models.Ch...
agpl-3.0
Python
a39bb013179b0b4f3749c1f9fc99f8f90706b36e
Add a couple more donation options
LukasBoersma/readthedocs.org,royalwang/readthedocs.org,nikolas/readthedocs.org,clarkperkins/readthedocs.org,GovReady/readthedocs.org,Tazer/readthedocs.org,singingwolfboy/readthedocs.org,gjtorikian/readthedocs.org,emawind84/readthedocs.org,techtonik/readthedocs.org,titiushko/readthedocs.org,espdev/readthedocs.org,raven4...
readthedocs/donate/models.py
readthedocs/donate/models.py
from django.db import models from django.utils.translation import ugettext_lazy as _ AMOUNT_CHOICES = ( (5, '$5'), (10, '$10'), (25, '$25'), (50, '1 Hour ($50)'), (100, '2 Hours ($100)'), (200, '4 Hours ($200)'), (400, '1 Day ($400)'), (800, '2 Days ($800)'), (1200, '3 Days ($1200)'...
from django.db import models from django.utils.translation import ugettext_lazy as _ AMOUNT_CHOICES = ( (5, '$5'), (10, '$10'), (25, '$25'), (50, '1 Hour ($50)'), (100, '2 Hours ($100)'), (200, '4 Hours ($200)'), (400, '1 Day ($400)'), (800, '2 Days ($800)'), (1200, '3 Days ($1200)'...
mit
Python
9e8009b501ca7001f5346b278cd59ad596e3ebe0
Bump version number to 0.2.1
Dalloriam/engel,Dalloriam/engel,Dalloriam/engel
popeui/__init__.py
popeui/__init__.py
__version__ = "0.2.1" from .application import Application, View
__version__ = "0.2.0" from .application import Application, View
mit
Python
5724ea0aa9d09b1af42f52e86a87dad4abda58e0
Remove search autosync from tests
rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org
readthedocs/settings/test.py
readthedocs/settings/test.py
from __future__ import absolute_import import os from .dev import CommunityDevSettings class CommunityTestSettings(CommunityDevSettings): SLUMBER_USERNAME = 'test' SLUMBER_PASSWORD = 'test' SLUMBER_API_HOST = 'http://localhost:8000' # A bunch of our tests check this value in a returned URL/Domain ...
from __future__ import absolute_import import os from .dev import CommunityDevSettings class CommunityTestSettings(CommunityDevSettings): SLUMBER_USERNAME = 'test' SLUMBER_PASSWORD = 'test' SLUMBER_API_HOST = 'http://localhost:8000' # A bunch of our tests check this value in a returned URL/Domain ...
mit
Python
19fff3f8c5e7cda590ad578638aec09349d09f11
make username unique
tschaume/global_gitfeed_api,tschaume/global_gitfeed_api
api/__init__.py
api/__init__.py
import os, bcrypt from eve import Eve from flask.ext.bootstrap import Bootstrap from eve_docs import eve_docs from eve.auth import BasicAuth class BCryptAuth(BasicAuth): def check_auth(self, username, password, allowed_roles, resource, method): accounts = app.data.driver.db['accounts'] account = accounts.fin...
import os, bcrypt from eve import Eve from flask.ext.bootstrap import Bootstrap from eve_docs import eve_docs from eve.auth import BasicAuth class BCryptAuth(BasicAuth): def check_auth(self, username, password, allowed_roles, resource, method): accounts = app.data.driver.db['accounts'] account = accounts.fin...
mit
Python
4fe3840d3297df2a158a3fd15d3de7a2e4da86aa
reorganize url patterns
desec-io/desec-stack,desec-io/desec-stack,desec-io/desec-stack,desec-io/desec-stack
api/api/urls.py
api/api/urls.py
from django.conf.urls import include, url from desecapi import views from rest_framework.routers import SimpleRouter tokens_router = SimpleRouter() tokens_router.register(r'', views.TokenViewSet, base_name='token') auth_urls = [ url(r'^users/create/$', views.UserCreateView.as_view(), name='user-create'), # depre...
from django.conf.urls import include, url from rest_framework.urlpatterns import format_suffix_patterns from desecapi import views from rest_framework.routers import SimpleRouter tokens_router = SimpleRouter() tokens_router.register(r'', views.TokenViewSet, base_name='token') tokens_urls = tokens_router.urls apiurls ...
mit
Python
a49e09ab00311a08296ce830443cc1b06338a502
Update comments
etgalloway/powershellmagic
powershellmagic.py
powershellmagic.py
"""IPython magics for Windows PowerShell. """ __version__ = '0.1' import atexit import os from subprocess import Popen, PIPE import sys import tempfile from IPython.core.magic import (cell_magic, Magics, magics_class) from IPython.core.magic_arguments import ( argument, magic_arguments, parse_argstring) @magics...
"""IPython magics for Windows PowerShell. """ __version__ = '0.1' import atexit import os from subprocess import Popen, PIPE import sys import tempfile from IPython.core.magic import (cell_magic, Magics, magics_class) from IPython.core.magic_arguments import ( argument, magic_arguments, parse_argstring) @magics...
bsd-3-clause
Python
d156f31e901887beb444d9b3eb6a3f5da1ec3394
remove periodic task from indicators until we can fix it
dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,SEL-Columbia/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,SEL-Columbia/commcare-hq,puttara...
mvp/tasks.py
mvp/tasks.py
from celery.schedules import crontab, schedule from celery.task import periodic_task, task from mvp.management.commands import mvp_update_existing #@periodic_task(run_every=crontab(minute=0, hour=[0, 12])) def update_mvp_indicators(): update_existing = mvp_update_existing.Command() update_existing.handle()
from celery.schedules import crontab, schedule from celery.task import periodic_task, task from mvp.management.commands import mvp_update_existing @periodic_task(run_every=crontab(minute=0, hour=[0, 12])) def update_mvp_indicators(): update_existing = mvp_update_existing.Command() update_existing.handle()
bsd-3-clause
Python
abd1e46a0c3862977a1333cb1ce567c28c02a0a6
Make files attachments not required
Hackfmi/Diaphanum,Hackfmi/Diaphanum
projects/models.py
projects/models.py
# -*- encoding:utf-8 -*- from datetime import date from django.db import models class Project(models.Model): STATUS = ( ('unrevised', u'Неразгледан'), ('returned', u'Върнат за корекция'), ('pending', u'Предстои да бъде разгледан на СИС'), ('approved', u'Разгледан и одобрен на СИС')...
# -*- encoding:utf-8 -*- from datetime import date from django.db import models class Project(models.Model): STATUS = ( ('unrevised', u'Неразгледан'), ('returned', u'Върнат за корекция'), ('pending', u'Предстои да бъде разгледан на СИС'), ('approved', u'Разгледан и одобрен на СИС...
mit
Python
4e30a21a4e17304582724714f0be6c7a8e2c1852
Add image field to project
City-of-Helsinki/devheldev,terotic/devheldev,terotic/devheldev,terotic/devheldev,City-of-Helsinki/devheldev,City-of-Helsinki/devheldev
projects/models.py
projects/models.py
from django.db import models from wagtail.wagtailcore.models import Page, Orderable from wagtail.wagtailcore.fields import RichTextField from wagtail.wagtailadmin.edit_handlers import FieldPanel, InlinePanel from wagtail.wagtailsearch import index from modelcluster.fields import ParentalKey class ProjectPage(Ordera...
from django.db import models from wagtail.wagtailcore.models import Page, Orderable from wagtail.wagtailcore.fields import RichTextField from wagtail.wagtailadmin.edit_handlers import FieldPanel, InlinePanel from wagtail.wagtailsearch import index from modelcluster.fields import ParentalKey class ProjectPage(Ordera...
agpl-3.0
Python
3f71420b2711bdaf721ca6db87d806093811bb5b
Fix detection of make(1) result
mjhanninen/oldfart,mjhanninen/oldfart,mjhanninen/oldfart
py/oldfart/make.py
py/oldfart/make.py
import os import re import subprocess __all__ = ['NOTHING_DONE', 'SUCCESS', 'NO_RULE', 'FAILURE', 'Maker'] NOTHING_DONE = 1 SUCCESS = 2 NO_RULE = 3 FAILURE = 4 def _occur(fmt, needle, haystack): return bool(re.search(('^' + fmt + '$').format(needle), haystack, re.MULTILINE)) class ...
import os import re import subprocess __all__ = ['NOTHING_DONE', 'SUCCESS', 'NO_RULE', 'FAILURE', 'Maker'] NOTHING_DONE = 1 SUCCESS = 2 NO_RULE = 3 FAILURE = 4 class Maker(object): def __init__(self, project_dir='.', makefile='Makefile'): self.project_dir = os.path.abspath(project_dir) self.m...
bsd-3-clause
Python
5961a841acbfac7aed64056f9be8078ed2338410
Update the version ID.
jeremiedecock/pyax12,jeremiedecock/pyax12
pyax12/__init__.py
pyax12/__init__.py
# PyAX-12 # The MIT License # # Copyright (c) 2010,2015 Jeremie DECOCK (http://www.jdhp.org) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitati...
# PyAX-12 # The MIT License # # Copyright (c) 2010,2015 Jeremie DECOCK (http://www.jdhp.org) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitati...
mit
Python
e0a212bd9c0729a635ca1adfaa3e18d79e601c03
Bump version to 1.5.2
cloudControl/pycclib,cloudControl/pycclib
pycclib/version.py
pycclib/version.py
# -*- coding: utf-8 -*- __version__ = '1.5.2'
# -*- coding: utf-8 -*- __version__ = '1.5.1'
apache-2.0
Python
230ce1c38e1bba7c69fd774d83d17a8014cd4aeb
Use a generator instead of a list in get_unused_ips
agdsn/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,agdsn/pycroft
pycroft/lib/net.py
pycroft/lib/net.py
# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. from itertools import islice from ipaddr import IPv4Address, IPv6Address, IPv4Network, IPv6Network import sys ...
# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. from itertools import islice from ipaddr import IPv4Address, IPv6Address, IPv4Network, IPv6Network import sys ...
apache-2.0
Python
d1ce4a7aba39e76e2c8ab2d4d5cca75b1a55889a
Increase version number.
alejandroautalan/pygubu,alejandroautalan/pygubu
pygubu/__init__.py
pygubu/__init__.py
# encoding: utf8 from __future__ import unicode_literals __all__ = ['Builder', 'TkApplication', 'BuilderObject', 'register_widget', 'register_property', 'remove_binding', 'ApplicationLevelBindManager'] import pygubu.builder.builderobject from pygubu.builder import Builder from pygubu.builder.builderobject ...
# encoding: utf8 from __future__ import unicode_literals __all__ = ['Builder', 'TkApplication', 'BuilderObject', 'register_widget', 'register_property', 'remove_binding', 'ApplicationLevelBindManager'] import pygubu.builder.builderobject from pygubu.builder import Builder from pygubu.builder.builderobject ...
mit
Python
36a9bec0d616d3d0e9ea1aaa6285226492817005
Comment clarifications in examples/basic_volume_usage.py
joferkington/python-geoprobe
examples/basic_volume_usage.py
examples/basic_volume_usage.py
""" A quick example of viewing data stored in a geoprobe volume file. """ import os import numpy as np import matplotlib.pyplot as plt import geoprobe def main(): # Path to the example data dir relative to the location of this script. # This is just so that the script can be called from a different directory...
""" A quick example of viewing data stored in a geoprobe volume file. """ import os import numpy as np import matplotlib.pyplot as plt import geoprobe def main(): # Path to the example data dir relative to the location of this script. datadir = os.path.dirname(__file__) + '/data/' # Read an existing geo...
mit
Python
9da303e48820e95e1bfd206f1c0372f896dac6ec
Allow enum to be created more easily
springload/draftjs_exporter,springload/draftjs_exporter,springload/draftjs_exporter
draftjs_exporter/constants.py
draftjs_exporter/constants.py
from __future__ import absolute_import, unicode_literals # http://stackoverflow.com/a/22723724/1798491 class Enum(object): def __init__(self, *elements): self.elements = tuple(elements) def __getattr__(self, name): if name not in self.elements: raise AttributeError("'Enum' has no ...
from __future__ import absolute_import, unicode_literals # http://stackoverflow.com/a/22723724/1798491 class Enum(object): def __init__(self, tuple_list): self.tuple_list = tuple_list def __getattr__(self, name): if name not in self.tuple_list: raise AttributeError("'Enum' has no ...
mit
Python
6cb3d7e9e95cc009579260d67a4525f17c8508cd
comment out the code
yarden-livnat/regulus
regulus/alg/alg.py
regulus/alg/alg.py
# from regulus.core.cache import Cache # from regulus.models import NullModel # # # def model_cache(model): # return Cache(key=lambda n: n.data.id, # factory=lambda n: model(n.data) if n.data.id is not -1 else NullModel()) # # # def compute_model(dataset, model, cache=None): # if cache is None:...
from regulus.topo.cache import Cache from regulus.models import NullModel # from regulus.tree import reduce_tree Node # from regulus.topo import Partition def model_cache(model): return Cache(key=lambda n: n.data.id, factory=lambda n: model(n.data) if n.data.id is not -1 else NullModel()) def co...
bsd-3-clause
Python
2d3b27d7d4f787513a31b5a3650febd15ffa98ed
fix missing key in repo templates
ghxandsky/ceph-deploy,rtulke/ceph-deploy,zhouyuan/ceph-deploy,branto1/ceph-deploy,alfredodeza/ceph-deploy,SUSE/ceph-deploy-to-be-deleted,alfredodeza/ceph-deploy,codenrhoden/ceph-deploy,zhouyuan/ceph-deploy,isyippee/ceph-deploy,shenhequnying/ceph-deploy,trhoden/ceph-deploy,ghxandsky/ceph-deploy,SUSE/ceph-deploy,branto1/...
ceph_deploy/util/templates.py
ceph_deploy/util/templates.py
ceph_repo = """ [ceph] name=Ceph packages for $basearch baseurl={repo_url}/$basearch enabled=1 gpgcheck=1 priority=1 type=rpm-md gpgkey={gpg_url} [ceph-noarch] name=Ceph noarch packages baseurl={repo_url}/noarch enabled=1 gpgcheck=1 priority=1 type=rpm-md gpgkey={gpg_url} [ceph-source] name=Ceph source packages bas...
ceph_repo = """ [ceph] name=Ceph packages for $basearch baseurl={repo_url}/$basearch enabled=1 gpgcheck=1 priority=1 type=rpm-md gpgkey={gpg_url} [ceph-noarch] name=Ceph noarch packages baseurl={repo_url}/noarch enabled=1 gpgcheck=1 priority=1 type=rpm-md gpgkey={gpg_url} [ceph-source] name=Ceph source packages bas...
mit
Python
61abbfb28ceb134f514ed2b3fd2757366df01246
attach isoline filter via timer
RebeccaWPerry/vispy,jdreaver/vispy,QuLogic/vispy,drufat/vispy,inclement/vispy,bollu/vispy,dchilds7/Deysha-Star-Formation,Eric89GXL/vispy,bollu/vispy,srinathv/vispy,jdreaver/vispy,ghisvail/vispy,ghisvail/vispy,QuLogic/vispy,ghisvail/vispy,RebeccaWPerry/vispy,inclement/vispy,inclement/vispy,kkuunnddaannkk/vispy,RebeccaWP...
examples/basics/scene/contour.py
examples/basics/scene/contour.py
# -*- coding: utf-8 -*- # vispy: gallery 30 # ----------------------------------------------------------------------------- # Copyright (c) 2015, Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # -----------------------------------------------------...
# -*- coding: utf-8 -*- # vispy: gallery 30 # ----------------------------------------------------------------------------- # Copyright (c) 2015, Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # -----------------------------------------------------...
bsd-3-clause
Python
a8e51f540cbfd3ab8800f6d2c5de98200b03d028
remove redundant components from service
inveniosoftware/invenio-communities,inveniosoftware/invenio-communities,inveniosoftware/invenio-communities,inveniosoftware/invenio-communities
invenio_communities/communities/service_config.py
invenio_communities/communities/service_config.py
# -*- coding: utf-8 -*- # # Copyright (C) 2020 CERN. # Copyright (C) 2020 Northwestern University. # # Invenio-Records-Resources is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more # details. """Invenio Communities Service API config.""" from flas...
# -*- coding: utf-8 -*- # # Copyright (C) 2020 CERN. # Copyright (C) 2020 Northwestern University. # # Invenio-Records-Resources is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more # details. """Invenio Communities Service API config.""" from flas...
mit
Python
722c17992ea9cd7949a2ca02d7aa1c8a2d10a312
Fix path for pathfinder test files.
Bismarrck/pymatgen,setten/pymatgen,mbkumar/pymatgen,tallakahath/pymatgen,dongsenfo/pymatgen,matk86/pymatgen,ndardenne/pymatgen,davidwaroquiers/pymatgen,montoyjh/pymatgen,aykol/pymatgen,richardtran415/pymatgen,richardtran415/pymatgen,mbkumar/pymatgen,fraricci/pymatgen,nisse3000/pymatgen,czhengsci/pymatgen,tschaume/pymat...
pymatgen/analysis/tests/test_path_finder.py
pymatgen/analysis/tests/test_path_finder.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import division from __future__ import absolute_import from __future__ import unicode_literals import os import unittest from pymatgen.analysis.path_finder import NEBPathfinder, ChgcarPotential from pymatgen.io.vasp im...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import division from __future__ import absolute_import from __future__ import unicode_literals import os import unittest from pymatgen.analysis.path_finder import NEBPathfinder, ChgcarPotential from pymatgen.io.vasp im...
mit
Python
4f49394a5bf457de2952194a1900726c3908b6da
build python eggs, too
ImmobilienScout24/python-cloudwatchlogs-logging
build.py
build.py
# CloudWatchLogs Logging # Copyright 2015 Immobilien Scout GmbH # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
# CloudWatchLogs Logging # Copyright 2015 Immobilien Scout GmbH # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
apache-2.0
Python
d1104d581b0b28f086461a826753dc6fa8ac5db0
Change project name
hekima/zahpee-api-python-client
build.py
build.py
from pybuilder.core import init, use_plugin, task, depends, description # Core build plugins use_plugin("python.core") use_plugin("python.distutils") use_plugin("python.install_dependencies") use_plugin("exec") # Testing plugins use_plugin("python.unittest") use_plugin("python.integrationtest") use_plugin("python.co...
from pybuilder.core import init, use_plugin, task, depends, description # Core build plugins use_plugin("python.core") use_plugin("python.distutils") use_plugin("python.install_dependencies") use_plugin("exec") # Testing plugins use_plugin("python.unittest") use_plugin("python.integrationtest") use_plugin("python.co...
mit
Python
f45e38cba0a61815b29ecc0ec9d503e289343961
add lru_cache import, bump version
arnehilmann/yum-repos,arnehilmann/yumrepos,arnehilmann/yum-repos,arnehilmann/yumrepos
build.py
build.py
from pybuilder.core import use_plugin, init, Author, task use_plugin("python.core") use_plugin("python.unittest") use_plugin("python.integrationtest") use_plugin("python.install_dependencies") use_plugin("python.flake8") use_plugin("python.coverage") use_plugin("python.distutils") use_plugin('copy_resources') use_plug...
from pybuilder.core import use_plugin, init, Author, task use_plugin("python.core") use_plugin("python.unittest") use_plugin("python.integrationtest") use_plugin("python.install_dependencies") use_plugin("python.flake8") use_plugin("python.coverage") use_plugin("python.distutils") use_plugin('copy_resources') use_plug...
apache-2.0
Python
3c029ad25c2066ecb484ea6dfb7c9887ea0a2101
Raise exception on docker-build error
dincamihai/salt-toaster,dincamihai/salt-toaster
build.py
build.py
import re import argparse from utils import build_docker_image def main(): parser = argparse.ArgumentParser() parser.add_argument('--nocache', action='store_true', default=False) parser.add_argument('--nopull', action='store_true', default=False) args = parser.parse_args() content = '' stream ...
import re import argparse from utils import build_docker_image def main(): parser = argparse.ArgumentParser() parser.add_argument('--nocache', action='store_true', default=False) parser.add_argument('--nopull', action='store_true', default=False) args = parser.parse_args() content = '' stream ...
mit
Python
b3a57443f58caf6be930d00e7f8805fd0e64e80a
bump the version
ceph/remoto,alfredodeza/remoto
remoto/__init__.py
remoto/__init__.py
from .connection import Connection __version__ = '0.0.10'
from .connection import Connection __version__ = '0.0.9'
mit
Python
fbccef017f48628c3f2e1457f21c38ba4d4fa90c
fix HAIL_GENETICS_IMAGES variable (#11117)
hail-is/hail,hail-is/hail,hail-is/hail,hail-is/hail,hail-is/hail,hail-is/hail,hail-is/hail,hail-is/hail
hail/python/hailtop/batch/hail_genetics_images.py
hail/python/hailtop/batch/hail_genetics_images.py
HAIL_GENETICS = 'hailgenetics/' HAIL_GENETICS_IMAGES = [ HAIL_GENETICS + name for name in ('hail', 'genetics', 'python-dill')]
HAIL_GENETICS = 'hailgenetics/' HAIL_GENETICS_IMAGES = ( HAIL_GENETICS + name for name in ('hail', 'genetics', 'python-dill'))
mit
Python
1c28a7cd116363e769dffc17d9b9ae951f0bcf20
Add test for Literal value property
vmuriart/python-sql
sql/tests/test_literal.py
sql/tests/test_literal.py
# -*- coding: utf-8 -*- # # Copyright (c) 2011-2013, Cédric Krier # Copyright (c) 2011-2013, B2CK # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain...
# -*- coding: utf-8 -*- # # Copyright (c) 2011-2013, Cédric Krier # Copyright (c) 2011-2013, B2CK # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain...
bsd-3-clause
Python
e9f4f2ae5ab6585b246668628b0f0eed332b76b4
Fix error message of assert_one to report the correct expected value
spodkowinski/cassandra-dtest,beobal/cassandra-dtest,riptano/cassandra-dtest,mambocab/cassandra-dtest,iamaleksey/cassandra-dtest,bdeggleston/cassandra-dtest,stef1927/cassandra-dtest,blerer/cassandra-dtest,mambocab/cassandra-dtest,spodkowinski/cassandra-dtest,iamaleksey/cassandra-dtest,aweisberg/cassandra-dtest,carlyeks/...
assertions.py
assertions.py
import re from cassandra import InvalidRequest, Unavailable, ConsistencyLevel, WriteTimeout, ReadTimeout from cassandra.query import SimpleStatement from tools import rows_to_list def assert_unavailable(fun, *args): try: if len(args) == 0: fun(None) else: fun(*args) exce...
import re from cassandra import InvalidRequest, Unavailable, ConsistencyLevel, WriteTimeout, ReadTimeout from cassandra.query import SimpleStatement from tools import rows_to_list def assert_unavailable(fun, *args): try: if len(args) == 0: fun(None) else: fun(*args) exce...
apache-2.0
Python
bbeaf90677970bf39fad21321f9a4b16418b8894
Complete recur sol
bowen0701/algorithms_data_structures
lc0116_populating_next_right_pointers_in_each_node.py
lc0116_populating_next_right_pointers_in_each_node.py
"""Leetcode 116. Populating Next Right Pointers in Each Node Medium URL: https://leetcode.com/problems/populating-next-right-pointers-in-each-node/ You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition: struct Node ...
"""Leetcode 116. Populating Next Right Pointers in Each Node Medium URL: https://leetcode.com/problems/populating-next-right-pointers-in-each-node/ You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition: struct Node ...
bsd-2-clause
Python
217cd5e0847031df41274acc2bb5463e09870219
Add help to memcached
gelbander/blues,andreif/blues,chrippa/blues,chrippa/blues,andreif/blues,Sportamore/blues,jocke-l/blues,adisbladis/blues,jocke-l/blues,chrippa/blues,andreif/blues,adisbladis/blues,Sportamore/blues,5monkeys/blues,Sportamore/blues,gelbander/blues,gelbander/blues,5monkeys/blues,adisbladis/blues,jocke-l/blues,5monkeys/blues
blues/memcached.py
blues/memcached.py
""" Memcached settings: memcached: size: 256 # Cache size in mb (Default: 64) bind: 1.2.3.4 # Force memcached bind to address (Default: listen to all) """ from fabric.decorators import task from refabric.api import run, info from refabric.context_managers import sudo, silent from refabric.contrib imp...
from fabric.decorators import task from refabric.api import run, info from refabric.context_managers import sudo, silent from refabric.contrib import blueprints from . import debian __all__ = ['start', 'stop', 'restart', 'status', 'setup', 'configure', 'flush'] blueprint = blueprints.get(__name__) start = debian....
mit
Python
6b7d7c1ae04cd00f06f05d8c5d55b2f8776bb1b2
Fix skp listing
bpsinc-native/src_third_party_trace-viewer,bpsinc-native/src_third_party_trace-viewer,bpsinc-native/src_third_party_trace-viewer,bpsinc-native/src_third_party_trace-viewer
run_dev_server.py
run_dev_server.py
#!/usr/bin/env python # Copyright (c) 2012 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. import os import sys import json from trace_viewer import trace_viewer_project import tvcm def do_GET_json_examples(request): te...
#!/usr/bin/env python # Copyright (c) 2012 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. import os import sys import json from trace_viewer import trace_viewer_project import tvcm def do_GET_json_examples(request): te...
bsd-3-clause
Python
5cc1ff3f4e15fa8a369da6e85dd7c0e01a93c1ee
Improve comments/documentation for driver script
djc/runa,djc/runa,djc/runa,djc/runa
runac/__main__.py
runac/__main__.py
#!/usr/bin/env python import optparse, sys, os from runac import util import runac def tokens(fn, opts): '''Print a list of tokens and location info''' with open(fn) as f: for x in runac.lex(f.read()): print (x.name, x.value, (x.source_pos.lineno, x.source_pos.colno)) def parse(fn, opts): '''Print the syntax...
#!/usr/bin/env python import optparse, sys, os from runac import util import runac def tokens(fn, opts): with open(fn) as f: for x in runac.lex(f.read()): print (x.name, x.value, (x.source_pos.lineno, x.source_pos.colno)) def parse(fn, opts): print runac.parse(fn) def show(fn, opts): for name, ast in runac....
mit
Python
7636d5e054bf77e94942e3ab3019d5633896f185
Remove duplicate item info.
nriley/LBHue
Hue.lbaction/Contents/Scripts/hue.py
Hue.lbaction/Contents/Scripts/hue.py
#!/Users/nicholas/Documents/Development/Hue/bin/python __all__ = ('lights', 'light', 'item_for_light', 'toggle_item_for_light') # XXX replace this with either nothing or something that isn't GPLv2 import collections, qhue bridge = qhue.Bridge('192.168.0.14', 'USERNAME') def lights(): lights = dict((light_info['...
#!/Users/nicholas/Documents/Development/Hue/bin/python __all__ = ('lights', 'light', 'item_for_light', 'toggle_item_for_light') # XXX replace this with either nothing or something that isn't GPLv2 import collections, qhue bridge = qhue.Bridge('192.168.0.14', 'USERNAME') def lights(): lights = dict((light_info['...
apache-2.0
Python
7ab650ff4180ce263d789d2266391a93daa7298f
Use master_config function
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
saltapi/config.py
saltapi/config.py
''' Manage configuration files in salt-cloud ''' # Import python libs import os # Import salt libs import salt.config def api_config(path): ''' Read in the salt master config file and add additional configs that need to be stubbed out for cloudapi ''' opts = {} opts = salt.config.master_con...
''' Manage configuration files in salt-cloud ''' # Import python libs import os # Import salt libs import salt.config def api_config(path): ''' Read in the salt master config file and add additional configs that need to be stubbed out for cloudapi ''' opts = { 'extension_modules': []...
apache-2.0
Python
0c403a18fa12a3bda3a2f51c7d4bbc37c7fb3960
Patch Release
SylvainCorlay/bqplot,SylvainCorlay/bqplot,ssunkara1/bqplot,ssunkara1/bqplot,ChakriCherukuri/bqplot,SylvainCorlay/bqplot,dmadeka/bqplot,ChakriCherukuri/bqplot,bloomberg/bqplot,dmadeka/bqplot,bloomberg/bqplot,ChakriCherukuri/bqplot,bloomberg/bqplot
bqplot/_version.py
bqplot/_version.py
version_info = (0, 7, 1) __version__ = '.'.join(map(str, version_info))
version_info = (0, 8, 0, 'dev0') __version__ = '.'.join(map(str, version_info))
apache-2.0
Python
2f8e030a879855d8a6a3d7ba6fd881b1341b64ea
Add test for location_sequences method
MikeVasmer/GreenGraphCoursework
greengraph/test/test_graph.py
greengraph/test/test_graph.py
from greengraph.map import Map from greengraph.graph import Greengraph from mock import patch import geopy from nose.tools import assert_equal from nose.tools import assert_almost_equal import os import yaml start = "London" end = "Durham" def test_Greengraph_init(): #Test instance of Greengraph class instantiate...
from greengraph.map import Map from greengraph.graph import Greengraph from mock import patch import geopy from nose.tools import assert_equal from nose.tools import assert_almost_equal import os import yaml start = "London" end = "Durham" def test_Greengraph_init(): #Test instance of Greengraph class instantiate...
mit
Python
50c306aead2376ba8b307a1731eb952e985ff138
Move clock imports
california-civic-data-coalition/django-calaccess-downloads-website,california-civic-data-coalition/django-calaccess-downloads-website,california-civic-data-coalition/django-calaccess-downloads-website
clock.py
clock.py
from apscheduler.schedulers.blocking import BlockingScheduler sched = BlockingScheduler() @sched.scheduled_job('interval', minutes=3) def timed_job(): print('This job is run every three minutes.') import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings") import django django.se...
import django django.setup() from django.core.management import call_command from apscheduler.schedulers.blocking import BlockingScheduler sched = BlockingScheduler() @sched.scheduled_job('interval', minutes=3) def timed_job(): print('This job is run every three minutes.') call_command("check") sched.start(...
mit
Python
bf6247615d6f1799e70171bdd7e174ca2061a296
Update docstring for Coins
PaulEcoffet/megamachineacaoua
coins.py
coins.py
from collections import Counter class Coins(Counter): """ Class that represents Coins Usage: ``` > coins = Coins({200: 0, 100: 2, 50: 4, 20: 3, 10: 1}) > coins.value 470 > coins2 = Coins({200:0, 100:0, 50:0, 20:2, 10:0}) > coins + coins2 Coins({200:0, 100:2, 50:4, 20:5, 10:1})...
from collections import Counter class Coins(Counter): """ Class that represents Coins Usage: ``` > coins = Coins([0, 2, 4, 3, 1], [200, 100, 50, 20, 10]) > coins.value 470 > coins2 = Coins([0, 0, 0, 2, 0], [200, 100, 50, 20, 10]) > coins + coins2 Coins({200:0, 100:2, 50:4, 20:...
apache-2.0
Python
3b23a7a3bba469487a4694e0653341740e64cd7a
Update Python path
xieweiAlex/English_Learning,xieweiAlex/English_Learning
count.py
count.py
#!/usr/bin/python3 import sys import re import os line = sys.argv[1] # line = "the feature **bloated** IDE Emacs is rather **off-putting**" # line = "**bloated** IDE Emacs is" # line = "asdfasdf asdf sad fasdf as dfasd f" # print ('The line is: ', line) pattern = "\*\*[^*]*\*\*" matches = re.findall(pattern, line) ...
#!/usr/local/bin/python3 import sys import re import os line = sys.argv[1] # line = "the feature **bloated** IDE Emacs is rather **off-putting**" # line = "**bloated** IDE Emacs is" # line = "asdfasdf asdf sad fasdf as dfasd f" # print ('The line is: ', line) pattern = "\*\*[^*]*\*\*" matches = re.findall(pattern, ...
mit
Python
19c601bbc36f1e049ee146439d767edd8004008a
add new line at end of file for toy_text __init__
Farama-Foundation/Gymnasium,Farama-Foundation/Gymnasium
gym/envs/toy_text/__init__.py
gym/envs/toy_text/__init__.py
from gym.envs.toy_text.blackjack import BlackjackEnv from gym.envs.toy_text.roulette import RouletteEnv from gym.envs.toy_text.frozen_lake import FrozenLakeEnv from gym.envs.toy_text.nchain import NChainEnv from gym.envs.toy_text.hotter_colder import HotterColder from gym.envs.toy_text.guessing_game import GuessingGame...
from gym.envs.toy_text.blackjack import BlackjackEnv from gym.envs.toy_text.roulette import RouletteEnv from gym.envs.toy_text.frozen_lake import FrozenLakeEnv from gym.envs.toy_text.nchain import NChainEnv from gym.envs.toy_text.hotter_colder import HotterColder from gym.envs.toy_text.guessing_game import GuessingGame...
mit
Python
d6cae7d5cc88539cb9bd310e5f81ee5c43f338bf
add Proxy xiaoice_storage
WEIZIBIN/PersonalWebsite,WEIZIBIN/PersonalWebsite,WEIZIBIN/PersonalWebsite
flask_website/xiaoice_storage.py
flask_website/xiaoice_storage.py
dict_xiaoice = {} class Xiaoice(): def __init__(self, weibo): self._weibo = weibo self.client_id = None def getWeibo(self): return self._weibo def post_msg(self, msg): self._weibo.post_msg_to_xiaoice(msg) def is_avail(self): if self._weibo.im_ready: ...
dict_xiaoice = {} def get_xiaoice_by_username(username): return dict_xiaoice[username] def add_xiaoice(xiaoice): dict_xiaoice[xiaoice.username] = xiaoice def get_all_xiaoice(): return dict_xiaoice def get_avail_xiaoice(): # todo check avail for username, xiaoice in dict_xiaoice.items(): ...
mit
Python
a55cfa7870fb821680b132c46011ac92179df0ce
Fix that one test.
jeremycline/fmn,jeremycline/fmn,jeremycline/fmn
fmn/lib/tests/test_recipients.py
fmn/lib/tests/test_recipients.py
from nose.tools import eq_, assert_not_equals import os import fmn.lib.models import fmn.lib.tests class TestRecipients(fmn.lib.tests.Base): def create_user_and_context_data(self): user1 = fmn.lib.models.User.get_or_create(self.sess, username="ralph") user2 = fmn.lib.models.User.get_or_create(sel...
from nose.tools import eq_, assert_not_equals import os import fmn.lib.models import fmn.lib.tests class TestRecipients(fmn.lib.tests.Base): def create_user_and_context_data(self): user1 = fmn.lib.models.User.get_or_create(self.sess, username="ralph") user2 = fmn.lib.models.User.get_or_create(sel...
lgpl-2.1
Python
3b7a3755a43c21471aa39c89914179862c66bf8a
Add Sample code
jervisfm/GoogleDrive
gdrive.py
gdrive.py
#!/usr/bin/python __author__ = 'Jervis Muindi' __date__ = 'November 2013' class GFile(object): """Encapsulates a GFile Object""" def __init__(self): pass class GDriveAuth(object): """Encapsulates OAUTH2 authentication details for Google Drive API. """ def __init__(self, client_id, client_secr...
#!/usr/bin/python __author__ = 'Jervis Muindi' __date__ = 'November 2013' class GFile(object): """Encapsulates a GFile Object""" def __init__(self): pass class GDriveAuth(object): """Encapsulates OAUTH2 authentication details for Google Drive API. """ def __init__(self, client_id, client_secr...
bsd-3-clause
Python
c9b035e576459673c2034aa0dc09aa67dde23886
Add some logging to the getter lambda
bwinterton/alexa-xkcd,bwinterton/alexa-xkcd
getter.py
getter.py
import requests import xmltodict import boto3 import botocore import re def get_latest_info(): r = requests.get("https://xkcd.com/rss.xml") rss = xmltodict.parse(r.text) post = dict() post["url"] = rss["rss"]["channel"]["item"][0]["link"] post["num"] = re.search(r"xkcd.com\/([0-9]+)", ...
import requests import xmltodict import boto3 import botocore import re def get_latest_info(): r = requests.get("https://xkcd.com/rss.xml") rss = xmltodict.parse(r.text) post = dict() post["url"] = rss["rss"]["channel"]["item"][0]["link"] post["num"] = re.search(r"xkcd.com\/([0-9]+)", ...
mit
Python
53a95088e0a0ecbca50c370a7803724a5cc67c6f
Bump version to 18.04.15-4
charlievieth/GoSubl,charlievieth/GoSubl
gosubl/about.py
gosubl/about.py
import re import sublime # GoSublime Globals ANN = 'a18.04.15-4' VERSION = 'r18.04.15-4' VERSION_PAT = re.compile(r'\d{2}[.]\d{2}[.]\d{2}-\d+', re.IGNORECASE) DEFAULT_GO_VERSION = 'go?' GO_VERSION_OUTPUT_PAT = re.compile(r'go\s+version\s+(\S+(?:\s+[+]\w+|\s+\([^)]+)?)', re.IGNORECASE) GO_VERSION_NORM_PAT = re.compile...
import re import sublime # GoSublime Globals ANN = 'a18.04.15-3' VERSION = 'r18.04.15-3' VERSION_PAT = re.compile(r'\d{2}[.]\d{2}[.]\d{2}-\d+', re.IGNORECASE) DEFAULT_GO_VERSION = 'go?' GO_VERSION_OUTPUT_PAT = re.compile(r'go\s+version\s+(\S+(?:\s+[+]\w+|\s+\([^)]+)?)', re.IGNORECASE) GO_VERSION_NORM_PAT = re.compile...
mit
Python
47497dee7fd10ebad084638b2f15f8e50e088737
fix imports
publica-io/django-publica-images,publica-io/django-publica-images
images/models.py
images/models.py
# -*- coding: utf-8 -*- from django.db import models from django.contrib.contenttypes import generic from entropy.mixins import EnabledMixin, OrderingMixin from .settings import CONTENT_MODELS class Image(models.Model): ''' Image URLs that reference an external source; such as FilePicker / S3 [{ ...
# -*- coding: utf-8 -*- from django.db import models from django.contrib.contenttypes import generic from entropy.base import EnabledMixin, OrderingMixin from .settings import CONTENT_MODELS class Image(models.Model): ''' Image URLs that reference an external source; such as FilePicker / S3 [{ "...
bsd-3-clause
Python
2b0fc1690da9de9d20901531979e760edd9ec023
Fix cuda.test()
jriehl/numba,stonebig/numba,stefanseefeld/numba,stuartarchibald/numba,pombredanne/numba,seibert/numba,gmarkall/numba,pombredanne/numba,IntelLabs/numba,stonebig/numba,cpcloud/numba,stonebig/numba,seibert/numba,jriehl/numba,numba/numba,numba/numba,pitrou/numba,seibert/numba,pitrou/numba,sklam/numba,pombredanne/numba,jrie...
numba/cuda/__init__.py
numba/cuda/__init__.py
from __future__ import print_function, absolute_import, division from numba import config import numba.testing if config.ENABLE_CUDASIM: from .simulator_init import * else: from .device_init import * from .device_init import _auto_device def test(*args, **kwargs): if not is_available(): rais...
from __future__ import print_function, absolute_import, division from numba import config if config.ENABLE_CUDASIM: from .simulator_init import * else: from .device_init import * from .device_init import _auto_device def test(): if not is_available(): raise cuda_error() from .tests.cudapy...
bsd-2-clause
Python
20a8b81e1e73417c4a5efed2d65c1819adb41391
Make the API in glyphslib.py a little more useful.
googlei18n/glyphsLib,googlefonts/glyphsLib
glyphslib.py
glyphslib.py
#!/usr/bin/python __all__ = [ "load_to_rfonts", "build_instances", "load", "loads", ] import json import sys from parser import Parser from casting import cast_data, cast_noto_data from torf import to_robofab def load(fp, dict_type=dict): """Read a .glyphs file. 'fp' should be (readable) file object. Return ...
#!/usr/bin/python __all__ = [ "load_to_rfonts", "build_instances", "load", "loads", ] import json import sys from fontbuild.convertCurves import glyphCurvesToQuadratic from fontbuild.outlineTTF import OutlineTTFCompiler from parser import Parser from casting import cast_data, cast_noto_data from interpolation i...
apache-2.0
Python
8eba46a73280c290aa03f5282da2b423facb9e6b
Add test for "archive list"
basak/glacier-cli,mhubig/glacier-cli,basak/glacier-cli,mhubig/glacier-cli
glacier_test.py
glacier_test.py
#!/usr/bin/env python # Copyright (c) 2013 Robie Basak # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, ...
#!/usr/bin/env python # Copyright (c) 2013 Robie Basak # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, ...
mit
Python
37340d0119254399517920dd9a85d295aee16cab
add newline at end
analysiscenter/dataset
dataset/models/tf/__init__.py
dataset/models/tf/__init__.py
""" Contains tensorflow models and functions """ from .base import TFModel from .vgg import VGG, VGG16, VGG19, VGG7 from .linknet import LinkNet from .unet import UNet from .vnet import VNet from .fcn import FCN, FCN32, FCN16, FCN8 from .resnet import ResNet, ResNet18, ResNet34, ResNet50, ResNet101, ResNet152 from .inc...
""" Contains tensorflow models and functions """ from .base import TFModel from .vgg import VGG, VGG16, VGG19, VGG7 from .linknet import LinkNet from .unet import UNet from .vnet import VNet from .fcn import FCN, FCN32, FCN16, FCN8 from .resnet import ResNet, ResNet18, ResNet34, ResNet50, ResNet101, ResNet152 from .inc...
apache-2.0
Python
021af9e73e6960347e47cf783c2d90d9e399a8c5
bump version
charlievieth/GoSubl,charlievieth/GoSubl
gosubl/about.py
gosubl/about.py
import re import sublime # GoSublime Globals ANN = 'a18.04.15-7' VERSION = 'r18.04.15-7' VERSION_PAT = re.compile(r'\d{2}[.]\d{2}[.]\d{2}-\d+', re.IGNORECASE) DEFAULT_GO_VERSION = 'go?' GO_VERSION_OUTPUT_PAT = re.compile(r'go\s+version\s+(\S+(?:\s+[+]\w+|\s+\([^)]+)?)', re.IGNORECASE) GO_VERSION_NORM_PAT = re.compile...
import re import sublime # GoSublime Globals ANN = 'a18.04.15-6' VERSION = 'r18.04.15-6' VERSION_PAT = re.compile(r'\d{2}[.]\d{2}[.]\d{2}-\d+', re.IGNORECASE) DEFAULT_GO_VERSION = 'go?' GO_VERSION_OUTPUT_PAT = re.compile(r'go\s+version\s+(\S+(?:\s+[+]\w+|\s+\([^)]+)?)', re.IGNORECASE) GO_VERSION_NORM_PAT = re.compile...
mit
Python
86fd9ad2035ab9ce5b7d3e6790b19c1d8e9bf756
revert changed word
ywryoo/GP2
gp2-core/app.py
gp2-core/app.py
# -*- coding: utf-8 -*- """ app.py flask application that serves webpages --- Written by Yangwook Ryoo, 2017 MIT License: see LICENSE at root directory """ from flask import Flask app = Flask(__name__) @app.route('/') def route_root(): return 'Hello, World!'
# -*- coding: utf-8 -*- """ app.py flask application that serves webpages --- Written by Yangwook Ryoo, 2017 MIT License: see LICENSE at root directory """ from flask import Flask app = Flask(__name__) @app.route('/') def route_root(): return 'Hello, WWWWWWWWorld!'
mit
Python
e33307999d804cb65c60459b74d76a10511f1e63
Fix an indent in Day 14
icydoge/AdventOfCodeSolutions
day14.py
day14.py
#Advent of Code December 14 #Written by icydoge - icydoge AT gmail dot com def reindeer_fly(reindeer, time): #Give the distance the reindeer covered until that time cycles = time / (reindeer[2] + reindeer[3]) remainder = time % (reindeer[2] + reindeer[3]) distance = cycles * reindeer[1] * reindeer[2] #...
#Advent of Code December 14 #Written by icydoge - icydoge AT gmail dot com def reindeer_fly(reindeer, time): #Give the distance the reindeer covered until that time cycles = time / (reindeer[2] + reindeer[3]) remainder = time % (reindeer[2] + reindeer[3]) distance = cycles * reindeer[1] * reindeer[2] #...
mit
Python
f7090bfc325f7f343b0dfdf29c943d33a61be092
Adjust setup file to include library
CiscoPSIRT/openVulnAPI,CiscoPSIRT/openVulnAPI,CiscoPSIRT/openVulnAPI,CiscoPSIRT/openVulnAPI,CiscoPSIRT/openVulnAPI
openVulnQuery/setup.py
openVulnQuery/setup.py
from setuptools import setup, find_packages setup(name='OpenVulnQuery', version='1.25', description='A python-based module(s) to query the Cisco PSIRT openVuln API.', url='https://github.com/CiscoPSIRT/openVulnAPI/tree/master/openVulnQuery', author='Bradley Korabik, Parash Ghimire', autho...
from setuptools import setup setup(name='OpenVulnQuery', version='1.25', description='A python-based module(s) to query the Cisco PSIRT openVuln API.', url='https://github.com/CiscoPSIRT/openVulnAPI/tree/master/openVulnQuery', author='Bradley Korabik, Parash Ghimire', author_email='bkorab...
mit
Python
4bd3f2167b342a1d4a31d85923a07bc0cd2e203e
Update setup.py
CiscoPSIRT/openVulnAPI,CiscoPSIRT/openVulnAPI,CiscoPSIRT/openVulnAPI,CiscoPSIRT/openVulnAPI,CiscoPSIRT/openVulnAPI
openVulnQuery/setup.py
openVulnQuery/setup.py
from setuptools import setup, find_packages setup(name='OpenVulnQuery', version='1.26', description='A python-based module(s) to query the Cisco PSIRT openVuln API.', url='https://github.com/CiscoPSIRT/openVulnAPI/tree/master/openVulnQuery', author='Bradley Korabik, Parash Ghimire, Omar Santos'...
from setuptools import setup, find_packages setup(name='OpenVulnQuery', version='1.25', description='A python-based module(s) to query the Cisco PSIRT openVuln API.', url='https://github.com/CiscoPSIRT/openVulnAPI/tree/master/openVulnQuery', author='Bradley Korabik, Parash Ghimire', autho...
mit
Python
e5c92700533ea021807971a4b2276d405e621160
make UserUtilityModel extract_features pass
yw374cornell/e-mission-server,e-mission/e-mission-server,joshzarrabi/e-mission-server,yw374cornell/e-mission-server,yw374cornell/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,yw374cornell/e-mission-server,sunil07t/e-mission-server,joshzarrabi/e...
CFC_DataCollector/recommender/user_utility_model.py
CFC_DataCollector/recommender/user_utility_model.py
# Phase 1: Build a model for User Utility Function (per Vij, Shankari) # First, for each trip, we must obtain alternatives through some method # (currently Google Maps API), alongside the actual trips which were taken. # Once we have these alternatives, we can extract the features from each of the # possible trips. Now...
# Phase 1: Build a model for User Utility Function (per Vij, Shankari) # First, for each trip, we must obtain alternatives through some method # (currently Google Maps API), alongside the actual trips which were taken. # Once we have these alternatives, we can extract the features from each of the # possible trips. Now...
bsd-3-clause
Python
dacad103e6f02f1953c6d5a9837e347793d1c52a
Fix cache folder issue.
ggordan/GutterColor,ggordan/GutterColor
gutter_color.py
gutter_color.py
from .file import File from sublime_plugin import EventListener from sublime import load_settings def plugin_loaded(): """ If the folder exists, and has more than 5MB of icons in the cache, delete it to clear all the icons then recreate it. """ from os.path import getsize, join, isfile, exists ...
from .file import File from sublime_plugin import EventListener from sublime import load_settings def plugin_loaded(): """ If the folder exists, and has more than 5MB of icons in the cache, delete it to clear all the icons then recreate it. """ from os.path import getsize, join, isfile, exists ...
mit
Python
b040c3783a179618d1e87d52df6d5799f782d5b1
Bump version to 0.9.0+dev
python-hyper/h11
h11/_version.py
h11/_version.py
# This file must be kept very simple, because it is consumed from several # places -- it is imported by h11/__init__.py, execfile'd by setup.py, etc. # We use a simple scheme: # 1.0.0 -> 1.0.0+dev -> 1.1.0 -> 1.1.0+dev # where the +dev versions are never released into the wild, they're just what # we stick into the ...
# This file must be kept very simple, because it is consumed from several # places -- it is imported by h11/__init__.py, execfile'd by setup.py, etc. # We use a simple scheme: # 1.0.0 -> 1.0.0+dev -> 1.1.0 -> 1.1.0+dev # where the +dev versions are never released into the wild, they're just what # we stick into the ...
mit
Python
fc42655e356c5f74fbfb86b28e59f6ecb4b601fb
fix None problem different version of 3.0
osmanbaskaya/semeval14-task3,osmanbaskaya/semeval14-task3
run/wn-baseline.py
run/wn-baseline.py
#! /usr/bin/python # -*- coding: utf-8 -*- __author__ = "Osman Baskaya" """ """ import sys from nltk.corpus import wordnet as wn from itertools import product import task3_utils import numpy as np from wn_utils import get_synsets_for_sents_tuple from collections import defaultdict as dd import nltk test_f = sys.std...
#! /usr/bin/python # -*- coding: utf-8 -*- __author__ = "Osman Baskaya" """ """ import sys from nltk.corpus import wordnet as wn from itertools import product import task3_utils import numpy as np from wn_utils import get_synsets_for_sents_tuple from collections import defaultdict as dd import nltk test_f = sys.std...
mit
Python
70a251ba27641e3c0425c659bb900e17f0f423dd
Enable initial user via service so that an event gets written
homeworkprod/byceps,m-ober/byceps,m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps
scripts/create_initial_admin_user.py
scripts/create_initial_admin_user.py
#!/usr/bin/env python """Create an initial user with admin privileges to begin BYCEPS setup. :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import click from byceps.services.user import creation_service as user_creation_service from byceps.services.user import servic...
#!/usr/bin/env python """Create an initial user with admin privileges to begin BYCEPS setup. :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import click from byceps.database import db from byceps.services.user import creation_service as user_creation_service from byc...
bsd-3-clause
Python
e524ea3db737ee92bb3ba486240dd60928781eaf
Fix tests.
iphoting/healthchecks,healthchecks/healthchecks,healthchecks/healthchecks,healthchecks/healthchecks,iphoting/healthchecks,healthchecks/healthchecks,iphoting/healthchecks,iphoting/healthchecks
hc/front/tests/test_add_pd.py
hc/front/tests/test_add_pd.py
from hc.api.models import Channel from hc.test import BaseTestCase class AddPdTestCase(BaseTestCase): url = "/integrations/add_pd/" def test_instructions_work(self): self.client.login(username="alice@example.org", password="password") r = self.client.get(self.url) self.assertContains(...
from hc.api.models import Channel from hc.test import BaseTestCase class AddPdTestCase(BaseTestCase): url = "/integrations/add_pd/" def test_instructions_work(self): self.client.login(username="alice@example.org", password="password") r = self.client.get(self.url) self.assertContains(...
bsd-3-clause
Python
65ae8fc33a1fa7297d3e68f7c67ca5c2678e81b7
Set up Flask-User to provide user auth
interactomix/iis,interactomix/iis
app/__init__.py
app/__init__.py
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_mail import Mail from flask_user import UserManager, SQLAlchemyAdapter app = Flask(__name__) app.config.from_object('config') db = SQLAlchemy(app) migrate = Migrate(app, db) # Load Flask-Mail mail = Mail(app)...
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_mail import Mail app = Flask(__name__) app.config.from_object('config') db = SQLAlchemy(app) migrate = Migrate(app, db) # Load Flask-Mail mail = Mail(app) from app import views, models
agpl-3.0
Python
d0a6183b31b417b0ff11a1f74b1480b24fb558bb
Change encoding
openxc/openxc-python,openxc/openxc-python,openxc/openxc-python
openxc/formats/json.py
openxc/formats/json.py
"""JSON formatting utilities.""" import json from openxc.formats.base import VehicleMessageStreamer class JsonStreamer(VehicleMessageStreamer): SERIALIZED_COMMAND_TERMINATOR = b"\x00" def parse_next_message(self): parsed_message = None remainder = self.message_buffer message = "" ...
"""JSON formatting utilities.""" import json from openxc.formats.base import VehicleMessageStreamer class JsonStreamer(VehicleMessageStreamer): SERIALIZED_COMMAND_TERMINATOR = b"\x00" def parse_next_message(self): parsed_message = None remainder = self.message_buffer message = "" ...
bsd-3-clause
Python
1e8d5cd1fc76527c650d2e47794ef3af3992dea7
Fix broken test 😑
UrLab/DocHub,UrLab/DocHub,UrLab/DocHub,UrLab/beta402,UrLab/beta402,UrLab/beta402,UrLab/DocHub
users/tests/auth_backend_authenticate_test.py
users/tests/auth_backend_authenticate_test.py
from django.test.client import RequestFactory import pytest import responses from users.authBackend import NetidBackend from users.models import User pytestmark = pytest.mark.django_db @responses.activate def test_auth(): sid = "this-is-a-sid" uid = "this-is-a-uid-and-is-longer" xml = open("users/tests...
import pytest import responses from users.authBackend import NetidBackend from users.models import User pytestmark = pytest.mark.django_db @responses.activate def test_auth(): sid = "this-is-a-sid" uid = 'this-is-a-uid-and-is-longer' xml = open("users/tests/xml-fixtures/nimarcha.xml").read() respon...
agpl-3.0
Python
32f409756af68e4500c1de310c24c2636366e133
Remove from flask_alembic
plenario/plenario,plenario/plenario,plenario/plenario
app/__init__.py
app/__init__.py
from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config.from_object('config') db = SQLAlchemy(app) alembic = Alembic() alembic.init_app(app) from app import views, models
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_alembic import Alembic app = Flask(__name__) app.config.from_object('config') db = SQLAlchemy(app) alembic = Alembic() alembic.init_app(app) from app import views, models
mit
Python
b53bbce8cfffbcf926f5b9951cb89be9cdb8b276
update debugger
miketwo/euler
debug.py
debug.py
# Useful debug from time import time START = 0 FINISH = 0 ACCUMULATOR = 0 DELTA = 0 def start(): global START, DELTA START = time() DELTA = START def finish(): t = time() if ACCUMULATOR != 0: print "Acumulated time: {}".format(ACCUMULATOR) else: global FINISH FINISH ...
# Useful debug from time import time START = 0 FINISH = 0 def start(): global START START = time() def finish(): global FINISH FINISH = time() print FINISH - START
mit
Python
d2e82419a8f1b7ead32a43e6a03ebe8093374840
Set slug field readonly after channel create
williamroot/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,jeanmask/opps,opps/opps,williamroot/opps,opps/opps,YACOWS/opps,opps/opps,opps/opps,YACOWS/opps
opps/channels/forms.py
opps/channels/forms.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from django import forms from django.utils.translation import ugettext_lazy as _ from .models import Channel class ChannelAdminForm(forms.ModelForm): layout = forms.ChoiceField(choices=(('default', _('Default')),)) def __init__(self, *args, **kwargs): su...
#!/usr/bin/env python # -*- coding: utf-8 -*- from django import forms from django.utils.translation import ugettext_lazy as _ from .models import Channel class ChannelAdminForm(forms.ModelForm): layout = forms.ChoiceField(choices=(('default', _('Default')),)) class Meta: model = Channel
mit
Python
c9284827eeec90a253157286214bc1d17771db24
Remove skip of service-type management API test
NeCTAR-RC/neutron,apporc/neutron,takeshineshiro/neutron,mmnelemane/neutron,barnsnake351/neutron,glove747/liberty-neutron,sasukeh/neutron,SamYaple/neutron,dhanunjaya/neutron,swdream/neutron,noironetworks/neutron,bgxavier/neutron,chitr/neutron,eonpatapon/neutron,glove747/liberty-neutron,paninetworks/neutron,antonioUnina/...
neutron/tests/api/test_service_type_management.py
neutron/tests/api/test_service_type_management.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
Python
c75a244247988dbce68aa7985241712d8c94a24a
Fix how we set 'build_dir' and 'install_dir' options from 'install' options -- irrelevant because this file is about to go away, but oh well.
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
Lib/distutils/command/install_ext.py
Lib/distutils/command/install_ext.py
"""install_ext Implement the Distutils "install_ext" command to install extension modules.""" # created 1999/09/12, Greg Ward __revision__ = "$Id$" from distutils.core import Command from distutils.util import copy_tree class install_ext (Command): description = "install C/C++ extension modules" user...
"""install_ext Implement the Distutils "install_ext" command to install extension modules.""" # created 1999/09/12, Greg Ward __revision__ = "$Id$" from distutils.core import Command from distutils.util import copy_tree class install_ext (Command): description = "install C/C++ extension modules" user...
mit
Python