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
0ac28421fe8ed4234db13ebdbb95c700191ba042
Remove spaces from hash tag links
devfort/bugle,devfort/bugle,simonw/bugle_project,devfort/bugle,simonw/bugle_project
bugle_project/bugle/templatetags/bugle.py
bugle_project/bugle/templatetags/bugle.py
from django import template from django.contrib.auth.models import User from django.utils.safestring import mark_safe import re import urllib register = template.Library() username_re = re.compile('@[0-9a-zA-Z]+') hashtag_re = re.compile('(^|\s)(#\S+)') @register.filter def buglise(s): s = unicode(s) us...
from django import template from django.contrib.auth.models import User from django.utils.safestring import mark_safe import re import urllib register = template.Library() username_re = re.compile('@[0-9a-zA-Z]+') hashtag_re = re.compile('(?:^|\s)(#\S+)') @register.filter def buglise(s): s = unicode(s) ...
bsd-2-clause
Python
a9ad46f143ad9223409149c7b22abafaef7f6d21
use admin.register decorator
geometalab/osmaxx,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/drf-utm-zone-info,geometalab/drf-utm-zone-info,geometalab/osmaxx-frontend
web_frontend/osmaxx/excerptexport/admin.py
web_frontend/osmaxx/excerptexport/admin.py
from django.contrib import admin from django.utils.safestring import mark_safe from osmaxx.excerptexport.models import BBoxBoundingGeometry, OsmosisPolygonFilterBoundingGeometry from osmaxx.excerptexport.models import Excerpt, ExtractionOrder, OutputFile class BBoxBoundingGeometryAdmin(admin.ModelAdmin): list_di...
from django.contrib import admin from django.utils.safestring import mark_safe from osmaxx.excerptexport.models import BBoxBoundingGeometry, OsmosisPolygonFilterBoundingGeometry from osmaxx.excerptexport.models import Excerpt, ExtractionOrder, OutputFile class BBoxBoundingGeometryAdmin(admin.ModelAdmin): list_di...
mit
Python
b612ad22834e9755412c9f565f317519518656bf
Fix simplechrome schedulers.
eunchong/build,eunchong/build,eunchong/build,eunchong/build
masters/master.chromium.chromiumos/master_chromiumos_simplechrome_cfg.py
masters/master.chromium.chromiumos/master_chromiumos_simplechrome_cfg.py
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from master.factory import annotator_factory from buildbot.schedulers.basic import SingleBranchScheduler m_annotator = annotator_factory.AnnotatorFactory()...
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from master.factory import annotator_factory from buildbot.schedulers.basic import SingleBranchScheduler m_annotator = annotator_factory.AnnotatorFactory()...
bsd-3-clause
Python
a86626bb92d35d268051fc78f163609c8639c02f
Add test to check that plotly_ssl_verification setting gets set.
plotly/plotly.py,ee-in/python-api,ee-in/python-api,plotly/python-api,plotly/plotly.py,plotly/python-api,plotly/plotly.py,plotly/python-api,ee-in/python-api
plotly/tests/test_core/test_plotly/test_credentials.py
plotly/tests/test_core/test_plotly/test_credentials.py
from unittest import TestCase import plotly.plotly.plotly as py import plotly.tools as tls def test_get_credentials(): if 'username' in py._credentials: del py._credentials['username'] if 'api_key' in py._credentials: del py._credentials['api_key'] creds = py.get_credentials() file_cre...
from unittest import TestCase import plotly.plotly.plotly as py import plotly.tools as tls def test_get_credentials(): if 'username' in py._credentials: del py._credentials['username'] if 'api_key' in py._credentials: del py._credentials['api_key'] creds = py.get_credentials() file_cre...
mit
Python
fdc9f7fabab770cf31a0351108eac18e1a5a4289
Store SMART values
eReuse/DeviceHub,eReuse/DeviceHub
ereuse_devicehub/resources/event/device/test_hard_drive/settings.py
ereuse_devicehub/resources/event/device/test_hard_drive/settings.py
from ereuse_devicehub.resources.event.device.settings import EventSubSettingsOneDevice, \ EventWithOneDevice, parent_materialized class TestHardDrive(EventWithOneDevice): """ We decided to take these specific SMART values because of https://www.backblaze.com/blog/hard-drive-smart-stats/. """ t...
from ereuse_devicehub.resources.event.device.settings import parent_materialized, EventWithOneDevice, \ EventSubSettingsOneDevice class TestHardDrive(EventWithOneDevice): type = { 'type': 'string', # 'allowed': ['Short Offline', 'Extended Offline'] } status = { 'type': 'string'...
agpl-3.0
Python
7834a0182b96cc372d50fc58eefcbdaeceb71e3d
Update move_credit_limit_to_customer_credit_limit.py
gsnbng/erpnext,gsnbng/erpnext,gsnbng/erpnext,gsnbng/erpnext
erpnext/patches/v12_0/move_credit_limit_to_customer_credit_limit.py
erpnext/patches/v12_0/move_credit_limit_to_customer_credit_limit.py
# Copyright (c) 2019, Frappe and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): ''' Move credit limit and bypass credit limit to the child table of customer credit limit ''' frappe.reload_doc("Selling", "doctype", "Customer...
# Copyright (c) 2019, Frappe and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): ''' Move credit limit and bypass credit limit to the child table of customer credit limit ''' frappe.reload_doc("Selling", "doctype", "Customer...
agpl-3.0
Python
e97310e315e95eef0901f0238a1e9cce012f54a0
Store ticket quantity on ticket bundle creation
m-ober/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps,m-ober/byceps,homeworkprod/byceps
byceps/services/ticket/models/ticket_bundle.py
byceps/services/ticket/models/ticket_bundle.py
# -*- coding: utf-8 -*- """ byceps.services.ticket.models.ticket_bundle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2016 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from datetime import datetime from ....database import db, generate_uuid from ....util.instances import ...
# -*- coding: utf-8 -*- """ byceps.services.ticket.models.ticket_bundle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2016 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from datetime import datetime from ....database import db, generate_uuid from ....util.instances import ...
bsd-3-clause
Python
ac1a10bb90ef8c81a853b78bf7acd40772966fe5
Use page-size not pageSize instead of limit (#430)
guardian/alerta,guardian/alerta,guardian/alerta,guardian/alerta
alerta/utils/paging.py
alerta/utils/paging.py
from flask import current_app from alerta.exceptions import ApiError class Page(object): def __init__(self, page=1, page_size=None, items=0): self.page = page self.page_size = page_size or current_app.config['DEFAULT_PAGE_SIZE'] self.items = items if items and self.page > self...
from flask import current_app from alerta.exceptions import ApiError class Page(object): def __init__(self, page=1, page_size=None, items=0): self.page = page self.page_size = page_size or current_app.config['DEFAULT_PAGE_SIZE'] self.items = items if items and self.page > self...
apache-2.0
Python
fd12d4131dcf2277afd277c991a42fa475a1c097
Tidy up pir-status.py
ilkkajylha/office-iot,ilkkajylha/office-iot
pir-status.py
pir-status.py
#!/usr/bin/env python """ Python source code - This python script reads pir state from arduino and makes it available via http(s). WIP """ # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 import serial, argparse, os, time # Parse arguments parser = argparse.ArgumentParser() # example: parser.add_argument('-', ...
#!/usr/bin/env python """ Python source code - This python script reads pir state from arduino and makes it available via http(s). WIP """ # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 import serial, argparse, os, time # Parse arguments parser = argparse.ArgumentParser() # example: parser.add_argument('-'...
mit
Python
65a3b6725ab03ab585ab66195c27368d349bfaa9
Add invited to event creation
DavidJFelix/hatchit,DavidJFelix/hatchit,DavidJFelix/hatchit
src/event_manager/views/api.py
src/event_manager/views/api.py
from django.shortcuts import render import json from django.http import HttpResponse from event_manager.models import Suggestion, Event, Invite from django.contrib.auth.models import User def api_get(request, type="e"): if type == "e": # data = Event.objects.values() # return render(request, 'api.html', {'data...
from django.shortcuts import render import json from django.http import HttpResponse from event_manager.models import Suggestion, Event, Invite from django.contrib.auth.models import User def api_get(request, type="e"): if type == "e": # data = Event.objects.values() # return render(request, 'api.html', {'data...
agpl-3.0
Python
b89a93faae8237561181f3d22b164de5b6dc728c
Remove unused imports. (#4083)
keras-team/keras,keras-team/keras,dolaameng/keras
examples/imdb_cnn_lstm.py
examples/imdb_cnn_lstm.py
'''Train a recurrent convolutional network on the IMDB sentiment classification task. Gets to 0.8498 test accuracy after 2 epochs. 41s/epoch on K520 GPU. ''' from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility from keras.preprocessing import sequence from keras.models ...
'''Train a recurrent convolutional network on the IMDB sentiment classification task. Gets to 0.8498 test accuracy after 2 epochs. 41s/epoch on K520 GPU. ''' from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility from keras.preprocessing import sequence from keras.models ...
apache-2.0
Python
6d5961628cdfa1b54e2290edc73e112ee5ca236f
Update sliv.py
RigFox/VK_chatrename,RigFox/VK_chatrename
sliv.py
sliv.py
# -*- coding: utf-8 -*- from setting.setting import VK_API_TOKEN from setting.setting import VK_CHAT_ID import requests import datetime import logging logger = logging.getLogger() logger.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') fh = logging.FileHandler('log/lo...
# -*- coding: utf-8 -*- from setting.setting import VK_API_TOKEN from setting.setting import VK_CHAT_ID import requests import datetime import logging logger = logging.getLogger() logger.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') fh = logging.FileHandler('log/lo...
apache-2.0
Python
d4b00b7d18dc4ea142ba32bbcf3811d27572a1e5
Test Linux
compmonk/playlister
playlister.py
playlister.py
#!/usr/bin/python #20170913:232732 import argparse import os import os.path as osp import sys import subprocess import re from json import loads from urllib import quote class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' INFO = '\033[92m' WARNING = '\033[93m' ERROR = '\033[91m' RESET = '\0...
mit
Python
a508196c65b6d20df4efe3c973827e0579298245
Fix serializing message logs when publishing from stores.
waartaa/ircb
ircb/models/logs.py
ircb/models/logs.py
# -*- coding: utf-8 -*- import datetime import sqlalchemy as sa from ircb.models.lib import Base class BaseLog(object): id = sa.Column(sa.Integer, primary_key=True) hostname = sa.Column(sa.String(100), nullable=False) roomname = sa.Column(sa.String(255), nullable=False) message = sa.Column(sa.Strin...
# -*- coding: utf-8 -*- import datetime import sqlalchemy as sa from ircb.models.lib import Base class BaseLog(object): id = sa.Column(sa.Integer, primary_key=True) hostname = sa.Column(sa.String(100), nullable=False) roomname = sa.Column(sa.String(255), nullable=False) message = sa.Column(sa.Strin...
mit
Python
25a61363ba84a46422ef1a8cec317619d69b60a2
Fix typo
kaichogami/sympy_gamma,bolshoibooze/sympy_gamma,bolshoibooze/sympy_gamma,kaichogami/sympy_gamma,iScienceLuvr/sympy_gamma,kaichogami/sympy_gamma,github4ry/sympy_gamma,debugger22/sympy_gamma,github4ry/sympy_gamma,iScienceLuvr/sympy_gamma,debugger22/sympy_gamma,github4ry/sympy_gamma,bolshoibooze/sympy_gamma,iScienceLuvr/s...
app/templatetags/extra_tags.py
app/templatetags/extra_tags.py
from django import template import urllib register = template.Library() @register.tag(name='make_query') def do_make_query(parser, token): try: tag_name, query = token.split_contents() except ValueError: raise template.TemplateSyntaxError( "%r tag requires a single argument" % token...
from django import template import urllib register = template.Library() @register.tag(name='make_query') def do_make_query(parser, token): try: tag_name, query = token.split_contents() except ValueError: raise template.TemplateSyntaxError( "%r tag requires a single argument" % token...
bsd-3-clause
Python
7a78525bb8cc6176dfbe348e5f95373c1d70628f
Add the checkRecaptcha( req, secret, simple=True ) function
kensonman/webframe,kensonman/webframe,kensonman/webframe
functions.py
functions.py
#-*- coding: utf-8 -*- def getClientIP( req ): ''' Get the client ip address @param req The request; ''' xForwardedFor=req.META.get('HTTP_X_FORWARDED_FOR') if xForwardedFor: ip=xForwardedFor.split(',')[0] else: ip=req.META.get('REMOTE_ADDR') return ip def getBool( val, defVal=False, trueOpts=['YES', 'Y',...
#-*- coding: utf-8 -*- def getClientIP( req ): ''' Get the client ip address ''' xForwardedFor=req.META.get('HTTP_X_FORWARDED_FOR') if xForwardedFor: ip=xForwardedFor.split(',')[0] else: ip=req.META.get('REMOTE_ADDR') return ip def getBool( val, trueOpts=['YES', 'Y', '1', 'TRUE', 'T'] ): ''' Retrieve the...
apache-2.0
Python
7682bff9451a3a5f471ef8f28b905d3ae2b2c92a
Use layout.scalar in test
arsenovic/clifford,arsenovic/clifford
clifford/test/test_multivector_inverse.py
clifford/test/test_multivector_inverse.py
import numpy as np import pytest import clifford as cf class TestClosedForm: @pytest.mark.parametrize('p, q', [ (p, total_dims - p) for total_dims in [1, 2, 3, 4, 5] for p in range(total_dims + 1) ]) def test_hitzer_inverse(self, p, q): Ntests = 100 layout, blades...
import numpy as np import pytest import clifford as cf class TestClosedForm: @pytest.mark.parametrize('p, q', [ (p, total_dims - p) for total_dims in [1, 2, 3, 4, 5] for p in range(total_dims + 1) ]) def test_hitzer_inverse(self, p, q): Ntests = 100 layout, blades...
bsd-3-clause
Python
02bcb1d8e3766b672688db6d8885fce9e198f526
Remove statsd code
ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend
cla_backend/apps/core/signals.py
cla_backend/apps/core/signals.py
import logging logger = logging.getLogger(__name__) def log_user_created(sender, instance, created, **kwargs): if created: logger.info( "User created", extra={ "USERNAME": instance.username, "IS_STAFF": unicode(instance.is_staff), "I...
import logging from django_statsd.clients import statsd logger = logging.getLogger(__name__) def log_user_created(sender, instance, created, **kwargs): if created: statsd.incr("user.created") logger.info( "User created", extra={ "USERNAME": instance.usern...
mit
Python
db0163e8af75ba22c6ec8d9f582027583e7c482f
use post_config_hook
ultrabug/py3status,tobes/py3status,ultrabug/py3status,tobes/py3status,guiniol/py3status,vvoland/py3status,alexoneill/py3status,guiniol/py3status,ultrabug/py3status,Andrwe/py3status,valdur55/py3status,Andrwe/py3status,valdur55/py3status,valdur55/py3status
py3status/modules/getjson.py
py3status/modules/getjson.py
# -*- coding: utf-8 -*- """ Display JSON data fetched from a URL. This module gets the given `url` configuration parameter and assumes the response is a JSON object. The keys of the JSON object are used as the format placeholders. The format placeholders are replaced by the value. Objects that are nested can be access...
# -*- coding: utf-8 -*- """ Display JSON data fetched from a URL. This module gets the given `url` configuration parameter and assumes the response is a JSON object. The keys of the JSON object are used as the format placeholders. The format placeholders are replaced by the value. Objects that are nested can be access...
bsd-3-clause
Python
7d74e93ad25fe3ada5afa877ed09a0894e01252f
Remove unused import
ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend
cla_backend/apps/status/views.py
cla_backend/apps/status/views.py
from django.db import connection, DatabaseError from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from rest_framework.renderers import JSONRenderer from cla_common.smoketest import smoketest class JSONResponse(HttpResponse): def __init__(self, data, **kwargs): cont...
import os from django.db import connection, DatabaseError from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from rest_framework.renderers import JSONRenderer from cla_common.smoketest import smoketest class JSONResponse(HttpResponse): def __init__(self, data, **kwargs): ...
mit
Python
f2f74f53fe8f5b4ac4cd728c4181b3a66b4e873d
Change problem description so it actually makes sense
josienb/project_euler,josienb/project_euler
euler009.py
euler009.py
# Project Euler # 9 - Special Pythagorean triplet # A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, # a^2 + b^2 = c^2 # # For example, 3^2 + 4^2 = 9 + 16 = 25 = 5^2. # # There exists exactly one Pythagorean triplet for which a + b + c = 1000. # Find the product abc.
# euler 009 # A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, # a^2 + b^2 = c^2 # # For example, 32 + 42 = 9 + 16 = 25 = 52. # # There exists exactly one Pythagorean triplet for which a + b + c = 1000. # Find the product abc.
mit
Python
cdd4989674791c57b872a0188d9478c2af278073
Add mean prediction
johnmartinsson/bird-species-classification,johnmartinsson/bird-species-classification
evaluate.py
evaluate.py
import numpy as np from functools import reduce from bird.models.cuberun import CubeRun from bird import utils from bird import loader nb_classes = 20 input_shape = (257, 512) image_shape = input_shape batch_size=32 def evaluate(model, data_filepath, file2labels_filepath): (X_tests, Y_tests) = loader.load_test...
from models.cuberun import CubeRun import numpy as np import utils import loader nb_classes = 19 input_shape = (257, 509, 1) (cols, rows, chs) = input_shape image_shape = (cols, rows) batch_size=32 def evaluate(model, data_filepath, file2labels_filepath): model.compile(loss='binary_crossentropy', optimizer='adam'...
mit
Python
26b440a0289901207745b2300d3833e0028f047a
use for-loop instead of while-loop
tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler
py_solutions_1-10/Euler_8.py
py_solutions_1-10/Euler_8.py
# find the greatest product of 5 consecutive digits in this 1000 digit number import timeit start = timeit.default_timer() big_num = """73167176531330624919225119674426574742355349194934 96983520312774506326239578318016984801869478851843 85861560789112949495459501737958331952853208805511 ...
# find the greatest product of 5 consecutive digits in this 1000 digit number import timeit start = timeit.default_timer() big_num = """73167176531330624919225119674426574742355349194934 96983520312774506326239578318016984801869478851843 85861560789112949495459501737958331952853208805511 ...
mit
Python
70592355c4977934291bcdfc54bc93d84b262b94
Add basic support.
ryan-roemer/django-cloud-browser,ryan-roemer/django-cloud-browser,UrbanDaddy/django-cloud-browser,ryan-roemer/django-cloud-browser,UrbanDaddy/django-cloud-browser
fabfile.py
fabfile.py
"""Fabric file.""" from fabric.api import cd, local ############################################################################### # Constants ############################################################################### MOD = "cloud_browser" PROJ = "cloud_browser_project" CHECK_INCLUDES = ( "fabfile.py", MOD,...
"""Fabric file.""" from fabric.api import cd, local ############################################################################### # Constants ############################################################################### MOD = "cloud_browser" PROJ = "cloud_browser_project" PYLINT_INCLUDES = ( "fabfile.py", MOD...
mit
Python
96b92ca853f2d937b81cfb1522fe201fa5c593c3
Bump version to 0.2.3
xrmx/django-skebby
django_skebby/__init__.py
django_skebby/__init__.py
__version__ = '0.2.3'
__version__ = '0.2.2'
bsd-3-clause
Python
d0be18d4ca82771082c442c5f419704806ebd412
Fix python3 incompatibility in table test
dwillmer/blaze,jcrist/blaze,maxalbert/blaze,scls19fr/blaze,cowlicks/blaze,nkhuyu/blaze,jdmcbr/blaze,alexmojaki/blaze,cowlicks/blaze,ChinaQuants/blaze,jdmcbr/blaze,cpcloud/blaze,caseyclements/blaze,mrocklin/blaze,alexmojaki/blaze,maxalbert/blaze,jcrist/blaze,dwillmer/blaze,ContinuumIO/blaze,ChinaQuants/blaze,LiaoPan/bla...
blaze/api/tests/test_table.py
blaze/api/tests/test_table.py
from blaze.api.table import Table, compute, table_repr from blaze.data.python import Python from blaze.compute.core import compute from blaze.compute.python import compute from datashape import dshape import pandas as pd data = (('Alice', 100), ('Bob', 200)) t = Table(data, columns=['name', 'amount']) def t...
from blaze.api.table import Table, compute, table_repr from blaze.data.python import Python from blaze.compute.core import compute from blaze.compute.python import compute from datashape import dshape import pandas as pd data = (('Alice', 100), ('Bob', 200)) t = Table(data, columns=['name', 'amount']) def t...
bsd-3-clause
Python
feaeba32c6e3ec1ac354984f55ae96107d5acbdf
Add default value to EnvironmentVariable substitution (#225)
ros2/launch,ros2/launch,ros2/launch
launch/launch/substitutions/environment_variable.py
launch/launch/substitutions/environment_variable.py
# Copyright 2018 Open Source Robotics Foundation, 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...
# Copyright 2018 Open Source Robotics Foundation, 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...
apache-2.0
Python
87f892731678049b5a706a36487982ebb9da3991
Add API client to global envar
alexandermendes/pybossa-discourse
pybossa_discourse/globals.py
pybossa_discourse/globals.py
# -*- coding: utf8 -*- """Jinja globals module for pybossa-discourse.""" from flask import Markup, request from . import discourse_client class DiscourseGlobals(object): """A class to implement Discourse Global variables.""" def __init__(self, app): self.url = app.config['DISCOURSE_URL'] sel...
# -*- coding: utf8 -*- """Jinja globals module for pybossa-discourse.""" from flask import Markup, request from . import discourse_client class DiscourseGlobals(object): """A class to implement Discourse Global variables.""" def __init__(self, app): self.url = app.config['DISCOURSE_URL'] app...
bsd-3-clause
Python
566c9088033158b4b707090a616a5952841c57aa
Correct an error in random_one_hot_topological_dense_design_matrix
nouiz/pylearn2,Refefer/pylearn2,lamblin/pylearn2,JesseLivezey/pylearn2,hantek/pylearn2,pombredanne/pylearn2,mkraemer67/pylearn2,jeremyfix/pylearn2,bartvm/pylearn2,caidongyun/pylearn2,matrogers/pylearn2,alexjc/pylearn2,jeremyfix/pylearn2,alexjc/pylearn2,jamessergeant/pylearn2,JesseLivezey/plankton,TNick/pylearn2,JesseLi...
pylearn2/testing/datasets.py
pylearn2/testing/datasets.py
""" Simple datasets to be used for unit tests. """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "Ian Goodfellow" __email__ = "goodfeli@iro" import numpy as np from pylearn2.datasets.dense_desi...
""" Simple datasets to be used for unit tests. """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "Ian Goodfellow" __email__ = "goodfeli@iro" import numpy as np from pylearn2.datasets.dense_desi...
bsd-3-clause
Python
15621212e635792bd6e5f28a58052d6b881d42de
Call test func properly.
bueda/django-comrade
fabfile.py
fabfile.py
#!/usr/bin/env python import os from fabric.api import * from fabric.contrib.console import confirm from fab_shared import _nose_test, _test, _package_deploy as deploy env.unit = "django-comrade" env.root_dir = os.path.abspath(os.path.dirname(__file__)) env.scm = env.root_dir env.allow_no_tag = True env.upload_to_s3 ...
#!/usr/bin/env python import os from fabric.api import * from fabric.contrib.console import confirm from fab_shared import _nose_test, _test, _package_deploy as deploy env.unit = "django-comrade" env.root_dir = os.path.abspath(os.path.dirname(__file__)) env.scm = env.root_dir env.allow_no_tag = True env.upload_to_s3 ...
mit
Python
edb07b507aa93ead278cecd168da83a4be68b2ba
Disable front-end testing on Travis
onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site,onepercentclub/onepercentclub-site
bluebottle/settings/travis.py
bluebottle/settings/travis.py
# SECRET_KEY and DATABASES needs to be defined before the base settings is imported. SECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q==' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }, } from .base import * # # Put the travis-ci e...
# SECRET_KEY and DATABASES needs to be defined before the base settings is imported. SECRET_KEY = 'hbqnTEq+m7Tk61bvRV/TLANr3i0WZ6hgBXDh3aYpSU8m+E1iCtlU3Q==' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }, } from .base import * # # Put the travis-ci e...
bsd-3-clause
Python
a714e48ad09ce3c730cbd8b3ad04ffefba4b8661
Remove obsolete "babel compile" command
Turbo87/skylines,RBE-Avionik/skylines,RBE-Avionik/skylines,Turbo87/skylines,skylines-project/skylines,Turbo87/skylines,Turbo87/skylines,RBE-Avionik/skylines,shadowoneau/skylines,Harry-R/skylines,RBE-Avionik/skylines,skylines-project/skylines,skylines-project/skylines,shadowoneau/skylines,Harry-R/skylines,shadowoneau/sk...
fabfile.py
fabfile.py
from fabric.api import env, task, local, cd, lcd, run, sudo, put from tempfile import NamedTemporaryFile env.use_ssh_config = True env.hosts = ['skylines@skylines'] APP_DIR = '/home/skylines' SRC_DIR = '%s/src' % APP_DIR @task def deploy(branch='master', force=False): deploy_ember() push(branch, force) ...
from fabric.api import env, task, local, cd, lcd, run, sudo, put from tempfile import NamedTemporaryFile env.use_ssh_config = True env.hosts = ['skylines@skylines'] APP_DIR = '/home/skylines' SRC_DIR = '%s/src' % APP_DIR @task def deploy(branch='master', force=False): deploy_ember() push(branch, force) ...
agpl-3.0
Python
bc3c057a2cc775bcce690e0e9019c2907b638101
Bump version
thombashi/pytablereader,thombashi/pytablereader,thombashi/pytablereader
pytablereader/__version__.py
pytablereader/__version__.py
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.25.5" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.25.4" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
mit
Python
da4900798c2b052f3d317cc419e829cebfb3701c
Remove unused lines of code
thombashi/pytablereader,thombashi/pytablereader,thombashi/pytablereader
pytablereader/sqlite/core.py
pytablereader/sqlite/core.py
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import from __future__ import unicode_literals from .._constant import TableNameTemplate as tnt from .._validator import FileValidator from ..interface import TableLoader from .formatter import SqliteTab...
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import from __future__ import unicode_literals from .._constant import TableNameTemplate as tnt from .._validator import FileValidator from ..interface import TableLoader from .formatter import SqliteTab...
mit
Python
9a6dcfdd3c4b445089b74840d55f420f038833d4
Update MM_filter_ont_1_AM.py
amojarro/carrierseq,amojarro/carrierseq
python/MM_filter_ont_1_AM.py
python/MM_filter_ont_1_AM.py
from Bio import SeqIO import math from Tkinter import Tk name = '/DataFolder/02_seqtk/unmapped_reads.fastq' qs = 9 output = '/DataFolder/03_fastq9/unmapped_reads_q9' count = 0 for rec in SeqIO.parse(name, "fastq"): count += 1 print("%i reads in fastq file" % count) qual_sequences = [] # Setup an empty list cnt...
from Bio import SeqIO import math from Tkinter import Tk name = '/$DataFolder/02_seqtk/unmapped_reads.fastq' qs = 9 output = '/$DataFolder/03_fastq9/unmapped_reads_q9' count = 0 for rec in SeqIO.parse(name, "fastq"): count += 1 print("%i reads in fastq file" % count) qual_sequences = [] # Setup an empty list c...
mit
Python
449c49901e4a8e202cb4cf08c7404747c7be54d9
Create models __init__.py file.
MichaelCurrin/twitterverse,MichaelCurrin/twitterverse
app/models/__init__.py
app/models/__init__.py
""" Initialisation file for models directory. Note that the model files cannot be be imported directly with `python -m models/{model}.py`, if they have been included here. Since this __init__ file will add the table names to the name space before the file is run, which causes a conflict. """ # Create an _`_all__` list...
""" Initialisation file for models directory. """ # Create an _`_all__` list here, using values set in other application files. from .places import __all__ as placesModel from .trends import __all__ as trendsModel from .tweets import __all__ as tweetsModel from .cronJobs import __all__ as cronJobsModel __all__ = places...
mit
Python
9338814b45c7ee658955e9342ae5b87bf577e83b
Fix deprecated can_build warning
oamldev/oamlGodotModule,oamldev/oamlGodotModule,oamldev/oamlGodotModule
config.py
config.py
def can_build(env, platform): return True def configure(env): pass
def can_build(platform): return True def configure(env): pass
mit
Python
9a84296ead813a926b61f296020c55574df0e151
clean config
buxx/synergine
config.py
config.py
from module.lifegame.synergy.collection.LifeGameCollection import LifeGameCollection from module.lifegame.synergy.LifeGameSimulation import LifeGameSimulation from module.lifegame.synergy.collection.LifeGameCollectionConfiguration import LifeGameCollectionConfiguration from module.lifegame.display.curses_visualisation ...
from module.lifegame.synergy.collection.LifeGameCollection import LifeGameCollection from module.lifegame.synergy.LifeGameSimulation import LifeGameSimulation from module.lifegame.synergy.collection.LifeGameCollectionConfiguration import LifeGameCollectionConfiguration from module.lifegame.display.curses_visualisation ...
apache-2.0
Python
f3f428480a8e61bf22532503680e718fd5f0d286
Write the first view - news feed.
pure-python/brainmate
fb/views.py
fb/views.py
from django.shortcuts import render from fb.models import UserPost def index(request): if request.method == 'GET': posts = UserPost.objects.all() context = { 'posts': posts, } return render(request, 'index.html', context)
from django.shortcuts import render # Create your views here.
apache-2.0
Python
72f429d74f04a700aa0240f1cb934dfcca979384
Remove comments
gateway4labs/labmanager,porduna/labmanager,go-lab/labmanager,morelab/labmanager,morelab/labmanager,labsland/labmanager,gateway4labs/labmanager,gateway4labs/labmanager,porduna/labmanager,go-lab/labmanager,porduna/labmanager,porduna/labmanager,go-lab/labmanager,morelab/labmanager,gateway4labs/labmanager,labsland/labmanag...
config.py
config.py
import os import yaml LAB_ENV = os.environ.get('LAB_ENV', 'development') env_config = yaml.load(open('labmanager/config/database.yml'))[LAB_ENV] # Have you run... "pip install git+https://github.com/lms4labs/rlms_weblabdeusto.git" first? RLMS = ['weblabdeusto','unr'] SQLALCHEMY_ENGINE_STR = os.environ.get('DATABASE_...
import os import yaml LAB_ENV = os.environ.get('LAB_ENV', 'development') env_config = yaml.load(open('labmanager/config/database.yml'))[LAB_ENV] # Have you run... "pip install git+https://github.com/lms4labs/rlms_weblabdeusto.git" first? RLMS = ['weblabdeusto','unr'] SQLALCHEMY_ENGINE_STR = os.environ.get('DATABASE_...
bsd-2-clause
Python
6b3a3d1ccf2f54d859b25904bf33edf917931529
fix url
akakou/Incoming-WebHooks-Bot
incoming-webhooks.py
incoming-webhooks.py
# coding:utf-8 '''This program is class for incoming webhooks''' import requests import json class IncomingWebhooks: """Incoming webhooks""" def __init__(self, url='', text=u'', username=u'', icon_emoji=u'', link_names=0): """Set Property""" self.url = url self.data = json.dumps({ ...
# coding:utf-8 '''This program is class for incoming webhooks''' import requests import json class IncomingWebhooks: """Incoming webhooks""" def __init__(self, url, text, username=u'', icon_emoji=u'', link_names=0): """Set Property""" self.url = '' self.data = json.dumps({ ...
mit
Python
a0f12252a83d3a04cfc3b73be0fa7d39809bfd59
Bump version.
CuBoulder/atlas,CUDEN-CLAS/atlas,CUDEN-CLAS/atlas,CuBoulder/atlas,CuBoulder/atlas
config.py
config.py
""" Configuration file for Atlas All variable settings should go here so values can be propagated to the various functions from a central location. """ import re import os # Set Atlas location atlas_location = os.path.dirname(os.path.realpath(__file__)) # Import config_servers.py. try: from config_servers impor...
""" Configuration file for Atlas All variable settings should go here so values can be propagated to the various functions from a central location. """ import re import os # Set Atlas location atlas_location = os.path.dirname(os.path.realpath(__file__)) # Import config_servers.py. try: from config_servers impor...
mit
Python
7e25321a6f6b0c6817eb14232f732cfccab8fdd8
Update utils.py
robcza/intelmq,robcza/intelmq,certtools/intelmq,certtools/intelmq,pkug/intelmq,aaronkaplan/intelmq,aaronkaplan/intelmq,sch3m4/intelmq,sch3m4/intelmq,sch3m4/intelmq,certtools/intelmq,pkug/intelmq,pkug/intelmq,sch3m4/intelmq,pkug/intelmq,robcza/intelmq,robcza/intelmq,aaronkaplan/intelmq
intelmq/lib/utils.py
intelmq/lib/utils.py
import logging import hashlib def decode(text, encodings=["utf-8", "ISO-8859-15"], force=False): for encoding in encodings: try: return text.decode(encoding) except ValueError as e: pass if force: for encoding in encodings: try: ...
import logging import hashlib def decode(text, encodings=["utf-8"], force=False): for encoding in encodings: try: return text.decode(encoding) except ValueError as e: pass if force: for encoding in encodings: try: return text....
agpl-3.0
Python
a05e4e478a932d18350a83687ee80103c8398f0d
Change winrate threshold
wizzomafizzo/hearthpy,wizzomafizzo/hearthpy
config.py
config.py
# hearthpy global config db_filename = "hearthpy.db" auth_filename = "hearthpy.auth" port = 5000 match_limit = 20 front_match_limit = 21 card_limit = 22 winrate_tiers = [50, 55] # % min_games_deck = 20 deck_template = "^(Dd|Hr|Me|Pn|Pt|Re|Sn|Wk|Wr) .+ \d+\.\d+$" card_image_url = "http://wow.zamimg.com/images/hearthsto...
# hearthpy global config db_filename = "hearthpy.db" auth_filename = "hearthpy.auth" port = 5000 match_limit = 20 front_match_limit = 21 card_limit = 22 winrate_tiers = [50, 60] # % min_games_deck = 20 deck_template = "^(Dd|Hr|Me|Pn|Pt|Re|Sn|Wk|Wr) .+ \d+\.\d+$" card_image_url = "http://wow.zamimg.com/images/hearthsto...
mit
Python
2dd68e018ad9e0bce16157fa8a748b5d075196b2
fix test
JesseAldridge/clipmon,JesseAldridge/clipmon
test.py
test.py
import os import clipmon import conf with open('test_cases.txt') as f: lines = f.read().splitlines() proj_dir = conf.curr_proj_dirs[0] for i in range(0, len(lines), 3): test_line, expected = lines[i:i+2] if expected == 'None': expected = None actual = clipmon.clip_str_to_path_line(test_line, ...
import os import clipmon import conf with open('test_cases.txt') as f: lines = f.read().splitlines() for i in range(0, len(lines), 3): test_line, expected = lines[i:i+2] if expected == 'None': expected = None actual = clipmon.clip_str_to_path_line(test_line) expected, actual = [ o...
mit
Python
e978b8be7ccfd9206d618f5a3de855a306ceccfe
Test if rotor encodes with different offset properly
ranisalt/enigma
test.py
test.py
import unittest from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen class RotorTestCase(unittest.TestCase): def test_rotor_encoding(self): rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q') self.assertEqual('E', rotor.encode('A')) def test_rotor_reverse_encoding(self): ...
import unittest from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen class RotorTestCase(unittest.TestCase): def test_rotor_encoding(self): rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q') self.assertEqual('E', rotor.encode('A')) def test_rotor_reverse_encoding(self): ...
mit
Python
5173f9e37de4bddda59c76b6e48fe8ccfc9692f1
Make cython.py executable and add Unix shebang
dahebolangkuan/cython,fperez/cython,JelleZijlstra/cython,madjar/cython,roxyboy/cython,ABcDexter/cython,scoder/cython,mcanthony/cython,rguillebert/CythonCTypesBackend,hhsprings/cython,ChristopherHogan/cython,hpfem/cython,mrGeen/cython,fperez/cython,fabianrost84/cython,mcanthony/cython,encukou/cython,fabianrost84/cython,...
cython.py
cython.py
#!/usr/bin/env python # # Cython -- Main Program, generic # if __name__ == '__main__': import os import sys # Make sure we import the right Cython cythonpath, _ = os.path.split(os.path.realpath(__file__)) sys.path.insert(0, cythonpath) from Cython.Compiler.Main import main main(co...
# # Cython -- Main Program, generic # if __name__ == '__main__': import os import sys # Make sure we import the right Cython cythonpath, _ = os.path.split(os.path.realpath(__file__)) sys.path.insert(0, cythonpath) from Cython.Compiler.Main import main main(command_line = 1) else: ...
apache-2.0
Python
94c647ac51a9547371bb7326964995904688abe3
Add django-import-export to admin
johngian/woodstock,mozilla/woodstock,ppapadeas/woodstock,johngian/woodstock,ppapadeas/woodstock,mozilla/woodstock,ppapadeas/woodstock,mozilla/woodstock,mozilla/woodstock,ppapadeas/woodstock,johngian/woodstock,johngian/woodstock
woodstock/voting/admin.py
woodstock/voting/admin.py
from django.contrib import admin from import_export.admin import ExportMixin, ImportExportMixin from import_export import fields, resources from woodstock.voting.models import MozillianGroup, MozillianProfile, Vote class MozillianGroupResouce(resources.ModelResource): negative_votes = fields.Field() skip_vo...
import csv from django.contrib import admin from django.http import HttpResponse from woodstock.voting.models import MozillianGroup, MozillianProfile, Vote def export_as_csv_action(description=None, fields=None, exclude=None, header=True): """ This function returns an export csv act...
mpl-2.0
Python
89c960bbe4154914f39391e4f0a4d47db33c01fb
Update test baseline
Kitware/geojs,OpenGeoscience/geojs,Kitware/geojs,OpenGeoscience/geojs,OpenGeoscience/geojs,Kitware/geojs
testing/test-cases/selenium-tests/glMultiPolygons/testGlMultiPolygons.py
testing/test-cases/selenium-tests/glMultiPolygons/testGlMultiPolygons.py
#!/usr/bin/env python from selenium_test import FirefoxTest, ChromeTest class glMultiPolygonsBase(object): testCase = ('glMultiPolygons',) testRevision = 4 def loadPage(self): self.resizeWindow(640, 480) self.loadURL('glMultiPolygons/index.html') self.wait() self.resizeWin...
#!/usr/bin/env python from selenium_test import FirefoxTest, ChromeTest class glMultiPolygonsBase(object): testCase = ('glMultiPolygons',) testRevision = 3 def loadPage(self): self.resizeWindow(640, 480) self.loadURL('glMultiPolygons/index.html') self.wait() self.resizeWin...
apache-2.0
Python
4514ddeac5bd2adc5228ecd4cd497059e7c82c88
delete unused code
free-free/pyblog,free-free/pyblog,free-free/pyblog,free-free/pyblog
pyblog/application.py
pyblog/application.py
# -*- coding:utf-8 -*- import os,time,asyncio,json import logging logging.basicConfig(level=logging.ERROR) try: from aiohttp import web except ImportError: logging.error("Can't import module aiohttp") from pyblog.log import Log from pyblog.httptools import Middleware,Route from pyblog.template import Template from...
# -*- coding:utf-8 -*- import os,time,asyncio,json import logging logging.basicConfig(level=logging.ERROR) try: from aiohttp import web except ImportError: logging.error("Can't import module aiohttp") from pyblog.log import Log from pyblog.httptools import Middleware,Route from pyblog.template import Template from...
mit
Python
4014553a3d7ddad5f86f53e212fd0b15a0535398
Fix template settings
uhuramedia/cookiecutter-django,uhuramedia/cookiecutter-django
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/settings/deploy.py
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/settings/deploy.py
from base import * DEBUG = False DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': '{{cookiecutter.project_name}}', 'HOST': '', 'USER': '', 'PASSWORD': '', 'CONN_MAX_AGE': 600, } } TEMPLATES[0]['OPTIONS']['debug'] = DEBUG CACHES = { ...
from base import * DEBUG = False TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': '{{cookiecutter.project_name}}', 'HOST': '', 'USER': '', 'PASSWORD': '', 'CONN_MAX_AGE': 600, } } TEMPLATE_LOADERS = ( ( ...
bsd-3-clause
Python
2b6ac1f28b85b7726c6fc52eabaabed73acb2a98
add test_view
evuez/mutations
test.py
test.py
import logging from time import sleep from pyglet import app from pyglet.window import Window from pyglet.clock import schedule_interval from render import MapView from mutations import Map from mutations import Body from mutations import EnergyBank logging.basicConfig(level=logging.DEBUG) def test(): map_ = Map...
from time import sleep from mutations import Map from mutations import Body from mutations import EnergyBank import logging logging.basicConfig(filename='test.log', level=logging.INFO) def test(): map_ = Map(1000, 1000) for i in range(2): map_.add(EnergyBank(map_)) for i in range(5): map_.add(Body(map_)) f...
mit
Python
9c7acc7e0c4973a85b4e703d2e05312d4d727cd6
Reorder __all__
numberoverzero/pyservice
pyservice/__init__.py
pyservice/__init__.py
from pyservice.client import Client from pyservice.layer import Layer from pyservice.operation import Operation from pyservice.service import Service __all__ = ["Client", "Layer", "Operation", "Service"]
from pyservice.client import Client from pyservice.service import Service __all__ = ["Client", "Service"]
mit
Python
26b14aa13f28859585080115f66bb7a995b37d59
change error output
ami-GS/pyHPACK
test.py
test.py
import os import json from HPACK import decode TESTCASE = [ 'hpack-test-case/haskell-http2-naive/', # 'hpack-test-case/haskell-http2-naive-huffman/', # 'hpack-test-case/haskell-http2-static/', # 'hpack-test-case/haskell-http2-static-huffman/', # 'hpack-test-case/haskell-http2-linear/', # 'hpack-tes...
import os import json from HPACK import decode TESTCASE = [ 'hpack-test-case/haskell-http2-naive/', # 'hpack-test-case/haskell-http2-naive-huffman/', # 'hpack-test-case/haskell-http2-static/', # 'hpack-test-case/haskell-http2-static-huffman/', # 'hpack-test-case/haskell-http2-linear/', # 'hpack-tes...
mit
Python
7aa281b56fa6fb4fc4c0625a13f303a085334d36
Build a set of categories to avoid duplication
vodik/pytest-exceptional
pytest_exceptional.py
pytest_exceptional.py
# -*- coding: utf-8 -*- import pytest from _pytest._code.code import TerminalRepr class PytestException(Exception): pass class ExceptionRepr(TerminalRepr): def __init__(self, excinfo, longrepr): self.excinfo = excinfo self.longrepr = longrepr def toterminal(self, tw): try: ...
# -*- coding: utf-8 -*- import pytest from _pytest._code.code import TerminalRepr class PytestException(Exception): pass class ExceptionRepr(TerminalRepr): def __init__(self, excinfo, longrepr): self.excinfo = excinfo self.longrepr = longrepr def toterminal(self, tw): try: ...
mit
Python
53e0a7b7ac81fab6527796e2fa33a456d0650863
Reduce maximum false positive rate to 5%.
Aurora0001/LearnProgrammingBot
test.py
test.py
import unittest from sqlalchemy.orm import sessionmaker from sqlalchemy import create_engine from sklearn import cross_validation import model import main class TestClassifier(unittest.TestCase): def test_classifications(self): false_positives = 0 false_negatives = 0 correct = 0 wr...
import unittest from sqlalchemy.orm import sessionmaker from sqlalchemy import create_engine from sklearn import cross_validation import model import main class TestClassifier(unittest.TestCase): def test_classifications(self): false_positives = 0 false_negatives = 0 correct = 0 wr...
mit
Python
47d1ad8ed082c43f1ff3bd157db077d1e494186a
Add to_json method for departures
MarkusH/bvg-grabber
bvggrabber/api/__init__.py
bvggrabber/api/__init__.py
# -*- coding: utf-8 -*- import json from datetime import datetime from dateutil.parser import parse fullformat = lambda dt: dt.strftime('%Y-%m-%d %H:%M') hourformat = lambda dt: dt.strftime('%H:%M') class QueryApi(object): def __init__(self): pass def call(self): raise NotImplementedError...
# -*- coding: utf-8 -*- from datetime import datetime from dateutil.parser import parse fullformat = lambda dt: dt.strftime('%Y-%m-%d %H:%M') hourformat = lambda dt: dt.strftime('%H:%M') class QueryApi(): def __init__(self): pass def call(self): raise NotImplementedError("The inheriting cl...
bsd-3-clause
Python
724c1b71d5ca299dd23ff51d5f568c08a77f2cf5
Update _version.py
4dn-dcic/tibanna,4dn-dcic/tibanna,4dn-dcic/tibanna
tibanna/_version.py
tibanna/_version.py
"""Version information.""" # The following line *must* be the last in the module, exactly as formatted: __version__ = "0.10.1"
"""Version information.""" # The following line *must* be the last in the module, exactly as formatted: __version__ = "0.10.0"
mit
Python
9092e4d5d41efd347b24efb54403d65451759d3d
make sure the example works under all supported python's vms
mgedmin/socketpool,benoitc/socketpool
examples/test_threaded.py
examples/test_threaded.py
# -*- coding: utf-8 - # # This file is part of socketpool. # See the NOTICE for more information. import socket import sys import threading try: from queue import * except ImportError: from Queue import * try: import SocketServer as socketserver except ImportError: import socketserver import time f...
# -*- coding: utf-8 - # # This file is part of socketpool. # See the NOTICE for more information. import socket import threading try: from queue import * except ImportError: from Queue import * try: import SocketServer as socketserver except ImportError: import socketserver import time from socketp...
mit
Python
c4d354c271e405a48fab9cdaeb41b2d5bc177be0
Add changes from Mikhail Terekhov <terekhov@emc.com>.
rvs/gpdb,janebeckman/gpdb,greenplum-db/gpdb,lpetrov-pivotal/gpdb,CraigHarris/gpdb,foyzur/gpdb,postmind-net/postgres-xl,kmjungersen/PostgresXL,oberstet/postgres-xl,randomtask1155/gpdb,arcivanov/postgres-xl,yuanzhao/gpdb,lintzc/gpdb,royc1/gpdb,arcivanov/postgres-xl,ashwinstar/gpdb,cjcjameson/gpdb,0x0FFF/gpdb,jmcatamney/g...
src/interfaces/python/setup.py
src/interfaces/python/setup.py
#!/usr/bin/env python # Setup script for the PyGreSQL version 3 # created 2000/04 Mark Alexander <mwa@gate.net> # tweaked 2000/05 Jeremy Hylton <jeremy@cnri.reston.va.us> # win32 support 2001/01 Gerhard Haering <gerhard@bigfoot.de> # requires distutils; standard in Python 1.6, otherwise download from # http://www.pyt...
#!/usr/bin/env python # Setup script for the PyGreSQL version 3 # created 2000/04 Mark Alexander <mwa@gate.net> # tweaked 2000/05 Jeremy Hylton <jeremy@cnri.reston.va.us> # win32 support 2001/01 Gerhard Haering <gerhard@bigfoot.de> # requires distutils; standard in Python 1.6, otherwise download from # http://www.pyt...
apache-2.0
Python
cea2a30d3f08af18efa318c1e0f7faedcf2d477a
update default metadata
josl/ASM_challenge,josl/Fastq-dump_ENA_NCBI,josl/NCBI-Downloader,josl/ASM_challenge,josl/NCBI-Downloader,josl/Fastq-dump_ENA_NCBI
isolates/template.py
isolates/template.py
metadata = { "sample_name": "", "group_name": "", "file_names": "", "sequencing_platform": "", "sequencing_type": "", "pre_assembled": "", "sample_type": "", "organism": "", "strain": "", "subtype": {}, "country": "", "region": "", "city": "", "zip_code": "", ...
metadata = { "sample_name": "", "group_name": "", "file_names": "", "sequencing_platform": "", "sequencing_type": "", "pre_assembled": "", "sample_type": "", "organism": "", "strain": "", "subtype": {}, "country": "", "region": "", "city": "", "zip_code": "", ...
apache-2.0
Python
9a5284d6aae3084b743c4392ba5322ec01af7484
update Calderdale import script for latest data (closes #964)
DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations
polling_stations/apps/data_collection/management/commands/import_calderdale.py
polling_stations/apps/data_collection/management/commands/import_calderdale.py
from django.contrib.gis.geos import Point from django.db import connection from pollingstations.models import PollingDistrict from data_collection.management.commands import BaseShpStationsShpDistrictsImporter from data_finder.helpers import geocode_point_only, PostcodeError class Command(BaseShpStationsShpDistrictsI...
from django.contrib.gis.geos import Point from django.db import connection from pollingstations.models import PollingDistrict from data_collection.management.commands import BaseShpStationsShpDistrictsImporter from data_finder.helpers import geocode_point_only, PostcodeError class Command(BaseShpStationsShpDistrictsI...
bsd-3-clause
Python
fa28e2c26181fd82a47162e5cb8004c97f2b42dc
increment version
gbrammer/grizli
grizli/version.py
grizli/version.py
# git describe --tags __version__ = "0.4.0-8-g2808abe"
# git describe --tags __version__ = "0.4.0-3-g057a694"
mit
Python
fee766f9dd6edfbb24e300063c3133f01b71af97
Update fetcher
hawson/db-builder,SteamDBAPI/db-builder
fetcher.py
fetcher.py
#!/usr/bin/python3 import requests import json from sqlalchemy import create_engine, ForeignKey from sqlalchemy import Column, Date, Integer, String from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlalchemy.exc import IntegrityError #Globals engine = create_engine...
#!/usr/bin/python3 import requests import json from sqlalchemy import create_engine, ForeignKey from sqlalchemy import Column, Date, Integer, String from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlalchemy.exc import IntegrityError #Globals engine = create_engine...
bsd-3-clause
Python
12ec60b1974db666153f038c6bb55ce11fc101de
Update __init__.py
aspuru-guzik-group/selfies
build/lib/selfies/__init__.py
build/lib/selfies/__init__.py
#!/usr/bin/env python __author__ = 'Mario Krenn' __version__ = 'v0.2.0' from .selfies_fcts import encoder, decoder
#!/usr/bin/env python __author__ = 'Mario Krenn' __version__ = 'v0.1.2' from .selfies_fcts import encoder, decoder
apache-2.0
Python
d9365f726b5972ca39bac56efb48a452521811be
add more info to dbinfo
idies/pyJHTDB,idies/pyJHTDB,idies/pyJHTDB,idies/pyJHTDB
dbinfo.py
dbinfo.py
import numpy as np import os package_dir, package_filename = os.path.split(__file__) isotropic1024coarse = {'name' : 'isotropic1024coarse'} for coord in ['x', 'y', 'z']: isotropic1024coarse[coord + 'nodes'] = (np.pi/512)*np.array(range(1024), dtype = np.float32) isotropic1024coarse['n' + coord] = 1024 ...
import numpy as np import os package_dir, package_filename = os.path.split(__file__) isotropic1024coarse = {'name' : 'isotropic1024coarse'} for coord in ['x', 'y', 'z']: isotropic1024coarse[coord + 'nodes'] = (np.pi/512)*np.array(range(1024), dtype = np.float32) isotropic1024coarse['n' + coord] = 1024 ...
apache-2.0
Python
577534988206b91b2f99f60cb48140b4c92acf4a
Reduce logging around http clients
dlecocq/nsq-py,dlecocq/nsq-py
nsq/http/__init__.py
nsq/http/__init__.py
'''Our clients for interacting with various clients''' from decorator import decorator import requests from .. import json, logger from ..exceptions import NSQException @decorator def wrap(function, *args, **kwargs): '''Wrap a function that returns a request with some exception handling''' try: req ...
'''Our clients for interacting with various clients''' from decorator import decorator import requests from .. import json, logger from ..exceptions import NSQException @decorator def wrap(function, *args, **kwargs): '''Wrap a function that returns a request with some exception handling''' try: req ...
mit
Python
fda70bfff7ec9d25f7c08c92d570dfc52754734c
Fix typo in description scting.
usc-isi-i2/dig-crf,usc-isi-i2/dig-crf
applyCrfPjSparkTest.py
applyCrfPjSparkTest.py
#!/usr/bin/env python """This program will use Apache Spark to read a keyed JSON Lines file (such as adjudicated_modeled_live_eyehair_100.kjsonl), convert it to a pair RDD, process it with CRF++, and print detected attributes as pair RDD keyed JSON files, formatted to Karma's liking. The keys in the input file will be...
#!/usr/bin/env python """This program will use Apache Spark to read a keyed JSON Lines file (such as adjudicated_modeled_live_eyehair_100.kjsonl), convert it to a pair RDD, process it with CRF++, and print detected attributes as pair RDD keyed JSON files, formatted to Karma's liking. The keys in the input file will be...
apache-2.0
Python
691093e38598959f98b319f7c57852496a26ba90
Fix project name in urlconf
onespacemedia/cms-jobs,onespacemedia/cms-jobs
apps/careers/models.py
apps/careers/models.py
import watson from cms.apps.pages.models import ContentBase from cms.models import HtmlField, SearchMetaBase from django.db import models class Careers(ContentBase): # The heading that the admin places this content under. classifier = "apps" # The urlconf used to power this content's views. urlconf ...
import watson from cms.apps.pages.models import ContentBase from cms.models import HtmlField, SearchMetaBase from django.db import models class Careers(ContentBase): # The heading that the admin places this content under. classifier = "apps" # The urlconf used to power this content's views. urlconf ...
mit
Python
56efc8fe371f9bbd7a39740908f5ca7a97010ad9
insert query modification
P1X-in/Tanks-of-Freedom-Server
tof_server/views.py
tof_server/views.py
"""This module provides views for application.""" from tof_server import app, versioning, mysql from flask import jsonify, make_response import string, random @app.route('/') def index(): """Server information""" return jsonify({ 'server-version' : versioning.SERVER_VERSION, 'client-versions' :...
"""This module provides views for application.""" from tof_server import app, versioning, mysql from flask import jsonify, make_response import string, random @app.route('/') def index(): """Server information""" return jsonify({ 'server-version' : versioning.SERVER_VERSION, 'client-versions' :...
mit
Python
28768a5826d83bd9cccb56d0d31dc1e83b671f65
Add command to output.
Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server
pykeg/core/tests.py
pykeg/core/tests.py
# Copyright 2014 Bevbot LLC, All Rights Reserved # # This file is part of the Pykeg package of the Kegbot project. # For more information on Pykeg or Kegbot, see http://kegbot.org/ # # Pykeg is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # ...
# Copyright 2014 Bevbot LLC, All Rights Reserved # # This file is part of the Pykeg package of the Kegbot project. # For more information on Pykeg or Kegbot, see http://kegbot.org/ # # Pykeg is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # ...
mit
Python
71bac0bf51a75094e2f8e4edaa94a4840e0a3572
Include Chapter class in __init__.py (#304)
JelteF/PyLaTeX,JelteF/PyLaTeX
pylatex/__init__.py
pylatex/__init__.py
""" A library for creating Latex files. .. :copyright: (c) 2014 by Jelte Fennema. :license: MIT, see License for more details. """ from .basic import HugeText, NewPage, LineBreak, NewLine, HFill, LargeText, \ MediumText, SmallText, FootnoteText, TextColor from .document import Document from .frames import Md...
""" A library for creating Latex files. .. :copyright: (c) 2014 by Jelte Fennema. :license: MIT, see License for more details. """ from .basic import HugeText, NewPage, LineBreak, NewLine, HFill, LargeText, \ MediumText, SmallText, FootnoteText, TextColor from .document import Document from .frames import Md...
mit
Python
fd5f7781ceb696ab90ddd733424695361fb02233
Fix typo, 'unitest.main()' -> 'unittest.main()'.
armandobs14/rdflib,ssssam/rdflib,ssssam/rdflib,yingerj/rdflib,yingerj/rdflib,RDFLib/rdflib,yingerj/rdflib,avorio/rdflib,marma/rdflib,RDFLib/rdflib,avorio/rdflib,yingerj/rdflib,dbs/rdflib,dbs/rdflib,armandobs14/rdflib,RDFLib/rdflib,armandobs14/rdflib,avorio/rdflib,ssssam/rdflib,marma/rdflib,marma/rdflib,armandobs14/rdfl...
test/events.py
test/events.py
import unittest from rdflib import events class AddedEvent(events.Event): pass class RemovedEvent(events.Event): pass def subscribe_to(source, target): target.subscribe(AddedEvent, source._add_handler) target.subscribe(RemovedEvent, source._remove_handler) def subscribe_all(caches): for cache in caches...
import unittest from rdflib import events class AddedEvent(events.Event): pass class RemovedEvent(events.Event): pass def subscribe_to(source, target): target.subscribe(AddedEvent, source._add_handler) target.subscribe(RemovedEvent, source._remove_handler) def subscribe_all(caches): for cache in caches...
bsd-3-clause
Python
718efabd2af075fa30cc84000e4d4594418cf42d
Tweak genini.
LingxiaoJIA/gem5,haowu4682/gem5,haowu4682/gem5,andrewfu0325/gem5-aladdin,andrewfu0325/gem5-aladdin,andrewfu0325/gem5-aladdin,andrewfu0325/gem5-aladdin,haowu4682/gem5,haowu4682/gem5,haowu4682/gem5,haowu4682/gem5,andrewfu0325/gem5-aladdin,andrewfu0325/gem5-aladdin,LingxiaoJIA/gem5,haowu4682/gem5,haowu4682/gem5,LingxiaoJI...
test/genini.py
test/genini.py
#!/usr/bin/env python # Copyright (c) 2005 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyrigh...
#!/usr/bin/env python # Copyright (c) 2005 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyrigh...
bsd-3-clause
Python
46bdf7225012c33835b41a721eece41d7256ec86
Fix removed django.conf.urls.defaults import.
trantu/seantis-questionnaire,affan2/ed-questionnaire,eugena/ed-questionnaire,seantis/seantis-questionnaire,eugena/ed-questionnaire,daniboy/seantis-questionnaire,trantu/seantis-questionnaire,eugena/ed-questionnaire,JanOosting/ed-questionnaire,affan2/ed-questionnaire,trantu/seantis-questionnaire,JanOosting/ed-questionnai...
questionnaire/urls.py
questionnaire/urls.py
# vim: set fileencoding=utf-8 from django.conf.urls import * from views import * urlpatterns = patterns('', url(r'^$', questionnaire, name='questionnaire_noargs'), url(r'^csv/(?P<qid>\d+)/$', export_csv, name='export_csv'), url(r'^(?P<runcode>[^/]+)/progress/$', get_as...
# vim: set fileencoding=utf-8 from django.conf.urls.defaults import * from views import * urlpatterns = patterns('', url(r'^$', questionnaire, name='questionnaire_noargs'), url(r'^csv/(?P<qid>\d+)/$', export_csv, name='export_csv'), url(r'^(?P<runcode>[^/]+)/progress/$', ...
bsd-3-clause
Python
cdb5023d841158f7040ee263a2eb85f11b5c5836
fix brokens tests for mds
ceph/ceph-ansible,travmi/ceph-ansible,fgal/ceph-ansible,jtaleric/ceph-ansible,jtaleric/ceph-ansible,ceph/ceph-ansible,font/ceph-ansible,fgal/ceph-ansible,travmi/ceph-ansible,font/ceph-ansible
tests/functional/tests/mds/test_mds.py
tests/functional/tests/mds/test_mds.py
import pytest import json class TestMDSs(object): @pytest.mark.no_docker def test_mds_is_installed(self, node, host): assert host.package("ceph-mds").is_installed def test_mds_service_is_running(self, node, host): service_name = "ceph-mds@{hostname}".format( hostname=node["var...
import pytest import json class TestMDSs(object): @pytest.mark.no_docker def test_mds_is_installed(self, node, host): assert host.package("ceph-mds").is_installed def test_mds_service_is_running(self, node, host): service_name = "ceph-mds@{hostname}".format( hostname=node["var...
apache-2.0
Python
d139aba5ef1ddbb87bf28171e3322c41819f2b06
Bump version 0.3.7
douban/pymesos
pymesos/__init__.py
pymesos/__init__.py
from .interface import Scheduler, Executor, OperatorMaster from .scheduler import MesosSchedulerDriver from .executor import MesosExecutorDriver from .operator_v1 import MesosOperatorMasterDriver, MesosOperatorAgentDriver from .utils import encode_data, decode_data __VERSION__ = '0.3.7' __all__ = ( 'Scheduler', ...
from .interface import Scheduler, Executor, OperatorMaster from .scheduler import MesosSchedulerDriver from .executor import MesosExecutorDriver from .operator_v1 import MesosOperatorMasterDriver, MesosOperatorAgentDriver from .utils import encode_data, decode_data __VERSION__ = '0.3.6' __all__ = ( 'Scheduler', ...
bsd-3-clause
Python
4a1351c546967701327adc17a704ccedfb15abdd
Update version to 1.3-20 (#5615)
tmerrick1/spack,EmreAtes/spack,mfherbst/spack,krafczyk/spack,mfherbst/spack,mfherbst/spack,LLNL/spack,mfherbst/spack,matthiasdiener/spack,LLNL/spack,krafczyk/spack,lgarren/spack,mfherbst/spack,tmerrick1/spack,skosukhin/spack,skosukhin/spack,iulian787/spack,LLNL/spack,tmerrick1/spack,skosukhin/spack,skosukhin/spack,Emre...
var/spack/repos/builtin/packages/r-boot/package.py
var/spack/repos/builtin/packages/r-boot/package.py
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Python
859b9972d37e742d2d6187c694f2e757fbd00897
Update version to 2.1.14 (#5856)
mfherbst/spack,iulian787/spack,EmreAtes/spack,lgarren/spack,matthiasdiener/spack,iulian787/spack,EmreAtes/spack,LLNL/spack,krafczyk/spack,matthiasdiener/spack,skosukhin/spack,LLNL/spack,matthiasdiener/spack,tmerrick1/spack,skosukhin/spack,LLNL/spack,skosukhin/spack,tmerrick1/spack,mfherbst/spack,tmerrick1/spack,matthia...
var/spack/repos/builtin/packages/r-yaml/package.py
var/spack/repos/builtin/packages/r-yaml/package.py
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Python
cafda2ccd8933d3e4b7a5605c95a2328d296b610
Bump version
guildai/guild,guildai/guild,guildai/guild,guildai/guild
guild/__init__.py
guild/__init__.py
# Copyright 2017 TensorHub, 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 writing, ...
# Copyright 2017 TensorHub, 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 writing, ...
apache-2.0
Python
114e658bcc13e7b8b8eb2c6c56915310baec2cd0
hide tasks without condition
DMPwerkzeug/DMPwerkzeug,DMPwerkzeug/DMPwerkzeug,DMPwerkzeug/DMPwerkzeug,rdmorganiser/rdmo,rdmorganiser/rdmo,rdmorganiser/rdmo
apps/tasks/managers.py
apps/tasks/managers.py
from django.db import models class TaskManager(models.Manager): def active_by_project(self, project): tasks = [] for task in self.get_queryset(): conditions = task.conditions.all() if conditions: for condition in conditions: if conditi...
from django.db import models class TaskManager(models.Manager): def active_by_project(self, project): tasks = [] for task in self.get_queryset(): conditions = task.conditions.all() if conditions: for condition in conditions: if conditi...
apache-2.0
Python
9cd217e0e39fb53ca002b18904921351dd52e234
Fix GetOverlappedResult WriteFile tests per MSDN docs
opalmer/pywincffi,opalmer/pywincffi,opalmer/pywincffi,opalmer/pywincffi
tests/test_kernel32/test_overlapped.py
tests/test_kernel32/test_overlapped.py
import os import shutil import tempfile from six import text_type from pywincffi.dev.testutil import TestCase from pywincffi.core import dist from pywincffi.kernel32 import ( CreateFile, WriteFile, CloseHandle, CreateEvent, GetOverlappedResult) from pywincffi.wintypes import OVERLAPPED class TestOverlappedWri...
import os import shutil import tempfile from six import text_type from pywincffi.dev.testutil import TestCase from pywincffi.core import dist from pywincffi.kernel32 import ( CreateFile, WriteFile, CloseHandle, CreateEvent, GetOverlappedResult) from pywincffi.wintypes import OVERLAPPED class TestOverlappedWri...
mit
Python
49d4031fb6ac08060b0d427bd8ac3345422c7b13
Update license year
uber/tchannel-python,uber/tchannel-python
tests/thrift/test_multiple_services.py
tests/thrift/test_multiple_services.py
# Copyright (c) 2016 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
# Copyright (c) 2015 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
mit
Python
a5ff46da6c0d5941a979566c5d0f97cd5f375c99
Add key type selection
bbockelm/glideinWMS,holzman/glideinwms-old,holzman/glideinwms-old,bbockelm/glideinWMS,bbockelm/glideinWMS,bbockelm/glideinWMS,holzman/glideinwms-old
tools/wmsTxtView.py
tools/wmsTxtView.py
#!/bin/env python # # Description: # This tool displays the status of the glideinWMS pool # in a text format # # Arguments: # [-pool collector_node] Entries|Sites|Gatekeepers # # Author: # Igor Sfiligoi (May 9th 2007) # import string import sys sys.path.append("../factory") sys.path.append("../frontend") sys.p...
#!/bin/env python # # Description: # This tool displays the status of the glideinWMS pool # in a text format # # Arguments: # [-pool collector_node] Entries|Sites|Gatekeepers # # Author: # Igor Sfiligoi (May 9th 2007) # import string import sys sys.path.append("../factory") sys.path.append("../frontend") sys.p...
bsd-3-clause
Python
3566bb6f5f7a2fb48c485fbad7b9961aa061acba
Update wp2pelican script to extract date and author taken from wordpress xml file.
btnpushnmunky/pelican,GiovanniMoretti/pelican,jvehent/pelican,florianjacob/pelican,treyhunner/pelican,levanhien8/pelican,iKevinY/pelican,ionelmc/pelican,abrahamvarricatt/pelican,kennethlyn/pelican,lucasplus/pelican,lazycoder-ru/pelican,rbarraud/pelican,ehashman/pelican,deved69/pelican-1,kernc/pelican,sunzhongwei/pelica...
tools/wp2pelican.py
tools/wp2pelican.py
#! /usr/bin/env python from BeautifulSoup import BeautifulStoneSoup from codecs import open import os import argparse def wp2html(xml): xmlfile = open(xml, encoding='utf-8').read() soup = BeautifulStoneSoup(xmlfile) items = soup.rss.channel.findAll('item') for item in items: if item.fetch('wp...
#! /usr/bin/env python from BeautifulSoup import BeautifulStoneSoup from codecs import open import os import argparse def wp2html(xml): xmlfile = open(xml, encoding='utf-8').read() soup = BeautifulStoneSoup(xmlfile) items = soup.rss.channel.findAll('item') for item in items: if item.fetch('wp...
agpl-3.0
Python
da389d740e0a13ca4ac8ba4132976fe2ca8cff53
fix err check
syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin,syscoin/syscoin
test/functional/feature_asset_burn.py
test/functional/feature_asset_burn.py
#!/usr/bin/env python3 # Copyright (c) 2019-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import SyscoinTestFramework from test_framework.util import assert_equ...
#!/usr/bin/env python3 # Copyright (c) 2019-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import SyscoinTestFramework from test_framework.util import assert_equ...
mit
Python
0d6a5273e8ee6700b81f7ea00b085e1aec264e2b
Make sure that the catch-all urlpattern in projects is at the bottom of urlpatterns in urls.py
mozilla/mozilla-ignite,mozilla/betafarm,mozilla/betafarm,mozilla/mozilla-ignite,mozilla/mozilla-ignite,mozilla/betafarm,mozilla/betafarm,mozilla/mozilla-ignite
urls.py
urls.py
from django.conf import settings from django.conf.urls.defaults import patterns, include from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^admin/', include(admin.site.urls)), (r'^browserid/', include('django_browserid.urls')), (r'^events', include('events.urls')), (r...
from django.conf import settings from django.conf.urls.defaults import patterns, include from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^admin/', include(admin.site.urls)), (r'^browserid/', include('django_browserid.urls')), (r'', include('projects.urls')), (r'', i...
bsd-3-clause
Python
1b494d4d4b462ca2f68b072ebb078c0f2b00dc71
fix urls
suvit/django-tinymce-images,suvit/django-tinymce-images
urls.py
urls.py
# -*- encoding: utf-8 -*- from django.conf.urls.defaults import * url_prefix = 'tiny_mce/images/' urlpatterns = patterns('tinymce_images.view', #url(r'download/$', tiny_views.download), #url(r'^$', tiny_views.all), url(r'^new_folder/(?P<name>\w+)/(?P<path>[a-zA-Z0-9_/]*)$', 'new_folder', {}, 'new_...
# -*- encoding: utf-8 -*- from django.conf.urls.defaults import * url_prefix = 'tiny_mce/images/' urlpatterns = patterns('tinymce_images.view', #url(r'download/$', tiny_views.download), #url(r'^$', tiny_views.all), url(r'^new_folder/(?P<name>\w+)/(?P<path>[a-zA-Z0-9_/]*)$', 'new_folder', {}, 'new_...
mit
Python
ce7bddf80dc58e1fa7e4fefe7890c9c23e549c29
Add datetime function to convert date into a numerical format.
weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,UWPCE-PythonCert/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,weidnem/IntroPython2016
students/psbriant/final_project/clean_data.py
students/psbriant/final_project/clean_data.py
""" Name: Paul Briant Date: 12/11/16 Class: Introduction to Python Assignment: Final Project Description: Code for Final Project """ import pandas import matplotlib.pyplot as plt from datetime import datetime def clean(data): """ Take in data and return cleaned version. """ # Remove Date Values colu...
""" Name: Paul Briant Date: 12/11/16 Class: Introduction to Python Assignment: Final Project Description: Code for Final Project """ import pandas import matplotlib.pyplot as plt from datetime import datetime def clean(data): """ Take in data and return cleaned version. """ # Remove Date Values colu...
unlicense
Python
9017e170f6d689bc0aae7c9d0c3ed3ea72f7eac5
update all other commands to new method
Jeikko/Redball-Cogs
arkserver/arkserver.py
arkserver/arkserver.py
import discord from discord.ext import commands from .utils import checks from __main__ import send_cmd_help import os import asyncio from subprocess import PIPE, run def out(command): result = run(command, stdout=PIPE, stderr=PIPE, universal_newlines=True, shell=True) return result.stdout class arkserver: """Ark ...
import discord from discord.ext import commands from .utils import checks from __main__ import send_cmd_help import os import asyncio from subprocess import PIPE, run def out(command): result = run(command, stdout=PIPE, stderr=PIPE, universal_newlines=True, shell=True) return result.stdout class arkserver: """Ark ...
mit
Python
88e0ec5ff58f7dabb531749472a410498c8e7827
Use itertools.repeat over slower alternatives.
ZhukovAlexander/skiplist-python
py_skiplist/iterators.py
py_skiplist/iterators.py
from itertools import dropwhile, count, repeat import random def geometric(p): return (next(dropwhile(lambda _: random.randint(1, int(1. / p)) == 1, count())) for _ in repeat(1)) # Simple deterministic distribution for testing internals of the skiplist. uniform = repeat
from itertools import dropwhile, count, cycle import random def geometric(p): return (next(dropwhile(lambda _: random.randint(1, int(1. / p)) == 1, count())) for _ in cycle([1])) def uniform(n): """ Simple deterministic distribution for testing internal of the skiplist """ return (n for _ in cyc...
mit
Python
da7f7c352ab2a6b2879e7b9d229c0b78a73d64e8
Bump version
laughingman7743/PyAthenaJDBC,laughingman7743/PyAthenaJDBC
pyathenajdbc/__init__.py
pyathenajdbc/__init__.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals import datetime __version__ = '1.0.5' __athena_driver_version__ = '1.0.0' # Globals https://www.python.org/dev/peps/pep-0249/#globals apilevel = '2.0' threadsafety = 3 paramstyle = 'pyformat' ATHENA_JAR = 'Athe...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals import datetime __version__ = '1.0.4' __athena_driver_version__ = '1.0.0' # Globals https://www.python.org/dev/peps/pep-0249/#globals apilevel = '2.0' threadsafety = 3 paramstyle = 'pyformat' ATHENA_JAR = 'Athe...
mit
Python
c201cfbf12286da220f0b656bbef256132554a66
switch nose to pytest remocing class implementation
sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana
test/scripts/test_sequana_taxonomy.py
test/scripts/test_sequana_taxonomy.py
from sequana.scripts import taxonomy from sequana import sequana_data import pytest prog = "sequana_taxonomy" @pytest.fixture def krakendb(): # todo try: taxonomy.main(["taxonomy", '--download', 'toydb']) except SystemExit: pass def test_analysis(krakendb): file1 = sequana_data("Hm2_...
from sequana.scripts import taxonomy from nose.plugins.attrib import attr from sequana import sequana_data class TestPipeline(object): @classmethod def setup_class(klass): klass.prog = "sequana_taxonomy" klass.params = {'prog': klass.prog} def setUp(self): try: ...
bsd-3-clause
Python
ba22bc23bf5d145e543a2f1b08fc0d6ea9247710
Fix chunk alignment
matwey/pybeam
pybeam/beam_construct.py
pybeam/beam_construct.py
# # Copyright (c) 2013 Matwey V. Kornilov <matwey.kornilov@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, ...
# # Copyright (c) 2013 Matwey V. Kornilov <matwey.kornilov@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, ...
mit
Python
ac4e2f23014c6aa2e3f27cd2556dd06e5188d5e2
Update tree package __init__ to match other subpackages.
pyconll/pyconll,pyconll/pyconll
pyconll/tree/__init__.py
pyconll/tree/__init__.py
""" Defines a tree data structure for internal use within pyconll. This module's logic is not intended to be used outside of pyconll, and is exposed here only so that pyconll methods that expose the Tree data structure will have appropriate documentation. """ __all__ = ['tree'] from .tree import Tree
""" Defines the modules for interfacing with CoNLL sentences as trees. This is a utility module which when provided a Sentence constructs the appropriate or corresponding tree structure. """
mit
Python
2a402751f03da41aa9da4bed5add89e4746b5de9
Bump version
messente/verigator-python
messente/verigator/__init__.py
messente/verigator/__init__.py
__version__ = "1.0.0"
__version__ = "0.0.1"
apache-2.0
Python
93bfbbb5ef729dd78087e8846cbe924b21b6e87e
Simplify plugin info declaration
pyexcel/pyexcel-text,pyexcel/pyexcel-text
pyexcel_text/__init__.py
pyexcel_text/__init__.py
""" pyexcel_text ~~~~~~~~~~~~~~~~~~~ Provide text output :copyright: (c) 2014-2016 by C. W. :license: New BSD """ from pyexcel.internal.common import PyexcelPluginList __pyexcel_plugins__ = PyexcelPluginList(__name__).add_a_renderer( submodule='_text', file_types=[ 'html', ...
""" pyexcel_text ~~~~~~~~~~~~~~~~~~~ Provide text output :copyright: (c) 2014-2016 by C. W. :license: New BSD """ __TEXT_META__ = { 'plugin_type': 'renderer', 'submodule': '_text', 'file_types': [ 'html', 'simple', 'plain', 'grid', 'pipe', ...
bsd-3-clause
Python
0a1b3e2f27276145dc1c5698a5541b5d85f03091
implement /login route
NaturalSolutions/NsPortal,NaturalSolutions/NsPortal,NaturalSolutions/NsPortal
Back/ns_portal/resources/root/security/oauth2/v1/login/login_resource.py
Back/ns_portal/resources/root/security/oauth2/v1/login/login_resource.py
from ns_portal.core.resources import ( MetaEndPointResource ) from marshmallow import ( Schema, fields, EXCLUDE, ValidationError ) from ns_portal.database.main_db import ( TUsers ) from sqlalchemy import ( and_, select ) from sqlalchemy.orm.exc import ( MultipleResultsFound ) from ns...
from ns_portal.core.resources import ( MetaEndPointResource ) class LoginResource(MetaEndPointResource): pass
mit
Python
f84da456028c5148f8c18041924a2f264ea6484b
set production s3 to use the cloudfront cdn
dstufft/jutils
crate_project/settings/production/base.py
crate_project/settings/production/base.py
from ..base import * SITE_ID = 3 EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" SERVER_EMAIL = "server@crate.io" DEFAULT_FROM_EMAIL = "donald@crate.io" CONTACT_EMAIL = "donald@crate.io" MIDDLEWARE_CLASSES += ["privatebeta.middleware.PrivateBetaMiddleware"] DEFAULT_FILE_STORAGE = "storages.backends.s...
from ..base import * SITE_ID = 3 EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" SERVER_EMAIL = "server@crate.io" DEFAULT_FROM_EMAIL = "donald@crate.io" CONTACT_EMAIL = "donald@crate.io" MIDDLEWARE_CLASSES += ["privatebeta.middleware.PrivateBetaMiddleware"] DEFAULT_FILE_STORAGE = "storages.backends.s...
bsd-2-clause
Python
7f0f1f9eddb10eb4bde1173bc02272b1ae3bd7b7
Add celerybeat tasks to test_project settings
yprez/django-useful,yprez/django-useful
test_project/test_project/settings.py
test_project/test_project/settings.py
# Django settings for test_project project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'test.db', } } TIME_ZONE = 'Etc/UTC' LANGUAGE_CODE = 'en-u...
# Django settings for test_project project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'test.db', } } TIME_ZONE = 'Etc/UTC' LANGUAGE_CODE = 'en-u...
isc
Python