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 |
|---|---|---|---|---|---|---|---|---|
5c35a57d703b2627f9f8903841e8115c2e1606e4 | add io | methane/minefield,methane/minefield,methane/minefield,methane/minefield | meinheld/middleware.py | meinheld/middleware.py | from meinheld import server
import greenlet
CLIENT_KEY = 'meinheld.client'
CONTINUATION_KEY = 'meinheld.continuation'
IO_KEY = 'wsgix.io'
class Continuation(object):
def __init__(self, client):
self.client = client
def suspend(self):
return server._suspend_client(self.client)
def re... | from meinheld import server
import greenlet
CLIENT_KEY = 'meinheld.client'
CONTINUATION_KEY = 'meinheld.continuation'
class Continuation(object):
def __init__(self, client):
self.client = client
def suspend(self):
return server._suspend_client(self.client)
def resume(self, *args, **... | bsd-3-clause | Python |
996f110415cfb1f84ec6171f0b1a362b537685d8 | Fix "invalid escape sequence \s" deprecation warning | andersinno/django-form-designer-ai,andersinno/django-form-designer,kcsry/django-form-designer,andersinno/django-form-designer,andersinno/django-form-designer-ai,kcsry/django-form-designer | form_designer/email.py | form_designer/email.py | import re
import django
from django.core.mail import EmailMessage
from django.utils.encoding import force_text
from form_designer.utils import string_template_replace
DJANGO_18 = django.VERSION[:2] >= (1, 8)
def _template_replace_list(input_str, context_dict):
"""
Split the input string by commas or semico... | import re
import django
from django.core.mail import EmailMessage
from django.utils.encoding import force_text
from form_designer.utils import string_template_replace
DJANGO_18 = django.VERSION[:2] >= (1, 8)
def _template_replace_list(input_str, context_dict):
"""
Split the input string by commas or semico... | bsd-3-clause | Python |
a6362b702b5494146a6c9e1d5accf03797fee981 | Reduce duplication of settings name | Rypac/sublime-format | src/settings.py | src/settings.py | import sublime
class Settings():
FORMAT_SETTINGS = 'Format.sublime-settings'
@staticmethod
def load():
return sublime.load_settings(Settings.FORMAT_SETTINGS)
@staticmethod
def save():
sublime.save_settings(Settings.FORMAT_SETTINGS)
@staticmethod
def on_change(callback):
... | import sublime
class Settings():
@staticmethod
def load():
return sublime.load_settings('Format.sublime-settings')
@staticmethod
def save():
sublime.save_settings('Format.sublime-settings')
@staticmethod
def on_change(callback):
Settings.load().add_on_change('Format.s... | mit | Python |
cb9e234600c3f06c7dec084d2055f4a52b1f5975 | Update urls.py | nleng/django-monit-collector,nleng/django-monit-collector,nleng/django-monit-collector,nleng/django-monit-collector | monitcollector/urls.py | monitcollector/urls.py | """monitcollector 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')
Cl... | """prettymonit 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... | bsd-3-clause | Python |
3144b548d58f219b573d82bbb2d1bfee171061d9 | Fix history view after merge | PressLabs/gitfs,rowhit/gitfs,PressLabs/gitfs,bussiere/gitfs,ksmaheshkumar/gitfs | gitfs/views/history.py | gitfs/views/history.py | import os
from stat import S_IFDIR
from errno import ENOENT
from fuse import FuseOSError
from gitfs.log import log
from .read_only import ReadOnlyView
class HistoryView(ReadOnlyView):
def getattr(self, path, fh=None):
'''
Returns a dictionary with keys identical to the stat C structure of
... | import os
from stat import S_IFDIR
from errno import ENOENT
from fuse import FuseOSError
from gitfs.log import log
from .read_only import ReadOnlyView
class HistoryView(ReadOnlyView):
def getattr(self, path, fh=None):
'''
Returns a dictionary with keys identical to the stat C structure of
... | apache-2.0 | Python |
e3e52d63a05d0373a91a4cac746ad09dbbc42f13 | Remove filesystem signal for stopping speech | MycroftAI/mycroft-core,forslund/mycroft-core,forslund/mycroft-core,MycroftAI/mycroft-core | mycroft/audio/utils.py | mycroft/audio/utils.py | # Copyright 2017 Mycroft AI 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 writin... | # Copyright 2017 Mycroft AI 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 writin... | apache-2.0 | Python |
c9c2cb0661de4a0fd955068acc5a1c7dbc2de790 | update tests | sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana | test/test_fasta.py | test/test_fasta.py | import os
from sequana import FastA, sequana_data
from sequana.fasta import is_fasta
from easydev import TempFile
def test_format_contigs_denovo():
# test with a custom fasta
filename = sequana_data("test_fasta.fasta")
contigs = FastA(filename)
with TempFile(suffix='.fasta') as fh:
contigs.f... | import os
from sequana import FastA, sequana_data
from sequana.fasta import is_fasta
from easydev import TempFile
def test_format_contigs_denovo():
# test with a custom fasta
filename = sequana_data("test_fasta.fasta")
contigs = FastA(filename)
with TempFile(suffix='.fasta') as fh:
contigs.f... | bsd-3-clause | Python |
e7954822d9c941b84917c4ec4a0a2f5357c9751b | Fix test to make it compatible with further changes | ahitrin/carlo | test/test_model.py | test/test_model.py | # coding: utf-8
import os, sys
sys.path.append(os.path.join(sys.path[0], '..'))
from carlo import Model, ModelException, eq, int_val, string_val
import pytest
def test_minimal_model():
m = Model(const={'int': int_val(42)}).build()
assert [('const', {'int': 42})] == m.create()
m = Model(const2={'str': stri... | # coding: utf-8
import os, sys
sys.path.append(os.path.join(sys.path[0], '..'))
from carlo import Model, ModelException, eq, int_val, string_val
import pytest
def test_minimal_model():
m = Model(const={'int': int_val(42)}).build()
assert [('const', {'int': 42})] == m.create()
m = Model(const2={'str': stri... | mit | Python |
2933ac6a0ecdd18763a528559d2813512d309873 | Add Unit Tests for utils.py | Alignak-monitoring-contrib/alignak-app,Alignak-monitoring-contrib/alignak-app | test/test_utils.py | test/test_utils.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016:
# Matthieu Estrada, ttamalfor@gmail.com
#
# This file is part of (AlignakApp).
#
# (AlignakApp) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Sof... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016:
# Matthieu Estrada, ttamalfor@gmail.com
#
# This file is part of (AlignakApp).
#
# (AlignakApp) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Sof... | agpl-3.0 | Python |
75379d0510961c8a88251de38c87ea3fe4f31542 | Fix CORS headers configuration. | ironweb/lesfeuxverts-backend | greenlight/settings.py | greenlight/settings.py | # Django settings for greenlight project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
TIME_ZONE = 'America/Montreal'
USE_I18N = False
SECRET_KEY = '9&@r*3hth4m=ml5t5tme0*(9^x@2xqo-ua^s+wg_ws(-^4-7@v'
MIDDLEWARE_CLASSES = (
'django.middleware... | # Django settings for greenlight project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
TIME_ZONE = 'America/Montreal'
USE_I18N = False
SECRET_KEY = '9&@r*3hth4m=ml5t5tme0*(9^x@2xqo-ua^s+wg_ws(-^4-7@v'
MIDDLEWARE_CLASSES = (
'django.middleware... | mit | Python |
2b4ccb7b7dd9bf24d74fc686c7f4296cfe34db51 | Add registration functions to `reg` | DudLab/nanshe_workflow,nanshe-org/nanshe_workflow | nanshe_workflow/reg.py | nanshe_workflow/reg.py | from builtins import range as irange
import numpy
import scipy.ndimage
import dask
import dask.array
def fourier_shift_wrap(array, shift):
result = numpy.empty_like(array)
for i in irange(len(array)):
result[i] = scipy.ndimage.fourier_shift(array[i], shift[0][i])
return result
def find_best_ma... | apache-2.0 | Python | |
7ee30ea1606122e97119ca7190f080c2ed105f6a | fix support title handling + better find budget items for bad takanas | omerbartal/open-budget-data,OpenBudget/open-budget-data,omerbartal/open-budget-data,OpenBudget/open-budget-data | processors/fix_support_budget_titles.py | processors/fix_support_budget_titles.py | import json
import logging
if __name__ == "__main__":
input = sys.argv[1]
output = sys.argv[2]
processor = fix_changeline_budget_titles().process(input,output,[])
class fix_support_budget_titles(object):
def process(self,inputs,output):
out = []
budgets = {}
budgets2 = {}
... | import json
import logging
if __name__ == "__main__":
input = sys.argv[1]
output = sys.argv[2]
processor = fix_changeline_budget_titles().process(input,output,[])
class fix_support_budget_titles(object):
def process(self,inputs,output):
out = []
budgets = {}
supports_jsons,... | mit | Python |
28d0f14a172821657ec7f17cfaf0ffb95f5ff8f8 | Make sure the right python path is used for plugins. | kamitchell/py2app,kamitchell/py2app,kamitchell/py2app,kamitchell/py2app | py2app/bundletemplate/plist_template.py | py2app/bundletemplate/plist_template.py | import sys
import py2app
__all__ = ['infoPlistDict']
def infoPlistDict(CFBundleExecutable, plist={}):
CFBundleExecutable = unicode(CFBundleExecutable)
NSPrincipalClass = u''.join(CFBundleExecutable.split())
version = sys.version[:3]
pdict = dict(
CFBundleDevelopmentRegion=u'English',
CF... | import sys
import py2app
__all__ = ['infoPlistDict']
def infoPlistDict(CFBundleExecutable, plist={}):
CFBundleExecutable = unicode(CFBundleExecutable)
NSPrincipalClass = u''.join(CFBundleExecutable.split())
version = sys.version[:3]
pdict = dict(
CFBundleDevelopmentRegion=u'English',
CF... | mit | Python |
3adfc96892b0f45a5d95164f81cea75d02b2df0d | add missing dependency | csulmone/skia,csulmone/skia,csulmone/skia,csulmone/skia | gyp/SimpleCocoaApp.gyp | gyp/SimpleCocoaApp.gyp | {
'targets': [
{
'target_name': 'SimpleCocoaApp',
'type': 'executable',
'mac_bundle' : 1,
'include_dirs' : [
'../experimental/SimpleCocoaApp/',
],
'sources': [
'../src/views/mac/SkEventNotifier.h',
'../src/views/mac/SkEventNotifier.mm',
'../src/v... | {
'targets': [
{
'target_name': 'SimpleCocoaApp',
'type': 'executable',
'mac_bundle' : 1,
'include_dirs' : [
'../experimental/SimpleCocoaApp/',
],
'sources': [
'../src/views/mac/SkEventNotifier.h',
'../src/views/mac/SkEventNotifier.mm',
'../src/v... | bsd-3-clause | Python |
50647e0c5033fb397d0acd5440427c6002bab510 | implement merging by process | morgenst/PyAnalysisTools,morgenst/PyAnalysisTools,morgenst/PyAnalysisTools | PyAnalysisTools/ROOTUtils/ObjectHandle.py | PyAnalysisTools/ROOTUtils/ObjectHandle.py | __author__ = 'marcusmorgenstern'
__mail__ = 'marcus.matthias.morgenstern@cern.ch'
# helper methods to deal with objects
def get_objects_from_canvas(canvas):
# todo: add logger warning for empty canvas
obj = [canvas.GetPrimitive(key.GetName()) for key in canvas.GetListOfPrimitives()]
return obj
def get... | __author__ = 'marcusmorgenstern'
__mail__ = 'marcus.matthias.morgenstern@cern.ch'
# helper methods to deal with objects
def get_objects_from_canvas(canvas):
# todo: add logger warning for empty canvas
obj = [canvas.GetPrimitive(key.GetName()) for key in canvas.GetListOfPrimitives()]
return obj
def get... | mit | Python |
a032f92300802db664bdc7c21d6d300b72dab3a2 | change so that it works with split base/root url | Ogaday/sapi-python-client,Ogaday/sapi-python-client | tests/test_base.py | tests/test_base.py | import unittest
import os
from requests import HTTPError
from kbcstorage.base import Endpoint
class TestEndpoint(unittest.TestCase):
"""
Test Endpoint functionality.
"""
def setUp(self):
self.root = os.getenv('KBC_TEST_API_URL')
self.token = 'some-token'
def test_get(self):
... | import unittest
from requests import HTTPError
from kbcstorage.base import Endpoint
class TestEndpoint(unittest.TestCase):
"""
Test Endpoint functionality.
"""
def setUp(self):
self.root = 'https://httpbin.org'
self.token = ''
def test_get(self):
"""
Simple get w... | mit | Python |
5ba72c9877d2f6e8400fae81bd88254d5b1db657 | bump version | sanoma/dynamic-rest,AltSchool/dynamic-rest,sanoma/dynamic-rest,AltSchool/dynamic-rest | dynamic_rest/__init__.py | dynamic_rest/__init__.py | __version__ = "1.3.3"
| __version__ = "1.3.2"
| mit | Python |
688783ec544616d177540ae024b90e3c18d32680 | disable heartbeat | hiidef/hiispider,hiidef/hiispider | hiispider/amqp/amqp.py | hiispider/amqp/amqp.py | import specs
from twisted.internet.protocol import ClientCreator
from twisted.internet import reactor
from txamqp.client import TwistedDelegate
from txamqp.protocol import AMQClient
import txamqp.spec
import sys
def createClient(amqp_host, amqp_vhost, amqp_port=5672):
amqp_spec = txamqp.spec.loadString(specs.v0_8... | import specs
from twisted.internet.protocol import ClientCreator
from twisted.internet import reactor
from txamqp.client import TwistedDelegate
from txamqp.protocol import AMQClient
import txamqp.spec
import sys
def createClient(amqp_host, amqp_vhost, amqp_port=5672):
amqp_spec = txamqp.spec.loadString(specs.v0_8... | mit | Python |
45c4c1f627f224f36c24acebbec43a17a5c59fcb | Print out file being processed, need to do to other modules, add -v flag | jreese/nib | nib/plugins/lesscss.py | nib/plugins/lesscss.py | from __future__ import absolute_import, division, print_function, unicode_literals
from os import path
import sh
from nib import Processor, resource
@resource('.less')
class LessCSSProcessor(Processor):
def resource(self, resource):
filepath = path.join(self.options['resource_path'],
... | from __future__ import absolute_import, division, print_function, unicode_literals
from os import path
import sh
from nib import Processor, resource
@resource('.less')
class LessCSSProcessor(Processor):
def resource(self, resource):
filepath = path.join(self.options['resource_path'],
... | mit | Python |
cd79906dbdb9758acdacdf6a251b21a54634ce29 | Update version for v0.10.dev | einvalentin/elasticutils,einvalentin/elasticutils,einvalentin/elasticutils,mozilla/elasticutils,mozilla/elasticutils,mozilla/elasticutils | elasticutils/_version.py | elasticutils/_version.py | # follow pep-386
# Examples:
# * 0.3 - released version
# * 0.3a1 - alpha version
# * 0.3.dev - version in development
__version__ = '0.10.dev'
__releasedate__ = ''
| # follow pep-386
# Examples:
# * 0.3 - released version
# * 0.3a1 - alpha version
# * 0.3.dev - version in development
__version__ = '0.9'
__releasedate__ = '20140403'
| bsd-3-clause | Python |
ec9258dcf3a2ca648c87c595752ea57eb9f9b943 | insert doSth() at current position | kamilsmuga/nodejs-autocomplete-sublime,kamilsmuga/nodejs-autocomplete-sublime | nodejs_autocomplete.py | nodejs_autocomplete.py | import sublime
import sublime_plugin
class NodejsAutocompleteCommand(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
view_sel = view.sel()
if not view_sel:
return
pos = view_sel[0].begin()
self.view.insert(edit, pos, ".doSth()")
| import sublime
import sublime_plugin
class NodejsAutocompleteCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.insert(edit, 0, "Hello, World!")
| mit | Python |
d28134b62ee4fdfb7676a65de54bc0e422c439e9 | add link | rboman/progs,rboman/progs,rboman/progs,rboman/progs,rboman/progs,rboman/progs,rboman/progs,rboman/progs,rboman/progs,rboman/progs | sandbox/webapi/githubapi_listproject.py | sandbox/webapi/githubapi_listproject.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# see https://developer.github.com/v3/repos/#list-repositories-for-the-authenticated-user
import json
import requests
token =''
# get all the public projects of github.com
#url = 'https://api.github.com/users/rboman/repos'
url = 'https://api.github.com/orgs/ulgltas/rep... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import json
import requests
token =''
# get all the public projects of github.com
#url = 'https://api.github.com/users/rboman/repos'
url = 'https://api.github.com/orgs/ulgltas/repos'
#url = 'https://api.github.com/orgs/math0471/repos'
r = requests.get(url)
#r = request... | apache-2.0 | Python |
d886a8c50f3cd7cb961ae114fa82322f25303481 | Change how backfill_meta_created works | lalinsky/acoustid-server,lalinsky/acoustid-server,lalinsky/acoustid-server,lalinsky/acoustid-server | acoustid/scripts/backfill_meta_created.py | acoustid/scripts/backfill_meta_created.py | #!/usr/bin/env python
# Copyright (C) 2019 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import logging
logger = logging.getLogger(__name__)
def run_backfill_meta_created(script, opts, args):
if script.config.cluster.role != 'master':
logger.info('Not running bac... | #!/usr/bin/env python
# Copyright (C) 2019 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import logging
logger = logging.getLogger(__name__)
def run_backfill_meta_created(script, opts, args):
if script.config.cluster.role != 'master':
logger.info('Not running bac... | mit | Python |
41ad2bebb3827c1772eddfaa7cf4dc23495f68f2 | document the three abstract methods | pradyunsg/zazo,pradyunsg/zazo | src/zazo/abc.py | src/zazo/abc.py | """
"""
from __future__ import absolute_import
import abc
from six import add_metaclass
if False:
from packaging.requirements import Requirement # NOQA
from packaging.version import Version # NOQA
from typing import List # NOQA
@add_metaclass(abc.ABCMeta)
class Candidate(object):
@abc.abstractm... | """
"""
from __future__ import absolute_import
import abc
from six import add_metaclass
if False:
from packaging.requirements import Requirement # NOQA
from packaging.version import Version # NOQA
from typing import List # NOQA
@add_metaclass(abc.ABCMeta)
class Candidate(object):
@abc.abstractm... | mit | Python |
71b511f97a6efa70c00c6dfa827f73f2c0d6b8c7 | update moment2 plot | mdavidsaver/jmbgsddb,mdavidsaver/jmbgsddb,frib-high-level-controls/FLAME,frib-high-level-controls/FLAME,frib-high-level-controls/FLAME,frib-high-level-controls/FLAME,frib-high-level-controls/FLAME,mdavidsaver/jmbgsddb,frib-high-level-controls/FLAME,mdavidsaver/jmbgsddb | tools/h5plotsim.py | tools/h5plotsim.py | #!/usr/bin/env python
"""Plot simulation results
"""
from __future__ import print_function
import sys
from matplotlib.pylab import *
from h5py import File
fname, _junk, gname = sys.argv[1].partition(':')
data = File(fname)
grp = data[gname or '/']
simtype = grp.attrs['sim_type']
print('sim_type', simtype)
def... | #!/usr/bin/env python
"""Plot simulation results
"""
from __future__ import print_function
import sys
from matplotlib.pylab import *
from h5py import File
fname, _junk, gname = sys.argv[1].partition(':')
data = File(fname)
grp = data[gname or '/']
simtype = grp.attrs['sim_type']
print('sim_type', simtype)
def... | mit | Python |
f547d131a3ad8d9c452a4583c080ac9d29b53709 | bump version | vmalloc/noselog | noselog/__version__.py | noselog/__version__.py | __version__ = "0.0.2"
| __version__ = "0.0.1"
| bsd-3-clause | Python |
c94671faaa2580d05494d770cca5183cde29e55e | bump version | crateio/carrier | conveyor/__init__.py | conveyor/__init__.py | __version__ = "0.1.dev23"
| __version__ = "0.1.dev22"
| bsd-2-clause | Python |
aaf6b2fefec03ec0896662605c3208d26aaab0dd | change i18n | Hybrid-Cloud/conveyor,Hybrid-Cloud/conveyor | conveyor/cmd/plan.py | conveyor/cmd/plan.py | #!/usr/bin/python
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | #!/usr/bin/python
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 | Python |
08f40c4e0c9dca21f6f7ff108868970b43725716 | change mimetype of get-video by ID endpoint as well | techytux/oertube,techytux/oertube,techytux/oertube | oertube/controllers.py | oertube/controllers.py | import os
from flask import Flask, request, Response
from flask import render_template, url_for, redirect, send_from_directory, jsonify
from flask import send_file, make_response, abort
from oertube import app
from bson import json_util
# routing for API endpoints, generated from the models designated as API_MODELS... | import os
from flask import Flask, request, Response
from flask import render_template, url_for, redirect, send_from_directory, jsonify
from flask import send_file, make_response, abort
from oertube import app
from bson import json_util
# routing for API endpoints, generated from the models designated as API_MODELS... | mit | Python |
3266ecee8f9a6601d8678a91e8923c6d7137adb3 | Make ilock lock name user specific | OGGM/oggm,OGGM/oggm,bearecinos/oggm,bearecinos/oggm,juliaeis/oggm,TimoRoth/oggm,anoukvlug/oggm,TimoRoth/oggm,juliaeis/oggm,anoukvlug/oggm | oggm/tests/conftest.py | oggm/tests/conftest.py | import pytest
import logging
import getpass
from oggm import cfg, utils
logger = logging.getLogger(__name__)
def pytest_configure(config):
if config.pluginmanager.hasplugin('xdist'):
try:
from ilock import ILock
utils.lock = ILock("oggm_xdist_download_lock_" + getpass.getuser())
... | import pytest
import logging
import multiprocessing as mp
from oggm import cfg, utils
import pickle
logger = logging.getLogger(__name__)
def pytest_configure(config):
if config.pluginmanager.hasplugin('xdist'):
try:
from ilock import ILock
utils.lock = ILock("oggm_xdist_download_lo... | bsd-3-clause | Python |
05f0d841bf1bd6b440d21f66df4bd18cb797ec24 | increment version | mikedh/trimesh,mikedh/trimesh,mikedh/trimesh,mikedh/trimesh | trimesh/version.py | trimesh/version.py | __version__ = '3.10.3'
| __version__ = '3.10.2'
| mit | Python |
cc298348cceece3b5ff64bdfb030d3885cc2e53f | fix filter | znick/anytask,znick/anytask,znick/anytask,znick/anytask | anytask/courses/templatetags/form_func.py | anytask/courses/templatetags/form_func.py | from BeautifulSoup import BeautifulSoup, Comment
from django import template
from django.http import QueryDict
register = template.Library()
@register.filter(name='field_in_data')
def form_selected_value(data, field):
if isinstance(data, QueryDict):
return data.getlist(field.name)
return []
@regis... | from BeautifulSoup import BeautifulSoup, Comment
from django import template
from django.utils.translation import ugettext as _
from issues.models import Issue
from issues.model_issue_field import IssueStatusField
register = template.Library()
@register.filter(name='field_in_data')
def form_selected_value(data, fie... | mit | Python |
6ed303ae43b2313f6425d34f08697121a4f7b0cd | remove unused var accidents_file | hasadna/anyway,hasadna/anyway,hasadna/anyway,hasadna/anyway | anyway/parsers/preprocessing_cbs_files.py | anyway/parsers/preprocessing_cbs_files.py | from six import iteritems
import os
CBS_FILES_HEBREW = {'sadot': 'Fields',
'zmatim_ironiim': 'IntersectUrban',
'zmatim_lo_ironiim': 'IntersectNonUrban',
'rehev': 'VehData',
'milon':'Dictionary',
'meoravim': 'InvData',
... | from six import iteritems
import os
CBS_FILES_HEBREW = {'sadot': 'Fields',
'zmatim_ironiim': 'IntersectUrban',
'zmatim_lo_ironiim': 'IntersectNonUrban',
'rehev': 'VehData',
'milon':'Dictionary',
'meoravim': 'InvData',
... | mit | Python |
c6095cd72e5a0c60a837214e5408feb42baf939d | Update config.py | kaiyou/freeposte.io,kaiyou/freeposte.io,kaiyou/freeposte.io,kaiyou/freeposte.io | core/nginx/config.py | core/nginx/config.py | #!/usr/bin/python
import jinja2
import os
convert = lambda src, dst, args: open(dst, "w").write(jinja2.Template(open(src).read()).render(**args))
args = os.environ.copy()
# Get the first DNS server
with open("/etc/resolv.conf") as handle:
content = handle.read().split()
args["RESOLVER"] = content[content.in... | #!/usr/bin/python
import jinja2
import os
convert = lambda src, dst, args: open(dst, "w").write(jinja2.Template(open(src).read()).render(**args))
args = os.environ.copy()
# Get the first DNS server
with open("/etc/resolv.conf") as handle:
content = handle.read().split()
args["RESOLVER"] = content[content.in... | mit | Python |
1ed08e4bd93c713d8a31a387265057f1d4d7ae8f | Increment the version | DesertBus/txircd,Heufneutje/txircd,ElementalAlchemist/txircd | txircd/__init__.py | txircd/__init__.py | __version__ = '0.2.5' | __version__ = '0.2.4' | bsd-3-clause | Python |
712ea23eec78df7650e0af47e3361313aa4c3901 | clean set context data, articles utils | williamroot/opps,williamroot/opps,jeanmask/opps,opps/opps,jeanmask/opps,YACOWS/opps,opps/opps,jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,YACOWS/opps,opps/opps | opps/articles/utils.py | opps/articles/utils.py | # -*- coding: utf-8 -*-
from django.conf import settings
from opps.articles.models import ArticleBox
def set_context_data(self, SUPER, **kwargs):
context = super(SUPER, self).get_context_data(**kwargs)
if len(self.article) >= 1:
article = self.article[0]
context['articleboxes'] = ArticleBox.... | # -*- coding: utf-8 -*-
from django.conf import settings
from opps.articles.models import ArticleBox
def set_context_data(self, SUPER, **kwargs):
context = super(SUPER, self).get_context_data(**kwargs)
if len(self.article) >= 1:
article = self.article[0]
context['articleboxes'] = ArticleBox.o... | mit | Python |
06fb3fa4b4850dced647eaaf699e05f006a31817 | Change rating strings | DLance96/nativx-survey,DLance96/nativx-survey,DLance96/nativx-survey | survey/forms.py | survey/forms.py | from django import forms
class ActivityRatingForm(forms.Form):
RATING_CHOICES = (
('0', 'No shot'),
('1', 'Probably would not go'),
('2', 'Probably would go'),
('3', 'Heck yea!')
)
rating = forms.ChoiceField(choices=RATING_CHOICES, required=False, label="", label_suffix=''... | from django import forms
class ActivityRatingForm(forms.Form):
RATING_CHOICES = (
('0', 'Would not go'),
('1', 'Probably would not go'),
('2', 'Probably would go'),
('3', 'Would go')
)
rating = forms.ChoiceField(choices=RATING_CHOICES, required=False, label="", label_suffi... | mit | Python |
6135699ccf19d8c5f801b1a73794f2414f7200d7 | test to check recording a survey actually records something | mysociety/manchester-survey,mysociety/manchester-survey,mysociety/manchester-survey,mysociety/manchester-survey,mysociety/manchester-survey | survey/tests.py | survey/tests.py | from django.core.urlresolvers import reverse
from django.test import TestCase
from survey.models import User, Item
class StartPageTest(TestCase):
def test_front_page_displays(self):
response = self.client.get(reverse('survey:survey'))
self.assertEqual(response.status_code, 200)
self.assert... | from django.core.urlresolvers import reverse
from django.test import TestCase
from survey.models import User
class StartPageTest(TestCase):
def test_front_page_displays(self):
response = self.client.get(reverse('survey:survey'))
self.assertEqual(response.status_code, 200)
self.assertContai... | agpl-3.0 | Python |
c73f1674dd57217569009716260af3d13a787052 | Bump version to 0.1.11 | botify-labs/python-simple-workflow,botify-labs/python-simple-workflow | swf/__init__.py | swf/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
version = (0, 1, 11)
__title__ = "python-simple-workflow"
__author__ = "Oleiade"
__license__ = "MIT"
__version__ = '.'.join(map(str, version))
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
version = (0, 1, 10)
__title__ = "python-simple-workflow"
__author__ = "Oleiade"
__license__ = "MIT"
__version__ = '.'.join(map(str, version))
| mit | Python |
a79f422991532cf559d394b608237953aa376bf6 | add admin for project | praekelt/mc2,praekelt/mc2,praekelt/mc2,universalcore/unicore-mc,universalcore/unicore-mc,praekelt/mc2,universalcore/unicore-mc,universalcore/unicore-mc,praekelt/mc2 | unicoremc/admin.py | unicoremc/admin.py | # ensure celery autodiscovery runs
from djcelery import admin as celery_admin
from djcelery.models import (
TaskState, WorkerState, PeriodicTask, IntervalSchedule, CrontabSchedule)
from django.contrib import admin
from django.contrib.sites.models import Site
from unicoremc.models import Project, Localisation
c... | # ensure celery autodiscovery runs
from djcelery import admin as celery_admin
from djcelery.models import (
TaskState, WorkerState, PeriodicTask, IntervalSchedule, CrontabSchedule)
from django.contrib import admin
from django.contrib.sites.models import Site
# remove celery from admin
admin.site.unregister(Site)... | bsd-2-clause | Python |
fd50ec469eebafe28938a5d9484a760f67ed154d | set version to 1.6dev | Chris7/cutadapt,marcelm/cutadapt | cutadapt/__init__.py | cutadapt/__init__.py | from __future__ import print_function
import sys
__version__ = '1.6dev'
def check_importability():
try:
import cutadapt._align
except ImportError as e:
if 'undefined symbol' in str(e):
print("""
ERROR: A required extension module could not be imported because it is
incompatible with your system. A quick fix ... | from __future__ import print_function
import sys
__version__ = '1.5'
def check_importability():
try:
import cutadapt._align
except ImportError as e:
if 'undefined symbol' in str(e):
print("""
ERROR: A required extension module could not be imported because it is
incompatible with your system. A quick fix is ... | mit | Python |
102f7979338b948744b6af06689f928deb72f27c | Fix lemma ordering in test | spacy-io/spaCy,recognai/spaCy,aikramer2/spaCy,spacy-io/spaCy,aikramer2/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,honnibal/spaCy,honnibal/spaCy,spacy-io/spaCy,recognai/spaCy,aikramer2/spaCy,recognai/spaCy,explosion/spaCy,aikramer2/spaCy,aikramer2/spaCy,explosion/spaCy,explosion/spaCy,recognai/spaCy,explosion/sp... | spacy/tests/regression/test_issue781.py | spacy/tests/regression/test_issue781.py | # coding: utf-8
from __future__ import unicode_literals
import pytest
# Note: "chromosomes" worked previous the bug fix
@pytest.mark.models('en')
@pytest.mark.parametrize('word,lemmas', [("chromosomes", ["chromosome"]), ("endosomes", ["endosome"]), ("colocalizes", ["colocaliz", "colocalize"])])
def test_issue781(EN,... | # coding: utf-8
from __future__ import unicode_literals
import pytest
# Note: "chromosomes" worked previous the bug fix
@pytest.mark.models('en')
@pytest.mark.parametrize('word,lemmas', [("chromosomes", ["chromosome"]), ("endosomes", ["endosome"]), ("colocalizes", ["colocalize", "colocaliz"])])
def test_issue781(EN,... | mit | Python |
c74251b3dc92e4188c8a27e5ca4bb13fe7c80df2 | add annotator urls | DeepController/tellina,DeepController/tellina,DeepController/tellina | tellina/urls.py | tellina/urls.py | """django_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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')
C... | """django_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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')
C... | mit | Python |
3d836dded0f21afb2d81c0a448149f73f4217fb3 | Bump to rc2. | gregoiresage/pebble-tool,gregoiresage/pebble-tool,pebble/pebble-tool,gregoiresage/pebble-tool,pebble/pebble-tool,pebble/pebble-tool,gregoiresage/pebble-tool,pebble/pebble-tool | pebble_tool/version.py | pebble_tool/version.py | version_base = (4, 0, 1)
version_suffix = 'rc2'
if version_suffix is None:
__version_info__ = version_base
else:
__version_info__ = version_base + (version_suffix,)
__version__ = '{}.{}'.format(*version_base)
if version_base[2] != 0:
__version__ += '.{}'.format(version_base[2])
if version_suffix is not N... | version_base = (4, 0, 1)
version_suffix = 'rc1'
if version_suffix is None:
__version_info__ = version_base
else:
__version_info__ = version_base + (version_suffix,)
__version__ = '{}.{}'.format(*version_base)
if version_base[2] != 0:
__version__ += '.{}'.format(version_base[2])
if version_suffix is not N... | mit | Python |
a2b3d233acb432142e0683217d46d5281649a696 | Update __version__.py | cvium/irc_bot | irc_bot/__version__.py | irc_bot/__version__.py | __version__ = '1.0.36'
| __version__ = '1.0.35'
| mit | Python |
b97a9290dfddd6777187f4acb6c3222b1e346fd8 | Fix defect in argument parser invokation | JIC-CSB/jicirodsmanager,JIC-CSB/jicirodsmanager | jicirodsmanager/cli.py | jicirodsmanager/cli.py | """Manger iRODS storage."""
import argparse
import logging
from jicirodsmanager.irods import IrodsStorageManager
root = logging.getLogger()
root.setLevel(logging.DEBUG)
formatter = logging.Formatter(
'%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
handler = logging.StreamHandler()
handler.setFormatter... | """Manger iRODS storage."""
import argparse
import logging
from jicirodsmanager.irods import IrodsStorageManager
root = logging.getLogger()
root.setLevel(logging.DEBUG)
formatter = logging.Formatter(
'%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
handler = logging.StreamHandler()
handler.setFormatter... | mit | Python |
df78c3093e377a6f4f9e7a92653d2273bd8a356d | Add to test per tutorial | jonathanstallings/learning-journal,jonathanstallings/learning-journal | test_journal.py | test_journal.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import pytest
from sqlalchemy import create_engine
from sqlalchemy.exc import IntegrityError
TEST_DATABASE_URL = os.environ.get(
'DATABASE_URL',
'postgresql://jonathan:@localhost:5432/test-learning-journal'
)
os.environ['DATABASE_URL'] =... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import pytest
from sqlalchemy import create_engine
from sqlalchemy.exc import IntegrityError
TEST_DATABASE_URL = os.environ.get(
'DATABASE_URL',
'postgresql://jonathan:@localhost:5432/test-learning-journal'
)
os.environ['DATABASE_URL'] =... | mit | Python |
52d4b82a2dff35b22cea389274aaf3731570fe80 | add numpy import | AustereCuriosity/astropy,saimn/astropy,funbaker/astropy,pllim/astropy,pllim/astropy,aleksandr-bakanov/astropy,AustereCuriosity/astropy,pllim/astropy,kelle/astropy,dhomeier/astropy,lpsinger/astropy,astropy/astropy,larrybradley/astropy,mhvk/astropy,DougBurke/astropy,AustereCuriosity/astropy,stargaser/astropy,tbabej/astro... | astropy/cosmology/tests/test_cosmology.py | astropy/cosmology/tests/test_cosmology.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .. import cosmology
import numpy as np
def test_cosmology():
cosmo = cosmology.Cosmology(H0=70, Om=0.27 ,Ol=0.73)
z = 1
# Test values were taken from the following web cosmology
# calculators on 27th Feb 2012:
# Wright: http://w... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .. import cosmology
def test_cosmology():
cosmo = cosmology.Cosmology(H0=70, Om=0.27 ,Ol=0.73)
z = 1
# Test values were taken from the following web cosmology
# calculators on 27th Feb 2012:
# Wright: http://www.astro.ucla.edu/~... | bsd-3-clause | Python |
182fa87ebb013c71744566bc0fe693ccef8df251 | add unit test suite | ContinuumIO/pycosat,ContinuumIO/pycosat,sandervandorsten/pycosat,sandervandorsten/pycosat | test_pycosat.py | test_pycosat.py | import unittest
import pycosat
tests = []
class TestSolver(unittest.TestCase):
def test_sat_1(self):
res = pycosat.solve(5, [[1, -5, 4],
[-1, 5, 3, 4],
[-3, -4]])
self.assertEqual(res, [True, False, False, False, True])
def te... | import pycosat
print pycosat.solve(
5, [
[1, -5, 4],
[-1, 5, 3, 4],
[-3, -4],
],
# True
)
print pycosat.solve(
2, [
[-1],
[1],
],
# True
)
| mit | Python |
68989a94b738a9e5ab7aed000523950da99029ec | update cloto db | Fiware/cloud.Facts,Fiware/cloud.Facts,telefonicaid/fiware-facts,telefonicaid/fiware-facts,Fiware/cloud.Facts,telefonicaid/fiware-facts | facts/cloto_db_client.py | facts/cloto_db_client.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright 2014 Telefónica Investigación y Desarrollo, S.A.U
#
# This file is part of FI-WARE project.
#
# 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 th... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright 2014 Telefónica Investigación y Desarrollo, S.A.U
#
# This file is part of FI-WARE project.
#
# 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 th... | apache-2.0 | Python |
0ae9b232b82285f2fa275b8ffa5dced6b9377b0e | Add equality operator to EnvironCredential | jaraco/keyring | keyring/credentials.py | keyring/credentials.py | import os
import abc
class Credential(metaclass=abc.ABCMeta):
"""Abstract class to manage credentials"""
@abc.abstractproperty
def username(self):
return None
@abc.abstractproperty
def password(self):
return None
class SimpleCredential(Credential):
"""Simple credentials imp... | import os
import abc
class Credential(metaclass=abc.ABCMeta):
"""Abstract class to manage credentials"""
@abc.abstractproperty
def username(self):
return None
@abc.abstractproperty
def password(self):
return None
class SimpleCredential(Credential):
"""Simple credentials imp... | mit | Python |
af572475c4ce2a2d5eafbf95dcbeff5759401cb3 | Fix typo in docstring | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/services/authentication/service.py | byceps/services/authentication/service.py | """
byceps.services.authentication.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import Optional
from ..user import service as user_service
from ..user.transfer.models import User
from .exceptions import Aut... | """
byceps.services.authentication.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import Optional
from ..user import service as user_service
from ..user.transfer.models import User
from .exceptions import Aut... | bsd-3-clause | Python |
b1de92ea458c5207620b999454ebb0e42716b629 | print eta only when fps > 0 | chainer/chainercv,pfnet/chainercv,yuyu2172/chainercv,yuyu2172/chainercv,chainer/chainercv | chainercv/utils/iterator/progress_hook.py | chainercv/utils/iterator/progress_hook.py | from __future__ import division
import sys
import time
class ProgressHook(object):
"""A hook class reporting the progress of iteration.
This is a hook class designed for
:func:`~chainercv.utils.apply_prediction_to_iterator`.
Args:
n_total (int): The number of images. This argument is option... | from __future__ import division
import sys
import time
class ProgressHook(object):
"""A hook class reporting the progress of iteration.
This is a hook class designed for
:func:`~chainercv.utils.apply_prediction_to_iterator`.
Args:
n_total (int): The number of images. This argument is option... | mit | Python |
9f76d65e4f372faa0f96d873d3ef07ca027038b9 | Use openssl pkey to convert EC key into printable form before comparing, because different openssl versions use different privkey formats | vbwagner/ctypescrypto | tests/testec.py | tests/testec.py | from ctypescrypto.oid import Oid
from ctypescrypto.ec import create
from base64 import b16decode
from subprocess import Popen, PIPE
import unittest
def dump_key(key):
""" Convert key into printable form using openssl utility
Used to compare keys which can be stored in different
format by different Op... | from ctypescrypto.oid import Oid
from ctypescrypto.ec import create
from base64 import b16decode
import unittest
class TestEcCreation(unittest.TestCase):
ec1priv="""-----BEGIN PRIVATE KEY-----
MIGEAgEAMBAGByqGSM49AgEGBSuBBAAKBG0wawIBAQQgKnG6neqZvB98EEuuxnHs
fv+L/5abuNNG20wzUqRpncOhRANCAARWKXWeUZ6WiCKZ2kHx87jmJyx... | mit | Python |
97312b55525f81ecba3c0df1d6c2e55fa217ce83 | Make tests run on sqlite by default | dabapps/django-db-queue | testsettings.py | testsettings.py | import os
import dj_database_url
DATABASE_URL = os.environ.get("DATABASE_URL", "sqlite:///:memory:")
DATABASES = {
"default": dj_database_url.parse(DATABASE_URL),
}
INSTALLED_APPS = ("django_dbq",)
MIDDLEWARE_CLASSES = (
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.... | import os
import dj_database_url
DATABASES = {
"default": dj_database_url.parse(os.environ["DATABASE_URL"]),
}
INSTALLED_APPS = ("django_dbq",)
MIDDLEWARE_CLASSES = (
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewM... | bsd-2-clause | Python |
3a3dd951bc4b3fe4c54cbc542cb63f84d5b0fdcc | Bump version number to 2.2alpha for continued development. | mkuiack/tkp,transientskp/tkp,bartscheers/tkp,bartscheers/tkp,mkuiack/tkp,transientskp/tkp | tkp/__init__.py | tkp/__init__.py | """
This package contains the Python modules used by the LOFAR Transients Pipeline
(TraP). This includes:
- Pipeline configuration management;
- Task distribution;
- Image loading and quality control;
- Source detection and measurement;
- Storing and associating sources in the database.
For details, see http://docs.t... | """
This package contains the Python modules used by the LOFAR Transients Pipeline
(TraP). This includes:
- Pipeline configuration management;
- Task distribution;
- Image loading and quality control;
- Source detection and measurement;
- Storing and associating sources in the database.
For details, see http://docs.t... | bsd-2-clause | Python |
328d40f8f166f6744db94332d5620500cac73f02 | fix bug, required not allowed for positionals | ixdy/kubernetes-release,ixdy/kubernetes-release,kubernetes/release,kubernetes/release | defs/gcs_uploader.py | defs/gcs_uploader.py | #!/usr/bin/env python
# Copyright 2016 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | #!/usr/bin/env python
# Copyright 2016 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 | Python |
a8246967f239938251d754bd934823f56f3d4df1 | update try_lightGBM.py | hanhanwu/Hanhan_Data_Science_Practice,hanhanwu/Hanhan_Data_Science_Practice,hanhanwu/Hanhan_Data_Science_Practice,hanhanwu/Hanhan_Data_Science_Practice | try_lightGBM.py | try_lightGBM.py | import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import lightgbm as lgb
import xgboost as xgb
from sklearn.preprocessing import LabelEncoder,OneHotEncoder
from sklearn.model_selection import train_test_split
data=pd.read_csv('adult.csv',header=None)
# assign column names to the data
... | import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import lightgbm as lgb
import xgboost as xgb
from sklearn.preprocessing import LabelEncoder,OneHotEncoder
from sklearn.model_selection import train_test_split
data=pd.read_csv('adult.csv',header=None)
# assign column names to the data
... | mit | Python |
ef638d679a87cb33975fb29fea652cc84aa71663 | Rename /atom.xml to /feed.atom | jarus/flask-rst | flaskrst/modules/atom.py | flaskrst/modules/atom.py | # -*- coding: utf-8 -*-
"""
flask-rst.modules.atom
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2011 by Christoph Heer.
:license: BSD, see LICENSE for more details.
"""
from flask import Blueprint, request, current_app, url_for
from werkzeug.contrib.atom import AtomFeed, FeedEntry
from flaskrst.modules.blo... | # -*- coding: utf-8 -*-
"""
flask-rst.modules.atom
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2011 by Christoph Heer.
:license: BSD, see LICENSE for more details.
"""
from flask import Blueprint, request, current_app, url_for
from werkzeug.contrib.atom import AtomFeed, FeedEntry
from flaskrst.modules.blo... | bsd-3-clause | Python |
6350c312891b91aea16eebc8a9cb1502d1a058a4 | Bump version to 1.1.3 | edoburu/django-fluent-utils | fluent_utils/__init__.py | fluent_utils/__init__.py | # following PEP 386
__version__ = "1.1.3"
| # following PEP 386
__version__ = "1.1.2"
| apache-2.0 | Python |
1b05421a58b8b6d62d62bfd7323e91df2fbc496d | patch auth.User to have utility methods | gizmag/django-generic-follow,pombredanne/django-generic-follow,gizmag/django-generic-follow | generic_follow/models.py | generic_follow/models.py | from django.conf import settings
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from .managers import FollowManager
class Follow(models.Model):
user = models.ForeignKey(getattr(settings, 'AUTH_USER_MODEL', 'auth.User'))
... | from django.conf import settings
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from .managers import FollowManager
class Follow(models.Model):
user = models.ForeignKey(getattr(settings, 'AUTH_USER_MODEL', 'auth.User'))
... | mit | Python |
d88bb6542373f248f6792bd064ad84a17efe9414 | fix teacher and student model | crike/crike,crike/crike,crike/crike,crike/crike | src/crike_django/crike_django/models.py | src/crike_django/crike_django/models.py | #coding:utf-8
from django.db import models
from django.contrib.auth.models import User
from mongoengine import *
# 数据库基本模型分为word、dict、user、course、voice、image、game、video
# 当前目标:实现word、dict、user、course,其余皆往后排
# dict包含多个word,course包含多个word,user包含多个course
class Word(Document):
name = StringField(required=True, max_l... | #coding:utf-8
from django.db import models
from django.contrib.auth.models import User
from mongoengine import *
# 数据库基本模型分为word、dict、user、course、voice、image、game、video
# 当前目标:实现word、dict、user、course,其余皆往后排
# dict包含多个word,course包含多个word,user包含多个course
class Word(Document):
name = StringField(required=True, max_l... | apache-2.0 | Python |
b5a92b53e95bef1858b3dfa1ab6b1828dd085ed4 | disable blue logs | rr-/dotfiles,rr-/dotfiles,rr-/dotfiles | libdotfiles/logging.py | libdotfiles/logging.py | # pylint: disable=unused-import,protected-access,invalid-name
import logging
import os
from logging import (
DEBUG,
ERROR,
INFO,
WARNING,
debug,
error,
getLogger,
info,
warning,
)
import coloredlogs
def _add_custom_level(number, name):
logging.addLevelName(number, name.upper()... | # pylint: disable=unused-import,protected-access,invalid-name
import logging
import os
from logging import (
DEBUG,
ERROR,
INFO,
WARNING,
debug,
error,
getLogger,
info,
warning,
)
import coloredlogs
def _add_custom_level(number, name):
logging.addLevelName(number, name.upper()... | mit | Python |
fed687bb6a5b4685b04b3533920288c8e5ae4faf | Use db.session directly rather than relying on convenience methods | eXcomm/gratipay.com,gratipay/gratipay.com,mccolgst/www.gittip.com,bountysource/www.gittip.com,eXcomm/gratipay.com,bountysource/www.gittip.com,studio666/gratipay.com,gratipay/gratipay.com,eXcomm/gratipay.com,mccolgst/www.gittip.com,mccolgst/www.gittip.com,bountysource/www.gittip.com,MikeFair/www.gittip.com,studio666/gra... | gittip/authentication.py | gittip/authentication.py | """Defines website authentication helpers.
"""
import datetime
import rfc822
import time
import pytz
from aspen import Response
from gittip.orm import db
from gittip.models import User
BEGINNING_OF_EPOCH = rfc822.formatdate(0)
TIMEOUT = 60 * 60 * 24 * 7 # one week
def inbound(request):
"""Authenticate from a coo... | """Defines website authentication helpers.
"""
import datetime
import rfc822
import time
import pytz
from aspen import Response
from gittip.models import User
BEGINNING_OF_EPOCH = rfc822.formatdate(0)
TIMEOUT = 60 * 60 * 24 * 7 # one week
def inbound(request):
"""Authenticate from a cookie.
"""
if 'sessi... | mit | Python |
383a9d6d74c55b8fb037e43c8236d0dc7ff38e07 | add argv argument to the process function (which defaults to sys.argv) | stefanseefeld/synopsis,stefanseefeld/synopsis,stefanseefeld/synopsis,stefanseefeld/synopsis,stefanseefeld/synopsis,stefanseefeld/synopsis | Synopsis/process.py | Synopsis/process.py | # $Id: process.py,v 1.5 2003/12/11 04:38:59 stefan Exp $
#
# Copyright (C) 2003 Stefan Seefeld
# All rights reserved.
# Licensed to the public under the terms of the GNU LGPL (>= 2),
# see the file COPYING for details.
#
from Processor import Processor
import AST
from getoptions import getoptions
import sys
def erro... | # $Id: process.py,v 1.5 2003/12/11 04:38:59 stefan Exp $
#
# Copyright (C) 2003 Stefan Seefeld
# All rights reserved.
# Licensed to the public under the terms of the GNU LGPL (>= 2),
# see the file COPYING for details.
#
from Processor import Processor
import AST
from getoptions import getoptions
import sys
def erro... | lgpl-2.1 | Python |
1de2ebab77eba6bdf35b7db004af42804a3984d1 | Fix admin file widget for cases where no file exists | google-code-export/marinemap,Alwnikrotikz/marinemap,Alwnikrotikz/marinemap,Alwnikrotikz/marinemap,google-code-export/marinemap,google-code-export/marinemap,Alwnikrotikz/marinemap,google-code-export/marinemap | lingcod/array/forms.py | lingcod/array/forms.py | #from django.contrib.admin.widgets import AdminFileWidget
from django.forms import ModelForm
from django.utils.safestring import mark_safe
from django import forms
from lingcod.array.models import MpaArray
from lingcod.rest.forms import UserForm
from os.path import splitext,split
class AdminFileWidget(forms.FileInput)... | #from django.contrib.admin.widgets import AdminFileWidget
from django.forms import ModelForm
from django.utils.safestring import mark_safe
from django import forms
from lingcod.array.models import MpaArray
from lingcod.rest.forms import UserForm
from os.path import splitext,split
class AdminFileWidget(forms.FileInput)... | bsd-3-clause | Python |
074b09f7a0831dd34e00727951fba89bfa559c42 | Update ipc_lista1.2.py | any1m1c/ipc20161 | lista1/ipc_lista1.2.py | lista1/ipc_lista1.2.py | #ipc_lista1.2
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um Programa que peça um número e então mostre a mensagem O número informado foi [número].
number = input("Digite um número: ")
print "O número digitado foi ",number
| #ipc_lista1.2
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um Programa que peça um número e então mostre a mensagem O número informado foi [número].
number = input("Digite um número: ")
print "O número digitado foi ",number
| apache-2.0 | Python |
468c7496109dcd23f02b6407bd10a0d758229c2a | Update ipc_lista1.5.py | any1m1c/ipc20161 | lista1/ipc_lista1.5.py | lista1/ipc_lista1.5.py | #ipc_lista1.5
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que converta metros para centímetros.
metros = input("Digite o valor em metros que deseja converter em centímetros: ")
centimetros = metros * 100
print
| #ipc_lista1.5
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um programa que converta metros para centímetros.
metros = input("Digite o valor em metros que deseja converter em centímetros: ")
centimetros = metros * 100
print
| apache-2.0 | Python |
f2b30562b76ed7ab52a1d52c065dd01de9edaef0 | Update ipc_lista1.7.py | any1m1c/ipc20161 | lista1/ipc_lista1.7.py | lista1/ipc_lista1.7.py | #ipc_lista1.7
#Professor: Jucimar Junior
#Any Mendes Carvalho
#
#
#
#
#Faça um programa que calcule a área de um quadrado, em seguida mostre o dobro desta área para o #usuário.
altura = input("Digite a altura do quadrado em metros: ")
largura = input("Digite a largura do quadrado em metros: ")
| #ipc_lista1.7
#Professor: Jucimar Junior
#Any Mendes Carvalho
#
#
#
#
#Faça um programa que calcule a área de um quadrado, em seguida mostre o dobro desta área para o #usuário.
altura = input("Digite a altura do quadrado em metros: ")
largura = input("Digite a largura do quadrado em metros:
| apache-2.0 | Python |
768c18f1b0bb8a974ffc4323dc302b03c96cbf86 | Bump version | mitsuhiko/logbook | logbook/__version__.py | logbook/__version__.py | __version__ = "1.5.3"
| __version__ = "1.5.2"
| bsd-3-clause | Python |
e8c180e65dda3422ab472a6580183c715ef325c3 | Update error message of UnsupportedOperationException. | KarlGong/easyium-python,KarlGong/easyium | easyium/decorator.py | easyium/decorator.py | __author__ = 'karl.gong'
from .exceptions import UnsupportedOperationException
def SupportedBy(*web_driver_types):
def handle_func(func):
def handle_args(*args, **kwargs):
wd_types = []
for wd_type in web_driver_types:
if isinstance(wd_type, list):
... | __author__ = 'karl.gong'
from .exceptions import UnsupportedOperationException
def SupportedBy(*web_driver_types):
def handle_func(func):
def handle_args(*args, **kwargs):
wd_types = []
for wd_type in web_driver_types:
if isinstance(wd_type, list):
... | apache-2.0 | Python |
3e8b3dc25d82d4d70d5c8068b12bc814723b7b08 | Make the spam stop | gnmerritt/casino,gnmerritt/casino,gnmerritt/casino,gnmerritt/casino | matchmaker/__init__.py | matchmaker/__init__.py | import logging
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
import slacker_log_handler as slh
app = Flask(__name__, static_folder='static')
app.config.from_object('matchmaker.default_settings')
app.config.from_envvar('CASINO_SETTINGS', silent=True)
if not app.debug:
handler = slh.SlackerLog... | import logging
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
import slacker_log_handler as slh
app = Flask(__name__, static_folder='static')
app.config.from_object('matchmaker.default_settings')
app.config.from_envvar('CASINO_SETTINGS', silent=True)
if not app.debug:
handler = slh.SlackerLog... | mit | Python |
b5c2bc906194e9be69d1895b6290bc918e5a040b | Increment version | ines/wasabi | wasabi/about.py | wasabi/about.py | __title__ = "wasabi"
__version__ = "0.5.0"
__summary__ = "A lightweight console printing and formatting toolkit"
__uri__ = "https://ines.io"
__author__ = "Ines Montani"
__email__ = "ines@explosion.ai"
__license__ = "MIT"
| __title__ = "wasabi"
__version__ = "0.4.2"
__summary__ = "A lightweight console printing and formatting toolkit"
__uri__ = "https://ines.io"
__author__ = "Ines Montani"
__email__ = "ines@explosion.ai"
__license__ = "MIT"
| mit | Python |
750dd5437314908985d5241a3b5483037adfd73f | change set comp in case python 2.6 | RiskIQ/pyyamlcfg | yamlcfg/util.py | yamlcfg/util.py | #!/usr/bin/env python
''' yamlcfg.util
Cross module utilities
'''
import os
def normalize(var, type=None, **kwargs):
if var is None:
return None
if type is None:
return var
if type is basestring:
return str(type)
elif type is int:
return int(type)
elif type is hex:
... | #!/usr/bin/env python
''' yamlcfg.util
Cross module utilities
'''
import os
def normalize(var, type=None, **kwargs):
if var is None:
return None
if type is None:
return var
if type is basestring:
return str(type)
elif type is int:
return int(type)
elif type is hex:
... | bsd-2-clause | Python |
07750d05ad92aade63accb2629f21180282c4be0 | Fix location of dashboard and license in setup script | pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus | lib/pegasus/python/pegasus-setup.py | lib/pegasus/python/pegasus-setup.py | """
Installation script for Pegasus Python library
Author: Dan Gunter <dkgunter@lbl.gov>
"""
try:
from setuptools import setup
except:
from distutils.core import setup
import os
VERSION = os.environ.get('PEGASUS_VERSION','trunk')
setup(name = "Pegasus",
version=VERSION,
packages = [
"Pe... | """
Installation script for Pegasus Python library
Author: Dan Gunter <dkgunter@lbl.gov>
"""
try:
from setuptools import setup
except:
from distutils.core import setup
from glob import glob
import os
import sys
VERSION = os.environ.get('PEGASUS_VERSION','trunk')
# Main function
# -------------
setup(name = ... | apache-2.0 | Python |
b70d06ac546b0c9736818600f52a3341f1e5fffc | Fix import | wjimenez5271/coastguard | coastguard/config.py | coastguard/config.py | import ConfigParser
from lib.hostfilter import HostFilter
import os
def load_config(configfile):
"""
Load config from ini formatted text file
:param configfile: str. path to file
:return: dict. configuration attributes
"""
parser = ConfigParser.SafeConfigParser()
parser.read(configfile)
... | import ConfigParser
from lib.HostFilter import HostFilter
import os
def load_config(configfile):
"""
Load config from ini formatted text file
:param configfile: str. path to file
:return: dict. configuration attributes
"""
parser = ConfigParser.SafeConfigParser()
parser.read(configfile)
... | apache-2.0 | Python |
67ad00b96be8cbaf8cc7a9cb6770fb9e685fe182 | add skeleton of Data.Traversable | billpmurphy/hask,silky/hask | hask/Data/Traversable.py | hask/Data/Traversable.py | from ..lang import build_instance
from ..lang import sig
from ..lang import H
from ..lang import t
from ..Control.Applicative import Applicative
from ..Control.Monad import Monad
from Foldable import Foldable
from Functor import Functor
class Traversable(Foldable, Functor):
"""
Functors representing data stru... | from ..lang import build_instance
from ..Control.Applicative import Applicative
from ..Control.Monad import Monad
from Foldable import Foldable
from Functor import Functor
class Traversable(Foldable, Functor):
"""
Functors representing data structures that can be traversed from left to
right.
Depende... | bsd-2-clause | Python |
e893ac40de2dda19196c7de7d9f7767b20b23884 | Use a better function (lambda) name | myint/cppclean,myint/cppclean,myint/cppclean,myint/cppclean | headers/cpp/functions.py | headers/cpp/functions.py | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | apache-2.0 | Python |
19756b4ed4ccc684a69af275b0ff43bc8392e50d | Remove unimplemented methods. | borg-project/borg | src/python/borg/domains/sat/__init__.py | src/python/borg/domains/sat/__init__.py | """@author: Bryan Silverthorn <bcs@cargo-cult.org>"""
import contextlib
import borg
from . import features
from . import instance
from . import solvers
class SatisfiabilityTask(object):
def __init__(self, path):
self.path = path
def clean(self):
pass
@borg.named_domain
class Satisfiability(... | """@author: Bryan Silverthorn <bcs@cargo-cult.org>"""
import contextlib
import borg
from . import features
from . import instance
from . import solvers
class SatisfiabilityTask(object):
def __init__(self, path):
self.path = path
def clean(self):
pass
@borg.named_domain
class Satisfiability(... | mit | Python |
17e58978b5e1b787b15cae817e510913333bd23d | comment out failing test | chamilad/breadpool | src/python/breadpool/tests/test_pool.py | src/python/breadpool/tests/test_pool.py | # Copyright 2015 Chamila de Alwis
#
# 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,... | # Copyright 2015 Chamila de Alwis
#
# 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,... | apache-2.0 | Python |
723b874eaf4945ffb1a8ac9db55099810271f8b0 | add reboot function. | Hybrid-Cloud/badam,Hybrid-Cloud/badam,Hybrid-Cloud/badam | engineering/utils.py | engineering/utils.py | __author__ = 'nash.xiejun'
import subprocess
def reboot():
subprocess.call("reboot")
| __author__ = 'nash.xiejun'
| apache-2.0 | Python |
60ee6a5d2ad9e85fefd973c020ef65bd212e687c | Fix management command to send notification about new blog post. | astrobin/astrobin,astrobin/astrobin,astrobin/astrobin,astrobin/astrobin | astrobin/management/commands/notify_new_blog_entry.py | astrobin/management/commands/notify_new_blog_entry.py | from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
import persistent_messages
from zinnia.models import Entry
class Command(BaseCommand):
help = "Notifies all users about most recent blog entry."
def handle(self, *args, **options):
entry = Entry.objects.a... | from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from zinnia.models import Entry
from astrobin.notifications import push_notification
class Command(BaseCommand):
help = "Notifies all users about most recent blog entry."
def handle(self, *args, **options):
... | agpl-3.0 | Python |
fee5170a4b947d7ab3755fcb246f59e29f2842e8 | Fix exception-message-attribute warning | DBuildService/atomic-reactor,projectatomic/atomic-reactor,DBuildService/atomic-reactor,projectatomic/atomic-reactor,fr34k8/atomic-reactor,fr34k8/atomic-reactor | atomic_reactor/plugins/exit_remove_worker_metadata.py | atomic_reactor/plugins/exit_remove_worker_metadata.py | """
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import absolute_import
from atomic_reactor.plugin import ExitPlugin
from atomic_reactor.constants import PLUGIN_REMOVE_WORKER... | """
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import absolute_import
from atomic_reactor.plugin import ExitPlugin
from atomic_reactor.constants import PLUGIN_REMOVE_WORKER... | bsd-3-clause | Python |
01646541cb6639e9b41050c6e5466222071364bc | Add "api" prefix to api urls. | franekp/PlanIt,franekp/PlanIt,franekp/PlanIt,franekp/PlanIt,franekp/PlanIt | src/web/web/urls.py | src/web/web/urls.py | """web URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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-based ... | """web URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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-based ... | agpl-3.0 | Python |
f21362be79974914f476be7bc85e74880e70ebf9 | Revert "Put gunicorn in debug mode according to DEBUG" | ovidner/bitket,ovidner/bitket,ovidner/bitket,ovidner/bitket | _conf/gunicorn.py | _conf/gunicorn.py | # -*- coding: utf-8 -*-
import multiprocessing
pythonpath = '/home/sof15/app'
bind = '0.0.0.0:8080'
workers = multiprocessing.cpu_count() * 2 + 1 # todo: optimize
threads = 1 # todo: optimize
user = None
loglevel = 'debug'
errorlog = '-' # stderr | # -*- coding: utf-8 -*-
import multiprocessing
import os
pythonpath = '/home/sof15/app'
bind = '0.0.0.0:8080'
workers = multiprocessing.cpu_count() * 2 + 1 # todo: optimize
threads = 1 # todo: optimize
user = None
loglevel = 'debug'
errorlog = '-' # stderr
debug = os.getenv('DEBUG', False)
| mit | Python |
0a08fe53c8f7a208828779575452f0d543782d33 | Update transactions.py | Chibuzor-IN/python-paystack | python_paystack/objects/transactions.py | python_paystack/objects/transactions.py | '''
transactions.py
'''
import math, uuid
from datetime import datetime
import validators
from .base import Base
from .errors import InvalidEmailError
class Transaction(Base):
'''
Transactions class
'''
reference = None
amount = None
email = None
plan = None
transaction_charge = None
... | '''
transactions.py
'''
import math
from datetime import datetime
import validators
from .base import Base
from .errors import InvalidEmailError
class Transaction(Base):
'''
Transactions class
'''
reference = None
amount = None
email = None
plan = None
transaction_charge = None
meta... | mit | Python |
1c0980b5e8d442df77424f7d471df9fe293571ca | build elf_loader_nexe with --pnacl-bias | cohortfsllc/cohort-cocl2-sandbox,cohortfsllc/cohort-cocl2-sandbox,cohortfsllc/cohort-cocl2-sandbox,cohortfsllc/cohort-cocl2-sandbox,cohortfsllc/cohort-cocl2-sandbox,cohortfsllc/cohort-cocl2-sandbox | src/untrusted/elf_loader/elf_loader.gyp | src/untrusted/elf_loader/elf_loader.gyp | # -*- gyp -*-
# Copyright (c) 2015 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'includes': [
'../../../build/common.gypi',
],
'targets' : [
{
'target_name': 'elf_loader_nexe',
'type': '... | # -*- gyp -*-
# Copyright (c) 2015 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'includes': [
'../../../build/common.gypi',
],
'targets' : [
{
'target_name': 'elf_loader_nexe',
'type': '... | bsd-3-clause | Python |
9126fa0afef42a8c7ecd12d1f0a882da97974fa9 | revert root-level imports | materialsproject/MPContribs,materialsproject/MPContribs,materialsproject/MPContribs,materialsproject/MPContribs | mpcontribs/__init__.py | mpcontribs/__init__.py | """The Materials Project's Community Contribution Framework"""
__version__ = '0.1.1'
__url__ = 'https://github.com/materialsproject/MPContribs'
__author__ = 'Patrick Huck'
__email__ = 'phuck@lbl.gov'
__copyright__ = 'Copyright 2014-2015, The Materials Project'
__maintainer__ = 'Patrick Huck'
| """The Materials Project's Community Contribution Framework"""
__version__ = '0.1.1'
__url__ = 'https://github.com/materialsproject/MPContribs'
__author__ = 'Patrick Huck'
__email__ = 'phuck@lbl.gov'
__copyright__ = 'Copyright 2014-2015, The Materials Project'
__maintainer__ = 'Patrick Huck'
from mpcontribs.io.archie... | mit | Python |
ab16ae6ecd1915981ceceeef8fb1c0c1c41b4089 | Add proper index route | CROSoftware/pyramid_object_dispatch | pyramid_dispatch_protocol/__init__.py | pyramid_dispatch_protocol/__init__.py | # encoding: utf-8
from pyramid.response import Response
from collections import deque
from collections.abc import Iterable
from webob.exc import HTTPNotFound
'''
An implementation of web.dispatch.object for pyramid.
'''
class Context(object):
'''
A psuedo implementation of WebCore's context object to better ... | # encoding: utf-8
from pyramid.response import Response
from collections import deque
from collections.abc import Iterable
from webob.exc import HTTPNotFound
'''
An implementation of web.dispatch.object for pyramid.
'''
class Context(object):
'''
A psuedo implementation of WebCore's context object to better ... | mit | Python |
7e6215ababc356a6e5f5789fab106d2322977ac2 | enable 'real' wikidata | legoktm/pywikipedia-rewrite | pywikibot/families/wikidata_family.py | pywikibot/families/wikidata_family.py | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata families
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'wikidata'
self.langs = {
'wikidata': 'wikidata.org',
'repo': 'wikidata-tes... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata families
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'wikidata'
self.langs = {
'wikidata': 'wikidata.org',
'repo': 'wikidata-tes... | mit | Python |
726da12888f47114008977fe228c4f78f920a057 | Remove old import line | laslabs/odoo-base | res_partner_multi_address/__init__.py | res_partner_multi_address/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Dave Lasley <dave@laslabs.com>
# Copyright: 2015 LasLabs, Inc [https://laslabs.com]
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Dave Lasley <dave@laslabs.com>
# Copyright: 2015 LasLabs, Inc [https://laslabs.com]
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... | agpl-3.0 | Python |
fe8cceed09ed1f8aadb5a1a6b5a3c85504b2f142 | clean compat_drf | chibisov/drf-extensions | rest_framework_extensions/compat_drf.py | rest_framework_extensions/compat_drf.py | """
The `compat` module provides support for backwards compatibility with older
versions of Django REST Framework.
"""
from rest_framework_extensions.utils import get_rest_framework_features
| """
The `compat` module provides support for backwards compatibility with older
versions of Django REST Framework.
"""
from rest_framework_extensions.utils import get_rest_framework_features
def add_trailing_slash_if_needed(regexp_string):
# todo: test me
if get_rest_framework_features()['router_trailing_slas... | mit | Python |
ed738c7962c2b8b144fbee7b382a8f5053b40f3b | Deal with changes made in f9ccf06 | mineo/lala,mineo/lala | lala/plugins/last.py | lala/plugins/last.py | import lala.config
from datetime import datetime
from lala.util import command, msg, regex
lala.config.set_default_options(max_lines="30",
datetime_format="%Y-%m-%d %H:%M:%S")
class _LogEntryBuffer(list):
"""A list with a restricted length."""
def __init__(self, maxentries):... | import lala.config
from datetime import datetime
from lala.util import command, msg, regex
lala.config.set_default_options(max_lines="30",
datetime_format="%Y-%m-%d %H:%M:%S")
class _LogEntryBuffer(list):
"""A list with a restricted length."""
def __init__(self, maxentries):... | mit | Python |
6e3a23edf55e5f153d4390d04c6867696d29ca36 | fix CSV export of unicode chars | hackatbrown/2015.hackatbrown.org,hackatbrown/2015.hackatbrown.org,hackatbrown/2015.hackatbrown.org | hack-at-brown-2015/csv_export.py | hack-at-brown-2015/csv_export.py | import csv
import webapp2
from registration import Hacker, hacker_keys, personal_info_keys
from config import onTeam, isAdmin
import logging
class CsvExport(webapp2.RequestHandler):
def get(self):
if not onTeam(): return self.redirect('/')
keys = list(hacker_keys) + ['status', 'admit_priority', 'r... | import csv
import webapp2
from registration import Hacker, hacker_keys, personal_info_keys
from config import onTeam, isAdmin
import logging
class CsvExport(webapp2.RequestHandler):
def get(self):
if not onTeam(): return self.redirect('/')
keys = list(hacker_keys) + ['status', 'admit_priority', 'r... | mit | Python |
9f9184a17b0aa5f58a104cb606cdca157386b32a | fix undefined variable | emschimmel/CameraPi,emschimmel/CameraPi | led_test/led_test.py | led_test/led_test.py | import ConfigParser
from time import sleep
try:
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
except ImportError:
print('GPIO unavailable')
class led_test:
config = ConfigParser.RawConfigParser()
config.read('c... | import ConfigParser
from time import sleep
try:
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
except ImportError:
print('GPIO unavailable')
class led_test:
config = ConfigParser.RawConfigParser()
config.read('c... | apache-2.0 | Python |
52d4d8283eaf7e899398b6539df80551ec3437ae | FIX version | ingadhoc/odoo-legal | legal/__openerp__.py | legal/__openerp__.py | # -*- coding: utf-8 -*-
{
'name': 'Legal',
'version': '8.0.0.6.0',
'description': 'Legal',
'category': 'base.module_category_knowledge_management',
'author': 'ADHOC',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
'depends': ['calendar',
'portal', 'report_aeroo',
... | # -*- coding: utf-8 -*-
{
'name': 'Legal',
'version': '8.0.0.5.0',
'description': 'Legal',
'category': 'base.module_category_knowledge_management',
'author': 'ADHOC',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
'depends': ['calendar',
'portal', 'report_aeroo',
... | agpl-3.0 | Python |
0e02c451f9d6f0c0af29eaef5f212efefc9d7eef | introduce the concept of an 'ultra' role, which is a role not even admins have unless it is explicitly declared | DOAJ/doaj,DOAJ/doaj,DOAJ/doaj,DOAJ/doaj | portality/authorise.py | portality/authorise.py | from portality.core import app
class Authorise(object):
@classmethod
def has_role(cls, role, reference):
ultra = False
if role.startswith("ultra_"):
ultra = True
# if we are the super user we can do anything
if app.config["SUPER_USER_ROLE"] in reference and not ultr... | from portality.core import app
class Authorise(object):
@classmethod
def has_role(cls, role, reference):
# if we are the super user we can do anything
if app.config["SUPER_USER_ROLE"] in reference:
return True
# if the user's role list contains the role explicitly t... | apache-2.0 | Python |
35ed0d75715a000c343de7e04a6c34dd2c14b2b9 | Split lines correctly, add leading 0 to patent number if length == 7 | yngcan/patentprocessor,yngcan/patentprocessor,yngcan/patentprocessor,funginstitute/patentprocessor,funginstitute/patentprocessor,nikken1/patentprocessor,nikken1/patentprocessor,nikken1/patentprocessor,funginstitute/patentprocessor | test/goldstandard/benchmark_confirm.py | test/goldstandard/benchmark_confirm.py | import sqlite3 as sql
import os
import sys
import logging
import benchmark
# bmVerify(['final_r7', 'final_r8'], filepath="/home/ysun/disambig/newcode/all/", outdir = "/home/ayu/results_v2/")
# Text Files
txt_file = 'benchmark_errors.txt'
opened_file = open(txt_file, 'U')
log_file = 'benchmark_results.log'
#... | import sqlite3 as sql
import os
import sys
import logging
import benchmark
# bmVerify(['final_r7', 'final_r8'], filepath="/home/ysun/disambig/newcode/all/", outdir = "/home/ayu/results_v2/")
# Text Files
txt_file = 'benchmark_errors.txt'
opened_file = open(txt_file, 'U')
log_file = 'benchmark_results.log'
#... | bsd-2-clause | Python |
589e1b3587a555983b764338d86a08596961247c | fix formatting of help text | TheReverend403/Pyper,TheReverend403/Pyper | commands/cmd_hash.py | commands/cmd_hash.py | import hashlib
from lib.command import Command
class HashCommand(Command):
name = 'hash'
description = 'Hashes text.'
def run(self, message, args):
# Remove duplicates
available_algorithms = list(set(x.lower() for x in hashlib.algorithms_available))
if not args or len(args) != 2:... | import hashlib
from lib.command import Command
class HashCommand(Command):
name = 'hash'
description = 'Hashes text.'
def run(self, message, args):
# Remove duplicates
available_algorithms = list(set(x.lower() for x in hashlib.algorithms_available))
if not args or len(args) != 2:... | agpl-3.0 | Python |
5527b7cd687f6b3b80c3b171d14a4031a01b995e | Add signal handler | phsmit/kaldi-recipes,psmit/kaldi-recipes,phsmit/kaldi-recipes,psmit/kaldi-recipes,psmit/kaldi-recipes | common/filter_lex.py | common/filter_lex.py | #!/usr/bin/env python3
import argparse
from signal import signal, SIGPIPE, SIG_DFL
#Ignore SIG_PIPE and don't throw exceptions on it... (http://docs.python.org/library/signal.html)
signal(SIGPIPE,SIG_DFL)
def main(in_lex, vocab, out_lex, oov):
d = {}
for line in in_lex:
key, trans = line.strip().spli... | #!/usr/bin/env python3
import argparse
def main(in_lex, vocab, out_lex, oov):
d = {}
for line in in_lex:
key, trans = line.strip().split(None, 1)
if key not in d:
d[key] = set()
d[key].add(trans)
for line in vocab:
word = line.strip().split()[0]
if wor... | apache-2.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.