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
3e10485f87f2e3a38c207d7cfe3eeec92b90fbd7
bump version number
rasbt/biopandas,rasbt/biopandas
biopandas/__init__.py
biopandas/__init__.py
# BioPandas # Author: Sebastian Raschka <mail@sebastianraschka.com> # License: BSD 3 clause # Project Website: http://rasbt.github.io/biopandas/ # Code Repository: https://github.com/rasbt/biopandas # # # # # PEP0440 compatible formatted version, see: # https://www.python.org/dev/peps/pep-0440/ # # Generic release mark...
# BioPandas # Author: Sebastian Raschka <mail@sebastianraschka.com> # License: BSD 3 clause # Project Website: http://rasbt.github.io/biopandas/ # Code Repository: https://github.com/rasbt/biopandas # # # # # PEP0440 compatible formatted version, see: # https://www.python.org/dev/peps/pep-0440/ # # Generic release mark...
bsd-3-clause
Python
58685b56199c90cc3e85e0ccbdc4ecd15a750f80
fix import
guziy/basemap,matplotlib/basemap,guziy/basemap,matplotlib/basemap
examples/lic_demo.py
examples/lic_demo.py
# example showing how to use Line Integral Convolution to visualize a vector # flow field (from Hurricane Earl). Produces something akin to streamlines. # Requires vectorplot scikit (http://scikits.appspot.com/vectorplot). try: from netCDF4 import Dataset as NetCDFFile except ImportError: from mpl_toolkits.bas...
# example showing how to use Line Integral Convolution to visualize a vector # flow field (from Hurricane Earl). Produces something akin to streamlines. # Requires vectorplot scikit (http://scikits.appspot.com/vectorplot). try: from netCDF4 import Dataset as NetCDFFile except ImportError: from mpl_toolkits.bas...
mit
Python
1e04152b69f88f6512920db8ccdd9ba2f0201517
Fix api mobile only with geotrek flatpages trekking tourism
GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin
geotrek/api/mobile/urls.py
geotrek/api/mobile/urls.py
from __future__ import unicode_literals from django.conf import settings from django.conf.urls import url, include from rest_framework import routers if 'geotrek.flatpages' and 'geotrek.trekking' and 'geotrek.tourism' in settings.INSTALLED_APPS: from geotrek.api.mobile import views as api_mobile router = rou...
from __future__ import unicode_literals from django.conf import settings from django.conf.urls import url, include from rest_framework import routers if 'geotrek.flatpages' and 'geotrek.trekking' and 'geotrek.tourism': from geotrek.api.mobile import views as api_mobile router = routers.DefaultRouter() ur...
bsd-2-clause
Python
7f01bb8b81fb51f28a42307d655885b4fb8eef92
Update api.py
ruoshuifuping/AdslProxyPool
adslproxy/api.py
adslproxy/api.py
import json import tornado.ioloop import tornado.web from tornado.web import RequestHandler, Application from adslproxy.config import * from adslproxy.db import RedisClient class MainHandler(RequestHandler): def initialize(self, redis): self.redis = redis def get(self, api=''): if not api: ...
import json import tornado.ioloop import tornado.web from tornado.web import RequestHandler, Application from adslproxy.config import * from adslproxy.db import RedisClient class MainHandler(RequestHandler): def initialize(self, redis): self.redis = redis def get(self, api=''): if not api: ...
mit
Python
84ceca42c746924b568959740a9a5366f23305b1
Update image_identifier.py
Bindernews/TheHound
identifiers/image_identifier.py
identifiers/image_identifier.py
# Identifier for basic image files from identifier import Result JPEG_PATTERNS = [ 'FF D8 FF E1', 'FF D8 FF E1', 'FF D8 FF FE', ] GIF_PATTERNS = [ '47 49 46 38 39 61', '47 49 46 38 37 61', ] PNG_PATTERNS = [ '89 50 4E 47' ] BMP_PATTERNS = [ '42 4D 62 25', '42 4D F8 A9', '42 4D 76 02', ] ICO_PATTERNS = [ ...
# Identifier for basic image files from identifier import Result JPEG_PATTERNS = [ 'FF D8 FF E1', 'FF D8 FF E1', 'FF D8 FF FE', ] GIF_PATTERNS = [ '47 49 46 38 39 61', '47 49 46 38 37 61', ] PNG_PATTERNS = [ '89 50 4E 47' ] BMP_PATTERNS = [ '42 4D 62 25', '42 4D F8 A9', '42 4D 76 02', ] class PngResolver...
mit
Python
f821e9a38b3a9d844739a2bde640ed5b044a4f80
update integration_test.py
dpranke/pyn,dpranke/pyn
integration_test.py
integration_test.py
import os import textwrap import unittest import main_test import parser_test from host import Host PATH_TO_THIS_MODULE = os.path.abspath(__file__) def path_to_main(): path = os.path.join(os.path.dirname(PATH_TO_THIS_MODULE), 'main.py') return path.replace(' ', '\\ ') class IntegrationTestArgs(main_test...
import os import textwrap import unittest import main_test import parser_test from host import Host PATH_TO_THIS_MODULE = os.path.abspath(__file__) def path_to_main(): path = os.path.join(os.path.dirname(PATH_TO_THIS_MODULE), 'main.py') return path.replace(' ', '\\ ') class IntegrationTestArgs(main_test...
apache-2.0
Python
3ec102074b52fe3dc3fdb4fae4cec23bad779679
Handle BadStatusLine
katoken-0215/FikaNote,sassy/FikaNote,sassy/FikaNote,gmkou/FikaNote,gmkou/FikaNote,katoken-0215/FikaNote,katoken-0215/FikaNote,sassy/FikaNote,gmkou/FikaNote
app/agenda.py
app/agenda.py
#!/usr/bin/env python #coding:utf-8 from agendaform import AgendaForm from django.shortcuts import render from django.http import HttpResponse,Http404,QueryDict from app.models import AgendaDB import urllib2 from BeautifulSoup import BeautifulSoup import json import datetime import httplib def agenda(request): if...
#!/usr/bin/env python #coding:utf-8 from agendaform import AgendaForm from django.shortcuts import render from django.http import HttpResponse,Http404,QueryDict from app.models import AgendaDB import urllib2 from BeautifulSoup import BeautifulSoup import json import datetime def agenda(request): if request.method...
mit
Python
ef8dec5fe547841709753f5f821fa853f8e8b70a
bump version
WIPACrepo/iceprod,WIPACrepo/iceprod,WIPACrepo/iceprod,WIPACrepo/iceprod
iceprod/__init__.py
iceprod/__init__.py
"""The IceProd Grid Middleware and tools.""" from __future__ import absolute_import, division, print_function # version is a human-readable version number. # version_info is a four-tuple for programmatic comparison. The first # three numbers are the components of the version number. The fourth # is zero for an offic...
"""The IceProd Grid Middleware and tools.""" from __future__ import absolute_import, division, print_function # version is a human-readable version number. # version_info is a four-tuple for programmatic comparison. The first # three numbers are the components of the version number. The fourth # is zero for an offic...
mit
Python
3166d48bed0bd7663a3332736a236d8f424b6cd3
Check hub permission @ report_availability
iver56/useat-api
room/views.py
room/views.py
from .models import Room from rest_framework import viewsets from .serializers import RoomDetailSerializer, RoomListSerializer from rest_framework.decorators import detail_route from django.core.exceptions import PermissionDenied from rest_framework.exceptions import ParseError from rest_framework.response import Respo...
from .models import Room from rest_framework import viewsets from .serializers import RoomDetailSerializer, RoomListSerializer from rest_framework.decorators import detail_route from django.core.exceptions import PermissionDenied from rest_framework.exceptions import ParseError from rest_framework.response import Respo...
mit
Python
cc29b7b256e9497b518ec00d0e877e7095a9b7de
add dial function
Studio-Link/webapp,Studio-Link/webapp,Studio-Link/webapp,Studio-Link/webapp
app/controllers/calls.py
app/controllers/calls.py
# -*- encoding: utf-8; py-indent-offset: 4 -*- # +--------------------------------------------------------------------------+ # | _____ __ ___ ______ __ | # | / ___// /___ ______/ (_)___ / ____/___ ____ ____ ___ _____/ /_ | # | \__ \/ __/ / / / __ / / __ \ ...
# -*- encoding: utf-8; py-indent-offset: 4 -*- # +--------------------------------------------------------------------------+ # | _____ __ ___ ______ __ | # | / ___// /___ ______/ (_)___ / ____/___ ____ ____ ___ _____/ /_ | # | \__ \/ __/ / / / __ / / __ \ ...
bsd-2-clause
Python
776ddc8ed6f74fbc45b831890b77af6ef7938d75
Remove pointless shebang from sortable example
plumdog/flask_table,plumdog/flask_table,plumdog/flask_table
examples/sortable.py
examples/sortable.py
from flask_table import Table, Col, LinkCol from flask import Flask, Markup, request, url_for """ A example for creating a Table that is sortable by its header """ app = Flask(__name__) class SortableTable(Table): id = Col('ID') name = Col('Name') description = Col('Description') link = LinkCol('Link...
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask_table import Table, Col, LinkCol from flask import Flask, Markup, request, url_for """ A example for creating a Table that is sortable by its header """ app = Flask(__name__) class SortableTable(Table): id = Col('ID') name = Col('Name') descriptio...
bsd-3-clause
Python
d5bf3928af1611b52c32a8d68eda4c3ed418f220
Remove older code
AstroHuntsman/POCS,joshwalawender/POCS,panoptes/POCS,panoptes/POCS,joshwalawender/POCS,AstroHuntsman/POCS,joshwalawender/POCS,AstroHuntsman/POCS,AstroHuntsman/POCS,panoptes/POCS,panoptes/POCS
panoptes/state/states/default/ready.py
panoptes/state/states/default/ready.py
def on_enter(event_data): """ Once in the `ready` state our unit has been initialized successfully. The next step is to schedule something for the night. """ pan = event_data.model pan.say("Ok, I'm all set up and ready to go!") pan.wait_until_mount('is_home', 'schedule')
def on_enter(event_data): """ Once in the `ready` state our unit has been initialized successfully. The next step is to schedule something for the night. """ pan = event_data.model pan.say("Ok, I'm all set up and ready to go!") next_state = 'schedule' pan.wait_until_mount('is_home', 's...
mit
Python
06efc0e6edb53fd8557e09485e4f478cd10793ad
Remove unused import
pinax/pinax-notifications,coldmind/pinax-notifications,aaronc-bixly/notifications,aaronc-bixly/notifications,coldmind/pinax-notifications,pinax/pinax-notifications,affiliprint/pinax-notifications,affiliprint/pinax-notifications,sherzberg/django-notification,synasius/pinax-notifications,sherzberg/django-notification,syn...
pinax/notifications/compat.py
pinax/notifications/compat.py
import django from django.conf import settings # Django 1.5 add support for custom auth user model if django.VERSION >= (1, 5): AUTH_USER_MODEL = settings.AUTH_USER_MODEL else: AUTH_USER_MODEL = "auth.User" def old_get_user_model(): return User try: from django.contrib.auth import get_user_model ...
import django from django.conf import settings from django.utils import six # Django 1.5 add support for custom auth user model if django.VERSION >= (1, 5): AUTH_USER_MODEL = settings.AUTH_USER_MODEL else: AUTH_USER_MODEL = "auth.User" def old_get_user_model(): return User try: from django.contri...
mit
Python
ce390ce2168c1c363fe7f26de676304452a87337
update get_version to support PEP386
suvit/speedydeploy,suvit/speedydeploy
speedydeploy/__init__.py
speedydeploy/__init__.py
# -*- coding: utf-8 -*- VERSION = __version__ = (0, 1, 0, 'beta', 2) def get_version(version=None): """Derives a PEP386-compliant version number from VERSION.""" if version is None: version = VERSION assert len(version) == 5 assert version[3] in ('alpha', 'beta', 'rc', 'final') # Now build...
# -*- coding: utf-8 -*- VERSION = __version__ = (0, 1, 0, 'beta', 2) def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) if VERSION[2]: version = '%s.%s' % (version, VERSION[2]) if VERSION[3:] == ('alpha', 0): version = '%s pre-alpha' % version else: if VERSION[3] !=...
mit
Python
c46ff2d0932a9179a45de9a9c456318a2d15889c
Remove print
tonioo/rst2pdf,aquavitae/rst2pdf,aquavitae/rst2pdf-py3-dev,tonioo/rst2pdf,sychen/rst2pdf,sychen/rst2pdf,openpolis/rst2pdf-patched-docutils-0.8,aquavitae/rst2pdf,aquavitae/rst2pdf-py3-dev,openpolis/rst2pdf-patched-docutils-0.8
rst2pdf/counter_role.py
rst2pdf/counter_role.py
# -*- coding: utf-8 -*- from docutils.nodes import Text, target values = {} class CounterNode(Text): children = () def __init__(self, data, rawsource=''): if ':' in data: self.name, value = [s.lower() for s in data.split(':')][:2] self.value=int(value) else: ...
# -*- coding: utf-8 -*- from docutils.nodes import Text, target values = {} class CounterNode(Text): children = () def __init__(self, data, rawsource=''): if ':' in data: self.name, value = [s.lower() for s in data.split(':')][:2] self.value=int(value) else: ...
mit
Python
3329afe6793b7140e418ffe549a9411bbd768a8f
Add utility functions
rmoorman/sqlalchemy-i18n,kvesteri/sqlalchemy-i18n
sqlalchemy_i18n/utils.py
sqlalchemy_i18n/utils.py
from inspect import isclass import sqlalchemy as sa def get_current_locale(obj): from sqlalchemy_utils import i18n locale = i18n.get_locale() if locale: return str(locale) return obj.locale def get_fallback_locale(obj): manager = obj.__translatable__['manager'] locale = manager.opt...
from inspect import isclass import sqlalchemy as sa def option(obj_or_class, option): class_ = obj_or_class if isclass(obj_or_class) else obj_or_class.__class__ manager = class_.__translatable__['manager'] return manager.option(class_, option) def all_translated_columns(model): for column in sa.insp...
bsd-3-clause
Python
762f5d686c59d5a08820d9dbae682cd94826a430
Bump app version to 2016.1
kernelci/kernelci-backend,kernelci/kernelci-backend
app/handlers/__init__.py
app/handlers/__init__.py
__version__ = "2016.1" __versionfull__ = __version__
__version__ = "2015.12" __versionfull__ = __version__
lgpl-2.1
Python
94fd99bd37a08a8a467096896cfc86744b6e7862
update version to 1.32.1
instana/python-sensor,instana/python-sensor
instana/version.py
instana/version.py
# (c) Copyright IBM Corp. 2021 # (c) Copyright Instana Inc. 2020 # Module version file. Used by setup.py and snapshot reporting. VERSION = '1.32.1'
# (c) Copyright IBM Corp. 2021 # (c) Copyright Instana Inc. 2020 # Module version file. Used by setup.py and snapshot reporting. VERSION = '1.32.0'
mit
Python
68ae2ff4026d7fbb68cf765b5c0667d33d7466ff
update version number
theno/fabsetup,theno/fabsetup
fabsetup/_version.py
fabsetup/_version.py
__version__ = "0.7.13" # semantic versioning: https://semver.org
__version__ = "0.7.12" # semantic versioning: https://semver.org
mit
Python
b3eba9e8f77db2a14eace4a0bb7c8a63e80c5fdc
Remove un-necessary view context.
La0/mozilla-relengapi,La0/mozilla-relengapi,garbas/mozilla-releng-services,lundjordan/build-relengapi,hwine/build-relengapi,hwine/build-relengapi,djmitche/build-relengapi,mrrrgn/build-relengapi-clobberer,srfraser/services,mozilla-releng/services,djmitche/build-relengapi,mozilla-releng/services,La0/mozilla-relengapi,and...
relengapi/blueprints/clobberer/__init__.py
relengapi/blueprints/clobberer/__init__.py
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import flask_login import logging import time from sqlalchemy import desc from flask import Blueprint from flask impor...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import flask_login import logging import time from sqlalchemy import desc from flask import Blueprint from flask impor...
mpl-2.0
Python
c411ff957a378d89812214443b1768f065c71f65
set default margin of error to 13%
pauloricardomg/cassandra-dtest,riptano/cassandra-dtest,krummas/cassandra-dtest,stef1927/cassandra-dtest,stef1927/cassandra-dtest,thobbs/cassandra-dtest,yukim/cassandra-dtest,spodkowinski/cassandra-dtest,riptano/cassandra-dtest,mambocab/cassandra-dtest,carlyeks/cassandra-dtest,carlyeks/cassandra-dtest,aweisberg/cassandr...
assertions.py
assertions.py
import re def assert_unavailable(fun, *args): import cql try: if len(args) == 0: fun(None) else: fun(*args) except cql.OperationalError as e: msg = str(e) assert re.search('one or more nodes were unavailable', msg), "Expecting unavailable exception, g...
import re def assert_unavailable(fun, *args): import cql try: if len(args) == 0: fun(None) else: fun(*args) except cql.OperationalError as e: msg = str(e) assert re.search('one or more nodes were unavailable', msg), "Expecting unavailable exception, g...
apache-2.0
Python
209666a3c108751e1e417c6ffd9212f072f7fbeb
Fix a few more deprecation warnings
thelabnyc/django-oscar-cch
src/oscarcch/migrations/0001_initial.py
src/oscarcch/migrations/0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.contrib.postgres.fields.hstore from django.contrib.postgres.operations import HStoreExtension class Migration(migrations.Migration): dependencies = [] operations = [ HStoreExtensio...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.contrib.postgres.fields.hstore from django.contrib.postgres.operations import HStoreExtension class Migration(migrations.Migration): dependencies = [] operations = [ HStoreExtensio...
isc
Python
4614247ea049a86e62fe9ab35237b5b2768f4a30
fix flake8
yuyu2172/chainercv,chainer/chainercv,chainer/chainercv,pfnet/chainercv,yuyu2172/chainercv
tests/datasets_tests/cub_tests/test_cub_label_dataset.py
tests/datasets_tests/cub_tests/test_cub_label_dataset.py
import unittest from chainer import testing from chainer.testing import attr from chainercv.datasets import cub_label_names from chainercv.datasets import CUBLabelDataset from chainercv.utils import assert_is_classification_dataset @testing.parameterize( {'crop_bbox': True}, {'crop_bbox': False} ) class Tes...
import unittest from chainer import testing from chainer.testing import attr from chainercv.datasets import CUBLabelDataset from chainercv.datasets import cub_label_names from chainercv.utils import assert_is_classification_dataset @testing.parameterize( {'crop_bbox': True}, {'crop_bbox': False} ) class Tes...
mit
Python
4ce06f6a4c2048a1725aa3cd0f6ee52446d3fdab
Add a simple test case for downloading image layers
duedil-ltd/portainer,duedil-ltd/portainer
portainer/util/test_squash.py
portainer/util/test_squash.py
import json import unittest from mock import patch from .squash import get_squash_layers, download_layers_for_image @patch('docker.client.Client') class SquashLayersTestCase(unittest.TestCase): def test_get_squash_layers_bottom(self, docker): self._mock_squash(docker, "A", "A", ["_A"]) def test_get...
import json import unittest from mock import patch from .squash import get_squash_layers @patch('docker.client.Client') class SquashLayersTestCase(unittest.TestCase): def test_get_squash_layers_bottom(self, docker): self._mock_squash(docker, "A", "A", ["_A"]) def test_get_squash_layers_direct_paren...
mit
Python
a7d4f28668f303da6834868963ba3f957d30a1fe
simplify (remove hack for supporting obsolete corpus format)
osma/annif,osma/annif,osma/annif
filter_corpus.py
filter_corpus.py
#!/usr/bin/env python from langdetect import detect_langs import sys import re concept_info = sys.stdin.readline().strip() print concept_info preflabel = sys.stdin.readline().strip() print preflabel FINNISH = re.compile(r'\b(ja|joka|oli|kuin|jossa|jotka|jonka)\b') SWEDISH = re.compile(r'\b(och|med|som)\b') ENGLISH =...
#!/usr/bin/env python from langdetect import detect_langs import sys import re concept_info = sys.stdin.readline().strip() print concept_info preflabel = sys.stdin.readline().strip() print preflabel FINNISH = re.compile(r'\b(ja|joka|oli|kuin|jossa|jotka|jonka)\b') SWEDISH = re.compile(r'\b(och|med|som)\b') ENGLISH =...
cc0-1.0
Python
8c107ce082b3974fa973d8a461108f401980959c
Update version
stasfilin/fastread
fastread/__init__.py
fastread/__init__.py
from .core import Fastread __version__ = '0.0.2' assert Fastread
from .core import Fastread __version__ = '0.0.1' assert Fastread
apache-2.0
Python
60db38ca747b23a5abac6725a7d8a854e6fd3217
Fix autocomplete mixin syntax
watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder
feder/main/mixins.py
feder/main/mixins.py
from django.core.paginator import Paginator, EmptyPage from guardian.mixins import PermissionRequiredMixin class ExtraListMixin(object): paginate_by = 25 extra_list_context = 'object_list' def paginator(self, object_list): paginator = Paginator(object_list, self.paginate_by) try: ...
from django.core.paginator import Paginator, EmptyPage from guardian.mixins import PermissionRequiredMixin class ExtraListMixin(object): paginate_by = 25 extra_list_context = 'object_list' def paginator(self, object_list): paginator = Paginator(object_list, self.paginate_by) try: ...
mit
Python
63dcf95e7ebccff2e28e50f6aaddd7c18289bd25
set version to 1.4.0
pytest-dev/execnet,alfredodeza/execnet
execnet/__init__.py
execnet/__init__.py
""" execnet ------- pure python lib for connecting to local and remote Python Interpreters. (c) 2012, Holger Krekel and others """ import apipkg __version__ = '1.4.0' apipkg.initpkg(__name__, { 'PopenGateway': '.deprecated:PopenGateway', 'SocketGateway': '.deprecated:SocketGateway', 'SshGateway...
""" execnet ------- pure python lib for connecting to local and remote Python Interpreters. (c) 2012, Holger Krekel and others """ import apipkg __version__ = '1.4.dev1' apipkg.initpkg(__name__, { 'PopenGateway': '.deprecated:PopenGateway', 'SocketGateway': '.deprecated:SocketGateway', 'SshGate...
mit
Python
4f3e16aee626094740cd39f85fa14e028880c826
extend fileupload slug
Foxugly/MyTaxAccountant,Foxugly/MyTaxAccountant,Foxugly/MyTaxAccountant,Foxugly/MyTaxAccountant
fileupload/models.py
fileupload/models.py
# -*- coding: utf-8 -*- # # Copyright 2015, Foxugly. All rights reserved. # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or (at # your option) any late...
# -*- coding: utf-8 -*- # # Copyright 2015, Foxugly. All rights reserved. # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or (at # your option) any late...
agpl-3.0
Python
1162b7047a842b87af61a69a9f01910619c15879
Add environment variable for notes
thomfort/notesCli
notes.py
notes.py
import StringIO import os NOTE_PATH = os.environ.get('NOTES_PATH') def list_tag(tags): if len(tags) == 0: pass for tag in tags: filename = NOTE_PATH + "/" + tag + ".txt" if not os.path.isfile(filename): continue f = open(filename) if os.stat(...
import StringIO import os def list_tag(tags): if len(tags) == 0: pass for tag in tags: filename = "/Users/thomasfortier/docs/notes/"+tag+".txt" f = open(filename) if os.stat(filename).st_size == 0: continue print "@"+tag print f.read() ...
mit
Python
8c362806c67c4dfa3c16dcb5de15f35597e458cc
fix eol
vhanla/CudaText,vhanla/CudaText,Alexey-T/CudaText,Alexey-T/CudaText,Alexey-T/CudaText,Alexey-T/CudaText,vhanla/CudaText,vhanla/CudaText,Alexey-T/CudaText,vhanla/CudaText,Alexey-T/CudaText,vhanla/CudaText,vhanla/CudaText,vhanla/CudaText,vhanla/CudaText,Alexey-T/CudaText,vhanla/CudaText,Alexey-T/CudaText
app/py/cuda_make_plugin/sample_body.py
app/py/cuda_make_plugin/sample_body.py
s = ''' file lines count: {cnt} option_int: {i} option_bool: {b} '''.format( cnt = ed.get_line_count(), i = option_int, b = option_bool, ) msg_box(s, MB_OK)
s = ''' file lines count: {cnt} option_int: {i} option_bool: {b} '''.format( cnt = ed.get_line_count(), i = option_int, b = option_bool, ) msg_box(s, MB_OK)
mpl-2.0
Python
e21046f87737f763fced96edce87de3ea7ce3731
fix convert string to dict error
alexfalcucc/douglas_bot
external/simsimi.py
external/simsimi.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # SimSimI Telegram Bot # This program is dedicated to the public domain under the CC0 license. import urllib import urllib3 import re from utils.utils import convert_str_to_dict from external.ed import get_ed_reply # Regular Expression to remove html tags r'<\/?\w+\s*[^...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # SimSimI Telegram Bot # This program is dedicated to the public domain under the CC0 license. import urllib import urllib3 import re from utils.utils import convert_str_to_dict from external.ed import get_ed_reply # Regular Expression to remove html tags r'<\/?\w+\s*[^...
mit
Python
b22c825280583617c7c8ab56e3183ce65c4df936
Make error message more user-friendly (#105)
Kaggle/kaggle-environments,Kaggle/kaggle-environments,Kaggle/kaggle-environments,Kaggle/kaggle-environments,Kaggle/kaggle-environments,Kaggle/kaggle-environments
kaggle_environments/__init__.py
kaggle_environments/__init__.py
# Copyright 2020 Kaggle 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 2020 Kaggle 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
d5117aeb6c525da5f6bc08970e933bc3002d13b2
Revert "Refactoring previous tests"
AlexGascon/MalTiempoBot
test/test_models.py
test/test_models.py
import unittest import json from src.models import Weather class TestWeather(unittest.TestCase): def setUp(self): self.json_api_response = open("./fixtures/weather.json").read() self.dict_api_response = json.loads(self.json_api_response) def test_json_constructor(self): test_weather...
import unittest import json from src.models import Weather class TestWeather(unittest.TestCase): """Testing the Weather model of the project""" def setUp(self): self.json_api_response = open("./fixtures/weather.json").read() self.dict_api_response = json.loads(self.json_api_response) de...
mit
Python
fa8d102bb2e00148a2153019b159540ef04a9ce1
Make modules uninstallable
OCA/l10n-brazil,akretion/l10n-brazil,OCA/l10n-brazil,akretion/l10n-brazil,akretion/l10n-brazil,OCA/l10n-brazil
l10n_br_purchase/__openerp__.py
l10n_br_purchase/__openerp__.py
# -*- coding: utf-8 -*- # Copyright (C) 2009 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { 'name': 'Brazilian Localization Purchase', 'license': 'AGPL-3', 'category': 'Localisation', 'author': 'Akretion, Odoo Community Association (OCA)', 'website': 'htt...
# -*- coding: utf-8 -*- # Copyright (C) 2009 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { 'name': 'Brazilian Localization Purchase', 'license': 'AGPL-3', 'category': 'Localisation', 'author': 'Akretion, Odoo Community Association (OCA)', 'website': 'htt...
agpl-3.0
Python
9820de2bf42c83e260415182de754a4c9676c6ee
Make test_record directly runnable
tofu-rocketry/apel,tofu-rocketry/apel,stfc/apel,apel/apel,stfc/apel,apel/apel
test/test_record.py
test/test_record.py
import unittest from apel.db.records import Record, InvalidRecordException class RecordTest(unittest.TestCase): ''' Test case for Record ''' # test for public interface def test_set_field(self): record = Record() self.assertRaises(InvalidRecordException, ...
from unittest import TestCase from apel.db.records import Record, InvalidRecordException class RecordTest(TestCase): ''' Test case for Record ''' # test for public interface def test_set_field(self): record = Record() self.assertRaises(InvalidRecordException, ...
apache-2.0
Python
07734f0b12b8f30cd967c631bc89799be3ec2699
add missing tests
ImmobilienScout24/aws-stager
src/unittest/python/aws_stager_tests.py
src/unittest/python/aws_stager_tests.py
from unittest import TestCase from mock import patch, Mock from aws_stager import fetch_candidate class AwsStagerTests(TestCase): def setUp(self): self.print_patcher = patch("aws_stager.candidates.print", create=True) self.print_patcher.start() def tearDown(self): self.print_patche...
from unittest import TestCase from mock import patch from aws_stager import fetch_candidate class AwsStagerTests(TestCase): def setUp(self): self.print_patcher = patch("aws_stager.candidates.print", create=True) self.print_patcher.start() def tearDown(self): self.print_patcher.stop...
mit
Python
cef32eb8b136497c4af2e9479892fdaa654ff864
Prepare v2.12.9.dev
jawilson/Flexget,jawilson/Flexget,JorisDeRieck/Flexget,Danfocus/Flexget,ianstalk/Flexget,Danfocus/Flexget,JorisDeRieck/Flexget,malkavi/Flexget,LynxyssCZ/Flexget,Flexget/Flexget,gazpachoking/Flexget,Flexget/Flexget,malkavi/Flexget,malkavi/Flexget,ianstalk/Flexget,Flexget/Flexget,tobinjt/Flexget,crawln45/Flexget,jawilson...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
586dec95bbd03700056a61fba62617c8d57876db
Prepare v2.10.62.dev
gazpachoking/Flexget,JorisDeRieck/Flexget,tobinjt/Flexget,JorisDeRieck/Flexget,ianstalk/Flexget,Danfocus/Flexget,JorisDeRieck/Flexget,LynxyssCZ/Flexget,jawilson/Flexget,qk4l/Flexget,Flexget/Flexget,Danfocus/Flexget,crawln45/Flexget,gazpachoking/Flexget,crawln45/Flexget,Danfocus/Flexget,crawln45/Flexget,Flexget/Flexget,...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
a9675975893ba51416b32449ac5a5e936400081c
Prepare v3.1.84.dev
crawln45/Flexget,Flexget/Flexget,Flexget/Flexget,crawln45/Flexget,Flexget/Flexget,crawln45/Flexget,crawln45/Flexget,Flexget/Flexget
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
90b0daea633cc885477e6440cc99c83c0e82c7b4
fix tests
scog1234/frontend,scog1234/frontend,keflavich/frontend,adamginsburg/frontend,adamginsburg/frontend,e-koch/frontend,keflavich/frontend,e-koch/frontend,camelot-project/frontend,camelot-project/frontend,adamginsburg/frontend,camelot-project/frontend,scog1234/frontend,e-koch/frontend,keflavich/frontend
test_upload_form.py
test_upload_form.py
import os import json import ast import requests from bs4 import BeautifulSoup import github_helpers def test_upload_file(filename='benoitcommercon.csv', username='test_BenoitCommercon', adsid='unknown_adsid', doi='unknown_doi', email='tester_adamginsburg@gmail.com', ...
import json import ast import requests from bs4 import BeautifulSoup import github_helpers def test_upload_file(filename='benoitcommercon.csv', username='test_BenoitCommercon', adsid='unknown_adsid', doi='unknown_doi', email='tester_adamginsburg@gmail.com', ...
bsd-3-clause
Python
81f326252a9b119b5ba238e32916d59d2cf8d36e
Cover branches
lhupfeldt/multiconf
test/test.py
test/test.py
#!/usr/bin/python import sys, subprocess import os.path print "Running tests" rc = subprocess.call(('nosetests', '--with-coverage', '--cover-branches', '--cover-package=multiconf')) print "Validating demo for all envs" here = os.path.abspath(os.path.dirname(__file__)) for env_name in 'prod', 'preprod', 'devlocal', '...
#!/usr/bin/python import sys, subprocess import os.path print "Running tests" rc = subprocess.call(('nosetests', '--with-coverage', '--cover-package=multiconf')) print "Validating demo for all envs" here = os.path.abspath(os.path.dirname(__file__)) for env_name in 'prod', 'preprod', 'devlocal', 'devs', 'devi': p...
bsd-3-clause
Python
6df54729954d5f9bd25549c482b3bc170a338ff0
Make new test use contains assertion
mattrobenolt/invoke,frol/invoke,pfmoore/invoke,singingwolfboy/invoke,pyinvoke/invoke,kejbaly2/invoke,tyewang/invoke,pyinvoke/invoke,mkusz/invoke,frol/invoke,pfmoore/invoke,mkusz/invoke,mattrobenolt/invoke,kejbaly2/invoke
tests/completion.py
tests/completion.py
import sys from nose.tools import ok_ from _utils import ( _output_eq, IntegrationSpec, _dispatch, trap, expect_exit, assert_contains ) class ShellCompletion(IntegrationSpec): """ Shell tab-completion behavior """ def no_input_means_just_task_names(self): _output_eq('-c simple_ns_list -...
import sys from nose.tools import ok_ from _utils import _output_eq, IntegrationSpec, _dispatch, trap, expect_exit class ShellCompletion(IntegrationSpec): """ Shell tab-completion behavior """ def no_input_means_just_task_names(self): _output_eq('-c simple_ns_list --complete', "z_toplevel\n...
bsd-2-clause
Python
1afa4802cf42c844d5bcf2a5809fb8c4a741e2b9
Remove package prefixes in tests.
jaapverloop/knot
test_knot.py
test_knot.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from knot import Container, factory, service, provider class TestContainer(unittest.TestCase): def test_returns_return_value_provider(self): c = Container() def foo(container): return 'bar' c.add_provider(foo, Fal...
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import knot class TestContainer(unittest.TestCase): def test_returns_return_value_provider(self): c = knot.Container() def foo(container): return 'bar' c.add_provider(foo, False) self.assertEqual(c.provid...
mit
Python
659028840edba9b17f69cf31c7c72d824092516f
remove unused import
forrest-mao/python-sdk,jemygraw/python-sdk,qiniu/python-sdk
qiniu/services/storage/upload_progress_recorder.py
qiniu/services/storage/upload_progress_recorder.py
# -*- coding: utf-8 -*- import hashlib import json import os import tempfile from qiniu.compat import is_py2 class UploadProgressRecorder(object): """持久化上传记录类 该类默认保存每个文件的上传记录到文件系统中,用于断点续传 上传记录为json格式: { "size": file_size, "offset": upload_offset, "modify_time": file_modify_ti...
# -*- coding: utf-8 -*- import hashlib import json import os import tempfile from qiniu.compat import is_py2, is_py3 class UploadProgressRecorder(object): """持久化上传记录类 该类默认保存每个文件的上传记录到文件系统中,用于断点续传 上传记录为json格式: { "size": file_size, "offset": upload_offset, "modify_time": file_m...
mit
Python
25a6016173286f80324ea9408590063ddaeed206
Remove bogus import from a previous iteration.
SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange
tests/run.py
tests/run.py
#!/usr/bin/env python import sys import os HERE = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')) appengine_location = os.path.join(HERE, 'thirdparty', 'google_appengine') extra_paths = [HERE, os.path.join(appengine_location, 'lib', '...
#!/usr/bin/env python import sys import os HERE = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')) appengine_location = os.path.join(HERE, 'thirdparty', 'google_appengine') extra_paths = [HERE, os.path.join(appengine_location, 'lib', '...
apache-2.0
Python
b4e345d8816075d2313e48f15e0d96bd30e1f0ce
Test runner and python3 are compatible
datascopeanalytics/scrubadub,datascopeanalytics/scrubadub,deanmalmgren/scrubadub,deanmalmgren/scrubadub
tests/run.py
tests/run.py
#!/usr/bin/env python """Run the test suite that is specified in the .travis.yml file """ import os import subprocess import yaml import sys from colors import green, red PY3 = int(sys.version[0]) == 3 if PY3: unicode = str root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) def run_test(c...
#!/usr/bin/env python """Run the test suite that is specified in the .travis.yml file """ import os import subprocess import yaml from colors import green, red root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) def run_test(command): wrapped_command = "cd %s && %s" % (root_dir, command) ...
mit
Python
b0944e1f9a6c43f547a61f05bb5b75c2b3bf946e
Revert "a0"
8dspaces/iflask
todo/todo.py
todo/todo.py
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from datetime import datetime import os basedir = os.path.abspath(os.path.dirname(__file__)) SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir,'test.db') app = Flask(__name__) app.config.from_object(__name__) db = SQLAlchemy(app) cl...
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from datetime import datetime import os basedir = os.path.abspath(os.path.dirname(__file__)) SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir,'test.db') app = Flask(__name__) app.config.from_object(__name__) db = SQLAlchemy(app) cl...
mit
Python
bbd49b7b10728937bf0da2e2e0f05e5bf86e752b
update train_amt.py
yasfmy/chainer_attention_model
train_amt.py
train_amt.py
from itertools import tee from chainer import optimizers, cuda from chainer import Variable as V from yasfmy.models import AttentionMT from yasfmy.preprocessing import gen_lines, gen_batch, gen_word from yasfmy.wrapper import xp from yasfmy.vocabulary import Vocabulary as vocab def main(): src_lines = gen_lines(...
from itertools import tee from chainer import optimizers, cuda from chainer import Variable as V from yasfmy.models import AttentionMT from yasfmy.preprocessing import gen_lines, gen_batch, gen_word from yasfmy.wrapper import xp from yasfmy.vocabulary import Vocabulary as vocab def main(): src_lines1, src_lines2...
mit
Python
1efbeb1646094a1c4f0180f2b4b0f78d8ceeb24d
Update playground command
ivandardi/RustbotPython,ivandardi/RustbotPython
cogs/playground.py
cogs/playground.py
import json import logging import aiohttp import discord from discord.ext import commands log = logging.getLogger(__name__) class CodeBlock: missing_error = 'Missing code block. Please use the following markdown\n\\`\\`\\`language\ncode here\n\\`\\`\\`' def __init__(self, argument): try: ...
import json import logging import aiohttp from discord.ext import commands log = logging.getLogger(__name__) async def cleanup_code(content): """Automatically removes code blocks from the code.""" # remove ```rs\n``` if content.startswith('```') and content.endswith('```'): return '\n'.join(cont...
mit
Python
4676d3b66a9a304949f9aa8c174f1eab334263d3
update to 1.27.0
conan-io/conan,conan-io/conan,conan-io/conan
conans/__init__.py
conans/__init__.py
# Allow conans to import ConanFile from here # to allow refactors from conans.client.build.autotools_environment import AutoToolsBuildEnvironment from conans.client.build.cmake import CMake from conans.client.toolchain.cmake import CMakeToolchain from conans.client.build.meson import Meson from conans.client.build.msbu...
# Allow conans to import ConanFile from here # to allow refactors from conans.client.build.autotools_environment import AutoToolsBuildEnvironment from conans.client.build.cmake import CMake from conans.client.toolchain.cmake import CMakeToolchain from conans.client.build.meson import Meson from conans.client.build.msbu...
mit
Python
85480f7ef6da70cc23b1def27f072c434179e4b2
Update jogovelha.py
kauaramirez/devops-aula05
Src/jogovelha.py
Src/jogovelha.py
def inicializar(): tab = [ ] for i in range(3r53253): linha = [ ] for j in range(3=344322): linha.append("X") tab.append(linha) return tab def main( ): jogo = inicializar ( ) print (jogo) if_name_=="_main_": main( )
def inicializar(): tab = [ ] for i in range(3): linha = [ ] for j in range(3): linha.append("X") tab.append(linha) return tab def main( ): jogo = inicializar ( ) print (jogo) if_name_=="_main_": main( )
apache-2.0
Python
3b5f9480bc3142c6ee34cae2a5c1ba273d597473
remove benchmarks
numairmansur/RoBO,aaronkl/RoBO,automl/RoBO,aaronkl/RoBO,automl/RoBO,aaronkl/RoBO,numairmansur/RoBO
robo/benchmarks/lenet_mnist_with_costs_surrogate.py
robo/benchmarks/lenet_mnist_with_costs_surrogate.py
''' Created on Jul 1, 2015 @author: Aaron Klein ''' import numpy as np from sklearn.ensemble import RandomForestRegressor from ParameterConfigSpace.config_space import ConfigSpace def lenet_mnist_with_cost_surrogate(x): X = np.load("robo/benchmarks/data_lenet_mnist_with_cost_surrogate/data.npy") y = np.lo...
''' Created on Jul 1, 2015 @author: Aaron Klein ''' import numpy as np from sklearn.ensemble import RandomForestRegressor from ParameterConfigSpace.config_space import ConfigSpace def lenet_mnist_surrogate(x): X = np.load("robo/benchmarks/data_lenet_mnist_surrogate/data.npy") y = np.load("robo/benchmarks/...
bsd-3-clause
Python
dc78643e081bb8b620071e0b8e029f0cd564946c
revert change
benvanwerkhoven/kernel_tuner
test/strategies/test_strategies.py
test/strategies/test_strategies.py
from collections import OrderedDict import os import pytest import numpy as np import kernel_tuner from kernel_tuner.interface import strategy_map from kernel_tuner import util cache_filename = os.path.dirname(os.path.realpath(__file__)) + "/../test_cache_file.json" @pytest.fixture def vector_add(): kernel_stri...
from collections import OrderedDict import os import pytest import numpy as np import kernel_tuner from kernel_tuner.interface import strategy_map from kernel_tuner import util cache_filename = os.path.dirname(os.path.realpath(__file__)) + "/../test_cache_file.json" @pytest.fixture def vector_add(): kernel_stri...
apache-2.0
Python
a97e2996d14c8935be8307a2b16fed18c52cb60a
use NeighborsClassifier in test.
vibhorag/scikit-learn,jkarnows/scikit-learn,jzt5132/scikit-learn,thilbern/scikit-learn,bthirion/scikit-learn,aminert/scikit-learn,nvoron23/scikit-learn,luo66/scikit-learn,ashhher3/scikit-learn,shahankhatch/scikit-learn,eg-zhang/scikit-learn,Garrett-R/scikit-learn,yyjiang/scikit-learn,Akshay0724/scikit-learn,aetilley/sc...
scikits/learn/manifold/tests/test_locally_linear.py
scikits/learn/manifold/tests/test_locally_linear.py
import itertools import numpy as np from numpy.testing import assert_array_almost_equal from scikits.learn import neighbors, manifold #---------------------------------------------------------------------- # Test LLE by computing the reconstruction error on some manifolds. def test_lle_simple_grid(): # grid of e...
import itertools import numpy as np from numpy.testing import assert_array_almost_equal from scikits.learn import neighbors, manifold #---------------------------------------------------------------------- # Test LLE by computing the reconstruction error on some manifolds. def test_lle_simple_grid(): # grid of e...
bsd-3-clause
Python
4ad6084b867a094cb7691799719e76279eb12a5c
Make regions API safer
webknjaz/webchallenge-ato-children,webknjaz/webchallenge-ato-children,webknjaz/webchallenge-ato-children,webknjaz/webchallenge-ato-children
ato_children/api/views.py
ato_children/api/views.py
from django.contrib.auth.models import User from rest_framework import viewsets, status, permissions from rest_framework.response import Response from rest_framework.decorators import permission_classes from ..models import Gift, Volunteer, City from .serializers import (UserSerializer, GiftSerializer, ...
from django.contrib.auth.models import User from rest_framework import viewsets, status, permissions from rest_framework.response import Response from rest_framework.decorators import permission_classes from ..models import Gift, Volunteer, City from .serializers import (UserSerializer, GiftSerializer, ...
mit
Python
e98731b559b4f8aabfc2ee8d59a5268200affd69
Update utilityfuncs.py
jswoboda/GeoDataPython,jswoboda/GeoDataPython
GeoData/utilityfuncs.py
GeoData/utilityfuncs.py
#!/usr/bin/env python """ Created on Thu Sep 11 15:29:27 2014 @author: John Swoboda """ import numpy as np from tables import * def readMad_hdf5 (filename, paramstr): #timelims=None """@author: Anna Stuhlmacher madgrigal h5 read in function for the python implementation of GeoData for Madrigal Sondrestrom d...
#!/usr/bin/env python """ Created on Thu Sep 11 15:29:27 2014 @author: John Swoboda """
mit
Python
7146dfe2630b536a1ddc68cdc2849bec9e71974b
revert last change
uw-it-aca/canvas-sis-provisioner,uw-it-aca/canvas-sis-provisioner,uw-it-aca/canvas-sis-provisioner,uw-it-aca/canvas-sis-provisioner
sis_provisioner/management/commands/load_courses.py
sis_provisioner/management/commands/load_courses.py
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from sis_provisioner.management.commands import SISProvisionerCommand from sis_provisioner.dao.term import get_all_active_terms, sws_now from sis_provisioner.models.course import Course class Command(SISProvisionerCommand): he...
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from sis_provisioner.management.commands import SISProvisionerCommand from sis_provisioner.dao.term import get_all_active_terms, sws_now from sis_provisioner.models.course import Course class Command(SISProvisionerCommand): he...
apache-2.0
Python
eda5a1a83ada258a6665bb70d7fe195ba6f790c8
use sws_now for current dt
uw-it-aca/canvas-sis-provisioner,uw-it-aca/canvas-sis-provisioner,uw-it-aca/canvas-sis-provisioner,uw-it-aca/canvas-sis-provisioner
sis_provisioner/management/commands/load_courses.py
sis_provisioner/management/commands/load_courses.py
from sis_provisioner.management.commands import SISProvisionerCommand from sis_provisioner.dao.term import get_all_active_terms, sws_now from sis_provisioner.models import Course class Command(SISProvisionerCommand): help = "Loads courses for provisioning." def handle(self, *args, **options): """ ...
from sis_provisioner.management.commands import SISProvisionerCommand from sis_provisioner.dao.term import get_all_active_terms from sis_provisioner.models import Course class Command(SISProvisionerCommand): help = "Loads courses for provisioning." def handle(self, *args, **options): """ Load...
apache-2.0
Python
7e3aaaf0cfc4e12b9cc72eb857b2d828035a0fe8
Fix pep8 whitespace
mannytoledo/troposphere,cloudtools/troposphere,xxxVxxx/troposphere,johnctitus/troposphere,alonsodomin/troposphere,ikben/troposphere,unravelin/troposphere,yxd-hde/troposphere,jantman/troposphere,ptoraskar/troposphere,amosshapira/troposphere,DualSpark/troposphere,jdc0589/troposphere,horacio3/troposphere,inetCatapult/trop...
tests/test_basic.py
tests/test_basic.py
import unittest from troposphere import AWSObject, Template from troposphere.ec2 import Instance class TestBasic(unittest.TestCase): def test_badproperty(self): with self.assertRaises(AttributeError): Instance('ec2instance', foobar=True,) def test_badrequired(self): with self.ass...
import unittest from troposphere import AWSObject, Template from troposphere.ec2 import Instance class TestBasic(unittest.TestCase): def test_badproperty(self): with self.assertRaises(AttributeError): Instance('ec2instance', foobar=True,) def test_badrequired(self): with self.ass...
bsd-2-clause
Python
fd820427517c14238f79f6e10521c297eab869f2
Update test_jobdb.py
cloudmesh/pbs,rajpushkar83/pbs,rajpushkar83/pbs,cloudmesh/pbs,rajpushkar83/pbs,cloudmesh/pbs
tests/test_jobdb.py
tests/test_jobdb.py
""" run with python setup.py install; nosetests --nocapture tests/test_jobdb.py python setup.py install; nosetests tests/test_jobdb.py """ from cm_mongodb import JobDB import os # nosetest --nocapture class TestJobDB: def setup(self): # HEADING() self.db = JobDB() def teardown(self): ...
""" run with python setup.py install; nosetests --nocapture tests/test_jobdb.py python setup.py install; nosetests tests/test_jobdb.py """ from cloudmesh_base.util import HEADING from cloudmesh_base.util import path_expand from cloudmesh_job.cm_jobdb import JobDB import os # nosetest --nocapture class TestJobDB: ...
apache-2.0
Python
e2b72a6e435178543239abffa826c210d1da3d0f
add spacing
GeoscienceAustralia/PyRate,GeoscienceAustralia/PyRate
tests/test_merge.py
tests/test_merge.py
# coding: utf-8 # This Python module is part of the PyRate software package. # # Copyright 2017 Geoscience Australia # # 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:/...
# coding: utf-8 # This Python module is part of the PyRate software package. # # Copyright 2017 Geoscience Australia # # 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:/...
apache-2.0
Python
b9f195320f664bcfb5b8bb74ba6c2a871cad3a62
Bump up version for release
shanemgrey/django-rest-framework-jwt,kbussell/django-rest-framework-jwt,coUrbanize/django-rest-framework-jwt,sandipbgt/django-rest-framework-jwt,plentific/django-rest-framework-jwt,TrackMaven/django-rest-framework-jwt,skurtapp/django-rest-framework-jwt,abdulhaq-e/django-rest-framework-jwt,blaklites/django-rest-framewor...
rest_framework_jwt/__init__.py
rest_framework_jwt/__init__.py
__version__ = '1.1.0' # Version synonym VERSION = __version__
__version__ = '1.0.2' # Version synonym VERSION = __version__
mit
Python
bec1f0bdf9fef70b14955fab288ca73cc387f7b3
Update namespace and statuses handlers
polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon
api/events/tasks.py
api/events/tasks.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import logging from polyaxon_schemas.experiment import JobStateConfig from api.settings import CeleryTasks from api.celery_api import app as celery_app from clusters.models import ClusterEvents from libs.redis_db import RedisExp...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import logging from api.settings import CeleryTasks from api.celery_api import app as celery_app from clusters.models import ClusterErrors logger = logging.getLogger('polyaxon.tasks.events') @celery_app.task(name=CeleryTasks.E...
apache-2.0
Python
f9e58a52dad06caee5c7becd4e9025253a2571f4
add charliecloud/0.14; remove umoci/skopeo; remove builder variant (#15573)
LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack
var/spack/repos/builtin/packages/charliecloud/package.py
var/spack/repos/builtin/packages/charliecloud/package.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Charliecloud(AutotoolsPackage): """Lightweight user-defined software stacks for HPC.""" ...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Charliecloud(AutotoolsPackage): """Lightweight user-defined software stacks for HPC.""" ...
lgpl-2.1
Python
c23e8ace1bfbb4c23d24feaf452bf17363fd0cf8
update TableTestCase
esjeon/eatable
tests/test_table.py
tests/test_table.py
import unittest from eatable import Table, Row class TableTestCase(unittest.TestCase): """Test the methods of Table""" def setUp(self): self.header = ['A', 'B', 'C'] def test_from_csv_file(self): table = Table.from_csv_file("tests/simple.csv") self.assertEqual(len(table), 3) ...
import unittest from eatable import Table, Row class TableTestCase(unittest.TestCase): """Test the methods of Table""" def setUp(self): self.header = ['A', 'B', 'C'] def test_from_csv_file(self): table = Table.from_csv_file("tests/simple.csv") self.assertEqual(len(table), 3) ...
mit
Python
407aaae79719c4e6ef8319b396bd667161ad2e76
bump version
Stvad/anki
anki/__init__.py
anki/__init__.py
# -*- coding: utf-8 -*- # Copyright: Damien Elmes <anki@ichi2.net> # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import sys if sys.version_info[0] < 3: raise Exception("Anki should be run with Python 3") elif sys.version_info[1] < 4: raise Exception("Anki requires Python 3.4+"...
# -*- coding: utf-8 -*- # Copyright: Damien Elmes <anki@ichi2.net> # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import sys if sys.version_info[0] < 3: raise Exception("Anki should be run with Python 3") elif sys.version_info[1] < 4: raise Exception("Anki requires Python 3.4+"...
agpl-3.0
Python
30a510b69902e402e48d998036593364f19b38bc
Bump version for grizzly
mc2014/anvil,stackforge/anvil,mc2014/anvil,stackforge/anvil
anvil/version.py
anvil/version.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Yahoo! 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.or...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Yahoo! 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.or...
apache-2.0
Python
5d1c2b1db7c3deb426074c295bab982577573d11
Fix test class name (#12)
major/monitorstack
tests/test_utils.py
tests/test_utils.py
# Copyright 2017, Major Hayden <major@mhtx.net> # # 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 agr...
# Copyright 2017, Major Hayden <major@mhtx.net> # # 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 agr...
apache-2.0
Python
ae49b5c59b8b1729c4f021347b417cb26b8255e2
Add testing for l_to_lm: axis param.
praveenv253/sht,praveenv253/sht
tests/test_utils.py
tests/test_utils.py
#!/usr/bin/env python3 from __future__ import print_function, division import numpy as np from sht import isht from sht.grids import standard_grid from sht.utils import l_to_lm, argsort_thetaphi_wrt_theta def test_l_to_lm(): L = 10 x = np.random.randn(L) # Test without fill_zeros y = l_to_lm(x) ...
#!/usr/bin/env python3 from __future__ import print_function, division import numpy as np from sht import isht from sht.grids import standard_grid from sht.utils import l_to_lm, argsort_thetaphi_wrt_theta def test_l_to_lm(): L = 10 x = np.random.randn(L) # Test without fill_zeros y = l_to_lm(x) ...
mit
Python
41ae39b6c507bf3667dc2af05b68b2600ac7e7d6
initialize memcache client
podhub-io/follower
follower/__init__.py
follower/__init__.py
from flask import Flask, jsonify from werkzeug.exceptions import default_exceptions from werkzeug.exceptions import HTTPException import pylibmc def make_json_error(ex): response = jsonify(message=str(ex)) if isinstance(ex, HTTPException): response.status_code = ex.code else: response.stat...
from flask import Flask, jsonify from werkzeug.exceptions import default_exceptions from werkzeug.exceptions import HTTPException def make_json_error(ex): response = jsonify(message=str(ex)) if isinstance(ex, HTTPException): response.status_code = ex.code else: response.status_code = 500 ...
bsd-3-clause
Python
1b08c6d140fa9ec9622a91cc0b709d4f4b38daee
update version
pavlov99/jsonapi,pavlov99/jsonapi
jsonapi/__init__.py
jsonapi/__init__.py
""" JSON:API realization.""" __version = (0, 7, 3) __version__ = version = '.'.join(map(str, __version)) __project__ = PROJECT = __name__
""" JSON:API realization.""" __version = (0, 7, 2) __version__ = version = '.'.join(map(str, __version)) __project__ = PROJECT = __name__
mit
Python
c4d6665059832a49659baaaff2a771066b0ac39f
Remove unnecessary Mapping Code
flomotlik/formica
formica/yaml_tags.py
formica/yaml_tags.py
import yaml from yaml.nodes import SequenceNode, CollectionNode from yaml.resolver import BaseResolver class BaseFunction(yaml.YAMLObject): @classmethod def tag(self, node): return node.lstrip('!') @classmethod def fn_tag(self, node): return 'Fn::' + self.tag(node) @classmethod ...
import yaml from yaml.nodes import MappingNode, SequenceNode, CollectionNode from yaml.resolver import BaseResolver class BaseFunction(yaml.YAMLObject): @classmethod def tag(self, node): return node.lstrip('!') @classmethod def fn_tag(self, node): return 'Fn::' + self.tag(node) @...
mit
Python
5e7c61f4aa71ae6f644cb0c216defb990a92f465
Move product_data to separate function
maferelo/saleor,maferelo/saleor,UITools/saleor,maferelo/saleor,mociepka/saleor,mociepka/saleor,UITools/saleor,mociepka/saleor,UITools/saleor,UITools/saleor,UITools/saleor
saleor/order/emails_helpers.py
saleor/order/emails_helpers.py
import json from django.conf import settings from django.contrib.sites.models import Site from django.core.serializers.json import DjangoJSONEncoder from ..core.utils import build_absolute_uri def get_organization(): site = Site.objects.get_current() return { '@type': 'Organization', 'name':...
import json from django.conf import settings from django.contrib.sites.models import Site from django.core.serializers.json import DjangoJSONEncoder from ..core.utils import build_absolute_uri def get_organization(): site = Site.objects.get_current() organization_data = { '@type': 'Organization', ...
bsd-3-clause
Python
828550efe172c3037005fefa95ab5f101c3d915f
return a public IP, otherwise we can't ssh in
Financial-Times/paasport,Financial-Times/paasport,Financial-Times/paasport
provisioner/models/machine.py
provisioner/models/machine.py
import boto.ec2 # EU-WEST-1: RHEL7 HVM AMI_ID = 'ami-25158352' region = 'eu-west-1' def create_many(definitions, cluster_id): return map(format_instance, map(lambda data: create_new(data, cluster_id), definitions)) def create_new(data, cluster_id): # Always keep the nursery full name = data['name'] if 'name' in...
import boto.ec2 # EU-WEST-1: RHEL7 HVM AMI_ID = 'ami-25158352' region = 'eu-west-1' def create_many(definitions, cluster_id): return map(format_instance, map(lambda data: create_new(data, cluster_id), definitions)) def create_new(data, cluster_id): # Always keep the nursery full name = data['name'] if 'name' in...
mit
Python
71fd42a92b41529d9f5c784840ab4c190946adef
Remove spammy warning which doesn't apply when stores check emails
antoviaque/django-social-auth-norel
social_auth/backends/pipeline/associate.py
social_auth/backends/pipeline/associate.py
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist from social_auth.utils import setting from social_auth.models import UserSocialAuth from social_auth.backends.pipeline import warn_setting from social_auth.backends.exceptions import AuthException def associate_by_email(details, user=None...
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist from social_auth.utils import setting from social_auth.models import UserSocialAuth from social_auth.backends.pipeline import warn_setting from social_auth.backends.exceptions import AuthException def associate_by_email(details, user=None...
bsd-3-clause
Python
3d484694bd4d4a97f5ea93936e14412f68e9c2fe
Remove unneeded stuff
claria/i3pystatus,Elder-of-Ozone/i3pystatus,asmikhailov/i3pystatus,onkelpit/i3pystatus,paulollivier/i3pystatus,enkore/i3pystatus,onkelpit/i3pystatus,Arvedui/i3pystatus,Elder-of-Ozone/i3pystatus,fmarchenko/i3pystatus,ismaelpuerto/i3pystatus,MaicoTimmerman/i3pystatus,yang-ling/i3pystatus,eBrnd/i3pystatus,asmikhailov/i3py...
i3pystatus/core/modules.py
i3pystatus/core/modules.py
from i3pystatus.core.settings import SettingsBase from i3pystatus.core.threading import Manager from i3pystatus.core.util import convert_position class Module(SettingsBase): output = None position = 0 def registered(self, status_handler): """Called when this module is registered with a status ha...
import time from i3pystatus.core.settings import SettingsBase from i3pystatus.core.threading import Manager from i3pystatus.core.util import convert_position __all__ = [ "Module", "AsyncModule", "IntervalModule", ] class Module(SettingsBase): output = None position = 0 def registered(self, status_...
mit
Python
a4ea03ce85727cb394779ac9176af542bc1070f6
Revise Python snippet.
niucheng/Snippets,niucheng/Snippets,niucheng/Snippets
Python.py
Python.py
#!/usr/bin/env python # coding: utf-8 """Python snippet """ import os import sys if __name__ == '__main__': if len (sys.argv) == 1: print ("Hi there!") elif len (sys.argv) == 2: print ("Hello, %s!" % sys.argv[1]) else: print ("Usage: [python] %s nickname" % sys.argv[0])
#!/usr/bin/env python # coding: utf-8 """Python snippet """ import os import sys if __name__ == '__main__': if len (sys.argv) == 1: print ("Hi there!") else: print ("Hello, %s!" % sys.argv[1])
mit
Python
d8014fac942b1c51dbbc84a322afe1bcbb8f392e
Add Hermite Interpolation
LanceVan/SciCycle
HermiteInterpolation.py
HermiteInterpolation.py
import numpy as np from Interpolation import * class HermiteInterpolation(Interpolation): def __init__(self, x, y, yDrv): Interpolation.__init__(self, x, y) sizeyDrv = yDrv.shape if len(sizeyDrv) != 1: if not (len(sizeyDrv) == 2 and sizeyDrv[1] == 1): raise Val...
import numpy as np from Interpolation import * class HermiteInterpolation(Interpolation): def __init__(self, x, y, yDrv): Interpolation.__init__(self, x, y) sizeyDrv = yDrv.shape if len(sizeyDrv) != 1: if not (len(sizeyDrv) == 2 and sizeyDrv[1] == 1): raise Val...
mit
Python
7e4c38c482bc908e85d8121c8e9d70b07ad9cd0d
Remove reference to butter since butter is deprecated
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/returners/mongo_return.py
salt/returners/mongo_return.py
''' Return data to a mongodb server Required python modules: pymongo ''' import logging try: import pymongo has_pymongo = True except ImportError: has_pymongo = False log = logging.getLogger(__name__) __opts__ = {'mongo.db': 'salt', 'mongo.host': 'salt', 'mongo.password': '', ...
''' Return data to a mongodb server This is the default interface for returning data for the butter statd subsytem Required python modules: pymongo ''' import logging try: import pymongo has_pymongo = True except ImportError: has_pymongo = False log = logging.getLogger(__name__) __opts__ = {'mongo.db...
apache-2.0
Python
5e6f0da6dc0f07a7461aed5b7eb55a2a1ac94488
update version
pavlov99/json-rpc
jsonrpc/__init__.py
jsonrpc/__init__.py
__version = (0, 2, 2) __version__ = version = '.'.join(map(str, __version)) __project__ = PROJECT = __name__
__version = (0, 2, 1) __version__ = version = '.'.join(map(str, __version)) __project__ = PROJECT = __name__
mit
Python
9989a66a6072e96a1c5f12002fbefc743fb67f48
bump version
TadLeonard/tfatool
tfatool/_version.py
tfatool/_version.py
__version__ = "v2.5.0"
__version__ = "v2.4.1"
mit
Python
fff68f0293bc20e081b72770a18524fd8226ed28
remove last remnant of task stuff
pajlada/pajbot,pajlada/pajbot,pajlada/tyggbot,pajlada/tyggbot,pajlada/pajbot,pajlada/pajbot,pajlada/tyggbot,pajlada/tyggbot
pajbot/web/common/__init__.py
pajbot/web/common/__init__.py
import pajbot.web.common.assets import pajbot.web.common.filters import pajbot.web.common.menu
import pajbot.web.common.assets import pajbot.web.common.filters import pajbot.web.common.menu import pajbot.web.common.tasks
mit
Python
cf45253937a2ef86000a243b38490ed7dc17e276
Fix issue with load_instances
skylander86/ycml
ycml/scripts/partition_instances.py
ycml/scripts/partition_instances.py
""" This script is different from `ycml.scripts.partition_lines` because it takes labels into account and produces stratified partitions. """ from argparse import ArgumentParser import json import logging from sklearn.model_selection import train_test_split from ycml.utils import load_instances from ycml.utils impor...
""" This script is different from `ycml.scripts.partition_lines` because it takes labels into account and produces stratified partitions. """ from argparse import ArgumentParser import json import logging from sklearn.model_selection import train_test_split from ycml.utils import load_instances from ycml.utils impor...
apache-2.0
Python
0f2b5298307f5246a222b4592167116880feb08b
Fix user info command
zooniverse/panoptes-cli
panoptes_cli/commands/user.py
panoptes_cli/commands/user.py
import yaml import click from panoptes_cli.scripts.panoptes import cli from panoptes_client import Panoptes, User @cli.group() def user(): """Contains commands for retrieving information about users.""" pass @user.command() @click.option( '--email', '-e', help='Search for users by email addre...
import yaml import click from panoptes_cli.scripts.panoptes import cli from panoptes_client import Panoptes, User @cli.group() def user(): """Contains commands for retrieving information about users.""" pass @user.command() @click.option( '--email', '-e', help='Search for users by email addre...
apache-2.0
Python
2ca1d769389c09e4f54002e2c52ae193d0affa9a
Fix string format issue.
weijia/iconizer
iconizer/win/sysprocess.py
iconizer/win/sysprocess.py
import logging import pywintypes try: import win32com.client import win32api except: #Temp workaround for ci. pass log = logging #Codes from http://code.activestate.com/recipes/496767-set-process-priority-in-windows/ def set_priority(pid=None,priority=1): """ Set The Priority of a Windows Process...
import logging import pywintypes try: import win32com.client import win32api except: #Temp workaround for ci. pass log = logging #Codes from http://code.activestate.com/recipes/496767-set-process-priority-in-windows/ def set_priority(pid=None,priority=1): """ Set The Priority of a Windows Process...
bsd-3-clause
Python
61b30997eb7e8833484e74ea1bc9df0bcb4b7617
Fix epsilon in objectives
relh/keras,DeepGnosis/keras,daviddiazvico/keras,keras-team/keras,kemaswill/keras,kuza55/keras,nebw/keras,dolaameng/keras,keras-team/keras
keras/objectives.py
keras/objectives.py
from __future__ import absolute_import import numpy as np from . import backend as K def mean_squared_error(y_true, y_pred): return K.mean(K.square(y_pred - y_true), axis=-1) def root_mean_squared_error(y_true, y_pred): return K.sqrt(K.mean(K.square(y_pred - y_true), axis=-1)) def mean_absolute_error(y_tr...
from __future__ import absolute_import import numpy as np from . import backend as K def mean_squared_error(y_true, y_pred): return K.mean(K.square(y_pred - y_true), axis=-1) def root_mean_squared_error(y_true, y_pred): return K.sqrt(K.mean(K.square(y_pred - y_true), axis=-1)) def mean_absolute_error(y_tr...
mit
Python
6c3078dc4f65548081d89a34d775ad4678f42f82
add process bar
quheng/chalk,quheng/chalk,quheng/chalk
script/bag_of_words_builder.py
script/bag_of_words_builder.py
# -*- coding: utf-8 -*- """ Building bag of words model from raw data. The model structure is [ { filename: { words: amount }}] """ import os import os.path import logging import jieba import json from tqdm import tqdm BASE_DIR = os.path.dirname(os.path.dirname(__file__)) RAW_DATA_DIR = f'{BASE_DIR}/raw_data' BAG_OF...
# -*- coding: utf-8 -*- """ Building bag of words model from raw data. The model structure is [ { filename: { words: amount }}] """ import os import os.path import logging import jieba import json BASE_DIR = os.path.dirname(os.path.dirname(__file__)) RAW_DATA_DIR = f'{BASE_DIR}/raw_data' BAG_OF_WORDS = f'{BASE_DIR}/d...
mit
Python
493133d0015296ead327f25db0a5ae20d874ea0d
set config for basic auth realm, aka: pretty auth :p
datanel/navitia,lrocheWB/navitia,ballouche/navitia,frodrigo/navitia,xlqian/navitia,fueghan/navitia,antoine-de/navitia,djludo/navitia,TeXitoi/navitia,kadhikari/navitia,CanalTP/navitia,prhod/navitia,VincentCATILLON/navitia,pbougue/navitia,patochectp/navitia,thiphariel/navitia,djludo/navitia,Tisseo/navitia,CanalTP/navitia...
source/jormungandr/jormungandr/default_settings.py
source/jormungandr/jormungandr/default_settings.py
# encoding: utf-8 import logging # path of the configuration file for each instances INSTANCES_DIR = '/etc/jormungandr.d' # Start the thread at startup, True in production, False for test environments START_MONITORING_THREAD = True #URI for postgresql # postgresql://<user>:<password>@<host>:<port>/<dbname> #http://...
# encoding: utf-8 import logging # path of the configuration file for each instances INSTANCES_DIR = '/etc/jormungandr.d' # Start the thread at startup, True in production, False for test environments START_MONITORING_THREAD = True #URI for postgresql # postgresql://<user>:<password>@<host>:<port>/<dbname> #http://...
agpl-3.0
Python
c7ba089ccd399aa59f619b9ee511304ec68cd9d4
refactor extract_swagger_path tests
rantav/flask-restful-swagger,rantav/flask-restful-swagger,rantav/flask-restful-swagger
tests/test_extract_swagger_path.py
tests/test_extract_swagger_path.py
from flask_restful_swagger import swagger import pytest """ Docstring from extract_swagger_path: Extracts a swagger type path from the given flask style path. This /path/<parameter> turns into this /path/{parameter} And this /<string(length=2):lang_code>/<string:id>/<float:probability> to this: /{lang_code}/...
from flask_restful_swagger import swagger """ Docstring from extract_swagger_path: Extracts a swagger type path from the given flask style path. This /path/<parameter> turns into this /path/{parameter} And this /<string(length=2):lang_code>/<string:id>/<float:probability> to this: /{lang_code}/{id}/{probabil...
mit
Python
4b86a199e8b798c283121ce3c2af30b258d21a57
Update version
cloudboss/bossimage,cloudboss/bossimage
bossimage/__init__.py
bossimage/__init__.py
__version__ = '0.4.10'
__version__ = '0.4.9'
mit
Python
6811b04a0a2e311fc2d014cd601da61a2f17a451
Fix KeyError in Provide personal data form
m4tx/egielda,m4tx/egielda,m4tx/egielda
sell/views.py
sell/views.py
from django.core.urlresolvers import reverse from django.forms import model_to_dict from django.http.response import HttpResponseRedirect, HttpResponse from django.shortcuts import render from common.models import Student from sell.forms import PersonalDataForm def index(request): return HttpResponseRedirect(re...
from django.core.urlresolvers import reverse from django.forms import model_to_dict from django.http.response import HttpResponseRedirect, HttpResponse from django.shortcuts import render from common.models import Student from sell.forms import PersonalDataForm def index(request): return HttpResponseRedirect(re...
agpl-3.0
Python
d7c116ddbc64292b6bc62db2454c0071e45eca45
Clean up
veryhappythings/discord-gather
gather/gatherbot.py
gather/gatherbot.py
import logging import discord from gather.bot import ListenerBot from gather.organiser import Organiser logger = logging.getLogger(__name__) class GatherBot(ListenerBot): def __init__(self): super().__init__() self.organiser = Organiser() self.client = discord.Client() @self.cli...
import logging import discord from gather.bot import ListenerBot from gather.organiser import Organiser, PlayerNotFoundError logger = logging.getLogger(__name__) class GatherBot(ListenerBot): def __init__(self): super().__init__() self.organiser = Organiser() self.client = discord.Clien...
mit
Python
39e132807fafe54537130af6a60a958aad6f7287
update docstring for atomic_write
datalib/atomicio
atomicio/api.py
atomicio/api.py
""" atomicio.api ~~~~~~~~~~~~ Implements the functional API over the lower level, more verbose class machinery. """ import os from contextlib import contextmanager from .core import AtomicWriter def touch(fname, times=None): """ Create *fname* if it doesn't exist, else modifies the last ...
""" atomicio.api ~~~~~~~~~~~~ Implements the functional API over the lower level, more verbose class machinery. """ import os from contextlib import contextmanager from .core import AtomicWriter def touch(fname, times=None): """ Create *fname* if it doesn't exist, else modifies the last ...
mit
Python
d372dfa6382473a15cb0782358abb72825f437b0
Fix #3: crash if no serial ports available
djs/serialenum
serialenum.py
serialenum.py
from glob import glob import os import os.path from serial import Serial import sys def enumerate(): ports = [] if sys.platform == 'win32': # Iterate through registry because WMI does not show virtual serial ports import _winreg try: key = _winreg.OpenKey(_winreg.HKEY_LOC...
from glob import glob import os import os.path from serial import Serial import sys def enumerate(): ports = [] if sys.platform == 'win32': # Iterate through registry because WMI does not show virtual serial ports import _winreg key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r'HAR...
bsd-2-clause
Python
e7f9e433697be402bb6d771438f3aece94736bce
Update js2xml/__main__.py
redapple/js2xml,redapple/js2xml,redapple/js2xml,redapple/js2xml
js2xml/__main__.py
js2xml/__main__.py
#!/usr/bin/env python import sys from argparse import ArgumentParser import six import js2xml def main(): ap = ArgumentParser() ap.add_argument('--debug', action='store_true') ap.add_argument('filenames', nargs='*', default=['-']) args = ap.parse_args() mode = 'rU' if six.PY2 else 'r' for ...
#!/usr/bin/env python import sys from argparse import ArgumentParser import six import js2xml def main(): ap = ArgumentParser() ap.add_argument('--debug', action='store_true') ap.add_argument('filenames', nargs='*', default=['-']) args = ap.parse_args() if six.PY2: mode = 'rU' else:...
mit
Python
3b5d0bff500a91da90e99181a9e037581c680ff5
improve vanity address generation
ofek/bit,ofek/bit
bit/keygen.py
bit/keygen.py
import sys import time from multiprocessing import Event, Process, Queue, Value, cpu_count from coincurve import Context from bit.base58 import BASE58_ALPHABET, b58encode_check from bit.crypto import ECPrivateKey, ripemd160_sha256 from bit.format import bytes_to_wif, public_key_to_address def generate_key_address_p...
from multiprocessing import Event, Process, Queue, cpu_count from coincurve import Context from bit.base58 import BASE58_ALPHABET from bit.crypto import ECPrivateKey from bit.format import public_key_to_address from bit.utils import bytes_to_hex def generate_key_address_pair(): # pragma: no cover private_key ...
mit
Python
394e7c5bdb47fb00fdce30132b8d9fe7629d14f5
Implement script file parsing
Rosuav/shed,Rosuav/shed,Rosuav/shed,Rosuav/shed,Rosuav/shed
blacksplit.py
blacksplit.py
""" Split a video file into chapters by detecting fade/cut to black Script file should look like this. Note that as long as the INPUT directive is found, everything else can be ignored. # Path to input file (note that comments are ignored) INPUT=/path/to/inputfile.mkv # Optional blackness threshold (a pixel is black ...
""" Split a video file into chapters by detecting fade/cut to black Script file should look like this. Note that as long as the INPUT directive is found, everything else can be ignored. # Path to input file (note that comments are ignored) INPUT=/path/to/inputfile.mkv # Optional blackness threshold (a pixel is black ...
mit
Python
ad2b469c001c6e699d3e8fd8f21409521a531919
Imprime la lista como se pide en el apartado 4
celiagarcia/ptavi-p3
karaoke.py
karaoke.py
#!/usr/bin/python # -*- coding: utf-8 -*- #CELIA GARCIA FERNANDEz from xml.sax import make_parser from xml.sax.handler import ContentHandler import smallsmilhandler import sys if __name__ == "__main__": parser = make_parser() small = smallsmilhandler.SmallSMILHandler() parser.setContentHandler(small) ...
#!/usr/bin/python # -*- coding: utf-8 -*- #CELIA GARCIA FERNANDEz from xml.sax import make_parser from xml.sax.handler import ContentHandler import smallsmilhandler import sys if __name__ == "__main__": parser = make_parser() small = smallsmilhandler.SmallSMILHandler() parser.setContentHandler(small)...
mit
Python
874eb2febdcc146b5454d450d76853866841b368
Fix c extension.
GaZ3ll3/scikit-image,chintak/scikit-image,jwiggins/scikit-image,michaelaye/scikit-image,robintw/scikit-image,chintak/scikit-image,GaelVaroquaux/scikits.image,WarrenWeckesser/scikits-image,bsipocz/scikit-image,rjeli/scikit-image,SamHames/scikit-image,youprofit/scikit-image,oew1v07/scikit-image,almarklein/scikit-image,jw...
scikits/image/_build.py
scikits/image/_build.py
import os import shutil import hashlib def cython(pyx_files, working_path=''): """Use Cython to convert the given files to C. Parameters ---------- pyx_files : list of str The input .pyx files. """ try: import Cython except ImportError: # If cython is not found, we...
import os import shutil import hashlib def cython(pyx_files, working_path=''): """Use Cython to convert the given files to C. Parameters ---------- pyx_files : list of str The input .pyx files. """ try: import Cython except ImportError: # If cython is not found, we...
bsd-3-clause
Python