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 |
|---|---|---|---|---|---|---|---|
09f6530a79e744bb5d4267bab0de27bf7aa34598 | Make default cursor start at now-70m instead of now-10m. | vt/feed.py | vt/feed.py | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
# Copyright © 2019 The vt-py 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... | Python | 0.000001 | @@ -2523,17 +2523,17 @@
minutes=
-1
+7
0)%0A
|
8c4555d3471324b2fc87bd914d3f10992424cecb | update ICD url | weather.py | weather.py | #!/usr/bin/env python
import sys
import html5lib
import urllib2
from numpy import median, array
from xml_icd import parseICD
from html5lib import treebuilders
def salt():
wx = {}
try:
tcs = parseICD("http://sgs.salt/xml/salt-tcs-icd.xml")
time = tcs['tcs xml time info']
bms = tcs['bm... | Python | 0.000001 | @@ -224,11 +224,11 @@
p://
-sgs
+icd
.sal
|
26f5a4fd2ed66d4a9b6fcef296b1365e8364aaf7 | Add messages to assertions | web/web.py | web/web.py | #!/usr/bin/env python3.6
import json
# import webcolors
import re
from flask import Flask, request, render_template, send_file
from flask_cors import CORS
import pygame
import pygame.camera
# file to write to
FILE_PATH = 'data.json'
# regex to match that colors are hexadecimal values
regex_color = '^#[A-Fa-f0-9]{6}$... | Python | 0.000001 | @@ -1864,16 +1864,39 @@
a, dict)
+, %22Data was not a dict%22
%0A%0A #
@@ -1940,32 +1940,53 @@
r1'%5D is not None
+, %22Color 1 was none.%22
%0A assert re.m
@@ -2014,24 +2014,47 @@
a%5B'color1'%5D)
+, %22Color 1 was invalid%22
%0A assert
@@ -2079,16 +2079,36 @@
not None
+, %22Color 2 was none%22
%0A ... |
367b9004cfbfbb8fe950a26c9c87948a8bac17d1 | Simplify JSON import logic | whip/db.py | whip/db.py | """
Whip database storage module.
All IP ranges with associated information are stored in a LevelDB
database. The key/value layout is as follows:
* The end IP is used as the key. This allows for quick
fast range lookups.
* The begin IP and the actual information is stored in the value. The
most recent infoset fo... | Python | 0.990858 | @@ -1093,100 +1093,150 @@
vel%0A
-try:%0A import ujson as json%0Aexcept ImportError:%0A try:%0A import simplejson as json
+%0A# Use fastest JSON implementation available%0Afor lib in ('ujson', 'simplejson', 'json'):%0A try:%0A json = __import__(lib)%0A break
%0A
@@ -1268,19 +1268,12 @... |
14e5937f4d4654451b1ab2cb8ddb5951b6741b5b | fix refactor bug | lib/raviron/proxy.py | lib/raviron/proxy.py | #
# This file is part of raviron. Raviron is free software available under
# the terms of the MIT license. See the file "LICENSE" that was provided
# together with this source file for the licensing terms.
#
# Copyright (c) 2015 the raviron authors. See the file "AUTHORS" for a
# complete list.
import re
import os
imp... | Python | 0.000001 | @@ -2728,19 +2728,17 @@
def
+do_
create
-_main
(env
|
3578dc1910dff4650c7b38ed97b825b0f5ea9711 | Fix wording for query help text | libpatchew/search.py | libpatchew/search.py | #!/usr/bin/env python2
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Fam Zheng <famcool@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without ... | Python | 0.000216 | @@ -5856,17 +5856,18 @@
st week.
-
+%0A%0A
And%0A%0A
@@ -6528,23 +6528,23 @@
uals to
-keyword
+subject
:%3Cvalue%3E
|
2c53e6a4fa83bfde0094eb4cb4e18661d6f310f8 | use log.err here, refs #154 | lib/carbon/writer.py | lib/carbon/writer.py | """Copyright 2009 Chris Davis
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
dist... | Python | 0 | @@ -4421,35 +4421,35 @@
:%0A log.
-msg
+err
(%22Error creating
|
9102fdda8c529bf22365112b40d0d5944603ebd3 | Update position.py | ogn/model/position.py | ogn/model/position.py | import re
from sqlalchemy import Column, String, Integer, Float, Boolean, SmallInteger
from ogn.aprs_utils import fpm2ms
from ogn.model.beacon import Beacon
from wsgiref.simple_server import software_version
class Position(Beacon):
__tablename__ = "position"
# Flarm specific data
address_type = Column(... | Python | 0 | @@ -156,59 +156,8 @@
con%0A
-from wsgiref.simple_server import software_version%0A
%0A%0Acl
|
c5fac61ca01040d0066aa2ecb30fca24e0edfdd6 | remove old unused comment | pyannote/audio/embedding/triplet_loss/glue.py | pyannote/audio/embedding/triplet_loss/glue.py | #!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2016 CNRS
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | Python | 0 | @@ -2713,111 +2713,8 @@
only
-%0A # # HACK https://github.com/fchollet/keras/issues/3833%0A # self.__name__ = 'TripletLoss'
%0A%0A
|
ae3ba5dfbedde4440d6ff534a606868f5af8f009 | remove legacy tensorflow support (#1817) | python/dllib/src/test/bigdl/keras/test_net.py | python/dllib/src/test/bigdl/keras/test_net.py | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | Python | 0 | @@ -4516,578 +4516,8 @@
l)%0A%0A
- def test_tf_load(self):%0A linear = Linear(10, 2)()%0A sigmoid = Sigmoid()(linear)%0A softmax = SoftMax().set_name(%22output%22)(sigmoid)%0A model = BModel(linear, softmax)%0A input = np.random.random((4, 10))%0A%0A tmp_path = create_tmp_p... |
137b20e4aa779be3c97c500ab485126085492ce5 | comment format | pywikibot/families/scratchpad_wikia_family.py | pywikibot/families/scratchpad_wikia_family.py | # -*- coding: utf-8 -*-
from pywikibot import family
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'scratchpad_wikia'
self.langs = {
'de':'de.mini.wikia.com',
'en':'scratchpad.wikia.com',
'fr':'bloc-notes.wiki... | Python | 0.000001 | @@ -489,16 +489,24 @@
not want
+ to loop
%0A
@@ -507,24 +507,16 @@
#
- to loop
over al
@@ -554,26 +554,16 @@
d by the
-%0A #
titletr
@@ -572,16 +572,26 @@
slate.py
+%0A #
module,
@@ -620,26 +620,16 @@
void the
-%0A #
options
@@ -648,16 +648,26 @@
get away
+%0A #
... |
c898b68fa8d81963b7a5282e67ecb28764bbd0a3 | Add comment explaining mocking | tests/app/models/test_contact_list.py | tests/app/models/test_contact_list.py | from datetime import datetime
from app.models.contact_list import ContactList
from app.models.job import PaginatedJobs
def test_created_at():
created_at = ContactList({'created_at': '2016-05-06T07:08:09.061258'}).created_at
assert isinstance(created_at, datetime)
assert created_at.isoformat() == '2016-05... | Python | 0 | @@ -509,16 +509,108 @@
edJobs)%0A
+ # mock_get_jobs mocks the underlying API client method, not%0A # contact_list.get_jobs%0A
mock
|
cfe2c5b405cc5cc74fed81e506e717698236f608 | debug print lines | yumoter.py | yumoter.py | #!/usr/bin/env python2
import sys, os, json, errno, subprocess, yum
class yumoter:
def __init__(self, configFile, repobasepath):
self.repobasepath = repobasepath
self.reloadConfig(configFile)
self.yb = yum.YumBase()
self.yb.setCacheDir()
def reloadConfig(self, jsonFile):
... | Python | 0.000003 | @@ -2802,32 +2802,55 @@
elf.repoConfig:%0A
+ print repo%0A
# On
@@ -3395,98 +3395,8 @@
nt a
-%0A else:%0A print %22wtf%22%0A print self.repoConfig%5Brepo%5D
%0A%0A''
|
b3d2c2a94a227fd7498ce2eded0bde440a521cb2 | Convert certificate generation to processutils. | nova/crypto.py | nova/crypto.py | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | Python | 0.00002 | @@ -1175,16 +1175,58 @@
rt x509%0A
+from oslo_concurrency import processutils%0A
from osl
@@ -4294,32 +4294,39 @@
ficate, _err) =
+process
utils.execute(%0A
@@ -4617,16 +4617,23 @@
_err) =
+process
utils.ex
|
39c34860fa9992f38892aa026c5b0c6547bd4b23 | Fix flaky evergreen test | tests/content/test_content_manager.py | tests/content/test_content_manager.py | from django.test import override_settings
from django.utils import timezone
from bulbs.campaigns.models import Campaign
from bulbs.content.models import Content
from bulbs.utils.test import make_content, BaseIndexableTestCase
from example.testcontent.models import TestContentObj, TestContentObjTwo
class ContentMana... | Python | 0.000003 | @@ -670,16 +670,36 @@
content(
+TestReadingListObj,
evergree
|
3c82d0ca4a314ffd052b99ece7afec6aaea4e063 | Update BatchKwargs to_id tests | tests/datasource/test_batch_kwargs.py | tests/datasource/test_batch_kwargs.py | import pytest
import os
from freezegun import freeze_time
try:
from unittest import mock
except ImportError:
import mock
from great_expectations.datasource.types import *
@freeze_time("1955-11-05")
def test_batch_kwargs_fingerprint():
test_batch_kwargs = PathBatchKwargs(
{
"path": ... | Python | 0 | @@ -182,35 +182,8 @@
*%0A%0A%0A
-@freeze_time(%221955-11-05%22)%0A
def
@@ -323,69 +323,8 @@
)%0A
-%0A #demonstrate *output* kwargs post-datasource/generator%0A%0A
@@ -458,115 +458,19 @@
rgs.
-batch_fingerprint == BatchFingerprint(%0A partition_id=%2219551105T000000.000000Z%22,%0A fingerpri... |
8c8bc1ef8e3ba7519d4612856a420ed410974e12 | add redactor on installed apps settings | opps/core/__init__.py | opps/core/__init__.py | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
trans_app_label = _('Opps')
| Python | 0 | @@ -77,32 +77,109 @@
s _%0A
-trans_app_label = _('Opps'
+from django.conf import settings%0A%0A%0A%0Atrans_app_label = _('Opps')%0Asettings.INSTALLED_APPS += ('redactor',
)%0A
|
a1df5125589e397aa45494cfe7ef8c7b7ca2174d | Update PkgDistributionCreator.py | MTM_Installer/PkgDistributionCreator.py | MTM_Installer/PkgDistributionCreator.py | #!/usr/bin/env python
#
#
# 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, softw... | Python | 0 | @@ -4663,16 +4663,42 @@
n.xml')%0A
+ self.output(root)%0A
@@ -4752,16 +4752,43 @@
itle%3E')%0A
+ self.output(child)%0A
|
9174a4d404cafd872a75c761db6357361fd9599d | Support requests with a body and url data | demands/service.py | demands/service.py | import logging
import requests
import time
log = logging.getLogger(__name__)
class Request(object):
"""
Request object which provides functionality to send and receive
http requests/responses.
"""
def __init__(self, url, method, data, headers, cookies, verify):
self.url = url
se... | Python | 0 | @@ -244,32 +244,38 @@
l, method, data,
+ body,
headers, cookie
@@ -365,24 +365,55 @@
data or %7B%7D%0A
+ self.body = body or %7B%7D%0A
self
@@ -583,175 +583,519 @@
-arguments = %7B%7D%0A if self.method in ('POST', 'PUT', 'PATCH'):%0A arguments%5B'data'%5D = self.data%0A ... |
9412b362b649a8eaa62448bef5772b0f001efdbb | Remove the download syncing as it's no longer part of Conveyor | conveyor/core.py | conveyor/core.py | from __future__ import absolute_import
from __future__ import division
import bz2
import csv
import logging
import logging.config
import io
import time
import urlparse
import lxml.html
import redis
import requests
import slumber
import yaml
from apscheduler.scheduler import Scheduler
from conveyor.processor import... | Python | 0 | @@ -1148,198 +1148,8 @@
%5D)%0A%0A
- if self.config%5B%22conveyor%22%5D.get(%22schedule%22, %7B%7D).get(%22downloads%22, %7B%7D):%0A self.scheduler.add_interval_job(self.downloads, **self.config%5B%22conveyor%22%5D%5B%22schedule%22%5D%5B%22downloads%22%5D)%0A%0A
@@ -2492,2672 +2492,4 @@
s()%0A... |
596e90626bf88be0ea1461ecb80924ef6b3b85e6 | use udp for direct communication | metric-generator/generator.py | metric-generator/generator.py | import socket
import sys
import random
import argparse
from time import time, sleep
class TokenBucket(object):
"""An implementation of the token bucket algorithm.
>>> bucket = TokenBucket(80, 0.5)
>>> print bucket.consume(10)
True
adapted from http://code.activestate.com/recipes/511490-implementation-of-the-toke... | Python | 0 | @@ -4219,16 +4219,39 @@
gs.port%0A
+%0Aif(not args.direct):%0A%09
sock = s
@@ -4299,16 +4299,17 @@
STREAM)%0A
+%09
sock.con
@@ -4326,16 +4326,79 @@
, PORT))
+%0Aelse %0A%09sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
%0A%0Astart_
@@ -4629,16 +4629,36 @@
illis))%0A
+%0A%09if(args.direct):%0A%09
%09byt... |
6a02c5e1844ad7d1b9ae50cd5dbae6975fb685ee | Make internal error more clear | numba/error.py | numba/error.py | import traceback
def format_pos(node):
if node is not None and hasattr(node, 'lineno'):
return "%s:%s: " % (node.lineno, node.col_offset)
else:
return ""
class NumbaError(Exception):
"Some error happened during compilation"
def __init__(self, node, msg=None, *args):
if msg is ... | Python | 0.000321 | @@ -684,16 +684,61 @@
return %22
+%3Cinternal error creating numba error message%3E
%22%0A%0A%0Aclas
@@ -842,8 +842,9 @@
pass
+%0A
|
4bbbac6f88f6f10bb6da82fb00704455115f9d9b | test seems to be working | py/testdir_multi_jvm/test_GLM_covtype20x_s3n_thru_hdfs.py | py/testdir_multi_jvm/test_GLM_covtype20x_s3n_thru_hdfs.py |
import os, json, unittest, time, shutil, sys
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts
import h2o_browse as h2b
import h2o_import as h2i
import time, random
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
... | Python | 0.000006 | @@ -103,16 +103,25 @@
2o_hosts
+, h2o_glm
%0Aimport
@@ -1337,34 +1337,8 @@
= 3
-%0A timeoutSecs = 500
%0A%0A
@@ -1925,16 +1925,46 @@
u HDFS'%0A
+ timeoutSecs = 500%0A
@@ -2071,19 +2071,27 @@
outSecs=
-500
+timeoutSecs
, retryD
@@ -2165,17 +2165,16 @@
- start%0A
-%0A
@@ ... |
619269367c9e38fe55ae8667ead8486f63467d2b | Fix case where apache passes DN in the format we expect rather than ssl format. | src/python/apache_utils.py | src/python/apache_utils.py | """
Apache Utils.
Tools for dealing with credential checking from X509 SSL certificates.
These are useful when using Apache as a reverse proxy to check user
credentials against a local DB.
"""
from collections import namedtuple
import cherrypy
from sqlalchemy_utils import create_db, db_session
from tables import Users... | Python | 0 | @@ -1230,24 +1230,66 @@
CA)%0A %22%22%22%0A
+ if not client_dn.startswith('/'):%0A
client_d
@@ -1335,24 +1335,28 @@
plit(',')))%0A
+
if clien
@@ -1373,16 +1373,20 @@
t None:%0A
+
|
429bf52eb482955cfe195708898ce275e1a72dcb | Validate input. | src/devilry_qualifiesforexam/devilry_qualifiesforexam/rest/preview.py | src/devilry_qualifiesforexam/devilry_qualifiesforexam/rest/preview.py | from djangorestframework.views import View
from djangorestframework.permissions import IsAuthenticated
from django.shortcuts import get_object_or_404
from devilry_qualifiesforexam.pluginhelpers import create_sessionkey
from devilry.apps.core.models import Period
from devilry.utils.groups_groupedby_relatedstudent_and_a... | Python | 0.000017 | @@ -96,16 +96,125 @@
ticated%0A
+from djangorestframework.response import ErrorResponse%0Afrom djangorestframework import status as statuscodes%0A
from dja
@@ -1346,27 +1346,210 @@
.GET
-%5B'pluginsessionid'%5D
+.get('pluginsessionid', None)%0A if not pluginsessionid:%0A raise ErrorResponse(statusc... |
17cef49cb97baae5d3300a368a1dbc472e193b1a | Add GIT_RESTRICTED_BRANCHES | osgbuild/constants.py | osgbuild/constants.py | """Global constants for osg-build"""
import os
import sys
WD_RESULTS = '_build_results'
WD_PREBUILD = '_final_srpm_contents'
WD_UNPACKED = '_upstream_srpm_contents'
WD_UNPACKED_TARBALL = '_upstream_tarball_contents'
WD_QUILT = '_quilt'
AFS_CACHE_PATH = '/p/vdt/public/html/upstream'
AFS_CACHE_PREFIX = 'file://' + AFS_C... | Python | 0.00001 | @@ -1617,16 +1617,213 @@
ioned'%7D%0A
+GIT_RESTRICTED_BRANCHES = %7B%0A r'%5E(%5Cw*/)?master$' : 'main',%0A r'%5E(%5Cw*/)?upcoming$' : 'upcoming',%0A r'%5E(%5Cw*/)?osg-(?P%3Cosgver%3E%5Cd+%5C.%5Cd+)$' : 'versioned'%7D%0A%0A
CSL_KOJI
|
8ab7ad1f6aee485c64a7e1347c76e628cc820ba8 | add some docker Builder args | src/py/gopythongo/builders/docker.py | src/py/gopythongo/builders/docker.py | # -* encoding: utf-8 *-
import argparse
import gopythongo.shared.docker_args
from gopythongo.utils import print_info, highlight
from gopythongo.builders import BaseBuilder
from typing import Any
class DockerBuilder(BaseBuilder):
def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*ar... | Python | 0 | @@ -392,17 +392,16 @@
return
-u
%22docker%22
@@ -401,16 +401,16 @@
docker%22%0A
+
%0A def
@@ -459,32 +459,32 @@
arser) -%3E None:%0A
-
gopython
@@ -530,16 +530,875 @@
arser)%0A%0A
+ gp_docker = parser.add_argument_group(%22Docker Builder options%22)%0A gp_docker.add_argument(%22--docke... |
6248a0b813fc6598d964639ad696ecd506015918 | Rename to TaarifaAPI | taarifa_api/settings.py | taarifa_api/settings.py | """Global API configuration."""
from os import environ
from urlparse import urlparse
from schemas import facility_schema, request_schema, resource_schema, \
service_schema
API_NAME = 'Taarifa'
URL_PREFIX = 'api'
if 'EVE_DEBUG' in environ:
DEBUG = True
if 'MONGOLAB_URI' in environ:
url = urlparse(environ... | Python | 0.999999 | @@ -191,16 +191,19 @@
'Taarifa
+API
'%0AURL_PR
|
27ef7070e8eb538e74ba5f69a156a1fee14b5af3 | Comment correction, `get_list` is now `filter`. | tests/modeltests/or_lookups/models.py | tests/modeltests/or_lookups/models.py | """
19. OR lookups
To perform an OR lookup, or a lookup that combines ANDs and ORs,
combine QuerySet objects using & and | operators.
Alternatively, use positional arguments, and pass one or more expressions
of clauses using the variable ``django.db.models.Q`` (or any object with
a get_sql method).
"""
from django... | Python | 0.000002 | @@ -3355,16 +3355,15 @@
han
-get_list
+filter.
%0A%3E%3E%3E
|
ab8930c771d71c09186f94fb554ee0e6d82cea43 | Remove ignore source from multi push notification commands #11 | notification/management/commands/multipush.py | notification/management/commands/multipush.py | from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand
from notification.apns.apns import APNs, Frame, Payload, PayloadAlert
from notification.models import DeviceToken, CertFile
import logging
import os.path
import random
import sys
import time
CERT_FILE_UPLOAD_DIR... | Python | 0 | @@ -143,15 +143,8 @@
PNs,
- Frame,
Pay
@@ -162,16 +162,16 @@
adAlert%0A
+
from not
@@ -276,20 +276,8 @@
sys%0A
-import time%0A
%0A%0ACE
@@ -439,16 +439,16 @@
mand):%0A%0A
+
help
@@ -504,135 +504,8 @@
.'%0A%0A
- def __init__(self):%0A self.frame = Frame()%0A self.expiry = int(time.time() +... |
059a799b9c347b6abfcd2daa3678d98cd0884210 | Add "no cover" to teardown() and handle_address_delete() on TiedModelRealtimeSignalProcessor. These are never called. | ovp_search/signals.py | ovp_search/signals.py | from django.db import models
from haystack import signals
from ovp_projects.models import Project
from ovp_organizations.models import Organization
from ovp_core.models import GoogleAddress
class TiedModelRealtimeSignalProcessor(signals.BaseSignalProcessor):
"""
TiedModelRealTimeSignalProcessor handles updates... | Python | 0 | @@ -1131,27 +1131,70 @@
%0A%0A
-def teardown(self):
+# never really called%0A def teardown(self): # pragma: no cover
%0A
@@ -1713,32 +1713,87 @@
_class__, obj)%0A%0A
+ # this function is never really called on sqlite dbs%0A
def handle_add
@@ -1830,32 +1830,51 @@
ance, **kwargs):
+ # pragma: no cover
%0A ... |
847d652c4ef179bbf94c0e322dc3277858fcf08c | Add h5cc shlib argument for correctly link hdf5 libraries | mesonbuild/dependencies/hdf5.py | mesonbuild/dependencies/hdf5.py | # Copyright 2013-2019 The Meson development team
# 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 agree... | Python | 0.000001 | @@ -4930,32 +4930,116 @@
return%0A
+ shlib_arg = '-noshlib' if kwargs.get('static', False) else '-shlib'%0A
@@ -5066,16 +5066,27 @@
nd() + %5B
+shlib_arg,
'-show'%5D
|
2f357ac185e7728e0a0afec6827500c78a4b2796 | Update SavedModel example to use serialized tf Example. Change: 135378723 | tensorflow/python/saved_model/example/saved_model_half_plus_two.py | tensorflow/python/saved_model/example/saved_model_half_plus_two.py | ## Copyright 2015 The TensorFlow 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 applic... | Python | 0 | @@ -1955,22 +1955,24 @@
%0A%0A #
-Set up
+Create a
placeho
@@ -1979,44 +1979,466 @@
lder
-s.%0A x = tf.placeholder(tf.float32
+ for serialized tensorflow.Example messages to be fed.%0A serialized_tf_example = tf.placeholder(tf.string, name=%22tf_example%22)%0A%0A # Parse the tensorflow.Example looking ... |
a07db1f5d05bf89cfd34c8229813eb7805c35b6a | Move general SOCKSError after more specific failures | ooni/errors.py | ooni/errors.py | from twisted.internet.defer import CancelledError
from twisted.internet.defer import TimeoutError as DeferTimeoutError
from twisted.web._newclient import ResponseNeverReceived
from twisted.web.error import Error
from twisted.internet.error import ConnectionRefusedError, TCPTimedOutError
from twisted.internet.error imp... | Python | 0 | @@ -1463,41 +1463,8 @@
'),%0A
- (SOCKSError, 'socks_error'),%0A
@@ -2096,24 +2096,57 @@
upported'),%0A
+ (SOCKSError, 'socks_error'),%0A
(Process
|
e8a29a6af8856c2957ed93a2da31b62916b6694d | add git support and support passing project_name in VersionControl __init__ | deps/__init__.py | deps/__init__.py | import os
import sys
import shutil
import logging
import urlparse
logger = logging.getLogger('deps')
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler())
class MissingDependency(Exception):
pass
class VersionControl(object):
def __init__(self, url, root, app_name='', project_name=''):... | Python | 0 | @@ -292,18 +292,20 @@
pp_name=
-''
+None
, projec
@@ -315,10 +315,12 @@
ame=
-''
+None
):%0A
@@ -451,75 +451,45 @@
-if not app_name:%0A self.app_name = tail%0A self.
+self.project_name = project_name and
proj
@@ -501,33 +501,16 @@
ame
-=
+or
tail%0A
- else:%0A
@@ ... |
b2ed2050fdab7ba1052e33786c0a0868333114c4 | Update treeviz_example.py | open_spiel/python/examples/treeviz_example.py | open_spiel/python/examples/treeviz_example.py | # Copyright 2019 DeepMind Technologies Ltd. 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 appl... | Python | 0.000001 | @@ -1371,16 +1371,17 @@
alse, %22W
+h
ether to
|
fd58dcc83080449219944426281c6d8e5f9e5f60 | change key into keyIndex for invalid path issues. | minicrawler/spider/basespider.py | minicrawler/spider/basespider.py | from ..provider.webbrowser import WebBrowser
from ..provider.requestor import Requestor
import csv
import os
import pickle
import datetime
import shutil
import numpy as np
import pandas as pd
class BaseSpider():
# member variables
_provider = None
_outputFolder = 'output'
_keyList = []
_lastKeyPath = None
... | Python | 0 | @@ -2886,12 +2886,74 @@
to .
-xlsx
+csv%0A # use keyIndex because current key may be invalid path
%0A
@@ -2983,24 +2983,29 @@
(result, key
+Index
)%0A pr
@@ -3594,19 +3594,32 @@
Folder,
+'
key
+' + str(key)
+ '.csv
|
9cbdc64bcc1144b8ca7d32d08aa5d36afa7f1e73 | index command - reflected _log_id_short change | pageobject/commands/index.py | pageobject/commands/index.py | def index(self, value):
"""
Return index of the first child containing the specified value.
:param str value: text value to look for
:returns: index of the first child containing the specified value
:rtype: int
:raises ValueError: if the value is not found
"""
self.logger.info('getting ... | Python | 0.000001 | @@ -314,32 +314,37 @@
etting index of
+text
%22%7B%7D%22 within %7B%7D'.
@@ -339,16 +339,33 @@
within
+page object list
%7B%7D'.form
@@ -427,32 +427,37 @@
etting index of
+text
%22%7B%7D%22 within page
@@ -463,16 +463,21 @@
e object
+ list
; %7B%7D'.fo
@@ -573,32 +573,37 @@
.info('index of
+text
%22%... |
32fdc3dfaaa8c8598de04a57141c5995be5409ca | Fix F.rrelu test unstability | tests/chainer_tests/functions_tests/activation_tests/test_rrelu.py | tests/chainer_tests/functions_tests/activation_tests/test_rrelu.py | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import testing
from chainer.testing import attr
@testing.inject_backend_tests(
None,
# CPU tests
[
{},
]
# GPU tests
+ testing.product({
'use_cuda': [True],
... | Python | 0.000005 | @@ -699,44 +699,8 @@
):%0A%0A
- dodge_nondifferentiable = True%0A%0A
@@ -1390,32 +1390,150 @@
ype(self.dtype)%0A
+ if self.test_name in ('test_backward', 'test_double_backward'):%0A x%5B(-0.05 %3C x) & (x %3C 0.05)%5D = 0.5%0A
return x
|
6143e6b015ed0435dc747b8d4242d47dca79c7a8 | improve busydialog handling | lib/kodi65/busyhandler.py | lib/kodi65/busyhandler.py | # -*- coding: utf8 -*-
# Copyright (C) 2015 - Philipp Temminghoff <phil65@kodi.tv>
# This program is Free Software see LICENSE file for details
import xbmc
from kodi65 import utils
import traceback
from functools import wraps
class BusyHandler(object):
"""
Class to deal with busydialog handling
"""
... | Python | 0.000001 | @@ -150,16 +150,19 @@
ort xbmc
+gui
%0Afrom ko
@@ -394,32 +394,75 @@
f.enabled = True
+%0A self.dialog = xbmcgui.DialogBusy()
%0A%0A def enable
@@ -876,80 +876,125 @@
-xbmc.executebuiltin(%22ActivateWindow(busydialog)%22)%0A self.busy += 1
+self.dialog.create()%0A self.busy += 1%0A%0A ... |
7f48ffa31e8aebffcb5be14ba26fe51dda586519 | add branch parsing | PyAnalysisTools/ROOTUtils/FileHandle.py | PyAnalysisTools/ROOTUtils/FileHandle.py | __author__ = 'marcusmorgenstern'
__mail__ = ''
import os
import re
from ROOT import TFile
from PyAnalysisTools.base import _logger, InvalidInputError
_memoized = {}
def get_id_tuple(f, args, kwargs, mark=object()):
l = [id(f)]
for arg in args:
l.append(id(arg))
l.append(id(mark))
for k, v in... | Python | 0.000001 | @@ -2375,32 +2375,451 @@
return objects%0A%0A
+ def get_branch_names_from_tree(self, tree_name, tdirectory=None, pattern=%22.*%22):%0A tree = self.get_object_by_name(tree_name, tdirectory)%0A pattern = re.compile(pattern)%0A branch_names = %5B%5D%0A for branch in tree.GetListOfBranches()... |
99eca228811022281da8c93123d7562e5e5c6acb | Update recommender_system.py | lib/recommender_system.py | lib/recommender_system.py | #!/usr/bin/env python
"""
This is a module that contains the main class and functionalities of the recommender systems.
"""
import numpy
from lib.content_based import ContentBased
from lib.evaluator import Evaluator
from lib.LDA import LDARecommender
from util.data_parser import DataParser
from util.recommender_configu... | Python | 0 | @@ -1006,34 +1006,32 @@
ations'%5D%0A
- #
self.content_ba
|
767a50052895cf10386f01bab83941a2141c30f1 | fix json test and add json from string test | tests/python_tests/datasource_test.py | tests/python_tests/datasource_test.py | #!/usr/bin/env python
from nose.tools import *
from utilities import execution_path
import os, mapnik2
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))
def test_field_listing():
lyr = mapnik2.Layer('t... | Python | 0.000008 | @@ -953,17 +953,300 @@
_feats,
-3
+5)%0A%0Adef test_reading_json_from_string():%0A json = open('../data/json/points.json','r').read()%0A lyr = mapnik2.Layer('test')%0A lyr.datasource = mapnik2.Ogr(file=json,layer_by_index=0)%0A features = lyr.datasource.all_features()%0A num_feats = len(features)%0A ... |
05855c934624c667053635a8ab8679c54426e49f | Rewrite the initialization of Release.eol_date. | releases/migrations/0003_populate_release_eol_date.py | releases/migrations/0003_populate_release_eol_date.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
def set_eol_date(apps, schema_editor):
Release = apps.get_model('releases', 'Release')
# List of EOL dates for releases for which docs are published.
for version, eol_date in [
... | Python | 0 | @@ -219,15 +219,15 @@
#
-List of
+Set the
EOL
@@ -235,95 +235,755 @@
date
-s for releases for which docs are published.%0A for version, eol_date in %5B%0A ('1
+ of all releases to the date of the following release%0A # except for the final one in the 0 series and in each 1.x series.%0A releases =... |
e26d30a0e88cb1100e0b285b394e94ce8c48d4f3 | fix the incorrect plot lasso tool | src/scripts/lasso_enet_var_select.py | src/scripts/lasso_enet_var_select.py | #!/usr/bin/env python
################################################################################
# AUTHORS: Miguel Ibarra <miguelib@ufl.edu>
# Matt Thoburn <mthoburn@ufl.edu>
#
# DESCRIPTION: This runs an Elastic Net or Lasso Test on wide data
###########################################################... | Python | 0.003436 | @@ -2206,32 +2206,52 @@
dest=%22alpha%22,%0A
+ type=float,%0A
action=%22
|
c772bff9251c049bdbeee0b502537166aaf8ff07 | Make sure that the threshold can cope with data ranges of 0 to 1 | ui/visualizations/VolumeVisualizationSimple.py | ui/visualizations/VolumeVisualizationSimple.py | """
VolumeVisualizationSimple
:Authors:
Berend Klein Haneveld
"""
from VolumeVisualization import VolumeVisualization
from VolumeVisualization import VisualizationTypeSimple
from vtk import vtkVolumeProperty
from vtk import vtkColorTransferFunction
from vtk import vtkPiecewiseFunction
from ui.widgets.SliderFloatWidge... | Python | 0.999594 | @@ -4273,128 +4273,8 @@
b)%0A
-%09%09self.colorFunction.AddRGBPoint(self.lowerBound, r, g, b)%0A%09%09self.colorFunction.AddRGBPoint(self.lowerBound+1, r, g, b)%0A
%09%09se
@@ -4325,16 +4325,16 @@
, g, b)%0A
+
%0A%09%09self.
@@ -4523,16 +4523,21 @@
erBound+
+0.000
1, 1)%0A%09%09
@@ -4585,10 +4585,8 @@
ound
--1
... |
ab93ea01dacc0fbd63fac91b1afcf5af1b711c2f | correct latest migration | umklapp/migrations/0009_teller_hasleft.py | umklapp/migrations/0009_teller_hasleft.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-31 19:39
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('umklapp', '0008_auto_20160528_2332'),
]
operations = [
migrations.AddField(
... | Python | 0.000002 | @@ -63,13 +63,13 @@
-31
-19:39
+20:38
%0Afro
@@ -424,11 +424,12 @@
ult=
-Tru
+Fals
e),%0A
|
dbd11fcc20f6770afa097e65d0a81c82b7f0c334 | Update tests with access token | mnubo/tests/test_auth_manager.py | mnubo/tests/test_auth_manager.py | from mnubo.api_manager import APIManager
import requests
import json
from requests import Response
from mock import MagicMock
def test_auth_maneger_init():
response = Response()
response._content = '{"access_token":"CLIENT_ACCESS_TOKEN","token_type":"Bearer","expires_in":3887999}'
requests.post = MagicMo... | Python | 0 | @@ -57,20 +57,24 @@
%0Aimport
-json
+datetime
%0Afrom re
@@ -125,16 +125,17 @@
icMock%0A%0A
+%0A
def test
@@ -217,39 +217,32 @@
%22access_token%22:%22
-CLIENT_
ACCESS_TOKEN%22,%22t
@@ -621,31 +621,24 @@
)%0A%0A auth.
-client_
access_token
@@ -651,23 +651,16 @@
h.fetch_
-client_
access_t
@@ -880,23 +880,16... |
aa203b23eec8ff9ccbde3678f01f4ee14f43a09f | Fix typo introduced by code quality patch | src/storage/sqlite.py | src/storage/sqlite.py | import collections
from threading import current_thread, enumerate as threadingEnumerate, RLock
import Queue
import time
from helper_sql import *
from storage import InventoryStorage, InventoryItem
class SqliteInventory(InventoryStorage):
def __init__(self):
super(self.__class__, self).__init__()
... | Python | 0.000003 | @@ -2335,17 +2335,23 @@
type ==
-t
+objectT
ype and
@@ -2541,17 +2541,23 @@
tag=?',
-t
+objectT
ype, tag
|
3405dc54b611b3d12583f0ff14f6b8d9e32a18a9 | Revert "fixed pipeline is dropping frames and GUI can't see any videos" | voctocore/lib/sources/decklinkavsource.py | voctocore/lib/sources/decklinkavsource.py | #!/usr/bin/env python3
import logging
import re
from gi.repository import Gst, GLib
from lib.config import Config
from lib.sources.avsource import AVSource
class DeckLinkAVSource(AVSource):
timer_resolution = 0.5
def __init__(self, name, has_audio=True, has_video=True):
super().__init__('DecklinkA... | Python | 0 | @@ -1776,43 +1776,8 @@
de%7D%0A
- drop-no-signal-frames=true%0A
%22%22%22.
|
c192e414c05266e555379564dcb50560c378265d | Fix for mediainfo on .bin files | mod_sample/media_info_parser.py | mod_sample/media_info_parser.py | import os
import traceback
import sys
from lxml import etree
import subprocess
import xmltodict
class InvalidMediaInfoError(Exception):
def __init__(self, message):
Exception.__init__(self)
self.message = message
class MediaInfoFetcher:
def __init__(self, sample):
from run import co... | Python | 0 | @@ -32,16 +32,53 @@
ort sys%0A
+from collections import OrderedDict%0A%0A
from lxm
@@ -2720,32 +2720,224 @@
k(self, track):%0A
+ if type(track) is not OrderedDict:%0A raise InvalidMediaInfoError('There is no useful information '%0A 'present in this MediaInfo f... |
ed863a5f792dcd11ef71361037fd19e022707821 | fix "get_app_template_dirs" | django_assets/loaders.py | django_assets/loaders.py | from django.conf import settings
from django import template
from webassets.loaders import GlobLoader, LoaderError
try:
set
except NameError:
from sets import Set as set
from django_assets.templatetags.assets import AssetsNode as AssetsNodeOriginal
try:
from django.templatetags.assets import AssetsNode as... | Python | 0.000004 | @@ -1988,38 +1988,20 @@
emplate.
-loaders.app_directorie
+util
s import
@@ -2001,16 +2001,20 @@
import
+get_
app_temp
@@ -2056,16 +2056,20 @@
.extend(
+get_
app_temp
@@ -2077,16 +2077,29 @@
ate_dirs
+('templates')
)%0A
|
f1fdc5b507af7fd0fbe6ef3bb1b3c9e997dc7626 | Fix a data format bug in get_trace.py | pw_trace_tokenized/py/pw_trace_tokenized/get_trace.py | pw_trace_tokenized/py/pw_trace_tokenized/get_trace.py | #!/usr/bin/env python3
# Copyright 2021 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | Python | 0.000006 | @@ -3003,17 +3003,16 @@
%0A %22%22%22
-
Get the
@@ -3072,26 +3072,17 @@
-result = %5C%0A
+service =
cli
@@ -3129,16 +3129,37 @@
eService
+%0A result = service
.GetTrac
@@ -3170,13 +3170,17 @@
a().
-get()
+responses
%0A
|
c5bfd55147e7fb18264f601c34e180453974f55e | DEBUG messages deleted | vt_manager/src/python/agent/provisioning/ProvisioningDispatcher.py | vt_manager/src/python/agent/provisioning/ProvisioningDispatcher.py | '''
@author: msune
Provisioning dispatcher. Selects appropiate Driver for VT tech
'''
from communications.XmlRpcClient import XmlRpcClient
from utils.VmMutexStore import VmMutexStore
import threading
class ProvisioningDispatcher:
@staticmethod
def __getProvisioningDispatcher(vtype):
#Import of Dispatchers ... | Python | 0.000001 | @@ -1315,276 +1315,8 @@
g):%0A
-%09%09print %22******************************************************************%5Cn%0A LEODEBUG: CURRENT THREAD: %22+str(threading.currentThread().get_ident())+%22%5Cn%0A *******************************************************************%22... |
a41de0b10a9416a290bbaf0b36c071cc0492439d | Fix check of send_sci sync_timeout parameter | devicecloud/sci.py | devicecloud/sci.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2015 Digi International, Inc.
"""Server Command Interface functionality"""
from devicecloud.apibase im... | Python | 0 | @@ -5763,20 +5763,16 @@
if
-not
sync_tim
@@ -5779,23 +5779,32 @@
eout is
+not
None
-or
+and not
isinsta
|
b78165d68e1e01e722b746e926a36b5680debdfa | remove email filter and rfactor | web/impact/impact/v1/views/mentor_program_office_hour_list_view.py | web/impact/impact/v1/views/mentor_program_office_hour_list_view.py | # MIT License
# Copyright (c) 2019 MassChallenge, Inc.
from impact.v1.views.base_list_view import BaseListView
from impact.v1.helpers import (
MentorProgramOfficeHourHelper,
)
LOOKUPS = {
'mentor_email': 'mentor__email__icontains',
'mentor_id': 'mentor_id',
'finalist_email': 'finalist__email__icontai... | Python | 0 | @@ -180,188 +180,8 @@
)%0A%0A%0A
-LOOKUPS = %7B%0A 'mentor_email': 'mentor__email__icontains',%0A 'mentor_id': 'mentor_id',%0A 'finalist_email': 'finalist__email__icontains',%0A 'finalist_id': 'finalist_id',%0A%7D%0A%0A%0A
clas
@@ -353,272 +353,188 @@
-if self.request.query_params.keys():%0A ... |
05b7f56bdfa600e72d4cca5a4c51324ff3c94d4d | Update file distancematrixtest.py | pymsascoring/distancematrix/test/distancematrixtest.py | pymsascoring/distancematrix/test/distancematrixtest.py | import unittest
__author__ = "Antonio J. Nebro"
class TestMethods(unittest.TestCase):
def setUp(self):
pass
if __name__ == '__main__':
unittest.main() | Python | 0.000001 | @@ -10,16 +10,87 @@
ittest%0A%0A
+from pymsascoring.distancematrix.distancematrix import DistanceMatrix%0A%0A
__author
@@ -188,16 +188,780 @@
pass%0A%0A
+ def test_should_default_gap_penalty_be_minus_eight(self):%0A matrix = DistanceMatrix()%0A%0A self.assertEqual(-8, matrix.get_gap_penalty())%0A%... |
720ee3792dc45f514d82108f217bb99e538ef98b | Fix export_to_dot for networkx package changes | taskflow/types/graph.py | taskflow/types/graph.py | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | Python | 0.000294 | @@ -702,16 +702,54 @@
x as nx%0A
+from networkx.drawing import nx_pydot%0A
import s
@@ -2003,32 +2003,38 @@
return nx
+_pydot
.to_pydot(self).
|
bd32faf934bd26957a16a0aa2ac092c5759d2342 | annotate new test | python/ql/test/experimental/dataflow/fieldflow/test.py | python/ql/test/experimental/dataflow/fieldflow/test.py | # These are defined so that we can evaluate the test code.
NONSOURCE = "not a source"
SOURCE = "source"
def is_source(x):
return x == "source" or x == b"source" or x == 42 or x == 42.0 or x == 42j
def SINK(x):
if is_source(x):
print("OK")
else:
print("Unexpected flow", x)
def SINK_F(x)... | Python | 0.004804 | @@ -911,32 +911,50 @@
SINK(myobj.foo)
+ # Flow not found
%0A%0A%0Adef test_exam
|
091ebd935c6145ac233c03bedeb52c65634939f4 | Include the version-detecting code to allow PyXML to override the "standard" xml package. Require at least PyXML 0.6.1. | Lib/xml/__init__.py | Lib/xml/__init__.py | """Core XML support for Python.
This package contains three sub-packages:
dom -- The W3C Document Object Model. This supports DOM Level 1 +
Namespaces.
parsers -- Python wrappers for XML parsers (currently only supports Expat).
sax -- The Simple API for XML, developed by XML-Dev, led by David
Meggins... | Python | 0 | @@ -409,68 +409,374 @@
%22%0A%0A%0A
-try:%0A import _xmlplus%0Aexcept ImportError:%0A pass%0Aelse:%0A
+__all__ = %5B%22dom%22, %22parsers%22, %22sax%22%5D%0A%0A__version__ = %22$Revision$%22%5B1:-1%5D.split()%5B1%5D%0A%0A%0A_MINIMUM_XMLPLUS_VERSION = (0, 6, 1)%0A%0A%0Atry:%0A import _xmlplus%0Aexcept ImportEr... |
3f0fc980629f0645acb813b2ef8ed5d91761cbcc | add missing pkgconfig dependency and fix boost version range (#9835) | var/spack/repos/builtin/packages/wt/package.py | var/spack/repos/builtin/packages/wt/package.py | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Wt(CMakePackage):
"""Wt, C++ Web Toolkit.
Wt is a C++ library for developing web appl... | Python | 0 | @@ -1803,24 +1803,66 @@
ibfcgi++')%0A%0A
+ depends_on('pkgconfig', type='build')%0A
depends_
@@ -1878,16 +1878,20 @@
@1.46.1:
+1.65
')%0A d
|
308b3f9b2b8a4f2be9bfc09f0c026b54880ec94c | Remove unwanted print statement | gemdeps/views.py | gemdeps/views.py | import json
import os
from flask import Markup, render_template, request
from gemdeps import app
@app.route('/', methods=['GET', 'POST'])
def index():
completedeplist = {}
gemnames = []
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
for app in ['diaspora', 'gitlab', 'asciinema']:
ap... | Python | 0.000034 | @@ -708,34 +708,8 @@
es)%0A
- print completedeplist%0A
|
3fe92a109ce6a21e98ee3c6a6c604d3e59cc2854 | Update export script | src/scripts/export_data.py | src/scripts/export_data.py | # Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0 | @@ -1578,32 +1578,34 @@
args.allowlist)%0A
+#
sources_google_t
@@ -1621,32 +1621,34 @@
ig.read_config(%0A
+#
cc_by=False,
@@ -1733,16 +1733,18 @@
owlist)%0A
+#
google_s
@@ -1847,16 +1847,18 @@
aset'%5D%7D%0A
+#
google_m
@@ -5721,32 +5721,34 @@
by-nc data.')%0A%0A
+#
export_utils.exp
@@ -5839,24 +583... |
49fafd2107719f0d0c588e85bb8c37a9d60a0845 | Fix PEP8 and remove pdb | sponsorship_tracking/wizard/sub_sponsorship_wizard.py | sponsorship_tracking/wizard/sub_sponsorship_wizard.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __open... | Python | 0.000001 | @@ -466,18 +466,8 @@
_%0D%0A
-import pdb
%0D%0A%0D%0A
@@ -1475,20 +1475,16 @@
%5D%0D%0A
-
%0D%0A de
@@ -2299,33 +2299,8 @@
id%0D%0A
- pdb.set_trace()%0D%0A
|
48f593bae26e1a587789a41aa82f9f984271bb4c | add check mode to dhcp_server | library/mt_dhcp_server.py | library/mt_dhcp_server.py | # -*- coding: utf-8 -*-
DOCUMENTATION = '''
module: mt_dhcp_server.py
author:
- "Valentin Gurmeza"
version_added: "2.4"
short_description: Manage mikrotik dhcp-server endpoints
requirements:
- mt_api
description:
- Mikrotik dhcp-server generic module
options:
hostname:
description:
- hotstname of mikr... | Python | 0 | @@ -1871,24 +1871,54 @@
),%0A )
+,%0A supports_check_mode=True
%0A )%0A%0A
@@ -2687,16 +2687,62 @@
eter'%5D),
+%0A check_mode = module.check_mode,
%0A%0A )%0A
|
7cebbd615544dc165d6711833747bc978c3bd2d6 | fix call | dihedral_mutinf.py | dihedral_mutinf.py | import numpy as np
import mdtraj as md
import argparse
import cPickle
import time
from multiprocessing import Pool
from itertools import combinations_with_replacement as combinations
from sklearn.metrics import mutual_info_score
from contextlib import closing
class timing(object):
"Context manager for printing pe... | Python | 0.000001 | @@ -958,20 +958,19 @@
def __c
-lass
+all
__(self,
|
c7a657f0ab2c39a66ed35056a8df976c913ea3c9 | Allow SparseBasis to take a specific op basis | src/pysme/sparse_system_builder.py | src/pysme/sparse_system_builder.py | """Construct integrators using sparse arrays.
"""
import numpy as np
import sparse
from sparse import COO
import pysme.gellmann as gm
def sparse_real(sparse_array):
"""`numpy.conjugate` returns a sparse array, but numpy.real does not, so
use this function to get a sparse real part.
"""
return (spar... | Python | 0 | @@ -629,33 +629,168 @@
dim
-):%0A self.dim = dim
+, basis=None):%0A if basis is None:%0A self.dim = dim%0A basis = gm.get_basis(dim)%0A else:%0A self.dim = basis%5B0%5D.shape%5B0%5D
%0A
@@ -831,33 +831,21 @@
p.array(
-gm.get_basis(dim)
+basis
))%0A
|
05916ed32ec9206baff2dd917440569bbae8c106 | Update tutorials/future/tf2/cifar10_tutorial.py | tutorials/future/tf2/cifar10_tutorial.py | tutorials/future/tf2/cifar10_tutorial.py | import numpy as np
import math
import numpy as np
import tensorflow as tf
import tensorflow_datasets as tfds
from absl import app, flags
from easydict import EasyDict
from tensorflow.keras import Model
from tensorflow.keras.layers import AveragePooling2D, Dense, Flatten, Conv2D, MaxPool2D
from cleverhans.future.tf2.at... | Python | 0 | @@ -1549,69 +1549,417 @@
ue)%0A
- mnist_train, mnist_test = dataset%5B'train'%5D, dataset%5B'test'%5D
+%0A def augment_mirror(x):%0A return tf.image.random_flip_left_right(x)%0A%0A def augment_shift(x, w=4):%0A y = tf.pad(x, %5B%5Bw%5D * 2, %5Bw%5D * 2, %5B0%5D * 2%5D, mode='REFLECT')%0A return t... |
3a27568211c07cf614aa9865a2f08d2a9b9bfb71 | Return errors in json only | dinosaurs/views.py | dinosaurs/views.py | import os
import json
import httplib as http
import tornado.web
import tornado.ioloop
from dinosaurs import api
from dinosaurs import settings
class SingleStatic(tornado.web.StaticFileHandler):
def initialize(self, path):
self.dirname, self.filename = os.path.split(path)
super(SingleStatic, self... | Python | 0.000002 | @@ -663,32 +663,186 @@
equestHandler):%0A
+ def write_error(self, status_code, **kwargs):%0A self.finish(%7B%0A %22code%22: status_code,%0A %22message%22: self._reason,%0A %7D)%0A%0A
def post(sel
@@ -1230,32 +1230,49 @@
p.BAD_REQUEST)%0A%0A
+ try:%0A
ret... |
be912178ca6a15a69f6479f71a9561a08bc3d301 | use hostnames in cbcollectinfo archives | perfrunner/tests/__init__.py | perfrunner/tests/__init__.py | import exceptions as exc
import os
import shutil
import time
from logger import logger
from perfrunner.helpers.cbmonitor import CbAgent
from perfrunner.helpers.experiments import ExperimentHelper
from perfrunner.helpers.memcached import MemcachedHelper
from perfrunner.helpers.metrics import MetricHelper
from perfrunn... | Python | 0 | @@ -25,18 +25,20 @@
%0Aimport
-os
+glob
%0Aimport
@@ -5532,46 +5532,70 @@
-self.reporter.save_web_logs()%0A
+for hostname in self.cluster_spec.yield_hostnames():%0A
for
@@ -5594,167 +5594,160 @@
+
for
-root, _, files in os.walk('.'):%0A for f in files:%0A if f... |
c9f25b7fb983c3d635ab7f13f350a53422059a8c | Handle errors in reloaded code | cpp/pineal-run.py | cpp/pineal-run.py | #!/usr/bin/env python
from __future__ import print_function
import os
from time import sleep
from sys import argv
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import hy
from pineal.hy_utils import run_hy_code
def update_file(file_name, ns, history):
"Update running ... | Python | 0.000001 | @@ -107,17 +107,31 @@
rt argv%0A
+import logging
%0A
-
from wat
@@ -265,16 +265,519 @@
y_code%0A%0A
+logger = logging.getLogger(%22pineal-run%22)%0Alogger.setLevel(logging.INFO)%0Alogger.addHandler(logging.StreamHandler())%0A%0A%0Adef run_code(ns, history):%0A %22Run last code in the history, if available%22%0A ... |
ae241ec7ecc75e9b66c2f47a97d7786f984e2470 | Fix prices query | db.py | db.py | import os
import psycopg2
import urlparse # import urllib.parse for python 3+
class model:
def __init__(self, uri):
parsed = urlparse.urlparse(uri)
username = parsed.username
password = parsed.password
database = parsed.path[1:]
hostname = parsed.hostname
... | Python | 0.999991 | @@ -4491,16 +4491,262 @@
r prices
+ are for return tickets%0A # which may have different outbound and inbound carriers%0A # therefore we need to match both directions of a quote separately, and use DISTINCT to deduplicate%0A # when they happen to be the same carrier
%0A
|
f574e19b14ff861c45f6c66c64a2570bdb0e3a3c | Apply change of file name | crawl_comments.py | crawl_comments.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__doc__ = '''
Crawl comment from nicovideo.jp
Usage:
main_crawl.py [--sqlite <sqlite>] [--csv <csv>]
Options:
--sqlite <sqlite> (optional) path of comment DB [default: comments.sqlite3]
--csv <csv> (optional) path of csv file contains urls of videos ... | Python | 0.000001 | @@ -103,18 +103,22 @@
-main_
crawl
+_comments
.py
|
3bc4fa33c3ec9272fed565260677518dcf5957fe | change version to 0.10.0.dev0 | csaps/_version.py | csaps/_version.py | # -*- coding: utf-8 -*-
__version__ = '0.9.0'
| Python | 0.000006 | @@ -39,9 +39,15 @@
'0.
-9.
+10.0.dev
0'%0A
|
214d4de14324e0097bad9bfb8b3b0fb009368abd | Add a docstring for EmptyInterval class | src/tempo/interval.py | src/tempo/interval.py | # coding=utf-8
"""Provides Interval class and EmptyInterval singleton value."""
class Interval(object):
"""
Interval(stop)
Interval(start, stop)
Represents an interval between two numbers.
Parameters
----------
start : decimal.Decimal or float or int
Start of the interval.
st... | Python | 0.000001 | @@ -3310,16 +3310,68 @@
terval):
+%0A %22%22%22A class of EmptyInterval singleton value.%22%22%22
%0A%0A __
|
3bb9c0aacdfff372e41d7a8d4c43e71535bff930 | Remove perf regression in not yet finished size estimation code | sdks/python/google/cloud/dataflow/worker/opcounters.py | sdks/python/google/cloud/dataflow/worker/opcounters.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | Python | 0.000001 | @@ -716,69 +716,8 @@
rt%0A%0A
-from google.cloud.dataflow.utils.counters import Accumulator%0A
from
@@ -769,16 +769,16 @@
Counter%0A
+
%0A%0Aclass
@@ -1227,43 +1227,8 @@
oder
-%0A self._active_accumulators = %5B%5D
%0A%0A
@@ -1362,132 +1362,59 @@
-byte_size_accumulator = Accumulator(self.mean_byte_cou... |
7a456cda2c39280f6facf273edb647badb78cc1e | Fix docstring | src/adhocracy_frontend/adhocracy_frontend/tests/acceptance/shared.py | src/adhocracy_frontend/adhocracy_frontend/tests/acceptance/shared.py | """Shared acceptance test functions."""
from random import choice
from time import sleep
import requests
import json
from splinter.driver.webdriver import WebDriverElement
from adhocracy_core.testing import god_login
from adhocracy_core.testing import god_password
from adhocracy_core.testing import annotator_password... | Python | 0.000002 | @@ -2254,35 +2254,41 @@
):%0A %22%22%22Login
-god
+annotator
user.%22%22%22%0A lo
|
6c57985a4f214978af59479ade330d829a02f457 | Add Event.tags | src/sentry/models/event.py | src/sentry/models/event.py | """
sentry.models.event
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import warnings
from django.db import models
from django.utils import timezone
from django.utils.datastructur... | Python | 0.000001 | @@ -4764,16 +4764,47 @@
urn %5B%5D%0A%0A
+ tags = property(get_tags)%0A%0A
def
|
4920391c4e6d690264ebc0bb829ad9b9a374917d | math is hard | services/extract-entities/entityextractor/aggregate.py | services/extract-entities/entityextractor/aggregate.py | import logging
from banal import ensure_list
from collections import Counter
from alephclient.services.entityextract_pb2 import ExtractedEntity
from entityextractor.extract import extract_polyglot, extract_spacy
from entityextractor.patterns import extract_patterns
from entityextractor.cluster import Cluster
log = l... | Python | 0.998297 | @@ -1478,16 +1478,20 @@
ters if
+not
c.strict
@@ -1493,16 +1493,67 @@
trict%5D)%0A
+ total_weight = float(max(1, total_weight))%0A
|
aab7c01c94088594258e33e3074f76d8735b8c2e | Add default config and config schema | mopidy/frontends/mpd/__init__.py | mopidy/frontends/mpd/__init__.py | from __future__ import unicode_literals
import mopidy
from mopidy import ext
__doc__ = """The MPD server frontend.
MPD stands for Music Player Daemon. MPD is an independent project and server.
Mopidy implements the MPD protocol, and is thus compatible with clients for the
original MPD server.
**Dependencies:**
- ... | Python | 0 | @@ -71,16 +71,804 @@
ort ext%0A
+from mopidy.utils import config, formatting%0A%0A%0Adefault_config = %22%22%22%0A%5Bext.mpd%5D%0A%0A# If the MPD extension should be enabled or not%0Aenabled = true%0A%0A# Which address the MPD server should bind to%0A#%0A# 127.0.0.1%0A# Listens only on the IPv4 loopback interface%... |
43653246bfdcf78e76bb41846fbf80ac2e5dc0f2 | Use declared_attr for ColorMixin columns | indico/core/db/sqlalchemy/colors.py | indico/core/db/sqlalchemy/colors.py | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | Python | 0 | @@ -776,17 +776,16 @@
string%0A
-%0A
from col
@@ -812,16 +812,70 @@
dtuple%0A%0A
+from sqlalchemy.ext.declarative import declared_attr%0A%0A
from ind
@@ -2476,20 +2476,62 @@
-text_color =
+@declared_attr%0A def text_color(cls):%0A return
db.
@@ -2538,32 +2538,36 @@
Column(%0A
+
+
db... |
e92a177124400c932e58e3980371837b82d64e20 | Clean up | maxfilter_from_db.py | maxfilter_from_db.py | """
Doc string here.
@author: cjb
@author: mje
last edited: Wed Sep 9 2015
"""
from __future__ import print_function
import os
import sys
import subprocess
# import subprocess
# import numpy as np
# from mne.preprocessing.maxfilter import apply_maxfilter
CLOBBER = False
FAKE = False
VERBOSE = True
# ENH: install "... | Python | 0.000002 | @@ -1029,19 +1029,17 @@
to_isis%22
-
%0A
+
proj_cod
@@ -1220,16 +1220,21 @@
filtered
+_data
/')%0A%0Asub
@@ -1419,17 +1419,16 @@
jects =
-%5B
included
@@ -1438,17 +1438,17 @@
bjects%5B3
-%5D
+:
%5D%0A%0Afor s
@@ -2070,24 +2070,25 @@
%22data%22)%0A
-#
+
+#
print(o
@@ -2096,20 +2096,16 @@
t_name... |
2b50fd475829aa25889b49da4d4a2dcdcece9893 | Remove unused imports. | src/Products/UserAndGroupSelectionWidget/at/widget.py | src/Products/UserAndGroupSelectionWidget/at/widget.py | import types
from zope.component import ComponentLookupError
from Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.Archetypes.Widget import TypesWidget
from Products.Archetypes.Registry import registerWidget
from Products.Archetypes.utils import shasattr
from Products.UserAndG... | Python | 0 | @@ -6,17 +6,16 @@
t types%0A
-%0A
from zop
@@ -57,45 +57,8 @@
rror
-%0A%0Afrom Globals import InitializeClass
%0Afro
@@ -209,56 +209,8 @@
get%0A
-from Products.Archetypes.utils import shasattr%0A%0A
from
@@ -291,17 +291,16 @@
lation%0A%0A
-%0A
class Us
@@ -2643,8 +2643,9 @@
ld', ))%0A
+%0A
|
317926c18ac2e139d2018acd767d10b4f53428f3 | Remove unneeded post method from CreateEnvProfile view | installer/installer_config/views.py | installer/installer_config/views.py | from django.shortcuts import render
from django.shortcuts import render_to_response
from django.views.generic import CreateView, UpdateView, DeleteView
from installer_config.models import EnvironmentProfile, UserChoice, Step
from installer_config.forms import EnvironmentForm
from django.core.urlresolvers import reverse... | Python | 0 | @@ -318,53 +318,9 @@
rse%0A
-from django.http import HttpResponseRedirect
%0A
+
%0Acla
@@ -653,423 +653,8 @@
)%0A%0A%0A
- def post(self, request, *args, **kwargs):%0A form_class = self.get_form_class()%0A form = form_class(request.POST)%0A if form.is_valid():%0A config_profile = f... |
c24dbc2d4d8b59a62a68f326edb350b3c633ea25 | Change the comment of InterleavingMethod.evaluate | interleaving/interleaving_method.py | interleaving/interleaving_method.py | class InterleavingMethod(object):
'''
Interleaving
'''
def interleave(self, k, a, b):
'''
k: the maximum length of resultant interleaving
a: a list of document IDs
b: a list of document IDs
Return an instance of Ranking
'''
raise NotImplementedErr... | Python | 0.000001 | @@ -748,36 +748,41 @@
urn
-one of the following tupl
+a list of pairs of ranker indic
es
-:
%0A
@@ -790,89 +790,186 @@
-- (1, 0): Ranking 'a' won%0A - (0, 1): Ranking 'b' won%0A - (0, 0): Tie
+in which element (i, j) indicates i won j.%0A%0A e.g. a result %5B(1, 0), (2, 1), (2, 0)%5D i... |
0e36a18ced74b3d7e1195994702305c26ac57dfa | Change gift and link it to correspondent | sponsorship_compassion/wizards/generate_gift_wizard.py | sponsorship_compassion/wizards/generate_gift_wizard.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manif... | Python | 0 | @@ -4392,31 +4392,37 @@
': contract.
-partner
+correspondant
_id.id,%0D%0A
|
e94af78bbeae26933d987494e628b18e201f8da2 | fix logger error message | spotseeker_server/management/commands/sync_techloan.py | spotseeker_server/management/commands/sync_techloan.py | # Copyright 2022 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
import logging
from django.core.management.base import BaseCommand
from django.conf import settings
from schema import Schema
from .techloan.techloan import Techloan
from .techloan.spotseeker import Spots
logger = logging.getLog... | Python | 0.000005 | @@ -858,16 +858,17 @@
r.error(
+f
%22Setting
@@ -888,13 +888,18 @@
ed:
-%22, ex
+%7Bstr(ex)%7D%22
)%0A
|
a9bcbe8bf69403dbf7780843fe362cf8e1f02c95 | update tree topo | mininet/tree/tree.py | mininet/tree/tree.py | #!/usr/bin/env python
from mininet.cli import CLI
from mininet.link import Link
from mininet.net import Mininet
from mininet.node import RemoteController
from mininet.term import makeTerm
def ofp_version(switch, protocols):
protocols_str = ','.join(protocols)
command = 'ovs-vsctl set Bridge %s protocols=%s' % (swi... | Python | 0.000001 | @@ -61,12 +61,12 @@
net.
-link
+node
imp
@@ -182,16 +182,47 @@
akeTerm%0A
+from functools import partial%0A%0A
def ofp_
@@ -448,16 +448,25 @@
troller=
+partial(
RemoteCo
@@ -473,16 +473,46 @@
ntroller
+, ip='10.42.0.27', port=6633 )
)%0A c0 =
@@ -798,24 +798,31 @@
st('h4')%0A%0A
+net.add
Link(s1, h1)
@@ ... |
e2e57a89b63943857eb2954d0c5bdcf8e2191ff4 | simplify logic for player count requirement | mk2/plugins/alert.py | mk2/plugins/alert.py | import os
import random
from mk2.plugins import Plugin
from mk2.events import Hook, StatPlayerCount
class Alert(Plugin):
interval = Plugin.Property(default=200)
command = Plugin.Property(default="say {message}")
path = Plugin.Property(default="alerts.txt")
min_pcount = Plugin.Property(default=0)... | Python | 0.000011 | @@ -694,18 +694,39 @@
-if
+self.requirements_met =
event.p
@@ -762,106 +762,8 @@
ount
-:%0A self.requirements_met = True%0A else:%0A self.requirements_met = False
%0A%0A
|
cf79b0f8c1d2099927db9b1021d3e5263c591709 | Create RooArgList of RooConstVas from list in rf316_llratioplot | tutorials/roofit/rf316_llratioplot.py | tutorials/roofit/rf316_llratioplot.py | ## \file
## \ingroup tutorial_roofit
## \notebook
## Multidimensional models: using the likelihood ratio techique to construct a signal
## enhanced one-dimensional projection of a multi-dimensional pdf
##
## \macro_code
##
## \date February 2018
## \authors Clemens Lange, Wouter Verkerke (C++ version)
import ROOT
# ... | Python | 0 | @@ -981,80 +981,21 @@
x,
-ROOT.RooArgList(ROOT.RooFit.RooConst(
+%5B
-0.1
-)
,
-ROOT.RooFit.RooConst(
0.004
-))
+%5D
)%0Apy
@@ -1035,80 +1035,21 @@
y,
-ROOT.RooArgList(ROOT.RooFit.RooConst(
+%5B
0.1
-)
,
-ROOT.RooFit.RooConst(
-0.004
-))
+%5D
)%0Apz
|
7aca118be8db36370ff793b6cbedecb050dc869d | Change control plugin name to 'control'. | twisted/plugins/automatron_control.py | twisted/plugins/automatron_control.py | from twisted.internet import defer
from zope.interface import classProvides, implements
from automatron.command import IAutomatronCommandHandler
from automatron.plugin import IAutomatronPluginFactory, STOP
class AutomatronControlPlugin(object):
classProvides(IAutomatronPluginFactory)
implements(IAutomatronCom... | Python | 0 | @@ -343,15 +343,8 @@
= '
-notify_
cont
|
9c2fe0b1d894e2423a2efe750415c2284ee0488f | Fix representative choice. | ueberwachungspaket/representatives.py | ueberwachungspaket/representatives.py | from json import load
from random import choice
class Representatives():
def __init__(self):
self.parties = load_parties()
self.teams = load_teams()
self.representatives = load_representatives("representatives.json", self.parties, self.teams)
self.government = load_representatives("... | Python | 0.000002 | @@ -519,16 +519,32 @@
choice(
+%5Brep for rep in
self.rep
@@ -555,16 +555,38 @@
ntatives
+ if rep.team == %22spy%22%5D
)%0A%0A
|
1519d9dc2f483671aee0f92252dd839a4d7af9c3 | Add About page TemplateView | painindex_app/urls.py | painindex_app/urls.py | from django.conf.urls import patterns, url
from django.views.generic import TemplateView, FormView
from painindex_app import views
urlpatterns = patterns('',
url(r'^$', views.homepage, name='homepage'),
url(r'^painsource/(?P<painsource_id>\d+)/$', views.painsource_detail, name='painsource_detail'),
# url(... | Python | 0 | @@ -198,24 +198,124 @@
homepage'),%0A
+ url(r'%5Eabout/$', TemplateView.as_view(template_name='painindex_app/about.html'), name='about'),%0A
url(r'%5Ep
@@ -555,25 +555,24 @@
ainreport'),
-%0A
%0A
|
09c8e9b11c584dcc03518fb5655d040db8ad63a6 | Add an extra cylinder to raw HD images to work around grub problem. (RBL-8292) | jobslave/generators/raw_hd_image.py | jobslave/generators/raw_hd_image.py | #
# Copyright (c) 2011 rPath, Inc.
#
# All Rights Reserved
#
import logging
import os
from jobslave import lvm
from jobslave.generators import bootable_image, constants
from jobslave.geometry import FSTYPE_LINUX, FSTYPE_LINUX_LVM
from jobslave.util import logCall, divCeil
from conary.lib import util
log = logging.g... | Python | 0 | @@ -3079,24 +3079,223 @@
n(lvmSize)%0A%0A
+ # Add one cylinder to the disk to work around grub/VMware/BIOS bugs%0A # and/or a misunderstanding by this developer of how partition table%0A # sizes are calculated, see RBL-8292.%0A
tota
@@ -3298,24 +3298,30 @@
totalSize =
+align(
rootEnd +... |
9e74874f3bc96f1d514ad6765e60910950ac9ee7 | switch to paho-mqtt | mqtt_randompub/mqtt_randompub.py | mqtt_randompub/mqtt_randompub.py | # This file is part of mqtt-randompub
#
# Copyright (c) 2013-2014, Fabian Affolter <fabian@affolter-engineering.ch>
# Released under the MIT license. See LICENSE file for details.
#
import random
import time
import sys
import os
import signal
import itertools
import mosquitto
import opthandling
def send(broker, port... | Python | 0.000005 | @@ -258,24 +258,138 @@
ls%0A%0A
-import mosquitto
+try:%0A import paho.mqtt.client as mqtt%0Aexcept ImportError:%0A print 'Please install the paho-mqtt module to use mqtt-randompub'
%0A%0Aim
@@ -564,26 +564,18 @@
= m
-osquitto.Mosquitto
+qtt.Client
(%22mq
|
e2c0fbd32514147cbb98d184c89437885757c98a | Remove spurious print from filters processing. | nengo_spinnaker/utils/filters.py | nengo_spinnaker/utils/filters.py | import collections
import itertools
import numpy as np
from . import fixpoint as fp
from vertices import (region_pre_sizeof, region_sizeof, region_write,
region_pre_prepare, region_post_prepare)
FilterItem = collections.namedtuple('FilterItem', ['time_constant',
... | Python | 0 | @@ -3904,47 +3904,8 @@
gth%0A
- print self.__subvertex_filter_keys%0A
|
40705a39292d0080126933b2318d20ef1a4499a2 | Remove obsolete input. | lobster/cmssw/data/job.py | lobster/cmssw/data/job.py | #!/usr/bin/env python
import base64
import json
import os
import pickle
import shutil
import subprocess
import sys
fragment = """import FWCore.ParameterSet.Config as cms
process.source.fileNames = cms.untracked.vstring({input_files})
process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1))
process.sour... | Python | 0.000183 | @@ -20,22 +20,8 @@
on%0A%0A
-import base64%0A
impo
|
efe75d083093bf7a421234831e27d661ef93dfdb | add labels and kwargs' | cupyx/time.py | cupyx/time.py | import time
import numpy
import cupy
from cupy import util
class _PerfCaseResult(object):
def __init__(self, name, ts):
assert ts.ndim == 2 and ts.shape[0] == 2 and ts.shape[1] > 0
self.name = name
self._ts = ts
@property
def cpu_times(self):
return self._ts[0]
@pro... | Python | 0 | @@ -757,16 +757,49 @@
ts%5B%5B0%5D%5D%0A
+ devices = %5B%22CPU%22, %22GPU%22%5D%0A
@@ -859,16 +859,52 @@
'.join(%5B
+devices%5Bi%5D + %22: %22%0A +
self._to
@@ -922,21 +922,37 @@
em(t
+s%5Bi%5D
) for
-t
+i
in
-ts
+range(len(ts))
%5D))%0A
@@ -1044,16 +1044,27 @@
args=(),
+ kwa... |
85769162560d83a58ccc92f818559ddd3dce2a09 | Fix another bug in the authentication | pages/index.py | pages/index.py | import web
from modules.base import renderer
from modules.login import loginInstance
from modules.courses import Course
#Index page
class IndexPage:
#Simply display the page
def GET(self):
if loginInstance.isLoggedIn():
userInput = web.input();
if "logoff" in userInput:
... | Python | 0.000005 | @@ -432,18 +432,29 @@
-courses =
+return renderer.main(
Cour
@@ -478,53 +478,8 @@
ds()
-%0A return renderer.main(courses
)%0A
@@ -759,16 +759,41 @@
er.main(
+Course.GetAllCoursesIds()
)%0A
|
f7cfa7ec75243dbc4dc6cf75155d8083df504692 | extend benchmark for lights | mpf/benchmarks/test_benchmark_light_shows.py | mpf/benchmarks/test_benchmark_light_shows.py | import time
from functools import partial
from mpf.core.logging import LogMixin
from mpf.tests.MpfGameTestCase import MpfGameTestCase
class BenchmarkLightShows(MpfGameTestCase):
def getConfigFile(self):
return 'config.yaml'
def getMachinePath(self):
return 'benchmarks/machine_files/shows/'... | Python | 0 | @@ -2250,134 +2250,514 @@
-start = time.time()%0A for i in range(num):%0A self.post_event(event)%0A self.advance_time_and_run(.01)
+channel_list = %5B%5D%0A for light in self.machine.lights.values():%0A for color, channels in light.hw_drivers.items():%0A ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.