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 |
|---|---|---|---|---|---|---|---|---|
377648465cfb9be870c20d1d59d2b93111fa7c86 | Handle movies without ratings section - refs #73 | StegSchreck/RatS,StegSchreck/RatS,StegSchreck/RatS | RatS/rottentomatoes/rottentomatoes_ratings_inserter.py | RatS/rottentomatoes/rottentomatoes_ratings_inserter.py | import time
import urllib.parse
from RatS.base.base_ratings_inserter import RatingsInserter
from RatS.rottentomatoes.rottentomatoes_site import RottenTomatoes
class RottenTomatoesRatingsInserter(RatingsInserter):
def __init__(self, args):
super(RottenTomatoesRatingsInserter, self).__init__(RottenTomatoes... | import time
import urllib.parse
from RatS.base.base_ratings_inserter import RatingsInserter
from RatS.rottentomatoes.rottentomatoes_site import RottenTomatoes
class RottenTomatoesRatingsInserter(RatingsInserter):
def __init__(self, args):
super(RottenTomatoesRatingsInserter, self).__init__(RottenTomatoes... | agpl-3.0 | Python |
a655b1758ca8c606fd74b7a0cfaafe3f2d6efb7c | Fix DJango auth to properly timeout with the fas session and to support single sign in with other Fedora Apps via a shared cookie. | fedora-infra/python-fedora | fedora/django/auth/middleware.py | fedora/django/auth/middleware.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Ignacio Vazquez-Abrams
# This file is part of python-fedora
#
# python-fedora is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the ... | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Ignacio Vazquez-Abrams
# This file is part of python-fedora
#
# python-fedora is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the ... | lgpl-2.1 | Python |
ed04b61398544adb8a5b5c1c5d589ea1dac2a20b | return the bad request value | sassoftware/conary,sassoftware/conary,sassoftware/conary,sassoftware/conary,sassoftware/conary | conary/web/webauth.py | conary/web/webauth.py | #
# Copyright (c) 2004-2005 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/... | #
# Copyright (c) 2004-2005 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/... | apache-2.0 | Python |
cd996486b25ab35369994a4470f795ae31e06a9c | Add first test for ccs | ewels/MultiQC_TestData,ewels/MultiQC_TestData,ewels/MultiQC_TestData,ewels/MultiQC_TestData,ewels/MultiQC_TestData | unit_tests/test_ccs.py | unit_tests/test_ccs.py | #!/usr/bin/env python3
import unittest
import sys
# This line allows the tests to run if you just naively run this script.
# But the preferred way is to use run_tests.sh
sys.path.insert(0,'../MultiQC')
from multiqc.modules.ccs.ccs import parse_ccs_log
class Test(unittest.TestCase):
def test_parse_line(self):
... | #!/usr/bin/env python3
import unittest
import sys
# This line allows the tests to run if you just naively run this script.
# But the preferred way is to use run_tests.sh
sys.path.insert(0,'../MultiQC')
from multiqc.modules.ccs.ccs import parse_ccs_log
class Test(unittest.TestCase):
def test_nothing(self):
... | mit | Python |
4c78e5aed5ab3f0c5e95b5efbf6459b3377e8bfb | move sample out of Voronoi function | PKU-Dragon-Team/Datalab-Utilities | Voronoi/__init__.py | Voronoi/__init__.py | """Module to compute and show Voronoi figure
"""
import os
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from scipy.spatial import Voronoi
import pandas as pd
__location__ = os.path.join(os.getcwd(), os.path.dirname(os.path.realpath(__file__)))
COUNT_LIMIT = None
def voronoi(cell_info: pd.Da... | """Module to compute and show Voronoi figure
"""
import os
# import typing as tg
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from scipy.spatial import Voronoi
import pandas as pd
__location__ = os.path.join(os.getcwd(), os.path.dirname(os.path.realpath(__file__)))
COUNT_LIMIT = None
def vo... | mit | Python |
76a326bb51331cc04798cddfff18faa60f0fa04f | Remove demo data | thinkopensolutions/l10n-brazil,thinkopensolutions/l10n-brazil | financial_account/__openerp__.py | financial_account/__openerp__.py | # -*- coding: utf-8 -*-
# Copyright 2017 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Financial Account',
'summary': """
Integrate financial module with Odoo accounting""",
'version': '8.0.1.0.0',
'license': 'AGPL-3',
'author': 'KMEE,Odoo Community Associa... | # -*- coding: utf-8 -*-
# Copyright 2017 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Financial Account',
'summary': """
Integrate financial module with Odoo accounting""",
'version': '8.0.1.0.0',
'license': 'AGPL-3',
'author': 'KMEE,Odoo Community Associa... | agpl-3.0 | Python |
8a1557bec5e7f94ce2e4a5b06d42e4bd2e2fcd70 | Make downloads.py compatible with Python | pgbouncer/pgbouncer.github.io,pgbouncer/pgbouncer.github.io,pgbouncer/pgbouncer.github.io,pgbouncer/pgbouncer.github.io,pgbouncer/pgbouncer.github.io | _build/downloads.py | _build/downloads.py | #! /usr/bin/env python
import os
import json
import re
import glob
import sys
from distutils.version import StrictVersion
date_map = {}
for m in re.finditer(r'^[*][*]([-0-9]+) *- *\w+ *([0-9.]+) *-', open('changelog.md', 'r').read(), re.M):
date_map[m.group(2)] = m.group(1)
vermap = {}
for fn in glob.glob('down... | #! /usr/bin/env python
import os
import json
import re
import glob
import sys
from distutils.version import StrictVersion
date_map = {}
for m in re.finditer(r'^[*][*]([-0-9]+) *- *\w+ *([0-9.]+) *-', open('changelog.md', 'r').read(), re.M):
date_map[m.group(2)] = m.group(1)
vermap = {}
for fn in glob.glob('down... | isc | Python |
3c0ed36b6cf0b8c95de225c249be8a86f2c41b81 | FIX __all__ needs strings | gallantlab/pycortex,gallantlab/pycortex,gallantlab/pycortex,gallantlab/pycortex,gallantlab/pycortex | cortex/export/__init__.py | cortex/export/__init__.py | from .save_views import save_3d_views
from .panels import plot_panels
from .panels import params_flatmap_lateral_medial
from .panels import params_occipital_triple_view
__all__ = [
'save_3d_views',
'plot_panels',
'params_flatmap_lateral_medial',
'params_occipital_triple_view',
]
| from .save_views import save_3d_views
from .panels import plot_panels
from .panels import params_flatmap_lateral_medial
from .panels import params_occipital_triple_view
__all__ = [
save_3d_views,
plot_panels,
params_flatmap_lateral_medial,
params_occipital_triple_view,
]
| bsd-2-clause | Python |
792bf99517149f06d7464ec364209265fc441529 | Test missing POST argument | UrLab/incubator,UrLab/incubator,UrLab/incubator,UrLab/incubator | space/tests/test_private_api.py | space/tests/test_private_api.py | from django.http import HttpResponseBadRequest, HttpResponseForbidden, HttpResponse
from space.decorators import private_api
X = HttpResponse('i am the inner fn')
@private_api()
def inner_fn(request):
return X
def test_get(rf):
request = rf.get('')
response = inner_fn(request)
assert isinstance(res... | from django.http import HttpResponseBadRequest, HttpResponseForbidden, HttpResponse
from space.decorators import private_api
X = HttpResponse('i am the inner fn')
@private_api()
def inner_fn(request):
return X
def test_get(rf):
request = rf.get('')
response = inner_fn(request)
assert isinstance(res... | agpl-3.0 | Python |
674df56992c2c3782185ee904e82f0a8094c3742 | Add extra space above set method to match the style of the rest of the project. Added in some documentation describing what the method can be used for. | Cue/greplin-tornado-kissmetrics | src/greplin/tornado/kissmetrics.py | src/greplin/tornado/kissmetrics.py | # Copyright 2011 The greplin-tornado-kissmetrics Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | # Copyright 2011 The greplin-tornado-kissmetrics Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 | Python |
64f66563a7abd92eeb16a7b903bdebb65c6c1b0d | Bump version number | fatboystring/csv_generator,fatboystring/csv_generator | csv_generator/__init__.py | csv_generator/__init__.py | # -*- coding: utf-8 -*-
"""
Configurable CSV Generator app for Django
"""
VERSION = ('0', '2', '2')
__version__ = '.'.join(VERSION)
| # -*- coding: utf-8 -*-
"""
Configurable CSV Generator app for Django
"""
VERSION = ('0', '2', '1')
__version__ = '.'.join(VERSION)
| mit | Python |
3326168635070a50486fe82d3f050a2e71d9dbef | add mini doc for updating fixtures | bartscheers/banana,bartscheers/banana,bartscheers/banana | util/create_content.py | util/create_content.py | """
Populate a TKP database with Mock data.
procedure:
* (re)create a database
* populate it with tkp-manage.py initdb
* run this script to create mock data. Configure the connection
using the TKP_DB* environment variables
* configure the Banana project to use this database
* dump the db cont... | """
Populate a TKP database with Mock data.
"""
import tkp.db
from tkp.testutil import db_subs
def main():
database = tkp.db.Database()
dataset = tkp.db.DataSet(data={'description': "Banana test data"},
database=database)
n_images = 4
new_source_sigma_margin = 3
image... | bsd-3-clause | Python |
ec57d1aeef9ef540269e2872c6718bba2cdd442e | Revert a change that caused Django controller tests to fail. | CMDann/oppia,kevinlee12/oppia,VictoriaRoux/oppia,terrameijar/oppia,amgowano/oppia,sanyaade-teachings/oppia,nagyistoce/oppia,won0089/oppia,zgchizi/oppia-uc,raju249/oppia,asandyz/oppia,MAKOSCAFEE/oppia,kingctan/oppia,amitdeutsch/oppia,sunu/oppia,VictoriaRoux/oppia,kennho/oppia,brianrodri/oppia,himanshu-dixit/oppia,AllanY... | core/controllers/base_test.py | core/controllers/base_test.py | # Copyright 2012 Google Inc. 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 by applicable law or ... | # Copyright 2012 Google Inc. 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 by applicable law or ... | apache-2.0 | Python |
b883294a43d4c3e2847c701062d77358473ca975 | revert hyperlinkimage use of MouseHandler class | pombredanne/pyjs,pombredanne/pyjs,gpitel/pyjs,lancezlin/pyjs,anandology/pyjamas,Hasimir/pyjs,pyjs/pyjs,pyjs/pyjs,pyjs/pyjs,gpitel/pyjs,spaceone/pyjs,lancezlin/pyjs,minghuascode/pyj,Hasimir/pyjs,Hasimir/pyjs,pombredanne/pyjs,gpitel/pyjs,pyjs/pyjs,minghuascode/pyj,spaceone/pyjs,spaceone/pyjs,minghuascode/pyj,anandology/p... | library/pyjamas/ui/HyperlinkImage.py | library/pyjamas/ui/HyperlinkImage.py | # Date Time Example
# Copyright (C) 2009 Yit Choong (http://code.google.com/u/yitchoong/)
# Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
from Hyperlink import Hyperlink
from pyjamas import Factory
from Image import Image
from pyjamas import DOM
from pyjamas.ui import Event
from pyjamas.ui import Mo... | # Date Time Example
# Copyright (C) 2009 Yit Choong (http://code.google.com/u/yitchoong/)
# Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
from Hyperlink import Hyperlink
from pyjamas import Factory
from Image import Image
from pyjamas import DOM
from pyjamas.ui import Event
from pyjamas.ui.MouseList... | apache-2.0 | Python |
9a52024ff5b8175ee8b8d4665d3c8c667003019b | Add test for redactor block creation | developersociety/django-glitter,blancltd/django-glitter,developersociety/django-glitter,developersociety/django-glitter,blancltd/django-glitter,blancltd/django-glitter | glitter/blocks/redactor/tests.py | glitter/blocks/redactor/tests.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.contrib.auth import get_user_model
from django.contrib.conte... | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... | bsd-3-clause | Python |
28292f823da360257f9a6d6d26c92f6c4df5a79d | bump to 0.5.3 | tsuru/varnishapi,tsuru/varnishapi | feaas/__init__.py | feaas/__init__.py | # Copyright 2014 varnishapi authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
__version__ = "0.5.3"
| # Copyright 2014 varnishapi authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
__version__ = "0.5.2"
| bsd-3-clause | Python |
2606d5f5b931ab3255c422ac038f669b05d0b8ff | Bump version as instructed by Bamboo | pbs/django-filer,pbs/django-filer,pbs/django-filer,pbs/django-filer,pbs/django-filer | filer/__init__.py | filer/__init__.py | #-*- coding: utf-8 -*-
# version string following pep-0396 and pep-0386
__version__ = '0.9pbs.20' # pragma: nocover
| #-*- coding: utf-8 -*-
# version string following pep-0396 and pep-0386
__version__ = '0.9pbs.19' # pragma: nocover
| bsd-3-clause | Python |
1bfbb286881e88c8e2b6fcdb2d74eff4e267bc57 | Normalize spread/span histograms into a probability distribution. | c4fcm/WhatWeWatch-Analysis,c4fcm/WhatWeWatch-Analysis,c4fcm/WhatWeWatch-Analysis | findstatistics.py | findstatistics.py | from __future__ import division
import ConfigParser
import csv
import datetime
import time
import numpy as np
import util
# Read config
config = ConfigParser.RawConfigParser()
config.read('app.config')
exp_id = time.time()
videos = dict()
# Open data file
all_dates = set()
all_countries = set()
all_videos = set(... | import ConfigParser
import csv
import datetime
import time
import numpy as np
import util
# Read config
config = ConfigParser.RawConfigParser()
config.read('app.config')
exp_id = time.time()
videos = dict()
# Open data file
all_dates = set()
all_countries = set()
all_videos = set()
with open('data/%s' % config.ge... | bsd-3-clause | Python |
0b296bdef138ffc48363745e39d0d605e81b24cc | Set scheduler to start at 8pm | tipsqueal/duwamish-lighthouse,tipsqueal/duwamish-lighthouse,illumenati/duwamish-lighthouse,illumenati/duwamish-lighthouse,YonasBerhe/duwamish-lighthouse | server.py | server.py | import bottle
import waitress
import controller
import breathe
from pytz import timezone
from apscheduler.schedulers.background import BackgroundScheduler
bottle_app = bottle.app()
scheduler = BackgroundScheduler()
scheduler.configure(timezone=timezone('US/Pacific'))
breather = breathe.Breathe()
my_controller = contro... | import bottle
import waitress
import controller
import breathe
from pytz import timezone
from apscheduler.schedulers.background import BackgroundScheduler
bottle_app = bottle.app()
scheduler = BackgroundScheduler()
scheduler.configure(timezone=timezone('US/Pacific'))
breather = breathe.Breathe()
my_controller = contro... | mit | Python |
fd18500f0d5273bcec4e5bbf9f547eff2c8aaba8 | Change ball parameters. | microy/NetworkBall,microy/NetworkDemo | server.py | server.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Server side of the NetworkDemo application
#
# Send a ball to all the clients (like a token ring)
#
#
# External dependencies
#
import select
import socket
import time
# Set up the server connection
server = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
serv... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Server side of the NetworkDemo application
#
# Send a ball to all the clients (like a token ring)
#
#
# External dependencies
#
import select
import socket
import time
# Set up the server connection
server = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
serv... | mit | Python |
0fa002e66f82eff593514c2249c4229604ec0f0a | Make sure to close the file afterwards | martindisch/SensorTag,martindisch/SensorTag,martindisch/SensorTag,martindisch/SensorTag | server.py | server.py | import web
import cPickle as pickle
import json
urls = (
'/latest', 'latest',
'/history', 'history'
)
class latest:
def GET(self):
try:
with open("latest.p", 'r') as f:
latest = pickle.load(f)
return json.dumps(latest)
except:
return "Cou... | import web
import cPickle as pickle
import json
urls = (
'/latest', 'latest',
'/history', 'history'
)
class latest:
def GET(self):
try:
latest = pickle.load(open("latest.p", "r"))
return json.dumps(latest)
except:
return "Could not read latest data"
cla... | mit | Python |
9c4c33461ddb2d621c2b393a779aa67fea3bef84 | fix test for py2.6, again. | chebee7i/dit,dit/dit,dit/dit,dit/dit,Autoplectic/dit,chebee7i/dit,chebee7i/dit,dit/dit,Autoplectic/dit,dit/dit,Autoplectic/dit,Autoplectic/dit,Autoplectic/dit,chebee7i/dit | dit/utils/tests/test_misc.py | dit/utils/tests/test_misc.py | from nose.tools import *
from dit.utils.misc import flatten, is_string_like
def test_flatten1():
x = [[[0], 1, 2], 3, [4]]
fx = list(flatten(x))
y = [0, 1, 2, 3, 4]
assert_equal(len(fx), len(y))
for i, j in zip(fx, y):
assert_equal(i, j)
def test_is_string_like1():
ys = ['', 'hi', "pa... | from nose.tools import *
from dit.utils.misc import flatten, is_string_like
def test_flatten1():
x = [[[0], 1, 2], 3, [4]]
y = [0, 1, 2, 3, 4]
assert_list_equal(list(flatten(x)), y)
def test_is_string_like1():
ys = ['', 'hi', "pants", '"test"', u'pants', r'pants']
ns = [1, [], int, {}, ()]
fo... | bsd-3-clause | Python |
a89e89dd10eb0a179513638765573c348c2c7784 | Add default value | dreipol/djangocms-spa,dreipol/djangocms-spa | djangocms_spa/cms_plugins.py | djangocms_spa/cms_plugins.py | from cms.plugin_base import CMSPluginBase
class SPAPluginMixin(object):
frontend_component_name = None
parse_child_plugins = True
def render_spa(self, request, context, instance):
return context
class SPAPluginBase(SPAPluginMixin, CMSPluginBase):
render_template = 'djangocms_spa/empty.html'... | from cms.plugin_base import CMSPluginBase
class SPAPluginMixin(object):
frontend_component_name = None
def render_spa(self, request, context, instance):
return context
class SPAPluginBase(SPAPluginMixin, CMSPluginBase):
render_template = 'djangocms_spa/empty.html' # The plugin needs a template... | mit | Python |
c00bab49a36aee13a88e7215d5cb8fdd42591fbf | reduce permission_list CharField length to 64 | adieu/djangotoolbox,heracek/djangotoolbox | djangotoolbox/auth/models.py | djangotoolbox/auth/models.py | from django.contrib.auth.models import User, Group
from django.db import models
from djangotoolbox.fields import ListField
class UserPermissionList(models.Model):
user = models.ForeignKey(User)
permission_list = ListField(models.CharField(max_length=64))
permission_fk_list = ListField(models.CharFiel... | from django.contrib.auth.models import User, Group
from django.db import models
from djangotoolbox.fields import ListField
class UserPermissionList(models.Model):
user = models.ForeignKey(User)
permission_list = ListField(models.CharField(max_length=128))
permission_fk_list = ListField(models.CharFie... | bsd-3-clause | Python |
656f3091ff622cfe55495c036b6cb01ae3cf8d96 | fix docs for source listing | sncosmo/sncosmo,dannygoldstein/sncosmo,kbarbary/sncosmo,dannygoldstein/sncosmo,kbarbary/sncosmo,sncosmo/sncosmo,dannygoldstein/sncosmo,sncosmo/sncosmo,kbarbary/sncosmo | docs/_helpers/source_page.py | docs/_helpers/source_page.py | """Generate a restructured text document that describes built-in sources
and save it to this module's docstring for the purpose of including in
sphinx documentation via the automodule directive."""
import string
from astropy.extern import six
from sncosmo import registry, Source
lines = [
'',
' '.join([20*... | """Generate a restructured text document that describes built-in sources
and save it to this module's docstring for the purpose of including in
sphinx documentation via the automodule directive."""
import string
from astropy.extern import six
from sncosmo import registry, Source
lines = [
'',
' '.join([20*... | bsd-3-clause | Python |
c06c0ee380f276c1f7720f00b0db01376a257893 | fix init_sqlite bug | the5fire/onlinetodos,the5fire/onlinetodos | src/init_sqlite.py | src/init_sqlite.py | #coding:utf-8
import sqlite3
con = sqlite3.connect('todos.db')
cur = con.cursor()
try:
cur.execute('CREATE TABLE todos(id integer PRIMARY KEY AUTOINCREMENT, title text,_order integer,done boolean default False);')
con.commit()
except Exception as e:
print e
cur.execute('INSERT INTO todos(title, _order, d... | #coding:utf-8
import sqlite3
con = sqlite3.connect('todos.db')
cur = con.cursor()
try:
cur.execute('CREATE TABLE todos(id integer PRIMARY KEY AUTOINCREMENT, title text,_order integer,done boolean default False);')
con.commit()
except Exception as e:
print e
cur.execute('INSERT INTO todos(title, _order, d... | apache-2.0 | Python |
c943790fe98e2430f99ec9fe47280b1ba621a475 | Remove spaces | charanpald/APGL | exp/influence2/ReputationExp.py | exp/influence2/ReputationExp.py | import numpy
import ctypes
try:
ctypes.cdll.LoadLibrary("/usr/local/lib/libigraph.so")
except:
pass
import igraph
from exp.influence2.MaxInfluence import MaxInfluence
from apgl.util.PathDefaults import PathDefaults
from exp.util.IdIndexer import IdIndexer
import array
#Read in graph
dataDir = PathDef... | import numpy
import ctypes
try:
ctypes.cdll.LoadLibrary("/usr/local/lib/libigraph.so")
except:
pass
import igraph
from exp.influence2.MaxInfluence import MaxInfluence
from apgl.util.PathDefaults import PathDefaults
from exp.util.IdIndexer import IdIndexer
import array
#Read in graph
dataDir = PathDef... | bsd-3-clause | Python |
f8128670f57caaac9b3cbb921716a0d93caf1b20 | use yield instead of return. | wings27/sc_spider | sc_spider/spiders/songsan.py | sc_spider/spiders/songsan.py | # -*- coding: utf-8 -*-
import os
import scrapy
from sc_spider.items import SongCiItem
from sc_spider.spiders.spider_utils import page_name_from_url
class SongSanSpider(scrapy.Spider):
name = "songsan"
allowed_domains = ["gushiwen.org"]
start_urls = (
'http://www.gushiwen.org/gushi/songsan.aspx'... | # -*- coding: utf-8 -*-
import os
import scrapy
from sc_spider.items import SongCiItem
from sc_spider.spiders.spider_utils import page_name_from_url
class SongSanSpider(scrapy.Spider):
name = "songsan"
allowed_domains = ["gushiwen.org"]
start_urls = (
'http://www.gushiwen.org/gushi/songsan.aspx'... | apache-2.0 | Python |
c6800bc8f57a2d79f404225b085fd7941fbf6321 | Update version to 2.0b1-dev | tsiegleauq/OpenSlides,normanjaeckel/OpenSlides,ostcar/OpenSlides,CatoTH/OpenSlides,normanjaeckel/OpenSlides,FinnStutzenstein/OpenSlides,CatoTH/OpenSlides,emanuelschuetze/OpenSlides,rolandgeider/OpenSlides,FinnStutzenstein/OpenSlides,rolandgeider/OpenSlides,boehlke/OpenSlides,boehlke/OpenSlides,ostcar/OpenSlides,boehlke... | openslides/__init__.py | openslides/__init__.py | __author__ = 'OpenSlides Team <support@openslides.org>'
__description__ = 'Presentation and assembly system'
__version__ = '2.0b1-dev'
| __author__ = 'OpenSlides Team <support@openslides.org>'
__description__ = 'Presentation and assembly system'
__version__ = '2.0a1'
| mit | Python |
63db4d67ae38c887e49777823cfdec55cb197bf5 | Mark the mail_environnement module as installable = True as it works on v 7.0 | tungocbui/server-tools,samuellefever/server-tools,florian-dacosta/server-tools,numerigraphe/server-tools,eezee-it/server-tools,archetipo/server-tools,acsone/server-tools,hurrinico/server-tools,open-synergy/server-tools,anas-taji/server-tools,sergiocorato/server-tools,acsone/server-tools,rossasa/server-tools,ClearCorp/s... | mail_environment/__openerp__.py | mail_environment/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... | agpl-3.0 | Python |
48ec7d25452e32d16b4224f665cf33e81e301c86 | handle legacy checkpoints gracefully | dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq | corehq/apps/change_feed/management/commands/validate_kafka_pillow_checkpoints.py | corehq/apps/change_feed/management/commands/validate_kafka_pillow_checkpoints.py | from optparse import make_option
from django.core.management import BaseCommand
from corehq.apps.change_feed.consumer.feed import KafkaChangeFeed
from corehq.apps.change_feed.exceptions import UnavailableKafkaOffset
from corehq.apps.change_feed.topics import validate_offsets
from pillowtop import get_all_pillow_instanc... | from optparse import make_option
from django.core.management import BaseCommand
from corehq.apps.change_feed.consumer.feed import KafkaChangeFeed
from corehq.apps.change_feed.exceptions import UnavailableKafkaOffset
from corehq.apps.change_feed.topics import validate_offsets
from pillowtop import get_all_pillow_instanc... | bsd-3-clause | Python |
2aa6af17bde1b6260cf9cdfaf724f152551e160a | add documentation ... fork stuff. | OpenTransitTools/utils | ott/utils/exe_utils.py | ott/utils/exe_utils.py | import os
import subprocess
import logging
log = logging.getLogger(__file__)
def run_java(cmd_line, fork=False, big_xmx="-Xmx4096m", small_xmx="-Xmx1536m", java_cmd="java"):
''' run java ... if we get an exception, try to run again with lower heap size
'''
#import pdb; pdb.set_trace()
try:
jav... | import os
import subprocess
import logging
log = logging.getLogger(__file__)
def run_java(cmd_line, fork=False, big_xmx="-Xmx4096m", small_xmx="-Xmx1536m", java_cmd="java"):
''' run java ... if we get an exception, try to run again with lower heap size
'''
try:
java_cmd = "{} {} {}".format(java_cm... | mpl-2.0 | Python |
86927c1c0ab5b4734aa23c7c90806d32183c8fd9 | Fix another failing test | jdgillespie91/trackerSpend,jdgillespie91/trackerSpend | utils/export_worksheet.py | utils/export_worksheet.py | import gspread
import json
import os
from oauth2client.client import SignedJwtAssertionCredentials
def __get_data(auth_file, workbook_key, worksheet_name):
with open(auth_file) as key:
json_key = json.load(key)
credentials = SignedJwtAssertionCredentials(json_key['client_email'],
... | import gspread
import json
import os
from oauth2client.client import SignedJwtAssertionCredentials
def __get_worksheet(auth_file, workbook_key, worksheet_name):
with open(auth_file) as key:
json_key = json.load(key)
credentials = SignedJwtAssertionCredentials(json_key['client_email'],
... | mit | Python |
d936f53ae422fab360f5e1cd62f7114d91ba270c | Add lagged phase space plot | kpj/PyWave | extra_plots.py | extra_plots.py | """
Generate nice plots providing additional information
"""
import sys
import numpy as np
import matplotlib.pylab as plt
from singularity_finder import compute_tau
def neural_spike():
""" Plot various neural spikes
"""
def do_plot(cell_evo):
""" Plot [cAMP] for single cell over time
"""... | """
Generate nice plots providing additional information
"""
import sys
import numpy as np
import matplotlib.pylab as plt
def neural_spike():
""" Plot various neural spikes
"""
def do_plot(cell_evo):
""" Plot [cAMP] for single cell over time
"""
plt.plot(range(len(cell_evo)), cell... | mit | Python |
abac01396688fee7bf0b7456ad05b0725b7494dc | Change REPO_URL to REPO_PATH in fabsettings. | jerivas/mezzanine-webf | fabsettings.py | fabsettings.py | # Copy this settings to your local_settings.py.
# Comment out the settings where you want to use defaults.
FABRIC = {
# Webfaction SSH username
"SSH_USER": "",
# Webfaction SSH password (You'll need this even if you use
# key-based auth because of Webafaction's API)
"SSH_PASS": "",
# Local pat... | # Copy this settings to your local_settings.py.
# Comment out the settings where you want to use defaults.
FABRIC = {
# Webfaction SSH username
"SSH_USER": "",
# Webfaction SSH password (You'll need this even if you use
# key-based auth because of Webafaction's API)
"SSH_PASS": "",
# Local pat... | mit | Python |
ebea469883e376fba1e7bc4a229a97065376f173 | Update task_1_50.py | Mariaanisimova/pythonintask | IVTa/2014/BRONNIKOV_I_S/task_1_50.py | IVTa/2014/BRONNIKOV_I_S/task_1_50.py | # Задача 1. Вариант 50
# Напишите программу, которая будет сообщать род деятельности и псевдоним
# под которым скрывается Садриддин Герхард Герхардс.
# После вывода информации программа
# должна дожидаться пока пользователь нажмет Enter для выхода.
# Bronnikov I.S.
# 24.05.2016
print("Герхард Герхардс, более... | Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:38:48) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> # Задача 1. Вариант 50
# Напишите программу, которая будет сообщать род деятельности и псевдоним
# под которым скрывается Садриддин Герхард Герхардс.
#... | apache-2.0 | Python |
6361a3d7cec6fdd3d339db18f778c0b745a9785b | fix test name | yuyu2172/chainercv,pfnet/chainercv,chainer/chainercv,chainer/chainercv,yuyu2172/chainercv | tests/datasets_tests/voc_tests/test_voc_semantic_segmentation_dataset.py | tests/datasets_tests/voc_tests/test_voc_semantic_segmentation_dataset.py | import unittest
from chainer import testing
from chainer.testing import attr
from chainercv.datasets import voc_semantic_segmentation_label_names
from chainercv.datasets import VOCSemanticSegmentationDataset
from chainercv.utils import assert_is_semantic_segmentation_dataset
@testing.parameterize(
{'split': 'tr... | import unittest
from chainer import testing
from chainer.testing import attr
from chainercv.datasets import voc_semantic_segmentation_label_names
from chainercv.datasets import VOCSemanticSegmentationDataset
from chainercv.utils import assert_is_semantic_segmentation_dataset
@testing.parameterize(
{'split': 'tr... | mit | Python |
af75af20c06bd18c50d3d8bb5aa6c8e4779aa2a8 | add - log level override in set_log | rfaulkner/easyML,rfaulkner/easyML,rfaulkner/easyML,rfaulkner/easyML | versus/config/__init__.py | versus/config/__init__.py | import logging
global log
# NullHandler was added in Python 3.1.
try:
NullHandler = logging.NullHandler
except AttributeError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
# Add a do-nothing NullHandler to the module logger to prevent "No handlers
# could be found" err... | import logging
global log
# NullHandler was added in Python 3.1.
try:
NullHandler = logging.NullHandler
except AttributeError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
# Add a do-nothing NullHandler to the module logger to prevent "No handlers
# could be found" err... | bsd-3-clause | Python |
7316d1cb953812ae0286d59d1abc014b2f90794b | Move wait_time.py into user module | locustio/locust,mbeacom/locust,mbeacom/locust,mbeacom/locust,locustio/locust,locustio/locust,mbeacom/locust,locustio/locust | locust/__init__.py | locust/__init__.py | from .user.sequential_taskset import SequentialTaskSet
from .user.task import task, TaskSet
from .user.users import HttpUser, User
from .user.wait_time import between, constant, constant_pacing
from .event import Events
events = Events()
__version__ = "1.0b1"
| from .user.sequential_taskset import SequentialTaskSet
from .user.task import task, TaskSet
from .user.users import HttpUser, User
from .event import Events
from .wait_time import between, constant, constant_pacing
events = Events()
__version__ = "1.0b1"
| mit | Python |
369449827d3b6176c6ada812f403f519357a740e | Bump version | illicitonion/synapse,iot-factory/synapse,rzr/synapse,TribeMedia/synapse,rzr/synapse,matrix-org/synapse,iot-factory/synapse,illicitonion/synapse,matrix-org/synapse,iot-factory/synapse,howethomas/synapse,matrix-org/synapse,iot-factory/synapse,illicitonion/synapse,rzr/synapse,matrix-org/synapse,TribeMedia/synapse,rzr/syna... | synapse/__init__.py | synapse/__init__.py | # -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# 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 applica... | # -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# 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 applica... | apache-2.0 | Python |
78d6d4dd90a2e79344849595a3869b0b53b945d0 | insert fixed to specs | Copenbacon/data-structures | src/pq.py | src/pq.py | """Implement a priority queue."""
from math import inf
class PikaQ(object):
"""The Priority Queue Class."""
def __init__(self, vals=[]):
"""Initialize a priority que."""
self.pq = {}
if isinstance(vals, list):
try:
for val in vals:
sel... | """Implement a priority queue."""
class PikaQueue(object):
"""The Priority Queue Class."""
def __init__(self, vals=[]):
"""Initialize a priority que."""
self.pq = {}
if isinstance(vals, list):
try:
for val in vals:
self.insert(val)
... | mit | Python |
71eeb919373787569034225e8047079075df5569 | Add print statements for clarity | HKuz/PythonChallenge | Challenges/chall_06.py | Challenges/chall_06.py | #!/usr/local/bin/python3
# Python Challenge - 6
# http://www.pythonchallenge.com/pc/def/channel.html
# http://www.pythonchallenge.com/pc/def/channel.zip
# Keyword: hockey -> oxygen
import re
import zipfile
def main():
'''
Hint: zip, now there are pairs
In the readme.txt:
welcome to my zipped list.
... | #!/usr/local/bin/python3
# Python Challenge - 6
# http://www.pythonchallenge.com/pc/def/channel.html
# http://www.pythonchallenge.com/pc/def/channel.zip
# Keyword: hockey -> oxygen
import re
import zipfile
def main():
'''
Hint: zip, now there are pairs
In the readme.txt:
welcome to my zipped list.
... | mit | Python |
c5c3f4c1bde43d12231575952084693553a34d65 | Update __init__.py | piotrjakimiak/cmsplugin-text-ng,KristianOellegaard/cmsplugin-text-ng | cmsplugin_text_ng/__init__.py | cmsplugin_text_ng/__init__.py | __version__ = '0.6'
default_app_config = 'cmsplugin_text_ng.apps.CmsPluginTextNgConfig'
| __version__ = '0.7'
default_app_config = 'cmsplugin_text_ng.apps.CmsPluginTextNgConfig'
| bsd-3-clause | Python |
9b8aeacb46baa4b862f0389e47048f03b7a2b62b | Use threading.Event.wait() instead of time.sleep() for loop timing | waits/status,waits/status | status.py | status.py | from flask import Flask
from flask import abort, redirect, render_template, url_for
import json, requests, sched, threading, time
app = Flask(__name__)
# Runs check_status() every 60 seconds
def worker():
check_status()
exit_flag = threading.Event()
while not exit_flag.wait(timeout=60):
check_statu... | from flask import Flask
from flask import abort, redirect, render_template, url_for
import json, requests, threading, time
app = Flask(__name__)
with open('config.json') as file:
app.config['SITES'] = json.load(file)['sites']
file.close()
@app.before_first_request
def start_worker_thread():
t = threading.... | bsd-3-clause | Python |
d0a615e2e6076a66a2da9e479ca5e26a31c37b3d | Add constant for HTTP 418 per RFC 7168 | avinassh/status,josuebrunel/status,avinassh/status,josuebrunel/status | status.py | status.py | """
source: https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/status.py
Copyright (c) 2011-2015, Tom Christie All rights reserved.
Descriptive HTTP status codes, for code readability.
See RFC 2616 - http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
And RFC 6585 - http://tools.ietf.o... | """
source: https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/status.py
Copyright (c) 2011-2015, Tom Christie All rights reserved.
Descriptive HTTP status codes, for code readability.
See RFC 2616 - http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
And RFC 6585 - http://tools.ietf.o... | bsd-2-clause | Python |
a1cfc32e7a8774570585b3964cebf026d589f596 | update version | obestwalter/loslassa,obestwalter/loslassa | loslassa/__init__.py | loslassa/__init__.py | __version__ = "0.3.8"
| __version__ = "0.3.7"
| bsd-3-clause | Python |
24c967d0802a24a605db3ce9c062a0a543174efa | Fix genbank.get indentation | igboyes/virtool,virtool/virtool,igboyes/virtool,virtool/virtool | virtool/api/genbank.py | virtool/api/genbank.py | """
Provides request handlers for managing and viewing analyses.
"""
import aiohttp
import aiohttp.client_exceptions
import virtool.genbank
import virtool.http.proxy
import virtool.http.routes
from virtool.api.utils import bad_gateway, json_response, not_found
routes = virtool.http.routes.Routes()
@routes.get("/ap... | """
Provides request handlers for managing and viewing analyses.
"""
import aiohttp
import aiohttp.client_exceptions
import virtool.genbank
import virtool.http.proxy
import virtool.http.routes
from virtool.api.utils import bad_gateway, json_response, not_found
routes = virtool.http.routes.Routes()
@routes.get("/ap... | mit | Python |
6665a6ebdd30da7543cd8868618132ee601ce88f | Update waflib/extras/stale.py | hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR,hlange/LogSoCR | waflib/extras/stale.py | waflib/extras/stale.py | #! /usr/bin/env python
# encoding: UTF-8
# Thomas Nagy, 2006-2015 (ita)
"""
Add a pre-build hook to remove build files (declared in the system)
that do not have a corresponding target
This can be used for example to remove the targets
that have changed name without performing
a full 'waf clean'
Of course, it will on... | #! /usr/bin/env python
# encoding: UTF-8
# Thomas Nagy, 2006-2015 (ita)
"""
Add a pre-build hook to remove build files (declared in the system)
that do not have a corresponding target
This can be used for example to remove the targets
that have changed name without performing
a full 'waf clean'
Of course, it will on... | agpl-3.0 | Python |
c6aeef140bb82a75c0671a14e9719d0a8b19b9ce | Bump version | open-synergy/opensynid-fleet | fleet_work_order/__openerp__.py | fleet_work_order/__openerp__.py | # -*- coding: utf-8 -*-
# © 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Fleet Work Order",
"version": "8.0.2.1.0",
"category": "Fleet",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
"license": "AG... | # -*- coding: utf-8 -*-
# © 2016 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Fleet Work Order",
"version": "8.0.2.0.0",
"category": "Fleet",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
"license": "AG... | agpl-3.0 | Python |
62e3e3459a4bf9757f95ea4adfe7bf562d79e9b6 | Handle escaping characters outside the BMP | jwodder/javaproperties | javaproperties/writing.py | javaproperties/writing.py | from __future__ import unicode_literals
from collections import Mapping
import re
def write_properties(props, fp, separator='='):
### Add arguments for comment and/or timestamp
if isinstance(props, Mapping):
items = (k, props[k] for k in props)
else:
items = props
for k,v in items:... | from __future__ import unicode_literals
from collections import Mapping
import re
def write_properties(props, fp, separator='='):
### Add arguments for comment and/or timestamp
if isinstance(props, Mapping):
items = (k, props[k] for k in props)
else:
items = props
for k,v in items:... | mit | Python |
2720e6eba9a68f339187236e16f5e6a13993afaf | Bump version | koodilehto/website-poller,koodilehto/website-poller | websitepoller/__init__.py | websitepoller/__init__.py | # -*- coding: utf-8 -*-
__author__ = 'Koodilehto osk.'
__version__ = '0.5.5'
from poller import run
| # -*- coding: utf-8 -*-
__author__ = 'Koodilehto osk.'
__version__ = '0.5.4'
from poller import run
| mit | Python |
3d1521892ba17120ca4461335713b9d2254311fe | Add tests for the clustering of cities | walkerke/marble,scities/marble | marble/tests/test_clustering.py | marble/tests/test_clustering.py | """ Tests for the clustering computation """
from nose.tools import *
import itertools
from shapely.geometry import Polygon
import marble as mb
#
# Synthetic data for tests
#
def grid():
""" Areal units arranged in a grid """
au = [i*3+j for i,j in itertools.product(range(3), repeat=2)]
units = {a:Polygo... | """ Tests for the clustering computation """
from nose.tools import *
import marble as mb
# Test c = 0 in the checkerboard case
# Test c = 1 in the fully clustered case
# Test an intermediate situation with known result
| bsd-3-clause | Python |
9fcfdafb1ce01417bb07a9ed5557a5b44e706bcb | Convert to reuse JWT | samcheck/PyMedia,samcheck/PyMedia,samcheck/PyMedia | tv_namer.py | tv_namer.py | #!/usr/bin/python3
# tv_namer.py - Renames passed media files of TV shows
import shutil
import os
import sys
import logging
import videoLister
import scrapeTVDB
import regSplit
logger = logging.getLogger(__name__)
logging.basicConfig(filename='tv_namer.log',level=logging.DEBUG,
format='%(asctime)... | #!/usr/bin/python3
# tv_namer.py - Renames passed media files of TV shows
import shutil
import os
import sys
import logging
import videoLister
import scrapeTVDB
import regSplit
logger = logging.getLogger(__name__)
logging.basicConfig(filename='tv_namer.log',level=logging.DEBUG,
format='%(asctime)... | mit | Python |
7d827ac23bb81b09d64234c0f832492967f9d5bd | add ‘on_delete’ to the Cart’s address fields | awesto/django-shop,nimbis/django-shop,divio/django-shop,nimbis/django-shop,divio/django-shop,awesto/django-shop,nimbis/django-shop,nimbis/django-shop,awesto/django-shop,divio/django-shop | shop/models/defaults/cart.py | shop/models/defaults/cart.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db.models import SET_DEFAULT
from shop import deferred
from shop.models.address import BaseShippingAddress, BaseBillingAddress
from shop.models.cart import BaseCart
class Cart(BaseCart):
"""
Default materialized model for BaseCart c... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from shop import deferred
from shop.models.address import BaseShippingAddress, BaseBillingAddress
from shop.models.cart import BaseCart
class Cart(BaseCart):
"""
Default materialized model for BaseCart containing common fields
"""
shippin... | bsd-3-clause | Python |
561bdb08e10adc625e34644fd9d60a48a7faf8a2 | update main.py | picklecai/OMOOC2py,picklecai/OMOOC2py | _src/om2py7w/7wex0/main.py | _src/om2py7w/7wex0/main.py | # _*_ coding:utf-8 _*_
#qpy:webapp:simple notebook
#qpy:fullscreen
#qpy://localhost:8800
"""
简易笔记本app
@Author Picklecai
"""
from bottle import *
import os
import sqlite3
import time
ASSETS = "/assets/"
ROOT = os.path.dirname(os.path.abspath(__file__))
class MyWSGIRefServer(ServerAdapter):
server = None
def... | # _*_ coding:utf-8 _*_
#qpy:webapp:simple notebook
#qpy:fullscreen
#qpy://localhost:8800
"""
简易笔记本app
@Author Picklecai
"""
from bottle import *
import os
import sqlite3
ASSETS = "/assets/"
ROOT = os.path.dirname(os.path.abspath(__file__))
class MyWSGIRefServer(ServerAdapter):
server = None
def run(self, ... | mit | Python |
da85e11965f09bb7f490931aa6c83290b63b0979 | Make a real __init__.py for evelink | bastianh/evelink,ayust/evelink,zigdon/evelink,Morloth1274/EVE-Online-POCO-manager,FashtimeDotCom/evelink | evelink/__init__.py | evelink/__init__.py | """EVELink - Python bindings for the EVE API."""
from evelink import account
from evelink import api
from evelink import char
from evelink import constants
from evelink import corp
from evelink import eve
from evelink import map
from evelink import parsing
from evelink import server
__all__ = [
"account",
"api",
... | mit | Python | |
383d17542bcd65474238add31b3511c25919df73 | refactor removing error treatment on thumbnail creation | mcolom/ipolDevel,mcolom/ipolDevel,mcolom/ipolDevel,mcolom/ipolDevel | ipol_demo/lib/ipolutils/utils.py | ipol_demo/lib/ipolutils/utils.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# GNU General Public Licence (GPL)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# GNU General Public Licence (GPL)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later... | agpl-3.0 | Python |
1bea419237c5822a0a7e5161b7d0d92418573de3 | fix discussion_module after merging from MITx/mitx | kmoocdev/edx-platform,peterm-itr/edx-platform,beacloudgenius/edx-platform,JCBarahona/edX,motion2015/a3,andyzsf/edx,nanolearningllc/edx-platform-cypress-2,praveen-pal/edx-platform,eduNEXT/edunext-platform,peterm-itr/edx-platform,kursitet/edx-platform,mjirayu/sit_academy,abdoosh00/edraak,4eek/edx-platform,halvertoluke/ed... | common/lib/xmodule/xmodule/discussion_module.py | common/lib/xmodule/xmodule/discussion_module.py | from lxml import etree
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
import comment_client
import dateutil
from dateutil.tz import tzlocal
from datehelper import time_ago_in_words
import json
class DiscussionModule(XModule):
def get_html(self):
context = {
... | from lxml import etree
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
import comment_client
import dateutil
from dateutil.tz import tzlocal
from datehelper import time_ago_in_words
import json
class DiscussionModule(XModule):
def get_html(self):
context = {
... | agpl-3.0 | Python |
5b867463109563468dbdb1a2bea4304412178224 | Fix _router issue | gawel/panoramisk,gawel/panoramisk | panoramisk/fast_agi.py | panoramisk/fast_agi.py | import logging
from collections import OrderedDict
from .utils import asyncio
from .utils import parse_agi_result
log = logging.getLogger(__name__)
class Request:
def __init__(self, app, headers, reader, writer, encoding='utf-8'):
self.app = app
self.headers = headers
self.reader = reader... | import logging
from collections import OrderedDict
from .utils import asyncio
from .utils import parse_agi_result
log = logging.getLogger(__name__)
class Request:
def __init__(self, app, headers, reader, writer, encoding='utf-8'):
self.app = app
self.headers = headers
self.reader = reader... | mit | Python |
02b4265f70991bb5d6a5f224f31a9699f6e3d386 | change doc | pfnet/chainercv,chainer/chainercv,chainer/chainercv,yuyu2172/chainercv,yuyu2172/chainercv | chainercv/utils/testing/assertions/assert_is_point_dataset.py | chainercv/utils/testing/assertions/assert_is_point_dataset.py | import numpy as np
import six
from chainercv.utils.testing.assertions.assert_is_image import assert_is_image
from chainercv.utils.testing.assertions.assert_is_point import assert_is_point
def assert_is_point_dataset(dataset, n_point=None, n_example=None,
no_visible=False):
"""Checks i... | import numpy as np
import six
from chainercv.utils.testing.assertions.assert_is_image import assert_is_image
from chainercv.utils.testing.assertions.assert_is_point import assert_is_point
def assert_is_point_dataset(dataset, n_point=None, n_example=None,
no_visible=False):
"""Checks i... | mit | Python |
233c5eb25586713deea5d70e7370e3f64661306b | Add UserProfile import in avatar_hash.py. | eeshangarg/zulip,shubhamdhama/zulip,rishig/zulip,jrowan/zulip,brainwane/zulip,vabs22/zulip,rht/zulip,amanharitsh123/zulip,vaidap/zulip,jrowan/zulip,brainwane/zulip,punchagan/zulip,christi3k/zulip,PhilSk/zulip,JPJPJPOPOP/zulip,jainayush975/zulip,souravbadami/zulip,ryanbackman/zulip,susansls/zulip,shubhamdhama/zulip,eesh... | zerver/lib/avatar_hash.py | zerver/lib/avatar_hash.py | from __future__ import absolute_import
from django.conf import settings
from typing import Text
from zerver.lib.utils import make_safe_digest
if False:
# Typing import inside `if False` to avoid import loop.
from zerver.models import UserProfile
import hashlib
def gravatar_hash(email):
# type: (Text) -... | from __future__ import absolute_import
from django.conf import settings
from typing import Text
from zerver.lib.utils import make_safe_digest
import hashlib
def gravatar_hash(email):
# type: (Text) -> Text
"""Compute the Gravatar hash for an email address."""
# Non-ASCII characters aren't permitted by t... | apache-2.0 | Python |
6c5cbc7c29935db177cc8b921b7de1a1a1a21901 | update script_3 | PMEAL/OpenPNM,TomTranter/OpenPNM | example_script_3.py | example_script_3.py | import openpnm as op
import scipy as sp
ws = op.core.Workspace()
ws.settings['local_data'] = True
sp.random.seed(0)
pn = op.network.Cubic(shape=[15, 15, 15], spacing=0.0001, name='pn')
# pn.add_boundaries()
geom = op.geometry.StickAndBall(network=pn, pores=pn.Ps, throats=pn.Ts)
water = op.phases.Water(network=pn)
wa... | import openpnm as op
import scipy as sp
ws = op.core.Workspace()
ws.settings['local_data'] = True
sp.random.seed(0)
pn = op.network.Cubic(shape=[15, 15, 15], spacing=0.0001, name='pn')
# pn.add_boundaries()
geom = op.geometry.StickAndBall(network=pn, pores=pn.Ps, throats=pn.Ts)
water = op.phases.Water(network=pn)
wa... | mit | Python |
efab820fcfff18e3e69db7563d8d81b9b56ae6e1 | Add ``__version__`` | tailhook/zorro | zorro/__init__.py | zorro/__init__.py | from .core import Hub, gethub, Future, Condition, Lock
from contextlib import contextmanager
from functools import wraps
__version__ = '0.2.a0'
__all__ = [
'Hub',
'gethub',
'sleep',
'Future',
'Condition',
'Lock',
]
def sleep(value):
gethub().do_sleep(value)
| from .core import Hub, gethub, Future, Condition, Lock
from contextlib import contextmanager
from functools import wraps
__all__ = [
'Hub',
'gethub',
'sleep',
'Future',
'Condition',
'Lock',
]
def sleep(value):
gethub().do_sleep(value)
| mit | Python |
425fb3507ea479551f06405116917fd7ee470350 | remove setup and teardown of contender. They are now added dynamically | dc-uba/metrika | metrika/contender.py | metrika/contender.py |
class Contender:
def __init__(self, names, values):
self.names = names
self.values = values
def __repr__(self):
strings = tuple(str(v.id()) for v in self.values)
return str(strings) + " contender"
def __getitem__(self, item):
idx = self.index_of(item)
retur... |
class Contender:
def __init__(self, names, values):
self.names = names
self.values = values
def __repr__(self):
strings = tuple(str(v.id()) for v in self.values)
return str(strings) + " contender"
def __getitem__(self, item):
idx = self.index_of(item)
retur... | mit | Python |
917d22e51185315911728eaefc6bc3f0157a03fb | Modify comments to Japanese | aidiary/keras_examples,aidiary/keras_examples | mlp/pima_tutorial.py | mlp/pima_tutorial.py | import os
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
# 参考
# http://machinelearningmastery.com/tutorial-first-neural-network-python-keras/
seed = 7
np.random.seed(seed)
if __name__ == "__main__":
# Pima indians datasetをロード
dataset = np.loadtxt(os.path.join("..", "dat... | import os
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
# http://machinelearningmastery.com/tutorial-first-neural-network-python-keras/
seed = 7
np.random.seed(seed)
if __name__ == "__main__":
# load pima indians dataset
dataset = np.loadtxt(os.path.join("data", "pima-... | mit | Python |
437d820b066ce9610f13cae65d2e0c6d1807ce2e | Return authenticated server | MatchmakerExchange/reference-server | mme_server/server.py | mme_server/server.py | """
This is a minimum working example of a Matchmaker Exchange server.
It is intended strictly as a useful reference, and should not be
used in a production setting.
"""
from __future__ import with_statement, division, unicode_literals
import logging
import json
from flask import Flask, request, after_this_request, ... | """
This is a minimum working example of a Matchmaker Exchange server.
It is intended strictly as a useful reference, and should not be
used in a production setting.
"""
from __future__ import with_statement, division, unicode_literals
import logging
import json
from flask import Flask, request, after_this_request, ... | mit | Python |
336edddf14d2584ba427038c30e2da91bc6b2774 | check if input is empty in mkdir_p() | alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl | alphatwirl/misc/mkdir_p.py | alphatwirl/misc/mkdir_p.py | # Tai Sakuma <tai.sakuma@gmail.com>
import os, errno
import logging
##__________________________________________________________________||
def mkdir_p(path):
if not path:
return
logger = logging.getLogger(__name__)
# http://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python
... | # Tai Sakuma <tai.sakuma@gmail.com>
import os, errno
import logging
##__________________________________________________________________||
def mkdir_p(path):
logger = logging.getLogger(__name__)
# http://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python
try:
os.makedirs(path)
... | bsd-3-clause | Python |
76fbc3a304a0f059074f6b0e5069f0666947d956 | Remove testing scaffold | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | custom/enikshay/management/commands/get_locations_for_bets.py | custom/enikshay/management/commands/get_locations_for_bets.py | import csv
from django.core.management.base import BaseCommand
from corehq.apps.locations.models import SQLLocation
from custom.enikshay.integrations.bets.repeaters import BETSLocationRepeater
from custom.enikshay.integrations.bets.utils import get_bets_location_json
class Command(BaseCommand):
field_names = [
... | import csv
from django.core.management.base import BaseCommand
from corehq.apps.locations.models import SQLLocation
from custom.enikshay.integrations.bets.repeaters import BETSLocationRepeater
from custom.enikshay.integrations.bets.utils import get_bets_location_json
class Command(BaseCommand):
field_names = [
... | bsd-3-clause | Python |
36ac84a0c8967b994242903a4cd404eac33af381 | Remove references to traffic balance | MarauderXtreme/sipa,agdsn/sipa,MarauderXtreme/sipa,MarauderXtreme/sipa,agdsn/sipa,agdsn/sipa,agdsn/sipa | sipa/model/pycroft/schema.py | sipa/model/pycroft/schema.py | # -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
cache: bool
traffic_h... | # -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Optional
from sipa.model.pycroft.unserialize import unserializer
@unserializer
class UserData:
id: int
user_id: str
login: str
name: str
status: UserStatus
room: str
mail: str
cache: bool
traffic_b... | mit | Python |
fbde4d9e1e0e6d5440ee8103d0ef8301f5f32a80 | use linked user id and add avatar | knyghty/harmony | harmony/extensions/lastspoke.py | harmony/extensions/lastspoke.py | import datetime
import discord
from discord.ext import commands
import sqlalchemy as sa
from db.base import Base
class LatestUtterance(Base):
__tablename__ = 'latestutterance'
user_id = sa.Column(sa.String, primary_key=True)
uttered_time = sa.Column(sa.DateTime, default=datetime.datetime.now, onupdate... | import datetime
import discord
from discord.ext import commands
import sqlalchemy as sa
from db.base import Base
class LatestUtterance(Base):
__tablename__ = 'latestutterance'
user_id = sa.Column(sa.String, primary_key=True)
uttered_time = sa.Column(sa.DateTime, default=datetime.datetime.now, onupdate... | apache-2.0 | Python |
093ad75d01ec62017c57d4d59cfc53b472e38456 | Bump version number. | devmessias/gmaps,devmessias/gmaps | gmaps/__init__.py | gmaps/__init__.py |
from gmaps.loader import init
from gmaps.heatmap import heatmap
from gmaps.plainmap import plainmap
import gmaps.datasets as datasets
from IPython.display import display
__version__ = "0.2.0"
init()
|
from gmaps.loader import init
from gmaps.heatmap import heatmap
from gmaps.plainmap import plainmap
import gmaps.datasets as datasets
from IPython.display import display
__version__ = "0.2.0-dev"
init()
| bsd-3-clause | Python |
b303feb0378ad3eb653b7de923c6fb458f9a0845 | add documentation | francois-berder/PyLetMeCreate | letmecreate/core/gpio_monitor.py | letmecreate/core/gpio_monitor.py | #!/usr/bin/env python3
"""Python binding of gpio_monitor wrapper of LetMeCreate library."""
import ctypes
_LIB = ctypes.CDLL('libletmecreate_core.so')
_CALLBACK_TYPE = ctypes.CFUNCTYPE(None, ctypes.c_uint8)
_CALLBACKS = {}
# GPIO events
GPIO_RAISING = 0x01
GPIO_FALLING = 0x02
GPIO_EDGE = GPIO_RAISING | GPIO_FALLING
... | #!/usr/bin/env python3
import ctypes
_LIB = ctypes.CDLL('libletmecreate_core.so')
_CALLBACK_TYPE = ctypes.CFUNCTYPE(None, ctypes.c_uint8)
_CALLBACKS = {}
# GPIO events
GPIO_RAISING = 0x01
GPIO_FALLING = 0x02
GPIO_EDGE = GPIO_RAISING | GPIO_FALLING
def init():
global _CALLBACKS
ret = _LIB.gpio_monitor_init(... | bsd-3-clause | Python |
2dfaf6fbd7428d41c47e7966bf089285cdcc51d1 | Update weekly_player_stats.py - still horribly broken but added a TODO that might help me remember how to fix it | prcutler/nflpool,prcutler/nflpool | weekly_player_stats.py | weekly_player_stats.py | import json
# Change the name of the file to open to match the query below:
with open('json/20161018-cumulative-player-stats.json') as file:
alltext = file.readlines() # Put each line into a list
v = 0 # Rushing
w = 0 # Receiving
x = 0 # Passing
y = 0 # Sacks
z = 0 # Interceptions
for lines in alltext:
... | import json
# Change the name of the file to open to match the query below:
with open('json/20161018-cumulative-player-stats.json') as file:
alltext = file.readlines() # Put each line into a list
v = 0 # Rushing
w = 0 # Receiving
x = 0 # Passing
y = 0 # Sacks
z = 0 # Interceptions
for lines in alltext:
... | mit | Python |
2ceb6fba736a9fa7a8ee8cc2a6f0904f642c31be | Update context_processors.py | 20tab/twentytab_project,20tab/twentytab_project,20tab/twentytab_project | commons/context_processors.py | commons/context_processors.py | from os import environ
from {{ project_name }} import __version__
import uuid
def metainfo(request):
current_id = unicode(uuid.uuid4())
metainfo = {
'uuid': current_id,
'version': version,
'static_version': "?v={}".format(current_id),
'branch': environ.get('BRANCH', None)
}... | from os import environ
from {{ project_name }} import __version__
import uuid
def metainfo(request):
metainfo = {
'uuid': unicode(uuid.uuid4()),
'version': __version__,
'static_version': "?v={}".format(uuid),
'branch': environ['BRANCH']
}
return metainfo
| mit | Python |
6a63028079fa3360c7495ea08e2d1d2f9f69dd3a | Remove vendor\brightray prefix | shiftkey/electron,the-ress/electron,electron/electron,rajatsingla28/electron,the-ress/electron,Floato/electron,bpasero/electron,bpasero/electron,bpasero/electron,rajatsingla28/electron,the-ress/electron,rreimann/electron,rreimann/electron,wan-qy/electron,tonyganch/electron,shiftkey/electron,miniak/electron,electron/ele... | script/upload-windows-pdb.py | script/upload-windows-pdb.py | #!/usr/bin/env python
import os
import glob
import sys
from lib.config import s3_config
from lib.util import electron_gyp, execute, rm_rf, safe_mkdir, s3put
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
SYMBOLS_DIR = 'dist\\symbols'
DOWNLOAD_DIR = 'vendor\\download\\libchromiumcontent'
... | #!/usr/bin/env python
import os
import glob
import sys
from lib.config import s3_config
from lib.util import electron_gyp, execute, rm_rf, safe_mkdir, s3put
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
SYMBOLS_DIR = 'dist\\symbols'
DOWNLOAD_DIR = 'vendor\\brightray\\vendor\\download\\li... | mit | Python |
610fb9c9ac6a225df10ec770d44564e61af53ce0 | Use abspath for COPY command | chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations | polling_stations/apps/addressbase/management/commands/import_cleaned_addresses.py | polling_stations/apps/addressbase/management/commands/import_cleaned_addresses.py | import os
import glob
from django.apps import apps
from django.db import connection
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""
Turn off auto system check for all apps
We will maunally run system checks only for the
'addressbase' and 'pollingstations' apps
... | import os
import glob
from django.apps import apps
from django.db import connection
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""
Turn off auto system check for all apps
We will maunally run system checks only for the
'addressbase' and 'pollingstations' apps
... | bsd-3-clause | Python |
c2f273fc7e98429bfc0c10595bb3f0b9a76d9906 | Update P01_birthdays.py added docstrings and wrapped in main() function | JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials | pythontutorials/books/AutomateTheBoringStuffWithPython/Chapter05/P01_birthdays.py | pythontutorials/books/AutomateTheBoringStuffWithPython/Chapter05/P01_birthdays.py | """Birthdays
This program makes a birthday database using a :obj:`dict`.
"""
def main():
birthdays = {'Alice': 'Apr 1', 'Bob': 'Dec 12', 'Carol': 'Mar 4'}
"""dict: Birthdays with first name as keys and `month day` as values."""
while True:
print('Enter a name: (blank to quit)')
name = i... | # This program makes a birthday database
birthdays = {'Alice': 'Apr 1', 'Bob': 'Dec 12', 'Carol': 'Mar 4'}
while True:
print('Enter a name: (blank to quit)')
name = input()
if name == '':
break
if name in birthdays:
print(birthdays[name] + ' is the birthday of ' + name)
else:
... | mit | Python |
691f2f3dfc44f2046c4a5222fe46f6de3a33e8b1 | Change definition of Minecraft Ops. | toffer/minecloud-ami,toffer/minecloud-ami | modules/msm_backup_restore/files/bin/msm-update-auth-lists.py | modules/msm_backup_restore/files/bin/msm-update-auth-lists.py | #!/usr/bin/env python
import os
import re
import requests
import sys
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
# Convert from Heroku style DATABASE_URL to Sqlalchemy style, if necessary
db_url = os.environ.get('DATABASE_URL')... | #!/usr/bin/env python
import os
import re
import requests
import sys
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
# Convert from Heroku style DATABASE_URL to Sqlalchemy style, if necessary
db_url = os.environ.get('DATABASE_URL')... | mit | Python |
8563b3853069cd4ff94937f632034b20fc19fc04 | clear ugly whitespace | chillipeper/will,chillipeper/will,chillipeper/will | will/tests/conftest.py | will/tests/conftest.py | import pytest
from will.abstractions import Message, Person
# Any fixtures defined in this file will be automatically imported into
# discovered tests.
# https://docs.pytest.org/en/latest/fixture.html#conftest-py-sharing-fixture-functions
@pytest.fixture()
def person():
"""Mimic person abstraction"""
def _pe... | import pytest
from will.abstractions import Message, Person
# Any fixtures defined in this file will be automatically imported into
# discovered tests.
# https://docs.pytest.org/en/latest/fixture.html#conftest-py-sharing-fixture-functions
@pytest.fixture()
def person():
"""Mimic person abstraction"""
def _p... | mit | Python |
ac0a5c4e9d1734f7b0a62f6c6f94a205371012bb | Improve output when __main__ catch a StagpyError | StagPython/StagPy | stagpy/__main__.py | stagpy/__main__.py | # PYTHON_ARGCOMPLETE_OK
"""The stagpy module is callable"""
import importlib
import signal
import sys
def sigint_handler(*_):
"""SIGINT handler"""
print('\nSo long, and thanks for all the fish.')
sys.exit()
def main():
"""StagPy entry point"""
signal.signal(signal.SIGINT, sigint_handler)
co... | # PYTHON_ARGCOMPLETE_OK
"""The stagpy module is callable"""
import importlib
import signal
import sys
def sigint_handler(*_):
"""SIGINT handler"""
print('\nSo long, and thanks for all the fish.')
sys.exit()
def main():
"""StagPy entry point"""
signal.signal(signal.SIGINT, sigint_handler)
co... | apache-2.0 | Python |
3b7b54539b9bb51c2a46699102882865b42a765d | Make the version 0.1.0 | SyntaxRules/python-starter | starter/starter.py | starter/starter.py | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 <company or person>
#
"""
The entry point for this application.
"""
from __future__ import print_function
__version__ = "0.1.0"
class StartExample(object):
"""
A example class that is the starts this application
"""
def __init__(self):
self.loca... | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 <company or person>
#
"""
The entry point for this application.
"""
from __future__ import print_function
__version__ = "0.2.0"
class StartExample(object):
"""
A example class that is the starts this application
"""
def __init__(self):
self.loca... | mit | Python |
f42e48c42dbac52d01781d448c47852344a12021 | Update Mongo update syntax | ghaff/whitewater-gauges,ghaff/whitewater-gauges | wsgi/usgs_update_01.py | wsgi/usgs_update_01.py | # Parse USGS JSON files
# Populates the sites using the original URL requests
# USGS site doesn't seem to let you just dump everything
# For this purpose we use the hydrological are
# This value goes from 01 to 21 and makes it easy to construct a series of operations
# This version creates a customized dump because Mo... | # Parse USGS JSON files
# Populates the sites using the original URL requests
# USGS site doesn't seem to let you just dump everything
# For this purpose we use the hydrological are
# This value goes from 01 to 21 and makes it easy to construct a series of operations
# This version creates a customized dump because Mo... | mit | Python |
1d8a45299e17fbc5be0950df73b11ca8eec695c8 | Add coverage for pending artifact creation | getsentry/zeus,getsentry/zeus,getsentry/zeus,getsentry/zeus | tests/zeus/web/hooks/test_job_artifacts_hook.py | tests/zeus/web/hooks/test_job_artifacts_hook.py | from io import BytesIO
from zeus import factories
from zeus.models import Artifact, PendingArtifact
def test_new_artifact(client, default_source, default_repo, default_hook, sample_xunit):
build = factories.BuildFactory(
source=default_source,
provider=default_hook.get_provider().get_name(default... | from io import BytesIO
from zeus import factories
from zeus.models import Artifact
def test_new_artifact(client, default_source, default_repo, default_hook, sample_xunit):
build = factories.BuildFactory(
source=default_source,
provider=default_hook.get_provider().get_name(default_hook.config),
... | apache-2.0 | Python |
96e564b196c83ed0a14dc2026579fc190609b30e | Repair migration | ic-labs/django-icekit,ic-labs/icekit-events,ic-labs/icekit-events,ic-labs/django-icekit,ic-labs/icekit-events,ic-labs/django-icekit,ic-labs/django-icekit | icekit_events/plugins/links/migrations/0001_initial.py | icekit_events/plugins/links/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import icekit.fields
class Migration(migrations.Migration):
dependencies = [
('icekit_events', '0008_occurrence_external_ref'),
('fluent_contents', '0001_initial'),
]
operations = [
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import icekit.fields
class Migration(migrations.Migration):
dependencies = [
('icekit_events', '0008_occurrence_external_ref'),
('fluent_contents', '0003_auto_20161021_1441'),
]
oper... | mit | Python |
b556bffeb5ed48812258b452e05cc00cfb160453 | Fix up settings for upstream Girder change | OpenChemistry/mongochemserver | girder/app/app/configuration.py | girder/app/app/configuration.py | from girder.api import access
from girder.api.describe import Description, autoDescribeRoute
from girder.api.rest import Resource, RestException
from girder.constants import AccessType, TokenScope
from girder.models.setting import Setting
from .constants import Features, Deployment, Branding
class Configuration(Resou... | from girder.api import access
from girder.api.describe import Description, autoDescribeRoute
from girder.api.rest import Resource, RestException
from girder.constants import AccessType, TokenScope
from girder.models.setting import Setting
from .constants import Features, Deployment, Branding
class Configuration(Resou... | bsd-3-clause | Python |
e373f17e0f3d3963f59992e6e98247b9923685ca | Add declinaison of a Django app not within a project | Fantomas42/templer.django-project-app | src/templer/django_project_app/__init__.py | src/templer/django_project_app/__init__.py | """templer.django_project_app"""
import os
from templer.core.vars import StringVar
from templer.core.vars import BooleanVar
from templer.core.base import BaseTemplate
from templer.core.structures import Structure
HELP_TEXT = """
This creates a basic skeleton for a Django application within a project.
"""
POST_RUN_M... | """templer.django_project_app"""
import os
from templer.core.vars import StringVar
from templer.core.vars import BooleanVar
from templer.core.base import BaseTemplate
from templer.core.structures import Structure
HELP_TEXT = """
This creates a basic skeleton for a Django application within a project.
"""
POST_RUN_M... | bsd-3-clause | Python |
f8b84bd165c675f8ee48e72098473982451542b8 | Disable sqlalch echo mode | hackeriet/nfcd,hackeriet/pyhackeriet,hackeriet/nfcd,hackeriet/pyhackeriet,hackeriet/pyhackeriet,hackeriet/nfcd | hackeriet/web/brusweb/brusdb.py | hackeriet/web/brusweb/brusdb.py |
# New quick and dirty DB interface
# TODO make use of the orm
from sqlalchemy import *
#engine = create_engine('sqlite:///door.db', echo=True)
engine = create_engine('postgresql://brus:brus@localhost/brus')
meta = MetaData()
users = Table("users", meta, autoload=True, autoload_with=engine)
transactions = Table("tr... |
# New quick and dirty DB interface
# TODO make use of the orm
from sqlalchemy import *
#engine = create_engine('sqlite:///door.db', echo=True)
engine = create_engine('postgresql://brus:brus@localhost/brus', echo=True)
meta = MetaData()
users = Table("users", meta, autoload=True, autoload_with=engine)
transactions ... | apache-2.0 | Python |
47858b4878e5f3cf1a28800c3b312373c32349de | increment version | gbrammer/grizli | grizli/version.py | grizli/version.py | # git describe --tags
__version__ = "0.7.0-41-g39ad8ff"
| # git describe --tags
__version__ = "0.7.0-39-g541f549"
| mit | Python |
e5ece0eff84de7fa9556fc0ead83354350f5cba8 | increment version | albertfxwang/grizli | grizli/version.py | grizli/version.py | # git describe --tags
__version__ = "0.6.0-180-g07764ba"
| # git describe --tags
__version__ = "0.6.0-172-gded0ced"
| mit | Python |
7049472e06b1e6e23d2317496a0fdb708a1e7e34 | tag v0.3.1 | alexsavio/hansel | hansel/version.py | hansel/version.py | # License: New BSD
"""
Unique version information place
"""
__version__ = "0.3.1"
VERSION = tuple(int(x) for x in __version__.split("."))
| # License: New BSD
"""
Unique version information place
"""
__version__ = "0.3.0"
VERSION = tuple(int(x) for x in __version__.split("."))
| apache-2.0 | Python |
e4317a89aaff7257b9f51a3b1984c7be9482a6ca | Allow modifying forums in admin panel. | xfix/NextBoard | forum/admin.py | forum/admin.py | from django.contrib import admin
from forum.models import Forum
admin.site.register(Forum)
| from django.contrib import admin
# Register your models here.
| mit | Python |
dba53763ac0a7f7b6223c7ce94023adcbb35ef28 | fix preferred lastname migration (#3046) | RCOS-Grading-Server/HWserver,Submitty/Submitty,RCOS-Grading-Server/HWserver,RCOS-Grading-Server/HWserver,Submitty/Submitty,RCOS-Grading-Server/HWserver,Submitty/Submitty,RCOS-Grading-Server/HWserver,RCOS-Grading-Server/HWserver,Submitty/Submitty,Submitty/Submitty,RCOS-Grading-Server/HWserver,Submitty/Submitty,Submitty/... | migration/migrations/course/20180919174325_user_preferred_lastname.py | migration/migrations/course/20180919174325_user_preferred_lastname.py | def up(config, conn, semester, course):
with conn.cursor() as cursor:
cursor.execute("SELECT * FROM users LIMIT 0")
colnames = [desc[0] for desc in cursor.description]
if 'user_preferred_lastname' not in colnames:
cursor.execute('ALTER TABLE users ADD COLUMN user_preferred_lastna... | def up(config, conn, semester, course):
with conn.cursor() as cursor:
cursor.execute("ALTER TABLE ONLY users ADD COLUMN IF NOT EXISTS user_preferred_lastname character varying;")
def down(config, conn, semester, course):
with conn.cursor() as cursor:
cursor.execute("ALTER TABLE ONLY users DROP... | bsd-3-clause | Python |
da8626ed43b156692bdfff87b04c9ecec3b4dac0 | remove test | quinoescobar/keystoneauth-oidc-refreshtoken | keystoneauth_oidc_refreshtoken/tests/unit/test_oidc.py | keystoneauth_oidc_refreshtoken/tests/unit/test_oidc.py | # coding=utf-8
# Copyright 2017 JOSÉ JOAQUÍN ESCOBAR GÓMEZ
# File: test_oidc.py
# Description:
#
# 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/license... | # coding=utf-8
# Copyright 2017 JOSÉ JOAQUÍN ESCOBAR GÓMEZ
# File: test_oidc.py
# Description:
#
# 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/license... | apache-2.0 | Python |
f8193b24195be2fe68d8e8f8f5f0007bb4da5ce0 | Bump version to 5.1.0rc3 | platformio/platformio,platformio/platformio-core,platformio/platformio-core | platformio/__init__.py | platformio/__init__.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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... | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 |
c5f6f408b70fa795ec759247835b8e545109be4b | Bump version to 3.2.0a3 | platformio/platformio-core,platformio/platformio-core,platformio/platformio | platformio/__init__.py | platformio/__init__.py | # Copyright 2014-present PlatformIO <contact@platformio.org>
#
# 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 applicabl... | # Copyright 2014-present PlatformIO <contact@platformio.org>
#
# 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 applicabl... | apache-2.0 | Python |
3928cb522e4563c8c59d27a601de1159d9515fdd | Bump version to 6.1.0b2 | platformio/platformio-core,platformio/platformio-core | platformio/__init__.py | platformio/__init__.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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... | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 |
2d47bb84c1d5a80072de19b129ed86869350de8b | Return tuple insteead of list of parameters * Fix: get_params_view to return a tuple when asking for a split view so the function return value can be caught in one variable. | punalpatel/st2,jtopjian/st2,pinterb/st2,grengojbo/st2,peak6/st2,armab/st2,grengojbo/st2,nzlosh/st2,Plexxi/st2,Plexxi/st2,pixelrebel/st2,pinterb/st2,dennybaa/st2,Itxaka/st2,Plexxi/st2,lakshmi-kannan/st2,emedvedev/st2,tonybaloney/st2,alfasin/st2,alfasin/st2,alfasin/st2,emedvedev/st2,Plexxi/st2,lakshmi-kannan/st2,dennybaa... | st2actions/st2actions/utils/param_utils.py | st2actions/st2actions/utils/param_utils.py | import copy
def _merge_param_meta_values(action_meta=None, runner_meta=None):
runner_meta_keys = runner_meta.keys() if runner_meta else []
action_meta_keys = action_meta.keys() if action_meta else []
all_keys = set(runner_meta_keys).union(set(action_meta_keys))
merged_meta = {}
# ?? Runner immut... | import copy
def _merge_param_meta_values(action_meta=None, runner_meta=None):
runner_meta_keys = runner_meta.keys() if runner_meta else []
action_meta_keys = action_meta.keys() if action_meta else []
all_keys = set(runner_meta_keys).union(set(action_meta_keys))
merged_meta = {}
# ?? Runner immut... | apache-2.0 | Python |
22dc160a2a76797c2c7056127e6baa0405fb3772 | Add target to substitute vars for CLI handler #38 | klen/graphite-beacon,pirogoeth/graphite-beacon,YuriyIlyin/graphite-beacon,boomtrain/graphite-beacon,ViaSat/graphite-beacon,klen/graphite-beacon,fried-sausage/graphite-beacon,boomtrain/graphite-beacon,tpeng/graphite-beacon,gcochard/graphite-beacon,peterkshultz/graphite-beacon,ViaSat/graphite-beacon,OnBloom/graphite-beac... | graphite_beacon/handlers/cli.py | graphite_beacon/handlers/cli.py | import subprocess
from . import AbstractHandler, LOGGER
class CliHandler(AbstractHandler):
name = 'cli'
# Default options
defaults = {
'command': None,
'alerts_whitelist': [],
}
def init_handler(self):
self.commandTemplate = self.options.get('command')
self.whit... | import subprocess
from . import AbstractHandler, LOGGER
class CliHandler(AbstractHandler):
name = 'cli'
# Default options
defaults = {
'command': None,
'alerts_whitelist': [],
}
def init_handler(self):
self.commandTemplate = self.options.get('command')
self.whit... | mit | Python |
56aab94e3a4ca53cd55027a30e07111dc6bd0b6a | Fix - CuReSim_eval | karel-brinda/smbl,karel-brinda/smbl | smbl/prog/plugins/curesim.py | smbl/prog/plugins/curesim.py | import smbl
import snakemake
import os
import _program
CURESIM = _program.get_bin_file_path("CuReSim.jar")
CURESIM_EVAL = _program.get_bin_file_path("CuReSimEval.jar")
##########################################
##########################################
class CuReSim(_program.Program):
@classmetho... | import smbl
import snakemake
import os
import _program
CURESIM = _program.get_bin_file_path("CuReSim.jar")
CURESIM_EVAL = _program.get_bin_file_path("CuReSimEval.jar")
##########################################
##########################################
class CuReSim(_program.Program):
@classmetho... | mit | Python |
a242100ccbeb1f647e9778ea853da40a2420e56a | Fix KeyError when getting fedmsg message info. | fedora-infra/fedimg,fedora-infra/fedimg | fedimg/consumers.py | fedimg/consumers.py | #!/bin/env python
# -*- coding: utf8 -*-
import fedmsg.consumers
import fedmsg.encoding
import fedimg.uploader
class KojiConsumer(fedmsg.consumers.FedmsgConsumer):
# To our knowledge, all *image* builds appear under this
# exact topic, along with scratch builds.
topic = 'org.fedoraproject.prod.buildsys.... | #!/bin/env python
# -*- coding: utf8 -*-
import fedmsg.consumers
import fedmsg.encoding
import fedimg.uploader
class KojiConsumer(fedmsg.consumers.FedmsgConsumer):
# To our knowledge, all *image* builds appear under this
# exact topic, along with scratch builds.
topic = 'org.fedoraproject.prod.buildsys.... | agpl-3.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.