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
9381657d8ad2e96c2537c89fad7a4b3d8d8ddff5
Add gpu parameter to htcondor_at_vispa example.
examples/htcondor_at_vispa/analysis/framework.py
examples/htcondor_at_vispa/analysis/framework.py
# -*- coding: utf-8 -*- """ Law example tasks to demonstrate HTCondor workflows at VISPA. In this file, some really basic tasks are defined that can be inherited by other tasks to receive the same features. This is usually called "framework" and only needs to be defined once per user / group / etc. """ import os i...
Python
0
@@ -1502,24 +1502,205 @@ d.%0A %22%22%22%0A%0A + htcondor_gpus = luigi.IntParameter(default=law.NO_INT, significant=False, desription=%22number %22%0A %22of GPUs to request on the VISPA cluster, leave empty to use only CPUs%22)%0A%0A def htco @@ -2667,16 +2667,194 @@ _PATH%22)%0A + # tell the...
a5de78328cc2e63c901c409fb6c7b376abf921e2
reorganize code the object oriented way
src/scopus.py
src/scopus.py
import requests class ScopusClient(object): _AUTHOR_API = 'http://api.elsevier.com/content/search/author' _SCOPUS_API = 'http://api.elsevier.com/content/search/scopus' _HEADERS = {'Accept': 'application/json'} def __init__(self, apiKey): self.apiKey = apiKey def _api(self, endpoint, quer...
Python
0.000153
@@ -1,19 +1,944 @@ -import requests +from itertools import chain%0Aimport requests%0A%0A_HEADERS = %7B'Accept': 'application/json'%7D%0A%0Aclass ScopusResponse(object):%0A%0A def __init__(self, data):%0A self._data = data%0A%0A def __getitem__(self, key):%0A return self._data%5B'search-results'%5D%5...
28601b95720474a4f8701d6cb784ac6ec3618d49
add support for wheel DL proxy (#14010)
tools/download-wheels.py
tools/download-wheels.py
#!/usr/bin/env python """ Download SciPy wheels from Anaconda staging area. """ import sys import os import re import shutil import argparse import urllib3 from bs4 import BeautifulSoup __version__ = '0.1' # Edit these for other projects. STAGING_URL = 'https://anaconda.org/multibuild-wheels-staging/scipy' PREFIX =...
Python
0
@@ -134,16 +134,30 @@ argparse +%0Aimport urllib %0A%0Aimport @@ -337,16 +337,445 @@ scipy'%0A%0A +def http_manager():%0A %22%22%22%0A Return a urllib3 http request manager, leveraging%0A proxy settings when available.%0A %22%22%22%0A proxy_dict = urllib.request.getproxies()%0A if 'http' in proxy_d...
c43bd7f829ce79577421374ba6c00b74adca05aa
add test for using glob matching in a directory tree in file iterator
src/test/file_iterator_tests.py
src/test/file_iterator_tests.py
import nose from nose.tools import * from unittest import TestCase import os from shutil import rmtree from tempfile import mkdtemp from file_iterator import FileIterator class FileIteratorTests(TestCase): def setUp(self): self.directory = mkdtemp('-gb-file-iterator-tests') self.file_iterator = F...
Python
0
@@ -1669,16 +1669,691 @@ %5D), s)%0A%0A + def test_match_files_in_directory_tree_by_glob(self):%0A self.file_iterator.set_glob(%22*.java%22)%0A self._create_file(self.directory, 'file0.java')%0A dir1 = self._create_dir(self.directory, 'dir1')%0A self._create_file(dir1, 'file1.c')%0A ...
f9be60fcbdd401e7b45917ba2d801ee255fdef68
Change to bare NotImplementedError.
cloud_browser/cloud/base.py
cloud_browser/cloud/base.py
"""Cloud API base abstraction.""" import mimetypes from cloud_browser.cloud import errors from cloud_browser.app_settings import settings from cloud_browser.common import SEP, path_join, basename DEFAULT_GET_OBJS_LIMIT = 20 class CloudObjectTypes(object): """Cloud object types helper.""" FILE = 'file' ...
Python
0
@@ -1577,36 +1577,17 @@ tedError -(%22Must implement.%22) %0A + %0A @pr @@ -2940,35 +2940,16 @@ tedError -(%22Must implement.%22) %0A%0A%0Aclass @@ -3567,35 +3567,16 @@ tedError -(%22Must implement.%22) %0A%0A de @@ -3705,35 +3705,16 @@ tedError -(%22Must implement.%22) %0A%0A de @@ -3805,35 +3805,16 ...
048151e47b0fb2e5211a1a0d857f55c32d64d70b
Add appropiate get_default method to field.
django_pgjson/fields.py
django_pgjson/fields.py
# -*- coding: utf-8 -*- import json import re import django from django.db.backends.postgresql_psycopg2.version import get_version from django.core.serializers.json import DjangoJSONEncoder from django.db import models from django import forms from django.utils import six import psycopg2 import psycopg2.extensions i...
Python
0
@@ -1233,16 +1233,205 @@ coder)%0A%0A + def get_default(self):%0A if self.has_default():%0A if callable(self.default):%0A return self.default()%0A return self.default%0A%0A return None%0A%0A def
758c33b216513ede90ebc139e6eae87ba60c7512
Remove django <= 1.4.x support.
djmail/template_mail.py
djmail/template_mail.py
# -*- encoding: utf-8 -*- from __future__ import print_function import functools import logging from django.conf import settings from django.core import mail from django.utils import translation try: # Django >= 1.4.5 from django.utils.six import string_types except ImportError: # Django < 1.4.5 stri...
Python
0
@@ -1,16 +1,14 @@ # -*- -en coding: @@ -17,16 +17,16 @@ f-8 -*-%0A + %0Afrom __ @@ -88,16 +88,54 @@ logging +%0Afrom contextlib import contextmanager %0A%0Afrom d @@ -231,39 +231,8 @@ ion%0A -try:%0A # Django %3E= 1.4.5%0A from @@ -273,79 +273,8 @@ pes%0A -except ImportError:%0A # Django %3C 1.4.5...
0bf9c011ca36df2d72dfd3b8fc59f6320e837e43
Update __init__.py
dmoj/cptbox/__init__.py
dmoj/cptbox/__init__.py
from collections import defaultdict from dmoj.cptbox.sandbox import SecurePopen, PIPE from dmoj.cptbox.handlers import DISALLOW, ALLOW from dmoj.cptbox.chroot import CHROOTSecurity from dmoj.cptbox.syscalls import SYSCALL_COUNT class NullSecurity(defaultdict): def __init__(self): for i in xrange(SYSCALL_...
Python
0.000072
@@ -223,16 +223,67 @@ _COUNT%0A%0A +if sys.version_info.major == 2:%0A range = xrange%0A %0Aclass N @@ -349,17 +349,16 @@ or i in -x range(SY
ca050969d1267d13986a0494a86f7fd50616937e
Remove old code.
process/scripts/run.py
process/scripts/run.py
""" Document processing script. Does NER for persons, dates, etc. Usage: process.py <dbname> process.py -h | --help | --version Options: -h --help Show this screen --version Version number """ import logging from docopt import docopt from iepy.db import connect, DocumentManager fr...
Python
0.000045
@@ -621,139 +621,8 @@ r()%0A - %22%22%22set_custom_entity_kinds(zip(map(lambda x: x.lower(), CUSTOM_ENTITIES),%0A CUSTOM_ENTITIES))%22%22%22%0A
8de499c725ac2a3028f5390f1c8d1b88115c6522
Add countdown
src/waldur_rancher/executors.py
src/waldur_rancher/executors.py
from celery import chain from waldur_core.core import executors as core_executors from waldur_core.core import tasks as core_tasks from waldur_core.core import utils as core_utils from waldur_core.core.models import StateMixin from . import models, tasks class ClusterCreateExecutor(core_executors.CreateExecutor): ...
Python
0.000208
@@ -719,32 +719,45 @@ ntimeStateTask() +%0A .si(%0A @@ -951,32 +951,64 @@ ,%0A )%0A + .set(countdown=120)%0A %5D%0A
9bc1c77250d338ca93ff33d2832c2b3117b3550e
Use the raw domain for Netflix, because there's only one now
services/netflix.py
services/netflix.py
import urlparse import foauth.providers from oauthlib.oauth1.rfc5849 import SIGNATURE_TYPE_QUERY class Netflix(foauth.providers.OAuth1): # General info about the provider provider_url = 'https://www.netflix.com/' favicon_url = 'https://netflix.hs.llnwd.net/e1/en_US/icons/nficon.ico' docs_url = 'http:...
Python
0.000001
@@ -1090,12 +1090,8 @@ main -s%5B0%5D , u'
87cc7ccb8626d9e236954cce0667167f5f9742be
fix prometheus test
restclients_core/tests/test_prometheus.py
restclients_core/tests/test_prometheus.py
from restclients_core.tests.dao_implementation.test_backend import TDAO from unittest import TestCase from prometheus_client import generate_latest, REGISTRY class TestPrometheusObservations(TestCase): def test_prometheus_observation(self): metrics = generate_latest(REGISTRY).decode('utf-8') self...
Python
0.000018
@@ -45,23 +45,20 @@ on.test_ -backend +live import @@ -91,16 +91,28 @@ TestCase +, skipUnless %0Afrom pr @@ -160,17 +160,104 @@ EGISTRY%0A -%0A +import os%0A%0A%0A@skipUnless(%22RUN_LIVE_TESTS%22 in os.environ, %22RUN_LIVE_TESTS=1 to run tests%22) %0Aclass T @@ -293,17 +293,16 @@ tCase):%0A -%0A def @@ -...
2b1cb336168e8ac72a768b03852ebe5a0c02a8a9
Remove unused import
corehq/apps/users/tests/fixture_status.py
corehq/apps/users/tests/fixture_status.py
from datetime import datetime from django.test import TestCase from mock import MagicMock, patch from django.contrib.auth.models import User from corehq.apps.users.models import CouchUser, CommCareUser from corehq.apps.domain.models import Domain from corehq.apps.fixtures.models import UserFixtureStatus, UserFixtureTy...
Python
0.000001
@@ -59,42 +59,8 @@ Case -%0Afrom mock import MagicMock, patch %0A%0Afr
550ef5aeb24bfc799a23091afc60ebbba7808793
fix #1353 (get and only get the specified part)
src/you_get/extractors/acfun.py
src/you_get/extractors/acfun.py
#!/usr/bin/env python __all__ = ['acfun_download'] from ..common import * from .le import letvcloud_download_by_vu from .qq import qq_download_by_vid from .sina import sina_download_by_vid from .tudou import tudou_download_by_iid from .youku import youku_download_by_vid, youku_open_download_by_vid import json, re ...
Python
0
@@ -543,20 +543,16 @@ -%3ENone%0A - %0A Dow @@ -577,20 +577,16 @@ by vid.%0A - %0A Cal @@ -3108,24 +3108,22 @@ ideo -s = re. -findall(%22 +search(' data @@ -3131,55 +3131,46 @@ vid= -%5C %22(%5Cd+) -%5C%22.*href=%5C%22%5B%5E%5C%22%5D+%5C%22.*title=%5C%22(%5B%5E%5C%22%5D+)%5C%22%22 +%22%5Cs*data...
c8a91d7891f4cba4e72ee192fc5599547d276d17
bring RTD cache down from 1 day to 30 minutes
crate_project/apps/packages/evaluators.py
crate_project/apps/packages/evaluators.py
import slumber from django.core.cache import cache from django.utils.safestring import mark_safe from evaluator import suite from packages.models import ReadTheDocsPackageSlug from packages.utils import verlib class PEP386Compatability(object): title = "PEP386 Compatibility" message = mark_safe("PEP386 def...
Python
0
@@ -4118,17 +4118,17 @@ version= -3 +4 ) is not @@ -4190,17 +4190,17 @@ version= -3 +4 )%0A @@ -4609,15 +4609,10 @@ 0 * -60 * 24 +30 , ve @@ -4617,17 +4617,17 @@ version= -3 +4 ) # Cac @@ -4642,13 +4642,18 @@ for -a Day +30 Minutes %0A%0A
dcd7b8e990ff0f3d29807be78d7d3967c6ad46c4
Add trailing newline
gen_tmpfiles.py
gen_tmpfiles.py
#!/usr/bin/python '''Scan an existing directory tree and record installed directories. During build a number of directories under /var are created in the stateful partition. We want to make sure that those are always there so create a record of them using systemd's tempfiles config format so they are recreated during ...
Python
0.000001
@@ -2284,16 +2284,21 @@ (config) ++'%5Cn' )%0A
fe265f187f37b13721e5d59919e618be56aa1eb4
Remove debug code
generate-tex.py
generate-tex.py
#!/usr/bin/env python3 import yaml import glob from jinja2 import Template from os.path import basename, splitext from subprocess import check_output from collections import defaultdict def convert_markdown_to_tex(markdown): return check_output( ["pandoc", "--from=markdown", "--to=latex"], univer...
Python
0.000299
@@ -3077,70 +3077,8 @@ t)%0A%0A - for p in parameters:%0A print(p.get('description'))%0A%0A
738cc42fc0ee8e06a53842c27dd4a392403bea49
remove asgi warning
fiduswriter/manage.py
fiduswriter/manage.py
#!/usr/bin/env python3 import os import sys from importlib import import_module if "COVERAGE_PROCESS_START" in os.environ: import coverage coverage.process_startup() SRC_PATH = os.path.dirname(os.path.realpath(__file__)) os.environ.setdefault("SRC_PATH", SRC_PATH) def inner(default_project_path): sys....
Python
0.000006
@@ -75,16 +75,66 @@ odule%0A%0A%0A +os.environ%5B%22DJANGO_ALLOW_ASYNC_UNSAFE%22%5D = %22true%22%0A%0A if %22COVE
be3189249da8906d0e09d810a9c132e8af9a344c
update docs conf description
docs/source/conf.py
docs/source/conf.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # ChoiceModels documentation build configuration file, created by # sphinx-quickstart on Thu Nov 30 14:23:50 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this...
Python
0
@@ -5450,23 +5450,8 @@ tion - and simulation .',%0A
a439d226a8616f81c43915516c30a4ee3a59904b
Bring back incomplete sentence
docs/source/conf.py
docs/source/conf.py
# -*- coding: utf-8 -*- # # Paver documentation build configuration file, created by # sphinx-quickstart on Fri Apr 11 08:20:18 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleabl...
Python
0.00007
@@ -1889,16 +1889,93 @@ '1.2.3'%0A +# There are two options for replacing %7Ctoday%7C: either, you set today to some%0A # non-fa
2fe38ad865afc1afc0b06edebf55929b99a64977
add more metadata to docs and package
docs/source/conf.py
docs/source/conf.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # PyBBN documentation build configuration file, created by # sphinx-quickstart on Tue Jan 17 17:44:12 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # auto...
Python
0
@@ -4741,39 +4741,26 @@ ', ' -One line description of project +Bayesian inference .',%0A
a363edd761e2c99bae6d4492d0ca44a404e5d904
Avoid py36 error when printing unicode chars in a stream
neutronclient/tests/unit/test_exceptions.py
neutronclient/tests/unit/test_exceptions.py
# 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 agreed to in...
Python
0.999789
@@ -598,24 +598,32 @@ %0Aimport -fixtures +sys%0A%0Aimport mock %0Afrom os @@ -1092,146 +1092,60 @@ -fixture = fixtures.StringStream('stdout')%0A self.useFixture(fixture)%0A with fixtures.MonkeyPatch('sys.stdout', fixture.stream) +with mock.patch.object(sys, 'stdout') as mock_stdout :%0A @@ -1...
62404979e69ccd129f8382e8a2fce5329c577a78
fix version
experimentator/__version__.py
experimentator/__version__.py
__version__ = '0.2.0.dev5'
Python
0.000001
@@ -13,15 +13,14 @@ = '0.2.0 -. dev5'%0A
b0e3b4fcd3d85989ebe72fa805cfab4576867835
Fix how node-caffe detects if GPU is supported on a machine
node-caffe/binding.gyp
node-caffe/binding.gyp
{ 'targets': [ { 'target_name': 'caffe', 'sources': [ 'src/caffe.cpp' ], 'include_dirs': [ '<!(node -e "require(\'nan\')")', '<!(echo $CAFFE_ROOT/include)', '/usr/local/cuda/include/', '<!(pwd)/caffe/src/', '<!(pwd)/caffe/include/', '...
Python
0.000082
@@ -94,24 +94,137 @@ p'%0A %5D,%0A + 'variables': %7B%0A 'has_gpu': '%3C!(if which nvidia-smi; then echo true; else echo false; fi)',%0A %7D,%0A 'inclu @@ -572,32 +572,57 @@ '%3C!(if %5B + %22$has_gpu%22 = true %5D && %5B -d /usr/local/c @@ -681,32 +681,57 @@ '%3C!(if %...
3471381b5894536142a9460410e0efe5e8b1b294
make doc regex more lenient
flask_website/docs.py
flask_website/docs.py
# -*- coding: utf-8 -*- import os import re from flask import url_for, Markup from flask_website import app from flask_website.search import Indexable _doc_body_re = re.compile(r'''(?smx) <title>(.*?)</title>.*? <div\s+class="body">(.*?)<div\s+class="sphinxsidebar"> ''') class DocumentationPage(Indexable): ...
Python
0.000692
@@ -145,17 +145,16 @@ exable%0A%0A -%0A _doc_bod @@ -222,43 +222,55 @@ %3Cdiv -%5Cs+ +.*? class=%22 +.*? body -%22 +.*? %3E(.* -? ) +%0A %3Cdiv -%5Cs+ +.*? class=%22 +.*? sphi @@ -282,10 +282,8 @@ ebar -%22%3E %0A'''
9156a6263c3a0e6c0cf83d2fa9e7ed33634f99fd
refactor (output): ensure that Nonetype is output correctly
flattentool/output.py
flattentool/output.py
""" Code to output a parsed flattened JSON schema in various spreadsheet formats. """ import openpyxl from openpyxl.cell.cell import ILLEGAL_CHARACTERS_RE import csv import os import sys from warnings import warn from flattentool.exceptions import DataErrorWarning from odf.opendocument import OpenDocumentSpreadsheet...
Python
0.000543
@@ -3015,16 +3015,38 @@ ll %22%22%22%0A%0A + if value:%0A @@ -3042,32 +3042,36 @@ try:%0A + # Se @@ -3103,32 +3103,36 @@ oat%0A + + cell = odf.table @@ -3196,24 +3196,25 @@ + value=float( @@ -3225,24 +3225,28 @@ e))%0A + ...
43403cfca2ca217c03f4aaffdddd7a4d03a74520
Change string formatting
getMolecules.py
getMolecules.py
#!/usr/bin/env python # Copyright (c) 2016 Ryan Collins <rcollins@chgr.mgh.harvard.edu> # Distributed under terms of the MIT license. """ Estimate original molecule sizes and coordinates from 10X linked-read WGS barcodes """ import argparse from collections import defaultdict, Counter, namedtuple import pysam def g...
Python
0.000007
@@ -2950,30 +2950,40 @@ = ' -%25s%5Ct%25s%5Ct%25s%5Ct%25s%5Ct%25s' %25 +%7B0%7D%5Ct%7B1%7D%5Ct%7B2%7D%5Ct%7B3%7D%5Ct%7B4%7D'.format( bed. @@ -3033,16 +3033,17 @@ eadcount +) %0A%0A
98e899d5e76f8bee5c288bffe78ccf943665693c
Fix white space to be 4 spaces
get_cve_data.py
get_cve_data.py
# Script to import CVE data from NIST https://nvd.nist.gov/vuln/data-feeds#JSON_FEED # https://static.nvd.nist.gov/feeds/json/cve/1.0/nvdcve-1.0-modified.json.gz import gzip import json import pycurl from io import BytesIO NVD_CVE_ENDPOINT = 'https://static.nvd.nist.gov/feeds/json/cve/1.0/nvdcve-1.0-modified.json.gz'...
Python
0.999999
@@ -378,17 +378,20 @@ as fd:%0A -%09 + c = pycu @@ -400,17 +400,20 @@ .Curl()%0A -%09 + c.setopt @@ -438,17 +438,20 @@ DPOINT)%0A -%09 + c.setopt @@ -468,17 +468,20 @@ TA, fd)%0A -%09 + c.perfor @@ -523,17 +523,20 @@ != 200:%0A -%09 + print('d @@ -556,17 +556,20 @@ ailed')%0A -%09 + ...
5e3a4c84d31fe63a67fdb2e64c5edc1ffe8d24ab
Tweak return message
flexget/api/cached.py
flexget/api/cached.py
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin from flask.helpers import send_file from flask_restplus import inputs from flexget.api import api, APIResource, APIError, BadRequest from flexget.utils.tools import cached_resou...
Python
0
@@ -838,18 +838,22 @@ on=' -Return fil +Cached resourc e')%0A
16e38be365c939f7e74fb321280e88370606a6c3
Fix daemonizing on python 3.4+
flexget/task_queue.py
flexget/task_queue.py
from __future__ import unicode_literals, division, absolute_import from builtins import * import logging import queue import threading import time from sqlalchemy.exc import ProgrammingError, OperationalError from flexget.task import TaskAbort log = logging.getLogger('task_queue') class TaskQueue(object): """...
Python
0
@@ -112,16 +112,27 @@ t queue%0A +import sys%0A import t @@ -3157,32 +3157,382 @@ l-c%0A %22%22%22%0A + if sys.version_info %3E= (3, 4):%0A # Due to python bug, Thread.is_alive doesn't seem to work properly under our conditions on python 3.4+%0A # http://bugs.python.org/issue26793...
ec54ab484d9b8d2507a42fa7f0adba9e52975ddb
add new test for revoke function
github/tests.py
github/tests.py
from django.core.urlresolvers import resolve from django.test import TestCase from django.http import HttpRequest from django.test import LiveServerTestCase from django.contrib.auth.models import User from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from sele...
Python
0.000001
@@ -2240,79 +2240,21 @@ mous -(self):%0A # self.client. +_ login( -u se -rname='admin', password='admin') +lf): %0A @@ -3099,16 +3099,798 @@ , '/')%0A%0A +%0Aclass TestRevokeView(TestCase):%0A%0A def setUp(self):%0A User.objects.create_superuser(%0A username='admin', password='admin'...
081d4f32f0cc69a62b7ae23909d0327a1df56fb1
Introduce CleanChars filter
weboob/tools/browser2/filters.py
weboob/tools/browser2/filters.py
# -*- coding: utf-8 -*- # Copyright(C) 2014 Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opti...
Python
0
@@ -4783,16 +4783,433 @@ name))%0A%0A +class CleanChars(Filter):%0A %22%22%22%0A Remove chars.%0A %22%22%22%0A def __init__(self, selector, symbols):%0A super(CleanChars, self).__init__(selector)%0A self.symbols = symbols%0A%0A def filter(self, txt):%0A if isinstance(txt, (tuple,lis...
f6fb41772726695a366798352e70e2c3644a44d4
Remove 'del_ins' third-party Markdown extension to prevent failing builds
website/project/views/comment.py
website/project/views/comment.py
# -*- coding: utf-8 -*- import pytz from datetime import datetime from flask import request from modularodm import Q from framework.auth.decorators import must_be_logged_in from website.addons.base.signals import file_updated from website.files.models import FileNode from website.notifications.constants import PROVID...
Python
0
@@ -1944,19 +1944,8 @@ t, %5B -'del_ins', 'mar
9df0c21bcefdeda4ca65ee4126ed965a6d099416
Fix line length on import statement
website/website/wagtail_hooks.py
website/website/wagtail_hooks.py
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register, \ ThumbnailMixin from website.models import Logo class LogoAdmin(ThumbnailMixin, ModelAdmin): model = Logo menu_icon = 'picture' menu_order = 1000 list_display = ('admin_thumb', 'category', 'link') add_to_settings...
Python
0.00979
@@ -51,16 +51,21 @@ elAdmin, +%5C%0A modelad @@ -81,14 +81,8 @@ ter, - %5C%0A Thu
a44484285b1b9ea4f072a3c0b3f933e44f1475c2
remove option --ids in formats.contig.frombed()
formats/contig.py
formats/contig.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ TIGR contig format, see spec: <http://www.cbcb.umd.edu/research/contig_representation.shtml#contig> """ import sys import logging from optparse import OptionParser from collections import defaultdict from jcvi.formats.base import BaseFile, read_block from jcvi.apps...
Python
0
@@ -2492,139 +2492,8 @@ __)%0A - p.add_option(%22--ids%22, default=False, action=%22store_true%22,%0A help=%22Only generate ids file %5Bdefault: %25default%5D%22)%0A @@ -2633,27 +2633,8 @@ rgs%0A - ids = opts.ids%0A @@ -2897,36 +2897,16 @@ e, %22w%22)%0A - if not ids:%0A ...
d4d69ed62cbd726c92de9382136175e0fbdbb8af
Remove super-stale file paths
opencog/nlp/anaphora/agents/testingAgent.py
opencog/nlp/anaphora/agents/testingAgent.py
from __future__ import print_function from pprint import pprint # from pln.examples.deduction import deduction_agent from opencog.atomspace import types, AtomSpace, TruthValue from agents.hobbs import HobbsAgent from agents.dumpAgent import dumpAgent from opencog.scheme_wrapper import load_scm,scheme_eval_h, scheme_ev...
Python
0.000002
@@ -654,767 +654,8 @@ %22)%0A%0A -%0A%0Adata=%5B%22opencog/scm/config.scm%22,%0A %22opencog/scm/core_types.scm%22,%0A %22spacetime/spacetime_types.scm%22,%0A %22opencog/nlp/types/nlp_types.scm%22,%0A %22opencog/attention/attention_types.scm%22,%0A %22opencog/embodiment/embodiment_types.scm%22,...
f585a7cdf4ecbecfe240873a3b4b8e7d4376e69c
Move fallback URL pattern to the end of the list so it gets matched last.
campus02/urls.py
campus02/urls.py
#!/usr/bin/python # -*- coding: utf-8 -*- from django.conf import settings from django.conf.urls import include, url from django.contrib import admin from django.views.static import serve urlpatterns = [ url(r'^', include('django.contrib.auth.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^web/...
Python
0
@@ -368,72 +368,8 @@ )),%0A - url(r'%5E', include('campus02.base.urls', namespace='base')),%0A %5D%0A%0Ai @@ -913,12 +913,98 @@ ),%0A )%0A +%0Aurlpatterns.append(%0A url(r'%5E', include('campus02.base.urls', namespace='base'))%0A)%0A
c05a93d8993e14fc8521dd01a13a930e85fcb882
fix code style in `test_db_util` (#9594)
datadog_checks_base/tests/test_db_util.py
datadog_checks_base/tests/test_db_util.py
# -*- coding: utf-8 -*- # (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import math import time from datadog_checks.base.utils.db.utils import RateLimitingTTLCache, ConstantRateLimiter def test_constant_rate_limiter(): rate_limit = 8 test_dur...
Python
0
@@ -136,20 +136,8 @@ SE)%0A -import math%0A impo @@ -192,16 +192,24 @@ import +Constant RateLimi @@ -213,40 +213,32 @@ imit -ingTTLCache, ConstantRateLimiter +er, RateLimitingTTLCache %0A%0A%0Ad
a9a9b60d9994bc4780e74ddd01df833a85247b95
Change state serialiser to pass hex color values.
suddendev/game/state_encoder.py
suddendev/game/state_encoder.py
#!/usr/bin/python3 import json def encodeState(game): return json.dumps(game, cls=StateEncoder) class StateEncoder(json.JSONEncoder): def default(self, o): return self.serializeState(o) def serializeState(self, state): return { 'players': self.serializePlayers(state.play...
Python
0
@@ -96,16 +96,63 @@ coder)%0A%0A +def clamp(x): %0A return max(0, min(x, 255))%0A%0A class St @@ -1361,116 +1361,87 @@ urn -%7B%0A 'r': color.r,%0A 'g': color.g,%0A 'b': color.b%0A %7D +%22#%7B0:02x%7D%7B1:02x%7D%7B2:02x%7D%22.format(clamp(color.r), cla...
3e5c500eed84ca24ffc31e802e061833a5a43225
use unicode names in test
suvit_system/tests/test_node.py
suvit_system/tests/test_node.py
# -*- coding: utf-8 -*- from openerp.tests.common import TransactionCase class TestNode(TransactionCase): def test_node_crud(self): Node = self.env['suvit.system.node'] root = Node.create({'name': 'Root1'}) ch1 = Node.create({'name': 'Ch1', 'parent_id': root.id}) ch2 = Node.crea...
Python
0.000026
@@ -1,5 +1,4 @@ -%EF%BB%BF # -* @@ -213,16 +213,17 @@ 'name': +u 'Root1'%7D @@ -260,16 +260,17 @@ 'name': +u 'Ch1', ' @@ -322,24 +322,25 @@ te(%7B'name': +u 'Ch3', 'pare @@ -388,24 +388,25 @@ te(%7B'name': +u 'Ch2', 'pare @@ -451,16 +451,17 @@ 'name': +u 'Ch3-las @@ -594,22 +594,25 @@ ), %5B +u 'Ch1',...
c300e70bb65da3678f27c4ba01b22f9a3d4fc717
Use spi_serial for tools
tools/serial_rf_spy.py
tools/serial_rf_spy.py
#!/usr/bin/env python import os import serial import time class SerialRfSpy: CMD_GET_STATE = 1 CMD_GET_VERSION = 2 CMD_GET_PACKET = 3 CMD_SEND_PACKET = 4 CMD_SEND_AND_LISTEN = 5 CMD_UPDATE_REGISTER = 6 CMD_RESET = 7 def __init__(self, serial_port, rtscts=None): if not rtscts: rtscts = int(...
Python
0.000001
@@ -343,17 +343,135 @@ S', 1))%0A -%0A + if serial_port.find('spi') %3E= 0:%0A import spi_serial%0A self.ser = spi_serial.SpiSerial()%0A else:%0A self
da3f842107e5f8062013b7a6412da2cb18592f5f
make the dt statement into an assertion
examples/basic_example.py
examples/basic_example.py
""" Basic Example ============= Here we demonstrate both the coordinate-based slicing notatation, which is unique to pySpecData, as well the way in which the axis coordinates for a Fourier transform are handled automatically. The case considered here is that of an NMR FID that has been acquired with a wider spectral w...
Python
0.999999
@@ -757,16 +757,64 @@ t=True)%0A +assert fake_data.get_ft_prop('t2','dt') == 1e-3%0A print(%22n
73029223f54dc6c793c190e70a135d0bd3faa50b
Update download script
download_corpora.py
download_corpora.py
#!/usr/bin/env python # -*- coding: utf-8 -*- '''Downloads the necessary NLTK models and corpora.''' from nltk import download REQUIRED_CORPORA = [ 'brown', 'punkt', 'conll2000', 'maxent_treebank_pos_tagger', ] def main(): for each in REQUIRED_CORPORA: print(('Downloading "{0}"'.format(eac...
Python
0
@@ -103,28 +103,33 @@ rom -nltk import download +text.packages import nltk %0A%0ARE @@ -331,16 +331,21 @@ +nltk. download
c818007491fe10101a73beeb7adfa59f9aadf3c6
use private key instead of public
osf/management/commands/file_view_counts.py
osf/management/commands/file_view_counts.py
from __future__ import unicode_literals import logging import django django.setup() import json import requests import urllib from django.core.management.base import BaseCommand from django.db import transaction from osf.models import BaseFileNode, PageCounter from website import settings from keen import KeenClient...
Python
0.000001
@@ -681,534 +681,8 @@ een%0A - client = KeenClient(%0A project_id=settings.KEEN%5B'public'%5D%5B'project_id'%5D,%0A read_key=settings.KEEN%5B'public'%5D%5B'read_key'%5D,%0A )%0A%0A node_pageviews = client.count(%0A event_collection='pageviews',%0A timefr...
986d134089d1ce9b026761a5d5bb7c6f528ca8d4
Use fmtlib-5.3.0
dreal/workspace.bzl
dreal/workspace.bzl
load("//third_party/com_github_robotlocomotion_drake:tools/workspace/github.bzl", "github_archive") load("//third_party/com_github_robotlocomotion_drake:tools/workspace/pkg_config.bzl", "pkg_config_repository") def dreal_workspace(): pkg_config_repository( name = "ibex", # LGPL3 modname = "ibex", ...
Python
0.000001
@@ -2451,19 +2451,19 @@ it = %225. -2.1 +3.0 %22,%0A @@ -2479,72 +2479,72 @@ = %22 -3c812a18e9f72a88631ab4732a97ce9ef5bcbefb3235e9fd465f059ba204359b +defa24a9af4c622a7134076602070b45721a43c51598c8456ec6f2c4dbb51c89 %22,%0A
02490615e82be65520a8d608cff467dcf1bd7b96
add picture commands help messages
extensions/picture/picture.py
extensions/picture/picture.py
from discord.ext import commands import discord import os class Picture(): def __init__(self, bot): self.bot = bot @commands.command() async def awoo(self): fp = os.path.join(os.path.dirname(os.path.realpath(__file__)) + '/awoo.jpg') with open(fp, 'rb') as f: try: ...
Python
0.000001
@@ -137,34 +137,46 @@ ommands.command( +help=%22Awoo!%22 )%0A - async def aw @@ -509,32 +509,52 @@ ommands.command( +help=%22Shows a baka.%22 )%0A async def @@ -889,32 +889,69 @@ ommands.command( +help=%22Summons the anti-bully ranger.%22 )%0A async def @@ -1270,32 +1270,32 @@ ad pictures.%22)%0A%0A...
7761d1ef19ec3b8a1c6ef17115cca27e39fafaad
Replace non-latin1 characters
demosys/effects/text/effects/writer_2d.py
demosys/effects/text/effects/writer_2d.py
import numpy from pyrr import matrix44 import moderngl from demosys.opengl.vao import VAO from .base import BaseText, FontMeta class TextWriter2D(BaseText): runnable = False def __init__(self, area, text_lines=None, aspect_ratio=1.0): """ :param area: (x, y) Text area size (nu...
Python
0.999988
@@ -2556,16 +2556,34 @@ -8859-1' +, errors='replace' ), self.
6148e7cccc50023955ef7c3d86709c5197ae78e7
Make output more understandable
doc/python/cryptobox.py
doc/python/cryptobox.py
#!/usr/bin/python import sys import botan def main(args = None): if args is None: args = sys.argv if len(args) != 3: raise Exception("Bad usage") password = args[1] input = ''.join(open(args[2]).readlines()) rng = botan.RandomNumberGenerator() ciphertext = botan.cryptobox_e...
Python
1
@@ -158,19 +158,36 @@ on(%22 -Bad usage +Usage: %3Cpassword%3E %3Cinput%3E %22) +; %0A%0A @@ -530,18 +530,65 @@ nt %22 -Oops -- %22, +Good news: bad password caused exception: %22%0A print e%0A%0A @@ -650,16 +650,49 @@ sword)%0A%0A + print %22Original input was: %22%0A prin
9c6001b5da9b28bf2f4e3d4028dacb4f0dec0a63
Change check_permission helper to accept non-staff
froide/helper/auth.py
froide/helper/auth.py
from functools import lru_cache from django.contrib.auth import get_permission_codename from django.db.models import Q from froide.team.models import Team AUTH_MAPPING = { 'read': 'view', 'write': 'change', } def check_permission(obj, request, verb): user = request.user if not user.is_staff: ...
Python
0.000001
@@ -289,51 +289,59 @@ -if not user.is_staff:%0A return False%0A +opts = obj._meta%0A%0A if verb in AUTH_MAPPING:%0A @@ -369,46 +369,19 @@ PING -.get(verb, +%5B verb -) +%5D %0A -opts = obj._meta%0A @@ -425,32 +425,67 @@ pability, opts)%0A + else:%0A codename = verb%0A%...
021802b9e937873e8108a3dc040a012c323173c1
increase time the updates stay in redis from 2 minutes to 10 minutes
totalimpact/tiredis.py
totalimpact/tiredis.py
import redis, logging, json, datetime, os, iso8601 from collections import defaultdict from totalimpact.providers.provider import ProviderFactory logger = logging.getLogger("ti.tiredis") def from_url(url, db=0): r = redis.from_url(url, db) return r def set_hash_value(self, key, hash_key, value, expire, pip...
Python
0
@@ -856,17 +856,18 @@ pire=60* -2 +10 , pipe=N @@ -1256,17 +1256,18 @@ pire=60* -2 +10 ):%0A p
4dc6b726e5f685d01229bc6438b99f060fb63380
Add content type and accpet header checking, probaly too strict.
src/webapp.py
src/webapp.py
#!/usr/bin/env python import os import json import uuid import tornado.ioloop import tornado.web import tornado.options tornado.options.define('cookie_secret', default='sssecccc', help='Change this to a real secret') tornado.options.define('favicon', default='static/favicon.ico', help='Path to favicon.ico') tornado.o...
Python
0
@@ -549,16 +549,59 @@ tion')%0A%0A +JSON_CONTENT = 'application/vnd.api+json'%0A%0A class Ma @@ -1752,34 +1752,20 @@ e', -'application/vnd.api+json' +JSON_CONTENT )%0A @@ -2001,32 +2001,38 @@ 04)%0A +if self. -set +_check _header('Con @@ -2045,63 +2045,357 @@ ype' -, 'application/vnd.api+json')%0A ...
c49daf9885e86ba08acdc8332d2a34bc5951a487
Increase limitancestorcount in tournament RPC test to showcase improved algorithm
test/functional/mempool_updatefromblock.py
test/functional/mempool_updatefromblock.py
#!/usr/bin/env python3 # Copyright (c) 2020-2021 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test mempool descendants/ancestors information update. Test mempool update of transaction descendants/...
Python
0
@@ -779,16 +779,43 @@ ze=1000' +, '-limitancestorcount=100' %5D%5D%0A%0A
6a8bae5e796b842ae9dd8ab51beb9cadea961305
version bump
transitions/version.py
transitions/version.py
__version__ = '0.2.2'
Python
0.000001
@@ -12,11 +12,11 @@ = '0.2. -2 +3 '%0A
6174580057cc1c54539f9f05bc09c6a80df1fe4b
Fix issue following rebase
app/questionnaire/create_questionnaire_manager.py
app/questionnaire/create_questionnaire_manager.py
from app.validation.validator import Validator from app.routing.routing_engine import RoutingEngine from app.navigation.navigator import Navigator from app.questionnaire.questionnaire_manager import QuestionnaireManager from app.main import errors from app.utilities.factory import factory from app.metadata.metadata_sto...
Python
0.000001
@@ -2174,39 +2174,47 @@ a = -factory.create(%22metadata-store%22 +MetaDataStore.get_instance(current_user )%0A%0A
b7b78a9282e2a4ee776020f83812e3abd437467b
Corrige erro de QuerySet immutable
djangosige/apps/cadastro/views/cliente.py
djangosige/apps/cadastro/views/cliente.py
# -*- coding: utf-8 -*- from django.core.urlresolvers import reverse_lazy from djangosige.apps.cadastro.forms import ClienteForm from djangosige.apps.cadastro.models import Cliente from .base import AdicionarPessoaView, PessoasListView, EditarPessoaView class AdicionarClienteView(AdicionarPessoaView): template...
Python
0.000001
@@ -1096,33 +1096,35 @@ req -uest.POST._mutable = True +_post = request.POST.copy() %0A @@ -1127,33 +1127,29 @@ %0A req -uest.POST +_post %5B'cliente_fo @@ -1172,33 +1172,29 @@ dito'%5D = req -uest.POST +_post %5B'cliente_fo @@ -1238,32 +1238,64 @@ '.', '')%0A + request.POST = req_post%0...
a2a26ed8b216c4a40db7a384571d05c690e25cef
Update test expectation
examples/run-example-8.py
examples/run-example-8.py
#!/usr/bin/python import os, sys, inspect DIR = os.path.dirname(os.path.realpath(__file__)) NORM_EXPECT='Require Coq.omega.Omega.\nRequire Top.A.\nRequire Top.B.\nRequire Top.C.\nRequire Top.D.\n\nImport Top.D.\n' GET_EXPECT = { 'Coq.omega.Omega': None, 'Top.A': 'Module Export Top_DOT_A.\nModule Export Top.\...
Python
0.000001
@@ -207,16 +207,40 @@ Top.D.%5Cn +%5CnFail Check A.mA.axA.%5Cn '%0A%0AGET_E
aba35816752dabc67ec0382d769fd1a39e0f7275
change address
dwitter/settings/base.py
dwitter/settings/base.py
""" Django settings for dwitter project. Generated by 'django-admin startproject' using Django 1.9. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # B...
Python
0.000003
@@ -472,16 +472,24 @@ 'http:// +dwitter. lionleaf @@ -493,23 +493,16 @@ eaf.org/ -dwitter '%0A%0AREGIS
48a89b4cdb2e084f4b349e9ca12a91daba9e0734
Fix build with Python 3
spyne/test/transport/test_msgpack.py
spyne/test/transport/test_msgpack.py
# # spyne - Copyright (C) Spyne contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This libra...
Python
0.000001
@@ -2028,33 +2028,33 @@ ()%0A print - +( repr(val)%0A @@ -2038,32 +2038,33 @@ print(repr(val) +) %0A val = m @@ -2088,33 +2088,33 @@ l)%0A print - +( repr(val)%0A%0A @@ -2098,32 +2098,33 @@ print(repr(val) +) %0A%0A self.a @@ -2935,33 +2935,33 @@ print - +...
6cdc05abb5777656684d18cfb215aa7dbcb10c43
Create indexes if not created
scripts/install/create_tables_cloudsql.py
scripts/install/create_tables_cloudsql.py
#! /usr/bin/env python import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", "engine", "src")) import MySQLdb import time from juliabox.db import JBoxUserV2, JBoxDynConfig, JBoxSessionProps, JBoxInstanceProps, JBPluginDB, JBoxAPISpec, JBoxUserProfile from juliabox.jbox_util import ...
Python
0.000002
@@ -1173,24 +1173,159 @@ n.commit()%0A%0A +def index_exists(tname, iname):%0A f = c.execute(%22show index from %60%25s%60 where Key_name=%5C%22%25s%5C%22%22 %25 (tname, iname))%0A return f is not 0%0A %0Adef indexes @@ -1374,24 +1374,62 @@ es == None:%0A + print(%22No indexes to create%22)%0A r...
0dcad3ac5f3754fedf12c7aca7050ec6ab85840d
fix merge cleaning
transports/__init__.py
transports/__init__.py
from yo_ug_http import YoUgHttpTransport from cm_nl_yo_ug_http import CmYoTransport from cm_nl_http import CmTransport from push_tz_yo_ug_http import PushYoTransport from push_tz_http import PushTransport from push_tz_smpp import PushTzSmppTransport from mobivate_http import MobivateHttpTransport from movilgate_http im...
Python
0
@@ -770,21 +770,8 @@ t%22,%0A -%3C%3C%3C%3C%3C%3C%3C HEAD%0A @@ -840,16 +840,8 @@ t%22,%0A -=======%0A @@ -873,32 +873,8 @@ t%22,%0A -%3E%3E%3E%3E%3E%3E%3E feature/burkina%0A
14e437772c50dfb35f394f4aa99a2aefd188c077
fix unused i
scripts/monitoring/cron-send-build-app.py
scripts/monitoring/cron-send-build-app.py
#!/usr/bin/env python ''' Quick and dirty create application check for v3 ''' # Adding the ignore because it does not like the naming of the script # to be different than the class name # pylint: disable=invalid-name # the to-many-branches import subprocess import json import time import re import urllib import s...
Python
0
@@ -305,16 +305,17 @@ urllib%0A +# import s @@ -6074,17 +6074,17 @@ for -i +_ in rang
6e213791d63267088c5bceaa98ce21dbff196167
Remove cpu restriction from android task.
scripts/slave/recipes/swarming/staging.py
scripts/slave/recipes/swarming/staging.py
# Copyright 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. """Swarming staging recipe: runs tests for HEAD of chromium using HEAD of swarming_client toolset on Swarming staging server instances (*-dev.appspot.com). ...
Python
0.999996
@@ -3771,16 +3771,49 @@ '%5D = '1' +%0A del task.dimensions%5B'cpu'%5D %0A%0A for
9c7b79cab06a955f4f2b8909b9bd0590069ee7d7
remove pdb
temp_script/inventory.py
temp_script/inventory.py
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
Python
0.000024
@@ -2003,43 +2003,8 @@ %7B%7D%0A - import pdb; pdb.set_trace() %0A @@ -2593,44 +2593,8 @@ te:%0A - import pdb; pdb.set_trace()%0A
6722b8494a847ca62f77874f41ee47abc08c2a09
Move the images to the left
flumotion/component/converters/overlay/genimg.py
flumotion/component/converters/overlay/genimg.py
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # # flumotion/component/converters/overlay/genimg.py: overlay image generator # # Flumotion - a streaming media server # Copyright (C) 2004 Fluendo (www.fluendo.com) # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU ...
Python
0.000003
@@ -1714,17 +1714,21 @@ ) if i%5D) + - 1 %0A - %0A # T @@ -2111,32 +2111,29 @@ ph, -logos * -(WIDTH + BORDER +-width + (WIDTH*logos ), y @@ -2348,32 +2348,29 @@ cc, -logos * -(WIDTH + BORDER +-width + (WIDTH*logos ), y @@ -2611,24 +2611,13 @@ o, - -(WIDTH + BORDER) +width , y_ @@ -2780,16 +2780,16 @@ 'pn...
f66cee94d2ae4ba12cc8d56c40be0d2e07f69a5a
Tag 0.0.2
swingtix/bookkeeper/__init__.py
swingtix/bookkeeper/__init__.py
__VERSION__='0.0.1.1'
Python
0.000002
@@ -13,10 +13,23 @@ '0.0.1.1 +-29-gdc751f0M '%0A
88a7b3251d96513111e20282e840d5e0f68aa9c8
Remove unused import
InvenTree/label/apps.py
InvenTree/label/apps.py
import os import shutil import logging from django.db.utils import IntegrityError from django.apps import AppConfig from django.conf import settings logger = logging.getLogger(__name__) class LabelConfig(AppConfig): name = 'label' def ready(self): """ This function is called whenever the l...
Python
0.000001
@@ -37,51 +37,8 @@ ng%0A%0A -from django.db.utils import IntegrityError%0A from
2b05069ffb00c1174a0286b20ebef7b2914d3402
Fix python2 but
xpathwebdriver/solve_settings.py
xpathwebdriver/solve_settings.py
# -*- coding: utf-8 -*- ''' xpathwebdriver Copyright (c) 2014 Juju. Inc Code Licensed under MIT License. See LICENSE file. ''' import rel_imp; rel_imp.init() import imp import importlib import logging import json import os logger = logging.getLogger('solve_settings') class ConfigVar(object): def __init__(self,...
Python
0.000069
@@ -948,24 +948,30 @@ entials_path +.value :%0A @@ -4233,16 +4233,22 @@ rovided +empty settings @@ -4252,29 +4252,10 @@ ngs -object evals to False +%25s ', s
101dae4f5a12605a791b0f81fb2ff599cbf2facb
Return early
mir/dlsite/cmd/dlorg.py
mir/dlsite/cmd/dlorg.py
# Copyright (C) 2016, 2017 Allen Li # # 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.000233
@@ -1547,18 +1547,21 @@ -else:%0A + return 0%0A @@ -1570,36 +1570,32 @@ r r in renames:%0A - r.execut @@ -1610,28 +1610,24 @@ op_dir)%0A - - org.remove_e @@ -1650,20 +1650,16 @@ op_dir)%0A - path @@ -1700,20 +1700,16 @@ es)%0A - - with api @@ -1739,28 +1739...
6035ef056f6ca028828faad68a0a0954e581300e
Set L=4 to try other topology
ext/viro_constant.py
ext/viro_constant.py
# Manually set L L = 3 # OPERATIONS VIRO_DATA_OP = 0x0000 VIRO_DATA = 0x0802 VIRO_CONTROL = 0x0803 RDV_PUBLISH = 0x1000 RDV_QUERY = 0x2000 RDV_REPLY = 0x3000 DISCOVERY_ECHO_REQUEST = 0x4000 DISCOVERY_ECHO_REPLY = 0x5000 GW_WITHDRAW = ...
Python
0.000002
@@ -14,17 +14,17 @@ t L%0AL = -3 +4 %0A%0A# OPER
252376693ae28f901321d1141e86508d4be29a74
add iOS 7.0 DistroVersion enum
cerbero/enums.py
cerbero/enums.py
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
Python
0.000011
@@ -2536,24 +2536,48 @@ = 'ios_6_1'%0A + IOS_7_0 = 'ios_7_0'%0A ANDROID_
fd1a6abb003832919eea99fce05e06188889527c
Change the urls import line. Fix #6
cerberos/urls.py
cerberos/urls.py
# -*- coding: utf-8 -*- from django.conf.urls.defaults import * from cerberos.views import * urlpatterns = patterns('', )
Python
0.000657
@@ -42,17 +42,8 @@ urls -.defaults imp
60034bb753c96a6773ea70d37f5fa3b438f7bed8
Update Chatbot._chain_filters() and _filter_recursive() to output a dictionary filters to a list of strings a given filter passed
chatbot_brain.py
chatbot_brain.py
import nltk import random import os from nltk import pos_tag from nltk.tokenize import wordpunct_tokenize from trainbot import Trainbot import input_filters import output_filters class Chatbot(Trainbot): def __init__(self, training_file=u"tell_tale_heart.txt"): super(Chatbot, self).__init__(training_fil...
Python
0.000023
@@ -2859,38 +2859,54 @@ %22%22%22%0A -return +strings, output_dict = self._filter_re @@ -2930,16 +2930,52 @@ filters) +%0A return strings, output_dict %0A%0A de @@ -3008,32 +3008,48 @@ strings, filters +, output_dict=%7B%7D ):%0A u%22%22%22R @@ -3159,16 +3159,29 @@ strings +, outpu...
95778ca8d83a7c3b4c87cfd5b89b470abfc58f6a
support to assign version and additional filter
check_version.py
check_version.py
#!/usr/bin/env python # 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 hop...
Python
0
@@ -1566,16 +1566,21 @@ version +=None , table= @@ -1590,32 +1590,49 @@ usekeeping.repo' +, add_filter=None ):%0A # get @@ -1681,35 +1681,22 @@ -ret = self.execute( +sql = 'select @@ -1740,84 +1740,251 @@ %22%7B%7D%22 - and version=%22%7B%7D%22 order by -dt limit 1'.format(table, uuid, repoid,...
bdcdeaea6eb760d91690439da43d72ef0673df48
change replace statement
fabfile/instagram.py
fabfile/instagram.py
#!/usr/bin/env python import csv import json from fabric.api import task import requests FIELDNAMES = ['date', 'username', 'caption', 'instagram_url', 'image', 'image_url', 'embed_code', 'approved'] class Photo(object): def __init__(self, **kwargs): for field in FIELDNAMES: if kwargs[field]...
Python
0.000266
@@ -523,9 +523,9 @@ e('_ -8 +n .jpg
54282a1b7c2ea707506078483cf806e9521f264c
update version number
fabsetup/_version.py
fabsetup/_version.py
__version__ = "0.7.6"
Python
0.000002
@@ -16,7 +16,7 @@ 0.7. -6 +7 %22%0A
7bc86a2cc5edbf17ed9cd80748ffe09ce5647fec
Remove %x usage
gtk/__init__.py
gtk/__init__.py
# -*- Mode: Python; py-indent-offset: 4 -*- # pygtk - Python bindings for the GTK toolkit. # Copyright (C) 1998-2003 James Henstridge # # gtk/__init__.py: initialisation file for gtk package. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Publi...
Python
0.000001
@@ -2910,16 +2910,8 @@ n %25s - at 0x%25x %3E' %25 @@ -2928,18 +2928,8 @@ name -, id(self) )%0A @@ -4047,16 +4047,17 @@ 'gdk')%0A +%0A del _Dep
7e168cb4fbcf8c8cdca3dcf80557534f5ab647af
Remove invalid mentions from message entities (#1049)
telethon/client/messageparse.py
telethon/client/messageparse.py
import itertools import re from .users import UserMethods from .. import utils from ..tl import types class MessageParseMethods(UserMethods): # region Public properties @property def parse_mode(self): """ This property is the default parse mode used when sending messages. Defaul...
Python
0.000001
@@ -1795,16 +1795,52 @@ )%0A + return True %0A @@ -1887,12 +1887,20 @@ -pass +return False %0A%0A @@ -2346,39 +2346,79 @@ or i -, e in -enumerate(msg_entities): +reversed(range(len(msg_entities))):%0A e = msg_entities%5Bi%5D %0A @@ -2639,32 +2639,45 @@ ...
a0ac28b8d55654e6da02b96cb7c85270a3267f3d
Add links for development_status and maintainers keys
template/module/__manifest__.py
template/module/__manifest__.py
# -*- coding: utf-8 -*- # Copyright <YEAR(S)> <AUTHOR(S)> # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Module name", "summary": "Module summary", "version": "11.0.1.0.0", "development_status": "Alpha|Beta|Production/Stable|Mature", "category": "Uncategorized", "web...
Python
0
@@ -207,16 +207,77 @@ 1.0.0%22,%0A + # see https://odoo-community.org/page/development-status%0A %22dev @@ -542,24 +542,163 @@ -%22maintainers%22: %5B +# see https://odoo-community.org/page/maintainer-role for a description of the maintainer role and responsibilities%0A %22maintainers%22: %5B%22your-g...
7f63e544c914ae4f08436f64d679d6965937a43c
fix login
login.py
login.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Yuande Liu <miracle (at) gmail.com> from settings import USERNAME, PASSWORD import requests import lxml.html requests.adapters.DEFAULT_RETRIES = 3 def get_session(): """.. :py:method:: """ if not hasattr(get_session, 'session'): session = req...
Python
0.000002
@@ -1330,24 +1330,25 @@ de',%0A %7D%0A%0A +# posturl @@ -2226,32 +2226,286 @@ SSWORD%0A%0A +posturl = self.loginurl + html.cssselect('.c form%5Bmethod=post%5D')%5B0%5D.get('action')%0A%0A print('http://weibo.cn/interface/f/ttt/captcha/show.php?cpt=%7B%7D'.format(self.data%5B'capId'%5D))%0A ...
2666ccea834598a1627a34da201bce0651011303
Remove discrete variables.
Orange/projection/pca.py
Orange/projection/pca.py
import sklearn.decomposition as skl_decomposition import Orange.data from Orange.misc.wrapper_meta import WrapperMeta from Orange.projection import SklProjector, Projection __all__ = ["PCA", "SparsePCA", "RandomizedPCA", "IncrementalPCA"] class PCA(SklProjector): __wraps__ = skl_decomposition.PCA name = 'pc...
Python
0.000018
@@ -112,16 +112,57 @@ perMeta%0A +from Orange.preprocess import Continuize%0A from Ora @@ -4372,16 +4372,162 @@ .table%0A%0A + cont = Continuize(multinomial_treatment=Continuize.Remove,%0A normalize_continuous=None)%0A data = cont(data)%0A
d45a0d97b978c18bb0a40e4cec6d3dab6ec2d566
fix loading crystal.json
test/command_line/tst_refine.py
test/command_line/tst_refine.py
#!/usr/bin/env cctbx.python # # Copyright (C) (2013) STFC Rutherford Appleton Laboratory, UK. # # Author: David Waterman. # # This code is distributed under the BSD license, a copy of which is # included in the root directory of this package. # """ Test command line program dials.refine by running a job with save...
Python
0.000001
@@ -1655,16 +1655,81 @@ rt load%0A + from cctbx.crystal.crystal_model.serialize import load_crystal%0A reg_sw @@ -1806,33 +1806,33 @@ g_crystal = load -. +_ crystal(os.path. @@ -1957,17 +1957,17 @@ l = load -. +_ crystal(
eca33ec2a4307009b049e001e49329496bb0ce93
Update test_ethiopia.py
test/countries/test_ethiopia.py
test/countries/test_ethiopia.py
# -*- coding: utf-8 -*- # python-holidays # --------------- # A fast, efficient Python library for generating country, province and state # specific sets of holidays on the fly. It aims to make determining whether a # specific date is a holiday as fast and flexible as possible. # # Author: ryanss <ryanssdev@icl...
Python
0.000001
@@ -1721,16 +1721,17 @@ holidays +) %0A
e318497949a340b3b821efbc4492c8605441fa47
reformat code
flask_praetorian/constants.py
flask_praetorian/constants.py
import pendulum import enum from os.path import dirname, abspath DEFAULT_JWT_PLACES = [ 'header', 'cookie' ] DEFAULT_JWT_COOKIE_NAME = 'access_token' DEFAULT_JWT_HEADER_NAME = 'Authorization' DEFAULT_JWT_HEADER_TYPE = 'Bearer' DEFAULT_JWT_ACCESS_LIFESPAN = pendulum.duration(minutes=15) DEFAULT_JWT_REFRESH_LIFESPA...
Python
0.999729
@@ -82,21 +82,16 @@ ACES = %5B -%0A 'header' @@ -100,17 +100,16 @@ 'cookie' -%0A %5D%0ADEFAUL
028068ff338c2ac5ee2696a68a1574d84dd33900
Add Tiezi function
guba/yueping.py
guba/yueping.py
# -*- coding: utf-8 -*- import time import re from functools import * import grequests from bs4 import BeautifulSoup URL1 = 'http://guba.eastmoney.com/list,%s_1.html' URL2 = 'http://guba.eastmoney.com/list,%s_2.html' TIEZI_URL = 'http://guba.eastmoney.com/' tiezi_list = {} tiezi_ids = {} def gcr...
Python
0.000001
@@ -4269,19 +4269,25 @@ e.sleep( -300 +wait_time )%0D%0A
df3960a00760138fe3837a8fe40ef99e28a721d0
Fix SSHExecuteOperator crash when using a custom ssh port
airflow/contrib/hooks/ssh_hook.py
airflow/contrib/hooks/ssh_hook.py
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # Ported to Airflow by Bolke de Bruin # # 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
@@ -3042,16 +3042,20 @@ %5B%22-p%22, +str( self.con @@ -3060,16 +3060,17 @@ onn.port +) %5D%0A%0A
3024d4628044a22d9fc1ec0032351d1da0d4ed1a
make code more concise and fix spelling
h5py/_hl/vds.py
h5py/_hl/vds.py
# This file is part of h5py, a Python interface to the HDF5 library. # # http://www.h5py.org # # Copyright 2008-2013 Andrew Collette and contributors # # License: Standard 3-clause BSD; see "license.txt" for full license terms # and contributor agreement. """ High-level interface for creating HDF5 virtu...
Python
0.000123
@@ -1773,110 +1773,8 @@ t):%0A - if any(inp is not None%0A for inp in %5Bname, shape, dtype, maxshape%5D):%0A @@ -1814,28 +1814,24 @@ - - for k, v in%0A @@ -1830,20 +1830,16 @@ k, v in%0A - @@ -1883,20 +1883,16 @@ shape,%0A - @@ -...
ed54991dc764cb5374cc33e7b98c7284b75d4651
byte strings are byte strings
tests/hazmat/backends/test_commoncrypto.py
tests/hazmat/backends/test_commoncrypto.py
# 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, software # distributed under the...
Python
0.999999
@@ -2904,16 +2904,17 @@ hexlify( +b %221dde380 @@ -2973,16 +2973,17 @@ hexlify( +b %225053bf9 @@ -3035,16 +3035,17 @@ hexlify( +b %22f807f5f @@ -3113,16 +3113,17 @@ hexlify( +b %224bebf3f @@ -3542,16 +3542,17 @@ hexlify( +b %22e98b72a @@ -3611,16 +3611,17 @@ hexlify( +b %228b23299 @@ -3672,16 +3672,17 @@ h...
34f453262f956ae0cd9a0999e0e9f5ff798b0872
Allow a tail path to passed to create_job
tests/integration/base_integration_test.py
tests/integration/base_integration_test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2015 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 cop...
Python
0.000001
@@ -3964,16 +3964,27 @@ TestJob' +, tail=None ):%0A @@ -4334,32 +4334,160 @@ %5D%0A %7D%0A%0A + if tail:%0A body%5B'output'%5D.append(%7B%0A %22path%22: tail,%0A %22tail%22: True%0A %7D)%0A%0A job = se
6410dd998d8b65674941b3f4d217d27a8084ec25
fix commit getter
hal/cvs/gits.py
hal/cvs/gits.py
#!/usr/bin/env python # coding: utf-8 """ Handles main models in git repository """ from git import Repo from unidiff import PatchSet from hal.cvs.versioning import Version class Diff: """ Git diff result """ ADD = 'added' DEL = 'removed' def __init__(self, diff): """ :param diff...
Python
0.000001
@@ -2632,16 +2632,50 @@ anged)%0A%0A + last_commit = commit%0A%0A @@ -3680,10 +3680,18 @@ str( +Commit( last) +) %0A
0ff88a6f75072b8bed822799b5ecf5b4d3412c66
fix params
firebase/__init__.py
firebase/__init__.py
import requests import urlparse #for urlparse and urljoin import os #for os.path.dirname import json #for dumps class Firebase(): ROOT_URL = '' #no trailing slash def __init__(self, root_url, auth_token=None): self.ROOT_URL = root_url.rstrip('/') self.auth_token = auth_token #These meth...
Python
0.000004
@@ -2004,16 +2004,36 @@ ata'%5D)%0A%0A + params = %7B%7D%0A @@ -2068,24 +2068,144 @@ -kwargs%5B +if 'params' in kwargs:%0A params = kwargs%5B'params'%5D%0A del kwargs%5B'params'%5D%0A params.update(%7B 'auth' -%5D = +: sel @@ -2212,24 +2212,26 @@ f.au...
16c8d9b66b41cf5342591201c5eabe9f873b2762
Allow passing a `Region` as mask to `is_screen_black`
_stbt/black.py
_stbt/black.py
# coding: utf-8 """ Copyright 2014 YouView TV Ltd. Copyright 2014-2018 stb-tester.com Ltd. License: LGPL v2.1 or (at your option) any later version (see https://github.com/stb-tester/stb-tester/blob/master/LICENSE for details). """ import cv2 from .config import get_config from .imgutils import (crop, _frame_repr, ...
Python
0
@@ -318,21 +318,20 @@ r, load_ -i ma -ge +sk , pixel_ @@ -2450,24 +2450,69 @@ et_frame()%0A%0A + region = _validate_region(frame, region)%0A if mask @@ -2548,82 +2548,57 @@ oad_ -i ma -ge +sk (mask, -color_channels=1)%0A%0A region = _validate_region(frame, region +shape=(region.height, region.width,...
3109bd9a1d01e926e4fce3373db93db8a2d091e0
Update 4.8_subtree.py
CrackingCodingInterview/4.8_subtree.py
CrackingCodingInterview/4.8_subtree.py
""" is a a subtree of b both are bst """
Python
0
@@ -30,12 +30,735 @@ are bst%0A%22%22%22%0A +%0Aclass Node:%0A02%0A ...%0A03%0A def compare_trees(self, node):%0A04%0A %22%22%22%0A05%0A Compare 2 trees%0A06%0A %0A07%0A @param node tree's root node to compare to%0A08%0A @returns True if the tree passed is identical to this tree%0A09%...
42cefe67849fd97c52210ba750077238d938fe6a
Fix TZ issue in order_by_score
drum/links/utils.py
drum/links/utils.py
from __future__ import division, unicode_literals from re import sub, split from django.conf import settings from django.utils.timezone import now def order_by_score(queryset, score_fields, date_field, reverse=True): """ Take some queryset (links or comments) and order them by score, which is basically ...
Python
0
@@ -1035,16 +1035,137 @@ ,%0A %7D%0A + now_tz_sqls = %7B%0A %22mysql%22: %22UTC_TIMESTAMP()%22,%0A %22postgresql_psycopg2%22: %22NOW() AT TIME ZONE 'utc'%22,%0A %7D%0A db_e @@ -1281,16 +1281,90 @@ _engine) +%0A now_sql = now_tz_sqls.get(db_engine) if settings.USE_TZ else %22NOW()%22, %...
7a10f8eccc4085933fb415b59dfee41a02572d6a
Add missing imports
sqlitebiter/subcommand/_file.py
sqlitebiter/subcommand/_file.py
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import absolute_import, unicode_literals import os import stat from copy import deepcopy import msgfy import path import pytablereader as ptr import six from .._const import IPYNB_FORMAT_NAME_LIST, TABLE_NOT_F...
Python
0.000479
@@ -190,16 +190,71 @@ deepcopy +%0Afrom errno import EBADF, ENAMETOOLONG, ENOENT, ENOTDIR %0A%0Aimport
239eaf0078db0549232ef6eca54dabf75e9752c5
Remove timezone specific value
test/mitmproxy/test_examples.py
test/mitmproxy/test_examples.py
import json import os import six from mitmproxy import options from mitmproxy import contentviews from mitmproxy.builtins import script from mitmproxy.flow import master from mitmproxy.flow import state import netlib.utils from netlib import tutils as netutils from netlib.http import Headers from netlib.http import...
Python
0.668778
@@ -5114,36 +5114,5 @@ es'%5D - == %222037-08-24T05:30:00+00:00%22 %0A
a38f2690ddcc72d24ab152b0c4c21ae51db7afa0
Update evaluate_task.py
docker/evaluate_task.py
docker/evaluate_task.py
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
Python
0.000007
@@ -585,16 +585,8 @@ s a -task in BIG- @@ -591,16 +591,26 @@ G-bench +task in a docker c
e675431d8d2930ae4a110feb94990a75308695cb
Change startup sequence
svr_record.py
svr_record.py
from tkinter import * from pcf8591read import * import threading root = Tk() def testytesty(): print ('oh look we used a callback') # words from https://www.randomlists.com/random-words # reader_worker = reader.run class svr_interface(): def __init__(self): self.current = 0 self.words = ['d...
Python
0.000032
@@ -1966,16 +1966,41 @@ n = True +%0A self.r_t.start() %0A%0A @@ -2654,43 +2654,8 @@ e%5D)%0A - # self.r_t.start()%0A
10a510dc3234860c697945c8c37393a9b5790b6c
Update lims.py
access/lims.py
access/lims.py
#!/usr/bin/python #Script that connects to the MySQL database and parses data from an html table #Import the mysql.connector library/module import sys import time import glob import re import os import requests from xml.etree import ElementTree def readconfig(): configfile = os.getenv('HOME') + '/.scilifelabrc' pa...
Python
0
@@ -1616,16 +1616,410 @@ urn hit%0A + %0A def getattribute(self, searchattribute, searchvalue, attribute):%0A r = requests.get(self.uri + searchattribute + '/' + searchvalue, auth=(self.user, self.pwd))%0A tree = ElementTree.fromstring(r.text)%0A hit = %22No hit%22%0A for node in tree:%0A for key ...
c2c21fabd144ec25fa46fefdfe7c460a39aa2454
Update lims.py
access/lims.py
access/lims.py
#!/usr/bin/python #Script that connects to the MySQL database and parses data from an html table #Import the mysql.connector library/module import sys import time import glob import re import os import requests from xml.etree import ElementTree def readconfig(): configfile = os.getenv('HOME') + '/.scilifelabrc' pa...
Python
0
@@ -1864,24 +1864,41 @@ de in tree:%0A + print node%0A for ke @@ -1915,16 +1915,34 @@ attrib:%0A + print key%0A
79b119befb556b7c3665c51d8f7b7a2e25e8a220
Update rv_transformation_tests.py
GPy/testing/rv_transformation_tests.py
GPy/testing/rv_transformation_tests.py
# Written by Ilias Bilionis """ Test if hyperparameters in models are properly transformed. """ import unittest import numpy as np import scipy.stats as st import GPy class TestModel(GPy.core.Model): """ A simple GPy model with one parameter. """ def __init__(self): GPy.core.Model.__init__(s...
Python
0.000002
@@ -2185,16 +2185,17 @@ eckgrad( +1 ):%0A