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 |
|---|---|---|---|---|---|---|---|
b74a835bfc5a5686f7b0102a2ed94591e7e9c2cd | Handle unset callback function in the python socket | python/Arcus/__init__.py | python/Arcus/__init__.py | import threading
import struct
import socket
import time
## Raised when an unknown message type is received.
class UnknownMessageError(Exception):
pass
## Threaded socket communication class.
#
#
class Socket(threading.Thread):
InitialState = 1
ConnectingState = 2
ConnectedState = 3
OpeningState... | Python | 0.000001 | @@ -4697,24 +4697,76 @@
_next_state%0A
+%0A if self._stateChangedCallback:%0A
@@ -4788,32 +4788,43 @@
ChangedCallback(
+self._state
)%0A%0A ## privat
@@ -6868,32 +6868,79 @@
ppend(message)%0A%0A
+ if self._messageAvailableCallback:%0A
self._me
|
c8baf23086b937a24046fd8dd0b27544dc2aadfb | Add single letter flag option to trap-images | recipes/trap-images.py | recipes/trap-images.py | #!/usr/bin/python
"""
This main recipe accepts a list of images (through images_to_process.py).
Images should be prepared with the correct keywords.
"""
from __future__ import with_statement
import sys
import os
import datetime
from pyrap.quanta import quantity
import lofarpipe.support
from lofarpipe.support.contr... | Python | 0.000001 | @@ -838,32 +838,38 @@
eld(%0A
+ '-m',
'--monitor-coor
|
3bce3110f145789818f5a85328263f55c09e0ebc | print stack trace in registering extensions | glim/app.py | glim/app.py | """
This module is responsible for instantiating a typical glim framework app.
It registers glim framework components, extensions and wsgi app.
"""
# application initiation script
import os
import sys
import traceback
from glim import Config, Log, GlimLog
from glim.utils import import_module, empty
from glim.dispa... | Python | 0 | @@ -3397,17 +3397,38 @@
g.error(
-e
+traceback.format_exc()
)%0A%0A d
|
83bd72110a39f5b5909f50ac3529c09dc9b54cd7 | Update rng.py | cogs/rng.py | cogs/rng.py | from discord.ext import commands
import random as rng
import copy
class RNG:
"""Utilities that provide pseudo-RNG."""
el_fractions=['ходоки', 'лорды', 'некрофаги', 'маги', 'хранители', 'драккны', 'забитые', 'кланы']
def __init__(self, bot):
self.bot = bot
self.el_pull = copy.copy(RNG.el_... | Python | 0.000001 | @@ -1230,17 +1230,17 @@
elf, ctx
-%D0%B1
+,
*, play
|
58a69bf2dd93027f083fe54721847c438f861f10 | Fix import of new data after rebase | statsmodels/datasets/statecrime/data.py | statsmodels/datasets/statecrime/data.py | #! /usr/bin/env python
"""Statewide Crime Data"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """Public domain."""
TITLE = """Statewide Crime Data 2009"""
SOURCE = """
All data is for 2009 and was obtained from the American Statistical Abstracts except as indicated below.
"""
DESCRSHORT = """State ... | Python | 0 | @@ -1955,12 +1955,15 @@
els.
-tool
+dataset
s im
@@ -1967,20 +1967,16 @@
import
-data
utils as
|
ea92aeed4dc606def49df643cadc696fec6452b3 | fix docstring (again) | python/mapbox_geocode.py | python/mapbox_geocode.py | import __future__
import os, sys, json
try:
# python 3
from urllib.request import urlopen as urlopen
from urllib.parse import quote_plus as quote_plus
except:
# python 2
from urllib import quote_plus as quote_plus
from urllib2 import urlopen as urlopen
def geocode(mapbox_access_token, query):
... | Python | 0 | @@ -365,36 +365,16 @@
x's
-permanent geocoding endpoint
+geocoder
.%0A
|
fa704d7eebb879dc739446c1cc811dc4cd505ae9 | Update documentation for mx.callback.Speedometer. (#6058) | python/mxnet/callback.py | python/mxnet/callback.py | # coding: utf-8
"""Callback functions that can be used to track various status during epoch."""
from __future__ import absolute_import
import logging
import math
import sys
import time
from .model import save_checkpoint
def module_checkpoint(mod, prefix, period=1, save_optimizer_states=False):
"""Callback to chec... | Python | 0 | @@ -2744,25 +2744,12 @@
%22%22%22
-Calculate and l
+L
og
+s
tra
@@ -2760,16 +2760,39 @@
g speed
+and evaluation metrics
periodic
@@ -2852,30 +2852,30 @@
int%0A
-b
+B
atch
-_
+
size of data
@@ -2906,88 +2906,126 @@
-How many batches between calculations.%0A Defaults to calculating & log... |
d6ffb7c91d3cfd9b9e0caeec41921ec3ddce6efa | rewrite custom command for django 1.10 compatibility | students/management/commands/stcount.py | students/management/commands/stcount.py | from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from students.models import Student, Group
class Command(BaseCommand):
args = '<model_name model_name ...>'
help = 'Prints to console number of students related in database.'
models = (('student', Student), (... | Python | 0.000001 | @@ -167,49 +167,8 @@
d):%0A
- args = '%3Cmodel_name model_name ...%3E'%0A
@@ -306,16 +306,102 @@
User))%0A%0A
+ def add_arguments(self, parser):%0A parser.add_argument('model', nargs='+')%0A%0A
def
@@ -495,20 +495,32 @@
name in
-args
+options%5B'model'%5D
:%0A
|
42ad2c26368dfaa19efcc5ea57902857aae3e2cf | fix horizon metrics | src/horizon/protocols.py | src/horizon/protocols.py | from twisted.internet.error import ConnectionDone
from twisted.internet.protocol import DatagramProtocol, ServerFactory
from twisted.protocols.basic import LineOnlyReceiver, Int32StringReceiver
from twisted.python import log
from utils import SafeUnpickler
from cache import MetricCache
from regexlist import WhiteList,... | Python | 0.000022 | @@ -1079,16 +1079,32 @@
emit('
+skyline.horizon.
blacklis
@@ -1193,16 +1193,32 @@
emit('
+skyline.horizon.
whiteLis
@@ -1225,17 +1225,16 @@
tRejects
-
', metri
|
454c7d322af3328279582aef629736b92c87e869 | Revert "It seems the mechanism to declare a namespace package changed." | backports/__init__.py | backports/__init__.py | # This file is part of a backport of 'lzma' included with Python 3.3,
# exposed under the namespace of backports.lzma following the conventions
# laid down here: http://pypi.python.org/pypi/backports/1.0
# Backports homepage: http://bitbucket.org/brandon/backports
# A Python "namespace package" http://www.python.org/d... | Python | 0 | @@ -399,127 +399,40 @@
py%0A%0A
-try:%0A import pkg_resources%0A pkg_resources.declare_namespace(__name__)%0Aexcept ImportError:%0A import pkgutil%0A
+from pkgutil import extend_path%0A
__pa
@@ -442,16 +442,8 @@
_ =
-pkgutil.
exte
|
d1be7f345529594ba25ed5d0f22e544735a64404 | Add a custom admin site header. | qubs_data_centre/urls.py | qubs_data_centre/urls.py | from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^api/', include('api.urls')),
url(r'^admin/', admin.site.urls),
]
| Python | 0 | @@ -69,16 +69,68 @@
admin%0A%0A
+%0Aadmin.site.site_header = 'QUBS Data Centre Admin'%0A%0A
urlpatte
|
914f95b8acc84828c8a5aea1138415542b066a62 | switch order | web3/urls.py | web3/urls.py | """web3 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | Python | 0.000005 | @@ -1137,16 +1137,26 @@
'%5Elogin/
+superuser/
$', auth
@@ -1185,16 +1185,26 @@
e='login
+_superuser
'),%0A
@@ -1212,34 +1212,24 @@
rl(r'%5Elogin/
-superuser/
$', auth_vie
@@ -1250,34 +1250,24 @@
name='login
-_superuser
'),%0A url(
|
7b6a2a9f4e24f50e1f8aaee482d4ccec4294161b | Update vso.py | tasks/vso.py | tasks/vso.py | __author__ = 'sachinpatney'
import json
import base64
from urllib.request import urlopen
from urllib.request import Request
from common import ITask
from common import BuildNotifier
from common import sync_read_status_file
from common import Timeline
from common import safe_read_dictionary
from common import Icons
fr... | Python | 0.000001 | @@ -727,47 +727,8 @@
d):%0A
- print(build%5B'status'%5D.lower())%0A
@@ -976,22 +976,29 @@
-print(
+for build in
data%5B'va
@@ -1002,26 +1002,27 @@
'value'%5D
-)%0A
+:%0A
%0A
@@ -1005,32 +1005,57 @@
lue'%5D:%0A
+ print(build%5B'status'%5D)
%0A for bui
|
242c739aa93604e6a19e115598d5c87a5cfe513c | remove unicode py2 | mpcontribs-utils/mpcontribs/io/archieml/mpfile.py | mpcontribs-utils/mpcontribs/io/archieml/mpfile.py | from __future__ import unicode_literals, print_function
import archieml, textwrap
from mpcontribs.config import mp_level01_titles, symprec, replacements
from mpcontribs.io.core.mpfile import MPFileCore
from mpcontribs.io.core.recdict import RecursiveDict, Quantity
from mpcontribs.io.core.utils import nest_dict, normali... | Python | 0.99863 | @@ -6211,63 +6211,18 @@
l =
-unicode(value) if not isinstance(value, str) else value
+str(value)
%0A
|
b8af2bcac83686a169deb631a466a75086a45904 | fix format | webserver.py | webserver.py | #!/usr/bin/env python
""" Raspberry Camera Web Server main file.
"""
#------------------------------------------------------------------------------
import web
import config
import json
import multiprocessing
import time
import shutil
import os.path
import cv2
try:
import picamera
found_picamera = True
except ... | Python | 0.00006 | @@ -1029,16 +1029,17 @@
.xml')%0A%0A
+%0A
#-------
@@ -3482,20 +3482,16 @@
ies.%22%22%22%0A
-
%0A def
@@ -3840,17 +3840,16 @@
100, 100
-
)%0A
@@ -4385,12 +4385,15 @@
(x,
+
y,
+
w,
+
h) i
@@ -4443,16 +4443,17 @@
img, (x,
+
y), (x+w
@@ -4453,16 +4453,17 @@
), (x+w,
+
y+h), (2
@@ -4465,18... |
553cd2cf48ed7be12021b2d9718a1d6fa6cdd2f4 | Fix a method call to roll in reordering. | incuna_test_utils/testcases/integration.py | incuna_test_utils/testcases/integration.py | from django.core.exceptions import ImproperlyConfigured
from django.shortcuts import render
from .request import BaseRequestTestCase
class BaseIntegrationTestCase(BaseRequestTestCase):
"""
A TestCase that operates similarly to a Selenium test.
Contains methods that access pages and render them to string... | Python | 0 | @@ -3017,16 +3017,25 @@
ss_view(
+request,
*view_ar
@@ -3041,25 +3041,8 @@
rgs,
- request=request,
**v
|
b2270d751146ed8f27a0d0cc85a10a15ea28dab3 | Fix float to byte conversion. | avena/np.py | avena/np.py | #!/usr/bin/env python
import numpy
import sys
_eps = 10.0 * sys.float_info.epsilon
# Map of NumPy array type strings to types
_np_dtypes = {
'int8': numpy.int8,
'int16': numpy.int16,
'int32': numpy.int32,
'int64': numpy.int64,
'uint8': numpy.uint8,
'uint16': numpy.uint16,
... | Python | 0 | @@ -692,21 +692,21 @@
y):%0A
-uint8
+float
_array =
@@ -716,91 +716,78 @@
mpy.
-empty(array.shape, dtype=numpy.uint8)%0A numpy.around(array * 255, out=uint8_array
+around(array * 255.0)%0A uint8_array = float_array.astype(numpy.uint8
)%0A
|
2b21a07ad1a26f7006809936e5a58e5af710f61b | bump version: 1.0.1 | admin_footer/__init__.py | admin_footer/__init__.py | # Copyright Collab 2015-2016
# See LICENSE for details.
"""
`django-admin-footer` application.
"""
from __future__ import unicode_literals
#: Application version.
__version__ = (1, 0, 0)
def short_version(version=None):
"""
Return short application version. For example: `1.0.0`.
"""
v = version or... | Python | 0.000002 | @@ -181,17 +181,17 @@
(1, 0,
-0
+1
)%0A%0A%0Adef
|
64619c465378ee34299961a225f0a3efc22c3d41 | Remove unused import. | app/handlers/tests/test_stats_handler.py | app/handlers/tests/test_stats_handler.py | # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be usefu... | Python | 0 | @@ -772,20 +772,8 @@
on%0A%0A
-import mock%0A
impo
|
62af60d69a8a3eeb5bc70c80a3a8dc2d863a62b1 | fix empty password registrations. | modules/websession/lib/webaccount_forms.py | modules/websession/lib/webaccount_forms.py | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012, 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your opt... | Python | 0 | @@ -4443,32 +4443,202 @@
pass%0A%0A
+ def validate_password(self, field):%0A if len(field.data) %3C= 6:%0A raise validators.ValidationError(_(%22Password must be at least 6 characters long.%22))%0A%0A
def validate
|
9968247d4a73549f1c5b02abf8976f11662b46f7 | Add a default logger. Specifically log repeated regulation node labels | regcore/settings/base.py | regcore/settings/base.py | """Base settings file; used by manage.py. All settings can be overridden via
local_settings.py"""
import os
from django.utils.crypto import get_random_string
INSTALLED_APPS = [
'haystack',
'regcore',
'regcore_read',
'regcore_write',
'south'
]
SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', get_... | Python | 0 | @@ -1091,16 +1091,469 @@
%7D%0A%7D%0A%0A
+LOGGING = %7B%0A 'version': 1,%0A 'disable_existing_loggers': False,%0A 'handlers': %7B%0A 'console': %7B%0A 'level': 'INFO',%0A 'class': 'logging.StreamHandler',%0A %7D%0A %7D,%0A 'loggers': %7B%0A '': %7B%0A ... |
16eda1aac6183f612c678ae555367113f1326c0a | Mark upcoming release number. | registration/__init__.py | registration/__init__.py | VERSION = (2, 1, 2, 'final', 0)
def get_version():
"""
Returns a PEP 386-compliant version number from VERSION.
"""
assert len(VERSION) == 5
assert VERSION[3] in ('alpha', 'beta', 'rc', 'final')
# Now build the two parts of the version number:
# main = X.Y[.Z]
# sub = .devN - for pre... | Python | 0 | @@ -11,20 +11,20 @@
(2,
-1, 2, 'final
+2, 0, 'alpha
', 0
|
cdb1af30a0f48adcb7d94b444642f5a43f5905dd | Make release-notes update timing configurable | bin/cron.py | bin/cron.py | #!/usr/bin/env python
from __future__ import print_function, unicode_literals
import datetime
import os
import sys
from subprocess import check_call
import requests
from apscheduler.schedulers.blocking import BlockingScheduler
from decouple import config
from pathlib2 import Path
schedule = BlockingScheduler()
DEA... | Python | 0 | @@ -375,16 +375,101 @@
ault='')
+%0AREL_NOTES_UPDATE_MINUTES = config('REL_NOTES_UPDATE_MINUTES', default='5', cast=int)
%0A%0A# ROOT
@@ -2930,17 +2930,40 @@
minutes=
-5
+REL_NOTES_UPDATE_MINUTES
)%0A de
|
18e4e457752051dc4d5f57e78e83572638c4fe62 | Refactor syncdb replacement. Clone existing schemata if they don't exist at syncdb time. | multi_schema/management/commands/syncdb.py | multi_schema/management/commands/syncdb.py | from django.core.management.commands import syncdb
from django.db import models, connection, transaction
try:
from south.management.commands import syncdb
except ImportError:
pass
class Command(syncdb.Command):
def handle_noargs(self, **options):
cursor = connection.cursor()
# Ensu... | Python | 0 | @@ -183,16 +183,63 @@
pass%0A%0A
+from ...models import Schema, template_schema%0A%0A
class Co
@@ -305,53 +305,8 @@
s):%0A
- cursor = connection.cursor() %0A
@@ -361,247 +361,37 @@
-cursor.execute(%22SELECT schema_name FROM information_schema.schemata WHERE schema_name = '__template__';%2... |
2665aa46702175a0d33ae76cfccdbbbddf42d316 | Allow for comments in the sql file that do not start the line. | multi_schema/management/commands/syncdb.py | multi_schema/management/commands/syncdb.py | import os.path
from django.core.management.commands import syncdb
from django.db import models, connection, transaction
try:
from south.management.commands import syncdb
except ImportError:
pass
from ...models import Schema, template_schema
class Command(syncdb.Command):
def handle_noargs(self, **option... | Python | 0 | @@ -586,16 +586,24 @@
f not x.
+strip().
startswi
|
74f016d343fe270ab3affe79cc82266d94120e5c | Remove now unused pick_server_from_list | synapse/http/federation/srv_resolver.py | synapse/http/federation/srv_resolver.py | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2019 New Vector Ltd
#
# 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 | @@ -1516,1011 +1516,8 @@
)%0A%0A%0A
-def pick_server_from_list(server_list):%0A %22%22%22Randomly choose a server from the server list%0A%0A Args:%0A server_list (list%5BServer%5D): list of candidate servers%0A%0A Returns:%0A Tuple%5Bbytes, int%5D: (host, port) pair for the chosen server%0A %... |
e2555422c12f0b4cf59d8c636a087eddc3150948 | allow CR | anaconda_verify/utils.py | anaconda_verify/utils.py | import sys
import collections
from anaconda_verify.const import MAGIC_HEADERS, DLL_TYPES
def get_object_type(data):
head = data[:4]
if head not in MAGIC_HEADERS:
return None
lookup = MAGIC_HEADERS.get(head)
if lookup == 'DLL':
pos = data.find('PE\0\0')
if pos < 0:
... | Python | 0.00006 | @@ -711,13 +711,19 @@
(n
-== 10
+in (10, 13)
or
|
cdefb28463a90be54b3b77f1d6d76fb8a2201da9 | Update models.py | analytics_kits/models.py | analytics_kits/models.py | from __future__ import unicode_literals
from django.db import models
from django.apps import apps
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
from django.utils.translation import ugettext_lazy as _
import logging
# A model to save absol... | Python | 0 | @@ -2572,16 +2572,82 @@
views%22%0A%0A
+ @staticmethod%0A def get_results_count():%0A return 50%0A%0A
@sta
|
04a3544a6bc9d9d02c4f7d5f1ba2168a45807f83 | Version bump | pushjournal/__version__.py | pushjournal/__version__.py | __version__ = "0.1.1"
| Python | 0.000001 | @@ -14,9 +14,9 @@
%220.
-1.1
+2.0
%22%0A
|
9382b15993bd8a77ab35cbec8e1f8d2304513c5d | remove attrname doc | pyardrone/navdata/types.py | pyardrone/navdata/types.py | import collections
import functools
import io
import itertools
import struct
import types
from pyardrone.utils.dochelper import DocFile
def _grouper(iterable, n, fillvalue=None):
"Collect data into fixed-length chunks or blocks"
# grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx"
args = [iter(iterable)] * n
... | Python | 0.000001 | @@ -4382,135 +4382,8 @@
t%60%60.
-%0A%0A .. py:data:: attrname%0A%0A The attribute name the get this option from%0A :py:class:%60~pyardrone.navdata.NavData%60
%0A
|
20260402fcdab75ddc98c6ad91c412e8a5fe8d01 | add test for empty functions | pychecker2/utest/unused.py | pychecker2/utest/unused.py | from pychecker2.TestSupport import WarningTester
from pychecker2 import VariableChecks
class UnusedTestCase(WarningTester):
def testUnusedBasic(self):
self.warning('def f(i, j): return i * 2\n',
1, VariableChecks.UnusedCheck.unused, 'j')
self.warning('def _unused(): pass\n',
... | Python | 0.000003 | @@ -2267,16 +2267,106 @@
ed, 'c')
+%0A self.silent('def f(a):%5Cn'%0A ' %22this is an empty function%22%5Cn')
%0A%0A
|
bfaa56817fddbe698d2fe29268185ec6dff5dbe4 | Remove two more items from drop-down list | pycon/sponsorship/forms.py | pycon/sponsorship/forms.py | from django import forms
from django.contrib.admin.widgets import AdminFileWidget
from django.forms.models import inlineformset_factory, BaseInlineFormSet
from django.utils.translation import ugettext_lazy as _
from multi_email_field.forms import MultiEmailField
from pycon.sponsorship.models import Sponsor, SponsorBe... | Python | 0.000003 | @@ -1843,16 +1843,30 @@
eryset =
+ (%0A
Sponsor
@@ -1878,25 +1878,16 @@
.objects
-.exclude(
%0A
@@ -1887,24 +1887,33 @@
+.exclude(
name='Open S
@@ -1933,25 +1933,52 @@
munity')
-.exclude(
+%0A .exclude(name='Patron')
%0A
@@ -1978,24 +1978,33 @@
+.e... |
f3be5abebca4cdb83cc23cf765c94ae25adfa8e6 | Fix a typo | pytablereader/ltsv/core.py | pytablereader/ltsv/core.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
import io
import pathvalidate as pv
import typepy
from pytablereader import DataError, InvalidHeaderNameError
from .._common import get_file_encoding
from .._constant i... | Python | 1 | @@ -1560,18 +1560,18 @@
nvalid l
-s
t
+s
v item f
|
57431b251ec17a13e42cd29640da0fbe2e949cf2 | Update version to 0.0.1 | qdarkgraystyle/__init__.py | qdarkgraystyle/__init__.py | # -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) <2013-2014> <Colin Duquesnoy>
# Copyright (c) <2017> <Michell Stuttgart>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software ... | Python | 0 | @@ -1416,13 +1416,13 @@
= '
-1.0.0
+0.0.1
'%0A%0A%0A
|
d4ff0f80f065b6f3efa79a5cf17bc4e81a6bb6f2 | Add TODO comment. | qipipe/staging/__init__.py | qipipe/staging/__init__.py | """
Image processing preparation.
The staging package defines the functions used to prepare the study image files
for import into XNAT, submission to the TCIA QIN collections and pipeline
processing.
"""
# The ohsu module creates the OHSU QIN collections.
# TODO - this should be a config item.
from . import ohsu
| Python | 0 | @@ -200,16 +200,23 @@
.%0A%22%22%22%0A%0A#
+ OHSU -
The ohs
|
db608f092192aa9552e5e75096ab4cb11323a8df | use slice | chainercv/datasets/cub/cub_keypoint_dataset.py | chainercv/datasets/cub/cub_keypoint_dataset.py | import collections
import numpy as np
import os
from chainercv.datasets.cub.cub_utils import CUBDatasetBase
from chainercv import utils
class CUBKeypointDataset(CUBDatasetBase):
"""`Caltech-UCSD Birds-200-2011`_ dataset with annotated keypoints.
.. _`Caltech-UCSD Birds-200-2011`:
http://www.vision... | Python | 0.000033 | @@ -4039,36 +4039,16 @@
%5D -
-np.array(%5Bbbox%5B0%5D, bbox%5B1%5D%5D)
+bbox%5B:2%5D
%0A%0A
|
082b1f542501b6f3ae496fb3fe50c9e50d770b2f | Update godeps to github | git_gate.py | git_gate.py | #!/usr/bin/python
"""Merge gating script for git go projects."""
from __future__ import print_function
import argparse
import os
import subprocess
import sys
from utility import (
print_now,
temp_dir,
)
class SubcommandError(Exception):
def __init__(self, command, subcommand, error):
self.comm... | Python | 0 | @@ -1623,37 +1623,43 @@
-v%22, %22-d%22, %22
-launchpad.net
+github.com/rogpeppe
/godeps/...%22
@@ -1687,21 +1687,27 @@
%22, %22
-launchpad.net
+github.com/rogpeppe
/god
|
0d0041678b598e623b3479942c3dd4fc23c5ab23 | Upgrade Pip | perfkitbenchmarker/linux_packages/pip.py | perfkitbenchmarker/linux_packages/pip.py | # Copyright 2014 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Python | 0 | @@ -889,16 +889,86 @@
n-pip')%0A
+ vm.RemoteCommand('sudo pip install -U pip') # Make pip upgrade pip%0A
vm.Rem
|
43ce3068d8ca97aef018caf2b53eea018e7e447e | Fix typo | nupic/research/frameworks/pytorch/lr_scheduler.py | nupic/research/frameworks/pytorch/lr_scheduler.py | # Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2019, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it unde... | Python | 0.99232 | @@ -4948,17 +4948,17 @@
update i
-s
+f
OneCycl
|
d25bfd459bfc03ea7a3a84a26d80b9db8036c168 | Add new NAMES_TO_EDITIONS mapping | reporters_db/__init__.py | reporters_db/__init__.py | import datetime
import json
import os
import six
from .utils import suck_out_variations_only
from .utils import suck_out_editions
# noinspection PyBroadException
def datetime_parser(dct):
for k, v in dct.items():
if isinstance(v, six.string_types):
try:
dct[k] = datetime.dateti... | Python | 0.000002 | @@ -74,60 +74,58 @@
out_
-variations_only%0Afrom .utils import suck_out_editions
+editions, suck_out_names, suck_out_variations_only
%0A%0A%0A#
@@ -404,16 +404,17 @@
rn dct%0A%0A
+%0A
db_root
@@ -906,20 +906,66 @@
editions(REPORTERS)%0A
+NAMES_TO_EDITIONS = suck_out_names(REPORTERS)%0A
|
bffdc451e8dc9df2219158349b60f082ab087a27 | add proposal pk to serializer to give votes unique id | meinberlin/apps/budgeting/serializers.py | meinberlin/apps/budgeting/serializers.py | from rest_framework import serializers
from adhocracy4.categories.models import Category
from .models import Proposal
class CategoryField(serializers.Field):
def to_internal_value(self, category):
if category:
return Category.objects.get(pk=category)
else:
return None
... | Python | 0 | @@ -1017,16 +1017,22 @@
', 'url'
+, 'pk'
)%0A
@@ -1276,16 +1276,22 @@
'url'
+, 'pk'
)%0A%0A d
|
4715f20655bd0cfac5f2cfad43ae09d600deb4bf | Raise exceptions on unimplemented statements | raco/myrial/interpreter.py | raco/myrial/interpreter.py | #!/usr/bin/python
import raco.myrial.parser as parser
import raco.algebra
import raco.expression as colexpr
import raco.catalog
import collections
import random
import sys
import types
class ExpressionProcessor:
'''Convert syntactic expressions into a relational algebra operation'''
def __init__(self, symbol... | Python | 0.000002 | @@ -5092,36 +5092,59 @@
, _id):%0A
-pass
+raise NotImplementedError()
%0A%0A def descri
@@ -5166,20 +5166,43 @@
-pass
+raise NotImplementedError()
%0A%0A de
@@ -5262,9 +5262,32 @@
-pass
+raise NotImplementedError()
%0A
|
655134fa5bebdc86985fd40ec770153bf133f362 | Handle case where value is an empty string | IPython/nbconvert/exporters/exporter.py | IPython/nbconvert/exporters/exporter.py | """This module defines a base Exporter class. For Jinja template-based export,
see templateexporter.py.
"""
from __future__ import print_function, absolute_import
import io
import os
import copy
import collections
import datetime
from IPython.config.configurable import LoggingConfigurable
from IPython.config import... | Python | 0.001642 | @@ -971,24 +971,34 @@
%0A if
+value and
not value.st
|
b8fb50f9f1b7c85811ed3550418eae2b72d30faf | Add index | radar/radar/models/logs.py | radar/radar/models/logs.py | from datetime import datetime
from sqlalchemy import event, DDL, Column, Integer, DateTime, String, text
from sqlalchemy.dialects import postgresql
from sqlalchemy.orm import relationship
from radar.database import db
class Log(db.Model):
__tablename__ = 'logs'
id = Column(Integer, primary_key=True)
da... | Python | 0.000017 | @@ -98,16 +98,23 @@
ng, text
+, Index
%0Afrom sq
@@ -782,16 +782,50 @@
JSONB)%0A%0A
+Index('logs_date_idx', Log.date)%0A%0A
%0Adef log
|
fcafa9704003c300be3486584773a0b13a057460 | Fix Flakes Errors: openspending/ui/test/functional/test_dimension.py | openspending/ui/test/functional/test_dimension.py | openspending/ui/test/functional/test_dimension.py | import json
from .. import ControllerTestCase, url, helpers as h
from openspending.ui.lib.helpers import member_url
from openspending.model import Dataset, CompoundDimension, meta as db
class TestDimensionController(ControllerTestCase):
def setup(self):
super(TestDimensionController, self).setup()
... | Python | 0.000046 | @@ -171,20 +171,8 @@
sion
-, meta as db
%0A%0A%0Ac
|
628655791fc41e5496dd8bed05beb232d7c0d104 | Store calculated intermediate values and use them for inheritance | UM/Settings/SettingOverrideDecorator.py | UM/Settings/SettingOverrideDecorator.py | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
from UM.Signal import Signal, SignalEmitter
from UM.Application import Application
from copy import deepcopy
## A decorator that can be used to override indiv... | Python | 0 | @@ -513,24 +513,56 @@
alues = %7B%7D%0A%0A
+ self._temp_values = %7B%7D%0A%0A
settingA
@@ -743,24 +743,35 @@
f):%0A
+self._temp_
values = %7B%7D%0A
@@ -1047,32 +1047,43 @@
+self._temp_
values%5Bkey%5D = se
@@ -1164,16 +1164,27 @@
+self._temp_
values%5Bk
@@ -1216,24 +... |
9df2420f152e48a0e99598220e4560fe25c9fd36 | add an argument to TblTreeEntries.__init__() | AlphaTwirl/HeppyResult/TblTreeEntries.py | AlphaTwirl/HeppyResult/TblTreeEntries.py | # Tai Sakuma <tai.sakuma@cern.ch>
from ..mkdir_p import mkdir_p
from ..listToAlignedText import listToAlignedText
import os
import ROOT
##__________________________________________________________________||
class TblTreeEntries(object):
def __init__(self, analyzerName, fileName, treeName, outPath):
self.an... | Python | 0.000551 | @@ -295,16 +295,34 @@
outPath
+, columnName = 'n'
):%0A
@@ -490,19 +490,26 @@
onent',
-'n'
+columnName
%5D%5D%0A%0A
|
1fcaeb69048a5124ad2a74ce8761685e2d76a360 | normalize elem start in wp_parser.py | wp_parser.py | wp_parser.py | """
parse data from huge Wikipedia XML Dump
"""
__author__ = "siznax"
__verion__ = "29 Sep 2015"
class WPParser:
MAX_ELEM_BYTES = 1024**2
_ebfr = ""
_found_end = False
_found_start = False
_sbfr = ""
elem = ""
elems_found = 0
elems_processed = 0
def __init__(self, start="<page>"... | Python | 0.000013 | @@ -7,16 +7,36 @@
rse data
+ (naive & wreckless)
from hu
@@ -1399,16 +1399,23 @@
f.elem =
+ %22 %22 +
self.st
|
6b38f0c872e17ec9869f0c62c886fbbc133a9599 | Customize tag rendering | barpyrus.py | barpyrus.py | import sys
import contextlib
from barpyrus import hlwm
from barpyrus import widgets as W
from barpyrus.core import Theme
from barpyrus import lemonbar
from barpyrus import conky
@contextlib.contextmanager
def maybe_orange(match, predicate='> 90'):
with cg.if_('match ${%s} %s' % (match, predicate)):
cg.fg... | Python | 0 | @@ -114,16 +114,25 @@
rt Theme
+, Painter
%0Afrom ba
@@ -362,16 +362,768 @@
None)%0A%0A%0A
+def underlined_tags(taginfo, painter):%0A if taginfo.empty:%0A return%0A painter.set_flag(painter.underline, True if taginfo.visible else False)%0A painter.fg('#a0a0a0' if taginfo.occupied else '#909090')%0A ... |
daf61b55beea74b516a249db8e963b803621cab8 | Version bump (0.3.3) | requestbuilder/__init__.py | requestbuilder/__init__.py | # Copyright (c) 2012-2015, Eucalyptus Systems, Inc.
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHO... | Python | 0 | @@ -852,17 +852,17 @@
= '0.3.
-1
+3
'%0A%0A%0Aif '
|
dab6d148e90ebf99287db870387361a53d4bef14 | add magic for 'clone_gist' | lib/plugins/git_completers.py | lib/plugins/git_completers.py | """ git_completers
WARNING:
most of this stuff fails silently and ipython mangles scope on the hooks
you register, so for instance DO NOT attempt to abstract local variables
out of your handle functions unless you really know what you're doing.
no idea wtf ipython does that or how to work a... | Python | 0.000002 | @@ -869,16 +869,48 @@
on.ipapi
+%0Afrom IPython.macro import Macro
%0A%0Afrom s
@@ -997,16 +997,258 @@
Plugin%0A%0A
+def clone_gist(parameter_s=''):%0A cmd = 'git clone git@gist.github.com:%7B0%7D.git %7B1%7D'%0A args = parameter_s.split()%0A assert args%0A if len(args)==1: args+=%5B''%5D%0A cmd = cm... |
0de57c0c14362d2f9c40975326c8cb1bf792e2a0 | make compiled dir | binding.gyp | binding.gyp | {
'targets': [
{
'target_name': 'chimera',
'sources': [
'src/top.cc',
'src/cookiejar.cc',
'src/chimera.cc',
'src/browser.cc'
],
'conditions': [
['OS=="mac"', {
'include_dirs': [
'qt/include',
'qt/include/QtCore',
... | Python | 0 | @@ -258,32 +258,41 @@
%0A 'qt
+_compiled
/include',%0A
@@ -293,32 +293,41 @@
%0A 'qt
+_compiled
/include/QtCore'
@@ -335,32 +335,41 @@
%0A 'qt
+_compiled
/include/QtGui',
@@ -376,32 +376,41 @@
%0A 'qt
+_compiled
/include/QtNetwo
@@ -421,32 +421,41 @@
%0A ... |
20ee95f56033b5a7d9d1e5f022118850b339ace9 | remove old ssl | binding.gyp | binding.gyp | {
'targets': [
{
'target_name': 'chimera',
'sources': [
'src/top.cc',
'src/cookiejar.cc',
'src/chimera.cc',
'src/browser.cc'
],
'conditions': [
['OS=="mac"', {
'include_dirs': [
'qt_compiled/include',
'qt_compiled/in... | Python | 0.999082 | @@ -1180,111 +1180,8 @@
: %5B%0A
- '../deps/openssl/linux/lib/libssl.a',%0A '../deps/openssl/linux/lib/libcrypto.a',%0A
|
fe290c9f3edc477707e88cb5942ee6c5bd1db568 | fix the http backend -- outgoing was still busted | lib/rapidsms/backends/http.py | lib/rapidsms/backends/http.py | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import BaseHTTPServer, SocketServer
import select
import random
import re
import urllib
import httphandlers as handlers
import rapidsms
from rapidsms.backends.base import BackendBase
class HttpServer (BaseHTTPServer.HTTPServer, SocketServer.ThreadingMixIn):
... | Python | 0.000001 | @@ -877,32 +877,71 @@
ndler)%0A %0A
+ self.handler = component_class%0A
self.ser
@@ -993,16 +993,16 @@
_class)%0A
-
@@ -1162,16 +1162,258 @@
= self%0A
+ # also set it in the handler class so we can callback%0A self.handler.backend = self%0A%0A # set the slug bas... |
9f27bf690113d30228b9a5a4ef2c729ea0fe361d | Remove blank line | app/timetables/models.py | app/timetables/models.py | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.validators import MinValueValidator
from django.db import models
from django.utils.translation import ugettext_lazy as _
from common.mixins import ForceCapitalizeMixi... | Python | 0.999999 | @@ -3993,17 +3993,16 @@
ble')%0A%0A%0A
-%0A
class Me
|
47902926f56b3944dbc00f6b2871fd7f77c7c510 | Add max_limit arg | saleor/graphql/core/fields.py | saleor/graphql/core/fields.py | import json
from functools import partial
import graphene
from django_measurement.models import MeasurementField
from django_prices.models import MoneyField, TaxedMoneyField
from graphene.relay import PageInfo
from graphene_django.converter import convert_django_field
from graphene_django.fields import DjangoConnectio... | Python | 0.999444 | @@ -1701,32 +1701,48 @@
, args, iterable
+, max_limit=None
):%0A commo
@@ -6174,16 +6174,29 @@
partial(
+%0A
cls.reso
@@ -6223,24 +6223,54 @@
ection, args
+, max_limit=max_limit%0A
)%0A%0A f
|
9f53cdc4ffa2b34aae59cf9f95958aae83964e7f | Update pexels.py | postcards/plugin_pexels/util/pexels.py | postcards/plugin_pexels/util/pexels.py | import random
import requests
from bs4 import BeautifulSoup
import os
import urllib
import sys
words_location = os.path.dirname(os.path.realpath(__file__)) + '/words.txt'
pexels_search_url = 'https://www.pexels.com/search/'
headers = {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like... | Python | 0 | @@ -87,16 +87,396 @@
port sys
+%0Aimport base64%0Afrom pypexels import PyPexels%0A%0A#Decode pexels API key from abertschi%0Abase64_message = 'NTYzNDkyYWQ2ZjkxNzAwMDAxMDAwMDAxNmEzNTcyNDA4YmVjNGFmNzc0YTYzYTRjNjdjZGNkMGIK'%0Abase64_bytes = base64_message.encode('ascii')%0Amessage_bytes = base64.b64decode(base64_bytes)%0... |
6508912a20ef25f0c70b08dabe98e59964e00be7 | Add seatsAvailable to database fixture | test/base.py | test/base.py | import unittest
import datetime
from google.appengine.api import users
from google.appengine.api import memcache
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from google.appengine.datastore import datastore_stub_util
from models import (
Profile,
Conference,
Session,
)
fr... | Python | 0 | @@ -2595,16 +2595,55 @@
ays=5),%0A
+ 'seatsAvailable': 100,%0A
@@ -3564,32 +3564,69 @@
delta(days=20),%0A
+ 'seatsAvailable': 1,%0A
@@ -3641,17 +3641,17 @@
ndees':
-5
+1
,%0A
@@ -3960,32 +3960,69 @@
delta(days=10),%0A
+ 'seatsAvailable... |
7c1e5418198b848b7e35fb53c41f8b6315d2d0c8 | fix diagnostics error when default terminal width <= 80 | modules/tools/diagnostics/diagnostics.py | modules/tools/diagnostics/diagnostics.py | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | Python | 0.000001 | @@ -898,16 +898,30 @@
raceback
+%0Aimport signal
%0A%0Aimport
@@ -1467,16 +1467,493 @@
set(0)%0A%0A
+ %22%22%22%0A Workaround for issuse #1774, since we know the exactly number of the%0A columns that we used, so if the default terminal width %3C= 80, we just%0A resize the terminal to ensu... |
bf336d99484cc3804f469631b513a927940ada30 | Add scan_steps wrapper for scan_nd | profile_collection/startup/50-scans.py | profile_collection/startup/50-scans.py | # vim: sw=4 ts=4 sts expandtab smarttab
# HXN step-scan configuration
import hxntools.scans
from bluesky.global_state import get_gs
gs = get_gs()
hxntools.scans.setup()
ct = hxntools.scans.count
ascan = hxntools.scans.absolute_scan
dscan = hxntools.scans.relative_scan
fermat = hxntools.scans.relative_fermat
spiral =... | Python | 0.000001 | @@ -479,16 +479,55 @@
s.a2scan
+%0Ascan_steps = hxntools.scans.scan_steps
%0A%0Ags.DET
@@ -848,13 +848,44 @@
= %5B
+dcm, m1, m2, beamline_status,
smll,
+
vmll
|
817fbb054f7422ec8adc16f079b8f70ed2534356 | remove shebang and executable bit | bin/auth.py | bin/auth.py | #!/usr/bin/env python3
import argparse
import pathlib
import googleapiclient.discovery
import httplib2
import oauth2client.client
import oauth2client.file
import oauth2client.tools
YOUTUBE_API_SERVICE_NAME = 'youtube'
YOUTUBE_API_VERSION = 'v3'
YOUTUBE_ANALYTICS_API_SERVICE_NAME = 'youtubeAnalytics'
YOUTUBE_ANALYTIC... | Python | 0.000001 | @@ -1,28 +1,4 @@
-#!/usr/bin/env python3%0A%0A
impo
|
50c06c3e24807c57654f292eee168c544939d06d | Update ALLOWED_HOSTS | config/settings.py | config/settings.py | from datetime import time
from os import getenv
from pathlib import Path
import dj_database_url
from dotenv import load_dotenv
import tomlkit
load_dotenv()
BASE_DIR = Path(__file__).resolve().parent.parent
PYPROJECT_PATH = BASE_DIR / "pyproject.toml"
PYPROJECT = tomlkit.parse(PYPROJECT_PATH.open().read())
SECRET... | Python | 0.000001 | @@ -472,16 +472,96 @@
OSTS = %5B
+%0A getenv(%22DO_APP_HOSTNAME%22),%0A %22starminder.xyz%22,%0A %22www.starminder.xyz%22,%0A
%5D%0A%0AINSTA
|
9291d1f6ddb2fe3b89bc4cc64676a8b9e050d80e | Add hashbang | gnetplus.py | gnetplus.py | import collections
import serial
import struct
import sys
import time
class InvalidMessage(Exception):
pass
class Message(object):
"""
Base message class for representing a message
"""
SOH = 0x01
def __init__(self, address, function, data):
self.address = address
self.funct... | Python | 0.000426 | @@ -1,12 +1,31 @@
+#!/usr/bin/python%0A%0A
import colle
|
d2d8645e1c704fd956df15481fe3dd38e84bd07b | Disable caching for the time being | server.py | server.py | import os
import json
import logging
from datetime import timedelta
from operator import itemgetter
from itertools import groupby
from collections import namedtuple
import flask
from arrow import Arrow
import dateutil.tz as dateutil_tz
from arrow import get as get_date
from arrow.parser import ParserError
from flask i... | Python | 0 | @@ -2157,16 +2157,18 @@
te):%0A
+ #
res = c
@@ -2183,24 +2183,48 @@
t_for(date)%0A
+ res = get_for(date)%0A
if not r
|
0f518f87e7e2af5d93481704c2430255373a4965 | fix a typo. | governor.py | governor.py | #!/usr/bin/env python
import logging
import os
import sys
import time
import yaml
from helpers.api import RestApiServer
from helpers.etcd import Etcd
from helpers.postgresql import Postgresql
from helpers.ha import Ha
from helpers.utils import setup_signal_handlers, sleep
import helpers.aws import AWSConnection
clas... | Python | 0.03285 | @@ -267,22 +267,20 @@
, sleep%0A
-import
+from
helpers
|
b4c73590db66c6731067995881b70dc4883ff65d | The previous fix was wrong | src/tn/plonemailing/message_factory.py | src/tn/plonemailing/message_factory.py | from email import message
from email import utils
from five import grok
from tn.plonemailing import interfaces
from zope.component import getMultiAdapter
import quopri
import email.header
import os
import random
import re
import time
class BaseMessageFactory(object):
def __init__(self, context, request, newslett... | Python | 0.999899 | @@ -663,22 +663,18 @@
return m
-essage
+sg
%0A%0A%0Aclass
@@ -907,34 +907,38 @@
_message(self, m
-sg
+essage
, content):%0A
@@ -1095,34 +1095,38 @@
m
-sg
+essage
,%0A
@@ -1414,18 +1414,22 @@
(self, m
-sg
+essage
, conten
@@ -1675,18 +1675,22 @@
m
-sg
+essage
,%0A
|
02abfa1d68239b2b2d20420ecae77c2388a96416 | use separate variable for type purposes | mythril/laser/smt/independence_solver.py | mythril/laser/smt/independence_solver.py | import z3
from mythril.laser.smt.model import Model
from mythril.laser.smt.bool import Bool
from typing import Set, Tuple, Dict, List, cast
def _get_expr_variables(expression: z3.ExprRef) -> List[z3.ExprRef]:
"""
Gets the variables that make up the current expression
:param expression:
:return:
"... | Python | 0 | @@ -3486,32 +3486,36 @@
%22%22%22%0A
+raw_
constraints = %5Bc
@@ -3505,32 +3505,45 @@
_constraints = %5B
+%0A
c.raw for c in c
@@ -3563,32 +3563,67 @@
l%5D, constraints)
+%0A %5D # type: List%5Bz3.BoolRef
%5D%0A self.c
@@ -3632,32 +3632,36 @@
straints.extend(
+raw_
constra... |
3453e903a50859c596c0997e87b62fb0f54d6d56 | add inchi_lock.cc | binding.gyp | binding.gyp | {
"target_defaults": {
"conditions": [
['OS=="win"', {
}, {
'cflags' : [ "-fexceptions" ],
'cflags_cc' : [ "-fexceptions" ]
} ]
],
"configurations": {
"Release": {
'msvs_settings': {
'VCCLCompilerTool': {
'WholeProgramOptimization': ... | Python | 0.000001 | @@ -1670,32 +1670,61 @@
from_inchi.cc%22,%0A
+ %22src/inchi_lock.cc%22,%0A
%22src/get
@@ -2285,32 +2285,61 @@
inchi_data.cc%22,%0A
+ %22src/inchi_lock.cc%22,%0A
%22src/inc
|
a292e1fe8ec72355ce2bb3c1f99dd82d6f145438 | Add path to homebrew-installed pkgconfig for Mac OS 10.8 (10.9 is symlinked to 10.8) #9 | binding.gyp | binding.gyp | {
'targets': [{
'target_name': 'sharp',
'sources': ['src/sharp.cc'],
'libraries': [
'<!@(PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" pkg-config --libs vips)',
'<!@(PKG_CONFIG_PATH="/usr/lib/pkgconfig" pkg-config --libs vips)'
],
'include_dirs': [
'/usr/local/include/glib-2.0',
... | Python | 0.000001 | @@ -130,19 +130,27 @@
r/local/
-l
+L
ib
+rary/ENV
/pkgconf
@@ -155,64 +155,39 @@
nfig
-%22
+/10.8:/usr/local/lib/
pkg
--
config
- --libs vips)',%0A '%3C!@(PKG_CONFIG_PATH=%22
+:
/usr
|
169a60075d37f37b0ac55e7ce26ba62e87baf913 | Add --tag options | bin/alloccli/tasks.py | bin/alloccli/tasks.py | """alloccli subcommand for viewing a list of tasks."""
from alloc import alloc
class tasks(alloc):
"""Print a list of tasks."""
# Setup the options that this cli can accept
ops = []
ops.append(('' , 'help ', 'Show this help.'))
ops.append(('' , 'csv=[WHEN] ', 'Return the results in CSV forma... | Python | 0 | @@ -526,32 +526,81 @@
roject name.'))%0A
+ ops.append(('g:', 'tag=TEXT ', 'A tag'))%0A
ops.append(('t
@@ -3100,16 +3100,56 @@
%5B'type'%5D
+%0A if o%5B'tag'%5D: ops%5B'tags'%5D = o%5B'tag'%5D
%0A%0A #
@@ -3775,16 +3775,24 @@
askName%22
+, %22tags%22
%5D%0A el
|
2553c362d0fe52440a3ee3bc3a5603842c524baa | Modify corresponding bindings | binding.gyp | binding.gyp | {
"targets":
[
{
"variables":
{
"variables":
{
"conditions":
[
[ "OS=='linux'", { "gcc":"<!(gcc --version 2>&1 | head -1 | sed -e 's/^.*(.*) \(.*\)\..*$/\\1/')" } , { "gcc":"" } ]
],
"juliaBase":"<!(python tools/nj_conf... | Python | 0.000004 | @@ -421,21 +421,22 @@
%22
-njLib
+NJ_LIB
%22:%22%3C!(py
@@ -469,16 +469,15 @@
OS)
-cwd)/
+nj_
lib
+)
%22,%0A
@@ -1764,13 +1764,14 @@
=%22%3C(
-njLib
+NJ_LIB
)%22',
|
88021aeb5e7c4d0f3a50333b3f77624ac718c03c | Use `ASM` mode on the linux + non glibc environ | binding.gyp | binding.gyp | {
'target_defaults': {
'default_configuration': 'Release',
'configurations': {
'Release': {
'cflags': [ '-O3' ],
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '3',
'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
},
'msvs_settings': {
'VCCLCompilerTool': {
'Optimization': 3,
'F... | Python | 0.000002 | @@ -826,20 +826,330 @@
%22linux%22
- or
+',%0A%09%09%09%09%09%7B%0A%09%09%09%09%09%09'variables': %7B%0A%09%09%09%09%09%09%09'USE_GLIBC': '%3C!(ldd --version 2%3E&1 %7C head -n 1 %7C grep -i %22glibc%22 %7C wc -l)',%0A%09%09%09%09%09%09%7D,%0A%09%09%09%09%09%09'conditions': %5B%0A%09%09%09%09%09%09%09%5B'%3C(USE_GLI... |
e68f66043b2770aa782d2d7d293de281527d1891 | test travis | binding.gyp | binding.gyp | {
"targets": [
{
"target_name": "addon",
"sources": [
"src/addon.cc",
"src/object.cc",
"src/async.cc",
"src/engine.cc",
"src/results.cc"
],
#"cflags": [ "-Werror", "-Wall", "-Wextra", "-Wpedantic", "-Wunused-parameter", "-funroll-loops", "-Ofast" ],#targets all... | Python | 0.000002 | @@ -600,32 +600,39 @@
nused-parameter%22
+, %22-O3%22
%5D,%0A %22cflags
|
92014a41831b6096e50103724e64a8991b68877e | Update the version to 1.0.0 | src/pymage_downloader.py | src/pymage_downloader.py | #!/usr/bin/python3
import glob
import logging
import os
import sys
from argparse import ArgumentParser
import praw
import requests
from exceptions.pymage_exceptions import NotAbleToDownloadException
from parsers.parser_factory import ParserFactory
LOGGER = logging.getLogger(__name__)
VERSION = "0.0.1"
def main():... | Python | 0.000017 | @@ -297,13 +297,13 @@
= %22
+1.
0.0
-.1
%22%0A%0A%0A
|
db1ea244ad057934d63ac0537085a40ee5122299 | Remove unused ctypes import | convertbng/util.py | convertbng/util.py | # -*- coding: utf-8 -*-
"""
util.py
Created by Stephan Hügel on 2015-06-22
This file is part of convertbng.
The MIT License (MIT)
Copyright (c) 2015 Stephan Hügel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to de... | Python | 0 | @@ -1236,18 +1236,8 @@
oat,
- c_double,
Str
|
6a6fd6a23b811421e68640d78f655ac2eb16f584 | Add DBus lib | binding.gyp | binding.gyp | {
'variables': {
'rm' : '<!(node -e "require(\'addon-tools-raub\').rm()")',
'cp' : '<!(node -e "require(\'addon-tools-raub\').cp()")',
'mkdir' : '<!(node -e "require(\'addon-tools-raub\').mkdir()")',
'binary' : '<!(node -e "require(\'addon-tools-raub\').bin()")',
'qml... | Python | 0 | @@ -1214,93 +1214,8 @@
)',%0A
-%09%09%09%09%09%09%09'%3C(qt_core_bin)/libQt5Core.so.5',%0A%09%09%09%09%09%09%09'%3C(qt_core_bin)/libQt5Network.so.5',%0A
%09%09%09%09
@@ -1446,32 +1446,158 @@
ibicutu.so.56',%0A
+%09%09%09%09%09%09%09'%3C(qt_core_bin)/libQt5Core.so.5',%0A%09%09%09%09%09%09%09'%3C(qt_core_bin)/libQt5Ne... |
73c8378f91687abfb58a8a964c2e5664b3e4c096 | Fix ordinal naming | angr/procedures/win32/dynamic_loading.py | angr/procedures/win32/dynamic_loading.py | import angr
import claripy
import logging
l = logging.getLogger('angr.procedures.win32.dynamic_loading')
class LoadLibraryA(angr.SimProcedure):
def run(self, lib_ptr):
lib = self.state.mem[lib_ptr].string.concrete
return self.load(lib)
def load(self, lib):
if '.' not in lib:
... | Python | 0.999575 | @@ -1798,19 +1798,38 @@
l.%25d
+.%25s
' %25
+(
ordinal
+, obj.provides)
%0A
@@ -3044,8 +3044,9 @@
return x
+%0A
|
16b19a2635a3c1e3ae6ace2204b7a39b94dd76fc | Bump minimum macOS version to 10.15 (latest maintained). | binding.gyp | binding.gyp | {
"variables": {
"copy_c_api": "no",
"c_api_path": "<(module_root_dir)/qdb",
},
"targets": [
{
"target_name": "<(module_name)",
"sources": [
"src/qdb_api.cpp",
"src/entry.hpp",
"src/expirable_entry.hpp",
... | Python | 0 | @@ -2955,9 +2955,10 @@
=10.
-7
+15
%22%0A
|
b5df30371e7f975311ed4e783e204a9e38f97b0a | add conditions in binding.gyp file to fix issues | binding.gyp | binding.gyp | {
"targets": [
{
"target_name": "addon",
"sources": [ "addon.cc", "myobject.cc" ]
}
]
}
| Python | 0 | @@ -92,16 +92,1398 @@
ct.cc%22 %5D
+,%0A %22conditions%22: %5B%0A %5B'OS==%22mac%22', %7B%0A %22cflags%22: %5B %22-m64%22 %5D,%0A %22ldflags%22: %5B %22-m64%22 %5D,%0A %22xcode_settings%22: %7B%0A %22OTHER_CFLAGS%22: %5B%22... |
8efda67b5ca352e92183132dcf78a9292da057a0 | Fix loading of .plist files | package_reviewer/checkers/check_resource_files.py | package_reviewer/checkers/check_resource_files.py | import functools
import itertools
import json
import logging
import plistlib
import xml.etree.ElementTree as ET
from ..base import Checker
from .. import jsonc
l = logging.getLogger(__name__)
class CheckResourceFiles(Checker):
# Cache results of glob calls
@functools.lru_cache()
def glob(self, pattern)... | Python | 0 | @@ -3359,16 +3359,20 @@
th.open(
+'rb'
) as f:%0A
@@ -3456,17 +3456,18 @@
ept
-Exception
+ValueError
as
|
dfde913dcd096ed76ab5939e63914ce1e103f76c | Fix for #352 | AppiumLibrary/keywords/_android_utils.py | AppiumLibrary/keywords/_android_utils.py | # -*- coding: utf-8 -*-
import base64
from .keywordgroup import KeywordGroup
from selenium.common.exceptions import TimeoutException
from kitchen.text.converters import to_bytes
class _AndroidUtilsKeywords(KeywordGroup):
# Public
def open_notifications(self):
"""Opens and expands an Android device's ... | Python | 0 | @@ -2985,24 +2985,40 @@
encode(data)
+.decode('utf-8')
%0A dri
|
9b9359c06e44fe5a8f5f16f662fcea2ef3e8f18d | Remove delay load hook | binding.gyp | binding.gyp | {
"targets" : [{
"target_name" : "ofe",
"sources" : [ "ofe.cc" ],
"include_dirs": [
'<!(node -e "require(\'nan\')")'
]
}]
}
| Python | 0.000001 | @@ -123,15 +123,50 @@
)%22)'%0A%09%09%5D
+,%0A%09%09%22win_delay_load_hook%22 : %22false%22
%0A%09%7D%5D%0A%7D%0A
|
a30eb4a1eaa3a9677950c37f273e7ac16cae698f | Change init method | DSTC2/basic.py | DSTC2/basic.py | # -*- coding:utf-8 -*-
from sklearn.cross_validation import train_test_split
from DSTC2.traindev.scripts import myLogger
from DSTC2.traindev.scripts.model import bp
from traindev.scripts import file_reader
from traindev.scripts import initializer
from traindev.scripts.initializer import Set
__author__ = "JOHNKYON"... | Python | 0.000008 | @@ -823,24 +823,108 @@
%5B%22output%22%5D)%0A
+ input_mtr, output_mtr = bp.bp_initialize(one_set.input_mtr, one_set.output_mtr)%0A
# get mo
@@ -1109,24 +1109,16 @@
t_split(
-one_set.
input_mt
@@ -1116,32 +1116,24 @@
(input_mtr,
-one_set.
output_mtr,
|
2f4243b7d7e314834ac3f57877c06b034c138567 | Use mcdir for writing file to repo. Cleanup the name of the file. | backend/mcapi/user/ud.py | backend/mcapi/user/ud.py | from ..mcapp import app
from ..decorators import crossdomain, apikey, jsonp
from flask import jsonify, g, request, send_from_directory
from ..utils import mkdirp
import rethinkdb as r
import os.path
import os
from ..args import json_as_format_arg
import tempfile
from loader.tasks.db import load_data_dir, import_data_di... | Python | 0 | @@ -437,16 +437,37 @@
alidate%0A
+from .. import mcdir%0A
from loa
@@ -492,16 +492,16 @@
atafile%0A
-
%0A%0A@app.r
@@ -1822,35 +1822,8 @@
r'%5D%0A
- mkdirp('/tmp/uploads')%0A
@@ -2548,30 +2548,35 @@
th.join(
-'/tmp/uploads'
+mcdir.for_uid(dfid)
, dfid)%0A
@@ -3301,24 +3301,41 @@
ataFile(
+os.path.basen... |
e36054ab878b10d9e2bc0b21a21d589a16945449 | Add -Wno-unused-function to xcode flags | binding.gyp | binding.gyp | {
"targets": [
{
"target_name": "bswap",
"sources": [ "src/bswap.cc" ],
"include_dirs" : [
"<!(node -e \"require('nan')\")"
],
"cflags":[
"-march=native",
"-falign-loops=32", # See readme; significant improvement for some cases
"-Wno-unused-function", ... | Python | 0.000001 | @@ -760,32 +760,107 @@
-march=native%22,%0A
+ %22-Wno-unused-function%22, # CPU feature detection only used on Win%0A
%22-Wno-
|
5fade792a45a7434f1b8c03e7835756ef8c2a672 | Use pkg-config in node's binding.gyp | binding.gyp | binding.gyp | {
"targets" : [
{
'include_dirs': [
"<!(node -e \"require('nan')\")"
],
'cflags': [
'-std=c++0x',
'-Wall',
'-pthread',
'-pedantic',
'-g',
'-zdefs'
'-Werror'
],
'ldflags': [
'-g'
],
'link_settings': {
... | Python | 0.000001 | @@ -280,32 +280,296 @@
'-g'%0A %5D,%0A
+ %22conditions%22: %5B%0A %5B'OS != %22win%22', %7B%0A 'variables': %7B%0A 'has_pkg_config': '%3C!(command -v pkg-config %3E/dev/null 2%3E&1 && echo true %7C%7C echo false)'%0A %7D,%0A 'conditions': %5B%0A %5B'h... |
5578af9e99c6792e375db143f2423d92c847e001 | update binding.gyp to compile new feature | binding.gyp | binding.gyp | {
"targets": [
{
"target_name": "ons",
"sources": [
"src/entry.cpp",
"src/log_util.cpp",
"src/ons_options.cpp",
"src/consumer_ack.cpp",
"src/consumer.cpp",
"src/producer.cpp",
"src/consumer_listener.cpp"
],
"include_dirs": [
"... | Python | 0 | @@ -227,32 +227,73 @@
/producer.cpp%22,%0A
+ %22src/real_producer_wrapper.cpp%22,%0A
%22src/con
@@ -1486,16 +1486,22 @@
d=c++11%22
+, %22-g%22
%5D%0A
|
d749361a7ee14b96c2235300b15fbba1222a6a9c | remove comment. | binding.gyp | binding.gyp | {
'targets': [{
'target_name': 'bitcoindjs',
'variables': {
'BOOST_INCLUDE': '<!(test -n "$BOOST_INCLUDE"'\
' && echo "$BOOST_INCLUDE"'\
' || test -e /usr/include/boost && echo /usr/include/boost' \
' || echo ./include)',
'LEVELDB_INCLUDE': '<!(test -n "$LEVELDB_INCLUDE"'\
... | Python | 0 | @@ -1124,24 +1124,8 @@
o',%0A
- # XXX NEW%0A
|
d85adcabe11d797b5ccf55189150707eb9672f3e | access Y/N in addition to y/n | core/roslib/src/roslib/scriptutil.py | core/roslib/src/roslib/scriptutil.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above... | Python | 0.000004 | @@ -6859,16 +6859,24 @@
.strip()
+.lower()
%0A
@@ -6950,30 +6950,8 @@
'y'%0A
- import subprocess%0A
|
e3d3672b40cffd024c26e4fa441ede9dee3b345c | add two new attributes to annotator annotator_schema_version and quote. | annotator/model/couch.py | annotator/model/couch.py | from datetime import datetime
import uuid
import couchdb
import couchdb.design
from couchdb.mapping import Document, Mapping
from couchdb.mapping import TextField, IntegerField, DateField, DictField
from couchdb.mapping import ListField, DateTimeField, BooleanField, ViewField
class Metadata(object):
SERVER = Non... | Python | 0 | @@ -1259,24 +1259,82 @@
nnotation')%0A
+ annotator_schema_version = TextField(default=u'v1.0')%0A
uri = Te
@@ -1414,24 +1414,48 @@
TextField()%0A
+ quote = TextField()%0A
created
|
50bfb78e3e384e341021662316c71ccd3ab27905 | Delete test_event_str from the tests | core/tests/tests_event.py | core/tests/tests_event.py | #! /usr/bin/env python
__author__ = 'Henri Buyse'
import pytest
from core.models import Event, Tournament
def test_str():
e = Event.objects.create(name="VolleyBall Day")
assert print(e) != None
assert print(e) != ''
assert print(e) == "VolleyBall Day"
def test_get_all_tournament... | Python | 0.000007 | @@ -117,177 +117,8 @@
%0D%0A%0D%0A
-def test_str():%0D%0A e = Event.objects.create(name=%22VolleyBall Day%22)%0D%0A%0D%0A assert print(e) != None%0D%0A assert print(e) != ''%0D%0A assert print(e) == %22VolleyBall Day%22%0D%0A
%0D%0A%0D%0A
|
bf799d6651fa43561bc7697f9bc4410aed30bca6 | remove dead code | corehq/form_processor/tests/utils.py | corehq/form_processor/tests/utils.py | import functools
from uuid import uuid4
from couchdbkit import ResourceNotFound
from datetime import datetime
from nose.tools import nottest
from casexml.apps.case.models import CommCareCase
from casexml.apps.phone.models import SyncLog
from corehq.form_processor.backends.sql.dbaccessors import CaseAccessorSQL, FormA... | Python | 0.999454 | @@ -1394,168 +1394,8 @@
)%0A%0A
- def _sql_delete(query, domain_filter):%0A if domain is not None:%0A query.filter(domain_filter)%0A query.all().delete()%0A%0A
|
539f575832244e426d768b0901113a1e45b25f3f | modify python ext setup script | src/python_zfor/setup.py | src/python_zfor/setup.py | #!/usr/bin/env python
from distutils.core import setup, Extension
zformod = Extension('zfor',
sources = ['src/zfor.c'], library_dirs = ['/usr/local/lib'], libraries = ['zfor']
)
setup(name = 'zfor',
version = '0.1',
description = 'Python zfor binding',
... | Python | 0 | @@ -80,23 +80,16 @@
tension(
-'zfor',
%0A
@@ -85,34 +85,40 @@
on(%0A
-
+'zfor',%0A
sour
@@ -138,16 +138,70 @@
for.c'%5D,
+%0A include_dirs = %5B'../libzfor'%5D,%0A
librar
@@ -230,31 +230,24 @@
lib'
-%5D
,
-libraries = %5B'
+'../lib
zfor'%5D
+,
%0A
@@... |
e346f70eb34a029642410a92e449915801d9f78f | use relative import | antimarkdown/__init__.py | antimarkdown/__init__.py | # -*- coding: utf-8 -*-
"""antimarkdown -- convert Markdown to HTML.
"""
from lxml import html
from lxml.builder import E
import handlers
default_safe_tags = set('p blockquote i em strong b u a h1 h2 h3 h4 h5 h6 hr pre code div br img ul ol li span'.split())
default_safe_attrs = set('href src alt style title'.split(... | Python | 0 | @@ -116,16 +116,23 @@
port E%0A%0A
+from .
import h
|
c5a156921b7c50c1cf6dc0344b92b661e73c5e32 | Build Results object from a dictionary | rnacentral/nhmmer/utils.py | rnacentral/nhmmer/utils.py | """
Copyright [2009-2014] EMBL-European Bioinformatics Institute
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.000055 | @@ -1104,797 +1104,72 @@
re
-sults.append(Results(query_id=query,%0A result_id=record%5B'result_id'%5D,%0A rnacentral_id=record%5B'rnacentral_id'%5D,%0A description=record%5B'description'%5D,%0A sc... |
1a0828bd9dda4b17f6121174bd826ace1fe2eefb | Fix remove_item (#112) | Core/automation/lib/python/core/items.py | Core/automation/lib/python/core/items.py | # NOTE: Requires JythonItemProvider component
from core.jsr223 import scope
scope.scriptExtension.importPreset(None)
import core
from core import osgi, JythonItemProvider
from core.log import logging, LOG_PREFIX
from core.links import remove_all_links
ItemBuilderFactory = osgi.get_service(
"org.openhab.core.i... | Python | 0 | @@ -3126,32 +3126,37 @@
ider.remove(item
+.name
)%0A log.de
|
08869ed4f1ac6190e5a3f6ec3439ce4cc7e010ba | add migration messenger | migrate2v2_dump.py | migrate2v2_dump.py | #!/usr/bin/env python
import os
from json import dump
from bitfield import BitHandler, BitField
from django import setup
from django.core.serializers.json import DjangoJSONEncoder
from django.db.models import ImageField
class BatchSaveStreamList(list):
def __init__(self, model_class, model_name, except_fields=No... | Python | 0.000001 | @@ -72,20 +72,8 @@
port
- BitHandler,
Bit
@@ -2687,16 +2687,440 @@
%7D)%0A%0A%0A
+def dump_messenger():%0A from messenger.models import Messenger, ViberMessenger, ViberMessage, ViberSubscriber%0A batch_save(%22messenger.json%22, Messenger, 'messenger.messenger')%0A batch_save(%22ViberMessenger.json%22, ... |
d00235a494b8dc5db18e0d0b7fa1135826ae49d3 | Set template_debug to False. | restfulgrok/fancyhtmlview.py | restfulgrok/fancyhtmlview.py | from jinja2 import Template
from pkg_resources import resource_string
from view import GrokRestViewMixin
from contenttype import ContentType, ContentTypesRegistry
from contenttype import JsonContentType
class HtmlContentType(ContentType):
"""
XHTML content type. Provides a dumps-method that uses a jinja2-te... | Python | 0 | @@ -700,19 +700,20 @@
debug =
-Tru
+Fals
e%0A%0A #
|
d450cbd8563fd1a6cb8654d7ccdbe045fd1bf6cb | Fix theme tests | src/wirecloud/platform/tests/themes.py | src/wirecloud/platform/tests/themes.py | # -*- coding: utf-8 -*-
# Copyright (c) 2016 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud 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 versio... | Python | 0.000001 | @@ -1989,22 +1989,150 @@
Error%0A%0A%0A
-@patch
+get_available_themes_mock = Mock(return_value = (DEFAULT_THEME, %22customtheme%22, %22custommodtheme%22, %22customroottheme%22))%0A%0A%0A@patch.multiple
('wirecl
@@ -2150,17 +2150,19 @@
m.themes
-.
+',
import_m
@@ -2170,14 +2170,8 @@
dule
-', new
=imp
@@ -2187,16 ... |
a25b720d46ba4d8322e0a3d87b526c95de071913 | update cryo manager | pychron/hardware/lakeshore/model330.py | pychron/hardware/lakeshore/model330.py | # ===============================================================================
# Copyright 2018 ross
#
# 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/LICE... | Python | 0 | @@ -964,16 +964,17 @@
t time%0A%0A
+%0A
class Mo
@@ -1027,24 +1027,26 @@
oller):%0A%0A
+ #
def set_set
@@ -1082,20 +1082,27 @@
ies=3):%0A
+ #
%0A
+ #
sel
@@ -1115,24 +1115,26 @@
range(v)%0A
+ #
for i i
@@ -1150,24 +1150,26 @@
etries):%0A
+ #
sel
@@ -1195,24 +1195,26 @@
rma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.