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
41d6d64ca46438e22ee69514a84357402c8d7869
Add unique_id to WOL integration (#49604)
homeassistant/components/wake_on_lan/switch.py
homeassistant/components/wake_on_lan/switch.py
"""Support for wake on lan.""" import logging import platform import subprocess as sp import voluptuous as vol import wakeonlan from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity from homeassistant.const import ( CONF_BROADCAST_ADDRESS, CONF_BROADCAST_PORT, CONF_HOST, CONF_MAC, ...
Python
0
@@ -330,16 +330,72 @@ NAME,%0A)%0A +from homeassistant.helpers import device_registry as dr%0A import h @@ -2389,16 +2389,69 @@ is None +%0A self._unique_id = dr.format_mac(mac_address) %0A%0A @p @@ -2915,24 +2915,146 @@ umed_state%0A%0A + @property%0A def unique_id(self):%0A %22%22%22Retur...
c5fff613e5b860d3df51fa45189d379c3e1aeb68
Support for namespace in graphite bridge #49
prometheus_client/bridge/graphite.py
prometheus_client/bridge/graphite.py
#!/usr/bin/python from __future__ import unicode_literals import logging import re import socket import time import threading from .. import core # Roughly, have to keep to what works as a file name. # We also remove periods, so labels can be distinguished. _INVALID_GRAPHITE_CHARS = re.compile(r"[^a-zA-Z0-9_-]") d...
Python
0
@@ -456,16 +456,24 @@ interval +, prefix ):%0A @@ -575,16 +575,46 @@ interval +%0A self._prefix = prefix %0A%0A de @@ -1093,16 +1093,35 @@ er.push( +prefix=self._prefix )%0A @@ -2328,16 +2328,27 @@ val=60.0 +, prefix='' ):%0A @@ -2381,16 +2381,24 @@ interval +, prefix )%0A
9ecd320d41be2d20e37c95f79cc827eea31e0639
Fix error in email exception handling
etd_drop_app/forms.py
etd_drop_app/forms.py
import os import sys import zipfile import json import shutil from datetime import datetime from django import forms, template from django.conf import settings from django.forms.extras import SelectDateWidget import bagit from .validators import * class NewSubmissionForm(forms.Form): """ Form for submittin...
Python
0.000088
@@ -7297,35 +7297,135 @@ pients)%0A -%0A # TODO + except Exception as e:%0A # Log this email failure%0A # TODO%0A pass %0A%0A
a390d2551a5e39ad35888c4b326f50212b60cabf
add description of exception
eventbus/exception.py
eventbus/exception.py
__author__ = 'Xsank' class EventTypeError(Exception): '''Event type is invalid!''' class UnregisterError(Exception): '''No listener to unregister!'''
Python
0.000002
@@ -83,16 +83,68 @@ id!'''%0A%0A + def __str__(self):%0A return self.__doc__%0A%0A %0Aclass U @@ -202,12 +202,64 @@ register!''' +%0A%0A def __str__(self):%0A return self.__doc__
bc083b7fc9ea0598dde9abe584365ba9e697bb9d
Fix export samples output message bug.
bayesdb/client.py
bayesdb/client.py
# # Copyright (c) 2010-2013, MIT Probabilistic Computing Project # # Lead Developers: Jay Baxter and Dan Lovell # Authors: Jay Baxter, Dan Lovell, Baxter Eaves, Vikash Mansinghka # Research Leads: Vikash Mansinghka, Patrick Shafto # # Licensed under the Apache License, Version 2.0 (the "License"); # you may...
Python
0
@@ -5517,15 +5517,29 @@ %22 %25 +args_dict%5B' pkl +_ path +'%5D )%0A
0f1fdb93c8005a26fcea10f708252a9e5f358270
add compare string in JRC
src/JRCFileParserService.py
src/JRCFileParserService.py
''' Created on Jan 30, 2017 @author: Subhasis ''' import csv from MongoManager import MongoManager class JRCFileParserService(object): ''' This class takes care of reading the input file parsing the text line by line and pushing it into MongoDB. ''' def __init__(self, file_path, db_config, schema, t...
Python
0.00002
@@ -1595,24 +1595,53 @@ ations = %5B%5D%0A + compare_strings = %5B%5D%0A for @@ -1656,16 +1656,16 @@ a_list:%0A - @@ -1778,35 +1778,131 @@ -d%5B'variations'%5D = variation + compare_strings.append(r%5B3%5D.lower())%0A d%5B'variations'%5D = variations%0A d%5B'compare_s...
0ff9ccacf20d2896353df906426db06ce8c24605
Update ASIC count from 7 to 10
scripts/avalon3-a3233-modular-test.py
scripts/avalon3-a3233-modular-test.py
#!/usr/bin/env python2.7 # This simple script was for test A3255 modular. there are 128 cores in one A3255 chip. # If all cores are working the number should be 0. # If some of them not working the number is the broken cores count. from serial import Serial from optparse import OptionParser import binascii import sys...
Python
0.000013
@@ -1064,17 +1064,18 @@ ange(0, -8 +11 ):%0A%09%09%09%09n
1b704c24eaeb412e0636e5a0111ce2ac990998fd
remove confirm_text option in example
example/app/tables.py
example/app/tables.py
#!/usr/bin/env python # coding: utf-8 from table.columns import Column, LinkColumn, Link from table.utils import A from table import Table from models import Person class PersonTable(Table): id = Column(field='id', header=u'序号', header_attrs={'width': '50%'}) name = Column(field='name', header=u'姓名', header_...
Python
0
@@ -763,27 +763,8 @@ irm= -True, confirm_text= u%22%E7%A1%AE%E5%AE%9A
47582594a20fdef8a02e8386a7e6565284fdd18e
Remove repeated line
dojo/product_type/views.py
dojo/product_type/views.py
import logging from django.contrib import messages from django.contrib.auth.decorators import user_passes_test from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from dojo.filters import ProductTypeFilter from dojo.forms import Product_Ty...
Python
0.024529
@@ -4135,86 +4135,8 @@ e()%0A - pt.authorized_users.set(pt_form.cleaned_data%5B'authorized_users'%5D)%0A
1591faf725844ae76bdf0a4343837e1c3d2e16c0
update weight clipping params
common/models/discriminators.py
common/models/discriminators.py
import numpy as np import math import chainer import chainer.functions as F import chainer.links as L from chainer import cuda, optimizers, serializers, Variable from chainer import function from chainer.utils import type_check from .ops import * class DCGANDiscriminator(chainer.Chain): def __init__(self, in_ch=3...
Python
0
@@ -1920,16 +1920,17 @@ upper=0. +0 1, lower @@ -1933,16 +1933,17 @@ ower=-0. +0 1):%0A
1c06ea2b4558851cb013dc908abc0c3e3c8f1955
add support for queuing system in _write method
communication/communications.py
communication/communications.py
#!/usr/bin/env python from serial import Serial from Queue import Queue import fileinput import readline from time import sleep from threading import Thread # constants TEAM = 0 # Operation Codes (OpCodes) STOP = 0 FORWARD = 1 BACKWARD = 2 LEFT = 3 RIGHT = 4 GRAB = 5 class CommsToArduino(object): queue = Queu...
Python
0
@@ -1601,20 +1601,9 @@ -Repeatedly s +S ends @@ -1603,26 +1603,24 @@ Sends the -op code to the @@ -1623,307 +1623,81 @@ the -robot until an OK is received.%0A Then waits until DONE, and sets %22ready%22 true.%0A %22%22%22%0A%0A received = None%0A checksum = self.create_checksu...
0e409813d360c8036d4a6a74c82d986f1b32472d
Improve error message when base64 data is an invalid type
drf_extra_fields/fields.py
drf_extra_fields/fields.py
import base64 import binascii import imghdr import uuid from django.core.exceptions import ValidationError from django.core.files.base import ContentFile from django.utils import six from django.utils.translation import ugettext_lazy as _ from rest_framework.fields import ( DateField, DateTimeField, DictF...
Python
0.000021
@@ -2324,16 +2324,30 @@ rror(_(' +Invalid type. This is @@ -2366,17 +2366,60 @@ 4 string -' +: %7B%7D'.format(%0A type(base64_data)) ))%0A%0A
cb34162de51f36e2d6b846cfbb6e9d6fe8801e48
implement send message
client/client.py
client/client.py
class OTC_Client(object): def __init__(self): raise NotImplementedError("TODO: write a client") def send(message): raise NotImplementedError("TODO: write send method") def recieve(): raise NotImplementedError("TODO: write recieve") def decrypt(message, pad_index=current_index): ...
Python
0.000029
@@ -43,16 +43,17 @@ (self):%0A +%0A @@ -125,16 +125,113 @@ ssage):%0A + payload = %7B'message':message%7D%0A r = requets.post(self.server_address,data=payload)%0A @@ -604,18 +604,77 @@ connect( -): +server_address):%0A self.server_address = server_address %0A
2ac53588f9d0cc5ce32f6fe15b715f5178a1a264
Send more info from i2pcontrol.
client/client.py
client/client.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # client.py - i2p clients share what they know to a centralized server. # Author: Chris Barry <chris@barry.im> # License: This is free and unencumbered software released into the public domain. import argparse import i2py.netdb import i2py.control import i2py.control.pyj...
Python
0
@@ -2063,35 +2063,24 @@ - : ri_vals%5B'i @@ -2137,27 +2137,16 @@ - - : ri_val @@ -2202,27 +2202,16 @@ ipating' - : ri_ @@ -2259,30 +2259,16 @@ g'%5D,%0A%09%09' -crypto.garlic. decryptF @@ -2271,16 +2271,19 @@ yptFail' + @@ -2344,16 +2344,51...
afc39de6009b28c6378d1ce605d8ca91e240accd
remove obsolete import
osmaxx/conversion/converters/converter_gis/helper/osm_boundaries_importer.py
osmaxx/conversion/converters/converter_gis/helper/osm_boundaries_importer.py
from itertools import chain from sqlalchemy import MetaData, Table, create_engine, func from sqlalchemy.engine.url import URL from sqlalchemy.sql import select, insert, expression from geoalchemy2 import Geometry, Geography class OSMBoundariesImporter: def __init__(self): self._osm_boundaries_tables = ['c...
Python
0.000998
@@ -1,32 +1,4 @@ -from itertools import chain%0A from
f1ed9cf573ec8aaa61e9aefb124b453a5a353db4
fix pointe-claire
ca_qc_pointe_claire/people.py
ca_qc_pointe_claire/people.py
from pupa.scrape import Scraper from utils import lxmlize, CanadianLegislator as Legislator import re COUNCIL_PAGE = 'http://www.ville.pointe-claire.qc.ca/en/city-hall-administration/your-council/municipal-council.html' class PointeClairePersonScraper(Scraper): def get_people(self): page = lxmlize(COUNCIL_P...
Python
0.000092
@@ -570,33 +570,36 @@ ndall(r'%5B0-9%5D%7B3%7D - +%5B -%5D %5B0-9%5D%7B3%7D-%5B0-9%5D%7B4 @@ -1312,17 +1312,20 @@ %5B0-9%5D%7B3%7D - +%5B -%5D %5B0-9%5D%7B3%7D
9a3081c58818ad28e216e9a14fc573c4a392f55f
Add method for getting csv Hours Worked reports for Jobs Board and Payment Plan
invoice/management/commands/ticket_time_csv.py
invoice/management/commands/ticket_time_csv.py
# -*- encoding: utf-8 -*- import csv import os from django.core.management.base import BaseCommand from invoice.models import TimeRecord class Command(BaseCommand): help = "Export ticket time to a CSV file" def handle(self, *args, **options): """Export ticket time to a CSV file. Columns: ...
Python
0
@@ -209,16 +209,20 @@ V file%22%0A + %0A def @@ -226,256 +226,187 @@ def -handle(self, *args, **options):%0A %22%22%22Export ticket time to a CSV file.%0A%0A Columns:%0A%0A - ticket number%0A - user name%0A - billable - True or False%0A - date started%0A - min...
c0e2fb3068270ebe7183587db1264c193c43b6cc
fix previous commit wrong domain
redpanal/redpanal/social/models.py
redpanal/redpanal/social/models.py
from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ from django.utils.safestring import mark_safe from django.db.models.signals import p...
Python
0.000002
@@ -1941,26 +1941,27 @@ //)( -grafiks%5C.info:8080 +beta%5C.redpanal%5C.org )/(%5B @@ -1988,35 +1988,34 @@ +)/?') # -beta%5C.redpanal%5C.org +grafiks%5C.info:8080 %0A
93ff10b9add58dbc045c6656715bf67409a51404
fix style-check error (#416)
gapic/schema/naming.py
gapic/schema/naming.py
# Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0
@@ -860,16 +860,18 @@ sitive.%0A +%0A%0A @datacla
a3db681a63a5908d38ca5fcac4bdd96f5e4fed7e
use typing.TYPE_CHECKING to avoid flake8 failure (#398)
launch/launch/event_handlers/on_execution_complete.py
launch/launch/event_handlers/on_execution_complete.py
# Copyright 2019 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
Python
0
@@ -750,24 +750,57 @@ import Text%0A +from typing import TYPE_CHECKING%0A from typing @@ -1075,16 +1075,69 @@ nsType%0A%0A +if TYPE_CHECKING:%0A from .. import Action # noqa%0A%0A %0Aclass O
8fa0ca6a307f7b23545d297d17f8eb05f037978f
fix one e2e test problem (#459)
test/e2e/utils.py
test/e2e/utils.py
# Copyright 2019 kubeflow.org. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
Python
0.000001
@@ -905,16 +905,43 @@ espace)%0A + status = 'Unknown'%0A
0097a4022ec8ab57e76c86bd202dd7a5fad8a076
Revert to original
cardiffshop/products/admin.py
cardiffshop/products/admin.py
from products.models import Product, Category, ProductImage from django.conf import settings from django.contrib import admin from django.contrib.admin import SimpleListFilter from suit.admin import SortableTabularInline class CanBeSoldListFilter(SimpleListFilter): title = "Can be sold" parameter_name = "can_...
Python
0.999647
@@ -600,32 +600,8 @@ t=0) -.filter(is_visible=True) %0A @@ -650,23 +650,22 @@ ueryset. -exclude +filter (stock_c @@ -672,39 +672,10 @@ ount -__gt=0).exclude(is_visible=True +=0 )%0A%0A%0A @@ -2375,27 +2375,8 @@ %3E 0 - and obj.is_visible :%0A
618c5bd2dee90565a97ab744f620ae8de4a74b91
refactor plymouth importer to use get_srid()
polling_stations/apps/data_collection/management/commands/import_plymouth.py
polling_stations/apps/data_collection/management/commands/import_plymouth.py
""" Imports Plymouth """ from django.contrib.gis.geos import Point, GEOSGeometry from data_collection.management.commands import BaseKamlImporter from data_collection.google_geocoding_api_wrapper import ( GoogleGeocodingApiWrapper, PostcodeNotFoundException ) class Command(BaseKamlImporter): """ Impo...
Python
0
@@ -682,271 +682,8 @@ on%0A%0A - # The SRID for the KML is 4326 but the CSV is 2770 so we%0A # set it each time we create the polygon.%0A # We could probably do with a more elegant way of doing%0A # this longer term.%0A self._srid = self.srid%0A self.srid = 4326%0A @@ -7...
49be60d27b5d5ce40c20847f79a8dd09f580a830
Update _var_dump.py
var_dump/_var_dump.py
var_dump/_var_dump.py
from __future__ import print_function import sys try: from types import NoneType except: NoneType = type(None) if sys.version_info > (3,): long = int unicode = str __author__ = "Shamim Hasnath" __copyright__ = "Copyright 2013, Shamim Hasnath" __license__ = "BSD License" __version__ = "1.0.1" ...
Python
0.000005
@@ -368,23 +368,22 @@ y, typ, -display +proret ):%0D%0A%09st @@ -1086,23 +1086,22 @@ %0D%0A%0D%0A%09if -display +proret :%0D%0A%09%09pri @@ -1119,25 +1119,18 @@ le(l))%0D%0A -%09else: %0D%0A -%09 %09return @@ -1192,16 +1192,26 @@ oret):%0D%0A +%09r = '';%0D%0A %09if type @@ -1266,24 +1266,29 @@ nicode):%0...
206696e82f3e5be4a64e60abdb59ca51d2b1461e
Add a test for rgb+mp to verify that it continues to work.
pysc2/tests/multi_player_env_test.py
pysc2/tests/multi_player_env_test.py
#!/usr/bin/python # Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
Python
0
@@ -1077,16 +1077,25 @@ ayer_env +_features (self):%0A @@ -1570,16 +1570,523 @@ steps)%0A%0A + def test_multi_player_env_rgb(self):%0A steps = 100%0A step_mul = 16%0A players = 2%0A with sc2_env.SC2Env(%0A map_name=%22Simple64%22,%0A players=%5Bsc2_env.Agent(sc2_env.Race.zerg),%0A ...
48e3dab4ce044554b0ff606dea340ff8b6e5d928
Update __init__.py
edbo_connector/__init__.py
edbo_connector/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ edbo_connector Author: Eldar Aliiev Email: e.aliiev@vnmu.edu.ua """ from .client import EDBOWebApiClient __name__ = 'python-edbo-connector' __author__ = 'Eldar Aliiev' __copyright__ = 'Copyright 2018, National Pirogov Memorial Medical University, Vinnytsya' __credits...
Python
0.000072
@@ -377,17 +377,17 @@ '1.0.4-1 -2 +3 '%0A__main
949934ea7a34fcd71f65118b741a51a28e815e5d
update from trunk r9256
pywikibot/families/wowwiki_family.py
pywikibot/families/wowwiki_family.py
# -*- coding: utf-8 -*- __version__ = '$Id$' from pywikibot import family class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'wowwiki' self.langs = { 'cs': 'cs.wow.wikia.com', 'da': 'da.wowwiki.com', 'de': 'de.w...
Python
0
@@ -954,30 +954,28 @@ no': 'no.wow -. wiki -a .com',%0A @@ -1717,16 +1717,319 @@ tions%22%0A%0A + # Wikia's default CategorySelect extension always puts categories last%0A self.categories_last = %5B'cs', 'da', 'de', 'el', 'en', 'es', 'fa', 'fi', 'fr', 'he', 'hr', 'hu', 'is', 'it', 'ja', 'ko', 'lt...
2d24ddd4e98972cdda69b5337ff2532f4319366e
add new line after test class
pywinauto/unittests/test_Calendar.py
pywinauto/unittests/test_Calendar.py
"""Tests for CalendarWrapper""" import time import datetime import ctypes import locale import re import sys import os import unittest sys.path.append(".") from pywinauto import win32structures from pywinauto import win32defines from pywinauto.application import Application from pywinauto.sysinfo import is_x64_Python f...
Python
0.000004
@@ -578,16 +578,17 @@ tCase):%0A +%0A %22%22%22U
327ba9de1fbe0ac3411c0192f944c3fae960d61b
fix tests
qiita_pet/test/test_qiita_redbiom.py
qiita_pet/test/test_qiita_redbiom.py
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
Python
0.000001
@@ -3254,36 +3254,65 @@ '5': %5B'1.SK -M3.640197'%5D, +D2.640178', '1.SKM3.640197'%5D,%0A '4': %5B'1.SK @@ -3313,32 +3313,49 @@ %5B'1.SKM3.640197' +, '1.SKD2.640178' %5D%7D%0A respo @@ -3398,86 +3398,8 @@ gs)%0A - print data%5B0%5D%5B'artifact_biom_ids'%5D%0A print loads(response....
c95c222384c2c0d887d435017196c9af4137d1b2
set numba parallel option
hpat/__init__.py
hpat/__init__.py
from __future__ import print_function, division, absolute_import import numba from numba import * from .compiler import add_hpat_stages set_user_pipeline_func(add_hpat_stages) del add_hpat_stages def jit(signature_or_function=None, **options): # set nopython by default if 'nopython' not in options: o...
Python
0.000002
@@ -339,16 +339,47 @@ = True%0A + options%5B'parallel'%5D = True%0A retu
678d96a624af1d3d4fa991ec41abde8919c9977c
add choices for some config options
yabgp/config.py
yabgp/config.py
# Copyright 2015 Cisco Systems, 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 requi...
Python
0
@@ -1531,24 +1531,65 @@ ult='json',%0A + choices=%5B'json', 'list'%5D,%0A @@ -2546,24 +2546,91 @@ 'add_path',%0A + choices=%5B'ipv4_send', 'ipv4_receive', 'ipv4_both'%5D,%0A @@ -3815,16 +3815,78 @@ t('tag', +%0A choices=%5B'SRC', 'DST', 'BOTH'%5D,...
07032d47dc103f6436989fdecf679bee92be0786
Rework question indexing
apps/questions/es_search.py
apps/questions/es_search.py
import elasticutils import logging import pyes import time from search.es_utils import (TYPE, LONG, INDEX, STRING, ANALYZED, ANALYZER, SNOWBALL, TERM_VECTOR, STORE, YES, BOOLEAN, WITH_POS_OFFSETS, DATE, INTEGER, get_index) ID_FACTOR = 100000 log = logging.ge...
Python
0.000016
@@ -3918,151 +3918,8 @@ )%0A%0A%0A -def index_docs(documents, bulk=False, force_insert=False, es=None):%0A for doc in documents:%0A index_doc(doc, bulk, force_insert, es)%0A%0A%0A def
81cbcf66ce2e4344a951092080a8be9bb0b86302
Complete tests for Group with invitation only
sigma_core/tests/test_group_member.py
sigma_core/tests/test_group_member.py
import json from django.core import mail from rest_framework import status from rest_framework.test import APITestCase from sigma_core.models.user import User from sigma_core.models.group import Group from sigma_core.models.group_member import GroupMember from sigma_core.serializers.user import DetailedUserSerialize...
Python
0
@@ -5058,28 +5058,820 @@ self.group = GroupFactory()%0A + self.group.req_rank_invite = 5%0A self.group.save()%0A%0A # Testing user%0A self.user = UserFactory()%0A%0A # Misc%0A self.new_membership_data = %7B%22user%22: self.user.id, %22group%22: self.group.id%7D%0A%0A de...
80d3fe7d2c69fd960a5b585d60085f33e109e455
solution found text incorrect
simbad/command_line/simbad_lattice.py
simbad/command_line/simbad_lattice.py
#!/usr/bin/env python __author__ = "Felix Simkovic & Adam Simpkin" __date__ = "06 Mar 2017" __version__ = "0.1" import argparse import os import platform import sys import time import simbad.command_line import simbad.util.exit_util import simbad.util.simbad_util import simbad.version __version__ = simbad.version._...
Python
0.999998
@@ -2626,110 +2626,76 @@ fo(%22 -Check you out, crystallizing contaminants! But don't worry, SIMBAD figured it out and found a solution +Lucky you! SIMBAD worked its charm and found a lattice match for you .%22)%0A
f6bb142bf965a7ac4f842d73235e2db17795e25e
Update sock_conn_test.py
apps/sock/sock_conn_test.py
apps/sock/sock_conn_test.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Author : jeonghoonkang, https://github.com/jeonghoonkang # Author : Kowonsik, https://github.com/kowonsik import socket import os import sys import struct import time ETYPE_VALUE_MAX = 8000 def main(): SERVER_ADDR = "125.xx.xx.41" SERVER_PORT = 8283 print " "*10, "tr...
Python
0.000004
@@ -146,17 +146,16 @@ wonsik%0A%0A -%0A import s
77651861fc5a27d1d62293e3bc66d62ae193221d
add tolerance option to F.sqrt
tests/chainer_tests/functions_tests/math_tests/test_sqrt.py
tests/chainer_tests/functions_tests/math_tests/test_sqrt.py
import unittest import numpy import chainer.functions as F from chainer import testing # sqrt def make_data(shape, dtype): x = numpy.random.uniform(0.1, 5, shape).astype(dtype) gy = numpy.random.uniform(-1, 1, shape).astype(dtype) ggx = numpy.random.uniform(-1, 1, shape).astype(dtype) return x, gy,...
Python
0.000003
@@ -362,15 +362,24 @@ est( +%0A F.sqrt, +%0A mak @@ -394,16 +394,69 @@ ake_data +,%0A backward_options=%7B'atol': 1e-3, 'rtol': 1e-3%7D,%0A )%0Aclass
cc17390eada091da34fed92ee7e2090adc1fa87e
Fix for `plot_field` function failing on non-square grids #666
examples/cfd/tools.py
examples/cfd/tools.py
from mpl_toolkits.mplot3d import Axes3D # noqa import numpy as np from matplotlib import pyplot, cm def plot_field(field, xmax=2., ymax=2., zmax=None, view=None, linewidth=0): """Utility plotting routine for 2D data :param field: Numpy array with field data to plot :param xmax: (Optional) Length of the...
Python
0
@@ -655,16 +655,31 @@ y_coord +, indexing='ij' )%0A ax
173317003a59afb639e6f4f5d5eca41a1f390979
Revise q05 to successfully use partial derivatives of u and v for gradient descent of E (error).
hw05/hw05ex05.py
hw05/hw05ex05.py
# dE/du (u e^v - 2v e^(-u))^2 = 2 (u e^v - 2v e^(-u))(e^v + 2v e^(-u)) #from decimal import Decimal from math import exp #natural exponent, e**x def calcE(u,v): return 2 * ( u*exp(v) - 2*v*exp(-u) ) * ( exp(v) + 2*v*exp(-u) ) i = 0 eta = 0.1 # u"\u03B7" #E = float(10^(-14)) #E = 10^(-14) #E = Decimal(0.0000000000...
Python
0
@@ -110,19 +110,31 @@ import -exp +sqrt, exp, fabs #natura @@ -149,16 +149,36 @@ nt, e**x +. and absolute value %0A%0Adef ca @@ -180,16 +180,20 @@ ef calcE +wrtu (u,v):%0A @@ -199,80 +199,549 @@ -return 2 * ( u*exp(v) - 2*v*exp(-u) ) * ( exp(v) + 2*v*exp(-u) )%0A%0A +'''%0A Given u and v, the hypothe...
61609c6b1a93316c1b8a5e512ed310a38d6c772b
Add gss_mnist description
examples/gss_mnist.py
examples/gss_mnist.py
import torch import torch.nn as nn from torch.nn import CrossEntropyLoss from torch.optim import SGD from avalanche.benchmarks import Experience from avalanche.benchmarks.classic import SplitMNIST from avalanche.benchmarks.generators.benchmark_generators import \ data_incremental_benchmark from avalanche.benchmark...
Python
0.000003
@@ -573,16 +573,188 @@ _greedy%0A +%22%22%22%0AThis example the strategy GSS_greedy on Split MNIST.%0AThe final accuracy is around 82.6%25 (std 2.9) %0Aas stated in the original paper: https://arxiv.org/abs/1903.08671%0A%22%22%22 %0A%0Aclass
c0eedfeca0e19a65e4484e63790319cf18433343
change optimizer in example
examples/mnist_mlp.py
examples/mnist_mlp.py
'''Trains a simple deep NN on the MNIST dataset. Gets to 98.40% test accuracy after 20 epochs (there is *a lot* of margin for parameter tuning). 2 seconds per epoch on a K520 GPU. ''' from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist...
Python
0
@@ -1403,20 +1403,23 @@ timizer= -Adam +RMSprop (),%0A
a5be3784d0cfce42c0cdb6bc83b37a07dff7a164
Implement accuracy on GPU
chainer/functions/accuracy.py
chainer/functions/accuracy.py
import numpy from chainer import cuda, Function class Accuracy(Function): """Compute accuracy within minibatch.""" def forward_cpu(self, inputs): y, t = inputs y = y.reshape(y.shape[0], y.size / y.shape[0]) # flatten pred = y.argmax(axis=1) return (pred == t).mean(dtype=numpy....
Python
0.000008
@@ -6,16 +6,44 @@ t numpy%0A +from pycuda import gpuarray%0A from cha @@ -69,16 +69,16 @@ unction%0A - %0Aclass A @@ -399,186 +399,685 @@ -# Fallback to CPU%0A # TODO(beam2d): Pure GPU version%0A accuracy, = self.forward_cpu((a.get() for a in inputs))%0A return cuda.to_gpu_async(numpy.arr...
f3c5a477141e5f3845641111f775ea90398be633
Add numpy.ndarray and cupy.ndarray as input type
chainer/functions/math/erf.py
chainer/functions/math/erf.py
import math import warnings import numpy import chainer from chainer import cuda from chainer import function_node from chainer import utils from chainer.utils import type_check _erf_cpu = None class Erf(function_node.FunctionNode): @property def label(self): return 'erf' def check_type_forw...
Python
0.000127
@@ -1517,16 +1517,24 @@ x ( +:class:%60 ~chainer @@ -1542,16 +1542,78 @@ Variable +%60 or :class:%60numpy.ndarray%60 or %5C%0A :class:%60cupy.ndarray%60 ): Input
0eeacf39140ae204bcea59a497acb8e58d949f5a
Remove unused relation join
changes/utils/originfinder.py
changes/utils/originfinder.py
from __future__ import absolute_import from collections import defaultdict from sqlalchemy.orm import subqueryload_all from changes.config import db from changes.constants import Result, Status from changes.models import Build, Job, TestGroup, Source def first(key, iterable): for x in iterable: if key(x...
Python
0.000001
@@ -1361,61 +1361,8 @@ id,%0A - ).options(%0A subqueryload_all(Build.jobs),%0A
569e21f9ad9f9668c7dcfcd4dba64806c9c07d7d
Support origination contexts in V2.
ambassador/ambassador/envoy/v2/v2cluster.py
ambassador/ambassador/envoy/v2/v2cluster.py
# Copyright 2018 Datawire. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
Python
0
@@ -1465,16 +1465,17 @@ , None)%0A +%0A @@ -1515,30 +1515,64 @@ If -TLS Context is enabled +this is a null TLS Context (_ambassador_enabled is True) , th @@ -1584,14 +1584,8 @@ at -least need @@ -1596,16 +1596,40 @@ specify +a%0A # minimal %60tls_con @@ -1643,17 +1643,16 @@ o enable ...
017413dedca384dad72a8159358f372ceff4949c
version bump
iiab/__init__.py
iiab/__init__.py
__version__ = '0.4.2'
Python
0.000001
@@ -16,7 +16,7 @@ 0.4. -2 +3 '%0A
95d6c63dfd527f3ffc19a713b2a2dfa2b97dfb1a
remove unnecessary lines
client/python/modeldb/tests/sklearn/testRandomSplitEvent.py
client/python/modeldb/tests/sklearn/testRandomSplitEvent.py
import unittest import sys from ModelDbSyncerTest import SyncerTest import modeldb.tests.utils as utils from modeldb.thrift.modeldb import ttypes as modeldb_types from modeldb.sklearn_native.ModelDbSyncer import * from modeldb.sklearn_native import SyncableRandomSplit import pandas as pd import random FMIN = sys.flo...
Python
0.999144
@@ -303,61 +303,8 @@ om%0A%0A -FMIN = sys.float_info.min%0AFMAX = sys.float_info.max%0A%0A clas
8c4a54690cb99b63a9cf825e2958bb2b48cd7e5d
Complete lc009_palindrome_number.py
lc009_palindrome_number.py
lc009_palindrome_number.py
"""Leetcode 9. Palindrome Number Easy Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Input: 121 Output: true Example 2: Input: -121 Output: false Explanation: From left to right, it reads -121. From right to left, it becomes 121-. The...
Python
0.999989
@@ -455,16 +455,90 @@ indrome. +%0A%0AFollow up:%0ACoud you solve it without converting the integer to a string? %0A%22%22%22%0A%0Acl @@ -559,17 +559,20 @@ bject):%0A -%09 + def isPa @@ -594,10 +594,16 @@ x):%0A -%09%09 + %22%22%22%0A @@ -668,32 +668,704 @@ -pass%0A%0A%0Adef main():%0A%09pass +x...
d325ed4aade30378e050cf2443081a86a6d4438c
Revise to var min_hq
lc0253_meeting_rooms_ii.py
lc0253_meeting_rooms_ii.py
"""Leetcode 253. Meeting Rooms II (Premium) Medium URL: https://leetcode.com/problems/meeting-rooms-ii Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference rooms required. Example1 Input: intervals = [[0,30],[5,10],[15,20]] ...
Python
0.001577
@@ -953,19 +953,17 @@ end_minh -eap +q = %5B%5D%0A @@ -983,35 +983,33 @@ eappush(end_minh -eap +q , intervals%5B0%5D%5B1 @@ -1174,19 +1174,17 @@ end_minh -eap +q %5B0%5D:%0A @@ -1218,19 +1218,17 @@ end_minh -eap +q )%0A%0A @@ -1302,19 +1302,17 @@ end_minh -eap +q , interv @@ -1350,19 +1350,17 @@ e...
7e20350e4199a5cbb4c89bd6593a93b9a2e56cff
add in old commands
lean_workbench/commands.py
lean_workbench/commands.py
# -*- coding:utf-8 -*- from flask.ext.script import Command, Option, prompt_bool import os import config from main import app_factory class CreateDB(Command): """ Creates sqlalchemy database """ def run(self): from database import create_all create_all() class DropDB(Command): ...
Python
0.000118
@@ -3189,25 +3189,24 @@ -# mine_fb_page @@ -3259,17 +3259,16 @@ -# track_ke
a2dcb94726d0bcc58b08eddcab6ebf433778af2c
Fix error handler to correct view.
zoll_me/urls.py
zoll_me/urls.py
''' James D. Zoll 1/20/2013 Purpose: Defines URL rules for the project. License: This is a public work. ''' # Library Imports from django.conf.urls import patterns, include, url from django.conf import settings from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', in...
Python
0
@@ -2799,33 +2799,33 @@ e.views.error_40 -4 +3 '%0Ahandler404 = '
9e9f831a757af01cc3b1edfe590e27f7ab53c2ce
define interfaces
zvmsdk/vmops.py
zvmsdk/vmops.py
from log import LOG import utils as zvmutils class VMOps(object): def __init__(self): self._xcat_url = zvmutils.get_xcat_url() def _power_state(self, instance_name, method, state): """Invoke xCAT REST API to set/get power state for a instance.""" body = [state] url = self._x...
Python
0.000003
@@ -42,16 +42,2193 @@ utils%0A%0A%0A +VMOPS = None%0A%0A%0Adef _get_vmops():%0A if VMOPS is None:%0A VMOPS = VMOps()%0A return VMOPS%0A%0A%0Adef run_instance(instance_name, image_id, cpu, memory,%0A login_password, ip_addr):%0A %22%22%22Deploy and provision a virtual machine.%0A%0A I...
c88060026243dee24ab96af35784b38ca8b1c2e9
Fix migration conflict. (#1929)
rdr_service/alembic/versions/2c3a71f9fc04_add_genomic_set_member_columns_for_aw3_.py
rdr_service/alembic/versions/2c3a71f9fc04_add_genomic_set_member_columns_for_aw3_.py
"""add_genomic_set_member columns_for_aw3_aw4 Revision ID: 2c3a71f9fc04 Revises: df7c40b6a209 Create Date: 2020-08-25 08:57:17.987756 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = '2c3a71f9fc04' down_revision = 'df7c40b6a2...
Python
0.000002
@@ -75,28 +75,28 @@ evises: -df7c40b6a209 +c069abb92cc0 %0ACreate @@ -307,20 +307,20 @@ = ' -df7c40b6a209 +c069abb92cc0 '%0Abr
dfaa289465a2cdc837884718624b9a8a65e511b3
Improve proxy rax example
examples/proxy_rax.py
examples/proxy_rax.py
import random import sc2 from sc2 import Race, Difficulty from sc2.constants import * from sc2.player import Bot, Computer class ProxyRaxBot(sc2.BotAI): async def on_step(self, state, iteration): cc = self.units(COMMANDCENTER) if not cc.exists: target = self.known_enemy_structures.rand...
Python
0.000001
@@ -956,17 +956,61 @@ _left %3C -2 +(2 if self.units(BARRACKS).amount %3C 3 else 4) :%0A @@ -1199,16 +1199,17 @@ %3C 3 or +( self.min @@ -1219,16 +1219,53 @@ ls %3E 400 + and self.units(BARRACKS).amount %3C 5) :%0A @@ -1896,11 +1896,12 @@ ime= -Tru +Fals e)%0A%0A
a4b7878880f5a8d275129949179b4b30044f0c86
Update __init__.py
eniric_scripts/__init__.py
eniric_scripts/__init__.py
__all__ = [ "bary_shift_atmmodel", "phoenix_precision.py", "precision_four_panel", "split_atmmodel", ]
Python
0.000072
@@ -58,11 +58,8 @@ sion -.py %22,%0A
9f24a53297a1d196127baf15f3fd6c025716207e
use the right netclient call
test/repostest.py
test/repostest.py
#!/usr/bin/python2.4 # # Copyright (c) 2004-2006 rPath, Inc. # from time import sleep import testsuite testsuite.setup() from mint_rephelp import MintRepositoryHelper import recipes from conary.conarycfg import ConaryConfiguration, UserInformation from conary.conaryclient import ConaryClient from conary import repos...
Python
0
@@ -2924,16 +2924,24 @@ oveNames +OnServer ('notfou
39f50aadc98f493a32810af0ba4d0fd87c8108e1
Update runsegment.py
bin/runsegment.py
bin/runsegment.py
#!/usr/bin/python import os import numpy as np import shutil import common from segment import normalizefile, segmentfile def runAll(args): print('\n\n\nYou have requested to normalize and segment bincounts files') print('\tWARNING:') print('\t\tIF USING ANY REFERENCES OTHER THAN THOSE I PROVIDE I CAN...
Python
0.000001
@@ -1688,26 +1688,8 @@ 1)%5D%0A -%09%09%09print refSlice%0A %09%09%09m @@ -1749,34 +1749,8 @@ '%5D%5D%0A -%09%09%09print methodSamples%0A%09%09%09 %0A%09%09%09 @@ -1883,17 +1883,17 @@ Dict%5Bi%5D -! += = False: @@ -1893,16 +1893,38 @@ False:%0A +%09%09%09%09continue%0A%09%09%09else:%0A %09%09%09%09for
10d5e90e65e792d0fae3879dd5f512bdc7b95da6
Add missing dependency to perl-xml-parser (#12903)
var/spack/repos/builtin/packages/perl-xml-parser/package.py
var/spack/repos/builtin/packages/perl-xml-parser/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) # from spack import * class PerlXmlParser(PerlPackage): """XML::Parser - A perl module for parsing XML documents""" ...
Python
0.000025
@@ -545,16 +545,74 @@ 'expat') +%0A depends_on('perl-libwww-perl', type=('build', 'run')) %0A%0A de
76f60e58f1011d2ae3589a08efe183775430a44c
create result dir if does not exist
test/run_tests.py
test/run_tests.py
#!/usr/bin/env python # Copyright 2008-2010 Nokia Siemens Networks Oyj # # 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 req...
Python
0.000001
@@ -2100,16 +2100,82 @@ unner):%0A + if not os.path.exists(RESULTDIR):%0A os.mkdir(RESULTDIR)%0A comm
0153a20201cfeff37512733b2e85106f69ba5f47
replace use of 'unicode' builtin
monasca_log_api/app/base/model.py
monasca_log_api/app/base/model.py
# Copyright 2016 FUJITSU LIMITED # # 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 writ...
Python
0.000617
@@ -926,14 +926,20 @@ w = -unicod +six.text_typ e(js @@ -984,16 +984,22 @@ utf-8',%0A +
ee75d9530bb6b9e409449c8e9d5ffb3a3578f5d8
Fix not coloring for new repositories
bin/commands/stateextensions/status.py
bin/commands/stateextensions/status.py
import os import re import subprocess from colorama import Fore def title(): return 'status' def accent(**kwargs): new_repository = kwargs.get('new_repository', False) show_color = kwargs.get('show_color', 'always') if new_repository: status_title = '{no_color}({green}master{no_color})'.f...
Python
0.000001
@@ -1001,16 +1001,52 @@ (%5B'git', + '-c', 'color.status=' + show_color, 'status
6258026193d52de5168007b833a2fd35c807b734
fix main to pass until further dev is done
bin/slacksible.py
bin/slacksible.py
#! /Users/jhefner/python_dev/uw_python/project/bin/python from slackclient import SlackClient import os import sys # import logging # TODOS: # * create logs: # 1. Debug log. slacksible_debug.log (10) # 2. stderr log. slacksible_stderr.log (40) # 3. usage log. slacksible_metrics.log # *...
Python
0
@@ -3448,85 +3448,11 @@ p -rint(os.path.split(os.path.abspath(os.path.dirname(sys.argv%5B0%5D)))%5B0%5D+%22/logs%22) +ass %0A%0A%0Ai
c0841b6a38fc042f95f931eead6bc5733d975644
Update forms.py
cla_public/apps/base/forms.py
cla_public/apps/base/forms.py
# coding: utf-8 "Base forms" from flask import render_template, current_app, request from flask_wtf import Form from flask.ext.babel import lazy_gettext as _, get_translations from wtforms import TextAreaField, RadioField, SelectMultipleField, StringField, widgets from wtforms.validators import InputRequired, Length ...
Python
0
@@ -1390,12 +1390,13 @@ lty -with +using thi @@ -1405,16 +1405,43 @@ service? + Tell us about the problem. %22), vali
2934f0a9a7696262032fed08f1e0a7c2e6be009c
use `host` variable
api-server.py
api-server.py
#!/usr/bin/env python3 """ This api server runs both a json-rpc api and a notification rest api. (neo.api.JSONRPC.JsonRpcApi and neo.api.REST.NotificationRestApi) Example systemd service config: TODO """ import os import argparse import threading from time import sleep from logzero import logger from twisted.internet...
Python
0.000055
@@ -4358,25 +4358,20 @@ rt_rpc, -'0.0.0.0' +host )%0A en @@ -4440,17 +4440,12 @@ st, -'0.0.0.0' +host )%0A
c71730cf4f3d8937f0ef1608bf670c28ec44eb0b
Complete and prettified
Challenge3.py
Challenge3.py
# Exercise 3 (and Solution) # Take a list, say for example this one: # a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] # and write a program that prints out all the elements of the list that are less than 5. # Extras: # Instead of printing the elements one by one, make a new list that has all the elements less than 5 ...
Python
0
@@ -811,29 +811,146 @@ %22)%0A%0A -list = %5B%5D%0Acounter = 0 +# create a list and start a counter to get desired numbers%0A%0Alist = %5B%5D%0Acounter = 0%0A%0A# ask for 10 numbers and add each one to the empty list %0A%0Awh @@ -1006,19 +1006,16 @@ se give -us a number @@ -1075,16 +1075,20 @@ .append( +int( us...
d6f4d9b76d6f12cc9eae1614a33ebb9fa6aa1724
Fix error handling on missing dest with unarchive
lib/ansible/runner/action_plugins/unarchive.py
lib/ansible/runner/action_plugins/unarchive.py
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2013, Dylan Martin <dmartin@seattlecentral.edu> # # This file is part of Ansible # # Ansible 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 v...
Python
0
@@ -1648,35 +1648,16 @@ urce = -os.path.expanduser( options. @@ -1664,33 +1664,32 @@ get('src', None) -) %0A dest @@ -1695,27 +1695,8 @@ = -os.path.expanduser( opti @@ -1716,17 +1716,16 @@ ', None) -) %0A @@ -1955,32 +1955,72 @@ result=result)%0A%0A + dest = os.path.expanduser(dest...
d4ee599fe9cd88315d129e036fb034111bfc2272
Add types to common url parameters (#50000)
lib/ansible/utils/module_docs_fragments/url.py
lib/ansible/utils/module_docs_fragments/url.py
# (c) 2018, John Barker<gundalow@redhat.com> # # This file is part of Ansible # # Ansible 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...
Python
0
@@ -1,9 +1,45 @@ # + -*- coding: utf-8 -*-%0A%0A# Copyright: (c) 201 @@ -52,16 +52,17 @@ n Barker + %3Cgundalo @@ -80,634 +80,63 @@ m%3E%0A# -%0A# This file is part of Ansible%0A#%0A# Ansible is free software: you can redistribute it and/or modify%0A# it under the terms of the GNU General Public License as publi...
e9df15b0f084ed9e026a5de129b109a3c546f99c
Handle comments in parse tree.
src/libeeyore/parse_tree_to_cpp.py
src/libeeyore/parse_tree_to_cpp.py
import builtins from cpp.cpprenderer import EeyCppRenderer from environment import EeyEnvironment from values import * def parse_tree_string_to_values( string ): return eval( string ) def non_empty_line( ln ): return ( ln.strip() != "" ) def parse_tree_to_cpp( parse_tree_in_fl, cpp_out_fl ): env = EeyEnvironmen...
Python
0
@@ -1,8 +1,35 @@ +from itertools import imap%0A %0Aimport @@ -120,16 +120,74 @@ ronment%0A +from functionvalues import *%0Afrom languagevalues import *%0A from val @@ -263,24 +263,120 @@ ( string )%0A%0A +def remove_comments( ln ):%0A%09i = ln.find( %22#%22 )%0A%09if i != -1:%0A%09%09return ln%5B:i%5D%0A%09else:%0...
7d09f713b929f60cd62ce48de2e2a8f27aa4de45
Fix unit tests.
Orange/tests/test_random_forest.py
Orange/tests/test_random_forest.py
import unittest import Orange.data import Orange.classification.random_forest as rf from Orange.evaluation import scoring, testing class RandomForestTest(unittest.TestCase): def test_RandomForest(self): table = Orange.data.Table('titanic') forest = rf.RandomForestLearner() results = testi...
Python
0
@@ -230,39 +230,36 @@ nge.data.Table(' -titanic +iris ')%0A fores @@ -334,22 +334,16 @@ on(table -%5B::20%5D , %5Bfores @@ -422,9 +422,9 @@ , 0. -7 +9 )%0A @@ -452,16 +452,17 @@ (ca, 0.9 +9 )%0A%0A d @@ -527,39 +527,36 @@ nge.data.Table(' -titanic +iris ')%0A fores @@ -634,22 +634,16 @@ in...
7041d2649b08d961cf5c7c4c663282e55526f2eb
Update pictures.py
cogs/pictures.py
cogs/pictures.py
from discord.ext import commands import copy import requests class Pic: """Мемасики и просто картинки.""" def __init__(self, bot): self.bot = bot self.pic_dir = 'pictures/' self.pic_dict = {} self.update_pics() def update_pics(self): file_list...
Python
0
@@ -707,19 +707,20 @@ -url +file = self. @@ -734,19 +734,16 @@ opy. -direct_link +get_file (sel @@ -793,143 +793,8 @@ %5D)%0D%0A - r = requests.get(url, stream=True)%0D%0A if r.status_code == 200:%0D%0A r.raw.decode_content = True%0D%0A @@ -827,13 +827,12 @@...
25f3da8409a6fe31eded302cd14a78b575ff2399
Please lxml
cogs/saucenao.py
cogs/saucenao.py
from discord.ext import commands from discord.ext.commands import Cog from lxml import etree from bot import BeattieBot from context import BContext class SauceNao(Cog): sauce_url = "https://saucenao.com/search.php" def __init__(self, bot: BeattieBot): self.session = bot.session self.parser ...
Python
0.998141
@@ -1180,23 +1180,28 @@ if +len( results +) :%0A
ddc0180e46588290ec53450ebff0a2cdf2adfeb4
rename the modrole command to setmodrole
cogs/settings.py
cogs/settings.py
import asyncio from discord.ext import commands import discord from db.dbase import DBase from cogs.utils.messages import MessageManager from cogs.utils.format import format_role_name class Settings: def __init__(self, bot): self.bot = bot @commands.command() @commands.guild_only() @comma...
Python
0.00001
@@ -1376,24 +1376,27 @@ async def +set modrole(self
719c8d37824a890ec0044b5a83a750e9dfa56329
Use 'get_tags_for_user' wherever possible
contacts/views/contact_views.py
contacts/views/contact_views.py
from django.contrib import messages from django.core.urlresolvers import reverse from django.shortcuts import ( get_object_or_404, ) from django.views.generic import ( CreateView, DeleteView, ListView, UpdateView, FormView, ) from django.utils import timezone from contacts.models import ( C...
Python
0.00002
@@ -808,37 +808,26 @@ cts. -filter(book__bookowne +get_tags_fo r_ -_ user -= +( self
8a0e231dcf1cd16a0075cca6c78a7996144eb6d2
Include the Python version in the platform-specific build directories: with the recent change in 'get_platform()', we now have directory names like "build/lib-1.5-linux-i586". Idea and original patch by Rene Liebscher.
command/build.py
command/build.py
"""distutils.command.build Implements the Distutils 'build' command.""" # created 1999/03/08, Greg Ward __revision__ = "$Id$" import sys, os from distutils.core import Command from distutils.util import get_platform def show_compilers (): from distutils.ccompiler import show_compilers show_compilers() c...
Python
0
@@ -2024,16 +2024,77 @@ orm ()%0A%0A + plat_specifier = sys.version%5B0:3%5D + '-' + self.plat%0A%0A @@ -2547,30 +2547,35 @@ 'lib -. +- ' + -self.plat +plat_specifier )%0A%0A @@ -3219,22 +3219,27 @@ temp -. +- ' + -self.plat +plat_specifier )%0A
d2abcb071d4c7035c1bf6818f89c2514be04c1d8
fix typo
test/test_main.py
test/test_main.py
from unittest.mock import patch, mock_open, MagicMock import asyncio import asynctest import discord import random import unittest import src.main class TestMain(unittest.TestCase): @patch('src.main.main') def test__init_calls_main_once(self, mock_main): with patch.object(src.main, '__name__', '__main...
Python
0.999991
@@ -1895,16 +1895,17 @@ d_respon +d s_with_h
a6a78260b47f3a632564e7a80ce25b3b75e242e9
Add sample code for API key authentication
examples/authentication.py
examples/authentication.py
'''A basic example of authentication requests within a hug API''' import hug # Several authenticators are included in hug/authentication.py. These functions # accept a verify_user function, which can be either an included function (such # as the basic username/bassword function demonstrated below), or logic of your # ...
Python
0
@@ -659,16 +659,96 @@ ord'))%0A%0A +@hug.get('/public')%0Adef public_api_call():%0A return %22Needs no authentication%22%0A %0A# Note @@ -1028,24 +1028,35 @@ on)%0Adef +basic_auth_ api_call 1(user: @@ -1047,17 +1047,16 @@ api_call -1 (user: h @@ -1087,17 +1087,17 @@ return -%22 +' Successf @@ -1133,95 ...
73fc80dd8ece1f5ecb1fb529412cd97a804ffccd
Test fetch_emails_from_wiki command
remo/profiles/tests/test_commands.py
remo/profiles/tests/test_commands.py
import os import tempfile from django.conf import settings from django.core import management, mail from django.contrib.auth.models import User from nose.tools import eq_ from test_utils import TestCase class CreateUserTest(TestCase): """ Create tests for create_user management command """ def setUp...
Python
0.000004
@@ -18,16 +18,58 @@ tempfile +%0Aimport json%0A%0Aimport requests%0Aimport fudge %0A%0Afrom d @@ -206,16 +206,24 @@ port eq_ +, raises %0Afrom te @@ -297,16 +297,9 @@ -Create t +T ests @@ -1834,32 +1834,32 @@ tearDown(self):%0A - os.unlin @@ -1881,8 +1881,2202 @@ e.name)%0A +%0A%0Aclass FetchEmail...
5d8929986d278d97e33d425ae10bee0d29631886
Encode the hostname to a str
mopidy/frontends/http/__init__.py
mopidy/frontends/http/__init__.py
from __future__ import absolute_import import logging import pykka from mopidy import exceptions, settings try: import cherrypy except ImportError as import_error: raise exceptions.OptionalDependencyError(import_error) logger = logging.getLogger('mopidy.frontends.http') class HttpFrontend(pykka.Threadin...
Python
0.999999
@@ -488,16 +488,32 @@ t_host': +%0A setting @@ -534,16 +534,32 @@ HOSTNAME +.encode('utf-8') ,%0A
6e660da290db674eebb0c353662e5400bc735397
Update backplane demo to be py3 only
examples/backplane_demo.py
examples/backplane_demo.py
#!/usr/bin/python import time from guild.actor import * from guild.components import Backplane, PublishTo, SubscribeTo, Printer class Producer(Actor): @process_method def process(self): self.output("hello") @late_bind_safe def output(self, value): pass Backplane("HELLO").start() p...
Python
0
@@ -416,17 +416,17 @@ )%0A%0Aprint - +( %22pub%22, p @@ -449,16 +449,17 @@ ub.input +) %0A%0Apipeli
78130574a38db3a79f7c669a62bf3b372db39967
add the capability to receive absolute and relative paths
msg/tools/uorb_rtps_classifier.py
msg/tools/uorb_rtps_classifier.py
#!/usr/bin/env python ################################################################################ # # Copyright 2018 PX4 Pro Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: #...
Python
0
@@ -5089,29 +5089,26 @@ ()%0A%0A msg_ -folde +di r = args.msg @@ -5148,29 +5148,26 @@ msg_ -folde +di r = os.path. @@ -5226,69 +5226,61 @@ -if args.yaml_file != 'tools/uorb_rtps_message_ids.yaml':%0A +else:%0A msg_dir = os.path.abspath(args.msgdir)%0A @@ -5284,32 +5284,33 @@ cl...
33354b12b16e5fab8db7fd7fa1d0defdb6e65a4e
update query to remove prefix
examples/flask-echo/app.py
examples/flask-echo/app.py
# -*- coding: utf-8 -*- # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
Python
0
@@ -3013,16 +3013,17 @@ y):%0A +# query = @@ -4706,24 +4706,20 @@ -imagemap +text _message @@ -4721,24 +4721,20 @@ ssage = -Imagemap +Text SendMess @@ -4741,736 +4741,52 @@ age( -%0A base_url='https://cdn.sstatic.net/Sites/stackoverflow/company/img/logos/so/so-icon.png?v=c78bd457575a',%...
0b37c0f1cba1a6e89a63f9597d61383b81b1a2d9
Fix typo
haas/client/network.py
haas/client/network.py
import json from haas.client.base import ClientBase class Network(ClientBase): """Consists of calls to query and manipulate network related objects and relations. """ def list(self): """Lists all projects under HIL """ url = self.object_url('networks') ...
Python
0.999999
@@ -237,23 +237,23 @@ sts all -project +network s under
19d8443eb3e1e45225e8dc2648b5d72d2c75548d
Fix underlining
clowder/model/clowder_yaml.py
clowder/model/clowder_yaml.py
"""clowder.yaml parsing and functionality""" import os, subprocess from termcolor import colored import yaml from clowder.utility.git_utilities import git_litter, git_validate_repo_state from clowder.utility.print_utilities import print_group, print_project_status from clowder.model.group import Group from clowder.mode...
Python
0.000419
@@ -2077,17 +2077,16 @@ command: - ', attrs @@ -2213,16 +2213,22 @@ output + + ' ' + command
a655372275026e23327ef8f3bf3136779f9c74d1
fix test to account for last_refresh in site dicts
test/usgs_test.py
test/usgs_test.py
import datetime import os import isodate import tables import pytest import pyhis TEST_FILE_PATH = '/tmp/pyhis_test.h5' def test_init(): _remove_test_file() assert not os.path.exists(TEST_FILE_PATH) pyhis.usgs.pytables.init_h5(TEST_FILE_PATH) assert os.path.exists(TEST_FILE_PATH) def test_parse_...
Python
0
@@ -1352,17 +1352,17 @@ te) == 1 -0 +1 %0A%0A%0Adef t
49da9cb5b9c39baf153d71047536a3c3a2789a24
Add user profile and authentication backend settings
Rynda/settings.py
Rynda/settings.py
# Django settings for Rynda project. import os SITE_ROOT = os.path.realpath(os.path.dirname(os.path.dirname(__file__))) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add '...
Python
0
@@ -4732,16 +4732,106 @@ cs',%0A)%0A%0A +AUTHENTICATION_BACKENDS = ('core.backends.IonAuth',)%0AAUTH_PROFILE_MODULE = 'users.users'%0A%0A # A samp
56f6339401fe5f792915279d98f553f3415e2c62
Fix module docstring (#163)
netdisco/discoverables/harmony.py
netdisco/discoverables/harmony.py
"""Discover Netgear routers.""" from . import SSDPDiscoverable class Discoverable(SSDPDiscoverable): """Add support for discovering Harmony Hub remotes""" def get_entries(self): """Get all the Harmony uPnP entries.""" return self.find_by_device_description({ "manufacturer": "Logit...
Python
0
@@ -9,22 +9,26 @@ ver -Netgear rou +Harmony Hub remo te -r s.%22%22
d5e909f6f9158ee3d5546c55e10a772c8952adf4
Update bounty.py
common/bounty.py
common/bounty.py
import os, pickle, re from common.safeprint import safeprint from multiprocessing import Lock bountyList = [] bountyLock = Lock() class Bounty: ip = "" btc = "" reward = 0 data = [] def __init__(self, ipAddress, btcAddress, rewardAmount, dataList=[]): self.ip = ipAddress self.btc = btcAddress ...
Python
0.000001
@@ -3086,17 +3086,17 @@ y = boun -d +t y.encode
b5c5f9f0e97c9273c18936ea57ad866b4865fc68
Revert 47344b
install/build.py
install/build.py
import distutils import os import shutil import subprocess import tempfile import setuptools from install import utils minimum_cuda_version = 6050 minimum_cudnn_version = 2000 def check_cuda_version(compiler, settings): out = build_and_run(compiler, ''' #include <cuda.h> #include <stdio.h> int mai...
Python
0.000001
@@ -1899,32 +1899,104 @@ e%0A%0A try:%0A + postargs = %5B'/MANIFEST'%5D if sys.platform == 'win32' else %5B%5D%0A comp @@ -2207,24 +2207,86 @@ library_dirs +,%0A extra_postargs=postargs )%0A ex
9e9bc5223c49bc51dbfd266f5dc89f2874016622
install rpm macros if RPM bin in system. Closes #56
install_meson.py
install_meson.py
#!/usr/bin/env python3 # Copyright 2013-2014 The Meson development team # 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...
Python
0
@@ -3910,43 +3910,22 @@ sts( -os.path.join('/usr', rpmmacros_dir) +'/usr/bin/rpm' ):%0A
d3425693d245c9dfa5350017903fc02a11ecd881
use width/height as percent base for x/y
compiler/lang.py
compiler/lang.py
import re def value_is_trivial(value): if value is None or not isinstance(value, str): return False if value[0] == '(' and value[-1] == ')': value = value[1:-1] if value == 'true' or value == 'false': return True try: float(value) return True except: pass if value[0] == '"' and value[-1] == '"': if...
Python
0.000003
@@ -1918,32 +1918,8 @@ et%0A%0A -%09%09def replace_name(m):%0A%09 %09%09do @@ -1942,17 +1942,25 @@ ('.')%0A%09%09 -%09 +property_ name = t @@ -1968,24 +1968,18 @@ rget -.substr( +%5B dot + 1 -) +:%5D if @@ -2005,20 +2005,116 @@ t%0A%09%09 -%09return name +if property_name == 'x':%0A%09%09%09property_name = 'w...
08d11dc308db007750fe06ea906264a6ab9f44cd
Add logging when cloning repository
instance/repo.py
instance/repo.py
# -*- coding: utf-8 -*- # # OpenCraft -- tools to aid developing and hosting free software projects # Copyright (C) 2015 OpenCraft <xavier@opencraft.com> # # 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 Soft...
Python
0.000001
@@ -1012,16 +1012,151 @@ nager%0A%0A%0A +# Logging #####################################################################%0A%0Aimport logging%0Alogger = logging.getLogger(__name__)%0A%0A%0A # Functi @@ -1472,16 +1472,106 @@ dtemp()%0A + logger.info('Cloning repository %25s (ref=%25s) in %25s...', repo_url, ref, re...
a96d22974a160edcceda657522ffab8e61b18dd8
Fix for older python
chainer/functions/noise/dropconnect.py
chainer/functions/noise/dropconnect.py
import numpy import chainer from chainer import cuda from chainer import function from chainer.utils import type_check def _as_mat(x): if x.ndim == 2: return x return x.reshape(len(x), -1) class Dropconnect(function.Function): """Linear unit regularized by dropconnect.""" def __init__(sel...
Python
0.000006
@@ -1206,17 +1206,16 @@ ape%5B0%5D, -* inputs%5B1 @@ -1217,24 +1217,69 @@ uts%5B1%5D.shape +%5B0%5D,%0A inputs%5B1%5D.shape%5B1%5D )%0A if @@ -3961,72 +3961,8 @@ io.%0A - If %60%60mask%60%60 is not %60%60None%60%60, this value is ignored.%0A
a2a4a8e4636051fa84a5cfbaf7f4ff796c59171a
Add build.parent to api response
changes/api/serializer/models/build.py
changes/api/serializer/models/build.py
from changes.api.serializer import Serializer, register from changes.constants import Result, Status from changes.models.build import Build @register(Build) class BuildSerializer(Serializer): def serialize(self, instance): # TODO(dcramer): this shouldnt be calculated at runtime last_5_builds = lis...
Python
0.000001
@@ -1005,32 +1005,254 @@ xternal = None%0A%0A + if instance.parent_id:%0A parent = %7B%0A 'id': instance.parent_id.hex,%0A 'link': '/builds/%25s/' %25 (instance.parent_id.hex,),%0A %7D%0A else:%0A parent = None%0A%0A return %7B @@ -1...
5a0edac271645f17e6989020aac77e65f29f0749
Fix typo.
webpy_helpers.py
webpy_helpers.py
''' web.py Custom HTTP Error Response Helpers Helper classes extending web.py's HTTPError class to set custom error response bodies and headers, including JSON bodies and headers appropriate for use in JSON based APIs. ''' import web try: import simplejson as json except ImportError: import json #### Util functi...
Python
0.001604
@@ -339,16 +339,17 @@ o conver +t HTML er
74cf1930f5c5df03f7d30657eb41ae0c2fc74f8e
Change Indent level
SentenceParser.py
SentenceParser.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import pandas as pd import os.path import logging from sklearn.feature_extraction.text import CountVectorizer from nltk.corpus import stopwords from bs4 import BeautifulSoup import sys default_stdout = sys.stdout default_stderr = sys.stderr reload(sys)...
Python
0.000002
@@ -3028,17 +3028,20 @@ -%09 + if reset @@ -3053,33 +3053,36 @@ x:%0D%0A -%09 + result%5Brow%5D = se @@ -3180,9 +3180,12 @@ + -%09 + resu @@ -3331,32 +3331,106 @@ e', length=50)%0D%0A + print %22%5CnThe Shape of %22+ row + %22 is %22+str(result%5Brow%5D.shape)%0D%...
39154c1c5dcb192079060083ecc0a97e776cee3d
Fix bug in redirect
website/views.py
website/views.py
import bcrypt from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth import authenticate, login from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AuthenticationForm, UserCreationForm from django.contrib.auth.models i...
Python
0
@@ -1365,24 +1365,146 @@ (req, user)%0A + next_page = req.POST.get(%22next%22)%0A if next_page is not None and next_page != %22%22:%0A return redirect(next_page)%0A return r
540dedd3f64687aeedd57280408e452da4034ace
remove unused import.
website/views.py
website/views.py
from django.shortcuts import render from django.http import HttpResponse from django.contrib.auth.decorators import login_required from django.contrib.auth import authenticate, login from django.contrib.auth.models import User from django.views.generic import View from django.db import transaction from django.contrib i...
Python
0
@@ -295,44 +295,8 @@ tion -%0Afrom django.contrib import messages %0A%0Afr
469fc6ff805e845ac922a7334612f67f194eb93b
Fix flake8 errors in late_command script
deployment/puppet/cobbler/templates/scripts/late_command.py
deployment/puppet/cobbler/templates/scripts/late_command.py
#!/usr/bin/python # # Copyright (C) 2011 Mirantis Inc. # # Authors: Vladimir Kozhukalov <vkozhukalov@mirantis.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of t...
Python
0.00004
@@ -732,23 +732,8 @@ s/%3E. -%0A# flake8: noqa %0A%0Afr @@ -820,28 +820,8 @@ ile%0A -import commands, os%0A %0A%0ATE @@ -1412,24 +1412,64 @@ ue):%0A %22%22%22 +Gzip and enconde bas64 provided content%0A %0A This me @@ -2027,32 +2027,32 @@ f.close()%0A - except:%0A @@ -2049,16 +2049,26 @@ ...
2413a2042745a00b5a220a753aa46177065f3793
bump version to 0.0.3
nose_warnings_filters/__init__.py
nose_warnings_filters/__init__.py
""" Nose plugin to add warnings filters (turn them into error) using nose.cfg file. """ __version__ = '0.0.2' from nose.plugins import Plugin import warnings import sys if sys.version_info < (3,): import builtins else: builtins = __builtins__ class WarningFilter(Plugin): def options(self, parser, en...
Python
0.000001
@@ -103,17 +103,17 @@ = '0.0. -2 +3 '%0A%0A%0Afrom
f8685d8ca3d4d18ca5895d765185993ed2d5bcd7
Fix citizen subscription to report : DatabaseError: current transaction is aborted, commands ignored until end of transaction block
django_fixmystreet/fixmystreet/views/reports/subscribers.py
django_fixmystreet/fixmystreet/views/reports/subscribers.py
from django.shortcuts import get_object_or_404 from django.http import HttpResponseRedirect from django.utils.translation import ugettext as _ from django.contrib import messages from django.db import IntegrityError from django_fixmystreet.fixmystreet.models import FMSUser from django_fixmystreet.fixmystreet.models ...
Python
0.000001
@@ -955,35 +955,113 @@ READY EXIST%0A -try +if not ReportSubscription.objects.filter(subscriber=user, report=report).exists() :%0A subscr @@ -1148,215 +1148,9 @@ e()%0A - messages.add_message(request, messages.SUCCESS, _(%22You have subscribed from updates successfully%22))%0A except IntegrityEr...
9a87f83c7060b66f7f95f2823db11b5e86a4fd67
fix #210
src/you_get/downloader/dailymotion.py
src/you_get/downloader/dailymotion.py
#!/usr/bin/env python __all__ = ['dailymotion_download'] from ..common import * def dailymotion_download(url, output_dir = '.', merge = True, info_only = False): html = get_html(url) html = parse.unquote(html).replace('\/', '/') title = r1(r'meta property="og:title" content="([^"]+)"', html) tit...
Python
0
@@ -166,187 +166,303 @@ -html = get_html(url)%0A html = parse.unquote(html).replace('%5C/', '/')%0A %0A title = r1(r'meta property=%22og:title%22 content=%22(%5B%5E%22%5D+)%22', html)%0A title = escape_file_path( +%22%22%22Downloads Dailymotion videos by URL.%0A %22%22%22%0A %0A id = match1(u...