hash
stringlengths
40
40
diff
stringlengths
131
26.7k
message
stringlengths
7
694
project
stringlengths
5
67
split
stringclasses
1 value
diff_languages
stringlengths
2
24
6af7cfff33b682f4b4435c592f4394075c9f7e09
diff --git a/script/create-dist.py b/script/create-dist.py index <HASH>..<HASH> 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -132,9 +132,9 @@ def copy_license(): shutil.copy2(os.path.join(SOURCE_ROOT, 'LICENSE'), DIST_DIR) def create_api_json_schema(): - outfile = os.path.join(DIST_DIR, 'electron-api.json') - execute(['electron-docs-linter', '--outfile={0}'.format(outfile)], - '--version={}'.format(ELECTRON_VERSION.replace('v', ''))) + outfile = os.path.relpath(os.path.join(DIST_DIR, 'electron-api.json')) + execute(['electron-docs-linter', 'docs', '--outfile={0}'.format(outfile), + '--version={}'.format(ELECTRON_VERSION.replace('v', ''))]) def strip_binaries(): for binary in TARGET_BINARIES[PLATFORM]:
fix syntax and use relative path to electron-api.json target
electron_electron
train
py
9e5d4260ba12dc5a209f95d4203d0d000bce707b
diff --git a/src/Kunstmaan/AdminListBundle/Controller/AdminListController.php b/src/Kunstmaan/AdminListBundle/Controller/AdminListController.php index <HASH>..<HASH> 100644 --- a/src/Kunstmaan/AdminListBundle/Controller/AdminListController.php +++ b/src/Kunstmaan/AdminListBundle/Controller/AdminListController.php @@ -136,7 +136,7 @@ abstract class AdminListController extends Controller $tabPane->bindRequest($request); $form = $tabPane->getForm(); } else { - $form->submit($request); + $form->handleRequest($request); } if ($form->isValid()) { @@ -214,7 +214,7 @@ abstract class AdminListController extends Controller $tabPane->bindRequest($request); $form = $tabPane->getForm(); } else { - $form->submit($request); + $form->handleRequest($request); } if ($form->isValid()) {
[AdminListBundle]: form submit to form handlerequest (#<I>)
Kunstmaan_KunstmaanBundlesCMS
train
php
ab80c036af779d8c0b2e041f265bfb16592de7c2
diff --git a/lib/mux.js b/lib/mux.js index <HASH>..<HASH> 100644 --- a/lib/mux.js +++ b/lib/mux.js @@ -155,10 +155,15 @@ function Ctor(options, receiveProps) { _emitter.on(CHANGE_EVENT, function (kp) { var willComputedProps = [] var mappings = [] + + if (!Object.keys(_cptDepsMapping).length) return + while(kp) { _cptDepsMapping[kp] && (mappings = mappings.concat(_cptDepsMapping[kp])) kp = $keypath.digest(kp) } + + if (!mappings.length) return /** * get all computed props that depend on kp */ @@ -190,7 +195,6 @@ function Ctor(options, receiveProps) { var args = arguments var evtArgs = $util.copyArray(args) var kp = $normalize($join(_rootPath(), propname)) - args[0] = CHANGE_EVENT + ':' + kp _emitter.emit(CHANGE_EVENT, kp) emitter.emit.apply(emitter, args)
filtrate some vars to stop empty logic when computed changed
switer_muxjs
train
js
4091c684a792328a3165a96480dd2ccfaa0bc9c1
diff --git a/ospd/parser.py b/ospd/parser.py index <HASH>..<HASH> 100644 --- a/ospd/parser.py +++ b/ospd/parser.py @@ -101,6 +101,7 @@ def create_args_parser(description: str) -> ParserType: '-b', '--bind-address', default=DEFAULT_ADDRESS, + dest='address', help='Address to listen on. Default: %(default)s', ) parser.add_argument(
Store bind-address argument in address property
greenbone_ospd
train
py
f9643901c5c25907d4ce0b94d08de2e9c93434d6
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,7 @@ test_requirements = [ if sys.version_info < (2, 7) or ( sys.version_info >= (3, 0) and sys.version_info < (3, 1)): # Require unittest2 for Python which doesn't contain the new unittest - # module (appears in Python 2.7 and Python 3.4) + # module (appears in Python 2.7 and Python 3.5) test_requirements.append('unittest2') if sys.version_info >= (3, 0): @@ -73,7 +73,7 @@ pytest_runner = ['pytest-runner'] if 'ptr' in sys.argv else [] setup_params = dict( name = 'keyring', - version = "3.4", + version = "3.5", description = "Store and access your passwords safely.", url = "http://bitbucket.org/kang/python-keyring-lib", keywords = "keyring Keychain GnomeKeyring Kwallet password storage",
Bumped to <I> in preparation for next release.
jaraco_keyring
train
py
95647b73d3f074b10db6d9aba9680e51d2ea1f81
diff --git a/indra/tests/test_belief_sklearn.py b/indra/tests/test_belief_sklearn.py index <HASH>..<HASH> 100644 --- a/indra/tests/test_belief_sklearn.py +++ b/indra/tests/test_belief_sklearn.py @@ -354,6 +354,19 @@ def test_set_hierarchy_probs(): assert stmt.belief != prior_prob +def test_set_hierarchy_probs_specific_false(): + # Get probs for a set of statements, and a belief engine instance + be, test_stmts_copy, prior_probs = setup_belief(include_more_specific=False) + # Set beliefs on the flattened statements + top_level = ac.filter_top_level(test_stmts_copy) + be.set_hierarchy_probs(test_stmts_copy) + # Compare hierarchy probs to prior probs + for stmt, prior_prob in zip(test_stmts_copy, prior_probs): + # Because we haven't included any supports, the beliefs should + # not have changed + assert stmt.belief == prior_prob + + def test_hybrid_scorer(): # First instantiate and train the SimpleScorer on readers # Make a model @@ -402,4 +415,3 @@ def test_hybrid_scorer(): print(expected_beliefs[ix], hybrid_beliefs[ix]) assert np.allclose(hybrid_beliefs, expected_beliefs) -
Add regression test for feature matrix discrepancy error
sorgerlab_indra
train
py
755f3f8c317a244ea34b36359201ca5bb3aaa83d
diff --git a/pyscreenshot/check/speedtest.py b/pyscreenshot/check/speedtest.py index <HASH>..<HASH> 100644 --- a/pyscreenshot/check/speedtest.py +++ b/pyscreenshot/check/speedtest.py @@ -4,6 +4,9 @@ import time import pyscreenshot from entrypoint2 import entrypoint +from pyscreenshot.plugins.gnome_dbus import GnomeDBusWrapper +from pyscreenshot.plugins.gnome_screenshot import GnomeScreenshotWrapper +from pyscreenshot.plugins.kwin_dbus import KwinDBusWrapper from pyscreenshot.util import proc @@ -28,6 +31,9 @@ def run(force_backend, n, childprocess, bbox=None): print("") +novirt = [GnomeDBusWrapper.name, KwinDBusWrapper.name, GnomeScreenshotWrapper.name] + + def run_all(n, childprocess_param, virtual_only=True, bbox=None): debug = True print("") @@ -46,7 +52,8 @@ def run_all(n, childprocess_param, virtual_only=True, bbox=None): debugpar = [] for x in ["default"] + pyscreenshot.backends(): backendpar = ["--backend", x] - if virtual_only and x == "gnome-screenshot": # TODO: remove + # skip non X backends + if virtual_only and x in novirt: continue p = proc( "pyscreenshot.check.speedtest",
speedtest: skip non X backends
ponty_pyscreenshot
train
py
5e7c2e14926188a4a4076eb1774d0d500cc88f4a
diff --git a/client/html/templates/checkout/standard/process-body-standard.php b/client/html/templates/checkout/standard/process-body-standard.php index <HASH>..<HASH> 100644 --- a/client/html/templates/checkout/standard/process-body-standard.php +++ b/client/html/templates/checkout/standard/process-body-standard.php @@ -7,7 +7,7 @@ $enc = $this->encoder(); -$prefix =$this->get( 'standardUrlExternal', true ); +$prefix = $this->get( 'standardUrlExternal', true ); /** client/html/checkout/standard/process/validate
Scrutinizer Auto-Fixes (#<I>) This commit consists of patches automatically generated for this project on <URL>
aimeos_ai-client-html
train
php
961f89997b215848695df9aa16b22b9494b16695
diff --git a/lib/utils/build-name-from-env.js b/lib/utils/build-name-from-env.js index <HASH>..<HASH> 100644 --- a/lib/utils/build-name-from-env.js +++ b/lib/utils/build-name-from-env.js @@ -1,5 +1,5 @@ module.exports = function() { - let buildNum = process.env.TRAVIS_JOB_NUMBER || process.env.BITBUCKET_BUILD_NUMBER; + let buildNum = process.env.TRAVIS_JOB_NUMBER || process.env.BITBUCKET_BUILD_NUMBER || process.env.CIRCLE_BUILD_NUM; let prefix = process.env.BROWSERSTACK_BUILD_NAME_PREFIX; if (buildNum && prefix) { return prefix + '-' + buildNum;
Add support for CIRCLE_BUILD_NUM
kategengler_ember-cli-browserstack
train
js
50d1d12f6e5cc30ec74be4547134db7babbeed28
diff --git a/src/Barryvdh/Debugbar/ServiceProvider.php b/src/Barryvdh/Debugbar/ServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Barryvdh/Debugbar/ServiceProvider.php +++ b/src/Barryvdh/Debugbar/ServiceProvider.php @@ -71,14 +71,15 @@ class ServiceProvider extends \Illuminate\Support\ServiceProvider { } if($db = $app['db']){ - $pdo = new TraceablePDO( $db->getPdo() ); - $debugbar->addCollector(new PDOCollector( $pdo )); + try{ + $pdo = new TraceablePDO( $db->getPdo() ); + $debugbar->addCollector(new PDOCollector( $pdo )); + }catch(\PDOException $e){ + //Not connection set.. + } } - if($mailer = $app['mailer']){ - $debugbar['messages']->aggregate(new SwiftLogCollector($mailer->getSwiftMailer())); - $debugbar->addCollector(new SwiftMailCollector($mailer->getSwiftMailer())); - } + return $debugbar; });
Remove Mailer and check for DB Connection
barryvdh_laravel-debugbar
train
php
4c3767c492d5d2c2492e2dda3b12338ae0ae8f15
diff --git a/session.go b/session.go index <HASH>..<HASH> 100644 --- a/session.go +++ b/session.go @@ -1,15 +1,35 @@ package revel import ( + "github.com/streadway/simpleuuid" "net/http" "net/url" "strings" + "time" ) // A signed cookie (and thus limited to 4kb in size). // Restriction: Keys may not have a colon in them. type Session map[string]string +const ( + SESSION_ID_KEY = "_ID" +) + +// Return a UUID identifying this session. +func (s Session) Id() string { + if uuidStr, ok := s[SESSION_ID_KEY]; ok { + return uuidStr + } + + uuid, err := simpleuuid.NewTime(time.Now()) + if err != nil { + panic(err) // I don't think this can actually happen. + } + s[SESSION_ID_KEY] = uuid.String() + return s[SESSION_ID_KEY] +} + type SessionPlugin struct{ EmptyPlugin } func (p SessionPlugin) BeforeRequest(c *Controller) { @@ -20,6 +40,9 @@ func (p SessionPlugin) AfterRequest(c *Controller) { // Store the session (and sign it). var sessionValue string for key, value := range c.Session { + if strings.Contains(key, ":") { + panic("Session keys may not have colons") + } sessionValue += "\x00" + key + ":" + value + "\x00" } sessionData := url.QueryEscape(sessionValue)
Add Session.Id() to return a UUID for the session. Using the simpleuuid package.
revel_revel
train
go
9f53ee27ac59ec843a7bd4e22f219f3c55ef34ea
diff --git a/src/pytds/__init__.py b/src/pytds/__init__.py index <HASH>..<HASH> 100644 --- a/src/pytds/__init__.py +++ b/src/pytds/__init__.py @@ -47,8 +47,8 @@ __version__ = pkg_resources.get_distribution('python-tds').version def _ver_to_int(ver): - maj, minor, rev = ver.split('.') - return (int(maj) << 24) + (int(minor) << 16) + (int(rev) << 8) + maj, minor, _ = ver.split('.') + return (int(maj) << 24) + (int(minor) << 16) intversion = _ver_to_int(__version__)
Change to send only major and minor parts of version to server Third component can contain git hash, which cannot be converted to integer properly
denisenkom_pytds
train
py
8c19b0c4ec29c8daa3aceddcaabf7ec0f86ed12e
diff --git a/fancy_getopt.py b/fancy_getopt.py index <HASH>..<HASH> 100644 --- a/fancy_getopt.py +++ b/fancy_getopt.py @@ -31,12 +31,6 @@ neg_alias_re = re.compile("^(%s)=!(%s)$" % (longopt_pat, longopt_pat)) # (for use as attributes of some object). longopt_xlate = string.maketrans('-', '_') -# This records (option, value) pairs in the order seen on the command line; -# it's close to what getopt.getopt() returns, but with short options -# expanded. (Ugh, this module should be OO-ified.) -_option_order = None - - class FancyGetopt: """Wrapper around the standard 'getopt()' module that provides some handy extra functionality:
global _option_order is not used
pypa_setuptools
train
py
265ab9731e677b5769a5b4d88c169c68ef11a8a3
diff --git a/ruby_event_store/lib/ruby_event_store/spec/event_repository_lint.rb b/ruby_event_store/lib/ruby_event_store/spec/event_repository_lint.rb index <HASH>..<HASH> 100644 --- a/ruby_event_store/lib/ruby_event_store/spec/event_repository_lint.rb +++ b/ruby_event_store/lib/ruby_event_store/spec/event_repository_lint.rb @@ -1200,6 +1200,7 @@ module RubyEventStore '8a6f053e-3ce2-4c82-a55b-4d02c66ae6ea', 'd345f86d-b903-4d78-803f-38990c078d9e' ]).in_batches.result).to_a[0]).to eq([e1,e3]) + expect(repository.read(specification.with_id([]).result).to_a).to eq([]) end specify do
Expect `read.events([])` to return empty collection
RailsEventStore_rails_event_store
train
rb
5628032034beffa1f5a8761c69cd05c4e0bd5c39
diff --git a/src/Moip.php b/src/Moip.php index <HASH>..<HASH> 100644 --- a/src/Moip.php +++ b/src/Moip.php @@ -44,7 +44,7 @@ class Moip * * @const string */ - const CLIENT_VERSION = '1.3.0'; + const CLIENT_VERSION = '1.3.1'; /** * Authentication that will be added to the header of request.
chore: bumped version to <I>
wirecardBrasil_moip-sdk-php
train
php
185cf18f3d0aec7941ecdf8000a6004b96a0a000
diff --git a/src/Users.php b/src/Users.php index <HASH>..<HASH> 100644 --- a/src/Users.php +++ b/src/Users.php @@ -231,7 +231,7 @@ class Users $this->getUsers(); // In most cases by far, we'll request an ID, and we can return it here. - if (array_key_exists($userId, $this->users)) { + if ($userId && array_key_exists($userId, $this->users)) { return $this->users[$userId]; }
Don't break if UserId is `null`
bolt_bolt
train
php
11ea56c52e1704b7dc0bb3c24338108201c21ec1
diff --git a/splinter/driver/webdriver/remote.py b/splinter/driver/webdriver/remote.py index <HASH>..<HASH> 100644 --- a/splinter/driver/webdriver/remote.py +++ b/splinter/driver/webdriver/remote.py @@ -3,26 +3,18 @@ import subprocess from selenium.webdriver import Remote -from selenium.webdriver.firefox.firefox_profile import FirefoxProfile from splinter.driver.webdriver import BaseWebDriver, WebDriverElement as BaseWebDriverElement from splinter.driver.webdriver.cookie_manager import CookieManager class WebDriver(BaseWebDriver): - def __init__(self, server, port=4443, profile=None, extensions=None): + def __init__(self, server='localhost', port=4443): self.old_popen = subprocess.Popen - firefox_profile = FirefoxProfile(profile) - firefox_profile.set_preference('extensions.logging.enabled', False) - firefox_profile.set_preference('network.dns.disableIPv6', False) - - if extensions: - for extension in extensions: - firefox_profile.add_extension(extension) self._patch_subprocess() - dest = 'http://%s:%s/wd/hub'%(server,port) - self.driver = Remote(dest, {}, firefox_profile) + dest = 'http://%s:%s/wd/hub' % (server, port) + self.driver = Remote(dest, {}) self._unpatch_subprocess() self.element_class = WebDriverElement
using localhost as defaul remote server
cobrateam_splinter
train
py
a0b06e0224dfaea4aed8c326296b76ee1ee42698
diff --git a/check.go b/check.go index <HASH>..<HASH> 100644 --- a/check.go +++ b/check.go @@ -50,7 +50,7 @@ func Check(root string, dh *DirectoryHierarchy, keywords []string) (*Result, err creator.curSet = nil } case RelativeType, FullType: - info, err := os.Lstat(filepath.Join(root, e.Path())) + info, err := os.Lstat(e.Path()) if err != nil { return nil, err }
check: recognize correct path Fixes #<I>. Check() changes its working directory to `root`, which is specified as an argument. Thus, it shouldn't open a file using its absolute path; instead it should open the file with the relative path to the root.
vbatts_go-mtree
train
go
c0226c1e896e6063ca0fd96d207350b460df961e
diff --git a/src/Controllers/OAuthController.php b/src/Controllers/OAuthController.php index <HASH>..<HASH> 100644 --- a/src/Controllers/OAuthController.php +++ b/src/Controllers/OAuthController.php @@ -62,7 +62,6 @@ class OAuthController extends HookController { // If is a new user, fill and save with auth data if (!$auth->_id) { - $auth->setTrustedAction(true); $auth->fill($opauth_data['info']); } @@ -74,6 +73,7 @@ class OAuthController extends HookController { // set visible provider_id on auth row. // such as 'facebook_id', 'google_id', etc. + $auth->setTrustedAction(true); $auth->setAttribute($identity->provider . '_id', $identity->uid); $auth->save();
set Auth updates as 'trusted action' when using OAuth.
doubleleft_hook
train
php
4959d2bbf4a5eef80a5e7afc8e20500c010b94a7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ def readme(file='', split=False): setup( name='pyderman', - version='1.4.0', + version='2.0.0', description='Installs the latest Chrome/Firefox/Opera/PhantomJS/Edge web drivers automatically.', long_description=readme('README.md'), long_description_content_type='text/markdown',
Increment to <I>, due to potentially-breaking Error handling changes.
shadowmoose_chrome_driver
train
py
cdaecf3859df0b9ee5ede0159a87c48fd90ce365
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -36,7 +36,7 @@ module.exports = function(opt) { file.contents = null; - file.path = pathToCss; + file.path = gutil.replaceExtension(file.path, '.css'); fs.readFile(pathToCss, function (err, contents) { if (err) { @@ -50,7 +50,6 @@ module.exports = function(opt) { file.contents = contents; return cb(null, file); - }); }); };
fixed #<I> .pipe(gulp.dest(dest)) not working.
appleboy_gulp-compass
train
js
27f0e796afae671a29b6e361637502d82150a272
diff --git a/jobs/create-version-branch.js b/jobs/create-version-branch.js index <HASH>..<HASH> 100644 --- a/jobs/create-version-branch.js +++ b/jobs/create-version-branch.js @@ -169,7 +169,7 @@ module.exports = async function ( if (!satisfies && openPR) { const dependencyNameAndVersion = `${depName}-${latestDependencyVersion}` - if (!openPR.comments.includes(dependencyNameAndVersion)) { + if (!openPR.comments || !openPR.comments.includes(dependencyNameAndVersion)) { hasNewUpdates = true await upsert(repositories, openPR._id, { comments: [...(openPR.comments || []), dependencyNameAndVersion]
fix(create-version-branch): comments on PR docs might not exist yet
greenkeeperio_greenkeeper
train
js
277212c09c46e1720059568aa107ae84e7e4315c
diff --git a/gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/SuggestBox.java b/gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/SuggestBox.java index <HASH>..<HASH> 100644 --- a/gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/SuggestBox.java +++ b/gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/SuggestBox.java @@ -138,8 +138,11 @@ public class SuggestBox extends com.google.gwt.user.client.ui.SuggestBox impleme }; Window.addResizeHandler(popupResizeHandler); } + if (!suggestBox.getElement().getStyle().getZIndex().equals("")) { + getPopupPanel().getElement().getStyle() + .setZIndex(Integer.valueOf(suggestBox.getElement().getStyle().getZIndex())); + } } - } private final EnabledMixin<SuggestBox> enabledMixin = new EnabledMixin<SuggestBox>(this);
Fixes <I>. Update the z-index of the popup when SuggestBox z-index is not "".
gwtbootstrap3_gwtbootstrap3
train
java
d25622d15ad37b465dd39f6b0f5524a0c2593811
diff --git a/tofu/imas2tofu/_core.py b/tofu/imas2tofu/_core.py index <HASH>..<HASH> 100644 --- a/tofu/imas2tofu/_core.py +++ b/tofu/imas2tofu/_core.py @@ -2704,8 +2704,8 @@ class MultiIDSLoader(object): if np.any(indnan): nunav, ntot = str(indnan.sum()), str(D.shape[1]) msg = "Some lines of sight geometry unavailable in ids:\n" - msg += " - nb. of LOS unavailable: %s / %s\n"%(nunav, ntot) - msg += " - indices: %s"%str(indnan.nonzero()[0]) + msg += " - unavailable LOS: {0} / {1}\n".format(nunav, ntot) + msg += " - indices: {0}"%format(str(indnan.nonzero()[0])) warnings.warn(msg) else: dgeom = None diff --git a/tofu/version.py b/tofu/version.py index <HASH>..<HASH> 100644 --- a/tofu/version.py +++ b/tofu/version.py @@ -1,2 +1,2 @@ # Do not edit, pipeline versioning governed by git tags! -__version__ = '1.4.1-188-g044d87f' +__version__ = '1.4.1-189-g5ca9e73'
[Issue<I>] PEP8 Compliance
ToFuProject_tofu
train
py,py
71800ed627af31c05677a7376ce9b6a601856268
diff --git a/round/developers.py b/round/developers.py index <HASH>..<HASH> 100644 --- a/round/developers.py +++ b/round/developers.py @@ -6,7 +6,7 @@ from .config import * from .wrappers import * -import Applications as apps +import applications as apps class Developers(object):
import capitalization error Applications should be applications
GemHQ_round-py
train
py
b37eaf3073b898650026389e94c60207eae26835
diff --git a/src/subscription.js b/src/subscription.js index <HASH>..<HASH> 100644 --- a/src/subscription.js +++ b/src/subscription.js @@ -47,15 +47,15 @@ class EventSubscription { _setActivationState(activated, cancelReason) { this._internal.cancelReason = cancelReason; this._internal.state = activated ? 'active' : 'canceled'; - for (let i = 0; i < this._internal.activatePromises.length; i++) { - const p = this._internal.activatePromises[i]; + while (this._internal.activatePromises.length > 0) { + const p = this._internal.activatePromises.shift(); if (activated) { p.callback && p.callback(true); p.resolve && p.resolve(); } else { p.callback && p.callback(false, cancelReason); - p.reject(cancelReason); + p.reject && p.reject(cancelReason); } } }
Trigger activation callbacks once
appy-one_acebase-core
train
js
87a369e496985a23c129b943457bd706a6a73fb0
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -29,9 +29,10 @@ setup(name='hpOneView', version='2.0.0', description='HPE OneView Python Library', url='https://github.com/HewlettPackard/python-hpOneView', + download_url="https://github.com/HewlettPackard/python-hpOneView/releases/tag/hpOneView-API-v200", author='Hewlett Packard Enterprise Development LP', - author_email = 'oneview-pythonsdk@hpe.com', + author_email='oneview-pythonsdk@hpe.com', license='MIT', packages=find_packages(exclude=['examples*', 'tests*']), - keywords=['oneview'], + keywords=['oneview', 'hpe'], install_requires=['future>=0.15.2'])
Add link in setup.py to download <I>
HewlettPackard_python-hpOneView
train
py
09f6055f9c8f20a21850d73914c5094d7eac8806
diff --git a/regcompiler.rb b/regcompiler.rb index <HASH>..<HASH> 100755 --- a/regcompiler.rb +++ b/regcompiler.rb @@ -2147,10 +2147,10 @@ end end end - def continuing_to_match - @threads.each{|thr| progress=thr[:progress] + def continuing_to_match progress + @threads.each{|thr| thr_progress=thr[:progress] progress.variable_names.each{|vname| - raw_register_var vname,progress.raw_variable(vname) + progress.raw_register_var vname,thr_progress.raw_variable(vname) } } @@ -2199,7 +2199,7 @@ end #p :end_try_match, @progress.cursor.pos - continuing_to_match if respond_to? :continuing_to_match + continuing_to_match(@progress) if respond_to? :continuing_to_match return true end
fixed continuing_to_match to call things on the right object
coatl_reg
train
rb
c809f85c214acd196ff1476b594b0592f6ba02d0
diff --git a/edisgo/data/import_data.py b/edisgo/data/import_data.py index <HASH>..<HASH> 100644 --- a/edisgo/data/import_data.py +++ b/edisgo/data/import_data.py @@ -1488,14 +1488,13 @@ def _import_genos_from_oedb(network): if row['geom']: geom = row['geom'] else: - # MV generators: set geom to EnergyMap's geom, if available - if int(row['voltage_level']) in [4,5]: - # check if original geom from Energy Map is available - if row['geom_em']: - geom = row['geom_em'] - logger.warning('Generator {} has no geom entry, EnergyMap\'s geom entry will be used.' - .format(id) - ) + # Set geom to EnergyMap's original geom, if this only this is + # available + if row['geom_em']: + geom = row['geom_em'] + logger.warning('Generator {} has no geom entry, EnergyMap\'s geom entry will be used.' + .format(id) + ) return geom
Fix geom is None for LV generators If geom of a generator is set to None this leads to subsequent errors...
openego_eDisGo
train
py
861f6baa66a4f625be7cd4d5228009e53265e1b6
diff --git a/support/app.js b/support/app.js index <HASH>..<HASH> 100644 --- a/support/app.js +++ b/support/app.js @@ -25,7 +25,7 @@ app.get('/middleware', foo, foo, foo, foo, function(req, res){ var n = 100; while (n--) { - app.get('/foo', function(req, res){ + app.get('/foo', foo, foo, function(req, res){ }); }
added some middleware to support/app.js
expressjs_express
train
js
edbec03015e7a2cb849db4059baadd02502a57f7
diff --git a/stdeb/util.py b/stdeb/util.py index <HASH>..<HASH> 100644 --- a/stdeb/util.py +++ b/stdeb/util.py @@ -48,7 +48,7 @@ stdeb_cmdline_opts = [ ('remove-expanded-source-dir','r', 'remove the expanded source directory'), ('ignore-install-requires', 'i', - 'ignore the requirements from requires.txt in the egg-info directory + 'ignore the requirements from requires.txt in the egg-info directory'), ] stdeb_cmd_bool_opts = [
fix SyntaxError introduced by --ignore-install-requires patch
astraw_stdeb
train
py
25baf11d5fb5eb64b3e1da02566118374e37605c
diff --git a/src/views/pages/preview.blade.php b/src/views/pages/preview.blade.php index <HASH>..<HASH> 100644 --- a/src/views/pages/preview.blade.php +++ b/src/views/pages/preview.blade.php @@ -12,16 +12,17 @@ <div id="overlay-inner"> <div class="pull-left"> - <div class="preview-text">You are previewing version #{{ $version->version }} of page "{{ $version->name }}"</div> + <div class="preview-text">You are previewing version #{{ $version->version }} of "{{ $version->page->name }}"</div> </div> - - <div class="pull-right"> - @if (Session::has('comment_saved')) - <span class="label label-success">Comment added!</span> - @endif - <button class="btn btn-default" id="add-comment-button">Add comment</button> - </div> + @if ($version->status == 'draft') + <div class="pull-right"> + @if (Session::has('comment_saved')) + <span class="label label-success">Comment added!</span> + @endif + <button class="btn btn-default" id="add-comment-button">Add comment</button> + </div> + @endif <div class="clearfix"></div>
Only show the comment link on the preview when we are looking at a draft version.
CoandaCMS_coanda-core
train
php
5b983f34d9370ff61f518e5bfd09baccf9905579
diff --git a/packages/build-essentials/src/styles/styleConstants.js b/packages/build-essentials/src/styles/styleConstants.js index <HASH>..<HASH> 100644 --- a/packages/build-essentials/src/styles/styleConstants.js +++ b/packages/build-essentials/src/styles/styleConstants.js @@ -20,7 +20,7 @@ const config = { secondaryToolbar: ['linkIconButtonFlyout'], flashMessageContainer: '2', loadingIndicatorContainer: '2', - secondaryInspector: ['context', 'close'], + secondaryInspector: ['context', 'iframe', 'close'], secondaryInspectorElevated: ['context', 'dropdownContents'], dialog: ['context'], fullScreenClose: ['context'],
BUGFIX: Increase close button z- index The secondary inspector has two constants for z index. The close button needs to be incresed to value higher than 3. And the possible iFrame has not z index yet. So we define a iframe zindex constant and so we also increase the close button constant.
neos_neos-ui
train
js
43a094be1d509cabb616ee744d8d2fc9b72df69e
diff --git a/src/phpDocumentor/Configuration/Loader.php b/src/phpDocumentor/Configuration/Loader.php index <HASH>..<HASH> 100644 --- a/src/phpDocumentor/Configuration/Loader.php +++ b/src/phpDocumentor/Configuration/Loader.php @@ -50,7 +50,10 @@ class Loader if (!$userConfigFilePath) { $userConfigFilePath = $input->getParameterOption('-c'); } - $userConfigFilePath = realpath($userConfigFilePath); + + if ($userConfigFilePath !== false) { + $userConfigFilePath = realpath($userConfigFilePath); + } if ($userConfigFilePath && $userConfigFilePath != 'none' && is_readable($userConfigFilePath)) { chdir(dirname($userConfigFilePath));
only apply realpath if config file was set see also #<I>
phpDocumentor_phpDocumentor2
train
php
b3be80aeb1c10774299bbf3fe68514f621710216
diff --git a/nodejs/scripts/tests/GH73/GH73.js b/nodejs/scripts/tests/GH73/GH73.js index <HASH>..<HASH> 100644 --- a/nodejs/scripts/tests/GH73/GH73.js +++ b/nodejs/scripts/tests/GH73/GH73.js @@ -4,9 +4,9 @@ module.exports = { "Issues" : { "GH73Core" : require('./GH73Core'), - + // TODO // runs only standalone under linux - // "GH73DateTimezoneOffset" : require('./GH73DateTimezoneOffset'), +// "GH73DateTimezoneOffset" : require('./GH73DateTimezoneOffset'), "GH73Calendar" : require('./GH73Calendar'), "GH73GYear" : require('./GH73GYear'), "GH73GYearMonth" : require('./GH73GYearMonth'),
Issue #<I>. TZ tests commenten out.
highsource_jsonix
train
js
b49dfbd6a1505172f2d2ce5f221ef3fdf9ac2432
diff --git a/lib/adhearsion/process.rb b/lib/adhearsion/process.rb index <HASH>..<HASH> 100644 --- a/lib/adhearsion/process.rb +++ b/lib/adhearsion/process.rb @@ -59,6 +59,13 @@ module Adhearsion def request_stop Events.trigger_immediately :stop_requested + IMPORTANT_THREADS << Thread.new do + until Adhearsion.active_calls.count == 0 + logger.trace "Stop requested but we still have #{Adhearsion.active_calls.count} active calls." + sleep 0.2 + end + force_stop + end end def final_shutdown
[FEATURE] Shut down when call count reaches 0.
adhearsion_adhearsion
train
rb
4cfe76116879857722b000c74b631049bf3a63f1
diff --git a/src/org/mozilla/javascript/NativeDate.java b/src/org/mozilla/javascript/NativeDate.java index <HASH>..<HASH> 100644 --- a/src/org/mozilla/javascript/NativeDate.java +++ b/src/org/mozilla/javascript/NativeDate.java @@ -1146,7 +1146,7 @@ final class NativeDate extends IdScriptable { } /* constants for toString, toUTCString */ - private static String js_NaN_date_str = "Invalid Date"; + private static final String js_NaN_date_str = "Invalid Date"; private static String toLocale_helper(double t, java.text.DateFormat formatter)
Adding missed final qualifier to the declaration of js_NaN_date_str field
mozilla_rhino
train
java
97509a7798c012deca8a7470945d9ea68e401a44
diff --git a/app/src/androidTest/java/fi/iki/elonen/router/RouterNanoHTTPD.java b/app/src/androidTest/java/fi/iki/elonen/router/RouterNanoHTTPD.java index <HASH>..<HASH> 100644 --- a/app/src/androidTest/java/fi/iki/elonen/router/RouterNanoHTTPD.java +++ b/app/src/androidTest/java/fi/iki/elonen/router/RouterNanoHTTPD.java @@ -560,13 +560,16 @@ public class RouterNanoHTTPD extends NanoHTTPD { @Override public Response serve(IHTTPSession session) { + long bodySize = ((HTTPSession)session).getBodySize(); + session.getInputStream().mark(HTTPSession.BUFSIZE); + // Try to find match Response r = router.process(session); - + //clear remain body try{ - Map<String, String> remainBody = new HashMap<>(); - session.parseBody(remainBody); + session.getInputStream().reset(); + session.getInputStream().skip(bodySize); } catch (Exception e){ String error = "Error: " + e.getClass().getName() + " : " + e.getMessage();
fix call parseBody twice cause read timeout (#<I>) some router.process call parseBody, after that we call parseBody for the second time, cause inputstream read timeout
macacajs_UIAutomatorWD
train
java
80043ce7680b367d77503f7e9563a4859c428889
diff --git a/salt/grains/core.py b/salt/grains/core.py index <HASH>..<HASH> 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -528,6 +528,7 @@ _OS_FAMILY_MAP = { 'CloudLinux': 'RedHat', 'OVS': 'RedHat', 'OEL': 'RedHat', + 'XCP': 'RedHat', 'Mandrake': 'Mandriva', 'ESXi': 'VMWare', 'Mint': 'Debian',
Add XCP to the os_family grainmap per #<I>
saltstack_salt
train
py
6607141f7903946e9293b8efc4628ab58f84470e
diff --git a/build_id.py b/build_id.py index <HASH>..<HASH> 100644 --- a/build_id.py +++ b/build_id.py @@ -1,14 +1,14 @@ +from __future__ import print_function import datetime import sys import json -json_data=open('./package.json').read(); +json_data=open('./package.json').read() data=json.loads(json_data) -print 'release.version='+data['version'] -print 'ptf.version=0' -print 'patch.level=0' +print('release.version='+data['version']) +print('ptf.version=0') +print('patch.level=0') if len(sys.argv) > 1: - print 'build.level='+sys.argv[1] + print('build.level='+sys.argv[1]) else: - print 'build.level='+(datetime.datetime.now().strftime('%Y%m%d%H%M')) - + print('build.level='+datetime.datetime.now().strftime('%Y%m%d%H%M'))
Use print() function in both Python 2 and Python 3 Legacy __print__ statements are syntax errors in Python 3 but __print()__ function works as expected in both Python 2 and Python 3.
IBM_node-ibmapm-restclient
train
py
8331d18992adf19f8159766aad7985c97bee3660
diff --git a/Controller/AdministrationController.php b/Controller/AdministrationController.php index <HASH>..<HASH> 100644 --- a/Controller/AdministrationController.php +++ b/Controller/AdministrationController.php @@ -1016,10 +1016,13 @@ class AdministrationController extends Controller $criteriaForm->handleRequest($this->request); $unique = false; + $range = null; + if ($criteriaForm->isValid()) { $range = $criteriaForm->get('range')->getData(); $unique = $criteriaForm->get('unique')->getData() === 'true'; } + $actionsForRange = $this->analyticsManager ->getDailyActionNumberForDateRange($range, 'user_login', $unique); @@ -1065,9 +1068,9 @@ class AdministrationController extends Controller /** * @EXT\Route( - * "/analytics/top/{top_type}", + * "/analytics/top/{topType}", * name="claro_admin_analytics_top", - * defaults={"top_type" = "top_users_connections"} + * defaults={"topType" = "top_users_connections"} * ) * * @EXT\Method({"GET", "POST"})
[CoreBundle] Fixed stat controller bugs
claroline_Distribution
train
php
b3081e6e598c583cd1b4ad3741d06b7f6d429bb4
diff --git a/packages/dev-react/config/babel.js b/packages/dev-react/config/babel.js index <HASH>..<HASH> 100644 --- a/packages/dev-react/config/babel.js +++ b/packages/dev-react/config/babel.js @@ -3,11 +3,7 @@ const base = require('@polkadot/dev/config/babel'); module.exports = Object.keys(base).reduce((config, key) => { config[key] = base[key]; - if (key === 'plugins') { - config[key] = config[key].concat([ - 'react-hot-loader/babel' - ]); - } else if (key === 'presets') { + if (key === 'presets') { const env = config[key].find((item) => item[0] === '@babel/preset-env'); env[1].targets.browsers = [
Remove react-hot-loader from default deps
polkadot-js_dev
train
js
a1dcdeda4636e9e533debb48ce6121c57258dc71
diff --git a/spec/attr_vault_spec.rb b/spec/attr_vault_spec.rb index <HASH>..<HASH> 100644 --- a/spec/attr_vault_spec.rb +++ b/spec/attr_vault_spec.rb @@ -355,12 +355,12 @@ describe AttrVault do context "with a digest field" do let(:key_id) { '80a8571b-dc8a-44da-9b89-caee87e41ce2' } - let (:key) { + let(:key) { [{id: key_id, value: 'aFJDXs+798G7wgS/nap21LXIpm/Rrr39jIVo2m/cdj8=', created_at: Time.now}] } - let(:item) { + let(:item) { # the let form can't be evaluated inside the class definition # because Ruby scoping rules were written by H.P. Lovecraft, so # we create a local here to work around that
Clean up whitespace and fix a linting error The "let (:key)" construct was the nearly-problematic one, because association rules allow (:key) to be a "grouped expression".
uhoh-itsmaciek_attr_vault
train
rb
e9345eccb003466fcbdbfc3df568d7dd579d8e14
diff --git a/value/src/main/java/com/google/auto/value/extension/AutoValueExtension.java b/value/src/main/java/com/google/auto/value/extension/AutoValueExtension.java index <HASH>..<HASH> 100644 --- a/value/src/main/java/com/google/auto/value/extension/AutoValueExtension.java +++ b/value/src/main/java/com/google/auto/value/extension/AutoValueExtension.java @@ -9,11 +9,10 @@ import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.TypeElement; /** + * This API is not final and WILL CHANGE in a future release. * An AutoValueExtension allows for extra functionality to be created during the generation * of an AutoValue class. * - * <p>NOTE: The design of this interface is not final and subject to change. - * * <p>Extensions are discovered at compile time using the {@link java.util.ServiceLoader} APIs, * allowing them to run without any additional annotations. *
Add stronger scare-text to the javadoc for AutoValueExtension. The intent is to allow a <I> release without having to finalize this API. ------------- Created by MOE: <URL>
google_auto
train
java
5af4528d2d3b45696f509e5d24bcf29cbb19b033
diff --git a/spec/upyun_spec.rb b/spec/upyun_spec.rb index <HASH>..<HASH> 100644 --- a/spec/upyun_spec.rb +++ b/spec/upyun_spec.rb @@ -337,7 +337,7 @@ describe "Form Upload", current: true do it "set not correct 'expiration' should return 403 with expired" do res = @form.upload(@file, {'expiration' => 102400}) expect(res[:code]).to eq(403) - expect(res[:message]).to match(/Authorize has expired/) + expect(res[:message]).to match(/authorization has expired/) end it "set 'return-url' should return a hash" do
Server is responding differently, updating the spec The response message was actually "authorization has expired" and not "Authorize has expired"
upyun_ruby-sdk
train
rb
d67a5b34235a517f00f78d8a95ca80c8c4441f79
diff --git a/driver/src/test/java/org/neo4j/driver/internal/async/inbound/InboundMessageDispatcherTest.java b/driver/src/test/java/org/neo4j/driver/internal/async/inbound/InboundMessageDispatcherTest.java index <HASH>..<HASH> 100644 --- a/driver/src/test/java/org/neo4j/driver/internal/async/inbound/InboundMessageDispatcherTest.java +++ b/driver/src/test/java/org/neo4j/driver/internal/async/inbound/InboundMessageDispatcherTest.java @@ -67,7 +67,7 @@ class InboundMessageDispatcherTest @Test void shouldFailWhenCreatedWithNullLogging() { - assertThrows( NullPointerException.class, () -> new InboundMessageDispatcher( mock( Channel.class ), null ) ); + assertThrows( NullPointerException.class, () -> new InboundMessageDispatcher( newChannelMock(), null ) ); } @Test @@ -109,7 +109,7 @@ class InboundMessageDispatcherTest @Test void shouldSendResetOnFailure() { - Channel channel = mock( Channel.class ); + Channel channel = newChannelMock(); InboundMessageDispatcher dispatcher = newDispatcher( channel ); dispatcher.enqueue( mock( ResponseHandler.class ) );
Fix mocking in a unit test
neo4j_neo4j-java-driver
train
java
31ddf3606efd3088aca17e78dedaad78c9494679
diff --git a/source/org/jasig/portal/RDBMUserLayoutStore.java b/source/org/jasig/portal/RDBMUserLayoutStore.java index <HASH>..<HASH> 100644 --- a/source/org/jasig/portal/RDBMUserLayoutStore.java +++ b/source/org/jasig/portal/RDBMUserLayoutStore.java @@ -837,8 +837,8 @@ public class RDBMUserLayoutStore setAutoCommit(con, false); Statement stmt = con.createStatement(); try { - String sqlTitle = channel.getAttribute("title"); - String sqlDescription = channel.getAttribute("description"); + String sqlTitle = sqlEscape(channel.getAttribute("title")); + String sqlDescription = sqlEscape(channel.getAttribute("description")); String sqlClass = channel.getAttribute("class"); String sqlTypeID = channel.getAttribute("typeID"); String sysdate = "{ts '" + new Timestamp(System.currentTimeMillis()).toString() + "'}";
Added SQL escaping to Title and Description fields of new channels. git-svn-id: <URL>
Jasig_uPortal
train
java
f3b60a190b4c0e876448590020d65e634d6bab37
diff --git a/lib/push.js b/lib/push.js index <HASH>..<HASH> 100644 --- a/lib/push.js +++ b/lib/push.js @@ -32,7 +32,7 @@ module.exports = function push (options, docsOrIds) { }) replication.on('error', defer.reject) replication.on('change', function (change) { - if(change.docs.length > 1) { + if (change.docs.length > 1) { pushedObjects = pushedObjects.concat(change.docs) } pushedObjects.push(change.docs)
feat(push): fixed undefined object in pushedObj
hoodiehq_pouchdb-hoodie-sync
train
js
07b0604458352b081f64c9d305aa20164785f166
diff --git a/lnwallet/script_utils.go b/lnwallet/script_utils.go index <HASH>..<HASH> 100644 --- a/lnwallet/script_utils.go +++ b/lnwallet/script_utils.go @@ -1005,6 +1005,20 @@ func TweakPubKey(basePoint, commitPoint *btcec.PublicKey) *btcec.PublicKey { } } +// TweakPubKeyWithTweak is the exact same as the TweakPubKey function, however +// it accepts the raw tweak bytes directly rather than the commitment point. +func TweakPubKeyWithTweak(pubKey *btcec.PublicKey, tweakBytes []byte) *btcec.PublicKey { + tweakX, tweakY := btcec.S256().ScalarBaseMult(tweakBytes) + + x, y := btcec.S256().Add(pubKey.X, pubKey.Y, tweakX, tweakY) + + return &btcec.PublicKey{ + X: x, + Y: y, + Curve: btcec.S256(), + } +} + // TweakPrivKek tweaks the private key of a public base point given a per // commitment point. The per commitment secret is the revealed revocation // secret for the commitment state in question. This private key will only need
lnwallet: add TweakPubKeyWithTweak helper function This commit adds a new helper function which is identical to TweakPubkey, but lets the caller specify their own hash tweak.
lightningnetwork_lnd
train
go
2893e58ebfe714f2c12496ce227d6bc2efbdb397
diff --git a/src/input/ContentEditableInput.js b/src/input/ContentEditableInput.js index <HASH>..<HASH> 100644 --- a/src/input/ContentEditableInput.js +++ b/src/input/ContentEditableInput.js @@ -443,6 +443,7 @@ function domTextBetween(cm, from, to, fromLine, toLine) { walk(from) if (from == to) break from = from.nextSibling + extraLinebreak = false } return text }
Reset extralinebreak between nodes
codemirror_CodeMirror
train
js
e77eb9f80ff507d4426e7c7983b4acdc679fa588
diff --git a/internal/shareable/shareable_test.go b/internal/shareable/shareable_test.go index <HASH>..<HASH> 100644 --- a/internal/shareable/shareable_test.go +++ b/internal/shareable/shareable_test.go @@ -42,7 +42,8 @@ func TestMain(m *testing.M) { const bigSize = 2049 -func TestEnsureNotShared(t *testing.T) { +// Temporary disabled per #575. +func Disabled_TestEnsureNotShared(t *testing.T) { // Create img1 and img2 with this size so that the next images are allocated // with non-upper-left location. img1 := NewImage(bigSize, 100)
shareable: Temporary disable tests (#<I>)
hajimehoshi_ebiten
train
go
bfbe13c5300aefbf23b3423ce5dc3828a36a20e2
diff --git a/tests/UserAgentParserEnhancedTest.php b/tests/UserAgentParserEnhancedTest.php index <HASH>..<HASH> 100644 --- a/tests/UserAgentParserEnhancedTest.php +++ b/tests/UserAgentParserEnhancedTest.php @@ -5,6 +5,7 @@ require_once 'DevicesDetection/UserAgentParserEnhanced/UserAgentParserEnhanced.p class UserAgentParserEnhancedTest extends PHPUnit_Framework_TestCase { /** + * @group Plugins * @dataProvider getUserAgents_asParsed */ public function testParse($expected)
Cleaning up @group comments on tests to keep only 4 groups: Core, Integration, Plugins and UI
matomo-org_device-detector
train
php
97ea107443b0fd1efaef86898c744aed230d0b12
diff --git a/lib/nestive/layout_helper.rb b/lib/nestive/layout_helper.rb index <HASH>..<HASH> 100644 --- a/lib/nestive/layout_helper.rb +++ b/lib/nestive/layout_helper.rb @@ -237,8 +237,8 @@ module Nestive # @todo is `html_safe` "safe" here? def render_area(name) [].tap do |output| - @_area_for.fetch(name, []).reverse_each do |i| - output.send i.first, i.last + @_area_for.fetch(name, []).reverse_each do |method_name, content| + output.public_send method_name, content end end.join.html_safe end
A bit of codestyle goodness for a private method
rwz_nestive
train
rb
e574a8bf5ff5ec398eacf6d1068be11f33d4dfa2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -169,7 +169,6 @@ def runSetup(): 'console_scripts': [ 'toil = toil.utils.toilMain:main', '_toil_worker = toil.worker:main', - 'cwltoil = toil.cwl.cwltoil:main [cwl]', 'toil-cwl-runner = toil.cwl.cwltoil:main [cwl]', 'toil-wdl-runner = toil.wdl.toilwdl:main', '_toil_mesos_executor = toil.batchSystems.mesos.executor:main [mesos]',
Drop the long-deprecated cwltoil (#<I>) Same entry point is provided by `toil-cwl-runner`
DataBiosphere_toil
train
py
6d1f9160d487b3265f6e9d65ebb357837a437c30
diff --git a/parsl/providers/provider_base.py b/parsl/providers/provider_base.py index <HASH>..<HASH> 100644 --- a/parsl/providers/provider_base.py +++ b/parsl/providers/provider_base.py @@ -29,7 +29,15 @@ class JobState(bytes, Enum): class JobStatus(object): - """Encapsulates a job state together with other details, presently a (error) message""" + """Encapsulates a job state together with other details: + + Args: + state: The machine-reachable state of the job this status refers to + message: Optional human readable message + exit_code: Optional exit code + stdout_path: Optional path to a file containing the job's stdout + stderr_path: Optional path to a file containing the job's stderr + """ SUMMARY_TRUNCATION_THRESHOLD = 2048 def __init__(self, state: JobState, message: Optional[str] = None, exit_code: Optional[int] = None,
Elaborate JobStatus docstring to include stdout/err/state info (#<I>)
Parsl_parsl
train
py
5b26e810f2cc0ebb652edfc486c4fce40e27b6d2
diff --git a/tests/test_connections.py b/tests/test_connections.py index <HASH>..<HASH> 100644 --- a/tests/test_connections.py +++ b/tests/test_connections.py @@ -1,6 +1,6 @@ from dingus import Dingus -from nydus.db import Cluster +from nydus.db import Cluster, create_cluster from nydus.db.routers import BaseRouter from nydus.db.backends import BaseConnection @@ -22,12 +22,21 @@ class DummyRouter(BaseRouter): return [0] class ClusterTest(BaseTest): + def test_create_cluster(self): + c = create_cluster({ + 'engine': DummyConnection, + 'router': DummyRouter, + 'hosts': { + 0: {'resp': 'bar'}, + } + }) + self.assertEquals(len(c), 1) + def test_init(self): c = Cluster( hosts={0: BaseConnection(num=1)}, ) self.assertEquals(len(c), 1) - self.assertTrue(c.redis) def test_proxy(self): c = DummyConnection(num=1, resp='bar')
Added tests for create_cluster
disqus_nydus
train
py
aee439447a3ea556a8fdbf5b2a66a22ea16902e8
diff --git a/lib/pith/server.rb b/lib/pith/server.rb index <HASH>..<HASH> 100644 --- a/lib/pith/server.rb +++ b/lib/pith/server.rb @@ -12,6 +12,7 @@ module Pith use Rack::Lint use Pith::Server::AutoBuild, project use Adsf::Rack::IndexFileFinder, :root => project.output_dir + use Pith::Server::DefaultToHtml, project.output_dir run Rack::Directory.new(project.output_dir) end end @@ -21,7 +22,7 @@ module Pith end extend self - + class AutoBuild def initialize(app, project) @@ -36,6 +37,29 @@ module Pith end + class DefaultToHtml + + def initialize(app, root) + @app = app + @root = root + end + + def call(env) + + path_info = ::Rack::Utils.unescape(env["PATH_INFO"]) + file = "#{@root}#{path_info}" + unless File.exist?(file) + if File.exist?("#{file}.html") + env["PATH_INFO"] += ".html" + end + end + + @app.call(env) + + end + + end + end end
Magically append missing ".html" extension to requests. (dumb-ass broken impl of content negotiation)
mdub_pith
train
rb
0405ed4c237936e5a45ee61ec3722649db26a28c
diff --git a/h2o-py/h2o/frame.py b/h2o-py/h2o/frame.py index <HASH>..<HASH> 100644 --- a/h2o-py/h2o/frame.py +++ b/h2o-py/h2o/frame.py @@ -664,7 +664,7 @@ class H2OVec: # whole vec replacement self._len_check(b) # lazy update in-place of the whole vec - self._expr = Expr("=", Expr("[", self._expr, b), Expr(c)) + self._expr = Expr("=", Expr("[", self._expr, b), None if c is None else Expr(c)) else: raise NotImplementedError("Only vector replacement is currently supported.")
handle assign null over 0 ... as well as assign 0 over null
h2oai_h2o-3
train
py
146f9c9f82601be83f3fef230dd1bde0b98abbc1
diff --git a/client/json-socket-connection.js b/client/json-socket-connection.js index <HASH>..<HASH> 100644 --- a/client/json-socket-connection.js +++ b/client/json-socket-connection.js @@ -18,7 +18,7 @@ var JSONSocketConnection = W.Object.extend({ W.extend(this, W.eventMixin); this.socketUrl = options.socketUrl; this._connectionDesired = false; - this.attemptReconnectionAfterMS = (typeof attemptReconnectionAfterMS !== 'undefined') ? options.attemptReconnectionAfterMS : 1000; + this.attemptReconnectionAfterMS = (typeof options.attemptReconnectionAfterMS !== 'undefined') ? options.attemptReconnectionAfterMS : 1000; }, openSocketConnection : function () { this._connectionDesired = true;
Fixed JSONSocketConnection attemptReconnectionAfterMS undefined condition
theworkers_W.js
train
js
6cd6b921ac57480d95af8b9bec2424e1f89fa196
diff --git a/crypto/crypto.go b/crypto/crypto.go index <HASH>..<HASH> 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -97,6 +97,16 @@ func toECDSA(d []byte, strict bool) (*ecdsa.PrivateKey, error) { return nil, fmt.Errorf("invalid length, need %d bits", priv.Params().BitSize) } priv.D = new(big.Int).SetBytes(d) + + // The priv.D must < N + if priv.D.Cmp(secp256k1_N) >= 0 { + return nil, fmt.Errorf("invalid private key, >=N") + } + // The priv.D must not be zero or negative. + if priv.D.Sign() <= 0 { + return nil, fmt.Errorf("invalid private key, zero or negative") + } + priv.PublicKey.X, priv.PublicKey.Y = priv.PublicKey.Curve.ScalarBaseMult(d) if priv.PublicKey.X == nil { return nil, errors.New("invalid private key")
crypto: ensure private keys are < N (#<I>) Fixes #<I>
ethereum_go-ethereum
train
go
a49e50d04da00b107c08290575a9b80f2eaf5b75
diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index <HASH>..<HASH> 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -43,7 +43,7 @@ class TelegramClient: # Current TelegramClient version __version__ = '0.8' - # region Initialization + # region Default methods of class def __init__(self, session, api_id, api_hash, proxy=None): """Initializes the Telegram client with the specified API ID and Hash. @@ -82,6 +82,10 @@ class TelegramClient: # We need to be signed in before we can listen for updates self.signed_in = False + def __del__(self): + """Releases the Telegram client, performing disconnection.""" + self.disconnect() + # endregion # region Connecting
TelegramClient: Perform disconnection on class destruction (#<I>)
LonamiWebs_Telethon
train
py
de1ea67656514e2c5e0dd40b1ddbeff6db76cace
diff --git a/tools/src/main/resources/templates/java/AppTest.java b/tools/src/main/resources/templates/java/AppTest.java index <HASH>..<HASH> 100644 --- a/tools/src/main/resources/templates/java/AppTest.java +++ b/tools/src/main/resources/templates/java/AppTest.java @@ -1,3 +1,4 @@ +import com.jetdrone.vertx.yoke.Yoke; import com.jetdrone.vertx.yoke.Middleware; import com.jetdrone.vertx.yoke.middleware.YokeRequest; import com.jetdrone.vertx.yoke.test.Response; @@ -12,7 +13,7 @@ public class AppTest extends TestVerticle { @Test public void testApp() { - final YokeTester yoke = new YokeTester(this); + final Yoke yoke = new Yoke(this); yoke.use(new Middleware() { @Override public void handle(YokeRequest request, Handler<Object> next) { @@ -21,7 +22,9 @@ public class AppTest extends TestVerticle { } }); - yoke.request("GET", "/", new Handler<Response>() { + final YokeTester yokeAssert = new YokeTester(vertx, yoke); + + yokeAssert.request("GET", "/", new Handler<Response>() { @Override public void handle(Response response) { assertEquals("OK", response.body.toString());
port yoketester to work with other languages than just java
pmlopes_yoke
train
java
3e52c02e11e6b1e520f90ffe9e2a855253d9370b
diff --git a/src/Template/GoTemplateParser.php b/src/Template/GoTemplateParser.php index <HASH>..<HASH> 100644 --- a/src/Template/GoTemplateParser.php +++ b/src/Template/GoTemplateParser.php @@ -107,7 +107,7 @@ $reader->setHandler(new class ($rootNode, $this->directiveBag) implements HtmlCallback { - private $html5EmptyTags = ["img", "meta", "br", "hr", "input"]; // Tags to treat as empty although they're not + private $html5EmptyTags = ["img", "meta", "br", "hr", "input", "link"]; // Tags to treat as empty although they're not /** * @var GoNode
Added link element to empty tag list
dermatthes_html-template
train
php
8eab5b1d358469e06f7993417c5031471a3d07a9
diff --git a/dallinger/bots.py b/dallinger/bots.py index <HASH>..<HASH> 100644 --- a/dallinger/bots.py +++ b/dallinger/bots.py @@ -116,7 +116,9 @@ class BotBase(object): self.driver.get(self.URL) logger.info("Loaded ad page.") begin = WebDriverWait(self.driver, 10).until( - EC.element_to_be_clickable((By.CLASS_NAME, "btn-primary")) + EC.element_to_be_clickable( + (By.CSS_SELECTOR, "button.btn-primary, button.btn-success") + ) ) begin.click() logger.info("Clicked begin experiment button.") diff --git a/dallinger/recruiters.py b/dallinger/recruiters.py index <HASH>..<HASH> 100644 --- a/dallinger/recruiters.py +++ b/dallinger/recruiters.py @@ -940,7 +940,7 @@ class BotRecruiter(Recruiter): url = "{}/ad?{}".format(base_url, ad_parameters) urls.append(url) bot = factory(url, assignment_id=assignment, worker_id=worker, hit_id=hit) - job = q.enqueue(bot.run_experiment, timeout=self._timeout) + job = q.enqueue(bot.run_experiment, job_timeout=self._timeout) logger.warning("Created job {} for url {}.".format(job.id, url)) return urls
Fix selenium bot test issues. Not sure why these tests only failed on the recruiter branch.
Dallinger_Dallinger
train
py,py
ea959340e62148ca67efd62f80be71281ab66621
diff --git a/resources/assets/js/files.attachments.app.js b/resources/assets/js/files.attachments.app.js index <HASH>..<HASH> 100644 --- a/resources/assets/js/files.attachments.app.js +++ b/resources/assets/js/files.attachments.app.js @@ -108,6 +108,8 @@ Files.Attachments.App = new Class({ if (copy.file.thumbnail) { that.preview.getElement('img').set('src', Files.sitebase + '/' + that.encodePath(copy.file.thumbnail.relative_path)).show(); + } else if (copy.file.type == 'image') { + that.preview.getElement('img').set('src', that.createRoute({view: 'file', format: 'html', name: encodeURIComponent(copy.file.name), routed: 1})); } that.grid.selected = row.name;
#<I> Set image source if no thumbnail is set
joomlatools_joomlatools-framework
train
js
1c39b5b1cfb6fcfba1b47bf951cb625bc960be7a
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -39,7 +39,8 @@ class PublicationServer { authorization: this._authFn, pathname: this._mountPath, parser: 'EJSON', - transformer: 'uws' + transformer: 'uws', + pingInterval: false }); this._primus.on('connection', (spark) => { @@ -89,4 +90,4 @@ class PublicationServer { } } -module.exports = PublicationServer; \ No newline at end of file +module.exports = PublicationServer;
Remove the pingInterval Since we don't use the timeout strategy in the publication-client, we can remove the pingInterval in favor of our own ping/pong implementations.
mixmaxhq_publication-server
train
js
0f12428f72f5672cac86f6af9a2b5143c8de6051
diff --git a/holoviews/core/layout.py b/holoviews/core/layout.py index <HASH>..<HASH> 100644 --- a/holoviews/core/layout.py +++ b/holoviews/core/layout.py @@ -277,6 +277,11 @@ class LayoutTree(AttrTree, LabelledData): return self + def select(self, **selections): + return self.clone([(path, item.select(**selections)) + for path, item in self.items()]) + + def __getitem__(self, key): if isinstance(key, int): if key < len(self):
Added select method to elements on LayoutTree
pyviz_holoviews
train
py
f822e083005291b52c46ec44fac76d44daa358b2
diff --git a/lib/licensed/sources/bundler.rb b/lib/licensed/sources/bundler.rb index <HASH>..<HASH> 100644 --- a/lib/licensed/sources/bundler.rb +++ b/lib/licensed/sources/bundler.rb @@ -60,7 +60,7 @@ module Licensed Dependency.new( name: spec.name, version: spec.version.to_s, - path: spec.gem_dir, + path: spec.full_gem_path, loaded_from: spec.loaded_from, errors: Array(error), metadata: {
use full_gem_path I found an issue during debugging the spec_root method where specs from git sources may report gem_dir incorrectly. full_gem_path didn't seem to suffer from the same problem
github_licensed
train
rb
378ecdccc0756aef3877fc96978d84af0e0c3592
diff --git a/github_fork_repos.py b/github_fork_repos.py index <HASH>..<HASH> 100755 --- a/github_fork_repos.py +++ b/github_fork_repos.py @@ -1,4 +1,4 @@ -#!/bin/env python +#!/usr/bin/env python """ Fork github repos @@ -12,14 +12,14 @@ from github3 import login from getpass import getuser import os import sys -import time +from time import sleep token = '' debug = os.getenv("DM_SQUARE_DEBUG") user = getuser() if debug: - print user + print 'You are', user # I have cut and pasted code # I am a bad person @@ -52,9 +52,11 @@ for repo in repos: print repo.name forked_repo = repo.create_fork(user+'-shadow') - forked_name = forked_repo.name + sleep(2) + + # forked_name = forked_repo.name # Trap previous fork with dm_ prefix - if not forked_name.startswith("dm_"): - newname = "dm_" + forked_name - forked_repo.edit(newname) + #if not forked_name.startswith("dm_"): + # newname = "dm_" + forked_name + # forked_repo.edit(newname)
Take out the rename code for now
lsst-sqre_sqre-codekit
train
py
ab89a5192a20802799769ce0cc5b4bda15e888e0
diff --git a/tests/Unit/Websocket/ApplicationTest.php b/tests/Unit/Websocket/ApplicationTest.php index <HASH>..<HASH> 100644 --- a/tests/Unit/Websocket/ApplicationTest.php +++ b/tests/Unit/Websocket/ApplicationTest.php @@ -21,7 +21,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase $app['sandstone.websocket.router'] = function () { $wrongTopic = new WrongTopic('my-topic'); - $topicRouterMock = $this->createMock(TopicRouter::class); + $topicRouterMock = $this->getMockBuilder(TopicRouter::class)->disableOriginalConstructor()->getMock(); $topicRouterMock ->method('loadTopic') @@ -31,8 +31,10 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase return $topicRouterMock; }; - $this->expectException(\LogicException::class); - $this->expectExceptionMessage('WrongTopic seems to implements the wrong EventSubscriberInterface'); + $this->setExpectedExceptionRegExp( + \LogicException::class, + '/WrongTopic seems to implements the wrong EventSubscriberInterface/' + ); $method->invokeArgs($websocketApp, ['my-topic']); }
Fix incompatibility with php <I> in tests
eole-io_sandstone
train
php
faefa7cb25645c58e8fe97c8d0644cc90014104b
diff --git a/test/repo.js b/test/repo.js index <HASH>..<HASH> 100644 --- a/test/repo.js +++ b/test/repo.js @@ -11,7 +11,7 @@ exports.open = function(test){ test.expect(2); // Test invalid repository - git.Repo.open('/etc/hosts', function(error, repository) { + git.Repo.open('/private/etc/hosts', function(error, repository) { test.equals(error.message, "The `.git` file at '/private/etc/hosts' is malformed"); // Test valid repository
fixed broken test on linux: /etc/hosts -> /private/etc/hosts
nodegit_nodegit
train
js
09ebbaf32c9d5ff8c0db5f450dfbdd7b57408da1
diff --git a/lib/search-index/index.js b/lib/search-index/index.js index <HASH>..<HASH> 100644 --- a/lib/search-index/index.js +++ b/lib/search-index/index.js @@ -217,7 +217,7 @@ function indexDoc(docID, doc, facets, indexMetaDataGlobal, callback) { if( Object.prototype.toString.call(doc[fieldKey]) === '[object Array]' ) { value['fields'][fieldKey] = doc[fieldKey]; } else { - value['fields'][fieldKey] = doc[fieldKey].substring(0, maxStringFieldLength); + value['fields'][fieldKey] = doc[fieldKey].toString().substring(0, maxStringFieldLength); } }
Convert integers to strings before using substring
fergiemcdowall_search-index
train
js
29597da130b44cff78ad630212694f8e3ef0c573
diff --git a/utils.js b/utils.js index <HASH>..<HASH> 100644 --- a/utils.js +++ b/utils.js @@ -233,7 +233,7 @@ Utils.makeRoutes = function(baseRoute, file, options) { // and pass the subsequent URL on as a "query" parameter if (/^html?$/.test(ext) && ("template" === file.name)) { route = route.split("/").slice(0, -1).join("/"); - return [route + "/:query"]; + return [route + "/:$slug"]; } // Add file and default extension
utils#makeRoutes: changes "query" to "$slug" This is part of effort to differentiate special variables
shippjs_shipp-server
train
js
4dd651abe2deeb5b574eb445ff041aaf43e7737b
diff --git a/OpenPNM/Network/__init__.py b/OpenPNM/Network/__init__.py index <HASH>..<HASH> 100644 --- a/OpenPNM/Network/__init__.py +++ b/OpenPNM/Network/__init__.py @@ -40,4 +40,3 @@ from .__MatFile__ import MatFile from .__TestNet__ import TestNet from .__Empty__ import Empty from . import models - diff --git a/OpenPNM/Utilities/__init__.py b/OpenPNM/Utilities/__init__.py index <HASH>..<HASH> 100644 --- a/OpenPNM/Utilities/__init__.py +++ b/OpenPNM/Utilities/__init__.py @@ -13,4 +13,4 @@ r""" from . import IO from . import misc from . import vertexops -from .__topology__ import topology \ No newline at end of file +from .__topology__ import topology
2 pep8 fixes (it seems my local pytest does not check for pep8)
PMEAL_OpenPNM
train
py,py
66278598a90de716a5940a8f05f0708650cf8c24
diff --git a/syn/base_utils/tests/test_dict.py b/syn/base_utils/tests/test_dict.py index <HASH>..<HASH> 100644 --- a/syn/base_utils/tests/test_dict.py +++ b/syn/base_utils/tests/test_dict.py @@ -107,7 +107,6 @@ def test_reflexivedict(): #------------------------------------------------------------------------------- # SeqDict - def test_seqdict(): dct = SeqDict(a = [1, 2], b = (10, 11)) @@ -116,9 +115,11 @@ def test_seqdict(): assert dct.b == (10, 11) dct.update(dict(a = (3, 4), - b = [12, 13])) + b = [12, 13], + c = [20])) assert dct.a == [1, 2, 3, 4] assert dct.b == (10, 11, 12, 13) + assert dct.c == [20] #-------------------------------------------------------------------------------
Completing SeqDict test coverage
mbodenhamer_syn
train
py
6569e097a15fd1bf0a7ae04b346ec1be23743687
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ except ImportError: from setuptools import setup setup( - setup_requires=['d2to1>=0.2.5', 'stsci.distutils>=0.2.2dev'], + setup_requires=['d2to1>=0.2.5', 'stsci.distutils>=0.3dev'], namespace_packages=['stsci'], packages=['stsci'], d2to1=True, use_2to3=True,
Bumped the development version of stscil.distutils since it contains significant API changes. Also bumped the version requirement on the sample stsci.tools and acstools packages. git-svn-id: <URL>
spacetelescope_stsci.tools
train
py
ce4f71ff7e52791a4b508c5d26d55307643cbf97
diff --git a/components/api/src/main/java/org/openengsb/core/api/model/OpenEngSBModel.java b/components/api/src/main/java/org/openengsb/core/api/model/OpenEngSBModel.java index <HASH>..<HASH> 100644 --- a/components/api/src/main/java/org/openengsb/core/api/model/OpenEngSBModel.java +++ b/components/api/src/main/java/org/openengsb/core/api/model/OpenEngSBModel.java @@ -17,6 +17,7 @@ package org.openengsb.core.api.model; +import java.io.Serializable; import java.util.List; /** @@ -24,7 +25,7 @@ import java.util.List; * use one model for all kinds of domain model data. Every domain model marked with the Model interface get this * interface injected. */ -public interface OpenEngSBModel { +public interface OpenEngSBModel extends Serializable { /** * Returns a list of OpenEngSBModelEntries. The list contains all data fields which are used by the specific domain.
[OPENENGSB-<I>] made OpenEngSBModel interface extend Serializable
openengsb_openengsb
train
java
d1c490204820769b6d20c7eec4435a806ad07810
diff --git a/zipline/lines.py b/zipline/lines.py index <HASH>..<HASH> 100644 --- a/zipline/lines.py +++ b/zipline/lines.py @@ -83,11 +83,6 @@ import zipline.protocol as zp log = Logger('Lines') -class CancelSignal(Exception): - def __init__(self): - pass - - class SimulatedTrading(object): def __init__(self, @@ -184,12 +179,7 @@ class SimulatedTrading(object): os.kill(ppid, SIGINT) def handle_exception(self, exc): - if isinstance(exc, CancelSignal): - # signal from monitor of an orderly shutdown, - # do nothing. - pass - else: - self.signal_exception(exc) + self.signal_exception(exc) def signal_exception(self, exc=None): """
Removes unused CancelSignal. This was only triggered by the now removed Monitor.
quantopian_zipline
train
py
948c327bae0b2fbef93e1e9a9bbf2b5c5e6e850f
diff --git a/thermo/stream.py b/thermo/stream.py index <HASH>..<HASH> 100644 --- a/thermo/stream.py +++ b/thermo/stream.py @@ -866,25 +866,29 @@ class Stream(Mixture): # flow_spec, composition_spec are attributes already @property def specified_composition_vars(self): + '''number of composition variables''' return 1 @property def composition_specified(self): - # Always needs a composition + '''Always needs a composition''' return True @property def specified_state_vars(self): - # Always needs two + '''Always needs two states''' return 2 @property def state_specified(self): - # Always needs a state + '''Always needs a state''' return True @property def state_specs(self): + '''Returns a list of tuples of (state_variable, state_value) representing + the thermodynamic state of the system. + ''' specs = [] for i, var in enumerate(('T', 'P', 'VF', 'Hm', 'H', 'Sm', 'S', 'energy')): v = self.specs[i] @@ -894,12 +898,12 @@ class Stream(Mixture): @property def specified_flow_vars(self): - # Always needs only one flow specified + '''Always needs only one flow specified''' return 1 @property def flow_specified(self): - # Always needs a flow specified + '''Always needs a flow specified''' return True
Add a few docstrings
CalebBell_thermo
train
py
f83f0cab9966fd4b562d26906684cfe5628a81ea
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -634,8 +634,12 @@ Driver.prototype.identityPublishStatus = function () { }) status.ever = !!unchained.length - status.current = unchained.some(function (e) { - return e[CUR_HASH] === curHash + unchained.some(function (e) { + if (e[CUR_HASH] === curHash) { + status.txId = e.txId + status.current = true + return true + } }) status.queued = !status.current && entries.some(function (e) { diff --git a/test/end-to-end.js b/test/end-to-end.js index <HASH>..<HASH> 100644 --- a/test/end-to-end.js +++ b/test/end-to-end.js @@ -570,6 +570,7 @@ test('the reader and the writer', function (t) { .then(function (status) { t.ok(status.ever) t.ok(status.current) + t.ok(status.txId) return reader.send({ chain: false, deliver: true,
add txId to identity publish status
tradle_tim-old-engine
train
js,js
1ef865cc00d55116c4027d759a72c7c2f57a1a3b
diff --git a/src/runner.js b/src/runner.js index <HASH>..<HASH> 100644 --- a/src/runner.js +++ b/src/runner.js @@ -16,23 +16,24 @@ var regexLog = /^\[([^\]]*)\]\(([^\)]*) ([^\)]*)\):([^\n]*)/gm; function Runner () { Emitter.call(this); + this.initialize(); +} +// Extend Event.Emitter. +util.inherits(Runner, Emitter); + +Runner.prototype.initialize = function () { this.uuid = uuid(); this.folder = path.join(__dirname, './bots/files/', this.uuid); this.captures = path.join(this.folder, 'captures'); this.log = path.join(this.folder, 'log.txt'); this.cookie = path.join(this.folder, 'cookies.txt'); - this.logs = {}; - this.tasks = {}; this.children = {}; this.createFiles(); this.bindings(); -} - -// Extend Event.Emitter. -util.inherits(Runner, Emitter); +}; Runner.prototype.createFiles = function createFiles () { // Create its captures folder.
feat: add an initialize function to the runner
damonjs_damon
train
js
14369b65176f234c9cbf7a2896a613ac256e3719
diff --git a/lib/resilient/circuit_breaker.rb b/lib/resilient/circuit_breaker.rb index <HASH>..<HASH> 100644 --- a/lib/resilient/circuit_breaker.rb +++ b/lib/resilient/circuit_breaker.rb @@ -38,12 +38,14 @@ module Resilient else @metrics.mark_success end + nil } end def mark_failure instrument("resilient.circuit_breaker.mark_failure") { |payload| @metrics.mark_failure + nil } end diff --git a/test/support/circuit_breaker_interface_test.rb b/test/support/circuit_breaker_interface_test.rb index <HASH>..<HASH> 100644 --- a/test/support/circuit_breaker_interface_test.rb +++ b/test/support/circuit_breaker_interface_test.rb @@ -7,10 +7,18 @@ module CircuitBreakerInterfaceTest assert_respond_to @object, :mark_success end + def test_mark_success_returns_nothing + assert_nil @object.mark_success + end + def test_responds_to_mark_failure assert_respond_to @object, :mark_failure end + def test_mark_failure_returns_nothing + assert_nil @object.mark_failure + end + def test_responds_to_reset assert_respond_to @object, :reset end
Ensure circuit breaker mark success/failure return nothing
jnunemaker_resilient
train
rb,rb
a81613070cebd545043cdeab97e9000ecaaae1a7
diff --git a/lib/reporters/html.js b/lib/reporters/html.js index <HASH>..<HASH> 100644 --- a/lib/reporters/html.js +++ b/lib/reporters/html.js @@ -181,7 +181,7 @@ function HTML(runner, options) { if (indexOfMessage === -1) { stackString = test.err.stack; } else { - stackString = test.err.stack.substr( + stackString = test.err.stack.slice( test.err.message.length + indexOfMessage ); }
refactor: replace deprecated 'String.prototype.substr()' (#<I>) 'substr()' is deprecated, so we replace it with 'slice()' which works similarily.
mochajs_mocha
train
js
da9720b4b32dc8be7eb9925d78217504e94b6651
diff --git a/lib/rest-core/promise.rb b/lib/rest-core/promise.rb index <HASH>..<HASH> 100644 --- a/lib/rest-core/promise.rb +++ b/lib/rest-core/promise.rb @@ -167,7 +167,7 @@ class RestCore::Promise begin rejecting(e) rescue Exception => f # log user callback error - callback_error(f) + callback_error(f, true) end end end @@ -196,8 +196,9 @@ class RestCore::Promise end # log user callback error - def callback_error e + def callback_error e, set_backtrace=false never_raise_yield do + self.class.set_backtrace(e) if set_backtrace if env[CLIENT].error_callback env[CLIENT].error_callback.call(e) else
should set_backtrace for callback error from rejecting
godfat_rest-core
train
rb
d20ed9b85058224780f00173511d054b50c0575a
diff --git a/src/Hodor/JobQueue/Config.php b/src/Hodor/JobQueue/Config.php index <HASH>..<HASH> 100644 --- a/src/Hodor/JobQueue/Config.php +++ b/src/Hodor/JobQueue/Config.php @@ -213,21 +213,20 @@ class Config implements ConfigInterface } $config = array_merge( - $this->getOption('queue_defaults', [ + [ 'host' => null, 'port' => 5672, 'username' => null, 'password' => null, - 'queue_prefix' => 'hodor-' - ]), - $this->getOption($queue_type_keys['defaults_key'], []) + 'queue_prefix' => 'hodor-', + ], + $this->getOption('queue_defaults', []), + $this->getOption($queue_type_keys['defaults_key'], []), + $queues[$queue_name] ); $config = array_merge( $config, - [ - 'queue_name' => "{$config['queue_prefix']}{$queue_name}", - ], - $queues[$queue_name] + ['queue_name' => "{$config['queue_prefix']}{$queue_name}"] ); $config['key_name'] = $queue_name; $config['fetch_count'] = 1;
Update the way queue configs are merged - Default any/all of host, port, username, and password rather than it being all or nothing - Always append the queue prefix to the queue name, even if the queue prefix is defined at the queue level
lightster_hodor
train
php
f6bb815b36224b4acc089879a538e7d79b5a719b
diff --git a/metrics-core/src/test/java/com/codahale/metrics/InstrumentedThreadFactoryTest.java b/metrics-core/src/test/java/com/codahale/metrics/InstrumentedThreadFactoryTest.java index <HASH>..<HASH> 100644 --- a/metrics-core/src/test/java/com/codahale/metrics/InstrumentedThreadFactoryTest.java +++ b/metrics-core/src/test/java/com/codahale/metrics/InstrumentedThreadFactoryTest.java @@ -33,7 +33,7 @@ public class InstrumentedThreadFactoryTest { // terminate all threads in the executor service. executor.shutdown(); - assertThat(executor.awaitTermination(1, TimeUnit.SECONDS)).isTrue(); + assertThat(executor.awaitTermination(2, TimeUnit.SECONDS)).isTrue(); // assert that all threads from the factory have been terminated. assertThat(terminated.getCount()).isEqualTo(10);
Provide a slightly longer wait for thread termination
dropwizard_metrics
train
java
3d5fd35c23547a0453772580f4c0710eb8f5c6ea
diff --git a/tests/spec/container-spec.js b/tests/spec/container-spec.js index <HASH>..<HASH> 100644 --- a/tests/spec/container-spec.js +++ b/tests/spec/container-spec.js @@ -650,7 +650,7 @@ describe('F2.registerApps - xhr overrides', function() { }); F2.registerApps({ appId: 'com_test_app', - manifestUrl: 'http://127.0.0.1:8080/httpPostTest' + manifestUrl: 'http://openf2.herokuapp.com/httpPostTest' }); }); diff --git a/tests/spec/spec-helpers.js b/tests/spec/spec-helpers.js index <HASH>..<HASH> 100644 --- a/tests/spec/spec-helpers.js +++ b/tests/spec/spec-helpers.js @@ -1,4 +1,4 @@ -var TEST_MANIFEST_URL = 'http://docs.openf2.org/demos/apps/JavaScript/HelloWorld/manifest.js', +var TEST_MANIFEST_URL = 'http://openf2.herokuapp.com/helloworldapp', TEST_APP_ID = 'com_openf2_examples_javascript_helloworld', TEST_MANIFEST_URL2 = 'http://www.openf2.org/Examples/Apps', TEST_APP_ID2 = 'com_openf2_examples_csharp_marketnews'
Fixed CORS issue with tests, 2 outstanding issues
OpenF2_F2
train
js,js
bf4463d84090ba1e0303db8336dd47ee91ddc2f8
diff --git a/examples/ex5.rb b/examples/ex5.rb index <HASH>..<HASH> 100644 --- a/examples/ex5.rb +++ b/examples/ex5.rb @@ -1,5 +1,5 @@ (wav = WavIn.new("ex1.wav")) >> WavOut.new("ex5.wav") >> blackhole -play 0.5.seconds # silence +wav.stop; play 0.5.seconds # silence wav.play; play 1.second # play first second (r = Ramp.new(1.0, 2.0, 1.minute)) >> blackhole
Updated example to reflect API change: WavIn starts unpaused
alltom_ruck
train
rb
bf4501c1bd1afdef0e8ee475fc6b754aa8eca527
diff --git a/salt/master.py b/salt/master.py index <HASH>..<HASH> 100644 --- a/salt/master.py +++ b/salt/master.py @@ -667,8 +667,8 @@ class AESFuncs(object): mopts = dict(self.opts) file_roots = dict(mopts['file_roots']) envs = self._file_envs() - for env in file_roots: - if not env in envs: + for env in envs: + if not env in file_roots: file_roots[env] = [] mopts['file_roots'] = file_roots return mopts
Fix bug in environment gathering on the master
saltstack_salt
train
py
9f31581fd8bfcd14f553af1831f99e9922751de6
diff --git a/src/Symfony/Component/Notifier/Bridge/OvhCloud/OvhCloudTransport.php b/src/Symfony/Component/Notifier/Bridge/OvhCloud/OvhCloudTransport.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Notifier/Bridge/OvhCloud/OvhCloudTransport.php +++ b/src/Symfony/Component/Notifier/Bridge/OvhCloud/OvhCloudTransport.php @@ -100,8 +100,6 @@ final class OvhCloudTransport extends AbstractTransport $endpoint = sprintf('%s/auth/time', $this->getEndpoint()); $response = $this->client->request('GET', $endpoint); - $serverTimestamp = (int) (string) $response->getContent(); - - return $serverTimestamp - (int) time(); + return $response->getContent() - time(); } }
time ( void ) : int no need to cast
symfony_symfony
train
php
4c56c7bf0cd5f02d3fb765e48fe6665b3f8cc170
diff --git a/lib/cronlib.php b/lib/cronlib.php index <HASH>..<HASH> 100644 --- a/lib/cronlib.php +++ b/lib/cronlib.php @@ -32,6 +32,11 @@ function cron_run() { exit(1); } + if (moodle_needs_upgrading()) { + echo "Moodle upgrade pending, cron execution suspended.\n"; + exit(1); + } + require_once($CFG->libdir.'/adminlib.php'); require_once($CFG->libdir.'/gradelib.php');
MDL-<I> prevent cron execution when upgrade pending
moodle_moodle
train
php
a664125ea5f8898a4fd1b533ddb84709ac4003d1
diff --git a/src/rez/package_help.py b/src/rez/package_help.py index <HASH>..<HASH> 100644 --- a/src/rez/package_help.py +++ b/src/rez/package_help.py @@ -1,7 +1,9 @@ from rez.packages import iter_packages from rez.config import config +from rez.rex_bindings import VersionBinding from rez.util import AttrDictWrapper, ObjectStringFormatter, \ convert_old_command_expansions +from rez.system import system import subprocess import webbrowser import os.path @@ -54,7 +56,9 @@ class PackageHelp(object): base = variant.base root = variant.root - namespace = dict(base=base, root=root, config=config) + namespace = dict(base=base, root=root, config=config, + version=VersionBinding(package.version), + system=system) formatter = ObjectStringFormatter(AttrDictWrapper(namespace), expand='unchanged')
+ Add support for package version and system variables to the namespace expansion.
nerdvegas_rez
train
py
35be017b035942ec50cb38d620e734fb4786b333
diff --git a/lib/fog/vsphere/requests/compute/vm_clone.rb b/lib/fog/vsphere/requests/compute/vm_clone.rb index <HASH>..<HASH> 100644 --- a/lib/fog/vsphere/requests/compute/vm_clone.rb +++ b/lib/fog/vsphere/requests/compute/vm_clone.rb @@ -18,7 +18,7 @@ module Fog raise ArgumentError, "#{required_options.join(', ')} are required" unless options.has_key? param end # TODO This is ugly and needs to rethink mocks - unless ENV['FOG_MOCK'] + unless Fog.mock? raise ArgumentError, "#{options["datacenter"]} Doesn't Exist!" unless get_datacenter(options["datacenter"]) raise ArgumentError, "#{options["template_path"]} Doesn't Exist!" unless get_virtual_machine(options["template_path"], options["datacenter"]) end
[vsphere] Use Fog.mock? as the other providers Specs can set Fog.mock! without setting the env var
fog_fog
train
rb
72dde9c7c7946e075833e398621f5fa5aacbb8c1
diff --git a/src/main/java/com/pinterest/secor/common/SecorConfig.java b/src/main/java/com/pinterest/secor/common/SecorConfig.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/pinterest/secor/common/SecorConfig.java +++ b/src/main/java/com/pinterest/secor/common/SecorConfig.java @@ -204,7 +204,7 @@ public class SecorConfig { } public String getHivePrefix() { - return getString("secor.hive.prefix", ""); + return getString("secor.hive.prefix"); } public String getCompressionCodec() { @@ -235,11 +235,6 @@ public class SecorConfig { return mProperties.getString(name); } - private String getString(String name, String defaultValue) { - checkProperty(name); - return mProperties.getString(name, defaultValue); - } - private int getInt(String name) { checkProperty(name); return mProperties.getInt(name);
Cleaning up code based on review - need to specific config ; no defaults
pinterest_secor
train
java
b8f31b2cd67191f9b50aae31b19e59ff5e31c43b
diff --git a/core/API/Inconsistencies.php b/core/API/Inconsistencies.php index <HASH>..<HASH> 100644 --- a/core/API/Inconsistencies.php +++ b/core/API/Inconsistencies.php @@ -38,6 +38,8 @@ class Inconsistencies 'nb_visits_percentage', '/.*_evolution/', '/goal_.*_conversion_rate/', + '/step_.*_rate/', + '/funnel_.*_rate/', '/form_.*_rate/', '/field_.*_rate/', );
Proceed rate in Goal Funnel report and row evolution of funnel is mismatching (#<I>) fix DEV-<I>
matomo-org_matomo
train
php
f0b52b87c94d4d80afe6330625fbdae7555a7d64
diff --git a/parsl/executors/high_throughput/interchange.py b/parsl/executors/high_throughput/interchange.py index <HASH>..<HASH> 100644 --- a/parsl/executors/high_throughput/interchange.py +++ b/parsl/executors/high_throughput/interchange.py @@ -81,8 +81,8 @@ class VersionMismatch(Exception): def __repr__(self): return "Manager version info {} does not match interchange version info {}, causing a critical failure".format( - self.interchange_version, - self.manager_version) + self.manager_version, + self.interchange_version) def __str__(self): return self.__repr__()
Fix incorrect order of manager and interchange versions in error text (#<I>)
Parsl_parsl
train
py
2b488da6e8d97ba46ee4c42ae9dbcdbff85ec2c2
diff --git a/responses.py b/responses.py index <HASH>..<HASH> 100644 --- a/responses.py +++ b/responses.py @@ -640,9 +640,15 @@ class RequestsMock(object): return _real_send(adapter, request, **kwargs) error_msg = ( - "Connection refused by Responses: {0} {1} doesn't " - "match Responses Mock".format(request.method, request.url) + "Connection refused by Responses - the call doesn't " + "match any registered mock.\n\n" + "Request: \n" + "- {0} {1}\n\n" + "Available matches:\n".format(request.method, request.url) ) + for m in self._matches: + error_msg += "- {} {}\n".format(m.method, m.url) + response = ConnectionError(error_msg) response.request = request
Improve ConnectionError message When a request doesn't match the responses mock the error message isn't very helpful. It tells you the request that was made which doesn't match any mock, but it doesn't show you what responses have been registered. This PR shows the request that has been made together with registered responses. It makes it easier to spot why a test is failing because you can compare the request with the mocks side by side. Prior output: ``` requests.exceptions.ConnectionError: Connection refused by Responses: GET <URL>
getsentry_responses
train
py
f856159e3d452549867d33d6ab0bc3dcea197e32
diff --git a/jenetics.ext/src/test/java/io/jenetics/ext/util/TreeTest.java b/jenetics.ext/src/test/java/io/jenetics/ext/util/TreeTest.java index <HASH>..<HASH> 100644 --- a/jenetics.ext/src/test/java/io/jenetics/ext/util/TreeTest.java +++ b/jenetics.ext/src/test/java/io/jenetics/ext/util/TreeTest.java @@ -143,7 +143,9 @@ public class TreeTest { @Test public void reduce() { - final Tree<String, ?> formula = TreeNode.parse("add(sub(6,div(230,10)),mul(5,6))"); + final Tree<String, ?> formula = TreeNode.parse( + "add(sub(6,div(230,10)),mul(5,6))" + ); final double result = formula.reduce(new Double[0], (op, args) -> switch (op) { case "add" -> args[0] + args[1];
#<I>: Improve `Tree::reduce` interface.
jenetics_jenetics
train
java
b3fc0b13e52dd467a5ae5c12cf5fa50f33c80847
diff --git a/src/Security/Security.php b/src/Security/Security.php index <HASH>..<HASH> 100644 --- a/src/Security/Security.php +++ b/src/Security/Security.php @@ -33,7 +33,7 @@ class Security */ protected function setTimezone() { - $parser = new TimezoneSetter(); - $parser->register(); + $setter = new TimezoneSetter(); + $setter->register(); } }
renamed the variable to be more descriptive
strata-mvc_strata
train
php
82e8bda9761e28f09ade2202843cacff011655e7
diff --git a/example/image-classification/symbols/vgg.py b/example/image-classification/symbols/vgg.py index <HASH>..<HASH> 100644 --- a/example/image-classification/symbols/vgg.py +++ b/example/image-classification/symbols/vgg.py @@ -6,7 +6,7 @@ large-scale image recognition." arXiv preprint arXiv:1409.1556 (2014). import mxnet as mx def get_symbol(num_classes, **kwargs): - ## define alexnet + ## define VGG11 data = mx.symbol.Variable(name="data") # group 1 conv1_1 = mx.symbol.Convolution(data=data, kernel=(3, 3), pad=(1, 1), num_filter=64, name="conv1_1")
Update vgg.py (#<I>)
apache_incubator-mxnet
train
py