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 |
|---|---|---|---|---|---|---|---|
7b9f1fa42927932ae9cb54e46c1d3727eaa5a1fa | Add an exposedProperties property to tool | UM/Tool.py | UM/Tool.py | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Signal import Signal, SignalEmitter
from UM.PluginObject import PluginObject
from UM.Event import Event
from UM.Scene.Selection import Selection
import UM.Application # Circular dependency blah
## Abstract base... | Python | 0 | @@ -739,39 +739,238 @@
one%0A
-%0A propertyChanged = Signal()
+ self._exposed_properties = %5B%5D%0A%0A propertyChanged = Signal()%0A%0A def getExposedProperties(self):%0A return self._exposed_properties%0A%0A def setExposedProperties(self, *args):%0A self._exposed_properties = args
%... |
90b602a1965418efef706c92bc4da8fc14e013d9 | Change cache policy to only include analytics api endpoints | data_aggregator/cache.py | data_aggregator/cache.py | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from gcs_clients import RestclientGCSClient
FOREVER = 0
class DataAggregatorGCSCache(RestclientGCSClient):
def get_cache_expiration_time(self, service, url, status=None):
if "canvas" == service:
return FO... | Python | 0 | @@ -81,16 +81,26 @@
he-2.0%0A%0A
+import re%0A
from gcs
@@ -302,16 +302,81 @@
ervice:%0A
+ if re.match(r'%5E.*/api/v1/.*/analytics/.*', url):%0A
|
05ab8c591f487aec84b68832393cd2fdca68ef38 | Implement secure RBAC for auto_allocated_topology API | neutron/conf/policies/auto_allocated_topology.py | neutron/conf/policies/auto_allocated_topology.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed u... | Python | 0 | @@ -678,16 +678,130 @@
t_id%7D'%0A%0A
+DEPRECATION_REASON = (%0A %22The Auto allocated topology API now supports system scope %22%0A %22and default roles.%22)%0A
%0Arules =
@@ -845,16 +845,21 @@
+name=
'get_aut
@@ -893,42 +893,69 @@
-base.RULE_ADMIN_OR_OWNER,%0A
+check_str=base.SYSTEM_O... |
614b02bc0c0c2b19d24741ce0e3bedce32098fa7 | Use a fixture. | tests/test_slugify.py | tests/test_slugify.py | """Test slugify."""
import nikola.utils
def test_ascii():
"""Test an ASCII-only string."""
o = nikola.utils.slugify(u'hello', lang='en')
assert o == u'hello'
assert isinstance(o, nikola.utils.unicode_str)
def test_ascii_dash():
"""Test an ASCII string, with dashes."""
o = nikola.utils.slugi... | Python | 0 | @@ -35,16 +35,31 @@
.utils%0A%0A
+import pytest%0A%0A
%0Adef tes
@@ -1453,16 +1453,30 @@
isarmed(
+disarm_slugify
):%0A %22
@@ -1507,45 +1507,8 @@
%22%22%22%0A
- nikola.utils.USE_SLUGIFY = False%0A
@@ -1675,44 +1675,8 @@
tr)%0A
- nikola.utils.USE_SLUGIFY = True%0A
%0A%0Ade
@@ -1697,16 +1697,30 @@
... |
1cbf563af368280cd789160fe388bc1b0b0280f4 | Add dict to json. | airwaveapiclient/airwaveapiclient.py | airwaveapiclient/airwaveapiclient.py | # -*- coding: utf-8 -*-
"""airwaveapiclient."""
import xmltodict
import requests
class AirWaveAPIClient(object):
"""Aruba networks Air Wave API client.
"""
def __init__(self, **kwargs):
"""Constructor."""
self.username = kwargs['username']
self.password = kwargs['password']
... | Python | 0 | @@ -77,16 +77,28 @@
equests%0A
+import json%0A
%0A%0Aclass
@@ -2656,8 +2656,130 @@
se(xml)%0A
+%0A @staticmethod%0A def dict_to_json(dict_obj):%0A %22%22%22Change dict to json.%22%22%22%0A return json.dumps(dict_obj)%0A
|
c292a4e0c05f935a3850b2291af662b869026178 | include link to issue for github api limitations | data_processor/github.py | data_processor/github.py | import datetime
import gzip
import json
import os
import requests
import sys
import urllib
import re
from pprint import pprint
def parse_events(path, gz=False, predicate=None):
"""
Takes in a .json[.gz] file with one json entry per line and
returns a list of events that match the given predicate or
al... | Python | 0 | @@ -2392,18 +2392,19 @@
itations
- w
+. W
hen they
@@ -2436,16 +2436,71 @@
is out.%0A
+ # https://github.com/uberVU/elasticboard/issues/42%0A
whil
|
5cc57e7d9d7ff08d7204935e3112f343903c22a5 | Update logwachstum.pyde | sketches/logwachstum/logwachstum.pyde | sketches/logwachstum/logwachstum.pyde | # Logistisches Wachstum
import math
WIDTH = 720
HEIGHT = 450
dt = 0.05
# Zeichenbereich
plot_x1 = 120
plot_x2 = WIDTH - 80 # WIDTH - plot_x1
label_x = 50
plot_y1 = 60
plot_y2 = HEIGHT - plot_y1
label_y = HEIGHT - 25
# Titel
plot_title = u"Logistisches Wachstum"
# Funktionsabhängige Konstanten
x_min = 0
x_max = 25... | Python | 0.000001 | @@ -1099,19 +1099,19 @@
exp(
-r*
t)*(
-K
+1
- t
+/K
))%0A%0A
|
38c667691f7d801a8a50614865336f8e3f3f230d | change reference to md5sums | tests/test_sources.py | tests/test_sources.py |
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
import os
import errno
import random
import unittest
from argparse import Namespace
from io import StringIO
from tldptesttools import TestToolsFilesystem
# -- Test Data
import example
# -- SUT
from tldp.sources... | Python | 0 | @@ -5303,16 +5303,15 @@
doc.
-statinfo
+md5sums
)%0A%0A
|
b5e4d0c42947260bcc6e2e033f6a6dd294edfa39 | Use snake_case for final PDF and folder name | create_books.py | create_books.py | """Creates a PDF from an article of the project „Mathe für Nicht-Freaks“."""
import os
import shelve
import requests
from mfnf.api import HTTPMediaWikiAPI
from mfnf.parser import ArticleParser
from mfnf.utils import CachedFunction
from mfnf.sitemap import parse_sitemap
from mfnf.latex import LatexExporter, MediaWiki... | Python | 0 | @@ -319,16 +319,53 @@
ki2Latex
+%0Afrom mfnf.utils import to_snake_case
%0A%0A# titl
@@ -553,24 +553,68 @@
a book.%22%22%22%0A
+ book_name = to_snake_case(book%5B%22name%22%5D)%0A
target =
@@ -642,30 +642,24 @@
book
-%5B%22
+_
name
-%22%5D
, book
-%5B%22
+_
name
-%22%5D
+ %22
|
4b3e1a1fa2dadcccd65d974a27c72169a68c6a61 | Add subtraction and scalar multiplication tests for Terrain | tests/test_terrain.py | tests/test_terrain.py | import unittest
from randterrainpy import *
class TerrainTesterPy(unittest.TestCase):
def setUp(self):
self.ter1 = Terrain(1, 1)
self.ter2 = Terrain(2, 4)
self.ter3 = Terrain(1, 1)
def test_getitem(self):
self.assertEqual(self.ter1[0, 0], 0)
self.assertEqual(self.ter2... | Python | 0.000004 | @@ -500,17 +500,19 @@
0, 0%5D =
-1
+0.9
%0A
@@ -546,17 +546,19 @@
%5B0, 0%5D,
-1
+0.9
)%0A
@@ -733,16 +733,16 @@
f.ter2)%0A
-
@@ -790,16 +790,656 @@
f.ter1)%0A
+ test_ter = Terrain(1, 1)%0A test_ter%5B0, 0%5D = 1%0A self.assertEqual((self.ter1+test_ter)%5B0, 0%5D, 1) ... |
5d082a9178ae70a3f1adca07e1ef9263a15ee1e3 | Fix default alarm_state_history_driver value | monasca_persister/conf/repositories.py | monasca_persister/conf/repositories.py | # (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP
# Copyright 2017 FUJITSU LIMITED
#
# 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... | Python | 0.000448 | @@ -1098,39 +1098,71 @@
tories.influxdb.
-metrics
+'%0A 'alarm_state_history
_repository:'%0A
@@ -1169,38 +1169,46 @@
'
-Metric
+AlarmStateHist
InfluxdbReposito
|
e7f640d1f519945d27178877c91ea4d5684d0f5a | Fix super call | viewflow/flow/start_view.py | viewflow/flow/start_view.py | """
Start flow task, instantiate new flow process
"""
import functools
from django.db import transaction
from django.core.urlresolvers import reverse
from django.conf.urls import url
from ..activation import Activation, StartViewActivation, STATUS
from ..exceptions import FlowRuntimeError
from . import base
def fl... | Python | 0.000043 | @@ -2069,24 +2069,31 @@
super(
+Managed
StartViewAct
|
477b5cb44a0c98776cc8f67d56d44147e66dc101 | fix print string alignment | pickle_sickle.py | pickle_sickle.py | #! /usr/bin/env python3
# I'm tired of having "du -hs / | sort -h" choke on /proc, /home
# etc.
import os
import sys
import subprocess
import re
MY_NAME = "pickle_sickle"
INSPECTEE = "/" # an absolute path to inspect WITH trailing slash
EXCLUDE_US = ("proc", "home", "run", "lost+found")
EXCLUDED = tuple(INSPECTEE ... | Python | 0.000355 | @@ -1262,16 +1262,17 @@
fmt = %22%25
+-
%22 + str(
|
9c02cfa250b0aa8f867d136cc57d405a7d4f3ec0 | check if website is not None | restaurant/management/commands/populate.py | restaurant/management/commands/populate.py | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
#from optparse import make_option
from restaurant.models import Restaurant
from geopy.geocoders import Nominatim
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
)
def create_restaurant(self, name, address, w... | Python | 0.999998 | @@ -405,16 +405,40 @@
if
+website is not None and
not webs
|
2ab3a73124685565877d4755056dced391305216 | Fix multichan | modules/multichan.py | modules/multichan.py | @self.command(help="Displays channels being served")
def chans(self, msginfo):
tosend = ", ".join(self.conman.instances["irc"].joined_chans)
tosend = "%s channels currently served by %s: %s" % (len(self.conman.instances["irc"].joined_chans), self.glob_confman.get("IRC", "NICK"), tosend)
self.conman.gen_send... | Python | 0.000004 | @@ -692,32 +692,49 @@
in self.conman.
+instances%5B%22irc%22%5D.
joined_chans:%0A
@@ -1104,16 +1104,33 @@
.conman.
+instances%5B%22irc%22%5D.
joined_c
|
17718e8bce9c819ddf6780dc6b39d2775569c249 | Fix bug | scan/src/main/org/apache/rat/scan/connect.py | scan/src/main/org/apache/rat/scan/connect.py | #########################################################################################
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | Python | 0.000003 | @@ -4405,17 +4405,17 @@
ame%5B0:-1
-5
+6
%5D%0A
|
f6b528ac74d71d02fde17a4cda5f9cbf77babd04 | Move column from 3 to 5, what you say, we don't know! | bin/generate_matrix.py | bin/generate_matrix.py | #!/usr/bin/env python
"""
generates a matrix.csv file from one .var file
"""
import re
import os
import sys
from argparse import ArgumentParser, ArgumentTypeError
def file_type(fname):
"""Confirm file input is in a file"""
if os.path.isfile(fname):
return fname
raise ArgumentTypeError("File not f... | Python | 0 | @@ -1194,17 +1194,17 @@
= items%5B
-3
+5
%5D%0A
|
e58441487fb37559bee5c8337fb49f47efa75c17 | Make red 4 and 5 flashes easier to count | monitoring/co2/local/led-daemon.py | monitoring/co2/local/led-daemon.py | #!/usr/bin/python
import RPi.GPIO as GPIO
import time
import datetime
GPIO.setmode(GPIO.BCM)
ledRed = 16
ledGreen = 20
levelFile = "/dev/shm/co2level"
redNightFactor = 16
patterns = [
[(0, 400), ledGreen, (3000, 2, 248, 2, 248, 2, 248, 2), 1],
[(400, 500), ledGreen, (... | Python | 0.000003 | @@ -986,34 +986,34 @@
00, 50,
-20
+15
0, 50,
-2
+3
00, 50,
200, 50)
@@ -996,34 +996,34 @@
0, 50, 300, 50,
-20
+15
0, 50),
@@ -1107,37 +1107,37 @@
50,
-20
+15
0, 50,
-20
+35
0, 50,
-20
+35
0, 50,
-20
+15
0, 5
|
3f6713a7367e2f14fc900e5c100d62e049dfeace | Update easynetwork_example.py | easynet/easynetwork_example.py | easynet/easynetwork_example.py | #!/usr/bin/python3
import easyclient as easyclient # when easyclient is in same folder, otherwise import easynet.easyclient as easyclient
import easyserver as easyserver # same as above
import time
myserver = easyserver.Server("localhost", 1337)
myserver.start()
myclient = easyclient.Client("localhost", 1336, "local... | Python | 0.000001 | @@ -20,34 +20,28 @@
%0Aimport easy
-client as
+net.
easyclient #
@@ -43,14 +43,10 @@
ent
-# when
+as
eas
@@ -57,84 +57,16 @@
ent
-is in same folder, otherwise import easynet.easyclient as easyclient
%0Aimport
easy
@@ -57,24 +57,32 @@
ent %0Aimport
+easynet.
easyserver a
@@ -97,24 +97,8 @@
rver
- # same ... |
095191d022784407488f4a9a23aa0a56788aa77f | use date created for ordering | gui/views.py | gui/views.py | from django.http import HttpResponse, HttpResponseRedirect
from django.template import Context, loader, Template, RequestContext
from django.shortcuts import render_to_response, get_list_or_404
from emma.interface.models import *
from django.http import Http404
from django.contrib.auth.decorators import login_required
... | Python | 0 | @@ -2561,38 +2561,37 @@
= 'image__date_
-modifi
+creat
ed' if sortpref
@@ -2606,38 +2606,37 @@
e '-image__date_
-modifi
+creat
ed'%0A m = Meta
|
39d0c69745c1d2811992712ad4174409d296cb52 | Use --no-patch with "git show" | slave/skia_slave_scripts/run_bench.py | slave/skia_slave_scripts/run_bench.py | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Run the Skia benchmarking executable. """
from build_step import BuildStep
from utils import shell_utils
import os
import re
i... | Python | 0.000002 | @@ -720,16 +720,30 @@
'show',
+ '--no-patch',
commit_
@@ -752,20 +752,8 @@
sh%5D,
- echo=False,
%0A
@@ -776,16 +776,28 @@
+ echo=False,
log_in_
|
50033b7cfc80c42381ff5a10ce95eb174624836a | Fix biplist dumps | rest_framework_plist/plist.py | rest_framework_plist/plist.py | # -*- coding: utf-8 -*-
import datetime
import plistlib
from decimal import Decimal
from functools import partial
import biplist
from django.utils import dateparse, six
from django.utils.encoding import force_text
from django.utils.six.moves.html_parser import HTMLParser
DATETIME_TYPES = (datetime.datetime, datetim... | Python | 0.000003 | @@ -1779,22 +1779,20 @@
f dumps(
-stream
+data
):%0A
@@ -1828,29 +1828,21 @@
oString(
-_clean(
data)
-)
%0A%0A%0Adef r
|
8a56a9e97278bdf013438200be4dfd88ba662b5f | Add import json in roomfinder_dispo | roomfinder_dispo/roomfinder_dispo/dispo.py | roomfinder_dispo/roomfinder_dispo/dispo.py | #!/usr/bin/env python2.7
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
from flask import Flask, render_template, request, jsonify
import argparse
import datetime
import os, sys
import requests
from socket import error as SocketError
import errno
app = Flask(__name__)
@app.route("/book", methods=["GET"])
def... | Python | 0.000001 | @@ -248,16 +248,28 @@
rt errno
+%0Aimport json
%0A%0Aapp =
@@ -573,16 +573,129 @@
', '')%0A%0A
+ if starttime is None or endtime is None or user_name is None or user_email is None or room_name is None:%0A
retu
@@ -739,17 +739,16 @@
uest%5Cn%22%0A
-%0A
data
|
6ef1184b3ef53c79082eeac2829247bd4c0861df | add hd=1 to youtubes | modules/urlparser.py | modules/urlparser.py | from modules import *
import re, htmlentitydefs
import urllib2
import string
try:
import simplejson as json
except ImportError:
import json
class Urlparser(Module):
"""Checks incoming messages for possible urls. If a url is found then
visit the site and get the <title>.
"""
def __init__(sel... | Python | 0.000589 | @@ -477,16 +477,110 @@
%7Cgif))%22)
+%0A self.youtube_pattern = re.compile(%22http(s%7C)://(www%5C.%7C)youtube.com/#!/watch%22)%0A
%0A%0A de
@@ -823,32 +823,181 @@
try:%0A
+ d = self.youtube_pattern.search(m.group(0))%0A if d:%0A ... |
c983a2de4c223d9f6ac78d4a0a3e14a6b6a90756 | fix in DirectorDistance example | examples/undocumented/python_modular/distance_director_euclidian_modular.py | examples/undocumented/python_modular/distance_director_euclidian_modular.py | import numpy
try:
from shogun.Distance import DirectorDistance
except ImportError:
print "recompile shogun with --enable-swig-directors"
import sys
sys.exit(0)
class DirectorEuclidianDistance(DirectorDistance):
def __init__(self):
DirectorDistance.__init__(self, True)
def distance_function(self, idx_a, idx_b)... | Python | 0 | @@ -6,16 +6,57 @@
t numpy%0A
+from shogun.Features import RealFeatures%0A
try:%0A%09fr
@@ -362,67 +362,156 @@
:%0A%09%09
-return numpy.linalg.norm(traindat%5B:,idx_a%5D-testdat%5B:,idx_b%5D
+seq1 = self.get_lhs().get_feature_vector(idx_a)%0A %09seq2 = self.get_rhs().get_feature_vector(idx_b)%0A%09%09re... |
e96d5cd8e833793e83ccbdfa138aa11f2ff1ed73 | Version bump 0.0.3 | bootstrap3/__init__.py | bootstrap3/__init__.py | __version__ = '0.0.2' | Python | 0.000001 | @@ -16,6 +16,6 @@
0.0.
-2
+3
'
|
5120a6181853ad67c0958ce8869cc76cd2259a32 | Fix string representation of conditions | src/mist/monitor/model.py | src/mist/monitor/model.py | import logging
from pymongo import MongoClient
from memcache import Client as MemcacheClient
from mist.io.dal import StrField, IntField, FloatField, BoolField
from mist.io.dal import ListField, DictField
from mist.io.dal import OODict, FieldsList, make_field
from mist.core.dal import FieldsDict # escapes mongo dots
... | Python | 0.999999 | @@ -2618,51 +2618,146 @@
%22%25s
+of
%25s %25s
-%22 %25 (self.metric, operator, self.value
+ %25s for 60 + %25d secs%22 %25 (%0A self.aggregate, self.metric, operator, self.value,%0A self.reminder_offset%0A
)%0A%0A%0A
|
8509754117f668b98da32eec32db0781cd556ef6 | improve docstring for satellite.execute_command | quantrocket/satellite.py | quantrocket/satellite.py | # Copyright 2017 QuantRocket - 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.000023 | @@ -1798,16 +1798,210 @@
message
+. If cmd uses Python dot%0A notation and the Python function returns a value, it will be included in%0A the status message as the %22output%22 key. Return values must be JSON-serializable.
%0A%0A Ex
@@ -2297,24 +2297,315 @@
s%22:%5B1,2%5D%7D)%0A%0A
+ Run a Pytho... |
f0c374eba55cdeb56bf3526ea0da041556f6ffe2 | Fix tests on python 3 | tests/test_yamlmod.py | tests/test_yamlmod.py | import os
import sys
from nose.tools import *
def setup_yamlmod():
import yamlmod
reload(yamlmod)
def teardown_yamlmod():
import yamlmod
for hook in sys.meta_path:
if isinstance(hook, yamlmod.YamlImportHook):
sys.meta_path.remove(hook)
break
@with_setup(setup_yamlmod, teardown_yamlmod)
def test_import_... | Python | 0.000081 | @@ -41,16 +41,78 @@
port *%0A%0A
+try:%0A%09from importlib import reload%0Aexcept ImportError:%0A%09pass%0A%0A
def setu
|
87791c10f9063c48dc238ba8561bcc83d865cd0d | Use optional arg for vimtips | botcommands/vimtips.py | botcommands/vimtips.py | # coding: utf-8
import requests
def vimtips(msg):
try:
tip = requests.get('http://vim-tips.com/random_tips/json').json()
except Exception as e:
return None
return u'%s\n%s' % (tip['Content'], tip['Comment'], )
| Python | 0 | @@ -41,16 +41,21 @@
tips(msg
+=None
):%0A t
|
cfdf3ed724b40d69e6bfce47a66f40249240c129 | make tmpdir if it doesn't exist | tests/testgenerate.py | tests/testgenerate.py | #!/usr/bin/python
import os, shutil, subprocess
import yaml
from brutus.db import Database
from brutus.generate import generate_all
tmpdir = "tmp"
filename = os.path.join(tmpdir, "test.pickle")
rootdir = os.path.join(tmpdir, "output")
def cleanup():
try:
os.remove(filename)
except FileNotFoundError:... | Python | 0.000001 | @@ -232,16 +232,17 @@
tput%22)%0A%0A
+%0A
def clea
@@ -328,16 +328,55 @@
pass%0A
+ os.makedirs(tmpdir, exist_ok=True)%0A
shut
@@ -392,16 +392,35 @@
(rootdir
+,ignore_errors=True
)%0A os
@@ -431,32 +431,33 @@
edirs(rootdir)%0A%0A
+%0A
def test_empty()
@@ -500,32 +500,32 @@
ilename) as db:%0A
-
... |
3c4e407430297ab5c011d67db2e2d6ad660d7c0c | Fix a typo in the instructions. | initialize_db.py | initialize_db.py | from random import randint
from os import environ
import requests
def setup_postgression():
url = 'http://api.postgression.com'
db_url = requests.get(url).text
with open('db_url.txt', 'w') as f:
f.write(db_url)
def run_django_commands(*args):
environ.setdefault("DJANGO_SETTINGS_MODULE", "ne... | Python | 1 | @@ -1501,17 +1501,16 @@
ic-admin
-g
run-pyt
|
8880aff128c1e430ee62691de3492fc5f65d6877 | fix bug | python/federatedml/framework/homo/blocks/base.py | python/federatedml/framework/homo/blocks/base.py | #
# Copyright 2019 The FATE 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 | @@ -1030,17 +1030,17 @@
odule__%7D
-$
+.
%7Bself.__
@@ -1060,9 +1060,9 @@
e__%7D
-$
+.
%22%0A
|
34d0bc783c49bc31bb2030b24a28c88998213c4f | Fix the synchronize decorator | watchdog/decorator_utils.py | watchdog/decorator_utils.py | # -*- coding: utf-8 -*-
"""Decorator utility functions.
decorators:
- synchronized
- property
- accepts
- returns
- singleton
- attrs
"""
from threading import Lock
from sys import settrace
def synchronized(lock=None):
"""Decorator that synchronizes a method or a function with a mutex lock.
Example usage:
... | Python | 0.004033 | @@ -404,25 +404,28 @@
%0A if lock
-=
+ is
None:%0A
|
9d5bf8b31b3de277422af5a294a6aca50f1eb2cc | Fix examples/print_request.py | python/g1/http/servers/examples/print_request.py | python/g1/http/servers/examples/print_request.py | """Simple web app that prints out requests."""
import json
from startup import startup
import g1.asyncs.agents.parts
import g1.http.servers.parts
from g1.apps import asyncs
from g1.asyncs import kernels
LABELS = g1.http.servers.parts.define_server(
host='127.0.0.1',
port=8000,
reuse_address=True,
re... | Python | 0.000068 | @@ -473,16 +473,54 @@
rrors')%0A
+ response.pop('wsgi.file_wrapper')%0A
resp
|
04d77be71d684644d1172051a78ebf6c1f8b4612 | Use requests wrapper (#1083) | sortdb/datadog_checks/sortdb/check.py | sortdb/datadog_checks/sortdb/check.py | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import time
from hashlib import md5
import requests
from requests.exceptions import ConnectionError, HTTPError, InvalidURL, Timeout
from simplejson import JSONDecodeError
from six import iteritems
from datadog_ch... | Python | 0 | @@ -140,24 +140,8 @@
d5%0A%0A
-import requests%0A
from
@@ -3248,41 +3248,25 @@
e =
-requests.get(url, timeout=timeout
+self.http.get(url
)%0A
|
7d2cfdc51f2669af5430ba567514782015f57f21 | Check the cron request header in the format that we get it. | codereview/middleware.py | codereview/middleware.py | # Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0 | @@ -4164,42 +4164,63 @@
n =
-'X-Appengine-Cron' in request.META
+request.META.get('HTTP_X_APPENGINE_CRON', '') == 'true'
%0A
|
3b7d1424da0e3ea7d9df928ab73d1b76f370acb0 | remove benchmarks | robo/test/test_task_branin.py | robo/test/test_task_branin.py | '''
Created on 14.07.2015
@author: aaron
'''
import unittest
import numpy as np
from robo.task.branin import Branin
class TestTaskBranin(unittest.TestCase):
def test_branin(self):
branin = Branin()
# Check batch computation
n_points = 10
X = np.random.rand(n_points, branin.n_dim... | Python | 0.010501 | @@ -1048,16 +1048,26 @@
, 6) ==
+np.array(%5B
branin.f
@@ -1073,17 +1073,11 @@
fopt
-) is True
+%5D))
%0A%0Aif
|
f365d0804b516ced454ad4cd7d0119d83adea98d | Add CLI help and command to print README. | mountain/mountain.py | mountain/mountain.py | # -*- coding: utf-8 -*-
__version__ = "0.1.0"
import sys
from .join import expand_manifest
from .split import split_combined_document
from .utils import write_files
def join(manifest_path, combined_document_path):
print("Reading manifest from `%s`." % manifest_path)
write_files(expand_manifest(manifest_pa... | Python | 0 | @@ -672,16 +672,962 @@
ersion()
+%0A print(%22%22%22%0AUsage:%0A%0A $ mountain join %3Cmanifest-path%3E %3Ccombined-document-path%3E%0A%0ACombine all files referenced from %3Cmanifest-path%3E into the document at%0A%3Ccombined-document-path%3E. The file at %3Ccombined-document-path%3E will be%0Aoverwritten if it... |
f249aeab4c14f1111ba8cc9438a6bfc8230890d5 | Update lib/languages.py | lib/languages.py | lib/languages.py | ## english dict
en = {}
en["id"] = "en"
en["menu_components"] = "Components"
en["menu_create_user"] = "Create user"
en["menu_home"] = "Home"
en["menu_login"] = "Login"
en["menu_logout"] = "Logout"
en["menu_reset"] = "Reset password"
en["menu_secure"] = "Secure Page"
en["menu_fyp"] = "Forgot your password?"
en["menu_gl... | Python | 0 | @@ -2929,29 +2929,28 @@
= %22
-Ricordami la password
+Password dimenticata
?%22%0Ai
|
911a2f46f22c8ab81cc6ab6f6a1f116351fe9dc1 | Fix typo in help | pywal/__main__.py | pywal/__main__.py | """
'||
... ... .... ... ... ... ... .... ||
||' || '|. | || || | '' .|| ||
|| | '|.| ||| ||| .|' || ||
||...' '| | | '|..'|' .||.
|| .. |
'''' ''
Created by Dylan Araps.
"""
import argparse
import os
import shutil
import sy... | Python | 0.000926 | @@ -1753,17 +1753,17 @@
de, don%5C
-%22
+'
t print
|
d8d90eed3d7392cf6fe95ccbe50e40775875462a | Translate tenure status choices | models.py | models.py | from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.translation import ugettext_lazy as _
import django_monitor
class BaseStewardProject(models.Model):
content_type = models.ForeignKey(ContentType)
object_i... | Python | 0.999999 | @@ -1639,24 +1639,26 @@
('owned',
+_(
'project own
@@ -1661,32 +1661,33 @@
owns the land')
+)
,%0A ('
@@ -1697,16 +1697,18 @@
ensed',
+_(
'project
@@ -1728,32 +1728,33 @@
e for the land')
+)
,%0A ('
@@ -1761,16 +1761,18 @@
lease',
+_(
'project
@@ -1790,32 +1790,33 @@
e for the lan... |
f0ecbfbc5e0fb10a48c122f81ce61d4b16893448 | use transforms in grid script benchmark | benchmarks/grid.py | benchmarks/grid.py | import numpy as np
import volpy
from libbenchmark import render, get_parser
def main():
parser = _get_parser()
args = parser.parse_args()
grid = volpy.Grid(np.ones(args.grid_shape), default=args.default)
scene = volpy.Scene(emit=grid, scatter=args.scatter)
image = render(scene, args)
image.sa... | Python | 0 | @@ -70,16 +70,29 @@
parser%0A%0A
+import math%0A%0A
%0Adef mai
@@ -163,51 +163,458 @@
-grid = volpy.Grid(np.ones(args.grid_shape),
+transform = np.eye(4)%0A if args.rotate:%0A args.rotate = np.array(args.rotate) * math.pi / 180%0A transform = volpy.rotatexyz(*args.rotate).dot(transform)%0A i... |
7475a584e5e9144d888094dd1d318c7a51cdeca4 | version bump | cuv/_version.py | cuv/_version.py | from incremental import Version
__version__ = Version("cuvner", 16, 4, 0)
__all__ = ["__version__"]
| Python | 0.000001 | @@ -66,9 +66,9 @@
16,
-4
+5
, 0)
|
ecfc74bfc93ddea277105fd2386d64ffe751c819 | Fix `series_list` in `user_page` not being populated properly | cogs/routes/user_page.py | cogs/routes/user_page.py | """
Copyright (c) 2017 Genome Research Ltd.
Authors:
* Simon Beal <sb48@sanger.ac.uk>
* Christopher Harrison <ch12@sanger.ac.uk>
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... | Python | 0 | @@ -2244,42 +2244,266 @@
t =
-db.get_projects_by_supervisor(user
+%5B%5D%0A for series in db.get_all_series():%0A for group in db.get_project_groups_by_series(series):%0A projects = db.get_projects_by_supervisor(user, group)%0A if projects:%0A series_... |
f9a8a32994057bd0ae5597ac4c5308ebeb20edc9 | Fix Jetstream results after r282659. | tools/perf/benchmarks/jetstream.py | tools/perf/benchmarks/jetstream.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs Apple's JetStream benchmark.
JetStream combines a variety of JavaScript benchmarks, covering a variety of
advanced workloads and programming techniq... | Python | 0.000291 | @@ -1096,16 +1096,66 @@
tistics%0A
+from telemetry.value import list_of_scalar_values%0A
from tel
@@ -2281,23 +2281,44 @@
ddValue(
-scalar.
+list_of_scalar_values.ListOf
ScalarVa
@@ -2316,24 +2316,25 @@
fScalarValue
+s
(%0A
|
0376082292dac24b7bf66c9ab3e179ea32af5c11 | Move config read earlier | pipes/securitygroup/create_securitygroup.py | pipes/securitygroup/create_securitygroup.py | """Create Security Groups for Spinnaker Pipelines."""
import argparse
import configparser
import json
import logging
import os
import sys
from jinja2 import Environment, FileSystemLoader
import requests
class SpinnakerAppNotFound(Exception):
pass
class SpinnakerApplicationListError(Exception):
pass
class... | Python | 0 | @@ -557,68 +557,8 @@
_)%0A%0A
- self.app_name = self.app_exists(app_name=app_name)%0A%0A
@@ -617,17 +617,16 @@
ile__))%0A
-%0A
@@ -655,24 +655,84 @@
_configs()%0A%0A
+ self.app_name = self.app_exists(app_name=app_name)%0A%0A
self
|
5fbb998e3fa1ee5342582b6a6a75ed5f9b1f0792 | Fix for issue 117 on jespern's bitbucket - added an admin.py file and moved the registration of piston's models with the admin app into it | piston/models.py | piston/models.py | import urllib, time, urlparse
# Django imports
from django.db.models.signals import post_save, post_delete
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
from django.core.mail import send_mail, mail_admins
# Piston imports
from managers import TokenManager, C... | Python | 0 | @@ -178,41 +178,8 @@
ser%0A
-from django.contrib import admin%0A
from
@@ -951,35 +951,8 @@
y)%0A%0A
-admin.site.register(Nonce)%0A
%0Acla
@@ -2172,38 +2172,8 @@
()%0A%0A
-admin.site.register(Consumer)%0A
%0Acla
@@ -4631,43 +4631,8 @@
e()%0A
- %0Aadmin.site.register(Token)
%0A%0A#
|
931a858dc1cfde1652d21e1ccd60a82dde683ce3 | Add simple "yo" bot command | moxie/butterfield.py | moxie/butterfield.py | import os
import json
import asyncio
from butterfield.utils import at_bot
from aiodocker import Docker
from aiocore import Service
WEB_ROOT = os.environ.get("MOXIE_WEB_URL", "http://localhost:8888")
@asyncio.coroutine
def events(bot):
docker = Docker()
events = docker.events
events.saferun()
stream... | Python | 0.000979 | @@ -1267,12 +1267,132 @@
, job=job))%0A
+ elif cmd == %22yo%22:%0A yield from bot.post(%0A message%5B'channel'%5D, %22Yo %7B%7D%22.format(message%5B'user'%5D))%0A
|
c8d66eb6a9d624cfb321b34abd9ec778d52d3266 | Fix copy for python2 | cxroots/Misc.py | cxroots/Misc.py | from numpydoc.docscrape import FunctionDoc
def remove_para(*paras):
def wrapper(func):
doc = FunctionDoc(func)
for i, p in enumerate(doc['Parameters'].copy()):
if p.name.split(':')[0].rstrip() in paras:
del doc['Parameters'][i]
func.__doc__ = doc
return ... | Python | 0.000005 | @@ -169,15 +169,11 @@
rs'%5D
-.copy()
+%5B:%5D
):%0A
|
32c2a52e241dc1524b1edd5c410c8ad3e96fd344 | Fix a typo | pgupdater.py | pgupdater.py |
import os
import psycopg2
PG_BACKEND_SETTINGS = {
"dbname" : "senzari_stats",
"user" : "senzari_dev",
"password" : "senzari_dev",
"host" : "localhost"
}
def open_connection():
connection = psycopg2.connect(database=PG_BACKEND_SETTINGS['dbname'],
host=PG_BACKEND_SETTING... | Python | 1 | @@ -3981,17 +3981,17 @@
ense()%0A%0A
-g
+i
f __name
|
2b8f025e94e593fc4d8cdaafb2b1344a9ea82a1a | allow continues reading and check if tag changes | terminal.py | terminal.py | from TTLeague import Match, Game, Player
import RPi.GPIO as GPIO
import MFRC522
import signal
import json
import requests
from time import sleep
# init empty configuration
config = {}
try:
# try to load config from file
config = json.load(open('config.json'))
except Exception, e:
print("Error while getting ... | Python | 0 | @@ -1,12 +1,31 @@
+#!/usr/bin/python%0A%0A
from TTLeagu
@@ -674,16 +674,18 @@
ag%5B3%5D)%0A%0A
+%0A%0A
def getP
@@ -1322,16 +1322,28 @@
minal%22%0A%0A
+oldTag = ''%0A
def wait
@@ -1368,24 +1368,42 @@
al notFound%0A
+ global oldTag%0A
notFound
@@ -1608,32 +1608,33 @@
_OK:%0A
+#
print %22tag de... |
5fe0bc64603e95720285f9de90b23f33f912a33e | Fix incorrect docstring definition reference. | colour/algebra/common.py | colour/algebra/common.py | # -*- coding: utf-8 -*-
"""
Common Utilities
================
Defines common algebra utilities objects that don't fall in any specific
category:
- :func:`colour.algebra.spow`: Safe (symmetrical) power.
"""
from __future__ import division, unicode_literals
import functools
import numpy as np
from colour.utilities... | Python | 0.000002 | @@ -3083,16 +3083,17 @@
nc:%60colo
+u
r.algebr
|
d6ace87dffa9ece146fd80b856bafe1ac515f69c | test sidebar | rst2pdf/tests/test_rst2pdf.py | rst2pdf/tests/test_rst2pdf.py | # -*- coding: utf-8 -*-
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
from unittest import TestCase, makeSuite
from pyPdf import PdfFileReader
import cStringIO
from docutils.core import publish_doctree
import rst2pdf
from utils import *
import pdb
#import pdb; pdb.set_trace()
def input_file_path(file):
r... | Python | 0.000001 | @@ -949,644 +949,8 @@
):%0A%0A
- def test_bullet_chars(self):%0A input_file = input_file_path('test_bullet_chars.txt')%0A input=open(input_file,'r').read()%0A doctree=publish_doctree(input)%0A elements=self.converter.gen_elements(doctree,0)%0A self.assertEqual(len(elements), 4)%0A... |
fe5e86254a1e2a2e8838988210531fc30467ee7f | Add further information to absorption correction cif | command_line/write_absorption_correction_cif.py | command_line/write_absorption_correction_cif.py | from __future__ import division
import datetime
import iotbx.cif.model
import os
import xia2.XIA2Version
def find_scale_dir():
assert os.path.exists('xia2.json')
from xia2.Schema.XProject import XProject
xinfo = XProject.from_json(filename='xia2.json')
crystals = xinfo.get_crystals()
assert len(crystals) == ... | Python | 0 | @@ -81,32 +81,18 @@
%0Aimport
-xia2.XIA2Version
+re
%0A%0Adef fi
@@ -812,16 +812,555 @@
astlog%0A%0A
+def get_versions():%0A from dials.util.version import dials_version%0A from i19.util.version import i19_version%0A import xia2.XIA2Version%0A versions = %7B%0A 'xia2': xia2.XIA2Version.Version,%0A 'dials'... |
46da0a7962472accbca791583c5f744bb26721f3 | make script executable | test/generate_ipv4.py | test/generate_ipv4.py | #!/usr/bin/env python
import sys
"""
* libFNR - A reference implementation library for FNR encryption mode.
*
* FNR represents \"Flexible Naor and Reingold\" mode
* FNR is a small domain block cipher to encrypt small domain
* objects ( < 128 bits ) like IPv4, MAC, Credit Card numbers etc.
* FNR is des... | Python | 0.000007 | |
38d7d3680dc5d2215274cb6cf3bc1768bf0b7a4f | Version bump | bespin/__init__.py | bespin/__init__.py | VERSION="0.2.11"
| Python | 0.000001 | @@ -7,11 +7,11 @@
N=%220.2.1
-1
+2
%22%0A
|
7eaeaad21481ec5562d5bb1fde0a78dec3e894e7 | Update fill_segments.py | plantcv/plantcv/morphology/fill_segments.py | plantcv/plantcv/morphology/fill_segments.py | # Fill a mask using watershed and skeleton segments
import os
import cv2
import numpy as np
from skimage.segmentation import watershed
from plantcv.plantcv import outputs
from plantcv.plantcv import color_palette
from plantcv.plantcv import params
from plantcv.plantcv._debug import _debug
def fill_segments(mask, obj... | Python | 0.000001 | @@ -193,29 +193,22 @@
import
-color_palette
+params
%0Afrom pl
@@ -216,38 +216,60 @@
ntcv.plantcv
- import params
+.visualize import colorize_label_img
%0Afrom plantc
@@ -2037,32 +2037,34 @@
value=counts%5B1:
+-1
%5D.tolist(),%0A
@@ -2096,32 +2096,34 @@
label=(ids%5B1:
+-1
%5D-1).tolist())%0A
@@ -239... |
fa6edcb1ad04ca0ff698da8fa4965ea02915758e | Fix the name of CHANGES.txt | coverage/__init__.py | coverage/__init__.py | """Code coverage measurement for Python.
Ned Batchelder
http://nedbatchelder.com/code/coverage
"""
__version__ = "3.0.1" # see detailed history in CHANGES
from coverage.control import coverage
from coverage.data import CoverageData
from coverage.cmdline import main, CoverageScript
from coverage.misc import Cover... | Python | 0.999999 | @@ -153,16 +153,20 @@
CHANGES
+.txt
%0A%0Afrom c
|
0639bfdc60d6bd5907000baf9b2bb279cbe25a16 | add header | dap/tf/utils.py | dap/tf/utils.py | """Tensorflow utilities.
These are mostly functions that bring additional numpy functionality to
Tensorflow.
"""
import itertools
import numpy as np
import tensorflow as tf
def swish(x, beta=1.0):
"""Swish activation function. See https://arxiv.org/abs/1710.05941"""
with tf.name_scope("swish"):
return x * tf.... | Python | 0.000001 | @@ -1,8 +1,584 @@
+# Copyright 2018 Google Inc.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by ... |
8c6c96d5a0cdeadb59e6f6ab8649f1dbc1fc12b7 | delete multiple sites at once | openedx/core/djangoapps/appsembler/sites/management/commands/remove_site.py | openedx/core/djangoapps/appsembler/sites/management/commands/remove_site.py | from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
from django.db import transaction
from openedx.core.djangoapps.appsembler.sites.utils import delete_site
class Command(BaseCommand):
"""
Remove a Tahoe website from LMS records.
Must be used `r... | Python | 0 | @@ -1,20 +1,38 @@
+import traceback%0A%0A
from django.core.man
@@ -66,22 +66,8 @@
mand
-, CommandError
%0Afro
@@ -442,157 +442,8 @@
nt(%0A
- 'domain',%0A help='The domain of the organization to be deleted.',%0A type=str,%0A )%0A parser.add_argument(%0A
@@ -650,16... |
aa39e30670f9d286c3901203dcca45a61fea9873 | Remove str from url | web_api/remoteConnection.py | web_api/remoteConnection.py | import json
import requests
from requests.auth import HTTPBasicAuth
from django.http import HttpResponse
from django.contrib.auth import login, logout
from django.contrib.auth.models import User, Group
from django.conf import settings
from rest_framework.views import APIView
from rest_framework.permissions import IsAut... | Python | 0.000009 | @@ -1224,16 +1224,11 @@
urn
-str(
url
-)
%5B:-1
|
69baf66b13331d5936e8c540a2bb7eccb1d64cb7 | Add view for user to download invoice | invoice/views.py | invoice/views.py | from django.shortcuts import get_object_or_404
from invoice.models import Invoice
from invoice.pdf import draw_pdf
from invoice.utils import pdf_response
def pdf_view(request, pk):
invoice = get_object_or_404(Invoice, pk=pk)
return pdf_response(draw_pdf, invoice.file_name(), invoice)
| Python | 0 | @@ -288,8 +288,197 @@
nvoice)%0A
+%0A%0Adef pdf_user_view(request, invoice_id):%0A invoice = get_object_or_404(Invoice, invoice_id=invoice_id, user=request.user)%0A return pdf_response(draw_pdf, invoice.file_name(), invoice)%0A
|
c3abd04da6c4ecc5d9464261c5c30d3eb527b04f | Bump version number | coverage/__init__.py | coverage/__init__.py | """Code coverage measurement for Python.
Ned Batchelder
http://nedbatchelder.com/code/coverage
"""
__version__ = "3.3.1" # see detailed history in CHANGES.txt
__url__ = "http://nedbatchelder.com/code/coverage"
from coverage.control import coverage, process_startup
from coverage.data import CoverageData
from cov... | Python | 0.000002 | @@ -114,16 +114,18 @@
= %223.3.
+2a
1%22 #
|
6b090757799b6c5928b5cf9c0722d870ff822205 | Fix poorly written sentence | app/v2/template/post_template.py | app/v2/template/post_template.py | from flask import jsonify, request
from app import authenticated_service
from app.dao import templates_dao
from app.schema_validation import validate
from app.utils import get_template_instance
from app.v2.errors import BadRequestError
from app.v2.template import v2_template_blueprint
from app.v2.template.template_sch... | Python | 1 | @@ -571,12 +571,9 @@
#
-If t
+T
he p
@@ -586,47 +586,45 @@
is
-is
empty
-if
+when
there
-is
+are
no p
-ersonalisation
+lace holders
in
|
bf939958c15106a8b7f631622cf9ac9813e2361e | add 1 line at end of paloalto_panos.py | netmiko/paloalto/paloalto_panos.py | netmiko/paloalto/paloalto_panos.py | from __future__ import unicode_literals
import time
import re
from netmiko.base_connection import BaseConnection
class PaloAltoPanosBase(BaseConnection):
"""
Implement methods for interacting with PaloAlto devices.
Disables `enable()` and `check_enable_mode()`
methods. Overrides several methods for ... | Python | 0.000001 | @@ -5582,28 +5582,29 @@
PaloAltoPanosBase):%0A pass
+%0A
|
6d51b0aa6e18d0cd99485861d60a7f20f40cb97a | tweak osm import query | training/import_osm.py | training/import_osm.py | import requests
import codecs
query1 = """<union>
<query type="way">
<has-kv k="addr:full"/>
<has-kv k="addr:city"/>
<has-kv k="addr:street"/>
<bbox-query e="%s" n="%s" s="%s" w="%s"/>
</query>
<query type="node">
<has-kv k="addr:full"/>
<has-kv k="addr:city"/>
<has-kv k="addr:street"/>
<bbox-query... | Python | 0.000001 | @@ -430,16 +430,17 @@
9) * 2)%0A
+#
r1 = req
@@ -507,16 +507,17 @@
uery1)%0A%0A
+#
f = open
@@ -543,16 +543,17 @@
%22, %22w%22)%0A
+#
f.write(
@@ -1172,16 +1172,17 @@
uery2)%0A%0A
+#
f = code
@@ -1232,16 +1232,17 @@
utf-8%22)%0A
+#
r2.encod
@@ -1247,32 +1247,33 @@
oding = 'utf-8'%0A
+#
f.write(r2.text)
@@ -... |
e867de159a974469fa10ab55aa3905e10324d17f | fix iteration over report metrics | webapp/cbmonitor/reports.py | webapp/cbmonitor/reports.py | from django.core.exceptions import ObjectDoesNotExist
from cbmonitor import models
class Report(object):
def __new__(cls, snapshots, report_type):
if report_type == "BaseReport":
return BaseReport(snapshots)
elif report_type == "FullReport":
return FullReport(snapshots)
... | Python | 0 | @@ -46,16 +46,47 @@
NotExist
+%0Afrom django.db.models import Q
%0A%0Afrom c
@@ -1375,16 +1375,189 @@
napshots
+%0A clusters = %5Bc for s, c in self.snapshots%5D%0A self.buckets = models.Bucket.objects.filter(%0A Q(cluster=clusters%5B0%5D) %7C Q(cluster=clusters%5B0%5D)%0A )
%0A%0A ... |
6895d4b3fb0e5a6a611e317045f8d4ee988c0055 | add arguments to catkin_test for backwards compatibility (#693) | catkin_tools/verbs/catkin_test/cli.py | catkin_tools/verbs/catkin_test/cli.py | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | Python | 0 | @@ -537,16 +537,32 @@
icense.%0A
+import argparse%0A
import o
@@ -3940,24 +3940,340 @@
ication.')%0A%0A
+ # Deprecated arguments%0A # colors are handled by the main catkin command%0A add('--no-color', action='store_true', help=argparse.SUPPRESS)%0A add('--force-color', action='store_true', help=argparse.... |
d4f1ec5ca62b95c44e66e29a7e4bda46368703be | solve memory problem with xrange? | neuropower/neuropower/utils/cluster.py | neuropower/neuropower/utils/cluster.py | import nibabel as nib
import numpy as np
import pandas as pd
"""
Extract local maxima from a spm, return a pandas table with variables:
- x coordinate
- y coordinate
- z coordinate
- peak height
"""
def cluster(spm,exc):
# make a new array with an extra row/column/plane around the original array
spm_newdim = tuple(... | Python | 0.000001 | @@ -631,24 +631,25 @@
e%0A%09for m in
+x
range(1,shap
@@ -664,24 +664,25 @@
%0A%09%09for n in
+x
range(1,shap
@@ -702,16 +702,17 @@
or o in
+x
range(1,
@@ -768,17 +768,19 @@
oundings
-=
+ =
%5Bspm_ext
|
ae44136c3ac7d130461d7e71daae2984c44b9cfa | Set default normalization to amp for wavelet transform. Update docstring to reflect that this is a continuous wavelet transform. | neurodsp/timefrequency/wavelets.py | neurodsp/timefrequency/wavelets.py | """Time-frequency decompositions using wavelets."""
import numpy as np
from scipy.signal import morlet
from neurodsp.utils.data import create_freqs
from neurodsp.utils.core import check_n_cycles
from neurodsp.utils.decorators import multidim
###########################################################################... | Python | 0 | @@ -520,35 +520,35 @@
ling=0.5, norm='
-sss
+amp
'):%0A %22%22%22Compu
@@ -1524,16 +1524,150 @@
ignal.%0A%0A
+ Notes%0A -----%0A%0A * This computes the continuous wavelet transform at the specified frequencies and%0A along all shifts.%0A%0A
Exam
|
e569ba84dbaffb4e8f4a754598ca105667a059e0 | Include a trailing newline in hashsum download keyfiles | plugins/hashsum_download/server/__init__.py | plugins/hashsum_download/server/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in compliance with the License.
# You may obtain a copy of ... | Python | 0 | @@ -2944,14 +2944,30 @@
-hash =
+keyFileBody = '%25s%5Cn' %25
fil
@@ -3069,20 +3069,27 @@
h', len(
-hash
+keyFileBody
))%0A
@@ -3216,20 +3216,27 @@
return
-hash
+keyFileBody
%0A%0A @a
|
9de3e898b0ce1d8970052d2052e4215bc2f12491 | bump version to 2.11 | newfies/newfies_dialer/__init__.py | newfies/newfies_dialer/__init__.py | # -*- coding: utf-8 -*-
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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) 2011-2014 Star2Bi... | Python | 0 | @@ -536,12 +536,12 @@
2, 1
-0, 1
+1, 0
, %22%22
|
014cb038b8e3a22c90864c842d2c049d3e9637d4 | Use recipe bootstrap | tests/recipes_test.py | tests/recipes_test.py | #!/usr/bin/env python
# Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs simulation tests and lint on the recipes."""
import os
import subprocess
ROOT_DIR = os.path.dirname(os.path.dirname(os.p... | Python | 0 | @@ -386,16 +386,23 @@
k_call(%5B
+%0A
os.path.
@@ -429,16 +429,35 @@
pes.py')
+, '--use-bootstrap'
%5D + list
|
1520a5e26c4ee438e57ebf59c04cef7ce578bb02 | Use csv for calibration | sensor_interface/scripts/bno055_interface.py | sensor_interface/scripts/bno055_interface.py | #!/usr/bin/env python
import rospkg
import rospy
from sensor_msgs.msg import Imu, MagneticField, Temperature
from std_msgs.msg import String
from geometry_msgs.msg import Vector3, Vector3Stamped, Quaternion
from diagnostic_msgs.msg import DiagnosticStatus, KeyValue
from sensor_interface.srv import SaveImuCalibration,... | Python | 0.000001 | @@ -16,16 +16,27 @@
python%0A%0A
+import csv%0A
import r
@@ -4761,35 +4761,35 @@
+ %22/calibration.
-txt
+csv
%22%0A with o
@@ -4801,16 +4801,28 @@
ath, 'w'
+, newline=''
) as out
@@ -4843,28 +4843,36 @@
-for value in values:
+writer = csv.writer(outfile)
%0A
@@ -4884,42 +4884,32 @@
- ou... |
b2371e4a19930ec32c0b212798203142c7c69f74 | Update fields.py | places/fields.py | places/fields.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from decimal import Decimal
from django.db import models
from django.utils.six import with_metaclass
from django.utils.encoding import smart_text
from django.utils.translation import ugettext_lazy as _
from . import Places
from .forms import PlacesField... | Python | 0.000002 | @@ -1386,17 +1386,8 @@
tion
-, context
):%0A
|
96d64babf02f66fe9ab17b544c2193a38e454d9e | Rework use of flask login | src/spz/spz/__init__.py | src/spz/spz/__init__.py | # -*- coding: utf-8 -*-
"""Sign up management handling.
.. note::
Views have to be registered at the end of this module because of circular dependencies.
.. warning::
Some code analyzers may flag view imports as unused, because they are only imported for their side effects.
"""
import os
import ra... | Python | 0 | @@ -1306,14 +1306,13 @@
= '
-strong
+basic
'%0A%0A%0A
|
94f795dbbac32cbe1c83da1fb3cd3e55fdceef11 | Test de pycharm par Simon. | testFile.py | testFile.py | __author__ = 'adrie_000'
import numpy as np
import numpy.matrixlib as nm
p = nm.matrix([[3, 3, 3], [3, 5, 7]])
q = p - p.mean(1)
print q
r = [np.array([q.getA()[0][k], q.getA()[1][k]]) for k in range(q.shape[1])]
print r
d = [np.linalg.norm(w) for w in r]
print d | Python | 0 | @@ -67,16 +67,22 @@
b as nm%0A
+'test'
%0Ap = nm.
|
b50c89b04229a679bc88accd71c05dd99d53f793 | Fix to call from command and library. | cronquot/cronquot.py | cronquot/cronquot.py | """Create cron schedule from exported data from `crontab -l` ."""
from crontab import CronTab
from datetime import timedelta
import os
import re
import sys
import warnings
# Ignore cases when reading crontab file.
IGNORE_CASES = ['MAILTO', '#']
def stop_future_warning(func):
"""Stop printing warning."""
imp... | Python | 0 | @@ -118,16 +118,46 @@
medelta%0A
+from datetime import datetime%0A
import o
@@ -742,77 +742,21 @@
t, s
-cripts in sorted(targets.items()):%0A for s in scripts:%0A
+ in targets:%0A
@@ -796,20 +796,16 @@
format(%0A
-
@@ -873,22 +873,14 @@
-
-
s%5B1%5D,%0A
-
@@ -... |
9247e40584ad9470b26ff0ed62be4324ae4e1dba | Add publisher function | sensor_interface/scripts/bno055_interface.py | sensor_interface/scripts/bno055_interface.py | #!/usr/bin/env python
import rospy
from sensor_msgs.msg import Imu, MagneticField, Temperature
from std_msgs.msg import String
from geometry_msgs.msg import Vector3
from diagnostic_msgs.msg import DiagnosticStatus, KeyValue
from Adafruit_BNO055 import BNO055
class Bno055InterfaceNode(object):
def __init__(self)... | Python | 0.000001 | @@ -159,16 +159,28 @@
Vector3
+, Quaternion
%0Afrom di
@@ -806,23 +806,31 @@
'
-imu/calibration
+sensors/imu/diagnostics
',%0A
@@ -930,16 +930,24 @@
'
+sensors/
imu/eule
@@ -1106,16 +1106,20 @@
gfatal('
+%25s:
Failed t
@@ -1164,16 +1164,34 @@
nected?'
+, rospy.get_name()
)%0A
@@ -1385,16 +1... |
1bf981bd62d56e608cea8e7f0f0132af8cf25b70 | Fix NXOS tests to allow mocked data to raise | test/nxos/conftest.py | test/nxos/conftest.py | """Test fixtures."""
from builtins import super
import pytest
from napalm.base.test import conftest as parent_conftest
from napalm.base.test.double import BaseTestDouble
from napalm.nxos import nxos
@pytest.fixture(scope="class")
def set_device_parameters(request):
"""Set up the class."""
def fin():
... | Python | 0 | @@ -56,16 +56,61 @@
pytest%0A
+from napalm.base.mock import raise_exception%0A
from nap
@@ -158,17 +158,16 @@
onftest%0A
-%0A
from nap
@@ -209,17 +209,16 @@
tDouble%0A
-%0A
from nap
@@ -1985,16 +1985,94 @@
ll_path)
+%0A if %22exception%22 in result:%0A raise_exception(result)
%0A%0A ... |
3b5dfeb81cf2a3038351af4a45568c10839c309d | add test of configuration before starting search | realfast/rfcontroller.py | realfast/rfcontroller.py | from __future__ import print_function, division, absolute_import #, unicode_literals # not casa compatible
from builtins import bytes, dict, object, range, map, input#, str # not casa compatible
from future.utils import itervalues, viewitems, iteritems, listvalues, listitems
from io import open
from evla_mcast.control... | Python | 0 | @@ -1338,16 +1338,62 @@
%7B0%7D,
- scan %7B1
+'%0A 'scan %7B1%7D, source %7B2%7D, intent %7B3
%7D'%0A
@@ -1451,65 +1451,114 @@
anNo
-))%0A%0A logger.info('TODO: print more config info')%0A%0A
+, config.source,%0A config.scan_intent))%0A%0A if self.runsearc... |
3d25ebd40d55925c3b0c03454fc8543cd5e39ac9 | update import script for Salford (closes #1162) | polling_stations/apps/data_collection/management/commands/import_salford.py | polling_stations/apps/data_collection/management/commands/import_salford.py | from data_collection.github_importer import BaseGitHubImporter
class Command(BaseGitHubImporter):
srid = 4326
districts_srid = 4326
council_id = 'E08000006'
elections = ['parl.2017-06-08']
scraper_name = 'wdiv-scrapers/DC-PollingStations-Salford'
geom_type = 'geojson'
def district_record... | Python | 0 | @@ -187,23 +187,24 @@
= %5B'
-par
+loca
l.201
-7-06-08
+8-05-03
'%5D%0A
|
a0c238ac2b74afd3cf2a5db5620d25b4de12dfa9 | Replace asserts with warning | plugins_/command_completions/commandinfo.py | plugins_/command_completions/commandinfo.py | import inspect
import functools
import logging
import yaml
import sublime
import sublime_plugin
l = logging.getLogger(__name__)
def get_command_name(command_class):
"""Get the name of a command.
Parameters:
command_class (sublime_plugin.Command)
The command class for which the name shou... | Python | 0.999999 | @@ -3887,46 +3887,8 @@
arg%0A
- assert arg == %22self%22, arg%0A
@@ -3896,32 +3896,32 @@
continue%0A
+
elif i =
@@ -4013,28 +4013,24 @@
-assert
+if
arg
-=
+!
= %22edit%22
, ar
@@ -4025,21 +4025,115 @@
= %22edit%22
-, arg
+:%0A l.warning(%22Second argument fo... |
6024c85f1c3054ed7691f576b4f2bb65eee537fe | Add run_compaction to compact through files. | compaction/compaction.py | compaction/compaction.py | #! /usr/bin/env python
import numpy as np
import pandas
from scipy.constants import g as gravity
import yaml
def compact(dz, porosity, c=5e-8, rho_grain=2650., excess_pressure=0.,
porosity_min=0., porosity_max=1., rho_void=1000.):
"""Compact a column of sediment.
Parameters
----------
dz ... | Python | 0 | @@ -16,16 +16,28 @@
python%0A
+import sys%0A%0A
import n
@@ -1720,19 +1720,18 @@
config(f
-nam
+il
e=None):
@@ -1810,19 +1810,25 @@
fname :
-str
+file-like
, option
@@ -1842,15 +1842,14 @@
-Name of
+Opened
con
@@ -2013,12 +2013,9 @@
c':
-3.68
+5
e-8,
@@ -2071,10 +2071,10 @@
x':
+1
.
-4
,%0A
@@ ... |
e96cc41708f873eb587a6c3245150fe0bf084026 | use as_regex | corpkit/conc.py | corpkit/conc.py |
def conc(corpus, query,
n = 100,
random = False,
window = 40,
trees = False,
plaintext = 'guess'):
"""A concordancer for Tregex queries over trees or regexes over plain text"""
import os
import re
import pandas as pd
from pandas import DataFrame
from... | Python | 0.000013 | @@ -795,64 +795,183 @@
-query = r'/(?i)%5E(' + '%7C'.join(query) + r')$/ !%3C __'%0A
+from corpkit.other import as_regex%0A query = r'/%25s/ !%3C __' %25 as_regex(query, boundaries = 'line')%0A %0A # lazy, daniel!%0A if window == 'all':%0A window = 9999%0A
%0A
|
1f7e355a3a325284c912265ce178d15129555375 | Add a news model | models.py | models.py | import urllib
from django.db import models
from django.core.validators import RegexValidator
from django.utils.text import slugify
from image_cropping import ImageRatioField
class Church(models.Model):
class Meta:
verbose_name_plural = "Churches"
ordering = ['name']
name = models.CharField(m... | Python | 0.000051 | @@ -2152,8 +2152,274 @@
line_2)%0A
+%0A%0Aclass News(models.Model):%0A%0A title =%C2%A0models.CharField(max_length=144)%0A detail = models.TextField()%0A photo = models.ImageField(blank=True)%0A square_crop = ImageRatioField('photo', '64x64', size_warning=True)%0A date = models.DateField(auto_now_add=Tr... |
5dcaf53c9c74fb52214688ef15f364aedd1f1d21 | Support for double-sided printing | cseprint/__init__.py | cseprint/__init__.py | """This file provides everything the script needs. The main entry point for the program is main()
"""
import argparse
import getpass
import os
import re
import subprocess
import sys
def is_valid_printer(args):
"""Validates that the state of the arguments provide a valid printer."""
pattern = re.compile(r'prin... | Python | 0 | @@ -1746,24 +1746,154 @@
logging.')%0A%0A
+ # Special printing options%0A parser.add_argument('--double-sided', action='store_true', help='Print double-sided sheets.')%0A%0A
# Versio
@@ -3631,18 +3631,8 @@
er%7D
-- %3C %7Bfile%7D
'.fo
@@ -3701,18 +3701,130 @@
.printer
-,
+)%0A if args.double_sided:%... |
dd3a8cddc1ca7efe09bb9887a5fdc6b9b989b734 | Bump version for pypi to 0.2018.07.04.1917 | ipwb/__init__.py | ipwb/__init__.py | __version__ = '0.2018.07.04.1637'
| Python | 0 | @@ -26,9 +26,9 @@
04.1
-63
+91
7'%0A
|
31cd63c06abf7a8736ecef26bf590c6a66a2bcac | Add --replay-start-size and reward clipping | examples/ale/train_acer_ale.py | examples/ale/train_acer_ale.py | from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases()
import argparse
import os
import chainer
from chainer import links a... | Python | 0 | @@ -316,16 +316,35 @@
nks as L
+%0Aimport numpy as np
%0A%0Afrom c
@@ -785,24 +785,65 @@
rt Sequence%0A
+from chainerrl.misc import env_modifiers%0A
from chainer
@@ -1604,16 +1604,88 @@
ult=20)%0A
+ parser.add_argument('--replay-start-size', type=int, default=10000)%0A
pars
@@ -4022,16 +4022,88 @@
replay,... |
013048e1d68174e71d4579e28efd0339144ce186 | Make function! and Use 4 tabs, not 8 tabs. | 2017/11.07/python/jya_homework2.py | 2017/11.07/python/jya_homework2.py | ```python
i = -1
sum = 0
one_to_ten = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
while i < 10:
i += 1
sum += one_to_ten[i]
print(sum)
``` | Python | 0.000005 | @@ -126,8 +126,240 @@
um)%0A%0A%60%60%60
+%0A%0A**Make function!**%0A%60like:%60%0A%60%60%60python%0Adef sum(number):%0A # .. TODO%0A return 0%0A%60%60%60%0A%0A%60I want to reuse this function, like:%60%0A%60%60%60python%0Aone_to_ten = sum(range(1,11))%0Aone_to_five = sum(range(1,6))%0Afive_to_ten = sum(range(5,... |
238784d3f3237ed2a93cde73aaa61ba8d4fa9a8a | Replace list comprehension with dict lookup | iso639/iso639.py | iso639/iso639.py | """
Python library for ISO 639 standard
Copyright (c) 2014 Mikael Karlsson (CSC - IT Center for Science Ltd.).
Licensed under AGPLv3.
"""
def _fabtabular():
"""
This function retrieves the ISO 639 and inverted names datasets as tsv files and returns them as two lists.
"""
import csv
import sys
... | Python | 0.000001 | @@ -2253,16 +2253,49 @@
bular()%0A
+ i = %7Bx%5B0%5D: x for x in i%7D%0A
@@ -2341,68 +2341,16 @@
e,
+i
%5B
-x%5B2%5D for x in i if x%5B0%5D ==
a%5D%5B
-0
+2
%5D)
-%0A
for
|
eb121b797e803be295fb2abeef91ebcdab2e75cf | Normalize data | plot_multiple.py | plot_multiple.py |
import os
import pandas as pd
import matplotlib.pyplot as plt
def symbol_to_path(symbol, base_dir="data"):
"""Return CSV file path given ticker symbol."""
return os.path.join(base_dir, "{}.csv".format(str(symbol)))
def get_data(symbols, dates):
"""Read stock data (adjusted close) for given symbols from ... | Python | 0.999999 | @@ -869,16 +869,66 @@
urn df%0A%0A
+def normalize_data(df):%0A return df/df.ix%5B0,:%5D%0A%0A
def plot
@@ -1296,58 +1296,32 @@
-#df = df/df.ix%5B'2015-11-23':'2015-11-23'%5D%0A plot
+%0A plot_data(normalize
_dat
@@ -1325,16 +1325,17 @@
data(df)
+)
%0A%0A%0Aif __
|
a36964a4326d668a4624648e330889667c31f012 | Make the po-merge tool overwrite translations from the source because the source is authorative, and also avoid updating the header. | tools/dev/po-merge.py | tools/dev/po-merge.py | #!/usr/bin/env python
import os, sys
def parse_translation(f):
"""Read a single translation entry from the file F and return a
tuple with the comments, msgid and msgstr. The comments is returned
as a list of lines which do not end in new-lines. The msgid and
msgstr are strings, possibly with embedde... | Python | 0 | @@ -3259,35 +3259,147 @@
-if msgstr =
+# Do not update the header, and only update if the source%0A # has a non-empty translation.%0A if msgid !
= '%22%22' and s
@@ -3419,13 +3419,22 @@
id,
+%5B
'%22%22'
-)
+, %5B%5D%5D)%5B0%5D
!=
@@ -3507,22 +3507,19 @@
-source
+new... |
59b06d696e302c43c059ff63c93fa3cbbe91eea4 | Update indicator names on test page | custom/icds/views.py | custom/icds/views.py | from django import forms
from django.core.urlresolvers import reverse
from django.http import JsonResponse
from django.shortcuts import render
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext as _, ugettext_lazy
from crispy_forms import bootstrap as twbscrispy
from cri... | Python | 0 | @@ -1111,16 +1111,20 @@
', 'AWW
+#1 (
Submissi
@@ -1129,32 +1129,33 @@
sion Performance
+)
'),%0A
@@ -1163,94 +1163,105 @@
'ls_
-sub_perf', 'LS SubmissionPerformance'),%0A ('ls_vhnd_survey', 'LS VHND Survey
+vhnd_survey', 'LS #2 (VHND Survey)'),%0A ('ls_sub_perf', 'LS #6 (Submiss... |
7b48c0d0eb62f0fb90b548c71d7b7938058bdda5 | Remove unneeded function call | tools/examples_rst.py | tools/examples_rst.py | #! /usr/bin/env python
import os
import sys
import re
import subprocess
import pickle
from StringIO import StringIO
# 3rd party
from matplotlib import pyplot as plt
# Ours
import hash_funcs
#----------------------------------------------------
# Globals
#----------------------------------------------------
# these ... | Python | 0 | @@ -5568,75 +5568,8 @@
nue%0A
- example_file_name = os.path.basename(example_file)%0A
@@ -5621,16 +5621,6 @@
mple
-_file_name
)%0A
|
f81680a0bfe04b9e38fda53038e00346246bb1eb | make test more portable | mint_test/resttest/apitest/sitetest.py | mint_test/resttest/apitest/sitetest.py | #!/usr/bin/python
#
# Copyright (c) 2009 rPath, Inc.
#
# All Rights Reserved
#
import testsetup
import os
import re
import time
from conary import conaryclient
from conary import constants as conaryConstants
from conary.lib import util
from mint import buildtypes
from mint import constants
import restbase
from rest... | Python | 0.000005 | @@ -288,16 +288,59 @@
stants%0A%0A
+from rpath_proddef import api1 as proddef%0A%0A
import r
@@ -1352,11 +1352,22 @@
ion%3E
-3.0
+%25(proddefVer)s
%3C/pr
@@ -1634,16 +1634,84 @@
.version
+,%0A proddefVer=proddef.BaseDefinition.version
))%0A%0Aif _
|
bea6bb4b04fbce577a2753cd8a86613fdf5984ba | FIX _wrap_write return value | base_field_validator/ir_model.py | base_field_validator/ir_model.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licen... | Python | 0.000006 | @@ -2351,16 +2351,22 @@
+ res =
old_wri
@@ -2430,28 +2430,27 @@
return
-True
+res
%0A%0A re
|
524bf10b29145c5069349c4db5e3edb7c9c34e11 | bump ver | plotlywrapper.py | plotlywrapper.py | """plotly wrapper to make easy plots easy to make"""
from tempfile import NamedTemporaryFile
from builtins import zip
import plotly.offline as py
import plotly.graph_objs as go
import numpy as np
from IPython import get_ipython
from ipykernel import zmqshell
__version__ = '0.0.8-dev'
def _labels(base='trace'):... | Python | 0.000002 | @@ -283,12 +283,8 @@
.0.8
--dev
'%0A%0A%0A
|
a106fbbf4bfc25c2a8dd84d8235b75f1ea193c31 | change to single jvm in cloud build, and do the normal SEED init/print method | py/testdir_single_jvm/test_NN2_twovalues.py | py/testdir_single_jvm/test_NN2_twovalues.py | import unittest, time, sys, re
sys.path.extend(['.','..','py'])
import h2o, h2o_nn, h2o_cmd, h2o_hosts, h2o_browse as h2b, h2o_import as h2i, h2o_gbm
def write_syn_dataset(csvPathname, rowCount, rowDataTrue, rowDataFalse, outputTrue, outputFalse):
dsf = open(csvPathname, "w+")
for i in range(int(rowCount/2)):
... | Python | 0 | @@ -671,16 +671,22 @@
global
+ SEED,
localho
@@ -688,16 +688,55 @@
calhost%0A
+ SEED = h2o.setup_random_seed()%0A
@@ -825,17 +825,17 @@
d_cloud(
-3
+1
, java_h
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.