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
f3524d7d6ab8df660d79759520acc3052103ed4a
add training interface function
epfahl/inaworld
inaworld/inaworld.py
inaworld/inaworld.py
"""Main driving script. Notes ----- * Genres for a given movie are vectorized as a binary array with a length equal to the total number of genres, where 1 indicates the presence of the genre. * Summaries are tokenized such that tokens have no non-alphabetic characters (numbers, punctuation, etc.). * Summaries are ...
"""Main driving script. """ import pandas as pd from . import utils from . import vectors from . import filters DEFAULT_DATA_PATH = 'movie_data.csv' MIN_GENRE_COUNT = 2 def filter_summaries_genres(df): """Given a DataFrame of movie genres and summaries, filter rows according to the minimum lengths of the g...
mit
Python
d11929c6799ba3d9b69960487853636e0a6df650
Remove a percentage of entries in CacheDict instead of a fixed number.
erdc-cm/numexpr,erdc-cm/numexpr
numexpr/utils.py
numexpr/utils.py
from numexpr import use_vml if use_vml: from numexpr.interpreter import ( _get_vml_version, _set_vml_accuracy_mode, _set_vml_num_threads) def get_vml_version(): """Get the VML/MKL library version.""" if use_vml: return _get_vml_version() else: return None def set_vml_accurac...
from numexpr import use_vml if use_vml: from numexpr.interpreter import ( _get_vml_version, _set_vml_accuracy_mode, _set_vml_num_threads) def get_vml_version(): """Get the VML/MKL library version.""" if use_vml: return _get_vml_version() else: return None def set_vml_accurac...
mit
Python
7963044f62a8f3a5c66b1917748c9bf112100f58
Make message byte bytes object
thusoy/nuts-auth,thusoy/nuts-auth
nuts/messages.py
nuts/messages.py
""" Define message type constants, sent as first byte in every message. First bit of byte (MSB) designates if the message is destined to server or client. 0 means target is server. """ from collections import namedtuple _ProtocolMessage = namedtuple('ProtocolMessage', ['byte', 'description']) # Client messa...
""" Define message type constants, sent as first byte in every message. First bit of byte (MSB) designates if the message is destined to server or client. 0 means target is server. """ from collections import namedtuple _ProtocolMessage = namedtuple('ProtocolMessage', ['byte', 'description']) # Client messa...
mit
Python
88259d84c3f86e862408ad00ce94fa4764f8bfc7
Move duplicated code into shared function
OpenChemistry/mongochemserver
girder/molecules/molecules/user.py
girder/molecules/molecules/user.py
from girder.api import access from girder.api.describe import Description, autoDescribeRoute from girder.api.rest import getCurrentUser from girder.models.model_base import AccessType from girder.models.user import User def _set_user_field(user, field_name, field_value): query = { '_id': user['_id'] } ...
from girder.api import access from girder.api.describe import Description, autoDescribeRoute from girder.api.rest import getCurrentUser from girder.models.model_base import AccessType from girder.models.user import User @access.public @autoDescribeRoute( Description('Get the orcid of a user.') .modelParam('id'...
bsd-3-clause
Python
b23ed2d6d74c4604e9bb7b55faf121661ee9f785
Develop program for points file generation
ndebuhr/thermo-state-solver,ndebuhr/thermo-state-solver
statePointsGen.py
statePointsGen.py
# Thermo State Solver # Solves for state parameters at various points in a simple thermodynamic model # Developed by Neal DeBuhr import csv import argparse import itertools import string numPoints=int(input('Number of points in analysis:')) num2alpha = dict(zip(range(1, 27), string.ascii_uppercase)) outRow=[''] outR...
# Thermo State Solver # Solves for state parameters at various points in a simple thermodynamic model # Developed by Neal DeBuhr import csv import argparse import itertools
mit
Python
04f1d458593e7c46a59f3b97725d45332f36e817
index now starts at 1
serpis/pynik
plugins/qotd.py
plugins/qotd.py
# coding: latin-1 from __future__ import with_statement from commands import Command import string, random class quote: quote = "" index = 1 played = 0 class QuoteCollection: quotes = [] plays = [] quotefilename = "data/quotes.txt" playlistfilename = "data/playlist.txt" def __init__(self): self.LoadFromF...
# coding: latin-1 from __future__ import with_statement from commands import Command import string, random class quote: quote = "" index = 0 played = 0 class QuoteCollection: quotes = [] plays = [] quotefilename = "data/quotes.txt" playlistfilename = "data/playlist.txt" def __init__(self): self.LoadFromF...
mit
Python
da4615879b43b2b747c9e2e72ae67bc7a63f9b32
fix initializer for CleanExit
HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak,HPI-SWA-Lab/RSqueak
rsqueakvm/error.py
rsqueakvm/error.py
# Some exception classes for the Smalltalk VM class SmalltalkException(Exception): """Base class for Smalltalk exception hierarchy""" exception_type = "SmalltalkException" _attrs_ = ["msg"] def __init__(self, msg="<no message>"): self.msg = msg class PrimitiveFailedError(SmalltalkException): ...
# Some exception classes for the Smalltalk VM class SmalltalkException(Exception): """Base class for Smalltalk exception hierarchy""" exception_type = "SmalltalkException" _attrs_ = ["msg"] def __init__(self, msg="<no message>"): self.msg = msg class PrimitiveFailedError(SmalltalkException): ...
bsd-3-clause
Python
cccdb3b914b1466a34a4b3d0a1b47b880e21168b
Change variable name for consistency
willrogers/pml,willrogers/pml
pml/__init__.py
pml/__init__.py
SP = 'setpoint' RB = 'readback' ENG = 'engineering' PHY = 'physics'
SP = 'setpoint' RB = 'readback' ENG = 'machine' PHY = 'physics'
apache-2.0
Python
83f15586e89325f2711c72f32ba087d6be9e26ac
Bump version to 0.4.2
graingert/aiopg,aio-libs/aiopg,hyzhak/aiopg,eirnym/aiopg,nerandell/aiopg,luhn/aiopg
aiopg/__init__.py
aiopg/__init__.py
import re import sys from collections import namedtuple from .connection import connect, Connection, TIMEOUT as DEFAULT_TIMEOUT from .cursor import Cursor from .pool import create_pool, Pool __all__ = ('connect', 'create_pool', 'Connection', 'Cursor', 'Pool', 'version', 'version_info', 'DEFAULT_TIMEOUT') ...
import re import sys from collections import namedtuple from .connection import connect, Connection, TIMEOUT as DEFAULT_TIMEOUT from .cursor import Cursor from .pool import create_pool, Pool __all__ = ('connect', 'create_pool', 'Connection', 'Cursor', 'Pool', 'version', 'version_info', 'DEFAULT_TIMEOUT') ...
bsd-2-clause
Python
664edac6941ce8288cf48ef5740a8ffc34ef2b6d
rename 'tekkit' to 'tekkit-classic'
frostyfrog/mark2,frostyfrog/mark2,SupaHam/mark2,SupaHam/mark2
servers/technic.py
servers/technic.py
from twisted.internet.defer import DeferredList from servers import JarProvider class Technic(JarProvider): base = 'http://mirror.technicpack.net/Technic/' packs = ( ('Tekkit Classic', 'tekkit', 'Tekkit_Server_{version}.zip'), ('Tekkit Lite', 'tekkitlite', 'Tekkit_Lite_Server_{version}...
from twisted.internet.defer import DeferredList from servers import JarProvider class Technic(JarProvider): base = 'http://mirror.technicpack.net/Technic/' packs = ( ('Tekkit', 'tekkit', 'Tekkit_Server_{version}.zip'), ('Tekkit Lite', 'tekkitlite', 'Tekkit_Lite_Server_{version}.zip')...
mit
Python
9cfbc399c521ec93090890c91ea2976f66639ff5
fix small python3.8 compatibility
aio-libs/aioredis,aio-libs/aioredis
aioredis/locks.py
aioredis/locks.py
import asyncio from asyncio.locks import Lock as _Lock from asyncio import coroutine # Fixes an issue with all Python versions that leaves pending waiters # without being awakened when the first waiter is canceled. # Code adapted from the PR https://github.com/python/cpython/pull/1031 # Waiting once it is merged to m...
from asyncio.locks import Lock as _Lock from asyncio import coroutine from asyncio import futures # Fixes an issue with all Python versions that leaves pending waiters # without being awakened when the first waiter is canceled. # Code adapted from the PR https://github.com/python/cpython/pull/1031 # Waiting once it is...
mit
Python
c2bf1bcb90cda51518bf87526ab128a1931e23c2
Update __init__.py
lvphj/epydemiology
epydemiology/__init__.py
epydemiology/__init__.py
from .phjRROR import *
__all__ = ['phjRROR']
mit
Python
253afc79d9f14b091d076075c759f20b368caedc
Remove translate rewrite URLs from main URLconf.
vivekanand1101/pontoon,yfdyh000/pontoon,sudheesh001/pontoon,vivekanand1101/pontoon,mastizada/pontoon,jotes/pontoon,mathjazz/pontoon,jotes/pontoon,mathjazz/pontoon,mozilla/pontoon,mozilla/pontoon,yfdyh000/pontoon,Osmose/pontoon,m8ttyB/pontoon,participedia/pontoon,jotes/pontoon,Jobava/mirror-pontoon,yfdyh000/pontoon,Joba...
pontoon/urls.py
pontoon/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin from django.views.generic import RedirectView from django.views.generic import TemplateView urlpatterns = patterns('', # Legacy: Locale redirect for compatibility with i18n ready URL scheme (r'^en-US(?P<url>.+)$', RedirectVie...
from django.conf.urls import patterns, include, url from django.contrib import admin from django.views.generic import RedirectView from django.views.generic import TemplateView urlpatterns = patterns('', # Legacy: Locale redirect for compatibility with i18n ready URL scheme (r'^en-US(?P<url>.+)$', RedirectVie...
bsd-3-clause
Python
1879cb76ae18390864dc382ac589c76c485d56aa
Fix celery settings
dayatz/taiga-back,dayatz/taiga-back,taigaio/taiga-back,taigaio/taiga-back,taigaio/taiga-back,dayatz/taiga-back
settings/celery.py
settings/celery.py
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can r...
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can r...
agpl-3.0
Python
f3b9cca8571acd1815534c5eb409f2ef166f897c
Set up loggers after the configuration file is loaded
mretegan/crispy,mretegan/crispy
crispy/main.py
crispy/main.py
# coding: utf-8 ################################################################### # Copyright (c) 2016-2020 European Synchrotron Radiation Facility # # # # Author: Marius Retegan # # ...
# coding: utf-8 ################################################################### # Copyright (c) 2016-2020 European Synchrotron Radiation Facility # # # # Author: Marius Retegan # # ...
mit
Python
2fd1d8b312ba00231105d8244f58242eb459f8cf
Fix bug #6
the7day/django-cron,rrader/django-cron,radiosilence/django-cron,Ixxy-Open-Source/django-cron,reavis/django-cron,peterbe/django-cron
cron/models.py
cron/models.py
""" Copyright (c) 2007-2008, Dj Gilcrease All rights reserved. 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, me...
""" Copyright (c) 2007-2008, Dj Gilcrease All rights reserved. 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, me...
mit
Python
06881ab893652be02606f96c14dc508ede1ac1a6
add some aliases to pdbpp
petobens/dotfiles,petobens/dotfiles,petobens/dotfiles
python/pdbrc.py
python/pdbrc.py
import pdb from pygments.formatters import Terminal256Formatter from pygments.lexers import PythonLexer from pygments.style import Style from pygments.token import ( Comment, Error, Keyword, Literal, Name, Number, Operator, String, Text, ) # Palette (onedarkish) white = '#abb2bf' m...
import pdb from pygments.formatters import Terminal256Formatter from pygments.lexers import PythonLexer from pygments.style import Style from pygments.token import ( Comment, Error, Keyword, Literal, Name, Number, Operator, String, Text, ) # Palette (onedarkish) white = '#abb2bf' m...
mit
Python
0ff36cb3a46a0117040aa44cd3f059b8a716e7ed
Update xcrit.py
amojarro/carrierseq,amojarro/carrierseq
python/xcrit.py
python/xcrit.py
from scipy.stats import poisson import sys lambda_value_txt = open(sys.argv[1], 'r') lambda_value = lambda_value_txt.read().splitlines()[8] print 'Lambda Value:' print lambda_value p = float(sys.argv[2]) print 'P Value:' print p x_crit = poisson.ppf(1-p,float(lambda_value)) print 'Critical Read/Channel Threshold...
from scipy.stats import poisson import sys lambda_value_txt = open(sys.argv[1], 'r') lambda_value = lambda_value_txt.read().splitlines()[8] print 'Lambda Value:' print lambda_value p = float(sys.argv[2]) # User Defined print 'P Value:' print p x_crit = poisson.ppf(1-p,float(lambda_value)) print 'Critical Read/Ch...
mit
Python
c78970055d10e53fc0dea9a8ee31c910a0eeb774
change social urls
knownsec/PyHackerNews,akun/PyHackerNews,akun/PyHackerNews,knownsec/PyHackerNews,knownsec/PyHackerNews,akun/PyHackerNews
src/pyhn/urls.py
src/pyhn/urls.py
#!/usr/bin/env python from django.conf.urls import patterns, include, url urlpatterns = patterns( '', url(r'^$', 'pyhn.apps.news.views.index.index', name='index'), url( r'^social/', include('social.apps.django_app.urls', namespace='social') ), url(r'^news/', include('pyhn.apps.news.urls'...
#!/usr/bin/env python from django.conf.urls import patterns, include, url urlpatterns = patterns( '', url(r'', include('social.apps.django_app.urls', namespace='social')), url(r'^$', 'pyhn.apps.news.views.index.index', name='index'), url(r'^news/', include('pyhn.apps.news.urls', namespace='news')), ...
mit
Python
ab26d81c479fd9baad29262c131f37c63519c165
Update Chapter16/PracticeQuestions.py added docstring
JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials
books/CrackingCodesWithPython/Chapter16/PracticeQuestions.py
books/CrackingCodesWithPython/Chapter16/PracticeQuestions.py
"""Chapter 16 Practice Questions Answers Chapter 16 Practice Questions via Python code. """ def main(): # 1. Why can't a brute-force attack be used against a simple substitution # cipher, even with a powerful supercomputer? # Hint: Check page 208 from math import factorial numKeys = factorial(26)...
# Chapter 16 Practice Questions def main(): # 1. Why can't a brute-force attack be used against a simple substitution # cipher, even with a powerful supercomputer? # Hint: Check page 208 from math import factorial numKeys = factorial(26) print(numKeys) # 2. What does the spam variable con...
mit
Python
4c0d47488de175b0c3464d456d963f66fcd20017
Update listcheck.py
aburan28/laikaboss,aburan28/laikaboss
laikaboss/modules/listcheck.py
laikaboss/modules/listcheck.py
# Copyright 2015 Lockheed Martin Corporation # # 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 2015 Lockheed Martin Corporation # # 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
89edd78b05a0b8da7b60033ec91b221d5c4e336c
Add an option to hide the traceback on SQL Programming Error
catherinedevlin/ipython-sql,catherinedevlin/ipython-sql
src/sql/magic.py
src/sql/magic.py
from IPython.core.magic import Magics, magics_class, cell_magic, line_magic from IPython.config.configurable import Configurable from IPython.utils.traitlets import Bool, Int, Unicode from sqlalchemy.exc import ProgrammingError, OperationalError import sql.connection import sql.parse import sql.run @magics_class cl...
from IPython.core.magic import Magics, magics_class, cell_magic, line_magic from IPython.config.configurable import Configurable from IPython.utils.traitlets import Int, Unicode import sql.connection import sql.parse import sql.run @magics_class class SqlMagic(Magics, Configurable): """Runs SQL statement on a d...
mit
Python
6394a34804c9bb372aea570771e6ab0649724778
fix NX_EXPERIMENTER_ID
darjus-amzn/ryu,gopchandani/ryu,iwaseyusuke/ryu,osrg/ryu,lsqtongxin/ryu,zyq001/ryu,jkoelker/ryu,StephenKing/ryu,Zouyiran/ryu,zyq001/ryu,ynkjm/ryu,John-Lin/ryu,shinpeimuraoka/ryu,gareging/SDN_Framework,pichuang/ryu,takahashiminoru/ryu,gareging/SDN_Framework,OpenState-SDN/ryu,haniehrajabi/ryu,Tejas-Subramanya/RYU_MEC,han...
ryu/ofproto/ofproto_common.py
ryu/ofproto/ofproto_common.py
# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp> # # 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 # # h...
# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp> # # 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 # # h...
apache-2.0
Python
674c1a5ff17881346c3247568f8348eb0e51a0a2
update model link
paulla/wsgiwar2013,paulla/wsgiwar2013
wsgiwars/models/link.py
wsgiwars/models/link.py
############################################################################ # The MIT License (MIT) # # Copyright (c) 2013 PauLLA # # 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 re...
############################################################################ # The MIT License (MIT) # # Copyright (c) 2013 PauLLA # # 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 r...
mit
Python
10bf401fd2e373b5d833e8234fcc2c99da7418f6
update createweekday class
teamtaverna/core
app/api/schema.py
app/api/schema.py
import graphene from graphene_django.filter import DjangoFilterConnectionField from .cruds.user_crud import UserNode, CreateUser, UpdateUser, DeleteUser from .cruds.dish_crud import DishNode, CreateDish, UpdateDish, DeleteDish from .cruds.weekday_crud import WeekdayNode, CreateWeekday class Query(graphene.AbstractTy...
import graphene from graphene_django.filter import DjangoFilterConnectionField from .cruds.user_crud import UserNode, CreateUser, UpdateUser, DeleteUser from .cruds.dish_crud import DishNode, CreateDish, UpdateDish, DeleteDish class Query(graphene.AbstractType): user = graphene.relay.Node.Field(UserNode) use...
mit
Python
35db597867a28200efe4a9d1462c361193490286
move everything do descriptive functions
rixx/owler
owler/captcha.py
owler/captcha.py
from operator import itemgetter from PIL import Image NUMS = 5 def closest_color(color, colors): red, green, blue = color distances = [(r - red, g - green, b - blue) for r, g, b in colors] distances = [sum((r**2, g**2, b**2)) for r, g, b in distances] color_index, _ = min((val, index) for val, inde...
from operator import itemgetter from PIL import Image NUMS = 5 def closest_color(color, colors): red, green, blue = color distances = [(r - red, g - green, b - blue) for r, g, b in colors] distances = [sum((r**2, g**2, b**2)) for r, g, b in distances] color_index, _ = min((val, index) for val, inde...
mit
Python
845a826bb5f15ed6025ea38aac75e4515d204293
Add postgresql password to production database settings
devunt/hydrocarbon,devunt/hydrocarbon,devunt/hydrocarbon
hydrocarbon/settings/production.py
hydrocarbon/settings/production.py
import os from hydrocarbon.settings.base import * # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '***REMOVED***' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False TEMPLATE_DEBUG = False # ALLOWED HOSTS ALLOWED_HOSTS = ['herocomics.kr', 'beta.herocomics...
import os from hydrocarbon.settings.base import * # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '***REMOVED***' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False TEMPLATE_DEBUG = False # ALLOWED HOSTS ALLOWED_HOSTS = ['herocomics.kr', 'beta.herocomics...
mit
Python
7ed1d3be18568ca2327e5c0f121c4dca2715e0f1
rename api
kentaiwami/FiNote,kentaiwami/FiNote,kentaiwami/FiNote,kentaiwami/FiNote
myapi/FiNote_API/v1/urls.py
myapi/FiNote_API/v1/urls.py
from rest_framework import routers from FiNote_API.v1.views import * router = routers.DefaultRouter() router.register(r'user', CreateUserViewSet, 'create-user') # router.register(r'v1/user/signin/token', SignInWithTokenViewSet, 'sign_in_with_token') # router.register(r'v1/user/signin/notoken', SignInNoTokenViewSet, '...
from rest_framework import routers from FiNote_API.v1.views import * router = routers.DefaultRouter() router.register(r'user', CreateUserViewSet, 'create user') # urlpatterns = router.urls # router.register(r'v1/user/signin/token', SignInWithTokenViewSet, 'sign_in_with_token') # router.register(r'v1/user/signin/notok...
mit
Python
14df7e6846eb080e0fee4467ba9f697fb20e1f41
Update __init__.py
forslund/mycroft-core,aatchison/mycroft-core,aatchison/mycroft-core,Dark5ide/mycroft-core,MycroftAI/mycroft-core,linuxipho/mycroft-core,MycroftAI/mycroft-core,linuxipho/mycroft-core,Dark5ide/mycroft-core,forslund/mycroft-core
mycroft/version/__init__.py
mycroft/version/__init__.py
# Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versio...
# Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versio...
apache-2.0
Python
a04458b4ea98b8042b093b605ef185fe90d4f0b1
update matplotlib colormap generation to use definitions from matplotlib
K3D-tools/K3D-jupyter,K3D-tools/K3D-jupyter,K3D-tools/K3D-jupyter,K3D-tools/K3D-jupyter
k3d/colormaps/generate_matplotlib_color_maps.py
k3d/colormaps/generate_matplotlib_color_maps.py
import numpy as np from matplotlib import pyplot, cm min_samples = 256 with open('matplotlib_color_maps.py', 'w') as file: for name in sorted(pyplot.colormaps()): cmap = cm.get_cmap(name) name_c = name.capitalize() if name_c == name: file.write('{} = [ \n'.format(name)) ...
import urllib.request import xml.etree.ElementTree as ET response = urllib.request.urlopen('http://www.paraview.org/Wiki/images/d/d4/All_mpl_cmaps.xml') root = ET.fromstring(response.read().decode('utf8')) file = open('matplotlib_color_maps.py', 'w') for colorMap in root: name = colorMap.attrib['name'] name ...
mit
Python
4d12c03260672d5760447b6a5d8cc805ecff540b
Make it importable
codeKonami/zulip,aps-sids/zulip,xuanhan863/zulip,suxinde2009/zulip,proliming/zulip,alliejones/zulip,suxinde2009/zulip,sonali0901/zulip,yuvipanda/zulip,amallia/zulip,seapasulli/zulip,isht3/zulip,zachallaun/zulip,arpith/zulip,tommyip/zulip,fw1121/zulip,blaze225/zulip,karamcnair/zulip,vikas-parashar/zulip,Qgap/zulip,he15h...
zephyr/zephyr-mirror.py
zephyr/zephyr-mirror.py
#!/usr/bin/python browser = None csrf_token = None def browser_login(): logger = logging.getLogger("mechanize") logger.addHandler(logging.StreamHandler(sys.stdout)) logger.setLevel(logging.INFO) global browser browser = mechanize.Browser() browser.set_handle_robots(False) ## debugging cod...
#!/usr/bin/python import mechanize import urllib import cgi import sys import logging import zephyr import BeautifulSoup logger = logging.getLogger("mechanize") logger.addHandler(logging.StreamHandler(sys.stdout)) logger.setLevel(logging.INFO) browser = mechanize.Browser() csrf_token = None def browser_login(): ...
apache-2.0
Python
87b66dcc9c9984e0a878ee5ce2f2eb52bf847225
Add new test
janecofino/pycon-tutorial-mjc
test_wordcount.py
test_wordcount.py
import os.path import tempfile import wordcount_lib from __builtin__ import False def _make_testfile(filename, data): "Make a temp file containing the given data; return full path to file." tempdir = tempfile.mkdtemp(prefix='wordcounttest_') testfile = os.path.join(tempdir, filename) with open(t...
import os.path import tempfile import wordcount_lib def _make_testfile(filename, data): "Make a temp file containing the given data; return full path to file." tempdir = tempfile.mkdtemp(prefix='wordcounttest_') testfile = os.path.join(tempdir, filename) with open(testfile, 'wt') as fp: ...
bsd-3-clause
Python
70c8d3427a3515c94b9b226afab5cf2a2eaf3d83
Fix tests
Phylliade/ikpy
tests/conftest.py
tests/conftest.py
import pytest import json # IKPy imports from ikpy.chain import Chain @pytest.fixture def resources_path(): return "../resources" def pytest_addoption(parser): parser.addoption( "--interactive", action="store_true", help="activate interactive mode" ) @pytest.fixture def interactive(request): ...
import pytest import json # IKPy imports from ikpy.chain import Chain @pytest.fixture def resources_path(): return "../resources" def pytest_addoption(parser): parser.addoption( "--interactive", action="store_true", help="activate interactive mode" ) @pytest.fixture def interactive(request): ...
apache-2.0
Python
e931ce9aed87e348c6a40528115c0546d3f7abf4
rename fixture function
myint/rstcheck,myint/rstcheck
tests/conftest.py
tests/conftest.py
"""Fixtures for tests.""" import typing import docutils.parsers.rst import pytest from rstcheck import _extras if _extras.SPHINX_INSTALLED: import sphinx.application @pytest.fixture(name="patch_docutils_directives_and_roles_dict") def _patch_docutils_directives_and_roles_dict_fixture(monkeypatch: pytest.Monke...
"""Fixtures for tests.""" import typing import docutils.parsers.rst import pytest from rstcheck import _extras if _extras.SPHINX_INSTALLED: import sphinx.application @pytest.fixture(name="patch_docutils_directives_and_roles_dict") def _patch_docutils_directives_and_roles_dict(monkeypatch: pytest.MonkeyPatch) ...
mit
Python
22a90801b3ac02ade7ed014058d6d19b506f8654
Update settings.py
raiderrobert/django-webhook
tests/settings.py
tests/settings.py
""" Testing mini-project and tests in one """ from __future__ import unicode_literals import unittest from django.conf import settings from django.conf.urls import url, include if __name__ == '__main__': settings.configure() unittest.main() from webhook.base import WebhookBase # Mini Project starts here D...
""" Testing mini-project and tests in one """ from __future__ import unicode_literals import unittest from django.conf import settings from django.test import TestCase from django.test.client import Client from django.conf.urls import url, include if __name__ == '__main__': settings.configure() unittest.mai...
mit
Python
edc9158f934b1d7e28e21770d2233ba35ed586e8
Replace help@osg.org with htcondor-users
brianhlin/htcondor-ce,brianhlin/htcondor-ce,brianhlin/htcondor-ce,opensciencegrid/htcondor-ce,matyasselmeci/htcondor-ce,matyasselmeci/htcondor-ce,opensciencegrid/htcondor-ce,matyasselmeci/htcondor-ce,opensciencegrid/htcondor-ce
src/htcondorce/tools.py
src/htcondorce/tools.py
"""Utility library for HTCondor-CE tools""" import errno import os import tempfile import textwrap import time from subprocess import Popen, PIPE HELP_EMAIL = 'htcondor-users@cs.wisc.edu' # Excluding submit file so the respective scripts # can generate it as they see fit JOB_FILES = ['stdout', 'stderr', 'log'] clas...
"""Utility library for HTCondor-CE tools""" import errno import os import tempfile import textwrap import time from subprocess import Popen, PIPE HELP_EMAIL = 'help@opensciencegrid.org' # Excluding submit file so the respective scripts # can generate it as they see fit JOB_FILES = ['stdout', 'stderr', 'log'] class ...
apache-2.0
Python
fcf38b0c5003a2163ab3cdb722602785f18dbcd8
Update setup.py
QualiSystems/OpenStack-Shell
package/setup.py
package/setup.py
from setuptools import setup, find_packages import os with open(os.path.join('version.txt')) as version_file: version_from_file = version_file.read().strip() with open('requirements.txt') as f_required: required = f_required.read().splitlines() with open('test_requirements.txt') as f_tests: required_for_...
from setuptools import setup, find_packages import os with open(os.path.join('version.txt')) as version_file: version_from_file = version_file.read().strip() with open('requirements.txt') as f_required: required = f_required.read().splitlines() with open('test_requirements.txt') as f_tests: required_for_...
isc
Python
7b7ede755e0910306be9f1c1c76497b7bff55eb8
Update lib.py
aaronkaplan/intelmq-old,aaronkaplan/intelmq-old,s4n7h0/intelmq,Phantasus/intelmq,aaronkaplan/intelmq-old
intelmq/bots/collectors/url/lib.py
intelmq/bots/collectors/url/lib.py
import re import ssl import socket import shutil import httplib import urllib2 import StringIO from urlparse import urlparse from intelmq.lib.utils import decode def fetch_url(url, timeout=60.0, chunk_size=16384): req = urllib2.urlopen(url, timeout = timeout) iostring = StringIO.StringIO() shu...
import re import ssl import socket import shutil import httplib import urllib2 import StringIO from urlparse import urlparse from intelmq.lib.utils import decode def fetch_url(url, timeout=60.0, chunk_size=16384): req = urllib2.urlopen(url, timeout = timeout) iostring = StringIO.StringIO() shu...
agpl-3.0
Python
83020fa4a4e60e762e6bf1fb49f3c4d9da586053
change ordering
holytortoise/abwreservierung,holytortoise/abwreservierung,holytortoise/abwreservierung,holytortoise/abwreservierung
src/reservierung/models.py
src/reservierung/models.py
from django.db import models # Zugriff auf die Benutzer from django.contrib.auth.models import User from django.utils import timezone from django.conf import settings from django.urls import reverse import datetime # Create your models here. class Raum(models.Model): name = models.CharField(max_length=255) n...
from django.db import models # Zugriff auf die Benutzer from django.contrib.auth.models import User from django.utils import timezone from django.conf import settings from django.urls import reverse import datetime # Create your models here. class Raum(models.Model): name = models.CharField(max_length=255) n...
mit
Python
7672b19f08a9bdffe546777031421720c97c9796
Allow semi broken quotes
1tush/sentry,TedaLIEz/sentry,hongliang5623/sentry,ngonzalvez/sentry,fotinakis/sentry,jean/sentry,Kryz/sentry,mitsuhiko/sentry,kevinlondon/sentry,songyi199111/sentry,mvaled/sentry,Natim/sentry,fuziontech/sentry,BuildingLink/sentry,ifduyue/sentry,mvaled/sentry,BuildingLink/sentry,kevinastone/sentry,JamesMura/sentry,kevin...
src/sentry/search/utils.py
src/sentry/search/utils.py
from __future__ import absolute_import, division, print_function from sentry.constants import STATUS_CHOICES from sentry.utils.auth import find_users def parse_query(query, user): # TODO(dcramer): make this better tokens = query.split(' ') results = {'tags': {}, 'query': []} tokens_iter = iter(toke...
from __future__ import absolute_import, division, print_function from sentry.constants import STATUS_CHOICES from sentry.utils.auth import find_users def parse_query(query, user): # TODO(dcramer): make this better tokens = query.split(' ') results = {'tags': {}, 'query': []} tokens_iter = iter(toke...
bsd-3-clause
Python
e0e9348d5b262afac1cdd52472b7a8350bf1d209
Add titles to views
Encrylize/MyDictionary,Encrylize/MyDictionary,Encrylize/MyDictionary
app/views/main.py
app/views/main.py
from flask import Blueprint, render_template, g, redirect, url_for, flash from flask_login import login_required, current_user, logout_user from app import db from app.utils import get_or_create main = Blueprint("main", __name__) @main.route("/") @main.route("/index") @login_required def index(): return render_...
from flask import Blueprint, render_template, g, redirect, url_for, flash from flask_login import login_required, current_user, logout_user from app import db from app.utils import get_or_create main = Blueprint("main", __name__) @main.route("/") @main.route("/index") @login_required def index(): return render_...
mit
Python
5c839d659a8f1b69731dd23fb2e6141e53927428
Update crud_generation.py
Typhon66/sanic_crud
sanic_crud/crud_generation.py
sanic_crud/crud_generation.py
from .config import CrudConfig, CrudShortcuts from .resources.single_resource import BaseResource from .resources.collection_resource import BaseCollectionResource def generate_crud(app, model_array): for model in model_array: if not hasattr(model, 'crud_config'): model.crud_config = CrudConfi...
from .config import CrudConfig, CrudShortcuts from .resources.single_resource import BaseResource from .resources.collection_resource import BaseCollectionResource def generate_crud(app, model_array): for model in model_array: if not hasattr(model, 'crud_config'): model.crud_config = CrudConfi...
mit
Python
2d0c4daba8656ed6f3e840aeeeb247f71bb9746d
Bump 2.2.0
appium/python-client,appium/python-client
appium/version.py
appium/version.py
version = '2.2.0'
version = '2.1.4'
apache-2.0
Python
eea0ae8b85285d79c01fe5100114570357f9a20c
Modify the Component admin page so that component ingredients are inlined
savoirfairelinux/santropol-feast,savoirfairelinux/sous-chef,madmath/sous-chef,madmath/sous-chef,savoirfairelinux/santropol-feast,savoirfairelinux/sous-chef,madmath/sous-chef,savoirfairelinux/sous-chef,savoirfairelinux/santropol-feast
src/meal/admin.py
src/meal/admin.py
from django.contrib import admin from meal.models import Component, Restricted_item from meal.models import Ingredient, Component_ingredient from meal.models import Incompatibility, Menu, Menu_component class ComponentsInline(admin.TabularInline): model = Menu.components.through class ComponentIngredientInline(a...
from django.contrib import admin from meal.models import Component, Restricted_item from meal.models import Ingredient, Component_ingredient from meal.models import Incompatibility, Menu, Menu_component class ComponentsInline(admin.TabularInline): model = Menu.components.through class MenuAdmin(admin.ModelAdmin...
agpl-3.0
Python
ef003a3ebf14545927d055a0deda7e1982e90e53
Fix decode test to actually decode message from stdin
tempbottle/pycapnp,tempbottle/pycapnp,SymbiFlow/pycapnp,jparyani/pycapnp,SymbiFlow/pycapnp,SymbiFlow/pycapnp,rcrowder/pycapnp,jparyani/pycapnp,jparyani/pycapnp,rcrowder/pycapnp,SymbiFlow/pycapnp,jparyani/pycapnp,tempbottle/pycapnp,rcrowder/pycapnp,rcrowder/pycapnp,tempbottle/pycapnp
scripts/capnp_test_pycapnp.py
scripts/capnp_test_pycapnp.py
#!/usr/bin/env python from __future__ import print_function import capnp import os capnp.add_import_hook([os.getcwd(), "/usr/local/include/"]) # change this to be auto-detected? import test_capnp import sys def decode(name): class_name = name[0].upper() + name[1:] print(getattr(test_capnp, class_name).from_b...
#!/usr/bin/env python import capnp import os capnp.add_import_hook([os.getcwd(), "/usr/local/include/"]) # change this to be auto-detected? import test_capnp import sys def decode(name): print getattr(test_capnp, name)._short_str() def encode(name): val = getattr(test_capnp, name) class_name = name[0].u...
bsd-2-clause
Python
9101c00d31a3013cf06e3ccd6a700eb0aa9c0322
Add option -f for printing whole arrays
amunmt/marian,emjotde/amunn,emjotde/amunn,marian-nmt/marian-train,emjotde/Marian,marian-nmt/marian-train,marian-nmt/marian-train,emjotde/amunmt,marian-nmt/marian-train,amunmt/marian,emjotde/amunn,emjotde/Marian,emjotde/amunmt,emjotde/amunn,emjotde/amunmt,marian-nmt/marian-train,emjotde/amunmt,amunmt/marian
scripts/contrib/model_info.py
scripts/contrib/model_info.py
#!/usr/bin/env python3 import sys import argparse import numpy as np import yaml DESC = "Prints keys and values from model.npz file." S2S_SPECIAL_NODE = "special:model.yml" def main(): args = parse_args() model = np.load(args.model) if args.special: if S2S_SPECIAL_NODE not in model: ...
#!/usr/bin/env python3 import sys import argparse import numpy as np import yaml DESC = "Prints keys and values from model.npz file." S2S_SPECIAL_NODE = "special:model.yml" def main(): args = parse_args() model = np.load(args.model) if args.special: if S2S_SPECIAL_NODE not in model: ...
mit
Python
f122d8a3bb793fe3f169b420b00f7a34032c3cdd
fix the dry mode
HalcyonChimera/osf.io,brianjgeiger/osf.io,laurenrevere/osf.io,cslzchen/osf.io,aaxelb/osf.io,adlius/osf.io,baylee-d/osf.io,saradbowman/osf.io,adlius/osf.io,leb2dg/osf.io,icereval/osf.io,HalcyonChimera/osf.io,binoculars/osf.io,caseyrollins/osf.io,erinspace/osf.io,pattisdr/osf.io,aaxelb/osf.io,binoculars/osf.io,TomBaxter/...
scripts/fix_user_mailchimp.py
scripts/fix_user_mailchimp.py
import logging import sys from datetime import datetime from django.db import transaction from django.utils import timezone from website.app import setup_django setup_django() from osf.models import OSFUser from scripts import utils as script_utils from website.mailchimp_utils import subscribe_mailchimp from website ...
import logging import sys from datetime import datetime from django.db import transaction from django.utils import timezone from website.app import setup_django setup_django() from osf.models import OSFUser from scripts import utils as script_utils from website.mailchimp_utils import subscribe_mailchimp from website ...
apache-2.0
Python
8982d1e8bdbc27844319edad4d968826048518d6
Implement validate() for Slovenian VAT numbers
holvi/python-stdnum,tonyseek/python-stdnum,dchoruzy/python-stdnum,holvi/python-stdnum,t0mk/python-stdnum,arthurdejong/python-stdnum,arthurdejong/python-stdnum,arthurdejong/python-stdnum,holvi/python-stdnum
stdnum/si/ddv.py
stdnum/si/ddv.py
# ddv.py - functions for handling Slovenian VAT numbers # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 ...
# ddv.py - functions for handling Slovenian VAT numbers # coding: utf-8 # # Copyright (C) 2012 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the...
lgpl-2.1
Python
2db2a65db5b81206581c605aeb01ccb03b307177
bump version 1.0.0a7
chriskiehl/python-stix,STIXProject/python-stix,benjamin9999/python-stix,benjamin9999/python-stix
stix/__init__.py
stix/__init__.py
# Copyright (c) 2013, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. __version__ = "1.0.0a7" import json from StringIO import StringIO class Entity(object): """Base class for all classes in the STIX API.""" def to_obj(self, return_obj=None): """Export a...
# Copyright (c) 2013, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. __version__ = "1.0.0a6" import json from StringIO import StringIO class Entity(object): """Base class for all classes in the STIX API.""" def to_obj(self, return_obj=None): """Export a...
bsd-3-clause
Python
a84566fdaca954bc4ebeaf0bda15bafa45de1750
Update antibody_lot.py
kidaa/encoded,philiptzou/clincoded,ClinGen/clincoded,4dn-dcic/fourfront,T2DREAM/t2dream-portal,T2DREAM/t2dream-portal,ClinGen/clincoded,philiptzou/clincoded,ENCODE-DCC/encoded,hms-dbmi/fourfront,hms-dbmi/fourfront,ENCODE-DCC/encoded,philiptzou/clincoded,ENCODE-DCC/encoded,ENCODE-DCC/snovault,ENCODE-DCC/snovault,hms-dbm...
src/encoded/audit/antibody_lot.py
src/encoded/audit/antibody_lot.py
from ..auditor import ( AuditFailure, audit_checker, ) @audit_checker('antibody_lot') def audit_antibody_lot_target(value, system): ''' Antibody lots should not have associated characterizations for different target labels ''' if value['status'] in ['not pursued', 'deleted']: retur...
from ..auditor import ( AuditFailure, audit_checker, ) @audit_checker('antibody_lot') def audit_antibody_lot_target(value, system): ''' Antibody lots should not have associated characterizations for different target labels ''' if value['status'] in ['not pursued', 'deleted']: retur...
mit
Python
0126ed2e540bd1228674c4eaef4d03a41cc1e5b3
Make 'employee' affiliation validation a separate case and re-introduce 'faculty+staff' validation.
its-dirg/svs
src/svs/filter.py
src/svs/filter.py
__author__ = 'regu0004' # SAML attribute to verify affiliation with AFFILIATION_ATTRIBUTE = 'eduPersonAffiliation' # Values the RP can request in OpenID Connect parameter 'scope' in the Auth req. PERSISTENT_NAMEID = 'persistent' TRANSIENT_NAMEID = 'transient' # Supported claims in the Auth req DOMAIN = 'domain' COUN...
__author__ = 'regu0004' # SAML attribute to verify affiliation with AFFILIATION_ATTRIBUTE = 'eduPersonAffiliation' # Values the RP can request in OpenID Connect parameter 'scope' in the Auth req. PERSISTENT_NAMEID = 'persistent' TRANSIENT_NAMEID = 'transient' # Supported claims in the Auth req DOMAIN = 'domain' COUN...
apache-2.0
Python
52e9390d88062e9442b18a7793e6696a36f5b9c3
Remove XFAIL on functional tor test
conorsch/securedrop,ehartsuyker/securedrop,garrettr/securedrop,ehartsuyker/securedrop,conorsch/securedrop,heartsucker/securedrop,garrettr/securedrop,ehartsuyker/securedrop,ehartsuyker/securedrop,conorsch/securedrop,ehartsuyker/securedrop,heartsucker/securedrop,conorsch/securedrop,heartsucker/securedrop,ehartsuyker/secu...
testinfra/functional/test_tor_interfaces.py
testinfra/functional/test_tor_interfaces.py
import os import re import pytest sdvars = pytest.securedrop_test_vars @pytest.mark.parametrize('site', sdvars.tor_url_files) @pytest.mark.skipif(os.environ.get('FPF_CI', 'false') == "false", reason="Can only assure Tor is configured in CI atm") def test_www(Command, site): """ Ensure tor...
import os import re import pytest sdvars = pytest.securedrop_test_vars @pytest.mark.xfail @pytest.mark.parametrize('site', sdvars.tor_url_files) @pytest.mark.skipif(os.environ.get('FPF_CI', 'false') == "false", reason="Can only assure Tor is configured in CI atm") def test_www(Command, site): ...
agpl-3.0
Python
89f2f8b9a7b6992ecd2f1da01678cf10b2fc55d7
Test that document download requests set the auth header
alphagov/notifications-api,alphagov/notifications-api
tests/app/clients/test_document_download.py
tests/app/clients/test_document_download.py
import requests import requests_mock import pytest from app.clients.document_download import DocumentDownloadClient, DocumentDownloadError @pytest.fixture(scope='function') def document_download(client, mocker): client = DocumentDownloadClient() current_app = mocker.Mock(config={ 'DOCUMENT_DOWNLOAD_A...
import requests import requests_mock import pytest from app.clients.document_download import DocumentDownloadClient, DocumentDownloadError @pytest.fixture(scope='function') def document_download(client, mocker): client = DocumentDownloadClient() current_app = mocker.Mock(config={ 'DOCUMENT_DOWNLOAD_A...
mit
Python
8886254d4f7e0c67bcd2024f0b6751e52d9b0e14
Add component interface test
liqd/adhocracy4,liqd/adhocracy4,liqd/adhocracy4,liqd/adhocracy4
tests/dashboard/test_components_registry.py
tests/dashboard/test_components_registry.py
import pytest from adhocracy4.dashboard.components import DashboardComponent from adhocracy4.dashboard.components import DashboardComponents def test_register(dashboard_test_component_factory): project_component0 = dashboard_test_component_factory( weight=0, identifier='b') project_component1 = dashb...
import pytest from adhocracy4.dashboard.components import DashboardComponents def test_register(dashboard_test_component_factory): project_component0 = dashboard_test_component_factory( weight=0, identifier='b') project_component1 = dashboard_test_component_factory( weight=0, identifier='a') ...
agpl-3.0
Python
6ab5be095442ec1318c64b665b980597e1e52c21
fix test case error: test_device_manager -- -- not found method context.register
IfengAutomation/uitester,IfengAutomation/uitester
tests/device_manager/test_device_manager.py
tests/device_manager/test_device_manager.py
import unittest import os from uitester.device_manager import device_manager from uitester.device_manager.device import Device class TestDeviceManager(unittest.TestCase): def setUp(self): tests_root = os.path.join(os.path.dirname(__file__), os.path.pardir) sdk_path = os.path.join(tests_root, 'and...
import unittest import os from uitester.device_manager import device_manager from uitester.device_manager.device import Device class TestDeviceManager(unittest.TestCase): def setUp(self): tests_root = os.path.join(os.path.dirname(__file__), os.path.pardir) sdk_path = os.path.join(tests_root, 'and...
apache-2.0
Python
904297c523634a110379940ff0eeb23ab11fea01
Drop Py2 and six on tests/integration/shell/test_master_tops.py
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
tests/integration/shell/test_master_tops.py
tests/integration/shell/test_master_tops.py
""" tests.integration.shell.master_tops ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ import pytest from tests.support.case import ShellCase from tests.support.helpers import slowTest @pytest.mark.windows_whitelisted class MasterTopsTest(ShellCase): _call_binary_ = "salt" @slowTest def test_custom_t...
# -*- coding: utf-8 -*- """ tests.integration.shell.master_tops ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ from __future__ import absolute_import, print_function, unicode_literals import pytest from tests.support.case import ShellCase from tests.support.helpers import slowTest @pytest.mark.windows_whitelisted ...
apache-2.0
Python
d15cd26815c4ae0aa88f43d095099a1135f5c83d
Fix constant error
jaredhasenklein/the-blue-alliance,bvisness/the-blue-alliance,jaredhasenklein/the-blue-alliance,synth3tk/the-blue-alliance,synth3tk/the-blue-alliance,the-blue-alliance/the-blue-alliance,verycumbersome/the-blue-alliance,josephbisch/the-blue-alliance,tsteward/the-blue-alliance,jaredhasenklein/the-blue-alliance,josephbisch...
tests/test_notification_schedule_updated.py
tests/test_notification_schedule_updated.py
import unittest2 import json from google.appengine.ext import ndb from google.appengine.ext import testbed from consts.notification_type import NotificationType from helpers.event.event_test_creator import EventTestCreator from helpers.model_to_dict import ModelToDict from models.team import Team from notifications.s...
import unittest2 import json from google.appengine.ext import ndb from google.appengine.ext import testbed from consts.notification_type import NotificationType from helpers.event.event_test_creator import EventTestCreator from helpers.model_to_dict import ModelToDict from models.team import Team from notifications.s...
mit
Python
9b334ee5434638b5b905ccb36b00dafa7a8b3019
Change default connection pool size to 8 connections instead of 20.
llevar/germline-regenotyper,llevar/germline-regenotyper
tracker/src/main/tracker/util/connection.py
tracker/src/main/tracker/util/connection.py
import os from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import sessionmaker from sqlalchemy import create_engine from sqlalchemy.orm.scoping import scoped_session DB_URL = os.environ.get('DB_URL') if not DB_URL: raise ValueError("DB_URL not present in the environment") Base = automap_base(...
import os from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import sessionmaker from sqlalchemy import create_engine from sqlalchemy.orm.scoping import scoped_session DB_URL = os.environ.get('DB_URL') if not DB_URL: raise ValueError("DB_URL not present in the environment") Base = automap_base(...
mit
Python
061d89fa6381be4c7a647092fb8b1c3f0a4c1509
Add and reformat docstrings to ota decorators
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/ota/decorators.py
corehq/apps/ota/decorators.py
import logging from functools import wraps from django.http import HttpResponseForbidden from dimagi.utils.couch.cache.cache_core import get_redis_client from corehq.apps.domain.models import Domain from corehq.apps.domain.auth import BASIC from corehq.apps.domain.decorators import ( get_multi_auth_decorator, ...
import logging from functools import wraps from django.http import HttpResponseForbidden from dimagi.utils.couch.cache.cache_core import get_redis_client from corehq.apps.domain.models import Domain from corehq.apps.domain.auth import BASIC from corehq.apps.domain.decorators import ( get_multi_auth_decorator, ...
bsd-3-clause
Python
b67f2d763dfb3d0e3ad99a54c47bd974ec82a6d1
fix typo
interrogator/corpkit,interrogator/corpkit
corpkit/dictionaries/roles.py
corpkit/dictionaries/roles.py
# This file translates CoreNLP labels into SFL categories def translator(): from collections import namedtuple roledict = { 'actor': ['nsubj', 'agent', 'csubj', 'agent'], 'adjunct': ['advmod', 'agent', '(prep|nmod)(_|:).*', 'advcl', 'tmod'], 'auxiliary': ['auxpass', 'a...
# This file translates CoreNLP labels into SFL categories def translator(): from collections import namedtuple roledict = { 'actor': ['nsubj', 'agent', 'csubj', 'agent'], 'adjunct': ['advmod', 'agent', '(prep|nmod)(_|:).*', 'advcl', 'tmod'], 'auxiliary': ['auxpass', 'a...
mit
Python
aee49d59b76400389ffa768950b479094059e385
Update test models for new metaclass support.
ulule/django-linguist
linguist/tests/translations.py
linguist/tests/translations.py
# -*- coding: utf-8 -*_ from django.db import models from ..base import ModelTranslationBase from ..mixins import ModelMixin, ManagerMixin class FooManager(ManagerMixin, models.Manager): pass class BarManager(ManagerMixin, models.Manager): pass class FooModel(ModelMixin, models.Model): title = models...
# -*- coding: utf-8 -*_ from django.db import models from ..base import ModelTranslationBase from ..mixins import ModelMixin, ManagerMixin class FooManager(ManagerMixin, models.Manager): pass class BarManager(ManagerMixin, models.Manager): pass class FooModel(ModelMixin, models.Model): title = models...
mit
Python
e82f6911cda51d489e6690f95f57b80249125c6b
test floats
fordf/sorting-algorithms
src/test_insertion_sort.py
src/test_insertion_sort.py
"""Tests for insertion sort function.""" import pytest LISTS = [ ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), ([10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), ([4, 2, 4, 1, 3, 5, 6, 3], [1, 2, 3, 3, 4, 4, 5, 6]), ([-1, -10, -3, 2, 139, -101, 192], [-101, -10, -...
"""Tests for insertion sort function.""" import pytest LISTS = [ ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), ([10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), ([4, 2, 4, 1, 3, 5, 6, 3], [1, 2, 3, 3, 4, 4, 5, 6]), ([-1, -10, -3, 2, 139, -101, 192], [-101, -10, -...
mit
Python
0f96ef21dfbedf0722719bb4ad22a01ed5edddcd
Update ipc_lista4.10.py
any1m1c/ipc20161
lista4-thiago/ipc_lista4.10.py
lista4-thiago/ipc_lista4.10.py
#ipc_lista4.10 #Thiago Santos Borges - Matrícula - 1615310023 # vetor1 = [] vetor2 = [] vetorint = [] print("Numeros do vetor 1") for i in range(10): vetor1.append(int(input("Digite numero:"))) print("Numeros do vetor 2") for i in range(10): vetor2.append(int(input("Digite numero:"))) for i,p in zip(vetor1,v...
#ipc_lista4.01 #Thiago Santos Borges - Matrícula - 1615310023 # vetor1 = [] vetor2 = [] vetorint = [] print("Numeros do vetor 1") for i in range(10): vetor1.append(int(input("Digite numero:"))) print("Numeros do vetor 2") for i in range(10): vetor2.append(int(input("Digite numero:"))) for i,p in zip(vetor1,v...
apache-2.0
Python
eb82ce3471452467dff777c14e89ba960266c329
Update ipc_lista4.14.py
any1m1c/ipc20161
lista4-thiago/ipc_lista4.14.py
lista4-thiago/ipc_lista4.14.py
#ipc_lista4.14 #Thiago Santos Borges - Matrícula - 1615310023 # pergunta = ["Telefonou para a vítima?","Esteve no local do crime?","Mora perto da vítima?","Devia para a vítima?" ,"Já trabalhou com a vítima?"] classificacao = "" acm = 0 print("Respostas S ou s-sim // N ou n-nao") for i in pergunta: resp = str(input...
#ipc_lista4.01 #Thiago Santos Borges - Matrícula - 1615310023 # pergunta = ["Telefonou para a vítima?","Esteve no local do crime?","Mora perto da vítima?","Devia para a vítima?" ,"Já trabalhou com a vítima?"] classificacao = "" acm = 0 print("Respostas S ou s-sim // N ou n-nao") for i in pergunta: resp = str(input...
apache-2.0
Python
786bc416ca00c7021f5881e459d2634e8fcd8458
Add ipaddress.IPv[46]Network to the supported types
sharhalakis/vdns
src/vdb/src/_vdb/common.py
src/vdb/src/_vdb/common.py
# Copyright (c) 2005-2016 Stefanos Harhalakis <v13@v13.gr> # Copyright (c) 2016-2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
# Copyright (c) 2005-2016 Stefanos Harhalakis <v13@v13.gr> # Copyright (c) 2016-2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
apache-2.0
Python
587330a4e7683b53a6e31e37e641cf8341cc7cf7
Add 404 when rental does not exist
verleihtool/verleihtool,verleihtool/verleihtool,verleihtool/verleihtool,verleihtool/verleihtool
rental/views.py
rental/views.py
from django.shortcuts import get_object_or_404, render, redirect from .models import Rental, ItemRental from django.http import Http404 from django.db import transaction from django.urls import reverse from django.views.decorators.http import require_POST import re @require_POST @transaction.atomic def create(request...
from django.shortcuts import get_object_or_404, render, redirect from .models import Rental, ItemRental from django.http import Http404 from django.db import transaction from django.urls import reverse from django.views.decorators.http import require_POST import re @require_POST @transaction.atomic def create(request...
agpl-3.0
Python
ce358129371d1abedc1eda7874c324c162c41aa3
Address jellyfin sensor feedback (#80222)
mezz64/home-assistant,mezz64/home-assistant,w1ll1am23/home-assistant,w1ll1am23/home-assistant
homeassistant/components/jellyfin/coordinator.py
homeassistant/components/jellyfin/coordinator.py
"""Data update coordinator for the Jellyfin integration.""" from __future__ import annotations from abc import abstractmethod from datetime import timedelta from typing import Any, TypeVar, Union from jellyfin_apiclient_python import JellyfinClient from homeassistant.config_entries import ConfigEntry from homeassist...
"""Data update coordinator for the Jellyfin integration.""" from __future__ import annotations from abc import abstractmethod from datetime import timedelta from typing import Any, TypeVar, Union from jellyfin_apiclient_python import JellyfinClient from homeassistant.config_entries import ConfigEntry from homeassist...
apache-2.0
Python
8220817d479a101f06fa029b221b2faca496260a
Switch zwave_js redact keys from tuple to set (#68375)
mezz64/home-assistant,w1ll1am23/home-assistant,toddeye/home-assistant,toddeye/home-assistant,w1ll1am23/home-assistant,nkgilley/home-assistant,nkgilley/home-assistant,mezz64/home-assistant
homeassistant/components/zwave_js/diagnostics.py
homeassistant/components/zwave_js/diagnostics.py
"""Provides diagnostics for Z-Wave JS.""" from __future__ import annotations from zwave_js_server.client import Client from zwave_js_server.dump import dump_msgs from zwave_js_server.model.node import NodeDataType from homeassistant.components.diagnostics.util import async_redact_data from homeassistant.config_entrie...
"""Provides diagnostics for Z-Wave JS.""" from __future__ import annotations from zwave_js_server.client import Client from zwave_js_server.dump import dump_msgs from zwave_js_server.model.node import NodeDataType from homeassistant.components.diagnostics.util import async_redact_data from homeassistant.config_entrie...
apache-2.0
Python
c5eb1d3a9c7459bc711d8a6adb4a23d6fc13fe2f
Send plots away.
berkeley-stat159/project-alpha,reychil/project-alpha-1
code/utils/tests/test_bh.py
code/utils/tests/test_bh.py
""" Tests for bh_procedure in benjamini_hochberg module Run at the project directory with: nosetests code/utils/tests/test_bh.py """ # Loading modules. import numpy as np import itertools import scipy.ndimage from scipy.ndimage.filters import gaussian_filter import matplotlib matplotlib.use('Agg') import matplotl...
""" Tests for bh_procedure in benjamini_hochberg module Run at the project directory with: nosetests code/utils/tests/test_bh.py """ # Loading modules. import numpy as np import itertools import scipy.ndimage from scipy.ndimage.filters import gaussian_filter import matplotlib.pyplot as plt import nibabel as nib i...
bsd-3-clause
Python
61dd5517c3f14a3277ac19216a139830be997434
Fix PEP 8 issue.
thaim/ansible,thaim/ansible
lib/ansible/modules/utilities/logic/_include.py
lib/ansible/modules/utilities/logic/_include.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
mit
Python
9cb6537da58dc9d3b6ddddc775e029476cf7014d
update to create super user for instances
stratosphereips/Manati,stratosphereips/Manati,stratosphereips/Manati,stratosphereips/Manati
manati_ui/migrations/0027_create_super_users.py
manati_ui/migrations/0027_create_super_users.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2017-04-08 11:33 from __future__ import unicode_literals from django.db import migrations, models from django.contrib.auth.hashers import make_password import datetime def create_admin_users(apps, schema_editor): User = apps.get_registered_model('auth', 'Use...
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2017-04-08 11:33 from __future__ import unicode_literals from django.db import migrations, models import datetime def create_admin_users(apps, schema_editor): User = apps.get_registered_model('auth', 'User') admin1 = User( username='seba', ...
agpl-3.0
Python
5403e74b8f4d8a49f3532a2a26a052ae682d213d
Bump version to 0.7.6 (final)
abloomston/sympy,grevutiu-gabriel/sympy,kaichogami/sympy,postvakje/sympy,Curious72/sympy,Sumith1896/sympy,Titan-C/sympy,beni55/sympy,madan96/sympy,souravsingh/sympy,mafiya69/sympy,Gadal/sympy,ChristinaZografou/sympy,lindsayad/sympy,VaibhavAgarwalVA/sympy,iamutkarshtiwari/sympy,jerli/sympy,kaushik94/sympy,garvitr/sympy,...
sympy/release.py
sympy/release.py
__version__ = "0.7.6"
__version__ = "0.7.6.rc2"
bsd-3-clause
Python
e849144f7c3d1f8a9d2eddb9cd4bdc7994ae5932
Change version too
kate-v-stepanova/TACA,SciLifeLab/TACA,senthil10/TACA,senthil10/TACA,vezzi/TACA,SciLifeLab/TACA,SciLifeLab/TACA,vezzi/TACA,kate-v-stepanova/TACA
taca/__init__.py
taca/__init__.py
""" Main TACA module """ __version__ = '0.5.4.1'
""" Main TACA module """ __version__ = '0.5.4'
mit
Python
fec4f537fb3af1ead3c47c3759b03a7912cd04b2
Fix compatibility with oslo.db 12.1.0
openstack/tacker,openstack/tacker,openstack/tacker
tacker/db/api.py
tacker/db/api.py
# Copyright 2011 VMware, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
# Copyright 2011 VMware, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
Python
5e68cf46c8cb24f13506e86694760b6ced094031
define channel in url.
cj1324/WebHooks2IRC
src/webhooks2irc/app.py
src/webhooks2irc/app.py
#!/usr/bin/env python # coding: UTF-8 from __future__ import (absolute_import, unicode_literals) try: from urllib import parse as urlparse # for python3 except ImportError: import urlparse import bottle from bottle import (get, post, template, ...
#!/usr/bin/env python # coding: UTF-8 from __future__ import (absolute_import, unicode_literals) try: from urllib import parse as urlparse # for python3 except ImportError: import urlparse import bottle from bottle import (get, post, template, ...
bsd-2-clause
Python
e3b614aba7bcb18cd93883ae7217e09da727f79a
Fix some bugs.
oubiwann/peloid
peloid/app/shell/gameshell.py
peloid/app/shell/gameshell.py
from carapace.app.shell import base from carapace.sdk import interfaces, registry config = registry.getConfig() # XXX move this into config.ssh BANNER_HELP = "This shell has no commands; it simply returns what you type." class SessionTransport(base.TerminalSessionTransport): """ """ def getHelpHint(se...
from carapace.app.shell import base from carapace.sdk import registry config = registry.getConfig() # XXX move this into config.ssh BANNER_HELP = "This shell has no commands; it simply returns what you type." class SessionTransport(base.TerminalSessionTransport): """ """ def getHelpHint(self): ...
mit
Python
3f6fb270072ef5870a9613aed30b2e12ca92c255
Test not runnable elements.
fhirschmann/penchy,fhirschmann/penchy
penchy/tests/test_elements.py
penchy/tests/test_elements.py
import unittest2 from penchy.jobs.elements import Workload, Tool from penchy.tests.util import MockPipelineElement class PipelineElementHookTest(unittest2.TestCase): def setUp(self): self.e = MockPipelineElement() self.list_ = [23, 42, 5] def test_pre_hooks(self): self.e.prehooks = [...
import unittest2 from penchy.tests.util import MockPipelineElement class PipelineElementHookTest(unittest2.TestCase): def setUp(self): self.e = MockPipelineElement() self.list_ = [23, 42, 5] def test_pre_hooks(self): self.e.prehooks = [ lambda: self.list_.__setitem__(0, 1...
mit
Python
487eae696f5d5cdd03fe35dc670f650d5c9eaeac
Add some doc about flock(2) Fix a fd leak in FileLock.release.
huangjunwen/tagcache
tagcache/lock.py
tagcache/lock.py
# -*- encoding: utf-8 -*- import os import fcntl from tagcache.utils import open_file class FileLock(object): """ From flock(2) on linux: ... If a process uses open(2) (or similar) to obtain more than one descriptor for the same file, these descriptors are treated inde...
# -*- encoding: utf-8 -*- import os import fcntl from tagcache.utils import open_file class FileLock(object): def __init__(self, path): self.path = path self.fd = None @property def is_acquired(self): return self.fd is not None def acquire(self, ex=False, nb=False): ...
mit
Python
b667126d35aed8f8463e9f67f9781d07f83a57c0
Update example in lookup dict.py (#39488)
thaim/ansible,thaim/ansible
lib/ansible/plugins/lookup/dict.py
lib/ansible/plugins/lookup/dict.py
# (c) 2014, Kent R. Spillner <kspillner@acm.org> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ lookup: dict version_added: "1.5" ...
# (c) 2014, Kent R. Spillner <kspillner@acm.org> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ lookup: dict version_added: "1.5" ...
mit
Python
89a4cc6218f2527f72d8b12d2c881be34f2aed54
Bump major
NiGhTTraX/hackernews-scraper
hackernews_scraper/__init__.py
hackernews_scraper/__init__.py
__version__ = "2.0.0" from hackernews_scraper.hnscraper import (CommentScraper, StoryScraper, TooManyItemsException)
__version__ = "1.0.2" from hackernews_scraper.hnscraper import (CommentScraper, StoryScraper, TooManyItemsException)
bsd-2-clause
Python
e899d71539cdb62b5a4d934c6051e4d9fce13d0e
update test partials for mock configs
USGS-EROS/lcmap-firebird,USGS-EROS/lcmap-firebird
test/conftest.py
test/conftest.py
import pytest import firebird from copy import deepcopy from firebird import grid from firebird import ids from firebird import timeseries from pyspark import SparkContext from pyspark.sql import SparkSession, SQLContext from .shared import merlin_grid_partial from .shared import merlin_nea...
import pytest import firebird from copy import deepcopy from firebird import grid from firebird import ids from firebird import timeseries from pyspark import SparkContext from pyspark.sql import SparkSession, SQLContext from .shared import merlin_grid_partial from .shared import merlin_nea...
unlicense
Python
6318a2a122bfabcd269c772425a0bcd60732617a
Fix deviceId clashes when running tests in parallel
ibm-watson-iot/iot-python,ibm-messaging/iot-python,ibm-watson-iot/iot-python
test/conftest.py
test/conftest.py
import os import pytest import uuid from testUtils import AbstractTest from ibmiotf.api.common import ApiException from ibmiotf.api.registry.devices import DeviceCreateRequest import logging logger = logging.getLogger() @pytest.fixture def testUtil(scope="module"): yield AbstractTest() @pytest.fixture def devi...
import os import pytest import uuid from testUtils import AbstractTest from ibmiotf.api.common import ApiException from ibmiotf.api.registry.devices import DeviceCreateRequest import logging logger = logging.getLogger() @pytest.fixture def testUtil(scope="module"): yield AbstractTest() @pytest.fixture def devi...
epl-1.0
Python
16f47b29dd20e99c63612e68ac75c61bef4c2d41
Clean up notebook server printing
minrk/jupyter-js-services,blink1073/services,jupyterlab/services,minrk/jupyter-js-services,jupyter/jupyter-js-services,blink1073/services,jupyter/jupyter-js-services,jupyterlab/services,minrk/jupyter-js-services,jupyter/jupyter-js-services,blink1073/jupyter-js-services,blink1073/jupyter-js-services,jupyterlab/services,...
test/run_test.py
test/run_test.py
# Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import subprocess import sys import argparse import threading KARMA_PORT = 9876 argparser = argparse.ArgumentParser( description='Run Jupyter JS Sevices integration tests' ) argparser.add_argument('-b', '...
# Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import subprocess import sys import argparse import threading KARMA_PORT = 9876 argparser = argparse.ArgumentParser( description='Run Jupyter JS Sevices integration tests' ) argparser.add_argument('-b', '...
bsd-3-clause
Python
6c043a58f907f7058b0f96792c02201ad299e10e
Create index page view
matthewlane/mesa,matthewlane/mesa,matthewlane/mesa,matthewlane/mesa
statuses/views.py
statuses/views.py
from django.views.generic.list import ListView from rest_framework import generics from .models import Status from .serializers import StatusSerializer class IndexView(ListView): model = Status template_name = "index.html" class StatusView(generics.ListCreateAPIView): model = Status serializer_class...
from rest_framework import generics from .models import Status from .serializers import StatusSerializer class StatusView(generics.ListCreateAPIView): model = Status serializer_class = StatusSerializer
mit
Python
6f8df25d80703c4357d46a8577cd21e988e2d902
Change Name variables
ricaportela/convert-data-nbf,ricaportela/convert-data-nbf
changedate.py
changedate.py
""" Calcular Data a partir de uma quantidade de minutos """ def change_date(date, op, value): """ Calcular nova data """ dataEnt, horaEnt = date.split(" ", 2) diaIni, mesIni, anoIni = dataEnt.split("/", 3) horaIni, minuIni = horaEnt.split(":", 2) # transformar tudo em minutos # converter hora...
""" Calcular Data a partir de uma quantidade de minutos """ def change_date(date, op, value): """ Calcular nova data """ dataEnt, horaEnt = date.split(" ", 2) diaIni, mesIni, anoIni = dataEnt.split("/", 3) horaIni, minuIni = horaEnt.split(":", 2) # transformar tudo em minutos # converter hora...
mit
Python
38eaea9abbfca52c1f70ba454b5813ad35793098
Put the API endpoints first in the root urlconf
stackdio/stackdio,stackdio/stackdio,clarkperkins/stackdio,stackdio/stackdio,stackdio/stackdio,clarkperkins/stackdio,clarkperkins/stackdio,clarkperkins/stackdio
stackdio/server/urls.py
stackdio/server/urls.py
# -*- coding: utf-8 -*- # Copyright 2014, Digital Reasoning # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- coding: utf-8 -*- # Copyright 2014, Digital Reasoning # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Python
97a208cfe92c3517b8cb2dd4f79ebe6da144cf97
Bump version
okfish/django-oscar-payonline,okfish/django-oscar-payonline
oscar_payonline/__init__.py
oscar_payonline/__init__.py
__version__ = '0.2.0-dev' default_app_config = 'oscar_payonline.config.OscarPayonlineConfig'
__version__ = '0.1.0-dev' default_app_config = 'oscar_payonline.config.OscarPayonlineConfig'
bsd-3-clause
Python
decc454dfb50258eaab4635379b1c18470246f62
Fix highlighting of "External ID Types" menu entry
ThiefMaster/indico,pferreir/indico,mic4ael/indico,ThiefMaster/indico,DirkHoffmann/indico,ThiefMaster/indico,OmeGak/indico,mic4ael/indico,indico/indico,DirkHoffmann/indico,mvidalgarcia/indico,mvidalgarcia/indico,pferreir/indico,OmeGak/indico,OmeGak/indico,mic4ael/indico,mic4ael/indico,indico/indico,DirkHoffmann/indico,i...
indico/modules/events/views.py
indico/modules/events/views.py
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (a...
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (a...
mit
Python
6b61882e39a01019760052547763bbf1f8f8d556
Fix for re module differences between 2.6 and 2.7.
nzwulfin/spaceclone,nzwulfin/spaceclone
src/spaceclone/satellite/clone.py
src/spaceclone/satellite/clone.py
import re import pickle import base64 import datetime class Clone: def __init__(self, **kwargs): self.chanid = None self.source = None self.prefix = None self.parent = None self.cloneset = None self.basename = None self.baselabel = None self.summary ...
import re import pickle import base64 import datetime class Clone: def __init__(self, **kwargs): self.chanid = None self.source = None self.prefix = None self.parent = None self.cloneset = None self.basename = None self.baselabel = None self.summary ...
mit
Python
0cecdbbcfdff554819a9cc97f0deb22da7aaf8a3
test for chuck fixed
sukeesh/Jarvis,sukeesh/Jarvis,sukeesh/Jarvis,sukeesh/Jarvis
jarviscli/tests/test_parser.py
jarviscli/tests/test_parser.py
import unittest from Jarvis import Jarvis class ParserTest(unittest.TestCase): def setUp(self): self.jarvis = Jarvis() def test_chuck(self): user_input = "Jarvis, I want to hear a joke about Chuck Norris, can you help me?" parsed_input = self.jarvis.parse_input(user_input).split() ...
import unittest from Jarvis import Jarvis class ParserTest(unittest.TestCase): def setUp(self): self.jarvis = Jarvis() def test_chuck(self): user_input = "Jarvis, I want to hear a joke about Chuck Norris, can you help me?" parsed_input = self.jarvis.parse_input(user_input).split() ...
mit
Python
42b17d53a7bcfbc29e9de900b461c16e5d266b7f
clean up the DB after every git push
goneri/dci-control-server,redhat-cip/dci-control-server,goneri/dci-control-server,goneri/dci-control-server,redhat-cip/dci-control-server,enovance/dci-control-server,enovance/dci-control-server,goneri/dci-control-server
init_db.py
init_db.py
# -*- coding: utf-8 -*- # # Copyright (C) 2015 eNovance SAS <licensing@enovance.com> # # 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 ...
# -*- coding: utf-8 -*- # # Copyright (C) 2015 eNovance SAS <licensing@enovance.com> # # 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 ...
apache-2.0
Python
f7b04f092cecd13d2195c5f992fdc013e2a33995
use ruox curve for downstairs temperature
ColumbiaCMB/kid_readout,ColumbiaCMB/kid_readout
kid_readout/utils/hpd_temps.py
kid_readout/utils/hpd_temps.py
""" Routines for getting temperature data for HPD cryostat from the 'adc' machine Currently assumes the /home/adclocal/data/cooldown_logs directory on 'adc' is mounted to /home/data/adc_mount """ import glob import os import time import bisect import numpy as np import netCDF4 rx102a_dat = np.loadtxt('/home/gjones/R...
""" Routines for getting temperature data for HPD cryostat from the 'adc' machine Currently assumes the /home/adclocal/data/cooldown_logs directory on 'adc' is mounted to /home/data/adc_mount """ import glob import os import time import bisect import numpy as np import netCDF4 nc_dir = "/home/data/adc_mount" _filec...
bsd-2-clause
Python
09d6922d2db300782fd46b45c2c4922f62779745
Update bicycle_repair_station test
mapzen/vector-datasource,mapzen/vector-datasource,mapzen/vector-datasource
integration-test/662-basic-outdoor-pois.py
integration-test/662-basic-outdoor-pois.py
#http://www.openstreetmap.org/node/1387024181 assert_has_feature( 16, 10550, 25297, 'pois', { 'kind': 'bbq', 'min_zoom': 18 }) # Node: Valencia Cyclery (3443701422) # http://www.openstreetmap.org/node/3443701422 assert_has_feature( 16, 10481, 25335, 'pois', { 'id': 3443701422, 'kind': 'bicycle_repair_s...
#http://www.openstreetmap.org/node/1387024181 assert_has_feature( 16, 10550, 25297, 'pois', { 'kind': 'bbq', 'min_zoom': 18 }) #http://www.openstreetmap.org/node/3497698404 assert_has_feature( 16, 10471, 25343, 'pois', { 'kind': 'bicycle_repair_station', 'min_zoom': 18 }) #http://www.openstreetmap.org...
mit
Python
e579b04beb2f3c4fbe3e27d386919f3c8af888e5
Disable updating serviceInfo when retrieving daily data.
alykhank/FoodMenu,alykhank/FoodMenu,alykhank/FoodMenu
retrieveData.py
retrieveData.py
#!/usr/bin/env python import json, os, requests from awsauth import S3Auth key = os.environ.get('UWOPENDATA_APIKEY') ACCESS_KEY = os.environ.get('AWS_ACCESS_KEY_ID') SECRET_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY') def getData(service): payload = {'key': key, 'service': service} r = requests.get('http://api.uwa...
#!/usr/bin/env python import json, os, requests from awsauth import S3Auth key = os.environ.get('UWOPENDATA_APIKEY') ACCESS_KEY = os.environ.get('AWS_ACCESS_KEY_ID') SECRET_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY') def getData(service): payload = {'key': key, 'service': service} r = requests.get('http://api.uwa...
mit
Python
b8bd12d8c23eb19dce8d8a66ef9bfeedfc78174a
fix python3 error
packagemgmt/repositorytools,stardust85/repositorytools,stardust85/repositorytools,packagemgmt/repositorytools
repositorytools/__init__.py
repositorytools/__init__.py
__author__ = 'msamia' __version__ = '3.0.52' from .lib import *
__author__ = 'msamia' __version__ = '3.0.52' from lib import *
apache-2.0
Python
670dcdfc14d855c45b076f852673906dc450f515
Remove unused functions
illicitonion/synapse,rzr/synapse,howethomas/synapse,TribeMedia/synapse,howethomas/synapse,TribeMedia/synapse,howethomas/synapse,iot-factory/synapse,howethomas/synapse,illicitonion/synapse,rzr/synapse,iot-factory/synapse,iot-factory/synapse,matrix-org/synapse,matrix-org/synapse,iot-factory/synapse,rzr/synapse,matrix-org...
synapse/events/snapshot.py
synapse/events/snapshot.py
# -*- coding: utf-8 -*- # Copyright 2014 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
# -*- coding: utf-8 -*- # Copyright 2014 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
Python
2961b7b606787ebcc08e9875f9f908c92559f83b
Use resolve_url
takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web
takeyourmeds/utils/test.py
takeyourmeds/utils/test.py
from django.test import TestCase from django.shortcuts import resolve_url from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse User = get_user_model() class TestCase(TestCase): def setUp(self): self.user = self.create_user('testuser') def assertStatusCode(self, ...
from django.test import TestCase from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse User = get_user_model() class TestCase(TestCase): def setUp(self): self.user = self.create_user('testuser') def assertStatusCode(self, status_code, fn, urlconf, *args, **kwargs...
mit
Python
6d3180ffd84e126ee4441a367a48a750d270892e
Return only alphabetic words from sentence
miso-belica/sumy,miso-belica/sumy
sumy/document/_sentence.py
sumy/document/_sentence.py
# -*- coding: utf8 -*- from __future__ import absolute_import from __future__ import division, print_function, unicode_literals import re from itertools import chain from .._compat import to_unicode, to_string, unicode_compatible _WORD_PATTERN = re.compile(r"^[^\W_]+$", re.UNICODE) @unicode_compatible class Sent...
# -*- coding: utf8 -*- from __future__ import absolute_import from __future__ import division, print_function, unicode_literals from itertools import chain from .._compat import to_unicode, to_string, unicode_compatible @unicode_compatible class Sentence(object): __slots__ = ("_words", "_is_heading",) def ...
apache-2.0
Python
bd902cbac5bddf1936b31b6ef690734a1b629435
modify qt5 call in ipython for consistency
kaushik94/tardis,kaushik94/tardis,kaushik94/tardis,kaushik94/tardis
tardis/gui/interface.py
tardis/gui/interface.py
import os if os.environ.get('QT_API', None)=='pyqt': from PyQt5 import QtCore, QtWidgets elif os.environ.get('QT_API', None)=='pyside': from PySide2 import QtCore,QtWidgets else: raise ImportError('QT_API was not set! Please exit the IPython console\n' ' and at the bash prompt use : \n\n export QT_A...
import os if os.environ.get('QT_API', None)=='pyqt': from PyQt5 import QtCore, QtWidgets elif os.environ.get('QT_API', None)=='pyside': from PySide2 import QtCore,QtWidgets else: raise ImportError('QT_API was not set! Please exit the IPython console\n' ' and at the bash prompt use : \n\n export QT_A...
bsd-3-clause
Python
f61bf7909f763b932af77c4fa26d7c81588e0fac
Print statement added
EdinburghGenomics/clarity_scripts,EdinburghGenomics/clarity_scripts
prodscripts/AssignWorkflow.py
prodscripts/AssignWorkflow.py
import getopt import sys from genologics.entities import Process from genologics.lims import Lims HOSTNAME = "" VERSION = "" BASE_URI = "" api = None args = None def get_workflow_stage(lims, workflow_name, stage_name=None): workflows = [w for w in lims.get_workflows() if w.name == workflow_name] if len(wor...
import getopt import sys from genologics.entities import Process from genologics.lims import Lims HOSTNAME = "" VERSION = "" BASE_URI = "" api = None args = None def get_workflow_stage(lims, workflow_name, stage_name=None): workflows = [w for w in lims.get_workflows() if w.name == workflow_name] if len(wor...
mit
Python