commit
stringlengths
40
40
subject
stringlengths
1
3.25k
old_file
stringlengths
4
311
new_file
stringlengths
4
311
old_contents
stringlengths
0
26.3k
lang
stringclasses
3 values
proba
float64
0
1
diff
stringlengths
0
7.82k
26e915e391d8554f6e775dd962d63e565066708c
add missing HTTP headers
src/streamlink/plugins/goltelevision.py
src/streamlink/plugins/goltelevision.py
""" $description Spanish live TV sports channel owned by Gol Network. $url goltelevision.com $type live $region Spain """ import re from streamlink.plugin import Plugin, pluginmatcher from streamlink.plugin.api import validate from streamlink.stream.hls import HLSStream @pluginmatcher(re.compile( r"https?://(?:...
Python
0.000001
@@ -411,16 +411,174 @@ (self):%0A + self.session.http.headers.update(%7B%0A %22Origin%22: %22https://goltelevision.com%22,%0A %22Referer%22: %22https://goltelevision.com/%22,%0A %7D)%0A @@ -829,16 +829,17 @@ nifest%22) +, %0A
5a284d5e149e7a9281fdb9bd7d22a53f1119c43d
Bump API version
src/supervisor_twiddler/rpcinterface.py
src/supervisor_twiddler/rpcinterface.py
import os from supervisor.options import UnhosedConfigParser from supervisor.options import ProcessGroupConfig from supervisor.datatypes import list_of_strings from supervisor.states import SupervisorStates from supervisor.states import ProcessStates, STOPPED_STATES from supervisor.xmlrpc import Faults as SupervisorFa...
Python
0
@@ -442,17 +442,17 @@ ON = '0. -2 +3 '%0A%0Aclass
621797e33e6dc9fd7ae6c9e08aef244b5efed6ff
Fix for #416
src/utils/management/commands/backup.py
src/utils/management/commands/backup.py
import os import shutil import boto from boto.s3.key import Key import subprocess from django.core.management.base import BaseCommand from django.conf import settings from django.utils import timezone from django.core.mail import send_mail from core import models def copy_file(source, destination): """ :par...
Python
0
@@ -3666,24 +3666,215 @@ %22%22%22%0A +%0A # Ensure temp dir exists:%0A if not os.path.exists(os.path.join(settings.BASE_DIR, 'files', 'temp')):%0A os.makedirs(os.path.join(settings.BASE_DIR, 'files', 'temp'))%0A%0A star
8279687c712a4e0081377a44efd562ed8dfcae0d
Improve error messages and improve docstrings/tests for Dimension.
sympy/physics/unitsystems/dimensions.py
sympy/physics/unitsystems/dimensions.py
# -*- coding:utf-8 -*- """ Definition of physical dimensions. Unit systems will be constructed on top of these dimensions. """ from __future__ import division from copy import copy import numbers from sympy.core.containers import Dict, Tuple from sympy import Number class Dimension(Dict): """ This class r...
Python
0
@@ -117,16 +117,354 @@ ensions. +%0A%0AMost of the examples below used MKS system and are presented from the computer%0Apoint of view: from a human point, adding length to time is not legal in MKS%0Abut it is in natural system; for a computer in natural system there is no time%0Adimension (but a velocity dimension ins...
04ddc5c8ce6575065c80b6380b2374e4624c6d0a
Update docstring for get_compile_flags and get_link_flags.
tensorflow/python/platform/sysconfig.py
tensorflow/python/platform/sysconfig.py
# Copyright 2015 The TensorFlow Authors. 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 applica...
Python
0.000001
@@ -2102,27 +2102,31 @@ ags():%0A %22%22%22 -G +R et +urns the compila @@ -2145,56 +2145,490 @@ or c -ustom operators.%0A%0A Returns:%0A The compilation +ompiling with TensorFlow.%0A%0A The returned list of arguments can be passed to the compiler for compiling%0A against TensorFlow headers. The result is pl...
7e877fe4cd8494a7517d300e8515def92cae3f61
Fix #239. SimSiam margin should be float not tf.constant.
tensorflow_similarity/losses/simsiam.py
tensorflow_similarity/losses/simsiam.py
# Copyright 2020 The TensorFlow Authors. 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 applica...
Python
0
@@ -2540,29 +2540,14 @@ n = -tf.constant(%5B margin -%5D) %0A%0A @@ -3778,26 +3778,11 @@ n * -tf.constant(%5B 0.5 -%5D) + s
017a4c7846d3bf660b53116842d627ac125db792
add SOIL20 to the same (right file this time)
scripts/cscap/harvest_soil_texture.py
scripts/cscap/harvest_soil_texture.py
''' Scrape out the Soil Texture data from Google Drive ''' import pyiem.cscap_utils as util import sys import psycopg2 YEAR = sys.argv[1] config = util.get_config() pgconn = psycopg2.connect(database='sustainablecorn', host=config['database']['host']) pcursor = pgconn.cursor() # Get me a ...
Python
0
@@ -550,16 +550,26 @@ SOIL40', + 'SOIL20', %0A
b85d6cf53b8cc07528f3876886e10dd8721fc5ec
Fix employee demo under django 1.11
demo/examples/employees/models.py
demo/examples/employees/models.py
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from .managers import TemporalQuerySet @python_2_unicode_compatible class Department(models.Model): dept_no = models.CharField...
Python
0.000001
@@ -1234,16 +1234,104 @@ t_emp'%0A%0A + def __str__(self):%0A return %22%7B%7D - %7B%7D%22.format(self.employee, self.department)%0A%0A %0A@python @@ -1945,16 +1945,104 @@ date'%5D%0A%0A + def __str__(self):%0A return %22%7B%7D - %7B%7D%22.format(self.employee, self.department)%0A%0A %0A@python ...
70a40f50e9988fadfbc42f236881c1e3e78f40f1
Extend base settings for test settings. Don't use live cache backend for tests.
icekit/project/settings/_test.py
icekit/project/settings/_test.py
from ._develop import * # DJANGO ###################################################################### DATABASES['default'].update({ 'TEST': { 'NAME': DATABASES['default']['NAME'], # See: https://docs.djangoproject.com/en/1.7/ref/settings/#serialize 'SERIALIZE': False, }, }) INSTALLE...
Python
0
@@ -4,15 +4,12 @@ m ._ -develop +base imp @@ -96,16 +96,180 @@ ######%0A%0A +ALLOWED_HOSTS = ('*', )%0A%0ACSRF_COOKIE_SECURE = False # Don't require HTTPS for CSRF cookie%0ASESSION_COOKIE_SECURE = False # Don't require HTTPS for session cookie%0A%0A DATABASE
44a6da5f6bc61924c234fc49e90f679b2d9b4c52
Bump @graknlabs_benchmark
dependencies/graknlabs/dependencies.bzl
dependencies/graknlabs/dependencies.bzl
# # GRAKN.AI - THE KNOWLEDGE GRAPH # Copyright (C) 2018 Grakn Labs Ltd # # 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 later v...
Python
0.000001
@@ -2124,48 +2124,48 @@ = %22 -5fbc895720c199da403e7cc163aec5b603a2aa86 +aa717279af73de2572cd754630b0796a22cbe6d0 %22 #
37aaeea29f4d6dfe4b5dddb3917835c300442802
Update dependency on client-java (#5681)
dependencies/graknlabs/dependencies.bzl
dependencies/graknlabs/dependencies.bzl
# # Copyright (C) 2020 Grakn Labs # # 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 later version. # # This program is distribut...
Python
0.999123
@@ -2167,48 +2167,48 @@ = %22 -e50f1076f5eecc6cddbc74d4e91458579f6931ce +3875b975dc781e6173119ddf28d59f579bcf7fe3 %22,%0A
c787d090adcfdaaf8d507fd5ca7d54b16d1670b9
switch to staging_rack
scripts/surface_water_quality_pallet.py
scripts/surface_water_quality_pallet.py
#!/usr/bin/env python # * coding: utf8 * ''' surface_water_quality_pallet.py A module that contains a pallet definition for the surface water quality project ''' from forklift.models import Pallet from os.path import join class SurfaceWaterQualityPallet(Pallet): def build(self, configuration): self.arc...
Python
0.000002
@@ -458,56 +458,8 @@ r')%5D -%0A self.staging = 'C:%5C%5CScheduled%5C%5Cstaging' %0A%0A @@ -546,16 +546,21 @@ .staging +_rack , 'water
6b4a44e68c46547aa645061ebae7cac27b9c7ea6
modify default jenkins job name/config filename
jenkins/jenkins_utils.py
jenkins/jenkins_utils.py
# # Copyright (c) 2010-2014, MIT Probabilistic Computing Project # # Lead Developers: Dan Lovell and Jay Baxter # Authors: Dan Lovell, Baxter Eaves, Jay Baxter, Vikash Mansinghka # Research Leads: Vikash Mansinghka, Patrick Shafto # # Licensed under the Apache License, Version 2.0 (the "License"); # you may...
Python
0
@@ -2254,16 +2254,27 @@ crosscat +-unit-tests ', type= @@ -2329,16 +2329,36 @@ efault=' +crosscat-unit-tests. config.x
5daa5460f32bb452980a9cd75d19c13a31484e08
remove unused imports
ddisearch/ddi/management/commands/load.py
ddisearch/ddi/management/commands/load.py
import logging import os from optparse import make_option import re import sys import time from django.conf import settings from django.core.management.base import BaseCommand, CommandError from progressbar import ProgressBar, Bar, Percentage, ETA, SimpleProgress from eulexistdb.db import ExistDB, ExistDBException f...
Python
0.000001
@@ -485,86 +485,8 @@ ics%0A -from ddisearch.geo.models import Location, GeonamesCountry, GeonamesContinent%0A from
1e3693eb60edaea9698ba3c761a9964ed51b55a7
bump version to 0.0.8
jinja2schema/__init__.py
jinja2schema/__init__.py
# coding: utf-8 """ jinja2schema ============ Type inference for Jinja2 templates. See http://jinja2schema.rtfd.org/ for documentation. :copyright: (c) 2014 Anton Romanovich :license: BSD """ __title__ = 'jinja2schema' __author__ = 'Anton Romanovich' __license__ = 'BSD' __copyright__ = 'Copyright 2014 Anton Roman...
Python
0.000001
@@ -343,9 +343,9 @@ 0.0. -7 +8 '%0A__
50232e968b0b02b70e9dfcb6203f83404529cfee
Fix for handling other device function (i.e., other context).
python/src/nnabla/experimental/graph_converters/identity.py
python/src/nnabla/experimental/graph_converters/identity.py
import nnabla as nn import nnabla.functions as F import nnabla.parametric_functions as PF import numpy as np from .helpers import GraphInfo class IdentityConverter(object): """ All functions are replaced with the same `new` function. Args: black_list (list): Black list of the function list. ...
Python
0
@@ -1782,17 +1782,29 @@ ctx=nn. -C +get_current_c ontext() @@ -3018,16 +3018,26 @@ on(func. +info.type_ name, in
c8aeddaaa57f991f9ed507eb8bc5bce51cf55269
Fix print()
test/Win32/mingw.py
test/Win32/mingw.py
""" This tests the MinGW C/C++ compiler support. """ #!/usr/bin/env python # # __COPYRIGHT__ # # 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 limita...
Python
0.000087
@@ -1648,17 +1648,17 @@ print - +( 'mingw e @@ -1663,16 +1663,17 @@ exists' +) %0Asys.exi
93a4ce6b98107ce1d798f05e1368d04e86b26b15
improve handling of blacklist
dicthash/dicthash.py
dicthash/dicthash.py
# -*- coding: utf-8 -*- """ DictHash.hash ============= A module implementing an md5 hash function for (nested) dictionaries. Functions --------- generate_hash_from_dict - generate an md5 hash from a (nested) dictionary """ import numpy as np import hashlib FLOAT_FACTOR = 1e15 def _save_convert_float_to_int(x)...
Python
0.000003
@@ -1342,37 +1342,37 @@ raw = ''%0A if -black +white list is None:%0A @@ -1381,22 +1381,28 @@ -black +white list = -%5B%5D +d.keys() %0A%0A @@ -1402,37 +1402,37 @@ s()%0A%0A if -white +black list is None:%0A @@ -1411,32 +1411,36 @@ if blacklist is +not None:%0A wh @@ -1449,29...
5edd851d53570364a075e840278f3dfe33158699
Awrite the correct version
salt/utils/thin.py
salt/utils/thin.py
''' Generate the salt thin tarball from the installed python files ''' # Import python libs import os import tarfile # Import third party libs import jinja2 import yaml try: import markupsafe HAS_MARKUPSAFE = True except ImportError: # Older jinja does not need markupsafe HAS_MARKUPSAFE = False # Imp...
Python
0.999055
@@ -1578,24 +1578,93 @@ -call')%0A +with open(thinver, 'w+') as fp_:%0A fp_.write(salt.__version__)%0A os.chdir @@ -1690,20 +1690,16 @@ inver))%0A - tfp. @@ -1713,28 +1713,24 @@ rsion')%0A - - os.chdir(sta @@ -1741,81 +1741,8 @@ ir)%0A - with open(thinver, 'w+') as fp_:%0A ...
4d9b2cecc592cc1075ddea6fcab980997434807f
remove include for admin
actstream/runtests/urls.py
actstream/runtests/urls.py
import os from django.contrib import admin from django.views.static import serve try: from django.urls import include, url except ImportError: from django.conf.urls import include, url urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^media/(?P<path>.*)$', serve, {'document_roo...
Python
0
@@ -224,24 +224,16 @@ dmin/', -include( admin.si @@ -240,17 +240,16 @@ te.urls) -) ,%0A ur
a1b6735b49ddebb63e43012fd17a4e467cb0ab1b
Read all files in subdirectories and train one big model
demos/matrix_factorization.py
demos/matrix_factorization.py
import cPickle as pickle import json import logging import os import numpy import sklearn.feature_extraction.text as text from sklearn import decomposition logging.basicConfig(format='%(asctime)s : %(levelname)s :: %(message)s', level=logging.DEBUG) with open('./matrix_factorization_input.json') as data_file: dat...
Python
0
@@ -581,28 +581,30 @@ ount'%5D%0A%0A +%0A file +_ names = sorted(%5B @@ -595,23 +595,16 @@ names = -sorted( %5Bos.path @@ -613,76 +613,100 @@ oin( -input_folder, file_name) for file_name in os.listdir(input_folder)%5D) +root, current) for root, subdirectories,files in os.walk(input_folder) for current in files...
e3e4e547620095313c0a543c1d2a67e64ca27040
check if token emulation returns an error
troposphere/views/emulation.py
troposphere/views/emulation.py
import logging import os from django.conf import settings from django.shortcuts import redirect import requests from caslib import OAuthClient as CAS_OAuthClient logger = logging.getLogger(__name__) cas_oauth_client = CAS_OAuthClient(settings.CAS_SERVER, settings.OAUTH_CLIENT_CAL...
Python
0.000007
@@ -160,16 +160,46 @@ lient%0A%0A%0A +STRING_TYPES = (str, unicode)%0A logger = @@ -1326,24 +1326,190 @@ plication')%0A +%0A # Check if error response was sent%0A if isinstance(j_data, STRING_TYPES):%0A logger.warn(%22%5BEMULATE%5D %25s%22, j_data)%0A return redirect('application')%0A%0A ne...
dc76e57883a96ba26d1845c7d0633027d4fcf658
add login url
saltshaker/urls.py
saltshaker/urls.py
"""saltshaker URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
Python
0.000001
@@ -846,16 +846,24 @@ em_setup +,account %0A%0Aurlpat @@ -905,16 +905,17 @@ h%3E.*)$', + 'django. @@ -934,16 +934,17 @@ .serve', + %7B'docume @@ -1046,16 +1046,17 @@ x.html', + include( @@ -1486,16 +1486,21 @@ (r'login +.html /', incl @@ -1500,33 +1500,31 @@ ', include(' -dashboard +account .urls')),%0A%...
0d3a1adaf2ea6a57a44aa22b9e5715b562712a41
change test array
test_utils.py
test_utils.py
import time import numpy as np from numpy import float32 as REAL from fast_utils import fast_dot from fast_utils import fast_dot_blas def main(): ''' A = np.array(np.random.random((2000,3000)),dtype=REAL) B = np.array(np.random.random((3000,2000)),dtype=REAL) C = np.array(np.random.random((2000,3000)...
Python
0.000002
@@ -140,25 +140,16 @@ main():%0A - ''' %0A A = @@ -170,38 +170,39 @@ ndom.random((200 -0 ,3000 +00 )),dtype=REAL) %0A @@ -244,13 +244,14 @@ 3000 +00 ,200 -0 )),d @@ -299,22 +299,23 @@ dom((200 -0 ,3000 +00 )),dtype @@ -548,18 +548,28 @@ AL)%0A - +''' %0A ''' %0A st @@ -731,32 +731,35 @...
7a94badfecd929028fb61d365c799dbc01c2833c
add setUpClass and tearDownClass in tests.base
tests/base.py
tests/base.py
import unittest2 import sys import os import shutil from django.core.management import call_command class BaseTestCase(unittest2.TestCase): test_folder = 't' test_project = 'testProject' envvar = 'FLEXI_WRAPPED_MODULE' def setUp(self): # create test folder os.mkdir(self.test_folder)...
Python
0
@@ -237,22 +237,43 @@ -def setUp(self +@classmethod%0A def setUpClass(cls ):%0A @@ -313,28 +313,27 @@ os.mkdir( -self +cls .test_folder @@ -405,20 +405,19 @@ oject', -self +cls .test_pr @@ -423,20 +423,19 @@ roject, -self +cls .test_fo @@ -454,69 +454,105 @@ # -change current directory to test...
895d355f4f3cec10c7657d5f445e558bcf58b329
Version 1.10.3b1
airflow/version.py
airflow/version.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
Python
0
@@ -823,11 +823,13 @@ = '1.10. -2 +3b1 '%0A
005be724459e4b56e32bf5d2335264841d4e728e
Send 442 when trying to PART a channel you're not on
txircd/modules/rfc/cmd_part.py
txircd/modules/rfc/cmd_part.py
from twisted.plugin import IPlugin from twisted.words.protocols import irc from txircd.config import ConfigValidationError from txircd.module_interface import Command, ICommand, IModuleData, ModuleData from zope.interface import implements class PartCommand(ModuleData): implements(IPlugin, IModuleData) name = "Par...
Python
0
@@ -2626,16 +2626,114 @@ .users:%0A +%09%09%09user.sendSingleError(%22PartCmd%22, irc.ERR_NOTONCHANNEL, params%5B0%5D, %22You're not on that channel%22)%0A %09%09%09retur
b3463f1fb7314aa4ee62d0499e2e0789d23a21d5
set SessionsDialog treeview's current selection again so that deleting multiple sessions is a bit more convenient
daemon/core/gui/dialogs/sessions.py
daemon/core/gui/dialogs/sessions.py
import logging import tkinter as tk from tkinter import ttk from typing import TYPE_CHECKING, Iterable import grpc from core.api.grpc import core_pb2 from core.gui.dialogs.dialog import Dialog from core.gui.errors import show_grpc_error from core.gui.images import ImageEnum, Images from core.gui.task import Backgroun...
Python
0
@@ -7164,28 +7164,191 @@ self.click_new()%0A + selections = self.tree.get_children()%0A if selections:%0A self.tree.focus(selections%5B0%5D)%0A self.tree.selection_set(selections%5B0%5D)%0A
f56c3df433906d89d35762b423c995cd779a9211
Fix the run step.
tests/base.py
tests/base.py
import subprocess import pytest def check_docker_output(tool): command = 'docker run --rm -ti active-enhancers ' + tool process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output = process.communicate() return output
Python
0.000034
@@ -88,17 +88,8 @@ run ---rm -ti acti
c1d9bcb42b8d1720e604c8417f092a2a74ec5e5d
Tweak polycentrism figure
bin/plot_polycentrism.py
bin/plot_polycentrism.py
"""plot_clustering.py Plot the distribution of the renormalised clustering coefficient for all 2000 MSA. """ from __future__ import division import csv import numpy as np from matplotlib import pylab as plt import networkx as nx colours = {'Lower':'#4F8F6B', 'Higher':'#C1A62E', 'Middle':'#4B453C'} ...
Python
0
@@ -1143,16 +1143,30 @@ .figure( +figsize=(12,8) )%0Aax = f
dc5868414fc7c5ed22978f524463ffbef6d6d392
Make cookies lazy to evaluate Give access to cookie Morsels
antfarm/request.py
antfarm/request.py
from http.cookies import SimpleCookie from urllib.parse import parse_qs from .utils.functional import buffered_property import logging log = logging.getLogger(__name__) DEFAULT_ENCODING = 'ISO-8859-1' class Request(object): def __init__(self, environ): self.environ = environ # XXX Handle encodi...
Python
0
@@ -494,52 +494,8 @@ e()%0A - self.cookies = self.parse_cookies()%0A @@ -703,17 +703,31 @@ )%0A +%0A - %0A +@buffered_property %0A @@ -731,21 +731,19 @@ def -parse +raw _cookies @@ -758,23 +758,63 @@ -cookies +'''Raw access to cookies'''%0A cookie_data = self. @@ ...
88f02fbea11390ec8866c29912ed8beadc31e736
Exclude preprints from queryset from account/register in the admin app.
admin/common_auth/forms.py
admin/common_auth/forms.py
from __future__ import absolute_import from django import forms from django.contrib.auth.models import Group from osf.models import AdminProfile class LoginForm(forms.Form): email = forms.CharField(label=u'Email', required=True) password = forms.CharField( label=u'Password', widget=forms.Pas...
Python
0
@@ -58,16 +58,47 @@ t forms%0A +from django.db.models import Q%0A from dja @@ -850,16 +850,18 @@ exclude( +Q( name__st @@ -884,16 +884,51 @@ tions_') + %7C Q(name__startswith='preprint_')) ,%0A
378100d978a2bb91bb1e18ef81776ae0d5785a1c
Update Ascii.py
Cogs/Ascii.py
Cogs/Ascii.py
from discord.ext import commands from Cogs import Utils, DisplayName, PickList, FuzzySearch, Message import pyfiglet def setup(bot): # Add the bot bot.add_cog(Ascii(bot)) class Ascii(commands.Cog): def __init__(self, bot): self.bot = bot global Utils, DisplayName Utils = self.bot.get_cog(...
Python
0.000002
@@ -1537,37 +1537,8 @@ and( -pass_context=True, no_pm=True )%0D%0A%09 @@ -2023,20 +2023,10 @@ ont -if font else +or pyf
756821bb357cb07d979b556dca2b9cd7324e8ff3
add correct way to handle form usage
api/forms/views.py
api/forms/views.py
from django.core.exceptions import ObjectDoesNotExist from rest_framework.views import APIView from rest_framework.response import Response from .models import Form class FormsView(APIView): queryset = Form.objects.all() def get(self, request, format=None, **kwargs): if kwargs.get('form_id'): ...
Python
0.000022
@@ -158,16 +158,56 @@ ort Form +%0Afrom .serializers import FormSerializer %0A%0Aclass @@ -666,42 +666,64 @@ -new_form = Form(**kwargs +serializer = FormSerializer(data=request.data )%0A +%0A new_ @@ -722,24 +722,33 @@ -new_form.save()%0A +if serializer.is_valid(): %0A @@ -756,20 +756,29 ...
afb85264bedfd484b9f6ac20d269d6184575f68f
Solve annoying server error when robots try to access lookup page with no args.
astrobin/lookups.py
astrobin/lookups.py
from models import Telescope from models import Mount from models import Camera from models import FocalReducer from models import Software from models import Filter from models import Accessory from models import Subject, SubjectIdentifier from models import Location from models import UserProfile import simbad from...
Python
0
@@ -984,18 +984,52 @@ return -%5B%5D +HttpResponse(simplejson.dumps(%5B%7B%7D%5D)) %0A%0A q
00eae4ad9eea6e161a4c6dee70f49f3946cf8916
Fix database creation.
ueberwachungspaket/__init__.py
ueberwachungspaket/__init__.py
from flask import Flask from config import * from database import init_db, db_session from .representatives import Representatives app = Flask(__name__) app.config.from_pyfile("config.py") app.config["TWILIO_NUMBERS"] = TWILIO_NUMBERS reps = Representatives() if __name__ == "__main__": app.run() initdb() @ap...
Python
0
@@ -253,16 +253,26 @@ atives() +%0Ainit_db() %0A%0Aif __n @@ -309,21 +309,8 @@ un() -%0A initdb() %0A%0A@a
9b1d616ac857902dcb25f0cccc1203435d4852cb
Bump to 0.3.0
aiohttp_jinja2/__init__.py
aiohttp_jinja2/__init__.py
import asyncio import functools import jinja2 from aiohttp import web __version__ = '0.2.1' __all__ = ('setup', 'get_env', 'render_template', 'template') APP_KEY = 'aiohttp_jinja2_environment' def setup(app, *args, app_key=APP_KEY, **kwargs): env = jinja2.Environment(*args, **kwargs) app[app_key] = env ...
Python
0.000108
@@ -86,11 +86,11 @@ '0. -2.1 +3.0 '%0A%0A_
d12fecd2eb012862b8d7654c879dccf5ccce833f
Enable Python RSA backend as a fallback.
jose/backends/__init__.py
jose/backends/__init__.py
try: from jose.backends.pycrypto_backend import RSAKey except ImportError: from jose.backends.cryptography_backend import CryptographyRSAKey as RSAKey try: from jose.backends.cryptography_backend import CryptographyECKey as ECKey except ImportError: from jose.backends.ecdsa_backend import ECDSAECKey a...
Python
0
@@ -65,32 +65,45 @@ pt ImportError:%0A + try:%0A from jose.ba @@ -165,16 +165,93 @@ s RSAKey +%0A except ImportError:%0A from jose.backends.rsa_backend import RSAKey %0A%0Atry:%0A
329b9e6aca60967bdd2eb10443046d054d4807fc
Add a missing import to the tumblr module
picdescbot/tumblr.py
picdescbot/tumblr.py
# coding=utf-8 # picdescbot: a tiny twitter/tumblr bot that tweets random pictures from wikipedia and their descriptions # this file implements tumblr-related functionality # Copyright (C) 2016 Elad Alfassa <elad@fedoraproject.org> from tumblpy import Tumblpy import tumblpy.exceptions from . import common DEFAULT_PAR...
Python
0
@@ -280,16 +280,28 @@ eptions%0A +import time%0A from . i
6e9deb97f951f0ce2ab4e7710f9cc79af6532dd1
test connection
tests/demo.py
tests/demo.py
# -*- coding: utf-8 -*- import os import mock import tests from tests import test_demo from tests.test_demo import FunDemo from tests import base from oslo_concurrency import processutils as putils class MyDemo(): def show(self): print 'funDemo' class FakeDemo(): def show(self): print 'FakeD...
Python
0.000001
@@ -645,14 +645,21 @@ show()%0A%0A -test() +print %22hello%22
80550e0790afc761b4a2f63430049b5f4af7af4f
add get_version that uses root-config
bindings/pyroot/cppyy.py
bindings/pyroot/cppyy.py
""" PyCintex compatibility module. This module allows transferring away from PyCintex from ROOT v5 to v6. It provides both the original PyCintex.py (most code here is copied over from PyCintex.py) as well as the newer cppyy (from PyPy) APIs. In ROOT6, these codes are consolidated. """ import sys, strin...
Python
0.000001
@@ -316,16 +316,336 @@ string%0A%0A +### helper to get the version number from root-config%0Adef get_version():%0A try:%0A import commands%0A stat, output = commands.getstatusoutput(%22root-config --version%22)%0A if stat == 0:%0A return output%0A except Exception:%0A pass%0A # semi-s...
51f41fdadb2f7e8e045e13b4d8202b23fcc93797
Add _read_config method
repostack.py
repostack.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Usage: repostack [--version] [--help] [--dir=<path>] <command> [<args>...] options: -v, --version -h, --help show this message -d, --dir=<path> set repostack root directory [default: .] The following commands are supported by repostack: ...
Python
0.000016
@@ -699,16 +699,57 @@ port os%0A +from ConfigParser import RawConfigParser%0A %0A%0A__all_ @@ -912,32 +912,56 @@ bspath(rootdir)%0A + self.cfg = None%0A self.cfg @@ -979,16 +979,16 @@ config%0A - @@ -1042,16 +1042,379 @@ onfig)%0A%0A + def _read_config(self):%0A if not os.path....
0d78115ee7b8bf165447c4c631373cbc646b71de
Add order_number and total to order admin.
apps/fund/admin.py
apps/fund/admin.py
from apps.cowry_docdata.models import DocDataPaymentOrder from django.contrib import admin from django.core.urlresolvers import reverse from django.contrib.contenttypes.models import ContentType from .models import Donation, Order, OrderItem, Voucher, CustomVoucherRequest, RecurringDirectDebitPayment class DonationAd...
Python
0
@@ -2011,16 +2011,24 @@ urring', + 'total' )%0A fi @@ -2069,16 +2069,32 @@ 'status' +, 'order_number' )%0A in
17ddafb45a7740601fcf9ad9d7b41bd82e87cc90
test data api query parameter
api/tests/test_data_api.py
api/tests/test_data_api.py
from django.test import RequestFactory from main.tests.test_base import MainTestCase from api.views import DataViewSet, XFormViewSet class TestDataAPI(MainTestCase): def setUp(self): MainTestCase.setUp(self) self._create_user_and_login() self._publish_transportation_form() self._...
Python
0.000002
@@ -1875,16 +1875,903 @@ .data)%0A%0A + def test_data_with_query_parameter(self):%0A view = DataViewSet.as_view(%7B'get': 'list'%7D)%0A request = self.factory.get('/', **self.extra)%0A formid = self.xform.pk%0A dataid = self.xform.surveys.all()%5B0%5D.pk%0A response = view(request...
94f3ba52cd60ec1316ce57f4f10bfc208ab7fd89
Version bump
bespin/__init__.py
bespin/__init__.py
VERSION="0.4.9.4"
Python
0.000001
@@ -8,11 +8,11 @@ =%220.4.9. -4 +5 %22%0A
6e503211f91f44357359c8e30d8b0eb4c7f03e5b
fix error when unicode character name can't be resolved
bigmoji/bigmoji.py
bigmoji/bigmoji.py
import asyncio import functools import io import os import unicodedata import aiohttp from discord.ext import commands try: import cairosvg cairo = True except: cairo = False class Bigmoji: """Emoji tools""" def __init__(self, bot): self.bot = bot self.session = aiohttp.ClientS...
Python
0.000008
@@ -860,16 +860,41 @@ ))%5B2:%5D)%0A + try:%0A @@ -937,16 +937,237 @@ (char))%0A + except ValueError:%0A # Sometimes occurs when the unicodedata library cannot%0A # resolve the name, however the image still exists%0A ...
8d6c275b771c73c3b36b38c0511e40f029bb1cfd
Refactor tests
tests/main.py
tests/main.py
import json import unittest import requests class DomainsTests(unittest.TestCase): def test_json_is_valid(self): with open("../world_universities_and_domains.json") as json_file: valid_json = json.load(json_file) for university in valid_json: university["name"] u...
Python
0.000001
@@ -272,32 +272,54 @@ son:%0A + self.assertIn(%22name%22, university%5B%22nam @@ -317,16 +317,9 @@ sity -%5B%22name%22%5D +) %0A @@ -331,181 +331,256 @@ -university%5B%22domains%22%5D%0A university%5B%22web_pages%22%5D%0A university%5B%22alpha_two_code%22%5D%0A ...
a3d0976f3610232b4849a64f98fdbc212a95b934
Make sure we don't crash if the config file has an option that isn't a CLI option
libnamebench/config.py
libnamebench/config.py
#!/usr/bin/env python # Copyright 2009 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
Python
0.000002
@@ -6288,16 +6288,48 @@ if not +hasattr(options, option) or not getattr(
7d6559a450b52bae3e402bacb41fc1a7a4d77a77
Make class declarations consistent.
IRCResponse.py
IRCResponse.py
from enumType import enum ResponseType = enum('Say', 'Do', 'Notice', 'Raw') class IRCResponse: def __init__(self, messageType, response, target): self.Type = messageType try: self.Response = unicode(response, 'utf-8') except TypeError: # Already utf-8? self.Respon...
Python
0
@@ -89,16 +89,24 @@ Response +(object) :%0A de @@ -359,12 +359,13 @@ get = target +%0A
6e59b0083d78bca02d08dbc7ce612c6fc4ed44a6
Update settings.py
LC/settings.py
LC/settings.py
""" Django settings for LC project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import ...
Python
0.000001
@@ -2024,16 +2024,8 @@ ': ' -massive1 ',%0A
3bdf9f01fa3e0454a3e28ab58886742a235f5215
change config.py to use properties
config.py
config.py
# Copyright 2020 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 # # Unless required by applicable law or agreed to in writing, ...
Python
0.000001
@@ -741,38 +741,227 @@ nfig):%0A%0A -PHILIPS_HUE_IP +def __init__(self):%0A self._philips_hue_ip = None%0A self._philips_hue_username = None%0A%0A%0A @property%0A def PHILIPS_HUE_IP(self):%0A if self._philips_hue_ip is None:%0A secret = secrets.G @@ -986,32 +986,40 @@ Secre...
fef337b4b161aaf30a9352dd5ae4200ec667c3c5
Add ASSETS_AUTO_BUILD set to False and set LESS_BIN to location of lessc executable.
config.py
config.py
from datetime import timedelta import sys DEBUG = False JS_DEBUG = False SECRET_KEY = '' VERIFY_CERT = True COLLECT_STATIC_ROOT = 'static/' COLLECT_STORAGE = 'flask.ext.collect.storage.file' MAIL_USERNAME = 'PUBSV2_NO_REPLY' PUB_URL = '' LOOKUP_URL = '' SUPERSEDES_URL = '' BROWSE_URL = '' BASE_SEARCH_URL = '' BASE_C...
Python
0
@@ -35,12 +35,63 @@ ort -sys%0A +os%0Aimport sys%0A%0APROJECT_HOME = os.path.dirname(__file__) %0A%0ADE @@ -1356,16 +1356,199 @@ to True +%0AASSETS_AUTO_BUILD = False #Local developers will typically set this to True in their instance/config.py.%0ALESS_BIN = os.path.join(PROJECT_HOME, 'node_modules', 'less', 'bin'...
d21b0898df0d745251735450bceebb341951e807
Add SECRET_KEY
config.py
config.py
import os from socket import gethostname # Project relative -> absolute root path _PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__)).replace('\\', '/') # Development hostnames, auto-switch to DEBUG mode DEV_HOSTS = ('Sun', ) # Administrator auth LOGIN = 'demo' PASSWORD = 'demo' # Auto switch to debug? DEB...
Python
0.000013
@@ -286,16 +286,45 @@ 'demo'%0A%0A +SECRET_KEY = %22random.get()%22%0A%0A # Auto s
5017f2bbdc22bafc3173c28f7cb076bffdb94201
move configs from secret file to config.py
config.py
config.py
""" config.py Configuration and settings """ import os def from_env(env_var, default): """ Gets value from envrionment variable or uses default Args: env_var: name of envrionment variable default: the default value """ new = os.environ.get(env_var) if new: return new ...
Python
0.000001
@@ -1301,30 +1301,8 @@ GCM_ -DRYRUN = True%0A GCM_ MOCK @@ -1319,16 +1319,154 @@ ONLY = 0 +%0A GCM_ALLOWED_TOPICS = %5B'/topics/demo','/topics/jordan','/topics/madagascar','/topics/somalia','/topics/somaliland','/topics/puntland'%5D %0A%0A%0Aclass
5ee44b82b5cb87931c143d71c87bc18c229d22a1
fix typo
config.py
config.py
import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config: SECRET_KEY = os.environ.get('SECRET_KEY') or 'supercalifragilistico9911' SQLALCHEMY_COMMIT_ON_TEARDOWN = True MAIL_SERVER = 'smtp.live.com' MAIL_PORT = 25 MAIL_USE_TLS = True MAIL_USERNAME = os.environ.get('MAIL_USERN...
Python
0.999991
@@ -1957,16 +1957,17 @@ l(loggin +g .ERROR)%0A
dd2643db72ee1bb8560319565244c02e7ab7b6d2
Allow configuring Gunicorn workers via env.
config.py
config.py
import os bind = os.getenv('OPENFISCA_BIND_HOST', '127.0.0.1:2000') timeout = 60 workers = 4
Python
0
@@ -89,6 +89,38 @@ s = -4 +os.getenv('OPENFISCA_WORKERS', 4) %0A
b2238218c524c4a9700b95324ab3f402507c1587
Enable searchspace lookup db
app/lookups/sqlite/base.py
app/lookups/sqlite/base.py
import sqlite3 from app.lookups.sqlite import proteingroups, quant, searchspace, \ biosets, spectra mslookup_tables = {'mzml': ['spectra_id INTEGER PRIMARY KEY', 'mzmlfile_id INTEGER', 'scan_nr TEXT', 'retention_time REAL', ...
Python
0.000001
@@ -7185,17 +7185,16 @@ -# 'searchs @@ -7212,16 +7212,30 @@ chspace. +SearchSpaceDB, %0A
2d004e4132b07801d5e3246d114850b0e546c69f
Add news data scraper
scrape_with_bs4.py
scrape_with_bs4.py
import requests from bs4 import BeautifulSoup import pandas as pd import datetime import os import _pickle as pickle def tracker(filename): f = open("links/tracker.data",'a+') f.write(filename+"\n") f.close() def tracked(): return [line.rstrip('\n') for line in open('links/tracker.data')] def list_files(path): ...
Python
0.000001
@@ -110,16 +110,18 @@ pickle%0A +%0A%0A def trac @@ -292,17 +292,16 @@ ta')%5D%0A%09%0A -%0A def list @@ -415,16 +415,53 @@ er path%0A + # excludes temporary files also.%0A file @@ -561,20 +561,22 @@ and name - != +.find( 'tracker @@ -581,16 +581,21 @@ er.data' +)==-1 and nam @@ -599,12 +599,14 @@ ...
518a66fa6c0fe8fe1cec87a679aa319553e2413e
Use new databse decorators for model management
scrapi/requests.py
scrapi/requests.py
from __future__ import absolute_import import json import logging import functools from datetime import datetime import requests import cqlengine from cqlengine import columns from scrapi import database # noqa from scrapi import settings logger = logging.getLogger(__name__) class HarvesterResponse(cqlengine.Mo...
Python
0
@@ -203,16 +203,8 @@ base - # noqa %0Afro @@ -229,17 +229,16 @@ ttings%0A%0A -%0A logger = @@ -268,16 +268,41 @@ me__)%0A%0A%0A +@database.register_model%0A class Ha
c62392f698fcac72882d1858fc2a29618676c951
Increase the retry interval for provider tests
config.py
config.py
import os class Config(object): ENVIRONMENT = os.environ['ENVIRONMENT'] NOTIFY_ADMIN_URL = os.environ.get(os.environ.get('ENVIRONMENT') + '_NOTIFY_ADMIN_URL') NOTIFY_API_URL = os.environ.get(os.environ.get('ENVIRONMENT') + '_NOTIFY_API_URL') TEST_NUMBER = os.environ.get(os.environ.get('ENVIRONMENT') +...
Python
0.000001
@@ -748,17 +748,17 @@ RVAL = 2 -0 +2 %0A VER
6d2e9f69f809c270cee57de5f761f5d915524546
add default model
config.py
config.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import random import string from core._time import now def get_config(): return { # OWASP Nettacker Default Configuration "language": "en", "verbose_level": 0, "show_version": False, "check_update": False, "log_in_file": "resul...
Python
0.000001
@@ -349,16 +349,41 @@ mat(now( +model=%22%25Y_%25m_%25d_%25H_%25M_%25S%22 ),%0A
03d47a0011dc7841bffc2856d49ab3d43ba157f7
check if cache/flash-dir is writable at configload
config.py
config.py
class config(object): cache_dir = '/mnt/sda6/prog/flashget/cache' flash_dir = '/mnt/sda6/prog/flashget/flash' # TODO: os.access(path, os.W_OK)
Python
0.000001
@@ -1,8 +1,18 @@ +import os%0A %0Aclass c @@ -126,41 +126,231 @@ sh'%0A - # TODO: os.access(path, os.W_OK) +%0A%0A%0A%0A%0A if not os.access(cache_dir, os.W_OK):%0A print %22your cache-dir isn't writeable please edit config.py%22%0A if not os.access(flash_dir, os.W_OK):%0A print %22your flash-d...
2b1f58f3a73fa43e489c6b7d6eb704eb0fbfcfcc
fix saving
scripts/freqmap.py
scripts/freqmap.py
# coding: utf-8 """ Make Figure 9 of Sanders and Binney """ from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Standard library import os, sys # Third-party import matplotlib.pyplot as plt import numpy as np from astropy import log as logger import astropy.units as u #...
Python
0.000001
@@ -2658,13 +2658,50 @@ fn, -(t,w) +np.vstack((t.reshape(t.size,1,1).T,w.T)).T )%0A @@ -2716,19 +2716,17 @@ -t,w +l = np.lo @@ -2732,16 +2732,69 @@ oad(fn)%0A + t = np.squeeze(l.T%5B0%5D)%0A w = l.T%5B1:%5D.T%0A
d61682e432f4a91d91e66df0fe215cd9336a0e6f
Update config.py
config.py
config.py
## Config config = { #[SERVER] [Modify the right side only] #server settings "host": "b0xi.eu", "port": 6667, #[BOT DETAILS] #Set bot details, chans etc.. "nick": "pyTsunku", "altnick": "pyTunkio", "realname": "pyTsunku", "ident": "pyTsunku", "version": "pyBot ...
Python
0.000001
@@ -325,17 +325,17 @@ ion 0.4. -1 +2 %22, %0A%09%09%09%22
247e363c01e9ebbc98885f73d0d3bbc5f1699d6d
fix config for heroku
config.py
config.py
from datetime import timedelta import os pgurl = os.environ.get('HEROKU_POSTGRESQL_SILVER_URL') class Config(object): DEBUG = False TESTING = False SQLALCHEMY_DATABASE_URI = '' APP_NAME = 'ApplicationName' SECRET_KEY = 'add_secret' JWT_EXPIRATION_DELTA = timedelta(days=30) JWT_AUTH_URL_RULE = '/api/v1/auth' ...
Python
0
@@ -593,32 +593,33 @@ onfig(Config):%0A%09 +# SQLALCHEMY_DATAB @@ -666,17 +666,16 @@ -# SQLALCHE
ce7eeb51be10768055829860f8a9ebc9a38c2a62
Increase HTTP cache time in production to a day
config.py
config.py
import os import hashlib import jinja2 from dmutils.status import enabled_since, get_version_label from dmutils.asset_fingerprint import AssetFingerprinter basedir = os.path.abspath(os.path.dirname(__file__)) def get_asset_fingerprint(asset_file_path): hasher = hashlib.md5() with open(asset_file_path, 'rb') ...
Python
0
@@ -916,17 +916,22 @@ X_AGE = -3 +24*360 0%0A DM
882e140c98ffd28d4117e5a3247cb1aaa836b792
Update config.py formatting
config.py
config.py
#------------------------------------------------------------------------------- # Filename: config.py # # Author: David C. Drake (http://davidcdrake.com) # # Description: Configuration file for an Asteroids game. Developed using Python # 2.7. #------------------------------------------------------...
Python
0.000001
@@ -72,17 +72,16 @@ -------- -- %0A# Fi @@ -216,47 +216,26 @@ game -. Developed us + written in -g Python -%0A# 2.7 @@ -319,17 +319,16 @@ ---- -- %0A%0ATITLE @@ -323,28 +323,16 @@ %0A%0ATITLE - = 'Aster @@ -351,21 +351,16 @@ N_WIDTH - = 800%0ASC @@ -371,20 +371,1...
fd727e48719beab90e6a398a4d891b96082d7b20
Add `clarifications closed` feature flag
config.py
config.py
import os import jinja2 from dmutils.status import enabled_since, get_version_label from dmutils.asset_fingerprint import AssetFingerprinter class Config(object): VERSION = get_version_label( os.path.abspath(os.path.dirname(__file__)) ) SESSION_COOKIE_NAME = 'dm_session' SESSION_COOKIE_PATH =...
Python
0.000001
@@ -1459,24 +1459,94 @@ on question' +%0A G7_FOLLOW_UP_EMAIL_SUBJECT = 'Thanks for your G-Cloud 7 question' %0A%0A CREATE @@ -2205,32 +2205,83 @@ UD7_OPEN = False +%0A FEATURE_FLAGS_G7_CLARIFICATIONS_CLOSED = False %0A%0A # Logging%0A @@ -3482,32 +3482,105 @@ e('2015-06-18')%0A + FEATURE_FLAGS_G7_CL...
a5b08698e22b8c46e2f6bbdda2b980dbd8d580ec
move up time for testing again
config.py
config.py
from celery.schedules import crontab # from datetime import timedelta import os def bool_env(val): """Replaces string based environment values with Python booleans""" return True if os.environ.get(val, False) == 'True' else False TIMEZONE = os.getenv('TIMEZONE', "US/Central") ####### # Flask # FLASK_SECRET...
Python
0
@@ -387,16 +387,19 @@ '4,15,16 +,21 '%0ACELERY @@ -766,16 +766,20 @@ e='0, 10 +, 15 ', hour=
a6e9c68a47dffe4387daa4456a7966adcdcfe77a
save credit_time as int
credit.py
credit.py
from threading import Timer, Thread, enumerate import sqlite3 import time from bitcoinrpc.authproxy import JSONRPCException __author__ = 'sammoth' """ Every thing in this module pertains to the crediting of orders. LPCs submit their signed 'open_orders' query through the 'liquidity' server end point. The server valid...
Python
0.000004
@@ -1180,16 +1180,20 @@ _time = +int( time.tim @@ -1195,16 +1195,17 @@ e.time() +) %0A con
60fdcc92e9408f728e8beb146378d4a91a4afc3c
rewrite output files name
scripts/supcomb.py
scripts/supcomb.py
#!/usr/bin/python __author__ = "Guillaume Bonamis" __license__ = "MIT" __copyright__ = "2015, ESRF" import argparse from os.path import dirname, abspath base = dirname(dirname(abspath(__file__))) from freesas.align import InputModels, AlignModels import logging logging.basicConfig(level=logging.INFO) logger = logging....
Python
0.000022
@@ -2048,43 +2048,8 @@ se:%0A - for i in range(input_len):%0A @@ -2069,16 +2069,12 @@ iles -.append( + = %5B %22ali @@ -2095,17 +2095,43 @@ %25 (i+1) -) + for i in range(input_len)%5D %0A%0Aif inp
3c0341663fbb3a860f9d83a04c15d14e6b5c007d
fix test
euxfel_h5tools/tests/test_streamer.py
euxfel_h5tools/tests/test_streamer.py
"""Test streaming data with ZMQ interface.""" import msgpack import msgpack_numpy as numpack import numpy as np import pytest from queue import Full from struct import pack from time import sleep from karabo_bridge import KaraboBridge from euxfel_h5tools import ZMQStreamer DATA = {'source1': {'parameter.1.value': 1...
Python
0.000002
@@ -196,16 +196,23 @@ p%0A%0Afrom +euxfel_ karabo_b @@ -224,28 +224,22 @@ import -KaraboBridge +Client %0A%0Afrom e @@ -2498,20 +2498,14 @@ t = -KaraboBridge +Client ('tc
d04eada57dc298400eaa2fd26c57037197357b36
fix bug in proteins example (#263)
examples/nodeproppred/proteins/gnn.py
examples/nodeproppred/proteins/gnn.py
import argparse import torch import torch.nn.functional as F import torch_geometric.transforms as T from torch_geometric.nn import GCNConv, SAGEConv from ogb.nodeproppred import PygNodePropPredDataset, Evaluator from logger import Logger class GCN(torch.nn.Module): def __init__(self, in_channels, hidden_chann...
Python
0
@@ -3822,16 +3822,25 @@ Dataset( +%0A name='og @@ -3856,45 +3856,8 @@ ns', -%0A tra @@ -3880,16 +3880,32 @@ eTensor( +attr='edge_attr' ))%0A d
69e8798137ca63b78adf0c41582e89973d2ea129
Work on model file handling
create.py
create.py
import os import sys base_path = os.path.dirname(__file__) sys.path.append(base_path) one_up_path = os.path.abspath(os.path.join(os.path.dirname(__file__),'..')) sys.path.append(one_up_path) import model_creator import util_functions def create(text,score,prompt_string,model_path): model_path=util_functions.cre...
Python
0
@@ -737,37 +737,74 @@ n failed.%22)%0A +%0A -try:%0A +full_path=os.path.join(base_path,model_path)%0A util_fun @@ -827,28 +827,27 @@ rectory( -mode +ful l_path)%0A @@ -834,28 +834,24 @@ (full_path)%0A - model_cr @@ -932,25 +932,19 @@ re, -args.mode +ful l_path)%0A @@ -939,...
50ff0b582e5026a9424f606e1f53d6a2a0d0e233
verify filenames
crypto.py
crypto.py
import hmac, hashlib, subprocess, random, threading myrandom = random.SystemRandom() import gnupg import config WORDS_IN_RANDOM_ID = 3 HASH_FUNCTION = hashlib.sha256 GPG_KEY_TYPE = "RSA" GPG_KEY_LENGTH = "4096" class CryptoException(Exception): pass def clean(s, also=''): """ >>> clean("Hello, world!") T...
Python
0.000007
@@ -1,12 +1,36 @@ +# -*- coding: utf-8 -*-%0A import hmac, @@ -128,16 +128,29 @@ t config +%0Aimport store %0A%0AWORDS_ @@ -2450,24 +2450,68 @@ A3'%0A %22%22%22%0A + if output:%0A store.verify(output)%0A fp = fp. @@ -3414,24 +3414,45 @@ unlink(fn):%0A + store.verify(fn)%0A return s
bace97dbb879309081222a2f2d035be22eb43ff1
correct column indexes for test files
csv2vw.py
csv2vw.py
'Convert CSV file to Vowpal Wabbit format.' 'all columns numerical or all categorical - no mixing at the moment' import sys import csv import argparse def construct_line( label, line ): new_line = [] # label try: label = float( label ) except Exception, e: pass if label == 0.0: if args.convert_zeros: ...
Python
0.000001
@@ -443,16 +443,112 @@ the rest +%0A%09%0A%09offset = 1%0A%09# to make test column numbers match train%0A%09if args.label_index %3C 0:%0A%09%09offset = 2 %0A%0A%09for i @@ -646,16 +646,43 @@ orical:%0A +%09%09%09# 1-based indexing here%0A %09%09%09new_i @@ -700,33 +700,38 @@ %7B%7D%22.format( i + -1 +offset , it...
98d0bebbf74c42676a373a3c77bd1bd192129995
Update trace perf output with struct deserialize example
examples/tracing/trace_perf_output.py
examples/tracing/trace_perf_output.py
#!/usr/bin/env python # Copyright (c) PLUMgrid, Inc. # Licensed under the Apache License, Version 2.0 (the "License") # This is an example of tracing an event and printing custom fields. # run in project examples directory with: # sudo ./trace_fields.py" import atexit from bcc import BPF import ctypes counter = 0 de...
Python
0
@@ -301,46 +301,324 @@ ypes -%0A%0Acounter = 0%0Adef cb(cpu, data, size): + as ct%0A%0Aclass Data(ct.Structure):%0A _fields_ = %5B(%22ts%22, ct.c_ulonglong),%0A (%22magic%22, ct.c_ulonglong)%5D%0A%0Acounter = 0%0Adef cb(cpu, data, size):%0A assert size %3E= ct.sizeof(Data)%0A event = ct.cast(da...
3654c65fef4eb28ca67ec1a6a63d1b2eed1b50c2
Update traitmenu example
examples/traitmenu_people_n_places.py
examples/traitmenu_people_n_places.py
#!/usr/bin/env python from __future__ import print_function import logging logger = logging.getLogger() handler = logging.StreamHandler() formatter = logging.Formatter( '%(levelname)-8s %(name)-12s %(message)s') handler.setFormatter(formatter) logger.addHandler(handler) logger.setLevel(logging.DEBUG) # from f...
Python
0
@@ -1756,21 +1756,10 @@ enu. -color_fg_norm +nf = ' @@ -1776,21 +1776,10 @@ enu. -color_bg_norm +nb = ' @@ -1796,20 +1796,10 @@ enu. -color_fg_sel +sf = ' @@ -1816,20 +1816,10 @@ enu. -color_bg_sel +sb = ' @@ -1962,157 +1962,5 @@ t)%0A%0A -from dynmen.fzf import FZF%0Amenu = FZF()%0Amenu.prompt = %22Name o...
8b281c88be708fce8186e0b0e63792fe196d4973
debug + add 'ub' support
cutout.py
cutout.py
import os import urllib import numpy as np import h5py def get_cutout( filename = 'tst', t0 = 0, tl = 1, x0 = 0, xl = 32, y0 = 0, yl = 32, z0 = 0, zl = 32, data_set = 'isotropic1024coarse', data_type = 'u', auth_token = 'edu.jhu.pha.turbulence.testing-201...
Python
0
@@ -646,16 +646,30 @@ 0, zl))%0A + print url%0A if d @@ -770,24 +770,78 @@ ponents = 1%0A + elif data_type in %5B'ub'%5D:%0A ncomponents = 6%0A print 'R
37b28aed6002f56f4813436ca2ced1f6c98ab84a
Use MOOC title for list name and campaign name
sequence/models.py
sequence/models.py
from django.conf import settings import db from mailgun import api as mailgun_api import datetime def sequence_list_name( sequence_number ): if settings.DEBUG: return 'sequence-{0}-all-test@{1}'.format(sequence_number, settings.EMAIL_DOMAIN) return 'sequence-{0}-all@{1}'.format(sequence_number, sett...
Python
0.000001
@@ -173,35 +173,30 @@ return ' -sequence-%7B0 +%7B0%7D-%7B1 %7D-all-test@%7B @@ -195,17 +195,17 @@ l-test@%7B -1 +2 %7D'.forma @@ -198,32 +198,79 @@ est@%7B2%7D'.format( +settings.MOOC_TITLE.replace(' ', '-').lower(), sequence_number, @@ -309,27 +309,22 @@ rn ' -sequence-%7B0 +%7B0%7D-%7B1 %7D-all@%7B -1 +...
7d3dd569df3c4bd388efac40e07f2d303d1a835a
Fix deprecation
server/database.py
server/database.py
import datetime import logging from pymongo import MongoClient, DESCENDING logger = logging.getLogger(__name__) class AppDatabase: # DB wrapper for accessing local storge that supports the app. # In theory this makes switching out storage backends easier, by gauranteeing _conn is private. def __init__(s...
Python
0.997058
@@ -618,16 +618,20 @@ t.insert +_one (%7B'dummy
fb0a639061f3bb092f0334564b3737da7d00bb8c
Add logger to providers
server/provider.py
server/provider.py
class Provider(object): """Base provider class""" regions = {} def __init__(self, key): self.key = key def create(self, region): raise NotImplemented() def start(self): raise NotImplemented() def stop(self): raise NotImplemented() def destroy(self): ...
Python
0.000001
@@ -1,12 +1,29 @@ +import logging%0A%0A%0A class Provid @@ -133,16 +133,68 @@ ey = key +%0A self.logger = logging.getLogger('Provider') %0A%0A de
78e8eaefed764ae616643f875a10fd3039f5d7fa
Add corpus_bleu from ntlk
session2/report.py
session2/report.py
import argparse, codecs, logging, nltk import unicodecsv as csv from nltk.translate.bleu_score import sentence_bleu as bleu import numpy as np def setup_args(): parser = argparse.ArgumentParser() parser.add_argument('src', help='Source file') parser.add_argument('target', help='Translated data') parser...
Python
0.000014
@@ -112,35 +112,22 @@ bleu - as bleu%0Aimport numpy as np +, corpus_bleu%0A %0A%0Ade @@ -447,16 +447,17 @@ n args%0A%0A +%0A def main @@ -1385,84 +1385,44 @@ -bleu_scores = %5B%5D%0A bleu_scores_bigram = %5B%5D%0A bleu_scores_fourgram +references = %5B%5D%0A hypotheses = %5B%5D%0A -%0A @@ -17...
8e4637af706b7b53b17fbde12d3050cc6eb8c7bd
Use rstrip
settings_dialog.py
settings_dialog.py
# -*- coding: utf-8 -*- """ /*************************************************************************** Svir A QGIS plugin OpenQuake Social Vulnerability and Integrated Risk ------------------- begin : 2013-10-24 copyright ...
Python
0.000001
@@ -2920,16 +2920,27 @@ # if the + (stripped) hostnam @@ -3024,80 +3024,20 @@ ip() -%0A if hostname.endswith('/'):%0A hostname = hostname%5B:-1%5D +.rstrip('/') %0A
4760665ed3f43db64e90f809a32b8005b7ab9128
Change config site_name variable to non-list
shablona/config.py
shablona/config.py
import numpy as np from math import pi from datetime import datetime # name of site of current deployment. this will be added as an attribute to # classified targets. site_name_auto indicates that a classification was # determined by the classifier, and site_name_manual indicates that a # classification was either ent...
Python
0.000002
@@ -367,15 +367,13 @@ e = -%5B 'MSL' -%5D %0A%0Ain
733f41d243be703fed10406d00a548ffc1ba2557
Add regression test.
mayavi/tests/test_threshold_filter.py
mayavi/tests/test_threshold_filter.py
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # Copyright (c) 2010, Enthought, Inc. # License: BSD Style. # Standard library imports. import unittest import numpy as np # Local imports. from mayavi.core.null_engine import NullEngine # Enthought library imports from mayavi.filters.threshold import Thresh...
Python
0.000004
@@ -2187,16 +2187,1853 @@ return%0A%0A + def test_threshold_filter_data_range_changes(self):%0A # Regression test for GitHub issue #136.%0A src = self.make_src()%0A self.e.add_source(src)%0A threshold = Threshold()%0A self.e.add_filter(threshold)%0A # Move from one data ran...
9ea2154491ecd2324cde998ce595c9430a14516b
Add the ability to set the Kafka key in KafkaProxy.send_message()
voltha/northbound/kafka/kafka_proxy.py
voltha/northbound/kafka/kafka_proxy.py
# # Copyright 2017 the original author or authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Python
0.000434
@@ -5080,16 +5080,26 @@ pic, msg +, key=None ):%0A @@ -6006,16 +6006,21 @@ pic, msg +, key )%0A
fb787e678641c68271fbecebe88d0a9d5371615b
Update tests: "login" & "logout" are no longer on the Kenya homepage
mzalendo/core/tests/test_accounts.py
mzalendo/core/tests/test_accounts.py
import re from django.conf import settings from django.core import mail from django_webtest import WebTest from core import models from django.test.client import Client from django.contrib.auth.models import User class AccountTest(WebTest): def setUp(self): pass def test_create_acco...
Python
0
@@ -362,60 +362,58 @@ # -go to home page, go to login page, go to new +Start at the login page and click 'Need an account pag @@ -408,21 +408,17 @@ account - page +' %0A @@ -468,61 +468,32 @@ ( '/ -' )%0A .click(description='login', index=1 +accounts/login/?next=/' )%0A @@ -2049,24 +...
5976f77a10ad4712a957442fd30f64805615f47e
add GWTCanvas demo
examples/gwtcanvas/LogoDemo.py
examples/gwtcanvas/LogoDemo.py
""" * Copyright 2008 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http:#www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, s...
Python
0
@@ -1429,11 +1429,15 @@ = %22 -GWT +Pyjamas Log
0a3f43e6d7341e16b573393122e96d0243203a4a
Add a method: color according to the most abundant state.
atomic/abundance.py
atomic/abundance.py
import numpy as np class FractionalAbundance(object): def __init__(self, atomic_data, y, temperature, density): self.atomic_data = atomic_data self.y = y self.temperature = temperature self.density = density def mean_charge(self): """ Compute the mean charge: ...
Python
0.99854
@@ -1799,9 +1799,446 @@ urn xy%0A%0A + def replot_colored(self, line, lines_ref):%0A %22%22%22%0A Replot a line, colored according the most abundant state.%0A %22%22%22%0A ax = line.axes%0A x = line.get_xdata()%0A y = line.get_ydata()%0A%0A lines = %5B%5D%0A i...
23ca85e0911fa49bc2bd784e45ece42c047f830e
Bump to version 0.56.1
riko/__init__.py
riko/__init__.py
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ riko ~~~~ Provides functions for analyzing and processing streams of structured data Examples: basic usage:: >>> from itertools import chain >>> from functools import partial >>> from riko.modules import itembuilder, strreplace ...
Python
0
@@ -1283,17 +1283,17 @@ = '0.56. -0 +1 '%0A%0A__tit
8f87b8a8dc1669ec9395127a0b1eff9dfe5238f7
Test used old parameter
mne/stats/tests/test_cluster_level.py
mne/stats/tests/test_cluster_level.py
import numpy as np from numpy.testing import assert_equal, assert_array_equal from nose.tools import assert_true from scipy import sparse, linalg, stats from mne.stats.cluster_level import permutation_cluster_test, \ permutation_cluster_1samp_test import mne.stats as mnestats noise...
Python
0
@@ -5979,17 +5979,16 @@ =0, max_ -t step=0,
e60548eeff5039833f3ee8a7b0e5767cb2a6e877
fix minor issue
Tests/scripts/wait_until_server_ready.py
Tests/scripts/wait_until_server_ready.py
"""Wait for server to be ready for tests""" import sys import json import string import random import argparse from time import sleep import datetime from requests import Session import demisto_client.demisto_api from demisto_client.demisto_api.rest import ApiException from typing import List, AnyStr import urllib3.ut...
Python
0.000002
@@ -5032,17 +5032,8 @@ %0A - api_key, con @@ -5071,23 +5071,33 @@ d = get_ -api_key +username_password ()%0A%0A
1187a9895d2ecada06780760c29fe3046eab0715
Update ipc_lista1.5.py
lista1/ipc_lista1.5.py
lista1/ipc_lista1.5.py
#ipc_lista1.5 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que converta metros para centímetros. metros = input("Digite o valor em metros que deseja converter em centímetros: ") centimetros = metros * 100 print "Esse valor equivale a
Python
0
@@ -270,9 +270,10 @@ uivale a +: %0A
2800f0b62c2936cd68c35623010c3f57d58b975d
Fix broken unit test
murano/tests/unit/db/services/test_instances.py
murano/tests/unit/db/services/test_instances.py
# Copyright 2016 AT&T Corp # 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 app...
Python
0.000978
@@ -2508,24 +2508,83 @@ nstance())%0A%0A + @mock.patch('murano.db.services.instances.sqlalchemy')%0A @mock.pa @@ -2685,16 +2685,84 @@ self, _, + mock_sqlalchemy,%0A mock_db @@ -3150,16 +3150,87 @@ l_count) +%0A self.assertEqual(1, mock_sqlalchemy.upd...
07fbaa9dd9b89965682158fe49db08b3852a3923
Test fix
InvenTree/part/api.py
InvenTree/part/api.py
""" Provides a JSON API for the Part app """ # -*- coding: utf-8 -*- from __future__ import unicode_literals from django_filters.rest_framework import DjangoFilterBackend from rest_framework import filters from rest_framework import generics, permissions from django.db.models import Q from django.conf.urls import ur...
Python
0
@@ -3354,28 +3354,8 @@ = %5B%0A - 'category',%0A
b161496aaf8d7550d1de2023ca2bf4e1e10812bc
change elapsed time
DCGAN/train.py
DCGAN/train.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division import tensorflow as tf import numpy as np import time import dcgan import image_utils as iu from dataset import Dataset, DataIterator dirs = { # 'cifar-10': 'D:\\ML\\cifar\\cifar-10-batches-py\\', #...
Python
0.000025
@@ -702,12 +702,12 @@ kes -4600 +3934 s%0A
78b9cd6ee72f59743f52d3a8c050d21d368b8ba6
Update ipc_lista1.5.py
lista1/ipc_lista1.5.py
lista1/ipc_lista1.5.py
#ipc_lista1.5 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que converta metros para centímetros. metros = input("Digite o valor em metros que deseja converter em
Python
0
@@ -198,9 +198,10 @@ erter em + %0A
5981ad8ebf968642d433c3aeb8b8da9202f7615c
Upgrade captcha handling
module/plugins/crypter/FilecryptCc.py
module/plugins/crypter/FilecryptCc.py
# -*- coding: utf-8 -*- import base64 import binascii import re from Crypto.Cipher import AES from module.plugins.Crypter import Crypter class FilecryptCc(Crypter): __name__ = "FilecryptCc" __type__ = "crypter" __version__ = "0.05" __pattern__ = r'https?://(?:www\.)?filecrypt\.cc/Container/\...
Python
0
@@ -249,9 +249,9 @@ %220.0 -5 +6 %22%0A%0A @@ -790,16 +790,79 @@ %22(.+?)%22' +%0A CIRCLECAPTCHA_PATTERN = r'%3Cinput type=%22image%22 src=%22(.+?)%22' %0A%0A MI @@ -1114,17 +1114,16 @@ tent not - found%22 i @@ -1126,32 +1126,68 @@ d%22 in self.html: + #@pyload-devs: this is _not_ a typo %0A ...
431aed87ed9ba90178117fa738e8c57ee542b7cc
Update ipc_lista1.8.py
lista1/ipc_lista1.8.py
lista1/ipc_lista1.8.py
#ipc_lista1.8 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que pergunte quanto você ganha por hora e o número de horas trabalhadas no mês. #Calcule e mostre o total do seu salário no referido mês. QntHora = input("Entre com o valor de seu rendimento por hora: ") hT = input("E...
Python
0
@@ -374,9 +374,12 @@ %0ASalario + = %0A