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 |
|---|---|---|---|---|---|---|---|
d2d44a0bd1d144a3497e857e368deab7b7833b2f | Fix lint issue | tests/test_manifest.py | tests/test_manifest.py | # Copyright 2017 Jon Wayne Parrott
#
# 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.000002 | @@ -5376,24 +5376,25 @@
pass%0A
+%0A
def noti
|
3cc7e0cebc8a7a7410ce6b239e55db0cf55b1dc8 | Fix broken tests in test_messages | tests/test_messages.py | tests/test_messages.py | from datetime import date
import unittest
from mock import patch
from six import u
from twilio.rest.resources import Messages
DEFAULT = {
'From': None,
'DateSent<': None,
'DateSent>': None,
'DateSent': None,
}
class MessageTest(unittest.TestCase):
def setUp(self):
self.resource = Messa... | Python | 0.000648 | @@ -1476,17 +1476,17 @@
'
-f
+F
rom': '+
@@ -1972,24 +1972,28 @@
called_with(
+sid=
'MM123', %7B'B
@@ -1989,16 +1989,21 @@
MM123',
+body=
%7B'Body':
|
92af628970486f18ea5a01fe0293ac6a88607928 | update mismatch test because of sensorsy bug fix. | tests/test_mismatch.py | tests/test_mismatch.py | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 27 10:08:25 2018
@author: cdeline
Using pytest to create unit tests for mismatch.py.
to run unit tests, run pytest from the command line in the bifacial_radiance directory
to run coverage tests, run py.test --cov-report term-missing --cov=bifacial_radiance
"""
import ... | Python | 0 | @@ -2291,27 +2291,8 @@
t')%0A
- bififactor = 1%0A
@@ -2629,11 +2629,11 @@
x(0.
-410
+376
, ab
@@ -2700,13 +2700,13 @@
rox(
-2.135
+1.987
, ab
|
f6ecf6a45e2749261a20869aca5dfca6d7c03494 | Correct method doc. | qiprofile_rest_client/helpers/database.py | qiprofile_rest_client/helpers/database.py | """Mongo Engine interaction utilities."""
def get_or_create(klass, pk, **non_pk):
"""
This function stands in for the Mongo Engine ``get_or_create``
collection method which was deprecated in mongoengine v0.8.0
and dropped in mongoengine v0.10.0, since MongoDB does not
support transactions.
... | Python | 0 | @@ -65,18 +65,24 @@
ss,
-p
k
+ey=None
, **non_
pk):
@@ -77,18 +77,19 @@
, **non_
-p
k
+ey
):%0A %22
@@ -1314,29 +1314,57 @@
to
-use
+call
%0A
-call *update*
+the data model class *update_one* method
rat
@@ -1450,23 +1450,32 @@
ram
-p
k
+ey
: the
-primary
+secondary field
key
@@ -1485,32 +148... |
c2df896183f80fe3ca0eab259874bc4385d399e9 | Clean up detrius in parallel test file | tests/test_parallel.py | tests/test_parallel.py | from __future__ import with_statement
from datetime import datetime
import copy
import getpass
import sys
import paramiko
from nose.tools import with_setup
from fudge import (Fake, clear_calls, clear_expectations, patch_object, verify,
with_patched_object, patched_context, with_fakes)
from fabric.context_manager... | Python | 0 | @@ -41,670 +41,85 @@
rom
-datetime import datetime%0Aimport copy%0Aimport getpass%0Aimport sys%0A%0Aimport paramiko%0Afrom nose.tools import with_setup%0Afrom fudge import (Fake, clear_calls, clear_expectations, patch_object, verify,%0A with_patched_object, patched_context, with_fakes)%0A%0Afrom fabric.context_man... |
8f86eacf1b85a0c497f9e8586a59cc19e6a0484f | Stop passing a recorder argument unecessarily in tests | tests/test_pipeline.py | tests/test_pipeline.py | from __future__ import print_function
import pytest
from plumbium.processresult import record, pipeline, call
class DummyRecorder(object):
def write(self, results):
self.results = results
@pytest.fixture
def simple_pipeline():
@record('an_output')
def recorded_function():
call(['echo', '... | Python | 0.000002 | @@ -932,43 +932,8 @@
():%0A
- recorder = DummyRecorder()%0A
@@ -985,35 +985,16 @@
(tmpdir)
-, recorder=recorder
)%0A
@@ -1176,43 +1176,8 @@
():%0A
- recorder = DummyRecorder()%0A
@@ -1234,27 +1234,8 @@
dir)
-, recorder=recorder
)%0A
|
7b75f508bf651bdeb57bdc4d263ced26434054c8 | add pct test | tests/test_pvmodule.py | tests/test_pvmodule.py | """
Tests for pvmodules.
"""
from nose.tools import ok_
from pvmismatch.pvmismatch_lib.pvmodule import PVmodule, TCT96
def test_calc_mod():
pvmod = PVmodule()
ok_(isinstance(pvmod, PVmodule))
return pvmod
def test_calc_TCT_mod():
pvmod = PVmodule(cell_pos=TCT96)
ok_(isinstance(pvmod, PVmodule))... | Python | 0.000014 | @@ -112,16 +112,23 @@
e, TCT96
+, PCT96
%0A%0A%0Adef t
@@ -340,16 +340,134 @@
pvmod%0A%0A%0A
+def test_calc_PCT_mod():%0A pvmod = PVmodule(cell_pos=PCT96)%0A ok_(isinstance(pvmod, PVmodule))%0A return pvmod%0A%0A%0A
if __nam
|
20d1ab60c718869d86deed5410d5aef428042195 | remove unused json import | tests/test_redirect.py | tests/test_redirect.py | import pytest
import json
from urllib.parse import quote
from sanic.response import text, redirect
@pytest.fixture
def redirect_app(app):
@app.route('/redirect_init')
async def redirect_init(request):
return redirect("/redirect_target")
@app.route('/redirect_init_with_301')
async def redire... | Python | 0.000002 | @@ -11,20 +11,8 @@
est%0A
-import json%0A
from
|
9744226621e27d4bd5d19a52b75b718e86bfef87 | Add extra filter for equipment | lims/equipment/views.py | lims/equipment/views.py |
from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework.exceptions import PermissionDenied
import django_filters
from lims.permissions.permissions import IsInAdminGroupOrRO
from .models import Equipment, EquipmentReservation
from .serializers import EquipmentSerializer, ... | Python | 0 | @@ -510,16 +510,26 @@
eserve',
+ 'status',
)%0A se
|
e312e2c61d6ddba147be73e636b26b14aaf49f60 | use django.conf.settings instead of plain settings | lingcod/kmlapp/tests.py | lingcod/kmlapp/tests.py | """
Unit tests for the KML App
"""
import settings
from django.test import TestCase
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.auth.models import *
from lingcod.common import utils
from lingcod.mpa.models import MpaDesignation
Mpa = utils.get_mpa_class()
MpaArray = utils.get_array_class()
u... | Python | 0 | @@ -28,16 +28,33 @@
App%0A%22%22%22%0A
+from django.conf
import s
|
368d46ba4bec2da22abfba306badf39a3a552e88 | Remove now-unused imports | tests/test_snippets.py | tests/test_snippets.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import json
import re
from xml.dom.minidom import parseString
from xml.parsers.expat import ExpatError
import pytest
im... | Python | 0 | @@ -197,30 +197,8 @@
/.%0A%0A
-import json%0Aimport re%0A
from
|
142ef9b907868f53c696bd4426a7f08b7ef57528 | Change metatdata test | tests/test_tifffile.py | tests/test_tifffile.py | """ Test tifffile plugin functionality.
"""
import os
import numpy as np
from pytest import raises
from imageio.testing import run_tests_if_main, get_test_dir, need_internet
from imageio.core import get_remote_file
import imageio
test_dir = get_test_dir()
def test_tifffile_format():
# Test selection
for ... | Python | 0 | @@ -1634,45 +1634,48 @@
-print(meta)%0A assert meta%5B'is_rgb'%5D
+assert meta%5B'orientation'%5D == 'top_left'
%0A
|
8d09e745f24e663cb81ff5be6bc7b643c6c5bd76 | call it pennyblack 0.3.0 | pennyblack/__init__.py | pennyblack/__init__.py | VERSION = (0, 3, 0, 'pre')
__version__ = '.'.join(map(str, VERSION))
# Do not use Django settings at module level as recommended
try:
from django.utils.functional import LazyObject
except ImportError:
pass
else:
class LazySettings(LazyObject):
def _setup(self):
from pennyblack import de... | Python | 0.999594 | @@ -16,14 +16,8 @@
, 0,
- 'pre'
)%0A__
|
57d5622d205854eafd8babf8dfa1ad45bf05ebcb | Update ipc_lista1.15.py | lista1/ipc_lista1.15.py | lista1/ipc_lista1.15.py | #ipc_lista1.15
#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, sabendo-se que são descontados 11% para o Imposto de Renda, 8% para o INSS e 5% ... | Python | 0 | @@ -874,17 +874,17 @@
(8/100.0
-m
+
* SalBru
|
b37432e914b6c6e45803a928f35fbaa8964780aa | test by uuid | tests/unit/test_log.py | tests/unit/test_log.py | import pytest
from raft import log
def mle(index, term, committed=False, msgid='', msg={}):
return dict(index=index, term=term, committed=committed,
msgid=msgid, msg=msg)
def test_le():
# a's term is greater than b's
a = {1: mle(1, 2),
2: mle(2, 2),
3: mle(3, 4)}
b =... | Python | 0.000001 | @@ -1396,8 +1396,188 @@
(2, 6)%0A
+%0Adef test_has_uuid():%0A rl = log.RaftLog(None)%0A le = log.logentry(2, 'abcd', %7B%7D)%0A rl.add(le)%0A assert rl.has_uuid('abcd') == True%0A assert rl.has_uuid('dcba') == False%0A
|
62d5a4446c4c0a919557dd5f2e95d21c5a8259a8 | Test the optimized set | tests/unit/test_set.py | tests/unit/test_set.py | from pypred import PredicateSet, Predicate
class TestPredicateSet(object):
def test_two(self):
p1 = Predicate("name is 'Jack'")
p2 = Predicate("name is 'Jill'")
s = PredicateSet([p1, p2])
match = s.evaluate({'name': 'Jill'})
assert match == [p2]
def test_dup(self):
... | Python | 0.000043 | @@ -1,8 +1,22 @@
+import pytest%0A
from pyp
@@ -25,16 +25,39 @@
d import
+ OptimizedPredicateSet,
Predica
@@ -459,32 +459,32 @@
name': 'Jill'%7D)%0A
-
assert m
@@ -497,8 +497,1244 @@
= %5Bp1%5D%0A%0A
+class TestOptPredicateSet(object):%0A def test_two(self):%0A p1 = Predicate(%22name is 'Jack'%... |
eb4a0ea5542e894e7d9519b5b03212122d26d220 | Version Bump | littlepython/version.py | littlepython/version.py | version = '0.4.3'
| Python | 0.000001 | @@ -12,7 +12,7 @@
0.4.
-3
+4
'%0A
|
cae0764f2cbb8d00de1832079e55b8e4d45f55f2 | Fix for short OTU name when there is a species but no genus or higher | phylotoast/otu_calc.py | phylotoast/otu_calc.py | from __future__ import division
import ast
from collections import defaultdict
from phylotoast import biom_calc as bc
def otu_name(tax):
"""
Determine a simple Genus-species identifier for an OTU, if possible.
If OTU is not identified to the species level, name it as
Unclassified (familly/genus/etc...... | Python | 0.00004 | @@ -918,16 +918,101 @@
else:%0A
+ if spname != %22spp.%22:%0A return spname%0A else:%0A
|
7c4d3fffe62190b8c27317ed83bd5e7110b103ec | Update parser.py | MusicXMLParser/parser.py | MusicXMLParser/parser.py | '''
Takes a musicXML file, and creates a file that can be played by my MusicPlayer arduino library.
Written by Eivind Lie Andreassen, 2016
Licensed under Creative Commons Attribution-ShareAlike 4.0 International. http://creativecommons.org/licenses/by-sa/4.0/
'''
import xml.dom.minidom
import valueHelper
xml... | Python | 0.000001 | @@ -144,9 +144,12 @@
016%0A
-%09
+
Lice
@@ -163,113 +163,24 @@
der
-Creative Commons Attribution-ShareAlike 4.0 International. http://creativecommons.org/licenses/by-sa/4.0/
+the MIT license.
%0A'''
@@ -2148,8 +2148,9 @@
(output)
+%0A
|
83b83cb3491bd4ccf39e2c6ade72f8f526ea27fe | Increase toolbox reporting | ArcToolbox/Scripts/ExportFolder2PDF.py | ArcToolbox/Scripts/ExportFolder2PDF.py | #Export a folder of maps to PDFs at their Map Document set sizes
#Written using ArcGIS 10 and Python 2.6.5
#by: Guest
# https://gis.stackexchange.com/questions/7147/how-to-batch-export-mxd-to-pdf-files
import arcpy, os
#Read input parameter from user.
path = arcpy.GetParameterAsText(0)
#Write MXD names in folder to ... | Python | 0 | @@ -678,21 +678,44 @@
-print
+arcpy.AddMessage('Found: ' +
fileNam
@@ -719,15 +719,9 @@
Name
- + %22%5Cn%22
+)
%0Adel
@@ -729,20 +729,32 @@
mxd%0A
-print
+arcpy.AddMessage(
%22Done%22
+)
%0Awri
@@ -1511,21 +1511,35 @@
-print
+# arcpy.AddMessage(
%22Basena
@@ -1551,16 +1551,18 @@
+newName
... |
f5a3d65d56a1746fac3bd42d38537cca359a968c | improve range-only command detection | ex_command_parser.py | ex_command_parser.py | """a simple 'parser' for :ex commands
"""
from collections import namedtuple
import re
# holds info about an ex command
EX_CMD = namedtuple('ex_command', 'name command forced range args')
EX_RANGE_REGEXP = re.compile(r'^(:?([.$%]|(:?/.*?/|\?.*?\?){1,2}|\d+)([-+]\d+)?)(([,;])(:?([.$]|(:?/.*?/|\?.*?\?){1,2}|\d+)([-+]... | Python | 0.000001 | @@ -1490,24 +1490,37 @@
(cmd_line):%0A
+ try:%0A
return E
@@ -1578,16 +1578,20 @@
+
EX_RANGE
@@ -1642,16 +1642,96 @@
d_line)%0A
+ except AttributeError:%0A return EX_ONLY_RANGE_REGEXP.search(cmd_line)%0A
%0A%0Adef ge
|
b614436766e8ee3316936c5718262b35cfae3869 | Add slug field on save | memex_explorer/base/models.py | memex_explorer/base/models.py | from django.db import models
class Project(models.Model):
name = models.CharField(max_length=64)
slug = models.SlugField(max_length=64, unique=True)
description = models.TextField()
icon = models.CharField(max_length=64)
def __str__(self):
return self.name
class DataModel(models.Model):... | Python | 0.000001 | @@ -23,16 +23,55 @@
models%0A%0A
+from django.utils.text import slugify%0A%0A
%0Aclass P
@@ -313,32 +313,341 @@
turn self.name%0A%0A
+ def save(self, *args, **kwargs):%0A if not self.id:%0A # Newly created object, so save to get self.id%0A super(Project, self).save(*args, **kwargs)%0A... |
047db1c64cd5b7ef070f73e1d580e36236ac9613 | Print warning when using deprecated 'python3' module | mesonbuild/modules/python3.py | mesonbuild/modules/python3.py | # Copyright 2016-2017 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 applicable law or agree... | Python | 0.000007 | @@ -776,16 +776,35 @@
edKwargs
+, FeatureDeprecated
%0Afrom ..
@@ -875,16 +875,67 @@
odule):%0A
+ @FeatureDeprecated('python3 module', '0.48.0')%0A
def
|
b7ca5d4a78bd988863aa0c292144bb5968eeb9c8 | Add --allow_other_files to review command | mesonwrap/tools/reviewtool.py | mesonwrap/tools/reviewtool.py | # Copyright 2015 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 applicable law or agreed to ... | Python | 0 | @@ -1335,16 +1335,51 @@
pull_id)
+%0A self.strict_fileset = True
%0A%0A de
@@ -3992,24 +3992,64 @@
not found):%0A
+ if self.strict_fileset:%0A
@@ -6799,16 +6799,84 @@
pe=int)%0A
+ parser.add_argument('--allow_other_files', action='store_true')%0A
args
@@ -6949,16 +6949... |
db931b67874d7dbba2aebf64e90f29b39555a529 | Add lizard-security again (I pruned too much) | ddsc_worker/settings.py | ddsc_worker/settings.py | # Base Django settings, suitable for production.
# Imported (and partly overridden) by developmentsettings.py which also
# imports localsettings.py (which isn't stored in svn). Buildout takes care
# of using the correct one.
# So: "DEBUG = TRUE" goes into developmentsettings.py and per-developer
# database ports go in... | Python | 0 | @@ -5219,17 +5219,17 @@
,%0A #%0A
-#
+
'liza
|
18c83c53263b3b70225fc657f064bd6d13e73881 | use iterator in csv dump | cla_backend/apps/cla_butler/qs_to_file.py | cla_backend/apps/cla_butler/qs_to_file.py | # -*- coding: utf-8 -*-
import csv
from datetime import datetime
import json
import os
import re
import time
from django.db import IntegrityError
from django.db.models import ForeignKey
from django.core import serializers
from django.core.serializers.json import DjangoJSONEncoder
from django.utils.dateparse import par... | Python | 0.000001 | @@ -2078,16 +2078,27 @@
ce in qs
+.iterator()
:%0A
|
1018d6bde32a8d18a2315dafd084826443209ba1 | Update clock.py | examples/clock.py | examples/clock.py | #!/usr/bin/python
import time
import datetime
from Adafruit_LED_Backpack import SevenSegment
# ===========================================================================
# Clock Example
# ===========================================================================
segment = SevenSegment.SevenSegment(address=0x70)
#... | Python | 0.000002 | @@ -628,16 +628,34 @@
hour %3C 7
+ and minutes == 26
:%0A se
|
37da8a56f127a871c4133f0ba58921779e9b487c | Update __init__.py | deepdish/io/__init__.py | deepdish/io/__init__.py | from __future__ import division, print_function, absolute_import
from .mnist import load_mnist
from .norb import load_small_norb
from .casia import load_casia
from .cifar import load_cifar_10
try:
import tables
_pytables_ok = True
except ImportError:
_pytables_ok = False
del tables
if _pytables_ok:
fr... | Python | 0 | @@ -233,16 +233,31 @@
= True%0A
+ del tables%0A
except I
@@ -296,19 +296,8 @@
alse
-%0Adel tables
%0A%0Aif
|
08d6784b452d729d7cecc3865212b0046d43301d | Allow limit to be passed to tasks API | deferred_manager/api.py | deferred_manager/api.py | import datetime
import json
import webapp2
from operator import itemgetter
from google.appengine.ext import db
from google.appengine.api.logservice import logservice
from .models import TaskState, QueueState
def _serializer(obj):
if isinstance(obj, datetime.datetime):
return obj.isoformat()
if hasa... | Python | 0 | @@ -1107,13 +1107,49 @@
mit=
+int(self.request.GET.get('limit',
1000)
+))
%0A%0A
@@ -2400,20 +2400,16 @@
eue_name
-
%0A
|
0d914a4843e5959c108077e8c5275a1ddd05f617 | Upgrade version number | djaloha/__init__.py | djaloha/__init__.py | # -*- coding: utf-8 -*-
VERSION = (0, 1)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
# if VERSION[2]:
# version = '%s.%s' % (version, VERSION[2])
# if VERSION[3] != "final":
# version = '%s%s%s' % (version, VERSION[3], VERSION[4])
return version
__version__ = get_versi... | Python | 0.000001 | @@ -32,17 +32,17 @@
N = (0,
-1
+2
)%0A%0Adef g
|
0f5433458be9add6a879e8e490017663714d7664 | fix cron job FailedRunsNotificationCronJob to import get_class routine from new place | django_cron/cron.py | django_cron/cron.py | from django.conf import settings
from django_cron import CronJobBase, Schedule
from django_cron.models import CronJobLog
from django_cron.management.commands.runcrons import get_class
from django_common.helper import send_mail
class FailedRunsNotificationCronJob(CronJobBase):
"""
Send email if cron faile... | Python | 0 | @@ -71,16 +71,27 @@
Schedule
+, get_class
%0Afrom dj
@@ -128,71 +128,8 @@
bLog
-%0Afrom django_cron.management.commands.runcrons import get_class
%0A%0Afr
|
57184440872c8c29906c84a919624e7878f7d75c | fix compat | skitai/backbone/https_server.py | skitai/backbone/https_server.py | #!/usr/bin/env python
from . import http_server
from ..counter import counter
import socket, time
from rs4 import asyncore
import ssl
from skitai import lifetime
import os, sys, errno
import skitai
from errno import EWOULDBLOCK
from aquests.protocols.http2 import H2_PROTOCOLS
from ..handlers import vhost_handler
clas... | Python | 0.000001 | @@ -2157,16 +2157,197 @@
f quic:%0A
+ if sys.version_info.major == 3 and sys.version_info.minor %3C 6:%0A self.log ('unsupoorted Python version for QUIC, DISABLED', 'error')%0A else:%0A
@@ -2377,16 +2377,20 @@
_server%0A
+
@@ -2442,16 +2442,20 @@
RTINF... |
7f3b2b0ab21e4dadffb55da912684eb84ce6da3d | Check if remot git is already on commit | gitric/api.py | gitric/api.py | from __future__ import with_statement
from fabric.state import env
from fabric.api import local, run, abort, task
from fabric.context_managers import settings
@task
def allow_dirty():
'''allow pushing even when the working copy is dirty'''
env.gitric_allow_dirty = True
@task
def force_push():
'''allow p... | Python | 0 | @@ -106,16 +106,26 @@
rt, task
+, cd, puts
%0Afrom fa
@@ -995,24 +995,234 @@
repo_path)%0A
+%0A # finis execution if remote git it's already on commit.%0A with cd(repo_path):%0A if run('git rev-parse HEAD') == commit:%0A puts('Remote already on commit %25s' %25 commit)%0A return%0... |
47e7fcc3b837b459a2800e09ee87c2a6f87cdfba | Update SController.py | skype_controller/SController.py | skype_controller/SController.py | """Import somes important packages"""
import Skype4Py
import config as gbconfig
import json
from common import get_project_path
# Get Skype class instance
SKYPE_OBJ = Skype4Py.Skype()
# Establish the connection from the Skype object to the Skype ddclient.
SKYPE_OBJ.Attach()
# Get all contact from object. This funct... | Python | 0.000001 | @@ -349,16 +349,31 @@
s case%0A%0A
+def get_file():
%0A%0A %22%22
|
8cca0499a6cecdb54a3f51987976c3aa1b9abf70 | Fix spelling | fetch_papers.py | fetch_papers.py | """
Queries arxiv API and downloads papers (the query is a parameter).
The script is intended to enrich an existing database pickle (by default db.p),
so this file will be loaded first, and then new results will be added to it.
"""
import urllib
import time
import feedparser
import os
import cPickle as pickle
import a... | Python | 0.999999 | @@ -4164,25 +4164,24 @@
miting? Exit
-t
ing. Restart
@@ -4357,17 +4357,16 @@
st. Exit
-t
ing.'%0A
|
f21e732eada64a18e08524052ec66ce8705d9e9b | make imagemagick env var default to 'convert' instead of None | glc/config.py | glc/config.py | """
glc.config
==========
At the moment this only houses the environmental variable
for the ImageMagick binary. If you don't want to set that,
or can't for some reason, you can replace ``None`` with the
path where the ``convert`` application that comes with it
lives in.
(c) 2016 LeoV
... | Python | 0.000113 | @@ -202,20 +202,25 @@
place %60%60
-None
+%22convert%22
%60%60 with
@@ -297,16 +297,57 @@
lives in
+, if it doesn't happen to be in your PATH
.%0A%0A (
@@ -466,10 +466,15 @@
Y%22,
-None
+%22convert%22
)%0A
|
88099c8e7386a3594a8528bf338c35eff80c6b1c | Fix typo | fabric/tunnels.py | fabric/tunnels.py | import errno
import select
import socket
import time
from threading import Event, Thread
# TODO: inherit from invoke.util.ExceptionHandlingThread
class Listener(Thread):
def __init__(self,
local_host, local_port,
remote_host, remote_port,
transport, finished
):
super(Listener, ... | Python | 0.999999 | @@ -3993,18 +3993,16 @@
elf.sock
-et
, self.c
|
3904b17a5a5a46d91f26dd384ade75c7f270541a | fix a bug | lib/core/manager.py | lib/core/manager.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import binascii
import json
import copy
from os import walk
from lib.core import log
from lib.core.data import kb
from lib.core.data import conf
from lib.core.common import paths
from lib.core.pluginbase import PluginBase
from lib.controller.controller import start
from li... | Python | 0.000016 | @@ -4533,22 +4533,26 @@
ets%22 in
-option
+str(value)
:%0A
|
699022ad6252ed73ed9e56ea050201020b2295af | add trailing slash to url for consistency | fixcity/urls.py | fixcity/urls.py | from django.conf.urls.defaults import *
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
(r'^$', 'fixcity.bmabr.views.index'),
(r'^about/$', 'fixcity.bmabr.views.about'),
(r'^faq/$',... | Python | 0 | @@ -3448,16 +3448,17 @@
cb1racks
+/
$', 'fix
|
d338dc15c57e3aea12de78354da908b1457c5055 | Clean up command more (#30) | earwigbot/commands/lag.py | earwigbot/commands/lag.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2012 Ben Kurtovic <ben.kurtovic@verizon.net>
#
# 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 limitatio... | Python | 0.000001 | @@ -1398,16 +1398,318 @@
data):%0A
+ site = self.get_site(data)%0A if not site:%0A return%0A%0A msg = %22%5Cx0302%7B0%7D%5Cx0F: Toolserver replag is %7B1%7D seconds; database maxlag is %7B2%7D seconds.%22%0A msg = msg.format(site.name, site.get_replag(), site.get_maxlag())%0A ... |
09a313a2cd74c391c12761306cb8ae641e9f0d28 | fix logs app prompt | ebcli/controllers/logs.py | ebcli/controllers/logs.py | # Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | Python | 0.000001 | @@ -1528,16 +1528,55 @@
(self):%0A
+ app_name = self.get_app_name()%0A
|
d3cd1778f4ccb1651feb2186ecfdd0c81f86088c | Improve Instruction parsing | instruction.py | instruction.py | class Instruction(object):
def __init__(self, line):
instr = line.split(' ')
self.name = instr[0]
self.ops = []
if len(instr) > 4:
raise Exception('too many operands: {}'.format(line))
# iterate through operands, perform some loose checks, and append
# t... | Python | 0.000072 | @@ -339,11 +339,8 @@
for
- i,
eac
@@ -348,18 +348,8 @@
in
-enumerate(
inst
@@ -353,17 +353,16 @@
nstr%5B1:%5D
-)
:%0A
@@ -439,125 +439,62 @@
-if each.startswith('$'):%0A self.ops.append(each%5B1:%5D)%0A else:%0A self.ops.append(
+self.ops.append(each%5B1:%5... |
23c95dcba178b3876bf07bec4b0c4f5c06895181 | add padding to file names | copyfiles.py | copyfiles.py | import hashlib
import os
import random
import shutil
import string
BLOCKSIZE = 65536
class FileCopier(object):
def __init__(self, dest_dir, copy):
self._dest_dir = dest_dir
self._copy = copy
def copy_file(self, in_path, date, subject):
out_dir = self._get_directory_name(date, subject)... | Python | 0.000001 | @@ -1055,15 +1055,19 @@
%25(y)
-s
+04d
-%25(m)
-s
+02d
' %25
@@ -1128,29 +1128,35 @@
= ('%25(y)
-s
+04d
_%25(m)
-s
+02d
_%25(d)
-s
+02d
-%25(subj)
@@ -1422,21 +1422,27 @@
%25(y)
-s
+04d
_%25(m)
-s
+02d
_%25(d)
-s
+02d
-%25(h
|
daa29e745256b164b3375e502444ec247aa0d892 | implement get_default_args for the future repr development | logwrap/func_helpers.py | logwrap/func_helpers.py | # Copyright 2016 Mirantis, Inc.
# Copyright 2016 Alexey Stepanov aka penguinolog
# 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/LICENS... | Python | 0 | @@ -1355,17 +1355,17 @@
%5D %3C (3,
-0
+3
):%0A
@@ -2828,16 +2828,1449 @@
guments%0A
+%0A%0Adef get_default_args(func):%0A %22%22%22Get function defaults from it's signature%0A%0A :param func: target function%0A :type func: function%0A :rtype: collections.OrderedDict%0A%0A %3E%3E%3E def tst0():p... |
d223ee2988be1eb439ebde1146c28ffc83576a29 | Return empty list on exception | fetch_mentions.py | fetch_mentions.py | import time
import requests
import json
import tweepy
from tweepy.error import TweepError
from raven import Client
from settings import consumer_key, consumer_secret, key, secret, count, pubKey, payload_type, SENTRY_DSN,\
overlap_count, waiting_period, speed_layer_endpoint_url, password, timeout, ssl_verification... | Python | 0.999717 | @@ -1995,16 +1995,42 @@
break%0A
+ print msg%0A
@@ -2040,20 +2040,18 @@
return
-None
+%5B%5D
%0A
|
e3dc9028199794498e05e43ed2f40f565e64ffde | Make Vina clean after running | docking/autodock_vina.py | docking/autodock_vina.py | from tempfile import mkdtemp
from shutil import rmtree
from os.path import exists
import subprocess
import numpy as np
import re
import pybel
class autodock_vina:
def __init__(self, protein, size=(10,10,10), center=(0,0,0), auto_ligand=None, exhaustivness=8, num_modes=9, energy_range=3, seed=None, prefix_dir='/tmp... | Python | 0.000002 | @@ -383,58 +383,19 @@
r =
-mkdtemp(dir = prefix_dir, prefix='autodock_vina_')
+prefix_dir,
%0A
@@ -1036,23 +1036,14 @@
-%0A # writ
+# shar
e pr
@@ -1047,28 +1047,29 @@
protein to
-file
+class
%0A sel
@@ -1081,110 +1081,27 @@
tein
-_file = self.dir + '/protein.pdbqt'%0A protein.wri... |
8d0a41391fae5c66c296d5dfacc0ac6f82a6b355 | fix gridsearch path | gridsearch.py | gridsearch.py | import time
import itertools as it
from gensim.models import word2vec
from goethe.corpora import Corpus
model_config = {
'size': [200, 300, 400, 500, 600],
'window': [5, 10, 20],
'sg': [0, 1] # Skip-gram or CBOW
}
sample_size = 10000000
epochs = 10
def train_model(config):
size, window, sg = config
... | Python | 0.000001 | @@ -356,24 +356,8 @@
eval
-/eval.tokens.txt
', l
|
b57e84fc157b7bbe564a7bd8799c06bec5b507eb | Remove unused property and non applicable TODO. | st2reactor/st2reactor/container/manager.py | st2reactor/st2reactor/container/manager.py | # Licensed to the StackStorm, Inc ('StackStorm') 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 "License"); you may not use th... | Python | 0 | @@ -1137,136 +1137,32 @@
t):%0A
- # TODO: Load balancing for sensors.%0A def __init__(self, max_containers=10):%0A self._max_containers = max_containers
+%0A def __init__(self):
%0A
|
f682300d4a8ab7e13ad0e26d2b37fdf24cdbdce9 | Bump development version | filer/__init__.py | filer/__init__.py | # -*- coding: utf-8 -*-
# version string following pep-0396 and pep-0386
__version__ = '1.2.6.rc1' # pragma: nocover
default_app_config = 'filer.apps.FilerConfig'
| Python | 0 | @@ -90,17 +90,17 @@
1.2.6.rc
-1
+2
' # pra
|
05c8dffcbfc08bbfd98d0f6a506af245719b3ac8 | FIX dependency | stock_picking_ean128_report/__openerp__.py | stock_picking_ean128_report/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | Python | 0.000001 | @@ -1314,16 +1314,40 @@
an128',%0A
+ 'report_aeroo',%0A
%5D,%0A
|
9608fff230665f5120e6ea98d4ae0efc91a345ef | Revert "Add teuthology git version query/logging" | teuthology/__init__.py | teuthology/__init__.py | from gevent import monkey
monkey.patch_all(
dns=False,
# Don't patch subprocess to avoid http://tracker.ceph.com/issues/14990
subprocess=False,
)
import sys
# Don't write pyc files
sys.dont_write_bytecode = True
from .orchestra import monkey
monkey.patch_all()
import logging
import os
import subprocess
... | Python | 0 | @@ -298,403 +298,32 @@
os%0A
-import subprocess%0A%0A__version__ = '1.0.0'%0A%0A# do our best, but if it fails, continue with above%0A%0Atry:%0A __version__ += '-' + subprocess.check_output(%0A 'git rev-parse --short HEAD'.split(),%0A cwd=os.path.dirname(os.path.realpath(__file__))%0A ).strip()%0A... |
0e4a61b97ee7fd2cdfea73ce13bfc2ebfc25c08b | Fix setting loglevel on python 2.6 | flexget/logger.py | flexget/logger.py | from __future__ import absolute_import, division, unicode_literals
import logging
import logging.handlers
import string
import sys
import threading
import warnings
# A level more detailed than DEBUG
TRACE = 5
# A level more detailed than INFO
VERBOSE = 15
class FlexGetLogger(logging.Logger):
"""Custom logger th... | Python | 0.000007 | @@ -3446,24 +3446,212 @@
getLogger()%0A
+ if not isinstance(level, int):%0A # Python logging api is horrible. This is getting the level number, which is required on python 2.6.%0A level = logging.getLevelName(level)%0A
logger.s
|
26123b15e28975c331b4c29e86bf69f2bee3a2c2 | Add option to get_or_create_inspection to filter inspections with content. | thezombies/tasks/urls.py | thezombies/tasks/urls.py | from __future__ import absolute_import
from django.db import transaction
from django.conf import settings
from celery import shared_task
import requests
from requests.exceptions import (MissingSchema)
from cachecontrol import CacheControl
from .utils import ResultDict, logger
from thezombies.models import URLInspecti... | Python | 0 | @@ -2300,16 +2300,36 @@
tion(url
+, with_content=False
):%0A %22
@@ -2700,64 +2700,274 @@
url,
- created_at__day=latest_date.day, parent_id__isnull=True
+%0A created_at__day=latest_date.day,%0A parent... |
574ad672167d06841fb37501050848d49c31d7ae | fix absolute import | vispy/scene/visuals/line/line.py | vispy/scene/visuals/line/line.py | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Line visual implementing Agg- and GL-based drawing modes.
TODO:
* Agg support is very minimal; needs attention.
* Optimization--avoid creating new buffers, avoid trigg... | Python | 0.000015 | @@ -411,13 +411,12 @@
rom
-vispy
+....
imp
|
0e4c8fb4965eadf8cf45ff0f6d3406df17015f46 | remove print | timeside/server/tasks.py | timeside/server/tasks.py | from __future__ import absolute_import
import time
import gc
from celery import shared_task
from celery.result import AsyncResult
from celery.result import GroupResult
from .models import Item, Selection, Preset, Experience, Task
from .models import _DONE
from celery.task import chord
from celery.utils.log import g... | Python | 0.000793 | @@ -405,27 +405,8 @@
d):%0A
- print(task_id)%0A
|
02afb9ef300e4d171b89f7160845cebbe512a6ed | removes __all__ as binary | feets/extractors/__init__.py | feets/extractors/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2017 Juan Cabral
# 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 withou... | Python | 0.999999 | @@ -1349,26 +1349,8 @@
port
- unicode_literals,
pri
@@ -1615,17 +1615,16 @@
= %5B%0A
-b
%22DATAS%22,
@@ -1624,25 +1624,24 @@
DATAS%22,%0A
-b
%22register_ex
@@ -1654,17 +1654,16 @@
r%22,%0A
-b
%22registe
@@ -1683,17 +1683,16 @@
s%22,%0A
-b
%22is_regi
@@ -1704,17 +1704,16 @@
d%22,%0A
-b
%... |
0138eacf0d518b86e819a70000b7b527434a6b35 | Change les arguments passés à celery pour gérer la sérialisation JSON. | libretto/signals.py | libretto/signals.py | # coding: utf-8
from __future__ import unicode_literals
from celery_haystack.signals import CelerySignalProcessor
from django.contrib.admin.models import LogEntry
from reversion.models import Version, Revision
from .tasks import auto_invalidate
class CeleryAutoInvalidator(CelerySignalProcessor):
def enqueue(self... | Python | 0 | @@ -157,16 +157,67 @@
ogEntry%0A
+from django.contrib.sessions.models import Session%0A
from rev
@@ -434,16 +434,25 @@
ogEntry,
+ Session,
Revisio
@@ -530,10 +530,33 @@
instance
+.__class__, instance.pk
)%0A
|
a3816e9dbd70c41b12307e776a87d3c5056030dd | fix settings | explorer/utils.py | explorer/utils.py | import functools
import csv
import json
import re
import string
from time import time
from explorer import app_settings
from django.db import connections, connection, models, transaction, DatabaseError
from django.http import HttpResponse
from six.moves import cStringIO
import sqlparse
EXPLORER_PARAM_TOKEN = "$$"
# S... | Python | 0.000001 | @@ -2765,16 +2765,20 @@
limeter=
+app_
settings
|
e8b5ca4f27f7b74cec5349b8a03a28239afefba9 | format all item fields, not just those used by 'by' option | flinck/brain.py | flinck/brain.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""IMDB movie searcher.
"""
from __future__ import print_function
import logging
import os
import re
import sys
try:
from urllib import quote
except ImportError:
from urllib.parse import quote
import omdb
import requests
from .config import config, FIELDS
# Regex ... | Python | 0.000001 | @@ -1598,33 +1598,25 @@
format_
-field(item, field
+item(item
):%0A %22
@@ -1671,24 +1671,77 @@
eld%0A %22%22%22%0A
+ for field in set(list(item) + list(FIELDS)):%0A
if item.
@@ -1767,32 +1767,36 @@
'N/A':%0A
+
item%5Bfield%5D = 'U
@@ -1803,30 +1803,16 @@
nknown'%0A
- else:%0A ... |
e7d44dd3c62c26af4bcf926b4c15f18ee01c3fe0 | Update to the docs | tool/biobambam_filter.py | tool/biobambam_filter.py | """
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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.... | Python | 0 | @@ -3785,19 +3785,19 @@
files :
-lis
+dic
t%0A
@@ -3846,19 +3846,19 @@
adata :
-lis
+dic
t%0A
|
eb102bb8550d59b34373f1806633a6079f7064a8 | Make sure that all requests for static files are correctly hidden from output | devserver/utils/http.py | devserver/utils/http.py | from django.conf import settings
from django.core.servers.basehttp import WSGIRequestHandler
from django.db import connection
from devserver.utils.time import ms_from_timedelta
from datetime import datetime
class SlimWSGIRequestHandler(WSGIRequestHandler):
"""
Hides all requests that originate from ```MEDIA_... | Python | 0.000001 | @@ -304,17 +304,41 @@
te from
-%60
+either %60%60STATIC_URL%60%60 or
%60%60MEDIA_
@@ -343,16 +343,21 @@
A_URL%60%60
+%0A
as well
@@ -362,20 +362,16 @@
l as any
-%0A
request
@@ -409,16 +409,21 @@
uded in
+%0A
%60%60DEVSER
@@ -764,101 +764,76 @@
-if settings.MEDIA_URL.startswith('http:'):%0... |
866e5fee6d39da9eb1a4893f12b1fe7aafbdbefd | update a comment about None gradient | examples/train_mlp.py | examples/train_mlp.py | ##############
#
# This example demonstrates the basics of using `equinox.jitf` and `equinox.gradf`.
#
# Here we'll use them to facilitate training a simple MLP: to automatically take gradients and jit with respect to
# all the jnp.arrays constituting the parameters. (But not with respect to anything else, like the cho... | Python | 0 | @@ -2923,297 +2923,23 @@
h a
-zero gradient.%0A # Anything we filtered out above will have a zero gradient. But in general some of the things we filtered out%0A # might not even be jnp.arrays, and might not even have a notion of addition. We don't want to try adding zero%0A # to arbitrary Python ... |
c053d6d46e6c1102b712649c8d91841d57b32ca7 | add todo | buncuts/utils.py | buncuts/utils.py | # coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import codecs
import re
default_delimeter = "。!?▲"
default_quote_dict = {"「": "」", "『": "』"}
def split_into_sentences(text=sys.stdi... | Python | 0 | @@ -648,16 +648,57 @@
option.
+%0A # TODO: implement chunk_size option.
%0A%0A co
|
cf80d48226d9b8c80d3528f5870f85af1a335472 | Fix a couple of minor bugs in the certbot_wrapper | tools/certbot_wrapper.py | tools/certbot_wrapper.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tools/certbot_wrapper.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this li... | Python | 0.000001 | @@ -3180,16 +3180,19 @@
.EX_
-NOTFOUND
+UNAVAILABLE
%0A%09if
@@ -5366,19 +5366,19 @@
us: ' +
-int
+str
(status)
|
649d4b7fb22c92fa116fb574c1e4a07578ca6faa | Create methods for getting revisions. | forum/models.py | forum/models.py | from django.db import models
import django.contrib.auth.models as auth
class User(auth.User):
"""Model for representing users.
It has few fields that aren't in the standard authentication user
table, and are needed for the forum to work, like footers.
"""
display_name = models.CharField(max_length... | Python | 0 | @@ -1168,16 +1168,166 @@
hread)%0A%0A
+ def first_revision(self):%0A return self.postrevision_set.first()%0A%0A def last_revision(self):%0A return self.postrevision_set.last()%0A%0A
class Po
|
84840387f3c0bda539673c64da5ae30ea5787626 | Replace deprecated functions nn 2 rnn (#7338) | research/deep_speech/deep_speech_model.py | research/deep_speech/deep_speech_model.py | # Copyright 2018 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.000003 | @@ -987,27 +987,27 @@
tm%22: tf.
-nn.rnn_cell
+contrib.rnn
.BasicLS
@@ -1028,27 +1028,27 @@
nn%22: tf.
-nn.rnn_cell
+contrib.rnn
.RNNCell
@@ -1067,19 +1067,19 @@
tf.
-nn.rnn_cell
+contrib.rnn
.GRU
|
65eb9bcd58d78fd80fabd03a26be73335f1a1122 | Update ci nose config to run with four processes | goldstone/settings/ci.py | goldstone/settings/ci.py | """Settings for accessing a distributed docker instance."""
# Copyright 2015 Solinea, 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
#... | Python | 0 | @@ -1189,14 +1189,35 @@
goldstone',%0A
+ '--processes=4',%0A
)%0A
|
ba19e9ae4a8bb36317ac4d8b7f64ca549a4c5d8e | Use Django built-in get_valid_filename (#466) | explorer/exporters.py | explorer/exporters.py | import codecs
import csv
import json
import string
import uuid
from datetime import datetime
from io import StringIO, BytesIO
from django.core.serializers.json import DjangoJSONEncoder
from django.utils.module_loading import import_string
from django.utils.text import slugify
from explorer import app_settings
def g... | Python | 0 | @@ -262,16 +262,36 @@
t import
+ get_valid_filename,
slugify
@@ -1142,299 +1142,60 @@
-# build list of valid chars, build filename from title & replace spaces%0A valid_chars = f'-_.() %7Bstring.ascii_letters%7D%7Bstring.digits%7D'%0A filename = ''.join(c for c in self.query.title if c in valid_ch... |
738fb4e15c0f34d7ebdf99852770cf94c96fbd21 | Fix sub issue (assignment is overridden by last chanel) :: refs #272 | src/magistral/client/sub/GroupConsumer.py | src/magistral/client/sub/GroupConsumer.py | '''
Created on 11 Aug 2016
@author: rizarse
'''
import logging
import threading
from os.path import expanduser
from kafka.consumer.group import KafkaConsumer
from magistral.client.Configs import Configs
from magistral.client.MagistralException import MagistralException
from kafka.structs import TopicPartition
from m... | Python | 0 | @@ -5424,25 +5424,154 @@
listener
-;
+%0A %0A ca = self.__consumer.assignment()%0A if (ca is not None):%0A for tp in ca: tpas.append(tp)
%0A
|
39c16a3552ef882441b26a4c6defc57d9ea42010 | return JSON rather than request.response objects | mondo.py | mondo.py | import requests
class MondoClient():
url = 'https://production-api.gmon.io/'
def __init__(self, url = None):
if url != None:
self.url = url
def token(self, client_id, client_secret, username, password):
"""
Acquiring an access token
"""
payload = {'gran... | Python | 0.000019 | @@ -507,33 +507,40 @@
return r
+.json()
%0A
-
%0A def refresh
@@ -876,32 +876,39 @@
return r
+.json()
%0A%0A def transa
@@ -1272,32 +1272,39 @@
return r
+.json()
%0A%0A def transa
@@ -1781,32 +1781,39 @@
return r
+.json()
%0A%0A def authen
@@ -2056,32 +2056,39 @@
... |
0fe56f804a7ed4958f33a534e30e3b6c79526ea6 | Update SimplyPremiumCom.py | module/plugins/accounts/SimplyPremiumCom.py | module/plugins/accounts/SimplyPremiumCom.py | # -*- coding: utf-8 -*-
from module.common.json_layer import json_loads
from module.plugins.Account import Account
class SimplyPremiumCom(Account):
__name__ = "SimplyPremiumCom"
__type__ = "account"
__version__ = "0.03"
__description__ = """Simply-Premium.com account plugin"""
__license__ ... | Python | 0 | @@ -231,17 +231,17 @@
_ = %220.0
-3
+4
%22%0A%0A _
@@ -991,32 +991,39 @@
data%5B'result'%5D%5B'
+remain_
traffic'%5D:%0A
@@ -1070,16 +1070,23 @@
sult'%5D%5B'
+remain_
traffic'
|
9d9b77d3785377320c6e9e835b38779035657e82 | Fix error for users in local groups | indico/modules/search/controllers.py | indico/modules/search/controllers.py | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import math
from flask import jsonify, session
from marshmallow import INCLUDE, fields
from marshmallow_e... | Python | 0 | @@ -1224,13 +1224,50 @@
ier%5D
+%0A access
+
+=
%5B
-x
+GroupProxy(x.id, _group=x)
.ide
|
a58de69cd0b93f1967a9b56812b1972a3ab9e5d1 | Update main.py | WikiQA_CNN+Feat/main.py | WikiQA_CNN+Feat/main.py | import numpy as np
from dl_text import *
import model
import wiki_utils as wk
from dl_text.metrics import eval_metric
glove_fname = 'D:/workspace/Trec_QA-master/data/Glove/glove.6B.50d.txt'
################### DEFINING MODEL ###################
lrmodel = model.cnn
model_name = lrmodel.func_name
###################... | Python | 0.000001 | @@ -1,12 +1,85 @@
+%22%22%22%0A** deeplean-ai.com **%0A** dl-lab **%0Acreated by :: GauravBh1010tt%0A%22%22%22%0A%0A
import numpy
|
6bb9eb81540720c67b709f3f2c971343e7e94f21 | change --cookbook-path to --cookbooks | fastfood/shell.py | fastfood/shell.py | # -*- coding: utf-8 -*-
"""fastfood - cookbook wizardry"""
from __future__ import print_function
from __future__ import unicode_literals
import json
import logging
import os
import sys
import threading
from fastfood import manifest
_local = threading.local()
LOG = logging.getLogger(__name__)
NAMESPACE = 'fastfood'
... | Python | 0.000009 | @@ -488,21 +488,17 @@
cookbook
-_path
+s
%0A ret
@@ -2375,13 +2375,9 @@
book
--path
+s
', h
@@ -2406,33 +2406,8 @@
ry',
- metavar='cookbook_path',
%0A
@@ -2455,13 +2455,9 @@
book
-_path
+s
', o
|
187e8237f9ba56dc517b2ad6e58be3e8031fa9df | Update __init__.py | examples/__init__.py | examples/__init__.py | # coding: utf-8
# In[1]:
import sys
sys.path.append("./examples")#add the examples as a module
| Python | 0.000072 | @@ -13,19 +13,8 @@
f-8%0A
-%0A# In%5B1%5D:%0A%0A
impo
@@ -55,36 +55,5 @@
es%22)
-#add the examples as a module
%0A
|
5060294de04033eb99bbaf91353794fd5e484217 | Modify only to attempt decryption on strings | figgypy/config.py | figgypy/config.py | try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
import logging
import os
import seria
import yaml
logger = logging.getLogger('figgypy')
if len(logger.handlers) == 0:
logger.addHandler(logging.NullHandler())
gpg_loaded = False
try:
import gnupg
gpg_loaded = True
exce... | Python | 0.000001 | @@ -2427,32 +2427,53 @@
)%0A else:%0A
+ try:%0A
if '
@@ -2499,37 +2499,45 @@
+
try:%0A
+
@@ -2594,16 +2594,20 @@
+
+
if decry
@@ -2615,16 +2615,20 @@
ted.ok:%0A
+
@@ -2692,38 +2692,46 @@
+ ... |
9ee0ad7dfad15e3d933b4d1c3fab508d99480748 | Fix example. | examples/faithful.py | examples/faithful.py | import numpy as np
import matplotlib.pyplot as plt
from gmm.algorithm import GMM
# Read in dataset from file
with open('faithful.txt', 'rt') as f:
data = []
for row in f:
cols = row.strip('\r\n').split(' ')
data.append(np.fromiter(map(lambda x: float(x), cols), np.float))
data = np.array(... | Python | 0.000004 | @@ -464,17 +464,17 @@
dentity(
-3
+2
), np.id
|
5437cdfe48c32cd100bb7fbbb2590fc7e11ab78b | read the docs theme modification | docs/readthedocs/conf.py | docs/readthedocs/conf.py | # -*- coding: utf-8 -*-
#
# pvtest documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 04 11:15:19 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | Python | 0 | @@ -720,16 +720,42 @@
h('.'))%0A
+import sphinx_rtd_theme%0A%0A%0A
from rec
@@ -2812,25 +2812,32 @@
heme = '
-alabaster
+sphinx_rtd_theme
'%0A%0A# The
|
18d4aabe9b818b62800526470007220c3bcc49db | Don't fail if the last line of allfilters.dat is blank | fsps/filters.py | fsps/filters.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tools for working with the FSPS filter set.
This module uses filter information shipped with FSPS itself in
``$SPS_HOME/data``.
"""
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__all__ = ["find_filter", ... | Python | 0.999566 | @@ -3887,32 +3887,61 @@
else:%0A
+ try:%0A
@@ -3956,32 +3956,36 @@
= line.split()%0A
+
@@ -4033,16 +4033,20 @@
+
trans.ap
@@ -4060,16 +4060,84 @@
oat(t))%0A
+ except(ValueError):%0A pass... |
0e75bfd460444b0d967751414832112b8f35a56f | change global method_supported variable to Crypto class varaible | fukei/crypto.py | fukei/crypto.py | #!/usr/bin/env python
import sys
import hashlib
import string
import struct
import logging
from utils import lazy_property
logger = logging.getLogger('crypto')
def random_string(length):
import M2Crypto.Rand
return M2Crypto.Rand.rand_bytes(length)
def get_table(key):
m = hashlib.md5()
m.update(key... | Python | 0.000036 | @@ -1230,32 +1230,61 @@
, iv)%0A%0A%0A
-method_supported
+%0A%0Aclass Crypto(object):%0A%0A METHOD_SUPPORTED
= %7B%0A
@@ -1640,33 +1640,14 @@
6),%0A
-%7D%0A%0A%0Aclass Crypto(object):
+ %7D%0A
%0A
@@ -2673,24 +2673,29 @@
urn
-method_supported
+slef.METHOD_SUPPORTED
.get
|
dc03a20265c2fc611c7b2027e76d01a495ef2e7e | fix typo | examples/ssd/eval.py | examples/ssd/eval.py | from __future__ import division
import argparse
import sys
import time
import chainer
from chainer import iterators
from chainercv.datasets import VOCDetectionDataset
from chainercv.datasets import voc_detection_label_names
from chainercv.evaluations import eval_detection_voc
from chainercv.links import SSD300
from ... | Python | 0.999991 | @@ -2301,9 +2301,9 @@
%7D: %7B
-;
+:
f%7D'.
|
a27f561ff24b41f215bdb3e33cdcdfcc4c43bf93 | fix imports, crashes with TypeError, now | examples/testknn2.py | examples/testknn2.py | # -*- coding: utf-8 -*-
"""
SVM for Wind Power Prediction (SAES, global timeout)
================================
"""
# Future
from __future__ import absolute_import, division, print_function, \
unicode_literals, with_statement
# Third Party
#from sklearn.neighbors import KNeighborsRegressor
from windml.datasets.n... | Python | 0 | @@ -420,23 +420,8 @@
KNN
-%0A%0A# First Party
%0Afro
@@ -439,137 +439,139 @@
ore.
-param.util import param%0Afrom metaopt.core.returns.util.decorator import maximize%0Afrom metaopt.core.returns.util.decorator
+returnspec.util.decorator import minimize%0Afrom metaopt.core.paramspec.util import param%0Afrom metaopt.c... |
528b10713d98e2603fad62c3fb252464c08896f0 | make '/mc_trks' absolute path to avoid confusion | examples/tonphdf5.py | examples/tonphdf5.py | #!/usr/bin/env python
"""
Converts hits in a Jpp-ROOT file to HDF5.
"""
from km3pipe.pumps.aanet import AanetPump
from km3pipe import Pipeline, Module
import sys
import pandas as pd
import h5py
if len(sys.argv) < 3:
sys.exit('Usage: {0} FILENAME.root OUTPUTFILENAME.h5'.format(sys.argv[0]))
FILEPATH = sys.argv[1... | Python | 0.000004 | @@ -2882,16 +2882,17 @@
ataset('
+/
mc_track
|
2c09c700b524a7272436feff19c4128ca3211725 | Update word2vec.py | examples/word2vec.py | examples/word2vec.py | import copy
import gensim
import logging
import pyndri
import sys
logging.basicConfig(level=logging.INFO)
if len(sys.argv) <= 1:
logging.error('Usage: python %s <path-to-indri-index>'.format(sys.argv[0]))
sys.exit(0)
logging.info('Initializing word2vec.')
word2vec_init = gensim.models.Word2Vec(
size=30... | Python | 0.000014 | @@ -476,16 +476,17 @@
sample t
+h
reshold.
|
2ece6032b2344e3cf6304a757714d0ecf5015324 | split drive controller to allow other pwm interface eg raspy juice | fishpi/vehicle/test_drive.py | fishpi/vehicle/test_drive.py | #!/usr/bin/python
#
# FishPi - An autonomous drop in the ocean
#
# Simple test of PWM motor and servo drive
#
import raspberrypi
from time import sleep
from drive_controller import DriveController
if __name__ == "__main__":
print "testing drive controller..."
drive = DriveController(debug=True, i2c_bus=rasp... | Python | 0 | @@ -177,16 +177,24 @@
import
+Adafruit
DriveCon
@@ -281,16 +281,24 @@
drive =
+Adafruit
DriveCon
|
3566c7689f59715f2d58886f52d3dd0c00a0ce4e | change manage.py | maili-develop/manage.py | maili-develop/manage.py | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "maili.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| Python | 0.000002 | @@ -64,16 +64,130 @@
ain__%22:%0A
+ if 'test' in sys.argv:%0A os.environ.setdefault(%22DJANGO_SETTINGS_MODULE%22, %22test.settings%22)%0A else:%0A
os.e
|
49f05720e0ca80b800b72936a06ea8e3d5bc5bdb | use DerivO3CPU model instead of MinorCPU model | configs/fault_injector/injector_system.py | configs/fault_injector/injector_system.py | # import the m5 (gem5) library created when gem5 is built
import m5
# import all of the SimObjects
from m5.objects import *
from FaultParser import *
import argparse
#parse and save the arguments
parser = argparse.ArgumentParser(description='Gem5')
parser.add_argument('-fe', '--fault-enabled', dest='faultEnabled',
... | Python | 0 | @@ -117,16 +117,46 @@
mport *%0A
+from m5.util import addToPath%0A
from Fau
@@ -190,16 +190,162 @@
gparse%0A%0A
+import os%0A%0A# Add configs/common to execution path in order to import Caches classes%0AaddToPath(os.path.join('..', 'common'))%0Afrom Caches import *%0A%0A
#parse a
@@ -2109,13 +2109,15 @@
u =
-Mino... |
cf79339061669bace0c97ca3e3452b27b77ad8da | Fix region not being passed to JAAS | conjureup/controllers/bootstrap/common.py | conjureup/controllers/bootstrap/common.py | from pathlib import Path
from conjureup import events, juju
from conjureup.app_config import app
from conjureup.models.step import StepModel
from conjureup.telemetry import track_event
class BaseBootstrapController:
msg_cb = NotImplementedError()
def is_existing_controller(self):
controllers = juju.... | Python | 0 | @@ -692,24 +692,229 @@
ju model.')%0A
+ cloud_with_region = app.provider.cloud%0A if app.provider.region:%0A cloud_with_region = '/'.join(%5Bapp.provider.cloud,%0A app.provider.region%5D)%0A
awai
@@ -942,32 +942,32 @@
provider.model,%0A
-
... |
ed267933edf8b6e2e2b63d11ece7457943fe9646 | Add documentation for powerline.lib.shell.run_cmd | powerline/lib/shell.py | powerline/lib/shell.py | # vim:fileencoding=utf-8:noet
from __future__ import absolute_import, unicode_literals, division, print_function
from subprocess import Popen, PIPE
from locale import getlocale, getdefaultlocale, LC_MESSAGES
def _get_shell_encoding():
return getlocale(LC_MESSAGES)[1] or getdefaultlocale()[1] or 'utf-8'
def run_c... | Python | 0.000001 | @@ -338,16 +338,313 @@
=None):%0A
+%09'''Run command and return its stdout, stripped%0A%0A%09If running command fails returns None and logs failure to %60%60pl%60%60 argument.%0A%0A%09:param PowerlineLogger pl:%0A%09%09Logger used to log failures.%0A%09:param list cmd:%0A%09%09Command which will be run.%0A%09:param st... |
be8fd3f10dbfd8e2099a046340a8e51758e60bd5 | Add signout view so we can signout (by entering url manually) | makerbase/views/auth.py | makerbase/views/auth.py | import json
from urllib import urlencode
from urlparse import parse_qs, urlsplit, urlunsplit
from flask import redirect, request, url_for
from flaskext.login import LoginManager, login_user
import requests
from makerbase import app
from makerbase.models import User
login_manager = LoginManager()
login_manager.setup... | Python | 0 | @@ -183,16 +183,29 @@
gin_user
+, logout_user
%0Aimport
@@ -818,24 +818,119 @@
rect_url)%0A%0A%0A
+@app.route('/signout')%0Adef signout():%0A logout_user()%0A return redirect(url_for('home'))%0A%0A%0A
@app.route('
|
df27f7ad62eebf29b42bfa9b2bce7d73739c4a8e | Fix minor template modernization bug | enhydris/conf/settings.py | enhydris/conf/settings.py | # Enhydris settings for {{ project_name }} project.
#
# Generated by 'enhydris-admin newinstance' using Enhydris {{ enhydris_version }}
# and Django {{ django_version }}.
#
# For more information on this file, see
# http://enhydris.readthedocs.org/en/{{ enhydris_docs_version }}/general/install.html#settings-reference
... | Python | 0 | @@ -433,31 +433,8 @@
True
-%0ATEMPLATE_DEBUG = DEBUG
%0A%0A#
|
4464919c5114193179490c151844fd771bfd880b | fix setup without flask installed | flask_ecstatic.py | flask_ecstatic.py | """Serves static files with optional directory index.
Files in static folder are automatically served on static URL by Flask.
See http://flask.pocoo.org/docs/0.10/api/#application-object.
It's recommended to specify static folder and URL path directly on Flask application object,
unless you need additional static fol... | Python | 0.000001 | @@ -527,46 +527,8 @@
t os
-%0Afrom flask import send_from_directory
%0A%0Ade
@@ -596,16 +596,42 @@
ex.html'
+, send_from_directory=None
):%0A %22
@@ -693,16 +693,96 @@
dex.%22%22%22%0A
+%0A if not send_from_directory:%0A from flask import send_from_directory%0A%0A
url
|
bbb0325ab44f57cbc728f3eae16eaec887e87517 | Add track_opens parameter to Message class | flask_pystmark.py | flask_pystmark.py | from flask import current_app
from pystmark import (send, send_batch, get_delivery_stats, get_bounces,
get_bounce, get_bounce_dump, get_bounce_tags,
activate_bounce, Message as _Message)
from __about__ import __version__, __title__, __description__
__all__ = ['__version__', ... | Python | 0 | @@ -6846,24 +6846,42 @@
verify=None
+, track_opens=None
):%0A i
@@ -7630,10 +7630,35 @@
y=verify
+, track_opens=track_opens
)%0A
|
b0d531b744f17d1204c2eb3a036b35f12d70fc1f | Update corpus save function definition | src/project/corpus.py | src/project/corpus.py | import sys
import copy
from os import listdir
from os.path import isdir, isfile, join
from gensim import models
from gensim.interfaces import TransformationABC
from gensim.corpora import Dictionary, MmCorpus, TextCorpus
class Corpus(object):
"""Wrapper class around Corpus streaming"""
def __init__(self, dir=... | Python | 0 | @@ -1570,16 +1570,28 @@
ve(self,
+ dictionary,
file):%0A
@@ -1729,94 +1729,92 @@
-MmCorpus.serialize(file, corpus)%0A Dictionary.save(self.dictionary, file+%22.dict%22
+Dictionary.save(self.dictionary, dictionary)%0A MmCorpus.serialize(file, corpus
)%0A%0A
@@ -3440,16 +3440,17 @@
n True%0A%0A
... |
b83e371f37477b5eaf552ac78383e3f0ac94bc21 | Change in presseurop RSS feed | modules/presseurop/backend.py | modules/presseurop/backend.py | # -*- coding: utf-8 -*-
# Copyright(C) 2012 Florent Fourcot
#
# This file is part of weboob.
#
# weboob 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 op... | Python | 0 | @@ -1526,9 +1526,10 @@
E =
-5
+14
0%0A
|
a3ae8a7ece6bc75437b9848cf43335690250c128 | exit http server gracefully | presstatic/__main__.py | presstatic/__main__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import argparse
import SimpleHTTPServer
import SocketServer
from clint.textui import colored, puts, indent
from presstatic import help
from presstatic.builders import SiteBuilder
from presstatic.storage import s3
def http_server_on_dir(host, port, dir):
H... | Python | 0.000001 | @@ -274,39 +274,32 @@
%0Adef http_server
-_on_dir
(host, port, dir
@@ -608,24 +608,38 @@
ort=port)))%0A
+%0A try:%0A
httpd.se
@@ -652,16 +652,84 @@
rever()%0A
+ except KeyboardInterrupt:%0A pass%0A httpd.server_close()%0A
%0A%0Adef ma
@@ -1706,15 +1706,8 @@
rver
-_on_dir
(hos
@@ -1721,24... |
c272b597a7ec2a1a5596daecce144001ae8a7d99 | fix simulate device | fluxghost/websocket/touch.py | fluxghost/websocket/touch.py |
from uuid import UUID
import logging
import json
from fluxclient.upnp.task import UpnpTask
from .base import WebSocketBase
logger = logging.getLogger("WS.DISCOVER")
class WebsocketTouch(WebSocketBase):
def __init__(self, *args):
WebSocketBase.__init__(self, *args)
def on_text_message(self, message... | Python | 0.000002 | @@ -1256,32 +1256,36 @@
+
%22serial%22: %22SIMUL
@@ -1292,16 +1292,20 @@
ATE00%22,%0A
+
@@ -1339,16 +1339,20 @@
evice%22,%0A
+
@@ -1389,32 +1389,36 @@
+
%22reachable%22: Tru
@@ -1428,32 +1428,36 @@
+
%22auth%22: True%0A ... |
4bc9217f15ee394332ab54efdb96ded056825c2b | Add todo to handle shuffling of tracks. | mopidy_pandora/doubleclick.py | mopidy_pandora/doubleclick.py | import logging
import time
from mopidy.internal import encoding
from pandora.errors import PandoraException
from mopidy_pandora.library import PandoraUri
logger = logging.getLogger(__name__)
class DoubleClickHandler(object):
def __init__(self, config, client):
self.on_pause_resume_click = config["on_... | Python | 0 | @@ -1467,16 +1467,233 @@
index)%0A%0A
+ # TODO: the order of the tracks will no longer be sequential if the user has 'shuffled' the tracklist%0A # Need to find a better approach for determining whether 'next' or 'previous' was clicked.%0A
|
d4f083d0cc1096152d7d5cd13c63e82f1a58a298 | handle testrunner exits as PR failures | spawner.py | spawner.py | #!/usr/bin/env python3
# Parse the YAML file, start the testrunners in parallel,
# and wait for them.
import os
import sys
import traceback
import subprocess
import utils.parser as parser
import utils.ghupdate as ghupdate
def main():
"Main entry point."
try:
n = parse_suites()
except SyntaxErr... | Python | 0 | @@ -1942,32 +1942,336 @@
i in range(n):%0A
+ # If the rc file doesn't exist but the runner exited%0A # nicely, then it means there was a semantic error%0A # in the YAML (e.g. bad Docker image, bad ostree%0A # revision, etc...).%0A if not os.path.isfile(%22state/suite-%25d/rc%22 %25 ... |
aaa7aad003f58e8f3ea809c5e7a3be860f68b8ea | Clean up `cache` module | gapipy/cache.py | gapipy/cache.py | import collections
from time import time
try:
import cPickle as pickle
except ImportError:
import pickle
def update(d, u):
for k, v in u.iteritems():
if isinstance(v, collections.Mapping):
r = update(d.get(k, {}), v)
d[k] = r
else:
d[k] = u[k]
retu... | Python | 0.000009 | @@ -1,23 +1,4 @@
-import collections%0A
from
@@ -95,637 +95,8 @@
e%0A%0A%0A
-def update(d, u):%0A for k, v in u.iteritems():%0A if isinstance(v, collections.Mapping):%0A r = update(d.get(k, %7B%7D), v)%0A d%5Bk%5D = r%0A else:%0A d%5Bk%5D = u%5Bk%5D%0A return d%0A%... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.