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 |
|---|---|---|---|---|---|---|---|---|
85f67cdf7dcae2a786187c37cc3f345a679ee5ee | Add ENABLE_EMAIL_SUBSCRIPTIONS to local-dist | doublebits/osf.io,mluo613/osf.io,barbour-em/osf.io,emetsger/osf.io,mluo613/osf.io,fabianvf/osf.io,caneruguz/osf.io,lyndsysimon/osf.io,icereval/osf.io,billyhunt/osf.io,jnayak1/osf.io,acshi/osf.io,barbour-em/osf.io,lamdnhan/osf.io,leb2dg/osf.io,saradbowman/osf.io,brandonPurvis/osf.io,njantrania/osf.io,erinspace/osf.io,fe... | website/settings/local-dist.py | website/settings/local-dist.py | # -*- coding: utf-8 -*-
'''Example settings/local.py file.
These settings override what's in website/settings/defaults.py
NOTE: local.py will not be added to source control.
'''
from . import defaults
DEV_MODE = True
DEBUG_MODE = True # Sets app to debug mode, turns off template caching, etc.
# Comment out to use ... | # -*- coding: utf-8 -*-
'''Example settings/local.py file.
These settings override what's in website/settings/defaults.py
NOTE: local.py will not be added to source control.
'''
from . import defaults
DEV_MODE = True
DEBUG_MODE = True # Sets app to debug mode, turns off template caching, etc.
# Comment out to use ... | apache-2.0 | Python |
b818cb6d4290e1daa8ebb6d4bedc87b55399c292 | fix the '--meta' argument | HERA-Team/librarian,HERA-Team/librarian,HERA-Team/librarian | scripts/upload_to_librarian.py | scripts/upload_to_librarian.py | #! /usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# Copyright 2016 the HERA Team.
# Licensed under the BSD License.
"""Upload a file to a Librarian. Do NOT use this script if the file that you
wish to upload is already known to the local Librarian. In that case, use the
"launch_librarian_copy.py" script -- ... | #! /usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# Copyright 2016 the HERA Team.
# Licensed under the BSD License.
"""Upload a file to a Librarian. Do NOT use this script if the file that you
wish to upload is already known to the local Librarian. In that case, use the
"launch_librarian_copy.py" script -- ... | bsd-2-clause | Python |
08674f32548c5ab186d6eca72bcb659786fa7ad6 | Bump version number for devel branch. | fperez/cython,fabianrost84/cython,JelleZijlstra/cython,mrGeen/cython,bzzzz/cython,fabianrost84/cython,mrGeen/cython,scoder/cython,mrGeen/cython,andreasvc/cython,rguillebert/CythonCTypesBackend,hickford/cython,hhsprings/cython,scoder/cython,c-blake/cython,andreasvc/cython,madjar/cython,hpfem/cython,dahebolangkuan/cython... | Cython/__init__.py | Cython/__init__.py | __version__ = "0.14+"
# Void cython.* directives (for case insensitive operating systems).
from Cython.Shadow import *
| __version__ = "0.14"
# Void cython.* directives (for case insensitive operating systems).
from Cython.Shadow import *
| apache-2.0 | Python |
4eb52bac0c38c2e9b40a2e3d48d4365835bc4e51 | fix typo in pyservicelib import | ameihm0912/service-map,mozilla/service-map,ameihm0912/service-map | python/pyservicelib/pyservicelib/__init__.py | python/pyservicelib/pyservicelib/__init__.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Copyright (c) 2015 Mozilla Corporation
# Author: ameihm@mozilla.com
from search import *
| #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Copyright (c) 2015 Mozilla Corporation
# Author: ameihm@mozilla.com
from pyservicelib import *
| mpl-2.0 | Python |
887feb2385f5b9c49db2ad7d4382543d20699a6e | update python path for pootle translation hack thing | online-go/online-go.com,online-go/online-go.com,online-go/online-go.com,online-go/online-go.com,online-go/online-go.com | i18n/translation-code-replace-for-parsing.py | i18n/translation-code-replace-for-parsing.py | #!/usr/bin/env python
import re
import os
replacement_count = 0
with open('build/ogs.strings.js', 'r') as input_file:
contents = input_file.read()
def repl(m):
global replacement_count
replacement_count += 1
#print(m[1])
return (' ' * (len(m[0]) - len(m[1]))) + m[1]
new... | #!python3
import re
import os
replacement_count = 0
with open('build/ogs.strings.js', 'r') as input_file:
contents = input_file.read()
def repl(m):
global replacement_count
replacement_count += 1
#print(m[1])
return (' ' * (len(m[0]) - len(m[1]))) + m[1]
new_contents = ... | agpl-3.0 | Python |
4f160545c9233eb04361d97516b63e4a231426e4 | Update detect-packer.py | nwiizo/workspace_2017,nwiizo/workspace_2017,nwiizo/workspace_2017,nwiizo/workspace_2017,nwiizo/workspace_2017,nwiizo/workspace_2017,nwiizo/workspace_2017,nwiizo/workspace_2017,nwiizo/workspace_2017,nwiizo/workspace_2017 | pen_test_code/detect-packer.py | pen_test_code/detect-packer.py | import peutils
import pefile
pe = pefile.PE('md5sum-packed.exe')
signatures = peutils.SignatureDatabase('http://reverse-engineering-scripts.googlecode.com/files/UserDB.TXT')
matches = signatures.match(pe, ep_only = True)
print(matches)
| Import peutils
Import pefile
pe = pefile.PE('md5sum-packed.exe')
signatures = peutils.SignatureDatabase('http://reverse-engineering-scripts.googlecode.com/files/UserDB.TXT')
matches = signatures.match(pe, ep_only = True)
print matches
| mit | Python |
2ee99a106e3d63cd6775d8aa98169ab02ca02950 | Add git info to status | amcat/amcat,amcat/amcat,amcat/amcat,amcat/amcat,amcat/amcat,amcat/amcat | api/rest/views/status.py | api/rest/views/status.py | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.status import HTTP_200_OK
from amcat.amcatcelery import status
from amcat.tools.amcates import ES
from git import Repo
import time
class StatusView(APIView):
def get(self, request):
data = {"amcat": s... | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.status import HTTP_200_OK
from amcat.amcatcelery import status
from amcat.tools.amcates import ES
class StatusView(APIView):
def get(self, request):
data = status()
data['celery_worker'] = sta... | agpl-3.0 | Python |
95edd8610753609b75e7517522a67b7a653a7b6b | remove ascii characters | cf-platform-eng/bosh-azure-template,cf-platform-eng/bosh-azure-template | install_steps/setup_dns.py | install_steps/setup_dns.py | import os
import traceback
def do_step(context):
settings = context.meta['settings']
username = settings["username"]
home_dir = os.path.join("/home", username)
install_log = os.path.join(home_dir, "install.log")
# Setup the devbox as a DNS
enable_dns = settings["enable-dns"]
if enable_dns:... | import os │·····················································································································
imp... | apache-2.0 | Python |
aaa89aa3211b0d73eb96442da3202c95e0dcbc14 | Add lint test and format generated code (#4114) | googleapis/google-cloud-java,googleapis/google-cloud-java,googleapis/google-cloud-java | java-os-login/google-cloud-os-login/synth.py | java-os-login/google-cloud-os-login/synth.py | # Copyright 2018 Google LLC
#
# 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, s... | # Copyright 2018 Google LLC
#
# 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, s... | apache-2.0 | Python |
d485acf596fc2e39c0d651eb90ad5e080b06b519 | clarify tests | johntellsall/shotglass,johntellsall/shotglass,johntellsall/shotglass | shotglass/app/tests/test_render.py | shotglass/app/tests/test_render.py | from app import render
class AttrDict(dict):
__getattr__ = dict.__getitem__
SYMBOLS = [
AttrDict(symbol='logger', path='main.py', size='M', length=1),
AttrDict(symbol='func1', path='main.py', size='L', length=2),
AttrDict(symbol='func2', path='aux.py', size='S', length=3),
]
def get_arg(result):
... | from app import render
class AttrDict(dict):
__getattr__ = dict.__getitem__
SYMBOLS = [
AttrDict(symbol='logger', path='main.py', size='M', length=1),
AttrDict(symbol='func1', path='main.py', size='L', length=2),
AttrDict(symbol='func2', path='aux.py', size='S', length=3),
]
def get_pos_arg(results... | mit | Python |
dfbb5e783dda89052872e063150a0e17528fdab4 | Remove deprecated function. Rename for consistency. | jaraco/jaraco.classes | jaraco/classes/ancestry.py | jaraco/classes/ancestry.py | """
Routines for obtaining the class names
of an object and its parent classes.
"""
from __future__ import unicode_literals
def all_bases(c):
"""
return a tuple of all base classes the class c has as a parent.
>>> object in all_bases(list)
True
"""
return c.mro()[1:]
def all_classes(c):
"""
return a tuple of... | """
Routines for obtaining the class names
of an object and its parent classes.
"""
from __future__ import absolute_import, unicode_literals
import warnings
import jaraco.itertools
def ensure_sequence(el):
"""
*Deprecated*
if item is not a sequence, return the item as a singleton in a list
>>> ensure_sequence... | mit | Python |
0d35e32c95e7abd30d662aa6fa704425264bf0fc | enable context aware commits (#88) | googleapis/google-cloud-java,googleapis/google-cloud-java,googleapis/google-cloud-java | java-game-servers/synth.py | java-game-servers/synth.py | # Copyright 2019 Google LLC
#
# 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, s... | # Copyright 2019 Google LLC
#
# 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, s... | apache-2.0 | Python |
5ae313e26e9c0641a62caba59b533354f2dbde3a | Return application/javascript for JSONP requests | lalinsky/acoustid-server,lalinsky/acoustid-server,lalinsky/acoustid-server,lalinsky/acoustid-server | acoustid/api/__init__.py | acoustid/api/__init__.py | # Copyright (C) 2011 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import logging
import json
import xml.etree.cElementTree as etree
from acoustid.handler import Response
from acoustid.utils import singular
logger = logging.getLogger(__name__)
def _serialize_xml_node(parent, ... | # Copyright (C) 2011 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import logging
import json
import xml.etree.cElementTree as etree
from acoustid.handler import Response
from acoustid.utils import singular
logger = logging.getLogger(__name__)
def _serialize_xml_node(parent, ... | mit | Python |
9cea169024c3931e22c5237bcf33e3578d79d16a | Update the version | manuelzs/PyPDF2,manuelzs/PyPDF2 | PyPDF2/_version.py | PyPDF2/_version.py | __version__ = '1.26.1'
| __version__ = '1.26.0'
| bsd-3-clause | Python |
65dc22fcd8d7332a2bb13eefcb6ac272c8ea3727 | Bump to v0.9.2 (MANIFEST.in fix) | jsvine/markovify | markovify/__version__.py | markovify/__version__.py | VERSION_TUPLE = (0, 9, 2)
__version__ = ".".join(map(str, VERSION_TUPLE))
| VERSION_TUPLE = (0, 9, 1)
__version__ = ".".join(map(str, VERSION_TUPLE))
| mit | Python |
9e2728e7589deebce39ed6bca385f36c6c90f718 | Add a timestamp field to the Message model | mlalic/TumCampusAppBackend,mlalic/TumCampusAppBackend | tca/chat/models.py | tca/chat/models.py | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Member(models.Model):
lrz_id = models.CharField(max_length=7, unique=True)
first_name = models.CharField(max_length=30, blank=True)
last_na... | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Member(models.Model):
lrz_id = models.CharField(max_length=7, unique=True)
first_name = models.CharField(max_length=30, blank=True)
last_na... | bsd-3-clause | Python |
a29788df335d9ffc2fd471463ba996ba1aca4665 | Define prototypes as extern | GNOME/at-spi2-core,GNOME/at-spi2-core,GNOME/at-spi2-core | xml/versioned-introspection.py | xml/versioned-introspection.py |
import sys
from xml.etree import ElementTree
CTEMPLATE = \
"""
/*
* This file has been auto-generated from the introspection data available
* in the at-spi2-core repository. The D-Bus procol is defined in this
* repository, which can be found at:
*
* http://download.gnome.org/sources/at-spi2-core/0.1/
*
* DO N... |
import sys
from xml.etree import ElementTree
CTEMPLATE = \
"""
/*
* This file has been auto-generated from the introspection data available
* in the at-spi2-core repository. The D-Bus procol is defined in this
* repository, which can be found at:
*
* http://download.gnome.org/sources/at-spi2-core/0.1/
*
* DO N... | lgpl-2.1 | Python |
fa18d4cbe28a4e4913787073bc418486bbf88691 | Improve example | KeyWeeUsr/plyer,KeyWeeUsr/plyer,KeyWeeUsr/plyer,kivy/plyer,kivy/plyer,kivy/plyer | examples/brightness/main.py | examples/brightness/main.py | from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.slider import Slider
from kivy.lang import Builder
from plyer import brightness
from kivy.uix.button import Button
from kivy.properties import NumericProperty
Builder.load_string('''
<BrightnessInterface>:
orientation: 'vertical'
L... | from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.slider import Slider
from kivy.lang import Builder
from plyer import brightness
from kivy.uix.button import Button
from kivy.properties import NumericProperty
Builder.load_string('''
<BrightnessInterface>:
orientation: 'vertical'
l... | mit | Python |
2d19810b621732c389aaf6884809bcbffd68dd35 | Revise memo array name in factorial_memo() | bowen0701/algorithms_data_structures | alg_factorial.py | alg_factorial.py | """Factorial series:
1!, 2!, 3!, ...
- Factorial(1) = 1! = 1
- Factorial(2) = 2! = 2
- Factorial(n) = n! = n * (n - 1)! = n * Factorial(n - 1)
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def factorial_recur(n):
"""Get the nth number of factor... | """Factorial series:
1!, 2!, 3!, ...
- Factorial(1) = 1! = 1
- Factorial(2) = 2! = 2
- Factorial(n) = n! = n * (n - 1)! = n * Factorial(n - 1)
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
def factorial_recur(n):
"""Get the nth number of factor... | bsd-2-clause | Python |
0833bdec269a74f686876859a5d2ef3cda919348 | Revert "[AC-5775] 1.0.1" | masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api,masschallenge/impact-api | web/impact/impact/__init__.py | web/impact/impact/__init__.py |
__version__ = '1.0.0' |
__version__ = '1.0.1' | mit | Python |
e55c975cd5de309746dedbc2b179ac4cc5e3e8ce | Update twitch.py | TingPing/plugins,TingPing/plugins | HexChat/twitch.py | HexChat/twitch.py | import hexchat
__module_name__ = 'Twitch'
__module_author__ = 'TingPing'
__module_version__ = '4'
__module_description__ = 'Better integration with Twitch.tv'
# Very much a work in progress...
# Commands from http://help.twitch.tv/customer/portal/articles/659095-chat-moderation-commands
# /ban may conflict with other... | import hexchat
__module_name__ = 'Twitch'
__module_author__ = 'TingPing'
__module_version__ = '3'
__module_description__ = 'Better integration with Twitch.tv'
# Very much a work in progress...
# Commands from http://help.twitch.tv/customer/portal/articles/659095-chat-moderation-commands
# /ban may conflict with other... | mit | Python |
3fe4307cf1315a70ae9286e36aa409191168e06a | Improve 'remove static from html' | marble/Toolchain_RenderDocumentation,marble/Toolchain_RenderDocumentation,marble/Toolchain_RenderDocumentation | 20-Postprocess/run_55-Remove-_static-from-html.py | 20-Postprocess/run_55-Remove-_static-from-html.py | #!/usr/bin/env python
# coding: utf-8
# ==================================================
# open
# --------------------------------------------------
from __future__ import print_function
import os
import tct
import sys
#
import shutil
params = tct.readjson(sys.argv[1])
binabspath = sys.argv[2]
facts = tct.readjson... | #!/usr/bin/env python
# coding: utf-8
# ==================================================
# open
# --------------------------------------------------
from __future__ import print_function
import os
import tct
import sys
params = tct.readjson(sys.argv[1])
binabspath = sys.argv[2]
facts = tct.readjson(params['factsfi... | mit | Python |
f76f4b7a52ff8afad71fc55b0c62add32742df5e | Solve encoding issue. | osamak/rlugroup,osamak/rlugroup | send_reminders.py | send_reminders.py | # -*- coding: utf-8 -*-
import datetime
import os
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
from django.conf import settings
from django.core.urlresolvers import reverse
from events.models import Attendee, Event
from post_office import mail
now = datetime.d... | import datetime
import os
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
from django.conf import settings
from django.core.urlresolvers import reverse
from events.models import Attendee, Event
from post_office import mail
now = datetime.datetime.now()
two_days_la... | agpl-3.0 | Python |
67157877553739e069da18e043267c96fa405cb0 | remove paranthesis from functions in warning messages | theislab/anndata | anndata/utils.py | anndata/utils.py | import logging as logg
import pandas as pd
def make_index_unique(index, join='-'):
"""Makes the index unique by appending '1', '2', etc.
The first occurance of a non-unique value is ignored.
Parameters
----------
join : `str`, optional (default: '')
The connecting string between name an... | import logging as logg
import pandas as pd
def make_index_unique(index, join='-'):
"""Makes the index unique by appending '1', '2', etc.
The first occurance of a non-unique value is ignored.
Parameters
----------
join : `str`, optional (default: '')
The connecting string between name an... | bsd-3-clause | Python |
28164180df5afdcba3be4a8e59dcbb5ac38eadf5 | fix #26 (acfun) | windygu/youku-lixian,sdgdsffdsfff/youku-lixian,liye111111/bin,iambus/youku-lixian,liye111111/bin,Ringares/youku-lixian,wangjun/youku-lixian | acfun.py | acfun.py | #!/usr/bin/env python
__all__ = ['acfun_download']
import re
from common import *
from iask import iask_download_by_id
from youku import youku_download_by_id
from tudou import tudou_download_by_iid
import json
def get_srt_json(id):
url = 'http://comment.acfun.tv/%s.json' % id
return get_html(url)
def acfun_downlo... | #!/usr/bin/env python
__all__ = ['acfun_download']
import re
from common import *
from iask import iask_download_by_id
from youku import youku_download_by_id
from tudou import tudou_download_by_iid
def get_srt_json(id):
url = 'http://comment.acfun.tv/%s.json' % id
return get_html(url)
def acfun_download(url):
as... | mit | Python |
51d258bf093e8885ea4cdfb6e162077f1961dd0c | Fix bug. Import own exceptions | dongguangming/python-github3,DataDog/python-github3,prezi/python-github3,copitux/python-github3,mrinfinidy/chapter8,Xobb/python-github3 | github3/handlers/user.py | github3/handlers/user.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# author: David Medina
from .base import Handler
import github3.models as models
import github3.exceptions as exceptions
class User(Handler):
""" Handler to query public user api """
def __init__(self, gh, username):
if not username:
raise... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# author: David Medina
from .base import Handler
import github3.models as models
class User(Handler):
""" Handler to query public user api """
def __init__(self, gh, username):
if not username:
raise exceptions.AnomUser("%s need a username... | isc | Python |
45894294df788d54402e78b517b542a6ffc5efd2 | Add x tag for part of speech keywords (#48) | googleinterns/major-tom,googleinterns/major-tom,googleinterns/major-tom | services/keywords/constants.py | services/keywords/constants.py | KEY_PARTS_OF_SPEECH = ["ADJ", "NOUN", "NUM", "VERB", "X"]
| KEY_PARTS_OF_SPEECH = ["ADJ", "NOUN", "NUM", "VERB"]
| apache-2.0 | Python |
72298c25fc8887f521ffa6410c9762c76719c4a1 | Increase digits printed in the rf | glrs/StackedDAE,glrs/StackedDAE | Train_SDAE/tools/evaluate_model.py | Train_SDAE/tools/evaluate_model.py | import numpy as np
import sklearn
from scipy.special import expit
from sklearn import ensemble
from sklearn.manifold import TSNE
import time
from os.path import join as pjoin
from tools.config import FLAGS
from tools.visualize import scatter
def get_activations(exp_data, w, b):
exp_data = np.transpose(exp_data)
... | import numpy as np
import sklearn
from scipy.special import expit
from sklearn import ensemble
from sklearn.manifold import TSNE
import time
from os.path import join as pjoin
from tools.config import FLAGS
from tools.visualize import scatter
def get_activations(exp_data, w, b):
exp_data = np.transpose(exp_data)
... | apache-2.0 | Python |
b91fa2d978a7d4450b126496cbb7ff3873a1b00f | Fix PEP8 E128 | backstage/functions | examples/pluct/post-item.py | examples/pluct/post-item.py | import pluct
functions = pluct.resource('http://localhost:8100').rel('functions')
code = '''
function main (x, callback) {
var result = x * 10;
callback(null, {marcos: result});
};
'''
new_code = functions.rel('update',
params={'id': 'my-code', 'namespace': 'backstage'},
... | import pluct
functions = pluct.resource('http://localhost:8100').rel('functions')
code = '''
function main (x, callback) {
var result = x * 10;
callback(null, {marcos: result});
};
'''
new_code = functions.rel('update',
params={'id': 'my-code', 'namespace': 'backstage'},
data={'code': cod... | mit | Python |
ae80e42ac2176c829eb575ed8ee5ca32077e34f0 | clean up AutoFallbackSolver.__new__() | BubuLK/sfepy,vlukes/sfepy,sfepy/sfepy,rc/sfepy,rc/sfepy,vlukes/sfepy,BubuLK/sfepy,vlukes/sfepy,rc/sfepy,BubuLK/sfepy,sfepy/sfepy,sfepy/sfepy | sfepy/solvers/auto_fallback.py | sfepy/solvers/auto_fallback.py | from __future__ import absolute_import
from sfepy.base.base import Struct
from sfepy.solvers.solvers import Solver, use_first_available
class AutoFallbackSolver(Solver):
"""
Base class for virtual solvers with the automatic fallback.
"""
_ls_solvers = []
def __new__(cls, conf, **kwargs):
... | from __future__ import absolute_import
from sfepy.base.base import Struct
from sfepy.solvers.solvers import Solver, use_first_available
class AutoFallbackSolver(Solver):
"""
Base class for virtual solvers with the automatic fallback.
"""
_ls_solvers = []
def __new__(cls, conf, **kwargs):
... | bsd-3-clause | Python |
bab46e2b9bdd6cf87e7ef5f034adfdedbe94fc59 | Bump app version to 2021.6.1 | kernelci/kernelci-backend,kernelci/kernelci-backend | app/handlers/__init__.py | app/handlers/__init__.py | __version__ = "2021.6.1"
__versionfull__ = __version__
| __version__ = "2021.6.0"
__versionfull__ = __version__
| lgpl-2.1 | Python |
5caa758b5638e0244da6818aa27092ad41801cc1 | Add a sanity check per @bbangert | AlexanderplUs/kazoo,bsanders/kazoo,tempbottle/kazoo,rockerbox/kazoo,python-zk/kazoo,AlexanderplUs/kazoo,pombredanne/kazoo,Asana/kazoo,kormat/kazoo,harlowja/kazoo,rockerbox/kazoo,rgs1/kazoo,jacksontj/kazoo,max0d41/kazoo,bsanders/kazoo,rgs1/kazoo,tempbottle/kazoo,pombredanne/kazoo,harlowja/kazoo,max0d41/kazoo,kormat/kazo... | kazoo/tests/test_interrupt.py | kazoo/tests/test_interrupt.py | import os
from nose import SkipTest
from sys import platform
from kazoo.testing import KazooTestCase
class KazooInterruptTests(KazooTestCase):
def test_interrupted_systemcall(self):
'''
Make sure interrupted system calls don't break the world, since we can't
control what all signals our c... | import os
from nose import SkipTest
from sys import platform
from kazoo.testing import KazooTestCase
class KazooInterruptTests(KazooTestCase):
def test_interrupted_systemcall(self):
'''
Make sure interrupted system calls don't break the world, since we can't
control what all signals our c... | apache-2.0 | Python |
cebfed37d1974c34f1a04e87f4ad8a877c19ede9 | Fix wrong date ordering | Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org | Instanssi/main2014/views.py | Instanssi/main2014/views.py | # -*- coding: utf-8 -*-
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from Instanssi.main2014.models import ToimistoJahti,ToimistoSuoritu... | # -*- coding: utf-8 -*-
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from Instanssi.main2014.models import ToimistoJahti,ToimistoSuoritu... | mit | Python |
fc4e3f53ca2defefbe29965468a62b27c5a26f5d | Improve keystone.conf [paste_deploy] documentation | ilay09/keystone,rajalokan/keystone,cernops/keystone,rajalokan/keystone,cernops/keystone,openstack/keystone,openstack/keystone,openstack/keystone,mahak/keystone,mahak/keystone,ilay09/keystone,mahak/keystone,ilay09/keystone,rajalokan/keystone | keystone/conf/paste_deploy.py | keystone/conf/paste_deploy.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 | Python |
f1dfc17b25352da550389bec3632c0301cfe181c | bump revision | sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia | Code/Python/Bindings/python-dvb3/dvb3/__init__.py | Code/Python/Bindings/python-dvb3/dvb3/__init__.py | __version__ = "0.0.5"
| __version__ = "0.0.4"
| apache-2.0 | Python |
1eda98c05e488a2966cbc849f65ffa97fecabf2b | Change 'render_to_response' to 'render' | release-engineering/kobo,release-engineering/kobo,release-engineering/kobo,release-engineering/kobo | examples/state/app/views.py | examples/state/app/views.py | from __future__ import absolute_import
from kobo.django.fields import *
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.forms import ModelForm
from .models import SimpleState
class ModifyForm(ModelForm):
class Meta:... | from __future__ import absolute_import
from kobo.django.fields import *
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.forms import ModelForm
from .models import SimpleState
class ModifyForm(ModelForm):
class Meta:... | lgpl-2.1 | Python |
eda094e52a19da2b384fb515dbfeecd237cd41d8 | fix duplicate models that sneaked in while rebasing. | luzfcb/django-simple-history,pombredanne/django-simple-history,luzfcb/django-simple-history,treyhunner/django-simple-history,pombredanne/django-simple-history,treyhunner/django-simple-history,emergence/django-simple-history,emergence/django-simple-history | simple_history/tests/models.py | simple_history/tests/models.py | from __future__ import unicode_literals
from django.db import models
try:
from django.contrib.auth import get_user_model
User = get_user_model()
except ImportError: # django 1.4 compatibility
from django.contrib.auth.models import User
from simple_history.models import HistoricalRecords
from simple_histo... | from __future__ import unicode_literals
from django.db import models
try:
from django.contrib.auth import get_user_model
User = get_user_model()
except ImportError: # django 1.4 compatibility
from django.contrib.auth.models import User
from simple_history.models import HistoricalRecords
from simple_histo... | bsd-3-clause | Python |
fde116305c97800da9b33ba79ef15e6f8981d51d | Fix remaining refactor | zakdoek/django-simple-resizer,zakdoek/django-simple-resizer | simple_resizer/tests/models.py | simple_resizer/tests/models.py | """
Some models purely for testing
"""
from django.db import models
from django.core.files.storage import FileSystemStorage
def _get_storage():
"""
Create a filesystemstorage
"""
return FileSystemStorage(location="simple_resizer/tests/assets/",
base_url="http://www.exampl... | """
Some models purely for testing
"""
from django.db import models
from django.core.files.storage import FileSystemStorage
def _get_storage():
"""
Create a filesystemstorage
"""
return FileSystemStorage(location="resizer/tests/assets/",
base_url="http://www.example.com/m... | mit | Python |
62c59e1efdd0a5c04bb3854dfb3f98ed5c237c21 | Add test for single-value fraction_illuminated() | skyfielders/python-skyfield,skyfielders/python-skyfield | skyfield/tests/test_almanac.py | skyfield/tests/test_almanac.py | from skyfield import api, almanac
# http://aa.usno.navy.mil/cgi-bin/aa_moonill2.pl?form=1&year=2018&task=00&tz=-05
def test_fraction_illuminated():
ts = api.load.timescale()
t0 = ts.utc(2018, 9, range(9, 19), 5)
e = api.load('de421.bsp')
f = almanac.fraction_illuminated(e, 'moon', t0[-1]).round(2)
... | from skyfield import api, almanac
# http://aa.usno.navy.mil/cgi-bin/aa_moonill2.pl?form=1&year=2018&task=00&tz=-05
def test_fraction_illuminated():
ts = api.load.timescale()
t0 = ts.utc(2018, 9, range(9, 19), 5)
e = api.load('de421.bsp')
p = almanac.fraction_illuminated(e, 'moon', t0).round(2)
asse... | mit | Python |
3abe2db4ae7cee95986ea25baa4190b2f98da0c0 | Fix `RpmPackages` fact class name. | Fizzadar/pyinfra,Fizzadar/pyinfra | pyinfra/facts/rpm.py | pyinfra/facts/rpm.py | from __future__ import unicode_literals
import re
from pyinfra.api import FactBase
from .util.packaging import parse_packages
rpm_regex = r'^(\S+)\ (\S+)$'
rpm_query_format = '%{NAME} %{VERSION}-%{RELEASE}\\n'
class RpmPackages(FactBase):
'''
Returns a dict of installed rpm packages:
.. code:: python... | from __future__ import unicode_literals
import re
from pyinfra.api import FactBase
from .util.packaging import parse_packages
rpm_regex = r'^(\S+)\ (\S+)$'
rpm_query_format = '%{NAME} %{VERSION}-%{RELEASE}\\n'
class RPMPackages(FactBase):
'''
Returns a dict of installed rpm packages:
.. code:: python... | mit | Python |
f5b8a847c91c046350db4597abb373dddca9aed1 | Mark the extension as safe for parallel reading | sphinx-contrib/spelling,sphinx-contrib/spelling | sphinxcontrib/spelling/__init__.py | sphinxcontrib/spelling/__init__.py | import inspect
from .builder import SpellingBuilder
from .directive import SpellingDirective
def setup(app):
# If we are running inside the test suite, "app" will be a module.
if inspect.ismodule(app):
return
app.info('Initializing Spelling Checker')
app.add_builder(SpellingBuilder)
# Reg... | import inspect
from .builder import SpellingBuilder
from .directive import SpellingDirective
def setup(app):
# If we are running inside the test suite, "app" will be a module.
if inspect.ismodule(app):
return
app.info('Initializing Spelling Checker')
app.add_builder(SpellingBuilder)
# Reg... | bsd-2-clause | Python |
d878d89958e01f5c832cf064c2e6f79d74c50a28 | Add additional list subcommands | alisaifee/pyutrack,alisaifee/pyutrack | pyutrack/cli/list.py | pyutrack/cli/list.py | import click
from click import get_current_context
from pyutrack import *
from . import cli
@cli.group()
@click.pass_context
def list(ctx):
pass
@list.resultcallback()
def result(result):
get_current_context().obj.render(result)
@list.command()
@click.pass_context
@click.option('--project', default=None)
@c... | import click
from click import get_current_context
from pyutrack import Issue, Project, User, Group
from . import cli
@cli.group()
@click.pass_context
def list(ctx):
pass
@list.resultcallback()
def result(result):
get_current_context().obj.render(result)
@list.command()
@click.pass_context
@click.option('-... | mit | Python |
36630365d43f14ea31c4f97d80fab66f591b12d9 | Update pattern syntax for deprecation warnings (#5473) | caseyrollins/osf.io,caneruguz/osf.io,DanielSBrown/osf.io,kch8qx/osf.io,TomBaxter/osf.io,binoculars/osf.io,mluke93/osf.io,cwisecarver/osf.io,kwierman/osf.io,Johnetordoff/osf.io,pattisdr/osf.io,doublebits/osf.io,brianjgeiger/osf.io,abought/osf.io,kch8qx/osf.io,crcresearch/osf.io,TomBaxter/osf.io,monikagrabowska/osf.io,ac... | api/base/urls.py | api/base/urls.py | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from settings import API_BASE
from . import views
base_pattern = '^{}'.format(API_BASE)
urlpatterns = [
url(base_pattern,
include(
[
url(r'^$', views.root, nam... | from django.conf import settings
from django.conf.urls import include, url, patterns
from django.conf.urls.static import static
from settings import API_BASE
from . import views
base_pattern = '^{}'.format(API_BASE)
urlpatterns = [
url(base_pattern,
include(patterns('',
url(r'^$'... | apache-2.0 | Python |
9ab4c92336362fbcca859b4df74bee95d071e14f | Update doorbot-v2.py | RABCbot/DoorButler | Test/doorbot-v2.py | Test/doorbot-v2.py | import time
import alsaaudio as aa
import pymumble.pymumble_py3 as pymumble
import audioop
# constants
MIC_CHANNELS = 1 # mono
MIC_FORMAT = aa.PCM_FORMAT_S16_LE # 16 bits litle-endian
MIC_SAMPLESIZE = 2 # two bytes per sample
MIC_RATE = 8000 # Hz
MIC_PERIOD = 160 # 20 ms
MIC_DEVICE = "plughw:... | import time
import alsaaudio as aa
import pymumble.pymumble_py3 as pymumble
import audioop
# constants
MIC_CHANNELS = 1 # mono
MIC_FORMAT = aa.PCM_FORMAT_S16_LE # 16 bits litle-endian
MIC_SAMPLESIZE = 2 # two bytes per sample
MIC_RATE = 8000 # Hz
MIC_PERIOD = 160 # 20 ms
MIC_DEVICE = "plughw:... | mit | Python |
b43ef3c50e132b171f35a5a31c8cd517ef0eaf17 | Use reversed instead of constructing reversed list | mwilliamson/abuse,mwilliamson/abuse | abuse/generate.py | abuse/generate.py | class NonTerminal(object):
def __init__(self, name):
self._name = name
def __hash__(self):
return hash(self._name)
def __eq__(self, other):
return self._name == other._name
def __ne__(self, other):
return self._name != other._name
d... | class NonTerminal(object):
def __init__(self, name):
self._name = name
def __hash__(self):
return hash(self._name)
def __eq__(self, other):
return self._name == other._name
def __ne__(self, other):
return self._name != other._name
d... | bsd-2-clause | Python |
ba185e51e711f0816ccceffd00668f1dda8fcfab | Bump django.VERSION for RC 1. | adieu/django-nonrel,adieu/django-nonrel,heracek/django-nonrel,adieu/django-nonrel,heracek/django-nonrel,heracek/django-nonrel | 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 |
8fe86edafa56ec841a55561e11237af8f4a4a3e6 | bump version to 0.5.1 | briney/abstar | abstar/version.py | abstar/version.py | # Store the version here so:
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
__version__ = '0.5.1' | # Store the version here so:
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
__version__ = '0.5.0' | mit | Python |
173f816a952b1c2110ea7c27c9ce92e7ff7506b1 | move user to his profile to show that it saved | hacklabr/timtec,mupi/escolamupi,mupi/escolamupi,mupi/tecsaladeaula,mupi/tecsaladeaula,mupi/tecsaladeaula,virgilio/timtec,GustavoVS/timtec,hacklabr/timtec,mupi/tecsaladeaula,GustavoVS/timtec,hacklabr/timtec,AllanNozomu/tecsaladeaula,mupi/timtec,virgilio/timtec,virgilio/timtec,AllanNozomu/tecsaladeaula,mupi/timtec,mupi/t... | accounts/views.py | accounts/views.py | from django.contrib.auth import get_user_model
from django.contrib.auth.views import login
from django.core.urlresolvers import reverse
from django.shortcuts import redirect, get_object_or_404
from django.template.response import TemplateResponse
from django.utils.http import is_safe_url
from django.views.generic impor... | from django.contrib.auth import get_user_model
from django.contrib.auth.views import login
from django.core.urlresolvers import reverse
from django.shortcuts import redirect, get_object_or_404
from django.template.response import TemplateResponse
from django.utils.http import is_safe_url
from django.views.generic impor... | agpl-3.0 | Python |
ec4d38aeedc94db5afce0d0c84e27b0a0f3fc768 | move keys to secrets.py | EthanBlackburn/sync-engine,jobscore/sync-engine,PriviPK/privipk-sync-engine,ErinCall/sync-engine,wakermahmud/sync-engine,ErinCall/sync-engine,EthanBlackburn/sync-engine,nylas/sync-engine,rmasters/inbox,wakermahmud/sync-engine,closeio/nylas,PriviPK/privipk-sync-engine,wakermahmud/sync-engine,nylas/sync-engine,jobscore/s... | server/secrets.py | server/secrets.py |
# shh
COOKIE_SECRET = "32oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o/Vo="
# You can manage (ie: reset) these in the Google API Console at https://code.google.com/apis/console
# The account is admin@inboxapp.com
GOOGLE_CONSUMER_KEY = "786647191490.apps.googleusercontent.com"
GOOGLE_CONSUMER_SECRET = "0MnVfEYfFebShe9576R... | agpl-3.0 | Python | |
1f70542bbabaf085bec9d900fdc620af9cdcba36 | Stop using intersphinx | klmitch/pbr,JioCloud/pbr,WiFast/pbr,openstack-dev/pbr,varunarya10/pbr,WiFast/pbr,JioCloud/pbr,openstack-dev/pbr,openstack-dev/pbr,varunarya10/pbr,klmitch/pbr | doc/source/conf.py | doc/source/conf.py | # -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
# -- General configuration ----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
e... | # -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
# -- General configuration ----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
e... | apache-2.0 | Python |
502d1cda325aeeb7f17295b22779c67c5ee99ca4 | update icon load script | erroneousboat/dotfiles,erroneousboat/dotfiles,erroneousboat/dotfiles | files/bin/bin/load.py | files/bin/bin/load.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import psutil
def get_cpu_load():
return psutil.cpu_percent(interval=1)
def get_mem_load():
mem = psutil.virtual_memory()
return mem.percent
def main():
try:
print(" %5s%% %4s%%" % (get_cpu_load(), get_mem_load()))
except:
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import psutil
def get_cpu_load():
return psutil.cpu_percent(interval=1)
def get_mem_load():
mem = psutil.virtual_memory()
return mem.percent
def main():
try:
print(" %5s%% %4s%%" % (get_cpu_load(), get_mem_load()))
except:
... | mit | Python |
0ebe4140acc2b853d3b4d332826f51fb78071760 | Update Meh.py | kallerdaller/Cogs-Yorkfield | Meh/Meh.py | Meh/Meh.py | import discord
from discord.ext import commands
class Meh:
"""Tells a user that you said meh"""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def meh(self, ctx, user : discord.Member):
"""Tags a person and tells them meh"""
#Your code will... | import discord
from discord.ext import commands
class Mycog:
"""Tells a user that you said meh"""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def meh(self, ctx, user : discord.Member):
"""Tags a person and tells them meh"""
#Your code wi... | mit | Python |
4ffbf028669a1fe353137db12b33498474103c4f | fix includes | jimklo/LearningRegistry,jimklo/LearningRegistry,jimklo/LearningRegistry,LearningRegistry/LearningRegistry,jimklo/LearningRegistry,jimklo/LearningRegistry,LearningRegistry/LearningRegistry,LearningRegistry/LearningRegistry,jimklo/LearningRegistry,jimklo/LearningRegistry,jimklo/LearningRegistry,jimklo/LearningRegistry,Le... | LR/lr/websetup.py | LR/lr/websetup.py | """Setup the LR application"""
import logging
import pylons.test
from lr.config.environment import load_environment
from lr.plugins import init_plugins
log = logging.getLogger(__name__)
def setup_app(command, conf, vars):
"""Place any commands to setup lr here"""
# Don't reload the app if it was loaded unde... | """Setup the LR application"""
import logging
import pylons.test
from lr.config.environment import load_environment
from lr.plugins import init_plugins
log = logging.getLogger(__name__)
def setup_app(command, conf, vars):
"""Place any commands to setup lr here"""
# Don't reload the app if it was loaded unde... | apache-2.0 | Python |
a42d98f8755d8f0691ad07e465ff79c11dce454a | Fix image plotting stacking | sataako/fmio-server,sataako/fmio-server,sataako/fmio-server | fmio/visualization.py | fmio/visualization.py | # coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
__metaclass__ = type
import imageio
from fmio import raster
from fmio import basemap
def pngs2gif(png_paths, gif_path, duration=0.2):
"""png_paths: Series"""
ims = png_paths.apply(imageio.imread)
imageio.m... | # coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
__metaclass__ = type
import imageio
from fmio import raster
from fmio import basemap
def pngs2gif(png_paths, gif_path, duration=0.2):
"""png_paths: Series"""
ims = png_paths.apply(imageio.imread)
imageio.m... | mit | Python |
2cf9060db40e746eb49665b3eac83c72fd81d461 | Fix callback erroneously filtered out | PierreRust/apigpio | apigpio/utils.py | apigpio/utils.py | import functools
def Debounce(threshold=100):
"""
Simple debouncing decorator for apigpio callbacks.
Example:
`@Debouncer()
def my_cb(gpio, level, tick)
print('gpio cb: {} {} {}'.format(gpio, level, tick))
`
The threshold can be given to the decorator as an argument (in millis... | import functools
def Debounce(threshold=100):
"""
Simple debouncing decorator for apigpio callbacks.
Example:
`@Debouncer()
def my_cb(gpio, level, tick)
print('gpio cb: {} {} {}'.format(gpio, level, tick))
`
The threshold can be given to the decorator as an argument (in millis... | mit | Python |
0c6a7ba1fd98d3f1bff1914dd31a6be5ec594476 | Update Sphinx.py | MyRobotLab/pyrobotlab,sstocker46/pyrobotlab,mecax/pyrobotlab,MyRobotLab/pyrobotlab,sstocker46/pyrobotlab,sstocker46/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,mecax/pyrobotlab,MyRobotLab/pyrobotlab | service/Sphinx.py | service/Sphinx.py | from java.lang import String
from org.myrobotlab.service import Speech
from org.myrobotlab.service import Sphinx
from org.myrobotlab.service import Runtime
# create ear and mouth
ear = Runtime.createAndStart("ear","Sphinx")
mouth = Runtime.createAndStart("mouth","Speech")
# start listening for the words we are inte... | from java.lang import String
from org.myrobotlab.service import Speech
from org.myrobotlab.service import Sphinx
from org.myrobotlab.service import Runtime
# create ear and mouth
ear = Runtime.createAndStart("ear","Sphinx")
mouth = Runtime.createAndStart("mouth","Speech")
# start listening for the words we are intere... | apache-2.0 | Python |
3b657f3158018865f95ec921e534793ec89307a4 | use logging in sns_message | mredar/harvester,ucldc/harvester,barbarahui/harvester,ucldc/harvester,mredar/harvester,barbarahui/harvester | harvester/sns_message.py | harvester/sns_message.py | import os
import boto3
import botocore.exceptions
import logging
logger = logging.getLogger(__name__)
def publish_to_harvesting(subject, message):
'''Publish a SNS message to the harvesting topic channel'''
client = boto3.client('sns')
# NOTE: this appears to raise exceptions if problem
try:
c... | import os
import boto3
import botocore.exceptions
def publish_to_harvesting(subject, message):
'''Publish a SNS message to the harvesting topic channel'''
client = boto3.client('sns')
# NOTE: this appears to raise exceptions if problem
try:
client.publish(
TopicArn=os.environ['ARN_... | bsd-3-clause | Python |
1f3ac4c16ca63a7a84a8f57765f88597ae6243e3 | Rename Game class as Console | raviqqe/shakyo | shakyo2d_proto.py | shakyo2d_proto.py | #!/usr/bin/env python3
import curses
import curses.ascii
import os
import sys
# the order of bugs
def perror(*message):
print(*message, file=sys.stderr)
def error(*message):
perror("ERROR:", *message)
def fail(*message):
error(*message)
exit(1)
def usage():
fail("usage: {}".format(sys.argv[0]))
# c... | #!/usr/bin/env python3
import curses
import curses.ascii
import os
import sys
# the order of bugs
def perror(*message):
print(*message, file=sys.stderr)
def error(*message):
perror("ERROR:", *message)
def fail(*message):
error(*message)
exit(1)
def usage():
fail("usage: {}".format(sys.argv[0]))
# c... | unlicense | Python |
75e14cded07f36b3c10ac2ed6333640a1671a5ce | bump version number | cggh/scikit-allel | allel/__init__.py | allel/__init__.py | # -*- coding: utf-8 -*-
# flake8: noqa
from . import model
from .model.ndarray import *
from .model.chunked import *
from .model.util import *
try:
import dask
except ImportError:
pass
else:
from .model.dask import *
from . import stats
from .stats import *
from . import plot
from . import io
from .io imp... | # -*- coding: utf-8 -*-
# flake8: noqa
from . import model
from .model.ndarray import *
from .model.chunked import *
from .model.util import *
try:
import dask
except ImportError:
pass
else:
from .model.dask import *
from . import stats
from .stats import *
from . import plot
from . import io
from .io imp... | mit | Python |
6b1cb22fc31d85a3e9e9bbf315ae959d05623427 | Allow hash_behaviour=merge to be respected in core inventory | thaim/ansible,thaim/ansible | lib/ansible/inventory/host.py | lib/ansible/inventory/host.py | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | mit | Python |
7ccb54bd2a3d6a678c481d98940860836830340b | print formatting and info | GregHilston/RouletteEngine | Roulette/roulette_engine.py | Roulette/roulette_engine.py | from Roulette.pick import Pick
from Roulette.roulette import Roulette
from algorithm import Algorithm
class RouletteEngine:
def __init__(self, number_of_rounds_per_run, number_of_runs, algorithm):
self._number_of_rounds_per_run = number_of_rounds_per_run
self._number_of_runs = number_of_runs
... | from Roulette.pick import Pick
from Roulette.roulette import Roulette
from algorithm import Algorithm
class RouletteEngine:
def __init__(self, number_of_rounds_per_run, number_of_runs, algorithm):
self._number_of_rounds_per_run = number_of_rounds_per_run
self._number_of_runs = number_of_runs
... | mit | Python |
a5eef970c71d5a19520e099c4b8de8d0f98be2cf | Create KVStoreModel atomically | jcupitt/sorl-thumbnail,Resmin/sorl-thumbnail,mcenirm/sorl-thumbnail,seedinvest/sorl-thumbnail,fdgogogo/sorl-thumbnail,seedinvest/sorl-thumbnail,MatthewWilkes/sorl-thumbnail,Resmin/sorl-thumbnail,TriplePoint-Software/sorl-thumbnail,einvalentin/sorl-thumbnail,leture/sorl-thumbnail,lampslave/sorl-thumbnail,fdgogogo/sorl-t... | sorl/thumbnail/kvstores/cached_db_kvstore.py | sorl/thumbnail/kvstores/cached_db_kvstore.py | from django.core.cache import cache
from sorl.thumbnail.kvstores.base import KVStoreBase
from sorl.thumbnail.conf import settings
from sorl.thumbnail.models import KVStore as KVStoreModel
class EMPTY_VALUE(object):
pass
class KVStore(KVStoreBase):
def clear(self):
"""
We can clear the databa... | from django.core.cache import cache
from sorl.thumbnail.kvstores.base import KVStoreBase
from sorl.thumbnail.conf import settings
from sorl.thumbnail.models import KVStore as KVStoreModel
class EMPTY_VALUE(object):
pass
class KVStore(KVStoreBase):
def clear(self):
"""
We can clear the databa... | bsd-3-clause | Python |
a7892a773152f2730df7b0a267e2d1559d6ea057 | put branch matrix and term cat in filtered json object, sort all node props by r1, empty adj list for size all to drive new vis | ryanbressler/GraphSpectrometer,ryanbressler/GraphSpectrometer,ryanbressler/GraphSpectrometer | annotateLeaves.py | annotateLeaves.py |
import os
import sys
import json
import branchMatrix
import numpy as np
def main():
fn = sys.argv[1]
fm = sys.argv[2]
branches = sys.argv[3]
print "Annotating %s with header from %s" % (os.path.abspath(fn), os.path.abspath(fm))
fo = open(fn)
data = json.load(fo)
fo.close()
fo = ope... |
import os
import sys
import json
import branchMatrix
import numpy as np
def main():
fn = sys.argv[1]
fm = sys.argv[2]
branches = sys.argv[3]
print "Annotating %s with header from %s" % (os.path.abspath(fn), os.path.abspath(fm))
fo = open(fn)
data = json.load(fo)
fo.close()
fo = ope... | bsd-3-clause | Python |
b47d896d889ffa3ee22f1745b553bbdc917ec9c5 | fix space to be pep8 compliant | bioinfo-center-pasteur-fr/python-solutions-1,C3BI-pasteur-fr/python-solutions-1 | source/_static/code/multiple_fasta_reader.py | source/_static/code/multiple_fasta_reader.py | from collections import namedtuple
Sequence = namedtuple("Sequence", "id comment sequence")
def fasta_reader(fasta_path):
"""
:param fasta_path: the path to the file to parse
:type fasta_path: string
:return: the list of sequences read from the file
:rtype: list of Sequence
"""
sequences... | from collections import namedtuple
Sequence = namedtuple("Sequence", "id comment sequence")
def fasta_reader(fasta_path):
"""
:param fasta_path: the path to the file to parse
:type fasta_path: string
:return: the list of sequences read from the file
:rtype: list of Sequence
"""
sequence... | cc0-1.0 | Python |
44e5a840bef5ff4baafad05adf10a0484c98e8ee | test django rq urls #1 | openaid-IATI/OIPA,tokatikato/OIPA,openaid-IATI/OIPA,tokatikato/OIPA,VincentVW/OIPA,openaid-IATI/OIPA,openaid-IATI/OIPA,zimmerman-zimmerman/OIPA,VincentVW/OIPA,catalpainternational/OIPA,tokatikato/OIPA,tokatikato/OIPA,zimmerman-zimmerman/OIPA,bryanph/OIPA,catalpainternational/OIPA,zimmerman-zimmerman/OIPA,bryanph/OIPA,z... | OIPA/OIPA/urls.py | OIPA/OIPA/urls.py | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django_rq import urls as django_rq_urls
from api.v3.urls import api_v3_docs
admin.autodiscover()
urlpatterns = patterns(
''... | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from api.v3.urls import api_v3_docs
admin.autodiscover()
urlpatterns = patterns(
'',
# (r'^admin/queue/', include('django_r... | agpl-3.0 | Python |
c7f5730dcb3f7f3ac2edb35e9bfedf826b21a2c0 | set content type to applcation/json | KuoE0/MPU6050-WebPlot,KuoE0/MPU6050-WebPlot | signal_receive.py | signal_receive.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2013 KuoE0 <kuoe0.tw@gmail.com>
#
# Distributed under terms of the MIT license.
"""
"""
import tornado.httpserver
import tornado.ioloop
import tornado.web
import serial
import sys
import json
tornado_port = 8888
# create serial object
s... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2013 KuoE0 <kuoe0.tw@gmail.com>
#
# Distributed under terms of the MIT license.
"""
"""
import tornado.httpserver
import tornado.ioloop
import tornado.web
import serial
import sys
import json
tornado_port = 8888
# create serial object
s... | mit | Python |
f92114b6cf8d3de3a6ffec076e9c3c1fdc47e378 | fix for names | dreibh/planetlab-lxc-plcapi,dreibh/planetlab-lxc-plcapi,dreibh/planetlab-lxc-plcapi,dreibh/planetlab-lxc-plcapi | PLC/Methods/AddNodeGroup.py | PLC/Methods/AddNodeGroup.py | from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Auth import Auth
from PLC.NodeGroups import NodeGroup, NodeGroups
from PLC.NodeTagTypes import NodeTagType, NodeTagTypes
from PLC.NodeTags import NodeTag, NodeTags
can_update = lambda (field, value): field in No... | from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Auth import Auth
from PLC.NodeGroups import NodeGroup, NodeGroups
from PLC.NodeTagTypes import NodeTagType, NodeTagTypes
from PLC.NodeTags import NodeTag, NodeTags
can_update = lambda (field, value): field in No... | bsd-3-clause | Python |
634c8e614c29e27c7b515a0dfc7a843f256b08e7 | add null check to is_event | jgayfer/spirit | cogs/utils/checks.py | cogs/utils/checks.py | def is_event(message):
"""Check if a message contains event data"""
if message.embeds[0]:
embed = message.embeds[0]
return (message.channel.name == 'upcoming-events'
and 'fields' in embed
and 'name' in embed['fields'][0]
and 'name' in embed['fields... | def is_event(message):
"""Check if a message contains event data"""
embed = message.embeds[0]
return (message.channel.name == 'upcoming-events'
and 'fields' in embed
and 'name' in embed['fields'][0]
and 'name' in embed['fields'][1]
and 'name' in embed['fields'... | mit | Python |
5b4065efa71cd34deaea8c8455170ff76922f315 | manage uuid object in json encoder | miLibris/flask-rest-jsonapi | flask_rest_jsonapi/utils.py | flask_rest_jsonapi/utils.py | # -*- coding: utf-8 -*-
import json
from uuid import UUID
from datetime import datetime
class JSONEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime):
return obj.isoformat()
elif isinstance(obj, UUID):
return str(obj)
return json.JSONEnc... | # -*- coding: utf-8 -*-
import json
from datetime import datetime
class JSONEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime):
return obj.isoformat()
return json.JSONEncoder.default(self, obj)
| mit | Python |
98e5c086b7358224a5709ec0b73d0af5112a243d | Bump version to 1.0.1 | django-fluent/django-fluent-comments,BangorUniversity/django-fluent-comments,edoburu/django-fluent-comments,django-fluent/django-fluent-comments,BangorUniversity/django-fluent-comments,edoburu/django-fluent-comments,PetrDlouhy/django-fluent-comments,PetrDlouhy/django-fluent-comments,edoburu/django-fluent-comments,akszy... | fluent_comments/__init__.py | fluent_comments/__init__.py | """
API for :ref:`custom-comment-app-api`
"""
from fluent_comments import appsettings
from fluent_comments.models import FluentComment
from fluent_comments.forms import FluentCommentForm
# following PEP 386
__version__ = "1.0.1"
if appsettings.USE_THREADEDCOMMENTS:
# Extend the API provided by django-threadedco... | """
API for :ref:`custom-comment-app-api`
"""
from fluent_comments import appsettings
from fluent_comments.models import FluentComment
from fluent_comments.forms import FluentCommentForm
# following PEP 386
__version__ = "1.0"
if appsettings.USE_THREADEDCOMMENTS:
# Extend the API provided by django-threadedcomm... | apache-2.0 | Python |
d563b11ee6115bc84877770997b1a24b23c7a855 | Fix input handler tests | biocore/pyqi,biocore/pyqi | tests/test_core/test_interfaces/test_optparse/test_input_handler.py | tests/test_core/test_interfaces/test_optparse/test_input_handler.py | #!/usr/bin/env python
#-----------------------------------------------------------------------------
# Copyright (c) 2013, The BiPy Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#--------------------------... | #!/usr/bin/env python
#-----------------------------------------------------------------------------
# Copyright (c) 2013, The BiPy Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#--------------------------... | bsd-3-clause | Python |
e8a81193114613d1227b0b7221410e1e02a89e46 | Rename self._slug to self.old_slug | samuelmaudo/yepes,samuelmaudo/yepes,samuelmaudo/yepes,samuelmaudo/yepes | yepes/model_mixins/slugged.py | yepes/model_mixins/slugged.py | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.contrib.contenttypes.generic import GenericRelation
from django.utils.translation import ugettext_lazy as _
from yepes import fields
from yepes import managers
from yepes.loading import is_installed
from yepes.model_mixins import Linked
cla... | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.contrib.contenttypes.generic import GenericRelation
from django.utils.translation import ugettext_lazy as _
from yepes import fields
from yepes import managers
from yepes.loading import is_installed
from yepes.model_mixins import Linked
cla... | bsd-3-clause | Python |
ae59cf021edb6b7786f338ccc171283abebcb8ea | Remove commented out code | berkmancenter/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT/mediacloud,AchyuthIIIT... | python_scripts/extractor_python_readability_server.py | python_scripts/extractor_python_readability_server.py | #!/usr/bin/python
import sys
import os
import glob
sys.path.append(os.path.join(os.path.dirname(__file__),"gen-py/thrift_solr/"))
sys.path.append(os.path.dirname(__file__) )
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from thrift.server imp... | #!/usr/bin/python
import sys
import os
import glob
sys.path.append(os.path.join(os.path.dirname(__file__),"gen-py/thrift_solr/"))
sys.path.append(os.path.dirname(__file__) )
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from thrift.server imp... | agpl-3.0 | Python |
84647be1350ee4a7652b55ba0ee4a34a1cdf1f67 | remove Lucene dependency | armijnhemel/binaryanalysis | src/name2program.py | src/name2program.py | #!/usr/bin/python
## Binary Analysis Tool
## Copyright 2010-2011 Armijn Hemel for LOCO (LOOHUIS CONSULTING)
## Licensed under Apache 2.0, see LICENSE file for details
'''
This tool maps the name of a program to the name of one or more packages.
'''
import os, sys, re, subprocess
import os.path
import sqlite3
from op... | #!/usr/bin/python
## Binary Analysis Tool
## Copyright 2010-2011 Armijn Hemel for LOCO (LOOHUIS CONSULTING)
## Licensed under Apache 2.0, see LICENSE file for details
'''
This tool maps the name of a program to the name of one or more packages.
'''
import os, sys, re, subprocess
import os.path
import lucene
from opt... | apache-2.0 | Python |
0d310fe7ad42847d07e2fb72c428a7278fddef0e | Fix (?) email command. | abilian/abilian-sbe,abilian/abilian-sbe,abilian/abilian-sbe,abilian/abilian-sbe,abilian/abilian-sbe | abilian/sbe/apps/forum/commands.py | abilian/sbe/apps/forum/commands.py | # coding=utf-8
""""""
from __future__ import absolute_import, print_function, unicode_literals
import fileinput
import logging
import sys
from email.parser import FeedParser
from flask_script import Manager
from .tasks import check_maildir, process_email
logger = logging.getLogger(__name__)
manager = Manager(descr... | # coding=utf-8
""""""
from __future__ import absolute_import, print_function, unicode_literals
import fileinput
import logging
import sys
from email.parser import FeedParser
from flask_script import Manager
from .tasks import check_maildir, process_email
logger = logging.getLogger(__name__)
manager = Manager(descr... | lgpl-2.1 | Python |
43f4dd50c4dd9811c171db41a0240092c636fe17 | Fix a typing error introduced in the previous commit. | inveniosoftware/invenio-formatter,inveniosoftware/invenio-formatter,tiborsimko/invenio-formatter,tiborsimko/invenio-formatter,inveniosoftware/invenio-formatter,tiborsimko/invenio-formatter | lib/elements/bfe_topbanner.py | lib/elements/bfe_topbanner.py | # -*- coding: utf-8 -*-
##
## $Id$
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN.
##
## CDS Invenio 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 v... | # -*- coding: utf-8 -*-
##
## $Id$
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN.
##
## CDS Invenio 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 v... | mit | Python |
001bd68766381924a36dd11a38049dd16ed2ac8c | update init | tmthydvnprt/compfipy,tmthydvnprt/compfipy | compfipy/__init__.py | compfipy/__init__.py | """
compfipy
Computational Finance in Python
"""
__all__ = ['asset', 'portfolio', 'market', 'models', 'calculator']
__version__ = '0.1.0'
__date__ = '2015-06-14 05:15:58 -0700'
__author__ = 'tmthydvnprt'
__status__ = 'development'
__website__ = 'https://github.com/tmthydvnprt/compfipy'
__email__ = 'tmthydvnprt@users.n... | """
compfipy
"""
pass
| mit | Python |
8a09e49cbcb9a874619b0e06601c2d69d5dad738 | Fix --version to output version | alexpilotti/python-keystoneclient,alexpilotti/python-keystoneclient,jamielennox/python-keystoneclient,ntt-sic/python-keystoneclient,klmitch/python-keystoneclient,metacloud/python-keystoneclient,sdpp/python-keystoneclient,ging/python-keystoneclient,sdpp/python-keystoneclient,ging/python-keystoneclient,darren-wang/ksc,Me... | keystoneclient/__init__.py | keystoneclient/__init__.py | # Copyright 2012 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | # Copyright 2012 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 | Python |
c0640b6521d49e07681b0c43c2015c150dff32df | Update "can delegate via forward on user" test. Still fails because of permissions | phihag/adhocracy,DanielNeugebauer/adhocracy,liqd/adhocracy,alkadis/vcv,DanielNeugebauer/adhocracy,phihag/adhocracy,SysTheron/adhocracy,alkadis/vcv,SysTheron/adhocracy,SysTheron/adhocracy,DanielNeugebauer/adhocracy,alkadis/vcv,alkadis/vcv,phihag/adhocracy,phihag/adhocracy,phihag/adhocracy,liqd/adhocracy,DanielNeugebauer... | adhocracy/tests/model/test_user.py | adhocracy/tests/model/test_user.py | from adhocracy.model import Delegation
from adhocracy.tests import TestController
from adhocracy.tests.testtools import tt_make_proposal, tt_make_user
class TestUserController(TestController):
def test_can_delegate_via_forward_on_user(self):
proposal = tt_make_proposal(voting=True)
me = tt_make... | from adhocracy.tests import TestController
from adhocracy.tests.testtools import tt_make_proposal, tt_make_user
class TestUserController(TestController):
def test_can_delegate_via_forward_on_user(self):
proposal = tt_make_proposal(voting=True)
me = tt_make_user()
delegate = tt_make_user()... | agpl-3.0 | Python |
8b0371aa0efb2894b14769f3f0b0f162a37c0bcc | fix PyYAML as per CVE-2017-18342 | Juniper/py-junos-eznc,Juniper/py-junos-eznc,Juniper/py-junos-eznc | lib/jnpr/junos/op/__init__.py | lib/jnpr/junos/op/__init__.py | import sys
import os
import yaml
import types
from jnpr.junos.factory.factory_loader import FactoryLoader
__all__ = []
class MetaPathFinder(object):
def find_module(self, fullname, path=None):
mod = fullname.split('.')[-1]
if mod in [os.path.splitext(i)[0] for i in os.listdir(
os... | import sys
import os
import yaml
import types
from jnpr.junos.factory.factory_loader import FactoryLoader
__all__ = []
class MetaPathFinder(object):
def find_module(self, fullname, path=None):
mod = fullname.split('.')[-1]
if mod in [os.path.splitext(i)[0] for i in os.listdir(
os... | apache-2.0 | Python |
944d092d56ce80e2914b4222fe21d577e29658ea | Bump version to 6.0.0a2 | genialis/resolwe,jberci/resolwe,jberci/resolwe,genialis/resolwe | resolwe/__about__.py | resolwe/__about__.py | """Central place for package metadata."""
# NOTE: We use __title__ instead of simply __name__ since the latter would
# interfere with a global variable __name__ denoting object's name.
__title__ = 'resolwe'
__summary__ = 'Open source enterprise dataflow engine in Django'
__url__ = 'https://github.com/genialis/re... | """Central place for package metadata."""
# NOTE: We use __title__ instead of simply __name__ since the latter would
# interfere with a global variable __name__ denoting object's name.
__title__ = 'resolwe'
__summary__ = 'Open source enterprise dataflow engine in Django'
__url__ = 'https://github.com/genialis/re... | apache-2.0 | Python |
0d2cb6f2091c01c9e57fd9b3c9d723b3e3d7080c | Add security_group_rule to objects registry | Metaswitch/calico-nova,barnsnake351/nova,MountainWei/nova,cloudbase/nova-virtualbox,hanlind/nova,maelnor/nova,jianghuaw/nova,zhimin711/nova,blueboxgroup/nova,TwinkleChawla/nova,dawnpower/nova,bgxavier/nova,thomasem/nova,j-carpentier/nova,tianweizhang/nova,openstack/nova,bigswitch/nova,openstack/nova,yosshy/nova,berrang... | nova/objects/__init__.py | nova/objects/__init__.py | # Copyright 2013 IBM Corp.
#
# 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 agree... | # Copyright 2013 IBM Corp.
#
# 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 agree... | apache-2.0 | Python |
00df45d086c46607f85a038e7f5e0c61df777a92 | fix netaddr.IPNetwork takes a cidr as string | jaypipes/os_vif | os_vif/objects/subnet.py | os_vif/objects/subnet.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 |
bee27f2500bdc80a436499d2d356a87572065aeb | Add tests for insert method | jonathanstallings/data-structures,jay-tyler/data-structures | test_priorityq.py | test_priorityq.py | from __future__ import unicode_literals
import pytest
from priorityq import PriorityQ, QNode
@pytest.fixture()
def QNode_list():
QNode_list = [
QNode(10),
QNode(5, 2),
QNode(100, 1)
]
return QNode_list
@pytest.fixture()
def base_pqueue(QNode_list):
return base_pqueue(QNode_l... | from __future__ import unicode_literals
import pytest
from priorityq import PriorityQ, QNode
def test_QNode_init_no_priority():
r = QNode(10)
assert r.val == 10
assert r.priority is None
def test_QNode_init_with_priority():
p = QNode('string', 0)
assert p.val == 'string'
assert p.priority i... | mit | Python |
987d785c9601c4dce19ca0e066b38df10e799d7a | remove docstring for build_sphinx | materialsproject/MPContribs,materialsproject/MPContribs,materialsproject/MPContribs,materialsproject/MPContribs | test_site/urls.py | test_site/urls.py | """test_site URL Configuration"""
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'', include('django_browserid.urls')),
url(r'', include('webtzite.urls')),
url(r'^accounts/', include('nopassword.urls')),
url(r'^admin/', include(admin.site.urls)),
url... | """test_site URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | mit | Python |
f4c9161f84013191779b841d88184bb5f87ea36c | add v2021-07-05 (#25565) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/ca-certificates-mozilla/package.py | var/spack/repos/builtin/packages/ca-certificates-mozilla/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 CaCertificatesMozilla(Package):
"""The Mozilla CA certificate store in PEM format"""
... | # 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 CaCertificatesMozilla(Package):
"""The Mozilla CA certificate store in PEM format"""
... | lgpl-2.1 | Python |
ba6a3c73e7a06f1855d4426b2eb7ccaa4951f1a0 | Add Python 2 fix | fin/froide,stefanw/froide,stefanw/froide,fin/froide,fin/froide,stefanw/froide,fin/froide,stefanw/froide,stefanw/froide | froide/helper/form_utils.py | froide/helper/form_utils.py | import json
from django.db import models
try:
unicode
except NameError:
unicode = str
class DjangoJSONEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, models.Model) and hasattr(obj, 'as_data'):
return obj.as_data()
return json.JSONEncoder.default(self, ob... | import json
from django.db import models
class DjangoJSONEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, models.Model) and hasattr(obj, 'as_data'):
return obj.as_data()
return json.JSONEncoder.default(self, obj)
def get_data(error):
if isinstance(error, (di... | mit | Python |
638c1d92d82cfa5d8e9a3c5bfacee630282cc0a4 | Remove "temp" from temporal workers, as they may have max_seconds_idle to None, not being temp at all | alvarogzp/telegram-bot,alvarogzp/telegram-bot | bot/multithreading/worker/pool/name_generator.py | bot/multithreading/worker/pool/name_generator.py | class WorkerPoolNameGenerator:
def __init__(self, base_name: str, max_workers: int, max_seconds_idle: int):
self.base_name = base_name
self.max_workers = max_workers
self.max_seconds_idle = max_seconds_idle
def get_name(self, number: int, is_temporal: bool = False):
name = self.... | class WorkerPoolNameGenerator:
def __init__(self, base_name: str, max_workers: int, max_seconds_idle: int):
self.base_name = base_name
self.max_workers = max_workers
self.max_seconds_idle = max_seconds_idle
def get_name(self, number: int, is_temporal: bool = False):
name = self.... | agpl-3.0 | Python |
b95e55d80f7dcef76f96f35a6e42fe0fedc60b97 | Remove debug print | bearstech/modoboa-admin,bearstech/modoboa-admin,bearstech/modoboa-admin | modoboa_admin/management/commands/_import.py | modoboa_admin/management/commands/_import.py | import os.path
import sys
import csv
from modoboa.core.models import User
from modoboa.lib import events
from modoboa.lib.exceptions import Conflict
from modoboa_admin.views.import_ import ( # NOQA
import_account, import_alias, import_forward, import_dlist,
import_domain, import_domainalias
)
def import_cs... | import os.path
import sys
import csv
from modoboa.core.models import User
from modoboa.lib import events
from modoboa.lib.exceptions import Conflict
from modoboa_admin.views.import_ import ( # NOQA
import_account, import_alias, import_forward, import_dlist,
import_domain, import_domainalias
)
def import_cs... | mit | Python |
8487c508453a1ee7425abfffa363bc366c4e5c87 | Update session.py | TingPing/plugins,TingPing/plugins | HexChat/session.py | HexChat/session.py | from __future__ import print_function
import hexchat
__module_name__ = "session"
__module_author__ = "TingPing"
__module_version__ = "1"
__module_description__ = "Saves current session for next start"
# To use just disable auto-connect and start using 'Quit and Save' from the menu.
def load_session():
for pref in he... | from __future__ import print_function
import hexchat
__module_name__ = "session"
__module_author__ = "TingPing"
__module_version__ = "1"
__module_description__ = "Saves current session for next start"
# To use just disable auto-connect and start using 'Quit and Save' from the menu.
def load_session():
for pref in he... | mit | Python |
01e5746931f2f6a12019c35acec27da882a3da8c | bump version | nickp60/riboSeed,nickp60/riboSeed,nickp60/riboSeed | riboSeed/_version.py | riboSeed/_version.py | __version__ = '0.4.82'
| __version__ = '0.4.80'
| mit | Python |
9e1a4a41c6d9acb446f7cfa228aaa0e366507aba | Update log code | bootstraponline/scrapy-broken-links | broken_links/broken_links/spiders/link_spider.py | broken_links/broken_links/spiders/link_spider.py | # -*- coding: utf-8 -*-
import scrapy
from scrapy import log
from scrapy.contrib.linkextractors import LinkExtractor
from scrapy.contrib.spiders import CrawlSpider, Rule
from broken_links.items import BrokenLinksItem
# scrapy runspider link_spider.py
#
# run from the project directory (broken_links/broken_links$ )
# ... | # -*- coding: utf-8 -*-
import scrapy
from scrapy.contrib.linkextractors import LinkExtractor
from scrapy.contrib.spiders import CrawlSpider, Rule
from broken_links.items import BrokenLinksItem
# scrapy runspider link_spider.py
#
# run from the project directory (broken_links/broken_links$ )
# note that this will app... | apache-2.0 | Python |
acc6ebb82b2a4c116b9d0cfb09696afce7b2bf88 | Update .logger's docstring header to correspond to new name | sjktje/sjkscan,sjktje/sjkscan | sjkscan/logger.py | sjkscan/logger.py | # -*- coding: utf-8 -*-
"""
sjkscan.logger
~~~~~~~~~~~~~~
This module handles logging related tasks, such as initialising the
logging environment.
:copyright: (c) 2016 by Svante Kvarnström
:license: BSD, see LICENSE for more details.
"""
import logging
def init_logging(level):
"""Initial... | # -*- coding: utf-8 -*-
"""
sjkscan.logging
~~~~~~~~~~~~~~~
This module handles logging related tasks, such as initialising the
logging environment.
:copyright: (c) 2016 by Svante Kvarnström
:license: BSD, see LICENSE for more details.
"""
import logging
def init_logging(level):
"""Initi... | bsd-2-clause | Python |
8dfb06007ea4ed70b1b0e971eb56c72da2b3ee15 | Update __init__.py to expose SlackRTMClient | seancron/slack-rtm | slack/__init__.py | slack/__init__.py | __title__ = 'slack-rtm'
__version__ = '0.1.0'
__author__ = 'Sean Cronin'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015 Sean Cronin'
from .client import SlackRTMClient
| mit | Python | |
93e7a027c25b7774eedee4045995e3649d5d9856 | Bump version | rocky/pycolumnize,rocky/pycolumnize,jlec/pycolumnize | VERSION.py | VERSION.py | # This file is needs to be multi-lingual in both Python and POSIX
# shell which "execfile" or "source" it respectively.
# This file should define a variable VERSION which we use as the
# debugger version number.
VERSION='0.3.7_01'
| # This file is needs to be multi-lingual in both Python and POSIX
# shell which "execfile" or "source" it respectively.
# This file should define a variable VERSION which we use as the
# debugger version number.
VERSION='0.3.7'
| mit | Python |
2aa8c1560f8bd2f1eb9958fdd3af86c9b36212e5 | Fix except to be compatible with Py3 | treyhunner/editorconfig-tools,treyhunner/editorconfig-tools | editorconfig_tools/check_editorconfig.py | editorconfig_tools/check_editorconfig.py | #!/usr/bin/env python
import sys
from clint import arguments
from clint.textui import puts, colored, indent
from os.path import abspath
from editorconfig_tools import EditorConfigChecker
from editorconfig import get_properties, EditorConfigError
COMMANDS = [
('--fix', "Fix EditorConfig file automatically."),
... | #!/usr/bin/env python
import sys
from clint import arguments
from clint.textui import puts, colored, indent
from os.path import abspath
from editorconfig_tools import EditorConfigChecker
from editorconfig import get_properties, EditorConfigError
COMMANDS = [
('--fix', "Fix EditorConfig file automatically."),
... | bsd-2-clause | Python |
81fe7727c04961ff37b263f0536ae5f986f35b41 | update debug line | dajusc/trimesh,mikedh/trimesh,mikedh/trimesh,mikedh/trimesh,mikedh/trimesh,dajusc/trimesh | tests/test_dxf.py | tests/test_dxf.py | import generic as g
class DXFTest(g.unittest.TestCase):
def setUp(self):
self.drawings = [g.trimesh.load_path(i) for i in g.data['2D_files']]
self.single = g.np.hstack([i.split() for i in self.drawings])
def test_dxf(self):
for p in self.single:
p.vertices /= p.scale
... | import generic as g
class DXFTest(g.unittest.TestCase):
def setUp(self):
self.drawings = [g.trimesh.load_path(i) for i in g.data['2D_files']]
self.single = g.np.hstack([i.split() for i in self.drawings])
def test_dxf(self):
for p in self.single:
p.vertices /= p.scale
... | mit | Python |
a82825341ad118222dd45ef70ea0a468d8ff1c30 | Add Snapshotable mixin and back references for Snapshot objects | selahssea/ggrc-core,AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,j0gurt/ggrc-core,plamut/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,andrei-karaliona... | src/ggrc/models/snapshot.py | src/ggrc/models/snapshot.py | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Module for Snapshot object"""
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy import orm
from ggrc import db
from ggrc.models.deferred import deferred
from ggrc.models import mixins... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Module for Snapshot object"""
from ggrc import db
from ggrc.models.deferred import deferred
from ggrc.models import mixins
class Snapshot(mixins.Base, db.Model):
"""Snapshot object that holds a join ... | apache-2.0 | Python |
e44fd462e02a1f2e07a24545820d358a58a1cf74 | Add link to MSDN documentation of CallNamedPipe. | python-postgres/fe,python-postgres/fe | postgresql/port/signal1_msw.py | postgresql/port/signal1_msw.py | ##
# copyright 2009, James William Pye
# http://python.projects.postgresql.org
##
"""
Support for PG signals on Windows platforms.
This implementation supports all known versions of PostgreSQL. (2009)
CallNamedPipe:
http://msdn.microsoft.com/en-us/library/aa365144%28VS.85%29.aspx
"""
from ctypes import windll, winty... | ##
# copyright 2009, James William Pye
# http://python.projects.postgresql.org
##
"""
Support for PG signals on Windows platforms.
This implementation supports all known versions of PostgreSQL.
"""
from ctypes import windll, wintypes, pointer
# CallNamedPipe from kernel32.
CallNamedPipeA = windll.kernel32.CallNamedPi... | bsd-3-clause | Python |
9ed5021ca615f2050ed18b6e11b7c3e640459c76 | support for subtitles | iwconfig/svtplay-dl,spaam/svtplay-dl,selepo/svtplay-dl,leakim/svtplay-dl,OakNinja/svtplay-dl,selepo/svtplay-dl,qnorsten/svtplay-dl,qnorsten/svtplay-dl,spaam/svtplay-dl,OakNinja/svtplay-dl,leakim/svtplay-dl,iwconfig/svtplay-dl,OakNinja/svtplay-dl,olof/svtplay-dl,dalgr/svtplay-dl,leakim/svtplay-dl,dalgr/svtplay-dl,olof/s... | lib/svtplay/service/kanal5.py | lib/svtplay/service/kanal5.py | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
from __future__ import absolute_import
import sys
import re
import json
from svtplay.utils import get_http_data, select_quality
from svtplay.log import log
from svtplay.rtmp import download_rtmp
class Kanal5():
def handle(sel... | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
from __future__ import absolute_import
import sys
import re
import json
from svtplay.utils import get_http_data, select_quality
from svtplay.log import log
from svtplay.rtmp import download_rtmp
class Kanal5():
def handle(sel... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.