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 |
|---|---|---|---|---|---|---|---|
fd87c6225f9f6be19b651d700644829430cbda77 | fix typo | tests/test_detector_spacy.py | tests/test_detector_spacy.py | import sys
import unittest
from scrubadub import Scrubber
from scrubadub.filth import NameFilth, OrganizationFilth, LocationFilth, Filth
from base import BaseTestCase
class NamedEntityTestCase(unittest.TestCase, BaseTestCase):
"""
Tests whether the detector is performing correctly from a function point of vi... | Python | 0.999991 | @@ -3267,10 +3267,10 @@
ocum
-n
e
+n
t_na
|
9a1eb2dbe37c13c82477ed5787eeb985994cac8f | add Python2 shebang to helper.py | scripts/helper.py | scripts/helper.py | # -*- coding: utf-8 -*-
"""
scripts.init_webhook
~~~~~~~~~~~~~~~~~~~~
A simple script to manage the webhook.
:copyright: (c) 2016 by Lujeni.
:license: BSD, see LICENSE for more details.
"""
import argparse
import sys
from trello import TrelloClient
from slugify import slugify
from matterllo.util... | Python | 0.000002 | @@ -1,8 +1,31 @@
+#!/usr/bin/env python2%0A
# -*- co
|
35ee18926743b6ab0356ef278da9cb14a3263246 | Print field in output | jjvm.py | jjvm.py | #!/usr/bin/python
import argparse
import os
import struct
import sys
CP_STRUCT_SIZES = { 7:3, 10:5 }
###############
### CLASSES ###
###############
class MyParser(argparse.ArgumentParser):
def error(self, message):
sys.stderr.write('error: %s\n' % message)
self.print_help()
sys.exit(2)
... | Python | 0.000279 | @@ -732,16 +732,30 @@
)%5B0%5D - 1
+%0A cpIndex = 1
%0A%0A prin
@@ -808,18 +808,24 @@
e cp
+Index %3C= cp
Count
- %3E= 0
:%0A
@@ -865,28 +865,40 @@
nt %22
-Got tag: %25d%22 %25
+Field %25d: %25d%22 %25 (cpIndex,
cpTag
+)
%0A
@@ -1048,24 +1048,26 @@
exit(1)%0A%0A
+ #
print %22Size
@@ -1100,15 +1100... |
78e4e0294673e71b552e2b793a2188e3f419206e | Update emon_AZURE_HA.py | azure/ha/emon_AZURE_HA.py | azure/ha/emon_AZURE_HA.py | #!/usr/bin/python
# F5 Networks - External Monitor: Azure HA
# https://github.com/ArtiomL/f5networks
# Artiom Lichtenstein
# v0.4, 04/08/2016
import json
import os
import requests
from signal import SIGKILL
from subprocess import call
import sys
# Log level to /var/log/ltm
intLogLevel = 2
strLogID = '[-v0.4.160804-] ... | Python | 0.000001 | @@ -358,24 +358,41 @@
%0AstrSubs = '
+%3CSubscription ID%3E
'%0AstrTenantI
@@ -392,24 +392,34 @@
TenantID = '
+%3CTenantID%3E
'%0AstrAppID =
@@ -416,24 +416,32 @@
strAppID = '
+%3CApp ID%3E
'%0AstrPass =
@@ -441,16 +441,26 @@
Pass = '
+%3CPassword%3E
'%0AstrTok
|
6ef4d27f2c6fd1f6a5b48ff3e07e7613a3c9d49e | fix cloning query | django_sphinx_db/backend/models.py | django_sphinx_db/backend/models.py | import re
from django.conf import settings
from django.db import models, connections
from django.db.models.sql import Query, AND
from django.db.models.query import QuerySet
from django_sphinx_db.backend.sphinx.compiler import SphinxWhereNode, SphinxExtraWhere
def sphinx_escape(value):
if type(value) not in (str, ... | Python | 0.000006 | @@ -881,39 +881,40 @@
clone(klass=
-None
+klass
, memo=
-None
+memo
, **kwargs)%0A
|
c1e71c1dce83b5c5de28c69a8eea4634df599d52 | Update worker state transitions | plugins/worker/server/__init__.py | plugins/worker/server/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | Python | 0.000001 | @@ -1474,16 +1474,111 @@
ons = %7B%0A
+ JobStatus.QUEUED: %5BJobStatus.INACTIVE%5D,%0A JobStatus.RUNNING: %5BJobStatus.QUEUED%5D,%0A
@@ -2095,16 +2095,18 @@
re allow
+ed
for rev
@@ -2212,16 +2212,80 @@
RUNNING%5D
+,%0A JobStatus.SUCCESS: %5BJobStatus.RUNNING, PUSHING_OUTPUT%5D
%0A ... |
43f502122ae617bae1c63d44692d590fbb5d53ab | fix weights | scripts/tester.py | scripts/tester.py | #!/usr/bin/env python
import itertools
import platform
import subprocess
import sys
import math
def normalize(x):
denom = sum(x)
return [e/denom for e in x]
def scale(x, a):
return [e * a for e in x]
def argcmp(x, comp, predicate):
idx = None
val = None
for i in xrange(len(x)):
if not predicate(x[i]... | Python | 0.000006 | @@ -1644,17 +1644,17 @@
a.log',
-2
+1
./3.),%0A
@@ -1679,33 +1679,36 @@
entu/data.log',
-1
+2./3
.),%0A %5D%0A else
|
2c6ccdacc2c4e54cf0a12618d60c963d9c67ef62 | Fix for DjangoCMS 3.5: get_cms_setting | djangocms_page_sitemap/settings.py | djangocms_page_sitemap/settings.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from cms.sitemaps import CMSSitemap
from cms.utils import get_cms_setting
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
PAGE_SITEMAP_CHANGEFREQ_DEFAULT_LIST = {
'always': _('... | Python | 0.00069 | @@ -141,16 +141,21 @@
ms.utils
+.conf
import
|
5ca7ffd1df650568b39ae18bfbeacacff573678f | Arguments need to be separated when implementing gyp-actions. | test/test.gyp | test/test.gyp | # Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | Python | 0.999987 | @@ -4150,16 +4150,19 @@
%5B'../../
+../
resource
@@ -4298,17 +4298,45 @@
'-p
-
+',%0A '
../../..
|
f603e8b394ea2b3ed9329b6948119970eb6aaa46 | add test for transition | lbworkflow/tests/test_transition.py | lbworkflow/tests/test_transition.py | from django.contrib.auth import get_user_model
from lbworkflow.core.transition import TransitionExecutor
from lbworkflow.views.helper import user_wf_info_as_dict
from .test_base import BaseTests
User = get_user_model()
class TransitionExecutorTests(BaseTests):
def test_submit(self):
leave = self.leave... | Python | 0 | @@ -39,16 +39,61 @@
er_model
+%0Afrom django.core.urlresolvers import reverse
%0A%0Afrom l
@@ -234,16 +234,48 @@
aseTests
+%0Afrom .leave.models import Leave
%0A%0AUser =
@@ -1047,111 +1047,8 @@
()%0A%0A
- def test_execute_transition(self):%0A self.client.login(username='tom', password='password')%0A%0A
... |
51d8d354f1a75b83becad880eec7cbac86d52e74 | Convert test to pytest syntax | tests/test_generate_files.py | tests/test_generate_files.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_generate_files
-------------------
Test formerly known from a unittest residing in test_generate.py named
TestGenerateFiles.test_generate_files_nontemplated_exception
TestGenerateFiles.test_generate_files
"""
from __future__ import unicode_literals
import os
imp... | Python | 0.999999 | @@ -1672,16 +1672,33 @@
ontext=%7B
+%0A
'cookiec
@@ -1722,16 +1722,29 @@
'pizza'%7D
+%0A
%7D,%0A
@@ -1812,16 +1812,83 @@
)%0A%0A%0A
+@pytest.mark.usefixtures(%22clean_system_remove_additional_folders%22)%0A
def test
@@ -1903,20 +1903,16 @@
e_files(
-self
):%0A g
@@ -2065,... |
c4963df740e82d476500d2d998b288d0213806ee | Allow searching in the authorization code admin. | src/commoner/promocodes/admin.py | src/commoner/promocodes/admin.py | from django.contrib import admin
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.forms.widgets import HiddenInput
from commoner.promocodes.models import PromoCode
class PromoCodeAdminForm(forms.ModelForm):
code = forms.CharField(initial='', widget=HiddenInput())
s... | Python | 0 | @@ -1299,24 +1299,96 @@
-created',)%0A
+ search_fields = ('recipient', 'transaction_id', 'contribution_id',)%0A
%0A # g
|
a415ac43b49fd4485b4f4be5d1286efed8c432cf | Fix broken airship with no signing key | airship/__init__.py | airship/__init__.py | import os
import json
import time
from flask import Flask, render_template, request
from groundstation import logger
log = logger.getLogger(__name__)
# XXX We won't always be using the github adaptor!!
from groundstation.protocols.github.read_adaptor import GithubReadAdaptor
from groundstation.gref import Gref, Tip
... | Python | 0.000004 | @@ -988,16 +988,48 @@
_name__)
+%0A app.has_signing_key = False
%0A%0A de
@@ -1285,38 +1285,31 @@
if app.
-private_crypto_adaptor
+has_signing_key
:%0A
|
1037524e5dbeb4482beb41b2d951690c77ce2316 | Fix invalid syntax | lowfat/management/commands/load2018applications.py | lowfat/management/commands/load2018applications.py | import pandas as pd
from django.contrib.auth.models import User, BaseUserManager
from django.core.management.base import BaseCommand
from lowfat.models import Claimant
class Command(BaseCommand):
help = "Import CSV with 2018 applications."
def add_arguments(self, parser):
parser.add_argument('csv', ... | Python | 0.999586 | @@ -3192,19 +3192,16 @@
gineer%22:
- if
line%5B%22R
|
3e504469c823fb3f655505444df78dc17f44ba07 | Add support for port ranges on ASA | aclhound/targets/asa.py | aclhound/targets/asa.py | #!/usr/bin/env python2.7
# Copyright (C) 2014 Job Snijders <job@instituut.net>
#
# This file is part of ACLHound
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the abov... | Python | 0 | @@ -6199,24 +6199,152 @@
if
+type(s_port) == tuple:%0A line += %22range %25s %25s %22 %25 (s_port%5B0%5D, s_port%5B1%5D)%0A elif
not s_port =
@@ -6959,19 +6959,149 @@
if
+type(
d_port
- != u
+) == tuple:%0A line += %22range %2... |
07764dba867b7da57e4134237aeaf65429b8a0ef | Fix problem with nan for social ID | lowfat/management/commands/load2018applications.py | lowfat/management/commands/load2018applications.py | import pandas as pd
from django.contrib.auth.models import User, BaseUserManager
from django.core.management.base import BaseCommand
from lowfat.models import Claimant
class Command(BaseCommand):
help = "Import CSV with 2018 applications."
def add_arguments(self, parser):
parser.add_argument('csv', ... | Python | 0.00012 | @@ -2392,16 +2392,53 @@
%22ORCID%22%5D
+ if pd.notnull(line%5B%22ORCID%22%5D) else %22%22
,%0A
@@ -2491,16 +2491,62 @@
cholar%22%5D
+ if pd.notnull(line%5B%22Google Scholar%22%5D) else %22%22
,%0A
@@ -2583,16 +2583,54 @@
GitHub%22%5D
+ if pd.notnull(line%5B%22GitHub%22%5D) else %22%22
,%0A
@@ -2... |
442f6c9eae5c64c3438f89c2968b0343c1f4ed6e | Revise script docstring | alg_find_peak_1D.py | alg_find_peak_1D.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
"""Find a peak in 1D array.
Support a is an array of length n.
If a is an array of length 1, a[0] is a peak.
In general k, a[k] is a peak iff a[k] >= a[k - 1] and a[k] >= a[k + 1].
If a[0] ... | Python | 0.000002 | @@ -247,10 +247,8 @@
eral
- k
, a%5B
|
1f58a07ba228cd1475ff057cca16920e6a698a01 | Add additional test vectors (from exact trig values) | tests/test_vector2_rotate.py | tests/test_vector2_rotate.py | from ppb_vector import Vector2
from utils import angle_isclose, vectors
import pytest # type: ignore
import math
from hypothesis import assume, given, note, example
import hypothesis.strategies as st
data_exact = [
(Vector2(1, 1), -90, Vector2(1, -1)),
(Vector2(1, 1), 0, Vector2(1, 1)),
(Vector2(1, 1),... | Python | 0 | @@ -584,16 +584,129 @@
95397)),
+%0A%0A (Vector2(1, 0), 30, Vector2(math.sqrt(3)/2, 0.5)),%0A (Vector2(1, 0), 60, Vector2(0.5, math.sqrt(3)/2)),
%0A%5D%0A%0A@pyt
|
545f04982267a34daaacc3afb94cd50db3821550 | Update ghost.py | home/Humanoid/ghost.py | home/Humanoid/ghost.py | ###################################################
# This is a basic script to carry on a conversation
# with ghost
###################################################
# create service
ghost = Runtime.start("ghost", "WebGui")
ear = Runtime.start("ear", "WebkitSpeechRecognition")
ghostchat = Runtime.start("ghostchat"... | Python | 0.000001 | @@ -438,16 +438,245 @@
eech%22)%0A%0A
+# creating the connections and routes%0A# - I'll need to check on these - might%0A# need to just %22attach%22 some services together%0Aear.addTextListener(ghostchat)%0Aghostchat.addTextListener(htmlfilter)%0Ahtmlfilter.addTextListener(mouth)%0A%0A
# start
@@ -931,195 +931,4 @@
... |
64938b5bb185f7f38716c166a2aa59a0713bc989 | fix for sqlite test db | tests/runtests.py | tests/runtests.py | """
Test support harness for doing setup.py test.
See http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/.
"""
import sys
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings'
# Bootstrap Django's settings.
from django.conf import settings
settings.DATABASES = {
'defau... | Python | 0 | @@ -379,9 +379,9 @@
mory
-;
+:
'%7D%0A%7D
|
05f28064187c56d70d8f50c920676b81b7eb9f32 | make test run faster | bdot/tests/test_carray.py | bdot/tests/test_carray.py | import nose
import bdot
import bcolz
import numpy as np
from numpy.testing import assert_array_equal
def test_dot_int64():
matrix = np.random.random_integers(0, 12000, size=(300000, 100))
bcarray = bdot.carray(matrix, chunklen=2**13, cparams=bcolz.cparams(clevel=2))
v = bcarray[0]
result = bcarray.dot(v)
exp... | Python | 0.000003 | @@ -177,17 +177,16 @@
e=(30000
-0
, 100))%0A
|
5e2f393238d976e576b390b668c7ce2f13a1e0c1 | Update to use Py3 print() (#1142) | example/scripts/add-line.py | example/scripts/add-line.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import sys
import getopt
import re
def findLine(pattern, fp):
line = fp.readline()
line_number = 1
while line:
#print("Line {}: {}".format(line_number, line.strip()))
if pattern in line:
return line_number
line = fp.readline()
... | Python | 0.9995 | @@ -36,16 +36,54 @@
-8 -*-%0A%0A
+from __future__ import print_function%0A
import s
@@ -561,17 +561,17 @@
print
-
+(
'Insert'
@@ -591,32 +591,33 @@
ne', line_number
+)
%0A fp.
@@ -802,17 +802,17 @@
print
-
+(
'pattern
@@ -830,16 +830,17 @@
found!'
+)
%0A%0Adef re
@@ -1016,17 +1016,17 @@
... |
06cb55639d2bc504d0ec1b9fb073c40e00751328 | Disable output example_pic.png if exists | doc/sample_code/demo_plot_state.py | doc/sample_code/demo_plot_state.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pyogi.board import Board
from pyogi.plot import plot_board
if __name__ == '__main__':
board = Board()
board.set_initial_state()
board.players = ['先手', '後手']
board.move('+7776FU')
board.move('-3334FU')
board.move('+2868HI')
board.move('... | Python | 0.999949 | @@ -40,16 +40,26 @@
-8 -*-%0A%0A
+import os%0A
from pyo
@@ -384,16 +384,107 @@
terials%0A
+ savepath = 'example_pic.png'%0A if os.path.exists(savepath):%0A savepath = None%0A%0A
plot
@@ -506,33 +506,24 @@
avepath=
-'example_pic.png'
+savepath
, mode='
|
75f8a41c00e06f52102bf5f87a093d4ffef34f97 | simplify the saving/loading of the lists | lib/maintain_lists_of_entries.py | lib/maintain_lists_of_entries.py | from .load_data_from_file import load_data_from_file
from .save_data import save_data
from .paths import mappings_path
import json
import os
def maintain_lists_of_entries(all_courses):
data_sets = {
'departments': set(),
'instructors': set(),
'times': set(),
'locations': set(),
... | Python | 0.000237 | @@ -552,21 +552,16 @@
ds(data)
-%5Bkey%5D
)%0A%0A f
@@ -1182,51 +1182,13 @@
mps(
-%7Bkey: data%7D,%0A
+data,
ind
@@ -1248,16 +1248,23 @@
son_data
+ + '%5Cn'
, filena
|
f3c6a888b4462e2fab43faba6dbe2af4bafff1bb | Update add-snmpproxy-collector.py | scripts/monitoring/proxy_snmp/add-snmpproxy-collector.py | scripts/monitoring/proxy_snmp/add-snmpproxy-collector.py | from cloudify import ctx
from cloudify import exceptions
import diamond_agent.tasks as diamond
import os
paths = diamond.get_paths(ctx.plugin.workdir)
name = 'SNMPProxyCollector'
collector_dir = os.path.join(paths['collectors'], name)
if not os.path.exists(collector_dir):
os.mkdir(collector_dir)
collector_fi... | Python | 0 | @@ -103,53 +103,98 @@
os%0A
-%0Apaths = diamond.get_paths(ctx.plugin.workdir
+workdir = ctx.plugin.workdir%0Apaths = diamond.get_paths(workdir.replace(%22script%22,%22diamond%22)
)%0Ana
|
c9027e8aebe853d1c85fcac24b09caeb8ea5f403 | Bump version to 0.3.0 | bands_inspect/__init__.py | bands_inspect/__init__.py | # -*- coding: utf-8 -*-
# (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <greschd@gmx.ch>
"""
A tool for modifying, comparing and plotting electronic bandstructures.
"""
from . import kpoints
from . import eigenvals
from . import compare
from . import lattice
from . import plot
... | Python | 0.000001 | @@ -335,9 +335,9 @@
'0.
-2.3
+3.0
'%0A
|
92752810380e38658de4a18eb0d06ff62395c38b | Fix path for gs upload credentials. | scripts/slave/chromium/archive_gpu_pixel_test_results.py | scripts/slave/chromium/archive_gpu_pixel_test_results.py | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A tool to archive Chrome gpu pixel test results generated by buildbots.
Pushes generated images, their associated reference ima... | Python | 0.000005 | @@ -1031,160 +1031,233 @@
ile.
+%0A #
Set
-the%0A # environment variable if needed.%0A old_env = os.environ.copy()%0A if 'HOME' not in os.environ:%0A os.environ%5B'HOME'%5D = os.path.expanduser('~
+$HOME to /b/build/site_config/ temporarily where .boto stays.%0A old_env = os.environ.copy()%0A # This script... |
889a2608d1d4038a8c7ee1c445530fd1750c00e0 | Optimize styling according to pylint | preprocessing/collect_unigrams.py | preprocessing/collect_unigrams.py | # -*- coding: utf-8 -*-
"""
File to collect all unigrams and all name-unigrams (label PER) from a corpus file.
The corpus file must have one document/article per line. The words must be labeled in the
form word/LABEL.
Example file content:
Yestarday John/PER Doe/PER said something amazing.
... | Python | 0 | @@ -459,21 +459,17 @@
...%0A
-
%0A
+
Exec
@@ -617,18 +617,8 @@
als%0A
-import os%0A
from
@@ -702,20 +702,22 @@
ile%0A
-from
+import
config
impo
@@ -716,16 +716,14 @@
fig
-import *
+as cfg
%0A%0Ade
@@ -827,21 +827,17 @@
top.%22%22%22%0A
-
%0A
+
# co
@@ -973,16 +973,20 @@
rticles(
+cf... |
9b5fd8dba4885cd0cc2de10f7ff6c8066aee0277 | Fix possibles issues with pulseaudiowidget | barython/widgets/audio.py | barython/widgets/audio.py | #!/usr/bin/env python3
import logging
from .base import SubprocessWidget
from barython.hooks.audio import PulseAudioHook
logger = logging.getLogger("barython")
class PulseAudioWidget(SubprocessWidget):
def handler(self, event, *args, **kwargs):
"""
Filter events sent by the notifications
... | Python | 0.000002 | @@ -290,20 +290,16 @@
sent by
-the
notifica
@@ -1336,16 +1336,37 @@
_init__(
+*args, **kwargs, cmd=
cmd, inf
@@ -1376,33 +1376,16 @@
te=False
-, *args, **kwargs
)%0A%0A
|
add3baff745a276da424b3e73bcb7619ba5ca061 | Fix holding config variable in database through proxy objects | analytical/utils.py | analytical/utils.py | """
Utility function for django-analytical.
"""
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
HTML_COMMENT = "<!-- %(service)s disabled on internal IP " \
"address\n%(html)s\n-->"
def get_required_setting(setting, value_re, invalid_msg):
"""
Return ... | Python | 0.000003 | @@ -750,20 +750,16 @@
if
+not
valu
-e is Non
e:%0A
@@ -810,19 +810,15 @@
is
-set to None
+not set
%22 %25
|
7f113399e4277ecbbfdde41d683c22082f7e19bd | Add DOI parsing to identifiers | scrapi/harvesters/smithsonian.py | scrapi/harvesters/smithsonian.py | '''
Harvester for the Smithsonian Digital Repository for the SHARE project
Example API call: http://repository.si.edu/oai/request?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
from scrapi.base import OAIHarvester
class SiHarvester(OAIHarvester):
short_name = 'smithsonian'
... | Python | 0.00003 | @@ -208,16 +208,59 @@
terals%0A%0A
+import re%0A%0Afrom scrapi.base import helpers%0A
from scr
@@ -461,158 +461,769 @@
-base_url = 'http://repository.si.edu/oai/request'%0A property_list = %5B'date', 'identifier', 'type', 'format', 'setSpec'%5D%0A timezone_granularity = Tr
+@property%0A def schema(self... |
b65a2ee41d16efd1a056727e59c229eb8258070f | set deafult DB_host as localhost | tests/settings.py | tests/settings.py | import os
INSTALLED_APPS = (
'model_utils',
'tests',
)
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": os.environ.get("DB_NAME", "modelutils"),
"USER": os.environ.get("DB_USER", 'postgres'),
"PASSWORD": os.environ.get("DB_PASSWORD", "")... | Python | 0.999466 | @@ -354,24 +354,33 @@
%22DB_HOST%22, %22
+localhost
%22),%0A
|
4a6e33eec89f88604cec47c9d0aff24b94b6d87b | Add setting to disable SECCOMP via environment variable | tests/settings.py | tests/settings.py | """
Django settings for running tests for Resolwe package.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import re
from distutils.util import strtobool # pylint: disable=import-error,no-name-in-module
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
SECRE... | Python | 0 | @@ -4272,16 +4272,163 @@
'0'))%0A%0A
+# Disable SECCOMP if set via environment variable.%0AFLOW_DOCKER_DISABLE_SECCOMP = strtobool(os.environ.get('RESOLWE_DOCKER_DISABLE_SECCOMP', '0'))%0A%0A
# Ensure
|
dcf7af23fa237cd761f1a589e2e268875d296841 | Test settings updated | tests/settings.py | tests/settings.py | # -*- coding: utf-8 -*-
# Standard library imports
import os
# Third party imports
from django.conf import global_settings as default_settings
from django.conf import settings
# Local application / specific library imports
TEST_ROOT = os.path.abspath(os.path.dirname(__file__))
TEST_SETTINGS = {
'DEBUG': Fals... | Python | 0 | @@ -1070,16 +1070,245 @@
ID': 1,%0A
+%0A%0A # Setting this explicitly prevents Django 1.7+ from showing a%0A # warning regarding a changed default test runner. The test%0A # suite is run with nose, so it does not matter.%0A 'SILENCED_SYSTEM_CHECKS': %5B'1_6.W001'%5D,%0A
%7D%0A%0A%0Adef
|
0b4cbd10ec6deb85603ad21a3ff1a7c3141da315 | Change matrix size for convolutionSeparable2 test | examples/convolution/run.py | examples/convolution/run.py | #!/usr/bin/env python
import subprocess
from xml.dom.minidom import parseString
stddevThreshold = 0.1 # tolerate up to 10% variation
nTrials = 5
nThreads = 2
def run(cmd):
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = proc.communicate()
ret = proc.poll()
if r... | Python | 0 | @@ -138,17 +138,17 @@
rials =
-5
+7
%0AnThread
@@ -1497,28 +1497,16 @@
2048
-%5D): # TODO: try 4096
+,3500%5D):
%0A
|
bd1e6eba5fa8f47606319dab6ae378383c31a366 | fix sdb unit tests | tests/unit/sdb/test_vault.py | tests/unit/sdb/test_vault.py | # -*- coding: utf-8 -*-
'''
Test case for the vault SDB module
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing libs
from tests.support.unit import TestCase
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import (
... | Python | 0.000001 | @@ -991,32 +991,165 @@
ion%0A '''%0A
+ version = %7B'v2': False, 'data': None, 'metadata': None, 'type': None%7D%0A mock_version = MagicMock(return_value=version)%0A
mock_vau
@@ -1283,32 +1283,107 @@
t': mock_vault%7D)
+, %5C%0A patch.dict(vault.__utils__, %7B'vault.is_v2': m... |
119f63d72f8faae892e0f4c75c9d3ae406a3c0b3 | Update settings for dev | core/settings.py | core/settings.py | """
Django settings for core project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
import os
import sys
# Needed for login
import django.contrib.auth
from djan... | Python | 0 | @@ -530,32 +530,41 @@
rror:%0A print(
+%0A
%22%5BERROR%5D core/se
@@ -1323,16 +1323,29 @@
7.0.0.1'
+, 'localhost'
%5D%0ASITE_I
@@ -2831,17 +2831,16 @@
ation'%0A%0A
-%0A
# Databa
@@ -3362,17 +3362,16 @@
e'),%0A)%0A%0A
-%0A
# Static
|
5fa36e781729fbfe5e3343f921e52eebf0062e75 | Switch rackspace env variables to prettyconf | tests/settings.py | tests/settings.py | import hashlib
import os
from tempfile import mkdtemp
from time import time
from prettyconf.configuration import Configuration
config = Configuration()
# Append epoch to prevent test runs from clobbering each other.
CONTAINER_PREFIX = 'cloud-storage-test-' + str(int(time()))
SECRET = hashlib.sha1(os.urandom(128)).he... | Python | 0 | @@ -1205,154 +1205,8 @@
e)%0A%0A
-RACKSPACE_KEY = os.environ%5B'RACKSPACE_KEY'%5D%0ARACKSPACE_SECRET = os.environ%5B'RACKSPACE_SECRET'%5D%0ARACKSPACE_REGION = os.environ%5B'RACKSPACE_REGION'%5D%0A#
RACK
@@ -1247,34 +1247,32 @@
, default=None)%0A
-#
RACKSPACE_SECRET
@@ -1315,18 +1315,16 @@
t=None)%0A
-#
RACKSPA... |
6e3ebff613254c7e13d89cd3599e030947a5072f | fix coverage report | tests/unittest/test_calls.py | tests/unittest/test_calls.py | from unittest import TestCase, mock
from unittest.mock import patch
import RequestsLibrary
lib = RequestsLibrary.RequestsLibrary()
HTTP_LOCAL_SERVER = 'http://localhost:5000'
sess_headers = {'content-type': False}
post_headers = {'Content-Type': 'application/json'}
class TestCalls(TestCase):
@patch('RequestsLibr... | Python | 0.000001 | @@ -1,20 +1,41 @@
+import os%0Aimport sys%0A
from unittest import
@@ -82,16 +82,213 @@
t patch%0A
+# I hate it but I can't get the coverage report to work without it, must be before RequestsLibrary import%0Asys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../src/')))%0A
import R
@@ -303... |
0179b6ce31856c18c9faaa58a55d8882e4a260ce | Configure Pool in if __name__ block | scripts/new_multiproc_manager.py | scripts/new_multiproc_manager.py | """
CPOL Level 1b main production line.
@title: CPOL_PROD_1b
@author: Valentin Louf <valentin.louf@monash.edu>
@institution: Bureau of Meteorology
@date: 1/03/2019
@version: 1
.. autosummary::
:toctree: generated/
timeout_handler
chunks
production_line_manager
production_line_multiproc
main
"... | Python | 0.99994 | @@ -412,49 +412,61 @@
ck%0A%0A
-import pandas as pd%0Aimport dask.bag
+from multiprocessing import Pool%0A%0Aimport pandas
as
+p
d
-b
%0Aimp
@@ -677,80 +677,36 @@
def
-production_line_manager(infile):%0A %22%22%22%0A The production line manager
+main(infile):%0A %22%22%22%0A It
cal
@@ -746,17 +746... |
3dd0ac13a5c2a3e0dc949d60e807b438c36636a9 | Fix for post_process. | core/tessagon.py | core/tessagon.py | from tessagon.core.grid_tile_generator import GridTileGenerator
from tessagon.core.rotate_tile_generator import RotateTileGenerator
class Tessagon:
def __init__(self, **kwargs):
if 'function' in kwargs:
self.f = kwargs['function']
else:
raise ValueError('Must specify a function')
self.tile_c... | Python | 0 | @@ -1262,16 +1262,125 @@
rocess:%0A
+ # Run user defined post-processing code%0A # Need to pass self here (this could be designed better)%0A
se
@@ -1395,16 +1395,20 @@
process(
+self
)%0A%0A r
|
d71353d8d1e0778f121c3ec07067d617ab3ce932 | Add run() method to Backend and make start() a wrapper for it. Also set backend.running in backend.start and backend.stop. Whatever code runs in a loop in backend.run() needs to check self.running periodically to make sure it should still be running. | lib/rapidsms/backends/backend.py | lib/rapidsms/backends/backend.py | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
class Backend(object):
def __init__ (self, router):
self.router = router
def log(self, level, message):
self.router.log(level, message)
def start(self):
raise NotImplementedError
def stop(self):
raise NotImple... | Python | 0 | @@ -130,21 +130,50 @@
router%0A
+ self.running = False%0A
%0A
-
def
@@ -253,32 +253,167 @@
ef start(self):%0A
+ self.running = True%0A try:%0A self.run()%0A finally:%0A self.running = False%0A%0A def run (self):%0A
raise No
@@ -467,33 +467,28 @... |
e7e4779d4b8ddbf2e42dea617e0f61e1e550f505 | bump current enterprise version to 2022.2 | unit_tests/test_base_version.py | unit_tests/test_base_version.py | # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be usefu... | Python | 0.000001 | @@ -2479,17 +2479,17 @@
%5B'2022.
-1
+2
'%5D)%0A%0A
|
4e5cc0a58dfaceac79f09f128ad5c4355975dcf0 | Update ABC interface | tests/test_a3c.py | tests/test_a3c.py | import os
import unittest
import tempfile
import multiprocessing as mp
import chainer
from chainer import optimizers
from chainer import links as L
from chainer import functions as F
import policy
import v_function
import a3c
import async
from envs.simple_abc import ABC
import run_a3c
class A3CFF(chainer.ChainList,... | Python | 0 | @@ -38,37 +38,8 @@
file
-%0Aimport multiprocessing as mp
%0A%0Aim
@@ -196,21 +196,8 @@
a3c%0A
-import async%0A
from
@@ -373,25 +373,25 @@
-1
+5
, n_actions,
@@ -485,17 +485,17 @@
-1
+5
, n_hidd
@@ -784,17 +784,17 @@
L.LSTM(
-1
+5
, 10)%0A
@@ -2495,26 +2495,85 @@
tal_r =
-env.reward
... |
1edd7017c0e8bbf343df65d4d32e3467e1211a19 | Enhance re-raised TemplateDoesNotExist exception | respite/views/views.py | respite/views/views.py | from django.shortcuts import render
from django.http import HttpResponse
from django.template import TemplateDoesNotExist
from django.conf import settings
from respite.settings import DEFAULT_FORMAT
from respite.utils import parse_http_accept_header
from respite.serializers import serializers
from respite import forma... | Python | 0 | @@ -6618,16 +6618,345 @@
raise
+ TemplateDoesNotExist(%0A %22%25(template)s.%25(extension)s does not exist and no serializer for %25(format)s could be found.%22 %25 %7B%0A 'template': template,%0A 'extension': format.extension,%0A ... |
30c701ca797ee289fa70866c1b5dfa0dce623d76 | fix typos : porivided -> provided | text_classification/train.py | text_classification/train.py | import os
import sys
import gzip
import paddle.v2 as paddle
import reader
from utils import logger, parse_train_cmd, build_dict, load_dict
from network_conf import fc_net, convolution_net
def train(topology,
train_data_dir=None,
test_data_dir=None,
word_dict_path=None,
label_... | Python | 0.999998 | @@ -1251,16 +1251,16 @@
re p
+r
o
-ri
vided
+d
, %22%0A
|
3eacd6c42126f08c9f941f47bab59430d1180c59 | use default bulk actions | reversedict/indexer.py | reversedict/indexer.py | import contextlib
import collections
import nlp
import elastic
DEFAULT_SEEDS = ['philosophy','science','art','health','emotion']
def index_terms(seeds=None, max_count=5000):
'''
Index words by their definitions and synonyms.
Starts with a list of seed word, e.g. top 100 used terms.
Index the words, q... | Python | 0 | @@ -1994,17 +1994,8 @@
ers.
-parallel_
bulk
|
f81bc19a9627225113ff1a3fa2aa0e6446402acb | test that shorten is text/plain (answer no :S) | tests/test_api.py | tests/test_api.py | import unittest
from flask import url_for
import summerurlapp
import appconfig
import types
class SummerApiTestCase(unittest.TestCase):
"""Test that the API works as intended"""
testurl_http1 = "http://random.org"
testurl_bad = "random.org"
def setUp(self):
summerurlapp.app.config.from_objec... | Python | 0.999964 | @@ -641,17 +641,16 @@
link))%0A%0A
-%0A
def
@@ -756,19 +756,44 @@
esp.
-data%5B0%5D, %221
+headers%5B'Content-Type'%5D, %22text/plain
%22)%0A%0A
|
06ef2e114949e1e733227fb6ddad56f1ff4cbaed | Bump the version to 0.0.2 and add a __version_info__ tuple | llic.py | llic.py | """
Low-Level iCalendar library.
"""
from __future__ import unicode_literals
import pytz
__version__ = "0.0.1"
DEFAULT_ICAL_LINE_LENGTH = 75
CRLF = b"\r\n"
CRLF_WRAP = b"\r\n "
NAME_VALUE_SEPARATOR = b":"
class BaseCalendarWriter(object):
def __init__(self, output, line_length=DEFAULT_ICAL_LINE_LENGTH):
... | Python | 0.999962 | @@ -108,10 +108,75 @@
0.0.
-1%22
+2%22%0A__version_info__ = tuple(int(n) for n in __version__.split(%22.%22))
%0A%0ADE
|
64a37bb9b758630c0f2c649d82e10e849c095d48 | Test side effect (#1889) | tests/test_cli.py | tests/test_cli.py | # -*- coding: utf-8 -*-
"""
tests.test_cli
~~~~~~~~~~~~~~
:copyright: (c) 2016 by the Flask Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
#
# This file was part of Flask-CLI and was modified under the terms its license,
# the Revised BSD License.
# Copyright (C) 2... | Python | 0 | @@ -379,16 +379,37 @@
function
+%0Aimport os%0Aimport sys
%0A%0Aimport
@@ -1374,24 +1374,334 @@
test_apps):%0A
+ %22%22%22Expect the correct path to be set and the correct module name to be returned.%0A%0A :func:%60prepare_exec_for_file%60 has a side effect, where%0A the parent directory of given file is ad... |
4f13f9cee13413e64095ddd5d283d92d1329f423 | Add assertRaises(ArgumentError) | tests/test_cli.py | tests/test_cli.py | # -*- coding: utf-8 -*-
import unittest
from types import ModuleType
from pythainlp import __main__, cli
class TestMainPackage(unittest.TestCase):
def test_cli_main(self):
# call with no argument, should exit with 2
with self.assertRaises(SystemExit) as ex:
__main__.main()
se... | Python | 0.000002 | @@ -34,16 +34,51 @@
nittest%0A
+from argparse import ArgumentError%0A
from typ
@@ -385,16 +385,17 @@
ode, 2)%0A
+%0A
@@ -448,32 +448,84 @@
ata%22, %22path%22%5D))%0A
+%0A with self.assertRaises(ArgumentError):%0A
self.ass
@@ -526,32 +526,49 @@
lf.assertIsNone(
+%0A
__... |
d2a66d7251266e732246a67c4232e51464ef0952 | Support NZ geocoding | load.py | load.py | import json
import os
from datetime import date
import boto3
import requests
from googlemaps import Client
from twilio.rest import TwilioRestClient
s3 = boto3.resource('s3')
def run_poll(event, context):
""" Update S3 with latest trackpoints from Spot. """
s3_history = get_history_from_s3()
s3_latest_ti... | Python | 0 | @@ -1156,19 +1156,42 @@
-for addr in
+#Hack%0A googleResp =
gma
@@ -1249,45 +1249,225 @@
ts'%5D
-:%0A if 'postal_town
+%0A for addr in googleResp:%0A if 'postal_town' in addr%5B'types'%5D:%0A return addr%5B'long_name'%5D... |
a396332ad66d31ac5caa1fcbf92ed564615fac85 | Use assert_raises in test_cli | tests/test_cli.py | tests/test_cli.py | import subprocess
import os
from nose.tools import eq_
# Get the filename of 'halibote.txt', which contains some mojibake about
# Harry Potter in Chinese
THIS_DIR = os.path.dirname(__file__)
TEST_FILENAME = os.path.join(THIS_DIR, 'halibote.txt')
CORRECT_OUTPUT = '【更新】《哈利波特》石堧卜才新婚娶初戀今痠逝\n'
FAILED_OUTPUT = '''ftfy erro... | Python | 0.000001 | @@ -47,16 +47,31 @@
port eq_
+, assert_raises
%0A%0A%0A# Get
@@ -1469,11 +1469,68 @@
-try
+with assert_raises(subprocess.CalledProcessError) as context
:%0A
@@ -1609,119 +1609,30 @@
- assert False, %22Should have raised a CalledProcessError%22%0A except subprocess.CalledProcessError as e:%0A
... |
6379da01e44098d0a44bb99177e9b068b5488d87 | Normalize one more path in test_check.py | test_check.py | test_check.py | #!/usr/bin/env python
import os
import shutil
import sys
import checkguard
import unittest
from collections import namedtuple
from StringIO import StringIO
Output = namedtuple('Output', ['stdout', 'stderr'])
def lines_counts(textblock):
line_hash = {}
for line in textblock.split('\n'):
try:
line_hash[line] +=... | Python | 0.000726 | @@ -3124,16 +3124,19 @@
dout,%0A%09%09
+np(
'guard_t
@@ -3160,16 +3160,17 @@
me.h%5Cn')
+)
%0A%0A%09def t
|
83dc9b5f80268a5bd23a737d66a219067353f2b7 | change parameter handling | test_files.py | test_files.py | #!/usr/bin/env python
# Generate test directories to mess with from a list of filenames.
import argparse
import os
import sys
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input')
parser.add_argument('-t', '--target')
args = parser.parse_args()
base_dir = args.target if args.target else 'testing'... | Python | 0.000003 | @@ -343,38 +343,10 @@
put
-if args.input is not None else
+or
'fi
|
13f797c35fd3d78d71dfb1b36d953a017c995034 | Convert public and private key blob into string format as it is PEM | drift/core/resources/jwtsession.py | drift/core/resources/jwtsession.py | # -*- coding: utf-8 -*-
"""
JWT Session Management
By including this resource module in a Drift app, it will be able to accept JWT from a list
of trusted issuers and issue and sign new JWT's.
Custom attributes for top level registration:
key_size: <int> Size in bytes of private key.
trusted_issue... | Python | 0.999999 | @@ -2216,45 +2216,129 @@
_pem
-,%0A 'private_key': private_pem,
+.decode(), # PEM is actually a text format%0A 'private_key': private_pem.decode(), # PEM is actually a text format
%0A
|
afea442758ebc60da443b45b9362040017c9f82b | rename variable to be more clear | corehq/apps/api/tests/test_auth.py | corehq/apps/api/tests/test_auth.py | from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponse
from django.test import TestCase, RequestFactory
from corehq.apps.api.resources.auth import LoginAuthentication, LoginAndDomainAuthentication, \
RequirePermissionAuthentication
from corehq.apps.domain.models import Domain
fro... | Python | 0.000006 | @@ -6761,24 +6761,27 @@
ta=False), '
+no-
edit-data')%0A
@@ -6826,32 +6826,35 @@
user_with
+out
_permission = We
@@ -6945,32 +6945,35 @@
api_key_with
+out
_permissions, _
@@ -7048,32 +7048,35 @@
o_user(user_with
+out
_permission)%0A
@@ -7115,32 +7115,35 @@
ambda: user_with
+out
_permission.dele... |
37d81e68bf5799272b8afa646916da46f2cc8ac5 | Introduce "compound filters", make `indices` one | corehq/apps/hqcase/api/get_list.py | corehq/apps/hqcase/api/get_list.py | import datetime
from base64 import b64decode, b64encode
from itertools import chain
from django.utils.http import urlencode
from django.http import QueryDict
from dateutil.parser import parse
from dimagi.utils.parsing import FALSE_STRINGS
from corehq.apps.case_search.filter_dsl import (
CaseFilterError,
bui... | Python | 0.000023 | @@ -554,34 +554,8 @@
y.'%0A
-INDEX_PREFIX = 'indices.'%0A
%0A%0Ade
@@ -1574,16 +1574,135 @@
%5D%0A%0A%0A
+def _index_filter(identifier, case_id):%0A return case_search.reverse_index_case_query(case_id, identifier)%0A%0A%0A%0ASIMPLE_
FILTERS
@@ -1917,16 +1917,23 @@
al)),%0A%7D%0A
+SIMPLE_
FILTERS.
@@ -2270... |
48b41ed2b4bcacd6fc6facaaf1ef5ea3390b49a8 | remove unecessary checks for stock_result | corehq/form_processor/reprocess.py | corehq/form_processor/reprocess.py | from collections import defaultdict
from casexml.apps.case.exceptions import IllegalCaseId, InvalidCaseIndex, CaseValueError, PhoneDateValueError
from casexml.apps.case.exceptions import UsesReferrals
from casexml.apps.case.signals import case_post_save
from corehq.apps.commtrack.exceptions import MissingProductId
fro... | Python | 0 | @@ -3595,41 +3595,8 @@
ult%0A
- if stock_result:%0A
@@ -4639,45 +4639,8 @@
es)%0A
- if stock_result:%0A
|
6e8c58608b85e10bc258b12dc83fb3dcdc0056a4 | tweak so that no files are created to cwd | utest/api/test_run_and_rebot.py | utest/api/test_run_and_rebot.py | import unittest
import sys
import tempfile
from os.path import abspath, dirname, join, exists
from os import remove
from StringIO import StringIO
from robot.utils.asserts import assert_equals
from robot import run, rebot
ROOT = dirname(dirname(dirname(abspath(__file__))))
TEMP = tempfile.gettempdir()
LOG_PATH = join(... | Python | 0 | @@ -4526,32 +4526,76 @@
', stdout=stdout
+,%0A outputdir=TEMP
), 1)%0A se
@@ -4996,16 +4996,32 @@
r=output
+, outputdir=TEMP
), 1)%0A
|
b0ef91a827650a23be819d6d4f1a99d096af8dfe | fix missing header tests | course_grader/test/dao/test_csv.py | course_grader/test/dao/test_csv.py | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.test import TestCase, override_settings
from course_grader.dao.csv import InsensitiveDictReader, GradeImportCSV
from course_grader.dao.section import get_section_by_label
from course_grader.dao.person import PWS
from cou... | Python | 0.000005 | @@ -1632,32 +1632,36 @@
ex(%0A
+
InvalidCSV, %22Mis
@@ -1665,38 +1665,29 @@
Missing
-%5C%22Class Grade%5C%22 he
+header: gr
ade
-r
$%22,%0A
@@ -1841,32 +1841,36 @@
ex(%0A
+
InvalidCSV, %22Mis
@@ -1878,30 +1878,21 @@
ing
-%5C%22Class Grade%5C%22 he
+header: gr
ade
-r
$%22,... |
2ed7986375cb9acf0f32e61b466178081c75cc24 | Fix test for Python 3 | tests/test_net.py | tests/test_net.py | import unittest
import urllib2
import oembed
class EndpointTest(unittest.TestCase):
def testInit(self):
#plain init
ep = oembed.OEmbedEndpoint('http://www.flickr.com/services/oembed')
self.assertEqual(len(ep.getUrlSchemes()), 0)
#init with schemes
ep = oemb... | Python | 0.998138 | @@ -20,29 +20,118 @@
ort
-urllib2%0Aimport oembed
+oembed%0A%0Atry:%0A import urllib.request as urllib2 # Python 3%0Aexcept ImportError:%0A import urllib2 # Python 2
%0A%0A%0Ac
@@ -5387,8 +5387,9 @@
t.main()
+%0A
|
ba0923dc8a38bfa3072f74ed1943e9859874e3a8 | use timezone in calculating current time | batch.py | batch.py | from datetime import datetime, timedelta
import json
import celery
from emails import send_email
from pytz import timezone
import requests
import stripe
from salesforce import SalesforceConnection
from config import STRIPE_KEYS
from config import ACCOUNTING_MAIL_RECIPIENT
from config import TIMEZONE
zone = timezone(... | Python | 0.000155 | @@ -3439,16 +3439,23 @@
ime.now(
+tz=zone
) - time
@@ -3460,16 +3460,25 @@
medelta(
+%0A
days=3))
@@ -3524,16 +3524,23 @@
ime.now(
+tz=zone
).strfti
|
158eea6914360f45b456c2a4a15f9c9bcd26beca | fix incorrect test name | tests/test_svm.py | tests/test_svm.py | import unittest
from context import lily
from lily import svm, optimizer
from numpy import mat
import logging
logging.basicConfig(level=logging.WARNING, format="%(lineno)d\t%(message)s")
class TestSvm(unittest.TestCase):
def setUp(self):
self.tolerance = 0.001
self.C = 0.6
self.iteration... | Python | 0.9998 | @@ -1412,16 +1412,21 @@
+
mat(self
@@ -1490,16 +1490,21 @@
+
self.C,%0A
@@ -1499,16 +1499,21 @@
self.C,%0A
+
@@ -2667,22 +2667,20 @@
rns_
-fals
+tru
e_for_
-high
+neg
_ei(
|
e94b2593424518632c704f4a440df3bc51cbcd3e | fix failing tests. | tests/test_uri.py | tests/test_uri.py | # encoding: utf-8
import unittest
from resources import URI
from resources import IRI
class TestURISnowman(unittest.TestCase):
def setUp(self):
uri = "http://u:p@" + "www.\N{SNOWMAN}".encode('idna') + ":80/path"
self.uri = URI(uri)
def testFail(self):
self.assertRaises(TypeError, UR... | Python | 0.000001 | @@ -157,66 +157,77 @@
-uri = %22http://u:p@%22 + %22www.%5CN%7BSNOWMAN%7D%22.encode('idna') + %22
+idna = u%22%5CN%7BSNOWMAN%7D%22.encode('idna')%0A uri = %22http://u:p@www.%25s
:80/
@@ -231,16 +231,23 @@
80/path%22
+ %25 idna
%0A
|
4104ea04d75b400e7a2a4d71c259ceb0957f8992 | include the absolute url to the onsite page | crate_project/apps/packages/api.py | crate_project/apps/packages/api.py | from tastypie import fields
from tastypie.resources import ModelResource
from packages.models import Package, Release
class PackageResource(ModelResource):
releases = fields.ToManyField("packages.api.ReleaseResource", "releases")
class Meta:
allowed_methods = ["get"]
queryset = Package.objec... | Python | 0 | @@ -273,32 +273,68 @@
thods = %5B%22get%22%5D%0A
+ include_absolute_url = True%0A
queryset
@@ -816,16 +816,52 @@
%5D%0A
+ include_absolute_url = True%0A
|
ebcf003dfaa8b2c375dfbecfe179665a9d0b339c | Print arguments | bench.py | bench.py | #!/usr/bin/env python
import argparse
import uuid
import subprocess
import os
import re
import time
class Failed(Exception):
pass
def launch_pachyderm(args, env):
try:
manifest = subprocess.check_output("make google-cluster-manifest", env=env, shell=True)
except subprocess.CalledProcessError:
... | Python | 0.000942 | @@ -3771,24 +3771,106 @@
rse_args()%0A%0A
+ print(%22running the benchmark with the following arguments:%22)%0A print(args)%0A%0A
if args.
|
6bc3e784828c1f339ab4fd5fe3ca6dc80a07bb46 | Enable logs | crawler/tasks.py | crawler/tasks.py | from __future__ import absolute_import, unicode_literals
from .celery import app
# from celery.utils.log import get_task_logger
from .crawler import crawl_url
# logger = get_task_logger(__name__)
@app.task(rate_limit="6/s", queue='crawler')
def crawl_url_task(url, value):
crawl_url(url, value)
# response, st... | Python | 0.000001 | @@ -74,18 +74,16 @@
ort app%0A
-#
from cel
@@ -151,18 +151,16 @@
wl_url%0A%0A
-#
logger =
@@ -294,18 +294,16 @@
lue)%0A
- #
respons
@@ -344,18 +344,16 @@
url)%0A
- #
if resp
@@ -369,26 +369,24 @@
ot None:%0A
- #
logger.
@@ -467,26 +467,24 @@
eason) +%0A
- #
@@ -598,18 +598,... |
89d70f5794969cb8d71201504b8645a8359f5b70 | read config file strings as unicode | credentials/settings/production.py | credentials/settings/production.py | from os import environ
import yaml
from credentials.settings.base import *
from credentials.settings.utils import get_env_setting, get_logger_config
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = ['*']
LOGGING = get_logger_config()
# Keep track of the names of settings that represent dicts. Instead of overr... | Python | 0.000344 | @@ -761,16 +761,34 @@
FIG_FILE
+, encoding='utf-8'
) as f:%0A
|
8257411a58f03d8a353129f2813cbc516a0e40c6 | Make sure API tests are registered | editorsnotes/api/tests/__init__.py | editorsnotes/api/tests/__init__.py | Python | 0 | @@ -0,0 +1,48 @@
+from .serializers import *%0Afrom .views import *%0A
| |
fa0b12cc00da83c5dfce903a0f118dd609c213dd | Fix for windows path to templates | imports/cisco_tools.py | imports/cisco_tools.py | # ############################### MODULE INFO ################################
# Author: Jamie Caesar
# Email: jcaesar@presidio.com
#
# !!!! NOTE: THIS IS NOT A SCRIPT THAT CAN BE RUN IN SECURECRT. !!!!
#
# This is a Python module that contains commonly used functions for processing the output of Cisco show comm... | Python | 0 | @@ -3035,16 +3035,163 @@
urn %5B%5D%0A%0A
+ # Normalize path before attempting to access (e.g. change slash to backslash for windows.)%0A template_file = os.path.normpath(template_file)%0A
rout
|
314de0fd750e582f5156c29d623d9362f5c037e3 | Add missing "file=sys.stdout" [skip ci] | test_utils.py | test_utils.py | import _thread
import docker
import os
import socket
import sys
from http.server import HTTPServer, SimpleHTTPRequestHandler
class TestFixtureServer(object):
def __init__(self):
self.port = 9999
self.ip = self.get_python_server_ip()
def get_python_server_ip(self):
# https://stackove... | Python | 0.000001 | @@ -1940,16 +1940,33 @@
ge_name)
+, file=sys.stdout
)%0A
|
e1c750b1e66e8eae4a8558a3dac6bb8038d84535 | Fix auto | peewee_migrate/auto.py | peewee_migrate/auto.py | from collections import Hashable, OrderedDict
import peewee as pw
from playhouse.reflection import Column as VanilaColumn
INDENT = ' '
NEWLINE = '\n' + INDENT
FIELD_TO_PARAMS = {
pw.CharField: lambda f: {'max_length': f.max_length},
pw.DecimalField: lambda f: {
'max_digits': f.max_digits, 'decima... | Python | 0.000002 | @@ -1265,46 +1265,37 @@
eld)
- and migrator and %5C%0A
+:%0A if migrator and
fi
@@ -1336,16 +1336,20 @@
or.orm:%0A
+
@@ -1418,16 +1418,92 @@
eta.name
+%0A else:%0A self.rel_model = field.rel_model.__name__
%0A%0A de
|
46b9c0a1d4941c6d3dacb18f5bfc08c8fc09f2b7 | add migration filter to multi reports | custom/enikshay/reports/generic.py | custom/enikshay/reports/generic.py | from collections import namedtuple
from sqlagg.filters import IN, AND, GTE, LT, RawFilter, EQ
from corehq.apps.reports.filters.dates import DatespanFilter
from corehq.apps.reports.generic import GenericReportView
from corehq.apps.reports.sqlreport import SqlTabularReport, SqlData
from corehq.apps.reports.standard imp... | Python | 0 | @@ -1730,16 +1730,41 @@
onFilter
+, EnikshayMigrationFilter
)%0A%0A @
|
79bd1165ece909ad8c302f7127c8c8fa1cd67794 | Remove unused parameters. When calling, use named parameters to keep things clear. | api/base/filters.py | api/base/filters.py | import re
import functools
from modularodm import Q
from rest_framework.filters import OrderingFilter
from rest_framework import serializers as ser
class ODMOrderingFilter(OrderingFilter):
"""Adaptation of rest_framework.filters.OrderingFilter to work with modular-odm."""
# override
def filter_queryset(... | Python | 0 | @@ -1881,26 +1881,19 @@
elf, key
-, value
):%0A
+
%0A
@@ -2161,39 +2161,32 @@
_field(self, key
-, value
):%0A try:%0A
@@ -2944,31 +2944,28 @@
vert_key(key
-, value
+=key
), self.get_
@@ -2987,23 +2987,20 @@
ator(key
-, value
+=key
), self.
@@ -3013,21 +3013,22 @@
t_value(
-key,
+value=
value))... |
2982d38d863e6f7654c4939a526d6e783525f8d6 | refactor compare_players | cribbage/main.py | cribbage/main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
from cribbage.game import Game
from cribbage.randomplayer import RandomCribbagePlayer
from cribbage.simpleplayer import SimpleCribbagePlayer
# ------------------------------------------------------------
# Cribbage Ga... | Python | 0.000004 | @@ -237,16 +237,202 @@
Player%0A%0A
+def compare_players(players, num_games=1000):%0A stats = %5B0, 0%5D%0A for i in range(num_games):%0A g = Game(players)%0A g.play()%0A stats%5Bg.winner%5D += 1%0A return stats%0A%0A
# ------
@@ -515,48 +515,23 @@
s =
-%5B0,0%5D%0Afor i in range(1000)... |
7ec191ce0b82827013485a98db84cd66aa2ca1b4 | use the currently checked out branch | lib/spack/spack/cmd/bootstrap.py | lib/spack/spack/cmd/bootstrap.py | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | Python | 0 | @@ -1652,19 +1652,20 @@
_origin_
-url
+info
():%0A
@@ -1753,16 +1753,216 @@
try:%0A
+ branch = git('symbolic-ref', '--short', 'HEAD', output=str)%0A except ProcessError:%0A branch = 'develop'%0A tty.warn('No branch found; using default branch: %25s' %25 branch)%0A try:%0A
... |
1c432cd4cfb0d6f8bb54727e2b16b58fd7feb390 | Add more categorical data | tests/data.py | tests/data.py | import pytest
import numpy as np
@pytest.fixture
def continuous_data():
x = np.array(range(5))
y = np.array(range(5))
return x, y
@pytest.fixture
def continuous_data_complicated():
x = np.array(range(10))
y = np.array(list(range(5)) + [6, 6.1, 6.2, 7, 7.1])
return x, y
@pytest.fixture
def cat... | Python | 0.000073 | @@ -601,16 +601,239 @@
turn x%0A%0A
+%0A@pytest.fixture%0Adef tall_matrix_data_2():%0A x = np.array(%5B%5B1, 2, 3%5D,%0A %5B1.1, 2.05, 3%5D,%0A %5B0.99, 2, 3%5D,%0A %5B0.98, 2.1, 3%5D%5D)%0A y = np.array(range(4))%0A return x, y%0A%0A
@pytest.
@@ -1085... |
a0546aafb34d27b55a59fdf499727cb5ef44cca4 | Print table-header | performance/routine.py | performance/routine.py | from performance import web
import time
import threading
class Tool:
def __init__(self, config):
if not isinstance(config, Config):
raise TypeError('No performance.routine.Config object')
self.config = config
def run(self):
if self.config.is_valid():
run_event ... | Python | 0.999599 | @@ -505,32 +505,74 @@
s with CTRL-C')%0A
+ print(' URL Time Code')%0A
for
|
0415361dcd6171f0f407ee528fa0761bf1e914b0 | Add proc name to gunicorn conf. | mezzanine/project_template/deploy/gunicorn.conf.py | mezzanine/project_template/deploy/gunicorn.conf.py | import os
bind = "127.0.0.1:%(port)s"
workers = (os.sysconf("SC_NPROCESSORS_ONLN") * 2) + 1
loglevel = "error"
| Python | 0 | @@ -24,16 +24,25 @@
0.0.1:%25(
+gunicorn_
port)s%22%0A
@@ -114,8 +114,36 @@
%22error%22%0A
+proc_name = %22%25(proj_name)s%22%0A
|
56606d3234fbebc504feec201e4a99a3adcd5023 | Fix code for pyflake8 convention | mgmtsystem_hazard_risk/models/mgmtsystem_hazard.py | mgmtsystem_hazard_risk/models/mgmtsystem_hazard.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it und... | Python | 0.000009 | @@ -1713,32 +1713,53 @@
obability_id and
+%5C%0A
hazard.severity
@@ -1765,16 +1765,37 @@
y_id and
+%5C%0A
hazard.
@@ -2065,17 +2065,16 @@
)
-
%0A
|
7c70a7c4b8b4cb002bcb8d683268c91de26d11c4 | formatname must be a string | tldp/doctypes/docbook4xml.py | tldp/doctypes/docbook4xml.py | #! /usr/bin/python
from ..utils import logger
from .common import SignatureChecker
class Docbook4XML(SignatureChecker):
formatname = ['DocBook 4.x XML']
extensions = ['.xml']
signatures = ['-//OASIS//DTD DocBook XML V4.1.2//EN',
'-//OASIS//DTD DocBook XML V4.2//EN',
'... | Python | 0.999577 | @@ -134,17 +134,16 @@
tname =
-%5B
'DocBook
@@ -151,17 +151,16 @@
4.x XML'
-%5D
%0A ext
|
96113152179ca81f24b85c19420fae7078907035 | change to ipn ver | amazon_buttons/views.py | amazon_buttons/views.py | from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse
from amazon_buttons import models
import datetime
from django.conf import settings
import urllib
from amazon_buttons import buttonconf
from amazon_buttons import _crypt
@csrf_exempt
def ipn_handler(request):
ipn = models.ipn... | Python | 0.999401 | @@ -747,31 +747,78 @@
ndPoint'%5D =
-ver_url
+settings.DOMAIN_FOR_AMAZON_IPN + reverse('amazon_ipn')
%0A%09%09prepd_dat
|
62367b8f6979dd90c5d8c4407580e958228792a5 | Fix list+tuple error due to Django Upgrade to v2.2+ | amy/workshops/fields.py | amy/workshops/fields.py | from dal_select2.widgets import (
Select2WidgetMixin as DALSelect2WidgetMixin,
)
from dal.autocomplete import (
Select2 as DALSelect2,
Select2Multiple as DALSelect2Multiple,
ListSelect2 as DALListSelect2,
ModelSelect2 as DALModelSelect2,
ModelSelect2Multiple as DALModelSelect2Multiple,
TagSe... | Python | 0 | @@ -2495,17 +2495,17 @@
een'%5D +
-(
+%5B
select2_
@@ -2524,11 +2524,9 @@
heme
-, )
+%5D
%0A%0A
|
15b0d333f434568b8c7a6f78b9773cd00d149638 | update loadxl tests | src/encoded/tests/test_loadxl.py | src/encoded/tests/test_loadxl.py | import pytest
from encoded import loadxl
import json
from unittest import mock
from pkg_resources import resource_filename
pytestmark = pytest.mark.working
def test_gen_access_keys(testapp, admin):
res = loadxl.generate_access_key(testapp,
store_access_key='local',
... | Python | 0 | @@ -1482,17 +1482,16 @@
%5B'key'%5D%0A
-%0A
@@ -1570,66 +1570,28 @@
-master_inserts = resource_filename('encoded', 'tests/data/
+data = %7B'fdn_dir': '
mast
@@ -1604,92 +1604,55 @@
erts
-/')
+',
%0A
-data = %7B%7D%0A data%5B'user'%5D = loadxl.read_single_sheet(master_inserts
+ 'itype':... |
38b5dc7ae5deb6eba676fb7315f2aafad474a1f4 | Allow overriding es.authorization_enabled | annotator/annotation.py | annotator/annotation.py | from annotator import authz, document, es
TYPE = 'annotation'
MAPPING = {
'id': {'type': 'string', 'index': 'no'},
'annotator_schema_version': {'type': 'string'},
'created': {'type': 'date'},
'updated': {'type': 'date'},
'quote': {'type': 'string'},
'tags': {'type': 'string', 'index_name': 'tag... | Python | 0.000032 | @@ -2196,32 +2196,79 @@
None, user=None,
+%0A authorization_enabled=None,
**kwargs):%0A
@@ -2315,35 +2315,135 @@
= %7B%7D%0A if
-es.
+authorization_enabled is None:%0A authorization_enabled = es.authorization_enabled%0A if
authorization_en
|
804d5808d38c5cb66fa2cfdd91e888fa5b3c8155 | Remove keystoneclient deprecation | aodh/keystone_client.py | aodh/keystone_client.py | #
# Copyright 2015 eNovance <licensing@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python | 0.000005 | @@ -771,22 +771,21 @@
keystone
-client
+auth1
import
|
0ea044dc978b6356cc49b9e5a47058beef5f38e4 | update transformer mean | tools/predict_worker/main.py | tools/predict_worker/main.py | import os
import time
import numpy as np
import caffe
import gear
import cStringIO as StringIO
import json
import urllib2
from caffe.io import resize_image
# import logging
# logging.basicConfig(level=logging.DEBUG)
caffe.set_mode_cpu()
MAX_PREDICT_LENGTH = 5
RAW_SCALE = 255.
def load_binaryproto(fn):
blob = caf... | Python | 0.000001 | @@ -149,18 +149,16 @@
e_image%0A
-#
import l
@@ -550,26 +550,24 @@
th):%0A
- #
mean_file =
@@ -745,16 +745,59 @@
emodel%22%0A
+%0A mean=load_binaryproto(mean_file)%0A%0A
@@ -892,120 +892,382 @@
-raw_scale=RAW_SCALE,%0A # mean=load_binaryproto(mean_file),%0A cha... |
38b36bcf3ba639faff7563f96db9ed45ce9ae5a4 | normalize qgis jobname | eventkit_cloud/ui/helpers.py | eventkit_cloud/ui/helpers.py | from __future__ import absolute_import
from contextlib import contextmanager
import os
from django.conf import settings
from django.utils import timezone
from django.template.loader import get_template, render_to_string
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
@contextmanage... | Python | 0.999998 | @@ -920,16 +920,68 @@
kStates%0A
+ from ..tasks.task_runners import normalize_name%0A
run
@@ -2653,24 +2653,39 @@
.format(
+normalize_name(
job_name
,%0A
@@ -2668,32 +2668,33 @@
ze_name(job_name
+)
,%0A
@@ -2905,24 +2905,39 @@
_name':
+normalize_name(
job_name
,%0A
@@ -2928,... |
a48085bc8a84f417fad4ae5c358a71dfa0d0570b | remove extra reshape | csaps/_sspndg.py | csaps/_sspndg.py | # -*- coding: utf-8 -*-
"""
ND-Gridded cubic smoothing spline implementation
"""
import collections.abc as c_abc
import typing as ty
import numpy as np
from ._base import SplinePPFormBase, ISmoothingSpline
from ._types import UnivariateDataType, NdGridDataType
from ._sspumv import SplinePPForm, CubicSmoothingSplin... | Python | 0.000048 | @@ -6865,34 +6865,8 @@
ata.
-reshape(sizey, order='F').
copy
|
859f97e2ba209479b0e882946afdf235ccd9e648 | Fix #1 Busy loop | pigv2/backends/glue.py | pigv2/backends/glue.py | import threading
import ipaddr
#Hub: takes one message from the input queue and replicates it across all output queues
class hub(object):
def __init__(self,input,output):
#Input and output functions (usually q1.get and [q2.put,q3.put....])
self.input = input;
self.output = output;
self.x=threading.Thread(tar... | Python | 0 | @@ -23,16 +23,28 @@
t ipaddr
+%0Aimport time
%0A%0A#Hub:
@@ -871,16 +871,37 @@
t,update
+,update_frequency=0.1
):%0A%09%09sel
@@ -1058,16 +1058,59 @@
= update
+%0A%09%09self.update_frequency = update_frequency
%0A%0A%09%09self
@@ -1743,16 +1743,58 @@
e True:%0A
+%09%09%09time.sleep(0.1) # to avoid a busy loop%0... |
ce73fe56375bef32a0997bdbe4ab305f232d605e | rename variable | daemon/rpcservice/systemservice.py | daemon/rpcservice/systemservice.py | import psutil
import json
from rpcservice.rpcservice import RPCService
from decorator.serialize import json_decorate
from decorator.singleton import singleton
@singleton
@json_decorate
class SystemService(RPCService):
def get_server_status(self):
cpu_status = {
"cpu": psutil.cpu_percent(),
... | Python | 0.000018 | @@ -257,19 +257,22 @@
-cpu
+system
_status
@@ -427,19 +427,22 @@
.append(
-cpu
+system
_status)
|
3586c3634a6e7ab21a32fcd3c62c33d6786aaaaa | Support -Xuse-fir (#717) | src/main/starlark/rkt_1_6/kotlin/opts.bzl | src/main/starlark/rkt_1_6/kotlin/opts.bzl | def _map_optin_class_to_flag(values):
return ["-opt-in=%s" % v for v in values]
_KOPTS = {
"warn": struct(
args = dict(
default = "report",
doc = "Control warning behaviour.",
values = ["off", "report", "error"],
),
type = attr.string,
value_t... | Python | 0 | @@ -4668,16 +4668,298 @@
%0A ),%0A
+ %22x_use_fir%22: struct(%0A args = dict(%0A default = False,%0A doc = %22Compile using the experimental Kotlin Front-end IR. Available from 1.6.%22,%0A ),%0A type = attr.bool,%0A value_to_flag = %7B%0A True: %5B%22-... |
6e8be0bf525d386cfd83ac1c0c3f66475e308234 | fix id tag | examples/RooUnfoldExample.py | examples/RooUnfoldExample.py | # ==============================================================================
# File and Version Information:
# $Id: RooUnfoldExample.py 248 2010-10-04 22:18:19Z T.J.Adye $
#
# Description:
# Simple example usage of the RooUnfold package using toy MC.
#
# Author: Tim Adye <T.J.Adye@rl.ac.uk>
#
# ==... | Python | 0.000005 | @@ -177,17 +177,16 @@
Adye $%0A#
-
%0A# Desc
@@ -263,17 +263,16 @@
oy MC.%0A#
-
%0A# Auth
@@ -305,17 +305,16 @@
ac.uk%3E%0A#
-
%0A# =====
|
61aea6972b9bc36e36bca9b7e971c798166c4dae | Revert "Support multiple Vagrant VM limit (comma separated)." | pyinfra/api/connectors/vagrant.py | pyinfra/api/connectors/vagrant.py | import json
from os import path
from threading import Thread
from six.moves.queue import Queue
from pyinfra import local, logger
from pyinfra.api.exceptions import InventoryError
from pyinfra.progress import progress_spinner
VAGRANT_CONFIG = None
VAGRANT_OPTIONS = None
def _get_vagrant_ssh_config(queue, progress,... | Python | 0 | @@ -571,86 +571,65 @@
imit
-:%0A limit = limit.split(',') # accept multiple comma separated VM names
+ and not isinstance(limit, list):%0A limit = %5Blimit%5D
%0A%0A
|
4f8fe4c584f3dd4f5cc612c43534f6b2dc149a11 | Fix a bug that caused the from_config to ignore the base_path when method is set to local | simplefsabstraction/interface.py | simplefsabstraction/interface.py | import uuid
class SimpleFS:
class BadExtensionError(Exception):
def __init__(self):
super().__init__('Extension not allowed')
def exists(self, file_name):
"""
Check whether a file exists in the file system
:param file_name: the name of the file
:return: tru... | Python | 0.000001 | @@ -2287,32 +2287,193 @@
onfig else None%0A
+ if 'base_path' in config:%0A return LocalFS(allowed_extensions=allowed_extensions, base_path=config%5B'base_path'%5D)%0A else:%0A
retu
|
b193a4035a0a77ba2555c41d977cf31975ac3b47 | Disable destructive action challenge for codelab. (#1059) | pylib/spinnaker/codelab_config.py | pylib/spinnaker/codelab_config.py | # Copyright 2016 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 a... | Python | 0 | @@ -1120,16 +1120,304 @@
%7D%0A )%0A%0A
+def disable_destructive_action_challenge():%0A %22%22%22Disables destructive action challenge for codelab.%0A%0A %22%22%22%0A YamlBindings.update_yml_source(%0A '/opt/spinnaker/config/clouddriver.yml',%0A %7B%0A 'credentials': %7B%0A 'challengeDestructive... |
1926e8d45017ed81228d79d43a03d5ef821ce341 | use pickle to serialize session | everyclass/server/utils/session.py | everyclass/server/utils/session.py | # https://github.com/SaintFlipper/EncryptedSession/blob/master/main.py
import base64
import json
import zlib
from json import JSONDecoder, JSONEncoder
from Crypto.Cipher import AES
from flask.sessions import SessionInterface, SessionMixin
from werkzeug.datastructures import CallbackDict
class EncryptedSession(Callba... | Python | 0 | @@ -85,20 +85,22 @@
%0Aimport
-json
+pickle
%0Aimport
@@ -2434,65 +2434,25 @@
t =
-json
+pickle
.loads(
-str(data, 'utf-8'), cls=BinaryAwareJSONDecoder
+data
)%0A%0A
@@ -3229,24 +3229,26 @@
ress%0A
+ #
bdict = byt
@@ -3314,16 +3314,60 @@
utf-8')%0A
+ bdict = pickle.dumps(dict(session))%0A
... |
555236f769c13518db70f5df36e5688d63486bd5 | Remove -detect_leaks=0 from test/fuzz/test_runner.py - no longer needed | test/fuzz/test_runner.py | test/fuzz/test_runner.py | #!/usr/bin/env python3
# Copyright (c) 2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run fuzz test targets.
"""
import argparse
import configparser
import os
import sys
import subprocess
impor... | Python | 0.000001 | @@ -4867,39 +4867,8 @@
1',%0A
- '-detect_leaks=0',%0A
|
c2c846b2e658e184e46a7e4d8375d4dcffbe04c3 | edit doc strings | src/ezdxf/math/transformtools.py | src/ezdxf/math/transformtools.py | # Created: 02.05.2020
# Copyright (c) 2020, Manfred Moitzi
# License: MIT License
from typing import TYPE_CHECKING, Tuple
import math
from .matrix44 import Matrix44
from .vector import Vector, X_AXIS, Y_AXIS
from .ucs import OCS
if TYPE_CHECKING:
from ezdxf.eztypes import DXFGraphic, Vertex
class TransformError(... | Python | 0.000001 | @@ -2292,107 +2292,85 @@
rns
-length of transformed %60length%60 vector.%0A%0A Args:%0A length: length vector in old OCS%0A
+magnitude of %60length%60 direction vector transformed form old OCS into new OCS.
%0A
@@ -2589,34 +2589,34 @@
ex transformed f
-r
o
+r
m old OCS into n
@@ -2625,37 +262... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.