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 |
|---|---|---|---|---|---|---|---|
d61a5eaebcaa12ddaec6161a347cbfa847c2a961 | remove debug information | uctrl/load_balancer.py | uctrl/load_balancer.py | #!/usr/bin/env python
import random
# Not supposed to be something dynamic, for now.
class Load_Balancer(object):
def __init__(self):
# Edge output ports in order of preference
# It will be calculated in the load_balance method
self.edge_out_ports = {}
def lb_policy(self, edge_core):
... | Python | 0.000004 | @@ -2906,32 +2906,33 @@
value))%0A
+#
print (%22id_match
|
8e536e4911ab18a5ac6e2e018fa041425a57a14b | Update serializers.py | website/serializers.py | website/serializers.py | from website.models import Issue, User , UserProfile,Points, Domain
from rest_framework import routers, serializers, viewsets, filters
import django_filters
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ('id','username')
class IssueSerializer(serializers.Mode... | Python | 0 | @@ -645,32 +645,80 @@
on', 'user__id')
+%0A http_method_names = %5B'get', 'post', 'head'%5D
%0A%0Aclass UserIssu
@@ -920,16 +920,64 @@
er__id')
+%0A http_method_names = %5B'get', 'post', 'head'%5D
%0A%0Aclass
@@ -1370,32 +1370,80 @@
user__username')
+%0A http_method_names = %5B'get', 'post', 'head'%5D
%... |
97a80b758908760692a468269a2f1cbf209247d8 | use default browser | config/lighthouse/cmd.py | config/lighthouse/cmd.py | #!/usr/bin/python2.7
import sys
import random
from time import sleep
import logging
from google import pygoogle
from multiprocessing import Process, Value, Manager, Array
from ctypes import c_char, c_char_p
import subprocess
import json
MAX_OUTPUT = 100 * 1024
resultStr = Array(c_char, MAX_OUTPUT);
def clear_output... | Python | 0 | @@ -1561,23 +1561,24 @@
ut%5B0%5D, %22
-firefox
+xdg-open
%22 + out
|
583a649cb959dacf31777a4d4736e06fbea7a9b1 | Kill main process first | runner.py | runner.py | #!/usr/bin/env python
import os
import sys
import yaml
import shlex
import signal
import psutil
import subprocess
def run_command(cmd, logfile='/dev/null'):
so = file(logfile, 'a+')
p = subprocess.Popen(cmd, shell=False, universal_newlines=True, stdout=so)
ret_code = p.wait()
so.flush()
return re... | Python | 0.000001 | @@ -16,16 +16,25 @@
python%0A%0A
+try:%0A
import o
@@ -35,16 +35,20 @@
port os%0A
+
import s
@@ -50,16 +50,20 @@
ort sys%0A
+
import y
@@ -66,16 +66,20 @@
rt yaml%0A
+
import s
@@ -83,16 +83,20 @@
t shlex%0A
+
import s
@@ -101,16 +101,20 @@
signal%0A
+
import p
@@ -119,16 +119,20 @@... |
936d16449ae8e40435258f79bbb14f4d47c96f02 | Fix bug in neonlogger using stdout for stderr. | src/opencmiss/neon/core/neonlogger.py | src/opencmiss/neon/core/neonlogger.py | '''
Copyright 2015 University of Auckland
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 agre... | Python | 0 | @@ -723,12 +723,11 @@
E =
-Fals
+Tru
e%0A%0A%0A
@@ -804,33 +804,8 @@
one%0A
- _saved_stdout = None%0A
@@ -1190,60 +1190,8 @@
m()%0A
- CustomStream._saved_stdout = sys.stdout%0A
@@ -1473,35 +1473,35 @@
ustomStream._std
-out
+err
if ENABLE_STD_S
|
6f0c05ee4743528550dd083d9290b5be0074ff0e | Add commands args to runner and improve docs in it | runner.py | runner.py | import sys
from vsut.unit import CSVFormatter, TableFormatter
if __name__ == "__main__":
for i in range(1, len(sys.argv)):
try:
modName = sys.argv[i].split(".")[0:-1]
modName = ".".join(modName)
className = sys.argv[i].split(".")[-1]
module = __import__(modN... | Python | 0 | @@ -1,12 +1,28 @@
+import argparse%0A
import sys%0Af
@@ -70,16 +70,22 @@
ormatter
+, Unit
%0A%0Aif __n
@@ -113,88 +113,426 @@
-for i in range(1, len(sys.argv)):%0A try:%0A modName = sys.argv%5Bi%5D
+parser = argparse.ArgumentParser(description=%22Runs unit tests.%22)%0A parser.add_argument... |
553cd68fb5d54be6ecbf3ca93c6d6c6be75afdb5 | Add EveLinkCache to evelink.appengine | evelink/appengine/__init__.py | evelink/appengine/__init__.py | from evelink.appengine.api import AppEngineAPI
from evelink.appengine.api import AppEngineCache
from evelink.appengine.api import AppEngineDatastoreCache
from evelink.appengine import account
from evelink.appengine import char
from evelink.appengine import corp
from evelink.appengine import eve
from evelink.appengine i... | Python | 0.000001 | @@ -143,24 +143,71 @@
astoreCache%0A
+from evelink.appengine.api import EveLinkCache%0A
from evelink
@@ -487,16 +487,34 @@
Cache%22,%0A
+ %22EveLinkCache%22,%0A
%22accou
|
68c4f723f5eea2802209862d323825f33a445154 | Fix url id to pk. | eventex/subscriptions/urls.py | eventex/subscriptions/urls.py | from django.urls import path
import eventex.subscriptions.views as s
app_name = 'subscriptions'
urlpatterns = [
path('', s.new, name='new'),
path('<int:id>/', s.detail, name='detail'),
path('json/donut/', s.paid_list_json, name='paid_list_json'),
path('json/column/', s.paid_column_json, name='paid_c... | Python | 0.000001 | @@ -157,18 +157,18 @@
h('%3Cint:
-id
+pk
%3E/', s.d
|
1bde40bebaa05a35e20dcbac7af91274d1c6e4da | test for .add_hashvalues was added | src/test_minhashsketch.py | src/test_minhashsketch.py | import pytest
import random
import array
from collections import Counter
from mashingpumpkins._murmurhash3 import hasharray
from mashingpumpkins.minhashsketch import (MaxHashNgramSketch, MaxHashNgramCountSketch, FrozenHashNgramSketch)
def _test_MaxHashNgramSketch(sequence, nsize):
# set the hashing function, siz... | Python | 0 | @@ -1396,49 +1396,8 @@
%0A
- #FIXME: add test for .add_hashvalues%0A
@@ -1954,16 +1954,17 @@
ashvalue
+s
():%0A
@@ -2926,49 +2926,8 @@
%0A
- #FIXME: add test for .add_hashvalues%0A
|
127e5ae02932af67c6157939cff6ab388c89c677 | convert process_attr to a parameter in contructor so extending the class is not needed | scrapy/trunk/scrapy/contrib_exp/link/__init__.py | scrapy/trunk/scrapy/contrib_exp/link/__init__.py | from HTMLParser import HTMLParser
from scrapy.link import Link
from scrapy.utils.python import unique as unique_list
from scrapy.utils.url import safe_url_string, urljoin_rfc as urljoin
class LinkExtractor(HTMLParser):
"""LinkExtractor are used to extract links from web pages. They are
instantiated and later... | Python | 0.000002 | @@ -1411,24 +1411,121 @@
to scan it%0A
+ * process (funtion)%0A * a function wich receives the attribute value before assigning it%0A
* unique
@@ -1589,16 +1589,16 @@
ise the%0A
-
sa
@@ -1731,16 +1731,30 @@
=%22href%22,
+ process=None,
unique=
@@ -1865,16 +1865,16 @@
== tag%0A
-
@@... |
20404db72b04dee0bc578404bdb97225c50430d2 | Add data_source to default file test data | webapp/apps/test_assets/utils.py | webapp/apps/test_assets/utils.py | import json
import os
import sys
import ast
from ..taxbrain.compute import MockCompute
from ..taxbrain.models import OutputUrl
from ..taxbrain.forms import TaxBrainForm
from ..dynamic import views
from ..taxbrain import views
from django.core.files.uploadedfile import SimpleUploadedFile
NUM_BUDGET_YEARS = int(os.e... | Python | 0 | @@ -4997,32 +4997,66 @@
de(start_year),%0A
+ 'data_source': 'PUF',%0A
u'qu
|
ca625e22cb397905f859c826c6507b3977665a51 | Fix import | examples/cifar10_ror.py | examples/cifar10_ror.py | '''
Trains a Residual-of-Residual Network (WRN-40-2) model on the CIFAR-10 Dataset.
Gets a 94.53% accuracy score after 150 epochs.
'''
import numpy as np
import sklearn.metrics as metrics
import keras.callbacks as callbacks
import keras.utils.np_utils as kutils
from keras.datasets import cifar10
from keras.preprocess... | Python | 0 | @@ -419,12 +419,8 @@
ions
-.ror
imp
|
cab81ff75f8fdd6650132927d9201bd0923c8354 | Fix error messages. | src/oidc_fed/__init__.py | src/oidc_fed/__init__.py | """
oidc-fed
~~~~~~~~~~~~~~~~
Example implementation of model for OpenID Connect federations.
:copyright: (c) 2016 by Umeå University.
:license: APACHE 2.0, see LICENSE for more details.
"""
import json
import uuid
from Crypto.PublicKey import RSA
from jwkest import JWKESTException
from jwkest.jwk ... | Python | 0.000001 | @@ -5111,24 +5111,22 @@
or(%22The
-provider
+entity
's signi
@@ -5962,33 +5962,16 @@
onError(
-%0A
%22No soft
@@ -5989,22 +5989,8 @@
ent
-from provider
issu
@@ -5995,21 +5995,20 @@
sued by
-commo
+know
n federa
|
d458fb855df77dfb553ee3e95a8201f58aba169e | Increment version number | clippercard/__init__.py | clippercard/__init__.py | """
Copyright (c) 2012-2017 (https://github.com/clippercard/clippercard-python)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use,... | Python | 0.000021 | @@ -1197,11 +1197,11 @@
= '0.4.
-0
+1
'%0A
|
279903d44198ed302a07d1ebff584e2f4b1bd9e5 | Fix the PostReservation Reservation creation | server/src/weblab/user_processing/Reservation.py | server/src/weblab/user_processing/Reservation.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2009 University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# listed... | Python | 0.000007 | @@ -1975,32 +1975,110 @@
ionReservation(%0A
+ status.finished,%0A status.initial_data,%0A
|
6e663d4010f9a79d2816a212e504773a1745a8e6 | Fix project name! | src/txkube/__init__.py | src/txkube/__init__.py | # Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
A Kubernetes client.
"""
__all__ = [
"version",
"IKubernetesClient",
"network_client", "memory_client",
]
from incremental import Version
from ._metadata import version_tuple as _version_tuple
version = Version("pykube", *_version_t... | Python | 0 | @@ -293,18 +293,18 @@
ersion(%22
-py
+tx
kube%22, *
|
171b951c773739b3a485bf4e4b3c2bd93950a174 | Make tests pass on Python 3. | user_agents/parsers.py | user_agents/parsers.py | from collections import namedtuple
from ua_parser import user_agent_parser
MOBILE_DEVICE_FAMILIES = (
'iPhone',
'iPod',
'Generic Smartphone',
'Generic Feature Phone',
)
MOBILE_OS_FAMILIES = (
'Windows Phone',
'Windows Phone OS', # Earlier versions of ua-parser returns Windows Phone OS
'S... | Python | 0.000001 | @@ -1,12 +1,23 @@
+import sys%0A
from collect
@@ -82,16 +82,148 @@
arser%0A%0A%0A
+PY2 = sys.version_info%5B0%5D == 2%0APY3 = sys.version_info%5B0%5D == 3%0A%0Aif PY3:%0A string_types = str%0Aelse:%0A string_types = basestring%0A%0A%0A
MOBILE_D
@@ -621,14 +621,31 @@
ry%22
-(caps)
+instead of %22BlackBerry%22... |
15faef8beb415211a04fd6dca976158343d8f77f | add abc to guid, fixed issues | user_profile/models.py | user_profile/models.py | from django.db import models
from django.contrib.auth.models import User
import uuid
# Create your models here.
# using the guid model
from framework.models import GUIDModel
class Profile(GUIDModel):
author = models.ForeignKey(User)
display_name = models.CharField(max_length=55)
# guid
guid = models... | Python | 0.000231 | @@ -289,77 +289,8 @@
5)%0A%0A
- # guid%0A guid = models.CharField(max_length=55, default=None)%0A%0A
|
127ad982617c2376c9378d1ef7e50b716a077428 | Replace imp with __import__ | dm_root.py | dm_root.py | #!/usr/bin/python
# Copyright 2012 Google Inc. All Rights Reserved.
#
# TR-069 has mandatory attribute names that don't comply with policy
#pylint: disable-msg=C6409
#pylint: disable-msg=W0404
#
"""The Device Model root, allowing specific platforms to populate it."""
__author__ = 'dgentry@google.com (Denton Gentry)'
... | Python | 0.000617 | @@ -317,30 +317,8 @@
)'%0A%0A
-import imp%0Aimport sys%0A
impo
@@ -328,16 +328,16 @@
google3%0A
+
import d
@@ -446,263 +446,45 @@
:%0A
-split = name.split('.')%0A last = split.pop()%0A if split:%0A path = _RecursiveImport('.'.join(split)).__path__%0A else:%0A path = sys.path%0A fileobj, path, descripti... |
8233f9c312955d56dff2fc80aed71dae6af910be | Check for None repos, in case of bad configuration file | do/main.py | do/main.py | # -*- coding: utf-8 -*-
""" DO!
I can do things thanks to Python, YAML configurations and Docker
NOTE: the command check does nothing
"""
from do.project import project_configuration, apply_variables
from do.gitter import clone, upstream
from do.builds import find_and_build
from do.utils.logs import get_logger
log... | Python | 0 | @@ -1316,16 +1316,144 @@
repos')%0A
+ if repos is None:%0A raise AttributeError(%0A %22Invalid configuration: repos section is missing%22)%0A%0A
|
e784227ae5da242d474bc02209289e1dabd2d3a2 | Test Spectral Reconstruction on Sin Wave | utils/spectral_test.py | utils/spectral_test.py | # Lint as: python3
"""Tests for spectral."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import os
import spectral
class SpectralTest(tf.test.TestCase):
def test_waveform_to_spectogram_shape(self):
... | Python | 0 | @@ -873,34 +873,43 @@
np.
-random.normal(size=(
+sin(np.linspace(0, 4 * np.pi,
2**14
-,
))%0A
@@ -1365,34 +1365,43 @@
np.
-random.normal(size=(
+sin(np.linspace(0, 4 * np.pi,
2**14
-,
))%0A
|
05939b0b797780ac1d265c8415f72f1ca44be53d | Modify return tag search data with tag_name | coco/dashboard/views.py | coco/dashboard/views.py | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from posts.models import Post, Tag
@login_required
def index(request):
context = {'posts': Post.objects.all()}
return render(request, 'dashboard/index.html', context)
@login_required
def tagg... | Python | 0.000001 | @@ -352,32 +352,66 @@
%0A context = %7B
+%0A 'tag': tag_name,%0A
'posts': Post.ob
@@ -443,16 +443,21 @@
ag_name)
+%0A
%7D%0A re
|
a82aab3199f264716af49f627f621597d70c9544 | Fix width when using multiple cascaded devices | examples/matrix_demo.py | examples/matrix_demo.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Richard Hull and contributors
# See LICENSE.rst for details.
import re
import time
import argparse
from luma.led_matrix.device import max7219
from luma.core.serial import spi, noop
from luma.core.render import canvas
from luma.core.virtual import view... | Python | 0.000002 | @@ -1118,10 +1118,20 @@
dth=
-64
+device.width
, he
|
d0de5476580b466d7b13cfc7668c267e62cb15f0 | create 32 bit integer var, not 64 (to allow test with NETCDF4_CLASSIC) | examples/mpi_example.py | examples/mpi_example.py | # to run: mpirun -np 4 python mpi_example.py
from mpi4py import MPI
import numpy as np
from netCDF4 import Dataset
rank = MPI.COMM_WORLD.rank # The process ID (integer 0-3 for 4-process run)
nc = Dataset('parallel_test.nc', 'w', parallel=True, comm=MPI.COMM_WORLD,
info=MPI.Info(),format='NETCDF4_CLASSIC')
# be... | Python | 0 | @@ -504,16 +504,18 @@
, np.int
+32
, 'dim')
|
a53fae5b42e9b33774650e017967b865552870e9 | tag v0.7.4 | unihan_tabular/__about__.py | unihan_tabular/__about__.py | __title__ = 'unihan-tabular'
__package_name__ = 'unihan_tabular'
__description__ = 'Export UNIHAN to Python, Data Package, CSV, JSON and YAML'
__version__ = '0.7.3'
__author__ = 'Tony Narlock'
__email__ = 'cihai@git-pull.com'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013-2017 Tony Narlock'
| Python | 0.000001 | @@ -155,17 +155,17 @@
= '0.7.
-3
+4
'%0A__auth
|
4420892ad3e8c1797753e7893772e53785efb570 | add logfile handling | updatebot/cmdline/simple.py | updatebot/cmdline/simple.py | #
# Copyright (c) 2008 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permanent/... | Python | 0.000001 | @@ -1007,16 +1007,26 @@
rm name%3E
+ %5Blogfile%5D
' %25 argv
@@ -1131,51 +1131,86 @@
if
+l
en
-ableLogging:%0A log.addRootLogger()%0A
+(argv) %3C 2 or len(argv) %3E 3:%0A return usage(argv)%0A%0A logFile = None
%0A
@@ -1227,12 +1227,12 @@
gv)
-!= 2
+== 3
:%0A
@@ -1237,33 +1237,98 @@
... |
4ffa2483021b360eb7460bfcf1d845712806390b | Move motor ports because our retail EV3 brick's port A doesn't work. | app/ev3.py | app/ev3.py | # See http://ev3dev-lang.readthedocs.org/projects/python-ev3dev/en/stable/index.html
# for API details -- specific Sensor/Motor docs http://www.ev3dev.org/docs/
from time import sleep
from ev3dev.auto import *
# Connect two large motors on output ports A and C
lmotor, rmotor = [LargeMotor(address) for address in (OUTP... | Python | 0 | @@ -316,17 +316,17 @@
(OUTPUT_
-A
+B
, OUTPUT
@@ -326,17 +326,17 @@
OUTPUT_
-C
+D
)%5D%0Amovin
@@ -430,17 +430,17 @@
(OUTPUT_
-B
+C
)%0Acamera
|
98cb673b358671211a0aa7fed0725dbb732200d0 | Fix edge cases due to artworkUrl100 being missing | coverpy/coverpy.py | coverpy/coverpy.py | import os
import requests
from . import exceptions
class Result:
""" Parse an API result into an object format. """
def __init__(self, item):
""" Call the list parser. """
self.parse(item)
def parse(self, item):
""" Parse the given list into self variables. """
self.artworkThumb = item['artworkUrl100']
... | Python | 0 | @@ -263,24 +263,32 @@
iables. %22%22%22%0A
+%09%09try:%0A%09
%09%09self.artwo
@@ -319,16 +319,695 @@
rl100'%5D%0A
+%09%09except KeyError as e:%0A%09%09%09# A vital parameter is missing, and magic on our end can't get us out of this error case situation.%0A%09%09%09# Therefore, we try to save the user from issues (mo... |
7f0b530db953698e6e923366be6d0d98033e4afb | add description | prontopull.py | prontopull.py | # -*- coding: utf-8 -*-
from urllib2 import Request, urlopen
import json
from pandas.io.json import json_normalize
import time
#from datetime import datetime
url = "https://secure.prontocycleshare.com/data/stations.json"
request = Request(url)
response = urlopen(request)
data = json.loads(response.read())
df=json_nor... | Python | 0.000004 | @@ -17,16 +17,104 @@
f-8 -*-%0A
+'''%0APulls data from pronto cycle share. Combine with cron job to%0Aget data over time%0A'''
%0Afrom ur
@@ -212,39 +212,8 @@
time
-%0A#from datetime import datetime
%0A%0Aur
|
d016e9f2620688bc1059977a12df638393c3fff1 | Bump version | lintreview/__init__.py | lintreview/__init__.py | __version__ = '2.1.1'
| Python | 0 | @@ -12,11 +12,11 @@
= '2.1.
-1
+2
'%0A
|
c86e7107d2f9d8079b0010ac100f627f1c34d127 | Update ipc_lista1.2.py | lista1/ipc_lista1.2.py | lista1/ipc_lista1.2.py | #ipc_lista1.2
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615310044
#
#
#
#
#Faça um Programa que peça um número e então mostre a mensagem O número informado foi [número].
number = input("Digite um número: ")
print "O número digitado foi ",number
| Python | 0.000001 | @@ -77,17 +77,16 @@
%0A#%0A#%0A#%0A%0A
-%0A
#Fa%C3%A7a um
|
85432b9509744eadc47c73a21b49f9ea93172c78 | Update ipc_lista1.8.py | lista1/ipc_lista1.8.py | lista1/ipc_lista1.8.py | #ipc_lista1.8
#Professor: Jucimar Junior
#Any Mendes Carvalho - 1615
| Python | 0 | @@ -61,9 +61,11 @@
o - 1615
+31
%0A
|
694eb7367f6f9dcd78f42a0a4bcd0b674451d250 | improve log message #11 | livereload/compiler.py | livereload/compiler.py | #!/usr/bin/python
"""livereload.compiler
Provides a set of compilers for web developers.
Available compilers now:
+ less
+ uglifyjs
+ slimmer
"""
import os
import functools
import logging
from subprocess import Popen, PIPE
def make_folder(dest):
folder = os.path.split(dest)[0]
if not folder:
retu... | Python | 0.000022 | @@ -1541,32 +1541,31 @@
w')%0A
-f.write(
+code =
self._get_co
@@ -1560,32 +1560,74 @@
self._get_code()
+%0A if code:%0A f.write(code
)%0A f.clos
@@ -1995,24 +1995,41 @@
self.path)%0A%0A
+ try:%0A
p =
@@ -2065,16 +2065,169 @@
r=PIPE)%0A
+ except OSError... |
9cad93eb5f04e9f455cec679089d8c8787ce3b04 | Enable appsembler reporting settings | lms/envs/appsembler.py | lms/envs/appsembler.py | import os
import json
from path import path
SERVICE_VARIANT = os.environ.get('SERVICE_VARIANT', None)
CONFIG_ROOT = path('/edx/app/edxapp/') #don't hardcode this in the future
CONFIG_PREFIX = SERVICE_VARIANT + "." if SERVICE_VARIANT else ""
with open(CONFIG_ROOT / CONFIG_PREFIX + 'env.json') as env_file:
ENV_TOK... | Python | 0.000474 | @@ -908,16 +908,247 @@
ER_EMAIL', ''))%0A
+%0A%0Aif APPSEMBLER_FEATURES.get('ENABLE_APPSEMBLER_REPORTING', False):%0A from appsembler_reporting.settings import APPSEMBLER_REPORTING%0A%0A APPSEMBLER_REPORTING.update(APPSEMBLER_FEATURES.get(%0A 'APPSEMBLER_REPORTING', %7B%7D ))%0A
|
4315d028f114ae1005f57d33df964be05b2fb8a6 | use bin/penchy_test_job instead of running it directly | docs/commented_sample_job.py | docs/commented_sample_job.py | # A job description is two part: part 1 introduces the involved elements and
# part 2 joins them in a job
# part 1: introduce the elements
# setup job environment
from penchy.jobs import *
# define a node
node = NodeConfiguration(
# that is the localhost
'localhost',
# ssh p... | Python | 0 | @@ -215,16 +215,75 @@
port *%0A%0A
+# import the configuration file (if needed)%0Aimport config%0A%0A
# define
@@ -2091,126 +2091,4 @@
2%0A)%0A
-%0A# a nice trick: check the job for plausibility if run as %60%60python %3Cjobname%3E%60%60%0Aif __name__ == '__main__':%0A job.check()%0A
|
927de70d3212c5106846b6f6f6333b93eceacea5 | add python 脚本 | pub-python.py | pub-python.py | # coding=utf8
import paramiko
import datetime
HOSTS = [
{
'HOST':'hive1_host',
'PORT':9092,
'USER':'root'
},
{
'HOST':'hive2_host',
'PORT':9092,
'USER':'root'
}
]
class SSH():
def __init__(self):
self.client = None
def connect(self,host... | Python | 0.000245 | @@ -39,16 +39,33 @@
datetime
+%0Aimport telnetlib
%0A%0AHOSTS
@@ -240,16 +240,44 @@
%7D%0A%5D%0A%0A
+BASEPATH = '/root/mpush'%0A%0A%0A%0A
class SS
@@ -972,17 +972,16 @@
ose()%0A%0A%0A
-%0A
def show
@@ -1458,16 +1458,17 @@
USER'%5D)%0A
+%0A
@@ -1473,16 +1473,18 @@
##back
+up
%0A
@@ -1491,... |
9f699f66c1ff14d884157cee358793d715b1e702 | delete print | tests/test_apiserver.py | tests/test_apiserver.py | # -*- coding: utf-8 -*-
"""
tests.apiserver
~~~~~~~~~~~~
Tests cobra.api
:author: 40huo <git@40huo.cn>
:homepage: https://github.com/wufeifei/cobra
:license: MIT, see LICENSE for more details.
:copyright: Copyright (c) 2017 Feei. All rights reserved
"""
# 测试完成需要手动关闭 API server 和扫描进... | Python | 0.000195 | @@ -1294,29 +1294,8 @@
rs)%0A
- print re.content%0A
|
17d79c5ec4584ea2f1f8b7fe52b157b3988bb7fc | test gap score | tests/test_gap_score.py | tests/test_gap_score.py | """
Using gap score to determine optimal cluster number
"""
import unittest
from unittest import TestCase
from flaky import flaky
import numpy as np
import scipy
from uncurl import gap_score
class GapScoreTest(TestCase):
def setUp(self):
pass
def test_gap_score(self):
data_mat = scipy.io.l... | Python | 0.000004 | @@ -1236,32 +1236,50 @@
reproc_data(data
+, gene_subset=True
)%0A max_k,
|
e3479cd460fb4e3a66db396f2bb1d59aa870adb3 | Remove unused variable | tests/test_generator.py | tests/test_generator.py | """Validate Generator class."""
import pytest
from gogoutils.generator import Generator, GeneratorError
PROJECTS = {
'repo1': {
'project': 'gogoair',
'repo': 'test',
'env': 'dev',
},
'repo2': {
'project': 'gogoair',
'repo': 'test',
'env': 'stage',
},
... | Python | 0.000347 | @@ -1538,28 +1538,24 @@
%0A
- g =
Generator(*
|
b6cb3b5239aa5cb6e18d97a3a0e827052b6873db | add ability to print args too | pygam/core.py | pygam/core.py | """
Core classes
"""
from __future__ import absolute_import
import numpy as np
from pygam.utils import round_to_n_decimal_places
def nice_repr(name, param_kvs, line_width=30, line_offset=5, decimals=3):
"""
tool to do a nice repr of a class.
Parameters
----------
name : str
class name
... | Python | 0 | @@ -197,16 +197,27 @@
cimals=3
+, args=None
):%0A %22
@@ -800,20 +800,20 @@
%0A if
-len(
+not
param_kv
@@ -817,14 +817,22 @@
_kvs
-) == 0
+ and not args
:%0A
@@ -1079,16 +1079,104 @@
idxs%5D%0A%0A
+ if args is not None:%0A param_kvs = %5B(None, arg) for arg in args%5D + param_kvs%0A%0A
... |
3ce54da38119987c2e23089cca3e14a1664cd0c9 | remove dots at the end of description | python2nix.py | python2nix.py | #!/usr/bin/env python2.7
import sys
import requests
import pip_deps
PACKAGE = """\
{name_only} = pythonPackages.buildPythonPackage rec {{
name = "{name}";
propagatedBuildInputs = [ {inputs} ];
src = fetchurl {{
url = "{url}";
md5 = "{md5}";
}};
meta = with stdenv.lib; {{
desc... | Python | 0.001447 | @@ -2193,16 +2193,28 @@
'%5Cn')%5B0%5D
+.rstrip('.')
%0A hom
|
3f0ab3d63ad0a602b3332b9c83c742caae47289a | Fix test for invalid queue class | tests/test_lib_queue.py | tests/test_lib_queue.py | """
This file contains the tests for the job queue modules.
In particular, this tests
lib/queue/*.py
"""
from huey import RedisHuey
import mock
from privacyidea.app import create_app
from privacyidea.config import TestingConfig
from privacyidea.lib.error import ServerError
from privacyidea.lib.queue import job, JOB_C... | Python | 0.000001 | @@ -1483,13 +1483,18 @@
app_
-fails
+graciously
(sel
@@ -1684,86 +1684,70 @@
-with self.assertRaises(ImportError):%0A create_app(%22testing%22, %22%22)
+app = create_app(%22testing%22, %22%22) # we do not throw an exception
%0A%0A%0Ac
|
04f7b8aa85bf2bb2c16eb246ee7c9d7ae5fc8cff | check contents | tests/test_roundtrip.py | tests/test_roundtrip.py | import json
import bitjws
def test_encode_decode():
key = bitjws.PrivateKey()
ser = bitjws.sign_serialize(key)
header, payload = bitjws.validate_deserialize(ser)
rawheader, rawpayload = ser.rsplit('.', 1)[0].split('.')
origheader = bitjws.base64url_decode(rawheader.encode('utf8'))
origpayload... | Python | 0 | @@ -389,49 +389,352 @@
ader
- == json.loads(origheader.decode('utf8'))
+%5B'typ'%5D == 'JWT'%0A assert header%5B'alg'%5D == 'CUSTOM-BITCOIN-SIGN'%0A assert header%5B'kid'%5D == bitjws.pubkey_to_addr(key.pubkey.serialize())%0A assert len(header) == 3%0A assert header == json.loads(origheader.decode('utf8'))... |
3059e2cf76e2e7bfb90c6c03afc5ee372294de94 | use with_setup instead of setUp/tearDown | tests/test_spotifile.py | tests/test_spotifile.py | import unittest
import os
from subprocess import check_call
from sh import ls
mountpoint = '/tmp/spotifile_test_mount'
class SpotifileTestClass(unittest.TestCase):
@classmethod
def setUpClass(cls):
if not os.path.exists(mountpoint):
os.mkdir(mountpoint)
@classmethod
def tearDownClass(cls):
if os.path.exis... | Python | 0 | @@ -1,29 +1,61 @@
-import unittest%0Aimport os
+from nose import with_setup%0Aimport os%0Afrom os import path
%0Afro
@@ -102,16 +102,21 @@
mport ls
+, cat
%0A%0A%0Amount
@@ -155,98 +155,33 @@
nt'%0A
-class SpotifileTestClass(unittest.TestCase):%0A%09@classmethod%0A%09def setUpClass(cls
+%0Adef fs_mount(
):%0A
-%09... |
c74faacfc91c8925ced63abda00e7e097903e0f7 | Remove stray print statements. | tests/test_table_xls.py | tests/test_table_xls.py | #!/usr/bin/env python
# -*- coding: utf8 -*-
try:
import unittest2 as unittest
except ImportError:
import unittest
import agate
import agateexcel
class TestXLS(agate.AgateTestCase):
def setUp(self):
self.rows = (
(1, 'a', True, '11/4/2015', '11/4/2015 12:22 PM'),
(2, u'👍'... | Python | 0.000022 | @@ -1534,158 +1534,8 @@
')%0A%0A
- self.table.print_table()%0A table.print_table()%0A%0A print('here')%0A%0A print(self.table.rows%5B2%5D)%0A print(table.rows%5B2%5D)%0A%0A%0A
|
eb64546b08bf93c0e1ffc5be8db413a2ebbca621 | correct vasp util unit test | tests/test_vasp_util.py | tests/test_vasp_util.py | import pytest
import os
import sys
import numpy as np
from pymatgen.io.vasp.inputs import Poscar
from pymatgen.io.vasp.outputs import Vasprun
from flare.struc import Structure, get_unique_species
from flare.dft_interface.vasp_util import parse_dft_forces, run_dft, \
edit_dft_input_positions, dft_input_to_structure,... | Python | 0.000001 | @@ -3918,49 +3918,8 @@
')%0A%0A
- structure.vec1 += np.random.randn(3)%0A
|
7fb5b04bb4054f60cefc79efabcef07979628285 | add directory encoding test in test_conf | tests/unit/test_conf.py | tests/unit/test_conf.py | import os
from twisted.trial import unittest
from lbrynet import conf
class SettingsTest(unittest.TestCase):
def setUp(self):
os.environ['LBRY_TEST'] = 'test_string'
def tearDown(self):
del os.environ['LBRY_TEST']
@staticmethod
def get_mock_config_instance():
settings = {'t... | Python | 0.000001 | @@ -39,17 +39,16 @@
nittest%0A
-%0A
from lbr
@@ -2135,28 +2135,452 @@
cedence', settings%5B'test'%5D)%0A
+%0A def test_data_dir(self):%0A # check if these directories are returned as string and not unicode%0A # otherwise there will be problems when calling os.path.join on%0A # unicode directo... |
c81393a8de27595f61cffc09fa6fa8352bb54b9c | Return a random set of factors | palindrome-products/palindrome_products.py | palindrome-products/palindrome_products.py | from collections import defaultdict
def largest_palindrome(max_factor, min_factor=0):
return _palindromes(max_factor, min_factor, max)
def smallest_palindrome(max_factor, min_factor=0):
return _palindromes(max_factor, min_factor, min)
def _palindromes(max_factor, min_factor, minmax):
pals = defaultdic... | Python | 0.999999 | @@ -1,8 +1,22 @@
+import random%0A
from col
@@ -576,16 +576,35 @@
ctors =
+random.choice(list(
pals%5Bval
@@ -606,16 +606,18 @@
s%5Bvalue%5D
+))
%0A ret
|
a1a261a88667c3066fd9e11e7af4673c1fca1b44 | Add tags! Task name and owner to start. | teuthology/run_tasks.py | teuthology/run_tasks.py | import sys
import logging
from teuthology.sentry import get_client as get_sentry_client
from .config import config as teuth_config
log = logging.getLogger(__name__)
def run_one_task(taskname, **kwargs):
submod = taskname
subtask = 'task'
if '.' in taskname:
(submod, subtask) = taskname.rsplit('.'... | Python | 0 | @@ -1262,24 +1262,129 @@
if sentry:%0A
+ tags = %7B%0A 'task': taskname,%0A 'owner': ctx.owner,%0A %7D%0A
@@ -1433,16 +1433,25 @@
ception(
+tags=tags
))%0A
|
45c1446779cbce050573264101b1afe3d7fe42b4 | Update BaseSearchCommand | elasticsearch_django/management/commands/__init__.py | elasticsearch_django/management/commands/__init__.py | # -*- coding: utf-8 -*-
"""Base command for search-related management commands."""
import logging
from django.core.management.base import BaseCommand
from elasticsearch.exceptions import TransportError
logger = logging.getLogger(__name__)
class BaseSearchCommand(BaseCommand):
"""Base class for commands that i... | Python | 0.000001 | @@ -1211,73 +1211,8 @@
ry:%0A
- print %22calling do_index_command%22, index, options%0A
|
7fe12dadbaba23a41664e49a003c328f3d82f67c | bump version and adjust copyright year | s3scan.py | s3scan.py | """
:copyright: (c) 2012 by Mike Taylor
:license: BSD, see LICENSE for more details.
Usage:
python s3scan.py [-k <api_key>] [-s <api_secret>] [-f <format>]
Options:
-k | --key S3 Access Key
-s | --secret S3 Access Secret
-f | --format Output format
[Optional]
Where the output forma... | Python | 0 | @@ -17,16 +17,21 @@
(c) 2012
+-2015
by Mike
@@ -571,17 +571,17 @@
(0, 1,
-0
+1
, '')%0A%0A_
@@ -677,17 +677,22 @@
ight 201
-3
+2-2015
, Mike T
|
f7e6d1a39837458a18c977e4766d831f89aa870d | Correct connection returning behavior | tilequeue/postgresql.py | tilequeue/postgresql.py | from itertools import chain
from itertools import cycle
import psycopg2
import threading
class RoundRobinConnectionFactory(object):
def __init__(self, conn_info, hosts):
self.conn_info = conn_info
self.hosts_gen = iter(cycle(hosts))
def __call__(self, ignored_dsn):
host = self.hosts_... | Python | 0.000001 | @@ -6157,38 +6157,37 @@
-else:%0A
+ continue%0A
|
15a32b91b36c9deba5a4fc1d8c843a5e044b62c3 | remove unnecessary comments and print statements | tdp_core/mapping_table.py | tdp_core/mapping_table.py | import logging
from . import db
import itertools
_log = logging.getLogger(__name__)
class SQLMappingTable(object):
def __init__(self, mapping, engine):
self.from_idtype = mapping.from_idtype
self.to_idtype = mapping.to_idtype
self._engine = engine
self._query = mapping.query
self._integer_ids =... | Python | 0 | @@ -386,127 +386,8 @@
ings
-%0A print(type(ids))%0A # ids = %5Bi.decode('utf-8') for i in ids if not isinstance(i, int)%5D%0A ids = %5Bi for i in ids%5D
%0A%0A
|
0b608d60ecad22dbecdd066fe0930b697b6eee9a | Add collection to tile dirname | tilezilla/cli/ingest.py | tilezilla/cli/ingest.py | # -*- coding: utf-8 -*-
""" CLI to process imagery products to tiles and index in database
"""
import logging
import os
import click
import rasterio
import six
from . import options
from .cliutils import config_to_resources, Echoer
from .. import products, db
from .._util import decompress_to, include_bands
from ..er... | Python | 0 | @@ -696,300 +696,9 @@
ig)%0A
- # TODO: config file should describe the basename of tile directories%0A # TODO: document choice of where these variables come from (Tile)%0A # TODO: parametrize zfill%0A tile_root = os.path.join(config%5B'store'%5D%5B'root'%5D,%0A config%5B'store'%... |
1ce24bd04f4b217e560707bd699bbeb6fe14fe09 | username should be case insensitive | timed/authentication.py | timed/authentication.py | import base64
import functools
import hashlib
import requests
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import SuspiciousOperation
from django.utils.encoding import force_bytes
from mozilla_django_oidc.auth import LOGGER, OIDCAuthenticationBackend
class TimedOID... | Python | 0.999949 | @@ -2967,32 +2967,40 @@
.filter(username
+__iexact
=username)%0A%0A
|
207c5d9b41933a4e08c88c026c4d9e8cba3a1d3a | Display the text if the regexp does not match | weboob/tools/browser2/filters.py | weboob/tools/browser2/filters.py | # -*- coding: utf-8 -*-
# Copyright(C) 2014 Romain Bignon
#
# 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 opti... | Python | 0.999995 | @@ -6109,22 +6109,29 @@
o match
+%25s in
%25s' %25
+(
self.pat
@@ -6134,16 +6134,22 @@
.pattern
+, txt)
)%0A%0A
|
f14c5c9e4a3c7d196421ce3d60ec64fdee4749dd | make arguments consistent | src/redditquery/parse.py | src/redditquery/parse.py | #!/usr/bin/python3
import os
import argparse
def parser():
"""Parses arguments from comman line using argparse.
Parameters"""
# default directory for reddit files
default_directory = os.path.join(os.getcwd(), "data")
parser = argparse.ArgumentParser()
# obligatory
parser.add_argument("mod... | Python | 0.999824 | @@ -480,20 +480,20 @@
t(%22-
-f%22, %22-
-first
+%22, %22-f
%22, t
@@ -560,19 +560,19 @@
t(%22-
-l%22, %22--last
+-last%22, %22-l
%22, t
|
312acba0b6a1efb4a0b4d62c5ac2844608c7f203 | Add basic message scoring algorithm | consequences/facebook.py | consequences/facebook.py | import requests
import sys
import config
import indicoio
import itertools
from pymongo import MongoClient
from collections import namedtuple
sys.path.append('../')
access_token = ''
indicoio.config.api_key = config.INDICO_API_KEY
# Connects to mongo and returns a MongoClient
def connect_to_mongo():
host = conf... | Python | 0.00034 | @@ -1598,23 +1598,1098 @@
= 1%0A
+%0A
-return base
+sentiment_score = 1 / sentiment%0A%0A likes_score = 0.1 * likes%0A%0A bonus_tags = %7B%0A 'anime': 1,%0A 'art': 1,%0A 'atheism': 1,%0A 'business': 1,%0A 'consipiracy': 1,%0A 'drugs': 1,%0A ... |
60202e6a4b51fb68045ee1df859c0827f5b770e4 | debug info | src/zeit/content/article/edit/body.py | src/zeit/content/article/edit/body.py | # Copyright (c) 2010 gocept gmbh & co. kg
# See also LICENSE.txt
import gocept.lxml.interfaces
import grokcore.component
import lxml.objectify
import uuid
import z3c.traverser.interfaces
import zeit.content.article.edit.interfaces
import zeit.content.article.interfaces
import zeit.edit.container
import zope.publisher.... | Python | 0.000001 | @@ -2312,16 +2312,52 @@
, key):%0A
+ __traceback_info__ = (key,)%0A
|
2a8b560b1abcca6dd93e86a893fc6b2d8b224dd5 | break definition of url_map and dispatcher out of __init__ | werkzeug_dispatch/application.py | werkzeug_dispatch/application.py | # -*- coding: utf-8 -*-
"""
werkzeug_dispatch.application
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2014 by Ben Mather.
:license: BSD, see LICENSE for more details.
"""
try:
from functools import singledispatch
except:
from singledispatch import singledispatch
from werkzeug import Request
fro... | Python | 0 | @@ -389,16 +389,59 @@
lManager
+%0Afrom werkzeug.utils import cached_property
%0A%0Afrom w
@@ -916,216 +916,31 @@
-def __init__(self, url_map=None, dispatcher=None):%0A %22%22%22%0A :param url_map:%0A a werkzeug %60Map%60 object%60%0A%0A :param dispatcher:%0A a %60Disp... |
deeb9a1cc773e7af4c539d3f451ab927ecea29ed | Check for uploader | whippersnapper/whippersnapper.py | whippersnapper/whippersnapper.py | #!/usr/bin/env python
import logging
import os
import subprocess
import sys
import time
import yaml
import screenshotter
import uploader
class WhipperSnapper(object):
"""
Implements all screenshot-related logic.
"""
def __init__(self):
if len(sys.argv) != 2:
self.usage()
... | Python | 0 | @@ -955,16 +955,62 @@
shots()%0A
+ if hasattr(self, 'uploader'):%0A
@@ -1055,16 +1055,20 @@
argets)%0A
+
@@ -1137,16 +1137,20 @@
+
+
if (self
@@ -1186,16 +1186,20 @@
ges')):%0A
+
|
2797797497f4f5ad606764815b334321732bef3b | Rename fibonacci() to fibonacci_recur() | alg_fibonacci.py | alg_fibonacci.py | """Fibonacci series:
0, 1, 1, 2, 3, 5, 8,...
- Fib(0) = 0
- Fib(1) = 1
- Fib(n) = Fib(n - 1) + Fib(n - 2)
"""
from __future__ import print_function
def fibonacci(n):
"""Get nth number of Fibonacci series by recursion."""
if n == 0:
return 0
elif n == 1 or n == 2:
return 1
else:
... | Python | 0.999999 | @@ -134,23 +134,93 @@
ort
-print_function%0A
+absolute_import%0Afrom __future__ import print_function%0Afrom __future__ import division
%0A%0Ade
@@ -230,16 +230,22 @@
ibonacci
+_recur
(n):%0A
@@ -313,12 +313,12 @@
f n
-== 0
+%3C= 1
:%0A
@@ -334,53 +334,9 @@
urn
-0%0A elif n == 1 or n == 2:%0A r... |
b5099530084deb61fcb9e60314579dd0daed79b5 | maven_jar compatibility to rules_closure#java_import_external | tools/bzl/maven_jar.bzl | tools/bzl/maven_jar.bzl | GERRIT = "GERRIT:"
GERRIT_API = "GERRIT_API:"
MAVEN_CENTRAL = "MAVEN_CENTRAL:"
MAVEN_LOCAL = "MAVEN_LOCAL:"
def _maven_release(ctx, parts):
"""induce jar and url name from maven coordinates."""
if len(parts) not in [3, 4]:
fail('%s:\nexpected id="groupId:artifactId:version[:classifier]"'
% ctx.attr... | Python | 0.999998 | @@ -1803,32 +1803,33 @@
erate_build_file
+s
(ctx, binjar, sr
@@ -1835,16 +1835,112 @@
rcjar):%0A
+ header = %22# DO NOT EDIT: automatically generated BUILD file for maven_jar rule %25s%22 %25 ctx.name%0A
srcjar
@@ -2028,87 +2028,15 @@
%22%22%22%0A
-# DO NOT EDIT: automatically generated BUILD file for maven_jar... |
0d7dc04a4e0c31924e64f8e2b8ed9da25e2b64ce | Fix PEP8 issues | wikidataeditor/wikidataeditor.py | wikidataeditor/wikidataeditor.py | # encoding=utf8
# @author Dan Michael O. Heggø <danmichaelo@gmail.com>
__ver__ = '0.0.1'
import requests
import logging
import time
import re
import json
from item import Item
logger = logging.getLogger('wikidataeditor')
class Repo:
def __init__(self, user_agent,
api_url='https://www.wikidata... | Python | 0.000001 | @@ -68,27 +68,8 @@
om%3E%0A
-__ver__ = '0.0.1'%0A%0A
impo
@@ -129,17 +129,16 @@
rt json%0A
-%0A
from ite
@@ -152,16 +152,35 @@
t Item%0A%0A
+__ver__ = '0.0.1'%0A%0A
logger =
|
ec1d0b5673ef0eca398715eb1f48f1a99f427cca | Format detect_targets.py | tools/detect_targets.py | tools/detect_targets.py | #! /usr/bin/env python2
"""
mbed SDK
Copyright (c) 2011-2013 ARM 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 applicabl... | Python | 0.000002 | @@ -595,27 +595,8 @@
se.%0A
-%0A%0ATEST BUILD & RUN%0A
%22%22%22%0A
@@ -619,20 +619,8 @@
t os
-%0Aimport json
%0A%0ARO
@@ -713,17 +713,16 @@
ROOT)%0A%0A
-%0A
from too
@@ -1061,34 +1061,41 @@
t%0A%0A%0A
-if __name__ == '__main__':
+def main():%0A %22%22%22Entry Point%22%22%22
%0A
@@ -1249,32 +1249,34 @@
... |
d484d4e1782a5552e10f91ff25b6acd6d36b07ae | Rename variables; exit if not support it | wonderful_bing/wonderful_bing.py | wonderful_bing/wonderful_bing.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
wonderful_bing
~~~~~~~~~~~~~~
Wonderful_bing is a small and simple program that helps you download
pictures from Bing and set as wallpaper. My first python program :)
:copyright: (c) 2014 by lord63.
:license: MIT, see LICENSE for more details.
... | Python | 0 | @@ -2101,41 +2101,92 @@
de
- = self.detect_de()%0A if de
+sktop_environment = self.detect_desktop_environment()%0A if desktop_environment
==
@@ -2440,16 +2440,33 @@
elif de
+sktop_environment
== 'xfc
@@ -2578,22 +2578,16 @@
-
/backdro
@@ -2705,20 +2705,279 @@
-pass
+sy... |
985dc40970ca236238b481d70dd94098c2c44167 | Wrap all zmq messages in json | admin/web.py | admin/web.py | import os
import os.path
import sys
import tornado.auth
import tornado.escape
import tornado.ioloop
import tornado.web
import tornado.httpserver
import tornado.options as options
from tornado.concurrent import Future
from tornado import gen
from tornado.options import define, options
import sockjs.tornado
import adm... | Python | 0.999999 | @@ -4016,17 +4016,17 @@
lay = 1e
-9
+3
# ms%0A%0A
@@ -5374,16 +5374,20 @@
+raw_
response
@@ -5405,24 +5405,155 @@
ket.recv()%0A%0A
+ response = json_util.dumps(%7B%0A 'type': 'mount',%0A 'message': raw_response.decode('ascii'),%0A %7D)%0A%0A
# Se
@@ -6191,16 ... |
228c726baa9742f8ed99b543443c5ff96729e054 | Move bool test above int test, because bool is a subclass of int | ext/dcos-installer/dcos_installer/config/__init__.py | ext/dcos-installer/dcos_installer/config/__init__.py | """
Configuration loader for dcosgen
Set all configuration for a given run with a simple map
my_opts = {
'config_dir': '/tmp'
}
c = DcosConfig()
print(c)
"""
import json
import logging
import os
import yaml
from dcos_installer.util import CONFIG_PATH, SSH_KEY_PATH, IP_DETECT_PATH
log = logging.getLogger(__name__... | Python | 0.998967 | @@ -4905,19 +4905,20 @@
(value,
-int
+bool
):%0A
@@ -4932,92 +4932,17 @@
-log.debug(%22Caught int for genconf configuration, transforming to string: %25s%22,
+if
value
-)
+:
%0A
@@ -4954,24 +4954,28 @@
+
value =
str(valu
@@ -4970,19 +4970,19 @@
e =
-str(value)%0A
+'true'%0A
... |
ebbcce590483a5970268db0c59bae0cec81648ad | Add example commands for the User Preferences api | storyboard/api/v1/user_preferences.py | storyboard/api/v1/user_preferences.py | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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... | Python | 0.000002 | @@ -1481,16 +1481,158 @@
user.%0A%0A
+ Example::%0A%0A curl https://my.example.org/api/v1/users/21/preferences %5C%5C%0A -H 'Authorization: Bearer MY_ACCESS_TOKEN'%0A%0A
@@ -2269,16 +2269,288 @@
leted.%0A%0A
+ Example::%0A%0A curl https://my.example.org/api/v1/users... |
839ff975b9d3cf29acd9c921e1b7c3722290d98a | Use np.nan_to_num instead of 'if x == 0' in _xlog2x | antropy/utils.py | antropy/utils.py | """Helper functions"""
import numpy as np
from numba import jit
from math import log, floor
all = ['_embed', '_linear_regression', '_log_n', '_xlog2x']
def _embed(x, order=3, delay=1):
"""Time-delay embedding.
Parameters
----------
x : 1d-array
Time series, of shape (n_times)
order : int... | Python | 0.000628 | @@ -2678,22 +2678,8 @@
)%0A%0A%0A
-@np.vectorize%0A
def
@@ -2874,27 +2874,22 @@
urn
-0.0 if x == 0 else
+np.nan_to_num(
x *
@@ -2898,9 +2898,19 @@
.log2(x)
+, nan=0.0)
%0A
|
f0ab4ecbc2e385dd69d644b6f8e4e41cdaa48423 | Add note. | software_engineering/problem_solving/design_patterns/grasp/pattern_pure_fabrication.py | software_engineering/problem_solving/design_patterns/grasp/pattern_pure_fabrication.py | # -*- coding: utf-8 -*-
__author__ = """Chris Tabor (dxdstudio@gmail.com)"""
if __name__ == '__main__':
from os import getcwd
from os import sys
sys.path.append(getcwd())
from helpers.display import Section
from uuid import uuid1
from random import choice
from random import randrange as rr
DEBUG = True ... | Python | 0 | @@ -761,16 +761,143 @@
y on it.
+%0A%0A It can be though of as a service-like layer of indirection:%0A%0A entity %3C------%3E entity_service %3C------%3E data-store%0A%0A
%22%22%22%0A%0A
|
705e7f1d68e4fb6bf37db623869a2c6d623dd9ae | use a pytest fixture for the CommandManager related tests | sunpy/tests/database/test_commands.py | sunpy/tests/database/test_commands.py | from __future__ import absolute_import
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import pytest
from sunpy.database.commands import AddEntry, RemoveEntry, EditEntry,\
NoSuchEntryError, CommandManager
from sunpy.database.tables import DatabaseEntry
@pytest.fixture
def session():... | Python | 0 | @@ -551,24 +551,93 @@
d=engine)%0A%0A%0A
+@pytest.fixture%0Adef command_manager():%0A return CommandManager()%0A%0A%0A
def test_add
@@ -2690,46 +2690,40 @@
sion
-):%0A manager = C
+, c
ommand
-M
+_m
anager
-(
)
+:
%0A
+command_
mana
@@ -2765,24 +2765,32 @@
try()))%0A
+command_
manager.do(A
@@ -2... |
5883b249fa1ade49ad2e57dd8b39f79a4e5c5ed8 | Better handling of {{{None}}}, {{{True}}} and {{{False}}} in the HDF wrapper. | trac/web/clearsilver.py | trac/web/clearsilver.py | # -*- coding: iso8859-1 -*-
#
# Copyright (C) 2005 Edgewall Software
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
#
# Trac 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 2 of the
# Lic... | Python | 0.999992 | @@ -4708,32 +4708,184 @@
%0A if
+value == None or value == False:%0A return%0A elif value == True:%0A self.hdf.setValue(prefix, '1')%0A elif
isinstance(value
|
db31ec971f092c9b9a6171b7de727ce47739ec6a | Fix an issue where the lldbinit parsing logic throws an out of range error when the lldbinit contained content after the tulsi block. | src/TulsiGenerator/Scripts/bootstrap_lldbinit.py | src/TulsiGenerator/Scripts/bootstrap_lldbinit.py | #!/usr/bin/python
# Copyright 2018 The Tulsi 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 requi... | Python | 0.000012 | @@ -2793,32 +2793,62 @@
ist.%0A if
+source_idx %3C= source_last and
source_lines%5Bsou
@@ -3198,35 +3198,16 @@
g = True
-%0A continue
%0A%0A
|
aa278487b4e65da413a217729b852a9c08a090cf | create function headers and change request structure | pagarme/resources/handler_request.py | pagarme/resources/handler_request.py | import requests
import json
TEMPORARY_COMPANY = 'https://api.pagar.me/1/companies/temporary'
def validate_response(pagarme_response):
if pagarme_response.status_code == 200:
return pagarme_response.json()
else:
return error(pagarme_response.json())
def create_temporary_company():
compan... | Python | 0 | @@ -13,19 +13,8 @@
sts%0A
-import json
%0A%0ATE
@@ -891,59 +891,8 @@
y'%5D%0A
- headers = %7B'content-type': 'application/json'%7D%0A
@@ -935,37 +935,25 @@
_point,
-data=json.dumps(
+json=
data
-)
, header
@@ -953,32 +953,34 @@
headers=headers
+()
)%0A return val
@@ -1087,59 +1087,8 @@
y'%5D%0A
-... |
99641c5052a944e887fb786983e5575301c604a2 | Replace _face_distance with more efficient calculation (#19) | face_recognition/api.py | face_recognition/api.py | # -*- coding: utf-8 -*-
import scipy.misc
import dlib
import numpy as np
try:
import face_recognition_models
except:
print("Please install `face_recognition_models` with this command before using `face_recognition`:")
print()
print("pip install git+https://github.com/ageitgey/face_recognition_models")... | Python | 0.005834 | @@ -2204,18 +2204,8 @@
urn
-np.array(%5B
np.l
@@ -2219,16 +2219,17 @@
orm(face
+s
- face_
@@ -2242,28 +2242,16 @@
pare
-) for face in faces%5D
+, axis=1
)%0A%0A%0A
|
5c05b933d88f3aa819660755360923fa10f8fcf3 | Allow passing extra environment files when scaling nodes | tripleo_common/scale.py | tripleo_common/scale.py | # Copyright 2015 Red Hat, 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 applicable law ... | Python | 0.000007 | @@ -1047,16 +1047,40 @@
dir=None
+, environment_files=None
):%0A
@@ -1216,16 +1216,67 @@
tht_dir%0A
+ self.environment_files = environment_files%0A
@@ -4251,16 +4251,175 @@
_name))%0A
+ env_paths = %5Bos.path.join(self.tht_dir, env_name)%5D%0A if self.environment_files:%0... |
6e257cef321023934477d95903d0b75c218c9264 | Remove extra `max_length` from ticket `background`. | api_v3/models.py | api_v3/models.py | from django.db import models
from django.conf import settings
from activity.models import Action # noqa
from core.countries import COUNTRIES
from accounts.models import Profile # noqa
from ticket.constants import REQUESTER_TYPES, TICKET_STATUS, TICKET_TYPES
class Responder(models.Model):
"""Intermediate model ... | Python | 0.000011 | @@ -2348,33 +2348,16 @@
nk=False
-, max_length=1000
)%0A%0A #
|
4acce9768d0dee9df75dc28806149bc4a7663d24 | fix #433 | datajoint/jobs.py | datajoint/jobs.py | from .hash import key_hash
import os
import pymysql
from .base_relation import BaseRelation
from . import DataJointError
ERROR_MESSAGE_LENGTH = 2047
TRUNCATION_APPENDIX = '...truncated'
class JobTable(BaseRelation):
"""
A base relation with no definition. Allows reserving jobs
"""
def __init__(self, ... | Python | 0.000001 | @@ -1,12 +1,41 @@
+from _decimal import Decimal%0A
from .hash i
@@ -49,16 +49,16 @@
ey_hash%0A
-
import o
@@ -2060,32 +2060,199 @@
f.drop_quick()%0A%0A
+ @staticmethod%0A def packable_or_none(key):%0A for v in key.values():%0A if isinstance(v, Decimal):%0A return None%0A ... |
cfae8d0430f3e3be1a67ff81dd7e3d8d74e8a7a8 | Remove spaces. | partner_create_by_vat/res_partner.py | partner_create_by_vat/res_partner.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Romanian accounting localization for OpenERP V7
# @author - Fekete Mihai, Tatár Attila <atta@nvm.ro>
# Copyright (C) 2011-2013 TOTAL PC SYSTEMS (http://www.www.erpsystems.ro).
# Copyright (C)... | Python | 0.000771 | @@ -3539,33 +3539,8 @@
vat)
- %0A
%0A%0A
|
1431a54d77ebded23b0842b219dc011ac080c471 | update django 1.3 deprecated context processor & template loader | findingaids/settings.py | findingaids/settings.py | from os import path
import os
os.environ['CELERY_LOADER'] = 'django'
# use a differently-named default queue to keep separate from other projects using celery
CELERY_DEFAULT_QUEUE = 'findingaids'
#Logger Setup
#Add custom logging level to allow us to tun off logging via tha config file
import logging
logging.NOLOG =... | Python | 0 | @@ -196,181 +196,8 @@
'%0A%0A%0A
-#Logger Setup%0A#Add custom logging level to allow us to tun off logging via tha config file%0Aimport logging%0Alogging.NOLOG = 60%0Alogging.addLevelName(logging.NOLOG, %22NOLOG%22)%0A%0A%0A%0A
# Ge
@@ -474,36 +474,22 @@
esystem.
-l
+L
oad
-_template_sourc
e
+r
',%0A '
@@ -250... |
ca076bbd397edd87fd1a26ee119ac29622868f03 | Fix test | paystackapi/tests/test_bulkcharge.py | paystackapi/tests/test_bulkcharge.py | import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.bulkcharge import BulkCharge
class TestBulkCharge(BaseTestCase):
@httpretty.activate
def test_initiate_bulk_charge(self):
""" Method for testing the initiation of a bulk charge"""
httpretty.register_u... | Python | 0.000004 | @@ -872,28 +872,16 @@
est_list
-_bulk_charge
(self):%0A
@@ -1057,33 +1057,32 @@
body =
-
'%7B%22status%22: true
@@ -1110,33 +1110,32 @@
arges retrieved%22
-,
%7D',%0A
@@ -1442,24 +1442,16 @@
8vtp80hx
-/charges
%22),%0A
@@ -1500,19 +1500,17 @@
body
- =
+=
'%7B%22statu
@@ -1546,3... |
65837af3a7af766af695eb2a934b5bb7a451bfcb | Remove mongodb from google_set | perfkitbenchmarker/benchmark_sets.py | perfkitbenchmarker/benchmark_sets.py | # Copyright 2014 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 applicable law or agr... | Python | 0.000002 | @@ -2796,32 +2796,16 @@
oldisim'
-, 'mongodb_ycsb'
%5D%0A %7D,
|
c838bee36ac1e68afd5f00630b98f806289f89c8 | Update fetch_metrics.py | perfmetrics/scripts/fetch_metrics.py | perfmetrics/scripts/fetch_metrics.py | """Executes fio_metrics.py and vm_metrics.py by passing appropriate arguments.
"""
import socket
import sys
import time
from fio import fio_metrics
from vm_metrics import vm_metrics
from gsheet import gsheet
INSTANCE = socket.gethostname()
PERIOD = 120
# Google sheet worksheets
FIO_WORKSHEET_NAME = 'fio_metrics'
VM_W... | Python | 0.000001 | @@ -240,16 +240,20 @@
)%0APERIOD
+_SEC
= 120%0A%0A
@@ -1435,16 +1435,20 @@
, PERIOD
+_SEC
, rw)%0A
|
597ea6bd20c9c1dbca46891d8c2aa12c625da555 | Fix unit tests | Tests/ConsoleWorkerTest.py | Tests/ConsoleWorkerTest.py | import TankTests
import os
import unittest
from Tank.ConsoleWorker import ConsoleTank
from Tests.TankTests import FakeOptions
from Tank.Plugins.DataUploader import DataUploaderPlugin
from Tests.DataUploaderTest import FakeAPICLient
from Tank.Plugins.ConsoleOnline import ConsoleOnlinePlugin
from Tests.ConsoleOnlinePlugi... | Python | 0.000005 | @@ -1,47 +1,4 @@
-import TankTests%0Aimport os%0Aimport unittest%0A
from
@@ -46,41 +46,60 @@
om T
-ests.TankTests import FakeOptions
+ank.Plugins.ConsoleOnline import ConsoleOnlinePlugin
%0Afro
@@ -167,139 +167,126 @@
sts.
-DataUploaderTest import FakeAPICLient%0Afrom Tank.Plugins.ConsoleOnline import ConsoleOnline... |
bdbb364c182920e1274d401e6a114267cdd9d0bb | Version 0.11.0 | flask_dance/__init__.py | flask_dance/__init__.py | # coding=utf-8
from __future__ import unicode_literals
from .consumer import OAuth1ConsumerBlueprint, OAuth2ConsumerBlueprint
__version__ = "0.10.1"
| Python | 0.000001 | @@ -139,13 +139,13 @@
_ = %220.1
-0.1
+1.0
%22%0A
|
8a4d259df272a65f95bacf233dc8654c68f5f54f | add identity coordinate mapping to ToUint8 and ToFloat32 augmentors (#339) | tensorpack/dataflow/imgaug/convert.py | tensorpack/dataflow/imgaug/convert.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: convert.py
from .base import ImageAugmentor
from .meta import MapImage
import numpy as np
import cv2
__all__ = ['ColorSpace', 'Grayscale', 'ToUint8', 'ToFloat32']
class ColorSpace(ImageAugmentor):
""" Convert into another colorspace. """
def __init__(se... | Python | 0 | @@ -1463,16 +1463,29 @@
p.uint8)
+, lambda x: x
)%0A%0A%0Aclas
@@ -1678,10 +1678,23 @@
float32)
+, lambda x: x
)%0A
|
1e7a6b0fbbdb57053d3510b67c95c5d7e2fb6b81 | Enable to display accuracy graph | floppy/report_widget.py | floppy/report_widget.py | from floppy.train_configuration import TrainParamServer
from PyQt5.QtWidgets import QWidget
from PyQt5.QtGui import QPixmap
from PyQt5.QtGui import QPainter
from PyQt5.QtCore import Qt
from PyQt5.QtCore import QPoint
class ReportWidget(QWidget):
def __init__(self, *args, **kwargs):
super(ReportWidget, s... | Python | 0.000001 | @@ -86,16 +86,55 @@
QWidget%0A
+from PyQt5.QtWidgets import QTabWidget%0A
from PyQ
@@ -272,16 +272,19 @@
Widget(Q
+Tab
Widget):
@@ -377,17 +377,17 @@
height=2
-0
+1
0, *args
@@ -654,109 +654,825 @@
elf.
-pixmap = QPixmap(loss_image)%0A self.resize(200, 200)%0A%0A def paintEvent(self, event):%0A ... |
ec82c7d7181803f577adb1a697ed53fbc42476ca | add goliad health check | plugins/bongo/check-goliad-health.py | plugins/bongo/check-goliad-health.py | #!/usr/bin/env python
from optparse import OptionParser
import socket
import sys
import httplib
import json
PASS = 0
WARNING = 1
FAIL = 2
def get_bongo_host(server, app):
try:
con = httplib.HTTPConnection(server, timeout=45)
con.request("GET","/v2/apps/" + app)
data = con.getresponse()
... | Python | 0 | @@ -888,21 +888,22 @@
/health/
-betty
+goliad
/%22 + gro
@@ -1931,21 +1931,22 @@
efault=%22
-betty
+goliad
.useast.
@@ -1970,13 +1970,14 @@
of
-betty
+goliad
Con
|
335abb7a4ddeabf9175b522d9336b94b7e32acc0 | Fix incorrect FAIL data. | test/broker/01-connect-anon-denied.py | test/broker/01-connect-anon-denied.py | #!/usr/bin/python
# Test whether an anonymous connection is correctly denied.
import subprocess
import socket
import time
from struct import *
rc = 1
keepalive = 10
connect_packet = pack('!BBH6sBBHH17s', 16, 12+2+17,6,"MQIsdp",3,2,keepalive,17,"connect-anon-test")
connack_packet = pack('!BBBB', 32, 2, 0, 5);
broker... | Python | 0.002419 | @@ -733,17 +733,17 @@
32,2,0,
-0
+5
got %22 +
|
19b6207f6ec2cefa28e79fb10639d1d1f5602d2c | clean up test | app/app/tests.py | app/app/tests.py | import unittest
import transaction
import os
import app
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep
from pyramid import testing
from .models import DBSession
DEFAULT_WAIT = 5
SCREEN_DUMP_LOCATION = os.path.join(
os.path.dirname(os.path.abspath(__file__)),... | Python | 0.000001 | @@ -1363,16 +1363,17 @@
om_in':
+'
self.bro
@@ -1430,32 +1430,33 @@
oom-in%22).click()
+'
,%0A 'z
@@ -1465,16 +1465,17 @@
m_out':
+'
self.bro
@@ -1541,16 +1541,17 @@
.click()
+'
,%0A
@@ -1570,16 +1570,17 @@
_down':
+'
map_.sen
@@ -1602,16 +1602,17 @@
OW_DOWN)
+'
,%0A
@@ -1628,24 +1... |
e7b53fcaaaed7f59534775e2e35f75a562354e79 | Add a UTC timezone to the TIMESTAMPs retrieved from MySQL, in addition to the UNIX epochs we synthesise. | app/dbqueries.py | app/dbqueries.py | from datetime import datetime, tzinfo, timedelta
from MySQLdb import escape_string
from common.dbconn import ResultSet, ResultSetSlice
class UTC(tzinfo):
"""
A timezone representing Coordinated Universal Time (UTC).
"""
def utcoffset(self, dt):
"""
UTC is always 0 offset from UTC.
... | Python | 0 | @@ -2898,16 +2898,35 @@
stamp(0)
+%0A return row
.replace
@@ -2941,35 +2941,16 @@
= UTC())
-%0A return row
%0A%0A @c
|
3e5641470afd3c1aea6273c47bc6fb9c326a8d79 | FIx srv.bin to work -- listens on 0.0.0.0 | bin/srv.py | bin/srv.py | #!/usr/bin/env python
# vim: set encoding=utf-8
"""
Main server program.
"""
from __future__ import print_function
from gevent.wsgi import WSGIServer
from gevent.monkey import patch_all
patch_all()
# pylint: disable=wrong-import-position,wrong-import-order
import sys
import logging
import os
import requests
import... | Python | 0 | @@ -122,16 +122,18 @@
gevent.
+py
wsgi imp
@@ -6321,16 +6321,23 @@
erver((%22
+0.0.0.0
%22, 8002)
|
9de0a05d28c83742224c0e708e80b8add198a8a8 | Add user data export for comments | froide/comments/apps.py | froide/comments/apps.py | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class CommentConfig(AppConfig):
name = 'froide.comments'
verbose_name = _('Comments')
def ready(self):
from froide.account import account_canceled
account_canceled.connect(cancel_user)
def cancel_... | Python | 0 | @@ -1,20 +1,33 @@
+import json%0A%0A
from django.apps imp
@@ -265,16 +265,67 @@
canceled
+%0A from froide.account.export import registry
%0A%0A
@@ -364,16 +364,60 @@
l_user)%0A
+ registry.register(export_user_data)%0A
%0A%0Adef ca
@@ -624,24 +624,24 @@
r_email='',%0A
-
user
@@ -654,8 ... |
4a201a37318d5eea1e50e0619580a23f37e2e7da | Fix path for boringssl | libwebsockets.gyp | libwebsockets.gyp | {
'targets': [
{
'target_name': 'libwebsockets',
'type': 'static_library',
'standalone_static_library': 1,
'sources': [
'lib/base64-decode.c',
'lib/handshake.c',
'lib/libwebsockets.c',
'lib/service.c',
'lib/pollfd.c',
'lib/output.c',
... | Python | 0.000013 | @@ -824,21 +824,8 @@
ot)/
-chromium/src/
thir
|
eed4faf3bfe670421e7dc9c3065adbfceef0d2b6 | fix test for heapify | linear_heapify.py | linear_heapify.py | # Building hash in O(n) time and O(1) additional space. Inspired by https://www.youtube.com/watch?v=MiyLo8adrWw
def heapify(a):
for i in range(len(a) // 2, -1, -1):
parent = i
while True:
candidates = [parent, 2 * parent + 1, 2 * parent + 2]
candidates = [e for e in candid... | Python | 0.000005 | @@ -634,14 +634,8 @@
19%5D%0A
-print(
heap
@@ -642,10 +642,20 @@
ify(arr)
+%0Aprint(arr
)%0A
|
b113cf82004b608b371d1a249801340f57195587 | add __str__. | linguist/cache.py | linguist/cache.py | # -*- coding: utf-8 -*-
class CachedTranslation(object):
def __init__(self, **kwargs):
from .models import Translation
self.instances = ['instance', 'translation']
self.fields = Translation._meta.get_all_field_names()
self.fields.remove('id')
attrs = self.fields + self.... | Python | 0.000011 | @@ -17,17 +17,108 @@
f-8 -*-%0A
-%0A
+from django.utils.encoding import python_2_unicode_compatible%0A%0A%0A@python_2_unicode_compatible
%0Aclass C
@@ -1800,8 +1800,178 @@
ields))%0A
+%0A def __str__(self):%0A return '%25s:%25s:%25s:%25s' %25 (%0A self.identifier,%0A self.object_id,%0... |
2466ca9839aaf1b5cfe98312c015a2defea71971 | to 0.1.0 | loris/__init__.py | loris/__init__.py | # __init__.py
__version__ = '0.1.0dev'
| Python | 0.999999 | @@ -31,9 +31,6 @@
.1.0
-dev
'%0A
|
fc059403c95dd3180f9e51f0d48be80a84504301 | Add reader from documentation for csv files | mailbox_filter.py | mailbox_filter.py | #!/usr/bin/python
# Arguments:
# <sample_mbox.csv> <filter_out.csv> <phrases.csv> <file_to_write_occurances_of_phrases.csv>(by default "phrase_occurances.csv")
import pandas as pd
import sys
import re
from collections import defaultdict
def search_for_phrases_in(questions, phrases):
phrases_count = defaultdict(lam... | Python | 0 | @@ -232,16 +232,27 @@
aultdict
+%0Aimport csv
%0A%0Adef se
@@ -2185,24 +2185,25 @@
.argv%5B2%5D, %22r
+b
%22) as filter
@@ -2209,16 +2209,69 @@
r_file:%0A
+%09%09%09reader = csv.reader(filter_file, delimiter = ',')%0A
%09%09%09filte
@@ -2282,32 +2282,35 @@
t_emails = %5Bline
+%5B0%5D
.strip() for lin
@@ -2314,2... |
615fd3b0b7d67905cf4568971602c6dfd7c5eff3 | Remove outdated code from `fs.sshfs.error_tools` | fs/sshfs/error_tools.py | fs/sshfs/error_tools.py | # coding: utf-8
"""Utils to work with `paramiko` errors.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import errno
import sys
import six
from .. import errors
class _ConvertSSHFSErrors(object):
"""Context manager to convert OSErrors in to FS Errors."""
FILE_ERRORS = {... | Python | 0.000002 | @@ -1426,210 +1426,8 @@
ed%0A%0A
- # if _WINDOWS_PLATFORM: # pragma: no cover%0A # DIR_ERRORS%5B13%5D = errors.DirectoryExpected%0A # DIR_ERRORS%5B267%5D = errors.DirectoryExpected%0A # FILE_ERRORS%5B13%5D = errors.FileExpected%0A%0A
@@ -1974,206 +1974,8 @@
ed)%0A
- if _errno... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.