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 |
|---|---|---|---|---|---|---|---|
bcf4c6be490b96230877d9388c27783abdbc487e | Fix aibrake | lib/ansible/modules/extras/monitoring/airbrake_deployment.py | lib/ansible/modules/extras/monitoring/airbrake_deployment.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Bruce Pennypacker <bruce@pennypacker.org>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version... | Python | 0.00005 | @@ -2443,32 +2443,45 @@
ct(required=True
+, no_log=True
),%0A e
|
8cbce567c8dc6c78a48972f7918897056a99a854 | fix to_3d | gdsfactory/export/to_3d.py | gdsfactory/export/to_3d.py | from typing import Optional, Tuple
import shapely
from gdsfactory.component import Component
from gdsfactory.layers import LayerColors
from gdsfactory.pdk import get_layer_colors, get_layer_stack
from gdsfactory.tech import LayerStack
from gdsfactory.types import Layer
def to_3d(
component: Component,
layer... | Python | 0.00156 | @@ -1434,16 +1434,32 @@
pec=True
+, as_array=False
).items(
|
9621de820ccbdd12a42bb4e4ff2f228ed245ee2e | Set velocity to maximum Maxon EC45 velocity. | epos_control_server.py | epos_control_server.py | #!/usr/bin/python
import logging.config
import signal
import threading
from flask import Flask, send_from_directory
from flask.ext.socketio import SocketIO
from epos_lib_wrapper import EposLibWrapper
from position_fetcher import PositionFetcher
POSITION_MAX_DELTA_TO_END = 0
EPOS_RELATIVE_POSITION = 20000000
EPOS_V... | Python | 0 | @@ -327,11 +327,11 @@
Y =
-300
+484
0%0A%0A#
|
fe4c426fe6384b570bcc2a105bdf04f2f412a31f | Use Query.executQuery for filterCasts.py | InformationScripting/scripts/filterCasts.py | InformationScripting/scripts/filterCasts.py | # filterCasts
casts = Query.ast(["-t=CastExpression"] + Query.args, [])
castTypeAttributes = Query.attribute(["-at=castType", "-s=of"], casts)
classUses = Query.uses(["-s=of", "-t=Class"], castTypeAttributes)
def hasTypeIdMethod( cl ):
for method in cl.methods:
if method.name == "typeIdStatic":
... | Python | 0 | @@ -9,19 +9,23 @@
Casts%0A%0Ac
+l
as
-t
+sUse
s = Quer
@@ -30,187 +30,99 @@
ery.
-ast(%5B%22-t=CastExpression%22%5D + Query.args, %5B%5D)%0AcastTypeAttributes = Query.attribute(%5B%22-at=castType%22, %22-s=of%22%5D, casts)%0AclassUses = Query.uses(%5B%22-s=of%22, %22-t=Class%22%5D, castTypeAttributes
+executeQuery(... |
69613f33b7b950dd536a5c4322214fbeaee89013 | fix bug | generate_tests0000-0999.py | generate_tests0000-0999.py | from isochrones.dartmouth import Dartmouth_Isochrone
from isochrones.utils import addmags
import numpy as np
import pandas as pd
file = open('/tigress/np5/true_params.txt','a')
def get_index(n):
if n < 10:
index = '000' + str(n)
elif n < 100:
index = '00' + str(n)
elif n < 1000:
in... | Python | 0.000001 | @@ -209,31 +209,30 @@
10:%0A
-index =
+return
'000' + str
@@ -261,23 +261,22 @@
-index =
+return
'00' +
@@ -309,23 +309,22 @@
-index =
+return
'0' + s
@@ -347,23 +347,22 @@
-index =
+return
str(n)%0A
|
866f9cbe01e360872e0b7f55b00f2683adffaabc | Fix typo | ckanext/mapactiontheme/controllers/admin_controller.py | ckanext/mapactiontheme/controllers/admin_controller.py | from ckan.controllers.admin import AdminController
import ckan.lib.base as base
import ckan.lib.helpers as h
import ckan.model as model
import ckan.logic as logic
from ckan.lib.base import BaseController
from ckan.plugins.toolkit import c, request, _
from ckan.authz import has_user_permission_for_group_or_org
class C... | Python | 0.999999 | @@ -1751,19 +1751,16 @@
eval of
-of
revision
|
f5c94105f6652186e05ebe201f127a1c8b7bd94c | add script to download and save articles | newsplease/tests/downloadarticles.py | newsplease/tests/downloadarticles.py | import json
import os
name = 'trump-in-saudi-arabia.txt'
basepath = '/Users/felix/Downloads/'
download_dir = basepath + 'dir' + name + '/'
os.makedirs(download_dir)
articles = NewsPlease.download_from_file(basepath + name)
for url in articles:
article = articles[url]
with open(download_dir + article['filena... | Python | 0 | @@ -372,8 +372,9 @@
utfile)%0A
+%0A
|
09441298ca9a170d166d61502eaa0b0f29358f4a | Fix for threshold outside testrun | PreProcess.py | PreProcess.py | import numpy as np
import sys, os
import nrrd
if (len(sys.argv) < 3):
print 'Error: missing arguments!'
print 'e.g. python PreProcess.py image_ch1.nrrd image_ch2.nrrd [C #]' # t or tC = test run with no save.
else:
print 'Processing %s and %s...'% (str(sys.argv[1]), str(sys.argv[2]))
data... | Python | 0.000001 | @@ -511,24 +511,49 @@
c = -1%0A %0A
+ testrun = False%0A %0A
if (len(
|
f6686169cf7344e0c75c6d060332d3692fc7df1c | Update curation table format | bin/trait_mapping/create_table_for_manual_curation.py | bin/trait_mapping/create_table_for_manual_curation.py | #!/usr/bin/env python3
import argparse
from eva_cttv_pipeline.trait_mapping.ols import (
get_ontology_label_from_ols, is_current_and_in_efo, is_in_efo,
)
def find_previous_mapping(trait_name, previous_mappings):
if trait_name not in previous_mappings:
return ''
uri = previous_mappings[trait_name... | Python | 0 | @@ -2008,162 +2008,8 @@
req,
-%0A # Mapping to use, if ready, comment, mapping URI, mapping label, whether exact, in EFO%0A '', '', '', '', '', '', '',%0A
pre
|
7f48cdbf306a4cf59e975aa41ddfef663e366b77 | Add test for non-empty database | tests/test_checker.py | tests/test_checker.py | import os
import sys
import stat
from random import randint, choice
from string import ascii_letters
import pytest
from botbot import checker, problems, checks, fileinfo
def create_random_directory_tree(ic, directory):
"""Create a directory tree with ic files in it (files and directories)"""
dp = directory
... | Python | 0.000019 | @@ -1949,16 +1949,452 @@
cklist%0A%0A
+def test_oneshot_checker_update_list_with_entries(tmpdir):%0A _TMPDIR_CT = 20%0A td = tmpdir.mkdir('doot')%0A tf = td.join('test.txt').ensure()%0A%0A c = checker.OneshotChecker(sys.stdout, tmpdir.join('test.db').strpath)%0A files = %5Bfileinfo.FileInfo(tf.strpath)%... |
620210707477e6496ab665ec7df8afaf2ba408aa | consolidate test version conditional boilerplate into assertion method | tests/test_codegen.py | tests/test_codegen.py | """
Part of the astor library for Python AST manipulation
License: 3-clause BSD
Copyright 2014 (c) Berker Peksag
"""
import ast
import sys
import textwrap
try:
import unittest2 as unittest
except ImportError:
import unittest
import astor
class CodegenTestCase(unittest.TestCase):
def assertAstSourceE... | Python | 0.000024 | @@ -395,32 +395,276 @@
rce)), source)%0A%0A
+ def assertAstSourceEqualIfAtLeastVersion(self, source, version_tuple):%0A if sys.version_info %3E= version_tuple:%0A self.assertAstSourceEqual(source)%0A else:%0A self.assertRaises(SyntaxError, ast.parse, source)%0A%0A
def test_i... |
c5902af643d639ecefa756a0caaeeb58a7c6d151 | Update P4_textToExcel working solution | books/AutomateTheBoringStuffWithPython/Chapter12/PracticeProjects/P4_textToExcel.py | books/AutomateTheBoringStuffWithPython/Chapter12/PracticeProjects/P4_textToExcel.py | # Write a program to read in the contents of several text files (you can make
# the text files yourself) and insert those contents into a spreadsheet, with
# one line of text per row. The lines of the first text file will be in the
# cells of column A, the lines of the second text file will be in the cells of
# column ... | Python | 0 | @@ -343,16 +343,49 @@
openpyxl
+%0Aimport os%0A%0AFOLDER = %22./p4files/%22
%0A%0A# Open
@@ -462,46 +462,189 @@
les%0A
-%0A# Open file%0A%0A# Scan lines into list%0A%0A
+filelist = os.listdir(FOLDER)%0Afilelist.sort()%0A%0A# Open file%0Afor file in filelist:%0A with open(FOLDER + file) as fileObj:%0A index... |
96adca2c21e37afd9a7c40d9aac7f0c6aa86ed84 | Improve naming. | gitfs/views/passthrough.py | gitfs/views/passthrough.py | # Copyright 2014 PressLabs SRL
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | Python | 0.000017 | @@ -1750,16 +1750,20 @@
st
+atus
= os.ls
@@ -1813,16 +1813,20 @@
tattr(st
+atus
, key))
|
7597497017053356cdfbebc38aa1468240df2e45 | fix the install to ./install requirements | fabfile/build.py | fabfile/build.py | from fabric.api import task, local, execute
import clean
__all__ = ['req', 'sdist', 'install', 'sphinx']
@task
def req():
"""install the requirements"""
local("pip install -r requirements.txt")
@task
def sdist():
"""create the sdist"""
execute(clean.all)
local("python setup.py sdist --format=bzta... | Python | 0.000005 | @@ -66,15 +66,8 @@
= %5B
-'req',
'sdi
@@ -97,106 +97,8 @@
'%5D%0A%0A
-@task%0Adef req():%0A %22%22%22install the requirements%22%22%22%0A local(%22pip install -r requirements.txt%22)%0A%0A
@tas
@@ -281,20 +281,18 @@
al(%22
-pip
+./
install
-r r
@@ -291,11 +291,8 @@
all
--r
requ
|
9646fb2b7f7f441c6630e04fa1e1af358f9c7d10 | Set version to 0.20 final | eulexistdb/__init__.py | eulexistdb/__init__.py | # file eulexistdb/__init__.py
#
# Copyright 2010,2011 Emory University Libraries
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | Python | 0.000037 | @@ -1116,13 +1116,12 @@
0,
-'dev'
+None
)%0A%0A#
|
859e8c3ad30fa4b4899609fc136fa8f45f73b8d4 | Add zoom functionality for the third axis of data cube | data-cube/volume_modify.py | data-cube/volume_modify.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... | Python | 0.000001 | @@ -705,16 +705,69 @@
hreshold
+%0A* =- - increase/decrease the scale of the third axis
%0A%0AWith f
@@ -4503,16 +4503,17 @@
%25 th)%0A#
+
Add zoom
|
14cb7c49d5b2e155e92c07ecd1e58dc386b0ddb3 | stop failing on exceptions--skip instead | parsing/parsinglib/jobcontainer.py | parsing/parsinglib/jobcontainer.py | from ..models import Job
import datetime
class JobContainer():
def __init__(self):
self.organization = None
self.title = None
self.division = None
self.date_posted = None
self.date_closing = None
self.date_collected = None
self.url_detail = None
self.... | Python | 0 | @@ -35,16 +35,17 @@
tetime%0A%0A
+%0A
class Jo
@@ -54,24 +54,25 @@
ontainer():%0A
+%0A
def __in
@@ -646,16 +646,33 @@
eyError(
+%0A
%22Queried
@@ -1154,32 +1154,66 @@
f.salary_amount%0A
+ # totally arbitray amount%0A
self.sal
@@ -1272,34 +1272,8 @@
alse
- # totally arbitray a... |
d7628bc32a0ba75bb5070ae7774e92039be735df | Fix manage_users | aetherguild/manage_users.py | aetherguild/manage_users.py | # -*- coding: utf-8 -*-
import argparse
from getpass import getpass
from listener_service.tables import User
import config
import tabulate
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
from passlib.hash import pbkdf2_sha512
def check_args(a):
if not a.username:
print("Use... | Python | 0.000002 | @@ -1330,35 +1330,8 @@
el)%0A
- user.active = a.active%0A
@@ -1380,16 +1380,16 @@
ssword)%0A
+
%0A s.a
@@ -2250,22 +2250,23 @@
if a.
-active
+deleted
:%0A
@@ -2280,25 +2280,27 @@
ser.
-active = a.active
+deleted = a.deleted
%0A
@@ -2888,22 +2888,23 @@
ser%5B'
-active
+deleted
'%5D = ... |
f633df6bb8e0e84699db2f47178f4b402ccc07a8 | Fix `OverflowError`. | eventkit/utils/time.py | eventkit/utils/time.py | from datetime import timedelta
from timezone import timezone
ROUND_DOWN = 'ROUND_DOWN'
ROUND_NEAREST = 'ROUND_NEAREST'
ROUND_UP = 'ROUND_UP'
WEEKDAYS = {
'MON': 0,
'TUE': 1,
'WED': 2,
'THU': 3,
'FRI': 4,
'SAT': 5,
'SUN': 6,
}
MON = 'MON'
TUE = 'TUE'
WED = 'WED'
THU = 'THU'
FRI = 'FRI'
SA... | Python | 0 | @@ -9,24 +9,34 @@
etime import
+ datetime,
timedelta%0A%0A
@@ -1434,42 +1434,178 @@
-when_min = %5C%0A timezone.
+# It doesn't seem to be possible to localise the %60min%60 datetime without%0A # raising %60OverflowError%60, so create a timezone aware object manually.%0A when_min =
da... |
701fc978271f8e0fc203374e05a40f23132b78b9 | Add convenience methods for active version number and Service Details API | fastly/models.py | fastly/models.py | """
"""
from string import Template
from copy import copy
from six.moves.urllib.parse import urlencode
class Model(object):
def __init__(self):
self._original_attrs = None
self.attrs = {}
@classmethod
def query(cls, conn, pattern, method, suffix='', body=None, **kwargs):
url = Te... | Python | 0 | @@ -2744,24 +2744,335 @@
N + '/$id'%0A%0A
+ def details(self):%0A resp, data = self._query('GET', '/details')%0A return data%0A%0A def get_active_version_number(self):%0A versions = self.attrs.get('versions')%0A if versions:%0A return list(filter(lambda x: x%5B'active'%5D i... |
09a6c3b5d860f8bbfafec9f5cdb4cef00cdae9c9 | Implement an additional test for handling exceptions in bake | tests/test_cookies.py | tests/test_cookies.py | # -*- coding: utf-8 -*-
import json
def test_help_message(testdir):
result = testdir.runpytest(
'--help',
)
# fnmatch_lines does an assertion internally
result.stdout.fnmatch_lines([
'cookies:',
'*--template=TEMPLATE*',
])
def test_cookies_fixture(testdir):
"""Make s... | Python | 0.000001 | @@ -2440,24 +2440,1127 @@
project PASSED',%0A %5D)%0A
+%0A%0Adef test_cookies_bake_should_handle_exception(testdir):%0A %22%22%22Programmatically create a **Cookiecutter** template and make sure that%0A cookies.bake() handles exceptions that happen during project generation.%0A%0A We expect **Cookiecutter*... |
3b4de1be81c7951ca064ff46e1f3e1ed95436ae3 | fix XSS vulnerability | django_bootstrap_breadcrumbs/templatetags/django_bootstrap_breadcrumbs.py | django_bootstrap_breadcrumbs/templatetags/django_bootstrap_breadcrumbs.py | # -*- coding: utf-8 -*-
"""
:copyright: Copyright 2013 by Łukasz Mierzwa
:contact: l.mierzwa@gmail.com
"""
from inspect import ismethod
from django.core.urlresolvers import reverse, NoReverseMatch
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from django.db.... | Python | 0 | @@ -201,16 +201,53 @@
seMatch%0A
+from django.utils.html import escape%0A
from dja
@@ -1090,21 +1090,29 @@
%5B%5D) + %5B(
+escape(
label
+)
, viewna
|
41ea0dd8c48ef8a336422482e9bbd1911bb7e168 | Make that it works in 90% of the cases. 3:30. | Commitment.py | Commitment.py | import sublime
import sublime_plugin
from commit import Commitment
whatthecommit = 'http://whatthecommit.com/'
randomMessages = Commitment()
class CommitmentToClipboardCommand(sublime_plugin.WindowCommand):
def run(self):
commit = randomMessages.get()
message = commit.get('message', '')
message_ha... | Python | 0.999808 | @@ -29,16 +29,34 @@
e_plugin
+%0Aimport HTMLParser
%0A%0Afrom c
@@ -294,32 +294,106 @@
e =
-commit.get('message', ''
+HTMLParser.HTMLParser().unescape(commit.get('message', '').replace('%5Cn','').replace('%3Cbr/%3E', '%5Cn')
)%0A
@@ -479,32 +479,39 @@
'Commitment: ' +
+ '%5Cn' +
message + '%5Cn'
@@ -737,32 +... |
6b85753357bbadd7ae0c0b1b814d7b10065e536b | clean up a little | tests/test_crawler.py | tests/test_crawler.py | # -*- coding: utf-8 -*-
import copy
import pytest
from urlparse import urljoin
from bs4.element import Tag
from crawly import crawler
from crawly.href import Href
def test_live_site_without_exception(site):
"""Crawls a live site without raising an exception"""
crawler.crawl(Href(urljoin(site, '/index.html')))... | Python | 0.000036 | @@ -76,36 +76,8 @@
oin%0A
-from bs4.element import Tag%0A
from
@@ -99,16 +99,16 @@
crawler%0A
+
from cra
@@ -2216,54 +2216,8 @@
%22%22%22%0A
- tag = Tag(name='a', attrs=%7B'href': href%7D)%0A
@@ -2352,32 +2352,8 @@
old
-, 'sanity check failed'%0A
%0A
@@ -2365,35 +2365,42 @@
ler.accept_link(
-tag
+H... |
b712346d4e138ccd00599c2d2fb9fdd938964589 | Remove startup.bat after resume. | pausable_unittest/windowspauser.py | pausable_unittest/windowspauser.py |
import pausable_unittest
import os
import os.path
import sys
import subprocess
import tempfile
import ctypes
TASK_NAME = "pausable_unittest"
BASE_DIR = os.path.abspath(os.getcwd())
BAT_PATH = os.path.join(BASE_DIR, "startup.bat")
PYTHON_PATH = os.path.abspath(sys.executable)
SCRIPT_PATH = os.path.relpath... | Python | 0 | @@ -3629,16 +3629,95 @@
(path)%0D%0A
+ if os.path.exists(BAT_PATH):%0D%0A os.remove(BAT_PATH)%0D%0A
|
81c32c9bc0868f7ccd764d8432fd46ccb7e6a8ef | Use get instead | paystackapi/tests/test_transfer.py | paystackapi/tests/test_transfer.py | import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.transfer import Transfer
class TestTransfer(BaseTestCase):
@httpretty.activate
def test_initiate(self):
"""Method defined to test transfer initiation."""
httpretty.register_uri(
httpretty.... | Python | 0 | @@ -898,35 +898,34 @@
httpretty.
-POS
+GE
T,%0A s
|
9a425bae3af8cca7ad8be938d7f698ef65f42f3a | Update load_groups_pipeline.py (#210) | google/cloud/security/inventory/pipelines/load_groups_pipeline.py | google/cloud/security/inventory/pipelines/load_groups_pipeline.py | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 0 | @@ -1910,14 +1910,18 @@
roup
-%5B
+.get(
'id'
-%5D
+)
,%0A
@@ -1961,17 +1961,21 @@
roup
-%5B
+.get(
'email'
-%5D
+)
,%0A
@@ -2014,16 +2014,20 @@
roup
-%5B
+.get(
'kind'
-%5D
+)
,%0A
@@ -2075,9 +2075,13 @@
roup
-%5B
+.get(
'dir
@@ -2100,9 +2100,9 @@
unt'
-%5D
+)
,%0A
|
2695c8c52d292f94cf404c959b43e2c1c57ddc02 | Implement handling of trade messages. | src/udprecieve.py | src/udprecieve.py | import json
import random
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
from crypto import get_public_bytestring
from orderbook import (match_incoming_ask, match_incoming_bid,
get_bids, get_asks, get_own_bids, get_own_asks,
trades, offers, get_offer,
... | Python | 0 | @@ -307,16 +307,30 @@
t_offer,
+ remove_offer,
%0A
@@ -3165,29 +3165,23 @@
-offer = get_offer(id=
+id, trade_id =
get_
@@ -3200,16 +3200,63 @@
tring(),
+ trade%5B'trade-id'%5D%0A offer = get_offer(id=id,
message
@@ -3260,36 +3260,27 @@
age_id=trade
-%5B'trade-id'%5D
+_id
)%0A if off
@@ -3283... |
cc3ca68df357572767280bdddf332cfd430e9203 | Enhance the test to avoid celery internal queues in rabbitmq status. | oneflow/base/utils/stats/rabbitmq.py | oneflow/base/utils/stats/rabbitmq.py | # -*- coding: utf-8 -*-
u"""
Copyright 2012-2014 Olivier Cortès <oc@1flow.io>.
This file is part of the 1flow project.
1flow 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... | Python | 0 | @@ -2561,16 +2561,25 @@
return %5B
+%0A
q for q
@@ -2633,20 +2633,16 @@
-
if not (
q%5B'n
@@ -2637,16 +2637,29 @@
if not (
+%0A
q%5B'name'
@@ -2698,48 +2698,45 @@
- or q%5B'name'%5D.startswith('celery'))
+or 'celery' in q%5B'name'%5D%0A )%0A
%5D%0A
|
a7894b858c31bbd7561b2e20ec43f5268f676f56 | Remove TEMPLATE_ options from example-local. | onlineweb4/settings/example-local.py | onlineweb4/settings/example-local.py | import os
import sys
from base import PROJECT_ROOT_DIRECTORY
# Prevent python from making .pyc files
sys.dont_write_bytecode = True
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# Change this to the host in production
ALLOWED_HOSTS = '*'
DATABASES = {
#'default': {
#'ENGINE': 'django.db.backends.postgresql_psyc... | Python | 0 | @@ -145,31 +145,8 @@
True
-%0ATEMPLATE_DEBUG = DEBUG
%0A%0A#
|
9c04063c033a1f707b6befdc66280a426fba78e3 | Add asterisk mark for the required field on CreateNamespaceForm | openstack_dashboard/dashboards/admin/metadata_defs/forms.py | openstack_dashboard/dashboards/admin/metadata_defs/forms.py | #
# (c) Copyright 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
#
# Unle... | Python | 0.000001 | @@ -1167,32 +1167,8 @@
'),%0A
- required=False,%0A
@@ -1619,32 +1619,87 @@
-on': 'source',%0A
+ 'data-required-when-shown': 'true',%0A
@@ -2017,32 +2017,87 @@
-on': 'source',%0A
+ 'data-required-when-shown': 'true',%0A
|
c93ab0a8030cd3819a4278d29d2976a4a0a42fdb | Fix LDAPURL's tests | tests/test_ldapurl.py | tests/test_ldapurl.py | import pytest
from bonsai import LDAPURL
from bonsai import LDAPDN
from bonsai.errors import InvalidDN
@pytest.fixture
def valid_ldapurl():
""" Get a valid LDAPURL. """
strurl = "ldaps://testurl:444/cn=test,dc=test?sn,gn?base?(objectclass=*)?1.2.3.4"
return LDAPURL(strurl)
def test_get_address(valid_ld... | Python | 0.000006 | @@ -1568,24 +1568,28 @@
apurl.filter
+_exp
== %22(object
@@ -3723,16 +3723,20 @@
l.filter
+_exp
== %22(cn
|
d9001013a070176756f49166552b7dbb5fb6aeb0 | Fix plugin rendering in tests | tests/test_plugins.py | tests/test_plugins.py | # -*- coding: utf-8 -*-
import pytest
from cms.api import add_plugin
from cms.models import Placeholder
from cmsplugin_articles_ai.cms_plugins import ArticleList, TagFilterArticleList, TagList
from cmsplugin_articles_ai.factories import PublicArticleFactory, TagFactory
def create_articles(amount):
for _ in range(... | Python | 0 | @@ -97,16 +97,65 @@
eholder%0A
+from cms.plugin_rendering import ContentRenderer%0A
from cms
@@ -404,16 +404,225 @@
ory()%0A%0A%0A
+def init_content_renderer(request=None):%0A %22%22%22%0A Create and return %60ContentRenderer%60 instance initiated with request.%0A Request may be %60None%60 in some cases.%0A... |
f928cd15b6ac04e03e569694c57f43110ce04b0a | Add ignoretz to FeedEntryItemLoader in case the supplied timezone is bogus. | feeds/loaders.py | feeds/loaders.py | import html
import os
import re
from copy import deepcopy
from datetime import datetime
import dateparser
import lxml
from dateutil.parser import parse as dateutil_parse
from dateutil.tz import gettz
from lxml import etree
from lxml.cssselect import CSSSelector
from lxml.html import HtmlComment
from scrapy.loader impo... | Python | 0 | @@ -854,24 +854,88 @@
st%22, True),%0A
+ ignoretz=loader_context.get(%22ignoretz%22, False),%0A
|
dba62be0d8b87a66b415460a07f453536209b08e | change user api prefix to user/ from users/ | dubdubdub/api_urls.py | dubdubdub/api_urls.py | from django.conf.urls import patterns, url
from django.views.decorators.cache import cache_page
from schools.api_views import SchoolsList, SchoolsInfo, SchoolInfo, Districts, \
SchoolsDiseInfo, SchoolDemographics, SchoolProgrammes, SchoolFinance, \
Blocks, Clusters, BlocksInsideDistrict, ClustersInsideDistrict... | Python | 0 | @@ -2578,25 +2578,24 @@
url('%5Euser
-s
/signup$', '
@@ -2649,25 +2649,24 @@
url('%5Euser
-s
/signin$', '
@@ -2724,17 +2724,16 @@
l('%5Euser
-s
/signout
@@ -2798,17 +2798,16 @@
l('%5Euser
-s
/test_au
|
88d56e2857f09223175e9f845aebb496c143d08b | check for gl errors in sampler tests | tests/test_sampler.py | tests/test_sampler.py | import unittest
import moderngl
from common import get_context
class TestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.ctx = get_context()
def test_attributes(self):
sampler = self.ctx.sampler()
# Default values
self.assertEqual(sampler.anisotropy, 1.0... | Python | 0 | @@ -59,16 +59,243 @@
ontext%0A%0A
+def checkerror(func):%0A def wrapper(*args, **kwargs):%0A _ = get_context().error%0A func(*args, **kwargs)%0A err = get_context().error%0A assert err == 'GL_NO_ERROR', %22Error: %25s%22 %25 err%0A return wrapper%0A%0A
%0Aclass T
@@ -406,27 +406,39 @... |
77d99751bdb55d25eeaff94c40e292ee8e56cbf6 | Add test for wrong number of time constants | tests/test_spiking.py | tests/test_spiking.py | from neurons import spiking
__author__ = 'johannes'
import pytest
import numpy as np
class TestVarious:
def test_neuron_no_spike(self):
# Neuron should not spike
timesteps = 20
# Two neurons
spiking_model = spiking.SRM(neurons=2, threshold=1.0, t_current=0.3,
... | Python | 0.000271 | @@ -5056,43 +5056,8 @@
e)%0A%0A
- # FIXME%0A @pytest.mark.xfail%0A
|
aeb2aaa106d7b37e0c9a3fc8a71364d79b00346d | Remove some debugging output from a migration | uk_results/migrations/0030_populate_postresult_post_election.py | uk_results/migrations/0030_populate_postresult_post_election.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import defaultdict
from django.db import migrations, models
def set_post_election_from_post(apps, schema_editor):
"""
This is far from ideal. Try to guess the PostExtraElection
that this PostResult relates to. This will have... | Python | 0.000004 | @@ -622,52 +622,8 @@
')%0A%0A
- print(PostResult.objects.all().count())%0A
|
8fd65190a2a68a7afeab91b0a02c83309f72ccd6 | Add tests to gen_test for generator, seems to work | tests/test_testing.py | tests/test_testing.py |
import greenado
from greenado.testing import gen_test
from tornado.testing import AsyncTestCase
from tornado import gen
@gen.coroutine
def coroutine():
raise gen.Return(1234)
class GreenadoTests(AsyncTestCase):
@gen_test
def test_without_timeout(self):
assert greenado.gyield(coroutine()) ... | Python | 0 | @@ -253,32 +253,33 @@
_without_timeout
+1
(self):%0A
@@ -318,24 +318,151 @@
()) == 1234%0A
+ %0A @gen_test%0A @greenado.generator%0A def test_without_timeout2(self):%0A assert (yield coroutine()) == 1234%0A
%0A @ge
@@ -504,16 +504,17 @@
_timeout
+1
(self):%0A
@@ -549,29 +549,... |
0d313502b8b5d850109b48cde8d3dea2dae0d802 | Clean up __init__.py . | vcr/__init__.py | vcr/__init__.py | import logging
from .config import VCR
# Set default logging handler to avoid "No handler found" warnings.
import logging
try: # Python 2.7+
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
logging.getLogger(__name__).add... | Python | 0.000021 | @@ -101,31 +101,16 @@
rnings.%0A
-import logging%0A
try: #
@@ -267,16 +267,17 @@
pass%0A%0A
+%0A
logging.
@@ -323,16 +323,17 @@
ler())%0A%0A
+%0A
default_
@@ -348,14 +348,8 @@
R()%0A
-%0A%0Adef
use_
@@ -360,36 +360,10 @@
ette
-(path, **kwargs):%0A return
+ =
def
@@ -387,21 +387,5 @@
ette
-(path, **k... |
98bf3d45c7f9cef77273e977d28cc9eaeaa95905 | fix import for state daily integration test | integrations/acquisition/covid_hosp/state_daily/test_scenarios.py | integrations/acquisition/covid_hosp/state_daily/test_scenarios.py | """Integration tests for acquisition of COVID hospitalization."""
# standard library
import unittest
from unittest.mock import MagicMock
from unittest.mock import patch
# third party
import requests
# first party
from delphi.epidata.acquisition.covid_hosp.common.database import Database
from delphi.epidata.acquisiti... | Python | 0 | @@ -495,16 +495,94 @@
Update%0A
+from delphi.epidata.acquisition.covid_hosp.state_daily.network import Network%0A
import d
|
83a7db27cd72bfc3699d56dfe8d2f988e3f8642e | fix typo | easylinker/parsers.py | easylinker/parsers.py | #-*- coding: utf-8 -*-
#from __future__ import unicode_literals
#from __future__ import print_function
from jinja2 import Template
import re
from config import PREDEFINED_VARIABLE_TABLE
from links import Link, LinkException
import platform
class ParserException(Exception):
pass
def to_unicode(val):
if type(... | Python | 0.999991 | @@ -1109,33 +1109,32 @@
if self.p
-a
latform == None:
@@ -1126,32 +1126,32 @@
atform == None:%0A
+
retu
@@ -1296,33 +1296,32 @@
if self.p
-a
latform == None:
@@ -1467,32 +1467,32 @@
is_linux(self):%0A
+
if self.
@@ -1492,17 +1492,16 @@
f self.p
-a
latform
|
e353bae122c6e55da022d73c42d7eee09a558b44 | clean code | bin/visual_dl.py | bin/visual_dl.py | """ entry point of visual_dl
"""
import json
import os
import sys
from optparse import OptionParser
from flask import Flask, redirect
from flask import send_from_directory
from visualdl.log import logger
app = Flask(__name__, static_url_path="")
def option_parser():
"""
:return:
"""
parser = Optio... | Python | 0.000008 | @@ -1027,25 +1027,8 @@
e):%0A
- print(%22aaa%22)%0A
|
3c72aa1266f1008552a3979ac057251bf2f93053 | Bump tensorflow in /training/xgboost/structured/base (#212) | training/xgboost/structured/base/setup.py | training/xgboost/structured/base/setup.py | #!/usr/bin/env python
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python | 0.000545 | @@ -1099,17 +1099,17 @@
w==1.15.
-2
+4
',%0A '
|
4b4736cc77ce429e8dbd562b7d68b5d00027a534 | Disable periodically failing Bok Choy test | common/test/acceptance/tests/test_studio_split_test.py | common/test/acceptance/tests/test_studio_split_test.py | """
Acceptance tests for Studio related to the split_test module.
"""
from ..fixtures.course import CourseFixture, XBlockFixtureDesc
from ..pages.studio.component_editor import ComponentEditorView
from test_studio_container import ContainerBase
from ..pages.studio.utils import add_advanced_component
from xmodule.part... | Python | 0 | @@ -64,16 +64,43 @@
e.%0A%22%22%22%0A%0A
+from unittest import skip%0A%0A
from ..f
@@ -5802,32 +5802,129 @@
pha', 'beta'%5D)%0A%0A
+ @skip(%22This fails periodically where it fails to trigger the add missing groups action.Dis%22)%0A
def test_mis
|
0ec3bfbd91e6e967bb2baae0307e76aafbb5aa91 | Simplify the base types | blackjax/base.py | blackjax/base.py | from typing import Callable, NamedTuple, Tuple
from typing_extensions import Protocol
from .types import PRNGKey, PyTree
Position = PyTree
State = NamedTuple
Info = NamedTuple
class InitFn(Protocol):
"""A `Callable` used to initialize the kernel state.
Sampling algorithms often need to carry over some inf... | Python | 0.002563 | @@ -15,18 +15,8 @@
port
- Callable,
Nam
@@ -3054,276 +3054,4 @@
nel%0A
-%0A%0Aclass SamplingAlgorithmGenerator(NamedTuple):%0A %22%22%22A pair of functions that implement a kenel generator.%0A%0A This is meant to be a quick fix until we can pass the values of parameters%0A directly to the step function.%0A... |
f1b22cfcca8470a59a7bab261bbd2a46a7c2a2ed | Fix unicode issues at url translation | socib_cms/cmsutils/utils.py | socib_cms/cmsutils/utils.py | # coding: utf-8
import re
from django.core.urlresolvers import reverse
from django.conf import settings
def reverse_no_i18n(viewname, *args, **kwargs):
result = reverse(viewname, *args, **kwargs)
m = re.match(r'(/[^/]*)(/.*$)', result)
return m.groups()[1]
def change_url_language(url, language):
if ... | Python | 0.00022 | @@ -507,32 +507,33 @@
return
+u
%22/%7Blang%7D%7Burl%7D%22.f
@@ -617,16 +617,17 @@
return
+u
%22/%7Blang%7D
|
24a0f128250b285b1f6a810c68bbea78c510fc62 | remove debug logging | DTBitmap2D.py | DTBitmap2D.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from PIL import Image
import numpy as np
class _DTBitmap2D(object):
"""docstring for DTBitmap2D"""
CHANNEL_NAMES = ("red", "green", "blue", "alpha", "gray")
def __init__(self):
super(_DTBitmap2D, self).__init__()
print "__init... | Python | 0.000002 | @@ -296,45 +296,8 @@
_()%0A
- print %22__init__%22, type(self)%0A
|
ed29f8c4bda7b8b4f9cf1f6281afcd14c7de0d2b | update it | lib/gtp/support/gtpv2c_tlv_gen.py | lib/gtp/support/gtpv2c_tlv_gen.py | #
# Copyright (c) 2017, CellWire Group
# All rights reserved.
#
# 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 above copyright notice, this
# list of conditions an... | Python | 0 | @@ -3249,43 +3249,352 @@
ows%5B
-1:
+2:-4
%5D:%0A
-msg_list%5Brow.cells%5B1%5D.text
+if len(row.cells%5B0%5D.text) == 0:%0A continue%0A if row.cells%5B0%5D.text.find('to') != -1:%0A continue%0A if row.cells%5B1%5D.text.find('Reserved') != -1:%0A continue%0A name = row.cells%5B1%5D.te... |
1ad5d9a10c1744032a4e3b19438869f79dfa1d9b | Remove obsolete &rtp test | test/test_vim.py | test/test_vim.py | # -*- coding: utf-8 -*-
import os, tempfile
from nose.tools import with_setup, eq_ as eq, ok_ as ok
from common import vim, cleanup
def source(code):
fd, fname = tempfile.mkstemp()
with os.fdopen(fd,'w') as f:
f.write(code)
vim.command('source '+fname)
os.unlink(fname)
@with_setup(setup=clean... | Python | 0.000001 | @@ -1462,589 +1462,8 @@
4)%0A%0A
-%0A@with_setup(setup=cleanup)%0Adef test_list_runtime_paths():%0A # Is this the default runtime path list?%0A homedir = os.path.join(os.environ%5B'HOME'%5D, '.nvim')%0A vimdir = vim.eval('$VIM')%0A dflt_rtp = %5B%0A homedir,%0A os.path.join(vimdir, 'vimfiles'... |
453bd97b7897da0f6fd6aea2517828962923d2f0 | Fix test for python 3. | test/test_who.py | test/test_who.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import nose
from nose.tools import *
import unittest
from whoswho import who, config, utils
from nameparser.config.titles import TITLES as NAMEPARSER_TITLES
from nameparser.config.suffixes import SUFFIXES as NAMEPARSER_SUFFIXES
class TestFullNames(uni... | Python | 0.000001 | @@ -110,16 +110,27 @@
unittest
+%0Aimport sys
%0A%0Afrom w
@@ -427,32 +427,71 @@
t_string(self):%0A
+ # Only relevant for python 2.X%0A
assert_t
@@ -507,32 +507,36 @@
atch(self.name,
+str(
'Robert Liebowit
@@ -541,23 +541,8 @@
itz'
-.encode('utf-8'
)))%0A
|
d15c2107f4132b53fb77622748753bb9f3c2916f | Update messenger.py | bot/messenger.py | bot/messenger.py | # -*- coding: utf-8 -*-
import logging
import random
import sys
reload(sys)
sys.setdefaultencoding('utf8')
logger = logging.getLogger(__name__)
class Messenger(object):
def __init__(self, slack_clients):
self.clients = slack_clients
def send_message(self, channel_id, msg):
# in the case... | Python | 0.000001 | @@ -1675,999 +1675,38 @@
=%5B%22T
-o infinity%E2%80%A6and beyond!%22,%22I have come here to chew bubblegum and kick ass, and Im all out of bubblegum.%22,%22Surely, you cant be serious %E2%80%93 I am serious, and dont call me Shirley.%22,%22I pity the fool%22,%22There can be only juan%22,%22THIS IS SPARTA!!!!%22,%22Shi... |
9e2948e7725da996399b7f80fe9c53e2c4a0c848 | Correct typo in docs. | django/applications/catmaid/control/project.py | django/applications/catmaid/control/project.py | import json
from collections import defaultdict
from django.contrib import auth
from django.db import connection
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from catmaid.models import *
from catmaid.control.authentication import *
from catmaid.control.common import *
from guar... | Python | 0.000001 | @@ -3031,17 +3031,17 @@
adminis
-e
+t
rable an
|
dd9843c97c9e15c2522034a6f5333f68714cd031 | copy with original content type | filer/storage.py | filer/storage.py | #-*- coding: utf-8 -*-
import urllib.request, urllib.parse, urllib.error
from django.core.files.storage import FileSystemStorage
from django.utils.encoding import smart_str
try:
from storages.backends.s3boto import S3BotoStorage
except ImportError:
from storages.backends.s3boto3 import S3Boto3Storage as S3Bot... | Python | 0 | @@ -1625,20 +1625,26 @@
d(self,
-path
+object_key
):%0A
@@ -1660,32 +1660,18 @@
l =
-self.bucket.Object(path)
+object_key
.Acl
@@ -2350,16 +2350,66 @@
ic read%0A
+ source_obj = self.bucket.Object(src_path)%0A
@@ -2433,23 +2433,25 @@
c_read(s
-rc_path
+ource_obj
):%0A
@@ -2508,16 +250... |
19b77442ee3cc80d8c7eaee6bde6c87d6a9e9277 | Test a fix for the wheel test | tests/integration/modules/saltutil.py | tests/integration/modules/saltutil.py | # -*- coding: utf-8 -*-
'''
Integration tests for the saltutil module.
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import Salt libs
import integration
class SaltUtilModuleTest(integration... | Python | 0 | @@ -128,16 +128,28 @@
e_import
+%0Aimport time
%0A%0A# Impo
@@ -403,16 +403,92 @@
'''%0A%0A
+ def setUp(self):%0A self.run_function('saltutil.refresh_pillar') %0A%0A
# Te
@@ -645,16 +645,16 @@
nction.%0A
-
@@ -649,32 +649,136 @@
on.%0A '''%0A
+ # Wait for the pillar refres... |
40d2de6f25a4081dac3d809c9d0b8d20478cf92c | Tidy test settings and introduce django-nose | wagtailmenus/tests/settings.py | wagtailmenus/tests/settings.py | import os
import hashlib
from django.conf.global_settings import * # NOQA
DEBUG = True
SITE_ID = 1
DATABASES = {
'default': {
'NAME': 'wagtailmenus.sqlite',
'TEST_NAME': 'wagtailmenus_test.sqlite',
'ENGINE': 'django.db.backends.sqlite3',
}
}
TIME_ZONE = 'Europe/London'
USE_TZ = True
... | Python | 0 | @@ -155,16 +155,21 @@
ailmenus
+_test
.sqlite'
@@ -201,32 +201,37 @@
agtailmenus_test
+_test
.sqlite',%0A
@@ -379,14 +379,8 @@
= (%0A
- %0A%0A
@@ -779,24 +779,43 @@
odeladmin',%0A
+ 'django_nose',%0A
'taggit'
@@ -1355,16 +1355,48 @@
.urls'%0A%0A
+WAGTAIL_SITE_NAME = 'Test site'%0A
LOGIN_U... |
b359d71a3c13720257167c57959a18b7a5ce9d07 | Fix Python package version checking | gravity/tilt/tilt_tests.py | gravity/tilt/tilt_tests.py | import os, subprocess, sys
import pkg_resources
from packaging import version
# This function is used ot check if an apt package is installed on Raspbian, Ubuntu, Debian, etc.
def apt_package_installed(package_name: str) -> bool:
devnull = open(os.devnull,"w")
retval = subprocess.call(["dpkg", "-s", package_n... | Python | 0.000026 | @@ -1575,11 +1575,11 @@
': '
-PyO
+pyo
bjc'
@@ -2477,16 +2477,23 @@
ersion'%5D
+.public
== resu
@@ -2519,16 +2519,23 @@
ersion'%5D
+.public
:%0A
|
4338b097f97bb03be27c81a810a5fc652f842c8a | change cnab processor selection to method" | l10n_br_account_payment_brcobranca/models/account_payment_mode.py | l10n_br_account_payment_brcobranca/models/account_payment_mode.py | # Copyright (C) 2012-Today - KMEE (<http://kmee.com.br>).
# @author Luis Felipe Miléo - mileo@kmee.com.br
# @author Renato Lima - renato.lima@akretion.com.br
# Copyright (C) 2021-Today - Akretion (<http://www.akretion.com>).
# @author Magno Costa <magno.costa@akretion.com.br>
# License AGPL-3.0 or later (http://www.g... | Python | 0 | @@ -354,22 +354,19 @@
import
-fields
+api
, models
@@ -506,42 +506,115 @@
-cnab_processor = fields.Selection(
+@api.model%0A def _selection_cnab_processor(self):%0A selection = super()._selection_cnab_processor()
%0A
@@ -631,14 +631,16 @@
tion
-_add=%5B
+.append(
(%22br
@@ -667,13 +667,31 @@
... |
3542dccc5e6a9718716695bd041ad302f2576a4d | Use uuid() to generate unique XQueue submission IDs during import of submissions | controller/management/commands/import_graded_essays.py | controller/management/commands/import_graded_essays.py | from django.core.management.base import BaseCommand
from django.conf import settings
from django.utils import timezone
#from http://jamesmckay.net/2009/03/django-custom-managepy-commands-not-committing-transactions/
#Fix issue where db data in manage.py commands is not refreshed at all once they start running
from dja... | Python | 0 | @@ -458,16 +458,39 @@
ort sys%0A
+from uuid import uuid4%0A
from Con
@@ -556,25 +556,8 @@
time
-%0Aimport test_util
%0A%0Afr
@@ -3574,42 +3574,19 @@
_id=
-test_util.generate_new_xqueue_
+uu
id
+4
()
+.hex
,%0A
|
0bbd10058ff58ca5160e74374c0b34f99c429ad8 | Update docstrings | openpathsampling/high_level/part_in_b_tps.py | openpathsampling/high_level/part_in_b_tps.py | from openpathsampling.high_level.network import FixedLengthTPSNetwork
from openpathsampling.high_level.transition import FixedLengthTPSTransition
import openpathsampling as paths
class PartInBFixedLengthTPSTransition(FixedLengthTPSTransition):
"""Fixed length TPS transition accepting any frame in the final state.
... | Python | 0.000001 | @@ -322,40 +322,112 @@
-Implements the ensemble in
+Transition that builds an ensemble used to facilitate the rate%0A calculation in fixed-length TPS.
%5B1%5D_
-.
Det
@@ -433,16 +433,20 @@
tails in
+%0A
:class:
@@ -450,24 +450,38 @@
ss:%60.PartInB
+FixedLengthTPS
Network%60.%0A%0A
@@ -501,24 +501,... |
73a9c5f02482abe376ce518f6fcf5e42f322952c | Disable open file verification for INSERT cancel tests due to IMPALA-551 | tests/query_test/test_cancellation.py | tests/query_test/test_cancellation.py | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Tests query cancellation using the ImpalaService.Cancel API
#
import pytest
import threading
from time import sleep
from tests.beeswax.impala_beeswax import ImpalaBeeswaxException
from tests.common.test_vector import TestDimension
from tes... | Python | 0 | @@ -5693,16 +5693,27 @@
ervice)%0A
+ try:%0A
metr
@@ -5757,8 +5757,97 @@
out=
-1
+3
0)%0A
+ except AssertionError:%0A pytest.xfail(%22IMPALA-551: File handle leak for INSERT%22)%0A
|
39c32fa537f9f8f511efde608fe6c8e0a4311296 | test working? | test_render_1.py | test_render_1.py | import sys
sys.path.append('../landsat-util/landsat')
import pytest
import render_1
import models
from sqlalchemy import create_engine, orm
from datetime import datetime
import mock
import unittest
import os
import factory
import factory.alchemy
Session = orm.scoped_session(orm.sessionmaker())
class JobFactory(facto... | Python | 0.000001 | @@ -2367,17 +2367,16 @@
tests%0A%0A
-#
@pytest.
@@ -2406,17 +2406,16 @@
ction%22)%0A
-#
@pytest.
@@ -2817,24 +2817,25 @@
ession%0A%0A
+#
@mock.patch(
@@ -2839,37 +2839,55 @@
ch('
-landsat.downloader.Downloader
+recombinators_landsat.landsat_worker.render_1.b
')%0A
@@ -2930,36 +2930,24 @@
_values(self
-, ... |
03fe3aad7358ee4593b9e8909d5374bae9e58b34 | revert changes | denumerator/denumerator.py | denumerator/denumerator.py | #!/usr/bin/python
# pylint: disable=invalid-name
"""
--- dENUMerator ---
by bl4de | bloorq@gmail.com | Twitter: @_bl4de | HackerOne: bl4de
Enumerates list of subdomains (output from tools like Sublist3r or subbrute)
and creates output file with servers responding on port 80/HTTP
This indicates (in most caes) working... | Python | 0 | @@ -12,17 +12,16 @@
python%0A#
-
pylint:
@@ -598,229 +598,8 @@
0%5D%0A%0A
-http_ports_short_list = %5B80, 443, 8000, 8008, 8080, 9080%5D%0A%0Ahttp_ports_long_list = %5B80, 443, 591, 981, 1311, 4444,%0A 4445, 7001, 7002, 8000, 8008, 8080, 8088, 8222, 8530, 8531, 8887, 8888, 9080, 16080, 18091%5D%0A%0A
... |
5c0a19386894e36898a48e7f10f01008e284e0c9 | Update dependency bazelbuild/bazel to latest version | third_party/bazel.bzl | third_party/bazel.bzl | # Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | Python | 0.000066 | @@ -655,128 +655,128 @@
= %22
-03719362d021a241ef9af04f33db6efcfd18590a%22%0Abazel_sha256 = %22eff6cd1c44a7c3ec63163b415383a4fb7db6c99dfcda1288a586df9671346512
+f259b8abfd575f544635f57f3bb6678d566ef309%22%0Abazel_sha256 = %227e262ca5f5595a74d75953dfdcb75b271c2561a292972da7f3be449a3e8b28f6
%22%0A
|
05a2189224589ac84b14240bf96b110d7c531dfb | add missing parent class inherit | vimball/base.py | vimball/base.py | import bz2
import errno
import gzip
import lzma
import os
import re
import tempfile
def mkdir_p(path):
"""Create potentially nested directories as required.
Does nothing if the path already exists and is a directory.
"""
try:
os.makedirs(path)
except OSError as e:
if e.errno == er... | Python | 0.000029 | @@ -1023,16 +1023,24 @@
Vimball
+(object)
:%0A %22%22
|
24f5afff6b8e65c633521189f4ac6bf4fbacbdb7 | Fix datapusher.wsgi to work with ckan-service-provider 0.0.2 | deployment/datapusher.wsgi | deployment/datapusher.wsgi | import os
import sys
import hashlib
activate_this = os.path.join('/usr/lib/ckan/datapusher/bin/activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
import ckanserviceprovider.web as web
import datapusher.jobs as jobs
os.environ['JOB_CONFIG'] = '/etc/ckan/datapusher_settings.py'
web.configure()
ap... | Python | 0.000002 | @@ -303,17 +303,12 @@
web.
-configure
+init
()%0Aa
|
efb420ddc6aa0052ecea6da84613da6e4cf1afc8 | Update Bazel to latest version | third_party/bazel.bzl | third_party/bazel.bzl | # Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | Python | 0 | @@ -591,128 +591,128 @@
= %22
-6fe70c2fef70b8a3da3aa3cbea26c6bf60f17e13%22%0Abazel_sha256 = %22ad525027ecc7056feb23fe96cfe8b28257a6c47a9d908e0bc4e0e0988bf61d28
+b017468d07da1e45282b9d153a4308fdace11eeb%22%0Abazel_sha256 = %22ce8dc5936238b6b7e27cdcdc13d481c94f20526fabfe20cbbceff17da83503e7
%22%0A
|
0bfa8373f82f801b34e7609f4ff6f28ab280a635 | Change mnist.py to follow the latest spec | example/mnist/mnist.py | example/mnist/mnist.py | #!/usr/bin/env python
"""Chainer example: train a multi-layer perceptron on MNIST
This is a minimal example to write a feed-forward net. It requires scikit-learn
to load MNIST dataset.
"""
import numpy as np
import six
import chainer
from chainer import cuda, FunctionSet
import chainer.functions as F
from chainer i... | Python | 0 | @@ -387,21 +387,30 @@
create(
-param
+*args, **kwarg
s):%0A
@@ -456,29 +456,29 @@
le_path' in
-param
+kwarg
s:%0A
@@ -490,21 +490,21 @@
th open(
-param
+kwarg
s%5B'model
@@ -831,21 +831,21 @@
gpu' in
-param
+kwarg
s:%0A
@@ -862,21 +862,21 @@
f.gpu =
-param
+kwarg
s%5B'gpu'%5D
@@ -1012,37... |
8959d982ddc810f9c226ce36884521cf979a61f1 | add destroy cb | gui/tests/testicontheme.py | gui/tests/testicontheme.py | #!/usr/bin/env python
# doesnt work. segfault.
# TODO: other screens?
import pygtk
pygtk.require("2.0")
import gtk
import xfce4
widget = xfce4.gui.IconTheme(gtk.gdk.screen_get_default())
ic = widget.load("folder", 24)
print ic
icname = widget.lookup("folder", 24)
print icname
image = gtk.Image()
image.set_from_pixbuf... | Python | 0 | @@ -348,16 +348,64 @@
indow()%0A
+w.connect(%22destroy%22, lambda x: gtk.main_quit())%0A
w.add(im
|
bf9ca12295aa62cb3e0f1885b99d7c228072b0c7 | fix 'has attrs, but not com.apple.FinderInfo' bug... | finder_colors.py | finder_colors.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" finder_colors.py - Setting colours of files/folders from the commandline.
Copyright (c) 2013 Daniel Fairhead <danthedeckie on github>
--------
Contributors:
- Panayotis Vryonis <vrypan on github>
Permission is hereby granted, free of charge, to any person obtaining a... | Python | 0 | @@ -1712,17 +1712,17 @@
= '0.9.
-2
+3
'%0A%0A_FIND
@@ -2458,16 +2458,68 @@
aise err
+%0A except KeyError as err:%0A return NAMES%5B0%5D
%0A%0Adef se
|
23c8044b84557dea940d527213022bfa19d28293 | test that Human is in Ensembl species | tests/test_ensembl_species_service.py | tests/test_ensembl_species_service.py | #
# Author : Manuel Bernal Llinares
# Project : trackhub-creator
# Timestamp : 04-07-2017 09:14
# ---
# © 2017 Manuel Bernal Llinares <mbdebian@gmail.com>
# All rights reserved.
#
"""
Unit Tests for Ensembl Species Service
"""
import unittest
# App modules
import ensembl.service
class TestEnsemblSpeciesServi... | Python | 0.999977 | @@ -367,17 +367,15 @@
N =
+'
9606
+'
%0A
-
%0A
@@ -1182,26 +1182,223 @@
-#TODO%0A pass
+self.assertIsNotNone(%0A self.ensembl_service.get_species_data_service().get_species_entry_for_taxonomy_id(%0A self.__NCB_TAXONOMY_HUMAN), %22Human NCBI taxonomy is in species data ... |
d977a9ee9814264bd1d3080cadcd7e43b7c1d27e | Revert changes | examples/News/news2.py | examples/News/news2.py | #!/usr/bin/env python
from Kiwi2 import Delegates
from Kiwi2.Widgets.List import List, Column
from Kiwi2.initgtk import gtk
class NewsItem:
"""An instance that holds information about a news article."""
def __init__(self, title, author, url):
self.title, self.author, self.url = title, author, url
# As... | Python | 0.000001 | @@ -1267,35 +1267,8 @@
hor%22
-, justify=gtk.JUSTIFY_RIGHT
), %0A
@@ -1365,60 +1365,49 @@
ws)%0A
-w = gtk.Window()%0Aw.set_size_request(600, 250)%0Aw.add(
+slave = Delegates.SlaveDelegate(toplevel=
kiwi
@@ -1412,17 +1412,21 @@
wilist)%0A
-w
+slave
.show_al
|
7c91d556220088ea5286611f3674aaa88f3a6340 | Add failing test for "Crash if session was flushed before commit (with validity strategy)" | tests/test_exotic_operation_combos.py | tests/test_exotic_operation_combos.py | from six import PY3
from tests import TestCase
class TestExoticOperationCombos(TestCase):
def test_insert_deleted_object(self):
article = self.Article()
article.name = u'Some article'
article.content = u'Some content'
self.session.add(article)
self.session.commit()
... | Python | 0 | @@ -2242,28 +2242,147 @@
ions%5B1%5D.operation_type == 1%0A
+%0A%0Aclass TestExoticOperationCombosWithValidityStrategy(TestExoticOperationCombos):%0A versioning_strategy = 'validity'%0A
|
e816b1f63c299141c6ad907c860d2c5411829405 | Simplify aggregator code | aleph/analysis/aggregate.py | aleph/analysis/aggregate.py | import logging
from Levenshtein import setmedian
from aleph.analysis.util import tag_key
from aleph.analysis.util import TAG_COUNTRY, TAG_LANGUAGE, TAG_PHONE
from aleph.analysis.util import TAG_PERSON, TAG_COMPANY
log = logging.getLogger(__name__)
class TagAggregator(object):
MAX_TAGS = 10000
CUTOFFS = {
... | Python | 0.000073 | @@ -17,36 +17,80 @@
rom
-Levenshtein import setmedian
+collections import defaultdict%0Afrom followthemoney.types import registry
%0A%0Afr
@@ -175,22 +175,8 @@
TRY,
- TAG_LANGUAGE,
TAG
@@ -239,17 +239,16 @@
OMPANY%0A%0A
-%0A
log = lo
@@ -365,34 +365,8 @@
TRY:
- .2,%0A TAG_LANGUAGE:
.3,
@@ -491,17 +491... |
30f55607990a356f49c03f04a707aa7d59a8eedf | Remove unncessary extra parens | examples/chatserver.py | examples/chatserver.py | #!/usr/bin/env python
"""Chat Server Example
This example demonstrates how to create a very simple telnet-style chat
server that supports many connecting clients.
"""
from optparse import OptionParser
from circuits import Component, Debugger
from circuits.net.sockets import TCPServer, Write
__version__ = "0.0.1"
... | Python | 0.000004 | @@ -3284,17 +3284,16 @@
em.%0A
-(
ChatServ
@@ -3306,17 +3306,16 @@
s, opts)
-)
.run()%0A%0A
|
0f2336bf9b190009a83c077671fa65f5e6c53f8b | Add error handling | server/python/server.py | server/python/server.py | import os
import json
from get_discovery_collections import get_constants
from flask import Flask, jsonify, render_template, request
from flask_cors import CORS
from dotenv import load_dotenv, find_dotenv
import watson_developer_cloud.natural_language_understanding.features.v1 as features # noqa
from watson_developer_... | Python | 0.000002 | @@ -154,16 +154,58 @@
rt CORS%0A
+from requests.exceptions import HTTPError%0A
from dot
@@ -4104,16 +4104,262 @@
)%0A%0A%0A
+@app.errorhandler(Exception)%0Adef handle_error(e):%0A code = 500%0A error = 'Error processing the request'%0A if isinstance(e, HTTPError):%0A code = e.code%0A error... |
8c6ebf17541e48e6d4fdd9d521a4391ce621f301 | Use getNextSchedule in ScheduleDao | broadcast_api.py | broadcast_api.py | from mysql import mysql
from mysql import DB_Exception
from datetime import date
from datetime import datetime
from datetime import timedelta
import os.path
import json
#The API load schedule.txt and find out the first image which has not print and the time limit still allow
def load_schedule():
try:
ret... | Python | 0 | @@ -553,16 +553,21 @@
#find
+next
schedule
@@ -579,467 +579,406 @@
-sql = (%22SELECT sche_id, sche_target_id, sche_display_time FROM schedule WHERE sche_is_used=0 ORDER BY sche_sn ASC LIMIT 1%22)%0A pure_result = db.query(sql)%0A try:%0A return_msg%5B%22schedule_id%22%5D = pure_resu... |
ba127d99871cde38d08c12091fda03381942f461 | remove petsc vec for now | tests/test_solve/test_slepc_solver.py | tests/test_solve/test_slepc_solver.py | # TODO: TEST NON_HERMITIAN
# TODO: TEST multiprocessing throws no error with petsc
from pytest import fixture, mark
import numpy as np
import scipy.sparse as sp
from numpy.testing import assert_allclose
from quimb import (
qu,
rand_uni,
ldmul,
rand_matrix,
rand_herm,
seigsys,
overlap,
... | Python | 0 | @@ -1567,24 +1567,26 @@
() == 2%0A%0A
+ #
def test_ve
@@ -1589,32 +1589,34 @@
t_vec(self):%0A
+ #
a = np.arra
@@ -1630,24 +1630,26 @@
, 3, 4%5D)%0A
+ #
b = con
@@ -1660,32 +1660,34 @@
_to_petsc(a)%0A
+ #
assert_allc
|
ca06a55d096eb4c67bf70c479107128b73087ab9 | integrate update | w1_integrate.py | w1_integrate.py | from sympy import integrate, symbols, log
# if 0 <= x < 0.25:
# return float(0)
# elif 0.25 <= x < 0.5:
# return 16.0 * (x - 0.25)
# elif 0.5 <= x < 0.75:
# return -16.0 * (x - 0.75)
# elif 0.75 < x <= 1:
# return float(0)
# h(f) = integrate(-f(x)lnf(x), (x, 0, 1))
x = symbols('x')
left = integrate(-1... | Python | 0 | @@ -34,17 +34,19 @@
ols, log
-%0A
+%0D%0A%0D
%0A# if 0
@@ -57,16 +57,17 @@
%3C 0.25:
+%0D
%0A# r
@@ -80,16 +80,17 @@
float(0)
+%0D
%0A# elif
@@ -105,16 +105,17 @@
x %3C 0.5:
+%0D
%0A# r
@@ -137,16 +137,17 @@
- 0.25)
+%0D
%0A# elif
@@ -162,16 +162,17 @@
%3C 0.75:
+%0D
%0A# r
@@ -195,16 +195... |
c3b9d629710bd5b106e33c921a0aa23dd435ce56 | Exclude package-index on non-deploy | lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py | lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py | '''
Created on Jan 6, 2013
__author__ = "Elizabeth 'pidge' Flanagan"
__copyright__ = "Copyright 2012-2013, Intel Corp."
__credits__ = ["Elizabeth Flanagan"]
__license__ = "GPL"
__version__ = "2.0"
__maintainer__ = "Elizabeth Flanagan"
__email__ = "elizabeth.flanagan@intel.com"
'''
from buildbot.steps.shell import Sh... | Python | 0 | @@ -1338,24 +1338,166 @@
nowExists%22)%0A
+ try:%0A self.deploycheck = self.getProperty('custom_deploy_artifacts')%0A except:%0A self.deploycheck = %22True%22%0A
if s
@@ -1793,16 +1793,255 @@
images)%5D
+%0A elif self.images == %22package-index%22 and str(self.deplo... |
f2bcbddab48eff06df78faff1ebb47c28adb4e0d | fix schema test | altair/tests/test_schema.py | altair/tests/test_schema.py | from altair.schema import SCHEMA
def test_schema():
assert SCHEMA["$schema"]=="http://json-schema.org/draft-04/schema#"
| Python | 0.000001 | @@ -19,22 +19,27 @@
import
-SCHEMA
+load_schema
%0A%0Adef te
@@ -51,16 +51,43 @@
hema():%0A
+ schema = load_schema()%0A
asse
@@ -93,14 +93,14 @@
ert
-SCHEMA
+schema
%5B%22$s
|
48f4c8dba40cb2fe03a74a7a4d7d979892601ddc | use __file__ to determine library path | tests/context.py | tests/context.py | # -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
import sample | Python | 0.000002 | @@ -78,14 +78,55 @@
ath(
+os.path.join(os.path.dirname(__file__),
'..'))
+)
%0A%0Aim
@@ -136,8 +136,9 @@
t sample
+%0A
|
24b2dd2f84a2a9ece9a9a4f7898c6f29233c19bc | Add message to welcome accepted students. | app/soc/modules/gsoc/models/program.py | app/soc/modules/gsoc/models/program.py | # Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | Python | 0 | @@ -1033,24 +1033,319 @@
Message'))%0A%0A
+ #: Message sent to welcome accepted students to the program. This does%0A #: not include any personalized text from the organization they got%0A #: accepted for.%0A accepted_students_welcome_msg = db.TextProperty(required=False,%0A verbose_name=ugettext('Accepted St... |
3c3013b8e7de5e1f8ae57e1d4a8b672cab8f6c47 | Test helpers : Message box, click yes vs enter | tests/helpers.py | tests/helpers.py | from PyQt5.QtWidgets import QApplication, QMessageBox, QDialog, QFileDialog
from PyQt5.QtCore import Qt
from PyQt5.QtTest import QTest
def click_on_top_message_box():
topWidgets = QApplication.topLevelWidgets()
for w in topWidgets:
if isinstance(w, QMessageBox):
QTest.keyClick(w, Qt.Key_En... | Python | 0 | @@ -296,32 +296,59 @@
est.
-key
+mouse
Click(w
-, Qt.Key_Enter
+.button(QMessageBox.Yes), Qt.LeftButton
)%0A
|
9fb370d9cd24e2ebe5ec97b01b2d0b78f71d6e2d | Add legacy urls for org homepage | app/soc/modules/gsoc/views/org_home.py | app/soc/modules/gsoc/views/org_home.py | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | Python | 0.000001 | @@ -5271,24 +5271,141 @@
_org_home')%0A
+ url(r'%5Egsoc/org/show/%25s$' %25 url_patterns.ORG, self),%0A url(r'%5Eorg/show/%25s$' %25 url_patterns.ORG, self),%0A
%5D%0A%0A def
|
1ab939ed7da45e7f6ff113b7e71017b28ee877a2 | Use 'with' keyword while opening file in tests/helpers.py | tests/helpers.py | tests/helpers.py | import razorpay
import os
import unittest
def mock_file(filename):
if not filename:
return ''
file_dir = os.path.dirname(__file__)
file_path = "{}/mocks/{}.json".format(file_dir, filename)
return open(file_path).read()
class ClientTestCase(unittest.TestCase):
def setUp(self):
sel... | Python | 0.000002 | @@ -208,22 +208,20 @@
me)%0A
-return
+with
open(fi
@@ -232,15 +232,74 @@
ath)
-.read()
+ as f:%0A mock_file_data = f.read()%0A return mock_file_data
%0A%0A%0Ac
|
9f069cf4fe634f34ccda29c18c03c63db04fe199 | Update Funcaptcha example | examples/funcaptcha.py | examples/funcaptcha.py | import requests
from os import environ
import re
from random import choice
from python_anticaptcha import AnticaptchaClient, FunCaptchaTask, Proxy
api_key = environ['KEY']
site_key_pattern = 'data-pkey="(.+?)"'
url = 'https://www.funcaptcha.com/demo/'
client = AnticaptchaClient(api_key)
session = requests.Session()
... | Python | 0 | @@ -1,16 +1,51 @@
+from urllib.parse import urlparse%0A%0A
import requests%0A
@@ -172,15 +172,8 @@
Task
-, Proxy
%0A%0Aap
@@ -559,24 +559,277 @@
plit(',')%0A%0A%0A
+def parse_url(url):%0A parsed = urlparse(url)%0A return dict(%0A proxy_type=parsed.scheme,%0A proxy_address=parsed.hostname,%0A ... |
d3583108eca98f72b9b4898a5cc5e9cf1cacf251 | Fix log_invocation test on python2 with hash randomization | test/units/module_utils/basic/test__log_invocation.py | test/units/module_utils/basic/test__log_invocation.py | # -*- coding: utf-8 -*-
# (c) 2016, James Cammarata <jimi@sngx.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | Python | 0.000002 | @@ -820,16 +820,27 @@
= type%0A%0A
+import sys%0A
import j
@@ -843,16 +843,16 @@
rt json%0A
-
%0Afrom an
@@ -982,17 +982,16 @@
tCase):%0A
-%0A
@uni
@@ -1004,52 +1004,80 @@
skip
-(%22Skipping due to unknown reason. See #15105
+If(sys.version_info%5B0%5D %3E= 3, %22Python 3 is not supported on targets (yet)
%... |
d2fb1f22be6c6434873f2bcafb6b8a9b714acde9 | Use fail signal in fail_archive_on_error decorator | website/archiver/decorators.py | website/archiver/decorators.py | import functools
from framework.exceptions import HTTPError
from website.project.decorators import _inject_nodes
from website.archiver import ARCHIVER_UNCAUGHT_ERROR
from website.archiver import utils
def fail_archive_on_error(func):
@functools.wraps(func)
def wrapped(*args, **kwargs):
try:
... | Python | 0.000001 | @@ -190,19 +190,21 @@
import
-uti
+signa
ls%0A%0Adef
@@ -471,21 +471,21 @@
-utils.handle_
+signals.send.
arch
@@ -514,153 +514,61 @@
-ARCHIVER_UNCAUGHT_ERROR,%0A registration.registered_from,%0A registration,%0A registration.registered_user
+registration,%0... |
3caa77b0f4b43e274eba21a8d759335f7833b99d | Change OSF_COOKIE_DOMAIN to None in local-dist.py | website/settings/local-dist.py | website/settings/local-dist.py | # -*- coding: utf-8 -*-
'''Example settings/local.py file.
These settings override what's in website/settings/defaults.py
NOTE: local.py will not be added to source control.
'''
from . import defaults
DEV_MODE = True
DEBUG_MODE = True # Sets app to debug mode, turns off template caching, etc.
SEARCH_ENGINE = 'elas... | Python | 0 | @@ -822,20 +822,12 @@
N =
-'.localhost'
+None
%0ACOO
|
22ae3a2e9a236de61c078d234d920a3e6bc62d7b | Add a bit of docs | pylisp/application/lispd/address_tree/ddt_container_node.py | pylisp/application/lispd/address_tree/ddt_container_node.py | '''
Created on 1 jun. 2013
@author: sander
'''
from .container_node import ContainerNode
class DDTContainerNode(ContainerNode):
pass
| Python | 0.000004 | @@ -132,9 +132,110 @@
-pass
+'''%0A A ContainerNode that indicates that we are responsible for this part of%0A the DDT tree.%0A '''
%0A
|
1d5285f08bc824ef1a83c2491c75b63df8c63da7 | allow qualification documents upload only in pending | openprocurement/tender/openeu/views/qualification_document.py | openprocurement/tender/openeu/views/qualification_document.py | # -*- coding: utf-8 -*-
from logging import getLogger
from openprocurement.api.utils import (
get_file,
save_tender,
upload_file,
apply_patch,
update_file_content_type,
json_view,
context_unpack,
)
from openprocurement.api.validation import (
validate_file_update,
validate_file_uploa... | Python | 0 | @@ -2109,32 +2109,27 @@
tion.status
-not in %5B
+!=
'pending', '
@@ -2121,35 +2121,24 @@
!= 'pending'
-, 'active'%5D
:%0A
@@ -4123,32 +4123,27 @@
tion.status
-not in %5B
+!=
'pending', '
@@ -4135,35 +4135,24 @@
!= 'pending'
-, 'active'%5D
:%0A
@@ -5385,16 +5385,11 @@
tus
-not in %5B
+!... |
17565e1725e3d5dff6313308cbc24bfcf55bf2f3 | Load frequency from parameter server | thruster_interface/scripts/thruster_interface_node.py | thruster_interface/scripts/thruster_interface_node.py | #!/usr/bin/env python
import math
import Adafruit_PCA9685
import numpy
import rospy
from vortex_msgs.msg import Float64ArrayStamped, Pwm
from thruster_interface.srv import ThrustersEnable, ThrustersEnableResponse
# Constants
PWM_BITS_PER_PERIOD = 4096.0 # 12 bit PWM
FREQUENCY = rospy.get_param('/pwm/frequency/set')... | Python | 0 | @@ -32,32 +32,8 @@
ath%0A
-import Adafruit_PCA9685%0A
impo
|
8acaec546de0311f5f33c2e8fb9e1828a1cbc44b | Fix memory leak caused by using rabbit as the result backend for celery | worker_manager/celeryconfig.py | worker_manager/celeryconfig.py | """
Configuration file for celerybeat/worker.
Dynamically adds consumers from all manifest files in worker_manager/manifests/
to the celerybeat schedule. Also adds a heartbeat function to the schedule,
which adds every 30 seconds, and a monthly task to normalize all non-normalized
documents.
"""
f... | Python | 0.000004 | @@ -441,16 +441,18 @@
alhost'%0A
+#
CELERY_R
@@ -1481,19 +1481,25 @@
%0ASCHED%5B'
-add
+heartbeat
'%5D = %7B%0A
|
cebba3af4f49173a6cf04d1c0824838772cbbf19 | Refactor code | batchflow/models/tf/nn/train.py | batchflow/models/tf/nn/train.py | """ Helpers for training """
from math import pi
import tensorflow as tf
from tensorflow.python.framework import ops # pylint: disable=no-name-in-module
from tensorflow.math import sin, asin, floor # pylint: disable=import-error
def piecewise_constant(global_step, *args, **kwargs):
""" Constant learning rate dec... | Python | 0.000002 | @@ -71,88 +71,8 @@
tf%0A
-from tensorflow.python.framework import ops # pylint: disable=no-name-in-module%0A
from
@@ -2807,19 +2807,18 @@
with
-ops
+tf
.name_sc
@@ -2922,30 +2922,8 @@
at32
-, name=%22learning_rate%22
)%0A
|
8cb46b963a20e65a64086a1c3e105dc858f22fb3 | Adds a blacklist of SKPs to exclude from bench expectations. | bench/gen_bench_expectations.py | bench/gen_bench_expectations.py | #!/usr/bin/env python
# Copyright (c) 2014 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.
""" Generate bench_expectations file from a given set of bench data files. """
import argparse
import bench_util
import os
import ... | Python | 0.998256 | @@ -978,16 +978,125 @@
%5D%0A%0A
+# List of flaky SKPs that should be excluded.%0ASKPS_TO_EXCLUDE = %5B'desk_chalkboard.skp',%0A %5D%0A%0A
%0Adef com
@@ -2108,16 +2108,58 @@
_INCLUDE
+ or%0A point.bench in SKPS_TO_EXCLUDE
):%0A
|
16806f7a620ddaba727fc6c7d6387eaa1c17f103 | Update p4-test-tool.py | benchexec/tools/p4-test-tool.py | benchexec/tools/p4-test-tool.py | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
import benchexec.util as util
import benchexec.tools.template
import benchexec.result as r... | Python | 0.000001 | @@ -807,20 +807,8 @@
S_FALSE%0A
-
|
b9d30a39f31862af607af44e97878a287f9361c5 | bump to v0.5.3 | steam/__init__.py | steam/__init__.py | __version__ = "0.5.2"
__author__ = "Rossen Georgiev"
from steam.steamid import SteamID
from steam.webapi import WebAPI
| Python | 0.000001 | @@ -16,9 +16,9 @@
0.5.
-2
+3
%22%0A__
|
026ba5fa78cb9916bffc23cf7dda1d1deb81b24c | Bump version 1.0.3 | story/__init__.py | story/__init__.py | """
Story - PySchool
"""
__author__ = 'PySchool'
__version__ = '1.0.2'
__licence__ = 'MIT'
| Python | 0 | @@ -66,9 +66,9 @@
1.0.
-2
+3
'%0A__
|
8d0e3ae1f80e8b19292b18a20a338cbfd00364c7 | Bump to version number 1.6.0 | stream/release.py | stream/release.py | # coding=utf-8
"""
stream.release
~~~~~~~~~~~~~~
Include release information of the package.
:copyright: (c) 2016 by Ali Ghaffaari.
:license: MIT, see LICENSE for more details.
"""
# CONSTANTS ###################################################################
# Development statuses:
DS_PLANNING... | Python | 0.000001 | @@ -1110,11 +1110,11 @@
'1.
-5.2
+6.0
'%0A__
@@ -1127,20 +1127,22 @@
__ = DS_
-BETA
+STABLE
%0A%0A# PyPI
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.